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

#include <stage.hh>

Public Member Functions

void AppendTouchingModels (std::set< Model * > &touchers)
 
 Block (Model *mod, const std::vector< point_t > &pts, meters_t zmin, meters_t zmax, Color color, bool inherit_color, bool wheel)
 
 Block (Model *mod, Worldfile *wf, int entity)
 
double CenterX ()
 
double CenterY ()
 
void DrawFootPrint ()
 
void DrawSolid (bool topview)
 
const ColorGetColor ()
 
ModelGetModel ()
 
void Load (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)
 
void SetCenter (double x, double y)
 
void SetCenterX (double y)
 
void SetCenterY (double y)
 
void SetZ (double min, double max)
 
ModelTestCollision ()
 
void Translate (double x, double y)
 
void UnMap (unsigned int layer)
 
 ~Block ()
 

Private Member Functions

point_t BlockPointToModelMeters (const point_t &bpt)
 
void DrawSides ()
 
void DrawTop ()
 
void InvalidateModelPointCache ()
 

Private Attributes

Color color
 
Bounds global_z
 
bool inherit_color
 
std::vector< std::list< Block * >::iterator > list_entries
 
Bounds local_z
 z extent in local coords More...
 
bool mapped
 
Modelmod
 model to which this block belongs More...
 
std::vector< point_tmpts
 cache of this->pts in model coordindates More...
 
size_t pt_count
 the number of points More...
 
std::vector< point_tpts
 points defining a polygonx More...
 
std::vector< Cell * > rendered_cells [2]
 
Size size
 
bool wheel
 

Friends

class BlockGroup
 
class Canvas
 
class Cell
 
class Model
 
class SuperRegion
 
class World
 

Detailed Description

Definition at line 1197 of file stage.hh.

Constructor & Destructor Documentation

Block::Block ( Model mod,
const std::vector< point_t > &  pts,
meters_t  zmin,
meters_t  zmax,
Color  color,
bool  inherit_color,
bool  wheel 
)

Block Constructor. A model's body is a list of these blocks. The point data is copied, so pts can safely be freed after constructing the block.

Create a new block. A model's body is a list of these blocks. The point data is copied, so pts can safely be freed after calling this.

Definition at line 13 of file block.cc.

Block::Block ( Model mod,
Worldfile wf,
int  entity 
)

A from-file constructor

Definition at line 34 of file block.cc.

Block::~Block ( )

Definition at line 54 of file block.cc.

Member Function Documentation

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

Definition at line 139 of file block.cc.

point_t Block::BlockPointToModelMeters ( const point_t bpt)
inlineprivate

find the position of a block's point in model coordinates (m)

Definition at line 240 of file block.cc.

double Block::CenterX ( )

Return the center of the block on the X axis

Definition at line 89 of file block.cc.

double Block::CenterY ( )

Return the center of the block on the Y axis

Definition at line 74 of file block.cc.

void Block::DrawFootPrint ( )

draw the projection of the block onto the z=0 plane

Definition at line 360 of file block.cc.

void Block::DrawSides ( )
private

Definition at line 344 of file block.cc.

void Block::DrawSolid ( bool  topview)

draw the block in OpenGL as a solid single color

Definition at line 368 of file block.cc.

void Block::DrawTop ( )
private

Definition at line 334 of file block.cc.

const Color & Block::GetColor ( )

Definition at line 134 of file block.cc.

Model* Stg::Block::GetModel ( )
inline

Definition at line 1262 of file stage.hh.

void Block::InvalidateModelPointCache ( )
private

invalidate the cache of points in model coordinates

Definition at line 249 of file block.cc.

void Block::Load ( Worldfile wf,
int  entity 
)

Definition at line 396 of file block.cc.

void Block::Map ( unsigned int  layer)

render the block into the world's raytrace data structure

Definition at line 197 of file block.cc.

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

Definition at line 262 of file block.cc.

void Block::SetCenter ( double  x,
double  y 
)

Set the center of the block

Definition at line 104 of file block.cc.

void Block::SetCenterX ( double  y)

Set the center of the block on the X axis

Definition at line 118 of file block.cc.

void Block::SetCenterY ( double  y)

Set the center of the block on the Y axis

Definition at line 111 of file block.cc.

void Block::SetZ ( double  min,
double  max 
)

Set the extent in Z of the block

Definition at line 125 of file block.cc.

Model * Block::TestCollision ( )

Returns the first model that shares a bitmap cell with this model

Definition at line 153 of file block.cc.

void Block::Translate ( double  x,
double  y 
)

Translate all points in the block by the indicated amounts

Definition at line 63 of file block.cc.

void Block::UnMap ( unsigned int  layer)

remove the block from the world's raytracing data structure

Definition at line 231 of file block.cc.

Friends And Related Function Documentation

friend class BlockGroup
friend

Definition at line 1199 of file stage.hh.

friend class Canvas
friend

Definition at line 1203 of file stage.hh.

friend class Cell
friend

Definition at line 1204 of file stage.hh.

friend class Model
friend

Definition at line 1200 of file stage.hh.

friend class SuperRegion
friend

Definition at line 1201 of file stage.hh.

friend class World
friend

Definition at line 1202 of file stage.hh.

Member Data Documentation

Color Stg::Block::color
private

Definition at line 1275 of file stage.hh.

Bounds Stg::Block::global_z
private

z extent in global coordinates

Definition at line 1283 of file stage.hh.

bool Stg::Block::inherit_color
private

Definition at line 1276 of file stage.hh.

std::vector< std::list<Block*>::iterator > Stg::Block::list_entries
private

record the list entries for the cells where this block is rendered

Definition at line 1287 of file stage.hh.

Bounds Stg::Block::local_z
private

z extent in local coords

Definition at line 1274 of file stage.hh.

bool Stg::Block::mapped
private

Definition at line 1284 of file stage.hh.

Model* Stg::Block::mod
private

model to which this block belongs

Definition at line 1269 of file stage.hh.

std::vector<point_t> Stg::Block::mpts
private

cache of this->pts in model coordindates

Definition at line 1270 of file stage.hh.

size_t Stg::Block::pt_count
private

the number of points

Definition at line 1271 of file stage.hh.

std::vector<point_t> Stg::Block::pts
private

points defining a polygonx

Definition at line 1272 of file stage.hh.

std::vector<Cell*> Stg::Block::rendered_cells[2]
private

record the cells into which this block has been rendered so we can remove them very quickly.

Definition at line 1291 of file stage.hh.

Size Stg::Block::size
private

Definition at line 1273 of file stage.hh.

bool Stg::Block::wheel
private

Definition at line 1277 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 Jun 10 2019 15:06:11