shape_doc 0.1
|
00001 /***************************************************************************** 00002 * M a t h e m a g i x 00003 ***************************************************************************** 00004 * ParametricCell 00005 * 2008-03-20 00006 * Julien Wintz 00007 ***************************************************************************** 00008 * Copyright (C) 2008 INRIA Sophia-Antipolis 00009 ***************************************************************************** 00010 * Comments : 00011 ****************************************************************************/ 00012 00013 # ifndef PARAMETRICCELL_H 00014 # define PARAMETRICCELL_H 00015 00016 # include <realroot/Seq.hpp> 00017 # include <shape/cell2d.hpp> 00018 00019 # define TMPL template<class C, class V> 00020 # define REF REF_OF(V) 00021 # define Cell2d cell2d<C,REF> 00022 # define ParametricCurve parametric_curve<C,V> 00023 # define SELF cell2d_parametric_curve<C,V> 00024 00025 namespace mmx { 00026 namespace shape { 00027 00028 00029 // TMPL struct cell2d_parametric_curve; 00030 00031 // TMPL struct with_cell2d_parametric_curve { 00032 // typedef cell2d_parametric_curve<K> Cell2dParametricCurve; 00033 // }; 00034 00035 00036 // TMPL struct cell2d_parametric_curve_def 00037 // :public cell2d_def<K> 00038 // ,public with_parametric_curve<K> 00039 // ,public with_cell2d_parametric_curve<K> { 00040 // }; 00041 00042 TMPL 00043 class cell2d_parametric_curve : public Cell2d 00044 { 00045 public: 00046 typedef bounding_box<C,REF> BoundingBox; 00047 //typedef cell<K> Cell; 00048 typedef cell<C,REF> Cell; 00049 typedef typename topology<C,V>::Point Point; 00050 typedef topology<C,V> Topology; 00051 00052 // Cell2dParametricCurve(void) ; 00053 // ~Cell2dParametricCurve(void) ; 00054 00055 cell2d_parametric_curve(ParametricCurve *, const BoundingBox &); 00056 00057 00058 bool is_active (void) { return true; } 00059 bool is_regular(void) ; 00060 bool is_intersected(void) { return true; } 00061 00062 virtual Point * pair(Point * p, int& sgn) { return NULL; }; 00063 virtual Point * starting_point(int sgn) { return NULL; }; 00064 00065 virtual bool insert_regular (Topology*) { return true; } ; 00066 virtual bool insert_singular(Topology*) { return true; } ; 00067 00068 00069 virtual void subdivide (Cell*& left, Cell*& right, int v, double s); 00070 00071 }; 00072 00073 00074 TMPL 00075 SELF::cell2d_parametric_curve(ParametricCurve * curve, const BoundingBox & bx) 00076 { 00077 00078 } 00079 00080 TMPL bool 00081 SELF::is_regular(void) 00082 { 00083 return false ; 00084 } 00085 00086 TMPL void 00087 SELF::subdivide(Cell*& left, Cell*& right, int v, double s) { 00088 // double xc = (bx->xmin()+bx->xmax())/2 ; 00089 // double yc = (bx->ymin()+bx->ymax())/2 ; 00090 00091 // SELF * nw = new SELF();//bx->xmin(), xc, yc, bx->ymax()) ; 00092 // SELF * ne = new SELF();//xc, bx->xmax(), yc, bx->ymax()) ; 00093 // SELF * sw = new SELF();//bx->xmin(), xc, bx->ymin(), yc) ; 00094 // SELF * se = new SELF();//xc, bx->xmax(), bx->ymin(), yc) ; 00095 00096 // foreach(point * p, n_intersections) { 00097 // if(p->x() <= xc) nw->northIntersectionpoints() << p ; 00098 // if(p->x() > xc) ne->northIntersectionpoints() << p ; 00099 // } 00100 00101 // foreach(point * p, s_intersections) { 00102 // if(p->x() <= xc) sw->southIntersectionpoints() << p ; 00103 // if(p->x() > xc) se->southIntersectionpoints() << p ; 00104 // } 00105 00106 // foreach(point * p, w_intersections) { 00107 // if(p->y() <= yc) sw->westIntersectionpoints() << p ; 00108 // if(p->y() > yc) nw->westIntersectionpoints() << p ; 00109 // } 00110 00111 // foreach(point * p, e_intersections) { 00112 // if(p->y() <= yc) se->eastIntersectionpoints() << p ; 00113 // if(p->y() > yc) ne->eastIntersectionpoints() << p ; 00114 // } 00115 00116 // foreach(point * p, m_critical) { 00117 // if(p->x() <= xc && p->y() <= yc) sw->criticalpoints() << p ; 00118 // if(p->x() <= xc && p->y() > yc) nw->criticalpoints() << p ; 00119 // if(p->x() > xc && p->y() <= yc) se->criticalpoints() << p ; 00120 // if(p->x() > xc && p->y() > yc) ne->criticalpoints() << p ; 00121 // } 00122 00123 // foreach(point * p, m_extremal) { 00124 // if(p->x() <= xc && p->y() <= yc) sw->extermalpoints() << p ; 00125 // if(p->x() <= xc && p->y() > yc) nw->extermalpoints() << p ; 00126 // if(p->x() > xc && p->y() <= yc) se->extermalpoints() << p ; 00127 // if(p->x() > xc && p->y() > yc) ne->extermalpoints() << p ; 00128 // } 00129 00130 // foreach(point * p, m_singular) { 00131 // if(p->x() <= xc && p->y() <= yc) sw->singularpoints() << p ; 00132 // if(p->x() <= xc && p->y() > yc) nw->singularpoints() << p ; 00133 // if(p->x() > xc && p->y() <= yc) se->singularpoints() << p ; 00134 // if(p->x() > xc && p->y() > yc) ne->singularpoints() << p ; 00135 // } 00136 00137 00138 // cells << (Cell *)nw ; cells << (Cell *)ne ; 00139 // cells << (Cell *)sw ; cells << (Cell *)se ; 00140 } 00141 00142 } ; // namespace shape 00143 } ; // namespace mmx 00144 # undef TMPL 00145 # undef SELF 00146 # undef Cell2d 00147 # undef ParametricCurve 00148 # undef Cell2dList 00149 # undef Cell2dFactory 00150 # undef Topology2d 00151 # endif // PARAMETRICCELL_H