Developer Documentation
PlanePlugin Class Reference
Inheritance diagram for PlanePlugin:
LoadSaveInterface ScriptInterface ToolbarInterface LoggingInterface PickingInterface KeyInterface MouseInterface BaseInterface

Public Slots

Scripting Functions
QString version ()
 

Signals

void updateView ()
 
void updatedObject (int, UpdateType)
 
void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 
void addEmptyObject (DataType _type, int &_id)
 
void copyObject (int _oldId, int &_newId)
 
void deleteObject (int _id)
 
void addToolbar (QToolBar *_toolbar)
 
void getToolBar (QString _name, QToolBar *&_toolbar)
 
void defineViewMode (QString _mode, QStringList _usedWidgets)
 
void registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false)
 
void addPickMode (const std::string _mode)
 
void scriptInfo (QString _functionName)
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
- Signals inherited from BaseInterface
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...
 
- Signals inherited from KeyInterface
virtual void registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false)
 Register a key-combination for your plugin. More...
 
- Signals inherited from PickingInterface
virtual void addPickMode (const std::string &_mode)
 Add a new picking mode to the examiner. More...
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget. More...
 
- Signals inherited from ScriptInterface
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)
 
- Signals inherited from LoadSaveInterface
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...
 

Public Member Functions

 PlanePlugin ()
 Constructor. More...
 
void exit ()
 
QString name ()
 Return a name for the plugin. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 
Template Functions
template<class MeshT >
std::vector< ACG::Vec3dgetIntersectionPoints (MeshT *_mesh, uint _fh, ACG::Vec3d _planeNormal, ACG::Vec3d _planePoint, bool &_closed)
 get the 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...
 

Private Slots

void initializePlugin ()
 Initialize the plugin. More...
 
void pluginsInitialized ()
 Second initialization phase. More...
 
void slotPickModeChanged (const std::string &_mode)
 the pickMode changed More...
 
void slotMouseEvent (QMouseEvent *_event)
 a mouse event occured More...
 
void slotKeyReleaseEvent (QKeyEvent *_event)
 a keyRelease event occured More...
 
bool getIntersectionParams (BaseObjectData &_obj, ACG::Vec3d &_center, double &_radius)
 
- Private Slots inherited from BaseInterface
virtual QString version ()
 Return a version string for your plugin. More...
 
- Private Slots inherited from KeyInterface
virtual void slotKeyEvent (QKeyEvent *_event)
 Key Event from Main App. More...
 

Private Member Functions

void setDescriptions ()
 set scripting slot descriptions
 
- Private Member Functions inherited from BaseInterface
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...
 
- Private Member Functions inherited from MouseInterface
virtual ~MouseInterface ()
 Destructor.
 
- Private Member Functions inherited from KeyInterface
virtual void slotKeyReleaseEvent (QKeyEvent *_event)
 Key Release Event from Main App. More...
 
virtual ~KeyInterface ()
 Destructor.
 
- Private Member Functions inherited from PickingInterface
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.
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- Private Member Functions inherited from ToolbarInterface
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...
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void executeFileScript (QString _filename)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Private Member Functions inherited from LoadSaveInterface
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...
 

GUI Related

QtPlaneSelectcreatePlane_
 additional information
 
QAction * planeNodeAction_
 additional information
 
bool dragging_
 additional information
 
int pickedCorner_
 additional information
 
ACG::Vec3d wMouseDownPosition_ {.0}
 additional information
 
ACG::Vec3d wCurrMousePos_ {.0}
 additional information
 
ACG::Vec3d viewDirection_ {.0}
 additional information
 
PlaneObjectcurPlane_ = nullptr
 additional information
 
Plane origPlane_
 additional information
 
int lastObjId_ = -1
 additional information
 
void slotCreatePlaneNode ()
 Plane Node Button. More...
 
void slotCreatePlaneTriggered ()
 Create a plane node when position/normal have been drawn.
 

Detailed Description

