Convert tabs to spaces.

This commit is contained in:
Robert Osfield 2005-11-17 17:44:48 +00:00
parent f391b0ff2c
commit 35fcaf7bde
58 changed files with 608 additions and 611 deletions

View File

@ -45,7 +45,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
class ControlPoint
{
public:
public:
ControlPoint():
_scale(1.0,1.0,1.0) {}
@ -64,14 +64,14 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
_rotation(rotation),
_scale(scale) {}
void setPosition(const osg::Vec3d& position) { _position = position; }
const osg::Vec3d& getPosition() const { return _position; }
void setPosition(const osg::Vec3d& position) { _position = position; }
const osg::Vec3d& getPosition() const { return _position; }
void setRotation(const osg::Quat& rotation) { _rotation = rotation; }
const osg::Quat& getRotation() const { return _rotation; }
void setRotation(const osg::Quat& rotation) { _rotation = rotation; }
const osg::Quat& getRotation() const { return _rotation; }
void setScale(const osg::Vec3d& scale) { _scale = scale; }
const osg::Vec3d& getScale() const { return _scale; }
void setScale(const osg::Vec3d& scale) { _scale = scale; }
const osg::Vec3d& getScale() const { return _scale; }
inline void interpolate(float ratio,const ControlPoint& first, const ControlPoint& second)
{
@ -116,8 +116,8 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
matrix.preMult(osg::Matrixd::rotate(_rotation.inverse()));
matrix.preMult(osg::Matrixd::translate(-_position));
}
protected:
protected:
osg::Vec3d _position;
osg::Quat _rotation;

View File

@ -66,13 +66,13 @@ class OSG_EXPORT Billboard : public Geode
typedef std::vector<Vec3> PositionList;
/** Set the list of pivot point positions. */
inline void setPositionList(PositionList& pl) { _positionList=pl; }
inline void setPositionList(PositionList& pl) { _positionList=pl; }
/** Get the list of pivot point positions. */
inline PositionList& getPositionList() { return _positionList; }
inline PositionList& getPositionList() { return _positionList; }
/** Get a const list of pivot point positions. */
inline const PositionList& getPositionList() const { return _positionList; }
inline const PositionList& getPositionList() const { return _positionList; }
/** Add a Drawable with a default position of Vec3(0,0,0).
* Call the base-class Geode::addDrawble() to add the given Drawable

View File

@ -33,7 +33,7 @@ class OSG_EXPORT ClipNode : public Group
ClipNode(const ClipNode& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(osg, ClipNode);
/** Creates six clip planes corresponding to the given BoundingBox. */
void createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberBase=0);

View File

@ -72,9 +72,9 @@ class OSG_EXPORT ClipPlane : public StateAttribute
/** Set the clip plane with the given Plane. */
void setClipPlane(const Plane& plane)
{
{
_clipPlane.set(plane[0],plane[1],plane[2],plane[3]);
}
}
/** Defines the plane as [ a b c d ]. */
void setClipPlane(double a,double b,double c,double d)

View File

@ -34,7 +34,7 @@ class OSG_EXPORT ClusterCullingCallback : public Drawable::CullCallback, public
META_Object(osg,ClusterCullingCallback);
/** Computes the control point, normal, and deviation from the
* given drawable contents. */
* given drawable contents. */
void computeFrom(const osg::Drawable* drawable);
/** Transform the ClusterCullingCallback's positional members to a new coordinate frame.*/

View File

@ -47,13 +47,13 @@ class OSG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::
virtual void apply(osg::OccluderNode& node);
/** Sets the minimum shadow occluder volume that an active occluder
* must have. vol is units relative the clip space volume where 1.0
* is the whole clip space. */
* must have. vol is units relative the clip space volume where 1.0
* is the whole clip space. */
void setMinimumShadowOccluderVolume(float vol) { _minimumShadowOccluderVolume = vol; }
float getMinimumShadowOccluderVolume() const { return _minimumShadowOccluderVolume; }
/** Sets the maximum number of occluders to have active for culling
* purposes. */
* purposes. */
void setMaximumNumberOfActiveOccluders(unsigned int num) { _maximumNumberOfActiveOccluders = num; }
unsigned int getMaximumNumberOfActiveOccluders() const { return _maximumNumberOfActiveOccluders; }
@ -65,7 +65,7 @@ class OSG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::
const ShadowVolumeOccluderSet& getCollectedOccluderSet() const { return _occluderSet; }
/** Removes occluded occluders for the collected occluders list, then
* discards all but MaximumNumberOfActiveOccluders of occluders,
* discards all but MaximumNumberOfActiveOccluders of occluders,
* discarding the occluders with the lowests shadow occluder volume. */
void removeOccludedOccluders();

View File

@ -39,7 +39,7 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
void setOccluder(const ConvexPlanarPolygon& cpp) { _occluder = cpp; }
ConvexPlanarPolygon& getOccluder() { return _occluder; }
const ConvexPlanarPolygon& getOccluder() const { return _occluder; }
@ -50,9 +50,9 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
void setHoleList(const HoleList& holeList) { _holeList=holeList; }
HoleList& getHoleList() { return _holeList; }
HoleList& getHoleList() { return _holeList; }
const HoleList& getHoleList() const { return _holeList; }
const HoleList& getHoleList() const { return _holeList; }
protected:
@ -63,6 +63,6 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
};
} // end of namespace
} // end of namespace
#endif

View File

@ -48,6 +48,6 @@ class OSG_EXPORT ConvexPlanarPolygon
};
} // end of namespace
} // end of namespace
#endif

View File

@ -40,19 +40,19 @@ class OSG_EXPORT CopyOp
enum Options
{
SHALLOW_COPY = 0,
DEEP_COPY_OBJECTS = 1,
DEEP_COPY_NODES = 2,
DEEP_COPY_DRAWABLES = 4,
DEEP_COPY_STATESETS = 8,
DEEP_COPY_STATEATTRIBUTES = 16,
DEEP_COPY_TEXTURES = 32,
DEEP_COPY_IMAGES = 64,
DEEP_COPY_ARRAYS = 128,
DEEP_COPY_PRIMITIVES = 256,
DEEP_COPY_SHAPES = 512,
DEEP_COPY_UNIFORMS = 1024,
DEEP_COPY_ALL = 0xffffffff
SHALLOW_COPY = 0,
DEEP_COPY_OBJECTS = 1,
DEEP_COPY_NODES = 2,
DEEP_COPY_DRAWABLES = 4,
DEEP_COPY_STATESETS = 8,
DEEP_COPY_STATEATTRIBUTES = 16,
DEEP_COPY_TEXTURES = 32,
DEEP_COPY_IMAGES = 64,
DEEP_COPY_ARRAYS = 128,
DEEP_COPY_PRIMITIVES = 256,
DEEP_COPY_SHAPES = 512,
DEEP_COPY_UNIFORMS = 1024,
DEEP_COPY_ALL = 0xffffffff
};
typedef unsigned int CopyFlags;
@ -70,8 +70,8 @@ class OSG_EXPORT CopyOp
virtual Image* operator() (const Image* image) const;
virtual Array* operator() (const Array* array) const;
virtual PrimitiveSet* operator() (const PrimitiveSet* primitives) const;
virtual Shape* operator() (const Shape* shape) const;
virtual Uniform* operator() (const Uniform* shape) const;
virtual Shape* operator() (const Shape* shape) const;
virtual Uniform* operator() (const Uniform* shape) const;
protected:

View File

@ -228,7 +228,7 @@ class OSG_EXPORT CullSettings
bool _impostorActive;
bool _depthSortImpostorSprites;
float _impostorPixelErrorThreshold;
int _numFramesToKeepImpostorSprites;
int _numFramesToKeepImpostorSprites;
Node::NodeMask _cullMask;
Node::NodeMask _cullMaskLeft;

