50 #ifndef VOLUMEMESHSELECTIONPLUGIN_HH
51 #define VOLUMEMESHSELECTIONPLUGIN_HH
62 #include <OpenFlipper/BasePlugin/INIInterface.hh>
67 #include <OpenFlipper/INIFile/INIFile.hh>
71 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT
87 #if QT_VERSION >= 0x050000
88 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-SelectionVolumeMesh")
106 void nodeVisibilityChanged(
int _identifier);
107 void setSlotDescription(QString _slotName, QString _slotDescription,
108 QStringList _parameters, QStringList _descriptions);
111 void log(
Logtype _type, QString _message);
112 void log(QString _message);
115 void scriptInfo(QString _functionName);
118 void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
119 void registerType(QString _handleName,
DataType _type);
120 void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
121 void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
123 void showToggleSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes);
125 void showVolumeLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes);
126 void showFloodFillSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes);
127 void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
128 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
130 void getActiveDataTypes(SelectionInterface::TypeList& _types);
131 void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
132 void targetObjectsOnly(
bool& _targetsOnly);
134 void registerKeyShortcut(
int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier);
139 void loadIniFile(
INIFile& _ini,
int _id);
140 void saveIniFile(
INIFile& _ini,
int _id);
143 void initializePlugin();
144 void pluginsInitialized();
145 void noguiSupported() {};
149 void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType,
bool _deselect);
152 void slotFloodFillSelection(QMouseEvent* _event,
double _maxAngle, SelectionInterface::PrimitiveType _currentType,
bool _deselect);
153 void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier,
bool _deselect);
163 void loadSelection(
int _objId,
const QString& _filename);
169 return (QString(tr(
"VolumeMesh Selection")));
173 return (QString(tr(
"Allows to select VolumeMeshes")));
190 return QString(
"1.0");
333 template<
class MeshT>
335 PrimitiveType _primitiveTypes,
bool _deselection);
338 template<
class MeshT>
340 PrimitiveType _primitiveTypes,
bool _deselection);
347 typedef std::pair<OpenVolumeMesh::HalfFaceHandle,OpenVolumeMesh::HalfFaceHandle>
HFPair;
387 unsigned int _type,
bool _deselection,
ACG::GLState& _state)
392 , deselection_(_deselection)
409 #if defined(INCLUDE_TEMPLATES) && !defined(VOLUMEMESHSELECTIONPLUGINT_CC)
410 #define VOLUMEMESHSELECTIONPLUGINT_TEMPLATES
411 #include "VolumeMeshSelectionPluginT.cc"
415 #endif // VOLUMEMESHSELECTIONPLUGIN_HH defined
OpenVolumeMesh::StatusAttrib * getStatus(int _objectId)
Handle to selection environment.
~VolumeMeshSelectionPlugin()
Default destructor.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
void selectVertices(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific vertices of a volume mesh.
bool vertexTypeActive()
Is vertex type active? (for use in plugins that need mesh selection)
IdList getVertexSelection(int _objectId)
Get current vertex selection.
void deselectAllFaces(int _objectId)
Deselect all faces of a volume mesh.
void selectFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific faces of a volume mesh.
void selectAllHalfFaces(int _objectId)
Select all half-faces of a volume mesh.
QVector< QPoint > volumeLassoPoints_
Keep volume lasso points.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
PrimitiveType cellType_
Handle to selection environment.
void deselectAllCells(int _objectId)
Deselect all cells of a volume mesh.
void slotSelectionOperation(QString _operation)
A specific operation is requested.
void deselectAllHalfFaces(int _objectId)
Deselect all half-faces of a volume mesh.
bool faceTypeActive()
Is face type active? (for use in plugins that need mesh selection)
IdList getHalfEdgeSelection(int _objectId)
Get current half-edge selection.
void deleteSelectedVertices(int _objectId, bool _preserveManifoldness=true)
Delete selected vertices from mesh.
IdList getEdgeSelection(int _objectId)
Get current edge selection.
Traverse the scenegraph and call the selection function for all mesh nodes.
void selectHalfFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-faces of a volume mesh.
Interface for all Plugins which provide scriptable Functions.
VolumeMeshSelectionPlugin()
Default constructor.
void invertHalfFaceSelection(int _objectId)
Invert half-face selection.
void selectAllVertices(int _objectId)
Select all vertices of a volume mesh.
Class for the handling of simple configuration files.
void invertHalfEdgeSelection(int _objectId)
Invert half-edge selection.
unsigned char lastPickedOrientation_
Handle to selection environment.
PrimitiveType floodFillSupportedTypes_
Handle to selection environment.
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
PrimitiveType vertexType_
Primitive type handles:
QString sheetSelectionHandle_
Handle to selection environment.
void selectAllFaces(int _objectId)
Select all faces of a volume mesh.
void selectAllHalfEdges(int _objectId)
Select all half-edges of a volume mesh.
Interface class for backup handling.
void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
Called whenever the user performs a custom selection.
Interface for all Plugins which do logging to the logging window of the framework.
PrimitiveType faceType_
Handle to selection environment.
std::pair< OpenVolumeMesh::HalfFaceHandle, OpenVolumeMesh::HalfFaceHandle > HFPair
Handle to selection environment.
bool volumeSelection(MeshT *_mesh, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
Interface for all plugins which want to use selection functions.
unsigned char getOrthogonalOrientationOfNeighborCell(const OpenVolumeMesh::CellHandle &_ch1, const OpenVolumeMesh::CellHandle &_ch2, unsigned char _firstOrthDirection, const HexahedralMesh *_mesh) const
Handle to selection environment.
bool edgeTypeActive()
Is vertex type active? (for use in plugins that need mesh selection)
IdList getHalfFaceSelection(int _objectId)
Get current half-face selection.
Keyboard Event Interface.
OpenVolumeMesh::CellHandle lastPickedCell_
Handle to selection environment.
IdList getFaceSelection(int _objectId)
Get current face selection.
void deleteSelectedCells(int _objectId, bool _preserveManifoldness=true)
Delete selected cells from mesh.
void invertVertexSelection(int _objectId)
Invert vertex selection.
void selectCells(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific cells of a volume mesh.
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) ...
QString environmentHandle_
Handle to selection environment.
QString description()
Return a description of what the plugin is doing.
PrimitiveType allSupportedTypes_
Handle to selection environment.
Interface class from which all plugins have to be created.
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
void invertFaceSelection(int _objectId)
Invert face selection.
Logtype
Log types for Message Window.
bool cellTypeActive()
Is cell type active? (for use in plugins that need mesh selection)
void updateSlotDescriptions()
Set slot descriptions for scripting functions.
void deleteSelectedEdges(int _objectId, bool _preserveManifoldness=true)
Delete selected edges from mesh.
void selectHalfEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-edges of a volume mesh.
PrimitiveType edgeType_
Handle to selection environment.
IdList getCellSelection(int _objectId)
Get current cell selection.
std::map< OpenVolumeMesh::CellHandle, unsigned char > orientationMap_
Handle to selection environment.
QString name()
Return a name for the plugin.
void invertCellSelection(int _objectId)
Invert cell selection.
void deselectAllEdges(int _objectId)
Deselect all edges of a volume mesh.
HFPair getCommonFace(const OpenVolumeMesh::CellHandle &_ch1, const OpenVolumeMesh::CellHandle &_ch2, const HexahedralMesh *_mesh) const
Handle to selection environment.
void deselectAllVertices(int _objectId)
Deselect all vertices of a volume mesh.
void invertEdgeSelection(int _objectId)
Invert edge selection.
void slotFloodFillSelection(QMouseEvent *_event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
void selectEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific edges of a volume mesh.
bool operator()(BaseNode *_node)
Traverse the scenegraph and call the selection function for all mesh nodes.
void deleteSelectedFaces(int _objectId, bool _preserveManifoldness=true)
Delete selected faces from mesh.
Interface class for Plugins which have to store information in ini files.
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
QString columnSelectionHandle_
Handle to selection environment.
void selectAllCells(int _objectId)
Select all cells of a volume mesh.
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
void selectAllEdges(int _objectId)
Select all edges of a volume mesh.
void deselectAllHalfEdges(int _objectId)
Deselect all half-edges of a volume mesh.