bcell2d_voronoi_site2d< C, V > Struct Template Reference

#include <bcell2d_voronoi_site2d.hpp>

Inheritance diagram for bcell2d_voronoi_site2d< C, V >:
bcell2d_algebraic_curve< C, V > bcell2d< C, REF_OF(V) > bcell< C, REF_OF(REF_OF(V)) > cell< C, V > bounding_box< C, V >

List of all members.

Public Types

Public Member Functions

Public Attributes

Protected Attributes


Detailed Description

template<class C, class V>
struct mmx::shape::bcell2d_voronoi_site2d< C, V >

Definition at line 77 of file bcell2d_voronoi_site2d.hpp.


Member Typedef Documentation

typedef algebraic_curve<C, REF_OF(V) > AlgebraicCurve [inherited]

Definition at line 186 of file bcell2d_algebraic_curve.hpp.

typedef algebraic_set<C, REF_OF(V) > AlgebraicSet [inherited]

Definition at line 185 of file bcell2d_algebraic_curve.hpp.

typedef bounding_box<C, REF_OF(V) > BoundingBox

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 88 of file bcell2d_voronoi_site2d.hpp.

typedef bcell<C, REF_OF(V) > Cell

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 84 of file bcell2d_voronoi_site2d.hpp.

typedef mesher2d<C,V>::Edge Edge

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 83 of file bcell2d_voronoi_site2d.hpp.

typedef mesher2d<C,V> Mesher2d

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 93 of file bcell2d_voronoi_site2d.hpp.

typedef mesher2d<C,V>::Point Point

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 79 of file bcell2d_voronoi_site2d.hpp.

typedef Seq<Point*> Points [inherited]

Definition at line 179 of file bcell2d_algebraic_curve.hpp.

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 87 of file bcell2d_voronoi_site2d.hpp.

typedef C Scalar [inherited]

Definition at line 176 of file bcell2d_algebraic_curve.hpp.

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 91 of file bcell2d_voronoi_site2d.hpp.

typedef topology<C,V> Topology

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 92 of file bcell2d_voronoi_site2d.hpp.

typedef point<C,2, REF_OF(V) > Vector

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 81 of file bcell2d_voronoi_site2d.hpp.


Constructor & Destructor Documentation

bcell2d_voronoi_site2d ( const Polynomial pol,
const BoundingBox bx 
) [inline]

Definition at line 183 of file bcell2d_voronoi_site2d.hpp.

00184   : Cell2dAlgebraicCurve(pol,bx)
00185 {
00186   //low=upp=NULL;
00187 }

bcell2d_voronoi_site2d ( const char *  s,
const BoundingBox b 
) [inline]

Definition at line 191 of file bcell2d_voronoi_site2d.hpp.

00192   : Cell2dAlgebraicCurve(s,b)
00193 {
00194   //low=upp=NULL;
00195 }

bcell2d_voronoi_site2d ( voronoi_site2d< C, V > *  cv,
const BoundingBox b 
) [inline]

Definition at line 198 of file bcell2d_voronoi_site2d.hpp.

00199   : Cell2dAlgebraicCurve(cv->distfunc(),b)
00200 {
00201   //low=upp=NULL;
00202   //std::cout<<"created voronoi bcell" <<std::endl;    
00203 
00204 }

bcell2d_voronoi_site2d ( const bcell2d_voronoi_site2d< C, V > &  cl  )  [inline]

Definition at line 99 of file bcell2d_voronoi_site2d.hpp.

00100   : Cell2dAlgebraicCurve(cl) {}


Member Function Documentation

BoundingBox boundingBox (  )  const [inline, inherited]

Definition at line 71 of file cell.hpp.

00071 { return (BoundingBox)*this; }

void compute_boundary (  )  [inline]

Definition at line 143 of file bcell2d_voronoi_site2d.hpp.

00144   {
00145     
00146     //   BoundingBox * b( (BoundingBox*)this );
00147     //Seq<mmx::GMP::rational> bx;
00148     //bx<<as<mmx::GMP::rational>( ((BoundingBox*)this)->xmin());
00149     //bx<<as<mmx::GMP::rational>(this->xmax());
00150     //bx<<as<mmx::GMP::rational>(this->ymin());
00151     //bx<<as<mmx::GMP::rational>(this->ymax());
00152     
00153     //Solver::edge_point(this->n_intersections, this->m_polynomial, Solver::north_edge, b);
00154     //Solver::edge_point(this->s_intersections, this->m_polynomial, Solver::south_edge, b);
00155     //Solver::edge_point(this->w_intersections, this->m_polynomial, Solver::west_edge , b);
00156     //Solver::edge_point(this->e_intersections, this->m_polynomial, Solver::east_edge , b);
00157     // Solver::extremal(this->m_singular, this->m_polynomial, b); 
00158 
00159   }

void connect0 ( bcell2d< C , REF_OF(V) > *  a,
bcell2d< C , REF_OF(V) > *  b 
) [inline, inherited]
void connect1 ( bcell2d< C , REF_OF(V) > *  a,
bcell2d< C , REF_OF(V) > *  b 
) [inline, inherited]
bool contains ( double  x,
double  y,
double  z,
bool  strict = false 
) [inline, inherited]

Definition at line 226 of file bounding_box.hpp.

References bounding_box< C, V >::m_xmax, bounding_box< C, V >::m_xmin, bounding_box< C, V >::m_ymax, bounding_box< C, V >::m_ymin, bounding_box< C, V >::m_zmax, and bounding_box< C, V >::m_zmin.

