MGUI::TOOL_BASE Class Reference

Base class for graphic tools. More...

#include <mgui/toolbase.h>

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

List of all members.

Classes

class  MANUAL_BASE
 Base class for manual entry classes implemented by tools based on TOOL_BASE. More...
class  SNAPGRID
 Snap grid definition. More...

Public Types

enum  ADJUSTFLAGS { ADJUST_Default = 0x00, ADJUST_Absolute = 0x01, ADJUST_ScreenCoords = 0x02, ADJUST_Notify = 0x80 }
enum  CHANGESEQ {
  CHANGESEQ_None = 0, CHANGESEQ_Begin = 1, CHANGESEQ_Continue = 2, CHANGESEQ_End = 3,
  CHANGESEQ_Cancel = 4
}
enum  CHANGETYPE {
  CHANGETYPE_None = 0, CHANGETYPE_Shift = 1, CHANGETYPE_Resize = 2, CHANGETYPE_Rotate = 3,
  CHANGETYPE_Shear = 4, CHANGETYPE_Edit = 5, CHANGETYPE_Create = 6, CHANGETYPE_Clear = 7,
  CHANGETYPE_ActiveElement = 8, CHANGETYPE_Other = 20
}
enum  CTRLOPT {
  CTRLOPT_Default = 0x0000, CTRLOPT_Manual = 0x0001, CTRLOPT_GPS = 0x0002, CTRLOPT_SnapGrid = 0x0004,
  CTRLOPT_NoManualProj = 0x0008, CTRLOPT_NoEditZ = 0x0010, CTRLOPT_NoBtnClear = 0x0020
}
typedef
fastdelegate::FastDelegate
< void(CHANGESEQ, CHANGETYPE)> 
DELEGATE_ONCHANGE
typedef
fastdelegate::FastDelegate
< bool(MGUI::POINT,
MGUI::KEYSTATE)> 
DELEGATE_ONPOINTER
enum  MARKER {
  MARKER_X = 0, MARKER_Plus = 1, MARKER_ArrowIn = 2, MARKER_ArrowOut = 3,
  MARKER_None = 4, MARKER_Circle = 5, MARKER_Flat = 6, MARKER_Square = 7,
  MARKER_Diamond = 8, MARKER_Diamond_Tall = 9, MARKER_Diamond_Wide = 10
}
enum  PENCOLOR { PENCOLOR_Primary, PENCOLOR_Inactive, PENCOLOR_Highlight, PENCOLOR_COUNT }

Public Member Functions

virtual ~TOOL_BASE ()=0
void Activate ()
void ClearPosition ()
MGUI::FORMCreateControlForm (MGUI::LAYOUT_PANE_BASE &ParentPane, CTRLOPT ctrlopt)
MGUI::FORMCreateManualForm (MGUI::LAYOUT_PANE_BASE &ParentPane, CTRLOPT ctrlopt)
void Deactivate ()
ERRVALUE GenerateRegion (REGION2D &region) const
const DPOINT2DGetArrowKeyDeltas () const
TOOLCANVASGetCanvas () const
void GetCanvasExtents (LRECT2D &extents) const
void GetCanvasExtents (DRECT2D &extents) const
CTRLOPT GetControlOptions () const
KEYSTATE GetKeyState () const
const TRANS2D_MAPGENGetTransToMap () const
const TRANS2D_AFFINEGetTransToWindow () const
bool HasControls () const
bool HasManualControls () const
bool HasPosition () const
bool Is3D () const
bool IsActive () const
bool IsResizable () const
bool IsRotatable () const
bool IsSuspended () const
void Move (double dx, double dy, ADJUSTFLAGS flags)
void NotifyChange (CHANGESEQ changeseq, CHANGETYPE changetype)
void Resize (double dx, double dy, ADJUSTFLAGS flags)
void Resume ()
void Set3D (bool is3D=true)
void SetArrowKeyDeltas (double dx, double dy)
void SetCanStartNew (bool canstartnew)
void SetControlOptions (CTRLOPT ctrlopt)
void SetDelegateOnChange (DELEGATE_ONCHANGE delegate)
void SetDelegateOnDestroy (DELEGATE_VOID_NOPARMS delegate)
void SetDelegateOnRightButtonDown (DELEGATE_ONPOINTER delegate)
void SetDelegateOnRightButtonUp (DELEGATE_ONPOINTER delegate)
void SetPenWidth (INT8 PenWidth)
void SetResizable (bool resizable)
void SetRotatable (bool rotatable)
void SetTransToMap (const TRANS2D_MAPGEN &TransToMap)
void SetTransToWindow (const TRANS2D_AFFINE &trans)
bool SnapGridIsActive () const
void SnapGridSet (const SNAPGRID &snapgrid)
void SnapGridSetActive (bool active)
void StereoEnable (bool enable)
bool StereoIsEnabled () const
void Suspend ()

