From 3a67eefd9f02dd2ab729edfde71b50ee8f442e1e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 21 Nov 2012 13:38:11 +0000 Subject: [PATCH] Refactored osgDB::Input::readObjectOfType to use a template, and updated associated wrappers to avoid using local static's --- include/osgDB/Input | 27 +++- include/osgDB/Registry | 19 --- .../deprecated-dotosg/osg/AnimationPath.cpp | 8 +- .../osg/CoordinateSystemNode.cpp | 4 +- .../deprecated-dotosg/osg/Drawable.cpp | 14 +- .../deprecated-dotosg/osg/Node.cpp | 13 +- .../deprecated-dotosg/osg/NodeCallback.cpp | 8 +- .../deprecated-dotosg/osg/OccluderNode.cpp | 5 +- .../deprecated-dotosg/osg/StateAttribute.cpp | 5 +- .../deprecated-dotosg/osg/StateSet.cpp | 130 +++++++++++------- .../deprecated-dotosg/osg/Uniform.cpp | 5 +- .../osgSim/IO_ObjectRecordData.cpp | 13 -- 12 files changed, 129 insertions(+), 122 deletions(-) diff --git a/include/osgDB/Input b/include/osgDB/Input index 230598619..9605d3118 100644 --- a/include/osgDB/Input +++ b/include/osgDB/Input @@ -29,7 +29,25 @@ namespace osgDB { -struct basic_type_wrapper; +/** basic structure for custom runtime inheritance checking */ +struct basic_type_wrapper { + virtual ~basic_type_wrapper() {} + virtual bool matches(const osg::Object *proto) const = 0; +}; + +/** a class template that checks inheritance between a given + Object's class and a class defined at compile time through + the template parameter T. + This is used in conjunction with readObjectOfType() to + specify an abstract class as reference type. +**/ +template +struct type_wrapper: basic_type_wrapper { + bool matches(const osg::Object *proto) const + { + return dynamic_cast(proto) != 0; + } +}; /** deprecated. */ class OSGDB_EXPORT Field @@ -255,6 +273,13 @@ class OSGDB_EXPORT Input : public FieldReaderIterator virtual osg::Object* readObjectOfType(const osg::Object& compObj); virtual osg::Object* readObjectOfType(const basic_type_wrapper &btw); + + template + inline T* readObjectOfType() + { + return dynamic_cast(readObjectOfType(osgDB::type_wrapper())); + } + virtual osg::Object* readObject(); virtual osg::Image* readImage(); virtual osg::Drawable* readDrawable(); diff --git a/include/osgDB/Registry b/include/osgDB/Registry index a5feb89e0..bfdd491fb 100644 --- a/include/osgDB/Registry +++ b/include/osgDB/Registry @@ -40,25 +40,6 @@ extern "C" namespace osgDB { -/** basic structure for custom runtime inheritance checking */ -struct basic_type_wrapper { - virtual ~basic_type_wrapper() {} - virtual bool matches(const osg::Object *proto) const = 0; -}; - -/** a class template that checks inheritance between a given - Object's class and a class defined at compile time through - the template parameter T. - This is used in conjunction with readObjectOfType() to - specify an abstract class as reference type. -**/ -template -struct type_wrapper: basic_type_wrapper { - bool matches(const osg::Object *proto) const - { - return dynamic_cast(proto) != 0; - } -}; /** Registry is a singleton factory which stores diff --git a/src/osgWrappers/deprecated-dotosg/osg/AnimationPath.cpp b/src/osgWrappers/deprecated-dotosg/osg/AnimationPath.cpp index 9a109cf81..46ed022e7 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/AnimationPath.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/AnimationPath.cpp @@ -198,12 +198,10 @@ bool AnimationPathCallback_readLocalData(osg::Object &obj, osgDB::Input &fr) iteratorAdvanced = true; } - static osg::ref_ptr s_path = new osg::AnimationPath; - ref_ptr object = fr.readObjectOfType(*s_path); - if (object.valid()) + osg::ref_ptr animpath = fr.readObjectOfType(); + if (animpath.valid()) { - osg::AnimationPath* animpath = dynamic_cast(object.get()); - if (animpath) apc->setAnimationPath(animpath); + apc->setAnimationPath(animpath.get()); iteratorAdvanced = true; } diff --git a/src/osgWrappers/deprecated-dotosg/osg/CoordinateSystemNode.cpp b/src/osgWrappers/deprecated-dotosg/osg/CoordinateSystemNode.cpp index d3739c819..38cbb97f1 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/CoordinateSystemNode.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/CoordinateSystemNode.cpp @@ -45,9 +45,7 @@ bool CoordinateSystemNode_readLocalData(Object& obj, Input& fr) fr+=2; } - static ref_ptr s_ellipsoidModel = new EllipsoidModel; - - EllipsoidModel* em = static_cast(fr.readObjectOfType(*s_ellipsoidModel)); + EllipsoidModel* em = fr.readObjectOfType(); if (em) csn.setEllipsoidModel(em); return iteratorAdvanced; diff --git a/src/osgWrappers/deprecated-dotosg/osg/Drawable.cpp b/src/osgWrappers/deprecated-dotosg/osg/Drawable.cpp index 8499f1f62..2d209d9be 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/Drawable.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/Drawable.cpp @@ -27,35 +27,35 @@ bool Drawable_readLocalData(Object& obj, Input& fr) Drawable& drawable = static_cast(obj); - static ref_ptr s_drawstate = new osg::StateSet; - if (StateSet* readState = static_cast(fr.readObjectOfType(*s_drawstate))) + osg::StateSet* readState = fr.readObjectOfType(); + if (readState) { drawable.setStateSet(readState); iteratorAdvanced = true; } - Shape* shape = static_cast(fr.readObjectOfType(type_wrapper())); + Shape* shape = fr.readObjectOfType(); if (shape) { drawable.setShape(shape); iteratorAdvanced = true; } - Drawable::UpdateCallback* uc = dynamic_cast(fr.readObjectOfType(type_wrapper())); + Drawable::UpdateCallback* uc = fr.readObjectOfType(); if (uc) { drawable.setUpdateCallback(uc); iteratorAdvanced = true; } - Drawable::CullCallback* cc = dynamic_cast(fr.readObjectOfType(type_wrapper())); + Drawable::CullCallback* cc = fr.readObjectOfType(); if (cc) { drawable.setCullCallback(cc); iteratorAdvanced = true; } - Drawable::DrawCallback* dc = dynamic_cast(fr.readObjectOfType(type_wrapper())); + Drawable::DrawCallback* dc = fr.readObjectOfType(); if (dc) { drawable.setDrawCallback(dc); @@ -76,7 +76,7 @@ bool Drawable_readLocalData(Object& obj, Input& fr) iteratorAdvanced = true; } - Drawable::ComputeBoundingBoxCallback* cbc = dynamic_cast(fr.readObjectOfType(type_wrapper())); + Drawable::ComputeBoundingBoxCallback* cbc = fr.readObjectOfType(); if (cbc) { drawable.setComputeBoundingBoxCallback(cbc); diff --git a/src/osgWrappers/deprecated-dotosg/osg/Node.cpp b/src/osgWrappers/deprecated-dotosg/osg/Node.cpp index 77fa1f626..3f1b6294d 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/Node.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/Node.cpp @@ -74,15 +74,14 @@ bool Node_readLocalData(Object& obj, Input& fr) iteratorAdvanced = true; } - static ref_ptr s_drawstate = new osg::StateSet; - if (StateSet* readState = static_cast(fr.readObjectOfType(*s_drawstate))) + StateSet* readState = fr.readObjectOfType(); + if (readState) { node.setStateSet(readState); iteratorAdvanced = true; } - static ref_ptr s_nodecallback = new osg::NodeCallback; while (fr.matchSequence("UpdateCallback {")) { int entry = fr[0].getNoNestedBrackets(); @@ -90,7 +89,7 @@ bool Node_readLocalData(Object& obj, Input& fr) while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { - NodeCallback* nodecallback = dynamic_cast(fr.readObjectOfType(*s_nodecallback)); + NodeCallback* nodecallback = fr.readObjectOfType(); if (nodecallback) { if (node.getUpdateCallback() == NULL) { node.setUpdateCallback(nodecallback); @@ -111,7 +110,7 @@ bool Node_readLocalData(Object& obj, Input& fr) while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { - NodeCallback* nodecallback = dynamic_cast(fr.readObjectOfType(*s_nodecallback)); + NodeCallback* nodecallback = fr.readObjectOfType(); if (nodecallback) { if (node.getEventCallback() == NULL) { node.setEventCallback(nodecallback); @@ -132,7 +131,7 @@ bool Node_readLocalData(Object& obj, Input& fr) while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { - NodeCallback* nodecallback = dynamic_cast(fr.readObjectOfType(*s_nodecallback)); + NodeCallback* nodecallback = fr.readObjectOfType(); if (nodecallback) { if (node.getCullCallback() == NULL) { node.setCullCallback(nodecallback); @@ -165,7 +164,7 @@ bool Node_readLocalData(Object& obj, Input& fr) while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { - Node::ComputeBoundingSphereCallback* callback = dynamic_cast(fr.readObjectOfType(type_wrapper())); + Node::ComputeBoundingSphereCallback* callback = fr.readObjectOfType(); if (callback) { node.setComputeBoundingSphereCallback(callback); } diff --git a/src/osgWrappers/deprecated-dotosg/osg/NodeCallback.cpp b/src/osgWrappers/deprecated-dotosg/osg/NodeCallback.cpp index 4ebcc2f28..e49dbb589 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/NodeCallback.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/NodeCallback.cpp @@ -28,12 +28,10 @@ bool NodeCallback_readLocalData(osg::Object &obj, osgDB::Input &fr) bool itrAdvanced = false; - static osg::ref_ptr s_nc = new NodeCallback; - osg::ref_ptr object = fr.readObjectOfType(*s_nc); - if (object.valid()) + NodeCallback* ncc = fr.readObjectOfType(); + if (ncc) { - NodeCallback* ncc = dynamic_cast(object.get()); - if (ncc) nc.setNestedCallback(ncc); + nc.setNestedCallback(ncc); itrAdvanced = true; } diff --git a/src/osgWrappers/deprecated-dotosg/osg/OccluderNode.cpp b/src/osgWrappers/deprecated-dotosg/osg/OccluderNode.cpp index ce4a9c676..7639e8330 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/OccluderNode.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/OccluderNode.cpp @@ -27,10 +27,7 @@ bool OccluderNode_readLocalData(Object& obj, Input& fr) OccluderNode& occludernode = static_cast(obj); - static ref_ptr s_occluder = new ConvexPlanarOccluder; - - ConvexPlanarOccluder* tmpOccluder = static_cast(fr.readObjectOfType(*s_occluder)); - + ConvexPlanarOccluder* tmpOccluder = fr.readObjectOfType(); if (tmpOccluder) { occludernode.setOccluder(tmpOccluder); diff --git a/src/osgWrappers/deprecated-dotosg/osg/StateAttribute.cpp b/src/osgWrappers/deprecated-dotosg/osg/StateAttribute.cpp index f6686a637..7be0abef0 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/StateAttribute.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/StateAttribute.cpp @@ -29,12 +29,11 @@ bool StateAttribute_readLocalData(Object& obj, Input& fr) bool iteratorAdvanced = false; StateAttribute& stateAttribute = static_cast(obj); - static ref_ptr s_callback = new osg::StateAttributeCallback; while (fr.matchSequence("UpdateCallback {")) { //int entry = fr[0].getNoNestedBrackets(); fr += 2; - StateAttributeCallback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); + StateAttributeCallback* callback = fr.readObjectOfType(); if (callback) { stateAttribute.setUpdateCallback(callback); } @@ -45,7 +44,7 @@ bool StateAttribute_readLocalData(Object& obj, Input& fr) { //int entry = fr[0].getNoNestedBrackets(); fr += 2; - StateAttributeCallback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); + StateAttributeCallback* callback = fr.readObjectOfType(); if (callback) { stateAttribute.setEventCallback(callback); } diff --git a/src/osgWrappers/deprecated-dotosg/osg/StateSet.cpp b/src/osgWrappers/deprecated-dotosg/osg/StateSet.cpp index 62d7a45a7..9632f59f6 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/StateSet.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/StateSet.cpp @@ -65,26 +65,61 @@ REGISTER_DOTOSGWRAPPER(GeoState) // // Set up the maps from name to GLMode and visa versa. // -typedef std::map GLNameToGLModeMap; -typedef std::map GLModeToGLNameMap; -typedef std::set TextureGLModeSet; -GLNameToGLModeMap s_GLNameToGLModeMap; -GLModeToGLNameMap s_GLModeToGLNameMap; -TextureGLModeSet s_TextureGLModeSet; +#define ADD_NAME(name,mode) _GLNameToGLModeMap[name]=mode; _GLModeToGLNameMap[mode]=name; -#define ADD_NAME(name,mode) s_GLNameToGLModeMap[name]=mode; s_GLModeToGLNameMap[mode]=name; - -void initGLNames() +struct ModesAndNames { - static bool first_time = true; - if (!first_time) return; + ModesAndNames(); - static OpenThreads::Mutex s_initGLNames; - OpenThreads::ScopedLock lock(s_initGLNames); + typedef std::map GLNameToGLModeMap; + typedef std::map GLModeToGLNameMap; + typedef std::set TextureGLModeSet; - if (!first_time) return; + inline bool isTextureMode(int mode) const + { + return _TextureGLModeSet.find(mode)!=_TextureGLModeSet.end(); + } + inline bool getGLModeForName(const std::string& str, osg::StateAttribute::GLMode& mode) const + { + GLNameToGLModeMap::const_iterator nitr = _GLNameToGLModeMap.find(str); + if (nitr!=_GLNameToGLModeMap.end()) + { + mode = nitr->second; + return true; + } + else + { + return false; + } + + } + + inline bool getNameForGLMode(const osg::StateAttribute::GLMode& mode, std::string& str) const + { + GLModeToGLNameMap::const_iterator nitr = _GLModeToGLNameMap.find(mode); + if (nitr!=_GLModeToGLNameMap.end()) + { + str = nitr->second; + return true; + } + else + { + return false; + } + + } + + GLNameToGLModeMap _GLNameToGLModeMap; + GLModeToGLNameMap _GLModeToGLNameMap; + TextureGLModeSet _TextureGLModeSet; +}; + +static ModesAndNames s_ModesAndNames; + +ModesAndNames::ModesAndNames() +{ ADD_NAME("GL_ALPHA_TEST",GL_ALPHA_TEST) ADD_NAME("GL_BLEND",GL_BLEND) ADD_NAME("GL_COLOR_MATERIAL",GL_COLOR_MATERIAL) @@ -138,17 +173,17 @@ void initGLNames() ADD_NAME("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SIZE) ADD_NAME("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE) - s_TextureGLModeSet.insert(GL_TEXTURE_1D); - s_TextureGLModeSet.insert(GL_TEXTURE_2D); - s_TextureGLModeSet.insert(GL_TEXTURE_3D); + _TextureGLModeSet.insert(GL_TEXTURE_1D); + _TextureGLModeSet.insert(GL_TEXTURE_2D); + _TextureGLModeSet.insert(GL_TEXTURE_3D); - s_TextureGLModeSet.insert(GL_TEXTURE_CUBE_MAP); - s_TextureGLModeSet.insert(GL_TEXTURE_RECTANGLE); + _TextureGLModeSet.insert(GL_TEXTURE_CUBE_MAP); + _TextureGLModeSet.insert(GL_TEXTURE_RECTANGLE); - s_TextureGLModeSet.insert(GL_TEXTURE_GEN_Q); - s_TextureGLModeSet.insert(GL_TEXTURE_GEN_R); - s_TextureGLModeSet.insert(GL_TEXTURE_GEN_S); - s_TextureGLModeSet.insert(GL_TEXTURE_GEN_T); + _TextureGLModeSet.insert(GL_TEXTURE_GEN_Q); + _TextureGLModeSet.insert(GL_TEXTURE_GEN_R); + _TextureGLModeSet.insert(GL_TEXTURE_GEN_S); + _TextureGLModeSet.insert(GL_TEXTURE_GEN_T); // for(GLNameToGLModeMap::iterator itr=s_GLNameToGLModeMap.begin(); @@ -157,8 +192,6 @@ void initGLNames() // { // cout << "Name ["<first<<","<second<<"]"<< std::endl; // } - - first_time = false; } @@ -294,8 +327,6 @@ bool StateSet_readLocalData(Object& obj, Input& fr) // note, StateSet replaced GeoState April 2001. StateSet& stateset = static_cast(obj); - initGLNames(); - // read the rendering hint value. if (fr[0].matchWord("rendering_hint")) { @@ -359,12 +390,11 @@ bool StateSet_readLocalData(Object& obj, Input& fr) stateset.setRenderBinDetails(binNumber,binName,rbmode); } - static ref_ptr s_callback = new osg::StateSet::Callback; while (fr.matchSequence("UpdateCallback {")) { // int entry = fr[0].getNoNestedBrackets(); fr += 2; - StateSet::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); + StateSet::Callback* callback = fr.readObjectOfType(); if (callback) { stateset.setUpdateCallback(callback); } @@ -375,7 +405,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr) { //int entry = fr[0].getNoNestedBrackets(); fr += 2; - StateSet::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); + StateSet::Callback* callback = fr.readObjectOfType(); if (callback) { stateset.setEventCallback(callback); } @@ -395,7 +425,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr) int mode; fr[0].getInt(mode); - if (s_TextureGLModeSet.find(mode)!=s_TextureGLModeSet.end()) + if (s_ModesAndNames.isTextureMode(mode)) { // remap to a texture unit. stateset.setTextureMode(0,(StateAttribute::GLMode)mode,value); @@ -414,11 +444,10 @@ bool StateSet_readLocalData(Object& obj, Input& fr) { if (StateSet_matchModeStr(fr[1].getStr(),value)) { - GLNameToGLModeMap::iterator nitr = s_GLNameToGLModeMap.find(fr[0].getStr()); - if (nitr!=s_GLNameToGLModeMap.end()) + StateAttribute::GLMode mode; + if (s_ModesAndNames.getGLModeForName(fr[0].getStr(), mode)) { - StateAttribute::GLMode mode = nitr->second; - if (s_TextureGLModeSet.find(mode)!=s_TextureGLModeSet.end()) + if (s_ModesAndNames.isTextureMode(mode)) { // remap to a texture unit. stateset.setTextureMode(0,mode,value); @@ -494,10 +523,9 @@ bool StateSet_readLocalData(Object& obj, Input& fr) { if (StateSet_matchModeStr(fr[1].getStr(),value)) { - GLNameToGLModeMap::iterator nitr = s_GLNameToGLModeMap.find(fr[0].getStr()); - if (nitr!=s_GLNameToGLModeMap.end()) + StateAttribute::GLMode mode; + if (s_ModesAndNames.getGLModeForName(fr[0].getStr(), mode)) { - StateAttribute::GLMode mode = nitr->second; stateset.setTextureMode(unit,mode,value); fr+=2; localIteratorAdvanced = true; @@ -543,8 +571,6 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw) const StateSet& stateset = static_cast(obj); - initGLNames(); - // write the rendering hint value. fw.indent()<<"rendering_hint "; switch(stateset.getRenderingHint()) @@ -575,11 +601,11 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw) for(StateSet::ModeList::const_iterator mitr=ml.begin(); mitr!=ml.end(); ++mitr) - { - GLModeToGLNameMap::iterator nitr = s_GLModeToGLNameMap.find(mitr->first); - if (nitr!=s_GLModeToGLNameMap.end()) + { + std::string str; + if (s_ModesAndNames.getNameForGLMode(mitr->first, str)) { - fw.indent() << nitr->second << " " << StateSet_getModeStr(mitr->second) << std::endl; + fw.indent() << str << " " << StateSet_getModeStr(mitr->second) << std::endl; } else { @@ -620,16 +646,16 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw) mitr!=ml.end(); ++mitr) { - GLModeToGLNameMap::iterator nitr = s_GLModeToGLNameMap.find(mitr->first); - if (nitr!=s_GLModeToGLNameMap.end()) - { - fw.indent() << nitr->second << " " << StateSet_getModeStr(mitr->second) << std::endl; - } - else - { + std::string str; + if (s_ModesAndNames.getNameForGLMode(mitr->first, str)) + { + fw.indent() << str << " " << StateSet_getModeStr(mitr->second) << std::endl; + } + else + { // no name defined for GLMode so just pass its value to fw. fw.indent() << "0x" << hex << (unsigned int)mitr->first << dec <<" " << StateSet_getModeStr(mitr->second) << std::endl; - } + } } } diff --git a/src/osgWrappers/deprecated-dotosg/osg/Uniform.cpp b/src/osgWrappers/deprecated-dotosg/osg/Uniform.cpp index a93e85ae5..90acd639a 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/Uniform.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/Uniform.cpp @@ -210,12 +210,11 @@ bool Uniform_readLocalData(Object& obj, Input& fr) } #endif //] - static ref_ptr s_callback = new osg::Uniform::Callback; while (fr.matchSequence("UpdateCallback {")) { //int entry = fr[0].getNoNestedBrackets(); fr += 2; - Uniform::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); + Uniform::Callback* callback = fr.readObjectOfType(); if (callback) { uniform.setUpdateCallback(callback); } @@ -226,7 +225,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr) { //int entry = fr[0].getNoNestedBrackets(); fr += 2; - Uniform::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); + Uniform::Callback* callback = fr.readObjectOfType(); if (callback) { uniform.setEventCallback(callback); } diff --git a/src/osgWrappers/deprecated-dotosg/osgSim/IO_ObjectRecordData.cpp b/src/osgWrappers/deprecated-dotosg/osgSim/IO_ObjectRecordData.cpp index 468e8b811..0cf34e10e 100644 --- a/src/osgWrappers/deprecated-dotosg/osgSim/IO_ObjectRecordData.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgSim/IO_ObjectRecordData.cpp @@ -24,19 +24,6 @@ REGISTER_DOTOSGWRAPPER(ObjectRecordData_Proxy) osgDB::DotOsgWrapper::READ_AND_WRITE ); -#if 0 -// if deffing out as values are not used anywhere. -static const int numBits( 6 ); -typedef std::pair< std::string, osgSim::ObjectRecordData::Flags> FlagBits; -static FlagBits flagBits[numBits] = { - FlagBits( std::string("DONT_DISPLAY_IN_DAYLIGHT"), osgSim::ObjectRecordData::DONT_DISPLAY_IN_DAYLIGHT ), - FlagBits( "DONT_DISPLAY_AT_DUSK", osgSim::ObjectRecordData::DONT_DISPLAY_AT_DUSK ), - FlagBits( "DONT_DISPLAY_AT_NIGHT", osgSim::ObjectRecordData::DONT_DISPLAY_AT_NIGHT ), - FlagBits( "DONT_ILLUMINATE", osgSim::ObjectRecordData::DONT_ILLUMINATE ), - FlagBits( "FLAT_SHADED", osgSim::ObjectRecordData::FLAT_SHADED ), - FlagBits( "GROUPS_SHADOW_OBJECT", osgSim::ObjectRecordData::GROUPS_SHADOW_OBJECT ) -}; -#endif bool ObjectRecordData_readLocalData(osg::Object &obj, osgDB::Input &fr) { bool iteratorAdvanced = false;