shape_doc 0.1
|
#include <cell2d_parametric_curve.hpp>
Definition at line 43 of file cell2d_parametric_curve.hpp.
typedef bounding_box<C, REF_OF(V) > BoundingBox |
Reimplemented from cell2d< C, REF_OF(V) >.
Definition at line 46 of file cell2d_parametric_curve.hpp.
Reimplemented from cell2d< C, REF_OF(V) >.
Definition at line 48 of file cell2d_parametric_curve.hpp.
Reimplemented in cell2d_algebraic_curve< C, V >, and cell2d_voronoi_site2d< C, V >.
Definition at line 63 of file cell2d.hpp.
Reimplemented from cell2d< C, REF_OF(V) >.
Definition at line 49 of file cell2d_parametric_curve.hpp.
Reimplemented from cell2d< C, REF_OF(V) >.
Definition at line 50 of file cell2d_parametric_curve.hpp.
cell2d_parametric_curve | ( | parametric_curve< C, V > * | curve, |
const BoundingBox & | bx | ||
) |
Definition at line 75 of file cell2d_parametric_curve.hpp.
{ }
BoundingBox boundingBox | ( | ) | const [inline, inherited] |
Definition at line 88 of file cell.hpp.
{ return (BoundingBox)*this; }
virtual Point center | ( | void | ) | const [inline, virtual, inherited] |
Definition at line 82 of file cell.hpp.
References bounding_box< C, V >::xmax(), bounding_box< C, V >::xmin(), bounding_box< C, V >::ymax(), bounding_box< C, V >::ymin(), bounding_box< C, V >::zmax(), and bounding_box< C, V >::zmin().
bool contains | ( | double | x, |
bool | strict = false |
||
) | [inherited] |
bool contains | ( | double | x, |
double | y, | ||
bool | strict = false |
||
) | [inherited] |
bool contains | ( | double | x, |
double | y, | ||
double | z, | ||
bool | strict = false |
||
) | [inherited] |
void disconnect | ( | ) | [inline, inherited] |
virtual bool insert_regular | ( | Topology * | ) | [inline, virtual] |
Implements cell< C, REF_OF(REF_OF(V)) >.
Definition at line 65 of file cell2d_parametric_curve.hpp.
{ return true; } ;
virtual bool insert_singular | ( | Topology * | ) | [inline, virtual] |
Implements cell< C, REF_OF(REF_OF(V)) >.
Definition at line 66 of file cell2d_parametric_curve.hpp.
{ return true; } ;
bounding_box<C,REF_OF(REF_OF(V)) >* intersect | ( | const bounding_box< C, REF_OF(REF_OF(V)) > & | other | ) | [inherited] |
void intersected | ( | bounding_box< C, REF_OF(REF_OF(V)) > * | other | ) | [inherited] |
virtual Seq<Point *> intersections | ( | ) | const [inline, virtual, inherited] |
Definition at line 96 of file cell2d.hpp.
References cell2d< C, V >::e_intersections, cell2d< C, V >::n_intersections, cell2d< C, V >::s_intersections, and cell2d< C, V >::w_intersections.
{ Seq<Point *> r; r<< this->s_intersections; r<< this->e_intersections; r<< this->n_intersections.reversed(); r<< this->w_intersections.reversed(); return ( r ); }
virtual Seq<Point *> intersections | ( | int | i | ) | const [inline, virtual, inherited] |
Definition at line 105 of file cell2d.hpp.
References cell2d< C, V >::e_intersections, cell2d< C, V >::n_intersections, cell2d< C, V >::s_intersections, and cell2d< C, V >::w_intersections.
{ switch(i) { case 0: return s_intersections; case 1: return e_intersections; case 2: return n_intersections.reversed(); case 3: return w_intersections.reversed(); default: return (Seq<Point *>()); } }
bool intersects | ( | bounding_box< C, REF_OF(REF_OF(V)) > * | other, |
bool | strict = true |
||
) | [inherited] |
bool is0D | ( | void | ) | const [inline, inherited] |
Definition at line 80 of file bounding_box.hpp.
{ return ((m_xmin == m_xmax) && (m_ymin == m_ymax) && (m_zmin == m_zmax)) ; }
bool is1D | ( | void | ) | const [inline, inherited] |
Definition at line 81 of file bounding_box.hpp.
{ return ((m_xmin != m_xmax) && (m_ymin == m_ymax) && (m_zmin == m_zmax)) ; }
bool is2D | ( | void | ) | const [inline, inherited] |
Definition at line 82 of file bounding_box.hpp.
{ return ((m_xmin != m_xmax) && (m_ymin != m_ymax) && (m_zmin == m_zmax)) ; }
bool is3d | ( | void | ) | const [inline, inherited] |
Definition at line 83 of file bounding_box.hpp.
{ return ((m_xmin != m_xmax) && (m_ymin != m_ymax) && (m_zmin != m_zmax)) ; }
bool is_active | ( | void | ) | [inline, virtual] |
Implements cell< C, REF_OF(REF_OF(V)) >.
Definition at line 58 of file cell2d_parametric_curve.hpp.
{ return true; }
bool is_border | ( | void | ) | const [inline, inherited] |
Definition at line 121 of file cell2d.hpp.
References cell2d< C, V >::e_neighbors, cell2d< C, V >::n_neighbors, cell2d< C, V >::s_neighbors, and cell2d< C, V >::w_neighbors.
{ return ( this->s_neighbors.size()==0 || this->e_neighbors.size()==0 || this->n_neighbors.size()==0 || this->w_neighbors.size()==0 ); }
bool is_corner | ( | void | ) | const [inherited] |
bool is_intersected | ( | void | ) | [inline, virtual] |
Implements cell< C, REF_OF(REF_OF(V)) >.
Definition at line 60 of file cell2d_parametric_curve.hpp.
{ return true; }
bool is_regular | ( | void | ) | [virtual] |
Implements cell< C, REF_OF(REF_OF(V)) >.
Definition at line 81 of file cell2d_parametric_curve.hpp.
{
return false ;
}
void join0 | ( | cell2d< C, REF_OF(V) > * | b | ) | [inline, inherited] |
void join1 | ( | cell2d< C, REF_OF(V) > * | b | ) | [inline, inherited] |
virtual unsigned nb_intersect | ( | void | ) | const [inline, virtual, inherited] |
Definition at line 89 of file cell2d.hpp.
References cell2d< C, V >::e_intersections, cell2d< C, V >::n_intersections, cell2d< C, V >::s_intersections, and cell2d< C, V >::w_intersections.
Referenced by cell2d_voronoi_site2d< C, V >::is_intersected(), and cell2d_algebraic_curve< C, V >::is_intersected().
{ return (this->n_intersections.size()+ this->s_intersections.size()+ this->e_intersections.size()+ this->w_intersections.size() ); }
Definition at line 175 of file cell2d.hpp.
References cell2d< C, V >::e_intersections, cell2d< C, V >::e_neighbors, cell2d< C, V >::n_intersections, cell2d< C, V >::n_neighbors, cell2d< C, V >::s_intersections, cell2d< C, V >::s_neighbors, cell2d< C, V >::w_intersections, and cell2d< C, V >::w_neighbors.
{ foreach( cell2d *c, this->s_neighbors ) if ( c->n_intersections.member(p) ) { return c; } foreach( cell2d *c, this->e_neighbors ) if ( c->w_intersections.member(p) ) { return c; } foreach( cell2d *c, this->n_neighbors ) if ( c->s_intersections.member(p) ) { return c; } foreach( cell2d *c, this->w_neighbors ) if ( c->e_intersections.member(p) ) { return c; } // Point p on boundary. //std::cout<<"... Point ("<<p->x()<<","<<p->y()<<") not found on neighbors of "<< this<<"("<<this->neighbors().size() <<")"<<std::endl; return NULL; }
virtual Seq<cell2d *> neighbors | ( | ) | [inline, virtual, inherited] |
Definition at line 162 of file cell2d.hpp.
References cell2d< C, V >::e_neighbors, cell2d< C, V >::n_neighbors, cell2d< C, V >::s_neighbors, and cell2d< C, V >::w_neighbors.
{ Seq<cell2d *> r; r<< this->s_neighbors; r<< this->e_neighbors; r<< this->n_neighbors; r<< this->w_neighbors; return ( r ); }
double operator() | ( | unsigned | v, |
unsigned | s | ||
) | const [inherited] |
double& operator() | ( | unsigned | v, |
unsigned | s | ||
) | [inherited] |
bounding_box<C,REF_OF(REF_OF(V)) >* operator* | ( | const bounding_box< C, REF_OF(REF_OF(V)) > & | other | ) | [inline, inherited] |
Definition at line 103 of file bounding_box.hpp.
{ return intersect(other) ; }
bounding_box<C,REF_OF(REF_OF(V)) >* operator+ | ( | const bounding_box< C, REF_OF(REF_OF(V)) > & | other | ) | [inline, inherited] |
Definition at line 104 of file bounding_box.hpp.
{ return unite(other) ; }
Definition at line 62 of file cell2d_parametric_curve.hpp.
{ return NULL; };
cell2d_voronoi_site2d< C, V >::Point * pair | ( | Point * | p, |
int & | sgn | ||
) | [pure virtual, inherited] |
Definition at line 585 of file cell2d_algebraic_curve.hpp.
{ // Pair: returns a neighboring point on the component (p,sgn) // The candidates are the 2 neighbor intersections of p in *this Seq<Point*> all; int a; all= this->intersections(); a = all.size(); if (a==2)// regular cell with a single branch { return (all[0]==p ? all[1]: all[0]); } if (a==1) { std::cout<<"Only 1 intersection point in "<< *this <<" (i.e."<<*all[0] <<")"<<std::endl; // if ( abs( l[0]->x()-this->xmin()<EPSILON) && // abs( l[0]->y()-this->ymin()<EPSILON) ) return (p); } int s=this->s_intersections.size() ,// ~0 e=this->e_intersections.size() ,// ~1 //n=this->n_intersections.size() ,// ~2 w=this->w_intersections.size() ;// ~3 int j,k,i= all.search(p); //if (this->is_regular() ) { if (this->m_singular.size()==0 ) { Vector grq, grp = this->gradient(*p); foreach(Point* q, all) if ( q != p) { grq = this->gradient(*q); if(grp[0]*grq[0]>0 && grp[1]*grq[1]>0 ) return (q); } //box has 2 or more "identical" branches //p is part of critical branch std::cout<<"...maybe pair Trouble"<< this<<std::endl; for (int v=0;v<a;v++) for (int w=v+1;w<a;v++) { grp= this->gradient(*all[v]); grq= this->gradient(*all[w]); if( grp[0]*grq[0]>0 && grp[1]*grq[1]>0 ) { for (int u=0; u<a;u++) if ( u!=v && u!=w && all[u]!=p ) return (all[u]); } } std::cout<<"empty BOX:("<<this->m_singular.size()<<",a="<<a<<")"<<this <<std::endl; foreach(Point*v,all) { Vector gr= this->gradient(*v); //std::cout<<"("<<v->x()<<","<<v->y()<<"): "; std::cout<<(gr[0]>0?1:-1)<<","<<(gr[1]>0?1:-1) <<std::endl; } //look non-tangent direction foreach(Point* q, all) if ( q != p) { grq = this->gradient(*q); if( abs(grp[0]) < 0.017) { if (grp[1]*grq[1]>0) return (q); } else if ( abs(grp[1])< 0.01) { if (grp[0]*grq[0]>0) return (q); } } std::cout<<"...pair Trouble"<< this<<std::endl; // foreach(Point* q, all) // if ( q != p) // { return (all[0]); // } } else {//singular box //std::cout<< "SBOX: " <<this <<std::endl; //std::cout<< " " <<all <<std::endl; //for (unsigned y=0;y<4;y++) //std::cout<<y <<": ("<<all[y]->x()<<","<<all[y]->y()<<")"<<std::endl; // Cell with 1 self-intersection int ev(0); int u, v;//side of p, ln resp. j= ( i!=0 ? i-1 : a-1 ); k= ( i!=a-1 ? i+1 : 0 ); //std::cout<<"j,i,k (left,p,right)="<<j <<" "<<i << " "<<k<< std::endl; Point *ln= all[j], *rn= all[k] ; //std::cout<<"i= "<< i<<", j=" <<j<< std::endl; // std::cout<<"("<<a<<")"<<s<<", "<<e<<", "<<n<<", "<<w<< std::endl; u= ( i<s ? 0 : ( i<s+e ? 1 : ( i<a-w ? 2 : 3 ))); v= ( j<s ? 0 : ( j<s+e ? 1 : ( j<a-w ? 2 : 3 ))); int * sz = this->m_polynomial.rep().szs(); int * st = this->m_polynomial.rep().str(); switch (u){ case 0: ev= (this->m_polynomial[0] >0 ? 1:-1); if (v==0 && j%2==0) // p, ln on the same face ev*=-1; break; case 1: ev= (this->m_polynomial[(sz[0]-1)*st[0]] >0 ? 1:-1); if (v==1 && (j-s)%2==0) // p, ln on the same face ev*=-1; break; case 2: ev= (this->m_polynomial[sz[0]*sz[1]-1]>0 ? 1:-1); if (v==2 && (j-s-e)%2==0) // p, ln on the same face ev*=-1; break; case 3: ev= (this->m_polynomial[(sz[1]-1)*st[1]] >0 ? 1:-1); if (v==3 && (j-a+w)%2==0) // p, ln on the same face ev*=-1; break; } // std::cout<<"Cell"<<this <<"("<<(sgn==1 ? "+": "-")<<")" <<std::endl; // std::cout<<"u= "<< u<<", v=" <<v<<", ev=" <<ev << std::endl; // std::cout<<"ln= "<< ln->x()<<","<<ln->y() << std::endl; // std::cout<<"p = "<< p->x()<<","<<p->y() << std::endl; // std::cout<<"rn= "<< rn->x()<<","<<rn->y() << std::endl; // if (ev*sgn>0) std::cout<<"result is ln"<< std::endl; // else std::cout<<"result is rn"<< std::endl; if (ev*sgn>0) return ln; else return rn; } }
void set_xmax | ( | double | x | ) | [inline, inherited] |
Definition at line 74 of file bounding_box.hpp.
{ this->m_xmax = x ; }
void set_xmin | ( | double | x | ) | [inline, inherited] |
Definition at line 73 of file bounding_box.hpp.
{ this->m_xmin = x ; }
void set_ymax | ( | double | y | ) | [inline, inherited] |
Definition at line 76 of file bounding_box.hpp.
{ this->m_ymax = y ; }
void set_ymin | ( | double | y | ) | [inline, inherited] |
Definition at line 75 of file bounding_box.hpp.
{ this->m_ymin = y ; }
void set_zmax | ( | double | z | ) | [inline, inherited] |
Definition at line 78 of file bounding_box.hpp.
{ this->m_zmax = z ; }
void set_zmin | ( | double | z | ) | [inline, inherited] |
Definition at line 77 of file bounding_box.hpp.
{ this->m_zmin = z ; }
int side | ( | Point * | p | ) | [inline, inherited] |
Definition at line 140 of file cell2d.hpp.
References cell2d< C, V >::e_intersections, cell2d< C, V >::intersections(), cell2d< C, V >::s_intersections, and cell2d< C, V >::w_intersections.
{ Seq<Point*> all; int s,i,a; s = s_intersections.size(); all = this->intersections(); a = all.size(); i = all.search(p); if (i==-1) return (-1); else return ( i<s ? 0 : ( i<s+(int)e_intersections.size() ? 1 : ( i<a-(int)w_intersections.size() ? 2 : 3 ))); }
double size | ( | void | ) | [inherited] |
virtual void split_position | ( | int & | v, |
double & | t | ||
) | [virtual, inherited] |
Implements cell< C, REF_OF(REF_OF(V)) >.
virtual Point* starting_point | ( | int | sgn | ) | [inline, virtual] |
Implements cell2d< C, REF_OF(V) >.
Definition at line 63 of file cell2d_parametric_curve.hpp.
{ return NULL; };
Definition at line 87 of file cell2d_parametric_curve.hpp.
{ // double xc = (bx->xmin()+bx->xmax())/2 ; // double yc = (bx->ymin()+bx->ymax())/2 ; // SELF * nw = new SELF();//bx->xmin(), xc, yc, bx->ymax()) ; // SELF * ne = new SELF();//xc, bx->xmax(), yc, bx->ymax()) ; // SELF * sw = new SELF();//bx->xmin(), xc, bx->ymin(), yc) ; // SELF * se = new SELF();//xc, bx->xmax(), bx->ymin(), yc) ; // foreach(point * p, n_intersections) { // if(p->x() <= xc) nw->northIntersectionpoints() << p ; // if(p->x() > xc) ne->northIntersectionpoints() << p ; // } // foreach(point * p, s_intersections) { // if(p->x() <= xc) sw->southIntersectionpoints() << p ; // if(p->x() > xc) se->southIntersectionpoints() << p ; // } // foreach(point * p, w_intersections) { // if(p->y() <= yc) sw->westIntersectionpoints() << p ; // if(p->y() > yc) nw->westIntersectionpoints() << p ; // } // foreach(point * p, e_intersections) { // if(p->y() <= yc) se->eastIntersectionpoints() << p ; // if(p->y() > yc) ne->eastIntersectionpoints() << p ; // } // foreach(point * p, m_critical) { // if(p->x() <= xc && p->y() <= yc) sw->criticalpoints() << p ; // if(p->x() <= xc && p->y() > yc) nw->criticalpoints() << p ; // if(p->x() > xc && p->y() <= yc) se->criticalpoints() << p ; // if(p->x() > xc && p->y() > yc) ne->criticalpoints() << p ; // } // foreach(point * p, m_extremal) { // if(p->x() <= xc && p->y() <= yc) sw->extermalpoints() << p ; // if(p->x() <= xc && p->y() > yc) nw->extermalpoints() << p ; // if(p->x() > xc && p->y() <= yc) se->extermalpoints() << p ; // if(p->x() > xc && p->y() > yc) ne->extermalpoints() << p ; // } // foreach(point * p, m_singular) { // if(p->x() <= xc && p->y() <= yc) sw->singularpoints() << p ; // if(p->x() <= xc && p->y() > yc) nw->singularpoints() << p ; // if(p->x() > xc && p->y() <= yc) se->singularpoints() << p ; // if(p->x() > xc && p->y() > yc) ne->singularpoints() << p ; // } // cells << (Cell *)nw ; cells << (Cell *)ne ; // cells << (Cell *)sw ; cells << (Cell *)se ; }
virtual void subdivide | ( | cell< C, REF_OF(REF_OF(V)) > *& | left, |
cell< C, REF_OF(REF_OF(V)) > *& | right, | ||
int | v, | ||
double | s | ||
) | [pure virtual, inherited] |
virtual int subdivide | ( | cell< C, REF_OF(REF_OF(V)) > *& | left, |
cell< C, REF_OF(REF_OF(V)) > *& | right | ||
) | [virtual, inherited] |
bounding_box<C,REF_OF(REF_OF(V)) >* unite | ( | bounding_box< C, REF_OF(REF_OF(V)) > * | other | ) | [inherited] |
void united | ( | bounding_box< C, REF_OF(REF_OF(V)) > * | other | ) | [inherited] |
bool unites | ( | bounding_box< C, REF_OF(REF_OF(V)) > * | other, |
bool | strict = true |
||
) | [inherited] |
double xmax | ( | void | ) | [inline, inherited] |
Definition at line 56 of file bounding_box.hpp.
{ return m_xmax ; }
double xmax | ( | void | ) | const [inline, inherited] |
Definition at line 63 of file bounding_box.hpp.
{ return m_xmax ; }
double xmin | ( | void | ) | const [inline, inherited] |
Definition at line 62 of file bounding_box.hpp.
{ return m_xmin ; }
double xmin | ( | void | ) | [inline, inherited] |
Definition at line 55 of file bounding_box.hpp.
{ return m_xmin ; }
double xsize | ( | void | ) | const [inline, inherited] |
Definition at line 69 of file bounding_box.hpp.
double ymax | ( | void | ) | [inline, inherited] |
Definition at line 58 of file bounding_box.hpp.
{ return m_ymax ; }
double ymax | ( | void | ) | const [inline, inherited] |
Definition at line 65 of file bounding_box.hpp.
{ return m_ymax ; }
double ymin | ( | void | ) | [inline, inherited] |
Definition at line 57 of file bounding_box.hpp.
{ return m_ymin ; }
double ymin | ( | void | ) | const [inline, inherited] |
Definition at line 64 of file bounding_box.hpp.
{ return m_ymin ; }
double ysize | ( | void | ) | const [inline, inherited] |
Definition at line 70 of file bounding_box.hpp.
double zmax | ( | void | ) | [inline, inherited] |
Definition at line 60 of file bounding_box.hpp.
{ return m_zmax ; }
double zmax | ( | void | ) | const [inline, inherited] |
Definition at line 67 of file bounding_box.hpp.
{ return m_zmax ; }
double zmin | ( | void | ) | [inline, inherited] |
Definition at line 59 of file bounding_box.hpp.
{ return m_zmin ; }
double zmin | ( | void | ) | const [inline, inherited] |
Definition at line 66 of file bounding_box.hpp.
{ return m_zmin ; }
double zsize | ( | void | ) | const [inline, inherited] |
Definition at line 71 of file bounding_box.hpp.
Seq<Point *> e_intersections [inherited] |
Definition at line 130 of file cell2d.hpp.
Referenced by cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve().
Seq<cell2d *> e_neighbors [inherited] |
Definition at line 171 of file cell2d.hpp.
Definition at line 138 of file cell2d.hpp.
Seq<Point *> m_singular [inherited] |
Definition at line 133 of file cell2d.hpp.
Referenced by cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve().
double m_xmax [protected, inherited] |
Definition at line 107 of file bounding_box.hpp.
double m_xmin [protected, inherited] |
Definition at line 107 of file bounding_box.hpp.
double m_ymax [protected, inherited] |
Definition at line 108 of file bounding_box.hpp.
double m_ymin [protected, inherited] |
Definition at line 108 of file bounding_box.hpp.
double m_zmax [protected, inherited] |
Definition at line 109 of file bounding_box.hpp.
double m_zmin [protected, inherited] |
Definition at line 109 of file bounding_box.hpp.
Seq<Point *> n_intersections [inherited] |
Definition at line 131 of file cell2d.hpp.
Referenced by cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve().
Seq<cell2d *> n_neighbors [inherited] |
Definition at line 172 of file cell2d.hpp.
Seq<Point *> s_intersections [inherited] |
Definition at line 129 of file cell2d.hpp.
Referenced by cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve().
Seq<cell2d *> s_neighbors [inherited] |
Definition at line 170 of file cell2d.hpp.
Seq<Point *> w_intersections [inherited] |
Definition at line 132 of file cell2d.hpp.
Referenced by cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve().
Seq<cell2d *> w_neighbors [inherited] |
Definition at line 173 of file cell2d.hpp.