00227 {
00228     if(!strict)
00229         return (((m_xmin <= x) && (x <= m_xmax))
00230                 &&   ((m_ymin <= y) && (y <= m_ymax))
00231                 &&   ((m_zmin <= z) && (z <= m_zmax)))  ;
00232     else
00233         return (((m_xmin <  x) && (x <  m_xmax))
00234                 &&   ((m_ymin <  y) && (y <  m_ymax))
00235                 &&   ((m_zmin <  z) && (z <  m_zmax)))  ;
00236 }

bool contains ( double  x,
double  y,
bool  strict = false 
) [inline, inherited]

Definition at line 215 of file bounding_box.hpp.

References bounding_box< C, V >::m_xmax, bounding_box< C, V >::m_xmin, bounding_box< C, V >::m_ymax, and bounding_box< C, V >::m_ymin.

00216 {
00217     if(!strict)
00218         return (((m_xmin <= x) && (x <= m_xmax))
00219                 &&   ((m_ymin <= y) && (y <= m_ymax))) ;
00220     else
00221         return (((m_xmin <  x) && (x <  m_xmax))
00222                 &&   ((m_ymin <  y) && (y <  m_ymax))) ;
00223 }

bool contains ( double  x,
bool  strict = false 
) [inline, inherited]

Definition at line 206 of file bounding_box.hpp.

References bounding_box< C, V >::m_xmax, and bounding_box< C, V >::m_xmin.

00207 {
00208     if(!strict)
00209         return (((m_xmin <= x) && (x <= m_xmax))) ;
00210     else
00211         return (((m_xmin <  x) && (x <  m_xmax))) ;
00212 }

void disconnect (  )  [inline, inherited]
Polynomial equation ( void   )  [inline]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 102 of file bcell2d_voronoi_site2d.hpp.

References bcell2d_algebraic_curve< C, V >::m_polynomial.

00102 { return  this->m_polynomial; }

bcell2d_voronoi_site2d< C, V >::Vector gradient ( const Point p  )  [inline]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 241 of file bcell2d_voronoi_site2d.hpp.

References mmx::diff(), bcell2d_algebraic_curve< C, V >::m_polynomial, bounding_box< C, V >::xmax(), bounding_box< C, V >::xmin(), bounding_box< C, V >::ymax(), and bounding_box< C, V >::ymin().

00241                              {
00242   Polynomial 
00243     dx= diff(this->m_polynomial,0),
00244     dy= diff(this->m_polynomial,1);
00245   double 
00246     u0= (p[0]-this->xmin())/(this->xmax()-this->xmin()),
00247     u1= (p[1]-this->ymin())/(this->ymax()-this->ymin());
00248   Vector v;
00249   v[0] = dx(u0,u1);
00250   v[1] = dy(u0,u1);
00251   return v;
00252 }