View File

@ -186,10 +186,10 @@ class OSG_EXPORT CullStack : public osg::CullSettings
ref_ptr<osg::RefMatrix> _identity;
typedef std::vector< osg::ref_ptr<osg::RefMatrix> > MatrixList;
MatrixList _reuseMatrixList;
unsigned int _currentReuseMatrixIndex;
inline osg::RefMatrix* createOrReuseMatrix(const osg::Matrix& value);
MatrixList _reuseMatrixList;
unsigned int _currentReuseMatrixIndex;
inline osg::RefMatrix* createOrReuseMatrix(const osg::Matrix& value);
};
@ -286,6 +286,6 @@ inline RefMatrix* CullStack::createOrReuseMatrix(const osg::Matrix& value)
return matrix;
}
} // end of namespace
} // end of namespace
#endif

View File

@ -345,6 +345,6 @@ class OSG_EXPORT CullingSet : public Referenced
};
} // end of namespace
} // end of namespace
#endif

View File

@ -85,7 +85,7 @@ class OSG_EXPORT Depth : public StateAttribute
inline void setZNear(double zNear) { _zNear=zNear; }
inline double getZNear() const { return _zNear; }
inline void setZFar(double zFar) { _zFar=zFar; }
inline double getZFar() const { return _zFar; }

View File

@ -31,15 +31,15 @@
#endif
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# if defined( _LIB ) || defined( USE_STATIC )
# define OSG_EXPORT
# elif defined( OSG_LIBRARY )
# define OSG_EXPORT __declspec(dllexport)
# else
# define OSG_EXPORT __declspec(dllimport)
# endif /* SG_LIBRARY */
# if defined( _LIB ) || defined( USE_STATIC )
# define OSG_EXPORT
# elif defined( OSG_LIBRARY )
# define OSG_EXPORT __declspec(dllexport)
# else
# define OSG_EXPORT __declspec(dllimport)
# endif /* SG_LIBRARY */
#else
# define OSG_EXPORT
# define OSG_EXPORT
#endif
// set up define for whether member templates are supported by VisualStudio compilers.

View File

@ -157,7 +157,7 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
_fragmentProgram = program;
dirtyFragmentProgramObject();
}
/** Set the fragment program using C++ style string.*/
inline void setFragmentProgram( const std::string& program )
{
@ -286,7 +286,7 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
std::string _fragmentProgram;
LocalParamList _programLocalParameters;
MatrixList _matrixList;
MatrixList _matrixList;
};

View File

@ -55,13 +55,13 @@ inline void* getGLExtensionFuncPtr(const char *funcName)
#elif defined(__APPLE__)
std::string temp( "_" );
temp += funcName; // Mac OS X prepends an underscore on function names
temp += funcName; // Mac OS X prepends an underscore on function names
if ( NSIsSymbolNameDefined( temp.c_str() ) )
{
NSSymbol symbol = NSLookupAndBindSymbol( temp.c_str() );
return NSAddressOfSymbol( symbol );
} else
return NULL;
return NULL;
#elif defined (__sun)

View File

@ -110,7 +110,7 @@ class OSG_EXPORT Group : public Node
/** Get the index number of child, return a value between
* 0 and _children.size()-1 if found, if not found then
* return _children.size().
*/
*/
inline unsigned int getChildIndex( const Node* node ) const
{
for (unsigned int childNum=0;childNum<_children.size();++childNum)

View File

@ -38,7 +38,7 @@ class OSG_EXPORT ImageStream : public Image
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const Image& rhs) const;
enum StreamStatus
enum StreamStatus
{
INVALID,
PLAYING,

View File

@ -101,16 +101,16 @@ class OSG_EXPORT Light : public StateAttribute
/** Get the specular component of the light. */
inline const Vec4& getSpecular() const { return _specular; }
/** Set the position of the light. */
/** Set the position of the light. */
inline void setPosition( const Vec4& position ) { _position = position; }
/** Get the position of the light. */
/** Get the position of the light. */
inline const Vec4& getPosition() const { return _position; }
/** Set the direction of the light. */
/** Set the direction of the light. */
inline void setDirection( const Vec3& direction ) { _direction = direction; }
/** Get the direction of the light. */
/** Get the direction of the light. */
inline const Vec3& getDirection() const { return _direction; }
/** Set the constant attenuation of the light. */

View File

@ -66,7 +66,7 @@ class OSG_EXPORT LineStipple : public StateAttribute
virtual ~LineStipple();
GLint _factor;
GLushort _pattern;
GLushort _pattern;
};

View File

