Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::DVRGeometryBase Class Reference

DVRGeometry Base Class.

#include <OSGDVRGeometryBase.h>

Inheritance diagram for osg::DVRGeometryBase:

osg::Geometry osg::GeometryBase osg::MaterialDrawable osg::MaterialDrawableBase osg::Drawable osg::DrawableBase osg::NodeCore osg::AttachmentContainer osg::FieldContainer osg::DVRGeometry List of all members.

Class Specific

Int16 calcMappingIndex (UInt16 attrib) const
virtual void changed (BitVector whichField, UInt32 origin)
GeometryPtr getPtr (void) const
GeometryPtr clone (void)
virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
bool isMergeable (const GeometryPtr other)
bool merge (const GeometryPtr other)
*static const char * mapType (UInt8 type)

Public Types

typedef DVRGeometryPtr Ptr
enum  {
  TypesFieldId = Inherited::NextFieldId, LengthsFieldId = TypesFieldId + 1, PositionsFieldId = LengthsFieldId + 1, NormalsFieldId = PositionsFieldId + 1,
  ColorsFieldId = NormalsFieldId + 1, SecondaryColorsFieldId = ColorsFieldId + 1, TexCoordsFieldId = SecondaryColorsFieldId + 1, TexCoords1FieldId = TexCoordsFieldId + 1,
  TexCoords2FieldId = TexCoords1FieldId + 1, TexCoords3FieldId = TexCoords2FieldId + 1, IndicesFieldId = TexCoords3FieldId + 1, IndexMappingFieldId = IndicesFieldId + 1,
  DlistCacheFieldId = IndexMappingFieldId + 1, GLIdFieldId = DlistCacheFieldId + 1, NextFieldId = GLIdFieldId + 1
}

Public Member Functions

FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Binary Access
*virtual UInt32 getBinSize (const BitVector &whichField)
virtual void copyToBin (BinaryDataHandler &pMem, const BitVector &whichField)
virtual void copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField)
Copy
*virtual FieldContainerPtr shallowCopy (void) const
Abstract
*virtual GeoPropertyArrayInterfacegetProperty (Int32 mapID)
Field Set
*void setTypes (const GeoPTypesPtr &value)
 Set the value of the Geometry::_sfTypes field.
void setLengths (const GeoPLengthsPtr &value)
 Set the value of the Geometry::_sfLengths field.
void setPositions (const GeoPositionsPtr &value)
 Set the value of the Geometry::_sfPositions field.
void setNormals (const GeoNormalsPtr &value)
 Set the value of the Geometry::_sfNormals field.
void setColors (const GeoColorsPtr &value)
 Set the value of the Geometry::_sfColors field.
void setSecondaryColors (const GeoColorsPtr &value)
 Set the value of the Geometry::_sfSecondaryColors field.
void setTexCoords (const GeoTexCoordsPtr &value)
 Set the value of the Geometry::_sfTexCoords field.
void setTexCoords1 (const GeoTexCoordsPtr &value)
 Set the value of the Geometry::_sfTexCoords1 field.
void setTexCoords2 (const GeoTexCoordsPtr &value)
 Set the value of the Geometry::_sfTexCoords2 field.
void setTexCoords3 (const GeoTexCoordsPtr &value)
 Set the value of the Geometry::_sfTexCoords3 field.
void setIndices (const GeoIndicesPtr &value)
 Set the value of the Geometry::_sfIndices field.
void setMaterial (const MaterialPtr &value)
 Set the value of the MaterialDrawable::_sfMaterial field.
Iterator Access
*TriangleIterator beginTriangles (void) const
TriangleIterator endTriangles (void) const
PrimitiveIterator beginPrimitives (void) const
PrimitiveIterator endPrimitives (void) const
FaceIterator beginFaces (void) const
FaceIterator endFaces (void) const
LineIterator beginLines (void) const
LineIterator endLines (void) const
EdgeIterator beginEdges (void) const
EdgeIterator endEdges (void) const
Draw
*virtual Action::ResultE drawPrimitives (DrawActionBase *action)
 initialize the static features of the class, e.g. action callbacks
