shape_doc 0.1
mesher3d_curve_algebraic< C, V > Class Template Reference

#include <mesher3d_curve_algebraic.hpp>

Inheritance diagram for mesher3d_curve_algebraic< 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_curve_algebraic< C, V >

Definition at line 71 of file mesher3d_curve_algebraic.hpp.


Member Typedef Documentation

Definition at line 84 of file mesher3d_curve_algebraic.hpp.

Definition at line 78 of file mesher3d_curve_algebraic.hpp.

typedef cell<C,V> CellBase

Definition at line 77 of file mesher3d_curve_algebraic.hpp.

typedef edge<C,V, Point> Edge

Definition at line 75 of file mesher3d_curve_algebraic.hpp.

typedef face<C,V, Point> Face

Definition at line 76 of file mesher3d_curve_algebraic.hpp.

typedef kdtree<Surface *, Cell *> Kdtree

Definition at line 82 of file mesher3d_curve_algebraic.hpp.

typedef node<Surface *, Cell *> Node

Definition at line 81 of file mesher3d_curve_algebraic.hpp.

typedef vertex<C,V> Point

Definition at line 74 of file mesher3d_curve_algebraic.hpp.

typedef surface<V> Surface

Definition at line 79 of file mesher3d_curve_algebraic.hpp.


Constructor & Destructor Documentation

mesher3d_curve_algebraic ( const BoundingBox bx) [inline]

Definition at line 86 of file mesher3d_curve_algebraic.hpp.

    : m_maxprec(0.1), m_minprec(0.01), m_bbx(bx)  
  {
    m_tree = new Kdtree;
  }
~mesher3d_curve_algebraic ( void  ) [inline]

Definition at line 92 of file mesher3d_curve_algebraic.hpp.

                                  {
    delete m_tree ;
  }

Member Function Documentation

void clear ( void  ) [virtual]

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

Definition at line 310 of file mesher3d_curve_algebraic.hpp.

            {
        // Should we clean up these points?
        this->m_faces.resize( 0 );
        this->m_edges.resize( 0 );
        this->m_vertices.resize( 0 );
}
unsigned count ( void  ) [inline]

Definition at line 101 of file mesher3d_curve_algebraic.hpp.

{ return m_objects.size(); }
Seq<Edge *>& edges ( void  ) [inline]

Definition at line 109 of file mesher3d_curve_algebraic.hpp.

{ return m_edges ; }
const Seq<Edge *>& edges ( void  ) const [inline]

Definition at line 110 of file mesher3d_curve_algebraic.hpp.

{ return m_edges ; }
virtual Face* faces ( int  i) [inline, virtual]

Definition at line 115 of file mesher3d_curve_algebraic.hpp.

{ return m_faces[i] ; }
Seq<Face *>& faces ( void  ) [inline]

Definition at line 111 of file mesher3d_curve_algebraic.hpp.

{ return m_faces ; }
const Seq<Face *>& faces ( void  ) const [inline]

Definition at line 112 of file mesher3d_curve_algebraic.hpp.

{ return m_faces ; }
void insert ( Point p) [virtual]
void insert ( Face f) [virtual]

Definition at line 292 of file mesher3d_curve_algebraic.hpp.

                     {
  this->m_faces<<f;
}
void insert ( Edge e) [virtual]

Definition at line 286 of file mesher3d_curve_algebraic.hpp.

                    {
  //  std::cout<<m_edges.size()<<"| "<<e->source()->index()<<" "<<e->destination()->index()<<std::endl;
  this->m_edges<<e;
}
void insert ( BoundingBox bx,
bool  cross = false 
) [virtual]