@ -286,8 +286,8 @@ class OSG_EXPORT Matrixd
inline Vec4d operator* ( const Vec4d& v ) const;
void setTrans( value_type tx, value_type ty, value_type tz );
void setTrans( const Vec3f& v );
void setTrans( const Vec3d& v );
void setTrans( const Vec3f& v );
void setTrans( const Vec3d& v );
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
@ -616,42 +616,42 @@ inline Vec3d Matrixd::transform3x3(const Matrixd& m,const Vec3d& v)
inline Vec3f operator* (const Vec3f& v, const Matrixd& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec3d operator* (const Vec3d& v, const Matrixd& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec4f operator* (const Vec4f& v, const Matrixd& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec4d operator* (const Vec4d& v, const Matrixd& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec3f Matrixd::operator* (const Vec3f& v) const
{
return postMult(v);
return postMult(v);
}
inline Vec3d Matrixd::operator* (const Vec3d& v) const
{
return postMult(v);
return postMult(v);
}
inline Vec4f Matrixd::operator* (const Vec4f& v) const
{
return postMult(v);
return postMult(v);
}
inline Vec4d Matrixd::operator* (const Vec4d& v) const
{
return postMult(v);
return postMult(v);
}

View File

@ -210,7 +210,7 @@ class OSG_EXPORT Matrixf
void orthoNormalize(const Matrixf& rhs);
//basic utility functions to create new matrices
inline static Matrixf identity( void );
inline static Matrixf identity( void );
inline static Matrixf scale( const Vec3f& sv);
inline static Matrixf scale( const Vec3d& sv);
inline static Matrixf scale( value_type sx, value_type sy, value_type sz);
@ -287,8 +287,8 @@ class OSG_EXPORT Matrixf
inline Vec4d operator* ( const Vec4d& v ) const;
void setTrans( value_type tx, value_type ty, value_type tz );
void setTrans( const Vec3f& v );
void setTrans( const Vec3d& v );
void setTrans( const Vec3f& v );
void setTrans( const Vec3d& v );
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
@ -325,11 +325,11 @@ class OSG_EXPORT Matrixf
}
inline Matrixf operator * ( const Matrixf &m ) const
{
osg::Matrixf r;
{
osg::Matrixf r;
r.mult(*this,m);
return r;
}
return r;
}
protected:
value_type _mat[4][4];
@ -610,36 +610,36 @@ inline Vec3d Matrixf::transform3x3(const Matrixf& m,const Vec3d& v)
inline Vec3f operator* (const Vec3f& v, const Matrixf& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec3d operator* (const Vec3d& v, const Matrixf& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec4f operator* (const Vec4f& v, const Matrixf& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec4d operator* (const Vec4d& v, const Matrixf& m )
{
return m.preMult(v);
return m.preMult(v);
}
inline Vec3f Matrixf::operator* (const Vec3f& v) const
{
return postMult(v);
return postMult(v);
}
inline Vec3d Matrixf::operator* (const Vec3d& v) const
{
return postMult(v);
return postMult(v);
}
inline Vec4f Matrixf::operator* (const Vec4f& v) const
{
return postMult(v);
return postMult(v);
}
inline Vec4d Matrixf::operator* (const Vec4d& v) const
{
return postMult(v);
return postMult(v);
}

View File

@ -83,7 +83,7 @@ class OSG_EXPORT Multisample : public StateAttribute
}
inline void setCoverage(float coverage) { _coverage=coverage; }
inline float getCoverage() const { return _coverage; }
inline void setInvert(bool invert) { _invert=invert; }
inline bool getInvert() const { return _invert; }

View File

@ -28,17 +28,17 @@ namespace osg {
class OSG_EXPORT PointSprite : public osg::StateAttribute {
public:
PointSprite() {}
PointSprite() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
PointSprite(const PointSprite& texenv,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
StateAttribute(texenv,copyop) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
PointSprite(const PointSprite& texenv,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
StateAttribute(texenv,copyop) {}
META_StateAttribute(osg, PointSprite, POINTSPRITE);
META_StateAttribute(osg, PointSprite, POINTSPRITE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const;
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const;
virtual bool getModeUsage(ModeUsage& usage) const
{
@ -46,14 +46,14 @@ public:
return true;
}
virtual bool isTextureAttribute() const { return true; }
virtual bool isTextureAttribute() const { return true; }
virtual void apply(osg::State& state) const;
virtual void apply(osg::State& state) const;
static bool isPointSpriteSupported(unsigned int context);
static bool isPointSpriteSupported(unsigned int context);
protected:
virtual ~PointSprite( void ) {}
virtual ~PointSprite( void ) {}
};
}

View File

@ -384,6 +384,6 @@ class OSG_EXPORT Polytope
};
} // end of namespace
} // end of namespace
#endif

View File

@ -172,13 +172,13 @@ inline void Referenced::unref() const
*/
class OSG_EXPORT Referenced : public NoodleGlue::CBridgable
{
public:
/** Method not used in NoodleGlue referencing
*/
inline void unref_nodelete() const { --_refCount; }
inline int referenceCount() const { return _refCount; }
protected:
virtual ~Referenced() {}
public:
/** Method not used in NoodleGlue referencing
*/
inline void unref_nodelete() const { --_refCount; }
inline int referenceCount() const { return _refCount; }
protected:
virtual ~Referenced() {}
};
#endif //OSG_JAVA_BUILD

View File

@ -167,6 +167,6 @@ inline void ShadowVolumeOccluder::popCurrentMask()
//std::cout<<"ShadowVolumeOccluder::popCurrentMasks() - _occluderVolume.getMaskStack().size()="<<_occluderVolume.getMaskStack().size()<<" "<<_occluderVolume.getCurrentMask()<<std::endl;
}
} // end of namespace
} // end of namespace
#endif

View File

@ -40,7 +40,7 @@ class ConstShapeVisitor;
virtual const char* className() const { return #name; } \
virtual void accept(osg::ShapeVisitor& sv) { sv.apply(*this); } \
virtual void accept(osg::ConstShapeVisitor& csv) const { csv.apply(*this); }
/** Base class for all shape types.
* Shapes are used to either for culling and collision detection or
* to define the geometric shape of procedurally generate Geometry.
@ -72,17 +72,17 @@ class OSG_EXPORT Shape : public Object
/** return the name of the attribute's class type.*/
virtual const char* className() const { return "Shape"; }
/** accept a non const shape visitor which can be used on non const shape objects.
/** accept a non const shape visitor which can be used on non const shape objects.
Must be defined by derived classes.*/
virtual void accept(ShapeVisitor&)=0;
/** accept a const shape visitor which can be used on const shape objects.
virtual void accept(ShapeVisitor&)=0;
/** accept a const shape visitor which can be used on const shape objects.
Must be defined by derived classes.*/
virtual void accept(ConstShapeVisitor&) const =0;
virtual void accept(ConstShapeVisitor&) const =0;
protected:
virtual ~Shape();
virtual ~Shape();
};
// forward declarations of Shape types.
@ -103,137 +103,137 @@ class ShapeVisitor
{
public:
ShapeVisitor() {}
ShapeVisitor() {}
virtual ~ShapeVisitor() {}
virtual void apply(Sphere&) {}
virtual void apply(Box&) {}
virtual void apply(Cone&) {}
virtual void apply(Cylinder&) {}
virtual void apply(Capsule&) {}
virtual void apply(InfinitePlane&) {}
virtual void apply(TriangleMesh&) {}
virtual void apply(ConvexHull&) {}
virtual void apply(HeightField&) {}
virtual void apply(Sphere&) {}
virtual void apply(Box&) {}
virtual void apply(Cone&) {}
virtual void apply(Cylinder&) {}
virtual void apply(Capsule&) {}
virtual void apply(InfinitePlane&) {}
virtual void apply(CompositeShape&) {}
virtual void apply(TriangleMesh&) {}
virtual void apply(ConvexHull&) {}
virtual void apply(HeightField&) {}
virtual void apply(CompositeShape&) {}
};
class ConstShapeVisitor
{
public:
ConstShapeVisitor() {}
ConstShapeVisitor() {}
virtual ~ConstShapeVisitor() {}
virtual void apply(const Sphere&) {}
virtual void apply(const Box&) {}
virtual void apply(const Cone&) {}
virtual void apply(const Cylinder&) {}
virtual void apply(const Capsule&) {}
virtual void apply(const InfinitePlane&) {}
virtual void apply(const Sphere&) {}
virtual void apply(const Box&) {}
virtual void apply(const Cone&) {}
virtual void apply(const Cylinder&) {}
virtual void apply(const Capsule&) {}
virtual void apply(const InfinitePlane&) {}
virtual void apply(const TriangleMesh&) {}
virtual void apply(const ConvexHull&) {}
virtual void apply(const HeightField&) {}
virtual void apply(const TriangleMesh&) {}
virtual void apply(const ConvexHull&) {}
virtual void apply(const HeightField&) {}
virtual void apply(const CompositeShape&) {}
virtual void apply(const CompositeShape&) {}
};
class Sphere : public Shape
{
public:
Sphere():
_center(0.0f,0.0f,0.0f),
_radius(1.0f) {}
_center(0.0f,0.0f,0.0f),
_radius(1.0f) {}
Sphere(const osg::Vec3& center,float radius):
_center(center),
_radius(radius) {}
_center(center),
_radius(radius) {}
Sphere(const Sphere& sphere,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(sphere,copyop),
_center(sphere._center),
_radius(sphere._radius) {}
META_Shape(osg, Sphere);
inline bool valid() const { return _radius>=0.0f; }
inline void set(const Vec3& center,float radius)
{
_center = center;
_radius = radius;
}
_center(sphere._center),
_radius(sphere._radius) {}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
META_Shape(osg, Sphere);
inline bool valid() const { return _radius>=0.0f; }
inline void set(const Vec3& center,float radius)
{
_center = center;
_radius = radius;
}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
protected:
virtual ~Sphere() {}
Vec3 _center;
float _radius;
virtual ~Sphere() {}
Vec3 _center;
float _radius;
};
class Box : public Shape
{
public:
Box():
_center(0.0f,0.0f,0.0f),
_halfLengths(0.5f,0.5f,0.5f) {}
_center(0.0f,0.0f,0.0f),
_halfLengths(0.5f,0.5f,0.5f) {}
Box(const osg::Vec3& center,float width):
_center(center),
_halfLengths(width*0.5f,width*0.5f,width*0.5f) {}
_center(center),
_halfLengths(width*0.5f,width*0.5f,width*0.5f) {}
Box(const osg::Vec3& center,float lengthX,float lengthY, float lengthZ):
_center(center),
_halfLengths(lengthX*0.5f,lengthY*0.5f,lengthZ*0.5f) {}
_center(center),
_halfLengths(lengthX*0.5f,lengthY*0.5f,lengthZ*0.5f) {}
Box(const Box& box,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(box,copyop),
_center(box._center),
_halfLengths(box._halfLengths),
_rotation(box._rotation) {}
META_Shape(osg, Box);
inline bool valid() const { return _halfLengths.x()>=0.0f; }
inline void set(const Vec3& center,const Vec3& halfLengths)
{
_center = center;
_halfLengths = halfLengths;
}
_center(box._center),
_halfLengths(box._halfLengths),
_rotation(box._rotation) {}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setHalfLengths(const Vec3& halfLengths) { _halfLengths = halfLengths; }
inline const Vec3& getHalfLengths() const { return _halfLengths; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
META_Shape(osg, Box);
inline bool valid() const { return _halfLengths.x()>=0.0f; }
inline void set(const Vec3& center,const Vec3& halfLengths)
{
_center = center;
_halfLengths = halfLengths;
}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setHalfLengths(const Vec3& halfLengths) { _halfLengths = halfLengths; }
inline const Vec3& getHalfLengths() const { return _halfLengths; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
protected:
virtual ~Box() {}
virtual ~Box() {}
Vec3 _center;
Vec3 _halfLengths;
Quat _rotation;
Vec3 _center;
Vec3 _halfLengths;
Quat _rotation;
};
@ -241,188 +241,186 @@ class Box : public Shape
class Cone : public Shape
{
public:
Cone():
_center(0.0f,0.0f,0.0f),
_radius(1.0f),
_height(1.0f) {}
_center(0.0f,0.0f,0.0f),
_radius(1.0f),
_height(1.0f) {}
Cone(const osg::Vec3& center,float radius,float height):
_center(center),
_radius(radius),
_height(height) {}
_center(center),
_radius(radius),
_height(height) {}
Cone(const Cone& cone,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(cone,copyop),
_center(cone._center),
_radius(cone._radius),
_height(cone._height),
_rotation(cone._rotation) {}
META_Shape(osg, Cone);
inline bool valid() const { return _radius>=0.0f; }
inline void set(const Vec3& center,float radius, float height)
{
_center = center;
_radius = radius;
_height = height;
}
_center(cone._center),
_radius(cone._radius),
_height(cone._height),
_rotation(cone._rotation) {}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
META_Shape(osg, Cone);
inline void setHeight(float height) { _height = height; }
inline float getHeight() const { return _height; }
inline bool valid() const { return _radius>=0.0f; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
inline float getBaseOffsetFactor() const { return 0.25f; }
inline float getBaseOffset() const { return -getBaseOffsetFactor()*getHeight(); }
inline void set(const Vec3& center,float radius, float height)
{
_center = center;
_radius = radius;
_height = height;
}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
inline void setHeight(float height) { _height = height; }
inline float getHeight() const { return _height; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
inline float getBaseOffsetFactor() const { return 0.25f; }
inline float getBaseOffset() const { return -getBaseOffsetFactor()*getHeight(); }
protected:
virtual ~Cone() {}
virtual ~Cone() {}
Vec3 _center;
float _radius;
float _height;
Quat _rotation;
Vec3 _center;
float _radius;
float _height;
Quat _rotation;
};
class Cylinder : public Shape
{
public:
Cylinder():
_center(0.0f,0.0f,0.0f),
_radius(1.0f),
_height(1.0f) {}
_center(0.0f,0.0f,0.0f),
_radius(1.0f),
_height(1.0f) {}
Cylinder(const osg::Vec3& center,float radius,float height):
_center(center),
_radius(radius),
_height(height) {}
_center(center),
_radius(radius),
_height(height) {}
Cylinder(const Cylinder& cylinder,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(cylinder,copyop),
_center(cylinder._center),
_radius(cylinder._radius),
_height(cylinder._height),
_rotation(cylinder._rotation) {}
META_Shape(osg, Cylinder);
inline bool valid() const { return _radius>=0.0f; }
inline void set(const Vec3& center,float radius, float height)
{
_center = center;
_radius = radius;
_height = height;
}
_center(cylinder._center),
_radius(cylinder._radius),
_height(cylinder._height),
_rotation(cylinder._rotation) {}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
META_Shape(osg, Cylinder);
inline void setHeight(float height) { _height = height; }
inline float getHeight() const { return _height; }
inline bool valid() const { return _radius>=0.0f; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
bool zeroRotation() const { return _rotation.zeroRotation(); }
inline void set(const Vec3& center,float radius, float height)
{
_center = center;
_radius = radius;
_height = height;
}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
inline void setHeight(float height) { _height = height; }
inline float getHeight() const { return _height; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
bool zeroRotation() const { return _rotation.zeroRotation(); }
protected:
virtual ~Cylinder() {}
Vec3 _center;
float _radius;
float _height;
Quat _rotation;
virtual ~Cylinder() {}
Vec3 _center;
float _radius;
float _height;
Quat _rotation;
};
class Capsule : public Shape
{
public:
Capsule():
_center(0.0f,0.0f,0.0f),
_radius(1.0f),
_height(1.0f) {}
_center(0.0f,0.0f,0.0f),
_radius(1.0f),
_height(1.0f) {}
Capsule(const osg::Vec3& center,float radius,float height):
_center(center),
_radius(radius),
_height(height) {}
_center(center),
_radius(radius),
_height(height) {}
Capsule(const Capsule& capsule,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(capsule,copyop),
_center(capsule._center),
_radius(capsule._radius),
_height(capsule._height),
_rotation(capsule._rotation) {}
META_Shape(osg, Capsule);
inline bool valid() const { return _radius>=0.0f; }
inline void set(const Vec3& center,float radius, float height)
{
_center = center;
_radius = radius;
_height = height;
}
_center(capsule._center),
_radius(capsule._radius),
_height(capsule._height),
_rotation(capsule._rotation) {}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
META_Shape(osg, Capsule);
inline void setHeight(float height) { _height = height; }
inline float getHeight() const { return _height; }
inline bool valid() const { return _radius>=0.0f; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
bool zeroRotation() const { return _rotation.zeroRotation(); }
inline void set(const Vec3& center,float radius, float height)
{
_center = center;
_radius = radius;
_height = height;
}
inline void setCenter(const Vec3& center) { _center = center; }
inline const Vec3& getCenter() const { return _center; }
inline void setRadius(float radius) { _radius = radius; }
inline float getRadius() const { return _radius; }
inline void setHeight(float height) { _height = height; }
inline float getHeight() const { return _height; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
bool zeroRotation() const { return _rotation.zeroRotation(); }
protected:
virtual ~Capsule() {}
virtual ~Capsule() {}
Vec3 _center;
float _radius;
float _height;
Quat _rotation;
Vec3 _center;
float _radius;
float _height;
Quat _rotation;
};
class InfinitePlane : public Shape, public Plane
{
public:
InfinitePlane() {}
InfinitePlane() {}
InfinitePlane(const InfinitePlane& plane,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(plane,copyop),
Plane(plane) {}
META_Shape(osg, InfinitePlane);
META_Shape(osg, InfinitePlane);
protected:
virtual ~InfinitePlane() {}
@ -432,101 +430,100 @@ class TriangleMesh : public Shape
{
public:
TriangleMesh() {}
TriangleMesh() {}
TriangleMesh(const TriangleMesh& mesh,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(mesh,copyop),
_vertices(mesh._vertices),
_indices(mesh._indices) {}
META_Shape(osg, TriangleMesh);
void setVertices(Vec3Array* vertices) { _vertices = vertices; }
Vec3Array* getVertices() { return _vertices.get(); }
const Vec3Array* getVertices() const { return _vertices.get(); }
void setIndices(IndexArray* indices) { _indices = indices; }
IndexArray* getIndices() { return _indices.get(); }
const IndexArray* getIndices() const { return _indices.get(); }
_vertices(mesh._vertices),
_indices(mesh._indices) {}
META_Shape(osg, TriangleMesh);
void setVertices(Vec3Array* vertices) { _vertices = vertices; }
Vec3Array* getVertices() { return _vertices.get(); }
const Vec3Array* getVertices() const { return _vertices.get(); }
void setIndices(IndexArray* indices) { _indices = indices; }
IndexArray* getIndices() { return _indices.get(); }
const IndexArray* getIndices() const { return _indices.get(); }
protected:
~TriangleMesh() {}
ref_ptr<Vec3Array> _vertices;
ref_ptr<IndexArray> _indices;
~TriangleMesh() {}
ref_ptr<Vec3Array> _vertices;
ref_ptr<IndexArray> _indices;
};
class ConvexHull : public TriangleMesh
{
public:
ConvexHull() {}
ConvexHull() {}
ConvexHull(const ConvexHull& hull,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
TriangleMesh(hull,copyop) {}
META_Shape(osg, TriangleMesh);
META_Shape(osg, TriangleMesh);
protected:
~ConvexHull() {}
~ConvexHull() {}
};
class OSG_EXPORT HeightField : public Shape
{
public:
HeightField():
_columns(0),
_rows(0),
_origin(0.0f,0.0f,0.0f),
_dx(1.0f),
_dy(1.0f),
HeightField():
_columns(0),
_rows(0),
_origin(0.0f,0.0f,0.0f),
_dx(1.0f),
_dy(1.0f),
_skirtHeight(0.0f),
_borderWidth(0) {}
HeightField(const HeightField& mesh,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(mesh,copyop),
_columns(mesh._columns),
_rows(mesh._rows),
_origin(mesh._origin),
_dx(mesh._dx),
_dy(mesh._dy),
_columns(mesh._columns),
_rows(mesh._rows),
_origin(mesh._origin),
_dx(mesh._dx),
_dy(mesh._dy),
_skirtHeight(mesh._skirtHeight),
_borderWidth(mesh._borderWidth),
_heights(mesh._heights) {}
META_Shape(osg, HeightField);
META_Shape(osg, HeightField);
typedef std::vector<float> HeightList;
typedef std::vector<float> HeightList;
void allocate(unsigned int numColumns,unsigned int numRows);
void allocate(unsigned int numColumns,unsigned int numRows);
inline unsigned int getNumColumns() const { return _columns; }
inline unsigned int getNumRows() const { return _rows; }
inline unsigned int getNumColumns() const { return _columns; }
inline unsigned int getNumRows() const { return _rows; }
inline void setOrigin(const osg::Vec3& origin) { _origin = origin; }
inline const osg::Vec3& getOrigin() const { return _origin; }
inline void setOrigin(const osg::Vec3& origin) { _origin = origin; }
inline const osg::Vec3& getOrigin() const { return _origin; }
inline void setXInterval(float dx) { _dx = dx; }
inline float getXInterval() const { return _dx; }
inline void setXInterval(float dx) { _dx = dx; }
inline float getXInterval() const { return _dx; }
inline void setYInterval(float dy) { _dy = dy; }
inline float getYInterval() const { return _dy; }
inline void setYInterval(float dy) { _dy = dy; }
inline float getYInterval() const { return _dy; }
/** Set the height of the skirt to render around the edge of HeightField.
* The skirt is used as a means of disguising edge boundaries between adjacent HeightField,
* particularly of ones with different resolutions.*/
void setSkirtHeight(float skirtHeight) { _skirtHeight = skirtHeight; }
/** Get the height of the skirt to render around the edge of HeightField.*/
float getSkirtHeight() const { return _skirtHeight; }
/** Set the width in number of cells in from the edge that the height field should be rendered from.
* This exists to allow gradient and curvature continutity to be maintained between adjacent HeightField, where
* the border cells will overlap adjacent HeightField.*/
@ -535,31 +532,31 @@ class OSG_EXPORT HeightField : public Shape
/** Get the width in number of cells in from the edge that the height field should be rendered from.*/
unsigned int getBorderWidth() const { return _borderWidth; }
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
/* set a single height point in the height field */
inline void setHeight(unsigned int c,unsigned int r,float value)
{
_heights[c+r*_columns] = value;
}
inline void setRotation(const Quat& quat) { _rotation = quat; }
inline const Quat& getRotation() const { return _rotation; }
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
/* Get address of single height point in the height field, allows user to change. */
inline float& getHeight(unsigned int c,unsigned int r)
{
return _heights[c+r*_columns];
}
/* set a single height point in the height field */
inline void setHeight(unsigned int c,unsigned int r,float value)
{
_heights[c+r*_columns] = value;
}
/* Get value of single height point in the height field, not editable. */
inline float getHeight(unsigned int c,unsigned int r) const
{
return _heights[c+r*_columns];
}
/* Get address of single height point in the height field, allows user to change. */
inline float& getHeight(unsigned int c,unsigned int r)
{
return _heights[c+r*_columns];
}
HeightList& getHeightList() { return _heights; }
const HeightList& getHeightList() const { return _heights; }
/* Get value of single height point in the height field, not editable. */
inline float getHeight(unsigned int c,unsigned int r) const
{
return _heights[c+r*_columns];
}
HeightList& getHeightList() { return _heights; }
const HeightList& getHeightList() const { return _heights; }
inline Vec3 getVertex(unsigned int c,unsigned int r) const
{
@ -567,27 +564,27 @@ class OSG_EXPORT HeightField : public Shape
_origin.y()+getYInterval()*(float)r,
_origin.z()+_heights[c+r*_columns]);
}
Vec3 getNormal(unsigned int c,unsigned int r) const;
Vec2 getHeightDelta(unsigned int c,unsigned int r) const;
protected:
virtual ~HeightField();
virtual ~HeightField();
unsigned int _columns,_rows;
unsigned int _columns,_rows;
osg::Vec3 _origin;
float _dx;
float _dy;
osg::Vec3 _origin;
float _dx;
float _dy;
float _skirtHeight;
unsigned int _borderWidth;
Quat _rotation;
HeightList _heights;
Quat _rotation;
HeightList _heights;
};
typedef HeightField Grid;
@ -599,43 +596,43 @@ class CompositeShape : public Shape
typedef std::vector< ref_ptr<Shape> > ChildList;
CompositeShape() {}
typedef std::vector< ref_ptr<Shape> > ChildList;
CompositeShape() {}
CompositeShape(const CompositeShape& cs,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Shape(cs,copyop),
_children(cs._children) {}
META_Shape(osg, CompositeShape);
_children(cs._children) {}
/** Set the shape that encloses all of the children.*/
void setShape(Shape* shape) { _shape = shape; }
META_Shape(osg, CompositeShape);
/** Get the shape that encloses all of the children.*/
Shape* getShape() { return _shape.get(); }
/** Set the shape that encloses all of the children.*/
void setShape(Shape* shape) { _shape = shape; }
/** Get the const shape that encloses all of the children.*/
const Shape* getShape() const { return _shape.get(); }
/** Get the number of children of this composite shape.*/
unsigned int getNumChildren() const { return _children.size(); }
/** Get a child.*/
Shape* getChild(unsigned int i) { return _children[i].get(); }
/** Get the shape that encloses all of the children.*/
Shape* getShape() { return _shape.get(); }
/** Get a const child.*/
const Shape* getChild(unsigned int i) const { return _children[i].get(); }
/** Get the const shape that encloses all of the children.*/
const Shape* getShape() const { return _shape.get(); }
/** Add a child to the list.*/
void addChild(Shape* shape) { _children.push_back(shape); }
/** remove a child from the list.*/
void removeChild(unsigned int i) { _children.erase(_children.begin()+i); }
/** Get the number of children of this composite shape.*/
unsigned int getNumChildren() const { return _children.size(); }
/** find the index number of child, if child is not found then it returns getNumChildren(),
* so should be used in similar style to STL's result!=end().*/
unsigned int findChildNo(Shape* shape) const
/** Get a child.*/
Shape* getChild(unsigned int i) { return _children[i].get(); }
/** Get a const child.*/
const Shape* getChild(unsigned int i) const { return _children[i].get(); }
/** Add a child to the list.*/
void addChild(Shape* shape) { _children.push_back(shape); }
/** remove a child from the list.*/
void removeChild(unsigned int i) { _children.erase(_children.begin()+i); }
/** find the index number of child, if child is not found then it returns getNumChildren(),
* so should be used in similar style to STL's result!=end().*/
unsigned int findChildNo(Shape* shape) const
{
for (unsigned int childNo=0;childNo<_children.size();++childNo)
{
@ -644,13 +641,13 @@ class CompositeShape : public Shape
return _children.size(); // node not found.
}
protected:
~CompositeShape() {}
~CompositeShape() {}
ref_ptr<Shape> _shape;
ChildList _children;
ref_ptr<Shape> _shape;
ChildList _children;
};

View File

@ -31,7 +31,7 @@ class OSG_EXPORT TexGenNode : public Group
TexGenNode(const TexGenNode& tgb, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(osg, TexGenNode);
enum ReferenceFrame
{

View File

@ -130,8 +130,8 @@ class OSG_EXPORT Texture1D : public Texture
/** It's not ideal that _image is mutable, but it's required since
* Image::ensureDimensionsArePowerOfTwo() can only be called in a
* valid OpenGL context, and therefore within Texture::apply, which
* is const. */
* valid OpenGL context, and therefore within Texture::apply, which
* is const. */
mutable ref_ptr<Image> _image;
/** Subloaded images can have different texture and image sizes. */

View File

@ -135,8 +135,8 @@ class OSG_EXPORT Texture2D : public Texture
/** It's not ideal that _image is mutable, but it's required since
* Image::ensureDimensionsArePowerOfTwo() can only be called in a
* valid OpenGL context, and therefore within Texture::apply, which
* is const. */
* valid OpenGL context, and therefore within Texture::apply, which
* is const. */
ref_ptr<Image> _image;
/** Subloaded images can have different texture and image sizes. */

View File

@ -104,7 +104,7 @@ class OSG_EXPORT Transform : public Group
* deep in the scene graph. It is therefore recommended to only use
* absolute Transforms at the top of the scene, for such things as
* heads up displays.
*/
*/
void setReferenceFrame(ReferenceFrame rf);
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
@ -139,7 +139,7 @@ class OSG_EXPORT Transform : public Group
* There is no need to override in subclasses from osg::Transform
* since this computeBound() uses the underlying matrix (calling
* computeMatrix if required).
*/
*/
virtual BoundingSphere computeBound() const;
protected :

View File

@ -72,8 +72,8 @@ public:
const Vec3* vptr = &_vertexArrayPtr[first];
for(GLsizei i=2;i<count;++i,++vptr)
{
if ((i%2)) this->operator()(*(vptr),*(vptr+2),*(vptr+1),_treatVertexDataAsTemporary);
else this->operator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary);
if ((i%2)) this->operator()(*(vptr),*(vptr+2),*(vptr+1),_treatVertexDataAsTemporary);
else this->operator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary);
}
break;
}
@ -138,8 +138,8 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=2;i<count;++i,++iptr)
{
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
}
break;
}
@ -207,8 +207,8 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=2;i<count;++i,++iptr)
{
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
}
break;
}
@ -274,8 +274,8 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=2;i<count;++i,++iptr)
{
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
}
break;
}
@ -328,7 +328,7 @@ public:
* non vertex array primitives to vertex array based primitives.
* This is done to simplify the implementation of primtive functor
* subclasses - users only need override drawArray and drawElements.
*/
*/
virtual void begin(GLenum mode)
{
_modeCache = mode;

View File

@ -74,8 +74,8 @@ public:
unsigned int pos=first;
for(GLsizei i=2;i<count;++i,++pos)
{
if ((i%2)) this->operator()(pos,pos+2,pos+1);
else this->operator()(pos,pos+1,pos+2);
if ((i%2)) this->operator()(pos,pos+2,pos+1);
else this->operator()(pos,pos+1,pos+2);
}
break;
}
@ -139,8 +139,8 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=2;i<count;++i,++iptr)
{
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
}
break;
}
@ -206,8 +206,8 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=2;i<count;++i,++iptr)
{
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
}
break;
}
@ -273,8 +273,8 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=2;i<count;++i,++iptr)
{
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
}
break;
}

View File

@ -22,6 +22,6 @@ namespace osg {
typedef UByte4 Vec4ub;
#endif
} // end of namespace osg
} // end of namespace osg
#endif

View File

@ -26,7 +26,7 @@ class Vec2b
{
public:
// Methods are defined here so that they are implicitly inlined
// Methods are defined here so that they are implicitly inlined
/** Type of Vec class.*/
typedef char value_type;
@ -123,7 +123,7 @@ class Vec2b
/** Unary vector add. Slightly more efficient because no temporary
* intermediate object.
*/
*/
inline Vec2b& operator += (const Vec2b& rhs)
{
_v[0] += rhs._v[0];
@ -145,10 +145,10 @@ class Vec2b
return *this;
}
}; // end of class Vec2b
}; // end of class Vec2b
} // end of namespace osg
} // end of namespace osg
#endif

View File

@ -51,7 +51,7 @@ class Vec2d
inline bool operator != (const Vec2d& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1]; }
inline bool operator < (const Vec2d& v) const
inline bool operator < (const Vec2d& v) const
{
if (_v[0]<v._v[0]) return true;
else if (_v[0]>v._v[0]) return false;
@ -91,8 +91,8 @@ class Vec2d
inline Vec2d& operator *= (value_type rhs)
{
_v[0]*=rhs;
_v[1]*=rhs;
return *this;
_v[1]*=rhs;
return *this;
}
/** Divide by scalar. */
@ -105,8 +105,8 @@ class Vec2d
inline Vec2d& operator /= (value_type rhs)
{
_v[0]/=rhs;
_v[1]/=rhs;
return *this;
_v[1]/=rhs;
return *this;
}
/** Binary vector add. */
@ -117,12 +117,12 @@ class Vec2d
/** Unary vector add. Slightly more efficient because no temporary
* intermediate object.
*/
*/
inline Vec2d& operator += (const Vec2d& rhs)
{
_v[0] += rhs._v[0];
_v[1] += rhs._v[1];
return *this;
return *this;
}
/** Binary vector subtract. */
@ -136,20 +136,20 @@ class Vec2d
{
_v[0]-=rhs._v[0];
_v[1]-=rhs._v[1];
return *this;
}
return *this;
}
/** Negation operator. Returns the negative of the Vec2d. */
inline const Vec2d operator - () const
{
return Vec2d (-_v[0], -_v[1]);
}
return Vec2d (-_v[0], -_v[1]);
}
/** Length of the vector = sqrt( vec . vec ) */
inline value_type length() const
{
return sqrt( _v[0]*_v[0] + _v[1]*_v[1] );
}
inline value_type length() const
{
return sqrt( _v[0]*_v[0] + _v[1]*_v[1] );
}
/** Length squared of the vector = vec . vec */
inline value_type length2( void ) const
@ -159,20 +159,20 @@ class Vec2d
/** Normalize the vector so that it has length unity.
* Returns the previous length of the vector.
*/
inline value_type normalize()
{
value_type norm = Vec2d::length();
*/
inline value_type normalize()
{
value_type norm = Vec2d::length();
if (norm>0.0)
{
value_type inv = 1.0/norm;
_v[0] *= inv;
_v[1] *= inv;
_v[0] *= inv;
_v[1] *= inv;
}
return( norm );
}
return( norm );
}
}; // end of class Vec2d
}; // end of class Vec2d
} // end of namespace osg
} // end of namespace osg
#endif

