osg::Surface Class Reference

#include <OSGSurface.h>

Inheritance diagram for osg::Surface:

osg::SurfaceBase osg::Geometry osg::GeometryBase osg::MaterialDrawable osg::MaterialDrawableBase osg::Drawable osg::DrawableBase osg::NodeCore osg::AttachmentContainer osg::FieldContainer

List of all members.

Internal functions



class FieldContainer
class SurfaceBase
BSplineTrimmedSurface * _trimmedSurface
CNurbsPatchSurface * _surfacePatch
Pnt3d _min
Pnt3d _max
Pnt2d _minParam
Pnt2d _maxParam
void tessellate (void)
 tessellate
void reTessellate (void)
 retessellate
Int32 convertSurface (void)
Int32 tessellateSurface (std::vector< SimplePolygon > &triangles, std::vector< Pnt3f > &gverts, std::vector< Vec3f > &norms)
Int32 tessellateSurface (std::vector< SimplePolygon > &triangles, std::vector< Pnt3f > &gverts, std::vector< Vec3f > &norms, std::vector< Pnt2f > &texcoords)
Int32 tessellateSurface (std::vector< SimplePolygon > &triangles, std::vector< Pnt3f > &gverts, std::vector< Pnt2f > &texcoords)
Int32 buildSurface (std::vector< SimplePolygon > &triangles, std::vector< Pnt3f > &gverts, std::vector< Vec3f > &norms, std::vector< Pnt2f > &texcoords)
bool checkOrient (UInt32 ui_v1, UInt32 ui_v2, UInt32 ui_v3, std::vector< Pnt3f > &m_vclGlobalVertices, std::vector< Vec3f > &m_vclNormal)
bool updateError (Pnt3f viewPos, Real64 halfPixelSize)
 update error field according to dynamic LOD
void FindClosestPoint (Vec3f &rDist, const Pnt3f viewPos) const
void FindClosestPointExact (Vec3f &rDist, const Pnt3f viewPos) const
void onCreate (const Surface *source=NULL)
void onDestroy (void)
void handleGL (Window *win, UInt32 idstatus)
void adjustVolume (Volume &volume)
virtual Action::ResultE drawPrimitives (DrawActionBase *action)
static void initMethod (void)
 initialize the static features of the class, e.g. action callbacks
void calcIndexMapping (void)
void operator= (const Surface &source)

Class Specific



Int16 calcMappingIndex (UInt16 attrib) const
GeometryPtr getPtr (void) const
bool isMergeable (const GeometryPtr other)
bool merge (const GeometryPtr other)
UInt32 getCachedGfxMemoryUsage (void)
static const char * mapType (UInt8 type)

Public Types

enum  {
  DimUFieldId = Inherited::NextFieldId, DimVFieldId = DimUFieldId + 1, KnotsUFieldId = DimVFieldId + 1, KnotsVFieldId = KnotsUFieldId + 1,
  ControlPointsFieldId = KnotsVFieldId + 1, ErrorFieldId = ControlPointsFieldId + 1, NumCurvesFieldId = ErrorFieldId + 1, KnotLengthsFieldId = NumCurvesFieldId + 1,
  DimensionsFieldId = KnotLengthsFieldId + 1, CurveControlPointsFieldId = DimensionsFieldId + 1, KnotsFieldId = CurveControlPointsFieldId + 1, CurvesPerLoopFieldId = KnotsFieldId + 1,
  IsDelaunayFieldId = CurvesPerLoopFieldId + 1, TextureControlPointsFieldId = IsDelaunayFieldId + 1, DirtyMaskFieldId = TextureControlPointsFieldId + 1, SurfaceGLIdFieldId = DirtyMaskFieldId + 1,
  NextFieldId = SurfaceGLIdFieldId + 1
}
typedef SurfacePtr Ptr
enum  {
  TypesFieldId = Inherited::NextFieldId, LengthsFieldId = TypesFieldId + 1, PositionsFieldId = LengthsFieldId + 1, NormalsFieldId = PositionsFieldId + 1,
  ColorsFieldId = NormalsFieldId + 1, SecondaryColorsFieldId = ColorsFieldId + 1, TexCoordsFieldId = SecondaryColorsFieldId + 1, TexCoords1FieldId = TexCoordsFieldId + 1,
  TexCoords2FieldId = TexCoords1FieldId + 1, TexCoords3FieldId = TexCoords2FieldId + 1, 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
}
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

user actions


void addCurve (UInt32 dim, std::vector< Real64 > &knots, std::vector< Pnt2f > &controlpoints, bool newloop=false)
 Add a (polynomial) trimming curve to the surface.
void addCurve (UInt32 dim, std::vector< Real64 > &knots, std::vector< Pnt3f > &controlpoints, bool newloop=false)
 Add a (rational) trimming curve to the surface.
void removeCurves (void)
 Remove all trimming curves from the surface.
SurfacePtr clone (void)
 Clone the Surface.
void readfromtso (std::istream &infile, bool useTextures=false)
 Read from a .tso file. Temporary function.
void writetotso (std::ostream &outfile)
 Add a (polynomial) trimming curve to the surface.
UInt32 writetoobj (std::ostream &outfile, UInt32 offset)
 Write tessellated geometry to an .obj file. Absolutely temporary function.
Real64 getDesiredError (Pnt3f viewPos, Real64 halfPixelSize)
 get desired error.
void forceTessellate (void)
 Add a (polynomial) trimming curve to the surface.
void flip (void)
 Add a (polynomial) trimming curve to the surface.
Field Set


void setControlPoints (const GeoPositionsPtr &value)
void setTextureControlPoints (const GeoTexCoordsPtr &value)
Sync


virtual void changed (BitVector whichField, UInt32 origin)
 react to field changes
Output


virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
 output the instance for debug purposes
FieldContainer Get


virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get


SFUInt32getSFDimU (void)
 Get the Surface::_sfDimU field.
SFUInt32getSFDimV (void)
 Get the Surface::_sfDimV field.
MFReal32getMFKnotsU (void)
 Get the Surface::_mfKnotsU field.
MFReal32getMFKnotsV (void)
 Get the Surface::_mfKnotsV field.
SFGeoPositionsPtrgetSFControlPoints (void)
 Get the Surface::_sfControlPoints field.
SFReal32getSFError (void)
 Get the Surface::_sfError field.
SFBoolgetSFIsDelaunay (void)
 Get the Surface::_sfIsDelaunay field.
SFGeoTexCoordsPtrgetSFTextureControlPoints (void)
 Get the Surface::_sfTextureControlPoints field.
UInt32getDimU (void)
 Get the value of the Surface::_sfDimU field.
const UInt32getDimU (void) const
 Get the value of the Surface::_sfDimU field.
UInt32getDimV (void)
 Get the value of the Surface::_sfDimV field.
const UInt32getDimV (void) const
 Get the value of the Surface::_sfDimV field.
GeoPositionsPtrgetControlPoints (void)
 Get the value of the Surface::_sfControlPoints field.
const GeoPositionsPtrgetControlPoints (void) const
 Get the value of the Surface::_sfControlPoints field.
Real32getError (void)
 Get the value of the Surface::_sfError field.
const Real32getError (void) const
 Get the value of the Surface::_sfError field.
bool & getIsDelaunay (void)
 Get the value of the Surface::_sfIsDelaunay field.
const bool & getIsDelaunay (void) const
 Get the value of the Surface::_sfIsDelaunay field.
GeoTexCoordsPtrgetTextureControlPoints (void)
 Get the value of the Surface::_sfTextureControlPoints field.
const GeoTexCoordsPtrgetTextureControlPoints (void) const
 Get the value of the Surface::_sfTextureControlPoints field.
Real32getKnotsU (const UInt32 index)
 Get the value of the index element the Surface::_mfKnotsU field.
MFReal32getKnotsU (void)
 Get the Surface::_mfKnotsU field.
const MFReal32getKnotsU (void) const
 Get the Surface::_mfKnotsU field.
Real32getKnotsV (const UInt32 index)
 Get the value of the index element the Surface::_mfKnotsV field.
MFReal32getKnotsV (void)
 Get the Surface::_mfKnotsV field.
const MFReal32getKnotsV (void) const
 Get the Surface::_mfKnotsV field.
Field Set


void setDimU (const UInt32 &value)
 Set the value of the Surface::_sfDimU field.
void setDimV (const UInt32 &value)
 Set the value of the Surface::_sfDimV field.
void setControlPoints (const GeoPositionsPtr &value)
 Set the value of the Surface::_sfControlPoints field.
void setError (const Real32 &value)
 Set the value of the Surface::_sfError field.
void setIsDelaunay (const bool &value)
 Set the value of the Surface::_sfIsDelaunay 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
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)
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.
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


Action::ResultE intersect (Action *action)
NewActionTypes::ResultE intersectActor (ActorBase::FunctorArgumentType &funcArg)
void invalidateDlistCache (void)
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.
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 FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction


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


static const char * getClassname (void)
Get Class Type Information


static UInt16 getClassGroupId (void)

Static Public Attributes

static const osg::BitVector CurveFieldMask
static const osg::BitVector SurfaceFieldMask
static const osg::BitVector DimUFieldMask
static const osg::BitVector DimVFieldMask
static const osg::BitVector KnotsUFieldMask
static const osg::BitVector KnotsVFieldMask
static const osg::BitVector ControlPointsFieldMask
static const osg::BitVector ErrorFieldMask
static const osg::BitVector NumCurvesFieldMask
static const osg::BitVector KnotLengthsFieldMask
static const osg::BitVector DimensionsFieldMask
static const osg::BitVector CurveControlPointsFieldMask
static const osg::BitVector KnotsFieldMask
static const osg::BitVector CurvesPerLoopFieldMask
static const osg::BitVector IsDelaunayFieldMask
static const osg::BitVector TextureControlPointsFieldMask
static const osg::BitVector DirtyMaskFieldMask
static const osg::BitVector SurfaceGLIdFieldMask
static const osg::BitVector MTInfluenceMask
static const osg::BitVector TypesFieldMask
static const osg::BitVector LengthsFieldMask
static const osg::BitVector PositionsFieldMask
static const osg::BitVector NormalsFieldMask
static const osg::BitVector ColorsFieldMask
static const osg::BitVector SecondaryColorsFieldMask
static const osg::BitVector TexCoordsFieldMask
static const osg::BitVector TexCoords1FieldMask
static const osg::BitVector TexCoords2FieldMask
static const osg::BitVector TexCoords3FieldMask
static const osg::BitVector 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 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


 Surface (void)
 Constructor.
 Surface (const Surface &source)
 Copy Constructor.
Destructors


virtual ~Surface (void)
 Destructor.
Field Get


SFUInt32getSFNumCurves (void)
 Get the Surface::_sfNumCurves field.
MFUInt32getMFKnotLengths (void)
 Get the Surface::_mfKnotLengths field.
MFUInt32getMFDimensions (void)
 Get the Surface::_mfDimensions field.
MFPnt3fgetMFCurveControlPoints (void)
 Get the Surface::_mfCurveControlPoints field.
MFReal32getMFKnots (void)
 Get the Surface::_mfKnots field.
MFUInt32getMFCurvesPerLoop (void)
 Get the Surface::_mfCurvesPerLoop field.
SFUInt32getSFDirtyMask (void)
 Get the Surface::_sfDirtyMask field.
SFInt32getSFSurfaceGLId (void)
 Get the Surface::_sfSurfaceGLId field.
UInt32getNumCurves (void)
 Get the value of the Surface::_sfNumCurves field.
const UInt32getNumCurves (void) const
 Get the value of the Surface::_sfNumCurves field.
UInt32getDirtyMask (void)
 Get the value of the Surface::_sfDirtyMask field.
const UInt32getDirtyMask (void) const
 Get the value of the Surface::_sfDirtyMask field.
Int32getSurfaceGLId (void)
 Get the value of the Surface::_sfSurfaceGLId field.
const Int32getSurfaceGLId (void) const
 Get the value of the Surface::_sfSurfaceGLId field.
UInt32getKnotLengths (UInt32 index)
 Get the value of the index element the Surface::_mfKnotLengths field.
MFUInt32getKnotLengths (void)
 Get the Surface::_mfKnotLengths field.
const MFUInt32getKnotLengths (void) const
 Get the Surface::_mfKnotLengths field.
UInt32getDimensions (UInt32 index)
 Get the value of the index element the Surface::_mfDimensions field.
MFUInt32getDimensions (void)
 Get the Surface::_mfDimensions field.
const MFUInt32getDimensions (void) const
 Get the Surface::_mfDimensions field.
Pnt3fgetCurveControlPoints (UInt32 index)
 Get the value of the index element the Surface::_mfCurveControlPoints field.
MFPnt3fgetCurveControlPoints (void)
 Get the Surface::_mfCurveControlPoints field.
const MFPnt3fgetCurveControlPoints (void) const
 Get the Surface::_mfCurveControlPoints field.
Real32getKnots (UInt32 index)
 Get the value of the index element the Surface::_mfKnots field.
MFReal32getKnots (void)
 Get the Surface::_mfKnots field.
const MFReal32getKnots (void) const
 Get the Surface::_mfKnots field.
UInt32getCurvesPerLoop (UInt32 index)
 Get the value of the index element the Surface::_mfCurvesPerLoop field.
MFUInt32getCurvesPerLoop (void)
 Get the Surface::_mfCurvesPerLoop field.
const MFUInt32getCurvesPerLoop (void) const
 Get the Surface::_mfCurvesPerLoop field.
Field Set


void setNumCurves (const UInt32 &value)
 Set the value of the Surface::_sfNumCurves field.
void setDirtyMask (const UInt32 &value)
 Set the value of the Surface::_sfDirtyMask field.
void setSurfaceGLId (const Int32 &value)
 Set the value of the Surface::_sfSurfaceGLId field.
Sync


void executeSyncImpl (SurfaceBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync


void executeSyncImpl (GeometryBase *pOther, 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)
Pointer


AttachmentContainerPtr getPtr (void)
Class Specific


void onCreate (const Geometry *source=NULL)
bool CompareMaterials (MaterialPtr m1, MaterialPtr m2)
Int16 MergeIndex (const GeometryPtr other)
void merge0 (const GeometryPtr other)
void merge1 (const GeometryPtr other)
void merge2 (const GeometryPtr other)
void merge3 (const GeometryPtr other)
void merge4 (const GeometryPtr other)
void merge5 (const GeometryPtr other)
void merge6 (const GeometryPtr other)
bool updateLowHighIndices (void)
MT Construction


void onCreate (const FieldContainer *source=NULL)
void onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL)
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.
Set / Get Parents


void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
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)

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


SFUInt32 _sfDimU
SFUInt32 _sfDimV
MFReal32 _mfKnotsU
MFReal32 _mfKnotsV
SFGeoPositionsPtr _sfControlPoints
SFReal32 _sfError
SFUInt32 _sfNumCurves
MFUInt32 _mfKnotLengths
MFUInt32 _mfDimensions
MFPnt3f _mfCurveControlPoints
MFReal32 _mfKnots
MFUInt32 _mfCurvesPerLoop
SFBool _sfIsDelaunay
SFGeoTexCoordsPtr _sfTextureControlPoints
SFUInt32 _sfDirtyMask
SFInt32 _sfSurfaceGLId
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

Static Protected Attributes

static const UInt32 TESSELLATE = 0x0001
static const UInt32 RETESSELLATE = 0x0002
static const UInt32 DONTTESSELLATE = 0x0004

Private Types

typedef SurfaceBase Inherited


Detailed Description

This is the OpenSG NURBS surface node. It supports an arbitrary number of trimming curves. The interface lets you define both rational and nonrational surfaces, and you can also vary rational and nonrational trimming curves.

You can edit the surface properties directly via the usual OpenSG methods. You are required to use beginEditCP()/endEditCP() pairs, of course. You may use the convenience fieldmask SurfaceFieldMask.

The error field means the maximum Euclidean error the tessellation will differ from the analytical surface in 3D space. Generally the lesser it is, the finer the tessellation is. For most surfaces 0.1 - 0.5 are generally good choices.

Definition at line 67 of file OSGSurface.h.


Member Typedef Documentation

Reimplemented from osg::SurfaceBase.

Definition at line 71 of file OSGSurface.h.

typedef SurfacePtr osg::SurfaceBase::Ptr [inherited]

Reimplemented from osg::GeometryBase.

Definition at line 105 of file OSGSurfaceBase.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:
DimUFieldId 
DimVFieldId 
KnotsUFieldId 
KnotsVFieldId 
ControlPointsFieldId 
ErrorFieldId 
NumCurvesFieldId 
KnotLengthsFieldId 
DimensionsFieldId 
CurveControlPointsFieldId 
KnotsFieldId 
CurvesPerLoopFieldId 
IsDelaunayFieldId 
TextureControlPointsFieldId 
DirtyMaskFieldId 
SurfaceGLIdFieldId 
NextFieldId 

Definition at line 107 of file OSGSurfaceBase.h.

00108     {
00109         DimUFieldId                 = Inherited::NextFieldId,
00110         DimVFieldId                 = DimUFieldId                 + 1,
00111         KnotsUFieldId               = DimVFieldId                 + 1,
00112         KnotsVFieldId               = KnotsUFieldId               + 1,
00113         ControlPointsFieldId        = KnotsVFieldId               + 1,
00114         ErrorFieldId                = ControlPointsFieldId        + 1,
00115         NumCurvesFieldId            = ErrorFieldId                + 1,
00116         KnotLengthsFieldId          = NumCurvesFieldId            + 1,
00117         DimensionsFieldId           = KnotLengthsFieldId          + 1,
00118         CurveControlPointsFieldId   = DimensionsFieldId           + 1,
00119         KnotsFieldId                = CurveControlPointsFieldId   + 1,
00120         CurvesPerLoopFieldId        = KnotsFieldId                + 1,
00121         IsDelaunayFieldId           = CurvesPerLoopFieldId        + 1,
00122         TextureControlPointsFieldId = IsDelaunayFieldId           + 1,
00123         DirtyMaskFieldId            = TextureControlPointsFieldId + 1,
00124         SurfaceGLIdFieldId          = DirtyMaskFieldId            + 1,
00125         NextFieldId                 = SurfaceGLIdFieldId          + 1
00126     };

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

Surface::Surface ( void   )  [protected]

Definition at line 147 of file OSGSurface.cpp.

References _surfacePatch, and _trimmedSurface.

00147                      :
00148     Inherited()
00149 {
00150 //    std::cerr<<"constructor"<<std::endl;
00151     _trimmedSurface = NULL;
00152     _surfacePatch = NULL;
00153 }

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

Definition at line 157 of file OSGSurface.cpp.

References _surfacePatch, and _trimmedSurface.

00157                                       :
00158     Inherited(source)
00159 {
00160 
00161     // We need these for every class and every aspect, so we have to 
00162     // allocate them here.
00163     _trimmedSurface = new BSplineTrimmedSurface;
00164     _surfacePatch = new CNurbsPatchSurface;
00165 }

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

Definition at line 169 of file OSGSurface.cpp.

References _surfacePatch, and _trimmedSurface.

00170 {
00171     if ( _trimmedSurface != NULL )
00172         delete _trimmedSurface;
00173     if ( _surfacePatch != NULL )
00174         delete _surfacePatch;
00175 }


Member Function Documentation

void Surface::addCurve ( UInt32  dim,
std::vector< Real64 > &  knots,
std::vector< Pnt2f > &  controlpoints,
bool  newloop = false 
)

This function allows you to add a new trimming curve to the Surface.

Parameters:
dim the dimension of the curve
knots the knotvector of the curve
controlpoints the (rational) control points for the curve
newloop false: this curve continues the current curveloop
true: starts a new loop
If it's the first curve added to the surface, it always starts a new loop, regardless of the value of
Parameters:
newloop. You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask. You are responsible that when calling endEditCP() the trimming curves are in a consistend state (they form closed loops and the like).

Definition at line 1694 of file OSGSurface.cpp.

Referenced by convertSurface(), and readfromtso().

