#include <bcell2d_algebraic_curve.hpp>
Kernel for bcell2d_algebraic_curve Polynomial : the type of polynomial associated to this class. subdivisor : the function which subdivides the representation.
Definition at line 38 of file bcell2d_algebraic_curve.hpp.
void subdivide | ( | CELL & | cl, | |
CELL *& | left, | |||
CELL *& | right, | |||
int | v, | |||
double | s | |||
) | [inline, static] |
Definition at line 52 of file bcell2d_algebraic_curve.hpp.
References Point, Solver, and mmx::split().
00052 { 00053 00054 typedef typename topology<C,V>::Point Point; 00055 typedef solver_implicit<C,V> Solver; 00056 00057 00058 double eps =Approximate().eps; 00059 if(v==0) {//direction v=0 00060 left = new CELL(cl); left ->set_xmax(s); 00061 right= new CELL(cl); right->set_xmin(s); 00062 00063 tensor::split(left->m_polynomial, right->m_polynomial, v); 00064 if (left->e_intersections.size() == 0) 00065 Solver::edge_point(left->e_intersections, 00066 left->m_polynomial, Solver::east_edge, left->boundingBox()); 00067 right->w_intersections=left->e_intersections; 00068 left ->w_intersections=cl.w_intersections; 00069 right->e_intersections=cl.e_intersections; 00070 foreach(Point* p,cl.n_intersections) { 00071 if (p->x() == s) { 00072 left ->n_intersections<< p ; 00073 right->n_intersections<< p ; 00074 } else if(p->x() < s) 00075 left ->n_intersections << p ; 00076 else 00077 right->n_intersections << p ; 00078 } 00079 00080 foreach(Point* p,cl.s_intersections) { 00081 if (p->x() == s) { 00082 left ->s_intersections<< p ; 00083 right->s_intersections<< p ; 00084 } else if(p->x() < s) 00085 left ->s_intersections<< p ; 00086 else 00087 right->s_intersections<< p ; 00088 } 00089 00090 foreach(Point* p,cl.m_singular) { 00091 00092 if(p->x() < s+eps) 00093 left ->m_singular << p ; 00094 // else 00095 if(p->x() > s-eps) 00096 right->m_singular << p ; 00097 } 00098 00099 /* Update neighbors */ 00100 cl.connect0(left, right); 00101 left->join0(right); 00102 00103 00104 } else {//direction v==1 00105 00106 left = new CELL(cl); left->set_ymax(s); 00107 right= new CELL(cl); right->set_ymin(s); 00108 00109 00110 tensor::split(left->m_polynomial, right->m_polynomial, v); 00111 if (left->n_intersections.size() ==0) 00112 Solver::edge_point(left->n_intersections, 00113 left->m_polynomial, Solver::north_edge, left->boundingBox()); 00114 right->s_intersections=left->n_intersections; 00115 left ->s_intersections=cl.s_intersections; 00116 right->n_intersections=cl.n_intersections; 00117 foreach(Point* p,cl.w_intersections) { 00118 if(p->y() == s) { 00119 left ->w_intersections << p ; 00120 right->w_intersections << p ; 00121 } else if(p->y() < s) 00122 left ->w_intersections << p ; 00123 else 00124 right->w_intersections << p ; 00125 } 00126 00127 foreach(Point* p,cl.e_intersections) { 00128 if(p->y() == s) { 00129 left ->e_intersections << p ; 00130 right->e_intersections << p ; 00131 } else if(p->y() < s) 00132 left ->e_intersections << p ; 00133 else 00134 right->e_intersections << p ; 00135 } 00136 00137 foreach(Point* p,cl.m_singular) { 00138 if(p->y() < s+eps) 00139 left->m_singular << p ; 00140 // else 00141 if(p->y() > s-eps) 00142 right->m_singular << p ; 00143 } 00144 00145 foreach(Point* p,cl.m_xcritical) { 00146 if(p->y() < s+eps) 00147 left->m_xcritical << p ; 00148 // else 00149 if(p->y() > s-eps) 00150 right->m_xcritical << p ; 00151 } 00152 00153 foreach(Point* p,cl.m_ycritical) { 00154 if(p->y() < s+eps) 00155 left->m_ycritical << p ; 00156 // else 00157 if(p->y() > s-eps) 00158 right->m_ycritical << p ; 00159 } 00160 00161 /* Update neighbors */ 00162 cl.connect1(left, right); 00163 left->join1(right); 00164 00165 } 00166 /* disconnect parent */ 00167 cl.disconnect( ); 00168 00169 }