All objects that want to be part of a GH_Document must implement the
IGH_DocumentObject
interface.
This interface provides core methods needed for all objects
- Undo
- Autosave
- Display
- Menu
- Tooltip
IGH_ActiveObject
extends upon IGH_DocumentObject
and it provides methods for participating in the solution.
Parameters
Parameters(via the IGH_Param
interface and several GH_Param<T>
classes) maintain a data tree which is associated with a special type of IGH_Goo
data. They have the logic build in that allows them to communicate with other parameters via their input/output wires.
Components
Components tend to drive from GH_Component(or at the very least implemeny IGH_Component
), as that class provides all the bookkeeping methods for managing a collection of input and output parameters.
Attribute
Attributes are used primary for display purposes. Every object must be capable of creating and maintaining a class which ultimately implements IGH_Attributes
. The attributes are in charge of
- rendering the object to the canvas
- providing basic information about the shape of an object
- handling mouse and key events
- responding correctly to selection actions
- maintaining the object hierarchy (Basically, it means that component attributes must be able to talk to input and output parameters, and the parameters need to be able to figure out they are slaved to a component.)
Custom Attribute SDK
Objects on the Grasshopper canvas consist of two part.
The most important piece is the class that implements the IGH_DocumentObject
interface.
This interface provides the basic plumbing needed to make objects work within a Grasshopper node network.
The interface part of objects however is handled seperately.
Every IGH_DocumentObject
carries around an instance of a class that implements the IGH_Attriibutes
interface(indeed, every IGH_DocumentOBject knows how to create its own stand-alone attributes).
It is not possible to have an IGH_Attributes
instance work on its own, we need an IGH_DocoumentObject
to tie it to.