43 #ifndef PRIMITIVESGENERATORPLUGIN_HH 44 #define PRIMITIVESGENERATORPLUGIN_HH 58 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 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 addTriangulatedCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
140 const double _length = 2.0);
142 int addIcosahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
143 const double _length = 2.0);
145 int addOctahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
146 const double _length = 2.0);
148 int addDodecahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
149 const double _length = 2.0);
151 #ifdef ENABLE_BSPLINECURVE_SUPPORT 152 int addRandomBSplineCurve(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
155 #ifdef ENABLE_BSPLINESURFACE_SUPPORT 156 int addRandomBSplineSurface(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
159 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 160 int addTetrahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
161 const double _length = 2.0);
163 int addTetrahedralCuboid(
const Vector& _position =
Vector(0.0,0.0,0.0),
165 const unsigned int n_x = 5,
166 const unsigned int n_y = 5,
167 const unsigned int n_z = 10);
169 #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT 170 int addHexahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
171 const double _length = 2.0);
178 void constructOctahedron(
const Vector& _position,
const double _length);
180 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 181 int addPolyhedralMesh();
183 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3);
185 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3 ,
int _vh4);
187 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3,
int _vh4 ,
int _vh5 );
189 inline ACG::Vec3d positionOnCylinder(
const int _sliceNumber,
190 const int _stackNumber,
193 const double _radius,
194 const double _height);
196 inline ACG::Vec3d positionOnSphere(
int _sliceNumber,
int _stackNumber,
const double _radius,
const Vector& _position);
197 inline ACG::Vec2f texCoordOnSphere(
int _sliceNumber,
int _stackNumber);
199 std::vector<TriMesh::VertexHandle> vhandles_;
200 std::vector<PolyMesh::VertexHandle> vphandles_;
208 QMenu* primitivesMenu_;
212 #endif //PRIMITIVESGENERATORPLUGIN_HH void initializePlugin()
BaseInterface.
Interface class for exporting functions to python.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
QString name()
Return a name for the plugin.
Logtype
Log types for Message Window.
Interface for all Plugins which do logging to the logging window of the framework.
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
Interface to call functions across plugins.
QString description()
Return a description of what the plugin is doing.
void noguiSupported()
Tell system that this plugin runs without ui.
Interface class from which all plugins have to be created.
Interface class for backup handling.
Interface for all plugins which want to Load or Save files and create Objects.