shape_doc 0.1
subdivision< C, V, Shape, Cell > Class Template Reference

#include <subdivision.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class C, class V, class Shape = typename SHAPE_OF(V), class Cell = cell<C,V>>
class mmx::shape::subdivision< C, V, Shape, Cell >

Definition at line 98 of file subdivision.hpp.


Member Typedef Documentation

typedef Cell::BoundingBox BoundingBox
typedef Cell Input

Definition at line 105 of file subdivision.hpp.

typedef node<Shape*, Cell*> Node
typedef kdtree_cell<Shape,Cell> Output

Definition at line 106 of file subdivision.hpp.

typedef C Scalar

Definition at line 101 of file subdivision.hpp.


Constructor & Destructor Documentation

subdivision ( double  e1 = 0.1,
double  e2 = 0.01 
)

Reimplemented in subdivision< C, with_tpl3d< V >, SURFACE, CELL >.

Definition at line 140 of file subdivision.hpp.

                                          : m_maxprec(e1), m_minprec(e2)
{ 
  m_output = new Output;
}
~subdivision ( void  )

Reimplemented in subdivision< C, with_tpl3d< V >, SURFACE, CELL >.

Definition at line 145 of file subdivision.hpp.

                            {
  delete m_output;
}

Member Function Documentation

void clear ( void  ) [virtual]

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

Reimplemented in mesher3d_shape< C, V >, and subdivision< C, with_tpl3d< V >, SURFACE, CELL >.

Definition at line 164 of file subdivision.hpp.

                      {

}
double get_precision ( void  ) const [inline]

Definition at line 122 of file subdivision.hpp.

{ return m_minprec ; }
double get_smoothness ( void  ) const [inline]

Definition at line 123 of file subdivision.hpp.

{ return m_maxprec ; }
Input* input ( void  ) [inline]

Definition at line 114 of file subdivision.hpp.

{ return m_input; }
Output* output ( void  ) [inline]

Definition at line 115 of file subdivision.hpp.

Referenced by mesher3d_dual< C, V, Shape, Cell >::run(), and mesher3d< C, V, Shape, Cell >::run().

{ return m_output; }
void run ( void  )

Reimplemented in mesher3d_shape< C, V >.

Definition at line 168 of file subdivision.hpp.

References Cell, and node< _Object, _CELL >::get_cell().

Referenced by mesher3d_dual< C, V, Shape, Cell >::run(), and mesher3d< C, V, Shape, Cell >::run().

                    {

 typedef use<subdivision_def,V> ENV;

 double maxsz = this->get_smoothness()*this->output()->root()->get_cell()->size();
 double minsz = this->get_precision()*this->output()->root()->get_cell()->size();
    
 while(!this->output()->m_nodes.empty()) {
   Node* node = this->output()->m_nodes.front() ;
   Cell* cl = node->get_cell() ;
   
   if(ENV::is_active(this,cl)) {
     if(cl->size() > maxsz) 
       { 
         ENV::subdivide_node(this->output(), cl, node) ;
       } 
     else if(ENV::is_regular(this,cl)) 
       { 
         ENV::process_regular(this->output(),cl) ;
       } 
     else if(cl->size() > minsz ) 
       { 
         ENV::subdivide_node(this->output(), cl, node) ;
       } 
     else { 
       ENV::process_singular(this->output(), cl);
     }
   }
   this->output()->m_nodes.pop_front() ;
 }
}
void set_input ( Cell *  bx)

Definition at line 149 of file subdivision.hpp.

References node< _Object, _CELL >::set_cell().

Referenced by mesher3d_dual< C, V, Shape, Cell >::run(), and mesher3d< C, V, Shape, Cell >::run().

{ 
  Node* root = this->output()->root();
  root->set_cell(c0);
  m_output->m_nodes.push_back(root) ;
}
void set_precision ( double  eps)
void set_smoothness ( double  eps)

Member Data Documentation


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