class SG_EXPORT osg::GeoSet

Encapsulates OpenGL drawing primitives, geometry and optional binding of normal, color and texture coordinates.

Inheritance:


Public Methods

[more] GeoSet()
[more] GeoSet(const GeoSet& geoset, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more]virtual Object* cloneType() const
[more]virtual Object* clone(const CopyOp& copyop) const
[more]virtual bool isSameKindAs(const Object* obj) const
[more]virtual const char* className() const
[more]inline void setNumPrims( const int n )
[more]inline const int getNumPrims() const
[more]void setPrimType( const PrimitiveType type )
[more]inline const PrimitiveType getPrimType() const
[more]inline void setPrimLengths( int* lens )
[more]inline int* getPrimLengths()
[more]inline const int* getPrimLengths() const
[more]void computeNumVerts() const
[more]inline const int getNumCoords() const
get the number of coords required by the defined primitives.
[more]inline Vec3* getCoords()
get a pointer to Vec3 coord array.
[more]inline const Vec3* getCoords() const
get a const pointer to Vec3 coord array.
[more]inline const int getNumCoordIndices() const
get the number of indices required by the defined primitives.
[more]inline IndexPointer& getCoordIndices()
get the coord index array.
[more]inline const IndexPointer& getCoordIndices() const
get the const coord index array.
[more]void setCoords( Vec3* cp )
set the coords (ie the geometry) of the geoset
[more]void setCoords( Vec3* cp, ushort* ci )
set the coords (ie the geometry) and ushort indices of the geoset.
[more]void setCoords( Vec3* cp, uint* ci )
set the coords (ie the geometry) and uint indices of the geoset.
[more]void setCoords( Vec3* cp, IndexPointer& ip )
set the coords (ie the geometry) and indices of the geoset
[more]inline const int getNumNormals() const
get the number of normals required by the defined primitives and normals binding
[more]inline Vec3* getNormals()
get a pointer to Vec3 normal array.
[more]inline const Vec3* getNormals() const
get a const pointer to Vec3 normal array.
[more]inline int getNumNormalIndices() const
get the number of normal indices required by the defined primitives and normals binding
[more]inline IndexPointer& getNormalIndices()
get the normal index array.
[more]inline const IndexPointer& getNormalIndices() const
get the const normal index array.
[more]void setNormals( Vec3* np )
set the normals of the geoset
[more]void setNormals( Vec3* np, ushort* ni )
set the normals and normal indices of the geoset
[more]void setNormals( Vec3* np, uint* ni )
set the normals and normal indices of the geoset
[more]void setNormals( Vec3* np, IndexPointer& ip )
set the normals and normal indices of the geoset
[more]void setNormalBinding( const BindingType binding )
set the normals binding to the vertices/primitives/overall
[more]inline const BindingType getNormalBinding() const
[more]inline const int getNumColors() const
get the number of colors required by the defined primitives and color binding
[more]inline Vec4* getColors()
get a pointer to Vec4 color array.
[more]inline const Vec4* getColors() const
get a pointer to Vec4 color array.
[more]inline int getNumColorIndices() const
get the number of colors indices required by the defined primitives and color binding
[more]inline IndexPointer& getColorIndices()
get the color index array.
[more]inline const IndexPointer& getColorIndices() const
get the const color index array.
[more]void setColors( Vec4* cp )
set the colors of the geoset
[more]void setColors( Vec4* cp, ushort* li )
set the colors and color indices of the geoset
[more]void setColors( Vec4* cp, uint* li )
set the colors and color indices of the geoset
[more]void setColors( Vec4* cp, IndexPointer& ip )
set the colors and color indices of the geoset
[more]void setColorBinding( BindingType binding )
set the color binding to the vertices/primitives/overall
[more]inline BindingType getColorBinding() const
[more]inline const int getNumTextureCoords() const
get the number of texture coords required by the defined primitives and textures binding
[more]inline Vec2* getTextureCoords()
get a pointer to Vec4 color array.
[more]inline const Vec2* getTextureCoords() const
get a pointer to Vec4 color array.
[more]inline const int getNumTextureIndices() const
get the number of texture coord indices required by the defined primitives and texture binding
[more]inline IndexPointer& getTextureIndices()
get the texture index array.
[more]inline const IndexPointer& getTextureIndices() const
get the texture index array.
[more]void setTextureCoords( Vec2* tc )
set the texture coords of the geoset
[more]void setTextureCoords( Vec2* tc, ushort* ti )
set the texture coords and texture coord indices of the geoset
[more]void setTextureCoords( Vec2* tc, uint* ti )
set the texture coords and texture coord indices of the geoset
[more]void setTextureCoords( Vec2* tc, IndexPointer& ip )
set the texture coords and texture indices of the geoset
[more]void setTextureBinding( const BindingType binding )
set the texture coord binding to the vertices/primitives/overall
[more]inline const BindingType getTextureBinding() const
[more]inline const int getNumInterleavedCoords() const
get the number of texture coords required by the defined primitives and textures binding
[more]inline void* getInterleavedArray()
get a pointer to interleaved float array.
[more]inline const void* getInterleavedArray() const
get a const pointer to interleaved float array.
[more]inline const int getNumInterleavedIndices() const
get the number of texture coord indices required by the defined primitives and texture binding
[more]inline IndexPointer& getInterleavedIndices()
get the texture index array.
[more]inline const IndexPointer& getInterleavedIndices() const
get the interleaved index array.
[more]inline const InterleaveArrayType getInterleavedFormat() const
get the interleaved array storage format.
[more]void setInterleavedArray( const InterleaveArrayType format, float* ia )
set the interleaved arrays of the geoset
[more]void setInterleavedArray( const InterleaveArrayType format, float* ia, ushort* iai )
[more]void setInterleavedArray( const InterleaveArrayType format, float* ia, uint* iai )
[more]void setInterleavedArray( const InterleaveArrayType format, float* ia, IndexPointer& iai )
[more]virtual void drawImmediateMode(State& state)
draw geoset directly ignoring an OpenGL display list which could be attached.
[more]const bool check() const
[more]void setAttributeDeleteFunctor(AttributeDeleteFunctor* adf)
set an alternative AttributeDeleteFunction to handle attribute arrays attached to this Geoset
[more]AttributeDeleteFunctor* getAttributeDeleteFunctor()
get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset
[more]const AttributeDeleteFunctor* getAttributeDeleteFunctor() const
get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset
[more]bool getStats(Statistics &)
Statistics collection for each drawable- 260901
[more]virtual AttributeBitMask suppportsAttributeOperation() const
return the attributes supported by applyAttrbuteUpdate() as an AttributeBitMask
[more]virtual AttributeBitMask applyAttributeOperation(AttributeFunctor& auf)
return the attributes successully applied in applyAttributeUpdate

