mesher3d_dual< C, V, Cell > Struct Template Reference

#include <mesher3d_dual.hpp>

Inheritance diagram for mesher3d_dual< C, V, Cell >:
mesher3d< C, V, Cell >

List of all members.

Public Types

Public Member Functions


Detailed Description

template<class C, class V = default_env, class Cell = bcell<C,V>>
struct mmx::shape::mesher3d_dual< C, V, Cell >

Definition at line 27 of file mesher3d_dual.hpp.


Member Typedef Documentation

typedef Output::Edge Edge

Reimplemented from mesher3d< C, V, Cell >.

Definition at line 33 of file mesher3d_dual.hpp.

typedef Output::Face Face

Definition at line 34 of file mesher3d_dual.hpp.

typedef Cell Input

Reimplemented from mesher3d< C, V, Cell >.

Definition at line 30 of file mesher3d_dual.hpp.

typedef tpl3d<C,V> Output

Reimplemented from mesher3d< C, V, Cell >.

Definition at line 31 of file mesher3d_dual.hpp.

Reimplemented from mesher3d< C, V, Cell >.

Definition at line 32 of file mesher3d_dual.hpp.

typedef subdivision<C,V,Cell> Subdivisor [inherited]

Definition at line 69 of file mesher3d.hpp.

typedef use<topology3d_def,C,V> Topology [inherited]

Definition at line 73 of file mesher3d.hpp.


Constructor & Destructor Documentation

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

Definition at line 60 of file mesher3d_dual.hpp.

00060                                             : mesher3d<C,V,Cell>(e1,e2)
00061 //m_smooth(e1), m_prec(e2)
00062 {
00063   //  m_output = new Output;
00064 }

~mesher3d_dual ( void   )  [inline]

Definition at line 66 of file mesher3d_dual.hpp.

00066                               {
00067   //  delete m_output;
00068 }


Member Function Documentation

void clear ( void   )  [inline, inherited]

Definition at line 309 of file mesher3d.hpp.

00309                           {
00310     this->output()->clear();
00311 }

Input* get_input ( void   )  [inline, inherited]

Definition at line 90 of file mesher3d.hpp.

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

00090 { return m_input; }

Output* get_output ( void   )  [inline, inherited]

Definition at line 91 of file mesher3d.hpp.

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

00091 { return m_output; }

double get_precision ( void   )  [inline, inherited]

Definition at line 87 of file mesher3d.hpp.

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

00087 { return m_prec;   }

double get_smoothness ( void   )  [inline, inherited]

Definition at line 86 of file mesher3d.hpp.

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

00086 { return m_smooth; }

void run ( void   )  [inline]

Reimplemented from mesher3d< C, V, Cell >.

Definition at line 70 of file mesher3d_dual.hpp.

References Cell, marching_cube::centralise(), mesher3d< C, V, Cell >::get_precision(), mesher3d< C, V, Cell >::get_smoothness(), marching_cube::polygonise(), subdivision< C, V, Cell >::run(), and subdivision< C, V, Cell >::set_input().

00070                         {
00071 
00072   typedef subdivision<C,V,Cell>      Subdivisor;
00073   Subdivisor* sbd = new Subdivisor(this->get_smoothness(),this->get_precision());
00074   sbd->set_input(this->input());
00075   sbd->run();
00076 
00077   std::cout<< "leaves    = "<< sbd->output()->m_leaves.size()<<"\n";
00078 
00079   typedef dualize<C,V,Cell>  Dualize;
00080   Dualize* dl = new Dualize;
00081   dl->set_input(sbd->output());
00082   dl->run();
00083 
00084   //this->get_adjacency();
00085   std::cout<< "Dual edges= "<< dl->output()->m_edges.size()/2<<"\n";
00086   std::cout<< "Dual faces= "<< dl->output()->m_faces.size()/4<<"\n";
00087 
00088   bool ctr = false;
00089   if (ctr) foreach(Cell * cl, sbd->output()->m_leaves) { 
00090       marching_cube::centralise(*cl, *cl);
00091       foreach(Point* p, cl->m_points) this->output()->insert(p); 
00092       
00093       //marching_cube::polygonise(*cl, *cl);
00094   }
00095 
00096   if (ctr) for(unsigned i=0; i< dl->output()->m_edges.size();i+=2){
00097     Edge* e=new Edge(dl->output()->m_edges[i]->get_cell()->m_points[0],
00098                      dl->output()->m_edges[i+1]->get_cell()->m_points[0]);
00099     this->output()->insert(e);
00100   }
00101 
00102   if (ctr) 
00103   for(unsigned i=0; i< dl->output()->m_faces.size();i+=4){
00104     Face* f=new Face;
00105     f->insert(dl->output()->m_faces[i]->get_cell()->m_points[0]); 
00106     f->insert(dl->output()->m_faces[i+1]->get_cell()->m_points[0]);
00107     f->insert(dl->output()->m_faces[i+2]->get_cell()->m_points[0]);
00108     this->output()->insert(f);
00109   }
00110   
00111   if (!ctr) 
00112   foreach(Cell * cl, sbd->output()->m_leaves) { 
00113     marching_cube::polygonise(*cl, *cl);
00114     foreach(Point* p, cl->m_points)  this->output()->insert(p);
00115     foreach(Face* f,  cl->m_faces)   this->output()->insert(f);
00116     std::cout<<"MC"<<std::endl;
00117   }
00118 
00119 }

void set_input ( Cell *  cl  )  [inline, inherited]

Definition at line 81 of file mesher3d.hpp.

00081 { m_input= cl; }

void set_precision ( double  e  )  [inline, inherited]

Definition at line 84 of file mesher3d.hpp.

00084 { m_prec   = e; }

void set_smoothness ( double  e  )  [inline, inherited]

Definition at line 83 of file mesher3d.hpp.

00083 { m_smooth = e; }


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1