Static Public Member Functions

static const COLORGetPenColor (PENCOLOR pencolor=PENCOLOR_Primary)
static INT8 GetPenWidthShared ()
static void SetPenColor (PENCOLOR pencolor, const COLOR &color)
static void SetPenWidthShared (INT8 PenWidth)

Protected Types

enum  CAPABILITY { CAPABILITY_Default = 0, CAPABILITY_ManualControls = 0x01, CAPABILITY_Stereo = 0x02, CAPABILITY_UsePixmap = 0x04 }
enum  CONTROLNEED { CONTROLNEED_None, CONTROLNEED_Optional, CONTROLNEED_Required }

Protected Member Functions

 TOOL_BASE (TOOLCANVAS *pCanvas, CONTROLNEED ControlNeed=CONTROLNEED_None, CAPABILITY capability=CAPABILITY_Default)
void AdjustBegin (CHANGETYPE changetype, bool redraw=true)
void AdjustEnd (bool releasecapture=true, bool cancel=false)
void ApplyMoveDeltas (DPOINT2D &point, double dx, double dy, ADJUSTFLAGS flags) const
void ApplySnap (DPOINT2D &point) const
void CalcMarkerRectTool (const DPOINT3D &ptTool, UINT16 size, LRECT2D &rectCanvas, bool AddLineWidth=true) const
void CalcMarkerRectTool (const DPOINT2D &ptTool, UINT16 size, LRECT2D &rectCanvas, bool AddLineWidth=true) const
bool CanStartNew () const
bool CanUsePixmap () const
void DrawLineTool (const POLYLINE &plTool, const COLOR *pColor=0, const double *DashArray=0, int DashArraySize=0, bool UsePixmap=false) const
void DrawMarker (const LPOINT2D &ptCanvasCenter, const LPOINT2D &ptCanvasDir, MARKER marker, UINT16 size, const COLOR *pColor=0, bool UsePixmap=false) const
void DrawMarker (const DPOINT2D &ptCanvasCenter, const DPOINT2D &ptCanvasDir, MARKER marker, UINT16 size, const COLOR *pColor=0, bool UsePixmap=false) const
void DrawMarkerTool (const DPOINT3D &ptToolCenter, const DPOINT2D &ptToolDir, MARKER marker, UINT16 size, const COLOR *pColor=0, bool UsePixmap=false) const
void DrawMarkerTool (const DPOINT3D &ptTool, MARKER marker, UINT16 size, const COLOR *pColor=0, bool UsePixmap=false) const
void DrawSegmentTool (const DPOINT3D &ptTool0, const DPOINT3D &ptTool1, const COLOR *pColor=0, const double *DashArray=0, int DashArraySize=0, bool UsePixmap=false) const
void DrawSegmentWindow (const DPOINT3D &ptTool0, const DPOINT3D &ptTool1, const COLOR *pColor=0, const double *DashArray=0, int DashArraySize=0, bool UsePixmap=false) const
bool GetArrowDeltas (KEYCODE, double *, double *)
CHANGETYPE GetChangeType () const
MGD::CONTEXTGetDrawingContext (STEREOVIEW StereoView=STEREOVIEW_None, bool UsePixmap=false) const
MGD::CONTEXTGetDrawingContext (STEREOVIEW StereoView, const COLOR *pColor, bool UsePixmap=false) const
MANUAL_BASEGetManualBase ()
INT8 GetPenWidth () const
bool IsPointerCaptured () const
bool IsUserModifying () const
void RestoreBackground (const LRECT2D &rect, bool AddLineWidth=true, bool UsePixmap=false) const
void RestoreBackground (bool UsePixmap=false) const
void SetAutoPixelFunction (bool AutoPixelFunction)
void SetCursor (CURSORID cursorid) const
void SetHasPosition (bool PosnValid=true)
void SetPixelFunction (MGD::PIXELFUNC PixelFunc)
bool TransToolToWindow (const DPOINT3D &ptTool, DPOINT3D &ptCanvas) const
bool TransToolToWindow (const DPOINT2D &ptTool, DPOINT3D &ptCanvas) const
void TransToolToWindow (const DPOINT2D &ptTool, DPOINT2D &ptCanvas) const
LPOINT2D TransToolToWindow (const DPOINT2D &ptTool) const
DPOINT2D TransWindowToTool (const LPOINT2D &point) const
DPOINT2D TransWindowToTool (MGUI::POINT point) const

Private Member Functions

