class SG_EXPORT osg::GeoSet: public Object

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

Inheritance:


Public Classes

[more]enum PrimitiveType
[more]enum BindingType
[more]enum InterleaveArrayType

Public Methods

[more] GeoSet()
[more]static GeoSet* instance()
[more]virtual Object* clone() const
[more]virtual bool isSameKindAs(Object* obj)
[more]virtual const char* className() const
[more]void setNumPrims( int n )
[more]int getNumPrims( void )
[more]void setPrimType( PrimitiveType type )
[more]PrimitiveType getPrimType( void )
[more]void setPrimLengths( int *lens )
[more]int* getPrimLengths( void )
[more]void computeNumVerts()
[more]int getNumCoords()
get the number of coords required by the defined primitives.
[more]Vec3* getCoords()
get a pointer to Vec3 coord array.
[more]int getNumIndices()
get the number of indices required by the defined primitives.
[more]ushort* getCIndex()
get the 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 indices of the geoset
[more]int getNumNormals()
get the number of normals required by the defined primitives and normals binding
[more]Vec3* getNormals()
get a pointer to Vec3 normal array.
[more]int getNumNIndices()
get the number of normal indices required by the defined primitives and normals binding
[more]ushort* getNIndex()
get the 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 setNormalBinding( BindingType binding )
set the normals binding to the vertices/primitives/overall
[more]BindingType getNormalBinding()
[more]int getNumColors()
get the number of colors required by the defined primitives and color binding
[more]Vec4* getColors()
get a pointer to Vec4 color array.
[more]int getNumCIndices()
get the number of colors indices required by the defined primitives and color binding
[more]ushort* getColIndex()
get the color index array.
[more]void setColors( Vec4 *lp )
set the colors of the geoset
[more]void setColors( Vec4 *lp, ushort *li )
set the colors and color indices of the geoset
[more]void setColorBinding( BindingType binding )
set the color binding to the vertices/primitives/overall
[more]BindingType getColorBinding()
[more]int getNumTCoords()
get the number of texture coords required by the defined primitives and textures binding
[more]Vec2* getTCoords()
get a pointer to Vec4 color array.
[more]int getNumTIndices()
get the number of texture coord indices required by the defined primitives and texture binding
[more]ushort* getTIndex()
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 setTextureBinding( BindingType binding )
set the texture coord binding to the vertices/primitives/overall
[more]BindingType getTextureBinding()
[more]void setInterleavedArray( InterleaveArrayType format, float *ia )
[more]void setInterleavedArray( InterleaveArrayType format, float *ia, ushort *iai )
[more]void setGeoState(GeoState *state)
[more]GeoState* getGeoState() const
[more]void setUseDisplayList(bool flag)
When set to true, force the draw method to use OpenGL Display List for rendering.
[more]bool getUseDisplayList()
Return whether OpenGL display lists are being used for rendering
[more]void dirtyDisplayList()
Force a recompile on next draw() of any OpenGL display list associated with this geoset
[more]virtual const BoundingBox& getBound()
get bounding box of geoset.
[more]void draw( void )
draw geoset.
[more]virtual void drawImmediateMode()
draw geoset directly ignoring an OpenGL display list which could be attached.
[more]void compile( void )
Immediately compile this geoset into an OpenGL Display List, set _useDisplayList to true
[more]bool check()

Protected Methods

[more] GeoSet(const GeoSet&)
[more]GeoSet& operator = (const GeoSet&)
[more]virtual ~GeoSet()
[more]bool matchBindingTypeStr(const char* str, BindingType& mode)
[more]const char* getBindingTypeStr(BindingType mode)
[more]virtual bool readLocalData(Input& fr)
[more]virtual bool writeLocalData(Output& fw)


Inherited from Object:

Public Methods

ovirtual Object* readClone(Input& fr)
ovirtual bool write(Output& fw)


Inherited from Referenced:

Public Methods

ovoid ref()
ovoid unref()
oint referenceCount()

Protected Fields

oint _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 GeoState which the GeoSet maintains a referenced counted pointer to. Both GeoSet's and GeoState'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

o GeoSet()

ostatic GeoSet* instance()

ovirtual Object* clone() const

ovirtual bool isSameKindAs(Object* obj)

ovirtual const char* className() const

ovoid setNumPrims( int n )

oint getNumPrims( void )

ovoid setPrimType( PrimitiveType type )

oPrimitiveType getPrimType( void )

ovoid setPrimLengths( int *lens )

oint* getPrimLengths( void )

ovoid computeNumVerts()

oint getNumCoords()
get the number of coords required by the defined primitives.

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

oint getNumIndices()
get the number of indices required by the defined primitives.

oushort* getCIndex()
get the 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 indices of the geoset

oint getNumNormals()
get the number of normals required by the defined primitives and normals binding

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

oint getNumNIndices()
get the number of normal indices required by the defined primitives and normals binding

oushort* getNIndex()
get the 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 setNormalBinding( BindingType binding )
set the normals binding to the vertices/primitives/overall

oBindingType getNormalBinding()

oint getNumColors()
get the number of colors required by the defined primitives and color binding

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

oint getNumCIndices()
get the number of colors indices required by the defined primitives and color binding

oushort* getColIndex()
get the color index array.

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

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

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

oBindingType getColorBinding()

oint getNumTCoords()
get the number of texture coords required by the defined primitives and textures binding

oVec2* getTCoords()
get a pointer to Vec4 color array.

oint getNumTIndices()
get the number of texture coord indices required by the defined primitives and texture binding

oushort* getTIndex()
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 setTextureBinding( BindingType binding )
set the texture coord binding to the vertices/primitives/overall

oBindingType getTextureBinding()

ovoid setInterleavedArray( InterleaveArrayType format, float *ia )

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

ovoid setGeoState(GeoState *state)

oGeoState* getGeoState() const

ovoid setUseDisplayList(bool flag)
When set to true, force the draw method to use OpenGL Display List for rendering. If false rendering directly. If the display list has not been already compile the next call to draw will automatically create the display list.

obool getUseDisplayList()
Return whether OpenGL display lists are being used for rendering

ovoid dirtyDisplayList()
Force a recompile on next draw() of any OpenGL display list associated with this geoset

ovirtual const BoundingBox& getBound()
get bounding box of geoset. Note, now made virtual to make it possible to implement user-drawn objects albiet so what crudely, to be improved later.

ovoid draw( void )
draw geoset. If the geoset has _useDisplayList set to true then use an OpenGL display list, automatically compiling one if required. Otherwise call drawImmediateMode(). Note, draw method should not be overiden in subclasses as it manages the optional display list.

ovirtual void drawImmediateMode()
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.

ovoid compile( void )
Immediately compile this geoset into an OpenGL Display List, set _useDisplayList to true

obool check()

o GeoSet(const GeoSet&)

oGeoSet& operator = (const GeoSet&)

ovirtual ~GeoSet()

obool matchBindingTypeStr(const char* str, BindingType& mode)

oconst char* getBindingTypeStr(BindingType mode)

ovirtual bool readLocalData(Input& fr)

ovirtual bool writeLocalData(Output& fw)


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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