Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Stg::BlockGroup Class Reference

#include <stage.hh>

Public Member Functions

 BlockGroup (Model &mod)
 
bounds3d_t BoundingBox () const
 
void DrawFootPrint (const Geom &geom)
 
const BlockGetBlock (unsigned int index) const
 
BlockGetBlockMutable (unsigned int index)
 
uint32_t GetCount () const
 
 ~BlockGroup ()
 

Public Attributes

Modelmod
 

Private Member Functions

void AppendBlock (const Block &block)
 
void AppendTouchingModels (std::set< Model *> &touchers)
 
void BuildDisplayList ()
 
void CalcSize ()
 
void CallDisplayList ()
 
void Clear ()
 
void DrawSolid (const Geom &geom)
 
void LoadBitmap (const std::string &bitmapfile, Worldfile *wf)
 
void LoadBlock (Worldfile *wf, int entity)
 
void Map (unsigned int layer)
 
void Rasterize (uint8_t *data, unsigned int width, unsigned int height, meters_t cellwidth, meters_t cellheight)
 
ModelTestCollision ()
 
void UnMap (unsigned int layer)
 

Private Attributes

std::vector< Blockblocks
 Contains the blocks in this group. More...
 
int displaylist
 OpenGL displaylist that renders this blockgroup. More...
 

Friends

class Block
 
class Model
 
class SuperRegion
 
class World
 

Detailed Description

Definition at line 1205 of file stage.hh.

Constructor & Destructor Documentation

◆ BlockGroup()

BlockGroup::BlockGroup ( Model mod)
explicit

Definition at line 13 of file blockgroup.cc.

◆ ~BlockGroup()

BlockGroup::~BlockGroup ( )

Definition at line 17 of file blockgroup.cc.

Member Function Documentation

◆ AppendBlock()

void BlockGroup::AppendBlock ( const Block block)
private

Definition at line 22 of file blockgroup.cc.

◆ AppendTouchingModels()

void BlockGroup::AppendTouchingModels ( std::set< Model *> &  touchers)
private

deletes all blocks from the group

Definition at line 35 of file blockgroup.cc.

◆ BoundingBox()

bounds3d_t BlockGroup::BoundingBox ( ) const

Return the extremal points of all member blocks in all three axes.

find the 3d bounding box of all the blocks in the group

Definition at line 53 of file blockgroup.cc.

◆ BuildDisplayList()

void BlockGroup::BuildDisplayList ( )
private

Re-create the display list for drawing this blockgroup. This is required whenever a member block or the owning model changes its appearance.

Definition at line 176 of file blockgroup.cc.

◆ CalcSize()

void BlockGroup::CalcSize ( )
private

Definition at line 83 of file blockgroup.cc.

◆ CallDisplayList()

void BlockGroup::CallDisplayList ( )
private

Draw the blockgroup from the cached displaylist.

Definition at line 278 of file blockgroup.cc.

◆ Clear()

void BlockGroup::Clear ( )
private

Definition at line 27 of file blockgroup.cc.

◆ DrawFootPrint()

void BlockGroup::DrawFootPrint ( const Geom geom)

Draw the projection of the block group onto the z=0 plane.

Definition at line 146 of file blockgroup.cc.

◆ DrawSolid()

void BlockGroup::DrawSolid ( const Geom geom)
private

Draw the block in OpenGL as a solid single color.

Definition at line 134 of file blockgroup.cc.

◆ GetBlock()

const Block& Stg::BlockGroup::GetBlock ( unsigned int  index) const
inline

Definition at line 1262 of file stage.hh.

◆ GetBlockMutable()

Block& Stg::BlockGroup::GetBlockMutable ( unsigned int  index)
inline

Definition at line 1263 of file stage.hh.

◆ GetCount()

uint32_t Stg::BlockGroup::GetCount ( ) const
inline

Definition at line 1261 of file stage.hh.

◆ LoadBitmap()

void BlockGroup::LoadBitmap ( const std::string &  bitmapfile,
Worldfile wf 
)
private

Interpret the bitmap file as a set of rectangles and add them as blocks to this group.

Definition at line 294 of file blockgroup.cc.

◆ LoadBlock()

void BlockGroup::LoadBlock ( Worldfile wf,
int  entity 
)
private

Add a new block decribed by a worldfile entry.

Definition at line 288 of file blockgroup.cc.

◆ Map()

void BlockGroup::Map ( unsigned int  layer)
private

Renders all blocks into the bitmap at the indicated layer.

Definition at line 114 of file blockgroup.cc.

◆ Rasterize()

void BlockGroup::Rasterize ( uint8_t *  data,
unsigned int  width,
unsigned int  height,
meters_t  cellwidth,
meters_t  cellheight 
)
private

Render the blockgroup as a bitmap image.

Definition at line 332 of file blockgroup.cc.

◆ TestCollision()

Model * BlockGroup::TestCollision ( )
private

Returns a pointer to the first model detected to be colliding with a block in this group, or NULL, if none are detected.

Definition at line 41 of file blockgroup.cc.

◆ UnMap()

void BlockGroup::UnMap ( unsigned int  layer)
private

Removes all blocks from the bitmap at the indicated layer.

Definition at line 123 of file blockgroup.cc.

Friends And Related Function Documentation

◆ Block

friend class Block
friend

Definition at line 1207 of file stage.hh.

◆ Model

friend class Model
friend

Definition at line 1206 of file stage.hh.

◆ SuperRegion

friend class SuperRegion
friend

Definition at line 1209 of file stage.hh.

◆ World

friend class World
friend

Definition at line 1208 of file stage.hh.

Member Data Documentation

◆ blocks

std::vector<Block> Stg::BlockGroup::blocks
private

Contains the blocks in this group.

Definition at line 1212 of file stage.hh.

◆ displaylist

int Stg::BlockGroup::displaylist
private

OpenGL displaylist that renders this blockgroup.

Definition at line 1213 of file stage.hh.

◆ mod

Model& Stg::BlockGroup::mod

Definition at line 1216 of file stage.hh.


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


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Feb 28 2022 23:48:56