virtual MGUI::FORMv_CreateControlForm (MGUI::LAYOUT_PANE_BASE &ParentPane, CTRLOPT ctrlopt)
virtual MANUAL_BASEv_CreateManualBase ()
virtual void v_DoDraw ()
virtual void v_DoMove (double x, double y, ADJUSTFLAGS)
virtual void v_DoSize (double x, double y, ADJUSTFLAGS)
virtual int v_GenerateRegion (REGION2D &region) const
virtual MISTRING v_GetDialogTitle () const
virtual void v_OnActivate ()
virtual void v_OnClear ()
virtual void v_OnDeactivate ()
virtual bool v_OnKey (MGUI::POINT point, MGUI::KEYCODE, KEYSTATE)
virtual void v_OnNotifyChange (CHANGESEQ changeseq, CHANGETYPE changetype)
virtual bool v_OnPointerButtonDown (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate)=0
virtual bool v_OnPointerButtonUp (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate)
virtual void v_OnPointerEnter ()
virtual void v_OnPointerLeave ()
virtual void v_OnPointerMove (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate)
virtual void v_OnResume ()
virtual void v_OnSet3D ()
virtual void v_OnSetTransToMap ()
virtual void v_OnSetTransToWindow ()
virtual void v_OnSizeCanvas ()
virtual void v_OnSuspend ()

Detailed Description

Base class for graphic tools.

Derived tool clients should only override the v_OnNotifyChange virtual method to receive tool change notifications. Tool implementations should NOT override the v_OnNotifyChange virtual methods (but may define new v_OnNotify... methods) as this avoids the need for derived tool client classes to call base methods.


Member Typedef Documentation

typedef fastdelegate::FastDelegate<void(CHANGESEQ, CHANGETYPE)> MGUI::TOOL_BASE::DELEGATE_ONCHANGE

Delegate for change notification.

Parameters are: sequence, type.

typedef fastdelegate::FastDelegate<bool(MGUI::POINT, MGUI::KEYSTATE)> MGUI::TOOL_BASE::DELEGATE_ONPOINTER

Delegate for pointer notification.

Parameters are: canvas point, key state. Return true if handled, false if not.


Member Enumeration Documentation

Adjustment flags for Move() and Resize() methods.

Enumerator:
ADJUST_Default 

Values are relative tool coordinates.

ADJUST_Absolute 

Adjustment values are absolute.

ADJUST_ScreenCoords 

Adjustment values are in screen pixels.

ADJUST_Notify 

Send notification message.

enum MGUI::TOOL_BASE::CAPABILITY [protected]
Enumerator:
CAPABILITY_Default 
CAPABILITY_ManualControls 

Manual controls available.

CAPABILITY_Stereo 

Stereo allowed.

CAPABILITY_UsePixmap 

Use canvas Pixmap buffer if available.

sequence

Enumerator:
CHANGESEQ_None 
CHANGESEQ_Begin 
CHANGESEQ_Continue 
CHANGESEQ_End 
CHANGESEQ_Cancel 
Enumerator:
CHANGETYPE_None 
CHANGETYPE_Shift 

Overall position was shifted.

CHANGETYPE_Resize 

Tool was resized.

CHANGETYPE_Rotate 

Tool was rotated.

CHANGETYPE_Shear 

Shear was applied.

CHANGETYPE_Edit 

General edit was made.

CHANGETYPE_Create 

New tool was started.

CHANGETYPE_Clear 

Tool was cleared.

CHANGETYPE_ActiveElement 

Active element was selected.

CHANGETYPE_Other 

Other change not listed above.

enum MGUI::TOOL_BASE::CONTROLNEED [protected]
Enumerator:
CONTROLNEED_None 
CONTROLNEED_Optional 
CONTROLNEED_Required 

Options for standard and manual control forms.

Enumerator:
CTRLOPT_Default 
CTRLOPT_Manual 

Include "manual" controls if available.

CTRLOPT_GPS 

Include "gps" controls if supported.

CTRLOPT_SnapGrid 

Include "snap to grid" toggle if supported.

CTRLOPT_NoManualProj 

Don't allow manual projection / distance controls.

CTRLOPT_NoEditZ 

Don't include Z value editing controls.

CTRLOPT_NoBtnClear 

Don't include "Clear" button.

Marker types, not all types are supported by all tools.

Enumerator:
MARKER_X 

Diagonal cross.

MARKER_Plus 

Orthogonal cross.

MARKER_ArrowIn 

Arrow pointing in for line endpoint.

MARKER_ArrowOut 

Arrow pointing out for line endpoint.

MARKER_None 

No marker.

MARKER_Circle 

Circle.

MARKER_Flat 

Flat line endpoint perpendicular to direction.

MARKER_Square 

Square.

MARKER_Diamond 

Square rotated 45 degrees.

MARKER_Diamond_Tall 