View File

@ -167,7 +167,7 @@ class Vec2f
}
return( norm );
}
}; // end of class Vec2f
} // end of namespace osg

View File

@ -12,7 +12,7 @@
*/
#ifndef OSG_VEC2S
#define OSG_VEC2S 1
#define OSG_VEC2S 1
namespace osg {

View File

@ -121,12 +121,12 @@ class Vec3b
inline Vec3b operator + (const Vec3b& rhs) const
{
return Vec3b(_v[0]+rhs._v[0], _v[1]+rhs._v[1],
_v[2]+rhs._v[2]);
_v[2]+rhs._v[2]);
}
/** Unary vector add. Slightly more efficient because no temporary
* intermediate object.
*/
*/
inline Vec3b& operator += (const Vec3b& rhs)
{
_v[0] += rhs._v[0];
@ -139,7 +139,7 @@ class Vec3b
inline Vec3b operator - (const Vec3b& rhs) const
{
return Vec3b(_v[0]-rhs._v[0], _v[1]-rhs._v[1],
_v[2]-rhs._v[2]);
_v[2]-rhs._v[2]);
}
/** Unary vector subtract. */
@ -151,10 +151,10 @@ class Vec3b
return *this;
}
}; // end of class Vec3b
}; // end of class Vec3b
} // end of namespace osg
} // end of namespace osg
#endif

