Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::GeoSet Class Reference

Note, osg::GeoSet is now deprecated, please use osg::Geometry instead. More...

Inheritance diagram for osg::GeoSet:

Inheritance graph
[legend]
List of all members.

Public Types

enum  PrimitiveType {
  NO_TYPE, POINTS, LINES, LINE_STRIP,
  FLAT_LINE_STRIP, LINE_LOOP, TRIANGLES, TRIANGLE_STRIP,
  FLAT_TRIANGLE_STRIP, TRIANGLE_FAN, FLAT_TRIANGLE_FAN, QUADS,
  QUAD_STRIP, POLYGON
}
enum  BindingType {
  BIND_OFF, BIND_OVERALL, BIND_PERPRIM, BIND_PERVERTEX,
  BIND_DEFAULT
}
enum  InterleaveArrayType {
  IA_OFF, IA_V2F, IA_V3F, IA_C4UB_V2F,
  IA_C4UB_V3F, IA_C3F_V3F, IA_N3F_V3F, IA_C4F_N3F_V3F,
  IA_T2F_V3F, IA_T4F_V4F, IA_T2F_C4UB_V3F, IA_T2F_C3F_V3F,
  IA_T2F_N3F_V3F, IA_T2F_C4F_N3F_V3F, IA_T4F_C4F_N3F_V4F
}

Public Methods

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

virtual ObjectcloneType () const
 Clone the type of an object, with Object* return type.

virtual Objectclone (const CopyOp &copyop) const
 Clone the an object, with Object* return type.

virtual bool isSameKindAs (const Object *obj) const
virtual const char * libraryName () const
 return the name of the object's library.

virtual const char * className () const
 return the name of the object's class type.

void setNumPrims (const int n)
const int getNumPrims () const
void setPrimType (const PrimitiveType type)
const PrimitiveType getPrimType () const
void setPrimLengths (int *lens)
int * getPrimLengths ()
const int * getPrimLengths () const
void computeNumVerts () const
const int getNumCoords () const
 get the number of coords required by the defined primitives.

Vec3getCoords ()
 get a pointer to Vec3 coord array.

const Vec3getCoords () const
 get a const pointer to Vec3 coord array.

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

IndexPointergetCoordIndices ()
 get the coord index array.

const IndexPointergetCoordIndices () const
 get the const coord index array.

void setCoords (Vec3 *cp)
 set the coords (i.e the geometry) of the geoset.

void setCoords (Vec3 *cp, GLushort *ci)
 set the coords (i.e the geometry) and ushort indices of the geoset.

void setCoords (Vec3 *cp, GLuint *ci)
 set the coords (i.e the geometry) and uint indices of the geoset.

void setCoords (Vec3 *cp, IndexPointer &ip)
 set the coords (i.e the geometry) and indices of the geoset.

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

Vec3getNormals ()
 get a pointer to Vec3 normal array.

const Vec3getNormals () const
 get a const pointer to Vec3 normal array.

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

IndexPointergetNormalIndices ()
 get the normal index array.

const IndexPointergetNormalIndices () const
 get the const normal index array.

void setNormals (Vec3 *np)
 set the normals of the geoset.

void setNormals (Vec3 *np, GLushort *ni)
 set the normals and normal indices of the geoset.

void setNormals (Vec3 *np, GLuint *ni)
 set the normals and normal indices of the geoset.

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

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

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

Vec4getColors ()
 get a pointer to Vec4 color array.

const Vec4getColors () const
 get a pointer to Vec4 color array.

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

IndexPointergetColorIndices ()
 get the color index array.

const IndexPointergetColorIndices () const
 get the const color index array.

void setColors (Vec4 *cp)
 set the colors of the geoset.

void setColors (Vec4 *cp, GLushort *li)
 set the colors and color indices of the geoset.

void setColors (Vec4 *cp, GLuint *li)
 set the colors and color indices of the geoset.

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

void setColorBinding (const BindingType binding)
 set the color binding to the vertices/primitives/overall.

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