Square rotated 45 degrees, height > width.

MARKER_Diamond_Wide 

Square rotated 45 degrees, width > height.

Enumerator:
PENCOLOR_Primary 

Primary tool drawing color.

PENCOLOR_Inactive 

Color for inactive elements (eg in POLYLINE tool).

PENCOLOR_Highlight 

Color for highlighting.

PENCOLOR_COUNT 

Number of pens, always last.


Constructor & Destructor Documentation

virtual MGUI::TOOL_BASE::~TOOL_BASE (  )  [pure virtual]

Destructor.

MGUI::TOOL_BASE::TOOL_BASE ( TOOLCANVAS pCanvas,
CONTROLNEED  ControlNeed = CONTROLNEED_None,
CAPABILITY  capability = CAPABILITY_Default 
) [explicit, protected]

Constructor.

Parameters:
pCanvas Canvas to contain tool
ControlNeed Need for control dialog or form
capability Additional capabilities

Member Function Documentation

void MGUI::TOOL_BASE::Activate (  ) 

Activate the tool.

If another tool is currently active on the canvas it will be automatically deactivated.

void MGUI::TOOL_BASE::AdjustBegin ( CHANGETYPE  changetype,
bool  redraw = true 
) [protected]
void MGUI::TOOL_BASE::AdjustEnd ( bool  releasecapture = true,
bool  cancel = false 
) [protected]
void MGUI::TOOL_BASE::ApplyMoveDeltas ( DPOINT2D point,
double  dx,
double  dy,
ADJUSTFLAGS  flags 
) const [protected]
void MGUI::TOOL_BASE::ApplySnap ( DPOINT2D point  )  const [protected]

Snap point to current snap grid, if no snapping enabled point unchanged.

Parameters:
point Point to adjust
void MGUI::TOOL_BASE::CalcMarkerRectTool ( const DPOINT3D ptTool,
UINT16  size,
LRECT2D rectCanvas,
bool  AddLineWidth = true 
) const [protected]

Calculate rectangle covered by marker, accounting for stereo mode if used.

Parameters:
ptTool Point in tool coordinates
size Marker size
rectCanvas Rectangle on canvas returned.
AddLineWidth Include current pen width in rectangle
void MGUI::TOOL_BASE::CalcMarkerRectTool ( const DPOINT2D ptTool,
UINT16  size,
LRECT2D rectCanvas,
bool  AddLineWidth = true 
) const [protected]

Calculate rectangle covered by marker, accounting for stereo mode if used.

Parameters:
ptTool Point in tool coordinates
size Marker size
rectCanvas Rectangle on canvas returned.
AddLineWidth Include current pen width in rectangle
bool MGUI::TOOL_BASE::CanStartNew (  )  const [inline, protected]
bool MGUI::TOOL_BASE::CanUsePixmap (  )  const [protected]

Determine if can use canvas pixmap.

Returns:
true if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers.
void MGUI::TOOL_BASE::ClearPosition (  ) 

Clear current tool position, erasing all graphics.

MGUI::FORM* MGUI::TOOL_BASE::CreateControlForm ( MGUI::LAYOUT_PANE_BASE ParentPane,
CTRLOPT  ctrlopt 
) [inline]

Create "form" with tool-specific controls.

Returns:
Pointer to FORM or NULL if tool has no "control" form.
Parameters:
ParentPane Parent pane
ctrlopt Control options
MGUI::FORM* MGUI::TOOL_BASE::CreateManualForm ( MGUI::LAYOUT_PANE_BASE ParentPane,
CTRLOPT  ctrlopt 
)

Create "form" with tool-specific manual-entry controls.

Returns:
Pointer to FORM or NULL if tool has no "manual entry" form.
Parameters:
ParentPane Parent pane
ctrlopt Control options
void MGUI::TOOL_BASE::Deactivate (  ) 

Deactivate this tool.

void MGUI::TOOL_BASE::DrawLineTool ( const POLYLINE plTool,
const COLOR pColor = 0,
const double *  DashArray = 0,
int  DashArraySize = 0,
bool  UsePixmap = false 
) const [protected]

Draw single line in "tool" coordinates.

Parameters:
plTool Line in "tool" coordinates
pColor Color, if 0 will use primary pen color
DashArray Dash array for drawing "closing" line
DashArraySize Number of dash array entries
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::DrawMarker ( const LPOINT2D ptCanvasCenter,
const LPOINT2D ptCanvasDir,
MARKER  marker,
UINT16  size,
const COLOR pColor = 0,
bool  UsePixmap = false 
) const [protected]

Draw marker (MARKER...) in the position and size specified.

