15 #include "LocalConversion.h"
17 #include "ogrsf_frmts.h"
24 #define MINIMUM_BASEMENT_SIZE 0.5 // Mininum size of an automatically generated basement layer in a building
26 #define DEFAULT_BUILDING_SIZE 10.0 // Default size for buildings imported from points
30 ROOF_FLAT, ROOF_SHED, ROOF_GABLE, ROOF_HIP, ROOF_UNKNOWN, NUM_ROOFTYPES
50 vtEdgeFeature(
int code,
float width = -1.0f,
float vf1 = 0.0f,
float vf2 = 1.0f);
87 void Set(
int doors,
int windows,
const char *material);
88 void AddFeature(
int code,
float width = -1.0f,
float vf1 = 0.0f,
float vf2 = 1.0f);
89 size_t NumFeatures()
const {
return m_Features.size(); }
90 int NumFeaturesOfCode(
int code);
91 float FixedFeaturesWidth();
92 float ProportionTotal();
105 std::vector<vtEdgeFeature> m_Features;
109 #define MAX_WALLS 360 // the largest number of walls
138 void DeleteEdge(
int iEdge);
139 bool AddEdge(
const int iEdge,
const DPoint2 &Point);
140 int NumEdges()
const {
return m_Edges.GetSize(); }
141 vtEdge *GetEdge(uint i)
const;
142 float GetEdgeLength(uint i)
const;
143 const vtString GetOverallEdgeMaterial();
144 bool GetOverallEdgeColor(
RGBi &color);
145 RoofType GuessRoofType();
148 bool HasSlopedEdges()
const;
149 bool IsHorizontal()
const;
150 bool IsEdgeConvex(
int i);
151 bool IsCornerConvex(
int i);
154 void SetEdgeMaterial(
const char *matname);
155 void SetEdgeColor(
RGBi color);
157 void SetEaveLength(
float fMeters);
160 float m_fStoryHeight;
164 void ResizeEdgesToMatchFootprint();
166 DPolygon2 &GetFootprint() {
return m_Foot; }
167 const DPolygon2 &GetFootprint()
const {
return m_Foot; }
170 DLine2 &GetOuterFootprint() {
return m_Foot[0]; }
171 const DLine2 &GetOuterFootprint()
const {
return m_Foot[0]; }
173 void DetermineLocalFootprint(
float fHeight);
174 const FPolygon3 &GetLocalFootprint()
const {
return m_LocalFootprint; }
177 void RebuildEdges(uint n);
178 void GetEdgePlane(uint i,
FPlane &plane);
179 bool DetermineHeightFromSlopes();
214 const DPolygon2 &GetFootprint(
int i)
const {
return m_Levels[i]->GetFootprint(); }
215 const DLine2 &GetOuterFootprint(
int i)
const {
return m_Levels[i]->GetOuterFootprint(); }
216 bool GetBaseLevelCenter(
DPoint2 &p)
const;
218 void SetRectangle(
const DPoint2 ¢er,
float fWidth,
float fDepth,
219 float fRotation = 0.0f);
227 void SetRoofType(RoofType rt,
int iSlope = -1,
int iLev = -1);
228 RoofType GetRoofType();
235 float GetTotalHeight()
const;
237 uint GetNumLevels()
const {
return m_Levels.GetSize(); }
238 vtLevel *GetLevel(
int i) {
return (i < (
int)m_Levels.GetSize()) ? m_Levels[i] : NULL; }
239 const vtLevel *GetLevel(
int i)
const {
return (i < (
int)m_Levels.GetSize()) ? m_Levels[i] : NULL; }
242 void InsertLevel(
int iLev,
vtLevel *pLev);
243 void DeleteLevel(
int iLev);
245 bool GetExtents(
DRECT &rect)
const;
246 void Offset(
const DPoint2 &delta);
249 void WriteXML(
GZOutput &out,
bool bDegrees)
const;
250 void AddDefaultDetails();
251 void DetermineLocalFootprints();
252 const FPolygon3 &GetLocalFootprint(
int i)
const {
return m_Levels[i]->GetLocalFootprint(); }
255 static const char *GetEdgeFeatureString(
int edgetype);
256 static int GetEdgeFeatureValue(
const char *value);
258 bool IsContainedBy(
const DRECT &rect)
const;
259 void SwapLevels(
int lev1,
int lev2);
260 void CopyFromDefault(
vtBuilding *pDefBld,
bool bDoHeight);