42#ifndef VOLUMEMESHSELECTIONPLUGIN_HH
43#define VOLUMEMESHSELECTIONPLUGIN_HH
54#include <OpenFlipper/BasePlugin/INIInterface.hh>
59#include <OpenFlipper/INIFile/INIFile.hh>
63#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT
81 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-SelectionVolumeMesh")
101 void updateView()
override;
102 void updatedObject(
int,
const UpdateType&)
override;
103 void nodeVisibilityChanged(
int _identifier)
override;
104 void setSlotDescription(QString _slotName, QString _slotDescription,
105 QStringList _parameters, QStringList _descriptions)
override;
108 void log(
Logtype _type, QString _message)
override;
109 void log(QString _message)
override;
112 void scriptInfo(QString _functionName);
115 void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName)
override;
116 void registerType(QString _handleName,
DataType _type)
override;
117 void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle)
override;
118 void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u)
override;
119 void addSelectionParameters(QString _handleName, QWidget* _widget, QString _category, SelectionInterface::PrimitiveType _type = 0u)
override;
121 void showToggleSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes)
override;
123 void showVolumeLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes)
override;
124 void showFloodFillSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes)
override;
125 void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
126 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier)
override;
128 void getActiveDataTypes(SelectionInterface::TypeList& _types)
override;
129 void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type)
override;
130 void targetObjectsOnly(
bool& _targetsOnly)
override;
132 void registerKeyShortcut(
int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier)
override;
137 void loadIniFile(
INIFile& _ini,
int _id)
override;
138 void saveIniFile(
INIFile& _ini,
int _id)
override;
141 void initializePlugin()
override;
142 void pluginsInitialized()
override;
143 void noguiSupported()
override {};
147 void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType,
bool _deselect)
override;
149 void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType,
bool _deselect)
override;
150 void slotFloodFillSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType,
bool _deselect)
override;
151 void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier,
bool _deselect)
override;
161 void loadSelection(
int _objId,
const QString& _filename)
override;
167 return (QString(tr(
"VolumeMesh Selection")));
171 return (QString(tr(
"Allows to select VolumeMeshes")));
187 QString version()
override {
188 return QString(
"1.0");
331 template<
class MeshT>
333 PrimitiveType _primitiveTypes,
bool _deselection);
336 template<
class MeshT>
338 PrimitiveType _primitiveTypes,
bool _deselection);
345 typedef std::pair<OpenVolumeMesh::HalfFaceHandle,OpenVolumeMesh::HalfFaceHandle>
HFPair;
389 unsigned int _type,
bool _deselection,
ACG::GLState& _state)
394 , deselection_(_deselection)
411#if defined(INCLUDE_TEMPLATES) && !defined(VOLUMEMESHSELECTIONPLUGINT_CC)
412#define VOLUMEMESHSELECTIONPLUGINT_TEMPLATES
413#include "VolumeMeshSelectionPluginT_impl.hh"
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Logtype
Log types for Message Window.
Interface class for backup handling.
Interface class from which all plugins have to be created.
Class for the handling of simple configuration files.
Interface class for Plugins which have to store information in ini files.
Keyboard Event Interface.
Interface for all Plugins which do logging to the logging window of the framework.
Interface for all Plugins which provide scriptable Functions.
Traverse the scenegraph and call the selection function for all mesh nodes.
bool operator()(BaseNode *_node)
Traverse the scenegraph and call the selection function for all mesh nodes.
Interface for all plugins which want to use selection functions.
void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect) override
Called whenever the user performs a custom selection.
bool vertexTypeActive()
Is vertex type active? (for use in plugins that need mesh selection)
PrimitiveType vertexType_
Primitive type handles:
void invertFaceSelection(int _objectId)
Invert face selection.
void invertCellSelection(int _objectId)
Invert cell selection.
void selectHalfFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-faces of a volume mesh.
void deleteSelectedVertices(int _objectId, bool _preserveManifoldness=true)
Delete selected vertices from mesh.
bool edgeTypeActive()
Is vertex type active? (for use in plugins that need mesh selection)
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers) override
One of the previously registered keys has been pressed.
void floodFillSelection(MeshT *_mesh, uint _fh, double _maxAngle, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are connected (and do not exceed the maximum dihedral angle)
void selectAllEdges(int _objectId)
Select all edges of a volume mesh.
QString name() override
Return a name for the plugin.
void selectFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific faces of a volume mesh.
unsigned char lastPickedOrientation_
Handle to selection environment.
bool faceTypeActive()
Is face type active? (for use in plugins that need mesh selection)
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect) override
Called whenever the user performs a volume lasso selection.
IdList getCellSelection(int _objectId)
Get current cell selection.
PrimitiveType floodFillSupportedTypes_
Handle to selection environment.
void selectAllHalfEdges(int _objectId)
Select all half-edges of a volume mesh.
PrimitiveType cellType_
Handle to selection environment.
QString description() override
Return a description of what the plugin is doing.
IdList getHalfFaceSelection(int _objectId)
Get current half-face selection.
void selectAllCells(int _objectId)
Select all cells of a volume mesh.
void deleteSelectedCells(int _objectId, bool _preserveManifoldness=true)
Delete selected cells from mesh.
IdList getFaceSelection(int _objectId)
Get current face selection.
VolMeshParamWidget * parameterWidget_
Handle to selection environment.
void deleteSelectedEdges(int _objectId, bool _preserveManifoldness=true)
Delete selected edges from mesh.
std::map< OpenVolumeMesh::CellHandle, unsigned char > orientationMap_
Handle to selection environment.
bool volumeSelection(MeshT *_mesh, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
void set_max_angle(const double _a)
set max angle for flood fill selection
void invertEdgeSelection(int _objectId)
Invert edge selection.
bool cellTypeActive()
Is cell type active? (for use in plugins that need mesh selection)
QString columnSelectionHandle_
Handle to selection environment.
void deleteSelectedFaces(int _objectId, bool _preserveManifoldness=true)
Delete selected faces from mesh.
void selectVertices(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific vertices of a volume mesh.
VolumeMeshSelectionPlugin()
Default constructor.
void selectAllHalfFaces(int _objectId)
Select all half-faces of a volume mesh.
~VolumeMeshSelectionPlugin()
Default destructor.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect) override
Called whenever the user performs a toggle selection.
HFPair getCommonFace(const OpenVolumeMesh::CellHandle &_ch1, const OpenVolumeMesh::CellHandle &_ch2, const HexahedralMesh *_mesh) const
Handle to selection environment.
IdList getHalfEdgeSelection(int _objectId)
Get current half-edge selection.
void selectHalfEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-edges of a volume mesh.
void selectAllVertices(int _objectId)
Select all vertices of a volume mesh.
void slotSaveSelection(INIFile &_file) override
Save selection for all objects in the scene.
void invertHalfFaceSelection(int _objectId)
Invert half-face selection.
void deselectAllCells(int _objectId)
Deselect all cells of a volume mesh.
void selectEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific edges of a volume mesh.
PrimitiveType edgeType_
Handle to selection environment.
double max_angle_
Handle to selection environment.
std::pair< OpenVolumeMesh::HalfFaceHandle, OpenVolumeMesh::HalfFaceHandle > HFPair
Handle to selection environment.
QString sheetSelectionHandle_
Handle to selection environment.
void invertVertexSelection(int _objectId)
Invert vertex selection.
void deselectAllVertices(int _objectId)
Deselect all vertices of a volume mesh.
double get_max_angle()
get max angle for flood fill selection
void deselectAllHalfEdges(int _objectId)
Deselect all half-edges of a volume mesh.
void invertHalfEdgeSelection(int _objectId)
Invert half-edge selection.
unsigned char getOrthogonalOrientationOfNeighborCell(const OpenVolumeMesh::CellHandle &_ch1, const OpenVolumeMesh::CellHandle &_ch2, unsigned char _firstOrthDirection, const HexahedralMesh *_mesh) const
Handle to selection environment.
PrimitiveType faceType_
Handle to selection environment.
IdList getEdgeSelection(int _objectId)
Get current edge selection.
void slotSelectionOperation(QString _operation) override
A specific operation is requested.
OpenVolumeMesh::CellHandle lastPickedCell_
Handle to selection environment.
void deselectAllFaces(int _objectId)
Deselect all faces of a volume mesh.
void deselectAllEdges(int _objectId)
Deselect all edges of a volume mesh.
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect) override
Called whenever the user performs a flood fill selection.
void slotLoadSelection(const INIFile &_file) override
Load selection for specific objects in the scene.
IdList getVertexSelection(int _objectId)
Get current vertex selection.
void selectCells(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific cells of a volume mesh.
void selectAllFaces(int _objectId)
Select all faces of a volume mesh.
OpenVolumeMesh::StatusAttrib * getStatus(int _objectId)
Handle to selection environment.
QVector< QPoint > volumeLassoPoints_
Keep volume lasso points.
PrimitiveType allSupportedTypes_
Handle to selection environment.
void updateSlotDescriptions()
Set slot descriptions for scripting functions.
void deselectAllHalfFaces(int _objectId)
Deselect all half-faces of a volume mesh.
QString environmentHandle_
Handle to selection environment.