Definition at line 60 of file PlanePlugin.hh.

Constructor & Destructor Documentation

◆ PlanePlugin()

PlanePlugin::PlanePlugin ( )

Constructor.

Definition at line 59 of file PlanePlugin.cc.

Member Function Documentation

◆ description()

QString PlanePlugin::description ( )
inlinevirtual

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implements BaseInterface.

Definition at line 139 of file PlanePlugin.hh.

◆ exit()

void PlanePlugin::exit ( )
inlinevirtual

This function is called when the application exits or when your plugin is about to be unloaded. Here you can clean up your plugin, delete local variables...

Reimplemented from BaseInterface.

Definition at line 136 of file PlanePlugin.hh.

◆ getCuttedEdge()

template<class MeshT >
MeshT::EdgeHandle PlanePlugin::getCuttedEdge ( MeshT &  _mesh,
ACG::Vec3d _planeNormal,
ACG::Vec3d _planePoint 
)

get an edge of the mesh that is cut by the plane

Parameters
_meshthe mesh
_planeNormalnormal of the cut plane
_planePointpoint on the cut plane
Returns
the edge that is intersected and closest to _planePoint

Definition at line 192 of file PlanePluginT_impl.hh.

◆ getIntersectionPoints()

template<class MeshT >
std::vector< ACG::Vec3d > PlanePlugin::getIntersectionPoints ( MeshT *  _mesh,
uint  _fh,
ACG::Vec3d  _planeNormal,
ACG::Vec3d  _planePoint,
bool &  _closed 
)

get the points from the intersection between mesh and plane

Parameters
_meshthe mesh
_fha starting face that is intersected
_planeNormalnormal of the cut plane
_planePointpoint on the cut plane
_closedTODO find out what its good for
Returns
a list of intersection points

Definition at line 67 of file PlanePluginT_impl.hh.

◆ initializePlugin

void PlanePlugin::initializePlugin ( )
privateslot

Initialize the plugin.

Definition at line 73 of file PlanePlugin.cc.

◆ name()

QString PlanePlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 138 of file PlanePlugin.hh.

◆ pluginsInitialized

void PlanePlugin::pluginsInitialized ( )
privateslot

Second initialization phase.

Definition at line 83 of file PlanePlugin.cc.

◆ slotCreatePlaneNode

void PlanePlugin::slotCreatePlaneNode ( )
privateslot

Plane Node Button.

Definition at line 367 of file PlanePlugin.cc.

◆ slotKeyReleaseEvent

void PlanePlugin::slotKeyReleaseEvent ( QKeyEvent *  _event)
privateslot

a keyRelease event occured

Parameters
_eventthe event that occured

Definition at line 132 of file PlanePlugin.cc.

◆ slotMouseEvent

void PlanePlugin::slotMouseEvent ( QMouseEvent *  _event)
privateslot

a mouse event occured

Parameters
_eventthe event that occured

only works in constrained cases

modification of triangleIntersection

we don't really care about legal barycentric coordinates, however if you really want to know if you are inside the defining triangle, there you go

obtain the ray for intersecting with the quad/plane

compute intersection

matrix to transform points from image plane to curPlane_

get the world position of the projected cursor by intersecting plane equation with ray

view coords in worldspace, with flipped y-axis

we can assume that most of the time, there wont be an intersection. but as we only check one half of the triangle, the other will always be outside

we dont really care about the result here

relative to plane

relative to plane

update vector in worldspace

We are actually dragging a corner

scale by half updates length

we dont do anything in z-dir

we are just dragging the plane along (also happens when scaling, dont worry)

overwrite plane

signal for updates

Definition at line 145 of file PlanePlugin.cc.

◆ slotPickModeChanged

void PlanePlugin::slotPickModeChanged ( const std::string &  _mode)
privateslot

the pickMode changed

Parameters
_modethe new pickMode

Definition at line 120 of file PlanePlugin.cc.


The documentation for this class was generated from the following files: