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

Road segment tool. More...

#include <RoadTool.h>

Inherits Tool.

Public Member Functions

 RoadTool (void)
 Constructor.
 
 ~RoadTool (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)
 
virtual void mouseUp (TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
 
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.
 
virtual WorldHeightMapEditgetHeightMap (void)
 

Static Public Member Functions

static Bool snap (Coord3D *pLoc, Bool skipLast)
 
- 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 Types

enum  { HYSTERESIS = 3 , MIN_LENGTH = 4 }
 

Protected Attributes

MapObjectm_mapObj
 
- Protected Attributes inherited from Tool
Int m_toolID
 
Int m_cursorID
 
HCURSOR m_cursor
 
Int m_prevXIndex
 
Int m_prevYIndex
 

Detailed Description

Road segment tool.

RoadTool Does the Add a section of road tool operation.

Definition at line 37 of file RoadTool.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
HYSTERESIS 
MIN_LENGTH 

Definition at line 40 of file RoadTool.h.

Constructor & Destructor Documentation

◆ RoadTool()

RoadTool::RoadTool ( void )

Constructor.

Definition at line 43 of file RoadTool.cpp.

◆ ~RoadTool()

RoadTool::~RoadTool ( void )

Destructor.

Definition at line 50 of file RoadTool.cpp.

Member Function Documentation

◆ activate()

void RoadTool::activate ( )
virtual

Become the current tool.

Shows the road options panel.

Reimplemented from Tool.

Definition at line 150 of file RoadTool.cpp.

◆ mouseDown()

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

Perform tool on mouse down.

Execute the tool on mouse up - Place a road segment.

Reimplemented from Tool.

Definition at line 159 of file RoadTool.cpp.

◆ mouseMoved()

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

Move the end of the road segment.

Reimplemented from Tool.

Definition at line 306 of file RoadTool.cpp.

◆ mouseUp()

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

Reimplemented from Tool.

Definition at line 336 of file RoadTool.cpp.

◆ snap()

Bool RoadTool::snap ( Coord3D * pLoc,
Bool skipFirst )
static

Snaps pLoc to another road endpoint if close enough.

Definition at line 105 of file RoadTool.cpp.

Member Data Documentation

◆ m_mapObj

MapObject* RoadTool::m_mapObj
protected

Definition at line 42 of file RoadTool.h.


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