01698 {
01699     UInt32 cpsize = controlpoints.size();
01700     std::vector<Pnt3f> ratcontrolpoints;
01701 
01702     ratcontrolpoints.reserve( cpsize );
01703     for (UInt32 i = 0; i < cpsize; ++i )
01704     {
01705         ratcontrolpoints.push_back( Pnt3f(controlpoints[i][0], 
01706                                           controlpoints[i][1],
01707                                           1.0f) );
01708     }    
01709     addCurve(dim, knots, ratcontrolpoints, newloop);
01710 }

void Surface::addCurve ( UInt32  dim,
std::vector< Real64 > &  knots,
std::vector< Pnt3f > &  controlpoints,
bool  newloop = false 
)

This function allows you to add a new trimming curve to the Surface.

Parameters:
dim the dimension of the curve
knots the knotvector of the curve
controlpoints the (nonrational) control points for the curve
newloop false: this curve continues the current curveloop
true: starts a new loop
If it's the first curve added to the surface, it always starts a new loop, regardless of the value of
Parameters:
newloop. You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask. You are responsible that when calling endEditCP() the trimming curves are in a consistend state (they form closed loops and the like).

Definition at line 1734 of file OSGSurface.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_sfNumCurves, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::MField< FieldTypeT, fieldNameSpace >::push_back(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

01738 {
01739     UInt32 cpsize = controlpoints.size();
01740     UInt32 knotsize = knots.size();
01741   
01742     if ( dim + cpsize + 1 != knotsize ) 
01743     {
01744 //        SWARNING <<"Surface::addCurve: inconsistent curve attributes..." << endLog;
01745         return;
01746     }
01747 //    SLOG <<"addCurve NI " << std::endl;    
01748 
01749     if ( _sfNumCurves.getValue() == 0 )
01750     {
01751         //this is the first curve -> it starts a new loop
01752 //        SLOG <<"addcurve first curve"<<endLog;
01753         newloop = true;
01754     }
01755     _mfDimensions.push_back( dim );
01756     if ( newloop ) 
01757     {
01758         _mfCurvesPerLoop.push_back( 1 ); //1 curve in a new loop
01759 //        SLOG <<"addcurve newloop"<<endLog;
01760     }
01761     else
01762     {
01763 //        SLOG <<"addcurve NOT newloop"<<endLog;
01764         UInt32 cplsize = _mfCurvesPerLoop.size();
01765 //        _mfCurvesPerLoop.setValue( _mfCurvesPerLoop.getValue( cplsize - 1 ) + 1, 
01766 //                                   cplsize - 1 );
01767         _mfCurvesPerLoop[ cplsize - 1 ] = _mfCurvesPerLoop[ cplsize - 1 ] + 1;
01768     }
01769     _mfKnotLengths.push_back( knotsize );
01770     UInt32 i;
01771     for ( i = 0; i < knotsize; ++i )
01772     {
01773         _mfKnots.push_back( (Real32) knots[ i ] );
01774     }
01775     for ( i = 0; i < cpsize; ++i )
01776     {
01777         _mfCurveControlPoints.push_back( controlpoints[ i ] );
01778     }  
01779     _sfNumCurves.setValue( _sfNumCurves.getValue() + 1 );
01780 }

void Surface::removeCurves ( void   ) 

This function removes all trimming curves from the surface.

You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask.

Definition at line 1791 of file OSGSurface.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_sfNumCurves, osg::MField< FieldTypeT, fieldNameSpace >::clear(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by readfromtso().

01792 {
01793     if ( _sfNumCurves.getValue() == 0 ) //we have no curves
01794     {
01795         return;
01796     }
01797 
01798     _sfNumCurves.setValue(0);
01799     _mfKnotLengths.clear();
01800     _mfDimensions.clear();
01801     _mfCurveControlPoints.clear();
01802     _mfKnots.clear();
01803     _mfCurvesPerLoop.clear();
01804 }

SurfacePtr Surface::clone ( void   ) 

Reimplemented from osg::Geometry.

Definition at line 1808 of file OSGSurface.cpp.

References osg::beginEditCP(), osg::SurfaceBase::create(), osg::endEditCP(), osg::endLog(), osg::SurfaceBase::getControlPoints(), osg::SurfaceBase::getDimU(), osg::SurfaceBase::getDimV(), osg::SurfaceBase::getError(), osg::SurfaceBase::getIsDelaunay(), osg::MaterialDrawableBase::getMaterial(), osg::SurfaceBase::getMFCurveControlPoints(), osg::SurfaceBase::getMFCurvesPerLoop(), osg::SurfaceBase::getMFDimensions(), osg::SurfaceBase::getMFKnotLengths(), osg::SurfaceBase::getMFKnots(), osg::SurfaceBase::getMFKnotsU(), osg::SurfaceBase::getMFKnotsV(), osg::SurfaceBase::getNumCurves(), osg::SurfaceBase::getTextureControlPoints(), and SWARNING.

01809 {
01810     SurfacePtr surf = Surface::create();
01811     
01812     SWARNING << "Surface::clone not completely implemented!"<<endLog;
01813     //  create copies of the attributes
01814     beginEditCP(surf);
01815     {
01816         if (getMFKnotsU() != NULL)
01817         {
01818             surf->getMFKnotsU()->setValues(*getMFKnotsU());
01819         }
01820         if (getMFKnotsV() != NULL)
01821         {
01822             surf->getMFKnotsV()->setValues(*getMFKnotsV());
01823         }
01824         if (getMFKnotLengths() != NULL)
01825         {
01826             surf->getMFKnotLengths()->setValues(*getMFKnotLengths());
01827         }
01828         if (getMFDimensions() != NULL)
01829         {
01830             surf->getMFDimensions()->setValues(*getMFDimensions());
01831         }
01832         if (getMFCurveControlPoints() != NULL)
01833         {
01834             surf->getMFCurveControlPoints()->setValues(*getMFCurveControlPoints());
01835         }
01836         if (getMFKnots() != NULL)
01837         {
01838             surf->getMFKnots()->setValues(*getMFKnots());
01839         }
01840         if (getMFCurvesPerLoop() != NULL)
01841         {
01842             surf->getMFCurvesPerLoop()->setValues(*getMFCurvesPerLoop());
01843         }
01844         surf->setMaterial  (getMaterial  ());
01845         surf->setDimU(getDimU());
01846         surf->setDimV(getDimV());
01847         surf->setNumCurves(getNumCurves());
01848         surf->setError(getError());
01849         surf->setIsDelaunay(getIsDelaunay());
01850         surf->setControlPoints(getControlPoints());
01851         surf->setTextureControlPoints(getTextureControlPoints());
01852     }
01853     endEditCP  (surf);
01854 
01855     return surf;
01856 }

void Surface::readfromtso ( std::istream &  infile,
bool  useTextures = false 
)

Read surface (and trimming) information from a file in .tso format. This is mainly used for debugging the code (with complicated models), it's not meant to be a general user-loader function!

This function may or may not be removed/changed/etc. later, you have been warned...

Does not perform too many checks on the input data...

You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask|SurfaceFieldMask.

Parameters:
infile istream to read surface data from.

Definition at line 1878 of file OSGSurface.cpp.

References osg::SurfaceBase::_mfKnotsU, osg::SurfaceBase::_mfKnotsV, osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfDimU, osg::SurfaceBase::_sfDimV, osg::SurfaceBase::_sfTextureControlPoints, addCurve(), osg::beginEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::clear(), osg::SurfaceBase::ControlPointsFieldMask, osg::GeoProperty< GeoPropertyDesc >::create(), osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::endEditCP(), osg::endLog(), osg::GeoProperty< GeoPropertyDesc >::GeoPropDataFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::push_back(), removeCurves(), setControlPoints(), setTextureControlPoints(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), SLOG, and osg::SurfaceBase::TextureControlPointsFieldMask.

01879 {
01880     Int32 err = 0;
01881     BSplineTrimmedSurface *cl_trimmed_surface = new BSplineTrimmedSurface;
01882     BSplineTensorSurface  tensor_surface;
01883     trimmingloop          trimloop;
01884 
01885     // this is actually rather inefficient: first we convert the data to the
01886     // OpenSG representation, and then we convert back
01887     // to the BSplineTrimmedSurface representation later
01888     // during the tessellation...
01889     // but it's somewhat simpler to extract the info from            
01890     // the BSplineTrimmedSurface class than to read from the file
01891     // I might rewrite it later, though...
01892          
01893     err = cl_trimmed_surface->read( infile );
01894     if ( err )
01895     {
01896         SLOG << "Couldn't read surface, exiting... " << err << endLog;        
01897         delete cl_trimmed_surface;
01898         return;
01899     }
01900     
01901     tensor_surface = cl_trimmed_surface->getSurface();
01902     trimloop = cl_trimmed_surface->getTrimmingLoops();
01903     
01904     // OK, first do surface business
01905     DCTPVec4dmatrix v4cps =  tensor_surface.getControlPointMatrix();
01906 
01907     UInt32 cpusize = v4cps.size();
01908     UInt32 cpvsize = v4cps[0].size();
01909     UInt32 k,u,v;
01910     Vec4d  vec4;
01911 
01912     GeoPositions4fPtr pPos;
01913 
01914     if(_sfControlPoints.getValue() == NullFC)
01915     {
01916         pPos = GeoPositions4f::create();
01917 
01918         SurfacePtr tmpPtr(*this);
01919             
01920         beginEditCP(tmpPtr, ControlPointsFieldMask);
01921             setControlPoints(pPos);
01922         endEditCP  (tmpPtr, ControlPointsFieldMask);
01923     }
01924     else
01925     {
01926         pPos = GeoPositions4fPtr::dcast(_sfControlPoints.getValue());
01927     }
01928 
01929     beginEditCP(pPos, GeoPositions4f::GeoPropDataFieldMask);
01930 
01931     MFPnt4f &_mfControlPoints = pPos->getField();
01932 //    MFPnt3f &_mfControlPoints = pPos->getField();
01933       
01934 //    _mfControlPoints.resize( cpusize * cpvsize );
01935     _mfControlPoints.clear( );
01936     for ( u = 0; u < cpusize; ++u )
01937     {
01938         for ( v = 0; v < cpvsize; ++v )
01939         {
01940 //            k = u * cpvsize + v;
01941             vec4 = v4cps[ u ][ v ];
01942             _mfControlPoints.push_back(Pnt4f(vec4[0], vec4[1], vec4[2], vec4[3]));
01943 //            _mfControlPoints.push_back(Pnt3f(vec4[0], vec4[1], vec4[2]));
01944         }
01945     }
01946 
01947     endEditCP(pPos, GeoPositions4f::GeoPropDataFieldMask);
01948 
01949     _sfDimU.setValue( tensor_surface.getDimension_U() );
01950     _sfDimV.setValue( tensor_surface.getDimension_V() );
01951 
01952     DCTPdvector knots;
01953     
01954     knots = tensor_surface.getKnotVector_U();
01955     _mfKnotsU.clear();
01956     for ( u = 0; u < knots.size(); ++u )
01957     {
01958         _mfKnotsU.push_back( (Real32) knots[ u ] );
01959     }
01960     knots = tensor_surface.getKnotVector_V();
01961     _mfKnotsV.clear();
01962     for ( v = 0; v < knots.size(); ++v )
01963     {
01964         _mfKnotsV.push_back( (Real32) knots[ v ] );
01965     }
01966 
01967     // now deal with the trimming curves
01968     removeCurves();    
01969     
01970     bool isnewloop;
01971     UInt32 actdim;
01972     std::vector<Real64> actknots;
01973     std::vector<Pnt3f> actcontrolpoints;
01974     DCTPVec3dvector v3actcps;
01975     for ( UInt32 i = 0; i < trimloop.size(); ++i )
01976     {
01977         isnewloop = true;
01978         for ( UInt32 j = 0; j < trimloop[i].size(); ++j )
01979         {
01980             actknots = trimloop[i][j].getKnotVector();
01981             actdim = trimloop[i][j].getDimension();
01982             v3actcps = trimloop[i][j].getControlPointVector();
01983             actcontrolpoints.clear();
01984             for ( UInt32 kk = 0; kk < v3actcps.size(); ++kk )
01985             {
01986                 actcontrolpoints.push_back(Pnt3f(v3actcps[ kk ][0], 
01987                                                  v3actcps[ kk ][1],
01988                                                  v3actcps[ kk ][2]));
01989             }
01990             addCurve( actdim, actknots, actcontrolpoints, isnewloop );                   
01991             isnewloop = false;
01992         }
01993     }    
01994     
01995     // trimming curves...
01996     delete cl_trimmed_surface;
01997     
01998     if ( useTextures )
01999     {
02000 //        std::cerr<<"read in texture coordinates..."<<std::endl;
02001         char buffer[1024];
02002         infile >> buffer >> std::ws;
02003 //        std::cerr <<"buffer: " << buffer <<std::endl;
02004         UInt32 numoftexcps = cpusize * cpvsize;
02005 //        _mfTextureControlPoints.clear();
02006 
02007         GeoTexCoords2fPtr pTexPos;
02008 
02009         if(_sfTextureControlPoints.getValue() == NullFC)
02010         {
02011             pTexPos = GeoTexCoords2f::create();
02012 
02013             SurfacePtr tmpPtr(*this);
02014             
02015             beginEditCP(tmpPtr, TextureControlPointsFieldMask);
02016                 setTextureControlPoints(pTexPos);
02017             endEditCP  (tmpPtr, TextureControlPointsFieldMask);
02018         }
02019         else
02020         {
02021             pTexPos = GeoTexCoords2fPtr::dcast(_sfTextureControlPoints.getValue());
02022         }
02023 
02024         beginEditCP(pTexPos, GeoTexCoords2f::GeoPropDataFieldMask);
02025 
02026         MFVec2f &_mfTextureControlPoints = pTexPos->getField();
02027         _mfTextureControlPoints.clear();
02028 
02029         Vec2f temp;
02030         for ( UInt32 ti = 0; ti < numoftexcps; ++ti )
02031         {
02032             infile >> std::ws >> temp[0] >> std::ws >> temp[1] >> std::ws;
02033             _mfTextureControlPoints.push_back( temp );
02034         }
02035         endEditCP(pTexPos, GeoTexCoords2f::GeoPropDataFieldMask);
02036 //        std::cerr<<"read " << _mfTextureControlPoints.size() << " cps."<<std::endl;
02037     }
02038 }

void Surface::writetotso ( std::ostream &  outfile  ) 

This function allows you to add a new trimming curve to the Surface.

Parameters:
dim the dimension of the curve
knots the knotvector of the curve
controlpoints the (rational) control points for the curve
newloop false: this curve continues the current curveloop
true: starts a new loop
If it's the first curve added to the surface, it always starts a new loop, regardless of the value of
Parameters:
newloop. You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask. You are responsible that when calling endEditCP() the trimming curves are in a consistend state (they form closed loops and the like).

Definition at line 2042 of file OSGSurface.cpp.

References _trimmedSurface.

02043 {
02044     _trimmedSurface->write( outfile );
02045 }

UInt32 Surface::writetoobj ( std::ostream &  outfile,
UInt32  offset 
)

Parameters:
outfile istream to read surface data from.

Definition at line 2053 of file OSGSurface.cpp.

References osg::GeometryBase::getIndices(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), and osg::GeometryBase::getTexCoords().

02054 {
02055     unsigned int uicnt;
02056 //     std::cerr << "current offset:" << g_current_obj_offset << std::endl;
02057     outfile << "g obj " << std::endl;
02058     GeoPositionsPtr pcl_points = getPositions();
02059     GeoNormalsPtr   pcl_norms = getNormals();
02060     GeoIndicesPtr   pcl_indices = getIndices();
02061     GeoTexCoordsPtr pcl_texcoords = getTexCoords();
02062     std::cerr << " indices size: " << pcl_indices->size() << std::endl;
02063     std::cerr << " points size: " << pcl_points->size() << std::endl;
02064     UInt32 ui_faces = pcl_indices->size() / 3;
02065     UInt32 uivertsize = pcl_points->size( );
02066     outfile << "# vertices " << uivertsize << std::endl;
02067 
02068     //write out vertices
02069     for ( uicnt = 0; uicnt < uivertsize; uicnt++) 
02070     {
02071         Pnt3f ppp = pcl_points->getValue( uicnt );
02072         
02073         outfile << "v " << ppp.x() << " " << 
02074                            ppp.y() << " " <<
02075                            ppp.z() << std::endl;
02076                                
02077     }
02078     //write out normals
02079     for ( uicnt = 0; uicnt < uivertsize; uicnt++) 
02080     {
02081         Pnt3f ppp = pcl_norms->getValue( uicnt );
02082             
02083         outfile << "vn " << ppp.x() << " " << 
02084                             ppp.y() << " " <<
02085                             ppp.z() << std::endl;
02086                                
02087     }
02088     //write out texture coordinates
02089     for ( uicnt = 0; uicnt < uivertsize; uicnt++) 
02090     {
02091         Pnt2f ppp = pcl_texcoords->getValue( uicnt );
02092             
02093         outfile << "vt " << ppp.x() << " " << 
02094                             ppp.y() << " " << std::endl;                          
02095     }
02096     
02097     outfile << "# faces " << ui_faces << std::endl;
02098     //write out triangles
02099     for ( unsigned int uitricnt = 0; uitricnt < ui_faces; uitricnt++)
02100     {
02101         UInt32 ind1 = pcl_indices->getValue( uitricnt * 3 );
02102         UInt32 ind2 = pcl_indices->getValue( uitricnt * 3 + 1 );
02103         UInt32 ind3 = pcl_indices->getValue( uitricnt * 3 + 2 );
02104         UInt32 i1 = ind1 + offset + 1;
02105         UInt32 i2 = ind2 + offset + 1;
02106         UInt32 i3 = ind3 + offset + 1;
02107             
02108         outfile << "f ";
02109         outfile << i1 << "/" << i1 << "/" << i1 << " " <<
02110                    i2 << "/" << i2 << "/" << i2 << " " <<
02111                    i3 << "/" << i3 << "/" << i3 << std::endl;
02112     }
02113 
02114     return offset + uivertsize;
02115 }

Real64 Surface::getDesiredError ( Pnt3f  viewPos,
Real64  halfPixelSize 
)

Definition at line 340 of file OSGSurface.cpp.

References _max, _min, osg::PointInterface< ValueTypeT, StorageInterfaceT >::dist(), FindClosestPoint(), and osg::VectorInterface< ValueTypeT, StorageInterfaceT >::squareLength().

Referenced by updateError().

00341 {
00342     Vec3f   dist;
00343     Real64  distance;
00344 
00345     FindClosestPoint( dist, viewPos );
00346     distance = dist.squareLength( );
00347 
00348 /*    if( distance < _max.dist2( _min ) )
00349     {
00350         FindClosestPointExact( dist, viewPos );
00351         distance = dist.squareLength( );
00352     }*/
00353 
00354     distance = sqrt( distance );
00355     // multiply the length of a line at distance one that projects 
00356     // to half a pixel with the distance of the current BB to get 
00357     // the maximum geometric error that is allowed for the surface 
00358     // within the BB
00359     Real64 desired_error = halfPixelSize * distance;
00360 
00361 //  std::cerr << distance << " " << desired_error << std::endl;
00362 
00363     if( desired_error < _max.dist( _min ) * 0.001 ) // 0.1% of bounding box
00364     {
00365 //          printf( "error below minimum => setting to minimal error %f\n", _max.dist( _min ) * 0.001 );
00366             desired_error = _max.dist( _min ) * 0.001;
00367     }
00368 
00369     return desired_error;
00370 }

void Surface::forceTessellate ( void   ) 

This function allows you to add a new trimming curve to the Surface.

Parameters:
dim the dimension of the curve
knots the knotvector of the curve
controlpoints the (rational) control points for the curve
newloop false: this curve continues the current curveloop
true: starts a new loop
If it's the first curve added to the surface, it always starts a new loop, regardless of the value of
Parameters:
newloop. You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask. You are responsible that when calling endEditCP() the trimming curves are in a consistend state (they form closed loops and the like).

Definition at line 2289 of file OSGSurface.cpp.

References osg::beginEditCP(), osg::SurfaceBase::DirtyMaskFieldMask, DONTTESSELLATE, osg::endEditCP(), osg::SurfaceBase::getDirtyMask(), reTessellate(), RETESSELLATE, tessellate(), and TESSELLATE.

02290 {
02291     SurfacePtr tmpPtr(*this);
02292 
02293     beginEditCP(tmpPtr, DirtyMaskFieldMask);
02294     {
02295         getDirtyMask() |= DONTTESSELLATE;
02296 
02297         if((getDirtyMask() & TESSELLATE) != 0x0000)
02298         {
02299             tessellate( );
02300         }
02301         else if((getDirtyMask() & RETESSELLATE) != 0x0000)
02302         {
02303             reTessellate( );
02304         }
02305         
02306         getDirtyMask() &= ~(TESSELLATE | RETESSELLATE);
02307     }
02308     endEditCP  (tmpPtr, DirtyMaskFieldMask);
02309 }

void Surface::flip ( void   ) 

This function allows you to add a new trimming curve to the Surface.

Parameters:
dim the dimension of the curve
knots the knotvector of the curve
controlpoints the (rational) control points for the curve
newloop false: this curve continues the current curveloop
true: starts a new loop
If it's the first curve added to the surface, it always starts a new loop, regardless of the value of
Parameters:
newloop. You are expected to call this function between corresponding beginEditCP()/endEditCP() pairs with the mask CurveFieldMask. You are responsible that when calling endEditCP() the trimming curves are in a consistend state (they form closed loops and the like).

Definition at line 2311 of file OSGSurface.cpp.

References _trimmedSurface.

02312 {
02313     if(_trimmedSurface != NULL)
02314         _trimmedSurface->flip();
02315 }

void osg::Surface::setControlPoints ( const GeoPositionsPtr value  )  [inline]

Definition at line 48 of file OSGSurface.inl.

References osg::SurfaceBase::_sfControlPoints, osg::addRefCP(), osg::beginEditCP(), osg::SurfaceBase::ControlPointsFieldId, osg::endEditCP(), 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 readfromtso().

00049 {
00050     SurfacePtr thisP(*this);
00051 
00052     addRefCP(value);
00053 
00054     if(_sfControlPoints.getValue() != NullFC)
00055     {
00056         beginEditCP(_sfControlPoints.getValue(), Attachment::ParentsFieldMask);
00057         {
00058             _sfControlPoints.getValue()->subParent(thisP);
00059         }
00060         endEditCP  (_sfControlPoints.getValue(), Attachment::ParentsFieldMask);
00061 
00062         subRefCP(_sfControlPoints.getValue());
00063     }
00064 
00065     if(value != NullFC)
00066     {
00067         thisP.setParentFieldPos(ControlPointsFieldId);
00068 
00069         beginEditCP(value, Attachment::ParentsFieldMask);
00070         {
00071             value->addParent(thisP);
00072         }
00073         endEditCP  (value, Attachment::ParentsFieldMask);
00074     }
00075 
00076     _sfControlPoints.setValue(value);
00077 }

void osg::Surface::setTextureControlPoints ( const GeoTexCoordsPtr value  )  [inline]

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

Reimplemented from osg::Geometry.

Definition at line 213 of file OSGSurface.cpp.

References osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfTextureControlPoints, osg::ChangedOrigin::Abstract, osg::ChangedOrigin::AbstrCheckValid, osg::ChangedOrigin::AbstrIncRefCount, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::changed(), osg::SurfaceBase::ControlPointsFieldMask, osg::SurfaceBase::CurveControlPointsFieldMask, osg::SurfaceBase::CurvesPerLoopFieldMask, osg::SurfaceBase::DimensionsFieldMask, osg::SurfaceBase::DimUFieldMask, osg::SurfaceBase::DimVFieldMask, osg::SurfaceBase::DirtyMaskFieldMask, osg::endEditCP(), osg::SurfaceBase::ErrorFieldMask, osg::SurfaceBase::getDirtyMask(), osg::SurfaceBase::getSurfaceGLId(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::SurfaceBase::IsDelaunayFieldMask, osg::SurfaceBase::KnotLengthsFieldMask, osg::SurfaceBase::KnotsFieldMask, osg::SurfaceBase::KnotsUFieldMask, osg::SurfaceBase::KnotsVFieldMask, osg::NullFC, osg::SurfaceBase::NumCurvesFieldMask, osg::Window::refreshGLObject(), RETESSELLATE, setControlPoints(), setTextureControlPoints(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), TESSELLATE, and osg::SurfaceBase::TextureControlPointsFieldMask.

00214 {
00215     if(whichField & ControlPointsFieldMask)
00216     {
00217         if(origin & ChangedOrigin::Abstract)
00218         {
00219             if(origin & ChangedOrigin::AbstrCheckValid)
00220             {
00221                 SurfacePtr thisP(*this);
00222 
00223                 if(_sfControlPoints.getValue()                    != NullFC &&
00224                    _sfControlPoints.getValue()->findParent(thisP) ==     -1 )
00225                 {
00226                     GeoPositionsPtr pPos = _sfControlPoints.getValue();
00227 
00228                     _sfControlPoints.setValue(NullFC);
00229 
00230                     setControlPoints(pPos);
00231                 }
00232             }
00233             else if(origin & ChangedOrigin::AbstrIncRefCount)
00234             {
00235                 addRefCP(_sfControlPoints.getValue());
00236             }
00237             else
00238             {
00239                 GeoPositionsPtr pPos = _sfControlPoints.getValue();
00240 
00241                 _sfControlPoints.setValue(NullFC);
00242 
00243                 setControlPoints(pPos);
00244             }
00245         }
00246     }
00247 
00248     if(whichField & TextureControlPointsFieldMask)
00249     {
00250         if(origin & ChangedOrigin::Abstract)
00251         {
00252             if(origin & ChangedOrigin::AbstrCheckValid)
00253             {
00254                 SurfacePtr thisP(*this);
00255 
00256                 if(_sfTextureControlPoints.getValue()                    != NullFC &&
00257                    _sfTextureControlPoints.getValue()->findParent(thisP) ==     -1 )
00258                 {
00259                     GeoTexCoordsPtr pTexCoord = _sfTextureControlPoints.getValue();
00260 
00261                     _sfTextureControlPoints.setValue(NullFC);
00262 
00263                     setTextureControlPoints(pTexCoord);
00264                 }
00265             }
00266             else if(origin & ChangedOrigin::AbstrIncRefCount)
00267             {
00268                 addRefCP(_sfTextureControlPoints.getValue());
00269             }
00270             else
00271             {
00272                 GeoTexCoordsPtr pTexCoord = _sfTextureControlPoints.getValue();
00273 
00274                 _sfTextureControlPoints.setValue(NullFC);
00275 
00276                 setTextureControlPoints(pTexCoord);
00277             }
00278         }
00279     }
00280 
00281     // only Client needs to tessellate / retessellate...
00282 //  if( ( origin & ChangedOrigin::Sync ) == 0 )
00283     {
00284         if( ( whichField & DimUFieldMask ) ||
00285             ( whichField & DimVFieldMask ) ||
00286             ( whichField & KnotsUFieldMask ) ||
00287             ( whichField & KnotsVFieldMask ) ||
00288             ( whichField & ControlPointsFieldMask ) ||
00289             ( whichField & NumCurvesFieldMask ) ||
00290             ( whichField & KnotLengthsFieldMask ) ||
00291             ( whichField & DimensionsFieldMask ) ||
00292             ( whichField & CurveControlPointsFieldMask ) ||
00293             ( whichField & KnotsFieldMask ) ||
00294             ( whichField & CurvesPerLoopFieldMask ) ||
00295             ( whichField & TextureControlPointsFieldMask ) )
00296         {
00297 //          SLOG <<"OSGSurface::changed: have to re-tessellate..." << endLog;
00298             SurfacePtr tmpPtr(*this);
00299 
00300             beginEditCP(tmpPtr, DirtyMaskFieldMask);
00301             {
00302                 getDirtyMask() |= TESSELLATE;
00303             }
00304             endEditCP  (tmpPtr, DirtyMaskFieldMask);
00305 
00306             Window::refreshGLObject(getSurfaceGLId());
00307         }
00308         else if( ( whichField & ErrorFieldMask ) ||
00309                  ( whichField & IsDelaunayFieldMask ) )
00310         {
00311 //          SLOG <<"OSGSurface: only error or delaunay mask" << endLog;
00312 //          std::cerr << origin << std::endl;
00313             SurfacePtr tmpPtr(*this);
00314             
00315             beginEditCP(tmpPtr, DirtyMaskFieldMask);
00316             {
00317                 getDirtyMask() |= RETESSELLATE;
00318             }
00319             endEditCP  (tmpPtr, DirtyMaskFieldMask);
00320 
00321             Window::refreshGLObject(getSurfaceGLId());
00322         }
00323     }
00324         
00325     // you should call the parent's changed() function in case
00326     // it needs to update inherited fields.
00327     Inherited::changed( whichField, origin );       
00328 //    std::cerr<<"Surface::changed:   texcoords ptr: " << getTexCoords() << std::endl;
00329 //    std::cerr<<"Surface::changed:   texcoords1 ptr: " << getTexCoords1() << std::endl;
00330     
00331 }

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

Reimplemented from osg::Geometry.

Definition at line 2119 of file OSGSurface.cpp.

References osg::endLog(), and SLOG.

02121 {
02122     SLOG << "Dump Surface NI" << endLog;
02123 }

void Surface::tessellate ( void   )  [protected]

Definition at line 535 of file OSGSurface.cpp.

References osg::SurfaceBase::_sfTextureControlPoints, buildSurface(), convertSurface(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, and tessellateSurface().

Referenced by forceTessellate(), and handleGL().

00536 {
00537     // local variables for tessellation
00538 //    BSplineTrimmedSurface _trimmedSurface;  // internal representation of surface
00539 //    CNurbsPatchSurface cpatch;              // "tessellator" object
00540 //    simplepolygonvector tris;               // resulting indexed triangle set
00541     std::vector< SimplePolygon > tris;
00542     std::vector< Pnt3f > gverts;            // resulting vertices
00543     std::vector< Vec3f > norms;             // resulting surface normals
00544     std::vector< Pnt2f > texturecoords;     // resulting texture coordinates
00545     
00546     Int32 err = convertSurface();
00547     if ( err ) 
00548     {
00549 //        exit(-1);
00550         return;
00551     }
00552     if ( _sfTextureControlPoints.getValue() == NullFC )
00553     {
00554         err = tessellateSurface( tris, gverts, norms);
00555 #ifdef OSG_NURBS_DEBUG
00556         std::cerr<<"Surface::tessellate err1: " << err << " #tris: " << tris.size() << std::endl;
00557 #endif /* OSG_NURBS_DEBUG */
00558         if ( err ) return;    
00559         (void) buildSurface( tris, gverts, norms, texturecoords );
00560     }
00561     else
00562     {
00563 /*        
00564         // fragment program stuff (no normals)
00565         err = tessellateSurface( tris, gverts, texturecoords );
00566         if ( err ) return;
00567         (void) buildSurface( tris, gverts, texturecoords );
00568 */        
00569         // classic texturemapping stuff (both normals and texcoords)
00570         err = tessellateSurface( tris, gverts, norms, texturecoords );
00571 #ifdef OSG_NURBS_DEBUG
00572         std::cerr<<"Surface::tessellate err2: " << err << " #tris: " << tris.size() << std::endl;
00573 #endif /* OSG_NURBS_DEBUG */
00574         if ( err ) return;
00575         (void) buildSurface( tris, gverts, norms, texturecoords );
00576        
00577     }
00578     
00579     
00580 //        std::cerr<<"Surface::tessellate:   texcoords ptr: " << getTexCoords() << std::endl;
00581 //        std::cerr<<"Surface::tessellate:   texcoords1 ptr: " << getTexCoords1() << std::endl;
00582     
00583 //    buildPointSet();
00584 //    SLOG << "tessellate NI" << endLog;   
00585 }

void Surface::reTessellate ( void   )  [protected]

Definition at line 588 of file OSGSurface.cpp.

References osg::SurfaceBase::_sfTextureControlPoints, _surfacePatch, buildSurface(), osg::SurfaceBase::getError(), osg::SurfaceBase::getIsDelaunay(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, and osg::SurfaceBase::setError().

Referenced by forceTessellate(), and handleGL().

00589 {
00590     std::vector< SimplePolygon > tris;
00591     std::vector< Pnt3f > gverts;            // resulting vertices
00592     std::vector< Vec3f > norms;             // resulting surface normals
00593     std::vector< Pnt2f > texturecoords;     // resulting texture coordinates
00594 
00595     
00596     //FIXMEZ0RZ:
00597 //    _surfacePatch->setSurface( _trimmedSurface );
00598     if ( getError() < DCTP_EPS )
00599     {
00600 //        SLOG << " Surface::tessellate: correcting negative/zero error" <<
00601   //              endLog;
00602         setError( 0.2 );
00603     }
00604     
00605     _surfacePatch->setError ( getError() );
00606     SSurface *surfdata = _surfacePatch->getSurfaceData();
00607 
00608     if ( _sfTextureControlPoints.getValue() == NullFC )
00609     {
00610         _surfacePatch->getTessellation( gverts, norms, tris, getIsDelaunay() );
00611         (void) buildSurface( tris, gverts, norms, texturecoords );
00612     }
00613     else
00614     {
00615 /*        
00616         //normalmap stuff
00617         _surfacePatch->getTessellation( gverts, texturecoords, tris, getIsDelaunay() );
00618         (void) buildSurface( tris, gverts, texturecoords );
00619 */
00620    
00621        //classic texturemapped stuff
00622        _surfacePatch->getTessellation( gverts, norms, texturecoords, 
00623                                        tris, getIsDelaunay() );
00624        (void) buildSurface( tris, gverts, norms, texturecoords );
00625       
00626     }
00627     
00628 //        std::cerr<<"Surface::reTessellate:   texcoords ptr: " << getTexCoords() << std::endl;
00629 //        std::cerr<<"Surface::reTessellate:   texcoords1 ptr: " << getTexCoords1() << std::endl;
00630         
00631 }

Int32 Surface::convertSurface ( void   )  [protected]

!!!!!!!!!!!!!!!!!!!

Definition at line 634 of file OSGSurface.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_mfKnotsU, osg::SurfaceBase::_mfKnotsV, osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfDimU, osg::SurfaceBase::_sfDimV, osg::SurfaceBase::_sfNumCurves, _trimmedSurface, addCurve(), osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::endLog(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::size(), and SLOG.

Referenced by tessellate().

00635 {
00636 //    BSplineTrimmedSurface *_trimmedSurface = (BSplineTrimmedSurface*)trimsurf;
00637 
00638     bool israt;
00639     GeoPositions3fPtr pPos = GeoPositions3fPtr::dcast(
00640         _sfControlPoints.getValue());
00641     GeoPositions4fPtr pRatPos = GeoPositions4fPtr::dcast(
00642         _sfControlPoints.getValue());
00643 
00644 //    std::cerr<< "pPos: " << pPos << " pRatPos: " << pRatPos << std::endl;
00645     if(_sfControlPoints.getValue() == NullFC)
00646     {
00647         SLOG << "Surface::tessellate: null surfacecontrol prop " << endLog;
00648         return -1;
00649     }
00650 
00651     if ( pPos != NullFC )
00652     {
00653         israt = false;   
00654     }
00655     else if ( pRatPos != NullFC )
00656     {
00657         israt = true;
00658     }
00659     else
00660     {
00661         SLOG << "Surface::tessellate: null surfacecontrol prop " << endLog;
00662         return -1;
00663     }
00664     MFPnt3f *polyControlPoints;
00665     MFPnt4f *ratControlPoints;
00666     UInt32 cpsize;
00667     if ( !israt )
00668     {
00669         polyControlPoints = &(pPos->getField());
00670         cpsize = polyControlPoints->size();
00671     }
00672     else
00673     {
00674         ratControlPoints = &(pRatPos->getField());
00675         cpsize = ratControlPoints->size();
00676     }
00677 //    MFPnt3f &_mfControlPoints = pPos->getField();
00678     
00679     // check knots, dimensions and control points
00680     if( cpsize == 0 ) 
00681     {
00682         SLOG << "Surface::tessellate: null surfacecontrol points " << endLog;
00683         return -1;
00684     }
00685 /*    if ( cpdim !=3 && cpdim !=4 )
00686     {
00687         SLOG << "Surface::tessellate: wrong control point dimensions " <<
00688                 endLog;
00689     }*/
00690     UInt32 dimu = _sfDimU.getValue();
00691     UInt32 dimv = _sfDimV.getValue();
00692     if ( dimu == 0 || dimv == 0 )
00693     {
00694         SLOG << "Surface::tessellate: 0 dimensions " << endLog;
00695         return -1;
00696     }
00697     UInt32 knotusize = _mfKnotsU.size();
00698     UInt32 knotvsize = _mfKnotsV.size();
00699     if ( knotusize == 0 || knotvsize == 0 )
00700     {
00701         SLOG << "Surface::tessellate: empty knotvectors " << endLog;
00702         return -1;
00703     }
00704     UInt32 cpusize = knotusize - dimu - 1;
00705     UInt32 cpvsize = knotvsize - dimv - 1;
00706     if ( cpusize < 1 || cpvsize < 1 || cpusize * cpvsize != cpsize )
00707     {
00708         SLOG << cpusize << "x" << cpvsize << ":" << cpsize << endLog;
00709         SLOG << "Surface::tessellate: inconsistent attributes " << endLog;
00710         return -1;
00711     }
00712     if ( _sfNumCurves.getValue() == 0  ) // no trimming specified, add dummy trimming
00713     {
00714         Real64 umin = _mfKnotsU[ 0 ];
00715         Real64 vmin = _mfKnotsV[ 0 ];
00716         Real64 umax = _mfKnotsU[ knotusize - 1 ];
00717         Real64 vmax = _mfKnotsV[ knotvsize - 1 ];
00718         
00719         std::vector< Real64 > tmpknotvec(4);
00720         std::vector< Pnt2f > tmpcps(2);
00721         UInt32 dim = 1;
00722         tmpknotvec[ 0 ] = 0.0;
00723         tmpknotvec[ 1 ] = 0.0;
00724         tmpknotvec[ 2 ] = 1.0;
00725         tmpknotvec[ 3 ] = 1.0;
00726 
00727         // (umin, vmin) -> (umax,vmin)
00728         tmpcps[0][0] = umin; tmpcps[0][1] = vmin;
00729         tmpcps[1][0] = umax; tmpcps[1][1] = vmin;
00730         addCurve( dim, tmpknotvec, tmpcps );
00731 
00732         // (umax, vmin) -> (umax,vmax)
00733         tmpcps[0][0] = umax; tmpcps[0][1] = vmin;
00734         tmpcps[1][0] = umax; tmpcps[1][1] = vmax;
00735         addCurve( dim, tmpknotvec, tmpcps );
00736 
00737         // (umax, vmax) -> (umin,vmax)
00738         tmpcps[0][0] = umax; tmpcps[0][1] = vmax;
00739         tmpcps[1][0] = umin; tmpcps[1][1] = vmax;
00740         addCurve( dim, tmpknotvec, tmpcps );
00741 
00742         // (umin, vmax) -> (umin,vmin)
00743         tmpcps[0][0] = umin; tmpcps[0][1] = vmax;
00744         tmpcps[1][0] = umin; tmpcps[1][1] = vmin;
00745         addCurve( dim, tmpknotvec, tmpcps );
00746     }
00747 
00748     // now we checked everything, let's convert the surface+trimcurves
00749     // to the internal representation
00750     
00751     // first create surface
00752     BSplineTensorSurface tensor_surface;
00753     UInt32 i, j, k;
00754     DCTPVec4dmatrix qnet;
00755     Vec4d vec4;
00756     qnet.resize( cpusize );
00757     
00758     for ( i = 0; i < cpusize; ++i )
00759     {
00760         qnet[ i ].resize( cpvsize );
00761         for ( j = 0; j < cpvsize; ++j )
00762         {
00763             k = i * cpvsize + j;
00764             if ( !israt )
00765             {
00766                 vec4[0] = (*polyControlPoints)[k][0];
00767                 vec4[1] = (*polyControlPoints)[k][1];
00768                 vec4[2] = (*polyControlPoints)[k][2];
00769                 vec4[3] = 1.0f; 
00770 //                SLOG << "qnet["<<i<<"]["<<j<<"]: " << vec4 << endLog;
00771 //                SLOG << "k: " << k << endLog;
00772             }
00773             else
00774             {
00775                 vec4[0] = (*ratControlPoints)[k][0];
00776                 vec4[1] = (*ratControlPoints)[k][1];
00777                 vec4[2] = (*ratControlPoints)[k][2];
00778                 vec4[3] = (*ratControlPoints)[k][3];
00779 //                SLOG << "qnet["<<i<<"]["<<j<<"]: " << vec4 << endLog;
00780 //                SLOG << "k: " << k << endLog;
00781             }
00782             qnet[ i ][ j ] = vec4;
00783         }
00784     }
00785     tensor_surface.setControlPointMatrix( qnet );
00786     // convert knotvectors
00787     DCTPdvector knotuvec(knotusize);
00788     DCTPdvector knotvvec(knotvsize);
00789     for ( i = 0; i < knotusize; ++i )
00790     {
00791         knotuvec[ i ] = _mfKnotsU[ i ];
00792     }
00793     for ( i = 0; i < knotvsize; ++i )
00794     {
00795         knotvvec[ i ] = _mfKnotsV[ i ];
00796     }
00797     tensor_surface.setKnotsAndDimension( knotuvec, dimu, knotvvec, dimv );
00798 //    std::cerr<<"0.2"<<std::endl;
00799 //    fprintf(stderr,"%x\n", _trimmedSurface);
00800     _trimmedSurface->setSurface( tensor_surface );
00801 //    std::cerr<<"0.3"<<std::endl;
00802 
00803     // now create/convert trimming loops
00804     trimmingloop trimloops;
00805     UInt32 cplsize = _mfCurvesPerLoop.size();
00806     trimloops.resize( cplsize );
00807     for ( i = 0; i < cplsize; ++i )
00808     {
00809         trimloops[ i ].resize( _mfCurvesPerLoop[ i ] );
00810     }
00811     UInt32 actknotoffset = 0;
00812     UInt32 actcpoffset = 0;
00813     UInt32 actloopoffset = 0;
00814     UInt32 actcurveno = 0;
00815     UInt32 acttrimcpsize = 0;
00816     DCTPdvector actknots;
00817     DCTPVec3dvector acttrimcps;
00818     BSplineCurve2D actcurve;
00819     for ( i = 0; i < trimloops.size(); ++i )
00820     {
00821         for ( j = 0; j < trimloops[i].size(); ++j )
00822         {
00823             actknots.resize( _mfKnotLengths[ actcurveno ] );
00824 //            SLOG << "Debug: _mfKnotLengths[ actcurveno ]: " <<
00825 //                    _mfKnotLengths[ actcurveno ] << " actcurveno: " <<
00826 //                    actcurveno << endLog;
00827             acttrimcpsize = actknots.size() - _mfDimensions[ actcurveno ] - 1;
00828             if ( acttrimcpsize < 1 ) 
00829             {
00830                 SLOG << "Surface::tessellate: wrong trimming curve attributes "
00831                         << endLog;
00832                 return -1;
00833             }
00834             acttrimcps.resize( acttrimcpsize );
00835             for ( k = 0; k < actknots.size(); ++k )
00836             {
00837                 actknots[ k ] = _mfKnots[ actknotoffset + k ];
00838             }
00839             actknotoffset += actknots.size();
00840             actcurve.setKnotsAndDimension( actknots, 
00841                                            _mfDimensions[ actcurveno ] );
00842 //            SLOG << "Debug: actknotoffset: " << actknotoffset << endLog;
00843 //            SLOG << "Debug: actcpoffset: " << actcpoffset << endLog;
00844 //            SLOG << "Debug: _mfCurveControlPoints.size(): " <<
00845 //                    _mfCurveControlPoints.size() << endLog;
00846 //            SLOG << "Debug: _mfKnots.size(): " << _mfKnots.size() << endLog;
00847 //            SLOG << "Debug: acttrimcps.size(): " << acttrimcps.size() << endLog;
00848             for ( k = 0; k < acttrimcpsize; ++k )
00849             {
00850 //                SLOG <<"Debug: k: " << k << endLog;
00851                 acttrimcps[ k ][0] = _mfCurveControlPoints[ actcpoffset + k ][0];
00852                 acttrimcps[ k ][1] = _mfCurveControlPoints[ actcpoffset + k ][1];
00853                 acttrimcps[ k ][2] = _mfCurveControlPoints[ actcpoffset + k ][2];
00854             }
00855             actcpoffset += acttrimcpsize;
00856             actcurve.setControlPointVector( acttrimcps );
00857 
00858             trimloops[i][j] = actcurve;
00859             actcurveno++;
00860         }
00861         
00862     }
00863     _trimmedSurface->setTrimmingLoops( trimloops );
00864     _trimmedSurface->normalize();
00865     
00866 //    global_surf = *_trimmedSurface;    
00867     return 0;   
00868 }

Int32 Surface::tessellateSurface ( std::vector< SimplePolygon > &  triangles,
std::vector< Pnt3f > &  gverts,
std::vector< Vec3f > &  norms 
) [protected]

Definition at line 873 of file OSGSurface.cpp.

References _max, _maxParam, _min, _minParam, osg::SurfaceBase::_sfError, _surfacePatch, _trimmedSurface, osg::SurfaceBase::getIsDelaunay(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by tessellate().

00876 {
00877 //    BSplineTrimmedSurface *_trimmedSurface = (BSplineTrimmedSurface*)trimsurf;
00878 //    std::vector< SimplePolygon > *triangles = (std::vector< SimplePolygon > *)tris;
00879 //    CNurbsPatchSurface cpatch;              // "tessellator" object
00880     std::vector< Pnt2f > dummy;
00881     _surfacePatch->setSurface( _trimmedSurface, dummy, false );
00882     if ( _sfError.getValue() < DCTP_EPS )
00883     {
00884 //        SLOG << " Surface::tessellate: correcting negative/zero error" <<
00885 //                endLog;
00886         _sfError.setValue( 0.2 );
00887     }
00888     _surfacePatch->setError ( _sfError.getValue() );
00889     _surfacePatch->getTessellation( gverts, norms, triangles, getIsDelaunay() );
00890     SSurface *surfaceData =  _surfacePatch->getSurfaceData();
00891     _min = Pnt3d( surfaceData->clMin[0], surfaceData->clMin[1],
00892                   surfaceData->clMin[2] );
00893     _max = Pnt3d( surfaceData->clMax[0], surfaceData->clMax[1],
00894                   surfaceData->clMax[2] );
00895 #ifdef OSG_ARBITRARY_SPLIT
00896     _minParam = Pnt2d( surfaceData->clMinParam[0] , surfaceData->clMinParam[1] );
00897     _maxParam = Pnt2d( surfaceData->clMaxParam[0] , surfaceData->clMaxParam[1] );
00898 #endif
00899 
00900     
00901 //    std::cerr<< "min, max: [" << _min << "][" << _max << "]" << std::endl;
00902 //    std::cerr<< "minparam, maxparam: [" << _minParam << "][ " << _maxParam  << "]" << std::endl;
00903         
00904     return 0;
00905 }

Int32 Surface::tessellateSurface ( std::vector< SimplePolygon > &  triangles,
std::vector< Pnt3f > &  gverts,
std::vector< Vec3f > &  norms,
std::vector< Pnt2f > &  texcoords 
) [protected]

Definition at line 909 of file OSGSurface.cpp.

References _max, _maxParam, _min, _minParam, osg::SurfaceBase::_sfError, osg::SurfaceBase::_sfTextureControlPoints, _surfacePatch, _trimmedSurface, osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::SurfaceBase::getIsDelaunay(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00913 {
00914 //    BSplineTrimmedSurface *_trimmedSurface = (BSplineTrimmedSurface*)trimsurf;
00915 //    std::vector< SimplePolygon > *triangles = (std::vector< SimplePolygon > *)tris;
00916 //    CNurbsPatchSurface cpatch;              // "tessellator" object
00917     GeoTexCoords2fPtr pTexPos = GeoTexCoords2fPtr::dcast(_sfTextureControlPoints.getValue());
00918     std::vector<Pnt2f > tmptexcoords;
00919     UInt32 i;
00920     UInt32 s =  pTexPos->getField().size();
00921     for ( i = 0; i < s; ++i )
00922     {
00923         tmptexcoords.push_back( Pnt2f( pTexPos->getField()[i][0],
00924                                        pTexPos->getField()[i][1]));
00925     }
00926     _surfacePatch->setSurface( _trimmedSurface,
00927                                tmptexcoords,
00928                                true);
00929     if ( _sfError.getValue() < DCTP_EPS )
00930     {
00931 //        SLOG << " Surface::tessellate: correcting negative/zero error" <<
00932 //                endLog;
00933         _sfError.setValue( 0.2 );
00934     }
00935     _surfacePatch->setError ( _sfError.getValue() );
00936     _surfacePatch->getTessellation( gverts, norms, texcoords, triangles, getIsDelaunay() );
00937         
00938 //    std::cerr<< "norms.size(): " << norms.size() << " texcoords.size(): " <<
00939 //            texcoords.size() << std::endl;
00940     SSurface *surfaceData =  _surfacePatch->getSurfaceData();
00941     _min = Pnt3d( surfaceData->clMin[0], surfaceData->clMin[1],
00942                   surfaceData->clMin[2] );
00943     _max = Pnt3d( surfaceData->clMax[0], surfaceData->clMax[1],
00944                   surfaceData->clMax[2] );
00945 #ifdef OSG_ARBITRARY_SPLIT
00946     _minParam = Pnt2d( surfaceData->clMinParam[0] , surfaceData->clMinParam[1] );
00947     _maxParam = Pnt2d( surfaceData->clMaxParam[0] , surfaceData->clMaxParam[1] );
00948 #endif
00949 
00950     
00951 //    std::cerr<< "min, max: [" << _min << "][" << _max << "]" << std::endl;
00952 //    std::cerr<< "minparam, maxparam: [" << _minParam << "][ " << _maxParam  << "]" << std::endl;
00953         
00954     return 0;
00955 }

Int32 Surface::tessellateSurface ( std::vector< SimplePolygon > &  triangles,
std::vector< Pnt3f > &  gverts,
std::vector< Pnt2f > &  texcoords 
) [protected]

Definition at line 959 of file OSGSurface.cpp.

References _max, _maxParam, _min, _minParam, osg::SurfaceBase::_sfError, osg::SurfaceBase::_sfTextureControlPoints, _surfacePatch, _trimmedSurface, osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::SurfaceBase::getIsDelaunay(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00962 {
00963 //    BSplineTrimmedSurface *_trimmedSurface = (BSplineTrimmedSurface*)trimsurf;
00964 //    std::vector< SimplePolygon > *triangles = (std::vector< SimplePolygon > *)tris;
00965 //    CNurbsPatchSurface cpatch;              // "tessellator" object
00966     GeoTexCoords2fPtr pTexPos = GeoTexCoords2fPtr::dcast(_sfTextureControlPoints.getValue());
00967     std::vector<Pnt2f > tmptexcoords;
00968     UInt32 i;
00969     UInt32 s =  pTexPos->getField().size();
00970     for ( i = 0; i < s; ++i )
00971     {
00972         tmptexcoords.push_back( Pnt2f( pTexPos->getField()[i][0],
00973                                        pTexPos->getField()[i][1]));
00974     }
00975     _surfacePatch->setSurface( _trimmedSurface,
00976                                tmptexcoords,
00977                                true);
00978     if ( _sfError.getValue() < DCTP_EPS )
00979     {
00980 //        SLOG << " Surface::tessellate: correcting negative/zero error" <<
00981 //                endLog;
00982         _sfError.setValue( 0.2 );
00983     }
00984     _surfacePatch->setError ( _sfError.getValue() );
00985     std::vector< Vec3f > norms;
00986     _surfacePatch->getTessellation( gverts, norms, triangles, false );
00987     _surfacePatch->getTessellation( gverts, texcoords, triangles, getIsDelaunay() );
00988     
00989     SSurface *surfaceData =  _surfacePatch->getSurfaceData();
00990     _min = Pnt3d( surfaceData->clMin[0], surfaceData->clMin[1],
00991                   surfaceData->clMin[2] );
00992     _max = Pnt3d( surfaceData->clMax[0], surfaceData->clMax[1],
00993                   surfaceData->clMax[2] );
00994 #ifdef OSG_ARBITRARY_SPLIT
00995     _minParam = Pnt2d( surfaceData->clMinParam[0] , surfaceData->clMinParam[1] );
00996     _maxParam = Pnt2d( surfaceData->clMaxParam[0] , surfaceData->clMaxParam[1] );
00997 #endif
00998 
00999     
01000 //    std::cerr<< "min, max: [" << _min << "][" << _max << "]" << std::endl;
01001 //    std::cerr<< "minparam, maxparam: [" << _minParam << "][ " << _maxParam  << "]" << std::endl;
01002         
01003     return 0;
01004 }

Int32 Surface::buildSurface ( std::vector< SimplePolygon > &  triangles,
std::vector< Pnt3f > &  gverts,
std::vector< Vec3f > &  norms,
std::vector< Pnt2f > &  texcoords 
) [protected]

Definition at line 1027 of file OSGSurface.cpp.

References _surfacePatch, _trimmedSurface, osg::beginEditCP(), calcIndexMapping(), checkOrient(), osg::GeoProperty< GeoPropertyDesc >::create(), osg::AttachmentPtr::dcast(), osg::AttachmentContainerPtr::dcast(), osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::endEditCP(), osg::GeoProperty< GeoPropertyDesc >::GeoPropDataFieldMask, osg::SurfaceBase::getError(), osg::GeometryBase::getIndices(), osg::GeometryBase::getLengths(), osg::MaterialDrawableBase::getMaterial(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTypes(), osg::GeometryBase::IndexMappingFieldMask, osg::GeometryBase::IndicesFieldMask, osg::GeometryBase::LengthsFieldMask, osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::GeometryBase::NormalsFieldMask, osg::NullFC, osg::GeometryBase::PositionsFieldMask, osg::Geometry::setIndices(), osg::Geometry::setLengths(), osg::Geometry::setNormals(), osg::Geometry::setPositions(), osg::Geometry::setTexCoords(), osg::Geometry::setTexCoords1(), osg::Geometry::setTypes(), osg::GeometryBase::TexCoords1FieldMask, osg::GeometryBase::TexCoordsFieldMask, and osg::GeometryBase::TypesFieldMask.

Referenced by reTessellate(), and tessellate().

01032 {
01033     // FIXME:
01034     //
01035     // At least on Linux/ATI with the current OpenGL drivers
01036     // TextureCoordinate1 doesn't get passed to the vertex program
01037     // unless there's TextureCoordinate0 present.
01038     // Might even crash older drivers, and might also be a problem
01039     // on Windows with some driver versions.
01040     //
01041     // Therefore the Surface uses TextureCoordinate0 to pass tangent
01042     // coordinates to the FatBorderChunk, thus texturing an OSGSurface
01043     // that uses FBs should begin in TextureCoordinate1. 
01044     // 
01045     // Currently only 1 texture is supported (copied to the fragment
01046     // program for further processing, and built by this function)
01047     // more can be easily added if it's a problem.
01048     //
01049     // FIXME END
01050     
01051     GeoPTypesPtr            pcl_type = getTypes();
01052     GeoPLengthsPtr          pcl_size = getLengths();
01053     GeoPositionsPtr         pcl_points = getPositions();
01054     GeoNormalsPtr           pcl_norms = getNormals();
01055     GeoIndicesPtr           pcl_indices = getIndices( );
01056     GeoTexCoordsPtr         pcl_texcoords = getTexCoords1();
01057     //FatBorderChunk parameters are always passed in TextureCoordinate.
01058     GeoTexCoords3fPtr       pcl_tangents = GeoTexCoords3fPtr::dcast( getTexCoords( ) );
01059     SimpleMaterialPtr       pcl_mat = SimpleMaterialPtr::dcast( getMaterial( ) );
01060     SurfacePtr              thisPtr = SurfacePtr( this );
01061 //  GeometryPtr         pcl_geo = Geometry::create( );
01062     SimplePolygon           *pcl_face;
01063     const UInt32            cui_faces = triangles.size();
01064     UInt32                  ui_face;
01065     BSplineTensorSurface    cl_surf = _trimmedSurface->getSurface();
01066     int                     i_err;
01067     Vec3d                   cl_norm;
01068     const UInt32            cui_verts = gverts.size( );
01069     UInt32                  ui_vert;
01070     SSurface                *pt_surfdata = _surfacePatch->getSurfaceData( );
01071     const UInt32            cui_loop_cnt = pt_surfdata->vvclEdgeLoops.size( );
01072     UInt32                  ui_loop;
01073     UInt32                  ui_vertex_cnt;
01074     UInt32                  ui_idx;
01075     UInt32                  ui_used;
01076     Vec3d                   *pcl_actn;
01077     Vec3d                   *pcl_actv;
01078     Vec3d                   *pcl_nextv;
01079     Vec3d                   *pcl_prevv;
01080     Vec3f                   cl_v1, cl_v2, cl_tangent;
01081     std::vector< Int32 >    vi_new_idx( cui_verts );
01082     bool                    b_show_trimming = false;
01083    
01084     // check if material has the fat border chunk
01085     if( pcl_mat != NullFC )
01086     {
01087         const UInt32    cui_chunk_cnt = pcl_mat->getChunks( ).size( );
01088         UInt32          ui_chunk;
01089 
01090         for( ui_chunk = 0; ui_chunk < cui_chunk_cnt; ++ui_chunk )
01091         {
01092             if( FatBorderChunkPtr::dcast( pcl_mat->getChunks( ui_chunk ) ) != NullFC )
01093 //            if( VertexProgramChunkPtr::dcast( pcl_mat->getChunks( ui_chunk ) ) != NullFC )
01094             {
01095                 b_show_trimming = true;
01096                 break;
01097             }
01098         }
01099     }
01100 
01101 //    std::cerr<<"show_trimming: " << b_show_trimming << std::endl;
01102     if ( pcl_type == NullFC )
01103     {
01104         pcl_type = GeoPTypesUI8::create();
01105     }
01106     if ( pcl_size == NullFC )
01107     {
01108         pcl_size = GeoPLengthsUI32::create();
01109     }
01110     if ( pcl_points == NullFC )
01111     {
01112         pcl_points = GeoPositions3f::create();
01113     }
01114     if ( ( norms.size( ) > 0 ) && ( pcl_norms == NullFC ) )
01115     {
01116         pcl_norms = GeoNormals3f::create();
01117     }
01118     if ( pcl_indices == NullFC )
01119     {
01120         pcl_indices = GeoIndicesUI32::create();
01121     }
01122     if ( ( texcoords.size( ) > 0 ) && ( pcl_texcoords == NullFC ) )
01123     {
01124         pcl_texcoords = GeoTexCoords2f::create();
01125     }
01126     if( b_show_trimming )
01127     {
01128         if( pcl_tangents == NullFC )
01129         {
01130             pcl_tangents = GeoTexCoords3f::create( );
01131         }
01132     }
01133     else
01134     {
01135         if( pcl_tangents != NullFC )
01136         {
01137             beginEditCP( thisPtr, Geometry::TexCoordsFieldMask );
01138             {
01139                 setTexCoords( NullFC );
01140             }
01141             endEditCP( thisPtr, Geometry::TexCoordsFieldMask );
01142         }
01143     }
01144     
01145     // check for unused points
01146     for( ui_vert = 0; ui_vert < cui_verts; ++ui_vert )
01147     {
01148         vi_new_idx[ ui_vert ] = -1;
01149     }
01150     for( ui_face = 0; ui_face < cui_faces; ++ui_face )
01151     {
01152         pcl_face = &triangles[ ui_face ];
01153         vi_new_idx[ pcl_face->vertices[ 0 ] ] = 0;
01154         vi_new_idx[ pcl_face->vertices[ 1 ] ] = 0;
01155         vi_new_idx[ pcl_face->vertices[ 2 ] ] = 0;
01156     }
01157 
01158     // calculate new indices
01159     ui_used = 0;
01160     for( ui_vert = 0; ui_vert < cui_verts; ++ui_vert )
01161     {
01162         if( vi_new_idx[ ui_vert ] >= 0 )
01163         {
01164             vi_new_idx[ ui_vert ] = ui_used;
01165             ++ui_used;
01166         }
01167     }
01168 
01169 //  m_vtSurfaces[ uiSurface ].uiTriangleCnt = cui_faces;
01170 //  m_vclNormal.resize( m_vclParameterVertices.size( ) );
01171 
01172     beginEditCP( pcl_type, GeoPTypesUI8::GeoPropDataFieldMask );
01173     {
01174 //        std::cerr<<"fuck3"<<std::endl; 
01175         pcl_type->clear();
01176 //        std::cerr<<"fuck4"<<std::endl; 
01177         pcl_type->push_back( GL_TRIANGLES );
01178 //        std::cerr<<"fuck5"<<std::endl;
01179         if( b_show_trimming )
01180         {
01181             for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01182             {
01183                 pcl_type->push_back( GL_TRIANGLE_STRIP );
01184             }
01185         } // b_show_trimming
01186     }
01187     endEditCP( pcl_type, GeoPTypesUI8::GeoPropDataFieldMask );
01188 //    std::cerr<<"types"<<std::endl;
01189     beginEditCP( pcl_size, GeoPLengthsUI32::GeoPropDataFieldMask );
01190     {
01191         pcl_size->clear();
01192         pcl_size->push_back( 3 * cui_faces );
01193         ui_idx = 3 * cui_faces;
01194         if ( b_show_trimming )
01195         {
01196             for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01197             {
01198                 pcl_size->push_back( 2 + 2 * pt_surfdata->vvclEdgeLoops[ ui_loop ].size( ) );
01199                 ui_idx += 2 + 2 * pt_surfdata->vvclEdgeLoops[ ui_loop ].size( );
01200             }
01201         }
01202 //      std::cerr << ui_idx << " indices" << std::endl;
01203     }
01204     endEditCP( pcl_size, GeoPLengthsUI32::GeoPropDataFieldMask );
01205 //    std::cerr<<"size"<<std::endl;
01206 
01207     beginEditCP( pcl_points, GeoPositions3f::GeoPropDataFieldMask );
01208     {
01209         pcl_points->clear();
01210         for( ui_vert = 0; ui_vert < cui_verts; ++ui_vert )
01211         {
01212             if( vi_new_idx[ ui_vert ] >= 0 )
01213             {
01214                 pcl_points->push_back( gverts[ ui_vert ] );
01215             }
01216         }
01217         if( b_show_trimming )
01218         {
01219             for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01220             {
01221                 ui_vertex_cnt = pt_surfdata->vvclEdgeLoops[ ui_loop ].size( );
01222                 for( ui_vert = 0; ui_vert < ui_vertex_cnt; ++ui_vert )
01223                 {
01224                     pcl_points->push_back( Pnt3f( pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ][0],
01225                                                   pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ][1],
01226                                                   pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ][2] ) );
01227                     pcl_points->push_back( Pnt3f( pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ][0],
01228                                                   pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ][1],
01229                                                   pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ][2] ) );
01230                 }
01231             }
01232         } // b_show_trimming
01233     }
01234     endEditCP( pcl_points, GeoPositions3f::GeoPropDataFieldMask );
01235 //    std::cerr<<"points"<<std::endl;
01236     
01237     if( norms.size( ) > 0 )
01238     {
01239         beginEditCP( pcl_norms, GeoNormals3f::GeoPropDataFieldMask );
01240         {
01241             pcl_norms->clear();
01242             for( ui_vert = 0; ui_vert < cui_verts; ++ui_vert )
01243             {
01244                 if( vi_new_idx[ ui_vert ] >= 0 )
01245                 {
01246                     pcl_norms->push_back( norms[ ui_vert ] );
01247                 }
01248             }
01249             if( b_show_trimming )
01250             {
01251                 for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01252                 {
01253                     ui_vertex_cnt = pt_surfdata->vvclEdgeLoops[ ui_loop ].size( );
01254                     for( ui_vert = 0; ui_vert < ui_vertex_cnt; ++ui_vert )
01255                     {
01256                         pcl_norms->push_back( Vec3f( pt_surfdata->vvclEdgeLoopsNorm[ ui_loop ][ ui_vert ][0],
01257                                                      pt_surfdata->vvclEdgeLoopsNorm[ ui_loop ][ ui_vert ][1],
01258                                                      pt_surfdata->vvclEdgeLoopsNorm[ ui_loop ][ ui_vert ][2] ) );
01259                         pcl_norms->push_back( Vec3f( pt_surfdata->vvclEdgeLoopsNorm[ ui_loop ][ ui_vert ][0],
01260                                                      pt_surfdata->vvclEdgeLoopsNorm[ ui_loop ][ ui_vert ][1],
01261                                                      pt_surfdata->vvclEdgeLoopsNorm[ ui_loop ][ ui_vert ][2] ) );
01262                     }
01263                 }
01264             } // b_show_trimming
01265         }
01266         endEditCP( pcl_norms, GeoNormals3f::GeoPropDataFieldMask );
01267 //      std::cerr<<"norms"<<std::endl;
01268     }
01269     
01270     if( texcoords.size( ) > 0 )
01271     {
01272         beginEditCP( pcl_texcoords, GeoTexCoords2f::GeoPropDataFieldMask );
01273         {
01274             pcl_texcoords->clear();
01275             for( ui_vert = 0; ui_vert < cui_verts; ++ui_vert )
01276             {
01277                 if( vi_new_idx[ ui_vert ] >= 0 )
01278                 {
01279                     pcl_texcoords->push_back( Vec2f( texcoords[ ui_vert ][ 0 ], 
01280                                                      texcoords[ ui_vert ][ 1 ] ) );
01281 //                    std::cerr<<"texcoords: " << texcoords[ ui_vert ][ 0 ] << 
01282 //                               " " << texcoords[ ui_vert ][ 1 ] << std::endl;
01283                 }
01284             }
01285             if ( b_show_trimming )
01286             {
01287                 for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01288                 {
01289                     ui_vertex_cnt = pt_surfdata->vvclEdgeLoops[ ui_loop ].size( );
01290                     for( ui_vert = 0; ui_vert < ui_vertex_cnt; ++ui_vert )
01291                     {
01292                         pcl_texcoords->push_back( Vec2f( pt_surfdata->vvclEdgeLoopsTex[ ui_loop ][ ui_vert ][0],
01293                                                          pt_surfdata->vvclEdgeLoopsTex[ ui_loop ][ ui_vert ][1] ) );
01294                         pcl_texcoords->push_back( Vec2f( pt_surfdata->vvclEdgeLoopsTex[ ui_loop ][ ui_vert ][0],
01295                                                          pt_surfdata->vvclEdgeLoopsTex[ ui_loop ][ ui_vert ][1] ) );
01296                     }
01297                 }
01298             } // b_show_trimming
01299         }
01300         endEditCP( pcl_texcoords, GeoTexCoords2f::GeoPropDataFieldMask );
01301     }
01302 
01303     if( b_show_trimming )
01304     {
01305         beginEditCP( pcl_tangents, GeoTexCoords3f::GeoPropDataFieldMask );
01306         {
01307             pcl_tangents->clear();
01308             for( ui_vert = 0; ui_vert < cui_verts; ++ui_vert )
01309             {
01310                 if( vi_new_idx[ ui_vert ] >= 0 )
01311                 {
01312                     pcl_tangents->getFieldPtr( )->push_back( Vec3f( 0.0, 0.0, 0.0 ) );
01313                 }
01314             }
01315             for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01316             {
01317                 ui_vertex_cnt = pt_surfdata->vvclEdgeLoops[ ui_loop ].size( );
01318                 for( ui_vert = 0; ui_vert < ui_vertex_cnt; ++ui_vert )
01319                 {
01320                     if( ui_vert == 0 ) 
01321                     {
01322                         pcl_prevv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vertex_cnt - 1 ];
01323                         pcl_nextv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ 1 ];
01324                     }
01325                     else if ( ui_vert == ui_vertex_cnt - 1 )
01326                     {
01327                         pcl_prevv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert - 1 ];
01328                         pcl_nextv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ 0 ];
01329                     }
01330                     else
01331                     {
01332                         pcl_prevv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert - 1 ];
01333                         pcl_nextv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert + 1 ];
01334                     }
01335                     pcl_actv = &pt_surfdata->vvclEdgeLoops3D[ ui_loop ][ ui_vert ];
01336                     // calculate the tangents of the trimming polyloops:
01337                     // (nextv - actv).normalize() plus
01338                     // (actv - prevv).normalize()  -> and normalize it again
01339                     cl_v1[0] = (*pcl_nextv)[0] - (*pcl_actv)[0];
01340                     cl_v1[1] = (*pcl_nextv)[1] - (*pcl_actv)[1];
01341                     cl_v1[2] = (*pcl_nextv)[2] - (*pcl_actv)[2];
01342                     cl_v1.normalize();
01343                     cl_v2[0] = (*pcl_actv)[0] - (*pcl_prevv)[0];
01344                     cl_v2[1] = (*pcl_actv)[1] - (*pcl_prevv)[1];
01345                     cl_v2[2] = (*pcl_actv)[2] - (*pcl_prevv)[2];
01346                     cl_v2.normalize();
01347                     cl_tangent = cl_v1 + cl_v2;
01348                     cl_tangent.normalize( );
01349 
01350                     cl_tangent *= sqrt( getError( ) );
01351 
01352                     pcl_tangents->getFieldPtr( )->push_back( -cl_tangent );
01353                     pcl_tangents->getFieldPtr( )->push_back( cl_tangent );
01354                 }
01355             }
01356         }
01357         endEditCP( pcl_tangents, GeoTexCoords3f::GeoPropDataFieldMask );
01358 //      std::cerr<<"tangents"<<std::endl;
01359     } // b_show_trimming
01360     
01361     beginEditCP( pcl_indices, GeoIndicesUI32::GeoPropDataFieldMask );
01362     {
01363         pcl_indices->clear();
01364         for( ui_face = 0; ui_face < cui_faces; ++ui_face )
01365         {
01366             pcl_face = &triangles[ ui_face ];
01367             if( ( norms.size( ) == 0 ) ||
01368                 ( checkOrient( pcl_face->vertices[ 0 ], 
01369                                pcl_face->vertices[ 1 ],
01370                                pcl_face->vertices[ 2 ], gverts, norms ) ) )
01371             {
01372                 pcl_indices->push_back( vi_new_idx[ pcl_face->vertices[ 0 ] ] );
01373                 pcl_indices->push_back( vi_new_idx[ pcl_face->vertices[ 1 ] ] );
01374                 pcl_indices->push_back( vi_new_idx[ pcl_face->vertices[ 2 ] ] );
01375             }
01376             else
01377             {
01378                 pcl_indices->push_back( vi_new_idx[ pcl_face->vertices[ 0 ] ] );
01379                 pcl_indices->push_back( vi_new_idx[ pcl_face->vertices[ 2 ] ] );
01380                 pcl_indices->push_back( vi_new_idx[ pcl_face->vertices[ 1 ] ] );
01381             }
01382         }
01383         ui_idx = ui_used;
01384         if( b_show_trimming )
01385         {
01386             for( ui_loop = 0; ui_loop < cui_loop_cnt; ++ui_loop )
01387             {
01388                 ui_vertex_cnt = pt_surfdata->vvclEdgeLoops[ ui_loop ].size( );
01389                 for( ui_vert = 0; ui_vert < ui_vertex_cnt; ++ui_vert )
01390                 {
01391                     pcl_indices->push_back( ui_idx++ );
01392                     pcl_indices->push_back( ui_idx++ );
01393                 }
01394                 pcl_indices->push_back( ui_idx - 2 * ui_vertex_cnt );
01395                 pcl_indices->push_back( ui_idx - 2 * ui_vertex_cnt + 1 );
01396             }
01397 //          std::cerr << ui_idx + 2 * cui_loop_cnt << " indices used" << std::endl;
01398         } // b_show_trimming
01399     }
01400     endEditCP( pcl_indices, GeoIndicesUI32::GeoPropDataFieldMask );
01401 //    std::cerr<<"indices"<<std::endl;
01402 
01403     if( b_show_trimming )
01404     {
01405         if( norms.size( ) > 0 )
01406         {
01407             if( texcoords.size( ) > 0 ) // fatborders, normals and standard textures
01408             {
01409                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01410                                       Geometry::LengthsFieldMask |
01411                                       Geometry::IndicesFieldMask |
01412                                       Geometry::PositionsFieldMask |
01413                                       Geometry::NormalsFieldMask |
01414                                       Geometry::TexCoordsFieldMask |
01415                                       Geometry::IndexMappingFieldMask |
01416                                       Geometry::TexCoords1FieldMask );
01417                 {
01418                     setTypes( pcl_type );
01419                     setLengths( pcl_size );
01420                     setIndices( pcl_indices );
01421 
01422                     setPositions( pcl_points );
01423                     setNormals( pcl_norms );
01424                     setTexCoords( pcl_tangents );
01425                     setTexCoords1( pcl_texcoords );
01426 
01427                     calcIndexMapping();
01428                     //                   std::cerr<<"setting stuph3 "<<std::endl;
01429                 }
01430                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01431                                     Geometry::LengthsFieldMask |
01432                                     Geometry::IndicesFieldMask |
01433                                     Geometry::PositionsFieldMask |
01434                                     Geometry::NormalsFieldMask |
01435                                     Geometry::TexCoordsFieldMask |
01436                                     Geometry::IndexMappingFieldMask |
01437                                     Geometry::TexCoords1FieldMask );
01438             }
01439             else // fatborders, normals but no standard textures (most used case)
01440             {
01441                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01442                                       Geometry::LengthsFieldMask |
01443                                       Geometry::IndicesFieldMask |
01444                                       Geometry::PositionsFieldMask |
01445                                       Geometry::NormalsFieldMask |
01446                                       Geometry::IndexMappingFieldMask |
01447                                       Geometry::TexCoordsFieldMask |
01448                                       Geometry::TexCoords1FieldMask );
01449                 {
01450                    setTypes( pcl_type );
01451                    setLengths( pcl_size );
01452                    setIndices( pcl_indices );
01453 
01454                    setPositions( pcl_points );
01455                    setNormals( pcl_norms );
01456                    setTexCoords( pcl_tangents );
01457 
01458                     calcIndexMapping();
01459 //                   std::cerr<<"setting stuph!"<<std::endl;
01460                 }
01461                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01462                                     Geometry::LengthsFieldMask |
01463                                     Geometry::IndicesFieldMask |
01464                                     Geometry::PositionsFieldMask |
01465                                     Geometry::NormalsFieldMask |
01466                                     Geometry::IndexMappingFieldMask |
01467                                     Geometry::TexCoordsFieldMask |
01468                                     Geometry::TexCoords1FieldMask );
01469             }
01470         }
01471         else
01472         {
01473             if( texcoords.size( ) > 0 ) //fatborders and normalmaps and no textures
01474             {
01475                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01476                                       Geometry::LengthsFieldMask |
01477                                       Geometry::IndicesFieldMask |
01478                                       Geometry::PositionsFieldMask |
01479                                       Geometry::TexCoordsFieldMask |
01480                                       Geometry::IndexMappingFieldMask |
01481                                       Geometry::TexCoords1FieldMask );
01482                 {
01483                    setTypes( pcl_type );
01484                    setLengths( pcl_size );
01485                    setIndices( pcl_indices );
01486 
01487                    setPositions( pcl_points );
01488                    setTexCoords( pcl_tangents );
01489                    setTexCoords1( pcl_texcoords );
01490 
01491                     calcIndexMapping();
01492 
01493                 }
01494                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01495                                     Geometry::LengthsFieldMask |
01496                                     Geometry::IndicesFieldMask |
01497                                     Geometry::PositionsFieldMask |
01498                                     Geometry::TexCoordsFieldMask |
01499                                     Geometry::IndexMappingFieldMask |
01500                                     Geometry::TexCoords1FieldMask );
01501             }
01502             else // fatborders, no normals, no textures -- makes no sense??? NPR?
01503                  // essentially flat-shading
01504             {
01505                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01506                                       Geometry::LengthsFieldMask |
01507                                       Geometry::IndicesFieldMask |
01508                                       Geometry::PositionsFieldMask |
01509                                       Geometry::IndexMappingFieldMask |
01510                                       Geometry::TexCoordsFieldMask |
01511                                       Geometry::TexCoords1FieldMask );
01512                 {
01513                    setTypes( pcl_type );
01514                    setLengths( pcl_size );
01515                    setIndices( pcl_indices );
01516 
01517                    setPositions( pcl_points );
01518                    setTexCoords( pcl_tangents );
01519 
01520                     calcIndexMapping();
01521 
01522 //                   std::cerr<<"setting stuph2"<<std::endl;
01523                 }
01524                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01525                                     Geometry::LengthsFieldMask |
01526                                     Geometry::IndicesFieldMask |
01527                                     Geometry::PositionsFieldMask |
01528                                     Geometry::IndexMappingFieldMask |
01529                                     Geometry::TexCoordsFieldMask |
01530                                     Geometry::TexCoords1FieldMask );
01531             }
01532         }
01533     }
01534     else
01535     {
01536         if( norms.size( ) > 0 )
01537         {
01538             if( texcoords.size( ) > 0 )  // no fatborders, normals and standard textures
01539             {
01540                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01541                                       Geometry::LengthsFieldMask |
01542                                       Geometry::IndicesFieldMask |
01543                                       Geometry::PositionsFieldMask |
01544                                       Geometry::NormalsFieldMask |
01545                                       Geometry::TexCoordsFieldMask |
01546                                       Geometry::IndexMappingFieldMask );
01547                 {
01548                    setTypes( pcl_type );
01549                    setLengths( pcl_size );
01550                    setIndices( pcl_indices );
01551 
01552                    setPositions( pcl_points );
01553                    setNormals( pcl_norms );
01554                    setTexCoords( pcl_texcoords );
01555 
01556                     calcIndexMapping();
01557 
01558 //                   std::cerr<<"setting stuph4"<<std::endl;
01559                 }
01560                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01561                                     Geometry::LengthsFieldMask |
01562                                     Geometry::IndicesFieldMask |
01563                                     Geometry::PositionsFieldMask |
01564                                     Geometry::NormalsFieldMask |
01565                                     Geometry::TexCoordsFieldMask |
01566                                     Geometry::IndexMappingFieldMask );
01567             }
01568             else // no fatborders, normals but no standard textures
01569             {
01570                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01571                                       Geometry::LengthsFieldMask |
01572                                       Geometry::IndicesFieldMask |
01573                                       Geometry::PositionsFieldMask |
01574                                       Geometry::NormalsFieldMask |
01575                                       Geometry::IndexMappingFieldMask );
01576                 {
01577                    setTypes( pcl_type );
01578                    setLengths( pcl_size );
01579                    setIndices( pcl_indices );
01580 
01581                    setPositions( pcl_points );
01582                    setNormals( pcl_norms );
01583 
01584                     calcIndexMapping();
01585                 }
01586                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01587                                     Geometry::LengthsFieldMask |
01588                                     Geometry::IndicesFieldMask |
01589                                     Geometry::PositionsFieldMask |
01590                                     Geometry::NormalsFieldMask |
01591                                     Geometry::IndexMappingFieldMask );
01592             }
01593         }
01594         else
01595         {
01596             if( texcoords.size( ) > 0 ) // no fatborders, normalmaps
01597             {
01598                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01599                                       Geometry::LengthsFieldMask |
01600                                       Geometry::IndicesFieldMask |
01601                                       Geometry::PositionsFieldMask |
01602                                       Geometry::TexCoordsFieldMask |
01603                                       Geometry::IndexMappingFieldMask );
01604                 {
01605                    setTypes( pcl_type );
01606                    setLengths( pcl_size );
01607                    setIndices( pcl_indices );
01608 
01609                    setPositions( pcl_points );
01610                    setTexCoords( pcl_texcoords );
01611 
01612                     calcIndexMapping();
01613                 }
01614                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01615                                     Geometry::LengthsFieldMask |
01616                                     Geometry::IndicesFieldMask |
01617                                     Geometry::PositionsFieldMask |
01618                                     Geometry::TexCoordsFieldMask |
01619                                     Geometry::IndexMappingFieldMask  );
01620             }
01621             else // no fatborders, no normals, no textures
01622             {
01623                 beginEditCP( thisPtr, Geometry::TypesFieldMask |
01624                                       Geometry::LengthsFieldMask |
01625                                       Geometry::IndicesFieldMask |
01626                                       Geometry::PositionsFieldMask |
01627                                       Geometry::IndexMappingFieldMask  );
01628                 {
01629                    setTypes( pcl_type );
01630                    setLengths( pcl_size );
01631                    setIndices( pcl_indices );
01632 
01633                    setPositions( pcl_points );
01634 
01635                    calcIndexMapping();
01636                 }
01637                 endEditCP( thisPtr, Geometry::TypesFieldMask |
01638                                     Geometry::LengthsFieldMask |
01639                                     Geometry::IndicesFieldMask |
01640                                     Geometry::PositionsFieldMask |
01641                                     Geometry::IndexMappingFieldMask  );
01642             }
01643         }
01644     }
01645 
01646 //        std::cerr<<"Surface::buildSurface:   texcoords ptr: " << getTexCoords() << std::endl;
01647 //        std::cerr<<"Surface::buildSurface:   texcoords1 ptr: " << getTexCoords1() << std::endl;
01648         
01649 
01650     // build new display list if used
01651 //  invalidateDlistCache( );
01652 
01653     return 0;
01654 }

