subdivision< C, V, 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 Cell = cell<C,V>>
class mmx::shape::subdivision< C, V, Cell >

Definition at line 96 of file subdivision.hpp.


Member Typedef Documentation

typedef Cell::BoundingBox BoundingBox

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

Definition at line 100 of file subdivision.hpp.

typedef Cell Input

Definition at line 103 of file subdivision.hpp.

typedef node<Cell*> Node

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

Definition at line 102 of file subdivision.hpp.

typedef kdtree_cell<Cell> Output

Definition at line 104 of file subdivision.hpp.

typedef C Scalar

Definition at line 99 of file subdivision.hpp.


Constructor & Destructor Documentation

subdivision ( double  e1 = 0.1,
double  e2 = 0.001 
) [inline]

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

Definition at line 137 of file subdivision.hpp.

00137                                           : m_maxprec(e1), m_minprec(e2)
00138 { 
00139     m_output = new Output;
00140 }

~subdivision ( void   )  [inline]

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

Definition at line 142 of file subdivision.hpp.

00142                             {
00143     delete m_output;
00144 }


Member Function Documentation

void clear ( void   )  [inline, virtual]

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

Definition at line 161 of file subdivision.hpp.

Referenced by subdivision< C, with_tpl3d< V >, CELL >::clear().

00161                       {
00162 
00163 }

Input* get_input ( void   )  [inline]

Definition at line 113 of file subdivision.hpp.

00113 { return m_input; }

Output* get_output ( void   )  [inline]
double get_precision ( void   )  const [inline]

Definition at line 120 of file subdivision.hpp.

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

00120 { return m_minprec ; }

double get_smoothness ( void   )  const [inline]

Definition at line 121 of file subdivision.hpp.

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

00121 { return m_maxprec ; }

void run ( void   )  [inline]

Reimplemented in mesher3d_shape< C, V >.

Definition at line 165 of file subdivision.hpp.

References Cell, node< _CELL >::get_cell(), subdivision< C, V, Cell >::get_output(), subdivision< C, V, Cell >::get_precision(), subdivision< C, V, Cell >::get_smoothness(), kdtree_cell< CELL >::m_nodes, and kdtree_cell< CELL >::root().

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

00165                     {
00166 
00167     typedef use<subdivision_def,C,V> USE;
00168 
00169     double maxsz = this->get_smoothness()*this->get_output()->root()->get_cell()->size();
00170     double minsz = this->get_precision()*this->get_output()->root()->get_cell()->size();
00171 
00172     std::cout<<"Size :"<< maxsz<< " "<<minsz<<std::endl;
00173 
00174     while(!this->get_output()->m_nodes.empty()) {
00175         Node* node = this->get_output()->m_nodes.front() ;
00176         Cell* cl = node->get_cell() ;
00177 
00178         if( USE::is_not_out(this,cl)) {
00179             if(cl->size() > maxsz)
00180             {
00181                 USE::subdivide_node(this->get_output(), cl, node) ;
00182             }
00183             else if(USE::is_regular(this,cl))
00184             {
00185                 USE::process_regular(this->get_output(),cl) ;
00186             }
00187             else if(cl->size() > minsz )
00188             {
00189                 USE::subdivide_node(this->get_output(), cl, node) ;
00190             }
00191             else {
00192                 std::cout<<"Singular cell"<<std::endl;
00193                 USE::process_singular(this->get_output(), cl);
00194             }
00195         }
00196         this->get_output()->m_nodes.pop_front() ;
00197     }
00198 }

void set_input ( Cell *  bx  )  [inline]

Definition at line 146 of file subdivision.hpp.

References subdivision< C, V, Cell >::get_output(), kdtree_cell< CELL >::m_nodes, kdtree_cell< CELL >::root(), and node< _CELL >::set_cell().

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

00147 { 
00148     Node* root = this->get_output()->root();
00149     root->set_cell(c0);
00150     m_output->m_nodes.push_back(root) ;
00151 }

void set_precision ( double  eps  )  [inline]

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

Definition at line 157 of file subdivision.hpp.

References subdivision< C, V, Cell >::m_minprec.

Referenced by subdivision< C, with_tpl3d< V >, CELL >::set_precision().

00157                                         {
00158     m_minprec = eps;
00159 }

void set_smoothness ( double  eps  )  [inline]

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

Definition at line 153 of file subdivision.hpp.

References subdivision< C, V, Cell >::m_maxprec.

Referenced by subdivision< C, with_tpl3d< V >, CELL >::set_smoothness().

00153                                          {
00154     m_maxprec = eps;
00155 }


Member Data Documentation

double m_maxprec
double m_minprec

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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1