shape_doc 0.1
cell2d_factory< C, V > Struct Template Reference

#include <topology2d.hpp>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions


Detailed Description

template<class C, class V>
struct mmx::shape::cell2d_factory< C, V >

Definition at line 168 of file topology2d.hpp.


Member Typedef Documentation

typedef bounding_box<C, REF_OF(V) > BoundingBox

Definition at line 171 of file topology2d.hpp.

typedef cell<C, REF_OF(V) > Cell

Definition at line 172 of file topology2d.hpp.


Member Function Documentation

Cell* create ( Shape curve,
const BoundingBox bx 
) [inline]

Definition at line 182 of file topology2d.hpp.

References AlgebraicCurve, Cell2dAlgebraicCurve, Cell2dParametricCurve, Cell2dSemiAlgebraicCurve, ParametricCurve, and SemiAlgebraicCurve.

Referenced by cell2d_factory< C, V >::create().

                                                      {
    // std::cout<<"create"<<std::endl;
        
    Cell* cell = NULL ;
    if(SemiAlgebraicCurve * isemialg = dynamic_cast<SemiAlgebraicCurve *>(curve))
      {
        cell = new Cell2dSemiAlgebraicCurve(isemialg,bx);
        //std::cout<<"semialg"<<std::endl;
      }
    //else if(VoronoiSite2d * vcurve = dynamic_cast<VoronoiSite2d *>(curve))
    //  {
    //  cell = new Cell2dVoronoiSite(vcurve,bx);
    //  //std::cout<<"voronoi site"<<std::endl;
    //}
    else if(AlgebraicCurve * icurve = dynamic_cast<AlgebraicCurve *>(curve))
      {
        cell = new Cell2dAlgebraicCurve(icurve,bx);
        //std::cout<<"algcurve"<<std::endl;
      }
    else if(ParametricCurve * pcurve = dynamic_cast<ParametricCurve *>(curve))
      {
        cell = new Cell2dParametricCurve(pcurve,bx);
        //std::cout<<"parametric curve"<<std::endl;
      }

    if(cell==NULL) std::cout<<"no dynamic cast cell2d_factory"<<std::endl;
    return cell ;

  }
Cell* create ( const Seq< Shape * > &  s,
const BoundingBox bx 
) [inline]

Definition at line 212 of file topology2d.hpp.

References Cell2dInter, Cell2dList, and cell2d_factory< C, V >::create().

                                                             {
    Cell * cell = NULL ;
  
    if (s.size()==0) return NULL;
    if (s.size()==1)  return create(s[0],bx);

    if( dynamic_cast<SemiAlgebraicCurve *>(s[0]) )
    {
      Cell2dInter* l= new Cell2dInter(bx);
      //std::cout<<"semialg intersection"<<std::endl;
      foreach(Shape* o, s) l->push_back(create(o,bx)) ;
      cell = l;
    } 
    //else if ( dynamic_cast<VoronoiSite2d *>(s[0]) ) {
    //  Cell2dVoronoiDiagram* l = new Cell2dVoronoiDiagram(bx);
    //  //std::cout<<"voronoi diagram"<<std::endl;
    // foreach(Shape* o, s) l->push_back(create(o,bx)) ;
    //  cell = l;
    //}
    else {
      Cell2dList* l= new Cell2dList(bx);
      // std::cout<<"cell-list"<<std::endl;
      foreach(Shape* o, s) l->push_back(create(o,bx)) ;
      cell = l;
    }
    
    return cell;
  }
static cell2d_factory<C,V>* instance ( void  ) [inline, static]

Definition at line 174 of file topology2d.hpp.

References Cell2dFactory.

                                        {

        if(!m_instance)
            m_instance = new Cell2dFactory ;

        return m_instance ;
    }
typedef SHAPE_OF ( )

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