Vec2getTextureCoords ()
 get a pointer to Vec4 color array.

const Vec2getTextureCoords () const
 get a pointer to Vec4 color array.

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

IndexPointergetTextureIndices ()
 get the texture index array.

const IndexPointergetTextureIndices () const
 get the texture index array.

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

void setTextureCoords (Vec2 *tc, GLushort *ti)
 set the texture coords and texture coord indices of the geoset.

void setTextureCoords (Vec2 *tc, GLuint *ti)
 set the texture coords and texture coord indices of the geoset.

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

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

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

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

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

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

IndexPointergetInterleavedIndices ()
 get the texture index array.

const IndexPointergetInterleavedIndices () const
 get the interleaved index array.

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

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

void setInterleavedArray (const InterleaveArrayType format, float *ia, GLushort *iai)
void setInterleavedArray (const InterleaveArrayType format, float *ia, GLuint *iai)
void setInterleavedArray (const InterleaveArrayType format, float *ia, IndexPointer &iai)
virtual void drawImmediateMode (State &state)
 draw geoset directly ignoring an OpenGL display list which could be attached.

const bool check () const
void setAttributeDeleteFunctor (AttributeDeleteFunctor *adf)
 set an alternative AttributeDeleteFunction to handle attribute arrays attached to this Geoset.

AttributeDeleteFunctorgetAttributeDeleteFunctor ()
 get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset.

const AttributeDeleteFunctorgetAttributeDeleteFunctor () const
 get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset.

virtual void accept (AttributeFunctor &af)
 accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.

virtual void accept (PrimitiveFunctor &pf)
 accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.

GeometryconvertToGeometry ()
 convinience function for converting GeoSet's to equivilant Geometry nodes.


Protected Methods

GeoSet & operator= (const GeoSet &)
virtual ~GeoSet ()
virtual const bool computeBound () const
 compute the bounding box of the drawable.

void set_fast_path (void)
void draw_fast_path (State &state)
void draw_alternate_path (State &state)

Protected Attributes

ref_ptr< AttributeDeleteFunctor_adf
int _numprims
PrimitiveType _primtype
int _needprimlen
unsigned int _oglprimtype
int * _primLengths
unsigned char _primlength
unsigned char _flat_shaded_skip
int _numcoords
Vec3_coords
IndexPointer _cindex
BindingType _normal_binding
int _numnormals
Vec3_normals
IndexPointer _nindex
BindingType _color_binding
int _numcolors
Vec4_colors
IndexPointer _colindex
BindingType _texture_binding
int _numtcoords
Vec2_tcoords
IndexPointer _tindex
void * _iarray
IndexPointer _iaindex
InterleaveArrayType _iaformat
unsigned int _ogliaformat
int _fast_path

Detailed Description

Note, osg::GeoSet is now deprecated, please use osg::Geometry instead.

osg::GeoSet will be kept through to the beta release for backwards compatability only.

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.


Member Enumeration Documentation

enum osg::GeoSet::BindingType
 

Enumeration values:
BIND_OFF 
BIND_OVERALL 
BIND_PERPRIM 
BIND_PERVERTEX 
BIND_DEFAULT 

enum osg::GeoSet::InterleaveArrayType
 

Enumeration values:
IA_OFF 
IA_V2F 
IA_V3F 
IA_C4UB_V2F 
IA_C4UB_V3F 
IA_C3F_V3F 
IA_N3F_V3F 
IA_C4F_N3F_V3F 
IA_T2F_V3F 
IA_T4F_V4F 
IA_T2F_C4UB_V3F 
IA_T2F_C3F_V3F 
IA_T2F_N3F_V3F 
IA_T2F_C4F_N3F_V3F 
IA_T4F_C4F_N3F_V4F 

enum osg::GeoSet::PrimitiveType
 