Action::ResultE intersect (Action *action)
NewActionTypes::ResultE intersect (ActorBase::FunctorArgumentType &funcArg)
void invalidateDlistCache (void)
NodeCore Specific
*void adjustVolume (Volume &volume)
Field Get
*SFGeoPTypesPtrgetSFTypes (void)
 Get the Geometry::_sfTypes field.
SFGeoPLengthsPtrgetSFLengths (void)
 Get the Geometry::_sfLengths field.
SFGeoPositionsPtrgetSFPositions (void)
 Get the Geometry::_sfPositions field.
SFGeoNormalsPtrgetSFNormals (void)
 Get the Geometry::_sfNormals field.
SFGeoColorsPtrgetSFColors (void)
 Get the Geometry::_sfColors field.
SFGeoColorsPtrgetSFSecondaryColors (void)
 Get the Geometry::_sfSecondaryColors field.
SFGeoTexCoordsPtrgetSFTexCoords (void)
 Get the Geometry::_sfTexCoords field.
SFGeoTexCoordsPtrgetSFTexCoords1 (void)
 Get the Geometry::_sfTexCoords1 field.
SFGeoTexCoordsPtrgetSFTexCoords2 (void)
 Get the Geometry::_sfTexCoords2 field.
SFGeoTexCoordsPtrgetSFTexCoords3 (void)
 Get the Geometry::_sfTexCoords3 field.
SFGeoIndicesPtrgetSFIndices (void)
 Get the Geometry::_sfIndices field.
MFUInt16getMFIndexMapping (void)
 Get the Geometry::_mfIndexMapping field.
SFBoolgetSFDlistCache (void)
 Get the Geometry::_sfDlistCache field.
GeoPTypesPtrgetTypes (void)
 Get the value of the Geometry::_sfTypes field.
const GeoPTypesPtrgetTypes (void) const
 Get the value of the Geometry::_sfTypes field.
GeoPLengthsPtrgetLengths (void)
 Get the value of the Geometry::_sfLengths field.
const GeoPLengthsPtrgetLengths (void) const
 Get the value of the Geometry::_sfLengths field.
GeoPositionsPtrgetPositions (void)
 Get the value of the Geometry::_sfPositions field.
const GeoPositionsPtrgetPositions (void) const
 Get the value of the Geometry::_sfPositions field.
GeoNormalsPtrgetNormals (void)
 Get the value of the Geometry::_sfNormals field.
const GeoNormalsPtrgetNormals (void) const
 Get the value of the Geometry::_sfNormals field.
GeoColorsPtrgetColors (void)
 Get the value of the Geometry::_sfColors field.
const GeoColorsPtrgetColors (void) const
 Get the value of the Geometry::_sfColors field.
GeoColorsPtrgetSecondaryColors (void)
 Get the value of the Geometry::_sfSecondaryColors field.
const GeoColorsPtrgetSecondaryColors (void) const
 Get the value of the Geometry::_sfSecondaryColors field.
GeoTexCoordsPtrgetTexCoords (void)
 Get the value of the Geometry::_sfTexCoords field.
const GeoTexCoordsPtrgetTexCoords (void) const
 Get the value of the Geometry::_sfTexCoords field.
GeoTexCoordsPtrgetTexCoords1 (void)
 Get the value of the Geometry::_sfTexCoords1 field.
const GeoTexCoordsPtrgetTexCoords1 (void) const
 Get the value of the Geometry::_sfTexCoords1 field.
GeoTexCoordsPtrgetTexCoords2 (void)
 Get the value of the Geometry::_sfTexCoords2 field.
const GeoTexCoordsPtrgetTexCoords2 (void) const
 Get the value of the Geometry::_sfTexCoords2 field.
