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

Height brush tool. More...

#include <MeshMoldTool.h>

Inherits Tool.

Public Member Functions

 MeshMoldTool (void)
 Constructor.
 
 ~MeshMoldTool (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)
 Track the mouse.
 
virtual WorldHeightMapEditgetHeightMap (void)
 
virtual void activate ()
 Become the current tool.
 
virtual void deactivate ()
 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)
 

Static Public Member Functions

static void apply (CWorldBuilderDoc *pDoc)
 Apply the mesh to the terrain & execute undoable.
 
static void updateMeshLocation (Bool changePreview)
 Update the mesh location onscreen.
 
- 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)
 

Static Protected Member Functions

static void applyMesh (CWorldBuilderDoc *pDoc)
 Apply the mesh to copy of terrain.
 

Protected Attributes

CPoint m_prevViewPt
 Previous tracking location in view coords.
 
Bool m_offsettingZ
 True if we are raising or lowering the mesh along z axis.
 
Coord3D m_prevDocPt
 Previous tracking location in doc coords.
 
- Protected Attributes inherited from Tool
Int m_toolID
 
Int m_cursorID
 
HCURSOR m_cursor
 
Int m_prevXIndex
 
Int m_prevYIndex
 

Static Protected Attributes

static Coord3D m_toolPos
 Current location of the mesh on the terrain.
 
static Bool m_tracking = false
 True if we are tracking a mesh on screen.
 
static WorldHeightMapEditm_htMapEditCopy = NULL
 ref counted.
 

Detailed Description

Height brush tool.

MeshMoldTool Does the Mesh Mold tool operation.

Definition at line 35 of file MeshMoldTool.h.

Constructor & Destructor Documentation

◆ MeshMoldTool()

MeshMoldTool::MeshMoldTool ( void )

Constructor.

Definition at line 47 of file MeshMoldTool.cpp.

◆ ~MeshMoldTool()

MeshMoldTool::~MeshMoldTool ( void )

Destructor.

Definition at line 54 of file MeshMoldTool.cpp.

Member Function Documentation

◆ activate()

void MeshMoldTool::activate ( )
virtual

Become the current tool.

Shows the mesh mold options panel.

Reimplemented from Tool.

Definition at line 61 of file MeshMoldTool.cpp.

◆ apply()

void MeshMoldTool::apply ( CWorldBuilderDoc * pDoc)
static

Apply the mesh to the terrain & execute undoable.

Apply the tool.

Apply the height mesh mold at the current point.

Definition at line 173 of file MeshMoldTool.cpp.

◆ applyMesh()

void MeshMoldTool::applyMesh ( CWorldBuilderDoc * pDoc)
staticprotected

Apply the mesh to copy of terrain.

Apply the tool.

Apply the height mesh mold at the current point.

Definition at line 185 of file MeshMoldTool.cpp.

◆ deactivate()

void MeshMoldTool::deactivate ( )
virtual

Become the current tool.

Shows the mesh mold options panel.

Reimplemented from Tool.

Definition at line 72 of file MeshMoldTool.cpp.

◆ followsTerrain()

virtual Bool MeshMoldTool::followsTerrain ( void )
inlinevirtual

Become not the current tool.

Reimplemented from Tool.

Definition at line 62 of file MeshMoldTool.h.

◆ getHeightMap()

virtual WorldHeightMapEdit * MeshMoldTool::getHeightMap ( void )
inlinevirtual

Reimplemented from Tool.

Definition at line 59 of file MeshMoldTool.h.

◆ mouseDown()

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

Start tool.

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

Reimplemented from Tool.

Definition at line 90 of file MeshMoldTool.cpp.

◆ mouseMoved()

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

Track the mouse.

Reimplemented from Tool.

Definition at line 124 of file MeshMoldTool.cpp.

◆ mouseUp()

void MeshMoldTool::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 117 of file MeshMoldTool.cpp.

◆ updateMeshLocation()

void MeshMoldTool::updateMeshLocation ( Bool changePreview)
static

Update the mesh location onscreen.

Definition at line 145 of file MeshMoldTool.cpp.

Member Data Documentation

◆ m_htMapEditCopy

WorldHeightMapEdit * MeshMoldTool::m_htMapEditCopy = NULL
staticprotected

ref counted.

Definition at line 44 of file MeshMoldTool.h.

◆ m_offsettingZ

Bool MeshMoldTool::m_offsettingZ
protected

True if we are raising or lowering the mesh along z axis.

Definition at line 40 of file MeshMoldTool.h.

◆ m_prevDocPt

Coord3D MeshMoldTool::m_prevDocPt
protected

Previous tracking location in doc coords.

Definition at line 41 of file MeshMoldTool.h.

◆ m_prevViewPt

CPoint MeshMoldTool::m_prevViewPt
protected

Previous tracking location in view coords.

Definition at line 39 of file MeshMoldTool.h.

◆ m_toolPos

Coord3D MeshMoldTool::m_toolPos
staticprotected

Current location of the mesh on the terrain.

Definition at line 42 of file MeshMoldTool.h.

◆ m_tracking

Bool MeshMoldTool::m_tracking = false
staticprotected

True if we are tracking a mesh on screen.

Definition at line 43 of file MeshMoldTool.h.


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