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

#include <PolygonTrigger.h>

Inherits MemoryPoolObject, and Snapshot.

Public Member Functions

 PolygonTrigger (Int initialAllocation)
 
void setNextPoly (PolygonTrigger *nextPoly)
 Link the next map object.
 
void addPoint (const ICoord3D &point)
 
void setPoint (const ICoord3D &point, Int ndx)
 
void insertPoint (const ICoord3D &point, Int ndx)
 
void deletePoint (Int ndx)
 
void setTriggerName (AsciiString name)
 
void setLayerName (AsciiString name)
 
AsciiString getLayerName (void) const
 
void setShouldRender (Bool toggle)
 
Bool getShouldRender ()
 
void setSelected (Bool toggle)
 
Bool getSelected ()
 
void getCenterPoint (Coord3D *pOutCoord) const
 
Real getRadius (void) const
 
const ICoord3DgetPoint (Int ndx) const
 Get a point.
 
Int getNumPoints (void) const
 
Int getID (void) const
 
PolygonTriggergetNext (void)
 
const PolygonTriggergetNext (void) const
 
AsciiString getTriggerName (void) const
 Gets the trigger name.
 
Bool pointInTrigger (ICoord3D &point) const
 
Bool doExportWithScripts (void) const
 
void setDoExportWithScripts (Bool val)
 
Bool isWaterArea (void) const
 
void setWaterArea (Bool val)
 
Bool isRiver (void) const
 
void setRiver (Bool val)
 
Int getRiverStart (void) const
 
void setRiverStart (Int val)
 
const WaterHandlegetWaterHandle (void) const
 
Bool isValid (void) const
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static PolygonTriggergetFirstPolygonTrigger (void)
 
static PolygonTriggergetPolygonTriggerByID (Int triggerID)
 
static Bool ParsePolygonTriggersDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static void WritePolygonTriggersDataChunk (DataChunkOutput &chunkWriter)
 Writes Triggers Info.
 
static void deleteTriggers (void)
 
static void addPolygonTrigger (PolygonTrigger *pTrigger)
 
static void removePolygonTrigger (PolygonTrigger *pTrigger)
 

Protected Member Functions

void reallocate (void)
 
void updateBounds (void) const
 
virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Protected Attributes

PolygonTriggerm_nextPolygonTrigger
 linked list.
 
AsciiString m_triggerName
 The name of this polygon area.
 
Int m_triggerID
 Unique int id for the trigger.
 
WaterHandle m_waterHandle
 handle to use this polygon as a water table
 
ICoord3Dm_points
 Points that are the polygon.
 
Int m_numPoints
 Num points in m_points.
 
Int m_sizePoints
 Space allocated for m_points.
 
IRegion2D m_bounds
 2D bounding box for quick checks.
 
Real m_radius
 
Int m_riverStart
 Identifies the start point of the river.
 
Bool m_boundsNeedsUpdate
 
Bool m_exportWithScripts
 
Bool m_isWaterArea
 Used to specify water areas in the map.
 
Bool m_isRiver
 Used to specify that a water area is a river.
 
AsciiString m_layerName
 Used to specify the layer in the World Builder.
 
Bool m_shouldRender
 
Bool m_selected
 

Static Protected Attributes

static PolygonTriggerThePolygonTriggerListPtr = NULL
 
static Int s_currentID = 1
 Current id for new triggers.
 

Detailed Description

Definition at line 67 of file PolygonTrigger.h.

Constructor & Destructor Documentation

◆ PolygonTrigger()

PolygonTrigger::PolygonTrigger ( Int initialAllocation)

PolygonTrigger - Constructor.

Definition at line 44 of file PolygonTrigger.cpp.

Member Function Documentation

◆ addPoint()

void PolygonTrigger::addPoint ( const ICoord3D & point)

PolygonTrigger::addPoint adds a point at the end of the polygon. NOTE: It is expected that this will only get called in the editor, as in the game the poly triggers don't change.

Definition at line 346 of file PolygonTrigger.cpp.

◆ addPolygonTrigger()

void PolygonTrigger::addPolygonTrigger ( PolygonTrigger * pTrigger)
static

PolygonTrigger::addPolygonTrigger adds a trigger to the list of triggers.

Definition at line 296 of file PolygonTrigger.cpp.

◆ crc()

void PolygonTrigger::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 508 of file PolygonTrigger.cpp.

◆ deletePoint()

void PolygonTrigger::deletePoint ( Int ndx)

PolygonTrigger::deletePoint . NOTE: It is expected that this will only get called in the editor, as in the game the poly triggers don't change.

Definition at line 407 of file PolygonTrigger.cpp.

◆ deleteTriggers()

void PolygonTrigger::deleteTriggers ( void )
static

PolygonTrigger::deleteTriggers Deletes list of triggers.

Definition at line 333 of file PolygonTrigger.cpp.

◆ doExportWithScripts()

Bool PolygonTrigger::doExportWithScripts ( void ) const
inline

Definition at line 145 of file PolygonTrigger.h.

◆ getCenterPoint()

void PolygonTrigger::getCenterPoint ( Coord3D * pOutCoord) const

