Overview of SampleSharedXform
9SampleSharedXform is a Rhino 6 solution designed to demonstrate how to share application data between RhinoCommon (C#) plug-ins and Rhino C++ plug-ins.
It achieves this by using a central C++ assembly that maintains a dictionary mapping Rhino object IDs to arrays of 4x4 transformation matrices. Note that this data is runtime-only and is not serialized into Rhino documents.
The solution is composed of four distinct projects demonstrating different interoperability methods:
- SampleSharedXformLib: A Rhino-dependent C++ assembly (DLL) that acts as the data provider/manager.
- SampleSharedXformOwner: A RhinoCommon (C#) plug-in that uses Platform Invoke (P/Invoke) to access exported C functions from the library. It has read-write access to the shared dictionary.
- SampleSharedXformClient1: A Rhino C++ plug-in that uses Load-Time Dynamic Linking to access the library. It has read-only access to the dictionary.
- SampleSharedXformClient2: A Rhino C++ plug-in that uses Run-Time Dynamic Linking to access the library. It has read-only access to the dictionary.