mesher3d_shape< C, V > Struct Template Reference

#include <mesher3d_shape.hpp>

Inheritance diagram for mesher3d_shape< C, V >:
subdivision< C, with_tpl3d< V >, bcell3d< C, V > >

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

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

Definition at line 29 of file mesher3d_shape.hpp.


Member Typedef Documentation

typedef bcell3d<C,Ref> bcell3d< C, V >

Definition at line 44 of file mesher3d_shape.hpp.

Reimplemented from subdivision< C, with_tpl3d< V >, bcell3d< C, V > >.

Definition at line 46 of file mesher3d_shape.hpp.

typedef bcell3d<C,Ref> Cell

Definition at line 43 of file mesher3d_shape.hpp.

Definition at line 37 of file mesher3d_shape.hpp.

Definition at line 40 of file mesher3d_shape.hpp.

Definition at line 41 of file mesher3d_shape.hpp.

typedef bcell3d< C, V > Input [inherited]

Definition at line 103 of file subdivision.hpp.

typedef kdtree<Cell *> Kdtree

Definition at line 49 of file mesher3d_shape.hpp.

typedef node<Cell *> Node

Reimplemented from subdivision< C, with_tpl3d< V >, bcell3d< C, V > >.

Definition at line 48 of file mesher3d_shape.hpp.

typedef kdtree_cell<bcell3d< C, V > > Output [inherited]

Definition at line 104 of file subdivision.hpp.

Definition at line 39 of file mesher3d_shape.hpp.

typedef C Scalar [inherited]

Definition at line 99 of file subdivision.hpp.

typedef subdivision<C, with_tpl3d<V>, bcell3d<C,V> > Subdivision

Definition at line 33 of file mesher3d_shape.hpp.

typedef surface<Ref> Surface

Definition at line 45 of file mesher3d_shape.hpp.

typedef tpl3d<C,V> Topology

Definition at line 32 of file mesher3d_shape.hpp.

typedef use<subdivision_def,V> VRT

Definition at line 34 of file mesher3d_shape.hpp.


Constructor & Destructor Documentation

mesher3d_shape ( double  e1 = 0.1,
double  e2 = 0.01 
) [inline]

Definition at line 69 of file mesher3d_shape.hpp.

00069                                              : Subdivision(e1, e2) {
00070 }

mesher3d_shape ( Shape s,
const BoundingBox bx,
double  e1 = 0.1,
double  e2 = 0.01 
) [inline]

Definition at line 72 of file mesher3d_shape.hpp.

References bcell3d_factory< C, V >::instance(), and mesher3d_shape< C, V >::set_input().

00073 : Subdivision(e1, e2) {
00074   this->set_input(Cell3dFactory::instance()->create(s0,bx0));
00075 }

~mesher3d_shape ( void   )  [inline]

Definition at line 77 of file mesher3d_shape.hpp.

00077                                {
00078   //  delete m_tree ;
00079 }


Member Function Documentation

void clear ( void   )  [inline, virtual]

Reimplemented from subdivision< C, with_tpl3d< V >, bcell3d< C, V > >.

Definition at line 159 of file mesher3d_shape.hpp.

00159                           {
00160   //  this->output()->clear();
00161 }

Input* get_input ( void   )  [inline, inherited]

Definition at line 113 of file subdivision.hpp.

00113 { return m_input; }

Output* get_output ( void   )  [inline, inherited]

Definition at line 115 of file subdivision.hpp.

00115 { return m_output; }

double get_precision ( void   )  const [inline, inherited]

Definition at line 120 of file subdivision.hpp.

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

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

00120 { return m_minprec ; }

double get_smoothness ( void   )  const [inline, inherited]

Definition at line 121 of file subdivision.hpp.

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

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

00121 { return m_maxprec ; }

bool insert_regular ( Cell bcell  )  [inline]

Definition at line 97 of file mesher3d_shape.hpp.

References bcell3d< C, V >::insert_regular().

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

00097                              {
00098   this->output()->m_leaves <<cl;// put in the leaves and will be treated at the end
00099   return cl->insert_regular(this);
00100 //  return true;
00101 }

bool is_regular ( Cell bcell  )  [inline]

