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

osg::PolygonBackgroundBase Class Reference

PolygonBackground Base Class.

#include <OSGPolygonBackgroundBase.h>

Inheritance diagram for osg::PolygonBackgroundBase:

osg::Background osg::BackgroundBase osg::AttachmentContainer osg::FieldContainer osg::PolygonBackground List of all members.

Public Types

typedef PolygonBackgroundPtr Ptr
enum  {
  MaterialFieldId = Inherited::NextFieldId, TexCoordsFieldId = MaterialFieldId + 1, PositionsFieldId = TexCoordsFieldId + 1, NormalizedXFieldId = PositionsFieldId + 1,
  NormalizedYFieldId = NormalizedXFieldId + 1, NextFieldId = NormalizedYFieldId + 1
}

Public Member Functions

FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFMaterialPtrgetSFMaterial (void)
 Get the PolygonBackground::_sfMaterial field.
MFVec3fgetMFTexCoords (void)
 Get the PolygonBackground::_mfTexCoords field.
MFPnt2fgetMFPositions (void)
 Get the PolygonBackground::_mfPositions field.
SFBoolgetSFNormalizedX (void)
 Get the PolygonBackground::_sfNormalizedX field.
SFBoolgetSFNormalizedY (void)
 Get the PolygonBackground::_sfNormalizedY field.
MaterialPtrgetMaterial (void)
 Get the value of the PolygonBackground::_sfMaterial field.
const MaterialPtrgetMaterial (void) const
 Get the value of the PolygonBackground::_sfMaterial field.
bool & getNormalizedX (void)
 Get the value of the PolygonBackground::_sfNormalizedX field.
const bool & getNormalizedX (void) const
 Get the value of the PolygonBackground::_sfNormalizedX field.
bool & getNormalizedY (void)
 Get the value of the PolygonBackground::_sfNormalizedY field.
const bool & getNormalizedY (void) const
 Get the value of the PolygonBackground::_sfNormalizedY field.
Vec3fgetTexCoords (const UInt32 index)
 Get the value of the index element the PolygonBackground::_mfTexCoords field.
MFVec3fgetTexCoords (void)
 Get the PolygonBackground::_mfTexCoords field.
const MFVec3fgetTexCoords (void) const
 Get the PolygonBackground::_mfTexCoords field.
Pnt2fgetPositions (const UInt32 index)
 Get the value of the index element the PolygonBackground::_mfPositions field.
MFPnt2fgetPositions (void)
 Get the PolygonBackground::_mfPositions field.
const MFPnt2fgetPositions (void) const
 Get the PolygonBackground::_mfPositions field.
Field Set
*void setMaterial (const MaterialPtr &value)
 Set the value of the PolygonBackground::_sfMaterial field.
void setNormalizedX (const bool &value)
 Set the value of the PolygonBackground::_sfNormalizedX field.
void setNormalizedY (const bool &value)
 Set the value of the PolygonBackground::_sfNormalizedY 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
access fields
*virtual void clear (DrawActionBase *action, Viewport *port)=0
transformation
*virtual void changed (BitVector whichField, UInt32 origin)
dump
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const

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 PolygonBackgroundPtr create (void)
 create a new instance of the class
static PolygonBackgroundPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Class Get
*static const Char8getClassname (void)

Static Public Attributes

static const osg::BitVector MaterialFieldMask
static const osg::BitVector TexCoordsFieldMask
static const osg::BitVector PositionsFieldMask
static const osg::BitVector NormalizedXFieldMask
static const osg::BitVector NormalizedYFieldMask
static const osg::BitVector MTInfluenceMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask

Protected Member Functions

Constructors
PolygonBackgroundBase (void)
 PolygonBackgroundBase (const PolygonBackgroundBase &source)