Parameters:
ptCanvasCenter Point in canvas coordinates for "center" of marker
ptCanvasDir Point in canvas coordinates used to determine direction
marker Type of marker to draw
size Size in pixels
pColor Color, if 0 will use primary pen color
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::DrawMarker ( const DPOINT2D ptCanvasCenter,
const DPOINT2D ptCanvasDir,
MARKER  marker,
UINT16  size,
const COLOR pColor = 0,
bool  UsePixmap = false 
) const [protected]

Draw a marker in the position and size specified.

Parameters:
ptCanvasCenter Point in canvas coordinates for "center" of marker
ptCanvasDir Point in canvas coordinates used to determine direction
marker Type of marker to draw
size Size in pixels
pColor Color, if 0 will use primary pen color
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::DrawMarkerTool ( const DPOINT3D ptToolCenter,
const DPOINT2D ptToolDir,
MARKER  marker,
UINT16  size,
const COLOR pColor = 0,
bool  UsePixmap = false 
) const [protected]

Draw optionally directional marker using specified "tool" coordinates.

Parameters:
ptToolCenter Point in tool coordinates for center of marker
ptToolDir Point in tool coordinates used to determine direction
marker Type of marker to draw
size Size in pixels
pColor Color, if 0 will use primary pen color
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::DrawMarkerTool ( const DPOINT3D ptTool,
MARKER  marker,
UINT16  size,
const COLOR pColor = 0,
bool  UsePixmap = false 
) const [protected]

Draw non-directional marker using specified "tool" coordinates.

Parameters:
ptTool Point in tool coordinates for center of marker
marker Type of marker to draw
size Size in pixels
pColor Color, if 0 will use primary pen color
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::DrawSegmentTool ( const DPOINT3D ptTool0,
const DPOINT3D ptTool1,
const COLOR pColor = 0,
const double *  DashArray = 0,
int  DashArraySize = 0,
bool  UsePixmap = false 
) const [protected]

Draw segment in "tool" coordinates.

Parameters:
ptTool0 Starting point in "tool" coordinates
ptTool1 Ending point in "tool" coordinates
pColor Color, if 0 will use primary pen color
DashArray Dash array if drawing dashed line
DashArraySize Number of dash array entries
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::DrawSegmentWindow ( const DPOINT3D ptTool0,
const DPOINT3D ptTool1,
const COLOR pColor = 0,
const double *  DashArray = 0,
int  DashArraySize = 0,
bool  UsePixmap = false 
) const [protected]

Draw segment in "window" coordinates.

Parameters:
ptTool0 Starting point in "tool" coordinates
ptTool1 Ending point in "tool" coordinates
pColor Color, if 0 will use primary pen color
DashArray Dash array if drawing dashed line
DashArraySize Number of dash array entries
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
ERRVALUE MGUI::TOOL_BASE::GenerateRegion ( REGION2D region  )  const [inline]

Generate region from tool.

Parameters:
region Region in 'tool' coordinates returned
bool MGUI::TOOL_BASE::GetArrowDeltas ( KEYCODE  ,
double *  ,
double *   
) [protected]
const DPOINT2D& MGUI::TOOL_BASE::GetArrowKeyDeltas (  )  const [inline]

Get movement values associated with arrow keys.

Returns:
Values in "tool" coordinates.
TOOLCANVAS* MGUI::TOOL_BASE::GetCanvas (  )  const [inline]

Get "canvas" associated with tool.

void MGUI::TOOL_BASE::GetCanvasExtents ( LRECT2D extents  )  const

Get extents of canvas in LRECT2D.

Parameters:
extents Extents in canvas coordinates returned
void MGUI::TOOL_BASE::GetCanvasExtents ( DRECT2D extents  )  const

Get extents of canvas in DRECT2D.

Parameters:
extents Extents in canvas coordinates returned
CHANGETYPE MGUI::TOOL_BASE::GetChangeType (  )  const [inline, protected]
CTRLOPT MGUI::TOOL_BASE::GetControlOptions (  )  const [inline]

Get current control options settings.

MGD::CONTEXT* MGUI::TOOL_BASE::GetDrawingContext ( STEREOVIEW  StereoView = STEREOVIEW_None,
bool  UsePixmap = false 
) const [protected]

Get shared drawing context.

Will set PixelFunction to Invert if modifying, Copy if not.

Parameters:
StereoView Stereo view, ignored unless stereo enabled for both canvas and tool
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
MGD::CONTEXT* MGUI::TOOL_BASE::GetDrawingContext ( STEREOVIEW  StereoView,
const COLOR pColor,
bool  UsePixmap = false 
) const [protected]

Get shared drawing context with option to set color.

Will set PixelFunction to Invert if modifying, Copy if not.

