bcell2d_factory< C, V > Struct Template Reference

#include <bcell2d_factory.hpp>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions


Detailed Description

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

Definition at line 49 of file bcell2d_factory.hpp.


Member Typedef Documentation

typedef bounding_box<C, REF_OF(V) > BoundingBox

Definition at line 52 of file bcell2d_factory.hpp.

typedef bcell<C, REF_OF(V) > Cell

Definition at line 53 of file bcell2d_factory.hpp.


Member Function Documentation

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

Definition at line 93 of file bcell2d_factory.hpp.

References Cell2dInter, Cell2dList, bcell2d_factory< C, V >::create(), and Seq< C, R >::size().

00093                                                                {
00094         Cell * bcell = NULL ;
00095 
00096         if (s.size()==0) return NULL;
00097         if (s.size()==1)  return create(s[0],bx);
00098 
00099         if( dynamic_cast<SemiAlgebraicCurve *>(s[0]) )
00100         {
00101             Cell2dInter* l= new Cell2dInter(bx);
00102             //std::cout<<"semialg intersection"<<std::endl;
00103             foreach(Shape* o, s) l->push_back(create(o,bx)) ;
00104             bcell = l;
00105         }
00106         //else if ( dynamic_cast<VoronoiSite2d *>(s[0]) ) {
00107         //  Cell2dVoronoiDiagram* l = new Cell2dVoronoiDiagram(bx);
00108         //  //std::cout<<"voronoi diagram"<<std::endl;
00109         // foreach(Shape* o, s) l->push_back(create(o,bx)) ;
00110         //  bcell = l;
00111         //}
00112         else {
00113             Cell2dList* l= new Cell2dList(bx);
00114             // std::cout<<"bcell-list"<<std::endl;
00115             foreach(Shape* o, s) l->push_back(create(o,bx)) ;
00116             bcell = l;
00117         }
00118 
00119         return bcell;
00120     }

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

Definition at line 63 of file bcell2d_factory.hpp.

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

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

00063                                                         {
00064         // std::cout<<"create"<<std::endl;
00065 
00066         Cell* bcell = NULL ;
00067         if(SemiAlgebraicCurve * isemialg = dynamic_cast<SemiAlgebraicCurve *>(curve))
00068         {
00069             bcell = new Cell2dSemiAlgebraicCurve(isemialg,bx);
00070             //std::cout<<"semialg"<<std::endl;
00071         }
00072         //else if(VoronoiSite2d * vcurve = dynamic_cast<VoronoiSite2d *>(curve))
00073         //  {
00074         //      bcell = new Cell2dVoronoiSite(vcurve,bx);
00075         //      //std::cout<<"voronoi site"<<std::endl;
00076         //}
00077         else if(AlgebraicCurve * icurve = dynamic_cast<AlgebraicCurve *>(curve))
00078         {
00079             bcell = new Cell2dAlgebraicCurve(icurve,bx);
00080             //std::cout<<"algcurve"<<std::endl;
00081         }
00082         else if(ParametricCurve * pcurve = dynamic_cast<ParametricCurve *>(curve))
00083         {
00084             bcell = new Cell2dParametricCurve(pcurve,bx);
00085             //std::cout<<"parametric curve"<<std::endl;
00086         }
00087 
00088         if(bcell==NULL) std::cout<<"no dynamic cast bcell2d_factory"<<std::endl;
00089         return bcell ;
00090 
00091     }

static bcell2d_factory<C,V>* instance ( void   )  [inline, static]

Definition at line 55 of file bcell2d_factory.hpp.

References Cell2dFactory.

00055                                           {
00056 
00057         if(!m_instance)
00058             m_instance = new Cell2dFactory ;
00059 
00060         return m_instance ;
00061     }

typedef SHAPE_OF (  ) 

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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1