26#ifndef __TERRALIB_VP_INTERNAL_COMMONDATASTRCTURES_H
27#define __TERRALIB_VP_INTERNAL_COMMONDATASTRCTURES_H
55 struct SegmentInfoImpl;
56 struct GeometryInfoImpl;
106 std::size_t position = 0;
142 std::vector<std::size_t> vecValidIndexes;
143 vecValidIndexes.reserve(
m_vecData.size());
145 for (std::size_t i = 0; i <
m_vecData.size(); ++i)
149 vecValidIndexes.push_back(i);
153 return vecValidIndexes;
156 std::vector<std::size_t>
getValidIndexes(
const std::vector<std::size_t>& vecIndexes)
const
163 std::vector<std::size_t> vecValidIndexes;
164 vecValidIndexes.reserve(vecIndexes.size());
168 for (std::size_t i = 0; i < vecIndexes.size(); ++i)
170 std::size_t index = vecIndexes.at(i);
175 vecValidIndexes.push_back(index);
180 return vecValidIndexes;
213 std::vector<T> vecAllData;
216 for (std::size_t i = 0; i <
m_vecFilter.size(); ++i)
An utility struct for representing 2D coordinates.
This file contains several utility functions for dealing with STL containers.
A base class for values that can be retrieved from the data access module.
An Envelope defines a 2D rectangular region.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
GeometryInfo(std::size_t geometryIndex, te::gm::Geometry *geometry)
Constructor.
std::vector< SegmentInfo > getAllSegments() const
Gets the geometry.
virtual ~GeometryInfo()
Searches the segments that interscepts the given filter.
void setGeometry(te::gm::Geometry *geometry)
std::size_t search(const te::gm::Envelope &filter, std::vector< SegmentInfo > &vecResult) const
Gets the list of all segments of the geometry.
void init(const te::gm::Envelope &filter)
< Initializes the index
GeometryInfoImpl * m_impl
A internal pointer to the implementation of the class. This is used to avoid exporting dependencies.
GeometryInfo(std::size_t geometryIndex, te::gm::Geometry *geometry, const te::gm::Envelope &filter)
Constructor.
const te::gm::Geometry * getGeometry() const
Sets the geometry. This will cause the old geometry to be deleted and the index to be recreated.
std::set< std::size_t > m_freeIndexes
Stores the list of removed indexes.
std::size_t insert(const T &data)
std::vector< IndexData< T > * > m_vecData
The actual data stored.
std::vector< std::size_t > getValidIndexes(const std::vector< std::size_t > &vecIndexes) const
te::vp::IndexData< T > * getData(std::size_t dataIndex) const
std::vector< std::size_t > getValidIndexes() const
void remove(std::size_t dataIndex)
IndexData(const T &data, std::size_t dataIndex)
T m_data
The templated data.
std::size_t m_dataIndex
The index of the data inside the data vector.
const IndexContainer< T > * m_indexContainer
IndexReport(const IndexContainer< T > *indexContainer, const std::vector< std::size_t > &vecFilter)
te::vp::IndexData< T > * getData(std::size_t dataIndex) const
std::vector< std::size_t > m_vecFilter
std::vector< T > getAllData() const
std::size_t m_geometryIndex
The segment envelope.
te::gm::Coord2D m_coord2
The segment start coordinate.
const te::gm::Envelope & getEnvelope() const
Gets the geometry index.
te::gm::Envelope m_envelope
The segment end coordinate.
SegmentInfo * clone() const
Gets the segment start coordinate.
SegmentInfo(const te::gm::Coord2D &coord1, const te::gm::Coord2D &coord2, const te::gm::Envelope &envelope, std::size_t geometryIndex)
Constructor.
const te::gm::Coord2D & getCoord2() const
Gets the segment envelope.
const te::gm::Coord2D & getCoord1() const
Gets the segment end coordinate.
virtual ~SegmentInfo()
Clones the SegmentInfo.
std::size_t getGeometryIndex() const
Sets the geometry index.
void setGeometryIndex(std::size_t geometryIndex)
An Envelope defines a 2D rectangular region.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map.
Namespace for the Data Type module of TerraLib.
Namespace for the Vector Geometry module of TerraLib.
Namespace for Vector Processing module of TerraLib.
An utility struct for representing 2D coordinates.
Configuration flags for the Terrralib Vector Processing module.
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.