Parameters:
StereoView Stereo view, ignored unless stereo enabled for both canvas and tool
pColor Color, NULL to leave unchanged, not used if user is "modifying" tool
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
KEYSTATE MGUI::TOOL_BASE::GetKeyState (  )  const [inline]

Get modifier key state (for use in OnPointer delegate).

MANUAL_BASE* MGUI::TOOL_BASE::GetManualBase (  )  [inline, protected]

Get the tool's manual base pointer.

static const COLOR& MGUI::TOOL_BASE::GetPenColor ( PENCOLOR  pencolor = PENCOLOR_Primary  )  [static]

Get global tool pen color.

Returns:
Color.
INT8 MGUI::TOOL_BASE::GetPenWidth (  )  const [protected]

Get pen width used.

static INT8 MGUI::TOOL_BASE::GetPenWidthShared (  )  [static]

Get shared pen width.

Returns:
Pen width in pixels.
const TRANS2D_MAPGEN& MGUI::TOOL_BASE::GetTransToMap (  )  const [inline]

Get transformation between "tool" and current "map" coordinates.

const TRANS2D_AFFINE& MGUI::TOOL_BASE::GetTransToWindow (  )  const [inline]

Get transformation between "tool" and "window" coordinates.

bool MGUI::TOOL_BASE::HasControls (  )  const [inline]

Determine if tool controls available.

bool MGUI::TOOL_BASE::HasManualControls (  )  const [inline]

Determine if has manual data entry controls.

bool MGUI::TOOL_BASE::HasPosition (  )  const [inline]

Check if tool has a valid position set.

bool MGUI::TOOL_BASE::Is3D (  )  const [inline]

Determine if tool set to be 3D.

bool MGUI::TOOL_BASE::IsActive (  )  const [inline]

Check if tool is currently "active".

bool MGUI::TOOL_BASE::IsPointerCaptured (  )  const [protected]

Determine if tool's canvas has the pointer "captured".

bool MGUI::TOOL_BASE::IsResizable (  )  const [inline]

Determine if tool is "resizable".

bool MGUI::TOOL_BASE::IsRotatable (  )  const [inline]

Determine if tool is "rotatable".

bool MGUI::TOOL_BASE::IsSuspended (  )  const [inline]

Check if tool is "suspended".

bool MGUI::TOOL_BASE::IsUserModifying (  )  const [inline, protected]

Determine if user is modifying tool.

void MGUI::TOOL_BASE::Move ( double  dx,
double  dy,
ADJUSTFLAGS  flags 
)

Move the tool by the specified amount.

void MGUI::TOOL_BASE::NotifyChange ( CHANGESEQ  changeseq,
CHANGETYPE  changetype 
)

Send notification of "change".

This should be called by tool implementation for any actual change to tool. This is public for cases where tool client may also send notifications for convenience.

Parameters:
changeseq Sequence
changetype Type
void MGUI::TOOL_BASE::Resize ( double  dx,
double  dy,
ADJUSTFLAGS  flags 
)

Resize the tool.

void MGUI::TOOL_BASE::RestoreBackground ( const LRECT2D rect,
bool  AddLineWidth = true,
bool  UsePixmap = false 
) const [protected]

Restore background for specified rectangle.

Parameters:
rect Rectangle in 'canvas' coordinates to restore
AddLineWidth Expand rectangle by 'LineWidth+1' to allow for wide lines
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::RestoreBackground ( bool  UsePixmap = false  )  const [protected]

Restore background for entire tool canvas window.

Parameters:
UsePixmap Use canvas Pixmap if has CAPABILITY_UsePixmap and canvas created with both Memory and Pixmap buffers
void MGUI::TOOL_BASE::Resume (  ) 

Resume the tool after performing drawing operation on the canvas.

void MGUI::TOOL_BASE::Set3D ( bool  is3D = true  ) 

Set whether tool contains 3D values.

void MGUI::TOOL_BASE::SetArrowKeyDeltas ( double  dx,
double  dy 
)

Set movement amounts associated with arrow keys.

void MGUI::TOOL_BASE::SetAutoPixelFunction ( bool  AutoPixelFunction  )  [inline, protected]

Set whether to automatically set PixelFunction in GetDrawingContext.

Default is to automatically set.

void MGUI::TOOL_BASE::SetCanStartNew ( bool  canstartnew  )  [inline]

Set whether user can start drawing a "new" tool.

void MGUI::TOOL_BASE::SetControlOptions ( CTRLOPT  ctrlopt  )  [inline]

Set controls to appear on dialog when shown.

If used, this must be called before tool is first activated.

Parameters:
ctrlopt Control settings
void MGUI::TOOL_BASE::SetCursor ( CURSORID  cursorid  )  const [inline, protected]

Set mouse cursor.

