define a module to convert a 2D drawing's screen-space buffer to a field
group GDmap2d_ss_notify_templ
{
GDroi2d_buffer+IPort2 &in_buf;
int clear;
method+notify_val upd_func = "GDmap2d_ss_update";
};
GDmap2d_ss_notify_templ GDmap2d_ss_templ
{
GDview_templ+IPort2 &view_in;
GDcamera_templ+IPort2 &cam_in;
GDobject_templ+IPort2 &obj_in;
int mode;
string name;
int color;
float red, green, blue;
Mesh+Cell_Data+OPort2 out_mesh {
&xform => obj_in.xform;
};
};
GDmap2d_ss_temp GDmap2d_ss {
mode = 0;
color = 0;
red = 1.0;
green = 1.0;
blue = 1.0;
};
These templates define a module to covert a 2D drawing's screen space buffer to a field. This buffer is typically created by either the GDroi2d_click or GDroi2d_cont modules. GDmap2d_ss_notify_templ defines the elements that cause the module's update method to execute. GDmap2d_ss_templ defines the additional elements that are used at execution time but do not trigger an activation. GDmap2d_ss provides initial values to some of the elements. This is the template that should be instanced.
The GDmap2d_ss module performs the mapping from screen space to world space. This module takes a GDroi2d_buffer as input. As described in the GDroi2d_click and GDroi2d_cont modules, this buffer contains the screen space points that represent the drawing that you have generated. The other required inputs for the module are a GDview and a GDcamera. The view and camera are needed to be able to determine the mapping from screen space to world space. A GDobject is an optional input to the module. When the module executes, if a GDobject does not exist, the screen points are mapped into the coordinate system of the camera. If the object does exist, the points are mapped into the same coordinate system as the object.
Libraries.Graphics_Display.Interactivity.UI_Interactivity.ClickSketch
Libraries.Graphics_Display.Interactivity.UI_Interactivity.ContinuousSketch