This is out of date and no longer correct!
Creating a new Extreme Wave object primitive is simply a matter of subclassing an existing object and then overiding that object's methods with the new functionality in your object. The following methods must exist for Extreme Wave to integrate your object. You can add new methods and variables to your object but generally speaking, anything you add should be declared as private or protected. Extreme Wave only knows that the virtual functions described here exist.
This should be considered an alpha API for Objects. The API will more than likely expand and change to meet the needs of new Objects.
void write (FILE *fh, int tab);
The write method tells the object to write itself to the file handle pointed to by fh in the Extreme Wave native file format. The tab argument is the number of spaces to indent the text to the right (for the purpose of generating nicely formatted file output). tab will always be >= 0.
bool set_attribute(char *op, char *argument, int length);
Tells the object to set the property specified by op to the string argument. The argument should be length characters in length.
bool set_attribute(char *op, double *argument, int length);
Tells the object to set the property specified by op to the array of doubles specified by argument. The length of the array is length.
bool set_attribute(char *op, int *argument, int length);
Tells the object to set the property specified by op to the array of integers specified by argument. The length of the array is length.
bool get_attribute(char *op, char *result, int &length);
The object should return the attribute specified by op in the variable result. The object should also set length to be the length of the result string.
bool get_attribute(char *op, double *result, int &length);
The object should return the attribute specified by op in the double array result. The object should also set length to be the length of the result array.
bool get_attribute(char *op, int *result, int &);
The object should return the attribute specified by op in the integer array result. The object should also set length to be the length of the result array.
void gl_draw();
gl_draw provides the OpenGL draw routines that should draw this object. The dirty bit flags can be used to determine what needs to be recalculated (if anything).
void set_draw_dirty_bit ();
When an operation "damages" the object it sets the dirty bit so that the object knows it needs to redraw itself completely.
virtual void set_bone_dirty_bit (int b);
When an operation "damages" the object by altering it's bone b it sets this dirty bit so that the object knows it needs to redraw itself. The object should make sure that it uses bone b.
bool uses_point (int a);
Returns true if this object uses the point a. Extreme Wave relies on the object to keep track of which points it uses.
virtual void swap_point (int a, int b);
Swap the points a and b in the object. (Used for point garbage collection).
bool select_point_down (int pnt, Vector b);
When an object's point is selected by the user clicking down on the mouse this method is called. pnt specifies the point that was selected and b specifies the x, y, z coordinates that were selected.
bool select_point_drag (int pnt, Vector b);
When an object's point is "dragged" across the OpenGL window this method is called. b specifies the current x, y, z coordinates that the mouse has dragged. It is the object's responsibility to update the point coordinates (but it doesn not necessarily have to update them to b)
bool select_point_release (int pnt, Vector b);
When the user releases the mouse after selecting or dragging a point this method is called. pnt specifies the point that was dragged and b specifies the x, y, z coordinates the user dragged to.
bool add_point_down (Vector b);
When the user adds a point to an object, this method is called with the x, y, z coordinates, b, the user clicked down on. This method is often called when an object is first created.
bool add_point_drag (Vector b);
When the user adds a point to an object and then drags it, this method is called with the x, y, z coordinates, b, the user dragged to.
bool add_point_release (Vector b);
When the user releases a point to an object, this method is called with the x, y, z coordinates, b, the user released at.
~Object();
When deleted an object should clean up after itself.
bool is_group();
Since groups contain other objects, Extreme Wave must know if this object is derived from a group.
void translate (Vector v);
Translate the entire object by the vector v.
void scale (Vector v);
Scale the entire object by the vector v.
void rotate (Vector v);
Rotate the entire object by the vector v.