Definition at line 160 of file mesher3d_curve_algebraic.hpp.

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

                                                        {
  Point 
    *p0= new Point(bx->xmin(),bx->ymin(),bx->zmin()),
    *p1= new Point(bx->xmin(),bx->ymax(),bx->zmin()),
    *p2= new Point(bx->xmax(),bx->ymax(),bx->zmin()),
    *p3= new Point(bx->xmax(),bx->ymin(),bx->zmin());
  
  this->insert(p0);this->insert(p1); this->insert(new Edge(p0,p1));
  this->insert(p1);this->insert(p2); this->insert(new Edge(p1,p2));
  this->insert(p2);this->insert(p3); this->insert(new Edge(p2,p3));
  this->insert(p3);this->insert(p0); this->insert(new Edge(p3,p0));
      
  Point 
    *q0= new Point(bx->xmin(),bx->ymin(),bx->zmax()),
    *q1= new Point(bx->xmin(),bx->ymax(),bx->zmax()),
    *q2= new Point(bx->xmax(),bx->ymax(),bx->zmax()),
    *q3= new Point(bx->xmax(),bx->ymin(),bx->zmax());
  
  this->insert(q0);this->insert(q1); this->insert(new Edge(q0,q1));
  this->insert(q1);this->insert(q2); this->insert(new Edge(q1,q2));
  this->insert(q2);this->insert(q3); this->insert(new Edge(q2,q3));
  this->insert(q3);this->insert(q0); this->insert(new Edge(q3,q0));
  
  this->insert(p0);this->insert(q0);this->insert(new Edge(p0,q0));
  this->insert(p1);this->insert(q1);this->insert(new Edge(p1,q1));
  this->insert(p2);this->insert(q2);this->insert(new Edge(p2,q2));
  this->insert(p3);this->insert(q3);this->insert(new Edge(p3,q3));

  if(cross) {
    Point 
      *r0= new Point(bx->xmin(),bx->ymin(),bx->zmax()),
      *r1= new Point(bx->xmin(),bx->ymax(),bx->zmax()),
      *r2= new Point(bx->xmax(),bx->ymax(),bx->zmax()),
      *r3= new Point(bx->xmax(),bx->ymin(),bx->zmax());

    this->insert(r0);this->insert(r2);this->insert(new Edge(r0,r2));
    this->insert(r1);this->insert(r3);this->insert(new Edge(r1,r3));
  }
}
bool insert_regular ( Cell cell)

Definition at line 253 of file mesher3d_curve_algebraic.hpp.

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

                             {
  return cl->inserted_regular_in(this);
}
void insert_singular ( Point ) [virtual]

Definition at line 304 of file mesher3d_curve_algebraic.hpp.

                              {
  std::cout<<"Begin insert_singular Uff"<<endl;
  //  m_specials<<p;
}
void insert_singular ( BoundingBox bx) [virtual]

Definition at line 297 of file mesher3d_curve_algebraic.hpp.

                                      {
        std::cout<<"Begin insert_singular"<<endl;
        this->m_specials<<bx;
        std::cout<<"End insert_singular"<<endl;
}
bool is_regular ( Cell cell)

Definition at line 248 of file mesher3d_curve_algebraic.hpp.

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

                         {
  return cl->is_regular();
}
int nbe ( ) const [inline]

Definition at line 104 of file mesher3d_curve_algebraic.hpp.

{ return m_edges.size();}
int nbf ( ) const [inline]

Definition at line 105 of file mesher3d_curve_algebraic.hpp.

{ return m_faces.size();}
int nbv ( ) const [inline]

Definition at line 103 of file mesher3d_curve_algebraic.hpp.

{ return m_vertices.size();}
void operator<< ( Shape s) [inline]

Definition at line 100 of file mesher3d_curve_algebraic.hpp.

{ m_objects.push_back(s); }
bool post_process ( Cell cell)

Definition at line 258 of file mesher3d_curve_algebraic.hpp.

                           {
  return true;
}
void push_back ( Shape s) [inline]

Definition at line 99 of file mesher3d_curve_algebraic.hpp.

{ m_objects.push_back(s); }
void run ( void  )