Destructors
*virtual ~PolygonBackgroundBase (void)
Sync
*void executeSyncImpl (PolygonBackgroundBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (BackgroundBase *pOther, const BitVector &whichField)

Protected Attributes

Fields
*SFMaterialPtr _sfMaterial
MFVec3f _mfTexCoords
MFPnt2f _mfPositions
SFBool _sfNormalizedX
SFBool _sfNormalizedY

Private Types

typedef Background Inherited

Private Member Functions

void operator= (const PolygonBackgroundBase &source)

Static Private Attributes

static FieldDescription_desc []
 PolygonBackground description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 85 of file OSGPolygonBackgroundBase.h.


Member Typedef Documentation

typedef Background osg::PolygonBackgroundBase::Inherited [private]
 

Reimplemented from osg::Background.

Reimplemented in osg::PolygonBackground.

Definition at line 89 of file OSGPolygonBackgroundBase.h.

typedef PolygonBackgroundPtr osg::PolygonBackgroundBase::Ptr
 

Reimplemented from osg::BackgroundBase.

Definition at line 94 of file OSGPolygonBackgroundBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
MaterialFieldId 
TexCoordsFieldId 
PositionsFieldId 
NormalizedXFieldId 
NormalizedYFieldId 
NextFieldId 

Reimplemented from osg::AttachmentContainer.

Definition at line 96 of file OSGPolygonBackgroundBase.h.

00097     {
00098         MaterialFieldId    = Inherited::NextFieldId,
00099         TexCoordsFieldId   = MaterialFieldId    + 1,
00100         PositionsFieldId   = TexCoordsFieldId   + 1,
00101         NormalizedXFieldId = PositionsFieldId   + 1,
00102         NormalizedYFieldId = NormalizedXFieldId + 1,
00103         NextFieldId        = NormalizedYFieldId + 1
00104     };


Constructor & Destructor Documentation

PolygonBackgroundBase::PolygonBackgroundBase void   )  [protected]
 

Definition at line 210 of file OSGPolygonBackgroundBase.cpp.

00210                                                  :
00211     _sfMaterial               (), 
00212     _mfTexCoords              (), 
00213     _mfPositions              (), 
00214     _sfNormalizedX            (bool(true)), 
00215     _sfNormalizedY            (bool(true)), 
00216     Inherited() 
00217 {
00218 }

PolygonBackgroundBase::PolygonBackgroundBase const PolygonBackgroundBase source  )  [protected]
 

Definition at line 224 of file OSGPolygonBackgroundBase.cpp.

00224                                                                                 :
00225     _sfMaterial               (source._sfMaterial               ), 
00226     _mfTexCoords              (source._mfTexCoords              ), 
00227     _mfPositions              (source._mfPositions              ), 
00228     _sfNormalizedX            (source._sfNormalizedX            ), 
00229     _sfNormalizedY            (source._sfNormalizedY            ), 
00230     Inherited                 (source)
00231 {
00232 }

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

Definition at line 236 of file OSGPolygonBackgroundBase.cpp.

00237 {
00238 }


Member Function Documentation

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

Reimplemented from osg::BackgroundBase.

Definition at line 58 of file OSGPolygonBackgroundBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::BackgroundBase.

Definition at line 65 of file OSGPolygonBackgroundBase.inl.

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

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

FieldContainerType & PolygonBackgroundBase::getType void   )  [virtual]
 

Reimplemented from osg::BackgroundBase.

Definition at line 150 of file OSGPolygonBackgroundBase.cpp.

References _type.

00151 {
00152     return _type; 
00153 } 

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

Reimplemented from osg::BackgroundBase.

Definition at line 155 of file OSGPolygonBackgroundBase.cpp.

References _type.

00156 {
00157     return _type;
00158 } 

UInt32 PolygonBackgroundBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::BackgroundBase.

Definition at line 170 of file OSGPolygonBackgroundBase.cpp.

00171 { 
00172     return sizeof(PolygonBackground); 
00173 }

