BALL  1.5.0
geometricControl.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_VIEW_WIDGETS_GEOMETRICCONTROL_H
6 #define BALL_VIEW_WIDGETS_GEOMETRICCONTROL_H
7 
8 #ifndef BALL_COMMON_H
9 # include <BALL/common.h>
10 #endif
11 
12 #ifndef BALL_VIEW_WIDGETS_GENERICCONTROL_H
14 #endif
15 
16 #ifndef BALL_VIEW_KERNEL_COMMON_H
17 # include <BALL/VIEW/KERNEL/common.h>
18 #endif
19 
20 #include <QtCore/QPoint>
21 #include <QtWidgets/QMenu>
22 
23 namespace BALL
24 {
25  namespace VIEW
26  {
27  class Representation;
28  class ModifyRepresentationDialog;
29  class ClippingPlane;
30  class TransformationMessage;
31 
42  : public GenericControl
43  {
44  Q_OBJECT
45 
46  public:
47 
49 
50 
53 
69  GeometricControl(QWidget* parent = 0, const char* name = 0);
70 
72  virtual ~GeometricControl();
73 
77  virtual void clear(){};
78 
80  virtual void initializeWidget(MainControl& main_control);
81 
83 
84 
87  virtual void addRepresentation(Representation& rep);
88 
91  virtual void removeRepresentation(Representation& rep);
92 
95  virtual void updateRepresentation(Representation& rep, bool force=false);
96 
102  std::list<Representation*> getHighlightedRepresentations() const;
103 
107  virtual void onNotify(Message *message);
108 
115  virtual void buildContextMenu();
116 
118  virtual void checkMenu(MainControl& main_control);
119 
121  void moveItems(const TransformationMessage& msg);
122 
123  void updateClippingPlanes();
124 
125  public Q_SLOTS:
126 
128 
131 
133  virtual void renameRepresentation();
134 
136  virtual void selectAtoms();
137 
139  virtual void selectedRepresentation(Representation& representation, bool state);
140 
142  virtual void updateSelection();
143 
145  virtual void focus();
146 
148  virtual void enterMoveMode();
149 
151  virtual void flipClippingCapping();
152 
154  virtual void flipClippingPlane();
155 
157  virtual void setClippingPosition();
158 
160  virtual void setClippingPlaneX();
161 
163  virtual void setClippingPlaneY();
164 
166  virtual void setClippingPlaneZ();
167 
169  void hideShowClippingPlane();
170 
172  virtual void selectClipRepresentations();
173 
175  void createNewClippingPlane();
176 
178  void duplicate();
179 
181  void saveSurface();
182 
184  void loadSurface();
185 
187  ModifyRepresentationDialog* getModifySurfaceDialog();
188 
189  protected Q_SLOTS:
190 
192 
194 
196  virtual void modifyRepresentation_();
197 
200  virtual void generateListViewItem_(Representation& rep);
201 
203  virtual void deleteCurrentItems();
204 
206  virtual void setupProximityLight();
207 
209 
210  protected Q_SLOTS:
211 
212  virtual void onItemClicked(QTreeWidgetItem* item, int col);
213  void showGuestContextMenu(const QPoint& pos);
214 
215  protected:
216 
217  void addItem_(const String& text, const char* member, QWidget* widget = 0);
218 
219  // only for Python Interface
220  GeometricControl(const GeometricControl& control);
221 
222  enum ColumnID
223  {
224  COLUMN_ID__TYPE = 0,
225  COLUMN_ID__Properties
226  };
227 
228  void setClippingPlane_(const Vector3& n);
229 
230  // the context menu
233 
236 
241 
243 
246 
247  QAction* menu_clipping_plane_, *menu_load_surface_, *modify_surface_;
248  vector<QAction*> context_menu_actions_;
249  };
250 
251 } } // namespaces
252 
253 #endif // BALL_VIEW_WIDGETS_GEOMETRICCONTROL_H
BALL::VIEW::GeometricControl::context_plane_
ClippingPlane * context_plane_
Definition: geometricControl.h:235
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
QWidget
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73
genericControl.h
BALL::TVector3< float >
BALL::VIEW::GeometricControl::modify_surface_
QAction * modify_surface_
Definition: geometricControl.h:247
BALL::VIEW::GeometricControl::ColumnID
ColumnID
Definition: geometricControl.h:222
BALL::VIEW::ModifyRepresentationDialog
Definition: modifyRepresentationDialog.h:51
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
BALL::VIEW::GeometricControl::clipping_plane_context_menu_
QMenu clipping_plane_context_menu_
Definition: geometricControl.h:232
BALL::VIEW::GenericControl
Definition: genericControl.h:50
BALL
Definition: constants.h:12
BALL::String
Definition: string.h:56
BALL::VIEW::GeometricControl::context_menu_
QMenu context_menu_
Definition: geometricControl.h:231
BALL::VIEW::Representation
Definition: representation.h:57
BALL::VIEW::TransformationMessage
Definition: message.h:734
BALL::VIEW::GeometricControl::context_menu_actions_
vector< QAction * > context_menu_actions_
Definition: geometricControl.h:248
BALL::VIEW::GeometricControl::clear
virtual void clear()
Definition: geometricControl.h:77
BALL::VIEW::MainControl
Definition: mainControl.h:114
BALL::VIEW::GeometricControl::context_representation_
Representation * context_representation_
Definition: geometricControl.h:234
BALL::VIEW::GeometricControl::creating_representations_
bool creating_representations_
Definition: geometricControl.h:244
BALL::VIEW::GeometricControl::item_to_plane_
HashMap< QTreeWidgetItem *, ClippingPlane * > item_to_plane_
Definition: geometricControl.h:240
common.h
BALL::VIEW::GeometricControl::representation_to_item_
HashMap< Representation *, QTreeWidgetItem * > representation_to_item_
Definition: geometricControl.h:237
BALL::VIEW::GeometricControl::ignore_change_
bool ignore_change_
Definition: geometricControl.h:245
BALL::VIEW::GeometricControl::item_to_representation_
HashMap< QTreeWidgetItem *, Representation * > item_to_representation_
Definition: geometricControl.h:239
BALL::VIEW::GeometricControl::plane_to_item_
HashMap< ClippingPlane *, QTreeWidgetItem * > plane_to_item_
Definition: geometricControl.h:238
BALL::VIEW::GeometricControl
Definition: geometricControl.h:41
QTreeWidgetItem
BALL::VIEW::GeometricControl::modify_rep_dialog_
ModifyRepresentationDialog * modify_rep_dialog_
Definition: geometricControl.h:242
BALL::VIEW::ClippingPlane
Definition: clippingPlane.h:25
BALL::VIEW::Message
Definition: message.h:52
common.h