Jean-Yves Didier

Modification bibliothèque.

Travail sur l'interfaçage de l'ensemble.
......@@ -2,4 +2,4 @@
network;network;distribution protocol;remote component
utils;utils;various tools
gui;gui;Qt widgets;integration
coin;scene/coin;Inventor
coin;scene/con;Inventor
......
......@@ -24,7 +24,7 @@ template<class T> class InventorField : public ARCSTypeFactoryTemplate<T>
{
public:
virtual QString getTypeName() const; // const { return QString; };
virtual bool isInternal() const { return true; }
virtual bool isInternal() const { return false; }
protected:
virtual T parse(QString s);
......
<library>
<related path="applications/coin"/>
<related path="applications/scenedit.xml"/>
<headers>
<header name="inventorfamily.h"/>
<header name="inventortypes.h"/>
......
#ifndef OSG2_BINARYSTREAMOPERATOR
#define OSG2_BINARYSTREAMOPERATOR
#include <osgDB/StreamOperator>
class BinaryOutputIterator : public osgDB::OutputIterator
{
public:
BinaryOutputIterator( std::ostream* ostream ) { _out = ostream; }
virtual ~BinaryOutputIterator() {}
virtual bool isBinary() const { return true; }
virtual void writeBool( bool b )
{ char c = b?1:0; _out->write( &c, osgDB::CHAR_SIZE ); }
virtual void writeChar( char c )
{ _out->write( &c, osgDB::CHAR_SIZE ); }
virtual void writeUChar( unsigned char c )
{ _out->write( (char*)&c, osgDB::CHAR_SIZE ); }
virtual void writeShort( short s )
{ _out->write( (char*)&s, osgDB::SHORT_SIZE ); }
virtual void writeUShort( unsigned short s )
{ _out->write( (char*)&s, osgDB::SHORT_SIZE ); }
virtual void writeInt( int i )
{ _out->write( (char*)&i, osgDB::INT_SIZE ); }
virtual void writeUInt( unsigned int i )
{ _out->write( (char*)&i, osgDB::INT_SIZE ); }
virtual void writeLong( long l )
{ _out->write( (char*)&l, osgDB::LONG_SIZE ); }
virtual void writeULong( unsigned long l )
{ _out->write( (char*)&l, osgDB::LONG_SIZE ); }
virtual void writeFloat( float f )
{ _out->write( (char*)&f, osgDB::FLOAT_SIZE ); }
virtual void writeDouble( double d )
{ _out->write((char*)&d, osgDB::DOUBLE_SIZE); }
virtual void writeString( const std::string& s )
{
int size = s.size();
_out->write( (char*)&size, osgDB::INT_SIZE );
_out->write( s.c_str(), s.size() );
}
virtual void writeStream( std::ostream& (*/*fn*/)(std::ostream&) ) {}
virtual void writeBase( std::ios_base& (*/*fn*/)(std::ios_base&) ) {}
virtual void writeGLenum( const osgDB::ObjectGLenum& value )
{ GLenum e = value.get(); _out->write((char*)&e, osgDB::GLENUM_SIZE); }
virtual void writeProperty( const osgDB::ObjectProperty& prop )
{ if (prop._mapProperty) _out->write((char*)&(prop._value), osgDB::INT_SIZE); }
virtual void writeMark( const osgDB::ObjectMark& /*mark*/ ) {}
virtual void writeCharArray( const char* s, unsigned int size )
{ if ( size>0 ) _out->write( s, size ); }
virtual void writeWrappedString( const std::string& str )
{ writeString( str ); }
};
class BinaryInputIterator : public osgDB::InputIterator
{
public:
BinaryInputIterator( std::istream* istream ) : _byteSwap(0) { _in = istream; }
virtual ~BinaryInputIterator() {}
virtual bool isBinary() const { return true; }
virtual void readBool( bool& b )
{
char c = 0;
_in->read( &c, osgDB::CHAR_SIZE );
b = (c!=0);
}
virtual void readChar( char& c )
{ _in->read( &c, osgDB::CHAR_SIZE ); }
virtual void readSChar( signed char& c )
{ _in->read( (char*)&c, osgDB::CHAR_SIZE ); }
virtual void readUChar( unsigned char& c )
{ _in->read( (char*)&c, osgDB::CHAR_SIZE ); }
virtual void readShort( short& s )
{
_in->read( (char*)&s, osgDB::SHORT_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&s, osgDB::SHORT_SIZE );
}
virtual void readUShort( unsigned short& s )
{
_in->read( (char*)&s, osgDB::SHORT_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&s, osgDB::SHORT_SIZE );
}
virtual void readInt( int& i )
{
_in->read( (char*)&i, osgDB::INT_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&i, osgDB::INT_SIZE );
}
virtual void readUInt( unsigned int& i )
{
_in->read( (char*)&i, osgDB::INT_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&i, osgDB::INT_SIZE );
}
virtual void readLong( long& l )
{
_in->read( (char*)&l, osgDB::LONG_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&l, osgDB::LONG_SIZE );
}
virtual void readULong( unsigned long& l )
{
_in->read( (char*)&l, osgDB::LONG_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&l, osgDB::LONG_SIZE );
}
virtual void readFloat( float& f )
{
_in->read( (char*)&f, osgDB::FLOAT_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&f, osgDB::FLOAT_SIZE );
}
virtual void readDouble( double& d )
{
_in->read( (char*)&d, osgDB::DOUBLE_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&d, osgDB::DOUBLE_SIZE );
}
virtual void readString( std::string& s )
{
int size = 0; readInt( size );
if ( size )
{
s.resize( size );
_in->read( (char*)s.c_str(), size );
}
}
virtual void readStream( std::istream& (*/*fn*/)(std::istream&) ) {}
virtual void readBase( std::ios_base& (*/*fn*/)(std::ios_base&) ) {}
virtual void readGLenum( osgDB::ObjectGLenum& value )
{
GLenum e = 0;
_in->read( (char*)&e, osgDB::GLENUM_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&e, osgDB::GLENUM_SIZE );
value.set( e );
}
virtual void readProperty( osgDB::ObjectProperty& prop )
{
int value = 0;
if ( prop._mapProperty )
{
_in->read( (char*)&value, osgDB::INT_SIZE );
if ( _byteSwap ) osg::swapBytes( (char*)&value, osgDB::INT_SIZE );
}
prop.set( value );
}
virtual void readMark( osgDB::ObjectMark& /*mark*/ ) {}
virtual void readCharArray( char* s, unsigned int size )
{ if ( size>0 ) _in->read( s, size ); }
virtual void readWrappedString( std::string& str )
{ readString( str ); }
protected:
int _byteSwap;
};
#endif
#include "osgslotwrapper.h"
OSGSlotWrapper::OSGSlotWrapper(QObject *parent) :
QObject(parent)
{
}
#ifndef __OSGSLOTWRAPPER_H__
#define __OSGSLOTWRAPPER_H__
#include <QObject>
#include <osg/Object>
class OSGSlotWrapper : public QObject
{
Q_OBJECT
public:
explicit OSGSlotWrapper(QObject *parent = 0);
public slots:
void call(osg::Object data);
void call(osg::Image data);
void call(bool data);
void call(char data);
void call(unsigned char data);
void call(short data);
void call(unsigned short data);
void call(int data);
void call(unsigned int data);
void call(float data);
void call(double data);
void call(osg::Vec2f data);
void call(osg::Vec2d data);
void call(osg::Vec2f data);
void call(osg::Vec3d data);
void call(osg::Vec3f data);
void call(osg::Vec4f data);
void call(osg::Vec4d data);
void call(osg::Quat data);
void call(osg::Plane data);
void call(osg::Matrixf data);
void call(osg::Matrixd data);
void call(osg::Matrix data);
void call(GLenum data);
void call(std::string data);
private:
};
#endif // __OSGSLOTWRAPPER_H__
#ifndef __OSGTYPES_H__
#define __OSGTYPES_H__
#endif // __OSGTYPES_H__