GeoTexCoordsPtrgetTexCoords3 (void)
 Get the value of the Geometry::_sfTexCoords3 field.
const GeoTexCoordsPtrgetTexCoords3 (void) const
 Get the value of the Geometry::_sfTexCoords3 field.
GeoIndicesPtrgetIndices (void)
 Get the value of the Geometry::_sfIndices field.
const GeoIndicesPtrgetIndices (void) const
 Get the value of the Geometry::_sfIndices field.
bool & getDlistCache (void)
 Get the value of the Geometry::_sfDlistCache field.
const bool & getDlistCache (void) const
 Get the value of the Geometry::_sfDlistCache field.
UInt16getIndexMapping (const UInt32 index)
 Get the value of the index element the Geometry::_mfIndexMapping field.
MFUInt16getIndexMapping (void)
 Get the Geometry::_mfIndexMapping field.
const MFUInt16getIndexMapping (void) const
 Get the Geometry::_mfIndexMapping field.
Field Set
void setDlistCache (const bool &value)
 Set the value of the Geometry::_sfDlistCache field.
action handler
Action::ResultE drawActionHandler (Action *action)
 initialize the static features of the class, e.g. action callbacks
Action::ResultE renderActionHandler (Action *action)
 initialize the static features of the class, e.g. action callbacks
Field Get
*SFMaterialPtrgetSFMaterial (void)
 Get the MaterialDrawable::_sfMaterial field.
MaterialPtrgetMaterial (void)
 Get the value of the MaterialDrawable::_sfMaterial field.
const MaterialPtrgetMaterial (void) const
 Get the value of the MaterialDrawable::_sfMaterial field.

Static Public Member Functions

Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static DVRGeometryPtr create (void)
 create a new instance of the class
static DVRGeometryPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Class Get
*static const char * getClassname (void)

Static Public Attributes

static const osg::BitVector MTInfluenceMask
static const osg::BitVector TypesFieldMask
static const osg::BitVector LengthsFieldMask
static const osg::BitVector PositionsFieldMask
static const osg::BitVector NormalsFieldMask
static const osg::BitVector ColorsFieldMask
static const osg::BitVector SecondaryColorsFieldMask
static const osg::BitVector TexCoordsFieldMask
static const osg::BitVector TexCoords1FieldMask
static const osg::BitVector TexCoords2FieldMask
static const osg::BitVector TexCoords3FieldMask
static const osg::BitVector IndicesFieldMask
static const osg::BitVector IndexMappingFieldMask
static const osg::BitVector DlistCacheFieldMask
static const osg::BitVector GLIdFieldMask
static const osg::BitVector MaterialFieldMask
static const BitVector ParentsFieldMask = (1 << NodeCore::ParentsFieldId )
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
IndexMapping Constants
*static const UInt16 MapPosition = 1
static const UInt16 MapNormal = Geometry::MapPosition << 1
static const UInt16 MapColor = Geometry::MapNormal << 1
static const UInt16 MapSecondaryColor = Geometry::MapColor << 1
static const UInt16 MapTexCoords = Geometry::MapSecondaryColor << 1
static const UInt16 MapTexCoords1 = Geometry::MapTexCoords << 1
static const UInt16 MapTexCoords2 = Geometry::MapTexCoords1 << 1
static const UInt16 MapTexCoords3 = Geometry::MapTexCoords2 << 1
static const UInt16 MapEmpty = Geometry::MapTexCoords3 << 1
static stat elem
*static StatElemDesc< StatIntElemstatNTriangles
static StatElemDesc< StatIntElemstatNLines
static StatElemDesc< StatIntElemstatNPoints
static StatElemDesc< StatIntElemstatNVertices
static StatElemDesc< StatIntElemstatNPrimitives

Protected Member Functions

Constructors
DVRGeometryBase (void)
 DVRGeometryBase (const DVRGeometryBase &source)