Public Members

[more]enum PrimitiveType
[more]enum BindingType
[more]enum InterleaveArrayType
[more]struct IndexPointer
[more]struct AttributeDeleteFunctor: public osg::Referenced
function object which is used to handling the clean up of attribute arrays associated with GeoSet's.

Protected Fields

[more]ref_ptr<AttributeDeleteFunctor> _adf
[more]int _numprims
[more]PrimitiveType _primtype
[more]int _needprimlen
[more]unsigned int _oglprimtype
[more]int* _primLengths
[more]mutable unsigned char _primlength
[more]unsigned char _flat_shaded_skip
[more]mutable int _numcoords
[more]Vec3* _coords
[more]IndexPointer _cindex
[more]BindingType _normal_binding
[more]mutable int _numnormals
[more]Vec3* _normals
[more]IndexPointer _nindex
[more]BindingType _color_binding
[more]mutable int _numcolors
[more]Vec4* _colors
[more]IndexPointer _colindex
[more]BindingType _texture_binding
[more]mutable int _numtcoords
[more]Vec2* _tcoords
[more]IndexPointer _tindex
[more]void* _iarray
[more]IndexPointer _iaindex
[more]InterleaveArrayType _iaformat
[more]unsigned int _ogliaformat
[more]int _fast_path

