Hello,
currently I'm trying to switch to the OpenSG 2.0 codebase. In this
context I have a couple of questions.
1. Can I safely assume the support of a boolean context from the XRecPtr
smart pointer types, i.e. can I write something like the following?
NodeRecPtr node = ...
if (node) ...
if (!node) ...
If this is correct, can I then assume that I do not have to use NullFC
anymore?
2. Dynamic casting from smart pointer does not work seemlessly. Using
dynamic_pointer_cast from a XRecPtr does work fine, but using it on a
TransitPtr is not supported. Is this intentionally? See the following
example:
// Works fine
NodeCoreRecPtr nodeCore = node->getCore();
GeometryRecPtr geomCore =
dynamic_pointer_cast<Geometry>(nodeCore);
// Not supported
GeometryRecPtr geomCore =
dynamic_pointer_cast<Geometry>(node->getCore());
In the examples, I could not found any application of
dynamic_pointer_cast function at all. Here only the following pattern is
applied:
GeometryRecPtr geomCore =
dynamic_cast<Geometry*>(node->getCore());
What is the proper usage pattern. Is it safe to go to the native pointer
level?
3. In the same direction as 2). I was used to work with the traverse
function taking a vector of NodePtr parameter. In OpenSG 2.0 a vector of
Node* pointers and a const MFUnrecChildNodePtr obect is supported, but
not a vector of NodeRecPtr, as I assumed I should use. Again looking
into the examples I did only found cases working directly on the Node*
pointers. Is this the recommended way for using traverse function? What
are the limits with respect to multithreading?
4. I did see that the TextureChunk class has gone. So I replaced it with
the TextureObjChunk class. Then, I did found a place where I called an
Image object's addParent function with the TextureChunk object. But I
could not find this function in the OpenSG 2.0 Image class. Do I not
have to perform this task anymore?
Any help and clarification if very appreciated.
With best regards,
Johannes
____________
Virus checked by G DATA AntiVirusKit
Version: AVF 19.486 from 05.08.2009
Virus news: www.antiviruslab.com
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users