bool Surface::checkOrient ( UInt32  ui_v1,
UInt32  ui_v2,
UInt32  ui_v3,
std::vector< Pnt3f > &  m_vclGlobalVertices,
std::vector< Vec3f > &  m_vclNormal 
) [protected]

Definition at line 1658 of file OSGSurface.cpp.

References osg::VectorInterface< ValueTypeT, StorageInterfaceT >::cross(), and osg::VectorInterface< ValueTypeT, StorageInterfaceT >::dot().

Referenced by buildSurface().

01661 {
01662     const Vec3f ccl_norm_p = m_vclNormal[ ui_v1 ] + m_vclNormal[ ui_v2 ] + m_vclNormal[ ui_v3 ];
01663     const Vec3f ccl_vec1 = m_vclGlobalVertices[ ui_v2 ] - m_vclGlobalVertices[ ui_v1 ];
01664     const Vec3f ccl_vec2 = m_vclGlobalVertices[ ui_v3 ] - m_vclGlobalVertices[ ui_v1 ];
01665     const Vec3f ccl_norm_t = ccl_vec1.cross( ccl_vec2 );
01666 
01667     // FIXME: is 0.0 really better than -DCTP_EPS ?
01668     return( ccl_norm_p.dot( ccl_norm_t ) > 0.0 );
01669 }