bool insert_regular ( Topology t  )  [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 220 of file bcell2d_voronoi_site2d.hpp.

References topology< C, V >::insert().

00220                                 {
00221 
00222   //std::cout<<"regular voronoi bcell" <<std::endl;    
00223     t->insert((BoundingBox*)this,false);
00224     return true;
00225 
00226 }

bool insert_singular ( Topology t  )  [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 229 of file bcell2d_voronoi_site2d.hpp.

00229                                  {
00230 
00231     return true;
00232   }

bounding_box< C, V > * intersect ( const bounding_box< C, V > &  other  )  [inline, inherited]

Definition at line 319 of file bounding_box.hpp.

References mmx::shape::mmxmax(), mmx::shape::mmxmin(), SELF, 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().

Referenced by bounding_box< double, V >::operator*().

00319                                  {
00320     SELF * bcell = new SELF ;
00321     bcell->set_xmin(mmxmax(this->xmin(), other.xmin())) ;
00322     bcell->set_xmax(mmxmin(this->xmax(), other.xmax())) ;
00323     bcell->set_ymin(mmxmax(this->ymin(), other.ymin())) ;
00324     bcell->set_ymax(mmxmin(this->ymax(), other.ymax())) ;
00325     bcell->set_zmin(mmxmax(this->zmin(), other.zmin())) ;
00326     bcell->set_zmax(mmxmin(this->zmax(), other.zmax())) ;
00327     return bcell ;
00328 }

void intersected ( bounding_box< C, V > *  other  )  [inline, inherited]
virtual Seq<Point *> intersections ( int  i  )  const [inline, virtual, inherited]

Definition at line 98 of file bcell2d.hpp.

References bcell2d< C, V >::e_intersections, bcell2d< C, V >::n_intersections, Seq< C, R >::reversed(), bcell2d< C, V >::s_intersections, and bcell2d< C, V >::w_intersections.

00098                                                  {
00099       switch(i) {
00100       case 0:
00101           return s_intersections;
00102       case 1:
00103           return e_intersections;
00104       case 2:
00105           return n_intersections.reversed();
00106       case 3:
00107           return w_intersections.reversed();
00108       default:
00109           return (Seq<Point *>());
00110       }
00111 
00112   }

virtual Seq<Point *> intersections (  )  const [inline, virtual, inherited]

Definition at line 84 of file bcell2d.hpp.

References bcell2d< C, V >::e_intersections, bcell2d< C, V >::n_intersections, Seq< C, R >::reversed(), bcell2d< C, V >::s_intersections, and bcell2d< C, V >::w_intersections.

Referenced by bcell2d_voronoi_site2d< C, V >::pair(), bcell2d_algebraic_curve< C, V >::pair(), bcell2d_voronoi_site2d< C, V >::starting_point(), and bcell2d_algebraic_curve< C, V >::starting_point().

00084                                             {
00085 //      std::cout<<"Intersection "
00086 //              << this->n_intersections.size()<<" "
00087 //              << this->s_intersections.size()<<" "
00088 //              << this->e_intersections.size()<<" "
00089 //              << this->w_intersections.size()<<std::endl;
00090       Seq<Point *> r;
00091       r<< this->s_intersections;
00092       r<< this->e_intersections;
00093       r<< this->n_intersections.reversed();
00094       r<< this->w_intersections.reversed();
00095   return ( r ); 
00096   }

bool intersects ( bounding_box< C, V > *  other,
bool  strict = true 
) [inline, inherited]

Definition at line 239 of file bounding_box.hpp.

References bounding_box< C, V >::is0D(), bounding_box< C, V >::is1D(), bounding_box< C, V >::is2D(), bounding_box< C, V >::is3d(), mmx::shape::mmxmax(), mmx::shape::mmxmin(), 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().

00240 {
00241     if(this->is0D())
00242         return (this->xmin() == other->xmin()) ;
00243     else if(this->is1D())
00244         if(strict)
00245             return ((mmxmax(this->xmin(), other->xmin()) <  mmxmin(this->xmax(), other->xmax()))) ;
00246         else
00247             return ((mmxmax(this->xmin(), other->xmin()) <= mmxmin(this->xmax(), other->xmax()))) ;
00248     else if(this->is2D())
00249         if(strict)
00250             return ((mmxmax(this->xmin(), other->xmin()) <  mmxmin(this->xmax(), other->xmax())) &&
00251                     (mmxmax(this->ymin(), other->ymin()) <  mmxmin(this->ymax(), other->ymax()))) ;
00252         else
00253             return ((mmxmax(this->xmin(), other->xmin()) <= mmxmin(this->xmax(), other->xmax())) &&
00254                     (mmxmax(this->ymin(), other->ymin()) <= mmxmin(this->ymax(), other->ymax()))) ;
00255     else if(this->is3d()) {
00256         if(strict)
00257             return ((mmxmax(this->xmin(), other->xmin()) <  mmxmin(this->xmax(), other->xmax())) &&
00258                     (mmxmax(this->ymin(), other->ymin()) <  mmxmin(this->ymax(), other->ymax())) &&
00259                     (mmxmax(this->zmin(), other->zmin()) <  mmxmin(this->zmax(), other->zmax()))) ;
00260         else
00261             return ((mmxmax(this->xmin(), other->xmin()) <= mmxmin(this->xmax(), other->xmax())) &&
00262                     (mmxmax(this->ymin(), other->ymin()) <= mmxmin(this->ymax(), other->ymax())) &&
00263                     (mmxmax(this->zmin(), other->zmin()) <= mmxmin(this->zmax(), other->zmax()))) ;
00264     }
00265     return false ;
00266 }

bool is0D ( void   )  const [inline, inherited]

Definition at line 80 of file bounding_box.hpp.

Referenced by bounding_box< C, V >::intersects(), and bounding_box< C, V >::unites().

00080 { 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.

Referenced by bounding_box< C, V >::intersects(), and bounding_box< C, V >::unites().

00081 { 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.

Referenced by bounding_box< C, V >::intersects(), and bounding_box< C, V >::unites().

00082 { 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.

Referenced by bounding_box< C, V >::intersects(), and bounding_box< C, V >::unites().

00083 { return ((m_xmin != m_xmax) && (m_ymin != m_ymax) && (m_zmin != m_zmax)) ; }

bool is_active ( void   )  [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 213 of file bcell2d_voronoi_site2d.hpp.

00213                 {
00214 
00215     return ( false );
00216 
00217 }

bool is_border ( void   )  const [inline, inherited]

Definition at line 114 of file bcell2d.hpp.

References bcell2d< C, V >::e_neighbors, bcell2d< C, V >::n_neighbors, bcell2d< C, V >::s_neighbors, Seq< C, R >::size(), and bcell2d< C, V >::w_neighbors.

00114                                     {
00115       return (  this->s_neighbors.size()==0 ||
00116                 this->e_neighbors.size()==0 ||
00117                 this->n_neighbors.size()==0 ||
00118                 this->w_neighbors.size()==0  );
00119   }

bool is_corner ( void   )  const [inherited]
bool is_intersected ( void   )  [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 106 of file bcell2d_voronoi_site2d.hpp.

References bcell2d< C, REF_OF(V) >::nb_intersect().

00106 {return (this->nb_intersect()>0);};

bool is_regular ( void   )  [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 207 of file bcell2d_voronoi_site2d.hpp.

00207                  {
00208 
00209     return true;
00210 }

void join0 ( bcell2d< C , REF_OF(V) > *  b  )  [inline, inherited]
void join1 ( bcell2d< C , REF_OF(V) > *  b  )  [inline, inherited]
double lower (  )  [inline]

Definition at line 128 of file bcell2d_voronoi_site2d.hpp.

References bcell2d_algebraic_curve< C, V >::m_polynomial.

00129   {
00130     return  double(*std::min_element( this->m_polynomial.begin(), 
00131                                          this->m_polynomial.end() ) );
00132   }

virtual unsigned nb_intersect ( void   )  const [inline, virtual, inherited]
virtual bcell2d* neighbor ( Point *  p  )  [inline, virtual, inherited]

Definition at line 167 of file bcell2d.hpp.

References bcell2d< C, V >::e_intersections, bcell2d< C, V >::e_neighbors, Seq< C, R >::member(), bcell2d< C, V >::n_intersections, bcell2d< C, V >::n_neighbors, bcell2d< C, V >::s_intersections, bcell2d< C, V >::s_neighbors, bcell2d< C, V >::w_intersections, and bcell2d< C, V >::w_neighbors.

00167                                          {
00168       foreach( bcell2d *c, this->s_neighbors     )
00169           if ( c->n_intersections.member(p) )
00170           { 
00171               return c;
00172           }
00173       foreach( bcell2d *c, this->e_neighbors     )
00174           if ( c->w_intersections.member(p) )
00175           { 
00176               return c;
00177           }
00178       foreach( bcell2d *c, this->n_neighbors     )
00179           if ( c->s_intersections.member(p) )
00180           { 
00181               return c;
00182           }
00183       foreach( bcell2d *c, this->w_neighbors     )
00184           if ( c->e_intersections.member(p) )
00185           { 
00186               return c;
00187           }
00188 
00189       // Point p on boundary.
00190       //std::cout<<"... Point ("<<p->x()<<","<<p->y()<<") not found on neighbors of "<< this<<"("<<this->neighbors().size() <<")"<<std::endl; 
00191       return NULL;
00192   }

virtual Seq<bcell2d *> neighbors (  )  [inline, virtual, inherited]

Definition at line 154 of file bcell2d.hpp.

References bcell2d< C, V >::e_neighbors, bcell2d< C, V >::n_neighbors, bcell2d< C, V >::s_neighbors, and bcell2d< C, V >::w_neighbors.

00154                                         {
00155       Seq<bcell2d *> r;
00156       r<< this->s_neighbors; 
00157       r<< this->e_neighbors; 
00158       r<< this->n_neighbors; 
00159       r<< this->w_neighbors;
00160   return ( r ); }

double & operator() ( unsigned  v,
unsigned  s 
) [inline, inherited]

Definition at line 356 of file bounding_box.hpp.

References bounding_box< C, V >::m_xmax, bounding_box< C, V >::m_xmin, bounding_box< C, V >::m_ymax, bounding_box< C, V >::m_ymin, bounding_box< C, V >::m_zmax, and bounding_box< C, V >::m_zmin.

00356                                        {
00357     switch(v) {
00358     case 0:
00359         if(s==0) return m_xmin; else return m_xmax;
00360     case 1:
00361         if(s==0) return m_ymin; else return m_ymax;
00362     default:
00363         if(s==0) return m_zmin; else return m_zmax;
00364     }
00365 
00366 }

double operator() ( unsigned  v,
unsigned  s 
) const [inline, inherited]

Definition at line 343 of file bounding_box.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().

00343                                              {
00344     switch(v) {
00345     case 0:
00346         if(s==0) return xmin(); else return xmax();
00347     case 1:
00348         if(s==0) return ymin(); else return ymax();
00349     default:
00350         if(s==0) return zmin(); else return zmax();
00351     }
00352 
00353 }

bounding_box<C,V>* operator* ( const bounding_box< C, V > &  other  )  [inline, inherited]

Definition at line 103 of file bounding_box.hpp.

00103 { return intersect(other) ; }

bounding_box<C,V>* operator+ ( const bounding_box< C, V > &  other  )  [inline, inherited]

Definition at line 104 of file bounding_box.hpp.

00104 { return     unite(other) ; }

virtual Point* pair ( Point *  p,
int &  sgn 
) [pure virtual, inherited]
bcell2d_voronoi_site2d< C, V >::Point * pair ( typename bcell2d_voronoi_site2d< C, V >::Point p,
int &  sgn 
) [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 310 of file bcell2d_voronoi_site2d.hpp.

References bcell2d< C, REF_OF(V) >::intersections(), and Seq< C, R >::size().

00310                                            {
00311      // Pair: returns a neighboring point on the component (p,sgn)
00312      // The candidates are the 2 neighbor intersections of p in *this
00313 
00314       Seq<Point*> all;
00315       int a;
00316       all= this->intersections();
00317       a   = all.size();
00318       if (a==2)// regular bcell with a single branch
00319          { return (all[0]==p ? all[1]: all[0]);  }
00320 
00321         std::cout<<"...pair Trouble"<< this<<std::endl;
00322         return (all[0]); 
00323 }

void set_xmax ( double  x  )  [inline, inherited]

Definition at line 74 of file bounding_box.hpp.

Referenced by bounding_box< C, V >::intersected(), and bounding_box< C, V >::united().

00074 { this->m_xmax = x ; }

void set_xmin ( double  x  )  [inline, inherited]

Definition at line 73 of file bounding_box.hpp.

Referenced by bounding_box< C, V >::intersected(), and bounding_box< C, V >::united().

00073 { this->m_xmin = x ; }

void set_ymax ( double  y  )  [inline, inherited]

Definition at line 76 of file bounding_box.hpp.

Referenced by bounding_box< C, V >::intersected(), and bounding_box< C, V >::united().

00076 { this->m_ymax = y ; }

void set_ymin ( double  y  )  [inline, inherited]

Definition at line 75 of file bounding_box.hpp.

Referenced by bounding_box< C, V >::intersected(), and bounding_box< C, V >::united().

00075 { this->m_ymin = y ; }

void set_zmax ( double  z  )  [inline, inherited]
void set_zmin ( double  z  )  [inline, inherited]
int side ( Point *  p  )  [inline, inherited]

Definition at line 132 of file bcell2d.hpp.

References bcell2d< C, V >::e_intersections, bcell2d< C, V >::intersections(), bcell2d< C, V >::s_intersections, Seq< C, R >::search(), Seq< C, R >::size(), and bcell2d< C, V >::w_intersections.

00132                        {
00133       Seq<Point*> all;
00134       int s,i,a;
00135       s   = s_intersections.size();
00136       all = this->intersections();
00137       a   = all.size();
00138       i   = all.search(p);
00139       if (i==-1) return (-1);
00140       else return
00141          ( i<s                             ? 0 :
00142          ( i<s+(int)e_intersections.size() ? 1 :
00143          ( i<a-(int)w_intersections.size() ? 2 :
00144                                       3 )));
00145   }

double size ( void   )  [inline, inherited]

Definition at line 199 of file bounding_box.hpp.

References bounding_box< C, V >::m_xmax, bounding_box< C, V >::m_xmin, bounding_box< C, V >::m_ymax, bounding_box< C, V >::m_ymin, bounding_box< C, V >::m_zmax, bounding_box< C, V >::m_zmin, and mmx::max().

Referenced by voronoi2dimpl< C, V >::run(), voronoi2d< C, V >::run(), mesher3d_shape< C, V >::run(), mesher3d_algebraic_curve< C, V >::run(), and mesher2d< C, V >::run().

00200 {
00201     //std::cout<<"Size "<<m_xmax<< " "<< m_xmin<<" "<< m_ymax<<" "<< m_ymin<<" "<< m_zmax<< " "<<m_zmin<<std::endl;
00202     return std::max(m_xmax-m_xmin, std::max(m_ymax-m_ymin, m_zmax-m_zmin)) ;
00203 }

virtual void split_position ( int &  v,
double &  t 
) [virtual, inherited]
bcell2d_voronoi_site2d< C, V >::Point * starting_point ( int  sgn  )  [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 256 of file bcell2d_voronoi_site2d.hpp.

References assert, bcell2d< C, REF_OF(V) >::e_intersections, bcell2d< C, REF_OF(V) >::intersections(), bcell2d_algebraic_curve< C, V >::m_polynomial, bcell2d< C, REF_OF(V) >::s_intersections, Seq< C, R >::size(), and bcell2d< C, REF_OF(V) >::w_intersections.

00256                             {//
00257 
00258 //std::cout<<"startingPoint.site2d"<<std::endl;
00259 
00260       Seq<Point*> all;
00261       unsigned a;
00262       all = this->intersections();
00263       a   = all.size();
00264 
00265       //std::cout<<this<<" , "<<a<<std::endl;
00266       //foreach(Point*p,all)
00267       //  std::cout<<p->x()<<" "<<p->y()<<" "<<p->z()<<std::endl;
00268 
00269       assert(a==2);
00270 
00271       int ev(0);
00272       int u ;//position of p
00273       unsigned
00274           s=this->s_intersections.size() ,// ~0
00275           e=this->e_intersections.size() ,// ~1
00276           //n=this->n_intersections.size() ,// ~2
00277           w=this->w_intersections.size() ;// ~3
00278 
00279       u= ( 0<s   ? 0 :
00280          ( 0<s+e ? 1 :
00281          ( 0<a-w ? 2 :
00282                    3 )));
00283 
00284       int * sz = this->m_polynomial.rep().szs();
00285       int * st = this->m_polynomial.rep().str();
00286 
00287           switch (u){
00288           case 0:
00289               ev= (this->m_polynomial[0] >0 ? 1:-1);
00290          break;
00291           case 1:
00292               ev= (this->m_polynomial[(sz[0]-1)*st[0]] >0 ? 1:-1);      
00293          break;
00294           case 2:
00295               ev= (this->m_polynomial[sz[0]*sz[1]-1]>0 ? 1:-1);
00296           break;
00297           case 3:
00298               ev= (this->m_polynomial[(sz[1]-1)*st[1]] >0 ? 1:-1);
00299           break;
00300           }
00301 
00302           if (ev*sgn>0)  
00303             return all[0]; 
00304           else                
00305             return all[1];
00306 }

virtual void subdivide ( bcell< C , REF_OF(REF_OF(V)) > *&  left,
bcell< C , REF_OF(REF_OF(V)) > *&  right,
int  v,
double  s 
) [pure virtual, inherited]
virtual int subdivide ( bcell< C , REF_OF(REF_OF(V)) > *&  left,
bcell< C , REF_OF(REF_OF(V)) > *&  right 
) [virtual, inherited]
void subdivide ( Cell *&  left,
Cell *&  right,
int  v,
double  s 
) [inline, virtual]

Reimplemented from bcell2d_algebraic_curve< C, V >.

Definition at line 236 of file bcell2d_voronoi_site2d.hpp.

References SELF.

00236                                                           {
00237   bcell2d_subdivisor<C,V>::subdivide( *this,(SELF*&)Left,(SELF*&)Right,v,s);
00238 }

bounding_box< C, V > * unite ( bounding_box< C, V > *  other  )  [inline, inherited]

Definition at line 331 of file bounding_box.hpp.

References mmx::shape::mmxmax(), mmx::shape::mmxmin(), SELF, 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().

Referenced by bounding_box< double, V >::operator+().

00331                         {
00332     SELF * bcell = new SELF ;
00333     bcell->set_xmin(mmxmin(this->xmin(), other->xmin())) ;
00334     bcell->set_xmax(mmxmax(this->xmax(), other->xmax())) ;
00335     bcell->set_ymin(mmxmin(this->ymin(), other->ymin())) ;
00336     bcell->set_ymax(mmxmax(this->ymax(), other->ymax())) ;
00337     bcell->set_zmin(mmxmin(this->zmin(), other->zmin())) ;
00338     bcell->set_zmax(mmxmax(this->zmax(), other->zmax())) ;
00339     return bcell ;
00340 }

void united ( bounding_box< C, V > *  other  )  [inline, inherited]
bool unites ( bounding_box< C, V > *  other,
bool  strict = true 
) [inline, inherited]

Definition at line 269 of file bounding_box.hpp.

References bounding_box< C, V >::is0D(), bounding_box< C, V >::is1D(), bounding_box< C, V >::is2D(), bounding_box< C, V >::is3d(), mmx::shape::mmxmax(), mmx::shape::mmxmin(), 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().

00270 {
00271     if(this->is0D())
00272         return (this->xmin() == other->xmin()) ;
00273     else if(this->is1D()) {
00274         if(strict)
00275             return ((mmxmin(this->xmin(), other->xmin()) <  mmxmax(this->xmax(), other->xmax()))) ;
00276         else
00277             return ((mmxmin(this->xmin(), other->xmin()) <= mmxmax(this->xmax(), other->xmax()))) ;
00278     } else if(this->is2D()) {
00279         if(strict)
00280             return ((mmxmin(this->xmin(), other->xmin()) <  mmxmax(this->xmax(), other->xmax())) &&
00281                     (mmxmin(this->ymin(), other->ymin()) <  mmxmax(this->ymax(), other->ymax()))) ;
00282         else
00283             return ((mmxmin(this->xmin(), other->xmin()) <= mmxmax(this->xmax(), other->xmax())) &&
00284                     (mmxmin(this->ymin(), other->ymin()) <= mmxmax(this->ymax(), other->ymax()))) ;
00285     } else if(this->is3d()) {
00286         if(strict)
00287             return ((mmxmin(this->xmin(), other->xmin()) <  mmxmax(this->xmax(), other->xmax())) &&
00288                     (mmxmin(this->ymin(), other->ymin()) <  mmxmax(this->ymax(), other->ymax())) &&
00289                     (mmxmin(this->zmin(), other->zmin()) <  mmxmax(this->zmax(), other->zmax()))) ;
00290         else
00291             return ((mmxmin(this->xmin(), other->xmin()) <= mmxmax(this->xmax(), other->xmax())) &&
00292                     (mmxmin(this->ymin(), other->ymin()) <= mmxmax(this->ymax(), other->ymax())) &&
00293                     (mmxmin(this->zmin(), other->zmin()) <= mmxmax(this->zmax(), other->zmax()))) ;
00294     }
00295     return false ;
00296 }

double upper (  )  [inline]

Definition at line 135 of file bcell2d_voronoi_site2d.hpp.

References bcell2d_algebraic_curve< C, V >::m_polynomial.

00136   {
00137     return double(*std::max_element( this->m_polynomial.begin(),
00138                                      this->m_polynomial.end() ) );
00139   }

double xmax ( void   )  const [inline, inherited]

Definition at line 63 of file bounding_box.hpp.

00063 { return m_xmax ; }

double xmax ( void   )  [inline, inherited]

Definition at line 56 of file bounding_box.hpp.

Referenced by bcell2d_algebraic_curve< C, V >::bcell2d_algebraic_curve(), bcell3d_algebraic_curve< C, V >::bcell3d_algebraic_curve(), bcell3d_algebraic_surface< C, V >::bcell3d_algebraic_surface(), cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve(), cell3d_algebraic_surface< C, V >::cell3d_algebraic_surface(), cell3d< C, V >::center(), cell2d< C, REF_OF(V) >::center(), bcell3d_algebraic_surface< C, V >::center(), bcell3d< C, V >::center(), bcell2d_voronoi_impl_diagram< C, V >::compute_boundary(), bcell2d_voronoi_diagram< C, V >::compute_boundary(), EdgeListBuilder< node_t >::computeCommonFace(), solver_implicit< C, V >::extremal(), cell2d_algebraic_curve< C, V >::gradient(), bcell2d_voronoi_site2d< C, V >::gradient(), bcell2d_voronoi_impl2d< C, V >::gradient(), bcell2d_algebraic_curve< C, V >::gradient(), topology< C, V >::insert(), mesher3d_algebraic_curve< C, V >::insert(), bcell2d_voronoi_impl_diagram< C, V >::insert_regular(), bcell2d_voronoi_diagram< C, V >::insert_regular(), bounding_box< C, V >::intersect(), bounding_box< C, V >::intersected(), solver_implicit< C, V >::intersection(), bounding_box< C, V >::intersects(), cell3d< C, V >::is_adjacent(), cell2d< C, V >::is_adjacent(), bounding_box< C, V >::operator()(), cell3d_algebraic_surface< C, V >::point(), solver_implicit< C, V >::singular(), cell3d_algebraic_surface< C, V >::split(), bcell3d_algebraic_surface< C, V >::split(), cell3d< C, V >::split_position(), cell2d_algebraic_curve< C, V >::split_position(), bcell3d_list< C, V >::split_position(), bcell3d< C, V >::split_position(), bcell2d_voronoi_impl_diagram< C, V >::split_position(), bcell2d_voronoi_diagram< C, V >::split_position(), bcell2d_list< C, V >::split_position(), bcell2d_intersection< C, V >::split_position(), bcell2d< C, V >::split_position(), bcell3d_algebraic_curve< C, V >::subdivide(), bcell2d_voronoi_impl_diagram< C, V >::subdivide(), bcell2d_voronoi_diagram< C, V >::subdivide(), bcell2d_list< C, V >::subdivide(), bcell2d_intersection< C, V >::subdivide(), bcell3d_algebraic_surface< C, V >::topology_regular(), bounding_box< C, V >::unite(), bounding_box< C, V >::united(), bounding_box< C, V >::unites(), voronoi_site2d< C, V >::upper_bound(), cell3d_algebraic_surface< C, V >::value(), and EdgeListBuilder< node_t >::verifyFaceList().

00056 { return m_xmax ; }

double xmin ( void   )  const [inline, inherited]

Definition at line 62 of file bounding_box.hpp.

00062 { return m_xmin ; }

double xmin ( void   )  [inline, inherited]

Definition at line 55 of file bounding_box.hpp.

Referenced by bcell2d_algebraic_curve< C, V >::bcell2d_algebraic_curve(), bcell3d_algebraic_curve< C, V >::bcell3d_algebraic_curve(), bcell3d_algebraic_surface< C, V >::bcell3d_algebraic_surface(), cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve(), cell3d_algebraic_surface< C, V >::cell3d_algebraic_surface(), cell3d< C, V >::center(), cell2d< C, REF_OF(V) >::center(), bcell3d_algebraic_surface< C, V >::center(), bcell3d< C, V >::center(), bcell2d_voronoi_impl_diagram< C, V >::compute_boundary(), bcell2d_voronoi_diagram< C, V >::compute_boundary(), EdgeListBuilder< node_t >::computeCommonFace(), solver_implicit< C, V >::extremal(), cell2d_algebraic_curve< C, V >::gradient(), bcell2d_voronoi_site2d< C, V >::gradient(), bcell2d_voronoi_impl2d< C, V >::gradient(), bcell2d_algebraic_curve< C, V >::gradient(), topology< C, V >::insert(), mesher3d_algebraic_curve< C, V >::insert(), bcell2d_voronoi_impl_diagram< C, V >::insert_regular(), bcell2d_voronoi_diagram< C, V >::insert_regular(), bounding_box< C, V >::intersect(), bounding_box< C, V >::intersected(), solver_implicit< C, V >::intersection(), bounding_box< C, V >::intersects(), cell3d< C, V >::is_adjacent(), cell2d< C, V >::is_adjacent(), bounding_box< C, V >::operator()(), mmx::shape::operator<<(), cell3d_algebraic_surface< C, V >::point(), solver_implicit< C, V >::singular(), cell3d_algebraic_surface< C, V >::split(), bcell3d_algebraic_surface< C, V >::split(), cell3d< C, V >::split_position(), cell2d_algebraic_curve< C, V >::split_position(), bcell3d_list< C, V >::split_position(), bcell3d< C, V >::split_position(), bcell2d_voronoi_impl_diagram< C, V >::split_position(), bcell2d_voronoi_diagram< C, V >::split_position(), bcell2d_list< C, V >::split_position(), bcell2d_intersection< C, V >::split_position(), bcell2d< C, V >::split_position(), bcell3d_algebraic_curve< C, V >::subdivide(), bcell2d_voronoi_impl_diagram< C, V >::subdivide(), bcell2d_voronoi_diagram< C, V >::subdivide(), bcell2d_list< C, V >::subdivide(), bcell2d_intersection< C, V >::subdivide(), bcell3d_algebraic_surface< C, V >::topology_regular(), bounding_box< C, V >::unite(), bounding_box< C, V >::united(), bounding_box< C, V >::unites(), voronoi_site2d< C, V >::upper_bound(), cell3d_algebraic_surface< C, V >::value(), and EdgeListBuilder< node_t >::verifyFaceList().

00055 { return m_xmin ; }

double xsize ( void   )  const [inline, inherited]

Definition at line 69 of file bounding_box.hpp.

00069 { return m_xmax-m_xmin ; }

double ymax ( void   )  const [inline, inherited]

Definition at line 65 of file bounding_box.hpp.

00065 { return m_ymax ; }

double ymax ( void   )  [inline, inherited]

Definition at line 58 of file bounding_box.hpp.

Referenced by bcell2d_algebraic_curve< C, V >::bcell2d_algebraic_curve(), bcell3d_algebraic_curve< C, V >::bcell3d_algebraic_curve(), bcell3d_algebraic_surface< C, V >::bcell3d_algebraic_surface(), cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve(), cell3d_algebraic_surface< C, V >::cell3d_algebraic_surface(), cell3d< C, V >::center(), cell2d< C, REF_OF(V) >::center(), bcell3d_algebraic_surface< C, V >::center(), bcell3d< C, V >::center(), bcell2d_voronoi_impl_diagram< C, V >::compute_boundary(), bcell2d_voronoi_diagram< C, V >::compute_boundary(), EdgeListBuilder< node_t >::computeCommonFace(), solver_implicit< C, V >::extremal(), cell2d_algebraic_curve< C, V >::gradient(), bcell2d_voronoi_site2d< C, V >::gradient(), bcell2d_voronoi_impl2d< C, V >::gradient(), bcell2d_algebraic_curve< C, V >::gradient(), topology< C, V >::insert(), mesher3d_algebraic_curve< C, V >::insert(), bcell2d_voronoi_impl_diagram< C, V >::insert_regular(), bcell2d_voronoi_diagram< C, V >::insert_regular(), bounding_box< C, V >::intersect(), bounding_box< C, V >::intersected(), solver_implicit< C, V >::intersection(), bounding_box< C, V >::intersects(), cell3d< C, V >::is_adjacent(), cell2d< C, V >::is_adjacent(), bounding_box< C, V >::operator()(), cell3d_algebraic_surface< C, V >::point(), solver_implicit< C, V >::singular(), cell3d_algebraic_surface< C, V >::split(), bcell3d_algebraic_surface< C, V >::split(), cell3d< C, V >::split_position(), cell2d_algebraic_curve< C, V >::split_position(), bcell3d_list< C, V >::split_position(), bcell3d< C, V >::split_position(), bcell2d_voronoi_impl_diagram< C, V >::split_position(), bcell2d_voronoi_diagram< C, V >::split_position(), bcell2d_list< C, V >::split_position(), bcell2d_intersection< C, V >::split_position(), bcell2d< C, V >::split_position(), bcell3d_algebraic_curve< C, V >::subdivide(), bcell2d_voronoi_impl_diagram< C, V >::subdivide(), bcell2d_voronoi_diagram< C, V >::subdivide(), bcell2d_list< C, V >::subdivide(), bcell2d_intersection< C, V >::subdivide(), bcell3d_algebraic_surface< C, V >::topology_regular(), bounding_box< C, V >::unite(), bounding_box< C, V >::united(), bounding_box< C, V >::unites(), voronoi_site2d< C, V >::upper_bound(), cell3d_algebraic_surface< C, V >::value(), and EdgeListBuilder< node_t >::verifyFaceList().

00058 { return m_ymax ; }

double ymin ( void   )  const [inline, inherited]

Definition at line 64 of file bounding_box.hpp.

00064 { return m_ymin ; }

double ymin ( void   )  [inline, inherited]

Definition at line 57 of file bounding_box.hpp.

Referenced by bcell2d_algebraic_curve< C, V >::bcell2d_algebraic_curve(), bcell3d_algebraic_curve< C, V >::bcell3d_algebraic_curve(), bcell3d_algebraic_surface< C, V >::bcell3d_algebraic_surface(), cell2d_algebraic_curve< C, V >::cell2d_algebraic_curve(), cell3d_algebraic_surface< C, V >::cell3d_algebraic_surface(), cell3d< C, V >::center(), cell2d< C, REF_OF(V) >::center(), bcell3d_algebraic_surface< C, V >::center(), bcell3d< C, V >::center(), bcell2d_voronoi_impl_diagram< C, V >::compute_boundary(), bcell2d_voronoi_diagram< C, V >::compute_boundary(), EdgeListBuilder< node_t >::computeCommonFace(), solver_implicit< C, V >::extremal(), cell2d_algebraic_curve< C, V >::gradient(), bcell2d_voronoi_site2d< C, V >::gradient(), bcell2d_voronoi_impl2d< C, V >::gradient(), bcell2d_algebraic_curve< C, V >::gradient(), topology< C, V >::insert(), mesher3d_algebraic_curve< C, V >::insert(), bcell2d_voronoi_impl_diagram< C, V >::insert_regular(), bcell2d_voronoi_diagram< C, V >::insert_regular(), bounding_box< C, V >::intersect(), bounding_box< C, V >::intersected(), solver_implicit< C, V >::intersection(), bounding_box< C, V >::intersects(), cell3d< C, V >::is_adjacent(), cell2d< C, V >::is_adjacent(), bounding_box< C, V >::operator()(), cell3d_algebraic_surface< C, V >::point(), solver_implicit< C, V >::singular(), cell3d_algebraic_surface< C, V >::split(), bcell3d_algebraic_surface< C, V >::split(), cell3d< C, V >::split_position(), cell2d_algebraic_curve< C, V >::split_position(), bcell3d_list< C, V >::split_position(), bcell3d< C, V >::split_position(), bcell2d_voronoi_impl_diagram< C, V >::split_position(), bcell2d_voronoi_diagram< C, V >::split_position(), bcell2d_list< C, V >::split_position(), bcell2d_intersection< C, V >::split_position(), bcell2d< C, V >::split_position(), bcell3d_algebraic_curve< C, V >::subdivide(), bcell2d_voronoi_impl_diagram< C, V >::subdivide(), bcell2d_voronoi_diagram< C, V >::subdivide(), bcell2d_list< C, V >::subdivide(), bcell2d_intersection< C, V >::subdivide(), bcell3d_algebraic_surface< C, V >::topology_regular(), bounding_box< C, V >::unite(), bounding_box< C, V >::united(), bounding_box< C, V >::unites(), voronoi_site2d< C, V >::upper_bound(), cell3d_algebraic_surface< C, V >::value(), and EdgeListBuilder< node_t >::verifyFaceList().

00057 { return m_ymin ; }

double ysize ( void   )  const [inline, inherited]

Definition at line 70 of file bounding_box.hpp.

00070 { return m_ymax-m_ymin ; }

double zmax ( void   )  const [inline, inherited]

Definition at line 67 of file bounding_box.hpp.

00067 { return m_zmax ; }

double zmax ( void   )  [inline, inherited]
double zmin ( void   )  const [inline, inherited]

Definition at line 66 of file bounding_box.hpp.

00066 { return m_zmin ; }

double zmin ( void   )  [inline, inherited]
double zsize ( void   )  const [inline, inherited]

Definition at line 71 of file bounding_box.hpp.

00071 { return m_zmax-m_zmin ; }


Member Data Documentation

Seq<Point *> e_intersections [inherited]
Seq<bcell2d *> e_neighbors [inherited]

Definition at line 163 of file bcell2d.hpp.

Seq<Point *> m_boundary [inherited]
gNode<bcell2d*>* m_gnode [inherited]

Definition at line 130 of file bcell2d.hpp.

Polynomial m_polynomial [inherited]
Seq<Point *> m_singular [inherited]
Seq<Point *> m_xcritical [inherited]

Definition at line 216 of file bcell2d_algebraic_curve.hpp.

double m_xmax [protected, inherited]
double m_xmin [protected, inherited]
Seq<Point *> m_ycritical [inherited]

Definition at line 217 of file bcell2d_algebraic_curve.hpp.

double m_ymax [protected, inherited]
double m_ymin [protected, inherited]
double m_zmax [protected, inherited]
double m_zmin [protected, inherited]
Seq<Point *> n_intersections [inherited]
Seq<bcell2d *> n_neighbors [inherited]

Definition at line 164 of file bcell2d.hpp.

Seq<Point *> s_intersections [inherited]
Seq<bcell2d *> s_neighbors [inherited]

Definition at line 162 of file bcell2d.hpp.

Seq<Point *> w_intersections [inherited]
Seq<bcell2d *> w_neighbors [inherited]

Definition at line 165 of file bcell2d.hpp.


The documentation for this struct was generated from the following file:

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1