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

osg::ComponentTransformBase Class Reference

ComponentTransform Base Class.

#include <OSGComponentTransformBase.h>

Inheritance diagram for osg::ComponentTransformBase:

osg::Transform osg::TransformBase osg::Group osg::GroupBase osg::NodeCore osg::AttachmentContainer osg::FieldContainer osg::ComponentTransform List of all members.

Public Types

typedef ComponentTransformPtr Ptr
enum  {
  CenterFieldId = Inherited::NextFieldId, RotationFieldId = CenterFieldId + 1, ScaleFieldId = RotationFieldId + 1, ScaleOrientationFieldId = ScaleFieldId + 1,
  TranslationFieldId = ScaleOrientationFieldId + 1, NextFieldId = TranslationFieldId + 1
}

Public Member Functions

Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFVec3fgetSFCenter (void)
 Get the ComponentTransform::_sfCenter field.
SFQuaterniongetSFRotation (void)
 Get the ComponentTransform::_sfRotation field.
SFVec3fgetSFScale (void)
 Get the ComponentTransform::_sfScale field.
SFQuaterniongetSFScaleOrientation (void)
 Get the ComponentTransform::_sfScaleOrientation field.
SFVec3fgetSFTranslation (void)
 Get the ComponentTransform::_sfTranslation field.
Vec3fgetCenter (void)
 Get the value of the ComponentTransform::_sfCenter field.
const Vec3fgetCenter (void) const
 Get the value of the ComponentTransform::_sfCenter field.
QuaterniongetRotation (void)
 Get the value of the ComponentTransform::_sfRotation field.
const QuaterniongetRotation (void) const
 Get the value of the ComponentTransform::_sfRotation field.
Vec3fgetScale (void)
 Get the value of the ComponentTransform::_sfScale field.
const Vec3fgetScale (void) const
 Get the value of the ComponentTransform::_sfScale field.
QuaterniongetScaleOrientation (void)
 Get the value of the ComponentTransform::_sfScaleOrientation field.
const QuaterniongetScaleOrientation (void) const
 Get the value of the ComponentTransform::_sfScaleOrientation field.
Vec3fgetTranslation (void)
 Get the value of the ComponentTransform::_sfTranslation field.
const Vec3fgetTranslation (void) const
 Get the value of the ComponentTransform::_sfTranslation field.
Field Set
*void setCenter (const Vec3f &value)
 Set the value of the ComponentTransform::_sfCenter field.
void setRotation (const Quaternion &value)
 Set the value of the ComponentTransform::_sfRotation field.
void setScale (const Vec3f &value)
 Set the value of the ComponentTransform::_sfScale field.
void setScaleOrientation (const Quaternion &value)
 Set the value of the ComponentTransform::_sfScaleOrientation field.
void setTranslation (const Vec3f &value)
 Set the value of the ComponentTransform::_sfTranslation 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
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Helper
*virtual void accumulateMatrix (Matrix &result)
void adjustVolume (Volume &volume)
Dump
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Field Get
*SFMatrixgetSFMatrix (void)
 Get the Transform::_sfMatrix field.
MatrixgetMatrix (void)
 Get the value of the Transform::_sfMatrix field.
const MatrixgetMatrix (void) const
 Get the value of the Transform::_sfMatrix field.
Field Set
*void setMatrix (const Matrix &value)
 Set the value of the Transform::_sfMatrix field.
Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)

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 ComponentTransformPtr create (void)
 create a new instance of the class
static ComponentTransformPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector CenterFieldMask
static const osg::BitVector RotationFieldMask
static const osg::BitVector ScaleFieldMask
static const osg::BitVector ScaleOrientationFieldMask
static const osg::BitVector TranslationFieldMask
static const osg::BitVector MTInfluenceMask
static const osg::BitVector MatrixFieldMask
static const BitVector ParentsFieldMask = (1 << NodeCore::ParentsFieldId )
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
CoredNodePtr helper
*static const bool isNodeCore = true
CoredNodePtr helper
*static const bool isNodeCore = true

Protected Member Functions

