Checked in Macro Jez's additions to osgText to support .osg IO make it

a fully functioning NodeKit.

Also reimplement notify() to try an prevent a crash which has been caused by
to objects in notify.cpp being initiliazed twice, the second time the auto_ptr
holding the dev/null ofstream was being initilized to 0.
This commit is contained in:
Robert Osfield
2002-06-11 18:41:57 +00:00
parent e1ba8a6292
commit 247cb3ff7e
21 changed files with 958 additions and 149 deletions

View File

@@ -0,0 +1,49 @@
#include <osg/Projection>
#include <osg/Matrix>
#include "osgDB/Registry"
#include "osgDB/Input"
#include "osgDB/Output"
using namespace osg;
using namespace osgDB;
// forward declare functions to use later.
bool Projection_readLocalData(Object& obj, Input& fr);
bool Projection_writeLocalData(const Object& obj, Output& fw);
// register the read and write functions with the osgDB::Registry.
RegisterDotOsgWrapperProxy g_ProjectionProxy
(
osgNew osg::Projection,
"Projection",
"Object Node Group Projection",
&Projection_readLocalData,
&Projection_writeLocalData
);
bool Projection_readLocalData(Object& obj, Input& fr)
{
Projection &myobj = static_cast<Projection &>(obj);
bool iteratorAdvanced = false;
static Matrix s_matrix;
if (Matrix* tmpMatrix = static_cast<Matrix*>(fr.readObjectOfType(s_matrix)))
{
myobj.setMatrix(*tmpMatrix);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
bool Projection_writeLocalData(const Object& obj, Output& fw)
{
const Projection& myobj = static_cast<const Projection&>(obj);
fw.writeObject(myobj.getMatrix());
return true;
}