Enumeration values:
NO_TYPE 
POINTS 
LINES 
LINE_STRIP 
FLAT_LINE_STRIP 
LINE_LOOP 
TRIANGLES 
TRIANGLE_STRIP 
FLAT_TRIANGLE_STRIP 
TRIANGLE_FAN 
FLAT_TRIANGLE_FAN 
QUADS 
QUAD_STRIP 
POLYGON 


Constructor & Destructor Documentation

osg::GeoSet::GeoSet  
 

osg::GeoSet::GeoSet const GeoSet &    geoset,
const CopyOp   copyop = CopyOp::SHALLOW_COPY
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::GeoSet::~GeoSet   [protected, virtual]
 


Member Function Documentation

virtual void osg::GeoSet::accept PrimitiveFunctor &    pf [virtual]
 

accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.

Reimplemented from osg::Drawable.

virtual void osg::GeoSet::accept AttributeFunctor &    af [virtual]
 

accept an AttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.

Reimplemented from osg::Drawable.

const bool osg::GeoSet::check   const
 

virtual const char* osg::GeoSet::className   const [inline, virtual]
 

return the name of the object's class type.

Must be defined by derived classes.

Reimplemented from osg::Drawable.

virtual Object* osg::GeoSet::clone const CopyOp   copyop const [inline, virtual]
 

Clone the an object, with Object* return type.

Must be defined by derived classes.

Implements osg::Object.

virtual Object* osg::GeoSet::cloneType   const [inline, virtual]
 

Clone the type of an object, with Object* return type.

Must be defined by derived classes.

Implements osg::Object.

virtual const bool osg::GeoSet::computeBound   const [protected, virtual]
 

compute the bounding box of the drawable.

Method must be implemented by subclasses.

Reimplemented from osg::Drawable.

void osg::GeoSet::computeNumVerts   const
 

Geometry* osg::GeoSet::convertToGeometry  
 

convinience function for converting GeoSet's to equivilant Geometry nodes.

void osg::GeoSet::draw_alternate_path State   state [protected]
 

void osg::GeoSet::draw_fast_path State   state [protected]
 

virtual void osg::GeoSet::drawImmediateMode State   state [virtual]
 

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.

Implements osg::Drawable.

const AttributeDeleteFunctor* osg::GeoSet::getAttributeDeleteFunctor   const [inline]
 

get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset.

AttributeDeleteFunctor* osg::GeoSet::getAttributeDeleteFunctor   [inline]
 

get the current AttributeDeleteFunction to handle attribute arrays attached to this Geoset.

BindingType osg::GeoSet::getColorBinding   const [inline]
 

const IndexPointer& osg::GeoSet::getColorIndices   const [inline]
 

get the const color index array.

IndexPointer& osg::GeoSet::getColorIndices   [inline]
 

get the color index array.

const Vec4* osg::GeoSet::getColors   const [inline]
 

get a pointer to Vec4 color array.

Vec4* osg::GeoSet::getColors   [inline]
 

get a pointer to Vec4 color array.

const IndexPointer& osg::GeoSet::getCoordIndices   const [inline]
 

get the const coord index array.

IndexPointer& osg::GeoSet::getCoordIndices   [inline]
 

get the coord index array.

const Vec3* osg::GeoSet::getCoords   const [inline]
 

get a const pointer to Vec3 coord array.

Vec3* osg::GeoSet::getCoords   [inline]
 

get a pointer to Vec3 coord array.

const void* osg::GeoSet::getInterleavedArray   const [inline]
 

get a const pointer to interleaved float array.

void* osg::GeoSet::getInterleavedArray   [inline]
 

get a pointer to interleaved float array.

const InterleaveArrayType osg::GeoSet::getInterleavedFormat   const [inline]
 

get the interleaved array storage format.

const IndexPointer& osg::GeoSet::getInterleavedIndices   const [inline]
 

get the interleaved index array.

IndexPointer& osg::GeoSet::getInterleavedIndices   [inline]
 

get the texture index array.

const BindingType osg::GeoSet::getNormalBinding   const [inline]
 

const IndexPointer& osg::GeoSet::getNormalIndices   const [inline]
 

get the const normal index array.

