MicroImages::GRTOOL_POLYLINE Class Reference

GRTOOL_POLYLINE - Polyline / polygon tool. More...

#include <mi32/grtool.h>

Inheritance diagram for MicroImages::GRTOOL_POLYLINE:

Inheritance graph
[legend]
List of all members.

Public Types

enum  EDITMODE {
  EDITMODE_AddEnd, EDITMODE_AddStart, EDITMODE_InsertVertex, EDITMODE_DragVertex,
  EDITMODE_DeleteVertex, EDITMODE_Move
}

Public Member Functions

virtual MGUI::CTRLCreateControlForm (MGUI::LAYOUT_PANE_BASE &ParentPane, CTRLOPT ctrlopt)
virtual int GenerateRegion (REGION2D &region) const
const POLYLINEGetActiveLine () const
const MILIST< POLYLINE > & GetLineList () const
int GetNumLines () const
 GRTOOL_POLYLINE (GRTOOLVIEW *view, bool AllowMulti=false)
bool Is3D () const
bool IsActiveValid () const
void LockEndPoint (bool locked=true)
void LockStartPoint (bool locked=true)
void Set3D (bool set3d=true)
void SetClosed (bool closed=true)
void SetEditMode (EDITMODE EditMode)
void SetMarkers (MARKER startmarker, MARKER endmarker, UINT16 startmarkersize=0, UINT16 endmarkersize=0)
virtual ~GRTOOL_POLYLINE ()

Protected Member Functions

virtual void OnChangeActiveElem ()
virtual void OnClear ()

Private Types

enum  ZONE { ZONE_NoFunction = 0, ZONE_Outside }

Private Member Functions

void AddPoint (CDC *, const DPOINT2D &, EDITMODE)
void AdjustTool (DPOINT2D &, MOVESEQ)
void ComputeCursorZone (const DPOINT2D &)
void DeletePoint (CDC *, int)
virtual void DoDraw (CDC *)
void DrawMarkerEnd (CDC *)
void DrawMarkerStart (CDC *)
void DrawNeighborSegments (CDC *, const LRECT2D &, bool SkipActive=true, int SkipSegment1=-2, int SkipSegment2=-2)
void DrawSegment (CDC *, int, bool)
void DrawSegment (CDC *, const POLYLINE &, int)
void DrawSingleLine (CDC *, const POLYLINE &)
void EraseLine (CDC *)
void EraseMarkerEnd (CDC *, bool)
void EraseMarkerStart (CDC *, bool)
void ErasePoint (CDC *, int)
void EraseSegment (CDC *, int)
void InsertPoint (CDC *, int, const DPOINT2D &, UINT32)
void MovePoint (CDC *, const DPOINT2D &, UINT32)
virtual bool OnKey (UINT nChar, UINT nRepCnt, UINT nFlags)
virtual void OnLButtonDown (UINT nFlags, const CPoint &mpoint)
virtual void OnLButtonUp (UINT nFlags, const CPoint &mpoint)
virtual void OnMouseMove (UINT nFlags, const CPoint &mpoint)
void UpdateCursor () const

Private Attributes

POLYLINEm_ActiveLine
int m_ActivePoint
bool m_AllowMulti
ZONE m_CursorZone
EDITMODE m_EditMode
MARKER m_endmarker
UINT16 m_endmarkersize
bool m_Is3D
bool m_IsClosed
MILIST< POLYLINEm_LineList
bool m_LockEnd
bool m_LockStart
DPOINT2D m_prevpt
bool m_RubberBand
MARKER m_startmarker
UINT16 m_startmarkersize

Detailed Description

GRTOOL_POLYLINE - Polyline / polygon tool.

Definition at line 1542 of file grtool.h.


Member Enumeration Documentation

enum MicroImages::GRTOOL_POLYLINE::EDITMODE
 

Editing modes.

Enumeration values:
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.

Definition at line 1546 of file grtool.h.

enum MicroImages::GRTOOL_POLYLINE::ZONE [private]
 

Enumeration constants.

Enumeration values:
ZONE_NoFunction 
ZONE_Outside 

Definition at line 1651 of file grtool.h.


Constructor & Destructor Documentation

MicroImages::GRTOOL_POLYLINE::GRTOOL_POLYLINE GRTOOLVIEW view,
bool  AllowMulti = false
[explicit]
 

