Changeset 11164

Show
Ignore:
Timestamp:
03/05/10 13:55:08 (3 years ago)
Author:
robert
Message:

Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings.

Update wrappers to reflect these changes.

Location:
OpenSceneGraph/trunk
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/CullSettings

    r10838 r11164  
    8080 
    8181            NO_VARIABLES                            = 0x00000000, 
    82             ALL_VARIABLES                           = 0xFFFFFFFF 
    83         }; 
     82            ALL_VARIABLES                           = 0x7FFFFFFF 
     83        }; 
     84 
     85        typedef int InheritanceMask; 
    8486 
    8587        /** Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.*/ 
    86         void setInheritanceMask(unsigned int mask) { _inheritanceMask = mask; } 
     88        void setInheritanceMask(InheritanceMask mask) { _inheritanceMask = mask; } 
    8789 
    8890        /** Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.*/ 
    89         unsigned int getInheritanceMask() const { return _inheritanceMask; } 
     91        InheritanceMask getInheritanceMask() const { return _inheritanceMask; } 
    9092         
    9193        /** Set the local cull settings values from specified CullSettings object.*/ 
     
    191193        }; 
    192194         
    193         typedef unsigned int CullingMode; 
     195        typedef int CullingMode; 
    194196 
    195197        /** Set the culling mode for the CullVisitor to use.*/ 
     
    245247    protected: 
    246248 
    247         unsigned int                                _inheritanceMask; 
     249        InheritanceMask                             _inheritanceMask; 
    248250        InheritanceMaskActionOnAttributeSetting     _inheritanceMaskActionOnAttributeSetting; 
    249251 
  • OpenSceneGraph/trunk/include/osg/CullingSet

    r5328 r11164  
    121121        typedef std::vector<ShadowVolumeOccluder>   OccluderList; 
    122122 
    123         typedef unsigned int Mask; 
     123        typedef int Mask; 
    124124 
    125125        enum MaskValues 
     
    141141                                          SHADOW_OCCLUSION_CULLING 
    142142        }; 
    143          
     143 
    144144        void setCullingMask(Mask mask) { _mask = mask; } 
    145145        Mask getCullingMask() const { return _mask; } 
  • OpenSceneGraph/trunk/include/osgGA/GUIEventAdapter

    r10211 r11164  
    380380 
    381381        /// set current mouse button state. 
    382         void setButtonMask(unsigned int mask) { _buttonMask = mask; } 
     382        void setButtonMask(int mask) { _buttonMask = mask; } 
    383383 
    384384        /// get current mouse button state. 
    385         unsigned int getButtonMask() const { return _buttonMask; } 
     385        int getButtonMask() const { return _buttonMask; } 
    386386 
    387387        /// set modifier key mask. 
    388         void setModKeyMask(unsigned int mask) { _modKeyMask = mask; } 
     388        void setModKeyMask(int mask) { _modKeyMask = mask; } 
    389389 
    390390        /// get modifier key mask. 
    391         unsigned int getModKeyMask() const { return _modKeyMask; } 
     391        int getModKeyMask() const { return _modKeyMask; } 
    392392 
    393393        /// set scrolling motion (for EventType::SCROLL). 
     
    465465        float _mx; 
    466466        float _my; 
    467         unsigned int _buttonMask; 
    468         unsigned int _modKeyMask; 
     467        int _buttonMask; 
     468        int _modKeyMask; 
    469469        MouseYOrientation _mouseYOrientation; 
    470470 
  • OpenSceneGraph/trunk/include/osgPresentation/SlideEventHandler

    r10396 r11164  
    261261    void setLoopPresentation(bool loop) { _loopPresentation = loop; } 
    262262    bool getLoopPresentation() const { return _loopPresentation; } 
    263      
     263 
    264264    void dispatchEvent(const KeyPosition& keyPosition); 
    265  
    266     enum ObjectMask 
    267     { 
    268         MOVIE = 1<<0, 
    269         OBJECTS = 1<<1, 
    270         ALL_OBJECTS = MOVIE | OBJECTS 
    271     }; 
    272265 
    273266protected: 
  • OpenSceneGraph/trunk/include/osgSim/ObjectRecordData

    r9458 r11164  
    5353        META_Object( osgSim, ObjectRecordData ); 
    5454 
    55         enum Flags 
    56         { 
    57             DONT_DISPLAY_IN_DAYLIGHT = 0x80000000u >> 0, 
    58             DONT_DISPLAY_AT_DUSK     = 0x80000000u >> 1, 
    59             DONT_DISPLAY_AT_NIGHT    = 0x80000000u >> 2, 
    60             DONT_ILLUMINATE          = 0x80000000u >> 3, 
    61             FLAT_SHADED              = 0x80000000u >> 4, 
    62             GROUPS_SHADOW_OBJECT     = 0x80000000u >> 5 
    63         }; 
     55        static const unsigned int DONT_DISPLAY_IN_DAYLIGHT = 0x80000000u >> 0; 
     56        static const unsigned int DONT_DISPLAY_AT_DUSK     = 0x80000000u >> 1; 
     57        static const unsigned int DONT_DISPLAY_AT_NIGHT    = 0x80000000u >> 2; 
     58        static const unsigned int DONT_ILLUMINATE          = 0x80000000u >> 3; 
     59        static const unsigned int FLAT_SHADED              = 0x80000000u >> 4; 
     60        static const unsigned int GROUPS_SHADOW_OBJECT     = 0x80000000u >> 5; 
    6461 
    6562        unsigned int _flags; 
  • OpenSceneGraph/trunk/include/osgSim/SphereSegment

    r9409 r11164  
    195195    @see DrawMask 
    196196    */ 
    197     void setDrawMask(DrawMask dm); 
     197    void setDrawMask(int dm); 
    198198 
    199199    /** Get the DrawMask */ 
    200     DrawMask getDrawMask() const { return _drawMask; } 
     200    int getDrawMask() const { return _drawMask; } 
    201201 
    202202    /** Set the color of the surface. */ 
     
    306306 
    307307    // Draw details 
    308     DrawMask _drawMask; 
    309     osg::Vec4 _surfaceColor; 
    310     osg::Vec4 _spokeColor; 
    311     osg::Vec4 _edgeLineColor; 
    312     osg::Vec4 _planeColor; 
     308    int        _drawMask; 
     309    osg::Vec4   _surfaceColor; 
     310    osg::Vec4   _spokeColor; 
     311    osg::Vec4   _edgeLineColor; 
     312    osg::Vec4   _planeColor; 
    313313}; 
    314314 
  • OpenSceneGraph/trunk/include/osgUtil/ShaderGen

    r9940 r11164  
    3939    }; 
    4040 
    41     typedef std::map<unsigned int, osg::ref_ptr<osg::StateSet> > StateSetMap; 
     41    typedef std::map<int, osg::ref_ptr<osg::StateSet> > StateSetMap; 
    4242 
    4343    ShaderGenCache() {}; 
    4444 
    45     void setStateSet(unsigned int stateMask, osg::StateSet *program); 
    46     osg::StateSet *getStateSet(unsigned int stateMask) const; 
    47     osg::StateSet *getOrCreateStateSet(unsigned int stateMask); 
     45    void setStateSet(int stateMask, osg::StateSet *program); 
     46    osg::StateSet *getStateSet(int stateMask) const; 
     47    osg::StateSet *getOrCreateStateSet(int stateMask); 
    4848 
    4949protected: 
    50     osg::StateSet *createStateSet(unsigned int stateMask) const; 
     50    osg::StateSet *createStateSet(int stateMask) const; 
    5151    mutable OpenThreads::Mutex _mutex; 
    5252    StateSetMap _stateSetMap; 
  • OpenSceneGraph/trunk/src/osgSim/SphereSegment.cpp

    r10658 r11164  
    875875} 
    876876 
    877 void SphereSegment::setDrawMask(DrawMask dm) 
     877void SphereSegment::setDrawMask(int dm) 
    878878{ 
    879879    _drawMask=dm; 
  • OpenSceneGraph/trunk/src/osgUtil/ShaderGen.cpp

    r10768 r11164  
    8585} 
    8686 
    87 void ShaderGenCache::setStateSet(unsigned int stateMask, osg::StateSet *stateSet) 
     87void ShaderGenCache::setStateSet(int stateMask, osg::StateSet *stateSet) 
    8888{ 
    8989    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 
     
    9191} 
    9292 
    93 osg::StateSet *ShaderGenCache::getStateSet(unsigned int stateMask) const 
     93osg::StateSet *ShaderGenCache::getStateSet(int stateMask) const 
    9494{ 
    9595    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 
     
    9898} 
    9999 
    100 osg::StateSet *ShaderGenCache::getOrCreateStateSet(unsigned int stateMask) 
     100osg::StateSet *ShaderGenCache::getOrCreateStateSet(int stateMask) 
    101101{ 
    102102    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 
     
    111111} 
    112112 
    113 osg::StateSet *ShaderGenCache::createStateSet(unsigned int stateMask) const 
     113osg::StateSet *ShaderGenCache::createStateSet(int stateMask) const 
    114114{ 
    115115    osg::StateSet *stateSet = new osg::StateSet; 
     
    364364        return; 
    365365 
    366     unsigned int stateMask = 0; 
     366    int stateMask = 0; 
    367367    //if (state->getMode(GL_BLEND) & osg::StateAttribute::ON) 
    368368    //    stateMask |= ShaderGen::BLEND; 
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osg/CullSettings.cpp

    r10967 r11164  
    7777END_REFLECTOR 
    7878 
    79 TYPE_NAME_ALIAS(unsigned int, osg::CullSettings::CullingMode) 
     79TYPE_NAME_ALIAS(int, osg::CullSettings::InheritanceMask) 
     80 
     81TYPE_NAME_ALIAS(int, osg::CullSettings::CullingMode) 
    8082 
    8183BEGIN_VALUE_REFLECTOR(osg::CullSettings) 
     
    99101                  "", 
    100102                  ""); 
    101         I_Method1(void, setInheritanceMask, IN, unsigned int, mask, 
    102                   Properties::NON_VIRTUAL, 
    103                   __void__setInheritanceMask__unsigned_int, 
     103        I_Method1(void, setInheritanceMask, IN, osg::CullSettings::InheritanceMask, mask, 
     104                  Properties::NON_VIRTUAL, 
     105                  __void__setInheritanceMask__InheritanceMask, 
    104106                  "Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object. ", 
    105107                  ""); 
    106         I_Method0(unsigned int, getInheritanceMask, 
    107                   Properties::NON_VIRTUAL, 
    108                   __unsigned_int__getInheritanceMask, 
     108        I_Method0(osg::CullSettings::InheritanceMask, getInheritanceMask, 
     109                  Properties::NON_VIRTUAL, 
     110                  __InheritanceMask__getInheritanceMask, 
    109111                  "Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object. ", 
    110112                  ""); 
     
    319321                         __bool__getImpostorsActive,  
    320322                         __void__setImpostorsActive__bool); 
    321         I_SimpleProperty(unsigned int, InheritanceMask,  
    322                          __unsigned_int__getInheritanceMask,  
    323                          __void__setInheritanceMask__unsigned_int); 
     323        I_SimpleProperty(osg::CullSettings::InheritanceMask, InheritanceMask,  
     324                         __InheritanceMask__getInheritanceMask,  
     325                         __void__setInheritanceMask__InheritanceMask); 
    324326        I_SimpleProperty(osg::CullSettings::InheritanceMaskActionOnAttributeSetting, InheritanceMaskActionOnAttributeSetting,  
    325327                         __InheritanceMaskActionOnAttributeSetting__getInheritanceMaskActionOnAttributeSetting,  
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osg/CullingSet.cpp

    r10967 r11164  
    5050TYPE_NAME_ALIAS(std::vector< osg::ShadowVolumeOccluder >, osg::CullingSet::OccluderList) 
    5151 
    52 TYPE_NAME_ALIAS(unsigned int, osg::CullingSet::Mask) 
     52TYPE_NAME_ALIAS(int, osg::CullingSet::Mask) 
    5353 
    5454BEGIN_OBJECT_REFLECTOR(osg::CullingSet) 
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osgGA/GUIEventAdapter.cpp

    r10967 r11164  
    418418                  "get mouse-Y orientation (mouse-Y increases upwards or downwards). ", 
    419419                  ""); 
    420         I_Method1(void, setButtonMask, IN, unsigned int, mask, 
    421                   Properties::NON_VIRTUAL, 
    422                   __void__setButtonMask__unsigned_int, 
     420        I_Method1(void, setButtonMask, IN, int, mask, 
     421                  Properties::NON_VIRTUAL, 
     422                  __void__setButtonMask__int, 
    423423                  "set current mouse button state. ", 
    424424                  ""); 
    425         I_Method0(unsigned int, getButtonMask, 
    426                   Properties::NON_VIRTUAL, 
    427                   __unsigned_int__getButtonMask, 
     425        I_Method0(int, getButtonMask, 
     426                  Properties::NON_VIRTUAL, 
     427                  __int__getButtonMask, 
    428428                  "get current mouse button state. ", 
    429429                  ""); 
    430         I_Method1(void, setModKeyMask, IN, unsigned int, mask, 
    431                   Properties::NON_VIRTUAL, 
    432                   __void__setModKeyMask__unsigned_int, 
     430        I_Method1(void, setModKeyMask, IN, int, mask, 
     431                  Properties::NON_VIRTUAL, 
     432                  __void__setModKeyMask__int, 
    433433                  "set modifier key mask. ", 
    434434                  ""); 
    435         I_Method0(unsigned int, getModKeyMask, 
    436                   Properties::NON_VIRTUAL, 
    437                   __unsigned_int__getModKeyMask, 
     435        I_Method0(int, getModKeyMask, 
     436                  Properties::NON_VIRTUAL, 
     437                  __int__getModKeyMask, 
    438438                  "get modifier key mask. ", 
    439439                  ""); 
     
    525525                         __int__getButton,  
    526526                         __void__setButton__int); 
    527         I_SimpleProperty(unsigned int, ButtonMask,  
    528                          __unsigned_int__getButtonMask,  
    529                          __void__setButtonMask__unsigned_int); 
     527        I_SimpleProperty(int, ButtonMask,  
     528                         __int__getButtonMask,  
     529                         __void__setButtonMask__int); 
    530530        I_SimpleProperty(osgGA::GUIEventAdapter::EventType, EventType,  
    531531                         __EventType__getEventType,  
     
    540540                         __int__getKey,  
    541541                         __void__setKey__int); 
    542         I_SimpleProperty(unsigned int, ModKeyMask,  
    543                          __unsigned_int__getModKeyMask,  
    544                          __void__setModKeyMask__unsigned_int); 
     542        I_SimpleProperty(int, ModKeyMask,  
     543                         __int__getModKeyMask,  
     544                         __void__setModKeyMask__int); 
    545545        I_SimpleProperty(osgGA::GUIEventAdapter::MouseYOrientation, MouseYOrientation,  
    546546                         __MouseYOrientation__getMouseYOrientation,  
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osgPresentation/SlideEventHandler.cpp

    r10967 r11164  
    319319        I_EnumLabel(osgPresentation::SlideEventHandler::FIRST_POSITION); 
    320320        I_EnumLabel(osgPresentation::SlideEventHandler::LAST_POSITION); 
    321 END_REFLECTOR 
    322  
    323 BEGIN_ENUM_REFLECTOR(osgPresentation::SlideEventHandler::ObjectMask) 
    324         I_DeclaringFile("osgPresentation/SlideEventHandler"); 
    325         I_EnumLabel(osgPresentation::SlideEventHandler::MOVIE); 
    326         I_EnumLabel(osgPresentation::SlideEventHandler::OBJECTS); 
    327         I_EnumLabel(osgPresentation::SlideEventHandler::ALL_OBJECTS); 
    328321END_REFLECTOR 
    329322 
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osgSim/ObjectRecordData.cpp

    r10967 r11164  
    2222#undef OUT 
    2323#endif 
    24  
    25 BEGIN_ENUM_REFLECTOR(osgSim::ObjectRecordData::Flags) 
    26         I_DeclaringFile("osgSim/ObjectRecordData"); 
    27         I_EnumLabel(osgSim::ObjectRecordData::DONT_DISPLAY_IN_DAYLIGHT); 
    28         I_EnumLabel(osgSim::ObjectRecordData::DONT_DISPLAY_AT_DUSK); 
    29         I_EnumLabel(osgSim::ObjectRecordData::DONT_DISPLAY_AT_NIGHT); 
    30         I_EnumLabel(osgSim::ObjectRecordData::DONT_ILLUMINATE); 
    31         I_EnumLabel(osgSim::ObjectRecordData::FLAT_SHADED); 
    32         I_EnumLabel(osgSim::ObjectRecordData::GROUPS_SHADOW_OBJECT); 
    33 END_REFLECTOR 
    3424 
    3525BEGIN_OBJECT_REFLECTOR(osgSim::ObjectRecordData) 
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osgSim/SphereSegment.cpp

    r10967 r11164  
    109109                  "Get the density of the sphere segment. ", 
    110110                  ""); 
    111         I_Method1(void, setDrawMask, IN, osgSim::SphereSegment::DrawMask, dm, 
    112                   Properties::NON_VIRTUAL, 
    113                   __void__setDrawMask__DrawMask, 
     111        I_Method1(void, setDrawMask, IN, int, dm, 
     112                  Properties::NON_VIRTUAL, 
     113                  __void__setDrawMask__int, 
    114114                  "Specify the DrawMask. ", 
    115115                  " param dm Bitmask specifying which parts of the sphere segment should be drawn.   see DrawMask "); 
    116         I_Method0(osgSim::SphereSegment::DrawMask, getDrawMask, 
    117                   Properties::NON_VIRTUAL, 
    118                   __DrawMask__getDrawMask, 
     116        I_Method0(int, getDrawMask, 
     117                  Properties::NON_VIRTUAL, 
     118                  __int__getDrawMask, 
    119119                  "Get the DrawMask. ", 
    120120                  ""); 
     
    223223                         __int__getDensity,  
    224224                         __void__setDensity__int); 
    225         I_SimpleProperty(osgSim::SphereSegment::DrawMask, DrawMask,  
    226                          __DrawMask__getDrawMask,  
    227                          __void__setDrawMask__DrawMask); 
     225        I_SimpleProperty(int, DrawMask,  
     226                         __int__getDrawMask,  
     227                         __void__setDrawMask__int); 
    228228        I_SimpleProperty(osg::Vec4, EdgeLineColor,  
    229229                         __osg_Vec4__getEdgeLineColor,  
  • OpenSceneGraph/trunk/src/osgWrappers/introspection/osgUtil/ShaderGen.cpp

    r10967 r11164  
    3333END_REFLECTOR 
    3434 
    35 TYPE_NAME_ALIAS(std::map< unsigned int COMMA  osg::ref_ptr< osg::StateSet > >, osgUtil::ShaderGenCache::StateSetMap) 
     35TYPE_NAME_ALIAS(std::map< int COMMA  osg::ref_ptr< osg::StateSet > >, osgUtil::ShaderGenCache::StateSetMap) 
    3636 
    3737BEGIN_OBJECT_REFLECTOR(osgUtil::ShaderGenCache) 
     
    4141                       "", 
    4242                       ""); 
    43         I_Method2(void, setStateSet, IN, unsigned int, stateMask, IN, osg::StateSet *, program, 
     43        I_Method2(void, setStateSet, IN, int, stateMask, IN, osg::StateSet *, program, 
    4444                  Properties::NON_VIRTUAL, 
    45                   __void__setStateSet__unsigned_int__osg_StateSet_P1, 
     45                  __void__setStateSet__int__osg_StateSet_P1, 
    4646                  "", 
    4747                  ""); 
    48         I_Method1(osg::StateSet *, getStateSet, IN, unsigned int, stateMask, 
     48        I_Method1(osg::StateSet *, getStateSet, IN, int, stateMask, 
    4949                  Properties::NON_VIRTUAL, 
    50                   __osg_StateSet_P1__getStateSet__unsigned_int, 
     50                  __osg_StateSet_P1__getStateSet__int, 
    5151                  "", 
    5252                  ""); 
    53         I_Method1(osg::StateSet *, getOrCreateStateSet, IN, unsigned int, stateMask, 
     53        I_Method1(osg::StateSet *, getOrCreateStateSet, IN, int, stateMask, 
    5454                  Properties::NON_VIRTUAL, 
    55                   __osg_StateSet_P1__getOrCreateStateSet__unsigned_int, 
     55                  __osg_StateSet_P1__getOrCreateStateSet__int, 
    5656                  "", 
    5757                  ""); 
    58         I_ProtectedMethod1(osg::StateSet *, createStateSet, IN, unsigned int, stateMask, 
     58        I_ProtectedMethod1(osg::StateSet *, createStateSet, IN, int, stateMask, 
    5959                           Properties::NON_VIRTUAL, 
    6060                           Properties::CONST, 
    61                            __osg_StateSet_P1__createStateSet__unsigned_int, 
     61                           __osg_StateSet_P1__createStateSet__int, 
    6262                           "", 
    6363                           ""); 
    6464        I_IndexedProperty(osg::StateSet *, StateSet,  
    65                           __osg_StateSet_P1__getStateSet__unsigned_int,  
    66                           __void__setStateSet__unsigned_int__osg_StateSet_P1,  
     65                          __osg_StateSet_P1__getStateSet__int,  
     66                          __void__setStateSet__int__osg_StateSet_P1,  
    6767                          0); 
    6868END_REFLECTOR 
     
    128128END_REFLECTOR 
    129129 
    130 STD_MAP_REFLECTOR(std::map< unsigned int COMMA  osg::ref_ptr< osg::StateSet > >) 
     130STD_MAP_REFLECTOR(std::map< int COMMA  osg::ref_ptr< osg::StateSet > >) 
    131131