Additions since the CVS back up was made.

This commit is contained in:
Robert Osfield
2003-06-24 21:57:13 +00:00
parent 15f88f35b2
commit d70ab592ed
53 changed files with 2630 additions and 124 deletions

View File

@@ -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;
}