SFMaterialPtr * osg::PolygonBackgroundBase::getSFMaterial void   )  [inline]
 

Definition at line 101 of file OSGPolygonBackgroundBase.inl.

References _sfMaterial.

00102 {
00103     return &_sfMaterial;
00104 }

MFVec3f * osg::PolygonBackgroundBase::getMFTexCoords void   )  [inline]
 

Definition at line 108 of file OSGPolygonBackgroundBase.inl.

References _mfTexCoords.

00109 {
00110     return &_mfTexCoords;
00111 }

MFPnt2f * osg::PolygonBackgroundBase::getMFPositions void   )  [inline]
 

Definition at line 115 of file OSGPolygonBackgroundBase.inl.

References _mfPositions.

00116 {
00117     return &_mfPositions;
00118 }

SFBool * osg::PolygonBackgroundBase::getSFNormalizedX void   )  [inline]
 

Definition at line 122 of file OSGPolygonBackgroundBase.inl.

References _sfNormalizedX.

00123 {
00124     return &_sfNormalizedX;
00125 }

SFBool * osg::PolygonBackgroundBase::getSFNormalizedY void   )  [inline]
 

Definition at line 129 of file OSGPolygonBackgroundBase.inl.

References _sfNormalizedY.

00130 {
00131     return &_sfNormalizedY;
00132 }

MaterialPtr & osg::PolygonBackgroundBase::getMaterial void   )  [inline]
 

Definition at line 137 of file OSGPolygonBackgroundBase.inl.

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

Referenced by osg::PolygonBackground::clear().

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

const MaterialPtr & osg::PolygonBackgroundBase::getMaterial void   )  const [inline]
 

Definition at line 144 of file OSGPolygonBackgroundBase.inl.

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

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

bool & osg::PolygonBackgroundBase::getNormalizedX void   )  [inline]
 

Definition at line 158 of file OSGPolygonBackgroundBase.inl.

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

Referenced by osg::PolygonBackground::clear().

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

const bool & osg::PolygonBackgroundBase::getNormalizedX void   )  const [inline]
 

Definition at line 165 of file OSGPolygonBackgroundBase.inl.

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

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

bool & osg::PolygonBackgroundBase::getNormalizedY void   )  [inline]
 

Definition at line 179 of file OSGPolygonBackgroundBase.inl.

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

Referenced by osg::PolygonBackground::clear().

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

const bool & osg::PolygonBackgroundBase::getNormalizedY void   )  const [inline]
 

Definition at line 186 of file OSGPolygonBackgroundBase.inl.

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

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

Vec3f & osg::PolygonBackgroundBase::getTexCoords const UInt32  index  )  [inline]
 

Definition at line 201 of file OSGPolygonBackgroundBase.inl.

References _mfTexCoords.

00202 {
00203     return _mfTexCoords[index];
00204 }

MFVec3f & osg::PolygonBackgroundBase::getTexCoords void   )  [inline]
 

Definition at line 208 of file OSGPolygonBackgroundBase.inl.

References _mfTexCoords.

Referenced by osg::PolygonBackground::clear().

00209 {
00210     return _mfTexCoords;
00211 }

const MFVec3f & osg::PolygonBackgroundBase::getTexCoords void   )  const [inline]
 

Definition at line 215 of file OSGPolygonBackgroundBase.inl.

References _mfTexCoords.

00216 {
00217     return _mfTexCoords;
00218 }

Pnt2f & osg::PolygonBackgroundBase::getPositions const UInt32  index  )  [inline]
 

Definition at line 222 of file OSGPolygonBackgroundBase.inl.

References _mfPositions.

00223 {
00224     return _mfPositions[index];
00225 }

MFPnt2f & osg::PolygonBackgroundBase::getPositions void   )  [inline]
 

Definition at line 229 of file OSGPolygonBackgroundBase.inl.

References _mfPositions.

Referenced by osg::PolygonBackground::clear().

