----- Original Message ----- From: "Tobias Berghoff" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Tuesday, June 29, 2004 11:33 PM Subject: RE: [Opensg-users] Segfault at endEditCP
> On Tue, 29 Jun 2004, Hagen Gadke wrote: > > Hi! > > Thanks for your time. > > > if your code compiles, then _textures is a multi field of > > NodePtr, not a multi field of textures. > > True. > I did some typeid-ing so we know what we're talking about: > typeid(i)=N9__gnu_cxx17__normal_iteratorIPN3osg7NodePtrESt6vectorIS2_SaIS2_EEEE > typeid(*i)=N3osg7NodePtrE > typeid(**i)=N3osg12TextureChunkE > > > > for(MFNodePtr::iterator i=_textures.begin();i!=_textures.end();i++) > > ^^^^^^^^^ > > > > So it's not surprising that you get problems when you cast *i > > to a TextureChunkPtr. > > Well, it is (to me, anyway). :) > I actually want a TextureChunkPtr, which is typedef'd from Ptr. Which > makes it the same type as NodePtr (which is also typedef'd from Ptr). Ouch... no, they seems to be, but they are not. > As we've seen above, the NodePtr *i points to a TextureChunk **i. That > seems to make it a TextureChunkPtr. If it doesn't, what do I have to do, > to cast it? > If you want absolutely to use iterators - I presume TextureChunkPtr might expose some higher level access method, isn't it ? like the good olde [] operator and size() Just cast an iterator from TextureChunkPtr following the example in paragraph concerning "Efficient Manipulation of Geometry" http://www.oliver-abert.de/opensg/Geometry.html#GeometryEfficientManipulation Hope it helps, Nop > Tobias > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Behalf Of Tobias > > Berghoff > > Sent: Montag, 28. Juni 2004 20:49 > > To: [email protected] > > Subject: [Opensg-users] Segfault at endEditCP > > > > > > Hallo! > > > > Probably a serious braino, but anyway: > > I've changed part of the VRML loader and get a segmentation fault when > > calling endEditCP. > > The Code looks like this: > > > > _textures contains one texture at this point, btw. > > > > > > std::cerr<<"setting textures\n"; > > beginEditCP(pChunkMat, ChunkMaterial::ChunksFieldMask); > > { > > for(MFNodePtr::iterator i=_textures.begin();i!=_textures.end();i++) > > { > > std::cerr<<"trying...\n"; > > TextureChunkPtr pTexture = TextureChunkPtr::dcast(*i); > > pChunkMat->addChunk(pTexture); > > std::cerr<<"added texture\n"; > > } > > } > > std::cerr<<"before endEditCP "<<pChunkMat<<"\n"; > > endEditCP(pChunkMat, ChunkMaterial::ChunksFieldMask); > > std::cerr<<"textures done\n"; > > > > Which generates this output: > > > > setting textures FCPtr 0x0xbfffe840:ChunkMaterialPtr(0x0x8163eb0) > > trying... > > added texture > > before endEditCP FCPtr 0x0xbfffe840:ChunkMaterialPtr(0x0x8163eb0) > > Speicherzugriffsfehler (aka segfault) > > > > Any quick idea, or do I have to work myself through the code of endEditCP? > > :) > > > > Tobias > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by Black Hat Briefings & Training. > > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > > digital self defense, top technical experts, no vendor pitches, > > unmatched networking opportunities. Visit www.blackhat.com > > _______________________________________________ > > Opensg-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/opensg-users > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by Black Hat Briefings & Training. > > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > > digital self defense, top technical experts, no vendor pitches, > > unmatched networking opportunities. Visit www.blackhat.com > > _______________________________________________ > > Opensg-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/opensg-users > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Opensg-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-users ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
