MGUI::TOOL_RECTANGLE Class Reference

Rectangle tool class. More...

#include <mgui/toolrectangle.h>

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

List of all members.

Public Types

enum  DIRECTION { DIRECTION_Forward, DIRECTION_Backward, DIRECTION_Left, DIRECTION_Right }
enum  STARTMODE { STARTMODE_Default = 0, STARTMODE_CenterlineWidth = 1 }

Public Member Functions

 TOOL_RECTANGLE (TOOLCANVAS *canvas)
virtual ~TOOL_RECTANGLE ()
double GetAngle () const
DPOINT2D GetCenter () const
const DPOINT2DGetCorner (int corner) const
void GetCorners (DPOINT2D rcorners[4]) const
const DPOINT2DGetCorners () const
const DRECT2DGetExtents () const
const DPOINT2DGetSize () const
void MoveByStep (DIRECTION direction, double StepAmtOverride=0)
void SetAngleVisible (bool anglevisible=true, bool sideanglevisible=false, int pixels=0)
void SetAspect (double aspect)
void SetCenterVisible (bool centervisible=true)
void SetCorners (const POLYLINE &corners)
void SetDftAngle (double dftangle)
void SetRectangle (const DRECT2D &rhs)
void SetSideMarkerLength (int lengthoutside)
void SetStartMode (STARTMODE StartMode)
void SetStepByToolDimension (bool StepByToolDim=true, double StepAmt=1.0)

Detailed Description

Rectangle tool class.


Member Enumeration Documentation

Enumerator:
DIRECTION_Forward 
DIRECTION_Backward 
DIRECTION_Left 
DIRECTION_Right 
Enumerator:
STARTMODE_Default 

Upright rectangle, start at one corner, drag opposite corner.

STARTMODE_CenterlineWidth 

Press-drag-release to define centerline, click again to define width.


Constructor & Destructor Documentation

MGUI::TOOL_RECTANGLE::TOOL_RECTANGLE ( TOOLCANVAS canvas  )  [explicit]

Constructor.

virtual MGUI::TOOL_RECTANGLE::~TOOL_RECTANGLE (  )  [virtual]

Destructor.


Member Function Documentation

double MGUI::TOOL_RECTANGLE::GetAngle (  )  const [inline]

Get rotation angle.

Returns:
Rotation angle in RADIANS.
DPOINT2D MGUI::TOOL_RECTANGLE::GetCenter (  )  const [inline]

Get center of rectangle in tool coordinates.

const DPOINT2D& MGUI::TOOL_RECTANGLE::GetCorner ( int  corner  )  const [inline]

Get coordinates of specified corner.

Parameters:
corner Corner number (0-3)
void MGUI::TOOL_RECTANGLE::GetCorners ( DPOINT2D  rcorners[4]  )  const [inline]

Copy corner coordinates into specified array.

Parameters:
rcorners Array to contain corner coordinates
const DPOINT2D* MGUI::TOOL_RECTANGLE::GetCorners (  )  const [inline]

Get coordinates of all rectangle corners.

Returns:
Array of 4 corner coordinates.
const DRECT2D& MGUI::TOOL_RECTANGLE::GetExtents (  )  const [inline]

Get extents of tool.

const DPOINT2D& MGUI::TOOL_RECTANGLE::GetSize (  )  const [inline]

Get current rectangle size.

Returns:
Size in tool coordinates before rotation.
void MGUI::TOOL_RECTANGLE::MoveByStep ( DIRECTION  direction,
double  StepAmtOverride = 0 
)

Move tool one "step" in specified direction.

Parameters:
direction Direction
StepAmtOverride Step amount override, 0 to use value set in tool
void MGUI::TOOL_RECTANGLE::SetAngleVisible ( bool  anglevisible = true,
bool  sideanglevisible = false,
int  pixels = 0 
)

Set whether rotation angle indicator is visible.

The rotation angle is indicated by a line from the center to the boundary.

Parameters:
pixels Number of pixels to extend handle outside of box
void MGUI::TOOL_RECTANGLE::SetAspect ( double  aspect  ) 

Set aspect ratio for rectangle.

Setting the aspect ratio to a value <= 0 removes the aspect constraint.

Parameters:
aspect Aspect ratio X/Y
void MGUI::TOOL_RECTANGLE::SetCenterVisible ( bool  centervisible = true  ) 

Set whether center marker is visible.

void MGUI::TOOL_RECTANGLE::SetCorners ( const POLYLINE corners  ) 

Set corners from POLYLINE.

Polyline must contain 4 vertices (5 if closed).

Parameters:
corners Corners in tool coordinates.
void MGUI::TOOL_RECTANGLE::SetDftAngle ( double  dftangle  ) 

Set default angle for starting new rectangle.

Parameters:
dftangle Default angle in degrees
void MGUI::TOOL_RECTANGLE::SetRectangle ( const DRECT2D rhs  ) 

Set position from rectangle.

Parameters:
rhs Rectangle in tool coordinates to set
void MGUI::TOOL_RECTANGLE::SetSideMarkerLength ( int  lengthoutside  ) 

Set length of "side markers".

By default, no side markers are shown. This is useful if box indicates a target if it can become small and hard to see.

Parameters:
lengthoutside Length of marker outside box in pixels
void MGUI::TOOL_RECTANGLE::SetStartMode ( STARTMODE  StartMode  )  [inline]

Set mode for when user starts new box.

Parameters:
StartMode Mode for when user starts new box
void MGUI::TOOL_RECTANGLE::SetStepByToolDimension ( bool  StepByToolDim = true,
double  StepAmt = 1.0 
) [inline]

Set to step by tool dimension, supported in v_OnKey.

Parameters:
StepAmt Size relative to width/height of profile tool (1.0 = 100%)

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

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