Sync
*void executeSyncImpl (GroupBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Constructors
ComponentTransformBase (void)
 ComponentTransformBase (const ComponentTransformBase &source)
Destructors
*virtual ~ComponentTransformBase (void)
Sync
*void executeSyncImpl (ComponentTransformBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Draw & Intersect & Render
*Action::ResultE drawEnter (Action *action)
Action::ResultE drawLeave (Action *action)
Action::ResultE intersectEnter (Action *action)
NewActionTypes::ResultE intersectEnter (ActorBase::FunctorArgumentType &funcArg)
Action::ResultE intersectLeave (Action *action)
NewActionTypes::ResultE intersectLeave (ActorBase::FunctorArgumentType &funcArg)
Action::ResultE renderEnter (Action *action)
Action::ResultE renderLeave (Action *action)
Sync
*void executeSyncImpl (TransformBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (GroupBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
Action Callbacks
Action::ResultE intersect (Action *action)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const

Protected Attributes

Fields
*MFNodePtr _parents
Fields
*SFVec3f _sfCenter
SFQuaternion _sfRotation
SFVec3f _sfScale
SFQuaternion _sfScaleOrientation
SFVec3f _sfTranslation
Fields
*SFMatrix _sfMatrix
Fields
*MFNodePtr _parents

Private Types

typedef Transform Inherited

Private Member Functions

void operator= (const ComponentTransformBase &source)

Static Private Attributes

static FieldDescription_desc []
 ComponentTransform description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 85 of file OSGComponentTransformBase.h.


Member Typedef Documentation

typedef Transform osg::ComponentTransformBase::Inherited [private]
 

Reimplemented from osg::Transform.

Reimplemented in osg::ComponentTransform.

Definition at line 89 of file OSGComponentTransformBase.h.

typedef ComponentTransformPtr osg::ComponentTransformBase::Ptr
 

Reimplemented from osg::TransformBase.

Definition at line 94 of file OSGComponentTransformBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
CenterFieldId 
RotationFieldId 
ScaleFieldId 
ScaleOrientationFieldId 
TranslationFieldId 
NextFieldId 

Reimplemented from osg::TransformBase.

Definition at line 96 of file OSGComponentTransformBase.h.

00097     {
00098         CenterFieldId           = Inherited::NextFieldId,
00099         RotationFieldId         = CenterFieldId           + 1,
00100         ScaleFieldId            = RotationFieldId         + 1,
00101         ScaleOrientationFieldId = ScaleFieldId            + 1,
00102         TranslationFieldId      = ScaleOrientationFieldId + 1,
00103         NextFieldId             = TranslationFieldId      + 1
00104     };


Constructor & Destructor Documentation

ComponentTransformBase::ComponentTransformBase void   )  [protected]
 

Definition at line 208 of file OSGComponentTransformBase.cpp.

00208                                                    :
00209     _sfCenter                 (), 
00210     _sfRotation               (), 
00211     _sfScale                  (), 
00212     _sfScaleOrientation       (), 
00213     _sfTranslation            (), 
00214     Inherited() 
00215 {
00216 }

ComponentTransformBase::ComponentTransformBase const ComponentTransformBase source  )  [protected]
 

Definition at line 222 of file OSGComponentTransformBase.cpp.

00222                                                                                    :
00223     _sfCenter                 (source._sfCenter                 ), 
00224     _sfRotation               (source._sfRotation               ), 
00225     _sfScale                  (source._sfScale                  ), 
00226     _sfScaleOrientation       (source._sfScaleOrientation       ), 
00227     _sfTranslation            (source._sfTranslation            ), 
00228     Inherited                 (source)
00229 {
00230 }

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

Definition at line 234 of file OSGComponentTransformBase.cpp.

00235 {
00236 }


Member Function Documentation

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

Reimplemented from osg::TransformBase.

Definition at line 58 of file OSGComponentTransformBase.inl.

References _type.

Referenced by create(), osg::VRMLWriteAction::initializeAction(), osg::ComponentTransform::initMethod(), osg::SplitGraphOp::isGroup(), and osg::MergeGraphOp::isGroup().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::TransformBase.

Definition at line 65 of file OSGComponentTransformBase.inl.

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

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

FieldContainerType & ComponentTransformBase::getType void   )  [virtual]
 

Reimplemented from osg::TransformBase.

Definition at line 150 of file OSGComponentTransformBase.cpp.

References _type.

00151 {
00152     return _type; 
00153 } 

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

Reimplemented from osg::TransformBase.

Definition at line 155 of file OSGComponentTransformBase.cpp.

References _type.

00156 {
00157     return _type;
00158 } 

UInt32 ComponentTransformBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::TransformBase.

Definition at line 170 of file OSGComponentTransformBase.cpp.

00171 { 
00172     return sizeof(ComponentTransform); 
00173 }

SFVec3f * osg::ComponentTransformBase::getSFCenter void   )  [inline]
 

Definition at line 101 of file OSGComponentTransformBase.inl.

References _sfCenter.

00102 {
00103     return &_sfCenter;
00104 }

