11 #ifndef BIOPROCESSING_GRAPH_POINTVERTEX 12 #define BIOPROCESSING_GRAPH_POINTVERTEX 17 #include <cartobase/smart/rcptr.h> 65 if(
typeid(other) !=
typeid(*
this) )
67 return _point == ( (
const This &)other )._point;
75 if(
typeid(other) !=
typeid(*
this) )
78 for(
int i =
_point.size()-1; i >= 0; --i )
80 if(
_point[i] > ( (
const This &)other )._point[i] )
82 else if(
_point[i] < ( (
const This &)other )._point[i] )
89 if(
operator>( other ) ||
operator==( other ) )
95 if(
operator<( other ) ||
operator==( other ) )
101 if(
operator>( other ) ||
operator==( other ) )
121 template <
typename P>
122 std::ostream & operator<<( std::ostream & os, const bio::PointVertex<P> & v )
124 os <<
"V{ " << v.
point() <<
" }";
137 template <
typename P>
147 typedef typename Pointed::Point
Point;
168 static Vertex
none() {
return This( (Pointed*)0 ); }
176 if( !(*
this) && !other )
178 else if( !(*
this) || !other )
181 return *((Pointed*)this->
get()) == *((Pointed*)other.get());
185 return !( *
this == other );
191 else if( !(*
this) || !other )
194 return *((Pointed*)this->
get()) > *((Pointed*)other.get());
200 else if( !(*
this) || !other )
203 return *((Pointed*)this->
get()) < *((Pointed*)other.get());
207 return ( *
this == other ) || ( *
this > other );
211 return ( *
this == other ) || ( *
this < other );
217 const Point &
point()
const {
return ((Pointed*)(this->
get()))->point(); }
219 Point &
point() {
return ((Pointed*)(this->
get()))->point(); }
230 template <
typename P>
231 std::ostream & operator<<( std::ostream & os, const bio::PointVertexRef<P> & v )
240 #endif // BIOPROCESSING_GRAPH_POINTVERTEX
PointVertex(const This &other)
Copy constructor.
PointVertexRef(const Point &p)
Constructor from coordinates.
virtual bool operator>=(const This &other) const
Coordinates-defined vertices.
virtual bool operator<(const This &other) const
PointVertexRef< P > This
Type of *this.
BaseVertexRef Base
Base class (rc_ptr)
PointVertex(const Point &p)
Constructor from coordiantes.
Point & point()
non constant accessor to the coordinates
BaseVertex Base
Base class.
virtual bool operator!=(const This &other) const
PointVertexRef< P > Vertex
Useable type (RC type)
static Vertex none()
Empty pointer factory.
Pointed::Vertex Vertex
Useable type (RC)
PointVertexRef(const Base &other)
Copy constructor (it copies the reference, it does not duplicate the pointed object) ...
virtual bool operator>(const This &other) const
const Point & point() const
constant accessor to the coordinates
Point & point()
non constant accessor to the coordinates
PointVertexRef()
Default constructor (creates an empty pointer)
const Point & point() const
constant accessor to the coordinates
friend class BaseVertexRef
PointVertex< P > This
Type of *this.
Reference counting pointer to a PointVertex.
virtual bool operator<=(const This &other) const
virtual bool operator==(const This &other) const
PointVertex< P > Pointed
Pointed object type.
virtual ~PointVertexRef()
Reference counting pointer to a BaseVertex.
Pointed::Point Point
Point.
PointVertexRef(Pointed *v)
Constructor from a pointer (the pointer should either be created by new, or be already referenced by ...
PointVertexRef< P > Ref
Reference type.