MGUI::TOOL_POLYLINE Class Reference

Polyline / polygon tool. More...

#include <mgui/toolpolyline.h>

Inheritance diagram for MGUI::TOOL_POLYLINE:
Inheritance graph
[legend]

List of all members.

Public Types

typedef
fastdelegate::FastDelegate
< bool(CHANGESEQ, EDITMODE,
DPOINT3D &)> 
DELEGATE_ONSETVERTEX
typedef
fastdelegate::FastDelegate
< bool(POLYLINE &)> 
DELEGATE_ONVERTICESCHANGED
enum  DRAWMODE { DRAWMODE_Draw = 256, DRAWMODE_Stretch }
enum  EDITMODE {
  EDITMODE_Automatic = 0, EDITMODE_AddEnd, EDITMODE_AddStart, EDITMODE_InsertVertex,
  EDITMODE_DragVertex, EDITMODE_DeleteVertex, EDITMODE_Move
}

Public Member Functions

 TOOL_POLYLINE (TOOLCANVAS *canvas, bool AllowMulti=false)
virtual ~TOOL_POLYLINE ()
const POLYLINEGetActiveLine () const
EDITMODE GetEditMode () const
const POLYLINELISTGetLineList () const
int GetNumLines () const
bool IsActiveValid () const
bool IsClosed () const
void LockEndPoint (bool locked=true)
void LockStartPoint (bool locked=true)
void SetClosed (bool closed=true)
void SetDelegateOnSetVertex (DELEGATE_ONSETVERTEX delegate)
void SetDelegateOnVerticesChanged (DELEGATE_ONVERTICESCHANGED delegate)
void SetDrawMode (DRAWMODE DrawMode)
void SetEditMode (EDITMODE EditMode)
void SetFilterDistance (double distance)
void SetLine (const POLYLINE &polyline)
void SetLineList (const POLYLINELIST &LineList)
void SetMarkerColors (PENCOLOR startcolor, PENCOLOR endcolor)
void SetMarkers (MARKER startmarker, MARKER endmarker, UINT16 startmarkersize=0, UINT16 endmarkersize=0)
void UpdateActiveLine (const POLYLINE &polyline)

Detailed Description

Polyline / polygon tool.


Member Typedef Documentation

typedef fastdelegate::FastDelegate<bool(CHANGESEQ, EDITMODE, DPOINT3D&)> MGUI::TOOL_POLYLINE::DELEGATE_ONSETVERTEX
typedef fastdelegate::FastDelegate<bool(POLYLINE&)> MGUI::TOOL_POLYLINE::DELEGATE_ONVERTICESCHANGED

Member Enumeration Documentation

Draw modes.

Enumerator:
DRAWMODE_Draw 
DRAWMODE_Stretch 

Editing modes.

Enumerator:
EDITMODE_Automatic 

Actual EDITMODE based on the location if the cursor to the current line.

EDITMODE_AddEnd 

Add vertices to end of active line (default).

EDITMODE_AddStart 

Add vertices to start of active line.

EDITMODE_InsertVertex 

Insert vertex.

EDITMODE_DragVertex 

Drag nearest vertex.

EDITMODE_DeleteVertex 

Delete nearest vertex.

EDITMODE_Move 

Move active line.


Constructor & Destructor Documentation

MGUI::TOOL_POLYLINE::TOOL_POLYLINE ( TOOLCANVAS canvas,
bool  AllowMulti = false 
) [explicit]

Constructor.

Parameters:
canvas View to contain tool
AllowMulti Allow multiple lines
virtual MGUI::TOOL_POLYLINE::~TOOL_POLYLINE (  )  [virtual]

Destructor.


Member Function Documentation

const POLYLINE& MGUI::TOOL_POLYLINE::GetActiveLine (  )  const [inline]

Get reference to active line.

IsActiveValid() should be used first to determine if the active line is valid. Failure to do so will likely result in an exception.

EDITMODE MGUI::TOOL_POLYLINE::GetEditMode (  )  const [inline]

Get line editing mode.

const POLYLINELIST& MGUI::TOOL_POLYLINE::GetLineList (  )  const [inline]

Get list of lines.

int MGUI::TOOL_POLYLINE::GetNumLines (  )  const [inline]

Get number of valid lines.

bool MGUI::TOOL_POLYLINE::IsActiveValid (  )  const [inline]

Determine if active line is valid.

In single-line mode the active line is always valid.

bool MGUI::TOOL_POLYLINE::IsClosed (  )  const [inline]

Determine if the lines are closed.

void MGUI::TOOL_POLYLINE::LockEndPoint ( bool  locked = true  ) 

Lock or unlock end point of active line.

Parameters:
locked 'true' to lock, 'false' to unlock
void MGUI::TOOL_POLYLINE::LockStartPoint ( bool  locked = true  ) 

Lock or unlock start point of active line.

Parameters:
locked 'true' to lock, 'false' to unlock
void MGUI::TOOL_POLYLINE::SetClosed ( bool  closed = true  ) 

Set line to draw as "closed".

This only affects how the tool is drawn, it does not add a closing point to the POLYLINE.

void MGUI::TOOL_POLYLINE::SetDelegateOnSetVertex ( DELEGATE_ONSETVERTEX  delegate  )  [inline]

Set delegate to call when a vertex is added or moved This allows the user of the tool to determine if the point is to be moved and where.

Return 'true' for the delegate to modify the point.

void MGUI::TOOL_POLYLINE::SetDelegateOnVerticesChanged ( DELEGATE_ONVERTICESCHANGED  delegate  )  [inline]

Set delegate to call when a set of vertices have changed This allows the user of the tool to modify the vertex set that the user has added or altered.

Return 'true' for the delegate to modify the active line.

void MGUI::TOOL_POLYLINE::SetDrawMode ( DRAWMODE  DrawMode  ) 

Set line drawing mode.

Call this method AFTER the call to TOOL_BASE::CreateControlForm().

Parameters:
DrawMode New drawing mode
void MGUI::TOOL_POLYLINE::SetEditMode ( EDITMODE  EditMode  ) 

Set line editing mode.

Parameters:
EditMode New editing mode
void MGUI::TOOL_POLYLINE::SetFilterDistance ( double  distance  ) 

Set filter distance.

void MGUI::TOOL_POLYLINE::SetLine ( const POLYLINE polyline  ) 

Set single polyline.

Parameters:
polyline Polyline in tool coordinates to set
void MGUI::TOOL_POLYLINE::SetLineList ( const POLYLINELIST LineList  ) 

Set polyline list.

Parameters:
LineList Polyline list in tool coordinates to set
void MGUI::TOOL_POLYLINE::SetMarkerColors ( PENCOLOR  startcolor,
PENCOLOR  endcolor 
)

Set marker colors for start and end points.

Parameters:
startcolor Starting point marker color setting
endcolor Ending point marker color setting
void MGUI::TOOL_POLYLINE::SetMarkers ( MARKER  startmarker,
MARKER  endmarker,
UINT16  startmarkersize = 0,
UINT16  endmarkersize = 0 
)

Set markers for start and end points.

Parameters:
startmarker Starting point marker type
endmarker Ending point marker type
startmarkersize Starting point marker size, 0 to retain current size
endmarkersize Ending point marker size, 0 to retain current size
void MGUI::TOOL_POLYLINE::UpdateActiveLine ( const POLYLINE polyline  ) 

Update active polyline.

Parameters:
polyline Polyline in tool coordinates to update

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

Generated on Sun Oct 7 21:36:19 2012 for TNTsdk 2012 by  doxygen 1.6.1