bool Surface::updateError ( Pnt3f  viewPos,
Real64  halfPixelSize 
) [protected]

Definition at line 378 of file OSGSurface.cpp.

References osg::beginEditCP(), osg::endEditCP(), osg::SurfaceBase::ErrorFieldMask, getDesiredError(), osg::SurfaceBase::getError(), osg::osgMin(), and osg::SurfaceBase::setError().

00379 {
00380     Real64  d_max_error = getDesiredError( viewPos, halfPixelSize );
00381 
00382     // FIXME: this will convert the surface data once again,
00383     // not very effective... should only be retessellated !!!
00384     // FIXME: do we have to change the error in every frame ???
00385     Real32  current_error = getError();
00386     if ( d_max_error < current_error )
00387     {
00388         std::cerr << "retessellating due to too high error: " << d_max_error
00389                 << " " << current_error << std::endl;
00390         Real32 new_error = osgMin( d_max_error, current_error / 2.0 );
00391         SurfacePtr thisPtr =  SurfacePtr( this );    
00392         beginEditCP( thisPtr, Surface::ErrorFieldMask );
00393         {
00394             setError( d_max_error / 2.0 );
00395         }
00396         endEditCP( thisPtr, Surface::ErrorFieldMask );
00397     }
00398     else if ( d_max_error > current_error * 4.0 )
00399     {
00400         std::cerr << "retessellating due to too low error: " << d_max_error
00401                 << " " << current_error << std::endl;
00402         SurfacePtr thisPtr =  SurfacePtr( this );    
00403         beginEditCP( thisPtr, Surface::ErrorFieldMask );
00404         {
00405             setError( d_max_error / 2.0 );
00406         }
00407         endEditCP( thisPtr, Surface::ErrorFieldMask );
00408     }
00409     return true;  
00410 }

