#include <OSGPolygonBackground.h>
Inheritance diagram for osg::PolygonBackground:

Definition at line 56 of file OSGPolygonBackground.h.
|
|
Reimplemented from osg::PolygonBackgroundBase. Definition at line 60 of file OSGPolygonBackground.h. |
|
|
Reimplemented from osg::BackgroundBase. Definition at line 94 of file OSGPolygonBackgroundBase.h. |
|
|
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 };
|
|
|
Definition at line 84 of file OSGPolygonBackground.cpp. 00084 : 00085 Inherited() 00086 { 00087 }
|
|
|
Definition at line 89 of file OSGPolygonBackground.cpp. 00089 : 00090 Inherited(source) 00091 { 00092 }
|
|
|
Definition at line 94 of file OSGPolygonBackground.cpp.
|
|
||||||||||||
|
Implements osg::Background. Definition at line 120 of file OSGPolygonBackground.cpp. References FWARNING, osg::PolygonBackgroundBase::getMaterial(), osg::PolygonBackgroundBase::getNormalizedX(), osg::PolygonBackgroundBase::getNormalizedY(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::PolygonBackgroundBase::getPositions(), osg::PolygonBackgroundBase::getTexCoords(), GLboolean, and mapCoordinate(). 00121 { 00122 if (port->getPixelWidth() == 0 || 00123 port->getPixelHeight() == 0 ) 00124 { 00125 FWARNING(("Port has zero size: nothing to render to!\n")); 00126 return; 00127 } 00128 00129 if (getPositions().getSize() == 0 || 00130 getPositions().getSize() != getTexCoords().getSize()) 00131 { 00132 FWARNING(("PolygonBackground::clear: positions and texcoords have " 00133 "different/ invalid sizes (%d vs. %d)!\n", 00134 getPositions().getSize(), getTexCoords().getSize())); 00135 return; 00136 } 00137 00138 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00139 00140 glPushAttrib(GL_ALL_ATTRIB_BITS); 00141 00142 GLboolean depth = glIsEnabled(GL_DEPTH_TEST); 00143 glDisable(GL_DEPTH_TEST); 00144 00145 GLint depthFunc; 00146 glGetIntegerv(GL_DEPTH_FUNC, &depthFunc); 00147 glDepthFunc(GL_ALWAYS); 00148 00149 glDepthMask(GL_FALSE); 00150 00151 glMatrixMode(GL_MODELVIEW); 00152 glPushMatrix(); 00153 glLoadIdentity(); 00154 00155 glMatrixMode(GL_PROJECTION); 00156 glPushMatrix(); 00157 glLoadIdentity(); 00158 glOrtho(0, port->getPixelWidth(), 0, port->getPixelHeight(), 0, 1); 00159 00160 getMaterial()->getState()->activate(act); 00161 00162 Vec3f *tc = &getTexCoords()[0]; 00163 Pnt2f *pos = &getPositions()[0]; 00164 00165 glBegin(GL_POLYGON); 00166 00167 for (UInt16 i=0; i<getPositions().size(); i++) 00168 { 00169 glTexCoord3fv( tc[i].getValues() ); 00170 glVertex2f( mapCoordinate(pos[i][0], Real32(port->getPixelWidth()), 00171 getNormalizedX()), 00172 mapCoordinate(pos[i][1], Real32(port->getPixelHeight()), 00173 getNormalizedY()) ); 00174 } 00175 00176 glEnd(); 00177 00178 getMaterial()->getState()->deactivate(act); 00179 00180 glClear(GL_DEPTH_BUFFER_BIT); 00181 00182 glDepthMask(GL_TRUE); 00183 00184 if (depth) 00185 glEnable(GL_DEPTH_TEST); 00186 glDepthFunc(depthFunc); 00187 00188 glPopMatrix(); 00189 glMatrixMode(GL_MODELVIEW); 00190 glPopMatrix(); 00191 00192 glPopAttrib(); 00193 }
|
|
||||||||||||
|
Reimplemented from osg::Background. Definition at line 195 of file OSGPolygonBackground.cpp. References osg::Background::changed(). 00196 { 00197 Inherited::changed(whichField, origin); 00198 }
|
|
||||||||||||
|
Reimplemented from osg::Background. Definition at line 200 of file OSGPolygonBackground.cpp. References SLOG. 00202 { 00203 SLOG << "Dump PolygonBackground NI" << std::endl; 00204 }
|
|
||||||||||||||||
|
Definition at line 100 of file OSGPolygonBackground.cpp. Referenced by clear(). 00101 { 00102 if(val >= 0) 00103 { 00104 if (norm) 00105 val *= max; 00106 } 00107 else 00108 { 00109 val += 1; 00110 00111 if (norm) 00112 val *= max; 00113 00114 val = max + val; 00115 } 00116 00117 return val; 00118 }
|
|
|
Reimplemented from osg::Background. Definition at line 69 of file OSGPolygonBackground.cpp.
|
|
|
|
|
|
Reimplemented from osg::BackgroundBase. Definition at line 58 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_type. Referenced by osg::PolygonBackgroundBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::BackgroundBase. Definition at line 65 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::BackgroundBase. Definition at line 150 of file OSGPolygonBackgroundBase.cpp. References osg::PolygonBackgroundBase::_type. 00151 { 00152 return _type; 00153 }
|
|
|
Reimplemented from osg::BackgroundBase. Definition at line 155 of file OSGPolygonBackgroundBase.cpp. References osg::PolygonBackgroundBase::_type. 00156 { 00157 return _type; 00158 }
|
|
|
Reimplemented from osg::BackgroundBase. Definition at line 170 of file OSGPolygonBackgroundBase.cpp. 00171 { 00172 return sizeof(PolygonBackground); 00173 }
|
|
|
Definition at line 101 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfMaterial. 00102 { 00103 return &_sfMaterial; 00104 }
|
|
|
Definition at line 108 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfTexCoords. 00109 { 00110 return &_mfTexCoords; 00111 }
|
|
|
Definition at line 115 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfPositions. 00116 { 00117 return &_mfPositions; 00118 }
|
|
|
Definition at line 122 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfNormalizedX. 00123 { 00124 return &_sfNormalizedX; 00125 }
|
|
|
Definition at line 129 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfNormalizedY. 00130 { 00131 return &_sfNormalizedY; 00132 }
|
|
|
Definition at line 137 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by clear(). 00138 { 00139 return _sfMaterial.getValue(); 00140 }
|
|
|
Definition at line 144 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00145 { 00146 return _sfMaterial.getValue(); 00147 }
|
|
|
Definition at line 158 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfNormalizedX, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by clear(). 00159 { 00160 return _sfNormalizedX.getValue(); 00161 }
|
|
|
Definition at line 165 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfNormalizedX, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00166 { 00167 return _sfNormalizedX.getValue(); 00168 }
|
|
|
Definition at line 179 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfNormalizedY, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by clear(). 00180 { 00181 return _sfNormalizedY.getValue(); 00182 }
|
|
|
Definition at line 186 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfNormalizedY, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00187 { 00188 return _sfNormalizedY.getValue(); 00189 }
|
|
|
Definition at line 201 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfTexCoords. 00202 { 00203 return _mfTexCoords[index]; 00204 }
|
|
|
Definition at line 208 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfTexCoords. Referenced by clear(). 00209 { 00210 return _mfTexCoords; 00211 }
|
|
|
Definition at line 215 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfTexCoords. 00216 { 00217 return _mfTexCoords; 00218 }
|
|
|
Definition at line 222 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfPositions. 00223 { 00224 return _mfPositions[index]; 00225 }
|
|
|
Definition at line 229 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfPositions. Referenced by clear(). 00230 { 00231 return _mfPositions; 00232 }
|
|
|
Definition at line 236 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_mfPositions. 00237 { 00238 return _mfPositions; 00239 }
|
|
|
Definition at line 151 of file OSGPolygonBackgroundBase.inl. References osg::PolygonBackgroundBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). |