Additions since the CVS back up was made.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
@@ -11,17 +12,6 @@ using namespace osgDB;
|
||||
bool ShapeDrawable_readLocalData(Object& obj, Input& fr);
|
||||
bool ShapeDrawable_writeLocalData(const Object& obj, Output& fw);
|
||||
|
||||
// //register the read and write functions with the osgDB::Registry.
|
||||
// RegisterDotOsgWrapperProxy g_ShapeDrawableFuncProxy
|
||||
// (
|
||||
// new osg::ShapeDrawable,
|
||||
// "ShapeDrawable",
|
||||
// "Object Drawable ShapeDrawable",
|
||||
// 0,
|
||||
// 0,
|
||||
// DotOsgWrapper::READ_AND_WRITE
|
||||
// );
|
||||
|
||||
RegisterDotOsgWrapperProxy g_ShapeDrawableFuncProxy
|
||||
(
|
||||
new osg::ShapeDrawable,
|
||||
@@ -52,6 +42,16 @@ bool ShapeDrawable_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
ref_ptr<Object> readObject = fr.readObject();
|
||||
if (readObject.valid()) {
|
||||
TessellationHints* hints = dynamic_cast<TessellationHints*>(readObject.get());
|
||||
if (hints)
|
||||
geom.setTessellationHints(hints);
|
||||
else
|
||||
notify(WARN) << "Warning: " << readObject->className() << " loaded but cannot be attached to ShapeDrawable.\n";
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
@@ -61,5 +61,9 @@ bool ShapeDrawable_writeLocalData(const Object& obj, Output& fw)
|
||||
|
||||
fw.indent() << "color " << geom.getColor() << std::endl;
|
||||
|
||||
const TessellationHints* hints = geom.getTessellationHints();
|
||||
if (hints)
|
||||
fw.writeObject(*hints);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user