void Surface::FindClosestPoint ( Vec3f rDist,
const Pnt3f  viewPos 
) const [protected]

Definition at line 419 of file OSGSurface.cpp.

References osg::DynamicVolume::BOX_VOLUME, osg::NodeCore::getParents(), osg::SurfaceBase::getType(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::length(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::DynamicVolume::SPHERE_VOLUME, and osg::VectorInterface< ValueTypeT, StorageInterfaceT >::squareLength().

Referenced by getDesiredError().

00420 {
00421     const UInt32    parent_cnt = getParents( ).size( );
00422     UInt32          parent_idx;
00423     Real64          min_dist = 1e300;
00424     Vec3f           temp_dist;
00425     Real64          curr_dist;
00426 
00427     for( parent_idx = 0; parent_idx < parent_cnt; ++parent_idx )
00428     {
00429         switch( getParents( )[ 0 ]->getVolume( ).getType( ) )
00430         {
00431         case DynamicVolume::BOX_VOLUME:
00432             {
00433                 Pnt3f   bb_min, bb_max;
00434 
00435                 getParents( )[ 0 ]->getVolume( ).getBounds( bb_min, bb_max );
00436 
00437 //              std::cerr << bb_min << " " << bb_max << " " << viewPos << std::endl;
00438 
00439                 if( viewPos[0] < bb_min[0] )
00440                 {
00441                     temp_dist[0] = viewPos[0] - bb_min[0];
00442                 }
00443                 else if( viewPos[0] > bb_max[0] )
00444                 {
00445                     temp_dist[0] = viewPos[0] - bb_max[0];
00446                 }
00447                 else
00448                 {
00449                     temp_dist[0] = 0.0;
00450                 }
00451 
00452                 if( viewPos[1] < bb_min[1] )
00453                 {
00454                     temp_dist[1] = viewPos[1] - bb_min[1];
00455                 }
00456                 else if( viewPos[1] > bb_max[1] )
00457                 {
00458                     temp_dist[1] = viewPos[1] - bb_max[1];
00459                 }
00460                 else
00461                 {
00462                     temp_dist[1] = 0.0;
00463                 }
00464 
00465                 if( viewPos[2] < bb_min[2] )
00466                 {
00467                     temp_dist[2] = viewPos[2] - bb_min[2];
00468                 }
00469                 else if( viewPos[2] > bb_max[2] )
00470                 {
00471                     temp_dist[2] = viewPos[2] - bb_max[2];
00472                 }
00473                 else
00474                 {
00475                     temp_dist[2] = 0.0;
00476                 }
00477             }
00478             break;
00479         case DynamicVolume::SPHERE_VOLUME:
00480             {
00481                 Real64  length;
00482                 Pnt3f   center;
00483 
00484                 getParents( )[ 0 ]->getVolume( ).getCenter( center );
00485                 temp_dist = center - viewPos;
00486                 length = temp_dist.length( ) - getParents( )[ 0 ]->getVolume( ).getScalarVolume( );
00487                 if( length > 0.0 )
00488                 {
00489                     temp_dist.normalize( );
00490                     temp_dist *= length;
00491                 }
00492                 else
00493                 {
00494                     temp_dist[0] = temp_dist[1] = temp_dist[2] = 0.0;
00495                 }
00496             }
00497             break;
00498         }
00499         curr_dist = temp_dist.squareLength( );
00500         if( curr_dist < min_dist )
00501         {
00502             min_dist = curr_dist;
00503             rDist = temp_dist;
00504         }
00505     }
00506 }

void Surface::FindClosestPointExact ( Vec3f rDist,
const Pnt3f  viewPos 
) const [protected]

Definition at line 509 of file OSGSurface.cpp.

References osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::GeometryBase::getPositions(), and osg::VectorInterface< ValueTypeT, StorageInterfaceT >::squareLength().

00510 {
00511 //  const GeoPositions3fPtr cpcl_points = GeoPositions3fPtr::dcast( cpcl_geo->getPositions( ) );
00512     const GeoPositions3fPtr cpcl_points = GeoPositions3fPtr::dcast( getPositions() );
00513     const unsigned int      cui_idx_cnt = cpcl_points->getSize( );
00514     Pnt3f                   cl_pos;
00515     unsigned int            ui_idx;
00516     Vec3f                   cl_temp;
00517     double                  d_min = DBL_MAX;
00518     double                  d_temp;
00519 
00520     for( ui_idx = 0; ui_idx < cui_idx_cnt; ++ui_idx )
00521     {
00522         cl_pos = cpcl_points->getValue( ui_idx );
00523         cl_temp = cl_pos - viewPos;
00524         d_temp = cl_temp.squareLength( );
00525         if( d_temp <= d_min )
00526         {
00527             d_min = d_temp;
00528             rDist = cl_temp;
00529         }
00530     }
00531 }

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

Definition at line 2125 of file OSGSurface.cpp.

References osg::GeometryBase::_sfIgnoreGLForAspect, osg::beginEditCP(), osg::endEditCP(), osg::PThreadBase::getAspect(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::GlobalSystemState, handleGL(), osg::Geometry::onCreate(), osg::osgTypedMethodVoidFunctor2ObjCPtrPtr(), osg::Window::registerGLObject(), osg::SurfaceBase::setSurfaceGLId(), osg::Startup, and osg::SurfaceBase::SurfaceGLIdFieldMask.

02126 {
02127     // if we're in startup this is the prototype, which shouldn't have an id
02128     if(GlobalSystemState == Startup)
02129         return;
02130 
02131     // !!! this temporary is needed to work around compiler problems(sgi)
02132     // CHECK CHECK
02133     //  TextureChunkPtr tmpPtr = FieldContainer::getPtr<TextureChunkPtr>(*this);
02134     if(Thread::getAspect() != _sfIgnoreGLForAspect.getValue())
02135     {
02136         SurfacePtr tmpPtr(*this);
02137     
02138         beginEditCP(tmpPtr, Surface::SurfaceGLIdFieldMask);
02139     
02140         setSurfaceGLId(
02141             Window::registerGLObject(
02142                 osgTypedMethodVoidFunctor2ObjCPtrPtr<SurfacePtr, 
02143                                                      Window , 
02144                                                      UInt32>(tmpPtr, 
02145                                                              &Surface::handleGL),
02146                 1));
02147     
02148         endEditCP(tmpPtr, Surface::SurfaceGLIdFieldMask);
02149     }
02150 
02151     Inherited::onCreate(source);
02152 }

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

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

OpenGL object handler. Used for DisplayList caching.

Reimplemented from osg::Geometry.

Definition at line 2188 of file OSGSurface.cpp.

References osg::beginEditCP(), osg::SurfaceBase::DirtyMaskFieldMask, DONTTESSELLATE, osg::endEditCP(), osg::SurfaceBase::getDirtyMask(), osg::Window::initialize, osg::Window::needrefresh, osg::Window::reinitialize, reTessellate(), RETESSELLATE, tessellate(), TESSELLATE, and osg::Window::unpackIdStatus().

Referenced by onCreate().

02189 {
02190     Window::GLObjectStatusE mode;
02191     UInt32 id;
02192 
02193     Window::unpackIdStatus(idstatus, id, mode);
02194 
02195     if(mode == Window::initialize  || 
02196        mode == Window::needrefresh ||
02197        mode == Window::reinitialize )
02198     {       
02199         if((getDirtyMask() & DONTTESSELLATE) == 0x0000)
02200         {
02201             if((getDirtyMask() & TESSELLATE) != 0x0000)
02202             {
02203                 tessellate( );
02204             }
02205             else if((getDirtyMask() & RETESSELLATE) != 0x0000)
02206             {
02207                 reTessellate( );
02208             }
02209 
02210             SurfacePtr tmpPtr(*this);
02211             beginEditCP(tmpPtr, DirtyMaskFieldMask);
02212             {
02213                 getDirtyMask() &= ~(TESSELLATE | RETESSELLATE);
02214             }
02215             endEditCP  (tmpPtr, DirtyMaskFieldMask);
02216         }
02217     }
02218 }

void Surface::adjustVolume ( Volume volume  )  [protected, virtual]

Reimplemented from osg::Geometry.

Definition at line 2227 of file OSGSurface.cpp.

References osg::SurfaceBase::_sfControlPoints, osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::Volume::extendBy(), osg::SurfaceBase::getControlPoints(), osg::GeometryBase::getPositions(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::osgabs(), osg::Volume::setEmpty(), and osg::Volume::setValid().

02228 {
02229     GeoPositionsPtr pos = getControlPoints();
02230     bool has_zeroweights = false;
02231     
02232     volume.setValid();
02233     volume.setEmpty();
02234 
02235     GeoPositions3fPtr pPos = GeoPositions3fPtr::dcast(
02236         _sfControlPoints.getValue());
02237     GeoPositions4fPtr pRatPos = GeoPositions4fPtr::dcast(
02238         _sfControlPoints.getValue());
02239 
02240     if(pos == NullFC)
02241         return;                  // Node has no points, no volume
02242 
02243     if( pPos != NullFC )
02244     {
02245         for(UInt32 i = 0; i < pPos->size(); ++i)
02246         {
02247             volume.extendBy(pPos->getValue(i));
02248         }
02249     }
02250     else if( pRatPos != NullFC )
02251     {
02252         for(UInt32 i = 0; i < pRatPos->size(); ++i)
02253         {
02254             Pnt3f   pnt;
02255 
02256             if( osgabs( pRatPos->getFieldPtr()->getValue(i)[3] ) > DCTP_EPS )
02257             {
02258                 pnt[0] = pRatPos->getFieldPtr()->getValue(i)[0] / pRatPos->getFieldPtr()->getValue(i)[3];
02259                 pnt[1] = pRatPos->getFieldPtr()->getValue(i)[1] / pRatPos->getFieldPtr()->getValue(i)[3];
02260                 pnt[2] = pRatPos->getFieldPtr()->getValue(i)[2] / pRatPos->getFieldPtr()->getValue(i)[3];
02261                 volume.extendBy(pnt);
02262             }
02263             else
02264             {
02265                 has_zeroweights = true;
02266             }
02267         }
02268     }
02269     if (has_zeroweights)
02270     {
02271         GeoPositionsPtr points = getPositions();
02272         if (points != NullFC)
02273         {
02274             for(UInt32 i = 0; i < points->size(); ++i)
02275             {
02276                 volume.extendBy(points->getValue(i));
02277             }
02278         }
02279         // FIXME: a warning should be printed here since the calculated
02280         // FIXME: volume will not be exact if there was no tessellated 
02281         // FIXME: geometry, but in that case there's nothing to render 
02282         // FIXME: anyway so we skip the warning (which would be  
02283         // FIXME: unnecessarily (and annoyingly) printed at startup 
02284         // FIXME: e.g. when the SSM::showall() method is called).
02285         // FIXME: Better suggestions are welcome.
02286     }
02287 }

Action::ResultE Surface::drawPrimitives ( DrawActionBase action  )  [protected, virtual]

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

void Surface::calcIndexMapping ( void   )  [private]

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

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

Reimplemented from osg::GeometryBase.

Definition at line 58 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_type.

Referenced by osg::SurfaceBase::create(), initMethod(), and osg::RemoteAspect::RemoteAspect().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::GeometryBase.

Definition at line 65 of file OSGSurfaceBase.inl.

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

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

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

Reimplemented from osg::GeometryBase.

Definition at line 271 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::_type.

Referenced by FindClosestPoint().

00272 {
00273     return _type; 
00274 } 

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

Reimplemented from osg::GeometryBase.

Definition at line 276 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::_type.

00277 {
00278     return _type;
00279 } 

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

Reimplemented from osg::GeometryBase.

Definition at line 291 of file OSGSurfaceBase.cpp.

00292 { 
00293     return sizeof(Surface); 
00294 }

SFUInt32 * osg::SurfaceBase::getSFDimU ( void   )  [inline, inherited]

Definition at line 101 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimU.

00102 {
00103     return &_sfDimU;
00104 }

SFUInt32 * osg::SurfaceBase::getSFDimV ( void   )  [inline, inherited]

Definition at line 108 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimV.

00109 {
00110     return &_sfDimV;
00111 }

MFReal32 * osg::SurfaceBase::getMFKnotsU ( void   )  [inline, inherited]

Definition at line 115 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsU.

Referenced by clone().

00116 {
00117     return &_mfKnotsU;
00118 }

MFReal32 * osg::SurfaceBase::getMFKnotsV ( void   )  [inline, inherited]

Definition at line 122 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsV.

Referenced by clone().

00123 {
00124     return &_mfKnotsV;
00125 }

SFGeoPositionsPtr * osg::SurfaceBase::getSFControlPoints ( void   )  [inline, inherited]

Definition at line 129 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfControlPoints.

00130 {
00131     return &_sfControlPoints;
00132 }

SFReal32 * osg::SurfaceBase::getSFError ( void   )  [inline, inherited]

Definition at line 136 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfError.

00137 {
00138     return &_sfError;
00139 }

SFBool * osg::SurfaceBase::getSFIsDelaunay ( void   )  [inline, inherited]

Definition at line 185 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfIsDelaunay.

00186 {
00187     return &_sfIsDelaunay;
00188 }

SFGeoTexCoordsPtr * osg::SurfaceBase::getSFTextureControlPoints ( void   )  [inline, inherited]

Definition at line 192 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfTextureControlPoints.

00193 {
00194     return &_sfTextureControlPoints;
00195 }

UInt32 & osg::SurfaceBase::getDimU ( void   )  [inline, inherited]

Definition at line 214 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimU, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by clone().

00215 {
00216     return _sfDimU.getValue();
00217 }

const UInt32 & osg::SurfaceBase::getDimU ( void   )  const [inline, inherited]

Definition at line 221 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimU, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00222 {
00223     return _sfDimU.getValue();
00224 }

UInt32 & osg::SurfaceBase::getDimV ( void   )  [inline, inherited]

Definition at line 235 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimV, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by clone().

00236 {
00237     return _sfDimV.getValue();
00238 }

const UInt32 & osg::SurfaceBase::getDimV ( void   )  const [inline, inherited]

Definition at line 242 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimV, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00243 {
00244     return _sfDimV.getValue();
00245 }

GeoPositionsPtr & osg::SurfaceBase::getControlPoints ( void   )  [inline, inherited]

Definition at line 256 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfControlPoints, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by adjustVolume(), and clone().

00257 {
00258     return _sfControlPoints.getValue();
00259 }

const GeoPositionsPtr & osg::SurfaceBase::getControlPoints ( void   )  const [inline, inherited]

Definition at line 263 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfControlPoints, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00264 {
00265     return _sfControlPoints.getValue();
00266 }

Real32 & osg::SurfaceBase::getError ( void   )  [inline, inherited]

Definition at line 277 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfError, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by buildSurface(), clone(), reTessellate(), and updateError().

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

const Real32 & osg::SurfaceBase::getError ( void   )  const [inline, inherited]

Definition at line 284 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfError, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00285 {
00286     return _sfError.getValue();
00287 }

bool & osg::SurfaceBase::getIsDelaunay ( void   )  [inline, inherited]

Definition at line 319 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfIsDelaunay, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by clone(), reTessellate(), and tessellateSurface().

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

const bool & osg::SurfaceBase::getIsDelaunay ( void   )  const [inline, inherited]

Definition at line 326 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfIsDelaunay, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00327 {
00328     return _sfIsDelaunay.getValue();
00329 }

GeoTexCoordsPtr & osg::SurfaceBase::getTextureControlPoints ( void   )  [inline, inherited]

Definition at line 340 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfTextureControlPoints, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by clone().

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

const GeoTexCoordsPtr & osg::SurfaceBase::getTextureControlPoints ( void   )  const [inline, inherited]

Definition at line 347 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfTextureControlPoints, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00348 {
00349     return _sfTextureControlPoints.getValue();
00350 }

Real32 & osg::SurfaceBase::getKnotsU ( const UInt32  index  )  [inline, inherited]

Definition at line 404 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsU.

00405 {
00406     return _mfKnotsU[index];
00407 }

MFReal32 & osg::SurfaceBase::getKnotsU ( void   )  [inline, inherited]

Definition at line 411 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsU.

00412 {
00413     return _mfKnotsU;
00414 }

const MFReal32 & osg::SurfaceBase::getKnotsU ( void   )  const [inline, inherited]

Definition at line 418 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsU.

00419 {
00420     return _mfKnotsU;
00421 }

Real32 & osg::SurfaceBase::getKnotsV ( const UInt32  index  )  [inline, inherited]

Definition at line 425 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsV.

00426 {
00427     return _mfKnotsV[index];
00428 }

MFReal32 & osg::SurfaceBase::getKnotsV ( void   )  [inline, inherited]

Definition at line 432 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsV.

00433 {
00434     return _mfKnotsV;
00435 }

const MFReal32 & osg::SurfaceBase::getKnotsV ( void   )  const [inline, inherited]

Definition at line 439 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotsV.

00440 {
00441     return _mfKnotsV;
00442 }

void osg::SurfaceBase::setDimU ( const UInt32 value  )  [inline, inherited]

Definition at line 228 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimU, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00229 {
00230     _sfDimU.setValue(value);
00231 }

void osg::SurfaceBase::setDimV ( const UInt32 value  )  [inline, inherited]

Definition at line 249 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDimV, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00250 {
00251     _sfDimV.setValue(value);
00252 }

void osg::SurfaceBase::setControlPoints ( const GeoPositionsPtr value  )  [inline, inherited]

void osg::SurfaceBase::setError ( const Real32 value  )  [inline, inherited]

Definition at line 291 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfError, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by reTessellate(), and updateError().

00292 {
00293     _sfError.setValue(value);
00294 }

void osg::SurfaceBase::setIsDelaunay ( const bool &  value  )  [inline, inherited]

Definition at line 333 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfIsDelaunay, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00334 {
00335     _sfIsDelaunay.setValue(value);
00336 }

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

Reimplemented from osg::GeometryBase.

Definition at line 390 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_mfKnotsU, osg::SurfaceBase::_mfKnotsV, osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfDimU, osg::SurfaceBase::_sfDimV, osg::SurfaceBase::_sfDirtyMask, osg::SurfaceBase::_sfError, osg::SurfaceBase::_sfIsDelaunay, osg::SurfaceBase::_sfNumCurves, osg::SurfaceBase::_sfSurfaceGLId, osg::SurfaceBase::_sfTextureControlPoints, osg::SurfaceBase::ControlPointsFieldMask, osg::SurfaceBase::CurveControlPointsFieldMask, osg::SurfaceBase::CurvesPerLoopFieldMask, osg::SurfaceBase::DimensionsFieldMask, osg::SurfaceBase::DimUFieldMask, osg::SurfaceBase::DimVFieldMask, osg::SurfaceBase::DirtyMaskFieldMask, osg::SurfaceBase::ErrorFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::GeometryBase::getBinSize(), osg::SurfaceBase::IsDelaunayFieldMask, osg::SurfaceBase::KnotLengthsFieldMask, osg::SurfaceBase::KnotsFieldMask, osg::SurfaceBase::KnotsUFieldMask, osg::SurfaceBase::KnotsVFieldMask, osg::FieldBits::NoField, osg::SurfaceBase::NumCurvesFieldMask, osg::SurfaceBase::SurfaceGLIdFieldMask, and osg::SurfaceBase::TextureControlPointsFieldMask.

00391 {
00392     UInt32 returnValue = Inherited::getBinSize(whichField);
00393 
00394     if(FieldBits::NoField != (DimUFieldMask & whichField))
00395     {
00396         returnValue += _sfDimU.getBinSize();
00397     }
00398 
00399     if(FieldBits::NoField != (DimVFieldMask & whichField))
00400     {
00401         returnValue += _sfDimV.getBinSize();
00402     }
00403 
00404     if(FieldBits::NoField != (KnotsUFieldMask & whichField))
00405     {
00406         returnValue += _mfKnotsU.getBinSize();
00407     }
00408 
00409     if(FieldBits::NoField != (KnotsVFieldMask & whichField))
00410     {
00411         returnValue += _mfKnotsV.getBinSize();
00412     }
00413 
00414     if(FieldBits::NoField != (ControlPointsFieldMask & whichField))
00415     {
00416         returnValue += _sfControlPoints.getBinSize();
00417     }
00418 
00419     if(FieldBits::NoField != (ErrorFieldMask & whichField))
00420     {
00421         returnValue += _sfError.getBinSize();
00422     }
00423 
00424     if(FieldBits::NoField != (NumCurvesFieldMask & whichField))
00425     {
00426         returnValue += _sfNumCurves.getBinSize();
00427     }
00428 
00429     if(FieldBits::NoField != (KnotLengthsFieldMask & whichField))
00430     {
00431         returnValue += _mfKnotLengths.getBinSize();
00432     }
00433 
00434     if(FieldBits::NoField != (DimensionsFieldMask & whichField))
00435     {
00436         returnValue += _mfDimensions.getBinSize();
00437     }
00438 
00439     if(FieldBits::NoField != (CurveControlPointsFieldMask & whichField))
00440     {
00441         returnValue += _mfCurveControlPoints.getBinSize();
00442     }
00443 
00444     if(FieldBits::NoField != (KnotsFieldMask & whichField))
00445     {
00446         returnValue += _mfKnots.getBinSize();
00447     }
00448 
00449     if(FieldBits::NoField != (CurvesPerLoopFieldMask & whichField))
00450     {
00451         returnValue += _mfCurvesPerLoop.getBinSize();
00452     }
00453 
00454     if(FieldBits::NoField != (IsDelaunayFieldMask & whichField))
00455     {
00456         returnValue += _sfIsDelaunay.getBinSize();
00457     }
00458 
00459     if(FieldBits::NoField != (TextureControlPointsFieldMask & whichField))
00460     {
00461         returnValue += _sfTextureControlPoints.getBinSize();
00462     }
00463 
00464     if(FieldBits::NoField != (DirtyMaskFieldMask & whichField))
00465     {
00466         returnValue += _sfDirtyMask.getBinSize();
00467     }
00468 
00469     if(FieldBits::NoField != (SurfaceGLIdFieldMask & whichField))
00470     {
00471         returnValue += _sfSurfaceGLId.getBinSize();
00472     }
00473 
00474 
00475     return returnValue;
00476 }

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

Reimplemented from osg::GeometryBase.

Definition at line 478 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_mfKnotsU, osg::SurfaceBase::_mfKnotsV, osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfDimU, osg::SurfaceBase::_sfDimV, osg::SurfaceBase::_sfDirtyMask, osg::SurfaceBase::_sfError, osg::SurfaceBase::_sfIsDelaunay, osg::SurfaceBase::_sfNumCurves, osg::SurfaceBase::_sfSurfaceGLId, osg::SurfaceBase::_sfTextureControlPoints, osg::SurfaceBase::ControlPointsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::GeometryBase::copyToBin(), osg::SurfaceBase::CurveControlPointsFieldMask, osg::SurfaceBase::CurvesPerLoopFieldMask, osg::SurfaceBase::DimensionsFieldMask, osg::SurfaceBase::DimUFieldMask, osg::SurfaceBase::DimVFieldMask, osg::SurfaceBase::DirtyMaskFieldMask, osg::SurfaceBase::ErrorFieldMask, osg::SurfaceBase::IsDelaunayFieldMask, osg::SurfaceBase::KnotLengthsFieldMask, osg::SurfaceBase::KnotsFieldMask, osg::SurfaceBase::KnotsUFieldMask, osg::SurfaceBase::KnotsVFieldMask, osg::FieldBits::NoField, osg::SurfaceBase::NumCurvesFieldMask, osg::SurfaceBase::SurfaceGLIdFieldMask, and osg::SurfaceBase::TextureControlPointsFieldMask.

00480 {
00481     Inherited::copyToBin(pMem, whichField);
00482 
00483     if(FieldBits::NoField != (DimUFieldMask & whichField))
00484     {
00485         _sfDimU.copyToBin(pMem);
00486     }
00487 
00488     if(FieldBits::NoField != (DimVFieldMask & whichField))
00489     {
00490         _sfDimV.copyToBin(pMem);
00491     }
00492 
00493     if(FieldBits::NoField != (KnotsUFieldMask & whichField))
00494     {
00495         _mfKnotsU.copyToBin(pMem);
00496     }
00497 
00498     if(FieldBits::NoField != (KnotsVFieldMask & whichField))
00499     {
00500         _mfKnotsV.copyToBin(pMem);
00501     }
00502 
00503     if(FieldBits::NoField != (ControlPointsFieldMask & whichField))
00504     {
00505         _sfControlPoints.copyToBin(pMem);
00506     }
00507 
00508     if(FieldBits::NoField != (ErrorFieldMask & whichField))
00509     {
00510         _sfError.copyToBin(pMem);
00511     }
00512 
00513     if(FieldBits::NoField != (NumCurvesFieldMask & whichField))
00514     {
00515         _sfNumCurves.copyToBin(pMem);
00516     }
00517 
00518     if(FieldBits::NoField != (KnotLengthsFieldMask & whichField))
00519     {
00520         _mfKnotLengths.copyToBin(pMem);
00521     }
00522 
00523     if(FieldBits::NoField != (DimensionsFieldMask & whichField))
00524     {
00525         _mfDimensions.copyToBin(pMem);
00526     }
00527 
00528     if(FieldBits::NoField != (CurveControlPointsFieldMask & whichField))
00529     {
00530         _mfCurveControlPoints.copyToBin(pMem);
00531     }
00532 
00533     if(FieldBits::NoField != (KnotsFieldMask & whichField))
00534     {
00535         _mfKnots.copyToBin(pMem);
00536     }
00537 
00538     if(FieldBits::NoField != (CurvesPerLoopFieldMask & whichField))
00539     {
00540         _mfCurvesPerLoop.copyToBin(pMem);
00541     }
00542 
00543     if(FieldBits::NoField != (IsDelaunayFieldMask & whichField))
00544     {
00545         _sfIsDelaunay.copyToBin(pMem);
00546     }
00547 
00548     if(FieldBits::NoField != (TextureControlPointsFieldMask & whichField))
00549     {
00550         _sfTextureControlPoints.copyToBin(pMem);
00551     }
00552 
00553     if(FieldBits::NoField != (DirtyMaskFieldMask & whichField))
00554     {
00555         _sfDirtyMask.copyToBin(pMem);
00556     }
00557 
00558     if(FieldBits::NoField != (SurfaceGLIdFieldMask & whichField))
00559     {
00560         _sfSurfaceGLId.copyToBin(pMem);
00561     }
00562 
00563 
00564 }

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

Reimplemented from osg::GeometryBase.

Definition at line 566 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_mfKnotsU, osg::SurfaceBase::_mfKnotsV, osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfDimU, osg::SurfaceBase::_sfDimV, osg::SurfaceBase::_sfDirtyMask, osg::SurfaceBase::_sfError, osg::SurfaceBase::_sfIsDelaunay, osg::SurfaceBase::_sfNumCurves, osg::SurfaceBase::_sfSurfaceGLId, osg::SurfaceBase::_sfTextureControlPoints, osg::SurfaceBase::ControlPointsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::GeometryBase::copyFromBin(), osg::SurfaceBase::CurveControlPointsFieldMask, osg::SurfaceBase::CurvesPerLoopFieldMask, osg::SurfaceBase::DimensionsFieldMask, osg::SurfaceBase::DimUFieldMask, osg::SurfaceBase::DimVFieldMask, osg::SurfaceBase::DirtyMaskFieldMask, osg::SurfaceBase::ErrorFieldMask, osg::SurfaceBase::IsDelaunayFieldMask, osg::SurfaceBase::KnotLengthsFieldMask, osg::SurfaceBase::KnotsFieldMask, osg::SurfaceBase::KnotsUFieldMask, osg::SurfaceBase::KnotsVFieldMask, osg::FieldBits::NoField, osg::SurfaceBase::NumCurvesFieldMask, osg::SurfaceBase::SurfaceGLIdFieldMask, and osg::SurfaceBase::TextureControlPointsFieldMask.

00568 {
00569     Inherited::copyFromBin(pMem, whichField);
00570 
00571     if(FieldBits::NoField != (DimUFieldMask & whichField))
00572     {
00573         _sfDimU.copyFromBin(pMem);
00574     }
00575 
00576     if(FieldBits::NoField != (DimVFieldMask & whichField))
00577     {
00578         _sfDimV.copyFromBin(pMem);
00579     }
00580 
00581     if(FieldBits::NoField != (KnotsUFieldMask & whichField))
00582     {
00583         _mfKnotsU.copyFromBin(pMem);
00584     }
00585 
00586     if(FieldBits::NoField != (KnotsVFieldMask & whichField))
00587     {
00588         _mfKnotsV.copyFromBin(pMem);
00589     }
00590 
00591     if(FieldBits::NoField != (ControlPointsFieldMask & whichField))
00592     {
00593         _sfControlPoints.copyFromBin(pMem);
00594     }
00595 
00596     if(FieldBits::NoField != (ErrorFieldMask & whichField))
00597     {
00598         _sfError.copyFromBin(pMem);
00599     }
00600 
00601     if(FieldBits::NoField != (NumCurvesFieldMask & whichField))
00602     {
00603         _sfNumCurves.copyFromBin(pMem);
00604     }
00605 
00606     if(FieldBits::NoField != (KnotLengthsFieldMask & whichField))
00607     {
00608         _mfKnotLengths.copyFromBin(pMem);
00609     }
00610 
00611     if(FieldBits::NoField != (DimensionsFieldMask & whichField))
00612     {
00613         _mfDimensions.copyFromBin(pMem);
00614     }
00615 
00616     if(FieldBits::NoField != (CurveControlPointsFieldMask & whichField))
00617     {
00618         _mfCurveControlPoints.copyFromBin(pMem);
00619     }
00620 
00621     if(FieldBits::NoField != (KnotsFieldMask & whichField))
00622     {
00623         _mfKnots.copyFromBin(pMem);
00624     }
00625 
00626     if(FieldBits::NoField != (CurvesPerLoopFieldMask & whichField))
00627     {
00628         _mfCurvesPerLoop.copyFromBin(pMem);
00629     }
00630 
00631     if(FieldBits::NoField != (IsDelaunayFieldMask & whichField))
00632     {
00633         _sfIsDelaunay.copyFromBin(pMem);
00634     }
00635 
00636     if(FieldBits::NoField != (TextureControlPointsFieldMask & whichField))
00637     {
00638         _sfTextureControlPoints.copyFromBin(pMem);
00639     }
00640 
00641     if(FieldBits::NoField != (DirtyMaskFieldMask & whichField))
00642     {
00643         _sfDirtyMask.copyFromBin(pMem);
00644     }
00645 
00646     if(FieldBits::NoField != (SurfaceGLIdFieldMask & whichField))
00647     {
00648         _sfSurfaceGLId.copyFromBin(pMem);
00649     }
00650 
00651 
00652 }

SurfacePtr osg::SurfaceBase::create ( void   )  [inline, static, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 72 of file OSGSurfaceBase.inl.

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

Referenced by clone().

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

SurfacePtr osg::SurfaceBase::createEmpty ( void   )  [inline, static, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 87 of file OSGSurfaceBase.inl.

References osg::FieldContainer::newPtr().

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

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

Reimplemented from osg::GeometryBase.

Definition at line 282 of file OSGSurfaceBase.cpp.

References osg::FieldContainer::newPtr().

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

00283 { 
00284     SurfacePtr returnValue; 
00285 
00286     newPtr(returnValue, dynamic_cast<const Surface *>(this)); 
00287 
00288     return returnValue; 
00289 }

SFUInt32 * osg::SurfaceBase::getSFNumCurves ( void   )  [inline, protected, inherited]

Definition at line 143 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfNumCurves.

00144 {
00145     return &_sfNumCurves;
00146 }

MFUInt32 * osg::SurfaceBase::getMFKnotLengths ( void   )  [inline, protected, inherited]

Definition at line 150 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotLengths.

Referenced by clone().

00151 {
00152     return &_mfKnotLengths;
00153 }

MFUInt32 * osg::SurfaceBase::getMFDimensions ( void   )  [inline, protected, inherited]

Definition at line 157 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfDimensions.

Referenced by clone().

00158 {
00159     return &_mfDimensions;
00160 }

MFPnt3f * osg::SurfaceBase::getMFCurveControlPoints ( void   )  [inline, protected, inherited]

Definition at line 164 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurveControlPoints.

Referenced by clone().

00165 {
00166     return &_mfCurveControlPoints;
00167 }

MFReal32 * osg::SurfaceBase::getMFKnots ( void   )  [inline, protected, inherited]

Definition at line 171 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnots.

Referenced by clone().

00172 {
00173     return &_mfKnots;
00174 }

MFUInt32 * osg::SurfaceBase::getMFCurvesPerLoop ( void   )  [inline, protected, inherited]

Definition at line 178 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurvesPerLoop.

Referenced by clone().

00179 {
00180     return &_mfCurvesPerLoop;
00181 }

SFUInt32 * osg::SurfaceBase::getSFDirtyMask ( void   )  [inline, protected, inherited]

Definition at line 199 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDirtyMask.

00200 {
00201     return &_sfDirtyMask;
00202 }

SFInt32 * osg::SurfaceBase::getSFSurfaceGLId ( void   )  [inline, protected, inherited]

Definition at line 206 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfSurfaceGLId.

00207 {
00208     return &_sfSurfaceGLId;
00209 }

UInt32 & osg::SurfaceBase::getNumCurves ( void   )  [inline, protected, inherited]

Definition at line 298 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfNumCurves, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by clone().

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

const UInt32 & osg::SurfaceBase::getNumCurves ( void   )  const [inline, protected, inherited]

Definition at line 305 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfNumCurves, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00306 {
00307     return _sfNumCurves.getValue();
00308 }

UInt32 & osg::SurfaceBase::getDirtyMask ( void   )  [inline, protected, inherited]

Definition at line 361 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDirtyMask, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

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

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

const UInt32 & osg::SurfaceBase::getDirtyMask ( void   )  const [inline, protected, inherited]

Definition at line 368 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDirtyMask, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00369 {
00370     return _sfDirtyMask.getValue();
00371 }

Int32 & osg::SurfaceBase::getSurfaceGLId ( void   )  [inline, protected, inherited]

Definition at line 382 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfSurfaceGLId, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

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

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

const Int32 & osg::SurfaceBase::getSurfaceGLId ( void   )  const [inline, protected, inherited]

Definition at line 389 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfSurfaceGLId, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00390 {
00391     return _sfSurfaceGLId.getValue();
00392 }

UInt32 & osg::SurfaceBase::getKnotLengths ( UInt32  index  )  [inline, protected, inherited]

Definition at line 446 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotLengths.

00447 {
00448     return _mfKnotLengths[index];
00449 }

MFUInt32 & osg::SurfaceBase::getKnotLengths ( void   )  [inline, protected, inherited]

Definition at line 453 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotLengths.

00454 {
00455     return _mfKnotLengths;
00456 }

const MFUInt32 & osg::SurfaceBase::getKnotLengths ( void   )  const [inline, protected, inherited]

Definition at line 460 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnotLengths.

00461 {
00462     return _mfKnotLengths;
00463 }

UInt32 & osg::SurfaceBase::getDimensions ( UInt32  index  )  [inline, protected, inherited]

Definition at line 467 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfDimensions.

00468 {
00469     return _mfDimensions[index];
00470 }

MFUInt32 & osg::SurfaceBase::getDimensions ( void   )  [inline, protected, inherited]

Definition at line 474 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfDimensions.

00475 {
00476     return _mfDimensions;
00477 }

const MFUInt32 & osg::SurfaceBase::getDimensions ( void   )  const [inline, protected, inherited]

Definition at line 481 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfDimensions.

00482 {
00483     return _mfDimensions;
00484 }

Pnt3f & osg::SurfaceBase::getCurveControlPoints ( UInt32  index  )  [inline, protected, inherited]

Definition at line 488 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurveControlPoints.

00489 {
00490     return _mfCurveControlPoints[index];
00491 }

MFPnt3f & osg::SurfaceBase::getCurveControlPoints ( void   )  [inline, protected, inherited]

Definition at line 495 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurveControlPoints.

00496 {
00497     return _mfCurveControlPoints;
00498 }

const MFPnt3f & osg::SurfaceBase::getCurveControlPoints ( void   )  const [inline, protected, inherited]

Definition at line 502 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurveControlPoints.

00503 {
00504     return _mfCurveControlPoints;
00505 }

Real32 & osg::SurfaceBase::getKnots ( UInt32  index  )  [inline, protected, inherited]

Definition at line 509 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnots.

00510 {
00511     return _mfKnots[index];
00512 }

MFReal32 & osg::SurfaceBase::getKnots ( void   )  [inline, protected, inherited]

Definition at line 516 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnots.

00517 {
00518     return _mfKnots;
00519 }

const MFReal32 & osg::SurfaceBase::getKnots ( void   )  const [inline, protected, inherited]

Definition at line 523 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfKnots.

00524 {
00525     return _mfKnots;
00526 }

UInt32 & osg::SurfaceBase::getCurvesPerLoop ( UInt32  index  )  [inline, protected, inherited]

Definition at line 530 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurvesPerLoop.

00531 {
00532     return _mfCurvesPerLoop[index];
00533 }

MFUInt32 & osg::SurfaceBase::getCurvesPerLoop ( void   )  [inline, protected, inherited]

Definition at line 537 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurvesPerLoop.

00538 {
00539     return _mfCurvesPerLoop;
00540 }

const MFUInt32 & osg::SurfaceBase::getCurvesPerLoop ( void   )  const [inline, protected, inherited]

Definition at line 544 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_mfCurvesPerLoop.

00545 {
00546     return _mfCurvesPerLoop;
00547 }

void osg::SurfaceBase::setNumCurves ( const UInt32 value  )  [inline, protected, inherited]

Definition at line 312 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfNumCurves, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00313 {
00314     _sfNumCurves.setValue(value);
00315 }

void osg::SurfaceBase::setDirtyMask ( const UInt32 value  )  [inline, protected, inherited]

Definition at line 375 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfDirtyMask, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00376 {
00377     _sfDirtyMask.setValue(value);
00378 }

void osg::SurfaceBase::setSurfaceGLId ( const Int32 value  )  [inline, protected, inherited]

Definition at line 396 of file OSGSurfaceBase.inl.

References osg::SurfaceBase::_sfSurfaceGLId, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

Referenced by onCreate().

00397 {
00398     _sfSurfaceGLId.setValue(value);
00399 }

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

Definition at line 655 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::_mfCurveControlPoints, osg::SurfaceBase::_mfCurvesPerLoop, osg::SurfaceBase::_mfDimensions, osg::SurfaceBase::_mfKnotLengths, osg::SurfaceBase::_mfKnots, osg::SurfaceBase::_mfKnotsU, osg::SurfaceBase::_mfKnotsV, osg::SurfaceBase::_sfControlPoints, osg::SurfaceBase::_sfDimU, osg::SurfaceBase::_sfDimV, osg::SurfaceBase::_sfDirtyMask, osg::SurfaceBase::_sfError, osg::SurfaceBase::_sfIsDelaunay, osg::SurfaceBase::_sfNumCurves, osg::SurfaceBase::_sfSurfaceGLId, osg::SurfaceBase::_sfTextureControlPoints, osg::SurfaceBase::ControlPointsFieldMask, osg::SurfaceBase::CurveControlPointsFieldMask, osg::SurfaceBase::CurvesPerLoopFieldMask, osg::SurfaceBase::DimensionsFieldMask, osg::SurfaceBase::DimUFieldMask, osg::SurfaceBase::DimVFieldMask, osg::SurfaceBase::DirtyMaskFieldMask, osg::SurfaceBase::ErrorFieldMask, osg::GeometryBase::executeSyncImpl(), osg::SurfaceBase::IsDelaunayFieldMask, osg::SurfaceBase::KnotLengthsFieldMask, osg::SurfaceBase::KnotsFieldMask, osg::SurfaceBase::KnotsUFieldMask, osg::SurfaceBase::KnotsVFieldMask, osg::FieldBits::NoField, osg::SurfaceBase::NumCurvesFieldMask, osg::SurfaceBase::SurfaceGLIdFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), and osg::SurfaceBase::TextureControlPointsFieldMask.

Referenced by osg::SurfaceBase::executeSync().

00657 {
00658 
00659     Inherited::executeSyncImpl(pOther, whichField);
00660 
00661     if(FieldBits::NoField != (DimUFieldMask & whichField))
00662         _sfDimU.syncWith(pOther->_sfDimU);
00663 
00664     if(FieldBits::NoField != (DimVFieldMask & whichField))
00665         _sfDimV.syncWith(pOther->_sfDimV);
00666 
00667     if(FieldBits::NoField != (KnotsUFieldMask & whichField))
00668         _mfKnotsU.syncWith(pOther->_mfKnotsU);
00669 
00670     if(FieldBits::NoField != (KnotsVFieldMask & whichField))
00671         _mfKnotsV.syncWith(pOther->_mfKnotsV);
00672 
00673     if(FieldBits::NoField != (ControlPointsFieldMask & whichField))
00674         _sfControlPoints.syncWith(pOther->_sfControlPoints);
00675 
00676     if(FieldBits::NoField != (ErrorFieldMask & whichField))
00677         _sfError.syncWith(pOther->_sfError);
00678 
00679     if(FieldBits::NoField != (NumCurvesFieldMask & whichField))
00680         _sfNumCurves.syncWith(pOther->_sfNumCurves);
00681 
00682     if(FieldBits::NoField != (KnotLengthsFieldMask & whichField))
00683         _mfKnotLengths.syncWith(pOther->_mfKnotLengths);
00684 
00685     if(FieldBits::NoField != (DimensionsFieldMask & whichField))
00686         _mfDimensions.syncWith(pOther->_mfDimensions);
00687 
00688     if(FieldBits::NoField != (CurveControlPointsFieldMask & whichField))
00689         _mfCurveControlPoints.syncWith(pOther->_mfCurveControlPoints);
00690 
00691     if(FieldBits::NoField != (KnotsFieldMask & whichField))
00692         _mfKnots.syncWith(pOther->_mfKnots);
00693 
00694     if(FieldBits::NoField != (CurvesPerLoopFieldMask & whichField))
00695         _mfCurvesPerLoop.syncWith(pOther->_mfCurvesPerLoop);
00696 
00697     if(FieldBits::NoField != (IsDelaunayFieldMask & whichField))
00698         _sfIsDelaunay.syncWith(pOther->_sfIsDelaunay);
00699 
00700     if(FieldBits::NoField != (TextureControlPointsFieldMask & whichField))
00701         _sfTextureControlPoints.syncWith(pOther->_sfTextureControlPoints);
00702 
00703     if(FieldBits::NoField != (DirtyMaskFieldMask & whichField))
00704         _sfDirtyMask.syncWith(pOther->_sfDirtyMask);
00705 
00706     if(FieldBits::NoField != (SurfaceGLIdFieldMask & whichField))
00707         _sfSurfaceGLId.syncWith(pOther->_sfSurfaceGLId);
00708 
00709 
00710 }

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::SurfaceBase::executeSync ( FieldContainer other,
const BitVector whichField 
) [protected, virtual, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 298 of file OSGSurfaceBase.cpp.

References osg::SurfaceBase::executeSyncImpl().

00300 {
00301     this->executeSyncImpl((SurfaceBase *) &other, whichField);
00302 }

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

Definition at line 98 of file OSGGeometry.h.

00098 { return "Geometry"; };

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

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

Definition at line 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 [inherited]

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

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

Definition at line 751 of file OSGGeometry.cpp.

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

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

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 }

GeometryPtr Geometry::getPtr ( void   )  const [inherited]

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

bool Geometry::isMergeable ( const GeometryPtr  other  )  [inherited]

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(), osg::Geometry::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  )  [inherited]

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, osg::Geometry::merge0(), osg::Geometry::merge1(), osg::Geometry::merge2(), osg::Geometry::merge3(), osg::Geometry::merge4(), osg::Geometry::merge5(), osg::Geometry::merge6(), osg::Geometry::MergeIndex(), osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::push_back(), osg::MField< FieldTypeT, fieldNameSpace >::reserve(), osg::Geometry::setColors(), osg::GeometryBase::setDlistCache(), osg::Geometry::setIndices(), osg::Geometry::setLengths(), osg::Geometry::setMaterial(), osg::Geometry::setNormals(), osg::Geometry::setPositions(), osg::Geometry::setSecondaryColors(), osg::Geometry::setTexCoords(), osg::Geometry::setTexCoords1(), osg::Geometry::setTexCoords2(), osg::Geometry::setTexCoords3(), osg::Geometry::setTexCoords4(), osg::Geometry::setTexCoords5(), osg::Geometry::setTexCoords6(), osg::Geometry::setTexCoords7(), osg::Geometry::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   )  [inherited]

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

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

Definition at line 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 osg::Geometry::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, inherited]

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(), osg::Geometry::MapColor, osg::Geometry::MapNormal, osg::Geometry::MapPosition, osg::Geometry::MapSecondaryColor, osg::Geometry::MapTexCoords, osg::Geometry::MapTexCoords1, osg::Geometry::MapTexCoords2, osg::Geometry::MapTexCoords3, osg::Geometry::MapTexCoords4, osg::Geometry::MapTexCoords5, osg::Geometry::MapTexCoords6, osg::Geometry::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, inherited]

Definition at line 66 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTypes, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::Geometry::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 buildSurface(), osg::Geometry::changed(), and osg::Geometry::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::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::Geometry::setLengths ( const GeoPLengthsPtr value  )  [inline, inherited]

Definition at line 98 of file OSGGeometry.inl.

References osg::GeometryBase::_sfLengths, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::Geometry::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 buildSurface(), osg::Geometry::changed(), and osg::Geometry::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::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::Geometry::setPositions ( const GeoPositionsPtr value  )  [inline, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 130 of file OSGGeometry.inl.

References osg::GeometryBase::_sfPositions, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::Geometry::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 buildSurface(), osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 162 of file OSGGeometry.inl.

References osg::GeometryBase::_sfNormals, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::Geometry::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 buildSurface(), osg::Geometry::changed(), and osg::Geometry::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, inherited]

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(), osg::Geometry::getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, osg::FieldContainerPtrBase::setParentFieldPos(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::subRefCP().

Referenced by osg::Geometry::changed(), and osg::Geometry::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, inherited]

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

Reimplemented from osg::GeometryBase.

Definition at line 258 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords, osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::Geometry::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 buildSurface(), osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 290 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords1, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 buildSurface(), osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 322 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords2, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 354 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords3, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 386 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords4, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 418 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords5, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 450 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords6, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 osg::Geometry::changed(), and osg::Geometry::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, inherited]

