i would need an advice on how to serialize my own class. The class will contain different geometries (Mesh, Curve, Points, Brep) among other data.
One way I see is to derive my class from one type of RhinoObject (for example CRhinoCurveObject) and add all other geometries and variables as User Data. I still do not know how to do this and serialize it afterwards, but before the research I wanted to ask if this is the best way? I guess this is the starting point of the research: http://wiki.mcneel.com/developer/userdata
Since it is not necessary for the class to be a part of the Rhino document (although it might be convenient)…is it maybe easier to just derive my class from ON_Object and somehow use the Write method to save all of its members, using this example: http://wiki.mcneel.com/developer/sdksamples/archivecurve
This example seems much simpler to me…I only dont know how to “group” the geometries that belong to one class object. If my class object has a Curve, Mesh, Points and a Brep and I save them all using Write Object…later when I read them, how do I group them back together? How do I “recognize” which ones belong to which object in the MyClass array? Actually if think about it, my class doesn`t need to be derived from ON_Object(?)…only the data it contains…I just need to find a way to reconstruct the class array when data and geometries are loaded…