View File

@ -12,7 +12,7 @@
*/
#ifndef OSG_VEC3S
#define OSG_VEC3S 1
#define OSG_VEC3S 1
namespace osg {

View File

@ -12,7 +12,7 @@
*/
#ifndef OSG_VEC4S
#define OSG_VEC4S 1
#define OSG_VEC4S 1
namespace osg {
@ -52,7 +52,7 @@ class Vec4s
else return (_v[3]<v._v[3]);
}
inline value_type* ptr() { return _v; }
inline value_type* ptr() { return _v; }
inline const value_type* ptr() const { return _v; }
inline void set( value_type x, value_type y, value_type z, value_type w)

View File

@ -121,12 +121,12 @@ class Vec4ub
inline Vec4ub operator + (const Vec4ub& rhs) const
{
return Vec4ub(_v[0]+rhs._v[0], _v[1]+rhs._v[1],
_v[2]+rhs._v[2], _v[3]+rhs._v[3]);
_v[2]+rhs._v[2], _v[3]+rhs._v[3]);
}
/** Unary vector add. Slightly more efficient because no temporary
* intermediate object.
*/
*/
inline Vec4ub& operator += (const Vec4ub& rhs)
{
_v[0] += rhs._v[0];
@ -140,7 +140,7 @@ class Vec4ub
inline Vec4ub operator - (const Vec4ub& rhs) const
{
return Vec4ub(_v[0]-rhs._v[0], _v[1]-rhs._v[1],
_v[2]-rhs._v[2], _v[3]-rhs._v[3] );
_v[2]-rhs._v[2], _v[3]-rhs._v[3] );
}
/** Unary vector subtract. */
@ -153,8 +153,8 @@ class Vec4ub
return *this;
}
}; // end of class Vec4ub
}; // end of class Vec4ub
} // end of namespace osg
} // end of namespace osg
#endif

