Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtBuilding3d Class Reference

#include <Building3d.h>

Inheritance diagram for vtBuilding3d:
vtBuilding vtStructure3d vtStructure Selectable vtTagArray

Public Member Functions

virtual bool CreateNode (vtTerrain *pTerr)
 
virtual bool IsCreated ()
 
virtual vtGeodeGetGeom ()
 Access the Geometry node for this structure, if it has one.
 
virtual osg::Node * GetContained ()
 
virtual void DeleteNode ()
 
virtual void ShowBounds (bool bShow)
 
vtBuilding3doperator= (const vtBuilding &v)
 
void DestroyGeometry ()
 
bool CreateGeometry (vtHeightField3d *pHeightField)
 
void AdjustHeight (vtHeightField3d *pHeightField)
 
void Randomize (int iStories)
 
- Public Member Functions inherited from vtBuilding
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
 
uint 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) const
 
bool IsContainedBy (const DRECT &rect) const
 
void SwapLevels (int lev1, int lev2)
 
void CopyFromDefault (vtBuilding *pDefBld, bool bDoHeight)
 
- Public Member Functions inherited from vtStructure
void CopyFrom (const vtStructure &v)
 
void SetType (vtStructureType t)
 
vtStructureType GetType ()
 
void SetElevationOffset (float fOffset)
 
float GetElevationOffset () const
 
void SetAbsolute (bool b)
 
bool GetAbsolute () const
 
vtBuildingGetBuilding ()
 
vtFenceGetFence ()
 
vtStructInstanceGetInstance ()
 
void WriteTags (GZOutput &out) const
 
- Public Member Functions inherited from Selectable
void Select (bool b)
 
bool IsSelected ()
 
void ToggleSelect ()
 
- Public Member Functions inherited from vtTagArray
void AddTag (const vtTag &pTag)
 
void AddTag (const char *name, const char *value)
 
vtTagFindTag (const char *szTagName)
 
const vtTagFindTag (const char *szTagName) const
 
vtTagGetTag (int index)
 
const vtTagGetTag (int index) const
 
uint NumTags () const
 
void RemoveTag (int index)
 
void RemoveTag (const char *szTagName)
 
void Clear ()
 
void SetValueString (const char *szTagName, const vtString &string, bool bCreating=false)
 
void SetValueBool (const char *szTagName, bool value, bool bCreating=false)
 
void SetValueInt (const char *szTagName, int value, bool bCreating=false)
 
void SetValueFloat (const char *szTagName, float value, bool bCreating=false)
 
void SetValueDouble (const char *szTagName, double value, bool bCreating=false)
 
void SetValueRGBi (const char *szTagName, const RGBi &value, bool bCreating=false)
 
const char * GetValueString (const char *szTagName, bool bSuppressWarning=false) const
 
bool GetValueBool (const char *szTagName) const
 
int GetValueInt (const char *szTagName) const
 
float GetValueFloat (const char *szTagName) const
 
double GetValueDouble (const char *szTagName) const
 
RGBi GetValueRGBi (const char *szTagName) const
 
bool GetValueString (const char *szTagName, vtString &string) const
 
bool GetValueBool (const char *szTagName, bool &bValue) const
 
bool GetValueInt (const char *szTagName, int &iValue) const
 
bool GetValueFloat (const char *szTagName, float &fValue) const
 
bool GetValueDouble (const char *szTagName, double &dValue) const
 
bool GetValueRGBi (const char *szTagName, RGBi &color) const
 
vtTagArrayoperator= (const vtTagArray &v)
 
bool operator== (const vtTagArray &v) const
 
bool operator!= (const vtTagArray &v) const
 
void CopyTagsFrom (const vtTagArray &v)
 
bool WriteToXML (const char *fname, const char *title) const
 
void WriteToXMLBody (FILE *fp, int iIndent) const
 
bool LoadFromXML (const char *fname)
 
virtual bool OverrideValue (const char *szTagName, const vtString &string)
 
virtual void WriteOverridesToXML (FILE *fp) const
 
void LogTags () const
 
- Public Member Functions inherited from vtStructure3d
vtTransformGetContainer ()
 
void SetCastShadow (bool b)
 
bool GetCastShadow ()
 
const bool GetVIAContributor () const
 
const bool GetVIATarget () const
 
void SetVIAContributor (const bool bVIAContributor)
 
void SetVIATarget (const bool bVIATarget)
 

Protected Member Functions

bool MakeFacade (vtEdge *pEdge, FLine3 &quad, int stories)
 
vtMeshFindMatMesh (const vtString &Material, const RGBi &color, vtMesh::PrimType ePrimType)
 
void UpdateWorldLocation (vtHeightField3d *pHeightField)
 
float GetHeightOfStories ()
 