Definition at line 419 of file PolygonTrigger.cpp.

◆ getFirstPolygonTrigger()

static PolygonTrigger * PolygonTrigger::getFirstPolygonTrigger ( void )
inlinestatic

Definition at line 108 of file PolygonTrigger.h.

◆ getID()

Int PolygonTrigger::getID ( void ) const
inline

Definition at line 140 of file PolygonTrigger.h.

◆ getLayerName()

AsciiString PolygonTrigger::getLayerName ( void ) const
inline

Definition at line 126 of file PolygonTrigger.h.

◆ getNext() [1/2]

PolygonTrigger * PolygonTrigger::getNext ( void )
inline

Definition at line 141 of file PolygonTrigger.h.

◆ getNext() [2/2]

const PolygonTrigger * PolygonTrigger::getNext ( void ) const
inline

Definition at line 142 of file PolygonTrigger.h.

◆ getNumPoints()

Int PolygonTrigger::getNumPoints ( void ) const
inline

Definition at line 139 of file PolygonTrigger.h.

◆ getPoint()

const ICoord3D * PolygonTrigger::getPoint ( Int ndx) const
inline

Get a point.

Definition at line 138 of file PolygonTrigger.h.

◆ getPolygonTriggerByID()

PolygonTrigger * PolygonTrigger::getPolygonTriggerByID ( Int triggerID)
static

Find the polygon trigger with the matching ID

Definition at line 115 of file PolygonTrigger.cpp.

◆ getRadius()

Real PolygonTrigger::getRadius ( void ) const

Definition at line 435 of file PolygonTrigger.cpp.

◆ getRiverStart()

Int PolygonTrigger::getRiverStart ( void ) const
inline

Definition at line 151 of file PolygonTrigger.h.

◆ getSelected()

Bool PolygonTrigger::getSelected ( )
inline

Definition at line 132 of file PolygonTrigger.h.

◆ getShouldRender()

Bool PolygonTrigger::getShouldRender ( )
inline

Definition at line 129 of file PolygonTrigger.h.

◆ getTriggerName()

AsciiString PolygonTrigger::getTriggerName ( void ) const
inline

Gets the trigger name.

Definition at line 143 of file PolygonTrigger.h.

◆ getWaterHandle()

const WaterHandle * PolygonTrigger::getWaterHandle ( void ) const

Definition at line 486 of file PolygonTrigger.cpp.

◆ insertPoint()

void PolygonTrigger::insertPoint ( const ICoord3D & point,
Int ndx )

PolygonTrigger::insertPoint . NOTE: It is expected that this will only get called in the editor, as in the game the poly triggers don't change.

Definition at line 382 of file PolygonTrigger.cpp.

◆ isRiver()

Bool PolygonTrigger::isRiver ( void ) const
inline

Definition at line 149 of file PolygonTrigger.h.

◆ isValid()

Bool PolygonTrigger::isValid ( void ) const

Definition at line 496 of file PolygonTrigger.cpp.

◆ isWaterArea()

Bool PolygonTrigger::isWaterArea ( void ) const
inline

Definition at line 147 of file PolygonTrigger.h.

◆ loadPostProcess()

void PolygonTrigger::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 556 of file PolygonTrigger.cpp.

◆ ParsePolygonTriggersDataChunk()

Bool PolygonTrigger::ParsePolygonTriggersDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
static

PolygonTrigger::ParsePolygonTriggersDataChunk - read a polygon triggers chunk. Format is the newer CHUNKY format. See PolygonTrigger::WritePolygonTriggersDataChunk for the writer. Input: DataChunkInput

Definition at line 135 of file PolygonTrigger.cpp.

◆ pointInTrigger()

Bool PolygonTrigger::pointInTrigger ( ICoord3D & point) const

PolygonTrigger - pointInTrigger.

Definition at line 447 of file PolygonTrigger.cpp.

◆ reallocate()

void PolygonTrigger::reallocate ( void )
protected

PolygonTrigger::reallocate - increases the size of the points list. NOTE: It is expected that this will only get called in the editor, as in the game the poly triggers don't change.

Definition at line 96 of file PolygonTrigger.cpp.

◆ removePolygonTrigger()

void PolygonTrigger::removePolygonTrigger ( PolygonTrigger * pTrigger)
static

PolygonTrigger::removePolygonTrigger removes a trigger to the list of triggers. note - does NOT delete pTrigger.

Definition at line 310 of file PolygonTrigger.cpp.

◆ setDoExportWithScripts()

void PolygonTrigger::setDoExportWithScripts ( Bool val)
inline

Definition at line 146 of file PolygonTrigger.h.

◆ setLayerName()

void PolygonTrigger::setLayerName ( AsciiString name)
inline

Definition at line 125 of file PolygonTrigger.h.

◆ setNextPoly()

void PolygonTrigger::setNextPoly ( PolygonTrigger * nextPoly)
inline

Link the next map object.

Definition at line 118 of file PolygonTrigger.h.

◆ setPoint()

void PolygonTrigger::setPoint ( const ICoord3D & point,
Int ndx )

PolygonTrigger::setPoint sets the point at index ndx. NOTE: It is expected that this will only get called in the editor, as in the game the poly triggers don't change.

