From Ralf Habacker, patch refactoring struct ObjOptionsStruct

in obj plugin into a real class, which is a preparation for further obj
related patches.
This commit is contained in:
Robert Osfield 2017-10-20 11:52:48 +01:00
parent a2ad1c9606
commit 38e5fdadf0

View File

@ -142,7 +142,8 @@ public:
protected:
struct ObjOptionsStruct {
class ObjOptionsStruct {
public:
bool rotate;
bool noTesselateLargePolygons;
bool noTriStripPolygons;
@ -155,6 +156,17 @@ protected:
TextureAllocationMap textureUnitAllocation;
/// Coordinates precision.
int precision;
ObjOptionsStruct()
{
rotate = true;
noTesselateLargePolygons = false;
noTriStripPolygons = false;
generateFacetNormals = false;
fixBlackMaterials = true;
noReverseFaces = false;
precision = std::numeric_limits<double>::digits10 + 2;
}
};
typedef std::map< std::string, osg::ref_ptr<osg::StateSet> > MaterialToStateSetMap;
@ -831,13 +843,6 @@ osg::Node* ReaderWriterOBJ::convertModelToSceneGraph(obj::Model& model, ObjOptio
ReaderWriterOBJ::ObjOptionsStruct ReaderWriterOBJ::parseOptions(const osgDB::ReaderWriter::Options* options) const
{
ObjOptionsStruct localOptions;
localOptions.rotate = true;
localOptions.noTesselateLargePolygons = false;
localOptions.noTriStripPolygons = false;
localOptions.generateFacetNormals = false;
localOptions.fixBlackMaterials = true;
localOptions.noReverseFaces = false;
localOptions.precision = std::numeric_limits<double>::digits10 + 2;
if (options!=NULL)
{