View File

@ -136,7 +136,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2b& vec)
{
output << (int)vec._v[0] << " "
<< (int)vec._v[1];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec2b& vec)
@ -152,7 +152,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3b& vec)
output << (int)vec._v[0] << " "
<< (int)vec._v[1] << " "
<< (int)vec._v[2];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec3b& vec)
@ -169,7 +169,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec4b& vec)
<< (int)vec._v[1] << " "
<< (int)vec._v[2] << " "
<< (int)vec._v[3];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec4b& vec)
@ -185,7 +185,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2s& vec)
{
output << (int)vec._v[0] << " "
<< (int)vec._v[1];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec2s& vec)
@ -201,7 +201,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3s& vec)
output << (int)vec._v[0] << " "
<< (int)vec._v[1] << " "
<< (int)vec._v[2];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec3s& vec)
@ -218,7 +218,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec4s& vec)
<< (int)vec._v[1] << " "
<< (int)vec._v[2] << " "
<< (int)vec._v[3];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec4s& vec)
@ -267,7 +267,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec4ub& vec)
<< (int)vec._v[1] << " "
<< (int)vec._v[2] << " "
<< (int)vec._v[3];
return output; // to enable cascading
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Vec4ub& vec)
@ -301,10 +301,10 @@ inline std::istream& operator >> (std::istream& input, Quat& vec)
inline std::ostream& operator << (std::ostream& output, const Plane& pl)
{
output << pl[0] << " "
<< pl[1] << " "
<< pl[2] << " "
<< pl[3];
return output; // to enable cascading
<< pl[1] << " "
<< pl[2] << " "
<< pl[3];
return output; // to enable cascading
}
inline std::istream& operator >> (std::istream& input, Plane& vec)