void CreateUpperPolygon (vtLevel *lev, FPolygon3 &poly, FPolygon3 &poly2)
 
void CreateEdgeGeometry (vtLevel *pLev, const FPolygon3 &polygon1, const FPolygon3 &polygon2, int iEdge, bool bShowEdge)
 
void CreateUniformLevel (int iLevel, float fHeight, int iHighlightEdge)
 
void AddWallSection (vtEdge *pEdge, bool bUniform, const FLine3 &quad, float h1, float h2, float hf1=-1.0f)
 
void AddHighlightSection (vtEdge *pEdge, const FLine3 &quad)
 
void AddDoorSection (vtEdge *pWall, vtEdgeFeature *pFeat, const FLine3 &quad)
 
void AddWindowSection (vtEdge *pWall, vtEdgeFeature *pFeat, const FLine3 &quad)
 
void AddWallNormal (vtEdge *pWall, vtEdgeFeature *pFeat, const FLine3 &quad)
 
void AddFlatRoof (const FPolygon3 &pp, vtLevel *pLev)
 
FPoint3 Normal (const FPoint3 &p0, const FPoint3 &p1, const FPoint3 &p2)
 
float MakeFelkelRoof (const FPolygon3 &pp, vtLevel *pLev)
 
bool Collinear2d (const FPoint3 &p1, const FPoint3 &p2, const FPoint3 &p3)
 
int FindVertex (FPoint3 Point, FLine3 &RoofSection3D, vtArray< int > &iaVertices)
 
- Protected Member Functions inherited from vtStructure3d
int FindMatIndex (const vtString &Material, const RGBf &inputColor=RGBf(), int iType=-1)
 
vtMaterialArrayGetSharedMaterialArray () const
 
float ColorDiff (const RGBi &c1, const RGBi &c2)
 

Protected Attributes

vtArray< MatMeshm_Mesh
 
FPoint3 m_center
 
vtGeodem_pGeode
 
vtGeodem_pHighlight
 
- Protected Attributes inherited from vtBuilding
vtArray< vtLevel * > m_Levels
 
- Protected Attributes inherited from vtStructure
vtStructureType m_type
 
float m_fElevationOffset
 
bool m_bAbsolute
 
- Protected Attributes inherited from Selectable
bool m_bSelect
 
- Protected Attributes inherited from vtTagArray
std::vector< vtTagm_tags
 
- Protected Attributes inherited from vtStructure3d
vtTransformPtr m_pContainer
 
bool m_bIsVIAContributor
 
bool m_bIsVIATarget
 

Additional Inherited Members

- Static Public Member Functions inherited from vtBuilding
static const char * GetEdgeFeatureString (int edgetype)
 
static int GetEdgeFeatureValue (const char *value)
 
- Static Public Member Functions inherited from vtStructure3d
static
vtMaterialDescriptorArray3d
GetMaterialDescriptors ()
 
static vtMaterialDescriptorFindMaterialDescriptor (const vtString &name, const RGBf &color=RGBf(), int type=-1)
 
static void InitializeMaterialArrays ()
 
static void CreateSharedMaterials ()
 
- Static Public Attributes inherited from vtBuilding
static vtLocalConversion s_Conv
 
- Static Protected Attributes inherited from vtTagArray
static bool s_bVerbose = false
 
- Static Protected Attributes inherited from vtStructure3d
static vtMaterialDescriptorArray3d s_MaterialDescriptors
 
static bool s_bMaterialsLoaded = false
 

Detailed Description

This class extends vtBuilding with the abiliity to construct and operate on a 3D model of a parametric building.

Member Function Documentation

void vtBuilding3d::AddDoorSection ( vtEdge pEdge,
vtEdgeFeature pFeat,
const FLine3 quad 
)
protected

Builds a door section. will also build the wall above the door to ceiling height.

void vtBuilding3d::AddHighlightSection ( vtEdge pEdge,
const FLine3 quad 
)
protected

Creates geometry for a highlighted area (an edge).

void vtBuilding3d::AddWallSection ( vtEdge pEdge,
bool  bUniform,
const FLine3 quad,
float  vf1,
float  vf2,
float  hf1 = -1.0f 
)
protected

Builds a wall, given material index, starting and end points, height, and starting height.

bool vtBuilding3d::CreateNode ( vtTerrain pTerr)
virtual

Creates the geometry for the building. Capable of several levels of detail (defaults to full detail). If the geometry was already built previously, it is destroyed and re-created.

Parameters
pTerrThe terrain on which to plant the building.

Implements vtStructure3d.

void vtBuilding3d::ShowBounds ( bool  bShow)
virtual

Display some bounding wires around the object to highlight it.

Reimplemented from vtStructure3d.


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