Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
PolygonTool Class Reference

Select tile tool. More...

#include <PolygonTool.h>

Inherits Tool.

Inherited by PointerTool, and WaterTool.

Public Member Functions

 PolygonTool (void)
 Constructor.
 
 ~PolygonTool (void)
 Destructor.
 
virtual void mouseDown (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 Perform tool on mouse down.
 
virtual void mouseMoved (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 Left button move code.
 
virtual void mouseUp (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 
virtual void setCursor (void)
 
virtual void activate ()
 Become the current tool.
 
virtual void deactivate ()
 Become not the current tool.
 
- Public Member Functions inherited from Tool
 Tool (Int toolID, Int cursorID)
 Tool class.
 
virtual ~Tool (void)
 Destructor.
 
Int getToolID (void)
 
virtual Bool followsTerrain (void)
 Become not the current tool.
 
virtual WorldHeightMapEditgetHeightMap (void)
 

Static Public Member Functions

static Bool isActive (void)
 
static Bool deleteSelectedPolygon (void)
 Delete the selected polygon or point.
 
static Bool isSelected (PolygonTrigger *pTrig)
 
static Int getSelectedPointNdx (void)
 
static PolygonTriggerpickPolygon (Coord3D loc, CPoint viewPt, WbView *pView)
 
static Bool isSelectedOpen (void)
 
- Static Public Member Functions inherited from Tool
static Real calcRoundBlendFactor (CPoint center, Int x, Int y, Int brushWidth, Int featherWidth)
 Calculate the round blend factor.
 
static Real calcSquareBlendFactor (CPoint center, Int x, Int y, Int brushWidth, Int featherWidth)
 Calculate the square blend factor.
 
static void getCenterIndex (Coord3D *docLocP, Int brushWidth, CPoint *center, CWorldBuilderDoc *pDoc)
 Gets the cell index for the center of the brush.
 
static void getAllIndexesIn (const Coord3D *bl, const Coord3D *br, const Coord3D *tl, const Coord3D *tr, Int widthOutside, CWorldBuilderDoc *pDoc, VecHeightMapIndexes *allIndices)
 

Protected Member Functions

Bool poly_snapToPoly (Coord3D *pLoc)
 
void poly_pickOnMouseDown (CPoint viewPt, WbView *pView)
 
void startMouseDown (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 Perform the tool behavior on mouse down.
 

Static Protected Member Functions

static Int poly_pickPoint (PolygonTrigger *pTrig, CPoint viewPt, WbView *pView)
 
static Int poly_getInsertIndex (PolygonTrigger *pTrig, Coord3D loc)
 
static Bool poly_pickPoly (PolygonTrigger *pTrig, Coord3D pLoc, Int tolerance)
 

Protected Attributes

Coord3D m_poly_mouseDownPt
 
Coord3D m_poly_unsnappedMouseDownPt
 
Bool m_poly_isDraggingPoint
 
Bool m_poly_justPicked
 
Bool m_poly_mouseUpPlus
 True if we are over the "Add point" hotspot.
 
HCURSOR m_poly_plusCursor
 
Bool m_poly_mouseUpMove
 True if we are over the "move" hotspot.
 
HCURSOR m_poly_moveCursor
 
MovePolygonUndoablem_poly_moveUndoable
 
- Protected Attributes inherited from Tool
Int m_toolID
 
Int m_cursorID
 
HCURSOR m_cursor
 
Int m_prevXIndex
 
Int m_prevYIndex
 

Static Protected Attributes

static Bool m_poly_isAdding = false
 
static Int m_poly_dragPointNdx = -1
 
static Bool m_poly_isActive = false
 
static PolygonTriggerm_poly_curSelectedPolygon = NULL
 

Detailed Description

Select tile tool.

PolygonTool Does the add/select polygon operation.

Definition at line 38 of file PolygonTool.h.

Constructor & Destructor Documentation

◆ PolygonTool()

PolygonTool::PolygonTool ( void )

Constructor.

Definition at line 50 of file PolygonTool.cpp.

◆ ~PolygonTool()

PolygonTool::~PolygonTool ( void )

Destructor.

Definition at line 60 of file PolygonTool.cpp.

Member Function Documentation

◆ activate()

void PolygonTool::activate ( )
virtual

Become the current tool.

Shows the terrain materials options panel.

Reimplemented from Tool.

Reimplemented in PointerTool, and WaterTool.

Definition at line 85 of file PolygonTool.cpp.

◆ deactivate()

void PolygonTool::deactivate ( )
virtual

Become not the current tool.

Clears it's is active flag.

Reimplemented from Tool.

Reimplemented in PointerTool, and WaterTool.

Definition at line 71 of file PolygonTool.cpp.

◆ deleteSelectedPolygon()

Bool PolygonTool::deleteSelectedPolygon ( void )
static

Delete the selected polygon or point.

Definition at line 355 of file PolygonTool.cpp.

◆ getSelectedPointNdx()

static Int PolygonTool::getSelectedPointNdx ( void )
inlinestatic

Definition at line 74 of file PolygonTool.h.

◆ isActive()

static Bool PolygonTool::isActive ( void )
inlinestatic

Definition at line 71 of file PolygonTool.h.

◆ isSelected()

static Bool PolygonTool::isSelected ( PolygonTrigger * pTrig)
inlinestatic

Definition at line 73 of file PolygonTool.h.

◆ isSelectedOpen()

static Bool PolygonTool::isSelectedOpen ( void )
inlinestatic

Definition at line 76 of file PolygonTool.h.

◆ mouseDown()

void PolygonTool::mouseDown ( TTrackingMode m,
CPoint viewPt,
WbView * pView,
CWorldBuilderDoc * pDoc )
virtual

Perform tool on mouse down.

Perform the tool behavior on mouse down.

Reimplemented from Tool.

Reimplemented in PointerTool, and WaterTool.

Definition at line 276 of file PolygonTool.cpp.

◆ mouseMoved()

void PolygonTool::mouseMoved ( TTrackingMode m,
CPoint viewPt,
WbView * pView,
CWorldBuilderDoc * pDoc )
virtual

Left button move code.

Reimplemented from Tool.

Reimplemented in PointerTool, and WaterTool.

Definition at line 413 of file PolygonTool.cpp.

◆ mouseUp()

void PolygonTool::mouseUp ( TTrackingMode m,
CPoint viewPt,
WbView * pView,
CWorldBuilderDoc * pDoc )
virtual

Mouse up - not much.

Reimplemented from Tool.

Reimplemented in PointerTool, and WaterTool.

Definition at line 464 of file PolygonTool.cpp.

◆ pickPolygon()

PolygonTrigger * PolygonTool::pickPolygon ( Coord3D loc,
CPoint viewPt,
WbView * pView )
static

Definition at line 129 of file PolygonTool.cpp.

◆ poly_getInsertIndex()

Int PolygonTool::poly_getInsertIndex ( PolygonTrigger * pTrig,
Coord3D loc )
staticprotected

Definition at line 203 of file PolygonTool.cpp.

◆ poly_pickOnMouseDown()

void PolygonTool::poly_pickOnMouseDown ( CPoint viewPt,
WbView * pView )
protected

Do the pick on poly triggers.

Definition at line 244 of file PolygonTool.cpp.

◆ poly_pickPoint()

Int PolygonTool::poly_pickPoint ( PolygonTrigger * pTrig,
CPoint viewPt,
WbView * pView )
staticprotected

Definition at line 178 of file PolygonTool.cpp.

◆ poly_pickPoly()

Bool PolygonTool::poly_pickPoly ( PolygonTrigger * pTrig,
Coord3D pLoc,
Int tolerance )
staticprotected

Definition at line 100 of file PolygonTool.cpp.

◆ poly_snapToPoly()

Bool PolygonTool::poly_snapToPoly ( Coord3D * pLoc)
protected

Definition at line 156 of file PolygonTool.cpp.

◆ setCursor()

void PolygonTool::setCursor ( void )
virtual

Set the cursor.

Reimplemented from Tool.

Reimplemented in PointerTool, and WaterTool.

Definition at line 393 of file PolygonTool.cpp.

◆ startMouseDown()

void PolygonTool::startMouseDown ( TTrackingMode m,
CPoint viewPt,
WbView * pView,
CWorldBuilderDoc * pDoc )
protected

Perform the tool behavior on mouse down.

Definition at line 291 of file PolygonTool.cpp.

Member Data Documentation

◆ m_poly_curSelectedPolygon

PolygonTrigger * PolygonTool::m_poly_curSelectedPolygon = NULL
staticprotected

Definition at line 60 of file PolygonTool.h.

◆ m_poly_dragPointNdx

Int PolygonTool::m_poly_dragPointNdx = -1
staticprotected

Definition at line 58 of file PolygonTool.h.

◆ m_poly_isActive

Bool PolygonTool::m_poly_isActive = false
staticprotected

Definition at line 59 of file PolygonTool.h.

◆ m_poly_isAdding

Bool PolygonTool::m_poly_isAdding = false
staticprotected

Definition at line 57 of file PolygonTool.h.

◆ m_poly_isDraggingPoint

Bool PolygonTool::m_poly_isDraggingPoint
protected

Definition at line 47 of file PolygonTool.h.

◆ m_poly_justPicked

Bool PolygonTool::m_poly_justPicked
protected

Definition at line 48 of file PolygonTool.h.

◆ m_poly_mouseDownPt

Coord3D PolygonTool::m_poly_mouseDownPt
protected

Definition at line 45 of file PolygonTool.h.

◆ m_poly_mouseUpMove

Bool PolygonTool::m_poly_mouseUpMove
protected

True if we are over the "move" hotspot.

Definition at line 52 of file PolygonTool.h.

◆ m_poly_mouseUpPlus

Bool PolygonTool::m_poly_mouseUpPlus
protected

True if we are over the "Add point" hotspot.

Definition at line 50 of file PolygonTool.h.

◆ m_poly_moveCursor

HCURSOR PolygonTool::m_poly_moveCursor
protected

Definition at line 53 of file PolygonTool.h.

◆ m_poly_moveUndoable

MovePolygonUndoable* PolygonTool::m_poly_moveUndoable
protected

Definition at line 55 of file PolygonTool.h.

◆ m_poly_plusCursor

HCURSOR PolygonTool::m_poly_plusCursor
protected

Definition at line 51 of file PolygonTool.h.

◆ m_poly_unsnappedMouseDownPt

Coord3D PolygonTool::m_poly_unsnappedMouseDownPt
protected

Definition at line 46 of file PolygonTool.h.


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