Destructors
*virtual ~DVRGeometryBase (void)
Sync
*void executeSyncImpl (DVRGeometryBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Class Specific
*void handleGL (Window *win, UInt32 id)
void onCreate (const Geometry *source=NULL)
bool CompareMaterials (MaterialPtr m1, MaterialPtr m2)
Int16 MergeIndex (const GeometryPtr other)
void merge0 (const GeometryPtr other)
void merge1 (const GeometryPtr other)
void merge2 (const GeometryPtr other)
void merge3 (const GeometryPtr other)
void merge4 (const GeometryPtr other)
void merge5 (const GeometryPtr other)
void merge6 (const GeometryPtr other)
Field Get
*SFInt32getSFGLId (void)
 Get the Geometry::_sfGLId field.
Int32getGLId (void)
 Get the value of the Geometry::_sfGLId field.
const Int32getGLId (void) const
 Get the value of the Geometry::_sfGLId field.
Field Set
*void setGLId (const Int32 &value)
 Set the value of the Geometry::_sfGLId field.
Sync
*void executeSyncImpl (GeometryBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (MaterialDrawableBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (DrawableBase *pOther, const BitVector &whichField)

Protected Attributes

Fields
*SFGeoPTypesPtr _sfTypes
SFGeoPLengthsPtr _sfLengths
SFGeoPositionsPtr _sfPositions
SFGeoNormalsPtr _sfNormals
SFGeoColorsPtr _sfColors
SFGeoColorsPtr _sfSecondaryColors
SFGeoTexCoordsPtr _sfTexCoords
SFGeoTexCoordsPtr _sfTexCoords1
SFGeoTexCoordsPtr _sfTexCoords2
SFGeoTexCoordsPtr _sfTexCoords3
SFGeoIndicesPtr _sfIndices
MFUInt16 _mfIndexMapping
SFBool _sfDlistCache
SFInt32 _sfGLId
Fields
*SFMaterialPtr _sfMaterial

Private Types

typedef Geometry Inherited

Private Member Functions

void operator= (const DVRGeometryBase &source)

Static Private Attributes

static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 80 of file OSGDVRGeometryBase.h.


Member Typedef Documentation

typedef Geometry osg::DVRGeometryBase::Inherited [private]
 

Reimplemented from osg::Geometry.

Reimplemented in osg::DVRGeometry.

Definition at line 84 of file OSGDVRGeometryBase.h.

typedef DVRGeometryPtr osg::DVRGeometryBase::Ptr
 

Reimplemented from osg::GeometryBase.

Definition at line 89 of file OSGDVRGeometryBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
TypesFieldId 
LengthsFieldId 
PositionsFieldId 
NormalsFieldId 
ColorsFieldId 
SecondaryColorsFieldId 
TexCoordsFieldId 
TexCoords1FieldId 
TexCoords2FieldId 
TexCoords3FieldId 
IndicesFieldId 
IndexMappingFieldId 
DlistCacheFieldId 
GLIdFieldId 
NextFieldId 

Reimplemented from osg::MaterialDrawableBase.

Definition at line 105 of file OSGGeometryBase.h.

00106     {
00107         TypesFieldId           = Inherited::NextFieldId,
00108         LengthsFieldId         = TypesFieldId           + 1,
00109         PositionsFieldId       = LengthsFieldId         + 1,
00110         NormalsFieldId         = PositionsFieldId       + 1,
00111         ColorsFieldId          = NormalsFieldId         + 1,
00112         SecondaryColorsFieldId = ColorsFieldId          + 1,
00113         TexCoordsFieldId       = SecondaryColorsFieldId + 1,
00114         TexCoords1FieldId      = TexCoordsFieldId       + 1,
00115         TexCoords2FieldId      = TexCoords1FieldId      + 1,
00116         TexCoords3FieldId      = TexCoords2FieldId      + 1,
00117         IndicesFieldId         = TexCoords3FieldId      + 1,
00118         IndexMappingFieldId    = IndicesFieldId         + 1,
00119         DlistCacheFieldId      = IndexMappingFieldId    + 1,
00120         GLIdFieldId            = DlistCacheFieldId      + 1,
00121         NextFieldId            = GLIdFieldId            + 1
00122     };


Constructor & Destructor Documentation

DVRGeometryBase::DVRGeometryBase void   )  [protected]
 

Definition at line 144 of file OSGDVRGeometryBase.cpp.

00144                                      :
00145     Inherited() 
00146 {
00147 }

DVRGeometryBase::DVRGeometryBase const DVRGeometryBase source  )  [protected]
 

Definition at line 153 of file OSGDVRGeometryBase.cpp.

00153                                                               :
00154     Inherited                 (source)
00155 {
00156 }

DVRGeometryBase::~DVRGeometryBase void   )  [protected, virtual]
 

