
Writing the Code
There are two basic kinds of class: data and GUI. Data classes involve parameter values, animation information, and the methods for manipulating them. GUI classes define the tool's interface, including widgets on the tool shelf and images in a custom canvas.
Many data and GUI classes are related. For example, DK_Tool and DK_AnimParam are data classes, while DK_ToolGUI and DK_AnimParamI are their related GUI classes. Your custom tool must contain a subclass (derived class) of DK_Tool which contains all the data and associated methods for your tool, as well as a subclass of DK_ToolGUI that draws and controls the tool editor window. For each animatable parameter in your tool, you add a DK_AnimParam object to your DK_Tool subclass, then in your DK_ToolGUI subclass you add a widget from the DK_AnimParamI class and link it to the DK_AnimParam object.
The table below lists the data and GUI class header files of the DKit and briefly describes their function.
| Data Class Header File | GUI Class Header File | Description |
|---|---|---|
| DK_AnimColour | DK_ColourPalette DK_ColourSliders | Handles animatable colours, that is, a set of four animatable floating-point numbers. |
| DK_AnimParam | DK_AnimParamI | Handles animatable parameters, that is, sets of floating-point numbers that can be keyframed. |
| DK_Canvas | Controls a canvas in a tool editor (abstract class). | |
| DK_ColourChannelToggles | Provides colour channel toggles for the tool shelf, such as those found in the ColourChannels and Mix tools. | |
| DK_Graphic | Controls a graphic in a tool editor (abstract class). | |
| DK_FileBrowser | Controls a file browser. | |
| DK_IconBrowser | Provides an icon browser for the tool shelf, such as those found in Impressionist and PainterlyEffects. | |
| DK_Image | Handles an image, that is, a rectangular array of pixels. | |
| DK_ImageCanvas | Controls an image canvas; subclass of DK_Canvas. | |
| DK_ImageGraphic | Controls a graphic in a DK_ImageCanvas; subclass of DK_Graphic. | |
| DK_Macros | Provides maximum and minimum functions, as well as a variety of useful epsilon-comparison functions. | |
| DK_Message | Displays various types of messages and dialogue boxes: error, warning, information, question, and input. | |
| DK_Rect | DK_RectGraphic | Controls a rectangular area, such as the Preview Region in the PainterlyEffects tool. |
| DK_ScreenMap | Provides mappings between screen space and ortho space (image space). | |
| DK_TimeSplineCanvas | Controls a spline-editing canvas such as the one found in the Colmap tool or Animation Editor; subclass of DK_Canvas. | |
| DK_TimeSplineGraphic | Controls a graphic of a function curve in a DK_TimeSplineCanvas; subclass of DK_Graphic. | |
| DK_Tool | DK_ToolGUI | Controls the effect and the tool editor window; the abstract base rendering and GUI classes from which to derive custom tools. |
| DK_Types | Provides various predefined data structures, macros and classes. | |
| DK_UserGraphic | Controls a custom graphic, such as a custom brush, in a canvas. You are responsible for creating a data class for the objects you want to draw. | |
| DK_Vector | Provides operators for a variety of different vector types. |