Constructor.

Parameters:
view  View to contain tool
AllowMulti  Allow multiple lines

virtual MicroImages::GRTOOL_POLYLINE::~GRTOOL_POLYLINE  )  [virtual]
 

Destructor.


Member Function Documentation

void MicroImages::GRTOOL_POLYLINE::AddPoint CDC *  ,
const DPOINT2D ,
EDITMODE 
[private]
 

Methods.

void MicroImages::GRTOOL_POLYLINE::AdjustTool DPOINT2D ,
MOVESEQ 
[private]
 

void MicroImages::GRTOOL_POLYLINE::ComputeCursorZone const DPOINT2D  )  [private]
 

virtual MGUI::CTRL* MicroImages::GRTOOL_POLYLINE::CreateControlForm MGUI::LAYOUT_PANE_BASE ParentPane,
CTRLOPT  ctrlopt
[virtual]
 

Create "form" with tool-specific controls.

Parameters:
ParentPane  Parent pane
ctrlopt  Control options

Reimplemented from MicroImages::GRTOOL.

void MicroImages::GRTOOL_POLYLINE::DeletePoint CDC *  ,
int 
[private]
 

virtual void MicroImages::GRTOOL_POLYLINE::DoDraw CDC *   )  [private, virtual]
 

Implements MicroImages::GRTOOL.

void MicroImages::GRTOOL_POLYLINE::DrawMarkerEnd CDC *   )  [private]
 

void MicroImages::GRTOOL_POLYLINE::DrawMarkerStart CDC *   )  [private]
 

void MicroImages::GRTOOL_POLYLINE::DrawNeighborSegments CDC *  ,
const LRECT2D ,
bool  SkipActive = true,
int  SkipSegment1 = -2,
int  SkipSegment2 = -2
[private]
 

void MicroImages::GRTOOL_POLYLINE::DrawSegment CDC *  ,
int  ,
bool 
[private]
 

void MicroImages::GRTOOL_POLYLINE::DrawSegment CDC *  ,
const POLYLINE ,
int 
[private]
 

void MicroImages::GRTOOL_POLYLINE::DrawSingleLine CDC *  ,
const POLYLINE
[private]
 

void MicroImages::GRTOOL_POLYLINE::EraseLine CDC *   )  [private]
 

void MicroImages::GRTOOL_POLYLINE::EraseMarkerEnd CDC *  ,
bool 
[private]
 

void MicroImages::GRTOOL_POLYLINE::EraseMarkerStart CDC *  ,
bool 
[private]
 

void MicroImages::GRTOOL_POLYLINE::ErasePoint CDC *  ,
int 
[private]
 

void MicroImages::GRTOOL_POLYLINE::EraseSegment CDC *  ,
int 
[private]
 

virtual int MicroImages::GRTOOL_POLYLINE::GenerateRegion REGION2D region  )  const [virtual]
 

Generate region from tool boundary.

Returns:
TRUE if region generated, FALSE if not, < 0 if error. Note that the generated region is not necessarily topologically valid as the user may have drawn overlapping or self-intersecting polygons.

Reimplemented from MicroImages::GRTOOL.

const POLYLINE& MicroImages::GRTOOL_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.

Definition at line 1582 of file grtool.h.

const MILIST<POLYLINE>& MicroImages::GRTOOL_POLYLINE::GetLineList  )  const [inline]
 

Get list of lines.

Definition at line 1586 of file grtool.h.

int MicroImages::GRTOOL_POLYLINE::GetNumLines  )  const [inline]
 

Get number of valid lines.

Definition at line 1590 of file grtool.h.

void MicroImages::GRTOOL_POLYLINE::InsertPoint CDC *  ,
int  ,
const DPOINT2D ,
UINT32 
[private]
 

bool MicroImages::GRTOOL_POLYLINE::Is3D  )  const [inline]
 

Determine if tool points are 3D.

Definition at line 1594 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::IsActiveValid  )  const [inline]
 

Determine if active line is valid.

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

Definition at line 1599 of file grtool.h.

void MicroImages::GRTOOL_POLYLINE::LockEndPoint bool  locked = true  ) 
 

Lock or unlock end point of active line.

Parameters:
locked  'true' to lock, 'false' to unlock

