#include <OSGSlices.h>

Public Types | |
| enum | { SizeFieldId = Inherited::NextFieldId, SliceDistanceFieldId = SizeFieldId + 1, NextFieldId = SliceDistanceFieldId + 1 } |
| typedef SlicesPtr | Ptr |
| enum | { MaterialFieldId = Inherited::NextFieldId, NextFieldId = MaterialFieldId + 1 } |
| enum | { ParentsFieldId = Inherited::NextFieldId, NextFieldId = ParentsFieldId + 1 } |
| typedef MFNodePtr | ParentField |
| typedef MFNodePtr * | ParentFieldPtr |
| typedef MFNodePtr::iterator | ParentFieldIt |
| enum | { AttachmentsFieldId = Inherited::NextFieldId, NextFieldId = AttachmentsFieldId + 1 } |
| enum | { NextFieldId = 1 } |
Public Member Functions | |
action handler | |
| virtual Action::ResultE | drawPrimitives (DrawActionBase *action) |
| Action::ResultE | intersect (Action *action) |
update | |
| void | adjustVolume (Volume &volume) |
Field Set | |
| void | setMaterial (const MaterialPtr &value) |
Sync | |
| virtual void | changed (BitVector whichField, UInt32 from) |
| 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 FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| SFVec3f * | getSFSize (void) |
| Get the Slices::_sfSize field. | |
| SFReal32 * | getSFSliceDistance (void) |
| Get the Slices::_sfSliceDistance field. | |
| Vec3f & | getSize (void) |
| Get the value of the Slices::_sfSize field. | |
| const Vec3f & | getSize (void) const |
| Get the value of the Slices::_sfSize field. | |
| Real32 & | getSliceDistance (void) |
| Get the value of the Slices::_sfSliceDistance field. | |
| const Real32 & | getSliceDistance (void) const |
| Get the value of the Slices::_sfSliceDistance field. | |
Field Set | |
| void | setSize (const Vec3f &value) |
| Set the value of the Slices::_sfSize field. | |
| void | setSliceDistance (const Real32 &value) |
| Set the value of the Slices::_sfSliceDistance 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 |
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 | |
| SFMaterialPtr * | getSFMaterial (void) |
| Get the MaterialDrawable::_sfMaterial field. | |
| MaterialPtr & | getMaterial (void) |
| Get the value of the MaterialDrawable::_sfMaterial field. | |
| const MaterialPtr & | getMaterial (void) const |
| Get the value of the MaterialDrawable::_sfMaterial field. | |
Parents | |
| MFNodePtr & | getParents (void) |
| const MFNodePtr & | getParents (void) const |
| MFNodePtr * | getMFParents (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) |
| SFAttachmentMap * | getSFAttachments (void) |
Get Instance Type Information | |
| UInt32 | getTypeId (void) const |
| UInt16 | getGroupId (void) const |
| const Char8 * | getTypeName (void) const |
| Field * | getField (UInt32 fieldId) |
| Field * | getField (const Char8 *fieldName) |
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 SlicesPtr | create (void) |
| create a new instance of the class | |
| static SlicesPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Get Class Type Information | |
| static UInt16 | getClassGroupId (void) |
Static Public Attributes | |
| static const osg::BitVector | SizeFieldMask |
| static const osg::BitVector | SliceDistanceFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const osg::BitVector | MaterialFieldMask |
| static const BitVector | ParentsFieldMask = (1 << NodeCore::ParentsFieldId ) |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
static stat elem | |
| static StatElemDesc< StatIntElem > | statNTriangles |
| static StatElemDesc< StatIntElem > | statNLines |
| static StatElemDesc< StatIntElem > | statNPoints |
| static StatElemDesc< StatIntElem > | statNVertices |
| static StatElemDesc< StatIntElem > | statNPrimitives |
| static StatElemDesc < StatIntOnceElem > | statNGeoBytes |
CoredNodePtr helper | |
| static const bool | isNodeCore = true |
Protected Member Functions | |
Constructors | |
| Slices (void) | |
| Constructor. | |
| Slices (const Slices &source) | |
| Copy Constructor. | |
Destructors | |
| virtual | ~Slices (void) |
| Destructor. | |
Sync | |
| void | executeSyncImpl (SlicesBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, 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) |
MT Destruction | |
| virtual void | onDestroy (void) |
Set / Get Parents | |
| void | addParent (const NodePtr &parent) |
| void | subParent (const NodePtr &parent) |
Pointer | |
| NodeCorePtr | getPtr (void) const |
Pointer | |
| AttachmentContainerPtr | getPtr (void) |
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) |
MT Construction | |
| void | onCreate (const FieldContainer *source=NULL) |
| void | onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL) |
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 | |
| SFVec3f | _sfSize |
| SFReal32 | _sfSliceDistance |
Fields | |
| SFMaterialPtr | _sfMaterial |
Fields | |
| MFNodePtr | _parents |
Fields | |
| SFAttachmentMap | _attachmentMap |
Member | |
| UInt32 | _shares |
Private Types | |
| typedef SlicesBase | Inherited |
Private Member Functions | |
| void | initEdgeVec (void) |
| unsigned | createSlice (const osg::Plane &plane, Slice &result) |
| void | drawSlices (Window *win, const Vec3f &planeNormal, UInt32 &triCount, UInt32 &vertexCount) |
| void | operator= (const Slices &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
| initialize the static features of the class, e.g. action callbacks | |
Private Attributes | |
| std::vector< Pnt3f > | _pointVec |
| std::vector< Edge > | _edgeVec |
Static Private Attributes | |
| static UInt32 | _arbMultitexture = Window::invalidFunctionID |
| static UInt32 | _funcMultiTexCoord3fARB = Window::invalidFunctionID |
Friends | |
| class | FieldContainer |
| class | SlicesBase |
Classes | |
| struct | Edge |
| struct | Slice |
Definition at line 64 of file OSGSlices.h.
typedef SlicesBase osg::Slices::Inherited [private] |
typedef SlicesPtr osg::SlicesBase::Ptr [inherited] |
typedef MFNodePtr osg::NodeCore::ParentField [inherited] |
Definition at line 85 of file OSGNodeCore.h.
typedef MFNodePtr* osg::NodeCore::ParentFieldPtr [inherited] |
Definition at line 86 of file OSGNodeCore.h.
typedef MFNodePtr::iterator osg::NodeCore::ParentFieldIt [inherited] |
Definition at line 87 of file OSGNodeCore.h.
anonymous enum [inherited] |
Definition at line 93 of file OSGSlicesBase.h.
00094 { 00095 SizeFieldId = Inherited::NextFieldId, 00096 SliceDistanceFieldId = SizeFieldId + 1, 00097 NextFieldId = SliceDistanceFieldId + 1 00098 };
anonymous enum [inherited] |
Definition at line 92 of file OSGMaterialDrawableBase.h.
00093 { 00094 MaterialFieldId = Inherited::NextFieldId, 00095 NextFieldId = MaterialFieldId + 1 00096 };
anonymous enum [inherited] |
Definition at line 93 of file OSGNodeCore.h.
00094 { 00095 ParentsFieldId = Inherited::NextFieldId, 00096 NextFieldId = ParentsFieldId + 1 00097 };
anonymous enum [inherited] |
Definition at line 78 of file OSGAttachmentContainerImpl.h.
00079 { 00080 AttachmentsFieldId = Inherited::NextFieldId, 00081 NextFieldId = AttachmentsFieldId + 1 00082 };
anonymous enum [inherited] |
| Slices::Slices | ( | void | ) | [protected] |
Definition at line 79 of file OSGSlices.cpp.
References _arbMultitexture, _funcMultiTexCoord3fARB, OSG_DLSYM_UNDERSCORE, osg::Window::registerExtension(), and osg::Window::registerFunction().
00079 : 00080 Inherited() 00081 { 00082 _arbMultitexture = 00083 Window::registerExtension("GL_ARB_multitexture"); 00084 00085 _funcMultiTexCoord3fARB = 00086 Window::registerFunction(OSG_DLSYM_UNDERSCORE"glMultiTexCoord3fARB", 00087 _arbMultitexture); 00088 }
| Slices::Slices | ( | const Slices & | source | ) | [protected] |
| Slices::~Slices | ( | void | ) | [protected, virtual] |
Definition at line 99 of file OSGSlices.cpp.
References osg::MaterialDrawableBase::_sfMaterial, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::subRefCP().
00100 { 00101 subRefCP(_sfMaterial.getValue()); 00102 }
| Action::ResultE Slices::drawPrimitives | ( | DrawActionBase * | action | ) | [virtual] |
Reimplemented from osg::MaterialDrawable.
Definition at line 201 of file OSGSlices.cpp.
References osg::StatIntElem::add(), osg::Action::Continue, drawSlices(), osg::Action::getActNode(), osg::DrawActionBase::getCameraToWorld(), osg::StatCollector::getElem(), osg::DrawActionBase::getStatistics(), osg::DrawActionBase::getWindow(), osg::TransformationMatrix< ValueTypeT >::invert(), osg::TransformationMatrix< ValueTypeT >::multLeft(), osg::TransformationMatrix< ValueTypeT >::multMatrixVec(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::Drawable::statNTriangles, osg::Drawable::statNVertices, and osg::RenderAction::top_matrix().
00202 { 00203 Matrix camera,toworld; 00204 UInt32 triCount, vertexCount; 00205 Vec3f planeNormal(0,0,1); 00206 StatCollector *coll = action->getStatistics(); 00207 StatIntElem *el = 0; 00208 00209 RenderAction *ra = dynamic_cast<RenderAction *>(action); 00210 00211 camera = action->getCameraToWorld(); 00212 00213 if(ra != NULL) 00214 { 00215 toworld = ra->top_matrix(); 00216 } 00217 else 00218 { 00219 action->getActNode()->getToWorld(toworld); 00220 } 00221 00222 // normalize them, we don't want to neutralize scales in toworld 00223 toworld[0].normalize(); 00224 toworld[1].normalize(); 00225 toworld[2].normalize(); 00226 toworld.invert(); 00227 camera.multLeft(toworld); 00228 00229 // Viewer direction 00230 camera.multMatrixVec(planeNormal,planeNormal); 00231 planeNormal.normalize(); 00232 00233 drawSlices(action->getWindow(), planeNormal,triCount,vertexCount); 00234 00235 if (coll) 00236 { 00237 if((el = coll->getElem(Drawable::statNTriangles,false))) 00238 el->add(triCount); 00239 if((el = coll->getElem(Drawable::statNVertices,false))) 00240 el->add(vertexCount); 00241 } 00242 00243 /* TODO; bbox draw code; just for debuggging; drawBBox opt ? 00244 glPushAttrib ( GL_ENABLE_BIT ); 00245 glDisable (GL_LIGHTING); 00246 glDisable (GL_TEXTURE_1D); 00247 glDisable (GL_TEXTURE_2D); 00248 glDisable (GL_TEXTURE_3D); 00249 00250 glBegin( GL_LINES ); 00251 { 00252 for (int i = 0; i < 12; i++) 00253 { 00254 glVertex3fv (_pointVec[_edgeVec[i].pointIndexA].getValues()); 00255 glVertex3fv (_pointVec[_edgeVec[i].pointIndexB].getValues()); 00256 } 00257 } 00258 glEnd(); 00259 glPopAttrib(); 00260 */ 00261 00262 return Action::Continue; 00263 }
| Action::ResultE Slices::intersect | ( | Action * | action | ) |
Definition at line 171 of file OSGSlices.cpp.
References osg::Action::Continue.
Referenced by initMethod().
00172 { 00173 /* 00174 IntersectAction * ia = dynamic_cast<IntersectAction*>(action); 00175 const DynamicVolume &dv = ia->getActNode()->getVolume(); 00176 00177 if( dv.isValid() && !dv.intersect(ia->getLine()) ) 00178 { 00179 return Action::Skip; //bv missed -> can not hit children 00180 } 00181 00182 TriangleIterator it; 00183 Real32 t; 00184 Vec3f norm; 00185 00186 for( it = this->beginTriangles(); it != this->endTriangles(); ++it ) 00187 { 00188 if( ia->getLine().intersect( it.getPosition(0), 00189 it.getPosition(1), 00190 it.getPosition(2), t, &norm) ) 00191 { 00192 ia->setHit( t, ia->getActNode(), it.getIndex(), norm ); 00193 } 00194 } 00195 00196 */ 00197 00198 return Action::Continue; 00199 }
| void Slices::adjustVolume | ( | Volume & | volume | ) | [virtual] |
Reimplemented from osg::NodeCore.
Definition at line 265 of file OSGSlices.cpp.
References osg::SlicesBase::_sfSize, osg::Volume::extendBy(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), p, osg::Volume::setEmpty(), and osg::Volume::setValid().
00266 { 00267 Vec3f v(_sfSize.getValue()); 00268 Pnt3f p(v[0],v[1],v[2]); 00269 00270 volume.setValid(); 00271 volume.setEmpty(); 00272 00273 p /= 2; 00274 volume.extendBy ( p ); 00275 00276 p.negate(); 00277 volume.extendBy ( p ); 00278 }
| void osg::Slices::setMaterial | ( | const MaterialPtr & | value | ) | [inline] |
Reimplemented from osg::MaterialDrawable.
Definition at line 46 of file OSGSlices.inl.
References osg::MaterialDrawableBase::_sfMaterial, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::setRefdCP().
Referenced by changed().
00047 { 00048 setRefdCP(_sfMaterial.getValue(), value); 00049 }
Reimplemented from osg::MaterialDrawable.
Definition at line 133 of file OSGSlices.cpp.
References osg::MaterialDrawableBase::_sfMaterial, osg::ChangedOrigin::Abstract, osg::ChangedOrigin::AbstrIncRefCount, osg::addRefCP(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), initEdgeVec(), osg::NodeCore::invalidateVolume(), osg::MaterialDrawableBase::MaterialFieldMask, osg::NullFC, setMaterial(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::SlicesBase::SizeFieldMask.
00135 { 00136 if(whichField & MaterialFieldMask) 00137 { 00138 if(origin & ChangedOrigin::Abstract) 00139 { 00140 if(origin & ChangedOrigin::AbstrIncRefCount) 00141 { 00142 addRefCP(_sfMaterial.getValue()); 00143 } 00144 else 00145 { 00146 MaterialPtr pMat = _sfMaterial.getValue(); 00147 00148 _sfMaterial.setValue(NullFC); 00149 00150 setMaterial(pMat); 00151 } 00152 } 00153 } 00154 00155 if(whichField & SizeFieldMask) 00156 { 00157 initEdgeVec(); 00158 invalidateVolume(); 00159 } 00160 00161 }
Reimplemented from osg::MaterialDrawable.
Definition at line 165 of file OSGSlices.cpp.
References SLOG.
00167 { 00168 SLOG << "Dump Slices NI" << std::endl; 00169 }
| void Slices::initEdgeVec | ( | void | ) | [private] |
Definition at line 288 of file OSGSlices.cpp.
References _edgeVec, _pointVec, FDEBUG, osg::SlicesBase::getSize(), and p.
Referenced by changed(), and drawSlices().
00289 { 00290 UInt32 i; 00291 std::vector<Pnt3f> & p(_pointVec); 00292 const Vec3f size(getSize()); 00293 00294 FDEBUG (("Run Slices::initEdgeVec()\n")); 00295 00296 // create the corner points 00297 00298 // 4--------5 00299 // /| /| 00300 // / | / | 00301 // / | / | 00302 // 7--------6 | 00303 // | 0----|---1 00304 // | / | / 00305 // | / | / 00306 // |/ |/ 00307 // 3--------2 00308 00309 _pointVec.resize(8); 00310 00311 p[0][0] = p[3][0] = p[4][0] = p[7][0] = -0.5f * size.x(); 00312 p[1][0] = p[2][0] = p[5][0] = p[6][0] = 0.5f * size.x(); 00313 p[0][1] = p[1][1] = p[2][1] = p[3][1] = -0.5f * size.y(); 00314 p[4][1] = p[5][1] = p[6][1] = p[7][1] = 0.5f * size.y(); 00315 p[0][2] = p[1][2] = p[4][2] = p[5][2] = -0.5f * size.z(); 00316 p[2][2] = p[3][2] = p[6][2] = p[7][2] = 0.5f * size.z(); 00317 00318 // create the edge description 00319 // 4--------5 *---4----* 0: - - - 00320 // /| /| /| /| 1: + - - 00321 // / | / | 7 | 5 | 2: + - + 00322 // / | / | / 8 / 9 3: - - + 00323 // 7--------6 | *----6---* | 4: - + - 00324 // | 0----|---1 | *---0|---* 5: + + - 00325 // | / | / 11 / 10 / 6: + + + 00326 // | / | / | 3 | 1 7: - + + 00327 // |/ |/ |/ |/ 00328 // 3--------2 *---2----* 00329 // 00330 // cubeCorners edges 00331 00332 _edgeVec.resize(12); 00333 00334 _edgeVec[0].pointIndexA = 0; // 1 : positiv 0: negativ 00: parallel 00335 _edgeVec[0].pointIndexB = 1; // xmax xmin ymax ymin zmax zmin 00336 _edgeVec[0].edgeTag = 5; // 0 0 0 1 0 1 00337 00338 _edgeVec[1].pointIndexA = 1; 00339 _edgeVec[1].pointIndexB = 2; // xmax xmin ymax ymin zmax zmin 00340 _edgeVec[1].edgeTag = 36; // 1 0 0 1 0 0 00341 00342 _edgeVec[2].pointIndexA = 2; 00343 _edgeVec[2].pointIndexB = 3; // xmax xmin ymax ymin zmax zmin 00344 _edgeVec[2].edgeTag = 6; // 0 0 0 1 1 0 00345 00346 _edgeVec[3].pointIndexA = 3; 00347 _edgeVec[3].pointIndexB = 0; // xmax xmin ymax ymin zmax zmin 00348 _edgeVec[3].edgeTag = 20; // 0 1 0 1 0 0 00349 00350 _edgeVec[4].pointIndexA = 4; 00351 _edgeVec[4].pointIndexB = 5; // xmax xmin ymax ymin zmax zmin 00352 _edgeVec[4].edgeTag = 9; // 0 0 1 0 0 1 00353 00354 _edgeVec[5].pointIndexA = 5; 00355 _edgeVec[5].pointIndexB = 6; // xmax xmin ymax ymin zmax zmin 00356 _edgeVec[5].edgeTag = 40; // 1 0 1 0 0 0 00357 00358 _edgeVec[6].pointIndexA = 6; 00359 _edgeVec[6].pointIndexB = 7; // xmax xmin ymax ymin zmax zmin 00360 _edgeVec[6].edgeTag = 10; // 0 0 1 0 1 0 00361 00362 _edgeVec[7].pointIndexA = 7; 00363 _edgeVec[7].pointIndexB = 4; // xmax xmin ymax ymin zmax zmin 00364 _edgeVec[7].edgeTag = 24; // 0 1 1 0 0 0 00365 00366 _edgeVec[8].pointIndexA = 0; 00367 _edgeVec[8].pointIndexB = 4; // xmax xmin ymax ymin zmax zmin 00368 _edgeVec[8].edgeTag = 17; // 0 1 0 0 0 1 00369 00370 _edgeVec[9].pointIndexA = 1; 00371 _edgeVec[9].pointIndexB = 5; // xmax xmin ymax ymin zmax zmin 00372 _edgeVec[9].edgeTag = 33; // 1 0 0 0 0 1 00373 00374 _edgeVec[10].pointIndexA = 2; 00375 _edgeVec[10].pointIndexB = 6; // xmax xmin ymax ymin zmax zmin 00376 _edgeVec[10].edgeTag = 34; // 1 0 0 0 1 0 00377 00378 _edgeVec[11].pointIndexA = 3; 00379 _edgeVec[11].pointIndexB = 7; // xmax xmin ymax ymin zmax zmin 00380 _edgeVec[11].edgeTag = 18; // 0 1 0 0 1 0 00381 00382 // create one line for every edge 00383 for (i = 0; i < 12; i++) 00384 _edgeVec[i].line.setValue( _pointVec[_edgeVec[i].pointIndexA], 00385 _pointVec[_edgeVec[i].pointIndexB]); 00386 }
| UInt32 Slices::createSlice | ( | const osg::Plane & | plane, | |
| Slice & | result | |||
| ) | [private] |
Definition at line 388 of file OSGSlices.cpp.
References _edgeVec, _pointVec, osg::Slices::Slice::ccw, osg::VectorInterface< ValueTypeT, StorageInterfaceT >::cross(), osg::Slices::Slice::edgeVec, osg::Slices::Slice::numOfIntersection, osg::osgSwap(), and osg::Slices::Slice::pointVec.
Referenced by drawSlices().
00389 { 00390 UInt32 i,j,k, lastButOne; 00391 Vec3f v1, v2, winding; 00392 bool pointInHalfSpace[8]; 00393 unsigned swapCount = 0; 00394 00395 // clip the plane with the corner points 00396 for(i = 0; i < 8; i++) 00397 pointInHalfSpace[i] = plane.isInHalfSpace(_pointVec[i]); 00398 00399 // calculate the intersection points 00400 for(slice.numOfIntersection = i = 0; i < 12; i++) 00401 { 00402 if((pointInHalfSpace[_edgeVec[i].pointIndexA] != 00403 pointInHalfSpace[_edgeVec[i].pointIndexB] )) 00404 { 00405 plane.intersect(_edgeVec[i].line, 00406 slice.pointVec[slice.numOfIntersection] ); 00407 slice.edgeVec[slice.numOfIntersection] = i; 00408 slice.numOfIntersection++; 00409 } 00410 } 00411 00412 if (slice.numOfIntersection > 2) 00413 { 00414 lastButOne = slice.numOfIntersection - 2; 00415 i=j=k=0; 00416 00417 // edge sort 00418 for (; j++ <= lastButOne; i++) 00419 { 00420 // find first invalid edgeTag -> j 00421 while((j <= lastButOne) && 00422 ((_edgeVec[slice.edgeVec[i]].edgeTag & 00423 _edgeVec[slice.edgeVec[j]].edgeTag ) != 0)) 00424 { 00425 i++; 00426 j++; 00427 } 00428 00429 // check whether edgeTags are disordered 00430 if (j <= lastButOne) 00431 { 00432 // find first valid edgeTag -> k 00433 k = j+1; 00434 while((k <= lastButOne) && 00435 ((_edgeVec[slice.edgeVec[i]].edgeTag & 00436 _edgeVec[slice.edgeVec[k]].edgeTag ) == 0)) 00437 { 00438 k++; 00439 } 00440 00441 // swap edge (j,k) 00442 osgSwap (slice.edgeVec[j], slice.edgeVec[k]); 00443 osgSwap (slice.pointVec[j], slice.pointVec[k]); 00444 swapCount++; 00445 } 00446 } 00447 00448 // TODO; find a better/faster way to check the winding 00449 // check winding 00450 v1 = slice.pointVec[1]; 00451 v1 -= slice.pointVec[0]; 00452 v2 = slice.pointVec[2]; 00453 v2 -= slice.pointVec[0]; 00454 winding = v1.cross(v2); 00455 00456 slice.ccw = ( fabs (winding.x() + plane.getNormal().x()) 00457 >= fabs(plane.getNormal().x()) ); 00458 } 00459 00460 return slice.numOfIntersection; 00461 }
| void Slices::drawSlices | ( | Window * | win, | |
| const Vec3f & | planeNormal, | |||
| UInt32 & | triCount, | |||
| UInt32 & | vertexCount | |||
| ) | [private] |
Definition at line 463 of file OSGSlices.cpp.
References _arbMultitexture, _edgeVec, _funcMultiTexCoord3fARB, osg::Slices::Slice::ccw, createSlice(), osg::Window::getFunction(), osg::SlicesBase::getSize(), osg::SlicesBase::getSliceDistance(), osg::PointInterface< ValueTypeT, StorageInterfaceT >::getValues(), GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, osg::Window::hasExtension(), initEdgeVec(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::length(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::Slices::Slice::numOfIntersection, osg::Slices::Slice::pointVec, and osg::Plane::set().
Referenced by drawPrimitives().
00465 { 00466 bool has_multitexture = win->hasExtension(_arbMultitexture); 00467 00468 PFNGLMULTITEXCOORD3FARBPROC multiTexCoord3f = NULL; 00469 if(has_multitexture) 00470 multiTexCoord3f = (PFNGLMULTITEXCOORD3FARBPROC) 00471 win->getFunction(_funcMultiTexCoord3fARB); 00472 00473 Real32 hsx = getSize().x()/2, hsy = getSize().y()/2, hsz = getSize().z()/2; 00474 Real32 ssx = 1/getSize().x(), ssy = 1/getSize().y(), ssz = 1/getSize().z(); 00475 Slice slice; 00476 Plane plane; 00477 Real32 distance, sliceDistance, volumeDiagonal = getSize().length(); 00478 Int32 i, si, numOfSlices; 00479 Vec3f texPos0, texPos1, texPos2, texOff, texSliceNormal; 00480 00481 if(_edgeVec.empty()) 00482 initEdgeVec(); 00483 00484 sliceDistance = getSliceDistance(); 00485 numOfSlices = int (volumeDiagonal / sliceDistance) + 1; 00486 distance = - volumeDiagonal / 2; 00487 texOff = planeNormal; 00488 texOff.normalize(); 00489 texOff *= sliceDistance * 0.5; 00490 00491 texSliceNormal.setValues(planeNormal.x() * sliceDistance * ssx, 00492 planeNormal.y() * sliceDistance * ssy, 00493 planeNormal.z() * sliceDistance * ssz ); 00494 00495 triCount = 0; 00496 vertexCount = 0; 00497 00498 if (numOfSlices) 00499 { 00500 glNormal3fv ( planeNormal.getValues() ); 00501 00502 for(si = 0; si < numOfSlices; si++) 00503 { 00504 plane.set ( planeNormal, distance += sliceDistance ); 00505 00506 if(createSlice(plane,slice) > 2) 00507 { 00508 triCount += slice.numOfIntersection - 2; 00509 vertexCount += slice.numOfIntersection; 00510 00511 ::glBegin(GL_POLYGON); 00512 if(slice.ccw) 00513 { 00514 for(i = 0; i < slice.numOfIntersection; i++) 00515 { 00516 texPos0 = texPos1 = texPos2 = slice.pointVec[i]; 00517 texPos1 += texOff; 00518 texPos2 -= texOff; 00519 00520 texSliceNormal = texPos1; 00521 texSliceNormal -= texPos2; 00522 00523 glTexCoord3f((hsx + texPos0.x()) * ssx, 00524 (hsy + texPos0.y()) * ssy, 00525 (hsz + texPos0.z()) * ssz ); 00526 00527 if(has_multitexture) 00528 { 00529 multiTexCoord3f(GL_TEXTURE1_ARB, 00530 (hsx + texPos1.x()) * ssx, 00531 (hsy + texPos1.y()) * ssy, 00532 (hsz + texPos1.z()) * ssz ); 00533 00534 multiTexCoord3f(GL_TEXTURE2_ARB, 00535 (hsx + texPos2.x()) * ssx, 00536 (hsy + texPos2.y()) * ssy, 00537 (hsz + texPos2.z()) * ssz ); 00538 } 00539 glVertex3fv ( slice.pointVec[i].getValues() ); 00540 } 00541 } 00542 else 00543 { 00544 for(i = slice.numOfIntersection - 1; i >= 0; i--) 00545 { 00546 texPos0 = texPos1 = texPos2 = slice.pointVec[i]; 00547 texPos1 += texOff; 00548 texPos2 -= texOff; 00549 00550 glTexCoord3f ((hsx + texPos0.x()) * ssx, 00551 (hsy + texPos0.y()) * ssy, 00552 (hsz + texPos0.z()) * ssz ); 00553 00554 if(has_multitexture) 00555 { 00556 multiTexCoord3f(GL_TEXTURE1_ARB, 00557 (hsx + texPos1.x()) * ssx, 00558 (hsy + texPos1.y()) * ssy, 00559 (hsz + texPos1.z()) * ssz ); 00560 00561 multiTexCoord3f(GL_TEXTURE2_ARB, 00562 (hsx + texPos2.x()) * ssx, 00563 (hsy + texPos2.y()) * ssy, 00564 (hsz + texPos2.z()) * ssz ); 00565 } 00566 glVertex3fv ( slice.pointVec[i].getValues() ); 00567 } 00568 } 00569 ::glEnd(); 00570 } 00571 } 00572 } 00573 }
| void Slices::initMethod | ( | void | ) | [static, private] |
Reimplemented from osg::MaterialDrawable.
Definition at line 108 of file OSGSlices.cpp.
References osg::MaterialDrawable::drawActionHandler(), osg::SlicesBase::getClassType(), intersect(), osg::osgTypedMethodFunctor2BaseCPtrRef(), osg::IntersectAction::registerEnterDefault(), osg::RenderAction::registerEnterDefault(), osg::DrawAction::registerEnterDefault(), and osg::MaterialDrawable::renderActionHandler().
00109 { 00110 DrawAction::registerEnterDefault( getClassType(), 00111 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE, 00112 MaterialDrawablePtr , 00113 CNodePtr , 00114 Action *>(&MaterialDrawable::drawActionHandler)); 00115 00116 RenderAction::registerEnterDefault( getClassType(), 00117 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE, 00118 MaterialDrawablePtr , 00119 CNodePtr , 00120 Action *>(&MaterialDrawable::renderActionHandler)); 00121 00122 IntersectAction::registerEnterDefault( getClassType(), 00123 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE, 00124 SlicesPtr , 00125 CNodePtr , 00126 Action *>(&Slices::intersect)); 00127 00128 00129 }
| void osg::Slices::operator= | ( | const Slices & | source | ) | [private] |
| osg::FieldContainerType & osg::SlicesBase::getClassType | ( | void | ) | [inline, static, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 58 of file OSGSlicesBase.inl.
References osg::SlicesBase::_type.
Referenced by osg::SlicesBase::create(), and initMethod().
00059 { 00060 return _type; 00061 }
| osg::UInt32 osg::SlicesBase::getClassTypeId | ( | void | ) | [inline, static, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 65 of file OSGSlicesBase.inl.
References osg::SlicesBase::_type, and osg::TypeBase::getId().
00066 { 00067 return _type.getId(); 00068 }
| FieldContainerType & SlicesBase::getType | ( | void | ) | [virtual, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 117 of file OSGSlicesBase.cpp.
References osg::SlicesBase::_type.
00118 { 00119 return _type; 00120 }
| const FieldContainerType & SlicesBase::getType | ( | void | ) | const [virtual, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 122 of file OSGSlicesBase.cpp.
References osg::SlicesBase::_type.
00123 { 00124 return _type; 00125 }
| UInt32 SlicesBase::getContainerSize | ( | void | ) | const [virtual, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 137 of file OSGSlicesBase.cpp.
00138 { 00139 return sizeof(Slices); 00140 }
| SFVec3f * osg::SlicesBase::getSFSize | ( | void | ) | [inline, inherited] |
Definition at line 101 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSize.
00102 { 00103 return &_sfSize; 00104 }
| SFReal32 * osg::SlicesBase::getSFSliceDistance | ( | void | ) | [inline, inherited] |
Definition at line 108 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSliceDistance.
00109 { 00110 return &_sfSliceDistance; 00111 }
| Vec3f & osg::SlicesBase::getSize | ( | void | ) | [inline, inherited] |
Definition at line 116 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSize, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by drawSlices(), and initEdgeVec().
00117 { 00118 return _sfSize.getValue(); 00119 }
| const Vec3f & osg::SlicesBase::getSize | ( | void | ) | const [inline, inherited] |
Definition at line 123 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSize, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00124 { 00125 return _sfSize.getValue(); 00126 }
| Real32 & osg::SlicesBase::getSliceDistance | ( | void | ) | [inline, inherited] |
Definition at line 137 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSliceDistance, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by drawSlices().
00138 { 00139 return _sfSliceDistance.getValue(); 00140 }
| const Real32 & osg::SlicesBase::getSliceDistance | ( | void | ) | const [inline, inherited] |
Definition at line 144 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSliceDistance, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00145 { 00146 return _sfSliceDistance.getValue(); 00147 }
| void osg::SlicesBase::setSize | ( | const Vec3f & | value | ) | [inline, inherited] |
Definition at line 130 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSize, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
| void osg::SlicesBase::setSliceDistance | ( | const Real32 & | value | ) | [inline, inherited] |
Definition at line 151 of file OSGSlicesBase.inl.
References osg::SlicesBase::_sfSliceDistance, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
00152 { 00153 _sfSliceDistance.setValue(value); 00154 }
Reimplemented from osg::MaterialDrawableBase.
Definition at line 201 of file OSGSlicesBase.cpp.
References osg::SlicesBase::_sfSize, osg::SlicesBase::_sfSliceDistance, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::MaterialDrawableBase::getBinSize(), osg::FieldBits::NoField, osg::SlicesBase::SizeFieldMask, and osg::SlicesBase::SliceDistanceFieldMask.
00202 { 00203 UInt32 returnValue = Inherited::getBinSize(whichField); 00204 00205 if(FieldBits::NoField != (SizeFieldMask & whichField)) 00206 { 00207 returnValue += _sfSize.getBinSize(); 00208 } 00209 00210 if(FieldBits::NoField != (SliceDistanceFieldMask & whichField)) 00211 { 00212 returnValue += _sfSliceDistance.getBinSize(); 00213 } 00214 00215 00216 return returnValue; 00217 }
| void SlicesBase::copyToBin | ( | BinaryDataHandler & | pMem, | |
| const BitVector & | whichField | |||
| ) | [virtual, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 219 of file OSGSlicesBase.cpp.
References osg::SlicesBase::_sfSize, osg::SlicesBase::_sfSliceDistance, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::MaterialDrawableBase::copyToBin(), osg::FieldBits::NoField, osg::SlicesBase::SizeFieldMask, and osg::SlicesBase::SliceDistanceFieldMask.
00221 { 00222 Inherited::copyToBin(pMem, whichField); 00223 00224 if(FieldBits::NoField != (SizeFieldMask & whichField)) 00225 { 00226 _sfSize.copyToBin(pMem); 00227 } 00228 00229 if(FieldBits::NoField != (SliceDistanceFieldMask & whichField)) 00230 { 00231 _sfSliceDistance.copyToBin(pMem); 00232 } 00233 00234 00235 }
| void SlicesBase::copyFromBin | ( | BinaryDataHandler & | pMem, | |
| const BitVector & | whichField | |||
| ) | [virtual, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 237 of file OSGSlicesBase.cpp.
References osg::SlicesBase::_sfSize, osg::SlicesBase::_sfSliceDistance, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::MaterialDrawableBase::copyFromBin(), osg::FieldBits::NoField, osg::SlicesBase::SizeFieldMask, and osg::SlicesBase::SliceDistanceFieldMask.
00239 { 00240 Inherited::copyFromBin(pMem, whichField); 00241 00242 if(FieldBits::NoField != (SizeFieldMask & whichField)) 00243 { 00244 _sfSize.copyFromBin(pMem); 00245 } 00246 00247 if(FieldBits::NoField != (SliceDistanceFieldMask & whichField)) 00248 { 00249 _sfSliceDistance.copyFromBin(pMem); 00250 } 00251 00252 00253 }
| SlicesPtr osg::SlicesBase::create | ( | void | ) | [inline, static, inherited] |
Definition at line 72 of file OSGSlicesBase.inl.
References osg::AttachmentContainerPtr::dcast(), osg::SlicesBase::getClassType(), osg::NullFC, and osg::SlicesBase::shallowCopy().
00073 { 00074 SlicesPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = SlicesPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
| SlicesPtr osg::SlicesBase::createEmpty | ( | void | ) | [inline, static, inherited] |
Definition at line 87 of file OSGSlicesBase.inl.
References osg::FieldContainer::newPtr().
00088 { 00089 SlicesPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
| FieldContainerPtr SlicesBase::shallowCopy | ( | void | ) | const [virtual, inherited] |
Implements osg::FieldContainer.
Definition at line 128 of file OSGSlicesBase.cpp.
References osg::FieldContainer::newPtr().
Referenced by osg::SlicesBase::create().
00129 { 00130 SlicesPtr returnValue; 00131 00132 newPtr(returnValue, dynamic_cast<const Slices *>(this)); 00133 00134 return returnValue; 00135 }
| void SlicesBase::executeSyncImpl | ( | SlicesBase * | pOther, | |
| const BitVector & | whichField | |||
| ) | [protected, inherited] |
Definition at line 256 of file OSGSlicesBase.cpp.
References osg::SlicesBase::_sfSize, osg::SlicesBase::_sfSliceDistance, osg::MaterialDrawableBase::executeSyncImpl(), osg::FieldBits::NoField, osg::SlicesBase::SizeFieldMask, osg::SlicesBase::SliceDistanceFieldMask, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().
Referenced by osg::SlicesBase::executeSync().
00258 { 00259 00260 Inherited::executeSyncImpl(pOther, whichField); 00261 00262 if(FieldBits::NoField != (SizeFieldMask & whichField)) 00263 _sfSize.syncWith(pOther->_sfSize); 00264 00265 if(FieldBits::NoField != (SliceDistanceFieldMask & whichField)) 00266 _sfSliceDistance.syncWith(pOther->_sfSliceDistance); 00267 00268 00269 }
| void MaterialDrawableBase::executeSyncImpl | ( | MaterialDrawableBase * | pOther, | |
| const BitVector & | whichField | |||
| ) | [protected, inherited] |
Definition at line 219 of file OSGMaterialDrawableBase.cpp.
References osg::MaterialDrawableBase::_sfMaterial, osg::DrawableBase::executeSyncImpl(), osg::MaterialDrawableBase::MaterialFieldMask, osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().
Referenced by osg::MaterialDrawableBase::executeSync(), osg::SlicesBase::executeSyncImpl(), osg::ParticlesBase::executeSyncImpl(), and osg::GeometryBase::executeSyncImpl().
00221 { 00222 00223 Inherited::executeSyncImpl(pOther, whichField); 00224 00225 if(FieldBits::NoField != (MaterialFieldMask & whichField)) 00226 _sfMaterial.syncWith(pOther->_sfMaterial); 00227 00228 00229 }
| 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] |
Definition at line 180 of file OSGNodeCore.inl.
References osg::NodeCore::_parents, osg::AttachmentContainer::executeSyncImpl(), osg::FieldBits::NoField, osg::NodeCore::ParentsFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::syncWith().
Referenced by osg::NodeCore::executeSync(), osg::StateSortingGroupBase::executeSyncImpl(), osg::LightEnvBase::executeSyncImpl(), osg::InlineBase::executeSyncImpl(), osg::GroupBase::executeSyncImpl(), osg::DVRVolumeBase::executeSyncImpl(), and osg::DrawableBase::executeSyncImpl().
00182 { 00183 Inherited::executeSyncImpl(pOther, whichField); 00184 00185 if(FieldBits::NoField != (ParentsFieldMask & whichField)) 00186 { 00187 _parents.syncWith(pOther->_parents); 00188 } 00189 }
| void AttachmentContainer::executeSyncImpl | ( | AttachmentContainer * | pOther, | |
| const BitVector & | whichField | |||
| ) | [protected, inherited] |
Definition at line 316 of file OSGAttachmentContainer.cpp.
References osg::AttachmentContainer::_attachmentMap, osg::AttachmentContainer::AttachmentsFieldMask, osg::FieldContainer::executeSyncImpl(), osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().
Referenced by osg::AttachmentContainer::executeSync(), osg::WindowBase::executeSyncImpl(), osg::ViewportBase::executeSyncImpl(), osg::ShaderParameterBase::executeSyncImpl(), osg::Node::executeSyncImpl(), osg::NodeCore::executeSyncImpl(), osg::MaterialBase::executeSyncImpl(), osg::ImageComposerBase::executeSyncImpl(), osg::ImageBase::executeSyncImpl(), osg::ForegroundBase::executeSyncImpl(), osg::DisplayFilterBase::executeSyncImpl(), osg::DisplayCalibrationBase::executeSyncImpl(), osg::CameraBase::executeSyncImpl(), and osg::BackgroundBase::executeSyncImpl().
00319 { 00320 Inherited::executeSyncImpl(pOther, whichField); 00321 00322 if (FieldBits::NoField != (AttachmentsFieldMask & whichField)) 00323 { 00324 _attachmentMap.syncWith(pOther->_attachmentMap); 00325 } 00326 }
| void osg::FieldContainer::executeSyncImpl | ( | FieldContainer * | pOther, | |
| const BitVector & | whichField | |||
| ) | [inline, protected, inherited] |
Definition at line 333 of file OSGFieldContainerImpl.inl.
Referenced by osg::StateBase::executeSyncImpl(), osg::DVRShaderBase::executeSyncImpl(), osg::DVRClipGeometryBase::executeSyncImpl(), osg::AttachmentContainer::executeSyncImpl(), and osg::Attachment::executeSyncImpl().
| void SlicesBase::executeSync | ( | FieldContainer & | other, | |
| const BitVector & | whichField | |||
| ) | [protected, virtual, inherited] |
Reimplemented from osg::MaterialDrawableBase.
Definition at line 144 of file OSGSlicesBase.cpp.
References osg::SlicesBase::executeSyncImpl().
00146 { 00147 this->executeSyncImpl((SlicesBase *) &other, whichField); 00148 }
| 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 osg::Surface::initMethod(), 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 osg::Surface::initMethod(), 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] |
Definition at line 83 of file OSGMaterialDrawableBase.inl.
References osg::MaterialDrawableBase::_sfMaterial, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by osg::Surface::buildSurface(), osg::Surface::clone(), osg::Geometry::clone(), osg::MaterialDrawable::drawActionHandler(), osg::RenderAction::dropGeometry(), osg::Geometry::dump(), osg::Geometry::MergeIndex(), and osg::MaterialDrawable::renderActionHandler().
00084 { 00085 return _sfMaterial.getValue(); 00086 }
| 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 osg::Surface::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 changed().
00238 { 00239 for(UInt32 i = 0; i < _parents.size(); i++) 00240 { 00241 _parents[i]->invalidateVolume(); 00242 } 00243 }
| void osg::NodeCore::onDestroy | ( | void | ) | [inline, protected, virtual, inherited] |
Reimplemented from osg::FieldContainer.
Reimplemented in osg::Geometry, osg::Surface, and osg::MaterialPool.
Definition at line 142 of file OSGNodeCore.inl.
Referenced by osg::Geometry::onDestroy().
| 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 }
| NodeCorePtr osg::NodeCore::getPtr | ( | void | ) | const [inline, protected, inherited] |
Reimplemented in osg::Geometry.
Definition at line 170 of file OSGNodeCore.inl.
Referenced by osg::MaterialPool::add(), osg::NodeCore::dump(), and osg::MaterialPool::sub().
| AttachmentContainerPtr AttachmentContainer::getPtr | ( | void | ) | [protected, inherited] |
Definition at line 352 of file OSGAttachmentContainer.cpp.
Referenced by osg::FileGrabForeground::draw(), osg::FBOViewport::render(), osg::AttachmentContainer::subAttachment(), and osg::AttachmentContainer::~AttachmentContainer().
00353 { 00354 return AttachmentContainerPtr(*this); 00355 }
| 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.
| 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] |
Definition at line 83 of file OSGFieldContainerImpl.inl.
References osg::FieldContainerType::getGroupId(), and osg::FieldContainer::getType().
Referenced by osg::fcptrAttributeMap(), osg::Image::setAttachmentField(), and osg::stringAttributeMap().
00084 { 00085 return getType().getGroupId(); 00086 }
| 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 }
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 }
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 }
| 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 }
| 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 }
| void osg::FieldContainer::beginEditX | ( | const BitVector & | whichField, | |
| FieldTypeT & | field | |||
| ) | [inline, protected, inherited] |
| 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::onCreate | ( | const FieldContainer * | source = NULL |
) | [inline, protected, inherited] |
Definition at line 318 of file OSGFieldContainerImpl.inl.
Referenced by osg::ShaderParameterChunk::onCreate().
| void osg::FieldContainer::onCreateAspect | ( | const FieldContainer * | aspect0, | |
| const FieldContainer * | source = NULL | |||
| ) | [inline, protected, inherited] |
friend class FieldContainer [friend] |
friend class SlicesBase [friend] |
Definition at line 138 of file OSGSlices.h.
std::vector<Pnt3f> osg::Slices::_pointVec [private] |
std::vector<Edge> osg::Slices::_edgeVec [private] |
Definition at line 175 of file OSGSlices.h.
Referenced by createSlice(), drawSlices(), and initEdgeVec().
UInt32 Slices::_arbMultitexture = Window::invalidFunctionID [static, private] |
UInt32 Slices::_funcMultiTexCoord3fARB = Window::invalidFunctionID [static, private] |
const osg::BitVector SlicesBase::SizeFieldMask [static, inherited] |
Initial value:
(TypeTraits<BitVector>::One << SlicesBase::SizeFieldId)
Definition at line 100 of file OSGSlicesBase.h.
Referenced by changed(), osg::SlicesBase::copyFromBin(), osg::SlicesBase::copyToBin(), osg::SlicesBase::executeSyncImpl(), and osg::SlicesBase::getBinSize().
const osg::BitVector SlicesBase::SliceDistanceFieldMask [static, inherited] |
Initial value:
(TypeTraits<BitVector>::One << SlicesBase::SliceDistanceFieldId)
Definition at line 101 of file OSGSlicesBase.h.
Referenced by osg::SlicesBase::copyFromBin(), osg::SlicesBase::copyToBin(), osg::SlicesBase::executeSyncImpl(), and osg::SlicesBase::getBinSize().
const osg::BitVector SlicesBase::MTInfluenceMask [static, inherited] |
Initial value:
(Inherited::MTInfluenceMask) |
(static_cast<BitVector>(0x0) << Inherited::NextFieldId)
Reimplemented from osg::MaterialDrawableBase.
Definition at line 104 of file OSGSlicesBase.h.
Vec3f SlicesBase::_sfSize [protected, inherited] |
terrain size in local coords
Definition at line 185 of file OSGSlicesBase.h.
Referenced by adjustVolume(), osg::SlicesBase::copyFromBin(), osg::SlicesBase::copyToBin(), osg::SlicesBase::executeSyncImpl(), osg::SlicesBase::getBinSize(), osg::SlicesBase::getSFSize(), osg::SlicesBase::getSize(), and osg::SlicesBase::setSize().
Real32 SlicesBase::_sfSliceDistance [protected, inherited] |
terrain size in local coords
Definition at line 186 of file OSGSlicesBase.h.
Referenced by osg::SlicesBase::copyFromBin(), osg::SlicesBase::copyToBin(), osg::SlicesBase::executeSyncImpl(), osg::SlicesBase::getBinSize(), osg::SlicesBase::getSFSliceDistance(), osg::SlicesBase::getSliceDistance(), and osg::SlicesBase::setSliceDistance().
const osg::BitVector MaterialDrawableBase::MaterialFieldMask [static, inherited] |
Initial value:
(TypeTraits<BitVector>::One << MaterialDrawableBase::MaterialFieldId)
Definition at line 98 of file OSGMaterialDrawableBase.h.
Referenced by changed(), osg::Particles::changed(), osg::Geometry::changed(), osg::MaterialDrawableBase::copyFromBin(), osg::MaterialDrawableBase::copyToBin(), osg::MaterialDrawableBase::executeSyncImpl(), and osg::MaterialDrawableBase::getBinSize().
MaterialPtr MaterialDrawableBase::_sfMaterial [protected, inherited] |
The material used to render the Drawable.
Definition at line 162 of file OSGMaterialDrawableBase.h.
Referenced by changed(), osg::Particles::changed(), osg::Geometry::changed(), osg::MaterialDrawableBase::copyFromBin(), osg::MaterialDrawableBase::copyToBin(), osg::MaterialDrawableBase::executeSyncImpl(), osg::MaterialDrawableBase::getBinSize(), osg::MaterialDrawableBase::getMaterial(), osg::MaterialDrawableBase::getSFMaterial(), osg::Geometry::onDestroy(), setMaterial(), osg::Particles::setMaterial(), osg::MaterialDrawableBase::setMaterial(), osg::MaterialDrawable::setMaterial(), osg::Geometry::setMaterial(), osg::Particles::~Particles(), and ~Slices().
StatElemDesc< StatIntElem > Drawable::statNTriangles [static, inherited] |
Definition at line 68 of file OSGDrawable.h.
Referenced by drawPrimitives(), osg::Geometry::drawPrimitives(), osg::SimpleSceneManager::initialize(), and osg::DrawActionBase::start().
StatElemDesc< StatIntElem > Drawable::statNLines [static, inherited] |
Definition at line 69 of file OSGDrawable.h.
Referenced by osg::Geometry::drawPrimitives(), osg::SimpleSceneManager::initialize(), and osg::DrawActionBase::start().
StatElemDesc< StatIntElem > Drawable::statNPoints [static, inherited] |
Definition at line 70 of file OSGDrawable.h.
Referenced by osg::SimpleSceneManager::initialize(), and osg::DrawActionBase::start().
StatElemDesc< StatIntElem > Drawable::statNVertices [static, inherited] |
Definition at line 71 of file OSGDrawable.h.
Referenced by drawPrimitives(), osg::Geometry::drawPrimitives(), osg::SimpleSceneManager::initialize(), and osg::DrawActionBase::start().
StatElemDesc< StatIntElem > Drawable::statNPrimitives [static, inherited] |
Definition at line 72 of file OSGDrawable.h.
Referenced by osg::Geometry::drawPrimitives(), and osg::DrawActionBase::start().
StatElemDesc< StatIntOnceElem > Drawable::statNGeoBytes [static, inherited] |
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] |
Definition at line 99 of file OSGNodeCore.h.
Referenced by osg::NodeCore::copyFromBin(), osg::NodeCore::copyToBin(), osg::NodeCore::executeSyncImpl(), osg::NodeCore::getBinSize(), and osg::Node::~Node().
const bool osg::NodeCore::isNodeCore = true [static, inherited] |
MFNodePtr osg::NodeCore::_parents [protected, inherited] |
Definition at line 168 of file OSGNodeCore.h.
Referenced by osg::NodeCore::addParent(), osg::ProxyGroup::changed(), osg::Particles::changed(), osg::Geometry::changed(), osg::NodeCore::copyFromBin(), osg::NodeCore::copyToBin(), osg::NodeCore::dump(), osg::Geometry::dump(), osg::NodeCore::executeSyncImpl(), osg::NodeCore::getBinSize(), osg::NodeCore::getMFParents(), osg::NodeCore::getParents(), osg::NodeCore::getType(), osg::NodeCore::invalidateVolume(), and osg::NodeCore::subParent().
const BitVector AttachmentContainer::AttachmentsFieldMask [static, inherited] |
Initial value:
(TypeTraits<BitVector>::One <<
AttachmentContainer::AttachmentsFieldId)
Definition at line 84 of file OSGAttachmentContainerImpl.h.
Referenced by osg::VRMLFile::beginNode(), osg::AttachmentContainer::changed(), osg::AttachmentContainer::copyFromBin(), osg::AttachmentContainer::copyToBin(), osg::deepCloneAttachments(), osg::AttachmentContainer::executeSyncImpl(), osg::fcptrAttributeMap(), osg::AttachmentContainer::getBinSize(), and osg::stringAttributeMap().
SFAttachmentMap osg::AttachmentContainer::_attachmentMap [protected, inherited] |
Definition at line 161 of file OSGAttachmentContainerImpl.h.
Referenced by osg::AttachmentContainer::AttachmentContainer(), osg::AttachmentContainer::changed(), osg::AttachmentContainer::copyFromBin(), osg::AttachmentContainer::copyToBin(), osg::NodeCore::dump(), osg::Node::dump(), osg::Geometry::dump(), osg::AttachmentContainer::dump(), osg::AttachmentContainer::executeSyncImpl(), osg::AttachmentContainer::findAttachment(), osg::AttachmentContainer::getBinSize(), osg::AttachmentContainer::getSFAttachments(), osg::Node::onCreate(), osg::AttachmentContainer::subAttachment(), and osg::AttachmentContainer::~AttachmentContainer().
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.
1.5.5