vtdata library
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes
vtBuilding Class Reference
Inheritance diagram for vtBuilding:
Inheritance graph
[legend]

List of all members.

Public Member Functions

vtBuildingoperator= (const vtBuilding &v)
void SetFootprint (int i, const DLine2 &dl)
void SetFootprint (int i, const DPolygon2 &poly)
const DPolygon2GetFootprint (int i) const
const DLine2GetOuterFootprint (int i) const
bool GetBaseLevelCenter (DPoint2 &p) const
void SetRectangle (const DPoint2 &center, float fWidth, float fDepth, float fRotation=0.0f)
void SetCircle (const DPoint2 &center, float fRad)
void FlipFootprintDirection ()
float CalculateBaseElevation (vtHeightField *pHeightField)
void TransformCoords (OCT *trans)
void SetRoofType (RoofType rt, int iSlope=-1, int iLev=-1)
RoofType GetRoofType ()
void SetColor (BldColor which, RGBi col)
RGBi GetColor (BldColor which) const
void SetStories (int i)
int GetStories () const
float GetTotalHeight () const
unsigned int GetNumLevels () const
vtLevelGetLevel (int i)
const vtLevelGetLevel (int i) const
vtLevelCreateLevel (const DPolygon2 &footprint)
vtLevelCreateLevel ()
void InsertLevel (int iLev, vtLevel *pLev)
void DeleteLevel (int iLev)
bool GetExtents (DRECT &rect) const
void Offset (const DPoint2 &delta)
double GetDistanceToInterior (const DPoint2 &point) const
void WriteXML (GZOutput &out, bool bDegrees) const
void AddDefaultDetails ()
void DetermineLocalFootprints ()
const FPolygon3GetLocalFootprint (int i)
bool IsContainedBy (const DRECT &rect) const
void SwapLevels (int lev1, int lev2)
void CopyFromDefault (vtBuilding *pDefBld, bool bDoHeight)

Static Public Member Functions

static const char * GetEdgeFeatureString (int edgetype)
static int GetEdgeFeatureValue (const char *value)

Static Public Attributes

static vtLocalConversion s_Conv

Protected Attributes

vtArray< vtLevel * > m_Levels

Detailed Description

This class contains a parametric representation of a building.

The geometry is described by a series of levels (vtLevel), each of which contains a set of edges (vtEdge), which in turn are composed of edge features (vtEdgeFeature). These components can vary in color, material, size, and number, which gives a high-level representation of a building, which can be used to construct a reasonable (visually similar) model of the building.


Member Function Documentation

float vtBuilding::CalculateBaseElevation ( vtHeightField pHeightField)

Calculate the elevation at which this building should be placed on a given heightfield.

void vtBuilding::FlipFootprintDirection ( )

Flips the direction of the footprint, which is either clockwise or counterclockwise when viewed from above. This affects the footprints of all levels.

RGBi vtBuilding::GetColor ( BldColor  which) const

Get the color of the building. In the case of multi-colored buildings, note that this method returns only the first color encountered.

Parameters:
whichCan be either BLD_BASIC (color of the building) or BLD_ROOF (color of the roof).
double vtBuilding::GetDistanceToInterior ( const DPoint2 point) const

Find the closest distance from a given point to the interior of a building's lowest footprint. If the point is inside the footprint, the value 0.0 is returned.

int vtBuilding::GetStories ( ) const

Get the total number of stories of this building. The top level is assumed to be a roof and does not count toward the total.

vtBuilding & vtBuilding::operator= ( const vtBuilding v)

Asignment operator, which makes an explicit copy the entire building including each level.

void vtBuilding::SetCircle ( const DPoint2 center,
float  fRad 
)

Sets the base footprint of the building to be a circle. A circle is represented by a 20-sided polygonal footprint.

Parameters:
centerThe location of the building's center.
fRadThe radius of the building.
void vtBuilding::SetColor ( BldColor  which,
RGBi  col 
)

Set the colors of the building.

Parameters:
whichCan be either BLD_BASIC (the overall color of the building) or BLD_ROOF (the overall color of the roof).
colThe color to set.
void vtBuilding::SetFootprint ( int  lev,
const DPolygon2 poly 
)

Set the footprintf of the given level of the building.

Parameters:
levThe level, from 0 for the base level and up.
polyThe footprint.
void vtBuilding::SetFootprint ( int  lev,
const DLine2 foot 
)

Set the footprint of the given level of the building.

Parameters:
levThe level, from 0 for the base level and up.
footThe footprint.
void vtBuilding::SetRoofType ( RoofType  rt,
int  iSlope = -1,
int  iLev = -1 
)

Set the type of roof for this building. In cases of ambiguity, such as setting a gable roof, the method will try to make intelligent guesses about where to put the roof angles based the length of the roof edges.

Parameters:
rtRoof type, one of:
  • ROOF_FLAT
  • ROOF_SHED
  • ROOF_GABLE
  • ROOF_HIP
iSlopeFor a non-flat roof, this is the slope in degrees of the sloped edges. This varies from 0 (horizontal) to 90 (vertical).
iLev(optional) The number of the level to assume is the roof. If omitted, the top level is assumed to be the roof.
void vtBuilding::SetStories ( int  iStories)

Set the height of the building in stories. If the building has no levels, two will be created: for the walls and the roof. If the number of stories is greater than before, the additional stories are added to the top-most non-roof level. If lesser, stories and levels are removed from the top down until the desired number is met.

Parameters:
iStoriesNumber of stories to set.
void vtBuilding::TransformCoords ( OCT *  trans)

Transform the coodinates of this building (the footprints of each level) by the given coordinate transformation.

 All Classes Files Functions Variables Enumerations Enumerator