IndexPointer& osg::GeoSet::getNormalIndices   [inline]
 

get the normal index array.

const Vec3* osg::GeoSet::getNormals   const [inline]
 

get a const pointer to Vec3 normal array.

Vec3* osg::GeoSet::getNormals   [inline]
 

get a pointer to Vec3 normal array.

int osg::GeoSet::getNumColorIndices   const [inline]
 

get the number of colors indices required by the defined primitives and color binding.

const int osg::GeoSet::getNumColors   const [inline]
 

get the number of colors required by the defined primitives and color binding.

const int osg::GeoSet::getNumCoordIndices   const [inline]
 

get the number of indices required by the defined primitives.

const int osg::GeoSet::getNumCoords   const [inline]
 

get the number of coords required by the defined primitives.

const int osg::GeoSet::getNumInterleavedCoords   const [inline]
 

get the number of texture coords required by the defined primitives and textures binding.

const int osg::GeoSet::getNumInterleavedIndices   const [inline]
 

get the number of texture coord indices required by the defined primitives and texture binding.

int osg::GeoSet::getNumNormalIndices   const [inline]
 

get the number of normal indices required by the defined primitives and normals binding.

const int osg::GeoSet::getNumNormals   const [inline]
 

get the number of normals required by the defined primitives and normals binding.

const int osg::GeoSet::getNumPrims   const [inline]
 

const int osg::GeoSet::getNumTextureCoords   const [inline]
 

get the number of texture coords required by the defined primitives and textures binding.

const int osg::GeoSet::getNumTextureIndices   const [inline]
 

get the number of texture coord indices required by the defined primitives and texture binding.

const int* osg::GeoSet::getPrimLengths   const [inline]
 

int* osg::GeoSet::getPrimLengths   [inline]
 

const PrimitiveType osg::GeoSet::getPrimType   const [inline]
 

const BindingType osg::GeoSet::getTextureBinding   const [inline]
 

const Vec2* osg::GeoSet::getTextureCoords   const [inline]
 

get a pointer to Vec4 color array.

Vec2* osg::GeoSet::getTextureCoords   [inline]
 

get a pointer to Vec4 color array.

const IndexPointer& osg::GeoSet::getTextureIndices   const [inline]
 

get the texture index array.

IndexPointer& osg::GeoSet::getTextureIndices   [inline]
 

get the texture index array.

virtual bool osg::GeoSet::isSameKindAs const Object   obj const [inline, virtual]
 

Reimplemented from osg::Drawable.

virtual const char* osg::GeoSet::libraryName   const [inline, virtual]
 

return the name of the object's library.

Must be defined by derived classes. The OpenSceneGraph convention the is that the namspace of a library is the same as the library name.

Reimplemented from osg::Drawable.

GeoSet& osg::GeoSet::operator= const GeoSet &    [inline, protected]
 

void osg::GeoSet::set_fast_path void    [protected]
 

void osg::GeoSet::setAttributeDeleteFunctor AttributeDeleteFunctor   adf [inline]
 

set an alternative AttributeDeleteFunction to handle attribute arrays attached to this Geoset.

void osg::GeoSet::setColorBinding const BindingType    binding
 

set the color binding to the vertices/primitives/overall.

void osg::GeoSet::setColors Vec4   cp,
IndexPointer   ip
 

set the colors and color indices of the geoset.

void osg::GeoSet::setColors Vec4   cp,
GLuint *    li
 

set the colors and color indices of the geoset.

void osg::GeoSet::setColors Vec4   cp,
GLushort *    li
 

set the colors and color indices of the geoset.

void osg::GeoSet::setColors Vec4   cp
 

set the colors of the geoset.

void osg::GeoSet::setCoords Vec3   cp,
IndexPointer   ip
 

set the coords (i.e the geometry) and indices of the geoset.

void osg::GeoSet::setCoords Vec3   cp,
GLuint *    ci
 