00230 {
00231     return _mfPositions;
00232 }

const MFPnt2f & osg::PolygonBackgroundBase::getPositions void   )  const [inline]
 

Definition at line 236 of file OSGPolygonBackgroundBase.inl.

References _mfPositions.

00237 {
00238     return _mfPositions;
00239 }

void osg::PolygonBackgroundBase::setMaterial const MaterialPtr value  )  [inline]
 

Definition at line 151 of file OSGPolygonBackgroundBase.inl.

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

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

void osg::PolygonBackgroundBase::setNormalizedX const bool &  value  )  [inline]
 

Definition at line 172 of file OSGPolygonBackgroundBase.inl.

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

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

void osg::PolygonBackgroundBase::setNormalizedY const bool &  value  )  [inline]
 

Definition at line 193 of file OSGPolygonBackgroundBase.inl.

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

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

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

Reimplemented from osg::BackgroundBase.

Definition at line 242 of file OSGPolygonBackgroundBase.cpp.

References _mfPositions, _mfTexCoords, _sfMaterial, _sfNormalizedX, _sfNormalizedY, osg::MField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::BackgroundBase::getBinSize(), MaterialFieldMask, osg::FieldBits::NoField, NormalizedXFieldMask, NormalizedYFieldMask, PositionsFieldMask, and TexCoordsFieldMask.

00243 {
00244     UInt32 returnValue = Inherited::getBinSize(whichField);
00245 
00246     if(FieldBits::NoField != (MaterialFieldMask & whichField))
00247     {
00248         returnValue += _sfMaterial.getBinSize();
00249     }
00250 
00251     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00252     {
00253         returnValue += _mfTexCoords.getBinSize();
00254     }
00255 
00256     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00257     {
00258         returnValue += _mfPositions.getBinSize();
00259     }
00260 
00261     if(FieldBits::NoField != (NormalizedXFieldMask & whichField))
00262     {
00263         returnValue += _sfNormalizedX.getBinSize();
00264     }
00265 
00266     if(FieldBits::NoField != (NormalizedYFieldMask & whichField))
00267     {
00268         returnValue += _sfNormalizedY.getBinSize();
00269     }
00270 
00271 
00272     return returnValue;
00273 }

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

Reimplemented from osg::BackgroundBase.

Definition at line 275 of file OSGPolygonBackgroundBase.cpp.

References _mfPositions, _mfTexCoords, _sfMaterial, _sfNormalizedX, _sfNormalizedY, osg::MField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::BackgroundBase::copyToBin(), MaterialFieldMask, osg::FieldBits::NoField, NormalizedXFieldMask, NormalizedYFieldMask, PositionsFieldMask, and TexCoordsFieldMask.

00277 {
00278     Inherited::copyToBin(pMem, whichField);
00279 
00280     if(FieldBits::NoField != (MaterialFieldMask & whichField))
00281     {
00282         _sfMaterial.copyToBin(pMem);
00283     }
00284 
00285     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00286     {
00287         _mfTexCoords.copyToBin(pMem);
00288     }
00289 
00290     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00291     {
00292         _mfPositions.copyToBin(pMem);
00293     }
00294 
00295     if(FieldBits::NoField != (NormalizedXFieldMask & whichField))
00296     {
00297         _sfNormalizedX.copyToBin(pMem);
00298     }
00299 
00300     if(FieldBits::NoField != (NormalizedYFieldMask & whichField))
00301     {
00302         _sfNormalizedY.copyToBin(pMem);
00303     }
00304 
00305 
00306 }

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

Reimplemented from osg::BackgroundBase.

Definition at line 308 of file OSGPolygonBackgroundBase.cpp.

References _mfPositions, _mfTexCoords, _sfMaterial, _sfNormalizedX, _sfNormalizedY, osg::MField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::BackgroundBase::copyFromBin(), MaterialFieldMask, osg::FieldBits::NoField, NormalizedXFieldMask, NormalizedYFieldMask, PositionsFieldMask, and TexCoordsFieldMask.

