shape_doc 0.1
mesher3d_dual< C, V, Shape, Cell > Struct Template Reference

#include <mesher3d_dual.hpp>

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

List of all members.

Public Types

Public Member Functions


Detailed Description

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

Definition at line 27 of file mesher3d_dual.hpp.


Member Typedef Documentation

typedef Cell::BoundingBox BoundingBox [inherited]

Definition at line 46 of file mesher3d.hpp.

typedef Output::Edge Edge

Reimplemented from mesher3d< C, V, Shape, Cell >.

Definition at line 33 of file mesher3d_dual.hpp.

typedef Output::Face Face

Reimplemented from mesher3d< C, V, Shape, Cell >.

Definition at line 34 of file mesher3d_dual.hpp.

typedef Cell Input

Reimplemented from mesher3d< C, V, Shape, Cell >.

Definition at line 30 of file mesher3d_dual.hpp.

typedef tpl3d<C,V> Output

Reimplemented from mesher3d< C, V, Shape, Cell >.

Definition at line 31 of file mesher3d_dual.hpp.

Reimplemented from mesher3d< C, V, Shape, Cell >.

Definition at line 32 of file mesher3d_dual.hpp.

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

Definition at line 39 of file mesher3d.hpp.


Constructor & Destructor Documentation

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

Definition at line 60 of file mesher3d_dual.hpp.

                                            : mesher3d<C,V,Shape,Cell>(e1,e2)
//m_smooth(e1), m_prec(e2)
{
  //  m_output = new Output;
}
~mesher3d_dual ( void  )

Definition at line 66 of file mesher3d_dual.hpp.

                              {
  //  delete m_output;
}

Member Function Documentation

void clear ( void  ) [inherited]

Definition at line 106 of file mesher3d.hpp.

                          {
  this->output()->clear();
}
double get_precision ( void  ) [inline, inherited]

Definition at line 58 of file mesher3d.hpp.

{ return m_prec;   }
double get_smoothness ( void  ) [inline, inherited]

Definition at line 57 of file mesher3d.hpp.

{ return m_smooth; }
Input* input ( void  ) [inline, inherited]

Definition at line 61 of file mesher3d.hpp.

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

Definition at line 62 of file mesher3d.hpp.

{ return m_output; }
void run ( void  )

Reimplemented from mesher3d< C, V, Shape, Cell >.

Definition at line 70 of file mesher3d_dual.hpp.

References Cell, marching_cube::centralise(), Edge, Face, face< C, V, POINT >::insert(), subdivision< C, V, Shape, Cell >::output(), subdivision< C, V, Shape, Cell >::run(), dualize< C, V, Shape, Cell >::set_input(), and subdivision< C, V, Shape, Cell >::set_input().

                        {

  typedef subdivision<C,V,Shape,Cell>      Subdivisor;
  Subdivisor* sbd = new Subdivisor(this->get_smoothness(),this->get_precision());
  sbd->set_input(this->input());
  sbd->run();

  std::cout<< "leaves    = "<< sbd->output()->m_leaves.size()<<"\n";

  typedef dualize<C,V,Shape,Cell>  Dualize;
  Dualize* dl = new Dualize;
  dl->set_input(sbd->output());
  dl->run();

  //  this->get_adjacency();
  std::cout<< "Dual edges= "<< dl->output()->m_edges.size()/2<<"\n";
  std::cout<< "Dual faces= "<< dl->output()->m_faces.size()/3<<"\n";

  foreach(Cell * cl, sbd->output()->m_leaves) { 
    marching_cube::centralise(*cl, *cl);
    //    marching_cube::polygonise(*cl, *cl);
    foreach(Point* p, cl->m_points) this->output()->insert(p); 
  }

  for(unsigned i=0; i< dl->output()->m_edges.size();i+=2){
    Edge* e=new Edge(dl->output()->m_edges[i]->get_cell()->m_points[0],
                     dl->output()->m_edges[i+1]->get_cell()->m_points[0]);
    this->output()->insert(e);
  }

  for(unsigned i=0; i< dl->output()->m_faces.size();i+=3){
    Face* f=new Face;
    f->insert(dl->output()->m_faces[i]->get_cell()->m_points[0]); 
    f->insert(dl->output()->m_faces[i+1]->get_cell()->m_points[0]);
    f->insert(dl->output()->m_faces[i+2]->get_cell()->m_points[0]);
    this->output()->insert(f);
  }

//  foreach(Cell * cl, this->m_leaves) { 
//     marching_cube::polygonise(*cl, *cl);
//     foreach(Point* p, cl->m_points)  m_output.insert(p);
//     foreach(Face* f,  cl->m_faces)   m_output.insert(f);
//  }

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

Definition at line 51 of file mesher3d.hpp.

{ m_input= cl; }
void set_input ( Shape s,
const BoundingBox bx 
) [inherited]

Definition at line 85 of file mesher3d.hpp.

{
  this->set_input(cell3d_factory<C,V>::instance()->create(s,bx));
}
void set_precision ( double  e) [inline, inherited]
Examples:
algebraic_surface_test.cpp.

Definition at line 55 of file mesher3d.hpp.

{ m_prec   = e; }
void set_smoothness ( double  e) [inline, inherited]

Definition at line 54 of file mesher3d.hpp.

{ m_smooth = e; }

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