Protected Methods

[more]GeoSet& operator = (const GeoSet&)
[more]virtual ~GeoSet()
[more]virtual const bool computeBound() const
[more]void set_fast_path( void )
[more]void draw_fast_path( void )
[more]void draw_alternate_path( void )


Inherited from Drawable:

Public Methods

oinline const ParentList& getParents() const
oinline ParentList getParents()
oinline Node* getParent(const int i)
oinline const Node* getParent(const int i) const
oinline const int getNumParents() const
oinline void setStateSet(StateSet* state)
oinline StateSet* getStateSet()
oinline const StateSet* getStateSet() const
ovoid setSupportsDisplayList(const bool flag)
oinline const bool getSupportsDisplayList() const
ovoid setUseDisplayList(const bool flag)
oinline const bool getUseDisplayList() const
ovoid dirtyDisplayList()
ovoid dirtyBound()
oinline const BoundingBox& getBound() const
ovoid compile(State& state)
ovoid setDrawCallback(DrawCallback* dc)
oDrawCallback* getDrawCallback()
oconst DrawCallback* getDrawCallback() const
ostatic void deleteDisplayList(uint contextID, uint globj)
ostatic void flushDeletedDisplayLists(uint contextID)
oinline void draw(State& state)

Public Members

otypedef std::vector<Node*> ParentList
ostruct DrawCallback: public osg::Referenced
otypedef uint AttributeBitMaskenum AttributeBitMaskValues
class AttributeFunctor

Protected Fields

oParentList _parents
oref_ptr<StateSet> _dstate
obool _supportsDisplayList
obool _useDisplayList
omutable BoundingBox _bbox
omutable bool _bbox_computed
oref_ptr<DrawCallback> _drawCallback

Protected Methods

ovoid addParent(osg::Node* node)
ovoid removeParent(osg::Node* node)

Protected Members

otypedef std::vector<uint> GLObjectList mutable GLObjectList _globjList
otypedef std::map<uint,std::set<uint> >static DeletedDisplayListCache DeletedDisplayListCache s_deletedDisplayListCache


Inherited from Object:


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

Encapsulates OpenGL drawing primitives, geometry and optional binding of normal, color and texture coordinates. Used for representing the visible objects in the scene. State attributes for a GeoSet are maintained in StateSet which the GeoSet maintains a referenced counted pointer to. Both GeoSet's and StateSet's can be shared for optimal memory usage and graphics performance.
oenum PrimitiveType

o NO_TYPE

o POINTS

o LINES

o LINE_STRIP

o FLAT_LINE_STRIP

o LINE_LOOP

o TRIANGLES

o TRIANGLE_STRIP

o FLAT_TRIANGLE_STRIP

o TRIANGLE_FAN

o FLAT_TRIANGLE_FAN

o QUADS

o QUAD_STRIP

o POLYGON

oenum BindingType

o BIND_OFF

o BIND_OVERALL

o BIND_PERPRIM

o BIND_PERVERTEX

o BIND_DEFAULT

oenum InterleaveArrayType

o IA_OFF

o IA_V2F

o IA_V3F

o IA_C4UB_V2F

o IA_C4UB_V3F

o IA_C3F_V3F

o IA_N3F_V3F

o IA_C4F_N3F_V3F

o IA_T2F_V3F

o IA_T4F_V4F

o IA_T2F_C4UB_V3F

o IA_T2F_C3F_V3F

o IA_T2F_N3F_V3F

o IA_T2F_C4F_N3F_V3F

o IA_T4F_C4F_N3F_V4F

ostruct IndexPointer

omutable uint _size

obool _is_ushort

ounion

oushort* _ushort

ouint* _uint

o IndexPointer()

oinline const bool operator == (const IndexPointer& ip) const

oinline const bool valid() const

oinline const bool null() const

oinline void setToNull()

oinline void set(uint size, ushort* data)

ovoid set(const uint size, uint* data)

oinline const uint maxIndex() const