Definition at line 92 of file mesher3d_shape.hpp.

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

00092                          {
00093   return cl->is_regular();  
00094 }

typedef REF_OF (  ) 
void run ( void   )  [inline]

Reimplemented from subdivision< C, with_tpl3d< V >, bcell3d< C, V > >.

Definition at line 117 of file mesher3d_shape.hpp.

References Cell3d, node< _CELL >::get_cell(), subdivision< C, with_tpl3d< V >, bcell3d< C, V > >::get_precision(), subdivision< C, with_tpl3d< V >, bcell3d< C, V > >::get_smoothness(), mesher3d_shape< C, V >::insert_regular(), bcell3d< C, V >::is_active(), bcell3d< C, V >::is_regular(), bounding_box< C, V >::size(), and mesher3d_shape< C, V >::subdivide().

00117                         {
00118   //this->Subdivision::run();
00119   double maxsz = this->get_smoothness()*this->output()->root()->get_cell()->size();
00120   double minsz = this->get_precision()*this->output()->root()->get_cell()->size();
00121 
00122   std::cout<<maxsz<<" "<<minsz<<std::endl;
00123   while(!this->output()->m_nodes.empty()) {
00124     Node* node = this->output()->m_nodes.front() ;
00125     Cell* cl = node->get_cell() ;
00126 
00127     if(cl->is_active()) {
00128       if(cl->size() > maxsz)
00129         {
00130           this->subdivide(cl, node) ;
00131         }
00132       else if(cl->is_regular())
00133         {
00134           this->insert_regular(cl) ;
00135         }
00136       else if(cl->size() > minsz )
00137         {
00138 //        std::cout<<"subdivide not regular"<<std::endl;
00139           this->subdivide(cl, node) ;
00140         }
00141       else {
00142 //      std::cout<<"insert singular"<<std::endl;
00143         //this->sing_process(cl);
00144       }
00145     }
00146     this->output()->m_nodes.pop_front() ;
00147   }
00148 
00149   foreach(Cell * cl, this->output()->m_leaves) {
00150      dynamic_cast<Cell3d*>(cl)->topology_regular(this);
00151      //foreach(Point* p, cl->m_points)  this->insert(p);
00152      //foreach(Face* f,  cl->m_faces)   this->insert(f);
00153   }
00154 
00155   std::cout<< "leaves="<< this->output()->m_leaves.size()<<"\n";
00156 
00157 }

void set_input ( bcell3d< C, V > *  bx  )  [inherited]
void set_input ( Shape s,
const BoundingBox bx 
) [inline]

Definition at line 86 of file mesher3d_shape.hpp.

References bcell3d_factory< C, V >::instance(), and mesher3d_shape< C, V >::set_input().

00087 {
00088   this->set_input(Cell3dFactory::instance()->create(s0,bx0));
00089 }

void set_input ( Cell cl  )  [inline]

Definition at line 81 of file mesher3d_shape.hpp.

Referenced by mesher3d_shape< C, V >::mesher3d_shape(), and mesher3d_shape< C, V >::set_input().

00082 {
00083   this->set_input(cl);
00084 }

void set_precision ( double   )  [inherited]
void set_smoothness ( double   )  [inherited]
typedef SHAPE_OF (  ) 
bool sing_process ( Cell bcell  )  [inline]

Definition at line 104 of file mesher3d_shape.hpp.

References bcell3d< C, V >::insert_singular().

00104                            {
00105   return cl->insert_singular(this) ;
00106 }

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

Definition at line 109 of file mesher3d_shape.hpp.

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

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

00109                                      {
00110   Cell * left, * right;
00111   int v = cl->subdivide(left, right) ;
00112   node->m_left = new Node(node, left,  Node::LEFT , v) ; this->output()->m_nodes << node->m_left ;
00113   node->m_right= new Node(node, right, Node::RIGHT, v) ; this->output()->m_nodes << node->m_right;
00114   return true ;
00115 }


Member Data Documentation

double m_maxprec [inherited]

Definition at line 129 of file subdivision.hpp.

double m_minprec [inherited]

Definition at line 130 of file subdivision.hpp.


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1