polygonizer< C, V, Input, Output > Struct Template Reference

#include <polygonizer.hpp>

List of all members.

Public Types

Public Member Functions


Detailed Description

template<class C, class V = default_env, class Input = Seq< cell<C,V>* >, class Output = mesh3d<C,default_env>>
struct mmx::shape::polygonizer< C, V, Input, Output >

Definition at line 25 of file polygonizer.hpp.


Member Typedef Documentation

typedef use<mesh3d_def,C,V>::Edge Edge

Definition at line 31 of file polygonizer.hpp.

typedef use<mesh3d_def,C,V>::Face Face

Definition at line 32 of file polygonizer.hpp.

typedef use<mesh3d_def,C,V>::Point Point

Definition at line 30 of file polygonizer.hpp.


Constructor & Destructor Documentation

polygonizer ( void   )  [inline]

Definition at line 53 of file polygonizer.hpp.

00053                            {
00054   m_output = new Output;
00055 }

~polygonizer ( void   )  [inline]

Definition at line 57 of file polygonizer.hpp.

00057                             {
00058   delete m_output;
00059 }


Member Function Documentation

void clear ( void   )  [inline]

Definition at line 119 of file polygonizer.hpp.

00119                           {  
00120 }

Input* get_input ( void   )  const [inline]

Definition at line 38 of file polygonizer.hpp.

Referenced by polygonizer< C, default_2d, Input, Output >::run(), and polygonizer< C, V, Input, Output >::run().

00038 { return m_input; }

Output* get_output ( void   )  const [inline]

Definition at line 41 of file polygonizer.hpp.

Referenced by polygonizer< C, default_2d, Input, Output >::run(), and polygonizer< C, V, Input, Output >::run().

00041 { return m_output; }

void run ( unsigned  n,
m = 0,
M = 1 
) [inline]

Definition at line 94 of file polygonizer.hpp.

References polygonizer< C, V, Input, Output >::get_input(), polygonizer< C, V, Input, Output >::get_output(), and marching_cube::polygonize().

00094                                         {
00095 
00096     C s=(M-m)/n;
00097   Point  points[8];
00098   C      values[8];
00099 
00100   Input L = *this->get_input();
00101 
00102   for(unsigned c=0; c< this->get_input()->size();c+=8){
00103 
00104     for(unsigned j=0; j<8; j++) {
00105       points[j] = L[c+j]->center();
00106       values[j] = L[c+j]->center_value()-m;
00107     }
00108 
00109     for(unsigned i=0; i<n+1; i++) {
00110        marching_cube::polygonize(*this->get_output(),points, values);
00111        for(unsigned j=0; j<8; j++) {
00112          values[j] += s;
00113        }
00114     }
00115   }
00116 
00117 }

void run ( void   )  [inline]

Definition at line 61 of file polygonizer.hpp.

References polygonizer< C, V, Input, Output >::get_input(), polygonizer< C, V, Input, Output >::get_output(), and marching_cube::polygonize().

00061                     {
00062 
00063   Point  points[8];
00064   C      values[8];
00065  
00066   Input L = *this->get_input();
00067 
00068   for(unsigned c=0; c< this->get_input()->size();c+=8){
00069 
00070     for(unsigned j=0; j<8; j++) {
00071       points[j] = L[c+j]->center();
00072       values[j] = L[c+j]->center_value();
00073     }
00074 
00075     marching_cube::polygonize(*this->get_output(),points, values);
00076 
00077 //    Point* P[8];
00078 //    if (!marching_cube::polygonize(*this->get_output(),points, values))
00079 //    {
00080 //      for (unsigned j=0;j<7;j++) {
00081 //        P[j] = new Point(points[j]);
00082 //          this->get_output()->insert(P[j]);
00083 //      }
00084 //    };
00085     
00086   }
00087 
00088   // foreach(Cell * cl, *this->input()) { 
00089   //     marching_cube::polygonise(*cl, *cl);
00090   //     foreach(Point* p, cl->m_points)  this->output()->insert(p);
00091   //     foreach(Face* f,  cl->m_faces)   this->output()->insert(f);
00092   //   }
00093 }//--------------------------------------------------------------------

void set_input ( Input *  i  )  [inline]

Definition at line 37 of file polygonizer.hpp.

00037 { m_input = i; }

void set_output ( Output *  o  )  [inline]

Definition at line 40 of file polygonizer.hpp.

00040 { m_output = o; }


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1