00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 # ifndef shape_edge_hpp
00013 # define shape_edge_hpp
00014
00015 # include <shape/vertex.hpp>
00016
00017 # define TMPL template<class K>
00018 # define SELF edge<K>
00019 # undef Shape
00020
00021 namespace mmx {
00022 namespace shape {
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 template<class C, class V= default_env, class POINT=point<C,3,V> >
00035 struct edge : public SHAPE_OF(V)
00036 {
00037 public:
00038
00039 typedef typename SHAPE_OF(V) Shape;
00040 typedef POINT Point;
00041
00042 edge(void) : Shape() {}
00043 edge(Point * source, Point * destination) : Shape() {
00044 this->m_source = source ;
00045 this->m_destination = destination ;
00046 }
00047
00048 inline Point * source(void) { return m_source ; }
00049 inline Point * destination(void) { return m_destination ; }
00050 inline void reverse()
00051 { Point *t=m_source; m_source=m_destination; m_destination=t; }
00052
00053
00054 private:
00055 Point * m_source ;
00056 Point * m_destination ;
00057 };
00058
00059
00060 } ;
00061 } ;
00062
00063 # undef TMPL
00064 # undef SELF
00065 # endif // shape_edge_hpp