Definition at line 362 of file PolygonTrigger.cpp.

◆ setRiver()

void PolygonTrigger::setRiver ( Bool val)
inline

Definition at line 150 of file PolygonTrigger.h.

◆ setRiverStart()

void PolygonTrigger::setRiverStart ( Int val)
inline

Definition at line 152 of file PolygonTrigger.h.

◆ setSelected()

void PolygonTrigger::setSelected ( Bool toggle)
inline

Definition at line 131 of file PolygonTrigger.h.

◆ setShouldRender()

void PolygonTrigger::setShouldRender ( Bool toggle)
inline

Definition at line 128 of file PolygonTrigger.h.

◆ setTriggerName()

void PolygonTrigger::setTriggerName ( AsciiString name)
inline

Definition at line 123 of file PolygonTrigger.h.

◆ setWaterArea()

void PolygonTrigger::setWaterArea ( Bool val)
inline

Definition at line 148 of file PolygonTrigger.h.

◆ updateBounds()

void PolygonTrigger::updateBounds ( void ) const
protected

PolygonTrigger::updateBounds - Updates the bounds.

Definition at line 273 of file PolygonTrigger.cpp.

◆ WritePolygonTriggersDataChunk()

void PolygonTrigger::WritePolygonTriggersDataChunk ( DataChunkOutput & chunkWriter)
static

Writes Triggers Info.

PolygonTrigger::WritePolygonTriggersDataChunk - Writes a Polygon triggers chunk. Format is the newer CHUNKY format. See PolygonTrigger::ParsePolygonTriggersDataChunk for the reader. Input: DataChunkInput

Definition at line 240 of file PolygonTrigger.cpp.

◆ xfer()

void PolygonTrigger::xfer ( Xfer * xfer)
protectedvirtual

Xfer method Version Info: 1: Initial version

Implements Snapshot.

Definition at line 518 of file PolygonTrigger.cpp.

Member Data Documentation

◆ m_bounds

IRegion2D PolygonTrigger::m_bounds
mutableprotected

2D bounding box for quick checks.

Definition at line 80 of file PolygonTrigger.h.

◆ m_boundsNeedsUpdate

Bool PolygonTrigger::m_boundsNeedsUpdate
mutableprotected

Definition at line 83 of file PolygonTrigger.h.

◆ m_exportWithScripts

Bool PolygonTrigger::m_exportWithScripts
protected

Definition at line 84 of file PolygonTrigger.h.

◆ m_isRiver

Bool PolygonTrigger::m_isRiver
protected

Used to specify that a water area is a river.

Definition at line 86 of file PolygonTrigger.h.

◆ m_isWaterArea

Bool PolygonTrigger::m_isWaterArea
protected

Used to specify water areas in the map.

Definition at line 85 of file PolygonTrigger.h.

◆ m_layerName

AsciiString PolygonTrigger::m_layerName
protected

Used to specify the layer in the World Builder.

Definition at line 87 of file PolygonTrigger.h.

◆ m_nextPolygonTrigger

PolygonTrigger* PolygonTrigger::m_nextPolygonTrigger
protected

linked list.

Definition at line 73 of file PolygonTrigger.h.

◆ m_numPoints

Int PolygonTrigger::m_numPoints
protected

Num points in m_points.

Definition at line 78 of file PolygonTrigger.h.

◆ m_points

ICoord3D* PolygonTrigger::m_points
protected

Points that are the polygon.

Definition at line 77 of file PolygonTrigger.h.

◆ m_radius

Real PolygonTrigger::m_radius
mutableprotected

Definition at line 81 of file PolygonTrigger.h.

◆ m_riverStart

Int PolygonTrigger::m_riverStart
protected

Identifies the start point of the river.

Definition at line 82 of file PolygonTrigger.h.

◆ m_selected

Bool PolygonTrigger::m_selected
protected

Definition at line 89 of file PolygonTrigger.h.

◆ m_shouldRender

Bool PolygonTrigger::m_shouldRender
protected

Definition at line 88 of file PolygonTrigger.h.

◆ m_sizePoints

Int PolygonTrigger::m_sizePoints
protected

Space allocated for m_points.

Definition at line 79 of file PolygonTrigger.h.

◆ m_triggerID

Int PolygonTrigger::m_triggerID
protected

Unique int id for the trigger.

Definition at line 75 of file PolygonTrigger.h.

◆ m_triggerName

AsciiString PolygonTrigger::m_triggerName
protected

The name of this polygon area.

Definition at line 74 of file PolygonTrigger.h.

◆ m_waterHandle

WaterHandle PolygonTrigger::m_waterHandle
protected

handle to use this polygon as a water table

Definition at line 76 of file PolygonTrigger.h.

◆ s_currentID

Int PolygonTrigger::s_currentID = 1
staticprotected

Current id for new triggers.

Definition at line 92 of file PolygonTrigger.h.

◆ ThePolygonTriggerListPtr

PolygonTrigger * PolygonTrigger::ThePolygonTriggerListPtr = NULL
staticprotected

Definition at line 91 of file PolygonTrigger.h.


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