osg::Geometry Class Reference
[Geometry]

#include <OSGGeometry.h>

Inheritance diagram for osg::Geometry:

osg::GeometryBase osg::MaterialDrawable osg::MaterialDrawableBase osg::Drawable osg::DrawableBase osg::NodeCore osg::AttachmentContainer osg::FieldContainer osg::DVRGeometryBase osg::SurfaceBase osg::DVRGeometry osg::Surface

List of all members.

Class Specific



static const char * mapType (UInt8 type)
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)
UInt32 getCachedGfxMemoryUsage (void)

Public Types

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, TexCoords4FieldId = TexCoords3FieldId + 1, TexCoords5FieldId = TexCoords4FieldId + 1,
  TexCoords6FieldId = TexCoords5FieldId + 1, TexCoords7FieldId = TexCoords6FieldId + 1, IndicesFieldId = TexCoords7FieldId + 1, IndexMappingFieldId = IndicesFieldId + 1,
  DlistCacheFieldId = IndexMappingFieldId + 1, GLIdFieldId = DlistCacheFieldId + 1, IgnoreGLForAspectFieldId = GLIdFieldId + 1, MinindexFieldId = IgnoreGLForAspectFieldId + 1,
  MaxindexFieldId = MinindexFieldId + 1, LowindicesFieldId = MaxindexFieldId + 1, HighindicesFieldId = LowindicesFieldId + 1, VboFieldId = HighindicesFieldId + 1,
  NextFieldId = VboFieldId + 1
}
typedef GeometryPtr Ptr
enum  { MaterialFieldId = Inherited::NextFieldId, NextFieldId = MaterialFieldId + 1 }
enum  { ParentsFieldId = Inherited::NextFieldId, NextFieldId = ParentsFieldId + 1 }
typedef MFNodePtr ParentField
typedef MFNodePtrParentFieldPtr
typedef MFNodePtr::iterator ParentFieldIt
enum  { AttachmentsFieldId = Inherited::NextFieldId, NextFieldId = AttachmentsFieldId + 1 }
enum  { NextFieldId = 1 }

Public Member Functions

Abstract


virtual GeoPropertyArrayInterfacegetProperty (Int32 mapID)
Field Set


void setTypes (const GeoPTypesPtr &value)
void setLengths (const GeoPLengthsPtr &value)
void setPositions (const GeoPositionsPtr &value)
void setNormals (const GeoNormalsPtr &value)
void setColors (const GeoColorsPtr &value)
void setSecondaryColors (const GeoColorsPtr &value)
void setTexCoords (const GeoTexCoordsPtr &value)
void setTexCoords1 (const GeoTexCoordsPtr &value)
void setTexCoords2 (const GeoTexCoordsPtr &value)
void setTexCoords3 (const GeoTexCoordsPtr &value)
void setTexCoords4 (const GeoTexCoordsPtr &value)
void setTexCoords5 (const GeoTexCoordsPtr &value)
void setTexCoords6 (const GeoTexCoordsPtr &value)
void setTexCoords7 (const GeoTexCoordsPtr &value)
void setIndices (const GeoIndicesPtr &value)
void setMaterial (const MaterialPtr &value)
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)
Action::ResultE intersect (Action *action)
NewActionTypes::ResultE intersectActor (ActorBase::FunctorArgumentType &funcArg)
void invalidateDlistCache (void)
NodeCore Specific


void adjustVolume (Volume &volume)
FieldContainer Get


virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
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.
SFGeoTexCoordsPtrgetSFTexCoords4 (void)
 Get the Geometry::_sfTexCoords4 field.
SFGeoTexCoordsPtrgetSFTexCoords5 (void)
 Get the Geometry::_sfTexCoords5 field.
SFGeoTexCoordsPtrgetSFTexCoords6 (void)
 Get the Geometry::_sfTexCoords6 field.
SFGeoTexCoordsPtrgetSFTexCoords7 (void)
 Get the Geometry::_sfTexCoords7 field.
SFGeoIndicesPtrgetSFIndices (void)
 Get the Geometry::_sfIndices field.
MFUInt16getMFIndexMapping (void)
 Get the Geometry::_mfIndexMapping field.
SFBoolgetSFDlistCache (void)
 Get the Geometry::_sfDlistCache field.
SFInt32getSFIgnoreGLForAspect (void)
 Get the Geometry::_sfIgnoreGLForAspect field.
SFUInt32getSFMinindex (void)
 Get the Geometry::_sfMinindex field.
SFUInt32getSFMaxindex (void)
 Get the Geometry::_sfMaxindex field.
MFUInt32getMFLowindices (void)
 Get the Geometry::_mfLowindices field.
MFUInt32getMFHighindices (void)
 Get the Geometry::_mfHighindices field.
SFBoolgetSFVbo (void)
 Get the Geometry::_sfVbo 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.
GeoTexCoordsPtrgetTexCoords4 (void)
 Get the value of the Geometry::_sfTexCoords4 field.
const GeoTexCoordsPtrgetTexCoords4 (void) const
 Get the value of the Geometry::_sfTexCoords4 field.
GeoTexCoordsPtrgetTexCoords5 (void)
 Get the value of the Geometry::_sfTexCoords5 field.
const GeoTexCoordsPtrgetTexCoords5 (void) const
 Get the value of the Geometry::_sfTexCoords5 field.
GeoTexCoordsPtrgetTexCoords6 (void)
 Get the value of the Geometry::_sfTexCoords6 field.
const GeoTexCoordsPtrgetTexCoords6 (void) const
 Get the value of the Geometry::_sfTexCoords6 field.
GeoTexCoordsPtrgetTexCoords7 (void)
 Get the value of the Geometry::_sfTexCoords7 field.
const GeoTexCoordsPtrgetTexCoords7 (void) const
 Get the value of the Geometry::_sfTexCoords7 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.
Int32getIgnoreGLForAspect (void)
 Get the value of the Geometry::_sfIgnoreGLForAspect field.
const Int32getIgnoreGLForAspect (void) const
 Get the value of the Geometry::_sfIgnoreGLForAspect field.
UInt32getMinindex (void)
 Get the value of the Geometry::_sfMinindex field.
const UInt32getMinindex (void) const
 Get the value of the Geometry::_sfMinindex field.
UInt32getMaxindex (void)
 Get the value of the Geometry::_sfMaxindex field.
const UInt32getMaxindex (void) const
 Get the value of the Geometry::_sfMaxindex field.
bool & getVbo (void)
 Get the value of the Geometry::_sfVbo field.
const bool & getVbo (void) const
 Get the value of the Geometry::_sfVbo 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.
UInt32getLowindices (const UInt32 index)
 Get the value of the index element the Geometry::_mfLowindices field.
MFUInt32getLowindices (void)
 Get the Geometry::_mfLowindices field.
const MFUInt32getLowindices (void) const
 Get the Geometry::_mfLowindices field.
UInt32getHighindices (const UInt32 index)
 Get the value of the index element the Geometry::_mfHighindices field.
MFUInt32getHighindices (void)
 Get the Geometry::_mfHighindices field.
const MFUInt32getHighindices (void) const
 Get the Geometry::_mfHighindices field.
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 setIndices (const GeoIndicesPtr &value)
 Set the value of the Geometry::_sfIndices field.
void setDlistCache (const bool &value)
 Set the value of the Geometry::_sfDlistCache field.
void setIgnoreGLForAspect (const Int32 &value)
 Set the value of the Geometry::_sfIgnoreGLForAspect field.
void setMinindex (const UInt32 &value)
 Set the value of the Geometry::_sfMinindex field.
void setMaxindex (const UInt32 &value)
 Set the value of the Geometry::_sfMaxindex field.
void setVbo (const bool &value)
 Set the value of the Geometry::_sfVbo field.
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
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.
Parents


MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume


virtual void invalidateVolume (void)
Handle Attachments


void addAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0)
void subAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0)
AttachmentPtr findAttachment (UInt32 groupId, UInt16 binding=0)
AttachmentPtr findAttachment (const FieldContainerType &type, UInt16 binding=0)


SFAttachmentMapgetSFAttachments (void)
Get Instance Type Information


UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const


FieldgetField (UInt32 fieldId)
FieldgetField (const Char8 *fieldName)

Static Public Member Functions

Class Get


static const char * getClassname (void)
Class Get


static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction


static GeometryPtr create (void)
 create a new instance of the class
static GeometryPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Get Class Type Information


static UInt16 getClassGroupId (void)

Static Public Attributes

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 TexCoords4FieldMask
static const osg::BitVector TexCoords5FieldMask
static const osg::BitVector TexCoords6FieldMask
static const osg::BitVector TexCoords7FieldMask
static const osg::BitVector IndicesFieldMask
static const osg::BitVector IndexMappingFieldMask
static const osg::BitVector DlistCacheFieldMask
static const osg::BitVector GLIdFieldMask
static const osg::BitVector IgnoreGLForAspectFieldMask
static const osg::BitVector MinindexFieldMask
static const osg::BitVector MaxindexFieldMask
static const osg::BitVector LowindicesFieldMask
static const osg::BitVector HighindicesFieldMask
static const osg::BitVector VboFieldMask
static const osg::BitVector MTInfluenceMask
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 MapTexCoords4 = Geometry::MapTexCoords3 << 1
static const UInt16 MapTexCoords5 = Geometry::MapTexCoords4 << 1
static const UInt16 MapTexCoords6 = Geometry::MapTexCoords5 << 1
static const UInt16 MapTexCoords7 = Geometry::MapTexCoords6 << 1
static const UInt16 MapEmpty = Geometry::MapTexCoords7 << 1
static stat elem


static StatElemDesc< StatIntElemstatNTriangles
static StatElemDesc< StatIntElemstatNLines
static StatElemDesc< StatIntElemstatNPoints
static StatElemDesc< StatIntElemstatNVertices
static StatElemDesc< StatIntElemstatNPrimitives
static StatElemDesc
< StatIntOnceElem
statNGeoBytes
CoredNodePtr helper


static const bool isNodeCore = true

Protected Member Functions

Constructors


 Geometry (void)
 Geometry (const Geometry &source)
Destructors


virtual ~Geometry (void)
Class Specific


void handleGL (Window *win, UInt32 id)
void onCreate (const Geometry *source=NULL)
void onDestroy (void)
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)
bool updateLowHighIndices (void)
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)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync


void executeSyncImpl (MaterialDrawableBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (DrawableBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
Set / Get Parents


void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer


AttachmentContainerPtr getPtr (void)
Transformation


virtual void accumulateMatrix (Matrix &result)
MT Edit


template<class FieldTypeT>
void beginEditX (const BitVector &whichField, FieldTypeT &field)
template<class FieldTypeT>
void endEditX (const BitVector &whichField, FieldTypeT &field)
MT Construction


void onCreate (const FieldContainer *source=NULL)
void onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL)

Static Protected Member Functions

Create Fieldcontainer


template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP)
template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result)

Protected Attributes

Fields


SFGeoPTypesPtr _sfTypes
SFGeoPLengthsPtr _sfLengths
SFGeoPositionsPtr _sfPositions
SFGeoNormalsPtr _sfNormals
SFGeoColorsPtr _sfColors
SFGeoColorsPtr _sfSecondaryColors
SFGeoTexCoordsPtr _sfTexCoords
SFGeoTexCoordsPtr _sfTexCoords1
SFGeoTexCoordsPtr _sfTexCoords2
SFGeoTexCoordsPtr _sfTexCoords3
SFGeoTexCoordsPtr _sfTexCoords4
SFGeoTexCoordsPtr _sfTexCoords5
SFGeoTexCoordsPtr _sfTexCoords6
SFGeoTexCoordsPtr _sfTexCoords7
SFGeoIndicesPtr _sfIndices
MFUInt16 _mfIndexMapping
SFBool _sfDlistCache
SFInt32 _sfGLId
SFInt32 _sfIgnoreGLForAspect
SFUInt32 _sfMinindex
SFUInt32 _sfMaxindex
MFUInt32 _mfLowindices
MFUInt32 _mfHighindices
SFBool _sfVbo
Fields


SFMaterialPtr _sfMaterial
Fields


MFNodePtr _parents
Fields


SFAttachmentMap _attachmentMap
Member


UInt32 _shares

Private Types

typedef GeometryBase Inherited

Private Member Functions

void operator= (const Geometry &source)
void createVBO (Window *win, UInt32 id)
void destroyVBO (Window *win, UInt32 id)
void updateVBO (Window *win, UInt32 id)
bool drawVBO (Window *win, UInt32 id)

Static Private Member Functions

static void initMethod (void)
 initialize the static features of the class, e.g. action callbacks

Private Attributes

UInt32 _numBytesOnGfxCard

Static Private Attributes

static std::vector< GeoVBO * > _vbos

Friends

class FieldContainer
class GeometryBase


Detailed Description

The Geometry class, see Geometry for a description.

The base class for all Geometry node types, see Geometry for a description.

Definition at line 70 of file OSGGeometry.h.


Member Typedef Documentation

Reimplemented from osg::GeometryBase.

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

Definition at line 243 of file OSGGeometry.h.

