Synopsis
create a 2D drawing with successive mouse clicks
Note: This object has superceded a previous version of an object with the same name. Please note that the older version's template is VIEW.Viewers.ClickSketch, and this version's template is GDM.Viewers.ClickSketch. The render_view input port present in the old template is no longer necessary when used with the new Uviewers.
V name
GDM.ClickSketch
Input Ports
view_in |
GDview_templ |
obj_in |
GDobject_templ |
Output Ports
click_sketch.GDmap2d_ss.out_mesh |
Mesh+Cell_Data |
click_sketch.DataObject.obj |
DefaultObject |
Description
ClickSketch enables you to create a 2D drawing with individual clicks of the mouse. It combines the following:
one-point interactors for adding a point, erasing a region point, and closing a region
GDroi2d_click for handling the drawing operation
GDmap2d_ss for converting the output buffer created by GDroi2d_click to a field
a user interface, which the user accesses through the Module Panel provided by the DataViewer or ModuleStack (as appropriate)
Input Ports
view_in
A view. This is typically connected to one of the Graphics Display Kit's viewer macros output view (for example, Uviewer2D.Scene_Selector.curr_view).
obj_in
An optional connection to an object. Without an object, ClickSketch converts the drawing to a field in the camera's world space. With an object, ClickSketch converts the drawing to a field in the object's world space.
Parameters
build option
UIradioBox. A set of radio buttons to pick which type of primitive to draw. Possible primitives are point, line. box, polyline, and polygon.
immed
UItoggle. This parameter controls whether the output buffer is immediately written to upon completion of a primitive. 1 means yes.; 0 means no. When the value is 0, you must press the Done button to cause the output buffer to be written.
build red color
build green color
build blue color
UIsliders. Float sliders to set the red/green/blue build color while initially constructing the primitive. Values are in the range 0-1.
build mode
UItoggle. The mode to use when building the primitive: 0 means clear; 1 means append. If the mode selected is clear, each time a primitive is built it overwrites any previous primitive. If the mode selected is append, each time a primitive is built, it is appended to a previous primitive(s). By using append mode, you can build multiple primitives before mapping them to a field.
build clear
UIbutton. When pressed, this button causes the build buffer to be cleared of all primitives.
build done
UIbutton. When pressed, this button causes all existing primitives to be written to the build output buffer. This buffer is then converted into a field.
map red color
map green color
map blue color
UIsliders. Float sliders to set the red/green/blue map color while mapping the primitives from screen space to some world space coordinate system. Values are in the range 0-1. These colors are only used if the map color has a value of 1.
map color
UItoggle. Enable/disable the use of the map red/green/blue colors. If the value is 0, no color information is written to the field. If the value is 1, color information is written to the output field as cell data. This gives you the ability to specify color on a per primitive basis.
map mode
UItoggle. The mode to use when mapping the primitives to world space: 0 means clear; 1 means append. If the mode selected is clear, each time primitives are mapped, any previous field is overwritten. If the mode selected is append, each time primitives are mapped, they are appended to the field. By using append mode, you can incrementally build the field.
map clear
UIbutton. When pressed, this button causes the output field to be cleared.
map name
UItext. A name that, if specified, is written to the cell set as the cell name.
Output Ports
out_mesh
A field mesh plus optional cell data.
obj
The field mesh as a Graphics Display Kit object.
Example
Libraries.Examples.Graphics_Display.ClickSketch
Libraries.Examples.Graphics_Display.EditMesh
Libraries.Examples.Graphics_Display.ImageAnno
Libraries.Examples.Graphics_Display.ROIdraw
File
v/view.v
See also