SFQuaternion * osg::ComponentTransformBase::getSFRotation void   )  [inline]
 

Definition at line 108 of file OSGComponentTransformBase.inl.

References _sfRotation.

00109 {
00110     return &_sfRotation;
00111 }

SFVec3f * osg::ComponentTransformBase::getSFScale void   )  [inline]
 

Definition at line 115 of file OSGComponentTransformBase.inl.

References _sfScale.

00116 {
00117     return &_sfScale;
00118 }

SFQuaternion * osg::ComponentTransformBase::getSFScaleOrientation void   )  [inline]
 

Definition at line 122 of file OSGComponentTransformBase.inl.

References _sfScaleOrientation.

00123 {
00124     return &_sfScaleOrientation;
00125 }

SFVec3f * osg::ComponentTransformBase::getSFTranslation void   )  [inline]
 

Definition at line 129 of file OSGComponentTransformBase.inl.

References _sfTranslation.

00130 {
00131     return &_sfTranslation;
00132 }

Vec3f & osg::ComponentTransformBase::getCenter void   )  [inline]
 

Definition at line 137 of file OSGComponentTransformBase.inl.

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

Referenced by osg::ComponentTransform::changed().

00138 {
00139     return _sfCenter.getValue();
00140 }

const Vec3f & osg::ComponentTransformBase::getCenter void   )  const [inline]
 

Definition at line 144 of file OSGComponentTransformBase.inl.

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

00145 {
00146     return _sfCenter.getValue();
00147 }

Quaternion & osg::ComponentTransformBase::getRotation void   )  [inline]
 

Definition at line 158 of file OSGComponentTransformBase.inl.

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

Referenced by osg::ComponentTransform::changed().

00159 {
00160     return _sfRotation.getValue();
00161 }

const Quaternion & osg::ComponentTransformBase::getRotation void   )  const [inline]
 

Definition at line 165 of file OSGComponentTransformBase.inl.

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

00166 {
00167     return _sfRotation.getValue();
00168 }

Vec3f & osg::ComponentTransformBase::getScale void   )  [inline]
 

Definition at line 179 of file OSGComponentTransformBase.inl.

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

Referenced by osg::ComponentTransform::changed().

00180 {
00181     return _sfScale.getValue();
00182 }

const Vec3f & osg::ComponentTransformBase::getScale void   )  const [inline]
 

Definition at line 186 of file OSGComponentTransformBase.inl.

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

00187 {
00188     return _sfScale.getValue();
00189 }

Quaternion & osg::ComponentTransformBase::getScaleOrientation void   )  [inline]
 

Definition at line 200 of file OSGComponentTransformBase.inl.

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

Referenced by osg::ComponentTransform::changed().

00201 {
00202     return _sfScaleOrientation.getValue();
00203 }

const Quaternion & osg::ComponentTransformBase::getScaleOrientation void   )  const [inline]
 

Definition at line 207 of file OSGComponentTransformBase.inl.

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

00208 {
00209     return _sfScaleOrientation.getValue();
00210 }

Vec3f & osg::ComponentTransformBase::getTranslation void   )  [inline]
 

Definition at line 221 of file OSGComponentTransformBase.inl.

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

Referenced by osg::ComponentTransform::changed().

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

const Vec3f & osg::ComponentTransformBase::getTranslation void   )  const [inline]
 

Definition at line 228 of file OSGComponentTransformBase.inl.

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

00229 {
00230     return _sfTranslation.getValue();
00231 }

void osg::ComponentTransformBase::setCenter const Vec3f value  )  [inline]
 

Definition at line 151 of file OSGComponentTransformBase.inl.

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

00152 {
00153     _sfCenter.setValue(value);
00154 }

void osg::ComponentTransformBase::setRotation const Quaternion value  )  [inline]
 

Definition at line 172 of file OSGComponentTransformBase.inl.

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

00173 {
00174     _sfRotation.setValue(value);
00175 }

void osg::ComponentTransformBase::setScale const Vec3f value  )  [inline]
 

Definition at line 193 of file OSGComponentTransformBase.inl.

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

00194 {
00195     _sfScale.setValue(value);
00196 }

void osg::ComponentTransformBase::setScaleOrientation const Quaternion value  )  [inline]
 

Definition at line 214 of file OSGComponentTransformBase.inl.

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

00215 {
00216     _sfScaleOrientation.setValue(value);
00217 }

void osg::ComponentTransformBase::setTranslation const Vec3f value  )  [inline]
 

Definition at line 235 of file OSGComponentTransformBase.inl.

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

00236 {
00237     _sfTranslation.setValue(value);
00238 }

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

