20 namespace osg {
class Vec3f;
class Array;
class Referenced; }
23 #define mGetOsgArrPtr(tp,ptr) ((tp) ptr->getDataPointer() ) 24 #define mGetOsgVec2Arr(ptr) ((osg::Vec2Array*) ptr ) 25 #define mGetOsgVec3Arr(ptr) ((osg::Vec3Array*) ptr ) 26 #define mGetOsgVec4Arr(ptr) ((osg::Vec4Array*) ptr ) 28 #if defined(visBase_EXPORTS) || defined(VISBASE_EXPORTS) || \ 29 defined(uiOSG_EXPORTS) || defined(UIOSG_EXPORTS) 42 void unRefOsgPtr(osg::Referenced*);
43 void refOsgPtr(
const osg::Referenced*);
44 void unRefAndZeroOsgPtr(osg::Referenced*);
52 inline void set(
Coord3d& _to,
const osg::Vec3f& v )
53 { _to.x_ = v[0]; _to.y_=v[1]; _to.z_=v[2]; }
56 inline void set( osg::Vec3f& _to,
const Coord3d& v )
57 { _to.set( (
float) v.x_, (
float) v.y_, (
float) v.z_ ); }
60 inline void set(
Coord3f& _to,
const osg::Vec3f& v )
61 { _to.x_ = v[0]; _to.y_=v[1]; _to.z_=v[2]; }
64 inline void set( osg::Vec3f& _to,
const Coord3f& v )
65 { _to.set( v.x_, v.y_, v.z_ ); }
68 inline void set(
Coord2d& _to,
const osg::Vec2f& v )
69 { _to.x_ = v[0]; _to.y_=v[1]; }
72 inline void set( osg::Vec2f& _to,
const Coord2d& v )
73 { _to.set( (
float) v.x_, (
float) v.y_ ); }
76 inline void set(
Coord2f& _to,
const osg::Vec2f& v )
77 { _to.x_ = v[0]; _to.y_=v[1]; }
80 inline void set( osg::Vec2f& _to,
const Coord2f& v )
81 { _to.set( v.x_, v.y_ ); }
84 inline void set(
Coord3& _to,
const osg::Vec3d& v )
85 { _to.x_ = v[0]; _to.y_=v[1]; _to.z_=v[2]; }
88 inline void set( osg::Vec3d& _to,
const Coord3& v )
89 { _to.set( v.x_, v.y_, v.z_ ); }
91 #define mIsOsgVec3Def( pos ) \ 92 ( pos[0]<mUdf(float) && pos[1]<mUdf(float) && pos[2]<mUdf(float) ) 94 #define mODColVal(val) ( val<=0.0 ? 0 : val>=1.0 ? 255 : mNINT32(255*val) ) 95 #define mOsgColValF(val) ( val<=0 ? 0.0f : val>=255 ? 1.0f : float(val)/255 ) 96 #define mOsgColValD(val) ( val<=0 ? 0.0 : val>=255 ? 1.0 : double(val)/255 ) 99 inline void set(
Color& _to,
const osg::Vec4f& col )
100 { _to.set( mODColVal(col[0]), mODColVal(col[1]),
101 mODColVal(col[2]), 255-mODColVal(col[3]) ); }
104 inline void set( osg::Vec4f& _to,
const Color& col )
105 { _to.set( mOsgColValF(col.r()), mOsgColValF(col.g()),
106 mOsgColValF(col.b()), 1.0f-mOsgColValF(col.t()) ); }
109 inline void set(
Color& _to,
const osg::Vec4d& col )
110 { _to.set( mODColVal(col[0]), mODColVal(col[1]),
111 mODColVal(col[2]), 255-mODColVal(col[3]) ); }
114 inline void set( osg::Vec4d& _to,
const Color& col )
115 { _to.set( mOsgColValD(col.r()), mOsgColValD(col.g()),
116 mOsgColValD(col.b()), 1.0-mOsgColValD(col.t()) ); }
123 class Undef<osg::Vec3f>
126 static void setUdf( osg::Vec3f& i ) {}
130 class Undef<osg::Vec3d>
133 static void setUdf( osg::Vec3d& i ) {}
137 class Undef<osg::Vec2f>
140 static void setUdf( osg::Vec2f& i ) {}
144 class Undef<osg::Vec2d>
147 static void setUdf( osg::Vec2d& i ) {}
152 class Undef<osg::Vec4f>
155 static void setUdf( osg::Vec4f& i ) {}
159 class Undef<osg::Vec4d>
162 static void setUdf( osg::Vec4d& i ) {}
178 OneFrameCullDisabler(osg::Node*);
179 virtual void operator()(osg::Node*,osg::NodeVisitor*);
182 #define mAttachOneFrameCullDisabler( osgnode ) \ 183 osg::ref_ptr<OneFrameCullDisabler> oneframeculldisablerof##osgnode = \ 184 new OneFrameCullDisabler( osgnode ); #define mExpClass(module)
Definition: commondefs.h:157
Templatized undefined and initialisation (i.e. null) values.
Definition: color.h:113
FixedString Undef()
Definition: keystrs.h:139
3D point or vector
Definition: commontypes.h:57
Definition: visannot.h:40
Open Scene Graph.
Definition: visannot.h:26
T & setUdf(T &u)
Definition: undefval.h:260
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
Template based type conversion.
Definition: convert.h:22
2D point or vector class.
Definition: commontypes.h:58