Definition at line 160 of file OSGDVRGeometryBase.cpp.

00161 {
00162 }


Member Function Documentation

osg::FieldContainerType & osg::DVRGeometryBase::getClassType void   )  [inline, static]
 

Reimplemented from osg::GeometryBase.

Definition at line 58 of file OSGDVRGeometryBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::DVRGeometryBase::getClassTypeId void   )  [inline, static]
 

Reimplemented from osg::GeometryBase.

Definition at line 65 of file OSGDVRGeometryBase.inl.

References _type, and osg::TypeBase::getId().

00066 {
00067     return _type.getId(); 
00068 } 

FieldContainerType & DVRGeometryBase::getType void   )  [virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 86 of file OSGDVRGeometryBase.cpp.

References _type.

00087 {
00088     return _type; 
00089 } 

const FieldContainerType & DVRGeometryBase::getType void   )  const [virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 91 of file OSGDVRGeometryBase.cpp.

References _type.

00092 {
00093     return _type;
00094 } 

UInt32 DVRGeometryBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 106 of file OSGDVRGeometryBase.cpp.

00107 { 
00108     return sizeof(DVRGeometry); 
00109 }

UInt32 DVRGeometryBase::getBinSize const BitVector whichField  )  [virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 166 of file OSGDVRGeometryBase.cpp.

References osg::GeometryBase::getBinSize().

00167 {
00168     UInt32 returnValue = Inherited::getBinSize(whichField);
00169 
00170 
00171     return returnValue;
00172 }

void DVRGeometryBase::copyToBin BinaryDataHandler pMem,
const BitVector whichField
[virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 174 of file OSGDVRGeometryBase.cpp.

References osg::GeometryBase::copyToBin().

00176 {
00177     Inherited::copyToBin(pMem, whichField);
00178 
00179 
00180 }

void DVRGeometryBase::copyFromBin BinaryDataHandler pMem,
const BitVector whichField
[virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 182 of file OSGDVRGeometryBase.cpp.

References osg::GeometryBase::copyFromBin().

00184 {
00185     Inherited::copyFromBin(pMem, whichField);
00186 
00187 
00188 }

DVRGeometryPtr osg::DVRGeometryBase::create void   )  [inline, static]
 

Reimplemented from osg::GeometryBase.

Definition at line 72 of file OSGDVRGeometryBase.inl.

References osg::AttachmentContainerPtr::dcast(), getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and shallowCopy().

00073 {
00074     DVRGeometryPtr fc; 
00075 
00076     if(getClassType().getPrototype() != OSG::NullFC) 
00077     {
00078         fc = DVRGeometryPtr::dcast(
00079             getClassType().getPrototype()-> shallowCopy()); 
00080     }
00081     
00082     return fc; 
00083 }

DVRGeometryPtr osg::DVRGeometryBase::createEmpty void   )  [inline, static]
 

Reimplemented from osg::GeometryBase.

Definition at line 87 of file OSGDVRGeometryBase.inl.

References osg::FieldContainer::newPtr().

00088 { 
00089     DVRGeometryPtr returnValue; 
00090     
00091     newPtr(returnValue); 
00092 
00093     return returnValue; 
00094 }

FieldContainerPtr DVRGeometryBase::shallowCopy void   )  const [virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 97 of file OSGDVRGeometryBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00098 { 
00099     DVRGeometryPtr returnValue; 
00100 
00101     newPtr(returnValue, dynamic_cast<const DVRGeometry *>(this)); 
00102 
00103     return returnValue; 
00104 }

void DVRGeometryBase::executeSyncImpl DVRGeometryBase pOther,
const BitVector whichField
[protected]
 

Definition at line 191 of file OSGDVRGeometryBase.cpp.

References osg::GeometryBase::executeSyncImpl().

Referenced by executeSync().

00193 {
00194 
00195     Inherited::executeSyncImpl(pOther, whichField);
00196 
00197 
00198 }

void DVRGeometryBase::executeSync FieldContainer other,
const BitVector whichField
[protected, virtual]
 

Reimplemented from osg::GeometryBase.

Definition at line 113 of file OSGDVRGeometryBase.cpp.

References executeSyncImpl().

00115 {
00116     this->executeSyncImpl((DVRGeometryBase *) &other, whichField);
00117 }

void osg::DVRGeometryBase::operator= const DVRGeometryBase source  )  [private]
 