Definition at line 201 of file mesher3d_curve_algebraic.hpp.

References AlgebraicCurve, Cell3dAlgebraicCurve, node< _Object, _CELL >::get_cell(), cell3d_algebraic_curve< C, V >::is_active(), node< _Object, _CELL >::set_cell(), and bounding_box< C, V >::size().

              {
  //no singularities are detected in the topology of the space algebraic curve. stopFlag is set to false(0)
  stopFlag=0;
  Node* root = m_tree->root();

  if(this->m_objects.size()==0) return;

  AlgebraicCurve* ic = dynamic_cast<AlgebraicCurve *>(*(this->m_objects.begin()));
  Cell* cl = new Cell3dAlgebraicCurve(ic, this->m_bbx);

//   foreach(Shape* s, m_objects) 
//     cl->push_back(SurfaceCellFactory::instance()->create(s,m_bbx)) ;
  
  root->set_cell(cl);
  m_nodes.push_back(root) ;
     
  double maxsz = this->m_maxprec*m_tree->root()->get_cell()->size();
  double minsz = this->m_minprec*m_tree->root()->get_cell()->size();

  while(!m_nodes.empty()) {
    Node* node = m_nodes.front() ;
    Cell* cl = node->get_cell() ;

    if(cl->is_active()) {
      if(cl->size() > maxsz) 
        { 
          this->subdivide(cl, node) ;
        } 
      else if(this->is_regular(cl)) 
        { 
          this->insert_regular(cl) ;
        } 
      else if(cl->size() > minsz ) 
        { 
          this->subdivide(cl, node) ;
        } 
      else { 
                  this->sing_process(cl);
                  //singularities are detected in the topology of the space algebraic curve. stopFlag is set to true(1)
                  stopFlag=1;
      }
    }
    m_nodes.pop_front() ;
  }
}
void set_precision ( double  eps) [inline]

Definition at line 96 of file mesher3d_curve_algebraic.hpp.

{ m_minprec = eps; }
void set_smoothness ( double  eps) [inline]

Definition at line 97 of file mesher3d_curve_algebraic.hpp.

{ m_maxprec = eps; }
typedef SHAPE_OF ( )
bool sing_process ( Cell cell)

Definition at line 263 of file mesher3d_curve_algebraic.hpp.

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

                           {
  //the method insert_singular(Topology* t) from cell3d_algebraic_curve.hpp is used here!!
  return cl->inserted_singular_in(this) ;
}
bool subdivide ( Cell cell,
Node node 
)

Definition at line 269 of file mesher3d_curve_algebraic.hpp.

References mmx::shape_ssi::left(), node< _Object, _CELL >::m_left, node< _Object, _CELL >::m_right, Node, mmx::shape_ssi::right(), and cell3d_algebraic_curve< C, V >::subdivide().

                                     {

  int v = 0;
  Cell * left, * right;
  v = cl->subdivide(left, right) ;
  node->m_left = new Node(node, left,  Node::LEFT , v) ; m_nodes << node->m_left ;
  node->m_right= new Node(node, right, Node::RIGHT, v) ; m_nodes << node->m_right;

  return true ;
}
const Kdtree* tree ( void  ) const [inline]

Definition at line 131 of file mesher3d_curve_algebraic.hpp.

{ return m_tree; }
const Seq<Point *>& vertices ( void  ) const [inline]

Definition at line 108 of file mesher3d_curve_algebraic.hpp.

{ return m_vertices ; }
Seq<Point *>& vertices ( void  ) [inline]

Definition at line 107 of file mesher3d_curve_algebraic.hpp.

{ return m_vertices ; }
virtual Point* vertices ( int  i) [inline, virtual]

Definition at line 114 of file mesher3d_curve_algebraic.hpp.

{ return m_vertices[i] ; }

Member Data Documentation

int stopFlag

Definition at line 141 of file mesher3d_curve_algebraic.hpp.


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