View File

@ -76,9 +76,9 @@ class ref_ptr
inline const T* operator->() const { return _ptr; }
inline bool operator!() const { return _ptr==0L; }
inline bool operator!() const { return _ptr==0L; }
inline bool valid() const { return _ptr!=0L; }
inline bool valid() const { return _ptr!=0L; }
inline T* get() { return _ptr; }

View File

@ -51,8 +51,8 @@ class OSGDB_EXPORT DynamicLibrary : public osg::Referenced
protected:
/** get handle to library file */
static HANDLE getLibraryHandle( const std::string& libraryName);
/** get handle to library file */
static HANDLE getLibraryHandle( const std::string& libraryName);
/** disallow default constructor.*/
DynamicLibrary():osg::Referenced() {}

View File

@ -29,12 +29,12 @@
# if defined( _LIB ) || defined( USE_STATIC )
# define OSGDB_EXPORT
# elif defined( OSGDB_LIBRARY )
# define OSGDB_EXPORT __declspec(dllexport)
# else
# define OSGDB_EXPORT __declspec(dllimport)
# endif /* OSGDBSG_LIBRARY */
# define OSGDB_EXPORT __declspec(dllexport)
# else
# define OSGDB_EXPORT __declspec(dllimport)
# endif /* OSGDBSG_LIBRARY */
#else
# define OSGDB_EXPORT
# define OSGDB_EXPORT
#endif
/**

View File

@ -46,8 +46,8 @@ class OSGDB_EXPORT Output : public std::ofstream
Output& indent();
/** wrap a string with "" quotes and use \" for any internal quotes.*/
std::string wrapString(const std::string& str);
/** wrap a string with "" quotes and use \" for any internal quotes.*/
std::string wrapString(const std::string& str);
inline void setIndentStep(int step) { _indentStep = step; }
inline int getIndentStep() const { return _indentStep; }

View File

