Dirk Reiners wrote: > Hi Patrick, > > Patrick Hartling wrote: >> I am working on porting OpenManip to OpenSG 2, and I have run into a >> difference WRT OpenSG 1.x that I cannot resolve. In OpenSG 1.x, the >> following worked (where mRenderAction is an OSG::DrawActionBase*): >> >> OSG::Camera* cam = mRenderAction->getCamera(); >> OSG::CameraPtr camPtr(cam); >> >> I have not found a way to construct an OSG::CameraPtr from an OSG::Camera*, >> and I am wondering if this is being done by design. In other words, is this >> prevention of OSG::FCPtr<> construction from a raw pointer deliberate? The >> closest I came was to try OSG::Camera::constructPtr(), but this method is >> protected. > > Hm, I will have to defer the actual answer to Gerrit. I'll just keep > this situation in mind for the CPtr part, and it's definitely a problem > with boost::shared_ptr (which doesn't support this operation either).
My 0.02€: Boost::shared_ptr has a number of drawbacks because it supports non-intrusive refcount, which is required in may occations but for frameworks like OpenSG (and my app) it's IMO mostly a hassle. We're using intrusive_ptr and a very simple RefObject base class to handle this for our own classes. (However, the weak_ptr support of boost::shared_ptr is nice and more easily supported with external refcounting) Cheers, /Marcus ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
