mesher3d_algebraic_curve< C, V > Class Template Reference

#include <mesher3d_algebraic_curve.hpp>

Inheritance diagram for mesher3d_algebraic_curve< C, V >:
SHAPE_OFV

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class C, class V = default_env>
class mmx::shape::mesher3d_algebraic_curve< C, V >

Definition at line 71 of file mesher3d_algebraic_curve.hpp.


Member Typedef Documentation

Definition at line 84 of file mesher3d_algebraic_curve.hpp.

Definition at line 78 of file mesher3d_algebraic_curve.hpp.

typedef bcell<C,V> CellBase

Definition at line 77 of file mesher3d_algebraic_curve.hpp.

typedef edge<C,V, Point> Edge

Definition at line 75 of file mesher3d_algebraic_curve.hpp.

typedef face<C,V, Point> Face

Definition at line 76 of file mesher3d_algebraic_curve.hpp.

typedef kdtree<Cell *> Kdtree

Definition at line 82 of file mesher3d_algebraic_curve.hpp.

typedef node<Cell *> Node

Definition at line 81 of file mesher3d_algebraic_curve.hpp.

typedef vertex<C, 3, V> Point

Definition at line 74 of file mesher3d_algebraic_curve.hpp.

typedef surface<V> Surface

Definition at line 79 of file mesher3d_algebraic_curve.hpp.


Constructor & Destructor Documentation

mesher3d_algebraic_curve ( const BoundingBox bx  )  [inline]

Definition at line 86 of file mesher3d_algebraic_curve.hpp.

00087         : m_maxprec(0.1), m_minprec(0.01), m_bbx(bx)
00088     {
00089         m_tree = new Kdtree;
00090     }

~mesher3d_algebraic_curve ( void   )  [inline]

Definition at line 92 of file mesher3d_algebraic_curve.hpp.

00092                                     {
00093         delete m_tree ;
00094     }


Member Function Documentation

void clear ( void   )  [inline, virtual]

Remove all vertices, edges and faces from the 3D topology.

Definition at line 310 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::resize().

00310             {
00311     // Should we clean up these points?
00312     this->m_faces.resize( 0 );
00313     this->m_edges.resize( 0 );
00314     this->m_vertices.resize( 0 );
00315 }

unsigned count ( void   )  [inline]

Definition at line 101 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::size().

00101 { return m_objects.size(); }

const Seq<Edge *>& edges ( void   )  const [inline]

Definition at line 110 of file mesher3d_algebraic_curve.hpp.

00110 { return m_edges ; }

Seq<Edge *>& edges ( void   )  [inline]

Definition at line 109 of file mesher3d_algebraic_curve.hpp.

00109 { return m_edges ; }

virtual Face* faces ( int  i  )  [inline, virtual]

Definition at line 115 of file mesher3d_algebraic_curve.hpp.

00115 { return m_faces[i] ; }

const Seq<Face *>& faces ( void   )  const [inline]

Definition at line 112 of file mesher3d_algebraic_curve.hpp.

00112 { return m_faces ; }

Seq<Face *>& faces ( void   )  [inline]

Definition at line 111 of file mesher3d_algebraic_curve.hpp.

00111 { return m_faces ; }

void insert ( BoundingBox bx,
bool  cross = false 
) [inline, virtual]

Definition at line 160 of file mesher3d_algebraic_curve.hpp.

References mmx::shape::cross(), mesher3d_algebraic_curve< C, V >::insert(), 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().

