Added support for reading and writing Sphere, Box, Cone, Cylinder and Grid shapes.
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -123,7 +123,6 @@ Ruben Lopez <ryu@gpul.org>
|
||||
Pavel Moloshtan <pasha@moloshtan.com>
|
||||
- Support for LWO2 format in the LightWave loader.
|
||||
|
||||
|
||||
Daniel Sj<53>lie <deepone@acc.umu.se>
|
||||
- Support for multitextured flt files.
|
||||
|
||||
|
||||
@@ -189,6 +189,10 @@ SOURCE=..\..\Include\osgDB\Output
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgDB\ParameterOutput
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\osgDB\ReaderWriter
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -246,6 +246,10 @@ SOURCE=..\..\..\src\osgPlugins\osg\ShadeModel.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osg\Shape.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osg\ShapeDrawable.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -287,8 +287,8 @@ class Cylinder : public Shape
|
||||
|
||||
Cylinder():
|
||||
_center(0.0f,0.0f,0.0f),
|
||||
_radius(-1.0f),
|
||||
_height(0.0f) {}
|
||||
_radius(1.0f),
|
||||
_height(1.0f) {}
|
||||
|
||||
Cylinder(const osg::Vec3& center,float radius,float height):
|
||||
_center(center),
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
#ifndef OSGDB_FIELDREADERITERATOR
|
||||
#define OSGDB_FIELDREADERITERATOR 1
|
||||
|
||||
#include <osg/Vec2>
|
||||
#include <osg/Vec2>
|
||||
#include <osg/Vec4>
|
||||
|
||||
#include <osgDB/Field>
|
||||
#include <osgDB/FieldReader>
|
||||
|
||||
@@ -48,6 +52,22 @@ class OSGDB_EXPORT FieldReaderIterator
|
||||
void advanceToEndOfBlock(int noNestBrackets);
|
||||
|
||||
bool matchSequence(const char* str);
|
||||
|
||||
bool readSequence(const char* keyword,std::string& value);
|
||||
bool readSequence(const char* keyword,unsigned int& value);
|
||||
bool readSequence(const char* keyword,int& value);
|
||||
bool readSequence(const char* keyword,float& value);
|
||||
bool readSequence(const char* keyword,osg::Vec2& value);
|
||||
bool readSequence(const char* keyword,osg::Vec3& value);
|
||||
bool readSequence(const char* keyword,osg::Vec4& value);
|
||||
|
||||
bool readSequence(std::string& value);
|
||||
bool readSequence(unsigned int& value);
|
||||
bool readSequence(int& value);
|
||||
bool readSequence(float& value);
|
||||
bool readSequence(osg::Vec2& value);
|
||||
bool readSequence(osg::Vec3& value);
|
||||
bool readSequence(osg::Vec4& value);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ class OSGDB_EXPORT Output : public std::ofstream
|
||||
void moveOut();
|
||||
|
||||
virtual bool writeObject(const osg::Object& obj);
|
||||
|
||||
|
||||
bool getUniqueIDForObject(const osg::Object* obj,std::string& uniqueID);
|
||||
bool createUniqueIDForObject(const osg::Object* obj,std::string& uniqueID);
|
||||
@@ -68,6 +69,7 @@ class OSGDB_EXPORT Output : public std::ofstream
|
||||
|
||||
virtual const std::string getFileNameForOutput(const std::string& filename) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// prevent copy construction and assignment.
|
||||
@@ -90,34 +92,6 @@ class OSGDB_EXPORT Output : public std::ofstream
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
bool writeArrayBlock(Output& fw,T* start,T* finish)
|
||||
{
|
||||
fw.indent() << "{" << std::endl;
|
||||
fw.moveIn();
|
||||
int numIndicesThisLine = 0;
|
||||
for(T* itr=start;itr!=finish;++itr)
|
||||
{
|
||||
if (numIndicesThisLine>=fw.getNumIndicesPerLine())
|
||||
{
|
||||
fw << std::endl;
|
||||
numIndicesThisLine = 0;
|
||||
}
|
||||
|
||||
if (numIndicesThisLine==0) fw.indent();
|
||||
else fw << " ";
|
||||
|
||||
fw << *itr;
|
||||
|
||||
++numIndicesThisLine;
|
||||
|
||||
}
|
||||
fw << std::endl;
|
||||
fw.moveOut();
|
||||
fw.indent() << "}" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // __SG_OUTPUT_H
|
||||
|
||||
173
include/osgDB/ParameterOutput
Normal file
173
include/osgDB/ParameterOutput
Normal file
@@ -0,0 +1,173 @@
|
||||
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
||||
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
||||
//as published by the Free Software Foundation.
|
||||
|
||||
#ifndef OSGDB_PARAMETEROUTPUT
|
||||
#define OSGDB_PARAMETEROUTPUT 1
|
||||
|
||||
#include <osgDB/Output>
|
||||
|
||||
namespace osgDB {
|
||||
|
||||
class OSGDB_EXPORT ParameterOutput
|
||||
{
|
||||
public:
|
||||
|
||||
ParameterOutput(Output& fw):
|
||||
_fw(fw),
|
||||
_numItemsPerLine(fw.getNumIndicesPerLine()),
|
||||
_column(0) {}
|
||||
|
||||
ParameterOutput(Output& fw,int numItemsPerLine):
|
||||
_fw(fw),
|
||||
_numItemsPerLine(numItemsPerLine),
|
||||
_column(0) {}
|
||||
|
||||
void begin()
|
||||
{
|
||||
_fw.indent() << "{"<<std::endl;
|
||||
_fw.moveIn();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void write(const T& t)
|
||||
{
|
||||
if (_column==0) _fw.indent();
|
||||
|
||||
_fw << t;
|
||||
|
||||
++_column;
|
||||
if (_column==_numItemsPerLine)
|
||||
{
|
||||
_fw << std::endl;
|
||||
_column = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_fw << " ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<class Iterator>
|
||||
void write(Iterator first, Iterator last)
|
||||
{
|
||||
for(Iterator itr=first;
|
||||
itr!=last;
|
||||
++itr)
|
||||
{
|
||||
write(*itr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<class Iterator>
|
||||
void writeAsInts(Iterator first, Iterator last)
|
||||
{
|
||||
for(Iterator itr=first;
|
||||
itr!=last;
|
||||
++itr)
|
||||
{
|
||||
write((int)*itr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void newLine()
|
||||
{
|
||||
if (_column!=0) _fw << std::endl;
|
||||
_column = 0;
|
||||
}
|
||||
|
||||
void end()
|
||||
{
|
||||
if (_column!=0) _fw << std::endl;
|
||||
_fw.moveOut();
|
||||
_fw.indent() << "}"<<std::endl;
|
||||
_column = 0;
|
||||
}
|
||||
|
||||
Output& _fw;
|
||||
int _numItemsPerLine;
|
||||
int _column;
|
||||
|
||||
};
|
||||
|
||||
|
||||
template<class Iterator>
|
||||
void writeArray(Output& fw, Iterator first, Iterator last,int noItemsPerLine=0)
|
||||
{
|
||||
if (noItemsPerLine==0) noItemsPerLine=fw.getNumIndicesPerLine();
|
||||
|
||||
fw.indent() << "{"<<std::endl;
|
||||
fw.moveIn();
|
||||
|
||||
int column=0;
|
||||
|
||||
for(Iterator itr=first;
|
||||
itr!=last;
|
||||
++itr)
|
||||
{
|
||||
if (column==0) fw.indent();
|
||||
|
||||
fw << *itr;
|
||||
|
||||
++column;
|
||||
if (column==noItemsPerLine)
|
||||
{
|
||||
fw << std::endl;
|
||||
column = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fw << " ";
|
||||
}
|
||||
}
|
||||
if (column!=0) fw << std::endl;
|
||||
|
||||
fw.moveOut();
|
||||
fw.indent()<<"}"<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<class Iterator>
|
||||
void writeArrayAsInts(Output& fw, Iterator first, Iterator last,int noItemsPerLine=0)
|
||||
{
|
||||
if (noItemsPerLine==0) noItemsPerLine=fw.getNumIndicesPerLine();
|
||||
|
||||
fw.indent() << "{"<<std::endl;
|
||||
fw.moveIn();
|
||||
|
||||
int column=0;
|
||||
|
||||
for(Iterator itr=first;
|
||||
itr!=last;
|
||||
++itr)
|
||||
{
|
||||
if (column==0) fw.indent();
|
||||
|
||||
fw << (int)*itr;
|
||||
|
||||
++column;
|
||||
if (column==noItemsPerLine)
|
||||
{
|
||||
fw << std::endl;
|
||||
column = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fw << " ";
|
||||
}
|
||||
}
|
||||
if (column!=0) fw << std::endl;
|
||||
|
||||
fw.moveOut();
|
||||
fw.indent()<<"}"<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif // __SG_OUTPUT_H
|
||||
@@ -734,6 +734,8 @@ void ComputeBoundShapeVisitor::apply(const ConvexHull& hull)
|
||||
void ComputeBoundShapeVisitor::apply(const HeightField& field)
|
||||
{
|
||||
|
||||
|
||||
|
||||
float zMin=FLT_MAX;
|
||||
float zMax=-FLT_MAX;
|
||||
|
||||
@@ -747,6 +749,12 @@ void ComputeBoundShapeVisitor::apply(const HeightField& field)
|
||||
}
|
||||
}
|
||||
|
||||
if (zMin>zMax)
|
||||
{
|
||||
// no valid entries so don't reset the bounding box
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (field.zeroRotation())
|
||||
{
|
||||
|
||||
@@ -377,3 +377,164 @@ bool FieldReaderIterator::matchSequence(const char* str)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,std::string& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) && (*this)[1].isString())
|
||||
{
|
||||
value = (*this)[1].getStr();
|
||||
(*this)+=2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,unsigned int& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) && (*this)[1].getUInt(value))
|
||||
{
|
||||
(*this)+=2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,int& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) && (*this)[1].getInt(value))
|
||||
{
|
||||
(*this)+=2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,float& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) &&
|
||||
(*this)[1].getFloat(value))
|
||||
{
|
||||
(*this)+=2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,osg::Vec2& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) &&
|
||||
(*this)[1].getFloat(value[0]) &&
|
||||
(*this)[2].getFloat(value[1]))
|
||||
{
|
||||
(*this)+=3;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,osg::Vec3& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) &&
|
||||
(*this)[1].getFloat(value[0]) &&
|
||||
(*this)[2].getFloat(value[1]) &&
|
||||
(*this)[3].getFloat(value[2]))
|
||||
{
|
||||
(*this)+=4;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(const char* keyword,osg::Vec4& value)
|
||||
{
|
||||
if ((*this)[0].matchWord(keyword) &&
|
||||
(*this)[1].getFloat(value[0]) &&
|
||||
(*this)[2].getFloat(value[1]) &&
|
||||
(*this)[3].getFloat(value[2]) &&
|
||||
(*this)[4].getFloat(value[3]))
|
||||
{
|
||||
(*this)+=5;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(std::string& value)
|
||||
{
|
||||
if ((*this)[0].isString())
|
||||
{
|
||||
value = (*this)[0].getStr();
|
||||
(*this)+=1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(unsigned int& value)
|
||||
{
|
||||
if ((*this)[0].getUInt(value))
|
||||
{
|
||||
(*this)+=1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(int& value)
|
||||
{
|
||||
if ((*this)[0].getInt(value))
|
||||
{
|
||||
(*this)+=1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(float& value)
|
||||
{
|
||||
if ((*this)[0].getFloat(value))
|
||||
{
|
||||
(*this)+=1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(osg::Vec2& value)
|
||||
{
|
||||
if ((*this)[0].getFloat(value[0]) &&
|
||||
(*this)[1].getFloat(value[1]))
|
||||
{
|
||||
(*this)+=2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(osg::Vec3& value)
|
||||
{
|
||||
if ((*this)[0].getFloat(value[0]) &&
|
||||
(*this)[1].getFloat(value[1]) &&
|
||||
(*this)[2].getFloat(value[2]))
|
||||
{
|
||||
(*this)+=3;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FieldReaderIterator::readSequence(osg::Vec4& value)
|
||||
{
|
||||
if ((*this)[0].getFloat(value[0]) &&
|
||||
(*this)[1].getFloat(value[1]) &&
|
||||
(*this)[2].getFloat(value[2]) &&
|
||||
(*this)[3].getFloat(value[3]))
|
||||
{
|
||||
(*this)+=4;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "osg/Drawable"
|
||||
#include "osg/Notify"
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
@@ -34,6 +35,16 @@ bool Drawable_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
ref_ptr<Object> readObject = fr.readObject();
|
||||
if (readObject.valid())
|
||||
{
|
||||
osg::Shape* shape = dynamic_cast<osg::Shape*>(readObject.get());
|
||||
if (shape) drawable.setShape(shape);
|
||||
else notify(WARN)<<"Warning:: "<<readObject->className()<<" loaded but cannot not be attached to Drawable."<<std::endl;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
|
||||
if (fr[0].matchWord("supportsDisplayList"))
|
||||
{
|
||||
if (fr[1].matchWord("TRUE"))
|
||||
@@ -65,6 +76,7 @@ bool Drawable_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
@@ -79,6 +91,11 @@ bool Drawable_writeLocalData(const Object& obj, Output& fw)
|
||||
fw.writeObject(*drawable.getStateSet());
|
||||
}
|
||||
|
||||
if (drawable.getShape())
|
||||
{
|
||||
fw.writeObject(*drawable.getShape());
|
||||
}
|
||||
|
||||
if (!drawable.getSupportsDisplayList())
|
||||
{
|
||||
fw.indent()<<"supportsDisplayList ";
|
||||
@@ -90,5 +107,6 @@ bool Drawable_writeLocalData(const Object& obj, Output& fw)
|
||||
if (drawable.getUseDisplayList()) fw << "TRUE" << std::endl;
|
||||
else fw << "FALSE" << std::endl;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
#include "osgDB/ParameterOutput"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
@@ -717,7 +717,7 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
|
||||
}
|
||||
if (writeOutPrimitiveLengths)
|
||||
{
|
||||
writeArrayBlock(fw,geoset.getPrimLengths(),geoset.getPrimLengths()+geoset.getNumPrims());
|
||||
writeArray(fw,geoset.getPrimLengths(),geoset.getPrimLengths()+geoset.getNumPrims());
|
||||
}
|
||||
|
||||
GeoSet& non_const_geoset = const_cast<GeoSet&>(geoset);
|
||||
@@ -1010,13 +1010,13 @@ bool GeoSet_writeIndexData(Output& fw, const char* IndexName,const GeoSet::Index
|
||||
{
|
||||
// write our CoordIndex
|
||||
fw.indent() << IndexName << " ushort " << ip._size<< std::endl;
|
||||
writeArrayBlock(fw,ip._ptr._ushort,ip._ptr._ushort+ip._size);
|
||||
writeArray(fw,ip._ptr._ushort,ip._ptr._ushort+ip._size);
|
||||
}
|
||||
else
|
||||
{
|
||||
// write our CoordIndex
|
||||
fw.indent() << IndexName << " uint " << ip._size<< std::endl;
|
||||
writeArrayBlock(fw,ip._ptr._uint,ip._ptr._uint+ip._size);
|
||||
writeArray(fw,ip._ptr._uint,ip._ptr._uint+ip._size);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
#include <osgDB/ParameterOutput>
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
@@ -557,74 +557,6 @@ Array* Array_readLocalData(Input& fr)
|
||||
}
|
||||
|
||||
|
||||
template<class Iterator>
|
||||
void Array_writeLocalData(Output& fw, Iterator first, Iterator last,int noItemsPerLine=8)
|
||||
{
|
||||
fw.indent() << "{"<<std::endl;
|
||||
fw.moveIn();
|
||||
|
||||
int column=0;
|
||||
|
||||
for(Iterator itr=first;
|
||||
itr!=last;
|
||||
++itr)
|
||||
{
|
||||
if (column==0) fw.indent();
|
||||
|
||||
fw << *itr;
|
||||
|
||||
++column;
|
||||
if (column==noItemsPerLine)
|
||||
{
|
||||
fw << std::endl;
|
||||
column = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fw << " ";
|
||||
}
|
||||
}
|
||||
if (column!=0) fw << std::endl;
|
||||
|
||||
fw.moveOut();
|
||||
fw.indent()<<"}"<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
template<class Iterator>
|
||||
void Array_writeLocalDataAsInts(Output& fw, Iterator first, Iterator last,int noItemsPerLine=8)
|
||||
{
|
||||
fw.indent() << "{"<<std::endl;
|
||||
fw.moveIn();
|
||||
|
||||
int column=0;
|
||||
|
||||
for(Iterator itr=first;
|
||||
itr!=last;
|
||||
++itr)
|
||||
{
|
||||
if (column==0) fw.indent();
|
||||
|
||||
fw << (int)*itr;
|
||||
|
||||
++column;
|
||||
if (column==noItemsPerLine)
|
||||
{
|
||||
fw << std::endl;
|
||||
column = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fw << " ";
|
||||
}
|
||||
}
|
||||
if (column!=0) fw << std::endl;
|
||||
|
||||
fw.moveOut();
|
||||
fw.indent()<<"}"<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
if (array.referenceCount()>1)
|
||||
@@ -651,7 +583,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const ByteArray& carray = static_cast<const ByteArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalDataAsInts(fw,carray.begin(),carray.end());
|
||||
writeArrayAsInts(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -659,7 +591,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const ShortArray& carray = static_cast<const ShortArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end());
|
||||
writeArray(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -667,7 +599,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const IntArray& carray = static_cast<const IntArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end());
|
||||
writeArray(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -675,7 +607,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const UByteArray& carray = static_cast<const UByteArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalDataAsInts(fw,carray.begin(),carray.end());
|
||||
writeArrayAsInts(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -683,7 +615,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const UShortArray& carray = static_cast<const UShortArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end());
|
||||
writeArray(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -691,7 +623,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const UIntArray& carray = static_cast<const UIntArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<" ";
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end());
|
||||
writeArray(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -699,7 +631,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const UByte4Array& carray = static_cast<const UByte4Array&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<" ";
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end(),1);
|
||||
writeArray(fw,carray.begin(),carray.end(),1);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -707,7 +639,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const FloatArray& carray = static_cast<const FloatArray&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end());
|
||||
writeArray(fw,carray.begin(),carray.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -715,7 +647,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const Vec2Array& carray = static_cast<const Vec2Array&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end(),1);
|
||||
writeArray(fw,carray.begin(),carray.end(),1);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -723,7 +655,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const Vec3Array& carray = static_cast<const Vec3Array&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end(),1);
|
||||
writeArray(fw,carray.begin(),carray.end(),1);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -731,7 +663,7 @@ bool Array_writeLocalData(const Array& array,Output& fw)
|
||||
{
|
||||
const Vec4Array& carray = static_cast<const Vec4Array&>(array);
|
||||
fw<<array.className()<<" "<<carray.size()<<std::endl;
|
||||
Array_writeLocalData(fw,carray.begin(),carray.end(),1);
|
||||
writeArray(fw,carray.begin(),carray.end(),1);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -912,7 +844,7 @@ bool Primitive_writeLocalData(const PrimitiveSet& prim,Output& fw)
|
||||
{
|
||||
const DrawArrayLengths& cprim = static_cast<const DrawArrayLengths&>(prim);
|
||||
fw<<cprim.className()<<" "<<Geometry_getPrimitiveModeStr(cprim.getMode())<<" "<<cprim.getFirst()<<" "<<cprim.size()<<std::endl;
|
||||
Array_writeLocalData(fw,cprim.begin(),cprim.end());
|
||||
writeArray(fw,cprim.begin(),cprim.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -920,7 +852,7 @@ bool Primitive_writeLocalData(const PrimitiveSet& prim,Output& fw)
|
||||
{
|
||||
const DrawElementsUByte& cprim = static_cast<const DrawElementsUByte&>(prim);
|
||||
fw<<cprim.className()<<" "<<Geometry_getPrimitiveModeStr(cprim.getMode())<<" "<<cprim.size()<<std::endl;
|
||||
Array_writeLocalData(fw,cprim.begin(),cprim.end());
|
||||
writeArrayAsInts(fw,cprim.begin(),cprim.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -928,7 +860,7 @@ bool Primitive_writeLocalData(const PrimitiveSet& prim,Output& fw)
|
||||
{
|
||||
const DrawElementsUShort& cprim = static_cast<const DrawElementsUShort&>(prim);
|
||||
fw<<cprim.className()<<" "<<Geometry_getPrimitiveModeStr(cprim.getMode())<<" "<<cprim.size()<<std::endl;
|
||||
Array_writeLocalData(fw,cprim.begin(),cprim.end());
|
||||
writeArray(fw,cprim.begin(),cprim.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -936,7 +868,7 @@ bool Primitive_writeLocalData(const PrimitiveSet& prim,Output& fw)
|
||||
{
|
||||
const DrawElementsUInt& cprim = static_cast<const DrawElementsUInt&>(prim);
|
||||
fw<<cprim.className()<<" "<<Geometry_getPrimitiveModeStr(cprim.getMode())<<" "<<cprim.size()<<std::endl;
|
||||
Array_writeLocalData(fw,cprim.begin(),cprim.end());
|
||||
writeArray(fw,cprim.begin(),cprim.end());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -41,6 +41,7 @@ CXXFILES =\
|
||||
Projection.cpp\
|
||||
ReaderWriterOSG.cpp\
|
||||
ShadeModel.cpp\
|
||||
Shape.cpp\
|
||||
ShapeDrawable.cpp\
|
||||
StateSet.cpp\
|
||||
Sequence.cpp\
|
||||
|
||||
Reference in New Issue
Block a user