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 shape_bcell2d_parametric_hpp 00014 # define shape_bcell2d_parametric_hpp 00015 00016 # include <realroot/Seq.hpp> 00017 # include <shape/bcell2d.hpp> 00018 00019 # define TMPL template<class C, class V> 00020 # define REF REF_OF(V) 00021 # define Cell2d bcell2d<C,REF> 00022 # define ParametricCurve parametric_curve<C,V> 00023 # define SELF bcell2d_parametric_curve<C,V> 00024 00025 namespace mmx { namespace shape { 00026 00027 00028 TMPL 00029 class bcell2d_parametric_curve : public Cell2d 00030 { 00031 public: 00032 typedef bounding_box<C,REF> BoundingBox; 00033 //typedef bcell<K> Cell; 00034 typedef bcell<C,REF> Cell; 00035 typedef typename topology<C,V>::Point Point; 00036 typedef topology<C,V> Topology; 00037 00038 // Cell2dParametricCurve(void) ; 00039 // ~Cell2dParametricCurve(void) ; 00040 00041 bcell2d_parametric_curve(ParametricCurve *, const BoundingBox &); 00042 00043 00044 bool is_active (void) { return true; } 00045 bool is_regular(void) ; 00046 bool is_intersected(void) { return true; } 00047 00048 virtual Point * pair(Point * p, int& sgn) { return NULL; }; 00049 virtual Point * starting_point(int sgn) { return NULL; }; 00050 00051 virtual bool insert_regular (Topology*) { return true; } ; 00052 virtual bool insert_singular(Topology*) { return true; } ; 00053 00054 00055 virtual void subdivide (Cell*& left, Cell*& right, int v, double s); 00056 00057 }; 00058 00059 00060 TMPL 00061 SELF::bcell2d_parametric_curve(ParametricCurve * curve, const BoundingBox & bx) 00062 { 00063 00064 } 00065 00066 TMPL bool 00067 SELF::is_regular(void) 00068 { 00069 return false ; 00070 } 00071 00072 TMPL void 00073 SELF::subdivide(Cell*& left, Cell*& right, int v, double s) { 00074 // double xc = (bx->xmin()+bx->xmax())/2 ; 00075 // double yc = (bx->ymin()+bx->ymax())/2 ; 00076 00077 // SELF * nw = new SELF();//bx->xmin(), xc, yc, bx->ymax()) ; 00078 // SELF * ne = new SELF();//xc, bx->xmax(), yc, bx->ymax()) ; 00079 // SELF * sw = new SELF();//bx->xmin(), xc, bx->ymin(), yc) ; 00080 // SELF * se = new SELF();//xc, bx->xmax(), bx->ymin(), yc) ; 00081 00082 // foreach(point * p, n_intersections) { 00083 // if(p->x() <= xc) nw->northIntersectionpoints() << p ; 00084 // if(p->x() > xc) ne->northIntersectionpoints() << p ; 00085 // } 00086 00087 // foreach(point * p, s_intersections) { 00088 // if(p->x() <= xc) sw->southIntersectionpoints() << p ; 00089 // if(p->x() > xc) se->southIntersectionpoints() << p ; 00090 // } 00091 00092 // foreach(point * p, w_intersections) { 00093 // if(p->y() <= yc) sw->westIntersectionpoints() << p ; 00094 // if(p->y() > yc) nw->westIntersectionpoints() << p ; 00095 // } 00096 00097 // foreach(point * p, e_intersections) { 00098 // if(p->y() <= yc) se->eastIntersectionpoints() << p ; 00099 // if(p->y() > yc) ne->eastIntersectionpoints() << p ; 00100 // } 00101 00102 // foreach(point * p, m_critical) { 00103 // if(p->x() <= xc && p->y() <= yc) sw->criticalpoints() << p ; 00104 // if(p->x() <= xc && p->y() > yc) nw->criticalpoints() << p ; 00105 // if(p->x() > xc && p->y() <= yc) se->criticalpoints() << p ; 00106 // if(p->x() > xc && p->y() > yc) ne->criticalpoints() << p ; 00107 // } 00108 00109 // foreach(point * p, m_extremal) { 00110 // if(p->x() <= xc && p->y() <= yc) sw->extermalpoints() << p ; 00111 // if(p->x() <= xc && p->y() > yc) nw->extermalpoints() << p ; 00112 // if(p->x() > xc && p->y() <= yc) se->extermalpoints() << p ; 00113 // if(p->x() > xc && p->y() > yc) ne->extermalpoints() << p ; 00114 // } 00115 00116 // foreach(point * p, m_singular) { 00117 // if(p->x() <= xc && p->y() <= yc) sw->singularpoints() << p ; 00118 // if(p->x() <= xc && p->y() > yc) nw->singularpoints() << p ; 00119 // if(p->x() > xc && p->y() <= yc) se->singularpoints() << p ; 00120 // if(p->x() > xc && p->y() > yc) ne->singularpoints() << p ; 00121 // } 00122 00123 00124 // bcells << (Cell *)nw ; bcells << (Cell *)ne ; 00125 // bcells << (Cell *)sw ; bcells << (Cell *)se ; 00126 } 00127 00128 } ; // namespace shape 00129 } ; // namespace mmx 00130 # undef TMPL 00131 # undef SELF 00132 # undef Cell2d 00133 # undef ParametricCurve 00134 # undef Cell2dList 00135 # undef Cell2dFactory 00136 # undef Mesher2d 00137 # endif // PARAMETRICCELL_H