Developer Documentation
Loading...
Searching...
No Matches
SelectionCommunication.cc
1/*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40\*===========================================================================*/
41
42
43//=============================================================================
44//
45// CLASS Core - IMPLEMENTATION of Comunication with plugins
46//
47//=============================================================================
48
49//== INCLUDES =================================================================
50
51#include "Core.hh"
52
53//== IMPLEMENTATION ==========================================================
54
55//========================================================================================
56// === Selection Communication ============================
57//========================================================================================
58
59void Core::slotAddSelectionEnvironment(const QString& _modeName, const QString& _description, const QString& _icon, QString& _handleName) {
60 emit addSelectionEnvironment(_modeName, _description, _icon, _handleName);
61}
62
63void Core::slotRegisterType(const QString& _handleName, DataType _type) {
64 emit registerType(_handleName, _type);
65}
66
67void Core::slotAddPrimitiveType(const QString& _handleName, const QString& _name, const QString& _icon, SelectionInterface::PrimitiveType& _typeHandle) {
68 emit addPrimitiveType(_handleName, _name, _icon, _typeHandle);
69}
70
71void Core::slotAddCustomSelectionMode(const QString& _handleName, const QString& _modeName, const QString& _description, const QString& _icon,
72 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier) {
73 emit addCustomSelectionMode(_handleName, _modeName, _description, _icon, _associatedTypes, _customIdentifier);
74}
75
76void Core::slotAddCustomSelectionMode(const QString& _handleName, const QString& _modeName, const QString& _description, const QString& _icon,
77 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
78 DataType _objectTypeRestriction) {
79 emit addCustomSelectionMode(_handleName, _modeName, _description, _icon, _associatedTypes, _customIdentifier, _objectTypeRestriction);
80}
81
82void Core::slotAddSelectionOperations(const QString& _handleName, const QStringList& _operationsList, const QString& _category, SelectionInterface::PrimitiveType _type) {
83 emit addSelectionOperations(_handleName, _operationsList, _category, _type);
84}
85
86void Core::slotAddSelectionParameters(const QString& _handleName,QWidget* _widget, const QString& _category, SelectionInterface::PrimitiveType _type) {
87 emit addSelectionParameters(_handleName, _widget, _category, _type);
88}
89
90void Core::slotSelectionOperation(const QString& _operation) {
91 emit selectionOperation(_operation);
92}
93
94void Core::slotShowToggleSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
95 emit showToggleSelectionMode(_handleName, _show, _associatedTypes);
96}
97
98void Core::slotShowLassoSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
99 emit showLassoSelectionMode(_handleName, _show, _associatedTypes);
100}
101
102void Core::slotShowVolumeLassoSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
103 emit showVolumeLassoSelectionMode(_handleName, _show, _associatedTypes);
104}
105
106void Core::slotShowSurfaceLassoSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
107 emit showSurfaceLassoSelectionMode(_handleName, _show, _associatedTypes);
108}
109
110void Core::slotShowSphereSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
111 emit showSphereSelectionMode(_handleName, _show, _associatedTypes);
112}
113
114void Core::slotShowClosestBoundarySelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
115 emit showClosestBoundarySelectionMode(_handleName, _show, _associatedTypes);
116}
117
118void Core::slotShowFloodFillSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
119 emit showFloodFillSelectionMode(_handleName, _show, _associatedTypes);
120}
121
122void Core::slotShowComponentsSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
123 emit showComponentsSelectionMode(_handleName, _show, _associatedTypes);
124}
125
126void Core::slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
127 emit toggleSelection(_event, _currentType, _deselect);
128}
129
130void Core::slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
131 emit lassoSelection(_event, _currentType, _deselect);
132}
133
134void Core::slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
135 emit volumeLassoSelection(_event, _currentType, _deselect);
136}
137
138void Core::slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
139 emit surfaceLassoSelection(_event, _currentType, _deselect);
140}
141
142void Core::slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
143 emit sphereSelection(_event, _radius, _currentType, _deselect);
144}
145
146void Core::slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
147 emit closestBoundarySelection(_event, _currentType, _deselect);
148}
149
150void Core::slotFloodFillSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
151 emit floodFillSelection(_event, _currentType, _deselect);
152}
153
154void Core::slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
155 emit componentsSelection(_event, _currentType, _deselect);
156}
157
158void Core::slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, const QString& _customIdentifier, bool _deselect) {
159 emit customSelection(_event, _currentType, _customIdentifier, _deselect);
160}
161
162void Core::slotGetActiveDataTypes(SelectionInterface::TypeList& _types) {
163 emit getActiveDataTypes(_types);
164}
165
166void Core::slotGetActivePrimitiveType(SelectionInterface::PrimitiveType& _type) {
167 emit getActivePrimitiveType(_type);
168}
169
170void Core::slotTargetObjectsOnly(bool& _targetsOnly) {
171 emit targetObjectsOnly(_targetsOnly);
172}
173
175 emit loadSelection(_file);
176}
177
179 emit saveSelection(_file);
180}
181
182void Core::slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers) {
183 emit registerKeyShortcut(_key, _modifiers);
184}
185
186void Core::slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers) {
187 emit keyShortcutEvent(_key, _modifiers);
188}
void keyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
SelectionInterface: This signal is emitted when a key shortcut has been pressed.
void saveSelection(INIFile &_file)
SelectionInterface: This signal is emitted when a selection should be written into a file.
void targetObjectsOnly(bool &_targetsOnly)
SelectionInterface: This signal is emitted if the current target restriction state is requested.
void slotAddSelectionOperations(const QString &_handleName, const QStringList &_operationsList, const QString &_category, SelectionInterface::PrimitiveType _type)
SelectionInterface: Called in order to add non-interactive operations for a specific primitive type.
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard toggle selection is required.
void componentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard connected components selection has been perf...
void slotShowFloodFillSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide flood fill selection operation for specific selection mode.
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString &_handleName)
SelectionInterface: This signal is emitted when a new toolbutton should be added.
void slotShowLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide lasso selection operation for specific selection mode.
void slotShowComponentsSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide connected components selection operation for specific selection mode.
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: Called when a key event occurred.
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type)
SelectionInterface: This signal is used to add non-interactive operations for a specific primitive ty...
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard volume lasso selection is required.
void slotShowClosestBoundarySelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide closest boundary selection operation for specific selection mode.
void selectionOperation(QString _operation)
SelectionInterface: This signal is emitted when a non-interactive operation has been performed.
void slotAddPrimitiveType(const QString &_handleName, const QString &_name, const QString &_icon, SelectionInterface::PrimitiveType &_typeHandle)
SelectionInterface: Called when a new, non-standard primitive type should be handled.
void addSelectionParameters(QString _handleName, QWidget *_widget, QString _category, SelectionInterface::PrimitiveType _type)
SelectionInterface: This signal is used to add interactive selection parameters for a specific primit...
void slotShowSurfaceLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide surface lasso selection operation for specific selection mode.
void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard connected components selection is required.
void getActivePrimitiveType(SelectionInterface::PrimitiveType &_type)
SelectionInterface: This signal is emitted when the active (selected) primitive type should be fetche...
void customSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
SelectionInterface: This signal is emitted when a custom selection operation has been performed.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when connected components selection operation has been performed.
void showSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard surface lasso selection is required.
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when flood fill selection operation has been performed.
void slotLoadSelection(const INIFile &_file)
SelectionInterface: Called when a selection should be loaded from a file.
void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: Called when a key shortcut is to be registered.
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier)
SelectionInterface: This signal is emitted when a custom selection mode is added.
void slotGetActiveDataTypes(SelectionInterface::TypeList &_types)
SelectionInterface: Called when active (selected) data types should be fetched.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when toggle selection operation has been performed.
void slotSelectionOperation(const QString &_operation)
SelectionInterface: Called when a non-interactive operation has been performed.
void volumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard volume lasso selection has been performed.
void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard sphere selection is required.
void slotShowToggleSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide toggle selection operation for specific selection mode.
void sphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard sphere selection has been performed.
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when volume lasso selection operation has been performed.
void closestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard closest boundary selection has been performe...
void loadSelection(const INIFile &_file)
SelectionInterface: This signal is emitted when a selection should be loaded from a file.
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType &_typeHandle)
SelectionInterface: This signal is emitted when a selection plugin should handle a new primitive type...
void registerType(QString _handleName, DataType _type)
SelectionInterface: This signal is emitted when a data type should be registered for a selection mode...
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when sphere selection operation has been performed.
void surfaceLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard surface lasso selection has been performed.
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when lasso selection operation has been performed.
void toggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard toggle selection has been performed.
void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard flood fill selection is required.
void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard lasso selection is required.
void floodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard flood fill selection has been performed.
void slotAddSelectionParameters(const QString &_handleName, QWidget *_widget, const QString &_category, SelectionInterface::PrimitiveType _type)
SelectionInterface: Called in order to add interactive parameters for a specific primitive type.
void slotSaveSelection(INIFile &_file)
SelectionInterface: Called when a selection should be stored into a file.
void getActiveDataTypes(SelectionInterface::TypeList &_types)
SelectionInterface: This signal is emitted when the active (selected) data types should be fetched.
void slotSurfaceLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when surface lasso selection operation has been performed.
void slotAddSelectionEnvironment(const QString &_modeName, const QString &_description, const QString &_icon, QString &_handleName)
SelectionInterface: Called when a new selection type button should be added to the toolbar.
void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard closest boundary selection is required.
void slotGetActivePrimitiveType(SelectionInterface::PrimitiveType &_type)
SelectionInterface: Called when active primitive type should be fetched.
void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, const QString &_customIdentifier, bool _deselect)
SelectionInterface: Called when custom selection operation has been performed.
void slotAddCustomSelectionMode(const QString &_handleName, const QString &_modeName, const QString &_description, const QString &_icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier)
SelectionInterface: Add new selection mode for specified type.
void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: This signal is emitted when a type selection plugin wants to listen to a key even...
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when closest boundary selection operation has been performed.
void slotShowVolumeLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide volume lasso selection operation for specific selection mode.
void slotRegisterType(const QString &_handleName, DataType _type)
SelectionInterface: Called when a data type is added for a specific selection type.
void lassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard lasso selection has been performed.
void slotTargetObjectsOnly(bool &_targetsOnly)
SelectionInterface: Called when target restriction state should be fetched.
void slotShowSphereSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide sphere selection operation for specific selection mode.
Predefined datatypes.
Definition DataTypes.hh:83
Class for the handling of simple configuration files.
Definition INIFile.hh:100