Reimplemented from osg::GeometryBase.

Definition at line 482 of file OSGGeometry.inl.

References osg::GeometryBase::_sfTexCoords7, osg::addRefCP(), osg::beginEditCP(), osg::Geometry::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 osg::Geometry::changed(), and osg::Geometry::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, inherited]

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::Geometry::setMaterial ( const MaterialPtr value  )  [inline, inherited]

TriangleIterator Geometry::beginTriangles ( void   )  const [inherited]

Return a TriangleIterator poiting to the beginning of the Geometry.

Definition at line 1758 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::intersect(), and osg::Geometry::intersectActor().

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

TriangleIterator Geometry::endTriangles ( void   )  const [inherited]

Return a TriangleIterator poiting to the end of the Geometry.

Definition at line 1769 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::intersect(), and osg::Geometry::intersectActor().

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

PrimitiveIterator Geometry::beginPrimitives ( void   )  const [inherited]

Return a PrimitiveIterator poiting to the beginning of the Geometry.

Definition at line 1782 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::adjustVolume().

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

PrimitiveIterator Geometry::endPrimitives ( void   )  const [inherited]

Return a PrimitiveIterator poiting to the end of the Geometry.

Definition at line 1793 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::adjustVolume().

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

FaceIterator Geometry::beginFaces ( void   )  const [inherited]

