vtdata library
Public Member Functions | Protected Attributes | List of all members
vtFeatureSetPolygon Class Reference
Inheritance diagram for vtFeatureSetPolygon:
Inheritance graph
[legend]

Public Member Functions

uint NumEntities () const
 
void SetNumGeometries (int iNum)
 
void Reserve (int iNum)
 
bool ComputeExtent (DRECT &rect) const
 
void Offset (const DPoint2 &p, bool bSelectedOnly=false)
 
bool TransformCoords (OCTransform *pTransform, bool progress_callback(int)=0)
 
bool AppendGeometryFrom (vtFeatureSet *pFromSet)
 
int AddPolygon (const DPolygon2 &poly)
 
void SetPolygon (uint num, const DPolygon2 &poly)
 
const DPolygon2GetPolygon (uint num) const
 
DPolygon2GetPolygon (uint num)
 
int FindSimplePolygon (const DPoint2 &p) const
 
int FindPolygon (const DPoint2 &p) const
 
int FixGeometry (double dEpsilon)
 
int SelectBadFeatures (double dEpsilon)
 
void CreateIndex (int iSize)
 
void FreeIndex ()
 
virtual bool IsInsideRect (int iElem, const DRECT &rect)
 
virtual void CopyGeometry (uint from, uint to)
 
virtual void SaveGeomToSHP (SHPHandle hSHP, bool progress_callback(int)=0) const
 
virtual void LoadGeomFromSHP (SHPHandle hSHP, bool progress_callback(int)=0)
 
virtual bool EarthExtents (DRECT &ext) const
 
- Public Member Functions inherited from vtFeatureSet
bool SaveToSHP (const char *filename, bool progress_callback(int)=0) const
 
bool LoadFromOGR (OGRLayer *pLayer, bool progress_callback(int)=0)
 
bool LoadFromSHP (const char *fname, bool progress_callback(int)=0)
 
bool LoadDataFromDBF (const char *filename, bool progress_callback(int)=0)
 
bool LoadFieldInfoFromDBF (const char *filename)
 
bool LoadDataFromCSV (const char *filename, bool progress_callback(int)=0)
 
bool SaveToKML (const char *filename, bool progress_callback(int)=0) const
 
void SetFilename (const vtString &str)
 
vtString GetFilename () const
 
void SetNumEntities (int iNum)
 
void AllocateFeatures ()
 
OGRwkbGeometryType GetGeomType () const
 
void SetGeomType (OGRwkbGeometryType eGeomType)
 
bool AppendDataFrom (vtFeatureSet *pFromSet)
 
virtual int NumTotalVertices () const
 
void SetToDelete (int iFeature)
 
int ApplyDeletion ()
 
void Select (uint iEnt, bool set=true)
 
bool IsSelected (uint iEnt) const
 
uint NumSelected () const
 
void DeselectAll ()
 
void InvertSelection ()
 
int SelectByCondition (int iField, int iCondition, const char *szValue)
 
void DeleteSelected ()
 
bool IsDeleted (uint iEnt)
 
int DoBoxSelect (const DRECT &rect, SelectionType st)
 
void Pick (uint iEnt, bool set=true)
 
bool IsPicked (uint iEnt)
 
void DePickAll ()
 
uint NumFields () const
 
FieldGetField (int i)
 
const FieldGetField (int i) const
 
FieldGetField (const char *name)
 
int GetFieldIndex (const char *name) const
 
int AddField (const char *name, FieldType ftype, int string_length=40)
 
int AddRecord ()
 
void DeleteFields ()
 
void SetValue (uint record, uint field, const char *string)
 
void SetValue (uint record, uint field, int value)
 
void SetValue (uint record, uint field, double value)
 
void SetValue (uint record, uint field, bool value)
 
void GetValueAsString (uint record, uint field, vtString &str) const
 
void SetValueFromString (uint iRecord, uint iField, const vtString &str)
 
void SetValueFromString (uint iRecord, uint iField, const char *str)
 
int GetIntegerValue (uint iRecord, uint iField) const
 
short GetShortValue (uint iRecord, uint iField) const
 
float GetFloatValue (uint iRecord, uint iField) const
 
double GetDoubleValue (uint iRecord, uint iField) const
 
bool GetBoolValue (uint iRecord, uint iField) const
 
void SetProjection (const vtCRS &proj)
 
vtCRSGetAtProjection ()
 
vtFeature * GetFeature (uint iIndex) const
 
vtFeature * GetFirstSelectedFeature () const
 

Protected Attributes

DPolyArray m_Poly
 
SpatialIndex * m_pIndex
 
- Protected Attributes inherited from vtFeatureSet
OGRwkbGeometryType m_eGeomType
 
std::vector< vtFeature * > m_Features
 
vtArray< Field * > m_fields
 
vtCRS m_proj
 
vtString m_strFilename
 

Additional Inherited Members

- Protected Member Functions inherited from vtFeatureSet
void CopyEntity (uint from, uint to)
 
void ParseDBFFields (DBFHandle db)
 
void ParseDBFRecords (DBFHandle db, bool progress_callback(int)=0)
 

Detailed Description

A set of polygon features. Each polygon is a DPolygon2 object, which consists of a number of rings: one external ring, and any number of internal rings (holes).

Member Function Documentation

int vtFeatureSetPolygon::FindPolygon ( const DPoint2 p) const

Find the first polygon in this feature set which contains the given point.

The index of the polygon is return, or -1 if no polygon was found.

int vtFeatureSetPolygon::FindSimplePolygon ( const DPoint2 p) const

Find the first polygon in this feature set which contains the given point. This method makes the simplification assumption that none of the polygons have holes.

The index of the polygon is return, or -1 if no polygon was found.

void vtFeatureSetPolygon::Reserve ( int  iNum)
virtual

If you know how many entities you will be adding to this FeatureSet, is it more efficient to reserve space for that many.

Implements vtFeatureSet.

int vtFeatureSetPolygon::SelectBadFeatures ( double  dEpsilon)

To detect coincident vertices, even between rings, we compare every vertex to every other. It is too troublesome to try to automatically correct these points, so intead we just select them to let the user know which are bad.