Go to the documentation of this file.
19 namespace DataStructures {
21 template<
typename CoordinateT =
double,
unsigned short DIM = 3 >
29 template<
typename CoordinateT =
double,
unsigned short DIM = 3 >
30 class AIFPoint :
public std::array< CoordinateT, DIM >
43 throw std::runtime_error(
"AIFPoint only support dim=3 for now.");
56 throw std::runtime_error(
"AIFPoint only support dim=3 for now.");
72 (*
this)[0] + other[0], (*
this)[1] + other[1], (*
this)[2] + other[2]);
85 for(
auto itVal = p.begin(); itVal != p.end(); ++itVal)
88 if(itVal != (p.end() - 1))
105 (*
this)[0] - other[0], (*
this)[1] - other[1], (*
this)[2] - other[2]);
116 (*
this)[0] + v[0], (*
this)[1] + v[1], (*
this)[2] + v[2]);
126 if((*
this)[0] < p[0])
128 else if((*
this)[0] > p[0])
131 if((*
this)[1] < p[1])
133 else if((*
this)[1] > p[1])
136 if((*
this)[2] < p[2])
171 template<
typename CoordinateT ,
unsigned short DIM >
184 throw std::runtime_error(
"AIFVector only support dim=3 for now.");
197 throw std::runtime_error(
"AIFVector only support dim=3 for now.");
225 (*
this)[0] + other[0], (*
this)[1] + other[1], (*
this)[2] + other[2]);
236 (*
this)[0] - other[0], (*
this)[1] - other[1], (*
this)[2] - other[2]);
246 (*
this)[0] / k, (*
this)[1] / k, (*
this)[2] / k);
256 return ((*
this)[0] * other[0] + (*
this)[1] * other[1] +
257 (*
this)[2] * other[2]);
267 (*
this)[0] * k, (*
this)[1] * k, (*
this)[2] * k);
288 if((*
this)[0] < v[0])
290 else if((*
this)[0] > v[0])
293 if((*
this)[1] < v[1])
295 else if((*
this)[1] > v[1])
298 if((*
this)[2] < v[2])
348 for(
auto itVal = v.begin(); itVal != v.end(); ++itVal)
351 if( itVal != (v.end() - 1) )
370 virtual void remove(std::size_t , std::size_t ) {}
378 template<
typename T >
384 using boost::vector_property_map< T >::operator[];
398 return std::distance(this->storage_begin(), this->storage_end());
407 void remove(std::size_t idx, std::size_t cLastIdx)
419 if(this->
size() == 0 || cLastIdx >= this->
size())
423 (*this)[idx] = (*this)[cLastIdx];
442 template<
typename KeyType,
typename ValueType >
444 :
public boost::associative_property_map< std::map< KeyType, ValueType > >,
455 boost::associative_property_map< std::map< KeyType, ValueType > >::
457 boost::associative_property_map< std::map< KeyType, ValueType > >(
map));
461 std::map< KeyType, ValueType >
map;
507 return (iter->first.compare(0, prefix.size(), prefix) == 0);
520 std::vector< std::string > res;
523 for( ; iter!=iter_end; ++iter)
525 if (iter->first.compare(0, prefix.size(), prefix) == 0)
526 res.push_back(iter->first);
537 template<
typename T >
541 throw std::runtime_error(
"Property map '" + name +
"' doesn't exist.");
546 throw std::runtime_error(
"Property map '" + name +
547 "' is not of the given type.");
558 template<
typename T >
567 return getPropertyMap< T >(name);
590 if (m.second != NULL)
605 template<
typename T >
606 void setProperty(
const std::string &name, std::size_t idx,
const T &value)
609 (*prop_map)[idx] = value;
619 template<
typename T >
623 return (*prop_map)[idx];
633 template<
typename T >
637 return (*prop_map)[idx];
650 auto map = it.second;
651 map->remove(idx, cLastIdx);
663 template<
typename KeyType,
typename ValueType >
668 throw std::runtime_error(
"Property map '" + name +
"' doesn't exist.");
674 throw std::runtime_error(
"Property map '" + name +
675 "' is not of the given type.");
686 template<
typename KeyType,
typename ValueType >
696 return getAssocPropertyMap< KeyType, ValueType >(name);
CoordinateT CoordinateType
const AIFPoint< CoordinateType, DIM > operator+(const AIFPoint< CoordinateType, DIM > &other) const
AssocPropertyMap< KeyType, ValueType > * addAssocPropertyMap(const std::string &name)
boost::shared_ptr< self > ptr
AIFVector< CoordinateType, DIM > operator/(double k) const
T & getProperty(const std::string &name, std::size_t idx)
void removePropertyMap(const std::string &name)
virtual ~BasePropertyMap()
AIFPoint(CoordinateType x, CoordinateType y, CoordinateType z)
bool isAPropertyMapStartingWithPrefix(const std::string &prefix) const
bool operator<(const AIFVector< CoordinateType, DIM > &v) const
PropertyMap< T > * getPropertyMap(const std::string &name) const
std::vector< std::string > GetPropertyMapNamesStartingWithPrefix(const std::string &prefix) const
std::map< const std::string, BasePropertyMap * > m_PropertyMaps
virtual void remove(std::size_t, std::size_t)
boost::shared_ptr< self > ptr
std::map< KeyType, ValueType > map
void setProperty(const std::string &name, std::size_t idx, const T &value)
AIFVector< CoordinateType, DIM > operator*(double k) const
void removeProperties(std::size_t idx, std::size_t cLastIdx)
friend AIFVector< CoordinateType, DIM > operator*(double s, const AIFVector< CoordinateType, DIM > &v)
virtual void forcePolymorphic(void)
Interfaces for plugins These interfaces will be used for different plugins.
AssocPropertyMap< KeyType, ValueType > * getAssocPropertyMap(const std::string &name)
CoordinateT CoordinateType
T & operator[](const AIFFace::ptr v) const
add operator[] for face_descriptor
std::size_t size(void) const
number of elements in the property map
void remove(std::size_t idx, std::size_t cLastIdx)
bool operator==(const AIFPoint< CoordinateType, DIM > &p) const
AIFVector< CoordinateType, DIM > operator-(const AIFVector< CoordinateType, DIM > &other) const
friend std::ostream & operator<<(std::ostream &stream, const AIFVector< CoordinateType, DIM > &v)
boost::shared_ptr< self > ptr
bool operator==(const AIFVector< CoordinateType, DIM > &v) const
T & operator[](const AIFVertex::ptr v) const
add operator[] for vertex_descriptor
T & getProperty(const std::string &name, std::size_t idx) const
bool isPropertyMap(const std::string &name) const
double fabs(const v_Curv< HalfedgeGraph > &input)
PropertyMap< T > * addPropertyMap(const std::string &name)
std::array< CoordinateType, DIM > SuperClass
AIFVector< CoordinateType, DIM > operator-(const AIFPoint< CoordinateType, DIM > &other) const
friend std::ostream & operator<<(std::ostream &stream, const AIFPoint< CoordinateType, DIM > &p)
AIFPoint< CoordinateType, DIM > operator+(const AIFPoint< CoordinateType, DIM > &p) const
AIFVector(CoordinateType x, CoordinateType y, CoordinateType z)
AIFPoint< CoordinateType, DIM > operator+(const AIFVector< CoordinateType, DIM > &v) const
CoordinateType length(void) const
AIFVector< CoordinateType, DIM > operator+(const AIFVector< CoordinateType, DIM > &other) const
T & operator[](const AIFEdge::ptr v) const
add operator[] for edge_descriptor
bool operator<(const AIFPoint< CoordinateType, DIM > &p) const
double operator*(const AIFVector< CoordinateType, DIM > &other) const