vtdata library
Public Member Functions | Public Attributes | Protected Attributes | List of all members
vtStructureArray Class Reference

Inherits vector< vtStructure * >.

Public Member Functions

void DestructItems ()
 
void SetFilename (const vtString &str)
 
vtString GetFilename ()
 
int GetFirstSelected ()
 
int GetNextSelected ()
 
vtStructureGetFirstSelectedStructure () const
 
int DeleteSelected ()
 
virtual void DestroyStructure (int i)
 
bool ReadSHP (const char *pathname, StructImportOptions &opt, bool progress_callback(int)=NULL)
 
void AddElementsFromOGR (class GDALDataset *datasource, StructImportOptions &opt, bool progress_callback(int)=NULL)
 
void AddElementsFromOGR_SDTS (class GDALDataset *datasource, bool progress_callback(int)=NULL)
 
void AddElementsFromOGR_RAW (class GDALDataset *datasource, StructImportOptions &opt, bool progress_callback(int)=NULL)
 
void AddBuildingsFromOGR (class OGRLayer *pLayer, StructImportOptions &opt, bool progress_callback(int)=NULL)
 
void AddLinearsFromOGR (class OGRLayer *pLayer, StructImportOptions &opt, bool progress_callback(int)=NULL)
 
void AddInstancesFromOGR (class OGRLayer *pLayer, StructImportOptions &opt, bool progress_callback(int)=NULL)
 
bool ReadBCF (const char *pathname)
 
bool ReadBCF_Old (FILE *fp)
 
bool ReadXML (const char *pathname, bool progress_callback(int)=NULL)
 
bool WriteXML (const char *pathname, bool bGZip=false) const
 
bool WriteFootprintsToSHP (const char *pathname)
 
bool WriteFootprintsToCanoma3DV (const char *pathname, const DRECT *area, const vtHeightField *pHF)
 
bool FindClosestBuildingCorner (const DPoint2 &point, double epsilon, int &building, int &corner, double &distance)
 
bool FindClosestBuildingCenter (const DPoint2 &point, double epsilon, int &building, double &distance)
 
bool FindClosestLinearCorner (const DPoint2 &point, double epsilon, int &structure, int &corner, double &distance)
 
bool FindClosestStructure (const DPoint2 &point, double epsilon, int &structure, double &distance, float fMaxInstRadius=1E9f, float fLinearWidthBuffer=0.0f)
 
bool FindClosestBuilding (const DPoint2 &point, double epsilon, int &structure, double &closest)
 
bool IsEmpty ()
 
void GetExtents (DRECT &ext) const
 
void Offset (const DPoint2 &delta)
 
int AddFoundations (vtHeightField *pHF, bool progress_callback(int)=NULL)
 
void RemoveFoundations ()
 
int NumSelected ()
 
int NumSelectedOfType (vtStructureType t)
 
void DeselectAll ()
 
virtual vtBuildingNewBuilding ()
 
virtual vtFenceNewFence ()
 
virtual vtStructInstanceNewInstance ()
 
vtBuildingAddNewBuilding ()
 
vtFenceAddNewFence ()
 
vtStructInstanceAddNewInstance ()
 
vtBuildingAddBuildingFromLineString (class OGRLineString *pLineString)
 
virtual void SetEditedEdge (vtBuilding *bld, int lev, int edge)
 

Public Attributes

vtCRS m_proj
 

Protected Attributes

vtString m_strFilename
 
vtBuildingm_pEditBuilding
 
int m_iEditLevel
 
int m_iEditEdge
 
int m_iLastSelected
 

Detailed Description

The vtStructureArray class contains a list of Built Structures (vtStructure objects). It can be loaded and saved to VTST files with the ReadXML and WriteXML methods.

Member Function Documentation

int vtStructureArray::DeleteSelected ( )

Delete any structures which are selected.

Returns
the number that were deleted.
bool vtStructureArray::FindClosestBuilding ( const DPoint2 point,
double  epsilon,
int &  structure,
double &  closest 
)

Find the building which is closest to the given point, if it is within 'epsilon' distance. The structure index and distance are returned by reference.

Returns
True if a building was found.
bool vtStructureArray::FindClosestBuildingCenter ( const DPoint2 point,
double  epsilon,
int &  building,
double &  closest 
)

Find the building center closest to the given point, if it is within 'epsilon' distance. The building index, and distance from the given point are returned by reference.

Returns
True if a building was found.
bool vtStructureArray::FindClosestBuildingCorner ( const DPoint2 point,
double  epsilon,
int &  building,
int &  corner,
double &  closest 
)

Find the building corner closest to the given point, if it is within 'epsilon' distance. The building index, corner index, and distance from the given point are all returned by reference.

Returns
True if a building was found.
bool vtStructureArray::FindClosestStructure ( const DPoint2 point,
double  epsilon,
int &  structure,
double &  closest,
float  fMaxInstRadius = 1E9f,
float  fLinearWidthBuffer = 0.0f 
)

Find the structure which is closest to the given point, if it is within 'epsilon' distance. The structure index and distance are returned by reference.

Returns
True if a building was found.
int vtStructureArray::GetFirstSelected ( )

Return the index of the first selected structure, or -1 if no structure is selected.

bool vtStructureArray::ReadSHP ( const char *  pathname,
StructImportOptions opt,
bool   progress_callbackint = NULL 
)

Import structure information from a Shapefile.

Parameters
pathnameA resolvable filename of a Shapefile (.shp)
optOptions which specify how to import structures from the file.
progress_callbackIf supplied, this function will be called back with a value of 0 to 100 as the operation progresses.
Returns
True if successful.
bool vtStructureArray::WriteFootprintsToCanoma3DV ( const char *  filename,
const DRECT area,
const vtHeightField pHF 
)

Write footprints to a Canoma file. Author of this code: BobMaX (Roberto Angeletti)