BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 <QtGui/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 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 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 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
ModifyRepresentationDialog * modify_rep_dialog_
vector< QAction * > context_menu_actions_
HashMap< ClippingPlane *, QTreeWidgetItem * > plane_to_item_
HashMap< QTreeWidgetItem *, Representation * > item_to_representation_
HashMap< Representation *, QTreeWidgetItem * > representation_to_item_
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
HashMap< QTreeWidgetItem *, ClippingPlane * > item_to_plane_
Representation * context_representation_
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73