Reimplemented from osg::TransformBase.

Definition at line 240 of file OSGComponentTransformBase.cpp.

References _sfCenter, _sfRotation, _sfScale, _sfScaleOrientation, _sfTranslation, CenterFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::TransformBase::getBinSize(), osg::FieldBits::NoField, RotationFieldMask, ScaleFieldMask, ScaleOrientationFieldMask, and TranslationFieldMask.

00241 {
00242     UInt32 returnValue = Inherited::getBinSize(whichField);
00243 
00244     if(FieldBits::NoField != (CenterFieldMask & whichField))
00245     {
00246         returnValue += _sfCenter.getBinSize();
00247     }
00248 
00249     if(FieldBits::NoField != (RotationFieldMask & whichField))
00250     {
00251         returnValue += _sfRotation.getBinSize();
00252     }
00253 
00254     if(FieldBits::NoField != (ScaleFieldMask & whichField))
00255     {
00256         returnValue += _sfScale.getBinSize();
00257     }
00258 
00259     if(FieldBits::NoField != (ScaleOrientationFieldMask & whichField))
00260     {
00261         returnValue += _sfScaleOrientation.getBinSize();
00262     }
00263 
00264     if(FieldBits::NoField != (TranslationFieldMask & whichField))
00265     {
00266         returnValue += _sfTranslation.getBinSize();
00267     }
00268 
00269 
00270     return returnValue;
00271 }

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

Reimplemented from osg::TransformBase.

Definition at line 273 of file OSGComponentTransformBase.cpp.

References _sfCenter, _sfRotation, _sfScale, _sfScaleOrientation, _sfTranslation, CenterFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::TransformBase::copyToBin(), osg::FieldBits::NoField, RotationFieldMask, ScaleFieldMask, ScaleOrientationFieldMask, and TranslationFieldMask.

00275 {
00276     Inherited::copyToBin(pMem, whichField);
00277 
00278     if(FieldBits::NoField != (CenterFieldMask & whichField))
00279     {
00280         _sfCenter.copyToBin(pMem);
00281     }
00282 
00283     if(FieldBits::NoField != (RotationFieldMask & whichField))
00284     {
00285         _sfRotation.copyToBin(pMem);
00286     }
00287 
00288     if(FieldBits::NoField != (ScaleFieldMask & whichField))
00289     {
00290         _sfScale.copyToBin(pMem);
00291     }
00292 
00293     if(FieldBits::NoField != (ScaleOrientationFieldMask & whichField))
00294     {
00295         _sfScaleOrientation.copyToBin(pMem);
00296     }
00297 
00298     if(FieldBits::NoField != (TranslationFieldMask & whichField))
00299     {
00300         _sfTranslation.copyToBin(pMem);
00301     }
00302 
00303 
00304 }

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

Reimplemented from osg::TransformBase.

Definition at line 306 of file OSGComponentTransformBase.cpp.

References _sfCenter, _sfRotation, _sfScale, _sfScaleOrientation, _sfTranslation, CenterFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::TransformBase::copyFromBin(), osg::FieldBits::NoField, RotationFieldMask, ScaleFieldMask, ScaleOrientationFieldMask, and TranslationFieldMask.

00308 {
00309     Inherited::copyFromBin(pMem, whichField);
00310 
00311     if(FieldBits::NoField != (CenterFieldMask & whichField))
00312     {
00313         _sfCenter.copyFromBin(pMem);
00314     }
00315 
00316     if(FieldBits::NoField != (RotationFieldMask & whichField))
00317     {
00318         _sfRotation.copyFromBin(pMem);
00319     }
00320 
00321     if(FieldBits::NoField != (ScaleFieldMask & whichField))
00322     {
00323         _sfScale.copyFromBin(pMem);
00324     }
00325 
00326     if(FieldBits::NoField != (ScaleOrientationFieldMask & whichField))
00327     {
00328         _sfScaleOrientation.copyFromBin(pMem);
00329     }
00330 
00331     if(FieldBits::NoField != (TranslationFieldMask & whichField))
00332     {
00333         _sfTranslation.copyFromBin(pMem);
00334     }
00335 
00336 
00337 }

ComponentTransformPtr osg::ComponentTransformBase::create void   )  [inline, static]
 

Reimplemented from osg::TransformBase.

Definition at line 72 of file OSGComponentTransformBase.inl.

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

Referenced by osg::DisplayCalibration::createCMViewports(), osg::VRMLViewpointDesc::init(), and osg::VRMLNodeDesc::init().

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

ComponentTransformPtr osg::ComponentTransformBas