Return a FaceIterator poiting to the beginning of the Geometry.

Definition at line 1806 of file OSGGeometry.cpp.

References osg::Geometry::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 [inherited]

Return a FaceIterator poiting to the end of the Geometry.

Definition at line 1817 of file OSGGeometry.cpp.

References osg::Geometry::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 [inherited]

Return a LineIterator poiting to the beginning of the Geometry.

Definition at line 1830 of file OSGGeometry.cpp.

References osg::Geometry::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 [inherited]

Return a LineIterator poiting to the end of the Geometry.

Definition at line 1841 of file OSGGeometry.cpp.

References osg::Geometry::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 [inherited]

Return a EdgeIterator poiting to the beginning of the Geometry.

Definition at line 1854 of file OSGGeometry.cpp.

References osg::Geometry::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 [inherited]

Return a EdgeIterator poiting to the end of the Geometry.

Definition at line 1865 of file OSGGeometry.cpp.

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

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

Action::ResultE Geometry::intersect ( Action action  )  [inherited]

Definition at line 1119 of file OSGGeometry.cpp.

References osg::Geometry::beginTriangles(), osg::Action::Continue, osg::Geometry::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 initMethod(), and osg::Geometry::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  )  [inherited]

Definition at line 1148 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::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, inherited]

Definition at line 58 of file OSGGeometry.inl.

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

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

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

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, osg::Geometry::handleGL(), osg::osgTypedMethodVoidFunctor2ObjCPtrPtr(), osg::Window::registerGLObject(), osg::GeometryBase::setGLId(), and osg::Startup.

