23 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
25 class axlSphereConverterPrivate
45 return "Converter from axlSphereConverter to axlMesh";
50 return QStringList() <<
"axlSphereConverter" <<
"axlSphere";
60 return dtkAbstractDataFactory::instance()->registerDataConverterType(
"axlSphereConverter", QStringList(),
"axlMesh",
createaxlSphereConverter);
70 double x= d->data->x(),
75 unsigned N1=50, N2=50;
77 for(
unsigned i=0;i<N1;i++)
78 for(
unsigned j=0;j<N2;j++)
80 y+r*sin(2*pi*i/N1)*cos(2*pi*j/N2),
82 for(
unsigned i=0;i<N1;i++)
83 for(
unsigned j=0;j<N2;j++){
86 f.push_back((i+1)%N1+N1*j);
87 f.push_back((i+1)%N1+N1*((j+1)%N2));
88 f.push_back(i+N1*((j+1)%N2));;
97 if(
axlSphere *sphere = dynamic_cast<axlSphere *>(data))
~axlSphereConverter(void)
void setData(dtkAbstractData *data)
QString description(void) const
QString toType(void) const
static bool registered(void)
dtkAbstractDataConverter * createaxlSphereConverter(void)
QVector< int > Face
A face is a polygon represented by a loop of vertices.
QStringList fromTypes(void) const
Class axlSphere defines 3D spheres.
void push_back_face(const Face &face)
Class axlMesh defines a piecewise-linear 3D object.
void push_back_vertex(const double &x, const double &y, const double &z)
Add a new vertex to the mesh.