Logo Search packages:      
Sourcecode: inkscape version File versions

static void sp_feTurbulence_set ( SPObject object,
unsigned int  key,
gchar const *  value 
) [static]

Sets a specific value in the SPFeTurbulence.

Definition at line 150 of file sp-feturbulence.cpp.

{
    SPFeTurbulence *feTurbulence = SP_FETURBULENCE(object);
    (void)feTurbulence;

    int read_int;
    double read_num;
    bool read_bool;
    NR::FilterTurbulenceType read_type;

    switch(key) {
      /*DEAL WITH SETTING ATTRIBUTES HERE*/

        case SP_ATTR_BASEFREQUENCY:
            feTurbulence->baseFrequency.set(value);
                //From SVG spec: If two <number>s are provided, the first number represents a base frequency in the X direction and the second value represents a base frequency in the Y direction. If one number is provided, then that value is used for both X and Y.
            if (feTurbulence->baseFrequency.optNumIsSet() == false)
                feTurbulence->baseFrequency.setOptNumber(feTurbulence->baseFrequency.getNumber());
            feTurbulence->updated = false;
            object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
            break;
        case SP_ATTR_NUMOCTAVES:
            read_int = (int) helperfns_read_number(value);
            if (read_int != feTurbulence->numOctaves){
                feTurbulence->numOctaves = read_int;
                feTurbulence->updated = false;
                object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
            }
            break;
        case SP_ATTR_SEED:
            read_num = helperfns_read_number(value);
            if (read_num != feTurbulence->seed){
                feTurbulence->seed = read_num;
                feTurbulence->updated = false;
                object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
            }
            break;
        case SP_ATTR_STITCHTILES:
            read_bool = sp_feTurbulence_read_stitchTiles(value);
            if (read_bool != feTurbulence->stitchTiles){
                feTurbulence->stitchTiles = read_bool;
                feTurbulence->updated = false;
                object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
            }
            break;
        case SP_ATTR_TYPE:
            read_type = sp_feTurbulence_read_type(value);
            if (read_type != feTurbulence->type){
                feTurbulence->type = read_type;
                feTurbulence->updated = false;
                object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
            }
            break;
        default:
            if (((SPObjectClass *) feTurbulence_parent_class)->set)
                ((SPObjectClass *) feTurbulence_parent_class)->set(object, key, value);
            break;
    }

}


Generated by  Doxygen 1.6.0   Back to index