Developer Documentation
|
#include <Plugin-PolyLine/PolyLinePlugin.hh>
Public Types | |
enum | EditMode { PL_NONE =0, PL_INSERT =1, PL_INSERTCIRCLE, PL_INSERTSPLINE, PL_DELETE, PL_MOVE, PL_SPLIT, PL_MERGE, PL_SMART_MOVE, PL_COPY_PASTE } |
Edit Mode of PolyLinePlugin. | |
Public Slots | |
void | slotEnablePickMode (QString _name) |
QString | version () |
void | createCircle_createUI (int _polyLineObjectID) |
void | createSpline_createUI (int _polyLineObjectID) |
Signals | |
void | updateView () |
void | updatedObject (int _identifier, const UpdateType &_type) |
void | nodeVisibilityChanged (int _id) |
void | addPickMode (const std::string &_mode) |
void | addHiddenPickMode (const std::string &_mode) |
void | setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar) |
void | setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking) |
void | log (Logtype _type, QString _message) |
void | log (QString _message) |
void | addToolbar (QToolBar *_toolbar) |
void | getToolBar (QString _name, QToolBar *&_toolbar) |
void | scriptInfo (QString _functionName) |
void | addToolbox (QString _name, QWidget *_widget, QIcon *_icon) |
void | deleteObject (int _id) |
void | addEmptyObject (DataType _type, int &_id) |
void | registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false) |
void | showStatusMessage (QString _message, int _timeout=0) |
void | clearStatusMessage () |
void | addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type) |
![]() | |
virtual void | updateView () |
Update current view in Main Application. More... | |
virtual void | setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions) |
Set a description for a public slot. More... | |
virtual void | setRenderer (unsigned int _viewer, QString _rendererName) |
Set a renderer for the given viewer. More... | |
![]() | |
virtual void | addPickMode (const std::string &_mode) |
Add a new picking mode to the examiner. More... | |
![]() | |
virtual void | addToolbox (QString _name, QWidget *_widget) |
Add a toolbox widget to the gui with the given name. More... | |
![]() | |
virtual void | log (Logtype _type, QString _message)=0 |
virtual void | log (QString _message)=0 |
![]() | |
virtual void | save (int _id, QString _filename) |
Save object to a file. More... | |
virtual void | load (QString _filename, DataType _type, int &_id) |
Load object from file with a specific DataType. More... | |
![]() | |
virtual void | addToolbar (QToolBar *_toolbar) |
Adds a Toolbar to the main widget. More... | |
![]() | |
virtual void | showStatusMessage (QString _message, int _timeout=0) |
Show a message in the status bar. More... | |
![]() | |
virtual void | registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false) |
Register a key-combination for your plugin. More... | |
![]() | |
virtual void | scriptInfo (QString _functionWithParameters) |
Emit this signal if a scriptable function is executed. More... | |
virtual void | getScriptingEngine (QScriptEngine *&_engine) |
virtual void | executeScript (QString _script) |
virtual void | getAvailableFunctions (QStringList &_functions) |
![]() | |
virtual void | addContextMenuItem (QAction *_action, ContextMenuType _type) |
Add an entry for a context Menu. More... | |
Public Member Functions | |
PolyLinePlugin () | |
default constructor | |
~PolyLinePlugin () | |
default destructor | |
QString | name () |
Name of the Plugin. | |
QString | description () |
Description of the Plugin. | |
int | generatePolyLineFromCut (int _objectId, Vector _planePoint, Vector _planeNormal, int _polyLineId=-1) |
Generates a polyLine of a plane intersection. More... | |
IdList | generatePolyLinesFromCut (int _objectId, Vector _planePoint, Vector _planeNormal) |
Generates a polyLine of a plane intersection. More... | |
Private Slots | |
void | initializePlugin () |
void | slotEditModeChanged () |
void | slotMouseEvent (QMouseEvent *_event) |
void | slotKeyEvent (QKeyEvent *_event) |
void | slotPickModeChanged (const std::string &_mode) |
void | pluginsInitialized () |
bool | pick_triangle_mesh (QPoint mPos, TriMeshObject *&_mesh_object_, TriMesh::FaceHandle &_fh, TriMesh::VertexHandle &_vh, ACG::Vec3d &_hitPoint) |
void | slotUpdateContextMenu (int objectId) |
void | slot_subdivide () |
void | slot_subdivide_percent (bool _checked) |
void | slot_decimate () |
void | slot_decimate_percent (bool _checked) |
void | slot_smooth () |
void | slot_smooth (PolyLineObject *&_pol) |
void | slot_project () |
void | slot_project (PolyLineObject *&_pol) |
void | slot_smooth_project () |
void | slot_smooth_project (PolyLineObject *&_pol) |
void | slot_smart_move_timer () |
void | slot_setCirclePointNum (int i) |
void | slot_setSplinePointNum (int i) |
virtual void | slotObjectUpdated (int _identifier, const UpdateType &_type) |
void | slot_duplicate () |
void | slot_instanciate () |
void | finishSpline () |
void | slotScissorButton () |
Scissor Button was hit. More... | |
void | slotScissorLinesButton () |
Scissor Button for multiple polylines was hit. More... | |
void | slotTriggerCutPlaneSelect () |
Generate PolyLine after the cutPlane has been drawn. More... | |
Private Member Functions | |
EditMode | mode () |
void | me_insert (QMouseEvent *_event) |
void | me_insertCircle (QMouseEvent *_event) |
void | me_insertSpline (QMouseEvent *_event) |
void | me_delete (QMouseEvent *_event) |
void | me_move (QMouseEvent *_event) |
void | me_split (QMouseEvent *_event) |
void | me_merge (QMouseEvent *_event) |
void | me_smart_move (QMouseEvent *_event) |
void | me_copyPasteMouse (QMouseEvent *_event) |
bool | createCircle_getPointOnMesh (TriMeshObject *_triMeshObject, ACG::Vec3d _center, ACG::Vec3d _pOnPlane, ACG::Vec3d _n, ACG::Vec3d *_pOut) |
Calculates a point on the mesh. More... | |
bool | createCircle_getHitInfo (PolyLineCircleData *_circleData, ACG::Vec3d _hit_Point, ACG::Vec3d *_pOut=0, double *_r=0, ACG::Vec3d *_onPlane=0) |
Calculates common info. More... | |
ACG::Vec3d | createCircle_getHit (PolyLineCircleData *_circleData, ACG::Vec3d _hit_point) |
Returns point on mesh or point on the normal plane. More... | |
void | updatePolyEllipse (PolyLineObject *_lineObject, unsigned int _pointCount) |
Generates points for the ellipse. More... | |
void | updateHandles (PolyLineObject *_lineObject) |
Updates the center, forward and side handle of the Poly ellipse. More... | |
void | updatePolyBezierSpline (PolyLineObject *_lineObject, unsigned int _pointsPerSegment) |
Generates points for the spline, updates handles. More... | |
void | updatePolyBezierHandles (PolyLineObject *_lineObject, ACG::SceneGraph::LineNode *_line) |
Updates all the handles on the PolyBezier. More... | |
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. More... | |
Template Functions | |
template<class MeshT > | |
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 More... | |
template<class MeshT > | |
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 More... | |
template<class MeshT > | |
MeshT::EdgeHandle | getCuttedEdge (MeshT &_mesh, ACG::Vec3d &_planeNormal, ACG::Vec3d &_planePoint) |
get an edge of the mesh that is cut by the plane More... | |
![]() | |
virtual void | noguiSupported () |
virtual | ~BaseInterface () |
Destructor. | |
virtual void | blockScenegraphUpdates (bool _block) |
Tell the core to prevent scenegraph updates. More... | |
virtual void | updatedObject (int _objectId) |
An object has been changed or added by this plugin. More... | |
virtual void | updatedObject (int _identifier, const UpdateType &_type) |
An object has been changed or added by this plugin. More... | |
virtual void | nodeVisibilityChanged (int _identifier) |
A scenegraph node has been shown or hidden. More... | |
virtual void | getCurrentRenderer (unsigned int _viewer, QString &_rendererName) |
Get the current renderer for the given viewer. More... | |
![]() | |
virtual | ~MouseInterface () |
Destructor. | |
![]() | |
virtual void | addHiddenPickMode (const std::string &_mode) |
Add a new picking mode to the examiner which will be invisible. More... | |
virtual void | setPickModeCursor (const std::string &_mode, QCursor _cursor) |
Set the cursor of the given PickMode. More... | |
virtual void | setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking) |
Set mouse tracking for the given PickMode. More... | |
virtual void | setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar) |
Set the additional toolbar of the given PickMode. More... | |
virtual void | removePickModeToolbar (const std::string &_mode) |
Removes the additional toolbar of the given PickMode. More... | |
virtual | ~PickingInterface () |
Destructor. | |
![]() | |
virtual | ~ToolboxInterface () |
Destructor. | |
virtual void | addToolbox (QString _name, QWidget *_widget, QIcon *_icon) |
Add a toolbox widget to the gui with the given name and an icon. More... | |
virtual void | addToolbox (QString _name, QWidget *_widget, QIcon *_icon, QWidget *_headerAreaWidget) |
Add a toolbox widget to the gui with the given name, icon and header area widget. More... | |
![]() | |
virtual | ~LoggingInterface () |
Destructor. | |
![]() | |
virtual | ~LoadSaveInterface () |
Destructor. | |
virtual void | addEmptyObject (DataType _type, int &_id) |
virtual void | copyObject (int _oldId, int &_newId) |
virtual void | emptyObjectAdded (int _id) |
DEPRECATED HERE (Moved to Type Interface)! Emit this signal if an empty object has been created. More... | |
virtual void | deleteObject (int _id) |
Delete an object This signal can be called from any thread. . More... | |
virtual void | deleteAllObjects () |
Delete all Objects. More... | |
virtual void | getAllFileFilters (QStringList &_filters) |
Get all file filters that are registered. More... | |
![]() | |
virtual | ~ToolbarInterface () |
Destructor. | |
virtual void | removeToolbar (QToolBar *_toolbar) |
Remove a Toolbar from the main widget. More... | |
virtual void | getToolBar (QString _name, QToolBar *&_toolbar) |
Get a pointer to a Toolbar of the given name or 0 if it does not exist. More... | |
![]() | |
virtual | ~StatusbarInterface () |
Destructor. | |
void | setStatus (ApplicationStatus::applicationStatus _status) |
Sets the status icon of the StatusBar. More... | |
void | clearStatusMessage () |
Removes the current message from the statusBar. More... | |
void | addWidgetToStatusbar (QWidget *_widget) |
Add a widget on the right side of the statusBar. More... | |
![]() | |
virtual void | slotKeyReleaseEvent (QKeyEvent *_event) |
Key Release Event from Main App. More... | |
virtual | ~KeyInterface () |
Destructor. | |
![]() | |
virtual | ~ScriptInterface () |
Destructor. | |
virtual void | executeFileScript (QString _filename) |
virtual void | getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions) |
![]() | |
virtual | ~ContextMenuInterface () |
Destructor. | |
virtual void | addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type) |
Add an entry for a context Menu. More... | |
virtual void | hideContextMenu () |
hide the main context menu | |
Private Attributes | |
int | cur_insert_id_ |
PolyLineObject * | cur_polyline_obj_ |
int | cur_move_id_ |
PolyLine::Point * | move_point_ref_ |
PolyLine::Point * | create_point_ref_ |
PolyLine::Point | move_point_orig_ |
int | createCircle_CurrSelIndex_ |
The object which is being modified(created, dragged) | |
int | createCircle_LastSelIndex_ |
Use this one to mark the last index to update the number of points. | |
ACG::SceneGraph::GlutPrimitiveNode * | moveCircle_SelNode_ |
The handle which is being dragged. | |
ACG::Vec3d | moveCircle_LastHitPos_ |
The last valid hit on the mesh. | |
ACG::Vec3d | moveCircle_LastHitNor_ |
bool | moveCircle_IsLocked |
bool | moveCircle_IsFloating |
QAction * | copyPaste_Action_ |
int | copyPaste_ObjectId_ |
int | copyPaste_ActionType_ |
int | copyPaste_NewObjectId_ |
std::vector< ACG::Vec3d > | copyPaste_RelativePoints_ |
QPoint | copyPaste_LastMouse |
int | createSpline_CurrSelIndex_ |
The index of the currently created spline. | |
int | createSpline_LastSelIndex_ |
Use this one to mark the last index to update the number of points. | |
ACG::SceneGraph::GlutPrimitiveNode * | moveBezSpline_SelNode_ |
The handle which is being dragged. | |
int | moveBezSpline_SelIndex_ |
The object which is being moved. | |
int | moveBezSpline_SelSubIndex_ |
The index of the control or handle being moved. | |
int | cur_merge_id_ |
QTimer * | smart_move_timer_ |
PolyLineObject * | cur_smart_move_obj_ |
QtPlaneSelect * | planeSelect_ |
Plane selection tool. | |
ToolBox | |
PolyLineToolbarWidget * | tool_ |
Widget for Toolbox. | |
ToolBar | |
QAction * | polyLineAction_ |
Called by Toolbar to enable pick mode. | |
QActionGroup * | toolBarActions_ |
Called by Toolbar to enable pick mode. | |
QToolBar * | toolbar_ |
Called by Toolbar to enable pick mode. | |
void | slotSetPolyLineMode (QAction *_action) |
Called by Toolbar to enable pick mode. | |
PickToolBar | |
QToolBar * | pickToolbar_ |
Called by pick Toolbar. | |
QActionGroup * | pickToolBarActions_ |
Called by pick Toolbar. | |
QAction * | insertAction_ |
Called by pick Toolbar. | |
QAction * | insertCircleAction_ |
Called by pick Toolbar. | |
QAction * | insertSplineAction_ |
Called by pick Toolbar. | |
QAction * | deleteAction_ |
Called by pick Toolbar. | |
QAction * | moveAction_ |
Called by pick Toolbar. | |
QAction * | smartMoveAction_ |
Called by pick Toolbar. | |
QAction * | mergeAction_ |
Called by pick Toolbar. | |
QAction * | splitAction_ |
Called by pick Toolbar. | |
QAction * | cutAction_ |
Called by pick Toolbar. | |
QAction * | cutMultipleAction_ |
Called by pick Toolbar. | |
void | slotPickToolbarAction (QAction *_action) |
Called by pick Toolbar. | |
Plugin for PolyLine Support
Definition at line 101 of file PolyLinePlugin.hh.
|
private |
Returns point on mesh or point on the normal plane.
Helper function which returns the point on the mesh or if none could be found the point on the plane
_circleData | The circle to use. |
_hit_point | The point to "project". |
Definition at line 127 of file PolyLinePlugin_Circle.cc.
|
private |
Calculates common info.
Calculates common info like point on the mesh, point on the normal plane and the distance from the circle center
_circleData | The circle to use. |
_hit_Point | The point which to "project". |
_pOut | (optional)Point on the mesh. |
_r | The distance between circle center and point on the plane. |
_onPlane | Point on the normal plane regarding the hit_point. |
Definition at line 109 of file PolyLinePlugin_Circle.cc.
|
private |
Calculates a point on the mesh.
Finds the nearest point on the mesh given a point on the normal plane
_triMeshObject | The mesh to use |
_center | The center of the ellipse |
_pOnPlane | The projection of the hit point on the plane |
_n | The normal of the ellipse |
_pOut | The point on the mesh if one could be found. |
Definition at line 82 of file PolyLinePlugin_Circle.cc.
int PolyLinePlugin::generatePolyLineFromCut | ( | int | _objectId, |
Vector | _planePoint, | ||
Vector | _planeNormal, | ||
int | _polyLineId = -1 |
||
) |
Generates a polyLine of a plane intersection.
_objectId | id of the target object |
_planePoint | a point on the cut plane |
_planeNormal | the normal of the cut plane |
_polyLineId | Specify this if you don't want a new polyline to be generated but to reuse an existing one |
Definition at line 55 of file PolyLineScripting.cc.
IdList PolyLinePlugin::generatePolyLinesFromCut | ( | int | _objectId, |
Vector | _planePoint, | ||
Vector | _planeNormal | ||
) |
Generates a polyLine of a plane intersection.
Generates polyLines from a plane intersection.
_objectId | id of the target object |
_planePoint | a point on the cut plane |
_planeNormal | the normal of the cut plane |
Definition at line 163 of file PolyLineScripting.cc.
|
private |
get an edge of the mesh that is cut by the plane
_mesh | the mesh |
_planeNormal | normal of the cut plane |
_planePoint | point on the cut plane |
Definition at line 234 of file PolyLinePluginT.cc.
|
private |
get the points from the closest connected intersection between mesh and plane
_mesh | the mesh |
_fh | a starting face that is intersected |
_planeNormal | normal of the cut plane |
_planePoint | point on the cut plane |
_closed | TODO find out what it's good for |
Definition at line 204 of file PolyLinePluginT.cc.
|
private |
get all points from the intersection between mesh and plane
_mesh | the mesh |
_planeNormal | normal of the cut plane |
_planePoint | point on the cut plane |
Definition at line 287 of file PolyLinePluginT.cc.
|
private |
Returns the nearest point on the mesh or if none could be found the input.
_SplineData | The spline which is being used. |
_point | The input point. |
_nor | (Optional)Normal at nearest point. |
Definition at line 63 of file PolyLinePlugin_BezierSpline.cc.
|
privateslot |
Scissor Button was hit.
Definition at line 456 of file PolyLinePlugin.cc.
|
privateslot |
Scissor Button for multiple polylines was hit.
Scissor Button was hit.
Definition at line 467 of file PolyLinePlugin.cc.
|
privateslot |
Generate PolyLine after the cutPlane has been drawn.
Definition at line 478 of file PolyLinePlugin.cc.
|
private |
Updates the center, forward and side handle of the Poly ellipse.
_lineObject | The object containing the handles. |
Definition at line 2047 of file PolyLinePlugin.cc.
|
private |
Updates all the handles on the PolyBezier.
_lineObject | The object to update. |
_line | the line node containing all the handles |
Definition at line 82 of file PolyLinePlugin_BezierSpline.cc.
|
private |
Generates points for the spline, updates handles.
_lineObject | The object to generate points for. |
_pointsPerSegment | The number of points per segment. |
Definition at line 105 of file PolyLinePlugin_BezierSpline.cc.
|
private |
Generates points for the ellipse.
_lineObject | The object to generate points for. |
_pointCount | The number of points to generate. |
Definition at line 138 of file PolyLinePlugin_Circle.cc.