Writing the Code

Classes and Header Files

Classes are very important to the Eddie DKit. When you create a tool, you are defining a class and telling Eddie how it behaves. In addition, the dkit/3.5/include subdirectory contains the header files that define the DKit classes. When you write your code, you can include these header files, make use of their classes, or create your own subclasses. For more information about the methods prototyped by these classes, see Class Reference.

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 FileGUI Class Header FileDescription
DK_AnimColourDK_ColourPalette
DK_ColourSliders
Handles animatable colours, that is, a set of four animatable floating-point numbers.
DK_AnimParamDK_AnimParamIHandles animatable parameters, that is, sets of floating-point numbers that can be keyframed.
 DK_CanvasControls a canvas in a tool editor (abstract class).
 DK_ColourChannelTogglesProvides colour channel toggles for the tool shelf, such as those found in the ColourChannels and Mix tools.
 DK_GraphicControls a graphic in a tool editor (abstract class).
 DK_FileBrowserControls a file browser.
 DK_IconBrowserProvides 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_ImageCanvasControls an image canvas; subclass of DK_Canvas.
 DK_ImageGraphicControls 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_MessageDisplays various types of messages and dialogue boxes: error, warning, information, question, and input.
DK_RectDK_RectGraphicControls a rectangular area, such as the Preview Region in the PainterlyEffects tool.
 DK_ScreenMapProvides mappings between screen space and ortho space (image space).
 DK_TimeSplineCanvasControls a spline-editing canvas such as the one found in the Colmap tool or Animation Editor; subclass of DK_Canvas.
 DK_TimeSplineGraphicControls a graphic of a function curve in a DK_TimeSplineCanvas; subclass of DK_Graphic.
DK_ToolDK_ToolGUIControls 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_UserGraphicControls 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.


SOFTIMAGE Eddie 3.5 - 10 JAN 1997