void MGUI::TOOL_BASE::SetDelegateOnChange ( DELEGATE_ONCHANGE  delegate  )  [inline]

Set delegate to call when tool changes.

void MGUI::TOOL_BASE::SetDelegateOnDestroy ( DELEGATE_VOID_NOPARMS  delegate  )  [inline]

Set delegate to call when tool destroyed.

Note, this is called from base class destructor after derived class destructor has already been called. Should generally only be used to "detach" tool to prevent further references. Do not call any tool methods from the delegate.

void MGUI::TOOL_BASE::SetDelegateOnRightButtonDown ( DELEGATE_ONPOINTER  delegate  )  [inline]

Set delegate for right button press.

void MGUI::TOOL_BASE::SetDelegateOnRightButtonUp ( DELEGATE_ONPOINTER  delegate  )  [inline]

Set delegate for right button release.

void MGUI::TOOL_BASE::SetHasPosition ( bool  PosnValid = true  )  [inline, protected]

Set whether current position values are valid.

Parameters:
PosnValid True if current position is valid, false if not
static void MGUI::TOOL_BASE::SetPenColor ( PENCOLOR  pencolor,
const COLOR color 
) [static]

Set global tool pen color.

void MGUI::TOOL_BASE::SetPenWidth ( INT8  PenWidth  ) 

Set individual tool pen width.

Parameters:
PenWidth Pen width in pixels, < 0 to use shared setting
static void MGUI::TOOL_BASE::SetPenWidthShared ( INT8  PenWidth  )  [static]

Set shared pen width.

void MGUI::TOOL_BASE::SetPixelFunction ( MGD::PIXELFUNC  PixelFunc  )  [protected]

Set pixel function on drawing context(s).

Used if tool manages pixel function itself.

Parameters:
PixelFunc Pixel function to set
void MGUI::TOOL_BASE::SetResizable ( bool  resizable  )  [inline]

Set whether tool is resizable.

void MGUI::TOOL_BASE::SetRotatable ( bool  rotatable  )  [inline]

Set whether tool is rotatable.

void MGUI::TOOL_BASE::SetTransToMap ( const TRANS2D_MAPGEN TransToMap  ) 

Set transformation between "tool" and "map" coordinates.

Parameters:
TransToMap Transformation from "tool" to "map" coordinates
void MGUI::TOOL_BASE::SetTransToWindow ( const TRANS2D_AFFINE trans  ) 

Set transformation between "tool" and "window" coordinates.

bool MGUI::TOOL_BASE::SnapGridIsActive (  )  const [inline]

Determine if snap grid is currently in use.

void MGUI::TOOL_BASE::SnapGridSet ( const SNAPGRID snapgrid  ) 

Set snap grid parameters.

void MGUI::TOOL_BASE::SnapGridSetActive ( bool  active  )  [inline]

Set whether to use snap grid or not.

void MGUI::TOOL_BASE::StereoEnable ( bool  enable  ) 

Enable or disable stereo mode.

Note that the TOOLCANVAS::v_GetZView method must also be overridden and not return NULL for stereo.

Parameters:
enable true to enable, false to disable
bool MGUI::TOOL_BASE::StereoIsEnabled (  )  const

Determine if stereo is enabled.

Includes check whether enabled for CANVAS and for non-null CANVAS::GetZView result.

void MGUI::TOOL_BASE::Suspend (  ) 

Suspend tool prior to performing a drawing operation on the canvas.

bool MGUI::TOOL_BASE::TransToolToWindow ( const DPOINT3D ptTool,
DPOINT3D ptCanvas 
) const [protected]

Transform DPOINT3D from "tool" to "window" coordinates with Z value.

Returns:
false if using Z value from Z-view and no value available, otherwise returns true.
Parameters:
ptTool Point in tool coordinates
ptCanvas Point in canvas coordinates returned
bool MGUI::TOOL_BASE::TransToolToWindow ( const DPOINT2D ptTool,
DPOINT3D ptCanvas 
) const [protected]

Transform DPOINT2D from "tool" to "window" coordinates with Z value.

Returns:
true if obtained Z value from Z-view, false if not.
Parameters:
ptTool Point in tool coordinates
ptCanvas Point in canvas coordinates returned
void MGUI::TOOL_BASE::TransToolToWindow ( const DPOINT2D ptTool,
DPOINT2D ptCanvas 
) const [inline, protected]

Transform DPOINT2D from "tool" to "window" coordinates with no Z value.

LPOINT2D MGUI::TOOL_BASE::TransToolToWindow ( const DPOINT2D ptTool  )  const [protected]

Transform DPOINT2D from "tool" to "window" coordinates.

DPOINT2D MGUI::TOOL_BASE::TransWindowToTool ( const LPOINT2D point  )  const [inline, protected]

