I am building code for a 2D scene graph and i have a single abstract class, Node that will be used to indicate that a type of item can be used in a scene graph. However, classes that implement from this are of different types such as leaf nodes and transformation nodes. How would i indicate these differences? would i use attributes, other interfaces, or what?
Edit: It would appear that i have given insufficient information. Here is as much information as i can provide on my current hierarchy:
- INode interface
- requires a Matrix called TransformationMatrix
- requires a List of INodes called Children
- requires a Node called Parent
- requires that a method be implemented called Draw which takes one Matrix as an argument and returns nothing
- Node class
- implements the INode interface
- Draw call (virtual void with 1 argument of type matrix) simply calls each child INode's Draw method.
- various classes that derive from Node
- these are actual nodes and can be transformation nodes, leaf nodes, etc.