set the coords (i.e 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.

void osg::GeoSet::setCoords Vec3   cp,
GLushort *    ci
 

set the coords (i.e 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.

void osg::GeoSet::setCoords Vec3   cp
 

set the coords (i.e the geometry) of the geoset.

void osg::GeoSet::setInterleavedArray const InterleaveArrayType    format,
float *    ia,
IndexPointer   iai
 

void osg::GeoSet::setInterleavedArray const InterleaveArrayType    format,
float *    ia,
GLuint *    iai
 

void osg::GeoSet::setInterleavedArray const InterleaveArrayType    format,
float *    ia,
GLushort *    iai
 

void osg::GeoSet::setInterleavedArray const InterleaveArrayType    format,
float *    ia
 

set the interleaved arrays of the geoset.

void osg::GeoSet::setNormalBinding const BindingType    binding
 

set the normals binding to the vertices/primitives/overall.

void osg::GeoSet::setNormals Vec3   np,
IndexPointer   ip
 

set the normals and normal indices of the geoset.

void osg::GeoSet::setNormals Vec3   np,
GLuint *    ni
 

set the normals and normal indices of the geoset.

void osg::GeoSet::setNormals Vec3   np,
GLushort *    ni
 

set the normals and normal indices of the geoset.

void osg::GeoSet::setNormals Vec3   np
 

set the normals of the geoset.

void osg::GeoSet::setNumPrims const int    n [inline]
 

void osg::GeoSet::setPrimLengths int *    lens [inline]
 

void osg::GeoSet::setPrimType const PrimitiveType    type
 

void osg::GeoSet::setTextureBinding const BindingType    binding
 

set the texture coord binding to the vertices/primitives/overall.

void osg::GeoSet::setTextureCoords Vec2   tc,
IndexPointer   ip
 

set the texture coords and texture indices of the geoset.

void osg::GeoSet::setTextureCoords Vec2   tc,
GLuint *    ti
 

set the texture coords and texture coord indices of the geoset.

void osg::GeoSet::setTextureCoords Vec2   tc,
GLushort *    ti
 

set the texture coords and texture coord indices of the geoset.

void osg::GeoSet::setTextureCoords Vec2   tc
 

set the texture coords of the geoset.


Member Data Documentation

ref_ptr<AttributeDeleteFunctor> osg::GeoSet::_adf [protected]
 

IndexPointer osg::GeoSet::_cindex [protected]
 

IndexPointer osg::GeoSet::_colindex [protected]
 

BindingType osg::GeoSet::_color_binding [protected]
 

Vec4* osg::GeoSet::_colors [protected]
 

Vec3* osg::GeoSet::_coords [protected]
 

int osg::GeoSet::_fast_path [protected]
 

unsigned char osg::GeoSet::_flat_shaded_skip [protected]
 

InterleaveArrayType osg::GeoSet::_iaformat [protected]
 

IndexPointer osg::GeoSet::_iaindex [protected]
 

void* osg::GeoSet::_iarray [protected]
 

int osg::GeoSet::_needprimlen [protected]
 

IndexPointer osg::GeoSet::_nindex [protected]
 

BindingType osg::GeoSet::_normal_binding [protected]
 

Vec3* osg::GeoSet::_normals [protected]
 

int osg::GeoSet::_numcolors [protected]
 

int osg::GeoSet::_numcoords [protected]
 

int osg::GeoSet::_numnormals [protected]
 

int osg::GeoSet::_numprims [protected]
 

int osg::GeoSet::_numtcoords [protected]
 

unsigned int osg::GeoSet::_ogliaformat [protected]
 

unsigned int osg::GeoSet::_oglprimtype [protected]
 

unsigned char osg::GeoSet::_primlength [protected]
 

int* osg::GeoSet::_primLengths [protected]
 

PrimitiveType osg::GeoSet::_primtype [protected]
 

Vec2* osg::GeoSet::_tcoords [protected]
 

BindingType osg::GeoSet::_texture_binding [protected]
 

IndexPointer osg::GeoSet::_tindex [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:31 2002 for the Open Scene Graph by doxygen 1.2.16.