Hello Carsten, that solution doesn't solve the issue. Writing seems to be fine, but loading throws lots of warnings and the loaded content has some errors that hard to guess at the moment. To me the cleanest solution would be, to avoid writing internal attachments inside the NFIO writer. Do you think it is a hard task to extend the writer in this direction?
Thanks, Michael -------- Original-Nachricht -------- > Datum: Mon, 23 May 2011 09:40:43 -0500 > Von: Carsten Neumann <carsten_neum...@gmx.net> > An: opensg-users@lists.sourceforge.net > Betreff: Re: [Opensg-users] OpenSG1.8 - Avoid to save attachments to OSB > Hello Michael, > > On 05/23/2011 07:42 AM, Michael Raab wrote: > > osg::MyAttachmentPtr proto = osg::MyAttachmentPtr::dcast( > > osg::MyAttachment::getClassType().getPrototype()); > > if( proto != osg::NullFC ) > > { > > beginEditCP(proto, osg::Attachment::InternalFieldMask); > > proto->setInternal(true); > > endEditCP(proto, osg::Attachment::InternalFieldMask); > > } > > > > But setting that internal flag seems to not to avoid to save that > attachment to OSB. > > argh, it seems the 1.x OSB writer ignores that setting, sorry about that. > I'm not sure it is flexible enough for this case, but you could try > registering your handler class for loading MyAttachment from OSB. > You can use OSGNFIOGenericAtt.{h,cpp} as a starting point and have > almost empty read/writeFC functions: > > FieldContainerPtr NFIOMyAttachment::readFC( > const std::string &/*typeName*/) > { > skipFCFields(); > > return NullFC; > } > > void NFIOMyAttachment::writeFC(const FieldContainerPtr &/*fc*/) > { > writeEndMarker(); > } > > I'm just not sure if the loader can deal with the NullFC returned from > readFC and what exactly will happen with fields in other containers that > contain pointer to the attachment. > > Cheers, > Carsten > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Opensg-users mailing list > Opensg-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensg-users -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users