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

Add a grove of trees tool. More...

#include <GroveTool.h>

Inherits Tool.

Public Member Functions

 GroveTool (void)
 Constructor.
 
 ~GroveTool (void)
 Destructor.
 
virtual void mouseDown (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 Perform tool on mouse down.
 
virtual void mouseUp (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 
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.
 
- 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.
 
virtual WorldHeightMapEditgetHeightMap (void)
 

Protected Types

enum  { HYSTERESIS = 3 }
 

Protected Member Functions

void plantTree (Coord3D *pos)
 
void plantShrub (Coord3D *pos)
 
void plantGrove (Coord3D pos, Coord3D prevDir, Real baseHeight, Int level, CPoint bounds)
 
void _plantGroveInBox (CPoint tl, CPoint br, WbView *pView)
 
void addObj (Coord3D *pos, AsciiString name)
 
void activate ()
 Become the current tool.
 

Protected Attributes

CPoint m_downPt
 
Bool m_dragging
 
MapObjectm_headMapObj
 
- Protected Attributes inherited from Tool
Int m_toolID
 
Int m_cursorID
 
HCURSOR m_cursor
 
Int m_prevXIndex
 
Int m_prevYIndex
 

Additional Inherited Members

- 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)
 

Detailed Description

Add a grove of trees tool.

GroveTool Does the add a grove of trees tool operation.

Definition at line 37 of file GroveTool.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
HYSTERESIS 

Definition at line 40 of file GroveTool.h.

Constructor & Destructor Documentation

◆ GroveTool()

GroveTool::GroveTool ( void )

Constructor.

Definition at line 238 of file GroveTool.cpp.

◆ ~GroveTool()

GroveTool::~GroveTool ( void )

Destructor.

Definition at line 245 of file GroveTool.cpp.

Member Function Documentation

◆ _plantGroveInBox()

void GroveTool::_plantGroveInBox ( CPoint tl,
CPoint br,
WbView * pView )
protected

Definition at line 114 of file GroveTool.cpp.

◆ activate()

void GroveTool::activate ( )
protectedvirtual

Become the current tool.

Shows the "no options" options panel.

Reimplemented from Tool.

Definition at line 100 of file GroveTool.cpp.

◆ addObj()

void GroveTool::addObj ( Coord3D * pos,
AsciiString name )
protected

Definition at line 336 of file GroveTool.cpp.

◆ mouseDown()

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

Perform tool on mouse down.

Execute the tool on mouse down - Place an object.

Reimplemented from Tool.

Definition at line 253 of file GroveTool.cpp.

◆ mouseMoved()

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

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

Reimplemented from Tool.

Definition at line 312 of file GroveTool.cpp.

◆ mouseUp()

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

Execute the tool on mouse up - Place an object.

Reimplemented from Tool.

Definition at line 261 of file GroveTool.cpp.

◆ plantGrove()

void GroveTool::plantGrove ( Coord3D pos,
Coord3D prevDir,
Real baseHeight,
Int level,
CPoint bounds )
protected

Plant a grove of trees, recursively. Given a "seed location", create child trees nearby, and recursively call the grove function on those children.

Definition at line 169 of file GroveTool.cpp.

◆ plantShrub()

void GroveTool::plantShrub ( Coord3D * pos)
protected

Definition at line 108 of file GroveTool.cpp.

◆ plantTree()

void GroveTool::plantTree ( Coord3D * pos)
protected

Definition at line 77 of file GroveTool.cpp.

Member Data Documentation

◆ m_downPt

CPoint GroveTool::m_downPt
protected

Definition at line 41 of file GroveTool.h.

◆ m_dragging

Bool GroveTool::m_dragging
protected

Definition at line 42 of file GroveTool.h.

◆ m_headMapObj

MapObject* GroveTool::m_headMapObj
protected

Definition at line 43 of file GroveTool.h.


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