typedef GeometryPtr osg::GeometryBase::Ptr [inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 113 of file OSGGeometryBase.h.

Definition at line 85 of file OSGNodeCore.h.

Definition at line 86 of file OSGNodeCore.h.

Definition at line 87 of file OSGNodeCore.h.


Member Enumeration Documentation

anonymous enum [inherited]

Enumerator:
TypesFieldId 
LengthsFieldId 
PositionsFieldId 
NormalsFieldId 
ColorsFieldId 
SecondaryColorsFieldId 
TexCoordsFieldId 
TexCoords1FieldId 
TexCoords2FieldId 
TexCoords3FieldId 
TexCoords4FieldId 
TexCoords5FieldId 
TexCoords6FieldId 
TexCoords7FieldId 
IndicesFieldId 
IndexMappingFieldId 
DlistCacheFieldId 
GLIdFieldId 
IgnoreGLForAspectFieldId 
MinindexFieldId 
MaxindexFieldId 
LowindicesFieldId 
HighindicesFieldId 
VboFieldId 
NextFieldId 

Definition at line 115 of file OSGGeometryBase.h.

00116     {
00117         TypesFieldId             = Inherited::NextFieldId,
00118         LengthsFieldId           = TypesFieldId             + 1,
00119         PositionsFieldId         = LengthsFieldId           + 1,
00120         NormalsFieldId           = PositionsFieldId         + 1,
00121         ColorsFieldId            = NormalsFieldId           + 1,
00122         SecondaryColorsFieldId   = ColorsFieldId            + 1,
00123         TexCoordsFieldId         = SecondaryColorsFieldId   + 1,
00124         TexCoords1FieldId        = TexCoordsFieldId         + 1,
00125         TexCoords2FieldId        = TexCoords1FieldId        + 1,
00126         TexCoords3FieldId        = TexCoords2FieldId        + 1,
00127         TexCoords4FieldId        = TexCoords3FieldId        + 1,
00128         TexCoords5FieldId        = TexCoords4FieldId        + 1,
00129         TexCoords6FieldId        = TexCoords5FieldId        + 1,
00130         TexCoords7FieldId        = TexCoords6FieldId        + 1,
00131         IndicesFieldId           = TexCoords7FieldId        + 1,
00132         IndexMappingFieldId      = IndicesFieldId           + 1,
00133         DlistCacheFieldId        = IndexMappingFieldId      + 1,
00134         GLIdFieldId              = DlistCacheFieldId        + 1,
00135         IgnoreGLForAspectFieldId = GLIdFieldId              + 1,
00136         MinindexFieldId          = IgnoreGLForAspectFieldId + 1,
00137         MaxindexFieldId          = MinindexFieldId          + 1,
00138         LowindicesFieldId        = MaxindexFieldId          + 1,
00139         HighindicesFieldId       = LowindicesFieldId        + 1,
00140         VboFieldId               = HighindicesFieldId       + 1,
00141         NextFieldId              = VboFieldId               + 1
00142     };

anonymous enum [inherited]

Enumerator:
MaterialFieldId 
NextFieldId 

Definition at line 92 of file OSGMaterialDrawableBase.h.

00093     {
00094         MaterialFieldId = Inherited::NextFieldId,
00095         NextFieldId     = MaterialFieldId + 1
00096     };

anonymous enum [inherited]

Enumerator:
ParentsFieldId 
NextFieldId 

Definition at line 93 of file OSGNodeCore.h.

00094     { 
00095         ParentsFieldId     = Inherited::NextFieldId, 
00096         NextFieldId        = ParentsFieldId + 1
00097     };

anonymous enum [inherited]

Enumerator:
AttachmentsFieldId 
NextFieldId 

Definition at line 78 of file OSGAttachmentContainerImpl.h.

anonymous enum [inherited]

Enumerator:
NextFieldId 

Definition at line 73 of file OSGFieldContainerImpl.h.

00073 { NextFieldId = 1 };


Constructor & Destructor Documentation

Geometry::Geometry ( void   )  [protected]

Definition at line 175 of file OSGGeometry.cpp.

00175                        :
00176     Inherited(),
00177     _numBytesOnGfxCard(0)
00178 {
00179 }

Geometry::Geometry ( const Geometry source  )  [protected]

Definition at line 181 of file OSGGeometry.cpp.

00181                                          :
00182     Inherited(source),
00183     _numBytesOnGfxCard(source._numBytesOnGfxCard)
00184 {
00185 }

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

The destructor automatically dereferences the used properties. If this Geometry was the last user that will automatically destroy them.

Definition at line 190 of file OSGGeometry.cpp.

00191 {
00192 }


Member Function Documentation

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

Definition at line 98 of file OSGGeometry.h.

00098 { return "Geometry"; };

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

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

Definition at line 117 of file OSGGeometry.cpp.

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

Int16 Geometry::calcMappingIndex ( UInt16  attrib  )  const

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 751 of file OSGGeometry.cpp.

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

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

00752 {
00753     UInt16 nmappings = getIndexMapping().size();
00754     Int16 i;
00755 
00756     for(i = nmappings - 1; i >= 0; i--)
00757     {
00758         if(getIndexMapping()[i] & attrib )
00759             break;
00760     }
00761 
00762     return i;
00763 }

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

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 1179 of file OSGGeometry.cpp.

References osg::NodeCore::_parents, osg::GeometryBase::_sfColors, osg::GeometryBase::_sfIgnoreGLForAspect, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::MaterialDrawableBase::_sfMaterial, osg::GeometryBase::_sfNormals, osg::GeometryBase::_sfPositions, osg::GeometryBase::_sfSecondaryColors, osg::GeometryBase::_sfTexCoords, osg::GeometryBase::_sfTexCoords1, osg::GeometryBase::_sfTexCoords2, osg::GeometryBase::_sfTexCoords3, osg::GeometryBase::_sfTexCoords4, osg::GeometryBase::_sfTexCoords5, osg::GeometryBase::_sfTexCoords6, osg::GeometryBase::_sfTexCoords7, osg::GeometryBase::_sfTypes, osg::ChangedOrigin::Abstract, osg::ChangedOrigin::AbstrCheckValid, osg::ChangedOrigin::AbstrIncRefCount, osg::addRefCP(), osg::beginEditCP(), osg::MaterialDrawable::changed(), osg::GeometryBase::ColorsFieldMask, osg::Window::destroyGLObject(), osg::endEditCP(), osg::PThreadBase::getAspect(), osg::GeometryBase::getDlistCache(), osg::GeometryBase::getGLId(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::GeometryBase::getVbo(), osg::GeometryBase::GLIdFieldMask, handleGL(), osg::GeometryBase::IndexMappingFieldMask, osg::GeometryBase::IndicesFieldMask, osg::GeometryBase::LengthsFieldMask, osg::MaterialDrawableBase::MaterialFieldMask, osg::GeometryBase::NormalsFieldMask, osg::NullFC, osg::osgTypedMethodVoidFunctor2ObjCPtrPtr(), osg::GeometryBase::PositionsFieldMask, osg::Window::refreshGLObject(), osg::Window::registerGLObject(), osg::GeometryBase::SecondaryColorsFieldMask, setColors(), osg::GeometryBase::setGLId(), setIndices(), setLengths(), setMaterial(), setNormals(), setPositions(), setSecondaryColors(), setTexCoords(), setTexCoords1(), setTexCoords2(), setTexCoords3(), setTexCoords4(), setTexCoords5(), setTexCoords6(), setTexCoords7(), setTypes(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::GeometryBase::TexCoords1FieldMask, osg::GeometryBase::TexCoords2FieldMask, osg::GeometryBase::TexCoords3FieldMask, osg::GeometryBase::TexCoords4FieldMask, osg::GeometryBase::TexCoords5FieldMask, osg::GeometryBase::TexCoords6FieldMask, osg::GeometryBase::TexCoords7FieldMask, osg::GeometryBase::TexCoordsFieldMask, osg::GeometryBase::TypesFieldMask, and updateLowHighIndices().

Referenced by osg::Surface::changed(), and osg::DVRGeometry::changed().

01181 {
01182     if(whichField & TypesFieldMask)
01183     {
01184         if(origin & ChangedOrigin::Abstract)
01185         {
01186             if(origin & ChangedOrigin::AbstrCheckValid)
01187             {
01188                 GeometryPtr thisP = getPtr();
01189 
01190                 if(_sfTypes.getValue()                    != NullFC &&
01191                    _sfTypes.getValue()->findParent(thisP) ==     -1 )
01192                 {
01193                     GeoPTypesPtr pType = _sfTypes.getValue();
01194 
01195                     _sfTypes.setValue(NullFC);
01196 
01197                     setTypes(pType);
01198                 }
01199             }
01200             else if(origin & ChangedOrigin::AbstrIncRefCount)
01201             {
01202                 addRefCP(_sfTypes.getValue());
01203             }
01204             else
01205             {
01206                 GeoPTypesPtr pType = _sfTypes.getValue();
01207 
01208                 _sfTypes.setValue(NullFC);
01209 
01210                 setTypes(pType);
01211             }
01212         }
01213     }
01214 
01215     if(whichField & LengthsFieldMask)
01216     {
01217         if(origin & ChangedOrigin::Abstract)
01218         {
01219             if(origin & ChangedOrigin::AbstrCheckValid)
01220             {
01221                 GeometryPtr thisP = getPtr();
01222 
01223                 if(_sfLengths.getValue()                    != NullFC &&
01224                    _sfLengths.getValue()->findParent(thisP) ==     -1 )
01225                 {
01226                     GeoPLengthsPtr pLength = _sfLengths.getValue();
01227 
01228                     _sfLengths.setValue(NullFC);
01229 
01230                     setLengths(pLength);
01231                 }
01232             }
01233             else if(origin & ChangedOrigin::AbstrIncRefCount)
01234             {
01235                 addRefCP(_sfLengths.getValue());
01236             }
01237             else
01238             {
01239                 GeoPLengthsPtr pLength = _sfLengths.getValue();
01240 
01241                 _sfLengths.setValue(NullFC);
01242 
01243                 setLengths(pLength);
01244             }
01245         }
01246     }
01247 
01248     if(whichField & PositionsFieldMask)
01249     {
01250         for(UInt32 i = 0; i < _parents.size(); i++)
01251         {
01252             _parents[i]->invalidateVolume();
01253         }
01254 
01255         if(origin & ChangedOrigin::Abstract)
01256         {
01257             if(origin & ChangedOrigin::AbstrCheckValid)
01258             {
01259                 GeometryPtr thisP = getPtr();
01260 
01261                 if(_sfPositions.getValue()                    != NullFC &&
01262                    _sfPositions.getValue()->findParent(thisP) ==     -1 )
01263                 {
01264                     GeoPositionsPtr pPos = _sfPositions.getValue();
01265 
01266                     _sfPositions.setValue(NullFC);
01267 
01268                     setPositions(pPos);
01269                 }
01270             }
01271             else if(origin & ChangedOrigin::AbstrIncRefCount)
01272             {
01273                 addRefCP(_sfPositions.getValue());
01274             }
01275             else
01276             {
01277                 GeoPositionsPtr pPos = _sfPositions.getValue();
01278 
01279                 _sfPositions.setValue(NullFC);
01280 
01281                 setPositions(pPos);
01282             }
01283         }
01284         else
01285         {
01286         }
01287     }
01288 
01289     if(whichField & NormalsFieldMask)
01290     {
01291         if(origin & ChangedOrigin::Abstract)
01292         {
01293             if(origin & ChangedOrigin::AbstrCheckValid)
01294             {
01295                 GeometryPtr thisP = getPtr();
01296 
01297                 if(_sfNormals.getValue()                    != NullFC &&
01298                    _sfNormals.getValue()->findParent(thisP) ==     -1 )
01299                 {
01300                     GeoNormalsPtr pNorm = _sfNormals.getValue();
01301 
01302                     _sfNormals.setValue(NullFC);
01303 
01304                     setNormals(pNorm);
01305                 }
01306             }
01307             else if(origin & ChangedOrigin::AbstrIncRefCount)
01308             {
01309                 addRefCP(_sfNormals.getValue());
01310             }
01311             else
01312             {
01313                 GeoNormalsPtr pNorm = _sfNormals.getValue();
01314 
01315                 _sfNormals.setValue(NullFC);
01316 
01317                 setNormals(pNorm);
01318             }
01319         }
01320     }
01321 
01322     if(whichField & ColorsFieldMask)
01323     {
01324         if(origin & ChangedOrigin::Abstract)
01325         {
01326             if(origin & ChangedOrigin::AbstrCheckValid)
01327             {
01328                 GeometryPtr thisP = getPtr();
01329 
01330                 if(_sfColors.getValue()                    != NullFC &&
01331                    _sfColors.getValue()->findParent(thisP) ==     -1 )
01332                 {
01333                     GeoColorsPtr pColor = _sfColors.getValue();
01334 
01335                     _sfColors.setValue(NullFC);
01336 
01337                     setColors(pColor);
01338                 }
01339             }
01340             else if(origin & ChangedOrigin::AbstrIncRefCount)
01341             {
01342                 addRefCP(_sfColors.getValue());
01343             }
01344             else
01345             {
01346                 GeoColorsPtr pColor = _sfColors.getValue();
01347 
01348                 _sfColors.setValue(NullFC);
01349 
01350                 setColors(pColor);
01351             }
01352         }
01353     }
01354 
01355     if(whichField & SecondaryColorsFieldMask)
01356     {
01357         if(origin & ChangedOrigin::Abstract)
01358         {
01359             if(origin & ChangedOrigin::AbstrCheckValid)
01360             {
01361                 GeometryPtr thisP = getPtr();
01362 
01363                 if(_sfSecondaryColors.getValue()                   != NullFC &&
01364                    _sfSecondaryColors.getValue()->findParent(thisP)==     -1 )
01365                 {
01366                     GeoColorsPtr pColor = _sfSecondaryColors.getValue();
01367 
01368                     _sfSecondaryColors.setValue(NullFC);
01369 
01370                     setSecondaryColors(pColor);
01371                 }
01372             }
01373             else if(origin & ChangedOrigin::AbstrIncRefCount)
01374             {
01375                 addRefCP(_sfSecondaryColors.getValue());
01376             }
01377             else
01378             {
01379                 GeoColorsPtr pColor = _sfSecondaryColors.getValue();
01380 
01381                 _sfSecondaryColors.setValue(NullFC);
01382 
01383                 setSecondaryColors(pColor);
01384             }
01385         }
01386     }
01387 
01388     if(whichField & TexCoordsFieldMask)
01389     {
01390         if(origin & ChangedOrigin::Abstract)
01391         {
01392             if(origin & ChangedOrigin::AbstrCheckValid)
01393             {
01394                 GeometryPtr thisP = getPtr();
01395 
01396                 if(_sfTexCoords.getValue()                    != NullFC &&
01397                    _sfTexCoords.getValue()->findParent(thisP) ==     -1 )
01398                 {
01399                     GeoTexCoordsPtr pTexCoord = _sfTexCoords.getValue();
01400 
01401                     _sfTexCoords.setValue(NullFC);
01402 
01403                     setTexCoords(pTexCoord);
01404                 }
01405             }
01406             else if(origin & ChangedOrigin::AbstrIncRefCount)
01407             {
01408                 addRefCP(_sfTexCoords.getValue());
01409             }
01410             else
01411             {
01412                 GeoTexCoordsPtr pTexCoord = _sfTexCoords.getValue();
01413 
01414                 _sfTexCoords.setValue(NullFC);
01415 
01416                 setTexCoords(pTexCoord);
01417             }
01418         }
01419     }
01420 
01421     if(whichField & TexCoords1FieldMask)
01422     {
01423         if(origin & ChangedOrigin::Abstract)
01424         {
01425             if(origin & ChangedOrigin::AbstrCheckValid)
01426             {
01427                 GeometryPtr thisP = getPtr();
01428 
01429                 if(_sfTexCoords1.getValue()                    != NullFC &&
01430                    _sfTexCoords1.getValue()->findParent(thisP) ==     -1 )
01431                 {
01432                     GeoTexCoordsPtr pTexCoord = _sfTexCoords1.getValue();
01433 
01434                     _sfTexCoords1.setValue(NullFC);
01435 
01436                     setTexCoords1(pTexCoord);
01437                 }
01438             }
01439             else if(origin & ChangedOrigin::AbstrIncRefCount)
01440             {
01441                 addRefCP(_sfTexCoords1.getValue());
01442             }
01443             else
01444             {
01445                 GeoTexCoordsPtr pTexCoord = _sfTexCoords1.getValue();
01446 
01447                 _sfTexCoords1.setValue(NullFC);
01448 
01449                 setTexCoords1(pTexCoord);
01450             }
01451         }
01452     }
01453 
01454     if(whichField & TexCoords2FieldMask)
01455     {
01456         if(origin & ChangedOrigin::Abstract)
01457         {
01458             if(origin & ChangedOrigin::AbstrCheckValid)
01459             {
01460                 GeometryPtr thisP = getPtr();
01461 
01462                 if(_sfTexCoords2.getValue()                    != NullFC &&
01463                    _sfTexCoords2.getValue()->findParent(thisP) ==     -1 )
01464                 {
01465                     GeoTexCoordsPtr pTexCoord = _sfTexCoords2.getValue();
01466 
01467                     _sfTexCoords2.setValue(NullFC);
01468 
01469                     setTexCoords2(pTexCoord);
01470                 }
01471             }
01472             else if(origin & ChangedOrigin::AbstrIncRefCount)
01473             {
01474                 addRefCP(_sfTexCoords2.getValue());
01475             }
01476             else
01477             {
01478                 GeoTexCoordsPtr pTexCoord = _sfTexCoords2.getValue();
01479 
01480                 _sfTexCoords2.setValue(NullFC);
01481 
01482                 setTexCoords2(pTexCoord);
01483             }
01484         }
01485     }
01486 
01487     if(whichField & TexCoords3FieldMask)
01488     {
01489         if(origin & ChangedOrigin::Abstract)
01490         {
01491             if(origin & ChangedOrigin::AbstrCheckValid)
01492             {
01493                 GeometryPtr thisP = getPtr();
01494 
01495                 if(_sfTexCoords3.getValue()                    != NullFC &&
01496                    _sfTexCoords3.getValue()->findParent(thisP) ==     -1 )
01497                 {
01498                     GeoTexCoordsPtr pTexCoord = _sfTexCoords3.getValue();
01499 
01500                     _sfTexCoords3.setValue(NullFC);
01501 
01502                     setTexCoords3(pTexCoord);
01503                 }
01504             }
01505             else if(origin & ChangedOrigin::AbstrIncRefCount)
01506             {
01507                 addRefCP(_sfTexCoords3.getValue());
01508             }
01509             else
01510             {
01511                 GeoTexCoordsPtr pTexCoord = _sfTexCoords3.getValue();
01512 
01513                 _sfTexCoords3.setValue(NullFC);
01514 
01515                 setTexCoords3(pTexCoord);
01516             }
01517         }
01518     }
01519 
01520     if(whichField & TexCoords4FieldMask)
01521     {
01522         if(origin & ChangedOrigin::Abstract)
01523         {
01524             if(origin & ChangedOrigin::AbstrCheckValid)
01525             {
01526                 GeometryPtr thisP = getPtr();
01527 
01528                 if(_sfTexCoords4.getValue()                    != NullFC &&
01529                    _sfTexCoords4.getValue()->findParent(thisP) ==     -1 )
01530                 {
01531                     GeoTexCoordsPtr pTexCoord = _sfTexCoords4.getValue();
01532 
01533                     _sfTexCoords4.setValue(NullFC);
01534 
01535                     setTexCoords4(pTexCoord);
01536                 }
01537             }
01538             else if(origin & ChangedOrigin::AbstrIncRefCount)
01539             {
01540                 addRefCP(_sfTexCoords4.getValue());
01541             }
01542             else
01543             {
01544                 GeoTexCoordsPtr pTexCoord = _sfTexCoords4.getValue();
01545 
01546                 _sfTexCoords4.setValue(NullFC);
01547 
01548                 setTexCoords4(pTexCoord);
01549             }
01550         }
01551     }
01552 
01553     if(whichField & TexCoords5FieldMask)
01554     {
01555         if(origin & ChangedOrigin::Abstract)
01556         {
01557             if(origin & ChangedOrigin::AbstrCheckValid)
01558             {
01559                 GeometryPtr thisP = getPtr();
01560 
01561                 if(_sfTexCoords5.getValue()                    != NullFC &&
01562                    _sfTexCoords5.getValue()->findParent(thisP) ==     -1 )
01563                 {
01564                     GeoTexCoordsPtr pTexCoord = _sfTexCoords5.getValue();
01565 
01566                     _sfTexCoords5.setValue(NullFC);
01567 
01568                     setTexCoords5(pTexCoord);
01569                 }
01570             }
01571             else if(origin & ChangedOrigin::AbstrIncRefCount)
01572             {
01573                 addRefCP(_sfTexCoords5.getValue());
01574             }
01575             else
01576             {
01577                 GeoTexCoordsPtr pTexCoord = _sfTexCoords5.getValue();
01578 
01579                 _sfTexCoords5.setValue(NullFC);
01580 
01581                 setTexCoords5(pTexCoord);
01582             }
01583         }
01584     }
01585 
01586     if(whichField & TexCoords6FieldMask)
01587     {
01588         if(origin & ChangedOrigin::Abstract)
01589         {
01590             if(origin & ChangedOrigin::AbstrCheckValid)
01591             {
01592                 GeometryPtr thisP = getPtr();
01593 
01594                 if(_sfTexCoords6.getValue()                    != NullFC &&
01595                    _sfTexCoords6.getValue()->findParent(thisP) ==     -1 )
01596                 {
01597                     GeoTexCoordsPtr pTexCoord = _sfTexCoords6.getValue();
01598 
01599                     _sfTexCoords6.setValue(NullFC);
01600 
01601                     setTexCoords6(pTexCoord);
01602                 }
01603             }
01604             else if(origin & ChangedOrigin::AbstrIncRefCount)
01605             {
01606                 addRefCP(_sfTexCoords6.getValue());
01607             }
01608             else
01609             {
01610                 GeoTexCoordsPtr pTexCoord = _sfTexCoords6.getValue();
01611 
01612                 _sfTexCoords6.setValue(NullFC);
01613 
01614                 setTexCoords6(pTexCoord);
01615             }
01616         }
01617     }
01618 
01619     if(whichField & TexCoords7FieldMask)
01620     {
01621         if(origin & ChangedOrigin::Abstract)
01622         {
01623             if(origin & ChangedOrigin::AbstrCheckValid)
01624             {
01625                 GeometryPtr thisP = getPtr();
01626 
01627                 if(_sfTexCoords7.getValue()                    != NullFC &&
01628                    _sfTexCoords7.getValue()->findParent(thisP) ==     -1 )
01629                 {
01630                     GeoTexCoordsPtr pTexCoord = _sfTexCoords7.getValue();
01631 
01632                     _sfTexCoords7.setValue(NullFC);
01633 
01634                     setTexCoords7(pTexCoord);
01635                 }
01636             }
01637             else if(origin & ChangedOrigin::AbstrIncRefCount)
01638             {
01639                 addRefCP(_sfTexCoords7.getValue());
01640             }
01641             else
01642             {
01643                 GeoTexCoordsPtr pTexCoord = _sfTexCoords7.getValue();
01644 
01645                 _sfTexCoords7.setValue(NullFC);
01646 
01647                 setTexCoords7(pTexCoord);
01648             }
01649         }
01650     }
01651 
01652     if(whichField & IndicesFieldMask)
01653     {
01654         if(origin & ChangedOrigin::Abstract)
01655         {
01656             if(origin & ChangedOrigin::AbstrCheckValid)
01657             {
01658                 GeometryPtr thisP = getPtr();
01659 
01660                 if(_sfIndices.getValue()                    != NullFC &&
01661                    _sfIndices.getValue()->findParent(thisP) ==     -1 )
01662                 {
01663                     GeoIndicesPtr pIndex = _sfIndices.getValue();
01664 
01665                     _sfIndices.setValue(NullFC);
01666 
01667                     setIndices(pIndex);
01668                 }
01669             }
01670             else if(origin & ChangedOrigin::AbstrIncRefCount)
01671             {
01672                 addRefCP(_sfIndices.getValue());
01673             }
01674             else
01675             {
01676                 GeoIndicesPtr pIndex = _sfIndices.getValue();
01677 
01678                 _sfIndices.setValue(NullFC);
01679 
01680                 setIndices(pIndex);
01681             }
01682         }
01683     }
01684 
01685     if(whichField & MaterialFieldMask)
01686     {
01687         if(origin & ChangedOrigin::Abstract)
01688         {
01689             if(origin & ChangedOrigin::AbstrIncRefCount)
01690             {
01691                 addRefCP(_sfMaterial.getValue());
01692             }
01693             else
01694             {
01695                 MaterialPtr pMat = _sfMaterial.getValue();
01696 
01697                 _sfMaterial.setValue(NullFC);
01698 
01699                 setMaterial(pMat);
01700             }
01701         }
01702     }
01703 
01704     if(whichField & (IndicesFieldMask | LengthsFieldMask | 
01705                      TypesFieldMask   | IndexMappingFieldMask)
01706       )
01707     {
01708         updateLowHighIndices();
01709     }
01710 
01711 #if 1
01712 
01713     if(Thread::getAspect() != _sfIgnoreGLForAspect.getValue())
01714     {
01715     // invalidate the dlist cache
01716         if(getDlistCache() || getVbo())
01717         {
01718             if(getGLId() == 0)
01719             {
01720                 GeometryPtr tmpPtr(*this);
01721                 
01722                 beginEditCP(tmpPtr, Geometry::GLIdFieldMask);
01723                 
01724                 setGLId(
01725                     Window::registerGLObject(
01726                         osgTypedMethodVoidFunctor2ObjCPtrPtr<
01727                                 GeometryPtr,
01728                                 Window ,
01729                                 UInt32>(tmpPtr,
01730                                         &Geometry::handleGL),
01731                         2));
01732 
01733                 endEditCP(tmpPtr, Geometry::GLIdFieldMask);
01734             }
01735 
01736             // speed improvement don't recreate the display list
01737             // for a material change.
01738             if(whichField != MaterialFieldMask)
01739                 Window::refreshGLObject(getGLId());
01740         }
01741         else
01742         {
01743             if(getGLId() != 0)
01744                 Window::destroyGLObject(getGLId(), 2);
01745             
01746             setGLId(0);
01747         }
01748     }
01749 #endif
01750 
01751     Inherited::changed(whichField, origin);
01752 }

GeometryPtr Geometry::getPtr ( void   )  const

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.

Reimplemented from osg::NodeCore.

Definition at line 428 of file OSGGeometry.cpp.

Referenced by beginEdges(), beginFaces(), beginLines(), beginPrimitives(), beginTriangles(), changed(), dump(), endEdges(), endFaces(), endLines(), endPrimitives(), endTriangles(), onDestroy(), setColors(), setIndices(), setLengths(), setNormals(), setPositions(), setSecondaryColors(), setTexCoords(), setTexCoords1(), setTexCoords2(), setTexCoords3(), setTexCoords4(), setTexCoords5(), setTexCoords6(), setTexCoords7(), and setTypes().

00429 {
00430     return GeometryPtr(*this);
00431 }

GeometryPtr Geometry::clone ( void   ) 

Clone the geometry, i.e. create a new Geometry that uses all the same properties the given one uses.

Reimplemented in osg::Surface.

Definition at line 1879 of file OSGGeometry.cpp.

References osg::beginEditCP(), osg::GeometryBase::create(), osg::endEditCP(), osg::GeometryBase::getColors(), osg::GeometryBase::getDlistCache(), osg::GeometryBase::getIndices(), osg::GeometryBase::getLengths(), osg::MaterialDrawableBase::getMaterial(), osg::GeometryBase::getMFIndexMapping(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), osg::GeometryBase::getSecondaryColors(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTexCoords2(), osg::GeometryBase::getTexCoords3(), osg::GeometryBase::getTexCoords4(), osg::GeometryBase::getTexCoords5(), osg::GeometryBase::getTexCoords6(), osg::GeometryBase::getTexCoords7(), osg::GeometryBase::getTypes(), and osg::NullFC.

01880 {
01881     GeometryPtr geo = Geometry::create();
01882 //  FieldContainerFactory * fcf = FieldContainerFactory::the();
01883 
01884    //  create copies of the attributes
01885 
01886     beginEditCP(geo);
01887     {
01888         if(getTypes() != NullFC)
01889         {
01890             geo->setTypes(getTypes()->clone());
01891         }
01892 
01893         if(getLengths() != NullFC)
01894         {
01895             geo->setLengths(getLengths()->clone());
01896         }
01897 
01898         if(getPositions() != NullFC)
01899         {
01900             geo->setPositions(getPositions()->clone());
01901         }
01902 
01903         if(getNormals() != NullFC)
01904         {
01905             geo->setNormals(getNormals()->clone());
01906         }
01907 
01908         if(getColors() != NullFC)
01909         {
01910             geo->setColors(getColors()->clone());
01911         }
01912 
01913         if(getSecondaryColors() != NullFC)
01914         {
01915             geo->setSecondaryColors(getSecondaryColors()->clone());
01916         }
01917 
01918         if(getTexCoords() != NullFC)
01919         {
01920             geo->setTexCoords(getTexCoords()->clone());
01921         }
01922 
01923         if(getTexCoords1() != NullFC)
01924         {
01925             geo->setTexCoords1(getTexCoords1()->clone());
01926         }
01927 
01928         if(getTexCoords2() != NullFC)
01929         {
01930             geo->setTexCoords2(getTexCoords2()->clone());
01931         }
01932 
01933         if(getTexCoords3() != NullFC)
01934         {
01935             geo->setTexCoords3(getTexCoords3()->clone());
01936         }
01937 
01938         if(getTexCoords4() != NullFC)
01939         {
01940             geo->setTexCoords4(getTexCoords4()->clone());
01941         }
01942 
01943         if(getTexCoords5() != NullFC)
01944         {
01945             geo->setTexCoords5(getTexCoords5()->clone());
01946         }
01947 
01948         if(getTexCoords6() != NullFC)
01949         {
01950             geo->setTexCoords6(getTexCoords6()->clone());
01951         }
01952 
01953         if(getTexCoords7() != NullFC)
01954         {
01955             geo->setTexCoords7(getTexCoords7()->clone());
01956         }
01957 
01958         if(getIndices() != NullFC)
01959         {
01960             geo->setIndices(getIndices()->clone());
01961         }
01962 
01963         if(getMFIndexMapping() != NULL)
01964         {
01965             geo->getMFIndexMapping()->setValues(*getMFIndexMapping());
01966         }
01967 
01968         geo->setMaterial(getMaterial());
01969         geo->setDlistCache(getDlistCache());
01970     }
01971     endEditCP(geo);
01972 
01973     return geo;
01974 }

void Geometry::dump ( UInt32  uiIndent = 0,
const BitVector  bvFlags = 0 
) const [virtual]

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

Reimplemented from osg::MaterialDrawable.

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

Definition at line 561 of file OSGGeometry.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::NodeCore::_parents, osg::AttachmentContainer::dump(), osg::FieldContainerPtrBase::dump(), osg::GeometryBase::getColors(), osg::FieldContainerPtrBase::getFieldContainerId(), osg::GeometryBase::getIndices(), osg::GeometryBase::getLengths(), osg::MaterialDrawableBase::getMaterial(), osg::TypeBase::getName(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), getPtr(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTexCoords2(), osg::GeometryBase::getTexCoords3(), osg::GeometryBase::getTexCoords4(), osg::GeometryBase::getTexCoords5(), osg::GeometryBase::getTexCoords6(), osg::GeometryBase::getTexCoords7(), osg::GeometryBase::getType(), osg::GeometryBase::getTypes(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::indentLog(), osg::NullFC, PLOG, and osg::MField< FieldTypeT, fieldNameSpace >::size().

00563 {
00564     UInt32 i;
00565 
00566     GeometryPtr thisP = getPtr();
00567 
00568     indentLog(uiIndent, PLOG);
00569 
00570     PLOG << "GeoCore"
00571          << "("
00572          << thisP.getFieldContainerId()
00573          << ") : "
00574          << getType().getName()
00575          << " "
00576          << _attachmentMap.getValue().size()
00577          << " attachments | "
00578          << this
00579          << std::endl;
00580 
00581     indentLog(uiIndent, PLOG);
00582     PLOG << "[" << std::endl;
00583 
00584     indentLog(uiIndent + 4, PLOG);
00585     PLOG << "Parents : " << std::endl;
00586 
00587     for(i = 0; i < _parents.size(); i++)
00588     {
00589         indentLog(uiIndent + 4, PLOG);
00590         PLOG << "           " << i << ") " << &(*(_parents[i])) << std::endl;
00591     }
00592 
00593     indentLog(uiIndent, PLOG);
00594     PLOG << "]" << std::endl;
00595 
00596     indentLog(uiIndent, PLOG);
00597     PLOG << "{" << std::endl;
00598 
00599     uiIndent += 4;
00600 
00601     if(getPositions() != NullFC)
00602     {
00603         getPositions()->dump(uiIndent, bvFlags);
00604     }
00605 
00606     if(getIndices() != NullFC)
00607     {
00608         getIndices()->dump(uiIndent, bvFlags);
00609     }
00610 
00611     if(getMaterial() != NullFC)
00612     {
00613         getMaterial()->dump(uiIndent, bvFlags);
00614     }
00615 
00616     if(getTypes() != NullFC)
00617     {
00618         getTypes()->dump(uiIndent, bvFlags);
00619     }
00620 
00621     if(getLengths() != NullFC)
00622     {
00623         getLengths()->dump(uiIndent, bvFlags);
00624     }
00625 
00626     if(getNormals() != NullFC)
00627     {
00628         getNormals()->dump(uiIndent, bvFlags);
00629     }
00630 
00631     if(getColors() != NullFC)
00632     {
00633         getColors()->dump(uiIndent, bvFlags);
00634     }
00635 
00636     if(getTexCoords() != NullFC)
00637     {
00638         getTexCoords()->dump(uiIndent, bvFlags);
00639     }
00640 
00641     if(getTexCoords1() != NullFC)
00642     {
00643         getTexCoords1()->dump(uiIndent, bvFlags);
00644     }
00645 
00646     if(getTexCoords2() != NullFC)
00647     {
00648         getTexCoords2()->dump(uiIndent, bvFlags);
00649     }
00650 
00651     if(getTexCoords3() != NullFC)
00652     {
00653         getTexCoords3()->dump(uiIndent, bvFlags);
00654     }
00655 
00656     if(getTexCoords4() != NullFC)
00657     {
00658         getTexCoords4()->dump(uiIndent, bvFlags);
00659     }
00660 
00661     if(getTexCoords5() != NullFC)
00662     {
00663         getTexCoords5()->dump(uiIndent, bvFlags);
00664     }
00665 
00666     if(getTexCoords6() != NullFC)
00667     {
00668         getTexCoords6()->dump(uiIndent, bvFlags);
00669     }
00670 
00671     if(getTexCoords7() != NullFC)
00672     {
00673         getTexCoords7()->dump(uiIndent, bvFlags);
00674     }
00675 
00676     uiIndent -= 4;
00677 
00678     AttachmentContainer::dump(uiIndent, bvFlags);
00679 
00680     indentLog(uiIndent, PLOG);
00681     PLOG << "}" << std::endl;
00682 }

bool Geometry::isMergeable ( const GeometryPtr  other  ) 

Check if the geometry can be merged into this one, return true if yes They need to have the same material and the same mappings or the same set of attributes.

Definition at line 771 of file OSGGeometry.cpp.

References osg::GeometryBase::getPositions(), MergeIndex(), and osg::NullFC.

00772 {
00773     if (MergeIndex(other)!=-1 || getPositions()==NullFC) return true;
00774     else return false;
00775 }

bool Geometry::merge ( const GeometryPtr  other  ) 

Merge the geometry into this one, return true if successful.

Definition at line 779 of file OSGGeometry.cpp.

References osg::beginEditCP(), osg::GeoProperty< GeoPropertyDesc >::create(), osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::endEditCP(), FDEBUG, osg::GeometryBase::getIndices(), osg::GeometryBase::getMFIndexMapping(), osg::GeometryBase::getPositions(), osg::GeometryBase::IndicesFieldMask, merge0(), merge1(), merge2(), merge3(), merge4(), merge5(), merge6(), MergeIndex(), osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::push_back(), osg::MField< FieldTypeT, fieldNameSpace >::reserve(), setColors(), osg::GeometryBase::setDlistCache(), setIndices(), setLengths(), setMaterial(), setNormals(), setPositions(), setSecondaryColors(), setTexCoords(), setTexCoords1(), setTexCoords2(), setTexCoords3(), setTexCoords4(), setTexCoords5(), setTexCoords6(), setTexCoords7(), setTypes(), and osg::MField< FieldTypeT, fieldNameSpace >::setValues().

00780 {
00781     if (other == NullFC)
00782     {
00783         FDEBUG(("Geometry::merge: other = NullFC!!!\n"));
00784         return false;
00785     }
00786     //first check whethet the current geometry is empty
00787     //if empty just add everything from the other geometry
00788     if (getPositions()==NullFC)
00789     {
00790         if (other->getPositions()!=NullFC)
00791             setPositions(other->getPositions()->clone());
00792 
00793         if (other->getTypes()!=NullFC)
00794             setTypes(other->getTypes()->clone());
00795 
00796         if (other->getLengths()!=NullFC)
00797             setLengths(other->getLengths()->clone());
00798 
00799         if (other->getNormals()!=NullFC)
00800             setNormals(other->getNormals()->clone());
00801 
00802         if (other->getColors()!=NullFC)
00803             setColors(other->getColors()->clone());
00804 
00805         if (other->getSecondaryColors()!=NullFC)
00806             setSecondaryColors(other->getSecondaryColors()->clone());
00807 
00808         if (other->getTexCoords()!=NullFC)
00809             setTexCoords(other->getTexCoords()->clone());
00810 
00811         if (other->getTexCoords1()!=NullFC)
00812             setTexCoords1(other->getTexCoords1()->clone());
00813 
00814         if (other->getTexCoords2()!=NullFC)
00815             setTexCoords2(other->getTexCoords2()->clone());
00816 
00817         if (other->getTexCoords3()!=NullFC)
00818             setTexCoords3(other->getTexCoords3()->clone());
00819 
00820         if (other->getTexCoords4()!=NullFC)
00821             setTexCoords4(other->getTexCoords4()->clone());
00822 
00823         if (other->getTexCoords5()!=NullFC)
00824             setTexCoords5(other->getTexCoords5()->clone());
00825 
00826         if (other->getTexCoords6()!=NullFC)
00827             setTexCoords6(other->getTexCoords6()->clone());
00828 
00829         if (other->getTexCoords7()!=NullFC)
00830             setTexCoords7(other->getTexCoords7()->clone());
00831 
00832         if(other->getIndices()!=NullFC)
00833             setIndices(other->getIndices()->clone());
00834 
00835         if(other->getMFIndexMapping()!=NULL)
00836             getMFIndexMapping()->setValues(*(other->getMFIndexMapping()));
00837 
00838         setMaterial(other->getMaterial());
00839         setDlistCache(other->getDlistCache());
00840 
00841         return true;
00842     }
00843 
00844 
00845     //if not empty continue trying a normal merge
00846     Int16 mergetype = MergeIndex( other );
00847 
00848     if(mergetype >= 0 && mergetype <= 6)
00849     {
00850         // in this case we create 32 bit indices to have enough room for both geometries.
00851         if(GeoIndicesUI16Ptr::dcast(getIndices()) != NullFC)
00852         {
00853             GeoIndicesPtr indices = getIndices();
00854             UInt32 indices_size = indices->getSize();
00855             GeoIndicesUI32Ptr indicesUI32 = GeoIndicesUI32::create();
00856             MFUInt32 &dst = indicesUI32->getField();
00857             dst.reserve(indices_size);
00858             beginEditCP(indicesUI32);
00859                 for (UInt32 i = 0; i < indices_size; ++i)
00860                     dst.push_back(indices->getValue(i));
00861             endEditCP(indicesUI32);
00862     
00863             beginEditCP((GeometryPtr)this, Geometry::IndicesFieldMask);
00864                 setIndices(indicesUI32);
00865             endEditCP((GeometryPtr)this, Geometry::IndicesFieldMask);
00866         }
00867     }
00868 
00869     switch ( mergetype )
00870     {
00871     case 0: merge0( other ); break;
00872     case 1: merge1( other ); break;
00873     case 2: merge2( other ); break;
00874     case 3: merge3( other ); break;
00875     case 4: merge4( other ); break;
00876     case 5: merge5( other ); break;
00877     case 6: merge6( other ); break;
00878     default: return false;
00879     }
00880     return true;
00881 }

UInt32 Geometry::getCachedGfxMemoryUsage ( void   ) 

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 985 of file OSGGeometry.cpp.

References osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::GeometryBase::getColors(), osg::GeometryBase::getIndices(), osg::GeometryBase::getLengths(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), osg::GeometryBase::getSecondaryColors(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTexCoords2(), osg::GeometryBase::getTexCoords3(), osg::GeometryBase::getTexCoords4(), osg::GeometryBase::getTexCoords5(), osg::GeometryBase::getTexCoords6(), osg::GeometryBase::getTexCoords7(), and osg::NullFC.

Referenced by handleGL().

00986 {
00987     int nBytes = 0;
00988 
00989     // Lengths are int32 (4 Bbytes) or int16 (2 Bytes)
00990     if (getLengths() != NullFC)
00991     {
00992         if (GeoPLengthsUI32Ptr::dcast(getLengths()) != NullFC)
00993             nBytes += getLengths()->getSize()*4;
00994         else
00995             nBytes += getLengths()->getSize()*2;
00996     }
00997 
00998     // Indices are int32 (4 Bbytes) or int16 (2 Bytes)
00999     if (getIndices() != NullFC)
01000     {
01001         if (GeoIndicesUI32Ptr::dcast(getIndices()) != NullFC)
01002             nBytes += getIndices()->getSize()*4;
01003         else
01004             nBytes += getIndices()->getSize()*2;
01005     }
01006 
01007     // Positions are vec3f = 3 * 4 Bytes
01008     if (getPositions() != NullFC)
01009         nBytes += getPositions()->getSize()*12;
01010 
01011     // Normals are vec3f (3*4 Bytes) or vec3b(3*1 Byte)
01012     if (getNormals() != NullFC)
01013     {
01014         if (GeoNormals3fPtr::dcast(getNormals()) != NullFC)
01015             nBytes += getNormals()->getSize()*12;
01016         else
01017             nBytes += getNormals()->getSize()*3;
01018     }
01019 
01020     // Colors are vec4f = 4 * 4 Bytes
01021     if (getColors() != NullFC)
01022         nBytes += getColors()->getSize()*16;
01023 
01024     // SecondaryColors are vec4f = 4 * 4 Bytes
01025     if (getSecondaryColors() != NullFC)
01026         nBytes += getSecondaryColors()->getSize()*16;
01027 
01028     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01029     if (getTexCoords() != NullFC)
01030     {
01031         if (GeoTexCoords4fPtr::dcast(getTexCoords()) != NullFC)
01032             nBytes += getTexCoords()->getSize()*16;
01033         else if (GeoTexCoords3fPtr::dcast(getTexCoords()) != NullFC)
01034             nBytes += getTexCoords()->getSize()*12;
01035         else if (GeoTexCoords2fPtr::dcast(getTexCoords()) != NullFC)
01036             nBytes += getTexCoords()->getSize()*8;
01037     }
01038 
01039     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01040     if (getTexCoords1() != NullFC)
01041     {
01042         if (GeoTexCoords4fPtr::dcast(getTexCoords1()) != NullFC)
01043             nBytes += getTexCoords1()->getSize()*16;
01044         else if (GeoTexCoords3fPtr::dcast(getTexCoords1()) != NullFC)
01045             nBytes += getTexCoords1()->getSize()*12;
01046         else if (GeoTexCoords2fPtr::dcast(getTexCoords1()) != NullFC)
01047             nBytes += getTexCoords1()->getSize()*8;
01048     }
01049 
01050     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01051     if (getTexCoords2() != NullFC)
01052     {
01053         if (GeoTexCoords4fPtr::dcast(getTexCoords2()) != NullFC)
01054             nBytes += getTexCoords2()->getSize()*16;
01055         else if (GeoTexCoords3fPtr::dcast(getTexCoords2()) != NullFC)
01056             nBytes += getTexCoords2()->getSize()*12;
01057         else if (GeoTexCoords2fPtr::dcast(getTexCoords2()) != NullFC)
01058             nBytes += getTexCoords2()->getSize()*8;
01059     }
01060 
01061     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01062     if (getTexCoords3() != NullFC)
01063     {
01064         if (GeoTexCoords4fPtr::dcast(getTexCoords3()) != NullFC)
01065             nBytes += getTexCoords3()->getSize()*16;
01066         else if (GeoTexCoords3fPtr::dcast(getTexCoords3()) != NullFC)
01067             nBytes += getTexCoords3()->getSize()*12;
01068         else if (GeoTexCoords2fPtr::dcast(getTexCoords3()) != NullFC)
01069             nBytes += getTexCoords3()->getSize()*8;
01070     }
01071 
01072     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01073     if (getTexCoords4() != NullFC)
01074     {
01075         if (GeoTexCoords4fPtr::dcast(getTexCoords4()) != NullFC)
01076             nBytes += getTexCoords4()->getSize()*16;
01077         else if (GeoTexCoords3fPtr::dcast(getTexCoords4()) != NullFC)
01078             nBytes += getTexCoords4()->getSize()*12;
01079         else if (GeoTexCoords2fPtr::dcast(getTexCoords4()) != NullFC)
01080             nBytes += getTexCoords4()->getSize()*8;
01081     }
01082 
01083     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01084     if (getTexCoords5() != NullFC)
01085     {
01086         if (GeoTexCoords4fPtr::dcast(getTexCoords5()) != NullFC)
01087             nBytes += getTexCoords5()->getSize()*16;
01088         else if (GeoTexCoords3fPtr::dcast(getTexCoords5()) != NullFC)
01089             nBytes += getTexCoords5()->getSize()*12;
01090         else if (GeoTexCoords2fPtr::dcast(getTexCoords5()) != NullFC)
01091             nBytes += getTexCoords5()->getSize()*8;
01092     }
01093 
01094     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01095     if (getTexCoords6() != NullFC)
01096     {
01097         if (GeoTexCoords4fPtr::dcast(getTexCoords6()) != NullFC)
01098             nBytes += getTexCoords6()->getSize()*16;
01099         else if (GeoTexCoords3fPtr::dcast(getTexCoords6()) != NullFC)
01100             nBytes += getTexCoords6()->getSize()*12;
01101         else if (GeoTexCoords2fPtr::dcast(getTexCoords6()) != NullFC)
01102             nBytes += getTexCoords6()->getSize()*8;
01103     }
01104 
01105     // TexCoords are vec4f (4*4 Bytes) or vec3f(3*4 Bytes) or vec2f (2*4 Bytes)
01106     if (getTexCoords7() != NullFC)
01107     {
01108         if (GeoTexCoords4fPtr::dcast(getTexCoords7()) != NullFC)
01109             nBytes += getTexCoords7()->getSize()*16;
01110         else if (GeoTexCoords3fPtr::dcast(getTexCoords7()) != NullFC)
01111             nBytes += getTexCoords7()->getSize()*12;
01112         else if (GeoTexCoords2fPtr::dcast(getTexCoords7()) != NullFC)
01113             nBytes += getTexCoords7()->getSize()*8;
01114     }
01115     
01116     return nBytes;
01117 }

GeoPropertyArrayInterface * Geometry::getProperty ( Int32  mapID  )  [virtual]

Find the property pointer for the given mapID, i.e. osg::Geometry::MapPosition and relatives.

Definition at line 689 of file OSGGeometry.cpp.

References FFATAL, osg::GeometryBase::getColors(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), osg::GeometryBase::getSecondaryColors(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTexCoords2(), osg::GeometryBase::getTexCoords3(), osg::GeometryBase::getTexCoords4(), osg::GeometryBase::getTexCoords5(), osg::GeometryBase::getTexCoords6(), osg::GeometryBase::getTexCoords7(), MapColor, MapNormal, MapPosition, MapSecondaryColor, MapTexCoords, MapTexCoords1, MapTexCoords2, MapTexCoords3, MapTexCoords4, MapTexCoords5, MapTexCoords6, MapTexCoords7, and osg::NullFC.

00690 {
00691     GeoPropertyArrayInterface *pP = 0;
00692 
00693     switch(mapID)
00694     {
00695         case 0:
00696             pP = 0;
00697             break;
00698         case MapPosition:
00699             pP =(getPositions()       == NullFC) ? 0 : &(*getPositions());
00700             break;
00701         case MapNormal:
00702             pP =(getNormals()         == NullFC) ? 0 : &(*getNormals());
00703             break;
00704         case MapColor:
00705             pP =(getColors()          == NullFC) ? 0 : &(*getColors());
00706             break;
00707         case MapSecondaryColor:
00708             pP =(getSecondaryColors() == NullFC) ? 0 : &(*getSecondaryColors());
00709             break;
00710         case MapTexCoords:
00711             pP =(getTexCoords()       == NullFC) ? 0 : &(*getTexCoords());
00712             break;
00713         case MapTexCoords1:
00714             pP =(getTexCoords1()      == NullFC) ? 0 : &(*getTexCoords1());
00715             break;
00716         case MapTexCoords2:
00717             pP =(getTexCoords2()      == NullFC) ? 0 : &(*getTexCoords2());
00718             break;
00719         case MapTexCoords3:
00720             pP =(getTexCoords3()      == NullFC) ? 0 : &(*getTexCoords3());
00721             break;
00722         case MapTexCoords4:
00723             pP =(getTexCoords4()      == NullFC) ? 0 : &(*getTexCoords4());
00724             break;
00725         case MapTexCoords5:
00726             pP =(getTexCoords5()      == NullFC) ? 0 : &(*getTexCoords5());
00727             break;
00728         case MapTexCoords6:
00729             pP =(getTexCoords6()      == NullFC) ? 0 : &(*getTexCoords6());
00730             break;
00731         case MapTexCoords7:
00732             pP =(getTexCoords7()      == NullFC) ? 0 : &(*getTexCoords7());
00733             break;
00734         default:
00735             FFATAL(("Invalid mapID(%d) in Geometry::getProperty()\n",
00736                     mapID));
00737           break;
00738     }
00739 
00740     return pP;
00741 }

void osg::Geometry::setTypes ( const GeoPTypesPtr value  )  [inline]

Definition at line 66 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTypes, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TypesFieldId.

Referenced by osg::Surface::buildSurface(), changed(), and merge().

00067 {
00068     GeometryPtr thisP = getPtr();
00069 
00070     addRefCP(value);
00071 
00072     if(_sfTypes.getValue() != NullFC)
00073     {
00074         beginEditCP(_sfTypes.getValue(), Attachment::ParentsFieldMask);
00075         {
00076             _sfTypes.getValue()->subParent(thisP);
00077         }
00078         endEditCP  (_sfTypes.getValue(), Attachment::ParentsFieldMask);
00079 
00080         subRefCP(_sfTypes.getValue());
00081     }
00082 
00083     if(value != NullFC)
00084     {
00085         thisP.setParentFieldPos(TypesFieldId);
00086 
00087         beginEditCP(value, Attachment::ParentsFieldMask);
00088         {
00089             value->addParent(thisP);
00090         }
00091         endEditCP  (value, Attachment::ParentsFieldMask);
00092     }
00093 
00094     _sfTypes.setValue(value);
00095 }

void osg::Geometry::setLengths ( const GeoPLengthsPtr value  )  [inline]

Definition at line 98 of file OSGGeometry.inl.

References osg::GeometryBase::_sfLengths, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::GeometryBase::LengthsFieldId, osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by osg::Surface::buildSurface(), changed(), and merge().

00099 {
00100     GeometryPtr thisP = getPtr();
00101 
00102     addRefCP(value);
00103 
00104     if(_sfLengths.getValue() != NullFC)
00105     {
00106         beginEditCP(_sfLengths.getValue(), Attachment::ParentsFieldMask);
00107         {
00108             _sfLengths.getValue()->subParent(thisP);
00109         }
00110         endEditCP  (_sfLengths.getValue(), Attachment::ParentsFieldMask);
00111 
00112         subRefCP(_sfLengths.getValue());
00113     }
00114 
00115     if(value != NullFC)
00116     {
00117         thisP.setParentFieldPos(LengthsFieldId);
00118 
00119         beginEditCP(value, Attachment::ParentsFieldMask);
00120         {
00121             value->addParent(thisP);
00122         }
00123         endEditCP  (value, Attachment::ParentsFieldMask);
00124     }
00125 
00126     _sfLengths.setValue(value);
00127 }

void osg::Geometry::setPositions ( const GeoPositionsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 130 of file OSGGeometry.inl.

References osg::GeometryBase::_sfPositions, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::GeometryBase::PositionsFieldId, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by osg::Surface::buildSurface(), changed(), and merge().

00131 {
00132     GeometryPtr thisP = getPtr();
00133 
00134     addRefCP(value);
00135 
00136     if(_sfPositions.getValue() != NullFC)
00137     {
00138         beginEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00139         {
00140             _sfPositions.getValue()->subParent(thisP);
00141         }
00142         endEditCP  (_sfPositions.getValue(), Attachment::ParentsFieldMask);
00143 
00144         subRefCP(_sfPositions.getValue());
00145     }
00146 
00147     if(value != NullFC)
00148     {
00149         thisP.setParentFieldPos(PositionsFieldId);
00150 
00151         beginEditCP(value, Attachment::ParentsFieldMask);
00152         {
00153             value->addParent(thisP);
00154         }
00155         endEditCP  (value, Attachment::ParentsFieldMask);
00156     }
00157 
00158     _sfPositions.setValue(value);
00159 }

void osg::Geometry::setNormals ( const GeoNormalsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 162 of file OSGGeometry.inl.

References osg::GeometryBase::_sfNormals, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::GeometryBase::NormalsFieldId, osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by osg::Surface::buildSurface(), changed(), and merge().

00163 {
00164     GeometryPtr thisP = getPtr();
00165 
00166     addRefCP(value);
00167 
00168     if(_sfNormals.getValue() != NullFC)
00169     {
00170         beginEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00171         {
00172             _sfNormals.getValue()->subParent(thisP);
00173         }
00174         endEditCP  (_sfNormals.getValue(), Attachment::ParentsFieldMask);
00175 
00176         subRefCP(_sfNormals.getValue());
00177     }
00178 
00179     if(value != NullFC)
00180     {
00181         thisP.setParentFieldPos(NormalsFieldId);
00182 
00183         beginEditCP(value, Attachment::ParentsFieldMask);
00184         {
00185             value->addParent(thisP);
00186         }
00187         endEditCP  (value, Attachment::ParentsFieldMask);
00188     }
00189 
00190     _sfNormals.setValue(value);
00191 }

void osg::Geometry::setColors ( const GeoColorsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 194 of file OSGGeometry.inl.

References osg::GeometryBase::_sfColors, osg::addRefCP(), osg::beginEditCP(), osg::GeometryBase::ColorsFieldId, osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by changed(), and merge().

00195 {
00196     GeometryPtr thisP = getPtr();
00197 
00198     addRefCP(value);
00199 
00200     if(_sfColors.getValue() != NullFC)
00201     {
00202         beginEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00203         {
00204             _sfColors.getValue()->subParent(thisP);
00205         }
00206         endEditCP  (_sfColors.getValue(), Attachment::ParentsFieldMask);
00207 
00208         subRefCP(_sfColors.getValue());
00209     }
00210 
00211     if(value != NullFC)
00212     {
00213         thisP.setParentFieldPos(ColorsFieldId);
00214 
00215         beginEditCP(value, Attachment::ParentsFieldMask);
00216         {
00217             value->addParent(thisP);
00218         }
00219         endEditCP  (value, Attachment::ParentsFieldMask);
00220     }
00221 
00222     _sfColors.setValue(value);
00223 }

void osg::Geometry::setSecondaryColors ( const GeoColorsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 226 of file OSGGeometry.inl.

References osg::GeometryBase::_sfSecondaryColors, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::GeometryBase::SecondaryColorsFieldId, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by changed(), and merge().

00227 {
00228     GeometryPtr thisP = getPtr();
00229 
00230     addRefCP(value);
00231 
00232     if(_sfSecondaryColors.getValue() != NullFC)
00233     {
00234         beginEditCP(_sfSecondaryColors.getValue(), Attachment::ParentsFieldMask);
00235         {
00236             _sfSecondaryColors.getValue()->subParent(thisP);
00237         }
00238         beginEditCP(_sfSecondaryColors.getValue(), Attachment::ParentsFieldMask);
00239 
00240         subRefCP(_sfSecondaryColors.getValue());
00241     }
00242 
00243     if(value != NullFC)
00244     {
00245         thisP.setParentFieldPos(SecondaryColorsFieldId);
00246 
00247         beginEditCP(value, Attachment::ParentsFieldMask);
00248         {
00249             value->addParent(thisP);
00250         }
00251         beginEditCP(value, Attachment::ParentsFieldMask);
00252     }
00253 
00254     _sfSecondaryColors.setValue(value);
00255 }

void osg::Geometry::setTexCoords ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 258 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoordsFieldId.

Referenced by osg::Surface::buildSurface(), changed(), and merge().

00259 {
00260     GeometryPtr thisP = getPtr();
00261 
00262     addRefCP(value);
00263 
00264     if(_sfTexCoords.getValue() != NullFC)
00265     {
00266         beginEditCP(_sfTexCoords.getValue(), Attachment::ParentsFieldMask);
00267         {
00268             _sfTexCoords.getValue()->subParent(thisP);
00269         }
00270         endEditCP  (_sfTexCoords.getValue(), Attachment::ParentsFieldMask);
00271 
00272         subRefCP(_sfTexCoords.getValue());
00273     }
00274 
00275     if(value != NullFC)
00276     {
00277         thisP.setParentFieldPos(TexCoordsFieldId);
00278 
00279         beginEditCP(value, Attachment::ParentsFieldMask);
00280         {
00281             value->addParent(thisP);
00282         }
00283         endEditCP  (value, Attachment::ParentsFieldMask);
00284     }
00285 
00286     _sfTexCoords.setValue(value);
00287 }

void osg::Geometry::setTexCoords1 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 290 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords1, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords1FieldId.

Referenced by osg::Surface::buildSurface(), changed(), and merge().

00291 {
00292     GeometryPtr thisP = getPtr();
00293 
00294     addRefCP(value);
00295 
00296     if(_sfTexCoords1.getValue() != NullFC)
00297     {
00298         beginEditCP(_sfTexCoords1.getValue(), Attachment::ParentsFieldMask);
00299         {
00300             _sfTexCoords1.getValue()->subParent(thisP);
00301         }
00302         beginEditCP(_sfTexCoords1.getValue(), Attachment::ParentsFieldMask);
00303 
00304         subRefCP(_sfTexCoords1.getValue());
00305     }
00306 
00307     if(value != NullFC)
00308     {
00309         thisP.setParentFieldPos(TexCoords1FieldId);
00310 
00311         beginEditCP(value, Attachment::ParentsFieldMask);
00312         {
00313             value->addParent(thisP);
00314         }
00315         beginEditCP(value, Attachment::ParentsFieldMask);
00316     }
00317 
00318     _sfTexCoords1.setValue(value);
00319 }

void osg::Geometry::setTexCoords2 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 322 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords2, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords2FieldId.

Referenced by changed(), and merge().

00323 {
00324     GeometryPtr thisP = getPtr();
00325 
00326     addRefCP(value);
00327 
00328     if(_sfTexCoords2.getValue() != NullFC)
00329     {
00330         beginEditCP(_sfTexCoords2.getValue(), Attachment::ParentsFieldMask);
00331         {
00332             _sfTexCoords2.getValue()->subParent(thisP);
00333         }
00334         beginEditCP(_sfTexCoords2.getValue(), Attachment::ParentsFieldMask);
00335 
00336         subRefCP(_sfTexCoords2.getValue());
00337     }
00338 
00339     if(value != NullFC)
00340     {
00341         thisP.setParentFieldPos(TexCoords2FieldId);
00342 
00343         beginEditCP(value, Attachment::ParentsFieldMask);
00344         {
00345             value->addParent(thisP);
00346         }
00347         beginEditCP(value, Attachment::ParentsFieldMask);
00348     }
00349 
00350     _sfTexCoords2.setValue(value);
00351 }

void osg::Geometry::setTexCoords3 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 354 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords3, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords3FieldId.

Referenced by changed(), and merge().

00355 {
00356     GeometryPtr thisP = getPtr();
00357 
00358     addRefCP(value);
00359 
00360     if(_sfTexCoords3.getValue() != NullFC)
00361     {
00362         beginEditCP(_sfTexCoords3.getValue(), Attachment::ParentsFieldMask);
00363         {
00364             _sfTexCoords3.getValue()->subParent(thisP);
00365         }
00366         beginEditCP(_sfTexCoords3.getValue(), Attachment::ParentsFieldMask);
00367 
00368         subRefCP(_sfTexCoords3.getValue());
00369     }
00370 
00371     if(value != NullFC)
00372     {
00373         thisP.setParentFieldPos(TexCoords3FieldId);
00374 
00375         beginEditCP(value, Attachment::ParentsFieldMask);
00376         {
00377             value->addParent(thisP);
00378         }
00379         beginEditCP(value, Attachment::ParentsFieldMask);
00380     }
00381 
00382     _sfTexCoords3.setValue(value);
00383 }

void osg::Geometry::setTexCoords4 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 386 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords4, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords4FieldId.

Referenced by changed(), and merge().

00387 {
00388     GeometryPtr thisP = getPtr();
00389 
00390     addRefCP(value);
00391 
00392     if(_sfTexCoords4.getValue() != NullFC)
00393     {
00394         beginEditCP(_sfTexCoords4.getValue(), Attachment::ParentsFieldMask);
00395         {
00396             _sfTexCoords4.getValue()->subParent(thisP);
00397         }
00398         beginEditCP(_sfTexCoords4.getValue(), Attachment::ParentsFieldMask);
00399 
00400         subRefCP(_sfTexCoords4.getValue());
00401     }
00402 
00403     if(value != NullFC)
00404     {
00405         thisP.setParentFieldPos(TexCoords4FieldId);
00406 
00407         beginEditCP(value, Attachment::ParentsFieldMask);
00408         {
00409             value->addParent(thisP);
00410         }
00411         beginEditCP(value, Attachment::ParentsFieldMask);
00412     }
00413 
00414     _sfTexCoords4.setValue(value);
00415 }

void osg::Geometry::setTexCoords5 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 418 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords5, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords5FieldId.

Referenced by changed(), and merge().

00419 {
00420     GeometryPtr thisP = getPtr();
00421 
00422     addRefCP(value);
00423 
00424     if(_sfTexCoords5.getValue() != NullFC)
00425     {
00426         beginEditCP(_sfTexCoords5.getValue(), Attachment::ParentsFieldMask);
00427         {
00428             _sfTexCoords5.getValue()->subParent(thisP);
00429         }
00430         beginEditCP(_sfTexCoords5.getValue(), Attachment::ParentsFieldMask);
00431 
00432         subRefCP(_sfTexCoords5.getValue());
00433     }
00434 
00435     if(value != NullFC)
00436     {
00437         thisP.setParentFieldPos(TexCoords5FieldId);
00438 
00439         beginEditCP(value, Attachment::ParentsFieldMask);
00440         {
00441             value->addParent(thisP);
00442         }
00443         beginEditCP(value, Attachment::ParentsFieldMask);
00444     }
00445 
00446     _sfTexCoords5.setValue(value);
00447 }

void osg::Geometry::setTexCoords6 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 450 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords6, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords6FieldId.

Referenced by changed(), and merge().

00451 {
00452     GeometryPtr thisP = getPtr();
00453 
00454     addRefCP(value);
00455 
00456     if(_sfTexCoords6.getValue() != NullFC)
00457     {
00458         beginEditCP(_sfTexCoords6.getValue(), Attachment::ParentsFieldMask);
00459         {
00460             _sfTexCoords6.getValue()->subParent(thisP);
00461         }
00462         beginEditCP(_sfTexCoords6.getValue(), Attachment::ParentsFieldMask);
00463 
00464         subRefCP(_sfTexCoords6.getValue());
00465     }
00466 
00467     if(value != NullFC)
00468     {
00469         thisP.setParentFieldPos(TexCoords6FieldId);
00470 
00471         beginEditCP(value, Attachment::ParentsFieldMask);
00472         {
00473             value->addParent(thisP);
00474         }
00475         beginEditCP(value, Attachment::ParentsFieldMask);
00476     }
00477 
00478     _sfTexCoords6.setValue(value);
00479 }

void osg::Geometry::setTexCoords7 ( const GeoTexCoordsPtr value  )  [inline]

Reimplemented from osg::GeometryBase.

Definition at line 482 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords7, osg::addRefCP(), osg::beginEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), osg::subRefCP(), and osg::GeometryBase::TexCoords7FieldId.

Referenced by changed(), and merge().

00483 {
00484     GeometryPtr thisP = getPtr();
00485 
00486     addRefCP(value);
00487 
00488     if(_sfTexCoords7.getValue() != NullFC)
00489     {
00490         beginEditCP(_sfTexCoords7.getValue(), Attachment::ParentsFieldMask);
00491         {
00492             _sfTexCoords7.getValue()->subParent(thisP);
00493         }
00494         beginEditCP(_sfTexCoords7.getValue(), Attachment::ParentsFieldMask);
00495 
00496         subRefCP(_sfTexCoords7.getValue());
00497     }
00498 
00499     if(value != NullFC)
00500     {
00501         thisP.setParentFieldPos(TexCoords7FieldId);
00502 
00503         beginEditCP(value, Attachment::ParentsFieldMask);
00504         {
00505             value->addParent(thisP);
00506         }
00507         beginEditCP(value, Attachment::ParentsFieldMask);
00508     }
00509 
00510     _sfTexCoords7.setValue(value);
00511 }

void osg::Geometry::setIndices ( const GeoIndicesPtr value  )  [inline]

Definition at line 514 of file OSGGeometry.inl.

References osg::GeometryBase::_sfIndices, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::GeometryBase::IndicesFieldId, osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by osg::Surface::buildSurface(), changed(), merge(), merge2(), and merge4().

00515 {
00516     GeometryPtr thisP = getPtr();
00517 
00518     addRefCP(value);
00519 
00520     if(_sfIndices.getValue() != NullFC)
00521     {
00522         beginEditCP(_sfIndices.getValue(), Attachment::ParentsFieldMask);
00523         {
00524             _sfIndices.getValue()->subParent(thisP);
00525         }
00526         endEditCP  (_sfIndices.getValue(), Attachment::ParentsFieldMask);
00527 
00528         subRefCP(_sfIndices.getValue());
00529     }
00530 
00531     if(value != NullFC)
00532     {
00533         thisP.setParentFieldPos(IndicesFieldId);
00534 
00535         beginEditCP(value, Attachment::ParentsFieldMask);
00536         {
00537             value->addParent(thisP);
00538         }
00539         endEditCP  (value, Attachment::ParentsFieldMask);
00540     }
00541 
00542     _sfIndices.setValue(value);
00543 }

void osg::Geometry::setMaterial ( const MaterialPtr value  )  [inline]

Reimplemented from osg::MaterialDrawable.

Definition at line 546 of file OSGGeometry.inl.

References osg::MaterialDrawableBase::_sfMaterial, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::setRefdCP().

Referenced by changed(), and merge().

00547 {
00548     setRefdCP(_sfMaterial.getValue(), value);
00549 }

TriangleIterator Geometry::beginTriangles ( void   )  const

Return a TriangleIterator poiting to the beginning of the Geometry.

Definition at line 1758 of file OSGGeometry.cpp.

References getPtr(), and osg::TriangleIterator::setToBegin().

Referenced by intersect(), and intersectActor().

01759 {
01760     TriangleIterator it(this->getPtr());
01761 
01762     it.setToBegin();
01763 
01764     return it;
01765 }

TriangleIterator Geometry::endTriangles ( void   )  const

Return a TriangleIterator poiting to the end of the Geometry.

Definition at line 1769 of file OSGGeometry.cpp.

References getPtr(), and osg::TriangleIterator::setToEnd().

Referenced by intersect(), and intersectActor().

01770 {
01771     TriangleIterator it(this->getPtr());
01772 
01773     it.setToEnd();
01774 
01775     return it;
01776 }

PrimitiveIterator Geometry::beginPrimitives ( void   )  const

Return a PrimitiveIterator poiting to the beginning of the Geometry.

Definition at line 1782 of file OSGGeometry.cpp.

References getPtr(), and osg::PrimitiveIterator::setToBegin().

Referenced by adjustVolume().

01783 {
01784     PrimitiveIterator it(this->getPtr());
01785 
01786     it.setToBegin();
01787 
01788     return it;
01789 }

PrimitiveIterator Geometry::endPrimitives ( void   )  const

Return a PrimitiveIterator poiting to the end of the Geometry.

Definition at line 1793 of file OSGGeometry.cpp.

References getPtr(), and osg::PrimitiveIterator::setToEnd().

Referenced by adjustVolume().

01794 {
01795     PrimitiveIterator it(this->getPtr());
01796 
01797     it.setToEnd();
01798 
01799     return it;
01800 }

FaceIterator Geometry::beginFaces ( void   )  const

Return a FaceIterator poiting to the beginning of the Geometry.

Definition at line 1806 of file OSGGeometry.cpp.

References getPtr(), and osg::FaceIterator::setToBegin().

01807 {
01808     FaceIterator it(this->getPtr());
01809 
01810     it.setToBegin();
01811 
01812     return it;
01813 }

FaceIterator Geometry::endFaces ( void   )  const

Return a FaceIterator poiting to the end of the Geometry.

Definition at line 1817 of file OSGGeometry.cpp.

References getPtr(), and osg::FaceIterator::setToEnd().

01818 {
01819     FaceIterator it(this->getPtr());
01820 
01821     it.setToEnd();
01822 
01823     return it;
01824 }

LineIterator Geometry::beginLines ( void   )  const

Return a LineIterator poiting to the beginning of the Geometry.

Definition at line 1830 of file OSGGeometry.cpp.

References getPtr(), and osg::LineIterator::setToBegin().

01831 {
01832     LineIterator it(this->getPtr());
01833 
01834     it.setToBegin();
01835     
01836     return it;
01837 }

LineIterator Geometry::endLines ( void   )  const

Return a LineIterator poiting to the end of the Geometry.

Definition at line 1841 of file OSGGeometry.cpp.

References getPtr(), and osg::LineIterator::setToEnd().

01842 {
01843     LineIterator it(this->getPtr());
01844 
01845     it.setToEnd();
01846     
01847     return it;
01848 }

EdgeIterator Geometry::beginEdges ( void   )  const

Return a EdgeIterator poiting to the beginning of the Geometry.

Definition at line 1854 of file OSGGeometry.cpp.

References getPtr(), and osg::EdgeIterator::setToBegin().

01855 {
01856     EdgeIterator it(this->getPtr());
01857 
01858     it.setToBegin();
01859     
01860     return it;
01861 }

EdgeIterator Geometry::endEdges ( void   )  const

Return a EdgeIterator poiting to the end of the Geometry.

Definition at line 1865 of file OSGGeometry.cpp.

References getPtr(), and osg::EdgeIterator::setToEnd().

01866 {
01867     EdgeIterator it(this->getPtr());
01868 
01869     it.setToEnd();
01870     
01871     return it;
01872 }

Action::ResultE Geometry::drawPrimitives ( DrawActionBase action  )  [virtual]

Reimplemented from osg::MaterialDrawable.

Reimplemented in osg::Surface.

Definition at line 887 of file OSGGeometry.cpp.

References _numBytesOnGfxCard, osg::StatIntElem::add(), osg::calcPrimitiveCount(), osg::Action::Continue, drawVBO(), osg::GeometryBase::getColors(), osg::GeometryBase::getDlistCache(), osg::StatCollector::getElem(), osg::GeoPumpFactory::getGeoPump(), osg::GeometryBase::getGLId(), osg::Window::getGLObjectId(), osg::GeoPumpFactory::getIndex(), osg::GeometryBase::getIndexMapping(), osg::GeometryBase::getIndices(), osg::GeometryBase::getPositions(), osg::DrawActionBase::getStatistics(), osg::GeometryBase::getTypes(), osg::GeometryBase::getVbo(), osg::DrawActionBase::getWindow(), osg::NullFC, p, osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::Drawable::statNGeoBytes, osg::Drawable::statNLines, osg::Drawable::statNPrimitives, osg::Drawable::statNTriangles, osg::Drawable::statNVertices, SWARNING, osg::GeoPumpFactory::the(), and osg::Window::validateGLObject().

Referenced by osg::RenderAction::draw(), osg::ChunkMaterial::draw(), and osg::Surface::drawPrimitives().

00888 {
00889     // store glColor.
00890     Color4f color;
00891     if(getColors() != NullFC)
00892         glPushAttrib(GL_CURRENT_BIT);
00893 
00894     bool vbo_supported = false;
00895     if(getVbo())
00896     {
00897         vbo_supported = drawVBO(action->getWindow(), getGLId());
00898     }
00899 
00900     if(!vbo_supported)
00901     {
00902         if(getDlistCache() == true)
00903         {
00904             action->getWindow()->validateGLObject(getGLId());
00905             UInt32 glid = action->getWindow()->getGLObjectId(getGLId());
00906             if(glid != 0)
00907                 glCallList(glid);
00908         }
00909         else
00910         {
00911             GeoPumpFactory::Index ind = GeoPumpFactory::the()->getIndex(this);
00912             GeoPumpFactory::GeoPump p =
00913                 GeoPumpFactory::the()->getGeoPump(action->getWindow(), ind);
00914     
00915             // call the pump
00916     
00917             if(p)
00918                 p(action->getWindow(), this);
00919             else
00920             {
00921                 SWARNING << "draw: no Pump found for geometry "
00922                          << this
00923                          << std::endl;
00924             }
00925         }
00926     }
00927 
00928     // restore glColor.
00929     if(getColors() != NullFC)
00930         glPopAttrib();
00931 
00932     StatCollector *coll = action->getStatistics();
00933 
00934     if(coll != NULL)
00935     {
00936         StatIntElem *el = coll->getElem(Drawable::statNTriangles,false);
00937         if(el)
00938         {
00939             GeometryPtr geo(this);
00940             UInt32 ntri,nl,np,is;
00941 
00942             calcPrimitiveCount(geo, ntri, nl, np);
00943             el->add(ntri);
00944             coll->getElem(Drawable::statNLines)->add(nl);
00945             coll->getElem(Drawable::statNLines)->add(np);
00946 
00947             if(getIndices() == NullFC)
00948             {
00949                 if(getPositions() != NullFC)
00950                 {
00951                     is = getPositions()->getSize();
00952                 }
00953                 else
00954                 {
00955                     is = 0;
00956                 }
00957             }
00958             else
00959             {
00960                 is = getIndexMapping().size();
00961                 is = getIndices()->getSize() /(is ? is : 1);
00962             }
00963             coll->getElem(Drawable::statNVertices)->add(is);
00964 
00965             UInt32 primitiveCount = 0;
00966             if (getTypes() != NullFC) {
00967                 primitiveCount = getTypes()->getSize();
00968             }
00969             coll->getElem(Drawable::statNPrimitives)->add(primitiveCount);
00970         }
00971 
00972         // check amount of memory on gfx card
00973         // count only primitives residing on the gfxcard
00974         if (vbo_supported || getDlistCache())
00975         {
00976             StatIntOnceElem *el = coll->getElem(Drawable::statNGeoBytes, false);
00977             if (el)
00978                 coll->getElem(Drawable::statNGeoBytes)->add(getGLId(), _numBytesOnGfxCard);
00979         }
00980     }
00981 
00982     return Action::Continue;
00983 }

Action::ResultE Geometry::intersect ( Action action  ) 

Definition at line 1119 of file OSGGeometry.cpp.

References beginTriangles(), osg::Action::Continue, endTriangles(), osg::Action::getActNode(), osg::TriangleIterator::getIndex(), osg::IntersectAction::getLine(), osg::TriangleIterator::getPosition(), osg::Line::intersect(), osg::DynamicVolume::intersect(), osg::Volume::isValid(), osg::IntersectAction::setHit(), and osg::Action::Skip.

Referenced by osg::Surface::initMethod(), and initMethod().

01120 {
01121     IntersectAction     * ia = dynamic_cast<IntersectAction*>(action);
01122     const DynamicVolume  &dv = ia->getActNode()->getVolume(true);
01123 
01124     if(dv.isValid() && !dv.intersect(ia->getLine()))
01125     {
01126         return Action::Skip; //bv missed -> can not hit children
01127     }
01128 
01129     TriangleIterator it  = this->beginTriangles();
01130     TriangleIterator end = this->endTriangles  ();
01131     Real32 t;
01132     Vec3f norm;
01133 
01134     for(; it != end; ++it)
01135     {
01136         if(ia->getLine().intersect(it.getPosition(0),
01137                                      it.getPosition(1),
01138                                      it.getPosition(2), t, &norm))
01139         {
01140             ia->setHit(t, ia->getActNode(), it.getIndex(), norm);
01141         }
01142     }
01143 
01144     return Action::Continue;
01145 }

NewActionTypes::ResultE Geometry::intersectActor ( ActorBase::FunctorArgumentType funcArg  ) 

Definition at line 1148 of file OSGGeometry.cpp.

References beginTriangles(), osg::NewActionTypes::Continue, endTriangles(), osg::NewActionTypes::FunctorArgumentType::getActor(), osg::TriangleIterator::getIndex(), osg::NewActionTypes::FunctorArgumentType::getNode(), and osg::TriangleIterator::getPosition().

Referenced by initMethod().

01149 {
01150     IntersectActor   *pIA         = dynamic_cast<IntersectActor *>(funcArg.getActor());
01151     Real32            scaleFactor = pIA->getScaleFactor();
01152 
01153     TriangleIterator  itTris      = this->beginTriangles();
01154     TriangleIterator  endTris     = this->endTriangles  ();
01155 
01156     Real32            hitDist;
01157     Vec3f             hitNormal;
01158 
01159     for(; itTris != endTris; ++itTris)
01160     {
01161         if(pIA->getRay().intersect(itTris.getPosition(0),
01162                                    itTris.getPosition(1),
01163                                    itTris.getPosition(2),
01164                                    hitDist,                &hitNormal) == true)
01165         {
01166             pIA->setHit(hitDist * scaleFactor, funcArg.getNode(),
01167                         itTris.getIndex(),     hitNormal        );
01168         }
01169     }
01170 
01171     pIA->setupChildrenPriorities();
01172 
01173     return NewActionTypes::Continue;
01174 }

void osg::Geometry::invalidateDlistCache ( void   )  [inline]

Definition at line 58 of file OSGGeometry.inl.

References osg::GeometryBase::getGLId(), and osg::Window::refreshGLObject().

00059 {
00060     Window::refreshGLObject( getGLId() );
00061 }

void Geometry::adjustVolume ( Volume volume  )  [virtual]

Reimplemented from osg::NodeCore.

Reimplemented in osg::Surface.

Definition at line 405 of file OSGGeometry.cpp.

References beginPrimitives(), endPrimitives(), osg::Volume::extendBy(), osg::PrimitiveIterator::getLength(), osg::PrimitiveIterator::getPosition(), osg::GeometryBase::getPositions(), osg::NullFC, osg::Volume::setEmpty(), and osg::Volume::setValid().

00406 {
00407     GeoPositionsPtr pos = getPositions();
00408 
00409     volume.setValid();
00410     volume.setEmpty();
00411 
00412     if(pos == NullFC)
00413         return;                  // Node has no points, no volume
00414 
00415     PrimitiveIterator it;
00416 
00417     for(it = this->beginPrimitives(); it != this->endPrimitives(); ++it)
00418     {
00419         for(UInt32 v=0; v < it.getLength(); ++v)
00420         {
00421             volume.extendBy(it.getPosition(v));
00422         }
00423     }
00424 }

void Geometry::handleGL ( Window win,
UInt32  idstatus 
) [protected]

OpenGL object handler. Used for DisplayList caching.

Reimplemented in osg::Surface.

Definition at line 436 of file OSGGeometry.cpp.

References osg::GeoPumpFactory::_arbVBO, _numBytesOnGfxCard, createVBO(), osg::Window::destroy, destroyVBO(), osg::Window::finaldestroy, getCachedGfxMemoryUsage(), osg::GeoPumpFactory::getGeoPump(), osg::Window::getGLObjectId(), osg::GeoPumpFactory::getIndex(), osg::GeometryBase::getVbo(), osg::Window::hasExtension(), osg::Window::initialize, osg::Window::needrefresh, p, osg::Window::reinitialize, osg::Window::setGLObjectId(), SFATAL, SWARNING, osg::GeoPumpFactory::the(), osg::Window::unpackIdStatus(), and updateVBO().

Referenced by changed(), and onCreate().

00437 {
00438     Window::GLObjectStatusE mode;
00439     UInt32 id;
00440     UInt32 glid = 0;
00441     
00442     Window::unpackIdStatus(idstatus, id, mode);
00443 
00444     if(mode == Window::initialize || mode == Window::needrefresh ||
00445        mode == Window::reinitialize)
00446     {
00447         _numBytesOnGfxCard = getCachedGfxMemoryUsage();
00448 
00449         GeoPumpFactory::Index ind = GeoPumpFactory::the()->getIndex(this);
00450         // vbo is only supported for single index geometry (pump 129)
00451         bool vbo_supported = getVbo() && (ind == 129) && win->hasExtension(GeoPumpFactory::_arbVBO);
00452         bool created_vbo = false;
00453         if(mode == Window::initialize)
00454         {
00455             if(vbo_supported)
00456             {
00457                 // reset the display list id.
00458                 win->setGLObjectId(id, 0);
00459                 // create the vbo objects.
00460                 createVBO(win, id);
00461                 created_vbo = true;
00462             }
00463             else
00464             {
00465                 // create a display list.
00466                 glid = glGenLists(1);
00467                 win->setGLObjectId(id, glid);
00468                 // reset the vbo id.
00469                 win->setGLObjectId(id + 1, 0);
00470             }
00471         }
00472 
00473         glid = win->getGLObjectId(id);
00474 
00475         if(!vbo_supported)
00476         {
00477             // could be switched from vbo to display list rendering,
00478             // destroy old vbo
00479             destroyVBO(win, id);
00480 
00481             if(glid == 0)
00482             {
00483                 // could be switched from vbo to display list rendering,
00484                 // so we need to create a new display list!
00485                 glid = glGenLists(1);
00486                 win->setGLObjectId(id, glid);
00487             }
00488 
00489             glNewList(glid, GL_COMPILE);
00490 
00491             GeoPumpFactory::GeoPump p =
00492                 GeoPumpFactory::the()->getGeoPump(win, ind);
00493 
00494             // call the pump
00495     
00496             if(p)
00497                 p(win, this);
00498             else
00499             {
00500                 SWARNING << "Geometry::handleGL: no Pump found for geometry "
00501                          << this
00502                          << std::endl;
00503             }
00504     
00505             glEndList();
00506 
00507             if(glGetError() == GL_OUT_OF_MEMORY)
00508             {
00509                 SFATAL << "Geometry::handleGL: couldn't create display list (out of memory) skipping geometry "
00510                          << this
00511                          << std::endl;
00512 
00513                 // destroy old list.
00514                 glDeleteLists(glid, 1);
00515                 win->setGLObjectId(id, 0);
00516             }
00517         }
00518         else
00519         {
00520             // could be switched from display list to vbo rendering,
00521             // destroy old display list.
00522             if(glid != 0)
00523             {
00524                 glDeleteLists(glid, 1);
00525                 // reset the display list id.
00526                 win->setGLObjectId(id, 0);
00527             }
00528             if(!created_vbo)
00529             {
00530                 updateVBO(win, id);
00531             }
00532         }
00533     }
00534     else if(mode == Window::destroy)
00535     {
00536         // delete vbo's and display lists.
00537         destroyVBO(win, id);
00538 
00539         glid = win->getGLObjectId(id);
00540         if(glid != 0)
00541         {
00542             glDeleteLists(glid, 1);
00543             // reset the display list id.
00544             win->setGLObjectId(id, 0);
00545         }
00546     }
00547     else if(mode == Window::finaldestroy)
00548     {
00549         //SWARNING << "Last geometry user destroyed" << std::endl;
00550     }
00551     else
00552     {
00553         SWARNING << "Geometry(" << this << "::handleGL: Illegal mode: "
00554                  << mode << " for id " << id << std::endl;
00555     }
00556 
00557 }

void Geometry::onCreate ( const Geometry source = NULL  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 194 of file OSGGeometry.cpp.

References osg::GeometryBase::_sfIgnoreGLForAspect, osg::beginEditCP(), osg::endEditCP(), osg::PThreadBase::getAspect(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::GeometryBase::GLIdFieldMask, osg::GlobalSystemState, handleGL(), osg::osgTypedMethodVoidFunctor2ObjCPtrPtr(), osg::Window::registerGLObject(), osg::GeometryBase::setGLId(), and osg::Startup.

Referenced by osg::Surface::onCreate().

00195 {
00196     // if we're in startup this is the prototype, which shouldn't have an id
00197     if(GlobalSystemState == Startup)
00198         return;
00199 
00200     // !!! this temporary is needed to work around compiler problems(sgi)
00201     // CHECK CHECK
00202 
00203     //  TextureChunkPtr tmpPtr = FieldContainer::getPtr<TextureChunkPtr>(*this);
00204     if(Thread::getAspect() != _sfIgnoreGLForAspect.getValue())
00205     {
00206         GeometryPtr tmpPtr(*this);
00207 
00208         beginEditCP(tmpPtr, Geometry::GLIdFieldMask);
00209 
00210         setGLId(
00211             Window::registerGLObject(
00212                 osgTypedMethodVoidFunctor2ObjCPtrPtr<GeometryPtr,
00213                                                      Window ,
00214                                                      UInt32>(tmpPtr,
00215                                                          &Geometry::handleGL),
00216                 2));
00217         
00218         endEditCP(tmpPtr, Geometry::GLIdFieldMask);
00219     }
00220 }

void Geometry::onDestroy ( void   )  [protected, virtual]

OpenGL object handler. Used for DisplayList caching.

Reimplemented from osg::NodeCore.

Reimplemented in osg::Surface.

Definition at line 222 of file OSGGeometry.cpp.

References osg::GeometryBase::_sfColors, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::MaterialDrawableBase::_sfMaterial, osg::GeometryBase::_sfNormals, osg::GeometryBase::_sfPositions, osg::GeometryBase::_sfSecondaryColors, osg::GeometryBase::_sfTexCoords, osg::GeometryBase::_sfTexCoords1, osg::GeometryBase::_sfTexCoords2, osg::GeometryBase::_sfTexCoords3, osg::GeometryBase::_sfTexCoords4, osg::GeometryBase::_sfTexCoords5, osg::GeometryBase::_sfTexCoords6, osg::GeometryBase::_sfTexCoords7, osg::GeometryBase::_sfTypes, osg::beginEditCP(), osg::Window::destroyGLObject(), osg::endEditCP(), osg::GeometryBase::getGLId(), getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::NodeCore::onDestroy(), osg::Attachment::ParentsFieldMask, and osg::subRefCP().

Referenced by osg::Surface::onDestroy().

00223 {
00224     Inherited::onDestroy();
00225 
00226     GeometryPtr thisP = getPtr();
00227 
00228     if(_sfTypes.getValue() != NullFC)
00229     {
00230         beginEditCP(_sfTypes.getValue(), Attachment::ParentsFieldMask);
00231         {
00232             _sfTypes.getValue()->subParent(thisP);
00233         }
00234         endEditCP(_sfTypes.getValue(), Attachment::ParentsFieldMask);
00235 
00236         subRefCP(_sfTypes.getValue());
00237     }
00238 
00239     if(_sfLengths.getValue() != NullFC)
00240     {
00241         beginEditCP(_sfLengths.getValue(), Attachment::ParentsFieldMask);
00242         {
00243             _sfLengths.getValue()->subParent(thisP);
00244         }
00245         endEditCP(_sfLengths.getValue(), Attachment::ParentsFieldMask);
00246 
00247         subRefCP(_sfLengths.getValue());
00248     }
00249 
00250     if(_sfPositions.getValue() != NullFC)
00251     {
00252         beginEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00253         {
00254             _sfPositions.getValue()->subParent(thisP);
00255         }
00256         endEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00257 
00258         subRefCP(_sfPositions.getValue());
00259     }
00260 
00261     if(_sfNormals.getValue() != NullFC)
00262     {
00263         beginEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00264         {
00265             _sfNormals.getValue()->subParent(thisP);
00266         }
00267         endEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00268 
00269         subRefCP(_sfNormals.getValue());
00270     }
00271 
00272     if(_sfColors.getValue() != NullFC)
00273     {
00274         beginEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00275         {
00276             _sfColors.getValue()->subParent(thisP);
00277         }
00278         endEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00279 
00280         subRefCP(_sfColors.getValue());
00281     }
00282 
00283     if(_sfSecondaryColors.getValue() != NullFC)
00284     {
00285         beginEditCP(_sfSecondaryColors.getValue(),
00286                         Attachment::ParentsFieldMask);
00287         {
00288             _sfSecondaryColors.getValue()->subParent(thisP);
00289         }
00290         endEditCP(_sfSecondaryColors.getValue(),
00291                         Attachment::ParentsFieldMask);
00292 
00293         subRefCP(_sfSecondaryColors.getValue());
00294     }
00295 
00296     if(_sfTexCoords.getValue() != NullFC)
00297     {
00298         beginEditCP(_sfTexCoords.getValue(), Attachment::ParentsFieldMask);
00299         {
00300             _sfTexCoords.getValue()->subParent(thisP);
00301         }
00302         endEditCP(_sfTexCoords.getValue(), Attachment::ParentsFieldMask);
00303 
00304         subRefCP(_sfTexCoords.getValue());
00305     }
00306 
00307     if(_sfTexCoords1.getValue() != NullFC)
00308     {
00309         beginEditCP(_sfTexCoords1.getValue(), Attachment::ParentsFieldMask);
00310         {
00311             _sfTexCoords1.getValue()->subParent(thisP);
00312         }
00313         endEditCP(_sfTexCoords1.getValue(), Attachment::ParentsFieldMask);
00314 
00315         subRefCP(_sfTexCoords1.getValue());
00316     }
00317 
00318     if(_sfTexCoords2.getValue() != NullFC)
00319     {
00320         beginEditCP(_sfTexCoords2.getValue(), Attachment::ParentsFieldMask);
00321         {
00322             _sfTexCoords2.getValue()->subParent(thisP);
00323         }
00324         endEditCP(_sfTexCoords2.getValue(), Attachment::ParentsFieldMask);
00325 
00326         subRefCP(_sfTexCoords2.getValue());
00327     }
00328 
00329     if(_sfTexCoords3.getValue() != NullFC)
00330     {
00331         beginEditCP(_sfTexCoords3.getValue(), Attachment::ParentsFieldMask);
00332         {
00333             _sfTexCoords3.getValue()->subParent(thisP);
00334         }
00335         endEditCP(_sfTexCoords3.getValue(), Attachment::ParentsFieldMask);
00336 
00337         subRefCP(_sfTexCoords3.getValue());
00338     }
00339 
00340     if(_sfTexCoords4.getValue() != NullFC)
00341     {
00342         beginEditCP(_sfTexCoords4.getValue(), Attachment::ParentsFieldMask);
00343         {
00344             _sfTexCoords4.getValue()->subParent(thisP);
00345         }
00346         endEditCP(_sfTexCoords4.getValue(), Attachment::ParentsFieldMask);
00347 
00348         subRefCP(_sfTexCoords4.getValue());
00349     }
00350 
00351     if(_sfTexCoords5.getValue() != NullFC)
00352     {
00353         beginEditCP(_sfTexCoords5.getValue(), Attachment::ParentsFieldMask);
00354         {
00355             _sfTexCoords5.getValue()->subParent(thisP);
00356         }
00357         endEditCP(_sfTexCoords5.getValue(), Attachment::ParentsFieldMask);
00358 
00359         subRefCP(_sfTexCoords5.getValue());
00360     }
00361 
00362     if(_sfTexCoords6.getValue() != NullFC)
00363     {
00364         beginEditCP(_sfTexCoords6.getValue(), Attachment::ParentsFieldMask);
00365         {
00366             _sfTexCoords6.getValue()->subParent(thisP);
00367         }
00368         endEditCP(_sfTexCoords6.getValue(), Attachment::ParentsFieldMask);
00369 
00370         subRefCP(_sfTexCoords6.getValue());
00371     }
00372 
00373     if(_sfTexCoords7.getValue() != NullFC)
00374     {
00375         beginEditCP(_sfTexCoords7.getValue(), Attachment::ParentsFieldMask);
00376         {
00377             _sfTexCoords7.getValue()->subParent(thisP);
00378         }
00379         endEditCP(_sfTexCoords7.getValue(), Attachment::ParentsFieldMask);
00380 
00381         subRefCP(_sfTexCoords7.getValue());
00382     }
00383 
00384     if(_sfIndices.getValue() != NullFC)
00385     {
00386         beginEditCP(_sfIndices.getValue(), Attachment::ParentsFieldMask);
00387         {
00388             _sfIndices.getValue()->subParent(thisP);
00389         }
00390         endEditCP(_sfIndices.getValue(), Attachment::ParentsFieldMask);
00391 
00392         subRefCP(_sfIndices.getValue());
00393     }
00394 
00395     subRefCP(_sfMaterial.getValue());
00396 
00397     if(getGLId() > 0)
00398     {
00399         Window::destroyGLObject(getGLId(), 2);
00400     }
00401 }

bool Geometry::CompareMaterials ( MaterialPtr  m1,
MaterialPtr  m2 
) [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 1976 of file OSGGeometry.cpp.

References osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::AttachmentContainerPtr::dcast(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::MField< FieldTypeT, fieldNameSpace >::find(), osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by MergeIndex().

01977 {
01978     if(m1 == m2)
01979         return true;
01980         
01981     ChunkMaterialPtr cm1=ChunkMaterialPtr::dcast(m1);
01982     ChunkMaterialPtr cm2=ChunkMaterialPtr::dcast(m2);
01983 
01984     if (cm1==NullFC || cm2==NullFC) return false;
01985 
01986     MFStateChunkPtr &chunks1=cm1->getChunks();
01987     MFStateChunkPtr &chunks2=cm2->getChunks();
01988 
01989     if (chunks1.size()!=chunks2.size()) return false;
01990 
01991     MFStateChunkPtr::iterator matIt  = chunks1.begin();
01992     MFStateChunkPtr::iterator matEnd = chunks1.end ();
01993 
01994     MFStateChunkPtr::iterator i;
01995 
01996     while (matIt!=matEnd)
01997     {
01998         i = chunks2.find(*matIt);
01999 
02000         if (i == chunks2.end()) return false;
02001 
02002         ++matIt;
02003     }
02004 
02005     if(cm1->getState() == NullFC)
02006         cm1->rebuildState();
02007     if(cm2->getState() == NullFC)
02008         cm2->rebuildState();
02009     
02010     MFStateChunkPtr &statechunks1=cm1->getState()->getChunks();
02011     MFStateChunkPtr &statechunks2=cm2->getState()->getChunks();
02012 
02013     if (statechunks1.size()!=statechunks2.size()) return false;
02014 
02015     matIt  = statechunks1.begin();
02016     matEnd = statechunks1.end ();
02017 
02018     while (matIt!=matEnd)
02019     {
02020         i = statechunks2.find(*matIt);
02021 
02022         if (i == statechunks2.end()) return false;
02023 
02024         ++matIt;
02025     }
02026 
02027     return true;
02028 }

Int16 Geometry::MergeIndex ( const GeometryPtr  other  )  [protected]

Checks if geometry can be merged into this one. return -1 if merging is not possible. 0 - geometries are identical ( use merge0 ) 1 - ... 2 - ... 3 - ... ...

They need to have the same material and the same set of attributes.

Definition at line 2041 of file OSGGeometry.cpp.

References CompareMaterials(), osg::GeometryBase::getColors(), osg::GeometryBase::getIndexMapping(), osg::MaterialDrawableBase::getMaterial(), osg::GeometryBase::getNormals(), osg::GeometryBase::getSecondaryColors(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTexCoords2(), osg::GeometryBase::getTexCoords3(), osg::GeometryBase::getTexCoords4(), osg::GeometryBase::getTexCoords5(), osg::GeometryBase::getTexCoords6(), osg::GeometryBase::getTexCoords7(), osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by isMergeable(), and merge().

02042 {
02043     //if ( getMaterial() != other->getMaterial() ) return -1;
02044     if (!CompareMaterials(getMaterial(),other->getMaterial())) return -1;
02045 
02046 
02047     //compare the existing attributes
02048     if ( ( (        getNormals()            != NullFC ) ^
02049            ( other->getNormals()            != NullFC )
02050         ) ||
02051         ( (        getColors()              != NullFC ) ^
02052           ( other->getColors()              != NullFC )
02053         ) ||
02054         ( (        getSecondaryColors()     != NullFC ) ^
02055           ( other->getSecondaryColors()     != NullFC )
02056         ) ||
02057         ( (        getTexCoords()           != NullFC ) ^
02058           ( other->getTexCoords()           != NullFC )
02059         ) ||
02060         ( (        getTexCoords1()          != NullFC ) ^
02061           ( other->getTexCoords1()          != NullFC )
02062         ) ||
02063         ( (        getTexCoords2()          != NullFC ) ^
02064           ( other->getTexCoords2()          != NullFC )
02065         ) ||
02066         ( (        getTexCoords3()          != NullFC ) ^
02067           ( other->getTexCoords3()          != NullFC )
02068         ) ||
02069         ( (        getTexCoords4()          != NullFC ) ^
02070           ( other->getTexCoords4()          != NullFC )
02071         ) ||
02072         ( (        getTexCoords5()          != NullFC ) ^
02073           ( other->getTexCoords5()          != NullFC )
02074         ) ||
02075         ( (        getTexCoords6()          != NullFC ) ^
02076           ( other->getTexCoords6()          != NullFC )
02077         ) ||
02078         ( (        getTexCoords7()          != NullFC ) ^
02079           ( other->getTexCoords7()          != NullFC )
02080         ) )
02081         return -1;
02082 
02083     /*at this point the geometries should have
02084     the same material and attributes
02085     so they should be mergeable
02086     remains to check indexing.
02087     */
02088     UInt16 nmap  = getIndexMapping().size();
02089     UInt16 onmap = other->getIndexMapping().size();
02090 
02091     if ( nmap == onmap ) return 0;
02092     else
02093     {
02094         //non-indexed in single-indexed
02095         if ( nmap == 1 && onmap == 0 ) return 1;
02096         //single-indexed in non-indexed
02097         if ( nmap == 0 && onmap == 1 ) return 2;
02098 
02099         //non-indexed in multi-indexed
02100         if ( nmap > 1 && onmap == 0 ) return 3;
02101         //multi-indexed in non-indexed
02102         if ( nmap == 0 && onmap > 1 ) return 4;
02103 
02104         //single-indexed in multi-indexed
02105         if ( nmap > 1 && onmap == 1 ) return 5;
02106         //multi-indexed in single-indexed
02107         if ( nmap == 1 && onmap > 1 ) return 6;
02108     }
02109 
02110     //hmm...another case?
02111     return -1;
02112 }

void Geometry::merge0 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2194 of file OSGGeometry.cpp.

References osg::beginEditCP(), calcMappingIndex(), copyAllAttrib, osg::endEditCP(), osg::GeometryBase::getIndexMapping(), osg::GeometryBase::getIndices(), MapColor, MapNormal, MapPosition, MapSecondaryColor, MapTexCoords, MapTexCoords1, MapTexCoords2, MapTexCoords3, MapTexCoords4, MapTexCoords5, MapTexCoords6, MapTexCoords7, osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by merge().

02195 {
02196     UInt32 posBase = 0,typeBase = 0,lengthBase = 0,normalBase = 0,colorBase = 0,
02197            seccolorBase = 0,texcoordBase = 0,texcoord1Base = 0,texcoord2Base = 0,
02198            texcoord3Base = 0, texcoord4Base = 0, texcoord5Base = 0, texcoord6Base = 0,
02199            texcoord7Base = 0;
02200 
02201     // append the data
02202     UInt32 i;
02203 
02204     copyAllAttrib;
02205 
02206     if ( getIndices() != NullFC )
02207     {
02208         // indices
02209 
02210         GeoIndicesPtr ind  =        getIndices();
02211         GeoIndicesPtr oind = other->getIndices();
02212 
02213         beginEditCP( ind );
02214 
02215         UInt32 indBase = ind->getSize();
02216         ind->resize( indBase + oind->getSize() );
02217 
02218         // single index?
02219         if ( getIndexMapping().size() < 2 )
02220         {
02221             for ( i = 0; i < oind->getSize(); i++ )
02222                 ind->setValue( oind->getValue(i) + posBase, indBase + i );
02223         }
02224         else // multi-index
02225         {
02226             UInt32 * offsets = new UInt32 [ getIndexMapping().size() ];
02227             Int16 mind;
02228             UInt16 nmap = getIndexMapping().size();
02229             UInt16 j;
02230 
02231             if ( ( mind = calcMappingIndex( MapPosition ) ) >= 0 )
02232                 offsets[ mind ] = posBase;
02233 
02234             if ( ( mind = calcMappingIndex( MapNormal ) ) >= 0 )
02235                 offsets[ mind ] = normalBase;
02236 
02237             if ( ( mind = calcMappingIndex( MapColor ) ) >= 0 )
02238                 offsets[ mind ] = colorBase;
02239 
02240             if ( ( mind = calcMappingIndex( MapSecondaryColor ) ) >= 0 )
02241                 offsets[ mind ] = seccolorBase;
02242 
02243             if ( ( mind = calcMappingIndex( MapTexCoords ) ) >= 0 )
02244                 offsets[ mind ] = texcoordBase;
02245 
02246             if ( ( mind = calcMappingIndex( MapTexCoords1 ) ) >= 0 )
02247                 offsets[ mind ] = texcoord1Base;
02248 
02249             if ( ( mind = calcMappingIndex( MapTexCoords2 ) ) >= 0 )
02250                 offsets[ mind ] = texcoord2Base;
02251 
02252             if ( ( mind = calcMappingIndex( MapTexCoords3 ) ) >= 0 )
02253                 offsets[ mind ] = texcoord3Base;
02254 
02255             if ( ( mind = calcMappingIndex( MapTexCoords4 ) ) >= 0 )
02256                 offsets[ mind ] = texcoord4Base;
02257 
02258             if ( ( mind = calcMappingIndex( MapTexCoords5 ) ) >= 0 )
02259                 offsets[ mind ] = texcoord5Base;
02260 
02261             if ( ( mind = calcMappingIndex( MapTexCoords6 ) ) >= 0 )
02262                 offsets[ mind ] = texcoord6Base;
02263 
02264             if ( ( mind = calcMappingIndex( MapTexCoords7 ) ) >= 0 )
02265                 offsets[ mind ] = texcoord7Base;
02266 
02267             // bump every index by its offset
02268             for ( i = 0, j = 0; i < oind->getSize();
02269                 i++, j = ( j + 1 ) % nmap )
02270             {
02271                 ind->setValue(oind->getValue(i) + offsets[j],
02272                     indBase + i );
02273             }
02274 
02275             delete [] offsets;
02276         }
02277 
02278         endEditCP( ind );
02279     }
02280 }

void Geometry::merge1 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2284 of file OSGGeometry.cpp.

References osg::beginEditCP(), copyAllAttrib, osg::endEditCP(), and osg::GeometryBase::getIndices().

Referenced by merge().

02285 {
02286     UInt32 posBase,typeBase,lengthBase,normalBase,colorBase,
02287            seccolorBase,texcoordBase,texcoord1Base,texcoord2Base,
02288            texcoord3Base, texcoord4Base, texcoord5Base, texcoord6Base,
02289            texcoord7Base;
02290 
02291     UInt32 i;
02292 
02293     copyAllAttrib;
02294 
02295     GeoIndicesPtr ind = getIndices();
02296 
02297     UInt32 indBase = ind->getSize();
02298     ind->resize(indBase + other->getPositions()->getSize());
02299 
02300     beginEditCP(ind);
02301 
02302     for (i = 0; i < other->getPositions()->getSize(); i++ )
02303         ind->setValue( i + posBase, indBase + i );
02304 
02305     endEditCP( ind );
02306 }

void Geometry::merge2 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2310 of file OSGGeometry.cpp.

References osg::beginEditCP(), copyAllAttrib, osg::GeoProperty< GeoPropertyDesc >::create(), osg::endEditCP(), osg::GeoProperty< GeoPropertyDesc >::GeoPropDataFieldMask, osg::GeometryBase::IndicesFieldMask, and setIndices().

Referenced by merge().

02311 {
02312     UInt32 posBase,typeBase,lengthBase,normalBase,colorBase,
02313            seccolorBase,texcoordBase,texcoord1Base,texcoord2Base,
02314            texcoord3Base, texcoord4Base, texcoord5Base, texcoord6Base,
02315            texcoord7Base;
02316 
02317     UInt32 i;
02318 
02319     copyAllAttrib;
02320 
02321     GeoIndicesUI32Ptr indices = GeoIndicesUI32::create();
02322     beginEditCP(indices, GeoIndicesUI32::GeoPropDataFieldMask);
02323 
02324     indices->resize(posBase + other->getIndices()->getSize());
02325 
02326     for (i = 0; i < posBase; i++)
02327         indices->setValue(i, i);
02328 
02329     for (i = 0; i < other->getIndices()->getSize(); i++)
02330         indices->setValue(posBase + other->getIndices()->getValue(i), posBase + i);
02331 
02332     endEditCP  (indices, GeoIndicesUI32::GeoPropDataFieldMask);
02333 
02334     beginEditCP((GeometryPtr)this, Geometry::IndicesFieldMask);
02335 
02336     setIndices(indices);
02337 
02338     endEditCP((GeometryPtr)this, Geometry::IndicesFieldMask);
02339 }

void Geometry::merge3 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2342 of file OSGGeometry.cpp.

References osg::beginEditCP(), calcMappingIndex(), copyAllAttrib, osg::endEditCP(), osg::GeometryBase::getIndexMapping(), osg::GeometryBase::getIndices(), MapColor, MapNormal, MapPosition, MapSecondaryColor, MapTexCoords, MapTexCoords1, MapTexCoords2, MapTexCoords3, MapTexCoords4, MapTexCoords5, MapTexCoords6, MapTexCoords7, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by merge().

02343 {
02344     UInt32 posBase,typeBase,lengthBase,normalBase,colorBase,
02345            seccolorBase,texcoordBase,texcoord1Base,texcoord2Base,
02346            texcoord3Base, texcoord4Base, texcoord5Base, texcoord6Base,
02347            texcoord7Base;
02348 
02349     UInt32 i;
02350 
02351     copyAllAttrib;
02352 
02353     // indices
02354     GeoIndicesPtr ind = getIndices();
02355     UInt16 nmap = getIndexMapping().size();
02356     Int16 mind;
02357     UInt32 indBase = ind->getSize();
02358     ind->resize( indBase + other->getPositions()->getSize()*nmap );
02359 
02360     beginEditCP( ind );
02361 
02362     for (i = 0; i < other->getPositions()->getSize(); i++)
02363     {
02364         if ( ( mind = calcMappingIndex( MapPosition ) ) >= 0 )
02365             ind->setValue(posBase + i, indBase + i*nmap + mind);
02366 
02367         if ( ( mind = calcMappingIndex( MapNormal ) ) >= 0 )
02368             ind->setValue(normalBase + i, indBase + i*nmap + mind);
02369 
02370         if ( ( mind = calcMappingIndex( MapColor ) ) >= 0 )
02371             ind->setValue(colorBase + i, indBase + i*nmap + mind);
02372 
02373         if ( ( mind = calcMappingIndex( MapSecondaryColor ) ) >= 0 )
02374             ind->setValue(seccolorBase + i, indBase + i*nmap + mind);
02375 
02376         if ( ( mind = calcMappingIndex( MapTexCoords ) ) >= 0 )
02377             ind->setValue(texcoordBase + i, indBase + i*nmap + mind);
02378 
02379         if ( ( mind = calcMappingIndex( MapTexCoords1 ) ) >= 0 )
02380             ind->setValue(texcoord1Base + i, indBase + i*nmap + mind);
02381 
02382         if ( ( mind = calcMappingIndex( MapTexCoords2 ) ) >= 0 )
02383             ind->setValue(texcoord2Base + i, indBase + i*nmap + mind);
02384 
02385         if ( ( mind = calcMappingIndex( MapTexCoords3 ) ) >= 0 )
02386             ind->setValue(texcoord3Base + i, indBase + i*nmap + mind);
02387 
02388         if ( ( mind = calcMappingIndex( MapTexCoords4 ) ) >= 0 )
02389             ind->setValue(texcoord4Base + i, indBase + i*nmap + mind);
02390 
02391         if ( ( mind = calcMappingIndex( MapTexCoords5 ) ) >= 0 )
02392             ind->setValue(texcoord5Base + i, indBase + i*nmap + mind);
02393 
02394         if ( ( mind = calcMappingIndex( MapTexCoords6 ) ) >= 0 )
02395             ind->setValue(texcoord6Base + i, indBase + i*nmap + mind);
02396 
02397         if ( ( mind = calcMappingIndex( MapTexCoords7 ) ) >= 0 )
02398             ind->setValue(texcoord7Base + i, indBase + i*nmap + mind);
02399     }
02400 
02401     endEditCP( ind );
02402 }

void Geometry::merge4 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2406 of file OSGGeometry.cpp.

References osg::beginEditCP(), calcMappingIndex(), copyAllAttrib, osg::GeoProperty< GeoPropertyDesc >::create(), osg::endEditCP(), osg::GeoProperty< GeoPropertyDesc >::GeoPropDataFieldMask, osg::GeometryBase::IndicesFieldMask, MapColor, MapNormal, MapPosition, MapSecondaryColor, MapTexCoords, MapTexCoords1, MapTexCoords2, MapTexCoords3, MapTexCoords4, MapTexCoords5, MapTexCoords6, MapTexCoords7, and setIndices().

Referenced by merge().

02407 {
02408     UInt32 posBase = 0,typeBase = 0,lengthBase = 0,normalBase = 0,colorBase = 0,
02409            seccolorBase = 0,texcoordBase = 0,texcoord1Base = 0,texcoord2Base = 0,
02410            texcoord3Base = 0, texcoord4Base = 0, texcoord5Base = 0, texcoord6Base = 0,
02411            texcoord7Base = 0;
02412 
02413     UInt32 i;
02414 
02415     copyAllAttrib;
02416 
02417     GeoIndicesPtr oind = other->getIndices();
02418     UInt16 nmap = other->getIndexMapping().size();
02419     Int16 mind;
02420     GeoIndicesUI32Ptr indices = GeoIndicesUI32::create();
02421     beginEditCP(indices, GeoIndicesUI32::GeoPropDataFieldMask);
02422 
02423     indices->resize( posBase*nmap + oind->getSize() );
02424 
02425     for (i = 0; i < posBase; i++)
02426     {
02427         if ( ( mind = calcMappingIndex( MapPosition ) ) >= 0 )
02428             indices->setValue(i, i*nmap + mind);
02429 
02430         if ( ( mind = calcMappingIndex( MapNormal ) ) >= 0 )
02431             indices->setValue(i, i*nmap + mind);
02432 
02433         if ( ( mind = calcMappingIndex( MapColor ) ) >= 0 )
02434             indices->setValue(i, i*nmap + mind);
02435 
02436         if ( ( mind = calcMappingIndex( MapSecondaryColor ) ) >= 0 )
02437             indices->setValue(i, i*nmap + mind);
02438 
02439         if ( ( mind = calcMappingIndex( MapTexCoords ) ) >= 0 )
02440             indices->setValue(i, i*nmap + mind);
02441 
02442         if ( ( mind = calcMappingIndex( MapTexCoords1 ) ) >= 0 )
02443             indices->setValue(i, i*nmap + mind);
02444 
02445         if ( ( mind = calcMappingIndex( MapTexCoords2 ) ) >= 0 )
02446             indices->setValue(i, i*nmap + mind);
02447 
02448         if ( ( mind = calcMappingIndex( MapTexCoords3 ) ) >= 0 )
02449             indices->setValue(i, i*nmap + mind);
02450 
02451         if ( ( mind = calcMappingIndex( MapTexCoords4 ) ) >= 0 )
02452             indices->setValue(i, i*nmap + mind);
02453 
02454         if ( ( mind = calcMappingIndex( MapTexCoords5 ) ) >= 0 )
02455             indices->setValue(i, i*nmap + mind);
02456 
02457         if ( ( mind = calcMappingIndex( MapTexCoords6 ) ) >= 0 )
02458             indices->setValue(i, i*nmap + mind);
02459 
02460         if ( ( mind = calcMappingIndex( MapTexCoords7 ) ) >= 0 )
02461             indices->setValue(i, i*nmap + mind);
02462     }
02463 
02464     for (i = 0; i < other->getIndices()->getSize(); i++)
02465         indices->setValue(posBase*nmap + other->getIndices()->getValue(i), posBase*nmap + i);
02466 
02467     endEditCP  (indices, GeoIndicesUI32::GeoPropDataFieldMask);
02468 
02469     beginEditCP((GeometryPtr)this, Geometry::IndicesFieldMask);
02470 
02471     setIndices(indices);
02472 
02473     endEditCP((GeometryPtr)this, Geometry::IndicesFieldMask);
02474 }

void Geometry::merge5 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2477 of file OSGGeometry.cpp.

References osg::beginEditCP(), calcMappingIndex(), copyAllAttrib, osg::endEditCP(), osg::GeometryBase::getIndexMapping(), osg::GeometryBase::getIndices(), MapColor, MapNormal, MapPosition, MapSecondaryColor, MapTexCoords, MapTexCoords1, MapTexCoords2, MapTexCoords3, MapTexCoords4, MapTexCoords5, MapTexCoords6, MapTexCoords7, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by merge().

02478 {
02479     UInt32 posBase,typeBase,lengthBase,normalBase,colorBase,
02480            seccolorBase,texcoordBase,texcoord1Base,texcoord2Base,
02481            texcoord3Base, texcoord4Base, texcoord5Base, texcoord6Base,
02482            texcoord7Base;
02483 
02484     UInt32 i;
02485 
02486     copyAllAttrib;
02487 
02488     // indices
02489     GeoIndicesPtr ind = getIndices();
02490     GeoIndicesPtr oind = other->getIndices();
02491     UInt16 nmap = getIndexMapping().size();
02492     Int16 mind;
02493     UInt32 indBase = ind->getSize();
02494     ind->resize( indBase + oind->getSize()*nmap );
02495 
02496     beginEditCP( ind );
02497 
02498     for (i = 0; i < oind->getSize(); i++)
02499     {
02500         if ( ( mind = calcMappingIndex( MapPosition ) ) >= 0 )
02501             ind->setValue(posBase + oind->getValue(i), indBase + i*nmap + mind);
02502 
02503         if ( ( mind = calcMappingIndex( MapNormal ) ) >= 0 )
02504             ind->setValue(normalBase + oind->getValue(i), indBase + i*nmap + mind);
02505 
02506         if ( ( mind = calcMappingIndex( MapColor ) ) >= 0 )
02507             ind->setValue(colorBase + oind->getValue(i), indBase + i*nmap + mind);
02508 
02509         if ( ( mind = calcMappingIndex( MapSecondaryColor ) ) >= 0 )
02510             ind->setValue(seccolorBase + oind->getValue(i), indBase + i*nmap + mind);
02511 
02512         if ( ( mind = calcMappingIndex( MapTexCoords ) ) >= 0 )
02513             ind->setValue(texcoordBase + oind->getValue(i), indBase + i*nmap + mind);
02514 
02515         if ( ( mind = calcMappingIndex( MapTexCoords1 ) ) >= 0 )
02516             ind->setValue(texcoord1Base + oind->getValue(i), indBase + i*nmap + mind);
02517 
02518         if ( ( mind = calcMappingIndex( MapTexCoords2 ) ) >= 0 )
02519             ind->setValue(texcoord2Base + oind->getValue(i), indBase + i*nmap + mind);
02520 
02521         if ( ( mind = calcMappingIndex( MapTexCoords3 ) ) >= 0 )
02522             ind->setValue(texcoord3Base + oind->getValue(i), indBase + i*nmap + mind);
02523 
02524         if ( ( mind = calcMappingIndex( MapTexCoords4 ) ) >= 0 )
02525             ind->setValue(texcoord4Base + oind->getValue(i), indBase + i*nmap + mind);
02526 
02527         if ( ( mind = calcMappingIndex( MapTexCoords5 ) ) >= 0 )
02528             ind->setValue(texcoord5Base + oind->getValue(i), indBase + i*nmap + mind);
02529 
02530         if ( ( mind = calcMappingIndex( MapTexCoords6 ) ) >= 0 )
02531             ind->setValue(texcoord6Base + oind->getValue(i), indBase + i*nmap + mind);
02532 
02533         if ( ( mind = calcMappingIndex( MapTexCoords7 ) ) >= 0 )
02534             ind->setValue(texcoord7Base + oind->getValue(i), indBase + i*nmap + mind);
02535     }
02536 
02537     endEditCP( ind );
02538 }

void Geometry::merge6 ( const GeometryPtr  other  )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2542 of file OSGGeometry.cpp.

References osg::beginEditCP(), calcMappingIndex(), copyAllAttrib, osg::endEditCP(), osg::GeometryBase::getIndices(), MapColor, MapNormal, MapPosition, MapSecondaryColor, MapTexCoords, MapTexCoords1, MapTexCoords2, MapTexCoords3, MapTexCoords4, MapTexCoords5, MapTexCoords6, and MapTexCoords7.

Referenced by merge().

02543 {
02544     UInt32 posBase,typeBase,lengthBase,normalBase,colorBase,
02545            seccolorBase,texcoordBase,texcoord1Base,texcoord2Base,
02546            texcoord3Base, texcoord4Base, texcoord5Base, texcoord6Base,
02547            texcoord7Base;
02548 
02549     UInt32 i;
02550 
02551     copyAllAttrib;
02552 
02553     // indices
02554     GeoIndicesPtr ind = getIndices();
02555     GeoIndicesPtr indclone = getIndices()->clone();
02556     GeoIndicesPtr oind = other->getIndices();
02557     UInt16 nmap = other->getIndexMapping().size();
02558     Int16 mind;
02559     UInt32 indBase = ind->getSize();
02560     ind->resize( indBase*nmap + oind->getSize() );
02561 
02562     beginEditCP( ind );
02563 
02564     for (i = 0; i < indclone->getSize(); i++)
02565     {
02566         if ( ( mind = calcMappingIndex( MapPosition ) ) >= 0 )
02567             ind->setValue(indclone->getValue(i), i*nmap + mind);
02568 
02569         if ( ( mind = calcMappingIndex( MapNormal ) ) >= 0 )
02570             ind->setValue(indclone->getValue(i), i*nmap + mind);
02571 
02572         if ( ( mind = calcMappingIndex( MapColor ) ) >= 0 )
02573             ind->setValue(indclone->getValue(i), i*nmap + mind);
02574 
02575         if ( ( mind = calcMappingIndex( MapSecondaryColor ) ) >= 0 )
02576             ind->setValue(indclone->getValue(i), i*nmap + mind);
02577 
02578         if ( ( mind = calcMappingIndex( MapTexCoords ) ) >= 0 )
02579             ind->setValue(indclone->getValue(i), i*nmap + mind);
02580 
02581         if ( ( mind = calcMappingIndex( MapTexCoords1 ) ) >= 0 )
02582             ind->setValue(indclone->getValue(i), i*nmap + mind);
02583 
02584         if ( ( mind = calcMappingIndex( MapTexCoords2 ) ) >= 0 )
02585             ind->setValue(indclone->getValue(i), i*nmap + mind);
02586 
02587         if ( ( mind = calcMappingIndex( MapTexCoords3 ) ) >= 0 )
02588             ind->setValue(indclone->getValue(i), i*nmap + mind);
02589 
02590         if ( ( mind = calcMappingIndex( MapTexCoords4 ) ) >= 0 )
02591             ind->setValue(indclone->getValue(i), i*nmap + mind);
02592 
02593         if ( ( mind = calcMappingIndex( MapTexCoords5 ) ) >= 0 )
02594             ind->setValue(indclone->getValue(i), i*nmap + mind);
02595 
02596         if ( ( mind = calcMappingIndex( MapTexCoords6 ) ) >= 0 )
02597             ind->setValue(indclone->getValue(i), i*nmap + mind);
02598 
02599         if ( ( mind = calcMappingIndex( MapTexCoords7 ) ) >= 0 )
02600             ind->setValue(indclone->getValue(i), i*nmap + mind);
02601     }
02602 
02603     for (i = 0; i < oind->getSize(); i++)
02604         ind->setValue(oind->getValue(i), indBase*nmap + i);
02605 
02606     endEditCP( ind );
02607 }

bool Geometry::updateLowHighIndices ( void   )  [protected]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2610 of file OSGGeometry.cpp.

References osg::beginEditCP(), osg::endEditCP(), osg::GeometryBase::getHighindices(), osg::GeometryBase::getIndexMapping(), osg::GeometryBase::getIndices(), osg::GeometryBase::getLengths(), osg::GeometryBase::getLowindices(), osg::GeometryBase::getTypes(), osg::GeometryBase::HighindicesFieldMask, osg::GeometryBase::LowindicesFieldMask, osg::GeometryBase::MaxindexFieldMask, osg::GeometryBase::MinindexFieldMask, osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::resize(), osg::GeometryBase::setMaxindex(), and osg::GeometryBase::setMinindex().

Referenced by changed().

02611 {
02612     // Are we single-indexed or incomplete?
02613     if(getTypes  () == NullFC || getTypes  ()->size() == 0)
02614         return true;
02615 
02616     UInt32 primcount = getTypes()->size();
02617         
02618     if(getLengths() == NullFC || getLengths()->size() < primcount ||
02619        getIndices() == NullFC || getIndices()->size() == 0 ||
02620        getIndexMapping().size() > 1 
02621       )
02622         return true;
02623         
02624     GeoIndicesPtr indP = getIndices();
02625     
02626     UInt32 low, high, mini, maxi, cur;
02627     
02628     GeometryPtr self(this);
02629     beginEditCP(self, LowindicesFieldMask |
02630                       HighindicesFieldMask |
02631                       MinindexFieldMask |
02632                       MaxindexFieldMask);
02633                       
02634     
02635     getLowindices().resize(primcount);
02636     getHighindices().resize(primcount);
02637     mini = 0xffffffffU;
02638     maxi = 0;
02639 
02640     for (UInt32 i = 0, cur = 0; i < primcount; i++)
02641     {
02642         UInt32 l;
02643         getLengths()->getValue(l, i);
02644         
02645         low = 0xffffffffU;
02646         high = 0;
02647         
02648         for (UInt32 j = 0; j < l; ++j, ++cur)
02649         {
02650             if(cur >= indP->size())
02651                 break;
02652 
02653             UInt32 ind;
02654             indP->getValue(ind, cur);
02655             
02656             if(ind < low ) low  = ind;
02657             if(ind > high) high = ind;
02658             if(ind < mini) mini = ind;
02659             if(ind > maxi) maxi = ind;
02660         }
02661         
02662         getLowindices()[i]  = low;
02663         getHighindices()[i] = high;
02664     }
02665     
02666     setMinindex(mini);
02667     setMaxindex(maxi);
02668     
02669     endEditCP(self,   LowindicesFieldMask |
02670                       HighindicesFieldMask |
02671                       MinindexFieldMask |
02672                       MaxindexFieldMask);
02673     
02674     return false;
02675 }

void Geometry::initMethod ( void   )  [static, private]

void osg::Geometry::operator= ( const Geometry source  )  [private]

void Geometry::createVBO ( Window win,
UInt32  id 
) [private]

Definition at line 2677 of file OSGGeometry.cpp.

References _vbos, and osg::Window::setGLObjectId().

Referenced by handleGL(), and updateVBO().

02678 {
02679     // we create a index in the range of 1 -n 0 is reserved!
02680 
02681     if(_vbos.capacity() > _vbos.size())
02682     {
02683         _vbos.push_back(new GeoVBO(win, this));
02684         win->setGLObjectId(id + 1, _vbos.size());
02685         return;
02686     }
02687 
02688     // search for a empty one
02689     for(UInt32 i=0;i<_vbos.size();++i)
02690     {
02691         if(_vbos[i] == NULL)
02692         {
02693             _vbos[i] = new GeoVBO(win, this);
02694             win->setGLObjectId(id + 1, i + 1);
02695             return;
02696         }
02697     }
02698 
02699     _vbos.push_back(new GeoVBO(win, this));
02700     win->setGLObjectId(id + 1, _vbos.size());
02701 }

void Geometry::destroyVBO ( Window win,
UInt32  id 
) [private]

Definition at line 2703 of file OSGGeometry.cpp.

References _vbos, osg::Window::getGLObjectId(), and osg::Window::setGLObjectId().

Referenced by handleGL().

02704 {
02705     UInt32 i = win->getGLObjectId(id + 1);
02706 
02707     if(i == 0)
02708         return;
02709 
02710     --i;
02711 
02712     if(i < _vbos.size())
02713     {
02714         delete _vbos[i];
02715         _vbos[i] = NULL;
02716     }
02717     win->setGLObjectId(id + 1, 0);
02718 }

void Geometry::updateVBO ( Window win,
UInt32  id 
) [private]

Definition at line 2720 of file OSGGeometry.cpp.

References _vbos, createVBO(), osg::Window::getGLObjectId(), and osg::GeoVBO::update().

Referenced by handleGL().

02721 {
02722     UInt32 i = win->getGLObjectId(id + 1);
02723 
02724     if(i == 0) // invalid not created yet.
02725     {
02726         // create a new one.
02727         createVBO(win, id);
02728         return;
02729     }
02730 
02731     --i;
02732 
02733     if(i < _vbos.size())
02734     {
02735         GeoVBO *vbo = _vbos[i];
02736         if(vbo != NULL)
02737         {
02738             vbo->update();
02739         }
02740     }
02741 }

bool Geometry::drawVBO ( Window win,
UInt32  id 
) [private]

Definition at line 2743 of file OSGGeometry.cpp.

References _vbos, osg::GeoVBO::draw(), osg::Window::getGLObjectId(), and osg::Window::validateGLObject().

Referenced by drawPrimitives().

02744 {
02745     win->validateGLObject(id);
02746     UInt32 i = win->getGLObjectId(id + 1);
02747     if(i == 0)
02748     {
02749         // couldn't create a vbo in handleGL.
02750         return false;
02751     }
02752 
02753     --i;
02754 
02755     if(i < _vbos.size())
02756     {
02757         GeoVBO *vbo = _vbos[i];
02758         if(vbo != NULL)
02759             vbo->draw();
02760     }
02761     return true;
02762 }

osg::FieldContainerType & osg::GeometryBase::getClassType ( void   )  [inline, static, inherited]

osg::UInt32 osg::GeometryBase::getClassTypeId ( void   )  [inline, static, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 65 of file OSGGeometryBase.inl.

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

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

FieldContainerType & osg::GeometryBase::getType ( void   )  [virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 359 of file OSGGeometryBase.cpp.

References osg::GeometryBase::_type.

Referenced by dump().

00360 {
00361     return _type; 
00362 } 

const FieldContainerType & osg::GeometryBase::getType ( void   )  const [virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 364 of file OSGGeometryBase.cpp.

References osg::GeometryBase::_type.

00365 {
00366     return _type;
00367 } 

UInt32 osg::GeometryBase::getContainerSize ( void   )  const [virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 379 of file OSGGeometryBase.cpp.

00380 { 
00381     return sizeof(Geometry); 
00382 }

SFGeoPTypesPtr * osg::GeometryBase::getSFTypes ( void   )  [inline, inherited]

Definition at line 101 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTypes.

00102 {
00103     return &_sfTypes;
00104 }

SFGeoPLengthsPtr * osg::GeometryBase::getSFLengths ( void   )  [inline, inherited]

Definition at line 108 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfLengths.

00109 {
00110     return &_sfLengths;
00111 }

SFGeoPositionsPtr * osg::GeometryBase::getSFPositions ( void   )  [inline, inherited]

Definition at line 115 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfPositions.

00116 {
00117     return &_sfPositions;
00118 }

SFGeoNormalsPtr * osg::GeometryBase::getSFNormals ( void   )  [inline, inherited]

Definition at line 122 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfNormals.

00123 {
00124     return &_sfNormals;
00125 }

SFGeoColorsPtr * osg::GeometryBase::getSFColors ( void   )  [inline, inherited]

Definition at line 129 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfColors.

00130 {
00131     return &_sfColors;
00132 }

SFGeoColorsPtr * osg::GeometryBase::getSFSecondaryColors ( void   )  [inline, inherited]

Definition at line 136 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfSecondaryColors.

00137 {
00138     return &_sfSecondaryColors;
00139 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords ( void   )  [inline, inherited]

Definition at line 143 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords.

00144 {
00145     return &_sfTexCoords;
00146 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords1 ( void   )  [inline, inherited]

Definition at line 150 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords1.

00151 {
00152     return &_sfTexCoords1;
00153 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords2 ( void   )  [inline, inherited]

Definition at line 157 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords2.

00158 {
00159     return &_sfTexCoords2;
00160 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords3 ( void   )  [inline, inherited]

Definition at line 164 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords3.

00165 {
00166     return &_sfTexCoords3;
00167 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords4 ( void   )  [inline, inherited]

Definition at line 171 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords4.

00172 {
00173     return &_sfTexCoords4;
00174 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords5 ( void   )  [inline, inherited]

Definition at line 178 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords5.

00179 {
00180     return &_sfTexCoords5;
00181 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords6 ( void   )  [inline, inherited]

Definition at line 185 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords6.

00186 {
00187     return &_sfTexCoords6;
00188 }

SFGeoTexCoordsPtr * osg::GeometryBase::getSFTexCoords7 ( void   )  [inline, inherited]

Definition at line 192 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords7.

00193 {
00194     return &_sfTexCoords7;
00195 }

SFGeoIndicesPtr * osg::GeometryBase::getSFIndices ( void   )  [inline, inherited]

Definition at line 199 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfIndices.

00200 {
00201     return &_sfIndices;
00202 }

MFUInt16 * osg::GeometryBase::getMFIndexMapping ( void   )  [inline, inherited]

Definition at line 206 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfIndexMapping.

Referenced by clone(), and merge().

00207 {
00208     return &_mfIndexMapping;
00209 }

SFBool * osg::GeometryBase::getSFDlistCache ( void   )  [inline, inherited]

Definition at line 213 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfDlistCache.

00214 {
00215     return &_sfDlistCache;
00216 }

SFInt32 * osg::GeometryBase::getSFIgnoreGLForAspect ( void   )  [inline, inherited]

Definition at line 227 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfIgnoreGLForAspect.

00228 {
00229     return &_sfIgnoreGLForAspect;
00230 }

SFUInt32 * osg::GeometryBase::getSFMinindex ( void   )  [inline, inherited]

Definition at line 234 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMinindex.

00235 {
00236     return &_sfMinindex;
00237 }

SFUInt32 * osg::GeometryBase::getSFMaxindex ( void   )  [inline, inherited]

Definition at line 241 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMaxindex.

00242 {
00243     return &_sfMaxindex;
00244 }

MFUInt32 * osg::GeometryBase::getMFLowindices ( void   )  [inline, inherited]

Definition at line 248 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfLowindices.

00249 {
00250     return &_mfLowindices;
00251 }

MFUInt32 * osg::GeometryBase::getMFHighindices ( void   )  [inline, inherited]

Definition at line 255 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfHighindices.

00256 {
00257     return &_mfHighindices;
00258 }

SFBool * osg::GeometryBase::getSFVbo ( void   )  [inline, inherited]

Definition at line 262 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfVbo.

00263 {
00264     return &_sfVbo;
00265 }

GeoPTypesPtr & osg::GeometryBase::getTypes ( void   )  [inline, inherited]

const GeoPTypesPtr & osg::GeometryBase::getTypes ( void   )  const [inline, inherited]

Definition at line 277 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTypes, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00278 {
00279     return _sfTypes.getValue();
00280 }

GeoPLengthsPtr & osg::GeometryBase::getLengths ( void   )  [inline, inherited]

const GeoPLengthsPtr & osg::GeometryBase::getLengths ( void   )  const [inline, inherited]

Definition at line 298 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfLengths, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00299 {
00300     return _sfLengths.getValue();
00301 }

GeoPositionsPtr & osg::GeometryBase::getPositions ( void   )  [inline, inherited]

const GeoPositionsPtr & osg::GeometryBase::getPositions ( void   )  const [inline, inherited]

Definition at line 319 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfPositions, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00320 {
00321     return _sfPositions.getValue();
00322 }

GeoNormalsPtr & osg::GeometryBase::getNormals ( void   )  [inline, inherited]

const GeoNormalsPtr & osg::GeometryBase::getNormals ( void   )  const [inline, inherited]

Definition at line 340 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfNormals, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00341 {
00342     return _sfNormals.getValue();
00343 }

GeoColorsPtr & osg::GeometryBase::getColors ( void   )  [inline, inherited]

const GeoColorsPtr & osg::GeometryBase::getColors ( void   )  const [inline, inherited]

Definition at line 361 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfColors, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00362 {
00363     return _sfColors.getValue();
00364 }

GeoColorsPtr & osg::GeometryBase::getSecondaryColors ( void   )  [inline, inherited]

const GeoColorsPtr & osg::GeometryBase::getSecondaryColors ( void   )  const [inline, inherited]

Definition at line 382 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfSecondaryColors, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00383 {
00384     return _sfSecondaryColors.getValue();
00385 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords ( void   )  const [inline, inherited]

Definition at line 403 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00404 {
00405     return _sfTexCoords.getValue();
00406 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords1 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords1 ( void   )  const [inline, inherited]

Definition at line 424 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords1, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00425 {
00426     return _sfTexCoords1.getValue();
00427 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords2 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords2 ( void   )  const [inline, inherited]

Definition at line 445 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords2, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00446 {
00447     return _sfTexCoords2.getValue();
00448 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords3 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords3 ( void   )  const [inline, inherited]

Definition at line 466 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords3, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00467 {
00468     return _sfTexCoords3.getValue();
00469 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords4 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords4 ( void   )  const [inline, inherited]

Definition at line 487 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords4, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00488 {
00489     return _sfTexCoords4.getValue();
00490 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords5 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords5 ( void   )  const [inline, inherited]

Definition at line 508 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords5, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00509 {
00510     return _sfTexCoords5.getValue();
00511 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords6 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords6 ( void   )  const [inline, inherited]

Definition at line 529 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords6, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00530 {
00531     return _sfTexCoords6.getValue();
00532 }

GeoTexCoordsPtr & osg::GeometryBase::getTexCoords7 ( void   )  [inline, inherited]

const GeoTexCoordsPtr & osg::GeometryBase::getTexCoords7 ( void   )  const [inline, inherited]

Definition at line 550 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTexCoords7, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00551 {
00552     return _sfTexCoords7.getValue();
00553 }

GeoIndicesPtr & osg::GeometryBase::getIndices ( void   )  [inline, inherited]

const GeoIndicesPtr & osg::GeometryBase::getIndices ( void   )  const [inline, inherited]

Definition at line 571 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfIndices, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00572 {
00573     return _sfIndices.getValue();
00574 }

bool & osg::GeometryBase::getDlistCache ( void   )  [inline, inherited]

Definition at line 585 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfDlistCache, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by changed(), clone(), and drawPrimitives().

00586 {
00587     return _sfDlistCache.getValue();
00588 }

const bool & osg::GeometryBase::getDlistCache ( void   )  const [inline, inherited]

Definition at line 592 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfDlistCache, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00593 {
00594     return _sfDlistCache.getValue();
00595 }

Int32 & osg::GeometryBase::getIgnoreGLForAspect ( void   )  [inline, inherited]

Definition at line 627 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfIgnoreGLForAspect, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00628 {
00629     return _sfIgnoreGLForAspect.getValue();
00630 }

const Int32 & osg::GeometryBase::getIgnoreGLForAspect ( void   )  const [inline, inherited]

Definition at line 634 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfIgnoreGLForAspect, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00635 {
00636     return _sfIgnoreGLForAspect.getValue();
00637 }

UInt32 & osg::GeometryBase::getMinindex ( void   )  [inline, inherited]

Definition at line 648 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMinindex, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by GeoPump129().

00649 {
00650     return _sfMinindex.getValue();
00651 }

const UInt32 & osg::GeometryBase::getMinindex ( void   )  const [inline, inherited]

Definition at line 655 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMinindex, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00656 {
00657     return _sfMinindex.getValue();
00658 }

UInt32 & osg::GeometryBase::getMaxindex ( void   )  [inline, inherited]

Definition at line 669 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMaxindex, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by GeoPump129().

00670 {
00671     return _sfMaxindex.getValue();
00672 }

const UInt32 & osg::GeometryBase::getMaxindex ( void   )  const [inline, inherited]

Definition at line 676 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMaxindex, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00677 {
00678     return _sfMaxindex.getValue();
00679 }

bool & osg::GeometryBase::getVbo ( void   )  [inline, inherited]

Definition at line 690 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfVbo, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by changed(), drawPrimitives(), and handleGL().

00691 {
00692     return _sfVbo.getValue();
00693 }

const bool & osg::GeometryBase::getVbo ( void   )  const [inline, inherited]

Definition at line 697 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfVbo, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00698 {
00699     return _sfVbo.getValue();
00700 }

UInt16 & osg::GeometryBase::getIndexMapping ( const UInt32  index  )  [inline, inherited]

Definition at line 712 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfIndexMapping.

Referenced by osg::GeoPumpFactory::getIndex(), and osg::GeoPumpFactory::masterGeoPump().

00713 {
00714     return _mfIndexMapping[index];
00715 }

MFUInt16 & osg::GeometryBase::getIndexMapping ( void   )  [inline, inherited]

const MFUInt16 & osg::GeometryBase::getIndexMapping ( void   )  const [inline, inherited]

Definition at line 726 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfIndexMapping.

00727 {
00728     return _mfIndexMapping;
00729 }

UInt32 & osg::GeometryBase::getLowindices ( const UInt32  index  )  [inline, inherited]

Definition at line 733 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfLowindices.

Referenced by osg::GeoVBO::draw(), and GeoPump129().

00734 {
00735     return _mfLowindices[index];
00736 }

MFUInt32 & osg::GeometryBase::getLowindices ( void   )  [inline, inherited]

Definition at line 740 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfLowindices.

Referenced by updateLowHighIndices().

00741 {
00742     return _mfLowindices;
00743 }

const MFUInt32 & osg::GeometryBase::getLowindices ( void   )  const [inline, inherited]

Definition at line 747 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfLowindices.

00748 {
00749     return _mfLowindices;
00750 }

UInt32 & osg::GeometryBase::getHighindices ( const UInt32  index  )  [inline, inherited]

Definition at line 754 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfHighindices.

Referenced by osg::GeoVBO::draw(), and GeoPump129().

00755 {
00756     return _mfHighindices[index];
00757 }

MFUInt32 & osg::GeometryBase::getHighindices ( void   )  [inline, inherited]

Definition at line 761 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfHighindices.

Referenced by updateLowHighIndices().

00762 {
00763     return _mfHighindices;
00764 }

const MFUInt32 & osg::GeometryBase::getHighindices ( void   )  const [inline, inherited]

Definition at line 768 of file OSGGeometryBase.inl.

References osg::GeometryBase::_mfHighindices.

00769 {
00770     return _mfHighindices;
00771 }

void osg::GeometryBase::setTypes ( const GeoPTypesPtr value  )  [inline, inherited]

Definition at line 284 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfTypes, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00285 {
00286     _sfTypes.setValue(value);
00287 }

void osg::GeometryBase::setLengths ( const GeoPLengthsPtr value  )  [inline, inherited]

Definition at line 305 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfLengths, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00306 {
00307     _sfLengths.setValue(value);
00308 }

void osg::GeometryBase::setIndices ( const GeoIndicesPtr value  )  [inline, inherited]

Definition at line 578 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfIndices, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00579 {
00580     _sfIndices.setValue(value);
00581 }

void osg::GeometryBase::setDlistCache ( const bool &  value  )  [inline, inherited]

Definition at line 599 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfDlistCache, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by merge().

00600 {
00601     _sfDlistCache.setValue(value);
00602 }

void osg::GeometryBase::setIgnoreGLForAspect ( const Int32 value  )  [inline, inherited]

void osg::GeometryBase::setMinindex ( const UInt32 value  )  [inline, inherited]

Definition at line 662 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMinindex, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by updateLowHighIndices().

00663 {
00664     _sfMinindex.setValue(value);
00665 }

void osg::GeometryBase::setMaxindex ( const UInt32 value  )  [inline, inherited]

Definition at line 683 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfMaxindex, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by updateLowHighIndices().

00684 {
00685     _sfMaxindex.setValue(value);
00686 }

void osg::GeometryBase::setVbo ( const bool &  value  )  [inline, inherited]

Definition at line 704 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfVbo, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00705 {
00706     _sfVbo.setValue(value);
00707 }

UInt32 osg::GeometryBase::getBinSize ( const BitVector whichField  )  [virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 490 of file OSGGeometryBase.cpp.

References osg::GeometryBase::_mfHighindices, osg::GeometryBase::_mfIndexMapping, osg::GeometryBase::_mfLowindices, osg::GeometryBase::_sfColors, osg::GeometryBase::_sfDlistCache, osg::GeometryBase::_sfGLId, osg::GeometryBase::_sfIgnoreGLForAspect, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::GeometryBase::_sfMaxindex, osg::GeometryBase::_sfMinindex, osg::GeometryBase::_sfNormals, osg::GeometryBase::_sfPositions, osg::GeometryBase::_sfSecondaryColors, osg::GeometryBase::_sfTexCoords, osg::GeometryBase::_sfTexCoords1, osg::GeometryBase::_sfTexCoords2, osg::GeometryBase::_sfTexCoords3, osg::GeometryBase::_sfTexCoords4, osg::GeometryBase::_sfTexCoords5, osg::GeometryBase::_sfTexCoords6, osg::GeometryBase::_sfTexCoords7, osg::GeometryBase::_sfTypes, osg::GeometryBase::_sfVbo, osg::GeometryBase::ColorsFieldMask, osg::GeometryBase::DlistCacheFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::MaterialDrawableBase::getBinSize(), osg::GeometryBase::GLIdFieldMask, osg::GeometryBase::HighindicesFieldMask, osg::GeometryBase::IgnoreGLForAspectFieldMask, osg::GeometryBase::IndexMappingFieldMask, osg::GeometryBase::IndicesFieldMask, osg::GeometryBase::LengthsFieldMask, osg::GeometryBase::LowindicesFieldMask, osg::GeometryBase::MaxindexFieldMask, osg::GeometryBase::MinindexFieldMask, osg::FieldBits::NoField, osg::GeometryBase::NormalsFieldMask, osg::GeometryBase::PositionsFieldMask, osg::GeometryBase::SecondaryColorsFieldMask, osg::GeometryBase::TexCoords1FieldMask, osg::GeometryBase::TexCoords2FieldMask, osg::GeometryBase::TexCoords3FieldMask, osg::GeometryBase::TexCoords4FieldMask, osg::GeometryBase::TexCoords5FieldMask, osg::GeometryBase::TexCoords6FieldMask, osg::GeometryBase::TexCoords7FieldMask, osg::GeometryBase::TexCoordsFieldMask, osg::GeometryBase::TypesFieldMask, and osg::GeometryBase::VboFieldMask.

Referenced by osg::SurfaceBase::getBinSize(), and osg::DVRGeometryBase::getBinSize().

00491 {
00492     UInt32 returnValue = Inherited::getBinSize(whichField);
00493 
00494     if(FieldBits::NoField != (TypesFieldMask & whichField))
00495     {
00496         returnValue += _sfTypes.getBinSize();
00497     }
00498 
00499     if(FieldBits::NoField != (LengthsFieldMask & whichField))
00500     {
00501         returnValue += _sfLengths.getBinSize();
00502     }
00503 
00504     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00505     {
00506         returnValue += _sfPositions.getBinSize();
00507     }
00508 
00509     if(FieldBits::NoField != (NormalsFieldMask & whichField))
00510     {
00511         returnValue += _sfNormals.getBinSize();
00512     }
00513 
00514     if(FieldBits::NoField != (ColorsFieldMask & whichField))
00515     {
00516         returnValue += _sfColors.getBinSize();
00517     }
00518 
00519     if(FieldBits::NoField != (SecondaryColorsFieldMask & whichField))
00520     {
00521         returnValue += _sfSecondaryColors.getBinSize();
00522     }
00523 
00524     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00525     {
00526         returnValue += _sfTexCoords.getBinSize();
00527     }
00528 
00529     if(FieldBits::NoField != (TexCoords1FieldMask & whichField))
00530     {
00531         returnValue += _sfTexCoords1.getBinSize();
00532     }
00533 
00534     if(FieldBits::NoField != (TexCoords2FieldMask & whichField))
00535     {
00536         returnValue += _sfTexCoords2.getBinSize();
00537     }
00538 
00539     if(FieldBits::NoField != (TexCoords3FieldMask & whichField))
00540     {
00541         returnValue += _sfTexCoords3.getBinSize();
00542     }
00543 
00544     if(FieldBits::NoField != (TexCoords4FieldMask & whichField))
00545     {
00546         returnValue += _sfTexCoords4.getBinSize();
00547     }
00548 
00549     if(FieldBits::NoField != (TexCoords5FieldMask & whichField))
00550     {
00551         returnValue += _sfTexCoords5.getBinSize();
00552     }
00553 
00554     if(FieldBits::NoField != (TexCoords6FieldMask & whichField))
00555     {
00556         returnValue += _sfTexCoords6.getBinSize();
00557     }
00558 
00559     if(FieldBits::NoField != (TexCoords7FieldMask & whichField))
00560     {
00561         returnValue += _sfTexCoords7.getBinSize();
00562     }
00563 
00564     if(FieldBits::NoField != (IndicesFieldMask & whichField))
00565     {
00566         returnValue += _sfIndices.getBinSize();
00567     }
00568 
00569     if(FieldBits::NoField != (IndexMappingFieldMask & whichField))
00570     {
00571         returnValue += _mfIndexMapping.getBinSize();
00572     }
00573 
00574     if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
00575     {
00576         returnValue += _sfDlistCache.getBinSize();
00577     }
00578 
00579     if(FieldBits::NoField != (GLIdFieldMask & whichField))
00580     {
00581         returnValue += _sfGLId.getBinSize();
00582     }
00583 
00584     if(FieldBits::NoField != (IgnoreGLForAspectFieldMask & whichField))
00585     {
00586         returnValue += _sfIgnoreGLForAspect.getBinSize();
00587     }
00588 
00589     if(FieldBits::NoField != (MinindexFieldMask & whichField))
00590     {
00591         returnValue += _sfMinindex.getBinSize();
00592     }
00593 
00594     if(FieldBits::NoField != (MaxindexFieldMask & whichField))
00595     {
00596         returnValue += _sfMaxindex.getBinSize();
00597     }
00598 
00599     if(FieldBits::NoField != (LowindicesFieldMask & whichField))
00600     {
00601         returnValue += _mfLowindices.getBinSize();
00602     }
00603 
00604     if(FieldBits::NoField != (HighindicesFieldMask & whichField))
00605     {
00606         returnValue += _mfHighindices.getBinSize();
00607     }
00608 
00609     if(FieldBits::NoField != (VboFieldMask & whichField))
00610     {
00611         returnValue += _sfVbo.getBinSize();
00612     }
00613 
00614 
00615     return returnValue;
00616 }

void osg::GeometryBase::copyToBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 618 of file OSGGeometryBase.cpp.

References osg::GeometryBase::_mfHighindices, osg::GeometryBase::_mfIndexMapping, osg::GeometryBase::_mfLowindices, osg::GeometryBase::_sfColors, osg::GeometryBase::_sfDlistCache, osg::GeometryBase::_sfGLId, osg::GeometryBase::_sfIgnoreGLForAspect, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::GeometryBase::_sfMaxindex, osg::GeometryBase::_sfMinindex, osg::GeometryBase::_sfNormals, osg::GeometryBase::_sfPositions, osg::GeometryBase::_sfSecondaryColors, osg::GeometryBase::_sfTexCoords, osg::GeometryBase::_sfTexCoords1, osg::GeometryBase::_sfTexCoords2, osg::GeometryBase::_sfTexCoords3, osg::GeometryBase::_sfTexCoords4, osg::GeometryBase::_sfTexCoords5, osg::GeometryBase::_sfTexCoords6, osg::GeometryBase::_sfTexCoords7, osg::GeometryBase::_sfTypes, osg::GeometryBase::_sfVbo, osg::GeometryBase::ColorsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::MaterialDrawableBase::copyToBin(), osg::GeometryBase::DlistCacheFieldMask, osg::GeometryBase::GLIdFieldMask, osg::GeometryBase::HighindicesFieldMask, osg::GeometryBase::IgnoreGLForAspectFieldMask, osg::GeometryBase::IndexMappingFieldMask, osg::GeometryBase::IndicesFieldMask, osg::GeometryBase::LengthsFieldMask, osg::GeometryBase::LowindicesFieldMask, osg::GeometryBase::MaxindexFieldMask, osg::GeometryBase::MinindexFieldMask, osg::FieldBits::NoField, osg::GeometryBase::NormalsFieldMask, osg::GeometryBase::PositionsFieldMask, osg::GeometryBase::SecondaryColorsFieldMask, osg::GeometryBase::TexCoords1FieldMask, osg::GeometryBase::TexCoords2FieldMask, osg::GeometryBase::TexCoords3FieldMask, osg::GeometryBase::TexCoords4FieldMask, osg::GeometryBase::TexCoords5FieldMask, osg::GeometryBase::TexCoords6FieldMask, osg::GeometryBase::TexCoords7FieldMask, osg::GeometryBase::TexCoordsFieldMask, osg::GeometryBase::TypesFieldMask, and osg::GeometryBase::VboFieldMask.

Referenced by osg::SurfaceBase::copyToBin(), and osg::DVRGeometryBase::copyToBin().

00620 {
00621     Inherited::copyToBin(pMem, whichField);
00622 
00623     if(FieldBits::NoField != (TypesFieldMask & whichField))
00624     {
00625         _sfTypes.copyToBin(pMem);
00626     }
00627 
00628     if(FieldBits::NoField != (LengthsFieldMask & whichField))
00629     {
00630         _sfLengths.copyToBin(pMem);
00631     }
00632 
00633     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00634     {
00635         _sfPositions.copyToBin(pMem);
00636     }
00637 
00638     if(FieldBits::NoField != (NormalsFieldMask & whichField))
00639     {
00640         _sfNormals.copyToBin(pMem);
00641     }
00642 
00643     if(FieldBits::NoField != (ColorsFieldMask & whichField))
00644     {
00645         _sfColors.copyToBin(pMem);
00646     }
00647 
00648     if(FieldBits::NoField != (SecondaryColorsFieldMask & whichField))
00649     {
00650         _sfSecondaryColors.copyToBin(pMem);
00651     }
00652 
00653     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00654     {
00655         _sfTexCoords.copyToBin(pMem);
00656     }
00657 
00658     if(FieldBits::NoField != (TexCoords1FieldMask & whichField))
00659     {
00660         _sfTexCoords1.copyToBin(pMem);
00661     }
00662 
00663     if(FieldBits::NoField != (TexCoords2FieldMask & whichField))
00664     {
00665         _sfTexCoords2.copyToBin(pMem);
00666     }
00667 
00668     if(FieldBits::NoField != (TexCoords3FieldMask & whichField))
00669     {
00670         _sfTexCoords3.copyToBin(pMem);
00671     }
00672 
00673     if(FieldBits::NoField != (TexCoords4FieldMask & whichField))
00674     {
00675         _sfTexCoords4.copyToBin(pMem);
00676     }
00677 
00678     if(FieldBits::NoField != (TexCoords5FieldMask & whichField))
00679     {
00680         _sfTexCoords5.copyToBin(pMem);
00681     }
00682 
00683     if(FieldBits::NoField != (TexCoords6FieldMask & whichField))
00684     {
00685         _sfTexCoords6.copyToBin(pMem);
00686     }
00687 
00688     if(FieldBits::NoField != (TexCoords7FieldMask & whichField))
00689     {
00690         _sfTexCoords7.copyToBin(pMem);
00691     }
00692 
00693     if(FieldBits::NoField != (IndicesFieldMask & whichField))
00694     {
00695         _sfIndices.copyToBin(pMem);
00696     }
00697 
00698     if(FieldBits::NoField != (IndexMappingFieldMask & whichField))
00699     {
00700         _mfIndexMapping.copyToBin(pMem);
00701     }
00702 
00703     if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
00704     {
00705         _sfDlistCache.copyToBin(pMem);
00706     }
00707 
00708     if(FieldBits::NoField != (GLIdFieldMask & whichField))
00709     {
00710         _sfGLId.copyToBin(pMem);
00711     }
00712 
00713     if(FieldBits::NoField != (IgnoreGLForAspectFieldMask & whichField))
00714     {
00715         _sfIgnoreGLForAspect.copyToBin(pMem);
00716     }
00717 
00718     if(FieldBits::NoField != (MinindexFieldMask & whichField))
00719     {
00720         _sfMinindex.copyToBin(pMem);
00721     }
00722 
00723     if(FieldBits::NoField != (MaxindexFieldMask & whichField))
00724     {
00725         _sfMaxindex.copyToBin(pMem);
00726     }
00727 
00728     if(FieldBits::NoField != (LowindicesFieldMask & whichField))
00729     {
00730         _mfLowindices.copyToBin(pMem);
00731     }
00732 
00733     if(FieldBits::NoField != (HighindicesFieldMask & whichField))
00734     {
00735         _mfHighindices.copyToBin(pMem);
00736     }
00737 
00738     if(FieldBits::NoField != (VboFieldMask & whichField))
00739     {
00740         _sfVbo.copyToBin(pMem);
00741     }
00742 
00743 
00744 }

void osg::GeometryBase::copyFromBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 746 of file OSGGeometryBase.cpp.

References osg::GeometryBase::_mfHighindices, osg::GeometryBase::_mfIndexMapping, osg::GeometryBase::_mfLowindices, osg::GeometryBase::_sfColors, osg::GeometryBase::_sfDlistCache, osg::GeometryBase::_sfGLId, osg::GeometryBase::_sfIgnoreGLForAspect, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::GeometryBase::_sfMaxindex, osg::GeometryBase::_sfMinindex, osg::GeometryBase::_sfNormals, osg::GeometryBase::_sfPositions, osg::GeometryBase::_sfSecondaryColors, osg::GeometryBase::_sfTexCoords, osg::GeometryBase::_sfTexCoords1, osg::GeometryBase::_sfTexCoords2, osg::GeometryBase::_sfTexCoords3, osg::GeometryBase::_sfTexCoords4, osg::GeometryBase::_sfTexCoords5, osg::GeometryBase::_sfTexCoords6, osg::GeometryBase::_sfTexCoords7, osg::GeometryBase::_sfTypes, osg::GeometryBase::_sfVbo, osg::GeometryBase::ColorsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::MaterialDrawableBase::copyFromBin(), osg::GeometryBase::DlistCacheFieldMask, osg::GeometryBase::GLIdFieldMask, osg::GeometryBase::HighindicesFieldMask, osg::GeometryBase::IgnoreGLForAspectFieldMask, osg::GeometryBase::IndexMappingFieldMask, osg::GeometryBase::IndicesFieldMask, osg::GeometryBase::LengthsFieldMask, osg::GeometryBase::LowindicesFieldMask, osg::GeometryBase::MaxindexFieldMask, osg::GeometryBase::MinindexFieldMask, osg::FieldBits::NoField, osg::GeometryBase::NormalsFieldMask, osg::GeometryBase::PositionsFieldMask, osg::GeometryBase::SecondaryColorsFieldMask, osg::GeometryBase::TexCoords1FieldMask, osg::GeometryBase::TexCoords2FieldMask, osg::GeometryBase::TexCoords3FieldMask, osg::GeometryBase::TexCoords4FieldMask, osg::GeometryBase::TexCoords5FieldMask, osg::GeometryBase::TexCoords6FieldMask, osg::GeometryBase::TexCoords7FieldMask, osg::GeometryBase::TexCoordsFieldMask, osg::GeometryBase::TypesFieldMask, and osg::GeometryBase::VboFieldMask.

Referenced by osg::SurfaceBase::copyFromBin(), and osg::DVRGeometryBase::copyFromBin().

00748 {
00749     Inherited::copyFromBin(pMem, whichField);
00750 
00751     if(FieldBits::NoField != (TypesFieldMask & whichField))
00752     {
00753         _sfTypes.copyFromBin(pMem);
00754     }
00755 
00756     if(FieldBits::NoField != (LengthsFieldMask & whichField))
00757     {
00758         _sfLengths.copyFromBin(pMem);
00759     }
00760 
00761     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00762     {
00763         _sfPositions.copyFromBin(pMem);
00764     }
00765 
00766     if(FieldBits::NoField != (NormalsFieldMask & whichField))
00767     {
00768         _sfNormals.copyFromBin(pMem);
00769     }
00770 
00771     if(FieldBits::NoField != (ColorsFieldMask & whichField))
00772     {
00773         _sfColors.copyFromBin(pMem);
00774     }
00775 
00776     if(FieldBits::NoField != (SecondaryColorsFieldMask & whichField))
00777     {
00778         _sfSecondaryColors.copyFromBin(pMem);
00779     }
00780 
00781     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00782     {
00783         _sfTexCoords.copyFromBin(pMem);
00784     }
00785 
00786     if(FieldBits::NoField != (TexCoords1FieldMask & whichField))
00787     {
00788         _sfTexCoords1.copyFromBin(pMem);
00789     }
00790 
00791     if(FieldBits::NoField != (TexCoords2FieldMask & whichField))
00792     {
00793         _sfTexCoords2.copyFromBin(pMem);
00794     }
00795 
00796     if(FieldBits::NoField != (TexCoords3FieldMask & whichField))
00797     {
00798         _sfTexCoords3.copyFromBin(pMem);
00799     }
00800 
00801     if(FieldBits::NoField != (TexCoords4FieldMask & whichField))
00802     {
00803         _sfTexCoords4.copyFromBin(pMem);
00804     }
00805 
00806     if(FieldBits::NoField != (TexCoords5FieldMask & whichField))
00807     {
00808         _sfTexCoords5.copyFromBin(pMem);
00809     }
00810 
00811     if(FieldBits::NoField != (TexCoords6FieldMask & whichField))
00812     {
00813         _sfTexCoords6.copyFromBin(pMem);
00814     }
00815 
00816     if(FieldBits::NoField != (TexCoords7FieldMask & whichField))
00817     {
00818         _sfTexCoords7.copyFromBin(pMem);
00819     }
00820 
00821     if(FieldBits::NoField != (IndicesFieldMask & whichField))
00822     {
00823         _sfIndices.copyFromBin(pMem);
00824     }
00825 
00826     if(FieldBits::NoField != (IndexMappingFieldMask & whichField))
00827     {
00828         _mfIndexMapping.copyFromBin(pMem);
00829     }
00830 
00831     if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
00832     {
00833         _sfDlistCache.copyFromBin(pMem);
00834     }
00835 
00836     if(FieldBits::NoField != (GLIdFieldMask & whichField))
00837     {
00838         _sfGLId.copyFromBin(pMem);
00839     }
00840 
00841     if(FieldBits::NoField != (IgnoreGLForAspectFieldMask & whichField))
00842     {
00843         _sfIgnoreGLForAspect.copyFromBin(pMem);
00844     }
00845 
00846     if(FieldBits::NoField != (MinindexFieldMask & whichField))
00847     {
00848         _sfMinindex.copyFromBin(pMem);
00849     }
00850 
00851     if(FieldBits::NoField != (MaxindexFieldMask & whichField))
00852     {
00853         _sfMaxindex.copyFromBin(pMem);
00854     }
00855 
00856     if(FieldBits::NoField != (LowindicesFieldMask & whichField))
00857     {
00858         _mfLowindices.copyFromBin(pMem);
00859     }
00860 
00861     if(FieldBits::NoField != (HighindicesFieldMask & whichField))
00862     {
00863         _mfHighindices.copyFromBin(pMem);
00864     }
00865 
00866     if(FieldBits::NoField != (VboFieldMask & whichField))
00867     {
00868         _sfVbo.copyFromBin(pMem);
00869     }
00870 
00871 
00872 }

GeometryPtr osg::GeometryBase::create ( void   )  [inline, static, inherited]

GeometryPtr osg::GeometryBase::createEmpty ( void   )  [inline, static, inherited]

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 87 of file OSGGeometryBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr osg::GeometryBase::shallowCopy ( void   )  const [virtual, inherited]

Implements osg::FieldContainer.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 370 of file OSGGeometryBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by osg::GeometryBase::create().

00371 { 
00372     GeometryPtr returnValue; 
00373 
00374     newPtr(returnValue, dynamic_cast<const Geometry *>(this)); 
00375 
00376     return returnValue; 
00377 }

SFInt32 * osg::GeometryBase::getSFGLId ( void   )  [inline, protected, inherited]

Definition at line 220 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfGLId.

00221 {
00222     return &_sfGLId;
00223 }

Int32 & osg::GeometryBase::getGLId ( void   )  [inline, protected, inherited]

Definition at line 606 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfGLId, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by changed(), drawPrimitives(), invalidateDlistCache(), and onDestroy().

00607 {
00608     return _sfGLId.getValue();
00609 }

const Int32 & osg::GeometryBase::getGLId ( void   )  const [inline, protected, inherited]

Definition at line 613 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfGLId, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00614 {
00615     return _sfGLId.getValue();
00616 }

void osg::GeometryBase::setGLId ( const Int32 value  )  [inline, protected, inherited]

Definition at line 620 of file OSGGeometryBase.inl.

References osg::GeometryBase::_sfGLId, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by changed(), and onCreate().

00621 {
00622     _sfGLId.setValue(value);
00623 }

void osg::GeometryBase::executeSyncImpl ( GeometryBase pOther,
const BitVector whichField 
) [protected, inherited]

Definition at line 875 of file OSGGeometryBase.cpp.

References osg::GeometryBase::_mfHighindices, osg::GeometryBase::_mfIndexMapping, osg::GeometryBase::_mfLowindices, osg::GeometryBase::_sfColors, osg::GeometryBase::_sfDlistCache, osg::GeometryBase::_sfGLId, osg::GeometryBase::_sfIgnoreGLForAspect, osg::GeometryBase::_sfIndices, osg::GeometryBase::_sfLengths, osg::GeometryBase::_sfMaxindex, osg::GeometryBase::_sfMinindex, osg::GeometryBase::_sfNormals, osg::GeometryBase::_sfPositions, osg::GeometryBase::_sfSecondaryColors, osg::GeometryBase::_sfTexCoords, osg::GeometryBase::_sfTexCoords1, osg::GeometryBase::_sfTexCoords2, osg::GeometryBase::_sfTexCoords3, osg::GeometryBase::_sfTexCoords4, osg::GeometryBase::_sfTexCoords5, osg::GeometryBase::_sfTexCoords6, osg::GeometryBase::_sfTexCoords7, osg::GeometryBase::_sfTypes, osg::GeometryBase::_sfVbo, osg::GeometryBase::ColorsFieldMask, osg::GeometryBase::DlistCacheFieldMask, osg::MaterialDrawableBase::executeSyncImpl(), osg::GeometryBase::GLIdFieldMask, osg::GeometryBase::HighindicesFieldMask, osg::GeometryBase::IgnoreGLForAspectFieldMask, osg::GeometryBase::IndexMappingFieldMask, osg::GeometryBase::IndicesFieldMask, osg::GeometryBase::LengthsFieldMask, osg::GeometryBase::LowindicesFieldMask, osg::GeometryBase::MaxindexFieldMask, osg::GeometryBase::MinindexFieldMask, osg::FieldBits::NoField, osg::GeometryBase::NormalsFieldMask, osg::GeometryBase::PositionsFieldMask, osg::GeometryBase::SecondaryColorsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), osg::GeometryBase::TexCoords1FieldMask, osg::GeometryBase::TexCoords2FieldMask, osg::GeometryBase::TexCoords3FieldMask, osg::GeometryBase::TexCoords4FieldMask, osg::GeometryBase::TexCoords5FieldMask, osg::GeometryBase::TexCoords6FieldMask, osg::GeometryBase::TexCoords7FieldMask, osg::GeometryBase::TexCoordsFieldMask, osg::GeometryBase::TypesFieldMask, and osg::GeometryBase::VboFieldMask.

Referenced by osg::GeometryBase::executeSync(), osg::SurfaceBase::executeSyncImpl(), and osg::DVRGeometryBase::executeSyncImpl().

00877 {
00878 
00879     Inherited::executeSyncImpl(pOther, whichField);
00880 
00881     if(FieldBits::NoField != (TypesFieldMask & whichField))
00882         _sfTypes.syncWith(pOther->_sfTypes);
00883 
00884     if(FieldBits::NoField != (LengthsFieldMask & whichField))
00885         _sfLengths.syncWith(pOther->_sfLengths);
00886 
00887     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00888         _sfPositions.syncWith(pOther->_sfPositions);
00889 
00890     if(FieldBits::NoField != (NormalsFieldMask & whichField))
00891         _sfNormals.syncWith(pOther->_sfNormals);
00892 
00893     if(FieldBits::NoField != (ColorsFieldMask & whichField))
00894         _sfColors.syncWith(pOther->_sfColors);
00895 
00896     if(FieldBits::NoField != (SecondaryColorsFieldMask & whichField))
00897         _sfSecondaryColors.syncWith(pOther->_sfSecondaryColors);
00898 
00899     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00900         _sfTexCoords.syncWith(pOther->_sfTexCoords);
00901 
00902     if(FieldBits::NoField != (TexCoords1FieldMask & whichField))
00903         _sfTexCoords1.syncWith(pOther->_sfTexCoords1);
00904 
00905     if(FieldBits::NoField != (TexCoords2FieldMask & whichField))
00906         _sfTexCoords2.syncWith(pOther->_sfTexCoords2);
00907 
00908     if(FieldBits::NoField != (TexCoords3FieldMask & whichField))
00909         _sfTexCoords3.syncWith(pOther->_sfTexCoords3);
00910 
00911     if(FieldBits::NoField != (TexCoords4FieldMask & whichField))
00912         _sfTexCoords4.syncWith(pOther->_sfTexCoords4);
00913 
00914     if(FieldBits::NoField != (TexCoords5FieldMask & whichField))
00915         _sfTexCoords5.syncWith(pOther->_sfTexCoords5);
00916 
00917     if(FieldBits::NoField != (TexCoords6FieldMask & whichField))
00918         _sfTexCoords6.syncWith(pOther->_sfTexCoords6);
00919 
00920     if(FieldBits::NoField != (TexCoords7FieldMask & whichField))
00921         _sfTexCoords7.syncWith(pOther->_sfTexCoords7);
00922 
00923     if(FieldBits::NoField != (IndicesFieldMask & whichField))
00924         _sfIndices.syncWith(pOther->_sfIndices);
00925 
00926     if(FieldBits::NoField != (IndexMappingFieldMask & whichField))
00927         _mfIndexMapping.syncWith(pOther->_mfIndexMapping);
00928 
00929     if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
00930         _sfDlistCache.syncWith(pOther->_sfDlistCache);
00931 
00932     if(FieldBits::NoField != (GLIdFieldMask & whichField))
00933         _sfGLId.syncWith(pOther->_sfGLId);
00934 
00935     if(FieldBits::NoField != (IgnoreGLForAspectFieldMask & whichField))
00936         _sfIgnoreGLForAspect.syncWith(pOther->_sfIgnoreGLForAspect);
00937 
00938     if(FieldBits::NoField != (MinindexFieldMask & whichField))
00939         _sfMinindex.syncWith(pOther->_sfMinindex);
00940 
00941     if(FieldBits::NoField != (MaxindexFieldMask & whichField))
00942         _sfMaxindex.syncWith(pOther->_sfMaxindex);
00943 
00944     if(FieldBits::NoField != (LowindicesFieldMask & whichField))
00945         _mfLowindices.syncWith(pOther->_mfLowindices);
00946 
00947     if(FieldBits::NoField != (HighindicesFieldMask & whichField))
00948         _mfHighindices.syncWith(pOther->_mfHighindices);
00949 
00950     if(FieldBits::NoField != (VboFieldMask & whichField))
00951         _sfVbo.syncWith(pOther->_sfVbo);
00952 
00953 
00954 }

void MaterialDrawableBase::executeSyncImpl ( MaterialDrawableBase pOther,
const BitVector whichField 
) [protected, inherited]

void DrawableBase::executeSyncImpl ( DrawableBase pOther,
const BitVector whichField 
) [protected, inherited]

Definition at line 182 of file OSGDrawableBase.cpp.

References osg::NodeCore::executeSyncImpl().

Referenced by osg::DrawableBase::executeSync(), and osg::MaterialDrawableBase::executeSyncImpl().

00184 {
00185 
00186     Inherited::executeSyncImpl(pOther, whichField);
00187 
00188 
00189 }

void osg::NodeCore::executeSyncImpl ( NodeCore pOther,
const BitVector whichField 
) [inline, protected, inherited]

void AttachmentContainer::executeSyncImpl ( AttachmentContainer pOther,
const BitVector whichField 
) [protected, inherited]

void osg::FieldContainer::executeSyncImpl ( FieldContainer pOther,
const BitVector whichField 
) [inline, protected, inherited]

void osg::GeometryBase::executeSync ( FieldContainer other,
const BitVector whichField 
) [protected, virtual, inherited]

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 386 of file OSGGeometryBase.cpp.

References osg::GeometryBase::executeSyncImpl().

00388 {
00389     this->executeSyncImpl((GeometryBase *) &other, whichField);
00390 }

Action::ResultE MaterialDrawable::drawActionHandler ( Action action  )  [inherited]

Definition at line 122 of file OSGMaterialDrawable.cpp.

References osg::Action::Continue, osg::Material::draw(), osg::MaterialDrawable::drawPrimitives(), FWARNING, osg::getDefaultMaterial(), osg::MaterialDrawableBase::getMaterial(), osg::DrawActionBase::getMaterial(), osg::NullFC, and osg::osgTypedMethodFunctor1ObjPtr().

Referenced by osg::Surface::initMethod(), osg::Slices::initMethod(), osg::Particles::initMethod(), and initMethod().

00123 {
00124     DrawAction *a = dynamic_cast<DrawAction*>(action);
00125     Material::DrawFunctor func;
00126 
00127     func=osgTypedMethodFunctor1ObjPtr(&(*this), 
00128                                       &MaterialDrawable::drawPrimitives);
00129 
00130     if(a->getMaterial() != NULL)
00131     {
00132         a->getMaterial()->draw(func, a);
00133     }
00134     else if ( getMaterial() != NullFC )
00135     {
00136         getMaterial()->draw( func, a );
00137     }
00138     else
00139     {
00140         getDefaultMaterial()->draw( func, a );
00141         FWARNING(("MaterialDrawable::draw:: no material!\n"));;
00142     }
00143     return Action::Continue;
00144 }

Action::ResultE MaterialDrawable::renderActionHandler ( Action action  )  [inherited]

Definition at line 94 of file OSGMaterialDrawable.cpp.

References osg::Action::Continue, osg::MaterialDrawable::drawPrimitives(), osg::RenderAction::dropFunctor(), FNOTICE, osg::AttachmentContainerPtr::getCPtr(), osg::getDefaultMaterial(), osg::MaterialDrawableBase::getMaterial(), osg::DrawActionBase::getMaterial(), osg::NullFC, and osg::osgTypedMethodFunctor1ObjPtr().

Referenced by osg::Surface::initMethod(), osg::Slices::initMethod(), osg::Particles::initMethod(), and initMethod().

00095 {
00096     RenderAction *a = dynamic_cast<RenderAction *>(action);
00097 
00098     Material::DrawFunctor func;
00099     func = osgTypedMethodFunctor1ObjPtr(this, 
00100                                         &MaterialDrawable::drawPrimitives);
00101 
00102     Material* m = a->getMaterial();
00103 
00104     if(m == NULL)
00105     {
00106         if(getMaterial() != NullFC)
00107         {
00108             m = getMaterial().getCPtr();
00109         }
00110         else
00111         {
00112             m = getDefaultMaterial().getCPtr();
00113             FNOTICE(("MaterialDrawable::render: no Material!?!\n"));
00114         }
00115     }
00116 
00117     a->dropFunctor(func, m);
00118 
00119     return Action::Continue;
00120 }

SFMaterialPtr * osg::MaterialDrawableBase::getSFMaterial ( void   )  [inline, inherited]

Definition at line 75 of file OSGMaterialDrawableBase.inl.

References osg::MaterialDrawableBase::_sfMaterial.

00076 {
00077     return &_sfMaterial;
00078 }

MaterialPtr & osg::MaterialDrawableBase::getMaterial ( void   )  [inline, inherited]

const MaterialPtr & osg::MaterialDrawableBase::getMaterial ( void   )  const [inline, inherited]

Definition at line 90 of file OSGMaterialDrawableBase.inl.

References osg::MaterialDrawableBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00091 {
00092     return _sfMaterial.getValue();
00093 }

MFNodePtr & osg::NodeCore::getParents ( void   )  [inline, inherited]

Definition at line 56 of file OSGNodeCore.inl.

Referenced by osg::Surface::FindClosestPoint().

00057 {
00058     return _parents;
00059 }

const MFNodePtr & osg::NodeCore::getParents ( void   )  const [inline, inherited]

Definition at line 62 of file OSGNodeCore.inl.

References osg::NodeCore::_parents.

00063 {
00064     return _parents;
00065 }

MFNodePtr * osg::NodeCore::getMFParents ( void   )  [inline, inherited]

Definition at line 68 of file OSGNodeCore.inl.

References osg::NodeCore::_parents.

00069 {
00070     return &_parents;
00071 }

void osg::NodeCore::invalidateVolume ( void   )  [inline, virtual, inherited]

Definition at line 237 of file OSGNodeCore.inl.

References osg::NodeCore::_parents, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by osg::Transform::changed(), and osg::Slices::changed().

00238 {
00239     for(UInt32 i = 0; i < _parents.size(); i++)
00240     {
00241         _parents[i]->invalidateVolume();
00242     }
00243 }

void osg::NodeCore::addParent ( const NodePtr parent  )  [inline, protected, inherited]

Definition at line 150 of file OSGNodeCore.inl.

References osg::NodeCore::_parents, and osg::MField< FieldTypeT, fieldNameSpace >::push_back().

00151 {
00152     _parents.push_back(parent);
00153 }

void osg::NodeCore::subParent ( const NodePtr parent  )  [inline, protected, inherited]

Definition at line 156 of file OSGNodeCore.inl.

References osg::NodeCore::_parents, osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), and osg::MField< FieldTypeT, fieldNameSpace >::find().

00157 {
00158     MFNodePtr::iterator parentIt = _parents.find(parent);
00159 
00160     if(parentIt != _parents.end())
00161     {
00162         _parents.erase(parentIt);
00163     }
00164 }

AttachmentContainerPtr AttachmentContainer::getPtr ( void   )  [protected, inherited]

void osg::NodeCore::accumulateMatrix ( Matrix result  )  [inline, protected, virtual, inherited]

Reimplemented in osg::Billboard, osg::InverseTransform, osg::ScreenGroup, and osg::Transform.

Definition at line 224 of file OSGNodeCore.inl.

00225 {
00226 }

void AttachmentContainer::addAttachment ( const AttachmentPtr fieldContainerP,
UInt16  binding = 0 
) [inherited]

Definition at line 84 of file OSGAttachmentContainer.cpp.

References osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, and osg::subRefCP().

Referenced by osg::AttachmentContainer::AttachmentContainer(), osg::Node::onCreate(), and osg::Image::setAttachmentField().

00086 {
00087     UInt32 key;
00088 
00089     if(fieldContainerP == NullFC)
00090         return;
00091 
00092     key = (UInt32 (fieldContainerP->getGroupId()) << 16) | binding;
00093 
00094     addRefCP(fieldContainerP);
00095 
00096     beginEditCP(fieldContainerP, Attachment::ParentsFieldMask);
00097     {
00098         fieldContainerP->addParent(getPtr());
00099     }
00100     endEditCP  (fieldContainerP, Attachment::ParentsFieldMask);
00101 
00102     AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key);
00103 
00104     if(fcI != _attachmentMap.getValue().end())
00105     {
00106         beginEditCP((*fcI).second, Attachment::ParentsFieldMask);
00107         {
00108             (*fcI).second->subParent(getPtr());
00109         }
00110         endEditCP  ((*fcI).second, Attachment::ParentsFieldMask);
00111 
00112         subRefCP((*fcI).second);
00113 
00114         (*fcI).second = fieldContainerP;
00115     }
00116     else
00117     {
00118         _attachmentMap.getValue()[key] = fieldContainerP;
00119     }
00120 }

void AttachmentContainer::subAttachment ( const AttachmentPtr fieldContainerP,
UInt16  binding = 0 
) [inherited]

Definition at line 122 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::beginEditCP(), osg::endEditCP(), osg::AttachmentContainer::getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, and osg::subRefCP().

00124 {
00125     UInt32 key;
00126 
00127     AttachmentMap::iterator fcI;
00128 
00129     if(fieldContainerP == NullFC)
00130         return;
00131 
00132     key = (UInt32(fieldContainerP->getGroupId()) << 16) | binding;
00133 
00134     fcI = _attachmentMap.getValue().find(key);
00135 
00136     if(fcI != _attachmentMap.getValue().end())
00137     {
00138         beginEditCP(fieldContainerP, Attachment::ParentsFieldMask);
00139         {
00140             (*fcI).second->subParent(getPtr());
00141         }
00142         endEditCP  (fieldContainerP, Attachment::ParentsFieldMask);
00143 
00144         subRefCP((*fcI).second);
00145 
00146         _attachmentMap.getValue().erase(fcI);
00147     }
00148 }

AttachmentPtr AttachmentContainer::findAttachment ( UInt32  groupId,
UInt16  binding = 0 
) [inherited]

Definition at line 150 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::NullFC.

Referenced by osg::Image::findAttachmentField(), and osg::Image::setAttachmentField().

00152 {
00153     UInt32 key = (UInt32(groupId) << 16) | binding;
00154 
00155     AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key);
00156 
00157     if(fcI == _attachmentMap.getValue().end())
00158     {
00159         return NullFC;
00160     }
00161     else
00162     {
00163         return (*fcI).second;
00164     }
00165 }

AttachmentPtr osg::AttachmentContainer::findAttachment ( const FieldContainerType type,
UInt16  binding = 0 
) [inline, inherited]

Definition at line 57 of file OSGAttachmentContainerImpl.inl.

00060 {
00061     return findAttachment(type.getGroupId(), binding);
00062 }

SFAttachmentMap * AttachmentContainer::getSFAttachments ( void   )  [inherited]

Field Access

Definition at line 170 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap.

00171 {
00172     return &_attachmentMap;
00173 }

UInt16 osg::FieldContainer::getClassGroupId ( void   )  [inline, static, inherited]

Definition at line 71 of file OSGFieldContainerImpl.inl.

References osg::FieldContainer::_type, and osg::FieldContainerType::getGroupId().

00072 {
00073     return _type.getGroupId();
00074 }

UInt32 osg::FieldContainer::getTypeId ( void   )  const [inline, inherited]

Definition at line 77 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getId(), and osg::FieldContainer::getType().

Referenced by osg::TextureChunk::changeFrom(), and osg::CubeTextureChunk::changeFrom().

00078 {
00079     return getType().getId();
00080 }

UInt16 osg::FieldContainer::getGroupId ( void   )  const [inline, inherited]

const Char8 * osg::FieldContainer::getTypeName ( void   )  const [inline, inherited]

Definition at line 89 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getCName(), and osg::FieldContainer::getType().

00090 {
00091     return getType().getCName();
00092 }

Field * osg::FieldContainer::getField ( UInt32  fieldId  )  [inline, inherited]

Generic Field Access

Definition at line 95 of file OSGFieldContainerImpl.inl.

References osg::FieldDescription::getField(), osg::FieldContainerType::getFieldDescription(), and osg::FieldContainer::getType().

Referenced by osg::QFCItem::expand(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::QFieldViewBase::getFieldPtr(), osg::QFieldEditorBase::getFieldPtr(), osg::getParentsField(), and osg::QFCItem::setup().

00096 {
00097     const FieldDescription *desc = getType().getFieldDescription(fieldId);
00098 
00099     return desc ? desc->getField(*this) : NULL;
00100 }

Field * osg::FieldContainer::getField ( const Char8 fieldName  )  [inline, inherited]

Generic Field Access

Definition at line 103 of file OSGFieldContainerImpl.inl.

References osg::FieldContainerType::findFieldDescription(), osg::FieldDescription::getField(), and osg::FieldContainer::getType().

00104 {
00105     const FieldDescription *desc =getType().findFieldDescription(fieldName);
00106 
00107     return desc ? desc->getField(*this) : NULL;
00108 }

template<class ObjectPtrT>
void osg::FieldContainer::newPtr ( ObjectPtrT &  result,
const typename ObjectPtrT::StoredObjectType *  prototypeP 
) [inline, static, protected, inherited]

Definition at line 138 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

Referenced by osg::XWindowBase::createEmpty(), osg::WIN32WindowBase::createEmpty(), osg::ViewportBase::createEmpty(), osg::VertexProgramChunkBase::createEmpty(), osg::TwoSidedLightingChunkBase::createEmpty(), osg::TransformChunkBase::createEmpty(), osg::TransformBase::createEmpty(), osg::TileCameraDecoratorBase::createEmpty(), osg::TextureTransformChunkBase::createEmpty(), osg::TextureGrabForegroundBase::createEmpty(), osg::TextureGrabBackgroundBase::createEmpty(), osg::TextureChunkBase::createEmpty(), osg::TextureBackgroundBase::createEmpty(), osg::TexGenChunkBase::createEmpty(), osg::SwitchMaterialBase::createEmpty(), osg::SwitchBase::createEmpty(), osg::SurfaceBase::createEmpty(), osg::StringAttributeMapBase::createEmpty(), osg::StereoBufferViewportBase::createEmpty(), osg::StencilChunkBase::createEmpty(), osg::StateSortingGroupBase::createEmpty(), osg::StateBase::createEmpty(), osg::SpotLightBase::createEmpty(), osg::SortFirstWindowBase::createEmpty(), osg::SolidBackgroundBase::createEmpty(), osg::SlicesBase::createEmpty(), osg::SkyBackgroundBase::createEmpty(), osg::SimpleTexturedMaterialBase::createEmpty(), osg::SimpleStatisticsForegroundBase::createEmpty(), osg::SimpleMaterialBase::createEmpty(), osg::SHLParameterChunkBase::createEmpty(), osg::SHLChunkBase::createEmpty(), osg::ShearedStereoCameraDecoratorBase::createEmpty(), osg::ShaderParameterVec4fBase::createEmpty(), osg::ShaderParameterVec3fBase::createEmpty(), osg::ShaderParameterVec2fBase::createEmpty(), osg::ShaderParameterStringBase::createEmpty(), osg::ShaderParameterRealBase::createEmpty(), osg::ShaderParameterMVec4fBase::createEmpty(), osg::ShaderParameterMVec3fBase::createEmpty(), osg::ShaderParameterMVec2fBase::createEmpty(), osg::ShaderParameterMRealBase::createEmpty(), osg::ShaderParameterMMatrixBase::createEmpty(), osg::ShaderParameterMIntBase::createEmpty(), osg::ShaderParameterMatrixBase::createEmpty(), osg::ShaderParameterIntBase::createEmpty(), osg::ShaderParameterBoolBase::createEmpty(), osg::ScreenGroupBase::createEmpty(), osg::SClipPlaneChunkBase::createEmpty(), osg::ResolutionDisplayFilterBase::createEmpty(), osg::RenderOptionsBase::createEmpty(), osg::RegisterCombinersChunkBase::createEmpty(), osg::QTWindowBase::createEmpty(), osg::ProxyGroupBase::createEmpty(), osg::ProjectionCameraDecoratorBase::createEmpty(), osg::PolygonForegroundBase::createEmpty(), osg::PolygonChunkBase::createEmpty(), osg::PolygonBackgroundBase::createEmpty(), osg::PointLightBase::createEmpty(), osg::PointChunkBase::createEmpty(), osg::PhongMaterialBase::createEmpty(), osg::PerspectiveCameraBase::createEmpty(), osg::PassiveWindowBase::createEmpty(), osg::PassiveViewportBase::createEmpty(), osg::PassiveBackgroundBase::createEmpty(), osg::ParticlesBase::createEmpty(), osg::OrthographicCameraBase::createEmpty(), osg::OffCenterPerspectiveCameraBase::createEmpty(), osg::MultiPassMaterialBase::createEmpty(), osg::MultiDisplayWindowBase::createEmpty(), osg::MatrixCameraDecoratorBase::createEmpty(), osg::MatrixCameraBase::createEmpty(), osg::MaterialPoolBase::createEmpty(), osg::MaterialGroupBase::createEmpty(), osg::MaterialChunkBase::createEmpty(), osg::LogicOpChunkBase::createEmpty(), osg::LineChunkBase::createEmpty(), osg::LightModelChunkBase::createEmpty(), osg::LightEnvBase::createEmpty(), osg::LightChunkBase::createEmpty(), osg::InverseTransformBase::createEmpty(), osg::InlineBase::createEmpty(), osg::ImageForegroundBase::createEmpty(), osg::ImageBase::createEmpty(), osg::ImageBackgroundBase::createEmpty(), osg::GroupBase::createEmpty(), osg::GraphicStatisticsForegroundBase::createEmpty(), osg::GradientBackgroundBase::createEmpty(), osg::GrabForegroundBase::createEmpty(), osg::GLUTWindowBase::createEmpty(), osg::GeometryBase::createEmpty(), osg::FresnelMaterialBase::createEmpty(), osg::FragmentProgramChunkBase::createEmpty(), osg::FileGrabForegroundBase::createEmpty(), osg::FCPtrAttributeMapBase::createEmpty(), osg::FBOViewportBase::createEmpty(), osg::FatBorderChunkBase::createEmpty(), osg::DVRVolumeTextureBase::createEmpty(), osg::DVRVolumeBase::createEmpty(), osg::DVRSimpleShaderBase::createEmpty(), osg::DVRSimpleLUTShaderBase::createEmpty(), osg::DVRMtexLUTShaderBase::createEmpty(), osg::DVRLookupTableBase::createEmpty(), osg::DVRIsoSurfaceBase::createEmpty(), osg::DVRIsoShaderBase::createEmpty(), osg::DVRGeometryBase::createEmpty(), osg::DVRClipObjectsBase::createEmpty(), osg::DVRClipGeometryBase::createEmpty(), osg::DVRAppearanceBase::createEmpty(), osg::DistortionDisplayFilterBase::createEmpty(), osg::DistanceLODBase::createEmpty(), osg::DisplayFilterForegroundBase::createEmpty(), osg::DisplayCalibrationBase::createEmpty(), osg::DirectionalLightBase::createEmpty(), osg::DepthClearBackgroundBase::createEmpty(), osg::DepthChunkBase::createEmpty(), osg::CubeTextureChunkBase::createEmpty(), osg::ComponentTransformBase::createEmpty(), osg::ColorMaskChunkBase::createEmpty(), osg::ColorDisplayFilterBase::createEmpty(), osg::ColorBufferViewportBase::createEmpty(), osg::ClusterWindowBase::createEmpty(), osg::ClipPlaneChunkBase::createEmpty(), osg::ClipPlaneBase::createEmpty(), osg::ChunkMaterialBase::createEmpty(), osg::BlendChunkBase::createEmpty(), osg::BillboardBase::createEmpty(), osg::XWindowBase::shallowCopy(), osg::WIN32WindowBase::shallowCopy(), osg::ViewportBase::shallowCopy(), osg::VertexProgramChunkBase::shallowCopy(), osg::TwoSidedLightingChunkBase::shallowCopy(), osg::TransformChunkBase::shallowCopy(), osg::TransformBase::shallowCopy(), osg::TileCameraDecoratorBase::shallowCopy(), osg::TextureTransformChunkBase::shallowCopy(), osg::TextureGrabForegroundBase::shallowCopy(), osg::TextureGrabBackgroundBase::shallowCopy(), osg::TextureChunkBase::shallowCopy(), osg::TextureBackgroundBase::shallowCopy(), osg::TexGenChunkBase::shallowCopy(), osg::SwitchMaterialBase::shallowCopy(), osg::SwitchBase::shallowCopy(), osg::SurfaceBase::shallowCopy(), osg::StringAttributeMapBase::shallowCopy(), osg::StereoBufferViewportBase::shallowCopy(), osg::StencilChunkBase::shallowCopy(), osg::StateSortingGroupBase::shallowCopy(), osg::StateBase::shallowCopy(), osg::SpotLightBase::shallowCopy(), osg::SortFirstWindowBase::shallowCopy(), osg::SolidBackgroundBase::shallowCopy(), osg::SlicesBase::shallowCopy(), osg::SkyBackgroundBase::shallowCopy(), osg::SimpleTexturedMaterialBase::shallowCopy(), osg::SimpleStatisticsForegroundBase::shallowCopy(), osg::SimpleMaterialBase::shallowCopy(), osg::SHLParameterChunkBase::shallowCopy(), osg::SHLChunkBase::shallowCopy(), osg::ShearedStereoCameraDecoratorBase::shallowCopy(), osg::ShaderParameterVec4fBase::shallowCopy(), osg::ShaderParameterVec3fBase::shallowCopy(), osg::ShaderParameterVec2fBase::shallowCopy(), osg::ShaderParameterStringBase::shallowCopy(), osg::ShaderParameterRealBase::shallowCopy(), osg::ShaderParameterMVec4fBase::shallowCopy(), osg::ShaderParameterMVec3fBase::shallowCopy(), osg::ShaderParameterMVec2fBase::shallowCopy(), osg::ShaderParameterMRealBase::shallowCopy(), osg::ShaderParameterMMatrixBase::shallowCopy(), osg::ShaderParameterMIntBase::shallowCopy(), osg::ShaderParameterMatrixBase::shallowCopy(), osg::ShaderParameterIntBase::shallowCopy(), osg::ShaderParameterBoolBase::shallowCopy(), osg::ScreenGroupBase::shallowCopy(), osg::SClipPlaneChunkBase::shallowCopy(), osg::ResolutionDisplayFilterBase::shallowCopy(), osg::RenderOptionsBase::shallowCopy(), osg::RegisterCombinersChunkBase::shallowCopy(), osg::QTWindowBase::shallowCopy(), osg::ProxyGroupBase::shallowCopy(), osg::ProjectionCameraDecoratorBase::shallowCopy(), osg::PolygonForegroundBase::shallowCopy(), osg::PolygonChunkBase::shallowCopy(), osg::PolygonBackgroundBase::shallowCopy(), osg::PointLightBase::shallowCopy(), osg::PointChunkBase::shallowCopy(), osg::PhongMaterialBase::shallowCopy(), osg::PerspectiveCameraBase::shallowCopy(), osg::PassiveWindowBase::shallowCopy(), osg::PassiveViewportBase::shallowCopy(), osg::PassiveBackgroundBase::shallowCopy(), osg::ParticlesBase::shallowCopy(), osg::OrthographicCameraBase::shallowCopy(), osg::OffCenterPerspectiveCameraBase::shallowCopy(), osg::MultiPassMaterialBase::shallowCopy(), osg::MultiDisplayWindowBase::shallowCopy(), osg::MatrixCameraDecoratorBase::shallowCopy(), osg::MatrixCameraBase::shallowCopy(), osg::MaterialPoolBase::shallowCopy(), osg::MaterialGroupBase::shallowCopy(), osg::MaterialChunkBase::shallowCopy(), osg::LogicOpChunkBase::shallowCopy(), osg::LineChunkBase::shallowCopy(), osg::LightModelChunkBase::shallowCopy(), osg::LightEnvBase::shallowCopy(), osg::LightChunkBase::shallowCopy(), osg::InverseTransformBase::shallowCopy(), osg::InlineBase::shallowCopy(), osg::ImageForegroundBase::shallowCopy(), osg::ImageBase::shallowCopy(), osg::ImageBackgroundBase::shallowCopy(), osg::GroupBase::shallowCopy(), osg::GraphicStatisticsForegroundBase::shallowCopy(), osg::GradientBackgroundBase::shallowCopy(), osg::GrabForegroundBase::shallowCopy(), osg::GLUTWindowBase::shallowCopy(), osg::GeometryBase::shallowCopy(), osg::FresnelMaterialBase::shallowCopy(), osg::FragmentProgramChunkBase::shallowCopy(), osg::FileGrabForegroundBase::shallowCopy(), osg::FCPtrAttributeMapBase::shallowCopy(), osg::FBOViewportBase::shallowCopy(), osg::FatBorderChunkBase::shallowCopy(), osg::DVRVolumeTextureBase::shallowCopy(), osg::DVRVolumeBase::shallowCopy(), osg::DVRSimpleShaderBase::shallowCopy(), osg::DVRSimpleLUTShaderBase::shallowCopy(), osg::DVRMtexLUTShaderBase::shallowCopy(), osg::DVRLookupTableBase::shallowCopy(), osg::DVRIsoSurfaceBase::shallowCopy(), osg::DVRIsoShaderBase::shallowCopy(), osg::DVRGeometryBase::shallowCopy(), osg::DVRClipObjectsBase::shallowCopy(), osg::DVRClipGeometryBase::shallowCopy(), osg::DVRAppearanceBase::shallowCopy(), osg::DistortionDisplayFilterBase::shallowCopy(), osg::DistanceLODBase::shallowCopy(), osg::DisplayFilterForegroundBase::shallowCopy(), osg::DisplayCalibrationBase::shallowCopy(), osg::DirectionalLightBase::shallowCopy(), osg::DepthClearBackgroundBase::shallowCopy(), osg::DepthChunkBase::shallowCopy(), osg::CubeTextureChunkBase::shallowCopy(), osg::ComponentTransformBase::shallowCopy(), osg::ColorMaskChunkBase::shallowCopy(), osg::ColorDisplayFilterBase::shallowCopy(), osg::ColorBufferViewportBase::shallowCopy(), osg::ClusterWindowBase::shallowCopy(), osg::ClipPlaneChunkBase::shallowCopy(), osg::ClipPlaneBase::shallowCopy(), osg::ChunkMaterialBase::shallowCopy(), osg::BlendChunkBase::shallowCopy(), and osg::BillboardBase::shallowCopy().

00141 {
00142     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00143     
00144     UInt8 *pTmp;
00145     
00146     result._containerSize = sizeof(ObjectType);
00147     
00148     pTmp        = 
00149         static_cast<UInt8 *>(operator new(
00150             sizeof(Int32)      + // ReferenceCount
00151             sizeof(UInt32)     + // ContainerId
00152             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00153     
00154     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00155     
00156     pTmp += sizeof(Int32);
00157     
00158     result._storeP = (pTmp + sizeof(UInt32));
00159 
00160 #ifdef OSG_DEBUG_FCPTR
00161     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00162 #endif
00163 
00164     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00165         FieldContainerFactory::the()->registerFieldContainer(result);
00166     
00167     Thread::getCurrentChangeList()->addCreated(
00168         *(reinterpret_cast<UInt32 *>(pTmp)));
00169     
00170     pTmp += sizeof(UInt32);
00171     
00172     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00173 
00174     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00175     {
00176         pTmp = 
00177             reinterpret_cast<UInt8 *>(new (pTmp) ObjectType(*prototypeP));
00178         
00179         pTmp += sizeof(ObjectType);
00180     }
00181     
00182     result->onCreate(prototypeP);
00183 
00184     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00185     {
00186         aObject[i].onCreateAspect(aObject, prototypeP);
00187     }
00188 
00189 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00190 
00191     fprintf(stderr, "GV_MEM_FC_DBG : (%u) cc (%p|%u)\n", 
00192             Thread::getAspect(),
00193             result._storeP,
00194 //            ObjectType::getClassType().getCName(),
00195             ObjectType::getClassType().getId());
00196 #endif
00197 
00198 #ifdef OSG_DEBUG_TYPED_FCPTR
00199     result.updateTypedStore();
00200 #endif
00201 }

template<class ObjectPtrT>
void osg::FieldContainer::newPtr ( ObjectPtrT &  result  )  [inline, static, protected, inherited]

Definition at line 204 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

00205 {
00206     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00207     
00208     UInt8 *pTmp;
00209     
00210     result._containerSize = sizeof(ObjectType);
00211     
00212     pTmp        =             
00213         static_cast<UInt8 *>(operator new(
00214             sizeof(Int32)      + // ReferenceCount
00215             sizeof(UInt32)     + // ContainerId
00216             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00217     
00218     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00219     
00220     pTmp  += sizeof(Int32);
00221     
00222     result._storeP = (pTmp + sizeof(UInt32));
00223     
00224 #ifdef OSG_DEBUG_FCPTR
00225     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00226 #endif
00227 
00228     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00229         FieldContainerFactory::the()->registerFieldContainer(result);
00230     
00231     Thread::getCurrentChangeList()->addCreated(
00232         *(reinterpret_cast<UInt32 *>(pTmp)));
00233     
00234     pTmp += sizeof(UInt32);
00235     
00236     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00237 
00238     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00239     {
00240         pTmp = reinterpret_cast<UInt8 *>(new (pTmp) ObjectType());
00241         
00242         pTmp += sizeof(ObjectType);
00243     }
00244     
00245     result->onCreate();
00246     
00247     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00248     {
00249         aObject[i].onCreateAspect(aObject);
00250     }
00251 
00252 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00253     fprintf(stderr, "GV_MEM_FC_DBG : (%u) c (%p|%u)\n", 
00254             Thread::getAspect(),
00255             result._storeP,
00256 //            ObjectType::getClassType().getCName(),
00257             ObjectType::getClassType().getId());
00258 #endif
00259     
00260 #ifdef OSG_DEBUG_TYPED_FCPTR
00261     result.updateTypedStore();
00262 #endif
00263 }

template<class FieldTypeT>
void osg::FieldContainer::beginEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 285 of file OSGFieldContainerImpl.inl.

00286 {
00287 //    fieldR.beginEdit();
00288 }

template<class FieldTypeT>
void osg::FieldContainer::endEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 291 of file OSGFieldContainerImpl.inl.

References osg::endEditCP().

00292 {
00293     FieldContainerPtr tmpPtr(this);
00294     endEditCP(tmpPtr, whichField);
00295 }

void osg::FieldContainer::onCreate ( const FieldContainer source = NULL  )  [inline, protected, inherited]

Definition at line 318 of file OSGFieldContainerImpl.inl.

Referenced by osg::ShaderParameterChunk::onCreate().

00319 {
00320 }

void osg::FieldContainer::onCreateAspect ( const FieldContainer aspect0,
const FieldContainer source = NULL 
) [inline, protected, inherited]

Definition at line 323 of file OSGFieldContainerImpl.inl.

00325 {
00326 }


Friends And Related Function Documentation

friend class FieldContainer [friend]

Reimplemented from osg::GeometryBase.

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

Definition at line 245 of file OSGGeometry.h.

friend class GeometryBase [friend]

Definition at line 246 of file OSGGeometry.h.


Member Data Documentation

const UInt16 Geometry::MapPosition = 1 [static]

Definition at line 91 of file OSGGeometry.h.

Referenced by osg::createSharedIndex().

std::vector< GeoVBO * > Geometry::_vbos [static, private]

Definition at line 257 of file OSGGeometry.h.

Referenced by createVBO(), destroyVBO(), drawVBO(), and updateVBO().

Definition at line 259 of file OSGGeometry.h.

Referenced by drawPrimitives(), and handleGL().

Initial value:

 
    (Inherited::MTInfluenceMask) | 
    (static_cast<BitVector>(0x0) << Inherited::NextFieldId)

Reimplemented from osg::MaterialDrawableBase.

Reimplemented in osg::DVRGeometryBase, and osg::SurfaceBase.

Definition at line 170 of file OSGGeometryBase.h.

GeoPTypesPtr osg::GeometryBase::_sfTypes [protected, inherited]

The types property contains the primitive's types. Legal values are everything that can be passed to glBegin(). There have to be as many types as lengths.

Definition at line 335 of file OSGGeometryBase.h.

Referenced by changed(), osg::GeometryBase::copyFromBin(), osg::GeometryBase::copyToBin(), osg::GeometryBase::executeSyncImpl(), osg::GeometryBase::getBinSize(), osg::GeometryBase::getSFTypes(), osg::GeometryBase::getTypes(), onDestroy(), osg::GeometryBase::setTypes(), and setTypes().

The lengths property contains the number of vertices to use for the corresponding primitive. There have to be as many lengths as types.

Definition at line 336 of file OSGGeometryBase.h.

Referenced by changed(), osg::GeometryBase::copyFromBin(), osg::GeometryBase::copyToBin(), osg::GeometryBase::executeSyncImpl(), osg::GeometryBase::getBinSize(), osg::GeometryBase::getLengths(), osg::GeometryBase::getSFLengths(), onDestroy(), osg::GeometryBase::setLengths(), and setLengths().

The indexMapping property contains the definition which index element is used for which attribute data. See Indexing for a description of the indexing options.

Definition at line 350 of file OSGGeometryBase.h.

Referenced by osg::GeometryBase::copyFromBin(), osg::GeometryBase::copyToBin(), osg::GeometryBase::executeSyncImpl(), osg::GeometryBase::getBinSize(), osg::GeometryBase::getIndexMapping(), and osg::GeometryBase::getMFIndexMapping().

bool osg::GeometryBase::_sfDlistCache [protected, inherited]

Int32 osg::GeometryBase::_sfGLId [protected, inherited]

UInt32 osg::GeometryBase::_sfMinindex [protected, inherited]

UInt32 osg::GeometryBase::_sfMaxindex [protected, inherited]

UInt32 osg::GeometryBase::_mfLowindices [protected, inherited]

For each primitive (entry in types) the lowest index used (for single-indexed mode only).

Definition at line 356 of file OSGGeometryBase.h.

Referenced by osg::GeometryBase::copyFromBin(), osg::GeometryBase::copyToBin(), osg::GeometryBase::executeSyncImpl(), osg::GeometryBase::getBinSize(), osg::GeometryBase::getLowindices(), and osg::GeometryBase::getMFLowindices().

UInt32 osg::GeometryBase::_mfHighindices [protected, inherited]

For each primitive (entry in types) the highest index used (for single-indexed mode only).

Definition at line 357 of file OSGGeometryBase.h.

Referenced by osg::GeometryBase::copyFromBin(), osg::GeometryBase::copyToBin(), osg::GeometryBase::executeSyncImpl(), osg::GeometryBase::getBinSize(), osg::GeometryBase::getHighindices(), and osg::GeometryBase::getMFHighindices().

bool osg::GeometryBase::_sfVbo [protected, inherited]

Definition at line 72 of file OSGDrawable.h.

Referenced by drawPrimitives(), and osg::DrawActionBase::start().

Definition at line 73 of file OSGDrawable.h.

Referenced by drawPrimitives(), and osg::DrawActionBase::start().

const BitVector NodeCore::ParentsFieldMask = (1 << NodeCore::ParentsFieldId ) [static, inherited]

const bool osg::NodeCore::isNodeCore = true [static, inherited]

Reimplemented from osg::FieldContainer.

Definition at line 149 of file OSGNodeCore.h.

MFNodePtr osg::NodeCore::_parents [protected, inherited]

const BitVector osg::FieldContainer::NextFieldMask [static, inherited]

Initial value:

 
                    (TypeTraits<BitVector>::One << NextFieldId)

Definition at line 75 of file OSGFieldContainerImpl.h.

UInt32 osg::FieldContainer::_shares [protected, inherited]

Definition at line 199 of file OSGFieldContainerImpl.h.


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

Generated on Mon Mar 17 11:13:32 2008 for OpenSG by  doxygen 1.5.5