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

smooth height map tool. More...

#include <FeatherTool.h>

Inherits Tool.

Public Member Functions

 FeatherTool (void)
 Constructor.
 
 ~FeatherTool (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.
 
- 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 ()
 
virtual Bool followsTerrain (void)
 Become not the current tool.
 

Static Public Member Functions

static void setFeather (Int feather)
 Set the brush feather and notify the height options panel of the change.
 
static void setRate (Int rate)
 Set the brush feather and notify the height options panel of the change.
 
static void setRadius (Int Radius)
 Set the brush feather 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
 
WorldHeightMapEditm_htMapFeatherCopy
 
WorldHeightMapEditm_htMapRateCopy
 
- 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_feather = 0
 
static Int m_rate = 0
 
static Int m_radius = 0
 

Detailed Description

smooth height map tool.

FeatherTool Does the smooth height map tool operation.

Definition at line 35 of file FeatherTool.h.

Constructor & Destructor Documentation

◆ FeatherTool()

FeatherTool::FeatherTool ( void )

Constructor.

Definition at line 42 of file FeatherTool.cpp.

◆ ~FeatherTool()

FeatherTool::~FeatherTool ( void )

Destructor.

Definition at line 51 of file FeatherTool.cpp.

Member Function Documentation

◆ activate()

void FeatherTool::activate ( )
virtual

Become the current tool.

Shows the brush options panel.

Reimplemented from Tool.

Definition at line 61 of file FeatherTool.cpp.

◆ getHeightMap()

virtual WorldHeightMapEdit * FeatherTool::getHeightMap ( void )
inlinevirtual

Reimplemented from Tool.

Definition at line 56 of file FeatherTool.h.

◆ mouseDown()

void FeatherTool::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 102 of file FeatherTool.cpp.

◆ mouseMoved()

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

Execute the tool.

Smooth the height map at the current point.

Reimplemented from Tool.

Definition at line 140 of file FeatherTool.cpp.

◆ mouseUp()

void FeatherTool::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 FeatherTool.cpp.

◆ setFeather()

void FeatherTool::setFeather ( Int feather)
static

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

Definition at line 69 of file FeatherTool.cpp.

◆ setRadius()

void FeatherTool::setRadius ( Int Radius)
static

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

Definition at line 90 of file FeatherTool.cpp.

◆ setRate()

void FeatherTool::setRate ( Int rate)
static

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

Definition at line 80 of file FeatherTool.cpp.

Member Data Documentation

◆ m_feather

Int FeatherTool::m_feather = 0
staticprotected

Definition at line 42 of file FeatherTool.h.

◆ m_htMapEditCopy

WorldHeightMapEdit* FeatherTool::m_htMapEditCopy
protected

Definition at line 38 of file FeatherTool.h.

◆ m_htMapFeatherCopy

WorldHeightMapEdit* FeatherTool::m_htMapFeatherCopy
protected

Definition at line 39 of file FeatherTool.h.

◆ m_htMapRateCopy

WorldHeightMapEdit* FeatherTool::m_htMapRateCopy
protected

Definition at line 40 of file FeatherTool.h.

◆ m_radius

Int FeatherTool::m_radius = 0
staticprotected

Definition at line 44 of file FeatherTool.h.

◆ m_rate

Int FeatherTool::m_rate = 0
staticprotected

Definition at line 43 of file FeatherTool.h.


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