00160                                                         {
00161     Point
00162             *p0= new Point(bx->xmin(),bx->ymin(),bx->zmin()),
00163             *p1= new Point(bx->xmin(),bx->ymax(),bx->zmin()),
00164             *p2= new Point(bx->xmax(),bx->ymax(),bx->zmin()),
00165             *p3= new Point(bx->xmax(),bx->ymin(),bx->zmin());
00166 
00167     this->insert(p0);this->insert(p1); this->insert(new Edge(p0,p1));
00168     this->insert(p1);this->insert(p2); this->insert(new Edge(p1,p2));
00169     this->insert(p2);this->insert(p3); this->insert(new Edge(p2,p3));
00170     this->insert(p3);this->insert(p0); this->insert(new Edge(p3,p0));
00171 
00172     Point
00173             *q0= new Point(bx->xmin(),bx->ymin(),bx->zmax()),
00174             *q1= new Point(bx->xmin(),bx->ymax(),bx->zmax()),
00175             *q2= new Point(bx->xmax(),bx->ymax(),bx->zmax()),
00176             *q3= new Point(bx->xmax(),bx->ymin(),bx->zmax());
00177 
00178     this->insert(q0);this->insert(q1); this->insert(new Edge(q0,q1));
00179     this->insert(q1);this->insert(q2); this->insert(new Edge(q1,q2));
00180     this->insert(q2);this->insert(q3); this->insert(new Edge(q2,q3));
00181     this->insert(q3);this->insert(q0); this->insert(new Edge(q3,q0));
00182 
00183     this->insert(p0);this->insert(q0);this->insert(new Edge(p0,q0));
00184     this->insert(p1);this->insert(q1);this->insert(new Edge(p1,q1));
00185     this->insert(p2);this->insert(q2);this->insert(new Edge(p2,q2));
00186     this->insert(p3);this->insert(q3);this->insert(new Edge(p3,q3));
00187 
00188     if(cross) {
00189         Point
00190                 *r0= new Point(bx->xmin(),bx->ymin(),bx->zmax()),
00191                 *r1= new Point(bx->xmin(),bx->ymax(),bx->zmax()),
00192                 *r2= new Point(bx->xmax(),bx->ymax(),bx->zmax()),
00193                 *r3= new Point(bx->xmax(),bx->ymin(),bx->zmax());
00194 
00195         this->insert(r0);this->insert(r2);this->insert(new Edge(r0,r2));
00196         this->insert(r1);this->insert(r3);this->insert(new Edge(r1,r3));
00197     }
00198 }

void insert ( Face f  )  [inline, virtual]

Definition at line 292 of file mesher3d_algebraic_curve.hpp.

00292                      {
00293     this->m_faces<<f;
00294 }

void insert ( Edge e  )  [inline, virtual]

Definition at line 286 of file mesher3d_algebraic_curve.hpp.

00286                     {
00287     //  std::cout<<m_edges.size()<<"| "<<e->source()->index()<<" "<<e->destination()->index()<<std::endl;
00288     this->m_edges<<e;
00289 }

void insert ( Point p  )  [inline, virtual]

Definition at line 281 of file mesher3d_algebraic_curve.hpp.

Referenced by mesher3d_algebraic_curve< C, V >::insert().

00281                       {
00282     use<mesher3d_algebraic_curve_def,C,V>::point_insertor(this->m_vertices, p);
00283 }

bool insert_regular ( Cell bcell  )  [inline]

Definition at line 253 of file mesher3d_algebraic_curve.hpp.

References bcell3d_algebraic_curve< C, V >::inserted_regular_in().

Referenced by mesher3d_algebraic_curve< C, V >::run().

00253                              {
00254     return cl->inserted_regular_in(this);
00255 }

void insert_singular ( BoundingBox bx  )  [inline, virtual]

Definition at line 297 of file mesher3d_algebraic_curve.hpp.

00297                                       {
00298     std::cout<<"Begin insert_singular"<<endl;
00299     this->m_specials<<bx;
00300     std::cout<<"End insert_singular"<<endl;
00301 }

void insert_singular ( Point  )  [inline, virtual]

Definition at line 304 of file mesher3d_algebraic_curve.hpp.

00304                               {
00305     std::cout<<"Begin insert_singular Uff"<<endl;
00306     //  m_specials<<p;
00307 }

bool is_regular ( Cell bcell  )  [inline]

Definition at line 248 of file mesher3d_algebraic_curve.hpp.

References bcell3d_algebraic_curve< C, V >::is_regular().

Referenced by mesher3d_algebraic_curve< C, V >::run().

00248                          {
00249     return cl->is_regular();
00250 }

int nbe ( void   )  const [inline]

Definition at line 104 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::size().

00104 { return m_edges.size();}

int nbf (  )  const [inline]

Definition at line 105 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::size().

00105 { return m_faces.size();}

int nbv (  )  const [inline]

Definition at line 103 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::size().

00103 { return m_vertices.size();}

void operator<< ( Shape s  )  [inline]

Definition at line 100 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::push_back().

00100 { m_objects.push_back(s); }

bool post_process ( Cell bcell  )  [inline]

Definition at line 258 of file mesher3d_algebraic_curve.hpp.

00258                            {
00259     return true;
00260 }

void push_back ( Shape s  )  [inline]

Definition at line 99 of file mesher3d_algebraic_curve.hpp.

References Seq< C, R >::push_back().

00099 { m_objects.push_back(s); }

void run ( void   )  [inline]

Definition at line 201 of file mesher3d_algebraic_curve.hpp.

