Hi,

On Wed, 2009-06-17 at 14:06 +0200, Andreas Halm wrote:
> Hi,
> 
>  
> 
> I was first missing documentation about how to write your own node (or
> core) class when using opensg 1.8, and now I am missing it again while
> converting from 1.8 to 2.0. So this post should encourage anybody
> capable of doing so to write a chapter about it J
> 
>  
> 
> Specific information I am missing is:
> 
> -         What are the methods absolutely needed to get it going, and
> what is their purpose

the easiest way is, write the fcd file, enable OSG_FCD2CODE_WRITE_CLASS 
in cmake, run cmake, run make and you are ready to go. Disable the
class creation after-wards if you like.

What else is needed depends heavily on the type of container.

> -         What are:
> 
> o    static ClassTransitPtr create(); 

create the class through the type system, clones from the
prototype.

> o    static Class*          createEmpty(); 

create a class instance from the default constructor, avoiding
the type system and the prototype.

> o   static ClassTransitPtr createLocal(BitVector bFlags =
> FCLocal::All);

same as create, except you can restrict MT/Cluster syncs.

> o   static Class*          createEmptyLocal(BitVector bFlags =
> FCLocal::All);

same as createEmpty, except you can restrict MT/Cluster syncs.

> o   static ClassTransitPtr createDependent(BitVector bFlags);

hmm, have to check I'm sure I had a reason to add it though.

> o    virtual FieldContainerTransitPtr shallowCopy () const; 

create a shallow copy of the container, which essentially means
pointers that can be shared will be shared and not followed.
pointers that can't will be ignored, e.g. parent fields.

> o   virtual FieldContainerTransitPtr shallowCopyLocal(BitVector bFlags
> = FCLocal::All) const;

same as shallowCopy, except you can restrict MT/Cluster syncs.

> o   virtual FieldContainerTransitPtr shallowCopyDependent(BitVector
> bFlags) const;

hmm, have to check I'm sure I had a reason to add it though.

> o   virtualFieldContainer*          createAspectCopy(const
> FieldContainer *pRefAspect) const;

used during sync.

> for, and in which cases would you need implementations different from
> the usual ones

Ideally never. I do strongly advise not to mess with those and to use
the fcd system to create new containers, with cmake and the new python
fcd2code version from Carsten that is easy enough. The internals might
change over time.

> -         What the hell happened to beginEditCP/endEditCP

gone

> -         What exactly do you need to enable synchronization

nothing special.


kind regards,
  gerrit





------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to