73 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-PrimitiveGenerator")
79 void updatedObject(
int _id,
const UpdateType& _type);
80 void setSlotDescription(QString _slotName, QString _slotDescription,
81 QStringList _parameters, QStringList _descriptions);
83 void log(
Logtype _type, QString _message);
84 void log(QString _message);
87 void getMenubarMenu (QString _name, QMenu *& _menu,
bool _create);
90 void addEmptyObject(
DataType _type,
int& _id);
101 QString
name() {
return (QString(
"PrimitivesGenerator")); } ;
102 QString
description() {
return (QString(
"Plugin used for generating basic primitives")); } ;
108 void pluginsInitialized();
115 QString version() {
return QString(
"1.0"); };
117 int addTriangulatedCylinder(
const Vector& _position =
Vector(0.0,0.0,0.0),
119 const double _radius = 1.0,
120 const double _height = 5.0,
121 const bool _top =
true,
122 const bool _bottom =
true);
124 int addSphere(
const Vector& _position =
Vector(0.0,0.0,0.0),
125 const double _radius = 1.0);
127 int addSubdivisionSphere(
const Vector& _position =
Vector(0.0,0.0,0.0),
128 const double _radius = 1.0);
130 int addTetrahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
131 const double _length = 2.0);
133 int addPyramid(
const Vector& _position =
Vector(0.0,0.0,0.0),
134 const double _length = 2.0);
136 int addCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
137 const double _length = 2.0);
139 int addTriangulatedPlaneFlat(
const Vector& _position =
Vector(0.0,0.0,0.0),
140 const double _sizeX = 2.0,
const double _sizeY = 2.0,
141 const int _segmentsX = 10,
const int _segmentsY = 10 );
143 int addTriangulatedPlaneBumpy(
const Vector& _position =
Vector(0.0,0.0,0.0),
144 const double _sizeX = 10.0,
const double _sizeY = 10.0,
145 const int _segmentsX = 200,
const int _segmentsY = 200 );
147 int addTriangulatedPlanesNonManifold(
const Vector& _position =
Vector(0.0,0.0,0.0),
148 const double _sizeX = 2.0,
const double _sizeY = 2.0,
const double _sizeZ = 1.0,
149 const int _segmentsX = 50,
const int _segmentsY = 50 ,
const int _segmentsZ = 50);
151 int addTriangulatedCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
152 const double _length = 2.0);
154 int addIcosahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
155 const double _length = 2.0);
157 int addOctahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
158 const double _length = 2.0);
160 int addDodecahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
161 const double _length = 2.0);
163#ifdef ENABLE_BSPLINECURVE_SUPPORT
164 int addRandomBSplineCurve(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
167#ifdef ENABLE_BSPLINESURFACE_SUPPORT
168 int addRandomBSplineSurface(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
171#ifdef ENABLE_POLYHEDRALMESH_SUPPORT
172 int addTetrahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
173 const double _length = 2.0);
175 int addTetrahedralCuboid(
const Vector& _position =
Vector(0.0,0.0,0.0),
177 const unsigned int n_x = 5,
178 const unsigned int n_y = 5,
179 const unsigned int n_z = 10);
181#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT
182 int addHexahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
183 const double _length = 2.0);
190 void constructOctahedron(
const Vector& _position,
const double _length);
192#ifdef ENABLE_POLYHEDRALMESH_SUPPORT
193 int addPolyhedralMesh();
195 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3);
197 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3 ,
int _vh4);
199 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3,
int _vh4 ,
int _vh5 );
201 inline ACG::Vec3d positionOnCylinder(
const int _sliceNumber,
202 const int _stackNumber,
205 const double _radius,
206 const double _height);
208 inline ACG::Vec3d positionOnSphere(
int _sliceNumber,
int _stackNumber,
const double _radius,
const Vector& _position);
209 inline ACG::Vec2f texCoordOnSphere(
int _sliceNumber,
int _stackNumber);
211 std::vector<TriMesh::VertexHandle> vhandles_;
212 std::vector<PolyMesh::VertexHandle> vphandles_;
220 QMenu* primitivesMenu_;