References AlgebraicCurve, Seq< C, R >::begin(), Cell3dAlgebraicCurve, node< _CELL >::get_cell(), mesher3d_algebraic_curve< C, V >::insert_regular(), bcell3d_algebraic_curve< C, V >::is_active(), mesher3d_algebraic_curve< C, V >::is_regular(), kdtree< CELL >::root(), node< _CELL >::set_cell(), mesher3d_algebraic_curve< C, V >::sing_process(), bounding_box< C, V >::size(), Seq< C, R >::size(), mesher3d_algebraic_curve< C, V >::stopFlag, and mesher3d_algebraic_curve< C, V >::subdivide().

00201               {
00202     //no singularities are detected in the topology of the space algebraic curve. stopFlag is set to false(0)
00203     stopFlag=0;
00204     Node* root = m_tree->root();
00205 
00206     if(this->m_objects.size()==0) return;
00207 
00208     AlgebraicCurve* ic = dynamic_cast<AlgebraicCurve *>(*(this->m_objects.begin()));
00209     Cell* cl = new Cell3dAlgebraicCurve(ic, this->m_bbx);
00210 
00211     //   foreach(Shape* s, m_objects)
00212     //     cl->push_back(SurfaceCellFactory::instance()->create(s,m_bbx)) ;
00213 
00214     root->set_cell(cl);
00215     m_nodes.push_back(root) ;
00216 
00217     double maxsz = this->m_maxprec*m_tree->root()->get_cell()->size();
00218     double minsz = this->m_minprec*m_tree->root()->get_cell()->size();
00219 
00220     while(!m_nodes.empty()) {
00221         Node* node = m_nodes.front() ;
00222         Cell* cl = node->get_cell() ;
00223 
00224         if(cl->is_active()) {
00225             if(cl->size() > maxsz)
00226             {
00227                 this->subdivide(cl, node) ;
00228             }
00229             else if(this->is_regular(cl))
00230             {
00231                 this->insert_regular(cl) ;
00232             }
00233             else if(cl->size() > minsz )
00234             {
00235                 this->subdivide(cl, node) ;
00236             }
00237             else {
00238                 this->sing_process(cl);
00239                 //singularities are detected in the topology of the space algebraic curve. stopFlag is set to true(1)
00240                 stopFlag=1;
00241             }
00242         }
00243         m_nodes.pop_front() ;
00244     }
00245 }

void set_precision ( double  eps  )  [inline]

Definition at line 96 of file mesher3d_algebraic_curve.hpp.

00096 { m_minprec = eps; }

void set_smoothness ( double  eps  )  [inline]

Definition at line 97 of file mesher3d_algebraic_curve.hpp.

00097 { m_maxprec = eps; }

typedef SHAPE_OF (  ) 
bool sing_process ( Cell bcell  )  [inline]

Definition at line 263 of file mesher3d_algebraic_curve.hpp.

References bcell3d_algebraic_curve< C, V >::inserted_singular_in().

Referenced by mesher3d_algebraic_curve< C, V >::run().

00263                            {
00264     //the method insert_singular(Topology* t) from bcell3d_algebraic_curve.hpp is used here!!
00265     return cl->inserted_singular_in(this) ;
00266 }

bool subdivide ( Cell bcell,
Node node 
) [inline]

Definition at line 269 of file mesher3d_algebraic_curve.hpp.

References node< _CELL >::LEFT, mmx::ssi::left(), node< _CELL >::m_left, node< _CELL >::m_right, node< _CELL >::RIGHT, mmx::ssi::right(), and bcell3d_algebraic_curve< C, V >::subdivide().

Referenced by mesher3d_algebraic_curve< C, V >::run().

00269                                      {
00270 
00271     int v = 0;
00272     Cell * left, * right;
00273     v = cl->subdivide(left, right) ;
00274     node->m_left = new Node(node, left,  Node::LEFT , v) ; m_nodes << node->m_left ;
00275     node->m_right= new Node(node, right, Node::RIGHT, v) ; m_nodes << node->m_right;
00276 
00277     return true ;
00278 }

const Kdtree* tree ( void   )  const [inline]

Definition at line 131 of file mesher3d_algebraic_curve.hpp.

00131 { return m_tree; }

virtual Point* vertices ( int  i  )  [inline, virtual]

Definition at line 114 of file mesher3d_algebraic_curve.hpp.

00114 { return m_vertices[i] ; }

const Seq<Point *>& vertices ( void   )  const [inline]

Definition at line 108 of file mesher3d_algebraic_curve.hpp.

00108 { return m_vertices ; }

Seq<Point *>& vertices ( void   )  [inline]

Definition at line 107 of file mesher3d_algebraic_curve.hpp.

00107 { return m_vertices ; }


Member Data Documentation

int stopFlag

Definition at line 141 of file mesher3d_algebraic_curve.hpp.

Referenced by mesher3d_algebraic_curve< C, V >::run().


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1