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

#include <Tool.h>

Inherited by AutoEdgeOutTool, BlendEdgeTool, BorderTool, BrushTool, BuildListTool, EyedropperTool, FeatherTool, FenceTool, FloodFillTool, GroveTool, HandScrollTool, MeshMoldTool, MoundTool, ObjectTool, PolygonTool, RampTool, RoadTool, RulerTool, ScorchTool, TileTool, and WaypointTool.

Public Member Functions

 Tool (Int toolID, Int cursorID)
 Tool class.
 
virtual ~Tool (void)
 Destructor.
 
Int getToolID (void)
 
virtual void setCursor (void)
 
virtual void activate ()
 Become the current tool.
 
virtual void deactivate ()
 
virtual Bool followsTerrain (void)
 Become not the current tool.
 
virtual void mouseMoved (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 True if the tool tracks the terrain, generally false if it modifies the terrain heights.
 
virtual void mouseDown (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 
virtual void mouseUp (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 
virtual WorldHeightMapEditgetHeightMap (void)
 

Static Public Member Functions

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 Attributes

Int m_toolID
 
Int m_cursorID
 
HCURSOR m_cursor
 
Int m_prevXIndex
 
Int m_prevYIndex
 

Detailed Description

Definition at line 56 of file Tool.h.

Constructor & Destructor Documentation

◆ Tool()

Tool::Tool ( Int toolID,
Int cursorID )

Tool class.

Constructor

Definition at line 35 of file Tool.cpp.

◆ ~Tool()

Tool::~Tool ( void )
virtual

Destructor.

Definition at line 44 of file Tool.cpp.

Member Function Documentation

◆ activate()

void Tool::activate ( )
virtual

◆ calcRoundBlendFactor()

Real Tool::calcRoundBlendFactor ( CPoint center,
Int x,
Int y,
Int brushWidth,
Int featherWidth )
static

Calculate the round blend factor.

Calculates the blend amount of the brush. 1.0 means the brush sets the height, 0.0 means no change, and between blends proportionally.

Definition at line 71 of file Tool.cpp.

◆ calcSquareBlendFactor()

Real Tool::calcSquareBlendFactor ( CPoint center,
Int x,
Int y,
Int brushWidth,
Int featherWidth )
static

Calculate the square blend factor.

Calculates the blend amount of the brush. 1.0 means the brush sets the height, 0.0 means no change, and between blends proportionally.

Definition at line 100 of file Tool.cpp.

◆ deactivate()

virtual void Tool::deactivate ( )
inlinevirtual

◆ followsTerrain()

virtual Bool Tool::followsTerrain ( void )
inlinevirtual

Become not the current tool.

Reimplemented in BorderTool, BrushTool, HandScrollTool, MeshMoldTool, RampTool, and RulerTool.

Definition at line 76 of file Tool.h.

◆ getAllIndexesIn()

void Tool::getAllIndexesIn ( const Coord3D * bl,
const Coord3D * br,
const Coord3D * tl,
const Coord3D * tr,
Int widthOutside,
CWorldBuilderDoc * pDoc,
VecHeightMapIndexes * allIndices )
static

Definition at line 141 of file Tool.cpp.

◆ getCenterIndex()

void Tool::getCenterIndex ( Coord3D * docLocP,
Int brushWidth,
CPoint * center,
CWorldBuilderDoc * pDoc )
static

Gets the cell index for the center of the brush.

Converts from document coordinates to cell index coordinates.

Definition at line 128 of file Tool.cpp.

◆ getHeightMap()

virtual WorldHeightMapEdit * Tool::getHeightMap ( void )
inlinevirtual

Reimplemented in BrushTool, FeatherTool, MeshMoldTool, MoundTool, and TileTool.

Definition at line 81 of file Tool.h.

◆ getToolID()

Int Tool::getToolID ( void )
inline

Definition at line 70 of file Tool.h.

◆ mouseDown()

◆ mouseMoved()

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

True if the tool tracks the terrain, generally false if it modifies the terrain heights.

Reimplemented in BorderTool, BrushTool, BuildListTool, FeatherTool, FenceTool, GroveTool, HandScrollTool, MeshMoldTool, MoundTool, ObjectTool, PointerTool, PolygonTool, RampTool, RoadTool, RulerTool, ScorchTool, TileTool, WaterTool, and WaypointTool.

Definition at line 78 of file Tool.h.

◆ mouseUp()

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

◆ setCursor()

void Tool::setCursor ( void )
virtual

Reimplemented in BorderTool, BuildListTool, FloodFillTool, PointerTool, PolygonTool, RulerTool, and WaterTool.

Definition at line 60 of file Tool.cpp.

Member Data Documentation

◆ m_cursor

HCURSOR Tool::m_cursor
protected

Definition at line 61 of file Tool.h.

◆ m_cursorID

Int Tool::m_cursorID
protected

Definition at line 60 of file Tool.h.

◆ m_prevXIndex

Int Tool::m_prevXIndex
protected

Definition at line 63 of file Tool.h.

◆ m_prevYIndex

Int Tool::m_prevYIndex
protected

Definition at line 64 of file Tool.h.

◆ m_toolID

Int Tool::m_toolID
protected

Definition at line 59 of file Tool.h.


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