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

Height brush tool. More...

#include <BrushTool.h>

Inherits Tool.

Public Member Functions

 BrushTool (void)
 Constructor.
 
 ~BrushTool (void)
 Destructor.
 
virtual void mouseDown (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 Start tool.
 
virtual void mouseUp (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 End tool.
 
virtual void mouseMoved (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 Execute the tool.
 
virtual WorldHeightMapEditgetHeightMap (void)
 
virtual void activate ()
 Become the current tool.
 
virtual Bool followsTerrain (void)
 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 void setCursor (void)
 
virtual void deactivate ()
 

Static Public Member Functions

static Int getWidth (void)
 
static Int getFeather (void)
 Returns width.
 
static Int getHeight (void)
 Returns feather.
 
static void setWidth (Int width)
 Returns height.
 
static void setFeather (Int feather)
 Set the brush feather and notify the height options panel of the change.
 
static void setHeight (Int height)
 Set the brush height and notify the height options panel of the change.
 
- 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 Attributes

WorldHeightMapEditm_htMapEditCopy
 ref counted.
 
WorldHeightMapEditm_htMapFeatherCopy
 ref counted.
 
- Protected Attributes inherited from Tool
Int m_toolID
 
Int m_cursorID
 
HCURSOR m_cursor
 
Int m_prevXIndex
 
Int m_prevYIndex
 

Static Protected Attributes

static Int m_brushWidth
 
static Int m_brushFeather
 
static Bool m_brushSquare
 
static Int m_brushHeight
 

Detailed Description

Height brush tool.

BrushTool Does the Height Brush tool operation.

Definition at line 35 of file BrushTool.h.

Constructor & Destructor Documentation

◆ BrushTool()

BrushTool::BrushTool ( void )

Constructor.

Definition at line 46 of file BrushTool.cpp.

◆ ~BrushTool()

BrushTool::~BrushTool ( void )

Destructor.

Definition at line 59 of file BrushTool.cpp.

Member Function Documentation

◆ activate()

void BrushTool::activate ( )
virtual

Become the current tool.

Shows the brush options panel.

Reimplemented from Tool.

Definition at line 98 of file BrushTool.cpp.

◆ followsTerrain()

virtual Bool BrushTool::followsTerrain ( void )
inlinevirtual

Become not the current tool.

Reimplemented from Tool.

Definition at line 64 of file BrushTool.h.

◆ getFeather()

static Int BrushTool::getFeather ( void )
inlinestatic

Returns width.

Definition at line 52 of file BrushTool.h.

◆ getHeight()

static Int BrushTool::getHeight ( void )
inlinestatic

Returns feather.

Definition at line 53 of file BrushTool.h.

◆ getHeightMap()

virtual WorldHeightMapEdit * BrushTool::getHeightMap ( void )
inlinevirtual

Reimplemented from Tool.

Definition at line 62 of file BrushTool.h.

◆ getWidth()

static Int BrushTool::getWidth ( void )
inlinestatic

Definition at line 51 of file BrushTool.h.

◆ mouseDown()

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

Start tool.

Setup the tool to start brushing - make a copy of the height map to edit, another copy because we need it :), and call mouseMovedDown.

Reimplemented from Tool.

Definition at line 108 of file BrushTool.cpp.

◆ mouseMoved()

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

Execute the tool.

Apply the height brush at the current point.

Reimplemented from Tool.

Definition at line 139 of file BrushTool.cpp.

◆ mouseUp()

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

End tool.

Finish the tool operation - create a command, pass it to the doc to execute, and cleanup ref'd objects.

Reimplemented from Tool.

Definition at line 126 of file BrushTool.cpp.

◆ setFeather()

void BrushTool::setFeather ( Int feather)
static

Set the brush feather and notify the height options panel of the change.

Definition at line 87 of file BrushTool.cpp.

◆ setHeight()

void BrushTool::setHeight ( Int height)
static

Set the brush height and notify the height options panel of the change.

Definition at line 66 of file BrushTool.cpp.

◆ setWidth()

void BrushTool::setWidth ( Int width)
static

Returns height.

Set the brush width and notify the height options panel of the change.

Definition at line 76 of file BrushTool.cpp.

Member Data Documentation

◆ m_brushFeather

Int BrushTool::m_brushFeather
staticprotected

Definition at line 42 of file BrushTool.h.

◆ m_brushHeight

Int BrushTool::m_brushHeight
staticprotected

Definition at line 44 of file BrushTool.h.

◆ m_brushSquare

Bool BrushTool::m_brushSquare
staticprotected

Definition at line 43 of file BrushTool.h.

◆ m_brushWidth

Int BrushTool::m_brushWidth
staticprotected

Definition at line 41 of file BrushTool.h.

◆ m_htMapEditCopy

WorldHeightMapEdit* BrushTool::m_htMapEditCopy
protected

ref counted.

Definition at line 38 of file BrushTool.h.

◆ m_htMapFeatherCopy

WorldHeightMapEdit* BrushTool::m_htMapFeatherCopy
protected

ref counted.

Definition at line 39 of file BrushTool.h.


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