Referenced by 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 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 }

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

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 osg::Geometry::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, inherited]

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 osg::Geometry::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 osg::Geometry::isMergeable(), and osg::Geometry::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, inherited]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2194 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::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, inherited]

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 osg::Geometry::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, inherited]

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 osg::Geometry::setIndices().

Referenced by osg::Geometry::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, inherited]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2342 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::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, inherited]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2406 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::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, inherited]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2477 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::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, inherited]

OpenGL object handler. Used for DisplayList caching.

Definition at line 2542 of file OSGGeometry.cpp.

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

Referenced by osg::Geometry::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, inherited]

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 osg::Geometry::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 }

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 osg::Geometry::clone(), and osg::Geometry::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]

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]

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 osg::Geometry::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 osg::Geometry::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::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 osg::Geometry::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]

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

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 }

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]

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]

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 initMethod(), osg::Slices::initMethod(), osg::Particles::initMethod(), and osg::Geometry::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 initMethod(), osg::Slices::initMethod(), osg::Particles::initMethod(), and osg::Geometry::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 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 }

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::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::SurfaceBase.

Definition at line 202 of file OSGSurface.h.

friend class SurfaceBase [friend]

Definition at line 203 of file OSGSurface.h.


Member Data Documentation

const UInt32 osg::Surface::TESSELLATE = 0x0001 [static, protected]

Definition at line 135 of file OSGSurface.h.

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

const UInt32 osg::Surface::RETESSELLATE = 0x0002 [static, protected]

Definition at line 136 of file OSGSurface.h.

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

const UInt32 osg::Surface::DONTTESSELLATE = 0x0004 [static, protected]

Definition at line 137 of file OSGSurface.h.

Referenced by forceTessellate(), and handleGL().

BSplineTrimmedSurface* osg::Surface::_trimmedSurface [private]

CNurbsPatchSurface* osg::Surface::_surfacePatch [private]

Definition at line 209 of file OSGSurface.h.

Referenced by buildSurface(), reTessellate(), Surface(), tessellateSurface(), and ~Surface().

Definition at line 211 of file OSGSurface.h.

Referenced by getDesiredError(), and tessellateSurface().

Definition at line 212 of file OSGSurface.h.

Referenced by getDesiredError(), and tessellateSurface().

Definition at line 213 of file OSGSurface.h.

Referenced by tessellateSurface().

Definition at line 214 of file OSGSurface.h.

Referenced by tessellateSurface().

Initial value:

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

Reimplemented from osg::GeometryBase.

Definition at line 146 of file OSGSurfaceBase.h.

UInt32 osg::SurfaceBase::_sfDimU [protected, inherited]

UInt32 osg::SurfaceBase::_sfDimV [protected, inherited]

Real32 osg::SurfaceBase::_mfKnotsU [protected, inherited]

Real32 osg::SurfaceBase::_mfKnotsV [protected, inherited]

Real32 osg::SurfaceBase::_sfError [protected, inherited]

UInt32 osg::SurfaceBase::_sfNumCurves [protected, inherited]

UInt32 osg::SurfaceBase::_mfKnotLengths [protected, inherited]

UInt32 osg::SurfaceBase::_mfDimensions [protected, inherited]

Real32 osg::SurfaceBase::_mfKnots [protected, inherited]

bool osg::SurfaceBase::_sfIsDelaunay [protected, inherited]

Whether to use Delaunay triangulation. Default is no, because it's faster and slightly more robust numerically, but produces a somewhat less "nice" triangulation. Set to true, if you want Delaunay triangulation. The number of triangles generated is the same in both modes.

Definition at line 263 of file OSGSurfaceBase.h.

Referenced by osg::SurfaceBase::copyFromBin(), osg::SurfaceBase::copyToBin(), osg::SurfaceBase::executeSyncImpl(), osg::SurfaceBase::getBinSize(), osg::SurfaceBase::getIsDelaunay(), osg::SurfaceBase::getSFIsDelaunay(), and osg::SurfaceBase::setIsDelaunay().

UInt32 osg::SurfaceBase::_sfDirtyMask [protected, inherited]

Int32 osg::SurfaceBase::_sfSurfaceGLId [protected, inherited]

const UInt16 Geometry::MapPosition = 1 [static, inherited]

const UInt16 Geometry::MapNormal = Geometry::MapPosition << 1 [static, inherited]

const UInt16 Geometry::MapColor = Geometry::MapNormal << 1 [static, inherited]

const UInt16 Geometry::MapSecondaryColor = Geometry::MapColor << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords = Geometry::MapSecondaryColor << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords1 = Geometry::MapTexCoords << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords2 = Geometry::MapTexCoords1 << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords3 = Geometry::MapTexCoords2 << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords4 = Geometry::MapTexCoords3 << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords5 = Geometry::MapTexCoords4 << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords6 = Geometry::MapTexCoords5 << 1 [static, inherited]

const UInt16 Geometry::MapTexCoords7 = Geometry::MapTexCoords6 << 1 [static, inherited]

const UInt16 Geometry::MapEmpty = Geometry::MapTexCoords7 << 1 [static, inherited]

Definition at line 91 of file OSGGeometry.h.

Referenced by osg::createSharedIndex().

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 osg::Geometry::changed(), osg::GeometryBase::copyFromBin(), osg::GeometryBase::copyToBin(), osg::GeometryBase::executeSyncImpl(), osg::GeometryBase::getBinSize(), osg::GeometryBase::getSFTypes(), osg::GeometryBase::getTypes(), osg::Geometry::onDestroy(), osg::GeometryBase::setTypes(), and osg::Geometry::setTypes().

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 osg::Geometry::drawPrimitives(), and osg::DrawActionBase::start().

Definition at line 73 of file OSGDrawable.h.

Referenced by osg::Geometry::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:15:06 2008 for OpenSG by  doxygen 1.5.5