oinline const uint operator [] (const uint pos) const

o GeoSet()

o GeoSet(const GeoSet& geoset, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

ovirtual Object* cloneType() const

ovirtual Object* clone(const CopyOp& copyop) const

ovirtual bool isSameKindAs(const Object* obj) const

ovirtual const char* className() const

oinline void setNumPrims( const int n )

oinline const int getNumPrims() const

ovoid setPrimType( const PrimitiveType type )

oinline const PrimitiveType getPrimType() const

oinline void setPrimLengths( int* lens )

oinline int* getPrimLengths()

oinline const int* getPrimLengths() const

ovoid computeNumVerts() const

oinline const int getNumCoords() const
get the number of coords required by the defined primitives.

oinline Vec3* getCoords()
get a pointer to Vec3 coord array.

oinline const Vec3* getCoords() const
get a const pointer to Vec3 coord array.

oinline const int getNumCoordIndices() const
get the number of indices required by the defined primitives.

oinline IndexPointer& getCoordIndices()
get the coord index array.

oinline const IndexPointer& getCoordIndices() const
get the const coord index array.

ovoid setCoords( Vec3* cp )
set the coords (ie the geometry) of the geoset

ovoid setCoords( Vec3* cp, ushort* ci )
set the coords (ie the geometry) and ushort indices of the geoset. To reduce memory footprint and bandwidth for small datasets it is recommended the ushort indices are used instead of unit indices.

ovoid setCoords( Vec3* cp, uint* ci )
set the coords (ie the geometry) and uint indices of the geoset. Unless your data set exceeds 65536 indices prefer ushort indices over uint indices, only use this unit indices version if necessary.

ovoid setCoords( Vec3* cp, IndexPointer& ip )
set the coords (ie the geometry) and indices of the geoset

oinline const int getNumNormals() const
get the number of normals required by the defined primitives and normals binding

oinline Vec3* getNormals()
get a pointer to Vec3 normal array.

oinline const Vec3* getNormals() const
get a const pointer to Vec3 normal array.

oinline int getNumNormalIndices() const
get the number of normal indices required by the defined primitives and normals binding

oinline IndexPointer& getNormalIndices()
get the normal index array.

oinline const IndexPointer& getNormalIndices() const
get the const normal index array.

ovoid setNormals( Vec3* np )
set the normals of the geoset

ovoid setNormals( Vec3* np, ushort* ni )
set the normals and normal indices of the geoset

ovoid setNormals( Vec3* np, uint* ni )
set the normals and normal indices of the geoset

ovoid setNormals( Vec3* np, IndexPointer& ip )
set the normals and normal indices of the geoset

ovoid setNormalBinding( const BindingType binding )
set the normals binding to the vertices/primitives/overall

oinline const BindingType getNormalBinding() const

oinline const int getNumColors() const
get the number of colors required by the defined primitives and color binding

oinline Vec4* getColors()
get a pointer to Vec4 color array.

oinline const Vec4* getColors() const
get a pointer to Vec4 color array.

oinline int getNumColorIndices() const
get the number of colors indices required by the defined primitives and color binding

oinline IndexPointer& getColorIndices()
get the color index array.

oinline const IndexPointer& getColorIndices() const
get the const color index array.

ovoid setColors( Vec4* cp )
set the colors of the geoset

ovoid setColors( Vec4* cp, ushort* li )
set the colors and color indices of the geoset

ovoid setColors( Vec4* cp, uint* li )
set the colors and color indices of the geoset

ovoid setColors( Vec4* cp, IndexPointer& ip )
set the colors and color indices of the geoset

ovoid setColorBinding( BindingType binding )
set the color binding to the vertices/primitives/overall

oinline BindingType getColorBinding() const

oinline const int getNumTextureCoords() const
get the number of texture coords required by the defined primitives and textures binding

oinline Vec2* getTextureCoords()
get a pointer to Vec4 color array.

oinline const Vec2* getTextureCoords() const
get a pointer to Vec4 color array.

oinline const int getNumTextureIndices() const
get the number of texture coord indices required by the defined primitives and texture binding

oinline IndexPointer& getTextureIndices()
get the texture index array.

oinline const IndexPointer& getTextureIndices() const
get the texture index array.

ovoid setTextureCoords( Vec2* tc )
set the texture coords of the geoset

ovoid setTextureCoords( Vec2* tc, ushort* ti )
set the texture coords and texture coord indices of the geoset

ovoid setTextureCoords( Vec2* tc, uint* ti )
set the texture coords and texture coord indices of the geoset

ovoid setTextureCoords( Vec2* tc, IndexPointer& ip )
set the texture coords and texture indices of the geoset

ovoid setTextureBinding( const BindingType binding )
set the texture coord binding to the vertices/primitives/overall

oinline const BindingType getTextureBinding() const

oinline const int getNumInterleavedCoords() const
get the number of texture coords required by the defined primitives and textures binding

oinline void* getInterleavedArray()
get a pointer to interleaved float array.

oinline const void* getInterleavedArray() const
get a const pointer to interleaved float array.

oinline const int getNumInterleavedIndices() const
get the number of texture coord indices required by the defined primitives and texture binding

oinline IndexPointer& getInterleavedIndices()
get the texture index array.

oinline const IndexPointer& getInterleavedIndices() const
get the interleaved index array.

oinline const InterleaveArrayType getInterleavedFormat() const
get the interleaved array storage format.

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia )
set the interleaved arrays of the geoset

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia, ushort* iai )

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia, uint* iai )

