define a module to edit a 2D mesh
group GDedit_mesh_notify_templ
{
int+IPort2 state;
int+IPort2 done;
int+IPort2 remove;
GDobject_templ+IPort2 *picked_obj;
method+notify_inst init_func = "GDedit_mesh_create";
method+notify_deinst del_func = "GDedit_mesh_delete";
method+notify_val upd_func = "GDedit_mesh_update";
};
GDedit_mesh_notify_templ GDedit_mesh_templ
{
int+IPort2 x;
int+IPort2 y;
int mode;
int immed;
float red, green, blue;
GDview_templ+IPort2 &view_in;
GDcamera_templ+IPort2 &cam_in;
ptr+nonotify+nosave local_ptr;
};
GDedit_mesh_templ GDedit_mesh {
mode = 1;
immed = 1;
red = 1.0;
green = 0.0;
blue = 0.0;
};
These templates define a module to edit a 2D mesh. This mesh is typically created by the GDmap2d_ss module but it could be generated in other ways as well. GDedit_mesh_notify_templ defines the elements that cause the module's update method to execute. GDedit_mesh_templ defines the additional elements that are used at execution time but do not trigger an activation. GDedit_mesh provides initial values to some of the elements. This is the template that should be instanced.
The GDedit_mesh module allows you to edit 2D unstructured meshes. Editing a mesh is a two stage process. First, you must select the object to edit using the normal pick process. When the selection occurs, all or part of the object is highlighted. Then, you can move the highlighted section of the object around. In order to work as just described, this module connects to the picked object output port from one of the standard viewers in the Graphics Display Kit. In this way, when an object is picked, the edit mesh module runs and gets an opportunity to highlight the item that was picked. The field that is attached to the object is what is edited.
Libraries.Graphics_Display.Interactivity.UI_Interactivity.EditMesh