#include <OSGPolygonForeground.h>
Inheritance diagram for osg::PolygonForeground:

Public Types | |
| typedef PolygonForegroundPtr | Ptr |
| enum | { MaterialFieldId = Inherited::NextFieldId, PositionsFieldId = MaterialFieldId + 1, TexCoordsFieldId = PositionsFieldId + 1, NormalizedXFieldId = TexCoordsFieldId + 1, NormalizedYFieldId = NormalizedXFieldId + 1, NextFieldId = NormalizedYFieldId + 1 } |
Public Member Functions | |
Sync | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
draw | |
| *virtual void | draw (DrawActionBase *, Viewport *) |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *SFMaterialPtr * | getSFMaterial (void) |
| Get the PolygonForeground::_sfMaterial field. | |
| MFPnt2f * | getMFPositions (void) |
| Get the PolygonForeground::_mfPositions field. | |
| MFVec3f * | getMFTexCoords (void) |
| Get the PolygonForeground::_mfTexCoords field. | |
| SFBool * | getSFNormalizedX (void) |
| Get the PolygonForeground::_sfNormalizedX field. | |
| SFBool * | getSFNormalizedY (void) |
| Get the PolygonForeground::_sfNormalizedY field. | |
| MaterialPtr & | getMaterial (void) |
| Get the value of the PolygonForeground::_sfMaterial field. | |
| const MaterialPtr & | getMaterial (void) const |
| Get the value of the PolygonForeground::_sfMaterial field. | |
| bool & | getNormalizedX (void) |
| Get the value of the PolygonForeground::_sfNormalizedX field. | |
| const bool & | getNormalizedX (void) const |
| Get the value of the PolygonForeground::_sfNormalizedX field. | |
| bool & | getNormalizedY (void) |
| Get the value of the PolygonForeground::_sfNormalizedY field. | |
| const bool & | getNormalizedY (void) const |
| Get the value of the PolygonForeground::_sfNormalizedY field. | |
| Pnt2f & | getPositions (const UInt32 index) |
| Get the value of the index element the PolygonForeground::_mfPositions field. | |
| MFPnt2f & | getPositions (void) |
| Get the PolygonForeground::_mfPositions field. | |
| const MFPnt2f & | getPositions (void) const |
| Get the PolygonForeground::_mfPositions field. | |
| Vec3f & | getTexCoords (const UInt32 index) |
| Get the value of the index element the PolygonForeground::_mfTexCoords field. | |
| MFVec3f & | getTexCoords (void) |
| Get the PolygonForeground::_mfTexCoords field. | |
| const MFVec3f & | getTexCoords (void) const |
| Get the PolygonForeground::_mfTexCoords field. | |
Field Set | |
| *void | setMaterial (const MaterialPtr &value) |
| Set the value of the PolygonForeground::_sfMaterial field. | |
| void | setNormalizedX (const bool &value) |
| Set the value of the PolygonForeground::_sfNormalizedX field. | |
| void | setNormalizedY (const bool &value) |
| Set the value of the PolygonForeground::_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 |
Static Public Member Functions | |
Class Get | |
| *static FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Construction | |
| *static PolygonForegroundPtr | create (void) |
| create a new instance of the class | |
| static PolygonForegroundPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Public Attributes | |
| static const osg::BitVector | MaterialFieldMask |
| static const osg::BitVector | PositionsFieldMask |
| static const osg::BitVector | TexCoordsFieldMask |
| static const osg::BitVector | NormalizedXFieldMask |
| static const osg::BitVector | NormalizedYFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const osg::BitVector | ActiveFieldMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
Protected Member Functions | |
Constructors | |
| * | PolygonForeground (void) |
| PolygonForeground (const PolygonForeground &source) | |
Destructors | |
| *virtual | ~PolygonForeground (void) |
Helpers | |
| *Real32 | mapCoordinate (Real32 val, Real32 max, bool norm) |
Sync | |
| *void | executeSyncImpl (PolygonForegroundBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Protected Attributes | |
Fields | |
| *SFMaterialPtr | _sfMaterial |
| MFPnt2f | _mfPositions |
| MFVec3f | _mfTexCoords |
| SFBool | _sfNormalizedX |
| SFBool | _sfNormalizedY |
Private Types | |
| typedef PolygonForegroundBase | Inherited |
Private Member Functions | |
| void | operator= (const PolygonForeground &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
Friends | |
| class | FieldContainer |
| class | PolygonForegroundBase |
The polygon material is defined by _sfMaterial, the positions by _mfPositions, the texture coordinates by _mfTexCoords. The interpretation of the positions is controlled by _sfNormalizedX and _sfNormalizedY.
Definition at line 55 of file OSGPolygonForeground.h.
|
|
Reimplemented from osg::PolygonForegroundBase. Definition at line 59 of file OSGPolygonForeground.h. |
|
|
Reimplemented from osg::ForegroundBase. Definition at line 94 of file OSGPolygonForegroundBase.h. |
|
|
Reimplemented from osg::ForegroundBase. Definition at line 96 of file OSGPolygonForegroundBase.h. 00097 { 00098 MaterialFieldId = Inherited::NextFieldId, 00099 PositionsFieldId = MaterialFieldId + 1, 00100 TexCoordsFieldId = PositionsFieldId + 1, 00101 NormalizedXFieldId = TexCoordsFieldId + 1, 00102 NormalizedYFieldId = NormalizedXFieldId + 1, 00103 NextFieldId = NormalizedYFieldId + 1 00104 };
|
|
|
Definition at line 95 of file OSGPolygonForeground.cpp. 00095 : 00096 Inherited() 00097 { 00098 }
|
|
|
Definition at line 100 of file OSGPolygonForeground.cpp. 00100 : 00101 Inherited(source) 00102 { 00103 }
|
|
|
Definition at line 105 of file OSGPolygonForeground.cpp.
|
|
||||||||||||
|
Reimplemented from osg::Foreground. Definition at line 111 of file OSGPolygonForeground.cpp. References osg::Foreground::changed(). 00112 { 00113 Inherited::changed(whichField, origin); 00114 }
|
|
||||||||||||
|
Reimplemented from osg::Foreground. Definition at line 116 of file OSGPolygonForeground.cpp. References SLOG. 00118 { 00119 SLOG << "Dump PolygonForeground NI" << std::endl; 00120 }
|
|
||||||||||||
|
Implements osg::Foreground. Definition at line 142 of file OSGPolygonForeground.cpp. References FWARNING, osg::PolygonForegroundBase::getMaterial(), osg::PolygonForegroundBase::getNormalizedX(), osg::PolygonForegroundBase::getNormalizedY(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::PolygonForegroundBase::getPositions(), osg::MField< FieldTypeT, fieldNameSpace >::getSize(), osg::PolygonForegroundBase::getTexCoords(), mapCoordinate(), and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00143 { 00144 if(getPositions().getSize() == 0) // nothing to render 00145 return; 00146 00147 if(port->getPixelWidth() == 0 || 00148 port->getPixelHeight() == 0 ) // nothing to render to 00149 return; 00150 00151 if(getPositions().getSize() != getTexCoords().getSize()) 00152 { 00153 FWARNING(("PolygonForeground::draw: positions and texcoords have " 00154 "different sizes (%d vs. %d)!\n", 00155 getPositions().getSize(), getTexCoords().getSize())); 00156 return; 00157 } 00158 00159 glPushAttrib(GL_ALL_ATTRIB_BITS); 00160 00161 glPushMatrix(); 00162 glLoadIdentity(); 00163 glMatrixMode(GL_PROJECTION); 00164 glPushMatrix(); 00165 glLoadIdentity(); 00166 00167 glOrtho(0, port->getPixelWidth(), 0, port->getPixelHeight(), 0, 1); 00168 00169 getMaterial()->getState()->activate(act); 00170 00171 UInt16 i; 00172 00173 Vec3f *tc = &getTexCoords()[0]; 00174 Pnt2f *pos = &getPositions()[0]; 00175 00176 glBegin(GL_POLYGON); 00177 00178 for(i = 0; i < getPositions().size(); i++) 00179 { 00180 glTexCoord3fv( tc[i].getValues() ); 00181 glVertex2f( mapCoordinate(pos[i][0], Real32(port->getPixelWidth()), 00182 getNormalizedX()), 00183 mapCoordinate(pos[i][1], Real32(port->getPixelHeight()), 00184 getNormalizedY()) ); 00185 } 00186 00187 glEnd(); 00188 00189 getMaterial()->getState()->deactivate(act); 00190 00191 glPopMatrix(); 00192 glMatrixMode(GL_MODELVIEW); 00193 glPopMatrix(); 00194 00195 glPopAttrib(); 00196 }
|
|
||||||||||||||||
|
Definition at line 122 of file OSGPolygonForeground.cpp. Referenced by draw(). 00123 { 00124 if(val >= 0) 00125 { 00126 if (norm) 00127 val *= max; 00128 } 00129 else 00130 { 00131 val += 1; 00132 00133 if (norm) 00134 val *= max; 00135 00136 val = max + val; 00137 } 00138 00139 return val; 00140 }
|
|
|
Reimplemented from osg::Foreground. Definition at line 80 of file OSGPolygonForeground.cpp.
|
|
|
|
|
|
Reimplemented from osg::ForegroundBase. Definition at line 58 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_type. Referenced by osg::PolygonForegroundBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::ForegroundBase. Definition at line 65 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::ForegroundBase. Definition at line 150 of file OSGPolygonForegroundBase.cpp. References osg::PolygonForegroundBase::_type. 00151 { 00152 return _type; 00153 }
|
|
|
Reimplemented from osg::ForegroundBase. Definition at line 155 of file OSGPolygonForegroundBase.cpp. References osg::PolygonForegroundBase::_type. 00156 { 00157 return _type; 00158 }
|
|
|
Reimplemented from osg::ForegroundBase. Definition at line 170 of file OSGPolygonForegroundBase.cpp. 00171 { 00172 return sizeof(PolygonForeground); 00173 }
|
|
|
Definition at line 101 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfMaterial. 00102 { 00103 return &_sfMaterial; 00104 }
|
|
|
Definition at line 108 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfPositions. 00109 { 00110 return &_mfPositions; 00111 }
|
|
|
Definition at line 115 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfTexCoords. 00116 { 00117 return &_mfTexCoords; 00118 }
|
|
|
Definition at line 122 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedX. 00123 { 00124 return &_sfNormalizedX; 00125 }
|
|
|
Definition at line 129 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedY. 00130 { 00131 return &_sfNormalizedY; 00132 }
|
|
|
Definition at line 137 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by draw(). 00138 { 00139 return _sfMaterial.getValue(); 00140 }
|
|
|
Definition at line 144 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00145 { 00146 return _sfMaterial.getValue(); 00147 }
|
|
|
Definition at line 158 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedX, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by draw(). 00159 { 00160 return _sfNormalizedX.getValue(); 00161 }
|
|
|
Definition at line 165 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedX, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00166 { 00167 return _sfNormalizedX.getValue(); 00168 }
|
|
|
Definition at line 179 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedY, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by draw(). 00180 { 00181 return _sfNormalizedY.getValue(); 00182 }
|
|
|
Definition at line 186 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedY, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00187 { 00188 return _sfNormalizedY.getValue(); 00189 }
|
|
|
Definition at line 201 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfPositions. 00202 { 00203 return _mfPositions[index]; 00204 }
|
|
|
Definition at line 208 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfPositions. Referenced by draw(). 00209 { 00210 return _mfPositions; 00211 }
|
|
|
Definition at line 215 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfPositions. 00216 { 00217 return _mfPositions; 00218 }
|
|
|
Definition at line 222 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfTexCoords. 00223 { 00224 return _mfTexCoords[index]; 00225 }
|
|
|
Definition at line 229 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfTexCoords. Referenced by draw(). 00230 { 00231 return _mfTexCoords; 00232 }
|
|
|
Definition at line 236 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_mfTexCoords. 00237 { 00238 return _mfTexCoords; 00239 }
|
|
|
Definition at line 151 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00152 { 00153 _sfMaterial.setValue(value); 00154 }
|
|
|
Definition at line 172 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedX, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00173 { 00174 _sfNormalizedX.setValue(value); 00175 }
|
|
|
Definition at line 193 of file OSGPolygonForegroundBase.inl. References osg::PolygonForegroundBase::_sfNormalizedY, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00194 { 00195 _sfNormalizedY.setValue(value); 00196 }
|
|
|
||||||||||||
|
||||||||||||
|
|
Definition at line 72 of file OSGPolygonForegroundBase.inl. References osg::AttachmentContainerPtr::dcast(), osg::PolygonForegroundBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::PolygonForegroundBase::shallowCopy(). 00073 { 00074 PolygonForegroundPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = PolygonForegroundPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
|
|
|
|