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]virtual Object* clone() 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()
[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 getNumIterleavedIndices() 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 getInterleavedFromat() 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

Public Members

[more]enum PrimitiveType
[more]enum BindingType
[more]enum InterleaveArrayType
[more]struct IndexPointer

Protected Fields

[more]int _numprims
[more]PrimitiveType _primtype
[more]int _needprimlen
[more]unsigned int _oglprimtype
[more]int* _primLengths
[more]unsigned char _primlength
[more]unsigned char _flat_shaded_skip
[more]int _numcoords
[more]Vec3* _coords
[more]IndexPointer _cindex
[more]BindingType _normal_binding
[more]int _numnormals
[more]Vec3* _normals
[more]IndexPointer _nindex
[more]BindingType _color_binding
[more]int _numcolors
[more]Vec4* _colors
[more]IndexPointer _colindex
[more]BindingType _texture_binding
[more]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(const GeoSet&)
[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 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()
oinline void dirtyBound()
oinline const BoundingBox& getBound() const
oinline void draw(State& state)
ovoid compile(State& state)
ostatic void deleteDisplayList(uint contextID, uint globj)
ostatic void flushDeletedDisplayLists(uint contextID)

Protected Fields

oref_ptr<StateSet> _dstate
obool _supportsDisplayList
obool _useDisplayList
omutable BoundingBox _bbox
omutable bool _bbox_computed

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

ouint _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()

ovirtual Object* clone() 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()

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 undices 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 neccessary.

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 getNumIterleavedIndices() 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 getInterleavedFromat() 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

o GeoSet(const GeoSet&)

oGeoSet& operator = (const GeoSet&)

ovirtual ~GeoSet()

ovirtual const bool computeBound() const

oint _numprims

oPrimitiveType _primtype

oint _needprimlen

ounsigned int _oglprimtype

oint* _primLengths

ounsigned char _primlength

ounsigned char _flat_shaded_skip

oint _numcoords

oVec3* _coords

oIndexPointer _cindex

oBindingType _normal_binding

oint _numnormals

oVec3* _normals

oIndexPointer _nindex

oBindingType _color_binding

oint _numcolors

oVec4* _colors

oIndexPointer _colindex

oBindingType _texture_binding

oint _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++.