SoPolyLineScreenDrawer Class Reference
[Drawers]

VSG extension Interactively draw a polyline in normalized screen space. More...

#include <Inventor/drawers/SoPolyLineScreenDrawer.h>

Inheritance diagram for SoPolyLineScreenDrawer:
SoScreenDrawer SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject SoEllipseScreenDrawer SoLassoScreenDrawer SoPolygonScreenDrawer SoRectangleScreenDrawer

List of all members.

Classes

struct  EventArg
 Structure given to callback when an event is raised. More...

Public Member Functions

virtual SoType getTypeId () const
 SoPolyLineScreenDrawer ()
virtual void clear ()

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFUInt32 simplificationThreshold
SoSFBool doCCW
SoSFColor color
SoMFVec2f point
SoSFBool isClosed
SbEventHandler< EventArg & > onFinish

Deprecated



typedef SbBool LineDrawerEventCallback (SoHandleEventAction *action, SoPolyLineScreenDrawer *drawer, void *userData)
virtual SoDEPRECATED void setFinishCallback (LineDrawerEventCallback *callback, void *userData=NULL)

Detailed Description

VSG extension Interactively draw a polyline in normalized screen space.

This class is a base class used to allow the user to dynamically draw line-based shapes (lasso, circle, rectangle, ...) on screen. The geometry is defined in normalized screen space ([-1, 1]x[-1, 1]).

Applications will typically use one of the derived classes, for example, SoEllipseScreenDrawer, SoRectangleScreenDrawer, SoPolygonScreenDrawer or SoLassoScreenDrawer.

The line color is specified by the color field (default is red).

SoPolyLineScreenDrawer classes can automatically reduce the number of points in the shape drawn by the user. This is especially useful with SoLassoScreenDrawer. See the simplificationThreshold field.

Sub-classes can implement the onMouseDown, onMouseMove, etc... methods, to add and edit points.

Notes:

EXAMPLE

SEE ALSO

SoEllipseScreenDrawer, SoLassoScreenDrawer, SoPolygonScreenDrawer, SoRectangleScreenDrawer, SoScreenDrawer

See related examples:

CustomScreenDrawer


Member Typedef Documentation

This is the declaration to use for mouse event callback functions.

Note: These callbacks are called just after the event occurs.

Parameters:
action Action that generate the event.
drawer The ScreenDrawer node that called the function.
userData Optional pointer specified when the callback was set.
Returns:
If the callback handles the event it must return TRUE, else return FALSE.

Constructor & Destructor Documentation

SoPolyLineScreenDrawer::SoPolyLineScreenDrawer (  ) 

Constructor.


Member Function Documentation

virtual void SoPolyLineScreenDrawer::clear (  )  [inline, virtual]

Convenience method to clear the points in the line.

Reimplemented in SoPolygonScreenDrawer.

static SoType SoPolyLineScreenDrawer::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoScreenDrawer.

Reimplemented in SoEllipseScreenDrawer, SoLassoScreenDrawer, SoPolygonScreenDrawer, and SoRectangleScreenDrawer.

virtual SoType SoPolyLineScreenDrawer::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoScreenDrawer.

Reimplemented in SoEllipseScreenDrawer, SoLassoScreenDrawer, SoPolygonScreenDrawer, and SoRectangleScreenDrawer.

virtual SoDEPRECATED void SoPolyLineScreenDrawer::setFinishCallback ( LineDrawerEventCallback callback,
void *  userData = NULL 
) [virtual]

Specifies a callback to call when the line is finished.

Parameters:
callback The callback method.
userData Parameter that will be given to callback. Basically, when the line is finished, this drawer will call:

 callback ( action, this, userData );
Deprecated:

Deprecated since Open Inventor 9800
Use onFinish event instead.

Member Data Documentation

Color of line.

Default value is red.

Make the line counter-clockwise when it is finalized.

This can change order of points. Default is TRUE.

Note:
Some shapes (like "8") do not have a defined clockwiseness. In these cases, the result is undefined.
NOTE: field available since Open Inventor 9.0

Close the line during display (connect last point to first point).

Default is FALSE (but most sub-classes automatically set it to TRUE).

Warning:
This only affects the display.

Event raised when the line is finished.

See SbEventHandler for methods to set a callback to be notified when this event is raised. The callback will be called with a line drawer specific EventArg from which you can query the current action and drawer objects.

Points of line.

Default is empty.

Threshold (in pixels) used to simplify line when it is finished.

A value of 0 means no simplification. Default value is 5 pixels.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/