50 #ifndef PRIMITIVESGENERATORPLUGIN_HH
51 #define PRIMITIVESGENERATORPLUGIN_HH
64 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
78 #if QT_VERSION >= 0x050000
79 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-PrimitiveGenerator")
86 void updatedObject(
int _id,
const UpdateType& _type);
87 void setSlotDescription(QString _slotName, QString _slotDescription,
88 QStringList _parameters, QStringList _descriptions);
90 void log(
Logtype _type, QString _message);
91 void log(QString _message);
94 void getMenubarMenu (QString _name, QMenu *& _menu,
bool _create);
97 void addEmptyObject(
DataType _type,
int& _id);
108 QString
name() {
return (QString(
"Primitives Generator")); } ;
109 QString
description() {
return (QString(
"Plugin used for generating basic primitives")); } ;
115 void pluginsInitialized();
122 QString version() {
return QString(
"1.0"); };
124 int addTriangulatedCylinder(
const Vector& _position =
Vector(0.0,0.0,0.0),
126 const double _radius = 1.0,
127 const double _height = 5.0,
128 const bool _top =
true,
129 const bool _bottom =
true);
131 int addSphere(
const Vector& _position =
Vector(0.0,0.0,0.0),
132 const double _radius = 1.0);
134 int addSubdivisionSphere(
const Vector& _position =
Vector(0.0,0.0,0.0),
135 const double _radius = 1.0);
137 int addTetrahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
138 const double _length = 2.0);
140 int addPyramid(
const Vector& _position =
Vector(0.0,0.0,0.0),
141 const double _length = 2.0);
143 int addTriangulatedCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
144 const double _length = 2.0);
146 int addIcosahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
147 const double _length = 2.0);
149 int addOctahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
150 const double _length = 2.0);
152 int addDodecahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
153 const double _length = 2.0);
155 #ifdef ENABLE_BSPLINECURVE_SUPPORT
156 int addRandomBSplineCurve(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
159 #ifdef ENABLE_BSPLINESURFACE_SUPPORT
160 int addRandomBSplineSurface(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
163 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
164 int addTetrahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
165 const double _length = 2.0);
167 int addTetrahedralCuboid(
const Vector& _position =
Vector(0.0,0.0,0.0),
169 const unsigned int n_x = 5,
170 const unsigned int n_y = 5,
171 const unsigned int n_z = 10);
178 void constructOctahedron(
const Vector& _position,
const double _length);
180 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
181 int addPolyhedralMesh();
184 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3 );
186 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3,
int _vh4 ,
int _vh5 );
188 inline ACG::Vec3d positionOnCylinder(
const int _sliceNumber,
189 const int _stackNumber,
192 const double _radius,
193 const double _height);
195 inline ACG::Vec3d positionOnSphere(
int _sliceNumber,
int _stackNumber,
const double _radius,
const Vector& _position);
196 inline ACG::Vec2f texCoordOnSphere(
int _sliceNumber,
int _stackNumber);
198 std::vector<TriMesh::VertexHandle> vhandles_;
199 std::vector<PolyMesh::VertexHandle> vphandles_;
207 QMenu* primitivesMenu_;
211 #endif //PRIMITIVESGENERATORPLUGIN_HH
Interface class from which all plugins have to be created.
void noguiSupported()
Tell system that this plugin runs without ui.
QString name()
Return a name for the plugin.
Logtype
Log types for Message Window.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
Interface for all Plugins which do logging to the logging window of the framework.
Interface to call functions across plugins.
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
Interface for all plugins which want to Load or Save files and create Objects.
QString description()
Return a description of what the plugin is doing.
Interface class for backup handling.
void initializePlugin()
BaseInterface.
Interface for all plugins which provide entries to the main menubar.