Moved osg::DOFTransform to osgSim::DOFTransform.
Fixed crash associated with .osg files which contain empty description fields. From Sondra Inverson, added support to .ive plugin for osgSim::DOFTransform.
This commit is contained in:
@@ -26,7 +26,6 @@ CXXFILES =\
|
||||
CullStack.cpp\
|
||||
Depth.cpp\
|
||||
DisplaySettings.cpp\
|
||||
DOFTransform.cpp\
|
||||
Drawable.cpp\
|
||||
DrawPixels.cpp\
|
||||
ClearNode.cpp\
|
||||
|
||||
@@ -52,7 +52,7 @@ CXXFILES =\
|
||||
|
||||
INC += -I$(THISDIR)
|
||||
|
||||
LIBS += $(OSG_LIBS) $(OTHER_LIBS)
|
||||
LIBS += -losgSim $(OSG_LIBS) $(OTHER_LIBS)
|
||||
|
||||
TARGET_BASENAME = flt
|
||||
include $(TOPDIR)/Make/cygwin_plugin_def
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <osg/Image>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osg/DOFTransform>
|
||||
#include <osg/Sequence>
|
||||
|
||||
#include <osgDB/FileUtils>
|
||||
@@ -38,6 +37,8 @@
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <osgSim/DOFTransform>
|
||||
|
||||
#include "opcodes.h"
|
||||
#include "flt.h"
|
||||
#include "flt2osg.h"
|
||||
@@ -800,7 +801,7 @@ osg::Group* ConvertFromFLT::visitDOF(osg::Group& osgParent, DofRecord* rec)
|
||||
|
||||
#if defined(USE_DOFTransform)
|
||||
|
||||
osg::DOFTransform* transform = new osg::DOFTransform;
|
||||
osgSim::DOFTransform* transform = new osgSim::DOFTransform;
|
||||
transform->setName(rec->getData()->szIdent);
|
||||
transform->setDataVariance(osg::Object::DYNAMIC);
|
||||
visitAncillary(osgParent, *transform, rec)->addChild( transform );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "LOD.h"
|
||||
#include "PagedLOD.h"
|
||||
#include "PositionAttitudeTransform.h"
|
||||
#include "DOFTransform.h"
|
||||
#include "Transform.h"
|
||||
#include "Switch.h"
|
||||
#include "OccluderNode.h"
|
||||
@@ -184,6 +185,17 @@ long DataInputStream::readLong(){
|
||||
return l;
|
||||
}
|
||||
|
||||
unsigned long DataInputStream::readULong(){
|
||||
unsigned long l;
|
||||
_istream->read((char*)&l, LONGSIZE);
|
||||
if (_istream->rdstate() & _istream->failbit)
|
||||
throw Exception("DataInputStream::readULong(): Failed to read unsigned long value.");
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeULong() ["<<l<<"]"<<std::endl;
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
double DataInputStream::readDouble(){
|
||||
double d;
|
||||
_istream->read((char*)&d, DOUBLESIZE);
|
||||
@@ -623,6 +635,10 @@ osg::Node* DataInputStream::readNode()
|
||||
node = new osg::PositionAttitudeTransform();
|
||||
((ive::PositionAttitudeTransform*)(node))->read(this);
|
||||
}
|
||||
else if(nodeTypeID== IVEDOFTRANSFORM){
|
||||
node = new osgSim::DOFTransform();
|
||||
((ive::DOFTransform*)(node))->read(this);
|
||||
}
|
||||
else if(nodeTypeID== IVETRANSFORM){
|
||||
node = new osg::Transform();
|
||||
((ive::Transform*)(node))->read(this);
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
int peekInt();
|
||||
float readFloat();
|
||||
long readLong();
|
||||
unsigned long readULong();
|
||||
double readDouble();
|
||||
std::string readString();
|
||||
void readCharArray(char* data, int size);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "LOD.h"
|
||||
#include "PagedLOD.h"
|
||||
#include "PositionAttitudeTransform.h"
|
||||
#include "DOFTransform.h"
|
||||
#include "Transform.h"
|
||||
#include "Switch.h"
|
||||
#include "OccluderNode.h"
|
||||
@@ -110,6 +111,12 @@ void DataOutputStream::writeLong(long l){
|
||||
if (_verboseOutput) std::cout<<"read/writeLong() ["<<l<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeULong(unsigned long l){
|
||||
_ostream->write((char*)&l, LONGSIZE);
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeULong() ["<<l<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeDouble(double d){
|
||||
_ostream->write((char*)&d, DOUBLESIZE);
|
||||
|
||||
@@ -500,6 +507,9 @@ void DataOutputStream::writeNode(const osg::Node* node)
|
||||
else if(dynamic_cast<const osg::PositionAttitudeTransform*>(node)){
|
||||
((ive::PositionAttitudeTransform*)(node))->write(this);
|
||||
}
|
||||
else if(dynamic_cast<const osgSim::DOFTransform*>(node)){
|
||||
((ive::DOFTransform*)(node))->write(this);
|
||||
}
|
||||
else if(dynamic_cast<const osg::LightSource*>(node)){
|
||||
((ive::LightSource*)(node))->write(this);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
void writeInt(int i);
|
||||
void writeFloat(float f);
|
||||
void writeLong(long l);
|
||||
void writeULong(unsigned long l);
|
||||
void writeDouble(double d);
|
||||
void writeString(const std::string& s);
|
||||
void writeCharArray(const char* data, int size);
|
||||
|
||||
@@ -12,6 +12,7 @@ CXXFILES =\
|
||||
CullFace.cpp\
|
||||
DataInputStream.cpp\
|
||||
DataOutputStream.cpp\
|
||||
DOFTransform.cpp\
|
||||
DrawArrayLengths.cpp\
|
||||
DrawArrays.cpp\
|
||||
DrawElementsUByte.cpp\
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "Image.h"
|
||||
#include "Object.h"
|
||||
|
||||
#include <osg/Notify>
|
||||
|
||||
using namespace ive;
|
||||
|
||||
void Image::write(DataOutputStream* out)
|
||||
@@ -40,7 +42,7 @@ void Image::write(DataOutputStream* out)
|
||||
out->writeInt(r());
|
||||
|
||||
|
||||
std::cout << getFileName()<<"\t"<<s()<<"\t"<<t()<<std::endl;
|
||||
osg::notify(osg::DEBUG_INFO) << "image written '" << getFileName()<<"'\t"<<s()<<"\t"<<t()<<std::endl;
|
||||
|
||||
// Write formats, type and packing
|
||||
out->writeInt(getInternalTextureFormat());
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace ive {
|
||||
#define IVECONVEXPLANAROCCLUDER 0x00000019
|
||||
#define IVECONVEXPLANARPOLYGON 0x00000020
|
||||
#define IVEPAGEDLOD 0x00000021
|
||||
#define IVEDOFTRANSFORM 0x00000022
|
||||
|
||||
// Node callbacks
|
||||
#define IVENODECALLBACK 0x00000050
|
||||
|
||||
@@ -12,7 +12,6 @@ CXXFILES =\
|
||||
CullFace.cpp\
|
||||
ClipNode.cpp\
|
||||
Depth.cpp\
|
||||
DOFTransform.cpp\
|
||||
Drawable.cpp\
|
||||
ClearNode.cpp\
|
||||
Fog.cpp\
|
||||
|
||||
@@ -91,7 +91,7 @@ bool Node_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
while (fr.matchSequence("description %s"))
|
||||
{
|
||||
node.addDescription(fr[1].getStr());
|
||||
if (fr[1].getStr()) node.addDescription(fr[1].getStr());
|
||||
fr+=2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ TOPDIR = ../../..
|
||||
include $(TOPDIR)/Make/makedefs
|
||||
|
||||
CXXFILES =\
|
||||
IO_DOFTransform.cpp\
|
||||
IO_LightPointNode.cpp\
|
||||
IO_LightPoint.cpp\
|
||||
IO_BlinkSequence.cpp\
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "osg/DOFTransform"
|
||||
#include "osgSim/DOFTransform"
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgSim;
|
||||
using namespace osgDB;
|
||||
using namespace std;
|
||||
|
||||
@@ -15,7 +16,7 @@ bool DOFTransform_writeLocalData(const Object& obj, Output& fw);
|
||||
// register the read and write functions with the osgDB::Registry.
|
||||
RegisterDotOsgWrapperProxy g_DOFTransformProxy
|
||||
(
|
||||
new osg::DOFTransform,
|
||||
new osgSim::DOFTransform,
|
||||
"DOFTransform",
|
||||
"Object Node Transform DOFTransform Group",
|
||||
&DOFTransform_readLocalData,
|
||||
@@ -4,6 +4,7 @@ include $(TOPDIR)/Make/makedefs
|
||||
|
||||
CXXFILES = \
|
||||
ColorRange.cpp\
|
||||
DOFTransform.cpp\
|
||||
ScalarBar.cpp\
|
||||
ScalarsToColors.cpp\
|
||||
BlinkSequence.cpp\
|
||||
|
||||
Reference in New Issue
Block a user