55 #ifndef POLYLINEPLUGIN_HH 56 #define POLYLINEPLUGIN_HH 58 #define CGAL_NO_AUTOLINK_MPFR 59 #define CGAL_NO_AUTOLINK_GMP 84 #include "PolyLineToolbarWidget.hh" 86 #include <ObjectTypes/Plane/QtPlaneSelect.hh> 88 #include <ACG/Scenegraph/GlutPrimitiveNode.hh> 90 #include <ObjectTypes/PolyLine/PolyLineCircleData.hh> 91 #include <ObjectTypes/PolyLine/PolyLineBezierSplineData.hh> 93 #define CREATE_CUT_POLYLINE "Create Polyline" 94 #define CREATE_CUT_POLYLINES "Create Polylines" 126 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-PolyLine")
132 void updatedObject(
int _identifier,
const UpdateType& _type);
133 void nodeVisibilityChanged(
int _id);
136 void addPickMode(
const std::string& _mode );
137 void addHiddenPickMode(
const std::string& _mode );
138 void setPickModeToolbar (
const std::string& _mode, QToolBar * _toolbar);
139 void setPickModeMouseTracking(
const std::string& _mode ,
bool _mouseTracking);
142 void log(
Logtype _type, QString _message);
143 void log(QString _message);
146 void addToolbar(QToolBar* _toolbar);
147 void getToolBar( QString _name, QToolBar*& _toolbar);
150 void scriptInfo( QString _functionName );
153 void addToolbox( QString _name , QWidget* _widget, QIcon* _icon);
155 void deleteObject(
int _id );
156 void addEmptyObject(
DataType _type,
int& _id);
158 void registerKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
bool _multiUse =
false);
159 void showStatusMessage(QString _message,
int _timeout = 0);
160 void clearStatusMessage();
167 void initializePlugin();
169 void slotEditModeChanged();
171 void slotMouseEvent( QMouseEvent* _event );
172 void slotKeyEvent(QKeyEvent* _event);
174 void slotPickModeChanged(
const std::string& _mode);
176 void pluginsInitialized();
178 bool pick_triangle_mesh( QPoint mPos,
181 void slotUpdateContextMenu(
int objectId);
184 void slotEnablePickMode(QString _name);
207 QString
name(){
return (QString(
"PolyLine")); };
210 QString
description() {
return (QString(
"Handling of PolyLines (Insertion/Deletion/Modeling/...")); };
214 #ifdef EXTENDED_POLY_LINE 215 void slot_resample_on_edges();
220 void slot_subdivide();
221 void slot_subdivide_percent(
bool _checked);
222 void slot_decimate();
223 void slot_decimate_percent(
bool _checked);
229 void slot_smooth_project();
232 void slot_smart_move_timer();
234 void slot_setCirclePointNum(
int i);
235 void slot_setSplinePointNum(
int i);
237 virtual void slotObjectUpdated(
int _identifier,
const UpdateType &_type );
239 void slot_duplicate();
240 void slot_instanciate();
247 void me_insert ( QMouseEvent* _event );
248 void me_insertCircle( QMouseEvent* _event );
249 void me_insertSpline( QMouseEvent* _event );
250 void me_delete ( QMouseEvent* _event );
251 void me_move ( QMouseEvent* _event );
252 void me_split ( QMouseEvent* _event );
253 void me_merge ( QMouseEvent* _event );
254 void me_smart_move ( QMouseEvent* _event );
321 template<
class MeshT > std::vector< ACG::Vec3d >
326 template<
class MeshT > std::vector< std::vector< ACG::Vec3d > >
330 template<
class MeshT >
331 typename MeshT::EdgeHandle
338 QString version() {
return QString(
"1.02"); };
364 PolyLine::Point* move_point_ref_;
365 PolyLine::Point* create_point_ref_;
366 PolyLine::Point move_point_orig_;
377 bool moveCircle_IsLocked;
378 bool moveCircle_IsFloating;
380 QAction* copyPaste_Action_;
381 int copyPaste_ObjectId_;
382 int copyPaste_ActionType_;
383 int copyPaste_NewObjectId_;
384 std::vector<ACG::Vec3d> copyPaste_RelativePoints_;
385 QPoint copyPaste_LastMouse;
393 void me_copyPasteMouse(QMouseEvent* _event);
444 void createCircle_createUI(
int _polyLineObjectID);
449 void createSpline_createUI(
int _polyLineObjectID);
503 QTimer* smart_move_timer_;
512 #if defined(INCLUDE_TEMPLATES) && !defined(POLYLINEPLUGIN_CC) 513 #define POLYLINEPLUGIN_TEMPLATES 514 #include "PolyLinePluginT_impl.hh" 517 #endif //MOVEPLUGIN_HH QtPlaneSelect * planeSelect_
Plane selection tool.
void slotSetPolyLineMode(QAction *_action)
Called by Toolbar to enable pick mode.
QAction * mergeAction_
Called by pick Toolbar.
PolyLinePlugin()
default constructor
ACG::Vec3d getPointOnMesh(PolyLineBezierSplineData *_SplineData, ACG::Vec3d _point, ACG::Vec3d *_nor=0)
Returns the nearest point on the mesh or if none could be found the input.
int moveBezSpline_SelIndex_
The object which is being moved.
QActionGroup * toolBarActions_
Called by Toolbar to enable pick mode.
void updatePolyEllipse(PolyLineObject *_lineObject, unsigned int _pointCount)
Generates points for the ellipse.
QToolBar * pickToolbar_
Called by pick Toolbar.
void updateHandles(PolyLineObject *_lineObject)
Updates the center, forward and side handle of the Poly ellipse.
Interface class for receiving mouse events.
bool createCircle_getHitInfo(PolyLineCircleData *_circleData, ACG::Vec3d _hit_Point, ACG::Vec3d *_pOut=0, double *_r=0, ACG::Vec3d *_onPlane=0)
Calculates common info.
void updatePolyBezierSpline(PolyLineObject *_lineObject, unsigned int _pointsPerSegment)
Generates points for the spline, updates handles.
QToolBar * toolbar_
Called by Toolbar to enable pick mode.
QAction * insertAction_
Called by pick Toolbar.
ACG::SceneGraph::GlutPrimitiveNode * moveBezSpline_SelNode_
The handle which is being dragged.
~PolyLinePlugin()
default destructor
Logtype
Log types for Message Window.
PolyLineToolbarWidget * tool_
Widget for Toolbox.
int createCircle_LastSelIndex_
Use this one to mark the last index to update the number of points.
ACG::Vec3d moveCircle_LastHitPos_
The last valid hit on the mesh.
QActionGroup * pickToolBarActions_
Called by pick Toolbar.
QAction * insertCircleAction_
Called by pick Toolbar.
Interface for all Plugins which do logging to the logging window of the framework.
int createCircle_CurrSelIndex_
The object which is being modified(created, dragged)
MeshT::EdgeHandle getCuttedEdge(MeshT &_mesh, ACG::Vec3d &_planeNormal, ACG::Vec3d &_planePoint)
get an edge of the mesh that is cut by the plane
EditMode
Edit Mode of PolyLinePlugin.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
int moveBezSpline_SelSubIndex_
The index of the control or handle being moved.
QAction * deleteAction_
Called by pick Toolbar.
void slotScissorButton()
Scissor Button was hit.
QAction * moveAction_
Called by pick Toolbar.
std::vector< std::vector< ACG::Vec3d > > getMultipleIntersectionPoints(MeshT *_mesh, ACG::Vec3d _planeNormal, ACG::Vec3d _planePoint)
get all points from the intersection between mesh and plane
void slotTriggerCutPlaneSelect()
Generate PolyLine after the cutPlane has been drawn.
QAction * polyLineAction_
Called by Toolbar to enable pick mode.
int generatePolyLineFromCut(int _objectId, Vector _planePoint, Vector _planeNormal, int _polyLineId=-1)
Generates a polyLine of a plane intersection.
QAction * splitAction_
Called by pick Toolbar.
std::vector< ACG::Vec3d > getIntersectionPoints(MeshT *_mesh, uint _fh, ACG::Vec3d _planeNormal, ACG::Vec3d _planePoint, bool &_closed)
get the points from the closest connected intersection between mesh and plane
QAction * smartMoveAction_
Called by pick Toolbar.
Type for a MeshObject containing a triangle mesh.
Control OpenFlippers status bar.
int createSpline_CurrSelIndex_
The index of the currently created spline.
void updatePolyBezierHandles(PolyLineObject *_lineObject, ACG::SceneGraph::LineNode *_line)
Updates all the handles on the PolyBezier.
ACG::Vec3d createCircle_getHit(PolyLineCircleData *_circleData, ACG::Vec3d _hit_point)
Returns point on mesh or point on the normal plane.
QString name()
Name of the Plugin.
Keyboard Event Interface.
QAction * cutMultipleAction_
Called by pick Toolbar.
void slotScissorLinesButton()
Scissor Button for multiple polylines was hit.
int createSpline_LastSelIndex_
Use this one to mark the last index to update the number of points.
QAction * cutAction_
Called by pick Toolbar.
bool createCircle_getPointOnMesh(TriMeshObject *_triMeshObject, ACG::Vec3d _center, ACG::Vec3d _pOnPlane, ACG::Vec3d _n, ACG::Vec3d *_pOut)
Calculates a point on the mesh.
QAction * insertSplineAction_
Called by pick Toolbar.
Interface for all Plugins which provide scriptable Functions.
void slotPickToolbarAction(QAction *_action)
Called by pick Toolbar.
ACG::SceneGraph::GlutPrimitiveNode * moveCircle_SelNode_
The handle which is being dragged.
IdList generatePolyLinesFromCut(int _objectId, Vector _planePoint, Vector _planeNormal)
Generates a polyLine of a plane intersection.
Interface class from which all plugins have to be created.
Allow access to picking functions.
Interface for all plugins which want to Load or Save files and create Objects.
QString description()
Description of the Plugin.