ovoid setInterleavedArray( const InterleaveArrayType format, float* ia, IndexPointer& iai )

ovirtual void drawImmediateMode(State& state)
draw geoset directly ignoring an OpenGL display list which could be attached. This is the internal draw method which does the drawing itself, and is the method to override when deriving from GeoSet for user-drawn objects.

oconst bool check() const

ostruct AttributeDeleteFunctor: public osg::Referenced
function object which is used to handling the clean up of attribute arrays associated with GeoSet's. A default is provided which assumes that all momory attached to the GeoSet is owned by this GeoSet and can be deleted using delete []. If this is not the cause derive your own AttributeDeleteFunctor a specify your own memory deletion operation.

ovirtual void operator() (GeoSet* gset)

ovoid setAttributeDeleteFunctor(AttributeDeleteFunctor* adf)
set an alternative AttributeDeleteFunction to handle attribute arrays attached to this Geoset

oAttributeDeleteFunctor* getAttributeDeleteFunctor()
get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset

oconst AttributeDeleteFunctor* getAttributeDeleteFunctor() const
get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset

obool getStats(Statistics &)
Statistics collection for each drawable- 260901

ovirtual AttributeBitMask suppportsAttributeOperation() const
return the attributes supported by applyAttrbuteUpdate() as an AttributeBitMask

ovirtual AttributeBitMask applyAttributeOperation(AttributeFunctor& auf)
return the attributes successully applied in applyAttributeUpdate

oGeoSet& operator = (const GeoSet&)

ovirtual ~GeoSet()

ovirtual const bool computeBound() const

oref_ptr<AttributeDeleteFunctor> _adf

oint _numprims

oPrimitiveType _primtype

oint _needprimlen

ounsigned int _oglprimtype

oint* _primLengths

omutable unsigned char _primlength

ounsigned char _flat_shaded_skip

omutable int _numcoords

oVec3* _coords

oIndexPointer _cindex

oBindingType _normal_binding

omutable int _numnormals

oVec3* _normals

oIndexPointer _nindex

oBindingType _color_binding

omutable int _numcolors

oVec4* _colors

oIndexPointer _colindex

oBindingType _texture_binding

omutable int _numtcoords

oVec2* _tcoords

oIndexPointer _tindex

ovoid* _iarray

oIndexPointer _iaindex

oInterleaveArrayType _iaformat

ounsigned int _ogliaformat

oint _fast_path

ovoid set_fast_path( void )

ovoid draw_fast_path( void )

ovoid draw_alternate_path( void )


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.