Transform LPOINT2D point in "window" to "tool" coordinates.

DPOINT2D MGUI::TOOL_BASE::TransWindowToTool ( MGUI::POINT  point  )  const [inline, protected]

Transform MGUI::POINT point in "window" to "tool" coordinates.

virtual MGUI::FORM* MGUI::TOOL_BASE::v_CreateControlForm ( MGUI::LAYOUT_PANE_BASE ParentPane,
CTRLOPT  ctrlopt 
) [private, virtual]

Create "form" with tool-specific controls.

Returns:
Pointer to FORM or NULL if tool has no "control" form.
Parameters:
ParentPane Parent pane
ctrlopt Control options
virtual MANUAL_BASE* MGUI::TOOL_BASE::v_CreateManualBase (  )  [private, virtual]

Create "MGUI::TOOL_BASE::MANUAL_BASE" with tool-specific manual-entry controls.

Returns:
Pointer to MANUAL_BASE or NULL if tool has no "manual entry" form.
virtual void MGUI::TOOL_BASE::v_DoDraw (  )  [private, virtual]

Do actual drawing of tool graphic.

virtual void MGUI::TOOL_BASE::v_DoMove ( double  x,
double  y,
ADJUSTFLAGS   
) [private, virtual]

Move the tool.

virtual void MGUI::TOOL_BASE::v_DoSize ( double  x,
double  y,
ADJUSTFLAGS   
) [private, virtual]

Size the tool.

virtual int MGUI::TOOL_BASE::v_GenerateRegion ( REGION2D region  )  const [private, virtual]

Generate region from tool.

Returns:
TRUE if region generated, FALSE if not, < 0 if error.
Parameters:
region Generated region in 'tool' coordinates returned
virtual MISTRING MGUI::TOOL_BASE::v_GetDialogTitle (  )  const [private, virtual]

Called to get title of tool control dialog.

virtual void MGUI::TOOL_BASE::v_OnActivate (  )  [private, virtual]

Called when tool is "activated".

Reimplemented in MGUI::TOOL_LIMITED.

virtual void MGUI::TOOL_BASE::v_OnClear (  )  [private, virtual]

Called when tool is cleared.

virtual void MGUI::TOOL_BASE::v_OnDeactivate (  )  [private, virtual]

Called when tool is deactivated.

virtual bool MGUI::TOOL_BASE::v_OnKey ( MGUI::POINT  point,
MGUI::KEYCODE  ,
KEYSTATE   
) [private, virtual]

Called when key pressed/released.

Returns:
'true' if key handled, 'false' if not. Should not be called directly, called by OnKey.
virtual void MGUI::TOOL_BASE::v_OnNotifyChange ( CHANGESEQ  changeseq,
CHANGETYPE  changetype 
) [private, virtual]

Called when change made to tool position, shape, size, etc.

Parameters:
changeseq Sequence
changetype Type
virtual bool MGUI::TOOL_BASE::v_OnPointerButtonDown ( MGUI::POINT  point,
POINTERBUTTON  button,
KEYSTATE  keystate 
) [private, pure virtual]

Called when pointer button pressed.

virtual bool MGUI::TOOL_BASE::v_OnPointerButtonUp ( MGUI::POINT  point,
POINTERBUTTON  button,
KEYSTATE  keystate 
) [private, virtual]

Called when pointer button released.

virtual void MGUI::TOOL_BASE::v_OnPointerEnter (  )  [private, virtual]

Called when pointer enters tool canvas.

virtual void MGUI::TOOL_BASE::v_OnPointerLeave (  )  [private, virtual]

Called when pointer leaves tool canvas.

virtual void MGUI::TOOL_BASE::v_OnPointerMove ( MGUI::POINT  point,
POINTERBUTTON  button,
KEYSTATE  keystate 
) [private, virtual]

Called when pointer is moved.

virtual void MGUI::TOOL_BASE::v_OnResume (  )  [private, virtual]

Called when tool is resumed, just before drawing.

virtual void MGUI::TOOL_BASE::v_OnSet3D (  )  [private, virtual]

Called when 3D setting changed.

virtual void MGUI::TOOL_BASE::v_OnSetTransToMap (  )  [private, virtual]

Called when tool to map transformation is set.

virtual void MGUI::TOOL_BASE::v_OnSetTransToWindow (  )  [private, virtual]

Called when tool to window transformation is set.

Reimplemented in MGUI::TOOL_LIMITED.

virtual void MGUI::TOOL_BASE::v_OnSizeCanvas (  )  [private, virtual]

Called when canvas is resized.

virtual void MGUI::TOOL_BASE::v_OnSuspend (  )  [private, virtual]

Called when tool is suspended, just after erasing.


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

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