* static const char* osg::Geometry::getClassname void   )  [inline, static, inherited]
 

Definition at line 93 of file OSGGeometry.h.

00093 { return "Geometry"; };

const char * Geometry::mapType UInt8  type  )  [static, inherited]
 

A little helper function to map the OpenGL primitive type to a name.

Definition at line 112 of file OSGGeometry.cpp.

00113 {
00114     switch(type)
00115     {
00116     case GL_POINTS:         return "Points";
00117     case GL_LINES:          return "Lines";
00118     case GL_LINE_LOOP:      return "LineLoop";
00119     case GL_LINE_STRIP:     return "LineStrip";
00120     case GL_TRIANGLES:      return "Triangles";
00121     case GL_TRIANGLE_STRIP: return "TriangleStrip";
00122     case GL_TRIANGLE_FAN:   return "TriangleFan";
00123     case GL_QUADS:          return "Quads";
00124     case GL_QUAD_STRIP:     return "QuadStrip";
00125     case GL_POLYGON:        return "Polygon";
00126     }
00127 
00128     return "Unknown Primitive";
00129 }

Int16 Geometry::calcMappingIndex UInt16  attrib  )  const [inherited]
 

Calc the indices into the index field for the given attributes. This is the index of the given attribute's index in a multi-index block.

Returns -1 for non- or single-indexed geometries, or if the given attribute is not used.

Definition at line 578 of file OSGGeometry.cpp.

References osg::GeometryBase::getIndexMapping(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by osg::GeoPumpFactory::masterGeoPump(), osg::Geometry::merge0(), osg::Geometry::merge3(), osg::Geometry::merge4(), osg::Geometry::merge5(), and osg::Geometry::merge6().

00579 {
00580     UInt16 nmappings = getIndexMapping().size();
00581     Int16 i;
00582 
00583     for(i = nmappings - 1; i >= 0; i--)
00584     {
00585         if(getIndexMapping()[i] & attrib )
00586             break;
00587     }
00588 
00589     return i;
00590 }

void Geometry::changed BitVector  whichField,
UInt32  origin
[virtual, inherited]
 

React to field changes, take care of incrementing/decrementing the reference count of the changed properties.

Reimplemented from osg::MaterialDrawable.

Reimplemented in osg::DVRGeometry, and osg::Surface.

Definition at line 809 of file OSGGeometry.cpp.

References osg::NodeCore::_parents, osg::GeometryBase::_sfColors, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::Mat