@ -35,9 +35,9 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
{
public:
AnimationPathManipulator( osg::AnimationPath* animationPath=0 );
AnimationPathManipulator( osg::AnimationPath* animationPath=0 );
AnimationPathManipulator( const std::string& filename );
AnimationPathManipulator( const std::string& filename );
virtual const char* className() const { return "AnimationPath"; }
@ -63,7 +63,7 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
const osg::AnimationPath* getAnimationPath() const { return _animationPath.get(); }
bool valid() const { return _animationPath.valid(); }
bool valid() const { return _animationPath.valid(); }
void init(const GUIEventAdapter& ea,GUIActionAdapter& us);
@ -77,13 +77,13 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
protected:
bool _valid;
bool _valid;
bool _printOutTiminInfo;
void handleFrame( double time );
void handleFrame( double time );
osg::ref_ptr<osg::AnimationPath> _animationPath;
osg::ref_ptr<osg::AnimationPath> _animationPath;
double _timeOffset;
double _timeScale;

View File

@ -63,14 +63,14 @@ class OSGGA_EXPORT DriveManipulator : public MatrixManipulator
/** Get the keyboard and mouse usage of this manipulator.*/
virtual void getUsage(osg::ApplicationUsage& usage) const;
void setModelScale( double in_ms ) { _modelScale = in_ms; }
double getModelScale() const { return _modelScale; }
void setModelScale( double in_ms ) { _modelScale = in_ms; }
double getModelScale() const { return _modelScale; }
void setVelocity( double in_vel ) { _velocity = in_vel; }
double getVelocity() const { return _velocity; }
void setVelocity( double in_vel ) { _velocity = in_vel; }
double getVelocity() const { return _velocity; }
void setHeight( double in_h ) { _height = in_h; }
double getHeight() const { return _height; }
void setHeight( double in_h ) { _height = in_h; }
double getHeight() const { return _height; }
protected:

View File

@ -45,9 +45,9 @@ public:
*/
void addMatrixManipulator(int key, std::string name, MatrixManipulator *cm);
/**
Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registerd.
*/
/**
Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registerd.
*/
void addNumberedMatrixManipulator(MatrixManipulator *cm);
unsigned int getNumMatrixManipulators() const { return _manips.size(); }

View File

@ -19,48 +19,48 @@
namespace osgIntrospection
{
class Value;
class Value;
struct Comparator
{
virtual bool isEqualTo(const Value& l, const Value& r) const = 0;
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const = 0;
virtual ~Comparator() {}
};
template<typename T>
struct TotalOrderComparator: Comparator
{
virtual bool isEqualTo(const Value& l, const Value& r) const
{
const T &vl = variant_cast<const T &>(l);
const T &vr = variant_cast<const T &>(r);
return vl <= vr && vr <= vl;
}
struct Comparator
{
virtual bool isEqualTo(const Value& l, const Value& r) const = 0;
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const = 0;
virtual ~Comparator() {}
};
template<typename T>
struct TotalOrderComparator: Comparator
{
virtual bool isEqualTo(const Value& l, const Value& r) const
{
const T &vl = variant_cast<const T &>(l);
const T &vr = variant_cast<const T &>(r);
return vl <= vr && vr <= vl;
}
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const
{
return variant_cast<const T &>(l) <= variant_cast<const T &>(r);
}
virtual ~TotalOrderComparator() {}
};
template<typename T>
struct PartialOrderComparator: Comparator
{
virtual bool isEqualTo(const Value& l, const Value& r) const
{
return variant_cast<const T &>(l) == variant_cast<const T &>(r);
}
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const
{
return variant_cast<const T &>(l) <= variant_cast<const T &>(r);
}
virtual ~TotalOrderComparator() {}
};
template<typename T>
struct PartialOrderComparator: Comparator
{
virtual bool isEqualTo(const Value& l, const Value& r) const
{
return variant_cast<const T &>(l) == variant_cast<const T &>(r);
}
virtual bool isLessThanOrEqualTo(const Value& , const Value& ) const
{
throw ComparisonOperatorNotSupportedException(typeid(T), "less than or equal to");
}
virtual ~PartialOrderComparator() {}
};
virtual bool isLessThanOrEqualTo(const Value& , const Value& ) const
{
throw ComparisonOperatorNotSupportedException(typeid(T), "less than or equal to");
}
virtual ~PartialOrderComparator() {}
};
}

View File

@ -84,7 +84,7 @@ class OSGPRODUCER_EXPORT EventAdapter : public osgGA::GUIEventAdapter
void adaptResize(double t, float Xmin, float Ymin, float Xmax, float Ymax);
/** method for adapting mouse scroll wheel events. */
void adaptMouseScroll(double t, Producer::KeyboardMouseCallback::ScrollingMotion sm);
void adaptMouseScroll(double t, Producer::KeyboardMouseCallback::ScrollingMotion sm);
/** method for adapting mouse motion events whilst mouse buttons are pressed.*/
void adaptMouseMotion(double t, float x, float y);
@ -125,8 +125,8 @@ class OSGPRODUCER_EXPORT EventAdapter : public osgGA::GUIEventAdapter
// which required the mouse buttons state at the time of the event.
static unsigned int _s_accumulatedButtonMask;
// used to store current button value
static int _s_button;
// used to store current button value
static int _s_button;
// used to store window min and max values.
static float _s_Xmin;

View File

@ -30,12 +30,12 @@
# if defined( _LIB ) || defined( USE_STATIC )
# define OSGPRODUCER_EXPORT
# elif defined( OSGPRODUCER_LIBRARY )
# define OSGPRODUCER_EXPORT __declspec(dllexport)
# else
# define OSGPRODUCER_EXPORT __declspec(dllimport)
#endif /* OSGPRODUCER_LIBRARY */
# define OSGPRODUCER_EXPORT __declspec(dllexport)
# else
# define OSGPRODUCER_EXPORT __declspec(dllimport)
#endif /* OSGPRODUCER_LIBRARY */
#else
#define OSGPRODUCER_EXPORT
#define OSGPRODUCER_EXPORT
#endif
/**

View File

@ -79,7 +79,7 @@ class OSGSIM_EXPORT Impostor : public osg::LOD
/** Set the Impostor threshold distance.
* For eye points further than this threshold the Imposter is used if appropriate,
* otherwise the LOD children as chosen as per a standard LOD node.
*/
*/
inline void setImpostorThreshold(float distance) { _impostorThreshold = distance; }
/* Get the Impostor threshold distance. */

View File

@ -121,7 +121,7 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
void setTexture(osg::Texture2D* tex,int s,int t);
osg::Texture2D* getTexture() { return _texture; }
const osg::Texture2D* getTexture() const { return _texture; }
int s() const { return _s; }
int t() const { return _t; }

View File

@ -932,7 +932,7 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
void setRadiusToMaxVisibleDistanceRatio(float ratio) { _radiusToMaxVisibleDistanceRatio = ratio; }
float getRadiusToMaxVisibleDistanceRatio() const { return _radiusToMaxVisibleDistanceRatio; }
void setVerticalScale(float verticalScale) { _verticalScale = verticalScale; }
float getVerticalScale() const { return _verticalScale; }
@ -1117,7 +1117,7 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
unsigned int _maximumTileImageSize;
unsigned int _maximumTileTerrainSize;
float _maximumVisiableDistanceOfTopLevel;
float _radiusToMaxVisibleDistanceRatio;
float _radiusToMaxVisibleDistanceRatio;
float _verticalScale;
float _skirtRatio;

View File

@ -151,11 +151,11 @@ public:
LEFT_BASE_LINE,
CENTER_BASE_LINE,
RIGHT_BASE_LINE,
LEFT_BOTTOM_BASE_LINE,
CENTER_BOTTOM_BASE_LINE,
RIGHT_BOTTOM_BASE_LINE,
BASE_LINE = LEFT_BASE_LINE /// default.
};