00310 {
00311     Inherited::copyFromBin(pMem, whichField);
00312 
00313     if(FieldBits::NoField != (MaterialFieldMask & whichField))
00314     {
00315         _sfMaterial.copyFromBin(pMem);
00316     }
00317 
00318     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00319     {
00320         _mfTexCoords.copyFromBin(pMem);
00321     }
00322 
00323     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00324     {
00325         _mfPositions.copyFromBin(pMem);
00326     }
00327 
00328     if(FieldBits::NoField != (NormalizedXFieldMask & whichField))
00329     {
00330         _sfNormalizedX.copyFromBin(pMem);
00331     }
00332 
00333     if(FieldBits::NoField != (NormalizedYFieldMask & whichField))
00334     {
00335         _sfNormalizedY.copyFromBin(pMem);
00336     }
00337 
00338 
00339 }

PolygonBackgroundPtr osg::PolygonBackgroundBase::create void   )  [inline, static]
 

Definition at line 72 of file OSGPolygonBackgroundBase.inl.

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

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

PolygonBackgroundPtr osg::PolygonBackgroundBase::createEmpty void   )  [inline, static]
 

Definition at line 87 of file OSGPolygonBackgroundBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr PolygonBackgroundBase::shallowCopy void   )  const [virtual]
 

Implements osg::FieldContainer.

Definition at line 161 of file OSGPolygonBackgroundBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00162 { 
00163     PolygonBackgroundPtr returnValue; 
00164 
00165     newPtr(returnValue, dynamic_cast<const PolygonBackground *>(this)); 
00166 
00167     return returnValue; 
00168 }

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

Definition at line 342 of file OSGPolygonBackgroundBase.cpp.

References _mfPositions, _mfTexCoords, _sfMaterial, _sfNormalizedX, _sfNormalizedY, osg::BackgroundBase::executeSyncImpl(), MaterialFieldMask, osg::FieldBits::NoField, NormalizedXFieldMask, NormalizedYFieldMask, PositionsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), and TexCoordsFieldMask.

Referenced by executeSync().

00344 {
00345 
00346     Inherited::executeSyncImpl(pOther, whichField);
00347 
00348     if(FieldBits::NoField != (MaterialFieldMask & whichField))
00349         _sfMaterial.syncWith(pOther->_sfMaterial);
00350 
00351     if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
00352         _mfTexCoords.syncWith(pOther->_mfTexCoords);
00353 
00354     if(FieldBits::NoField != (PositionsFieldMask & whichField))
00355         _mfPositions.syncWith(pOther->_mfPositions);
00356 
00357     if(FieldBits::NoField != (NormalizedXFieldMask & whichField))
00358         _sfNormalizedX.syncWith(pOther->_sfNormalizedX);
00359 
00360     if(FieldBits::NoField != (NormalizedYFieldMask & whichField))
00361         _sfNormalizedY.syncWith(pOther->_sfNormalizedY);
00362 
00363 
00364 }

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

Reimplemented from osg::BackgroundBase.

Definition at line 177 of file OSGPolygonBackgroundBase.cpp.

References executeSyncImpl().

00179 {
00180     this->executeSyncImpl((PolygonBackgroundBase *) &other, whichField);
00181 }

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

* static const Char8* osg::Background::getClassname void   )  [inline, static, inherited]
 

Reimplemented in osg::GradientBackground, and osg::SolidBackground.

Definition at line 70 of file OSGBackground.h.

00070 { return "Background"; };

* virtual void osg::Background::clear DrawActionBase action,
Viewport port
[pure virtual, inherited]
 

Implemented in osg::DepthClearBackground, osg::GradientBackground, osg::ImageBackground, osg::PassiveBackground, osg::PolygonBackground, osg::SkyBackground, osg::SolidBackground, osg::TextureBackground, and