void MicroImages::GRTOOL_POLYLINE::LockStartPoint bool  locked = true  ) 
 

Lock or unlock start point of active line.

Parameters:
locked  'true' to lock, 'false' to unlock

void MicroImages::GRTOOL_POLYLINE::MovePoint CDC *  ,
const DPOINT2D ,
UINT32 
[private]
 

virtual void MicroImages::GRTOOL_POLYLINE::OnChangeActiveElem  )  [protected, virtual]
 

Called when "active element" changed.

Derived class must call superclass method BEFORE performing own processing.

virtual void MicroImages::GRTOOL_POLYLINE::OnClear  )  [protected, virtual]
 

Called when tool is "cleared" by user action, usually on control dialog.

Derived class must call superclass method BEFORE performing own processing.

Reimplemented from MicroImages::GRTOOL.

virtual bool MicroImages::GRTOOL_POLYLINE::OnKey UINT  nChar,
UINT  nRepCnt,
UINT  nFlags
[private, virtual]
 

Called when key pressed/released.

Returns:
'true' if key handled, 'false' if not.

Reimplemented from MicroImages::GRTOOL.

virtual void MicroImages::GRTOOL_POLYLINE::OnLButtonDown UINT  nFlags,
const CPoint &  mpoint
[private, virtual]
 

Implements MicroImages::GRTOOL.

virtual void MicroImages::GRTOOL_POLYLINE::OnLButtonUp UINT  nFlags,
const CPoint &  mpoint
[private, virtual]
 

Reimplemented from MicroImages::GRTOOL.

virtual void MicroImages::GRTOOL_POLYLINE::OnMouseMove UINT  nFlags,
const CPoint &  mpoint
[private, virtual]
 

Implements MicroImages::GRTOOL.

void MicroImages::GRTOOL_POLYLINE::Set3D bool  set3d = true  ) 
 

Set whether points are 3D.

void MicroImages::GRTOOL_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 MicroImages::GRTOOL_POLYLINE::SetEditMode EDITMODE  EditMode  ) 
 

Set line editing mode.

Parameters:
EditMode  New editing mode

void MicroImages::GRTOOL_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 MicroImages::GRTOOL_POLYLINE::UpdateCursor  )  const [private]
 


Member Data Documentation

POLYLINE* MicroImages::GRTOOL_POLYLINE::m_ActiveLine [private]
 

Pointer to active line.

Definition at line 1669 of file grtool.h.

int MicroImages::GRTOOL_POLYLINE::m_ActivePoint [private]
 

Definition at line 1673 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::m_AllowMulti [private]
 

Tool settings.

Definition at line 1657 of file grtool.h.

ZONE MicroImages::GRTOOL_POLYLINE::m_CursorZone [private]
 

Current cursor zone.

Definition at line 1671 of file grtool.h.

EDITMODE MicroImages::GRTOOL_POLYLINE::m_EditMode [private]
 

Definition at line 1666 of file grtool.h.

MARKER MicroImages::GRTOOL_POLYLINE::m_endmarker [private]
 

Definition at line 1663 of file grtool.h.

UINT16 MicroImages::GRTOOL_POLYLINE::m_endmarkersize [private]
 

Definition at line 1665 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::m_Is3D [private]
 

Definition at line 1659 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::m_IsClosed [private]
 

Definition at line 1658 of file grtool.h.

MILIST<POLYLINE> MicroImages::GRTOOL_POLYLINE::m_LineList [private]
 

Tool position values.

Definition at line 1668 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::m_LockEnd [private]
 

Definition at line 1661 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::m_LockStart [private]
 

Definition at line 1660 of file grtool.h.

DPOINT2D MicroImages::GRTOOL_POLYLINE::m_prevpt [private]
 

Previous point during button-down.

Definition at line 1672 of file grtool.h.

bool MicroImages::GRTOOL_POLYLINE::m_RubberBand [private]
 

Definition at line 1674 of file grtool.h.

MARKER MicroImages::GRTOOL_POLYLINE::m_startmarker [private]
 

Definition at line 1662 of file grtool.h.

UINT16 MicroImages::GRTOOL_POLYLINE::m_startmarkersize [private]
 

Definition at line 1664 of file grtool.h.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:21:05 2004 for TNTsdk by  doxygen 1.3.8-20040913