shape_doc 0.1
mesher3d_shape< C, V > Struct Template Reference

#include <mesher3d_shape.hpp>

Inheritance diagram for mesher3d_shape< C, V >:
subdivision< C, with_tpl3d< V >, SHAPE_OF(V), cell3d< 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 cell3d<C,Ref> Cell

Definition at line 43 of file mesher3d_shape.hpp.

typedef cell3d<C,Ref> Cell3d

Definition at line 44 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 cell3d< C, V > Input [inherited]

Definition at line 105 of file subdivision.hpp.

typedef kdtree<Shape *, Cell *> Kdtree

Definition at line 49 of file mesher3d_shape.hpp.

typedef node<Shape *, Cell *> Node
typedef kdtree_cell<SHAPE_OF(V) ,cell3d< C, V > > Output [inherited]

Definition at line 106 of file subdivision.hpp.

Definition at line 39 of file mesher3d_shape.hpp.

typedef C Scalar [inherited]

Definition at line 101 of file subdivision.hpp.

typedef subdivision<C,with_tpl3d<V>, typename SHAPE_OF(V), cell3d<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 
)

Definition at line 69 of file mesher3d_shape.hpp.

                                             : Subdivision(e1, e2) {
}
mesher3d_shape ( Shape s,
const BoundingBox bx,
double  e1 = 0.1,
double  e2 = 0.01 
)

Definition at line 72 of file mesher3d_shape.hpp.

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

: Subdivision(e1, e2) {
  this->set_input(Cell3dFactory::instance()->create(s0,bx0));
}
~mesher3d_shape ( void  )

Definition at line 77 of file mesher3d_shape.hpp.

                               {
  //  delete m_tree ;
}

Member Function Documentation

void clear ( void  ) [virtual]

Remove all vertices, edges and faces from the 3D subdivision.

Reimplemented from subdivision< C, with_tpl3d< V >, SHAPE_OF(V), cell3d< C, V > >.

Definition at line 159 of file mesher3d_shape.hpp.

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

Definition at line 122 of file subdivision.hpp.

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

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

Definition at line 123 of file subdivision.hpp.

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

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

Definition at line 114 of file subdivision.hpp.

{ return m_input; }
bool insert_regular ( Cell cell)

Definition at line 97 of file mesher3d_shape.hpp.

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

                             {
  this->output()->m_leaves <<cl;// put in the leaves and will be treated at the end
  return cl->insert_regular(this);
//  return true;
}
bool is_regular ( Cell cell)

Definition at line 92 of file mesher3d_shape.hpp.

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

                         {
  return cl->is_regular();  
}
Output* output ( void  ) [inline, inherited]

Definition at line 115 of file subdivision.hpp.

{ return m_output; }
typedef REF_OF ( )
void run ( void  )

Reimplemented from subdivision< C, with_tpl3d< V >, SHAPE_OF(V), cell3d< C, V > >.

Definition at line 117 of file mesher3d_shape.hpp.

References node< _Object, _CELL >::get_cell(), cell3d< C, V >::is_active(), cell3d< C, V >::is_regular(), and bounding_box< C, V >::size().

                        {
  //this->Subdivision::run();
  double maxsz = this->get_smoothness()*this->output()->root()->get_cell()->size();
  double minsz = this->get_precision()*this->output()->root()->get_cell()->size();

  std::cout<<maxsz<<" "<<minsz<<std::endl;
  while(!this->output()->m_nodes.empty()) {
    Node* node = this->output()->m_nodes.front() ;
    Cell* cl = node->get_cell() ;

    if(cl->is_active()) {
      if(cl->size() > maxsz)
        {
          this->subdivide(cl, node) ;
        }
      else if(cl->is_regular())
        {
          this->insert_regular(cl) ;
        }
      else if(cl->size() > minsz )
        {
//        std::cout<<"subdivide not regular"<<std::endl;
          this->subdivide(cl, node) ;
        }
      else {
//      std::cout<<"insert singular"<<std::endl;
        //this->sing_process(cl);
      }
    }
    this->output()->m_nodes.pop_front() ;
  }

  foreach(Cell * cl, this->output()->m_leaves) {
     dynamic_cast<Cell3d*>(cl)->topology_regular(this);
     //foreach(Point* p, cl->m_points)  this->insert(p);
     //foreach(Face* f,  cl->m_faces)   this->insert(f);
  }

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

}
void set_input ( Shape s,
const BoundingBox bx 
)

Definition at line 86 of file mesher3d_shape.hpp.

{
  this->set_input(Cell3dFactory::instance()->create(s0,bx0));
}
void set_input ( Cell cl)

Definition at line 81 of file mesher3d_shape.hpp.

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

{
  this->set_input(cl);
}
void set_input ( cell3d< C, V > *  bx) [inherited]
void set_precision ( double  ) [inherited]
void set_smoothness ( double  ) [inherited]
typedef SHAPE_OF ( )
bool sing_process ( Cell cell)

Definition at line 104 of file mesher3d_shape.hpp.

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

                           {
  return cl->insert_singular(this) ;
}
bool subdivide ( Cell cell,
Node node 
)

Definition at line 109 of file mesher3d_shape.hpp.

References mmx::shape_ssi::left(), node< _Object, _CELL >::m_left, node< _Object, _CELL >::m_right, Node, mmx::shape_ssi::right(), and cell3d< C, V >::subdivide().

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

Member Data Documentation

double m_maxprec [inherited]

Definition at line 131 of file subdivision.hpp.

double m_minprec [inherited]

Definition at line 132 of file subdivision.hpp.


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