OpenSceneGraph  3.4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
osg::Geometry Class Reference
Inheritance diagram for osg::Geometry:
Inheritance graph
[legend]

List of all members.

Public Types

enum  AttributeBinding { BIND_OFF = 0, BIND_OVERALL = 1, BIND_PER_PRIMITIVE_SET = 2, BIND_PER_VERTEX = 4 }
 deprecated, Same values as Array::Binding. More...
typedef std::vector
< osg::ref_ptr< osg::Array > > 
ArrayList
typedef std::vector< ref_ptr
< PrimitiveSet > > 
PrimitiveSetList
typedef std::vector
< osg::DrawElements * > 
DrawElementsList

Public Member Functions

 Geometry ()
 Geometry (const Geometry &geometry, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_Node (osg, Geometry)
virtual GeometryasGeometry ()
 convert 'this' into a Geometry pointer if Node is a Geometry, otherwise return 0.
virtual const GeometryasGeometry () const
 convert 'const this' into a const Geometry pointer if Node is a Geometry, otherwise return 0.
bool empty () const
void setVertexArray (Array *array)
ArraygetVertexArray ()
const ArraygetVertexArray () const
void setNormalArray (Array *array)
void setNormalArray (Array *array, osg::Array::Binding binding)
ArraygetNormalArray ()
const ArraygetNormalArray () const
void setColorArray (Array *array)
void setColorArray (Array *array, osg::Array::Binding binding)
ArraygetColorArray ()
const ArraygetColorArray () const
void setSecondaryColorArray (Array *array)
void setSecondaryColorArray (Array *array, osg::Array::Binding binding)
ArraygetSecondaryColorArray ()
const ArraygetSecondaryColorArray () const
void setFogCoordArray (Array *array)
void setFogCoordArray (Array *array, osg::Array::Binding binding)
ArraygetFogCoordArray ()
const ArraygetFogCoordArray () const
void setTexCoordArray (unsigned int unit, Array *array)
void setTexCoordArray (unsigned int unit, Array *array, osg::Array::Binding binding)
ArraygetTexCoordArray (unsigned int unit)
const ArraygetTexCoordArray (unsigned int unit) const
unsigned int getNumTexCoordArrays () const
void setTexCoordArrayList (const ArrayList &arrrayList)
ArrayListgetTexCoordArrayList ()
const ArrayListgetTexCoordArrayList () const
void setVertexAttribArray (unsigned int index, Array *array)
void setVertexAttribArray (unsigned int index, Array *array, osg::Array::Binding binding)
ArraygetVertexAttribArray (unsigned int index)
const ArraygetVertexAttribArray (unsigned int index) const
unsigned int getNumVertexAttribArrays () const
void setVertexAttribArrayList (const ArrayList &arrayList)
ArrayListgetVertexAttribArrayList ()
const ArrayListgetVertexAttribArrayList () const
void setPrimitiveSetList (const PrimitiveSetList &primitives)
PrimitiveSetListgetPrimitiveSetList ()
const PrimitiveSetListgetPrimitiveSetList () const
unsigned int getNumPrimitiveSets () const
PrimitiveSetgetPrimitiveSet (unsigned int pos)
const PrimitiveSetgetPrimitiveSet (unsigned int pos) const
bool addPrimitiveSet (PrimitiveSet *primitiveset)
 Add a primitive set to the geometry.
bool setPrimitiveSet (unsigned int i, PrimitiveSet *primitiveset)
 Set a primitive set to the specified position in geometry's primitive set list.
bool insertPrimitiveSet (unsigned int i, PrimitiveSet *primitiveset)
 Insert a primitive set to the specified position in geometry's primitive set list.
bool removePrimitiveSet (unsigned int i, unsigned int numElementsToRemove=1)
 Remove primitive set(s) from the specified position in geometry's primitive set list.
unsigned int getPrimitiveSetIndex (const PrimitiveSet *primitiveset) const
 Get the index number of a primitive set, return a value between 0 and getNumPrimitiveSet()-1 if found, if not found then return getNumPrimitiveSet().
bool containsSharedArrays () const
 return true if any arrays are shared.
void duplicateSharedArrays ()
 duplicate any shared arrays.
virtual void setUseVertexBufferObjects (bool flag)
 When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation method to use OpenGL vertex buffer objects for rendering.
virtual void dirtyDisplayList ()
 Force a recompile on next draw() of any OpenGL display list associated with this geoset.
virtual void resizeGLObjectBuffers (unsigned int maxSize)
 Resize any per context GLObject buffers to specified size.
virtual void releaseGLObjects (State *state=0) const
 If State is non-zero, this function releases OpenGL objects for the specified graphics context.
bool getArrayList (ArrayList &arrayList) const
bool getDrawElementsList (DrawElementsList &drawElementsList) const
osg::VertexBufferObjectgetOrCreateVertexBufferObject ()
osg::ElementBufferObjectgetOrCreateElementBufferObject ()
virtual unsigned int getGLObjectSizeHint () const
 Return the estimated size of GLObjects (display lists/vertex buffer objects) that are associated with this drawable.
virtual void compileGLObjects (RenderInfo &renderInfo) const
 Immediately compile this Drawable into an OpenGL Display List/VertexBufferObjects.
virtual void drawImplementation (RenderInfo &renderInfo) const
 Draw Geometry directly ignoring an OpenGL display list which could be attached.
void drawVertexArraysImplementation (RenderInfo &renderInfo) const
 Set up the vertex arrays for the purpose of rendering, called by drawImplemtation() prior to it calling drawPrimitivesImplementation().
void drawPrimitivesImplementation (RenderInfo &renderInfo) const
 dispatch the primitives to OpenGL, called by drawImplemtation() after calling drawVertexArraysImplementation().
virtual bool supports (const Drawable::AttributeFunctor &) const
 Return true, osg::Geometry does support accept(Drawable::AttributeFunctor&).
virtual void accept (Drawable::AttributeFunctor &af)
 Accept an Drawable::AttributeFunctor and call its methods to tell it about the internal attributes that this Drawable has.
virtual bool supports (const Drawable::ConstAttributeFunctor &) const
 Return true, osg::Geometry does support accept(Drawable::ConstAttributeFunctor&).
virtual void accept (Drawable::ConstAttributeFunctor &af) const
 Accept a Drawable::ConstAttributeFunctor and call its methods to tell it about the internal attributes that this Drawable has.
virtual bool supports (const PrimitiveFunctor &) const
 Return true, osg::Geometry does support accept(PrimitiveFunctor&).
virtual void accept (PrimitiveFunctor &pf) const
 Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.
virtual bool supports (const PrimitiveIndexFunctor &) const
 Return true, osg::Geometry does support accept(PrimitiveIndexFunctor&).
virtual void accept (PrimitiveIndexFunctor &pf) const
 Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.
bool containsDeprecatedData () const
 Return true if the deprecated use array indices or BIND_PER_PRIMITIVE binding has been assigned to arrays.
bool checkForDeprecatedData ()
 fallback for deprecated functionality.
void fixDeprecatedData ()
 fallback for deprecated functionality.
void setNormalBinding (AttributeBinding ab)
 deprecated, use array->set*Binding(..).
void setColorBinding (AttributeBinding ab)
void setSecondaryColorBinding (AttributeBinding ab)
void setFogCoordBinding (AttributeBinding ab)
void setVertexAttribBinding (unsigned int index, AttributeBinding ab)
AttributeBinding getNormalBinding () const
 deprecated, use array->get*Binding(..).
AttributeBinding getColorBinding () const
AttributeBinding getSecondaryColorBinding () const
AttributeBinding getFogCoordBinding () const
AttributeBinding getVertexAttribBinding (unsigned int index) const
void setVertexAttribNormalize (unsigned int index, GLboolean norm)
 deprecated, use array->set*Normalize(..).
GLboolean getVertexAttribNormalize (unsigned int index) const
 deprecated, use array->get*Normalize(..).

Protected Member Functions

Geometryoperator= (const Geometry &)
virtual ~Geometry ()
void addVertexBufferObjectIfRequired (osg::Array *array)
void addElementBufferObjectIfRequired (osg::PrimitiveSet *primitiveSet)

Protected Attributes

PrimitiveSetList _primitives
osg::ref_ptr< Array_vertexArray
osg::ref_ptr< Array_normalArray
osg::ref_ptr< Array_colorArray
osg::ref_ptr< Array_secondaryColorArray
osg::ref_ptr< Array_fogCoordArray
ArrayList _texCoordList
ArrayList _vertexAttribList
bool _containsDeprecatedData

Member Typedef Documentation


Member Enumeration Documentation

deprecated, Same values as Array::Binding.

Enumerator:
BIND_OFF 
BIND_OVERALL 
BIND_PER_PRIMITIVE_SET 
BIND_PER_VERTEX 

Reimplemented in deprecated_osg::Geometry.


Constructor & Destructor Documentation

Reimplemented in deprecated_osg::Geometry.

osg::Geometry::Geometry ( const Geometry geometry,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Geometry::~Geometry ( ) [protected, virtual]

Member Function Documentation

Accept an Drawable::AttributeFunctor and call its methods to tell it about the internal attributes that this Drawable has.

Reimplemented from osg::Drawable.

virtual void osg::Geometry::accept ( Drawable::ConstAttributeFunctor af) const [virtual]

Accept a Drawable::ConstAttributeFunctor and call its methods to tell it about the internal attributes that this Drawable has.

Reimplemented from osg::Drawable.

virtual void osg::Geometry::accept ( PrimitiveFunctor pf) const [virtual]

Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.

Reimplemented from osg::Drawable.

virtual void osg::Geometry::accept ( PrimitiveIndexFunctor pf) const [virtual]

Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.

Reimplemented from osg::Drawable.

bool osg::Geometry::addPrimitiveSet ( PrimitiveSet primitiveset)

Add a primitive set to the geometry.

virtual Geometry* osg::Geometry::asGeometry ( ) [inline, virtual]

convert 'this' into a Geometry pointer if Node is a Geometry, otherwise return 0.

Equivalent to dynamic_cast<Group*>(this).

Reimplemented from osg::Node.

virtual const Geometry* osg::Geometry::asGeometry ( ) const [inline, virtual]

convert 'const this' into a const Geometry pointer if Node is a Geometry, otherwise return 0.

Equivalent to dynamic_cast<const Group*>(this).

Reimplemented from osg::Node.

fallback for deprecated functionality.

Return true if the Geometry contains any array indices or BIND_PER_PRIMITIVE arrays.

virtual void osg::Geometry::compileGLObjects ( RenderInfo renderInfo) const [virtual]

Immediately compile this Drawable into an OpenGL Display List/VertexBufferObjects.

Note:
Operation is ignored if _useDisplayList is false or VertexBufferObjects are not used.

Reimplemented from osg::Drawable.

bool osg::Geometry::containsDeprecatedData ( ) const [inline]

Return true if the deprecated use array indices or BIND_PER_PRIMITIVE binding has been assigned to arrays.

return true if any arrays are shared.

virtual void osg::Geometry::dirtyDisplayList ( ) [virtual]

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

Reimplemented from osg::Drawable.

virtual void osg::Geometry::drawImplementation ( RenderInfo renderInfo) const [virtual]

Draw Geometry 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 Geometry for user-drawn objects.

Reimplemented from osg::Drawable.

Reimplemented in osgAnimation::RigGeometry, and osg::QueryGeometry.

dispatch the primitives to OpenGL, called by drawImplemtation() after calling drawVertexArraysImplementation().

Set up the vertex arrays for the purpose of rendering, called by drawImplemtation() prior to it calling drawPrimitivesImplementation().

duplicate any shared arrays.

bool osg::Geometry::empty ( ) const

fallback for deprecated functionality.

Removes any array indices and BIND_PER_PRIMITIVE arrays.

bool osg::Geometry::getArrayList ( ArrayList arrayList) const
const Array* osg::Geometry::getColorArray ( ) const [inline]

Reimplemented in deprecated_osg::Geometry.

bool osg::Geometry::getDrawElementsList ( DrawElementsList drawElementsList) const
const Array* osg::Geometry::getFogCoordArray ( ) const [inline]

Reimplemented in deprecated_osg::Geometry.

virtual unsigned int osg::Geometry::getGLObjectSizeHint ( ) const [virtual]

Return the estimated size of GLObjects (display lists/vertex buffer objects) that are associated with this drawable.

This size is used a hint for reuse of deleted display lists/vertex buffer objects.

Reimplemented from osg::Drawable.

const Array* osg::Geometry::getNormalArray ( ) const [inline]

deprecated, use array->get*Binding(..).

Reimplemented in deprecated_osg::Geometry.

unsigned int osg::Geometry::getNumPrimitiveSets ( ) const [inline]
unsigned int osg::Geometry::getNumTexCoordArrays ( ) const [inline]
unsigned int osg::Geometry::getNumVertexAttribArrays ( ) const [inline]
PrimitiveSet* osg::Geometry::getPrimitiveSet ( unsigned int  pos) [inline]
const PrimitiveSet* osg::Geometry::getPrimitiveSet ( unsigned int  pos) const [inline]
unsigned int osg::Geometry::getPrimitiveSetIndex ( const PrimitiveSet primitiveset) const

Get the index number of a primitive set, return a value between 0 and getNumPrimitiveSet()-1 if found, if not found then return getNumPrimitiveSet().

When checking for a valid find value use if ((value=geometry->getPrimitiveSetIndex(primitive))!=geometry.getNumPrimitiveSet())

const Array* osg::Geometry::getSecondaryColorArray ( ) const [inline]

Reimplemented in deprecated_osg::Geometry.

Array* osg::Geometry::getTexCoordArray ( unsigned int  unit)
const Array* osg::Geometry::getTexCoordArray ( unsigned int  unit) const
const Array* osg::Geometry::getVertexArray ( ) const [inline]
Array* osg::Geometry::getVertexAttribArray ( unsigned int  index)
const Array* osg::Geometry::getVertexAttribArray ( unsigned int  index) const

Reimplemented in deprecated_osg::Geometry.

GLboolean osg::Geometry::getVertexAttribNormalize ( unsigned int  index) const

deprecated, use array->get*Normalize(..).

Reimplemented in deprecated_osg::Geometry.

bool osg::Geometry::insertPrimitiveSet ( unsigned int  i,
PrimitiveSet primitiveset 
)

Insert a primitive set to the specified position in geometry's primitive set list.

Geometry& osg::Geometry::operator= ( const Geometry ) [inline, protected]
virtual void osg::Geometry::releaseGLObjects ( State state = 0) const [virtual]

If State is non-zero, this function releases OpenGL objects for the specified graphics context.

Otherwise, releases OpenGL objects for all graphics contexts.

Reimplemented from osg::Drawable.

Reimplemented in osg::QueryGeometry.

bool osg::Geometry::removePrimitiveSet ( unsigned int  i,
unsigned int  numElementsToRemove = 1 
)

Remove primitive set(s) from the specified position in geometry's primitive set list.

virtual void osg::Geometry::resizeGLObjectBuffers ( unsigned int  maxSize) [virtual]

Resize any per context GLObject buffers to specified size.

Reimplemented from osg::Drawable.

void osg::Geometry::setColorArray ( Array array) [inline]

Reimplemented in deprecated_osg::Geometry.

Reimplemented in deprecated_osg::Geometry.

void osg::Geometry::setNormalArray ( Array array) [inline]

deprecated, use array->set*Binding(..).

Reimplemented in deprecated_osg::Geometry.

bool osg::Geometry::setPrimitiveSet ( unsigned int  i,
PrimitiveSet primitiveset 
)

Set a primitive set to the specified position in geometry's primitive set list.

Reimplemented in deprecated_osg::Geometry.

void osg::Geometry::setTexCoordArray ( unsigned int  unit,
Array array 
) [inline]
void osg::Geometry::setTexCoordArray ( unsigned int  unit,
Array array,
osg::Array::Binding  binding 
)
virtual void osg::Geometry::setUseVertexBufferObjects ( bool  flag) [virtual]

When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation method to use OpenGL vertex buffer objects for rendering.

Reimplemented from osg::Drawable.

void osg::Geometry::setVertexAttribArray ( unsigned int  index,
Array array 
) [inline]
void osg::Geometry::setVertexAttribArray ( unsigned int  index,
Array array,
osg::Array::Binding  binding 
)

Reimplemented in deprecated_osg::Geometry.

void osg::Geometry::setVertexAttribNormalize ( unsigned int  index,
GLboolean  norm 
)

deprecated, use array->set*Normalize(..).

Reimplemented in deprecated_osg::Geometry.

virtual bool osg::Geometry::supports ( const Drawable::AttributeFunctor ) const [inline, virtual]

Return true, osg::Geometry does support accept(Drawable::AttributeFunctor&).

Reimplemented from osg::Drawable.

virtual bool osg::Geometry::supports ( const Drawable::ConstAttributeFunctor ) const [inline, virtual]

Return true, osg::Geometry does support accept(Drawable::ConstAttributeFunctor&).

Reimplemented from osg::Drawable.

virtual bool osg::Geometry::supports ( const PrimitiveFunctor ) const [inline, virtual]

Return true, osg::Geometry does support accept(PrimitiveFunctor&).

Reimplemented from osg::Drawable.

virtual bool osg::Geometry::supports ( const PrimitiveIndexFunctor ) const [inline, virtual]

Return true, osg::Geometry does support accept(PrimitiveIndexFunctor&).

Reimplemented from osg::Drawable.


Member Data Documentation


The documentation for this class was generated from the following file:

osg logo
Generated at Tue Dec 8 2015 00:14:24 for the OpenSceneGraph by doxygen 1.7.6.1.