GDmap2d_ss


Synopsis

define a module to convert a 2D drawing's screen-space buffer to a field

GDmap2d_ss_notify_templ


group GDmap2d_ss_notify_templ
{
GDroi2d_buffer+IPort2 &in_buf;
int clear;
method+notify_val upd_func = "GDmap2d_ss_update";
};

 

GDmap2d_ss_templ


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;
};
};

 

GDmap2s_ss


GDmap2d_ss_temp GDmap2d_ss {
mode = 0;
color = 0;
red = 1.0;
green = 1.0;
blue = 1.0;
};

 

Description

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.

Input Ports

in_buf

A connection to a buffer created by GDroi2d_click or GDroi2d_cont.

view_in

A connection to a view.

cam_in

A connection to a camera, typically the view's picked camera.

obj_in

An optional connection to an object. Without a connection to an object, GDmap2d_ss creates a field in the connected camera's world space. With a connection to an object, GDmap2d_ss creates a field in the connected object's world space.

Parameters

clear

This parameter when set causes the output mesh to be cleared.

mode

This parameter controls how the input screen space data is added to the output mesh: 0 means that the input data is to replace any existing output mesh; 1 means that the input data is to be appended to any existing output mesh.

name

This string parameter is written to the output cell set(s) as the cell set name. This name can then be viewed/used by other modules. When building ROIs, the name can be used as a filter in the Vector2Raster module so only some of the regions are converted to a raster mask.

color

This parameter controls if the red/green/blue values are written to the output field as cell data. The use of color in this manner means that the primitives drawn can have individual color if desired.

red
green
blue

These parameters control the color that can optionally be written to the output mesh. This is termed the "map" color.

Output Ports

out_mesh

The output field created by GDmap2d_ss.

Example

Libraries.Graphics_Display.Interactivity.UI_Interactivity.ClickSketch
Libraries.Graphics_Display.Interactivity.UI_Interactivity.ContinuousSketch

File

v/gd.v

See also

For more information, see: