43 #ifndef PRIMITIVESGENERATORPLUGIN_HH 44 #define PRIMITIVESGENERATORPLUGIN_HH 57 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 71 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-PrimitiveGenerator")
77 void updatedObject(
int _id,
const UpdateType& _type);
78 void setSlotDescription(QString _slotName, QString _slotDescription,
79 QStringList _parameters, QStringList _descriptions);
81 void log(
Logtype _type, QString _message);
82 void log(QString _message);
85 void getMenubarMenu (QString _name, QMenu *& _menu,
bool _create);
88 void addEmptyObject(
DataType _type,
int& _id);
99 QString
name() {
return (QString(
"Primitives Generator")); } ;
100 QString
description() {
return (QString(
"Plugin used for generating basic primitives")); } ;
106 void pluginsInitialized();
113 QString version() {
return QString(
"1.0"); };
115 int addTriangulatedCylinder(
const Vector& _position =
Vector(0.0,0.0,0.0),
117 const double _radius = 1.0,
118 const double _height = 5.0,
119 const bool _top =
true,
120 const bool _bottom =
true);
122 int addSphere(
const Vector& _position =
Vector(0.0,0.0,0.0),
123 const double _radius = 1.0);
125 int addSubdivisionSphere(
const Vector& _position =
Vector(0.0,0.0,0.0),
126 const double _radius = 1.0);
128 int addTetrahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
129 const double _length = 2.0);
131 int addPyramid(
const Vector& _position =
Vector(0.0,0.0,0.0),
132 const double _length = 2.0);
134 int addCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
135 const double _length = 2.0);
137 int addTriangulatedCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
138 const double _length = 2.0);
140 int addIcosahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
141 const double _length = 2.0);
143 int addOctahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
144 const double _length = 2.0);
146 int addDodecahedron(
const Vector& _position =
Vector(0.0,0.0,0.0),
147 const double _length = 2.0);
149 #ifdef ENABLE_BSPLINECURVE_SUPPORT 150 int addRandomBSplineCurve(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
153 #ifdef ENABLE_BSPLINESURFACE_SUPPORT 154 int addRandomBSplineSurface(
const Vector& _position =
Vector(0, 0, 0),
int nDiv = 5);
157 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 158 int addTetrahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
159 const double _length = 2.0);
161 int addTetrahedralCuboid(
const Vector& _position =
Vector(0.0,0.0,0.0),
163 const unsigned int n_x = 5,
164 const unsigned int n_y = 5,
165 const unsigned int n_z = 10);
167 #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT 168 int addHexahedralCube(
const Vector& _position =
Vector(0.0,0.0,0.0),
169 const double _length = 2.0);
176 void constructOctahedron(
const Vector& _position,
const double _length);
178 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 179 int addPolyhedralMesh();
181 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3);
183 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3 ,
int _vh4);
185 inline void add_face(
int _vh1 ,
int _vh2,
int _vh3,
int _vh4 ,
int _vh5 );
187 inline ACG::Vec3d positionOnCylinder(
const int _sliceNumber,
188 const int _stackNumber,
191 const double _radius,
192 const double _height);
194 inline ACG::Vec3d positionOnSphere(
int _sliceNumber,
int _stackNumber,
const double _radius,
const Vector& _position);
195 inline ACG::Vec2f texCoordOnSphere(
int _sliceNumber,
int _stackNumber);
197 std::vector<TriMesh::VertexHandle> vhandles_;
198 std::vector<PolyMesh::VertexHandle> vphandles_;
206 QMenu* primitivesMenu_;
210 #endif //PRIMITIVESGENERATORPLUGIN_HH
Interface to call functions across plugins.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void initializePlugin()
BaseInterface.
Logtype
Log types for Message Window.
Interface for all plugins which want to Load or Save files and create Objects.
Interface for all Plugins which do logging to the logging window of the framework.
void noguiSupported()
Tell system that this plugin runs without ui.
QString name()
Return a name for the plugin.
Interface class from which all plugins have to be created.
Interface for all plugins which provide entries to the main menubar.
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
Interface class for backup handling.
QString description()
Return a description of what the plugin is doing.