Developer documentation | Axl-2.5.1

axlShape.h
Go to the documentation of this file.
1 /* axlShape.h ---
2  *
3  * Author: Valentin Michelet
4  * Copyright (C) 2008-2013 - Valentin Michelet, Inria.
5  * Created: Wed Mar 20 03:47:23 2013 (+0100)
6  * Version: $Id$
7  */
8 
9 /* Commentary:
10  *
11  */
12 
13 /* Change log:
14  *
15  */
16 
17 #ifndef AXLSHAPE_H
18 #define AXLSHAPE_H
19 
20 #include "axlCoreExport.h"
21 #include "axlAbstractData.h"
24 
25 #include <QtCore>
26 
27 class axlShapePrivate;
28 class axlPoint;
30 
32  Q_OBJECT
33 
34 public:
41  struct Edge {
44 
47 
50 
51  Edge():indexStartVertex(0), indexEndVertex(1), curve(NULL) {};
52 
54  Edge(axlAbstractCurveParametric* crv, int si, int ei): indexStartVertex(si), indexEndVertex(ei), curve(crv) {};
55  };
56 
62  struct Loop {
64  QVector<int> edges;
65 
67  QVector<bool> orientations;
68  };
69 
76  struct Face {
78  QVector<Loop*> loops;
79 
82  };
83 
84 public:
85 
91  axlShape(int vertexCount, int edgeCount, int faceCount, axlShape* parent = 0);
95  virtual ~axlShape(void);
96 
100  QVector<axlPoint*> getVertices(void) const;
101 
105  QVector<Edge*> getEdges(void) const;
106 
110  QVector<Face*> getFaces(void) const;
111 
115  int getVertexCount(void) const;
116 
120  int getEdgeCount(void) const;
121 
125  int getFaceCount(void) const;
126 
130  virtual QString description(void) const;
134  virtual QString identifier(void) const;
135 
139  void insert_vertex(axlPoint* vertex, int index);
140 
144  void insert_edge(Edge* edge, int index);
145  void insert_edge(axlAbstractCurveParametric* crv, int si, int ei, int index);
146 
155  void sortEdges(Loop* loop);
156 
165  void sortLoops(Face* face);
166 
170  void insert_face(Face *face, int index);
171  void insert_face(axlAbstractSurfaceParametric*surf, int *l, int *orient,int *loopsSize, int sizel,int nbLoops, int index);
172  void insert_face(axlAbstractSurfaceParametric*surf, int *l, int *orient, int sizel,int sizeOrient, int index);
173  void insert_face_with_no_sort(axlAbstractSurfaceParametric*surf, int *l, int *orient, int sizel,int sizeOrient, int index);
174  void insert_face_with_no_sort(axlAbstractSurfaceParametric*surf, int *l, int *orient,int *loopsSize, int sizel,int nbLoops, int index);
175 
179  QVariantList convertDataToQVariant(void) const;
183  int convertQVariantToData(const QVariantList &data);
184 
185 public slots:
186 
187 private:
188  axlShapePrivate* d;
189 };
190 
192 // * To be registered to the data factory.
193 // */
194 //dtkAbstractData *createaxlShape(void);
195 
196 #endif // AXLSHAPE_H
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Edge(axlAbstractCurveParametric *crv, int si, int ei)
Constructor from a parametric curve pointer, the starting and ending indices;.
Definition: axlShape.h:54
axlAbstractCurveParametric * curve
Pointer to the parametric curve supporting the edge, of type axlAbstractCurveParametric.
Definition: axlShape.h:49
The edge structure.
Definition: axlShape.h:41
int indexStartVertex
Index of the starting point of the edge in the array of vertices of the axlShape. ...
Definition: axlShape.h:43
QVector< int > edges
Vector of indices of the edges of the loop in the array of edges of the axlShape. ...
Definition: axlShape.h:64
The Face structure.
Definition: axlShape.h:76
virtual int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
The Loop structure.
Definition: axlShape.h:62
Generic interface for parametric curve.
virtual QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
int indexEndVertex
Index of the ending point of the edge in the array of vertices of the axlShape.
Definition: axlShape.h:46
QVector< bool > orientations
Vector of booleans of the same size as edges: true means the direct orientation, false is the reverse...
Definition: axlShape.h:67
axlAbstractSurfaceParametric * surface
Pointer to the supporting surface of type axlAbstractSurfaceParametric.
Definition: axlShape.h:81
QVector< Loop * > loops
Vector of all the loops defining the face.
Definition: axlShape.h:78
#define AXLCORE_EXPORT
Class axlAbstractData defines an API for all type of axel data.