Hi Sebastian,
Thanx for your reply. The reason why I didn’t also add the FID (and others 
more) is simple: I wanted to keep the changes small to increase the possibility 
my code will be merged with OSG. But I planned already to add further values, 
therefore the import-option has the name ‘preserveNonOsgAttrsAsDescription‘. 
Maybe I will add further values or somebody else (maybe you?). But actually I 
have no testdata for other values than SMC.

Cheers WeSee


Sebastian Messerschmidt wrote:
> Hello Alois,
> 
> That's a very nice addition. I've been asking how and where to add this more 
> than once, and you simply did ;-)
> I have a comment however: 
> Why didn't you add the FID (Feature ID) too? 
> 
> Anyways: I would really like this to be merged to the OSG.
> 
> cheers
> Sebastian 
> 
> 
> 
> >      <![endif]-->   <![endif]-->  
> > Hi guys, 
> > I am very proud to present my first contribution to OSG. It is a small 
> > extension of the OpenFlight-plugin for reading Surface Material Codes and 
> > adding this code as description to the geode. 
> > 
> > I have seen, the OpenFlight-Load does not support the Surface Material Code 
> > (SMC) attribute. Therefore all Surface Mateial Codes of models in 
> > flt-Format will be lost when reading into OSG. So I made a change in the 
> > OpenFlight plugin, which reads the SMC and adds a description to the geode 
> > (the OSG-nodes have no such element). The description will be: 
> > ‘SMC:<surfaceCode>’. Example: if the surface-code is 1234, the description 
> > will be ‘SMC:1234’. 
> > Adding this desciption can be enabled/disabled with the import-option 
> > ‚preserveNonOsgAttrsAsDescription’ (default is disabled). If it is set, the 
> > description will be added, if it is not set, SMC will be ignored (=> like 
> > it was without this change). It would make sense to describe this new 
> > option in the wiki-page: 
> > http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/OpenFlight
> >  
> > (http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/OpenFlight).
> >  
> > I tested this change with a lot of flt-models containing different SMC and 
> > it worked flawless. 
> > 
> > The base for my changes was OSG-3.0.1. 
> > 
> > Following changes I made: 
> > 
> > src/osgPlugins/OpenFlight/Document.h & Document.cpp: 
> > New member-variable bool _preserveNonOsgAttrsAsDescription which will be 
> > set to false in the constructor and getter/setter-methods for it added 
> > (getPreserveNonOsgAttrsAsDescription() and 
> > setPreserveNonOsgAttrsAsDescription()) 
> > 
> > src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp: 
> > In the constructor FLTReaderWriter()preserveNonOsgAttrsAsDescription will 
> > be declared as import-option 
> > In readNode() the new option preserveNonOsgAttrsAsDescription will be read 
> > and set (also an OSG_DEBUG will be made) 
> > 
> > src/osgPlugins/OpenFlight/GeometryRecords.cpp: 
> > In Face::readRecord() the surface will be read and if 
> > preserveNonOsgAttrsAsDescription-option is set, the description will be 
> > generated and added to the geode 
> > In Mesh::readRecord() the surface will be read and if 
> > preserveNonOsgAttrsAsDescription-option is set, the description will be 
> > generated and added to the geode 
> > 
> > I hope you can add this to the trunc, otherwise please inform me why this 
> > is not possible. 
> > 
> > 
> > Cheers 
> > 
> > WeSee 
> > 
> > 
> > 
> > > _______________________________________________
> > > osg-submissions mailing list
> > >  ()
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> > >  
> > > (http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org)
> > > 
> >  
> 
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51158#51158





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to