BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
message.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_KERNEL_MESSAGE_H
6 #define BALL_VIEW_KERNEL_MESSAGE_H
7 
8 #ifndef BALL_VIEW_KERNEL_STAGE_H
9 # include <BALL/VIEW/KERNEL/stage.h>
10 #endif
11 
12 #ifndef BALL_VIEW_KERNEL_COMMON_H
13 # include <BALL/VIEW/KERNEL/common.h>
14 #endif
15 
16 #include <boost/any.hpp>
17 
18 class QWidget;
19 
20 namespace BALL
21 {
22  class Composite;
23  class ConformationSet;
24 
25  namespace VIEW
26  {
27  class Dataset;
28  class ConnectionObject;
29  class GeometricObject;
30 
33 
53 {
54  public:
55 
59 
65  Message();
66 
69  Message(const Message& message);
70 
73  virtual ~Message();
74 
76 
79 
85  void setSender(const ConnectionObject* sender);
86 
92  const ConnectionObject* getSender() const;
93 
105  void setDeletable(bool flag = true);
106 
109  bool isDeletable() const;
110 
115  boost::any& data() { return data_; }
117 
118  private:
119 
120  const ConnectionObject* connection_object_;
121 
122  bool deletable_;
123 
124  boost::any data_;
125 };
126 
127 
138  : public Message
139 {
140  public:
141 
143  enum Type
144  {
146  UNDEFINED = -1,
147 
149  ADD = 0,
150 
153 
156 
159 
162 
165  };
166 
168  DatasetMessage(Dataset* set = 0, Type type = UNDEFINED);
169 
171  DatasetMessage(const DatasetMessage& msg);
172 
174  Type getType() const { return type_;}
175 
177  void setType(Type type) { type_ = type;}
178 
180  Dataset* getDataset() const { return dataset_;}
181 
183  void setDataset(Dataset* set) { dataset_ = set;}
184 
186  bool isValid() const;
187 
188  protected:
189 
193 };
194 
195 
196 
201  : public Message
202 {
203  public:
204 
207  {
209  UNDEFINED = -1,
210 
215 
218 
221 
224 
227 
230 
233 
237  NEW_MOLECULE
238  };
239 
243 
250 
252  CompositeMessage(const Composite& composite, CompositeMessageType type, bool update_representations = true);
253 
255  CompositeMessage(const CompositeMessage& message);
256 
258  virtual ~CompositeMessage();
259 
261 
264 
267  void setComposite(const Composite& composite);
268 
271  Composite* getComposite() const;
272 
276  void setCompositeName(const String& name);
277 
280  const String& getCompositeName() const;
281 
284  { type_ = type;}
285 
288  { return type_;}
289 
291  void setUpdateRepresentations(bool state)
292  { update_representations_ = state;}
293 
296  { return update_representations_;}
297 
299  void setShowSelectionInfos(bool state)
300  { show_selection_infos_ = state;}
301 
304  { return show_selection_infos_;}
305 
307 
308  protected:
309 
315 };
316 
317 
329 {
330  public:
331 
335 
338  {
340  UNDEFINED = 0,
341 
344 
347 
350 
353 
356 
359 
362 
365 
368 
370  EXPORT_FINISHED
371  };
372 
374 
377 
384  SceneMessage(SceneMessageType type = UNDEFINED);
385 
388  SceneMessage(const SceneMessage& message);
389 
392  virtual ~SceneMessage();
393 
395 
398 
400  void setType(SceneMessageType type);
401 
404  { return type_;}
405 
408  void setStage(Stage stage)
409  { stage_ = stage;}
410 
413  { return stage_;}
414 
416  const Stage& getStage() const
417  { return stage_;}
418 
420 
421  private:
422 
423  SceneMessageType type_;
424  Stage stage_;
425 };
426 
427 
434 {
435  public:
436 
440 
446 
450 
453  virtual ~GenericSelectionMessage();
454 
456 
459 
463  void setSelection(const std::list<Composite*>& selection);
464 
467  const std::list<Composite*>& getSelection() const;
468 
471  std::list<Composite*>& getSelection();
472 
474 
475  private:
476 
477  std::list<Composite*> selection_;
478 };
479 
480 
487 {
488  public:
490 };
491 
492 
496 {
497  public:
499 
501  bool openItems()
502  { return open_;}
503 
505  void setOpenItems(bool state)
506  { open_ = state;}
507 
508  protected:
509  bool open_;
510 };
511 
517 {
518  public:
519 
523 
527 
531 
533 
536 
540  void setSelection(const std::list<GeometricObject*>& selection)
541  { selection_ = selection;}
542 
545  const std::list<GeometricObject*>& getSelection() const
546  { return selection_;}
547 
549  void setSelected(bool state)
550  { state_ = state;}
551 
553  bool isSelected() const
554  { return state_;}
555 
557 
558  private:
559 
560  std::list<GeometricObject*> selection_;
561 
562  bool state_;
563 };
564 
565 
566 class Representation;
567 
570 {
571  public:
572 
575  {
577  UNDEFINED = -1,
578 
580  ADD = 0,
581 
584 
587 
590 
593 
596 
599 
601  UPDATE_PROPERTIES
602  };
603 
606 
608  virtual ~RepresentationMessage();
609 
611  RepresentationMessage(Representation& rep, RepresentationMessageType type);
612 
615  {representation_ = &rep;}
616 
619  {return representation_;}
620 
622  void setType(RepresentationMessageType type);
623 
626  { return type_;}
627 
628  private:
629 
630  Representation* representation_;
631  RepresentationMessageType type_;
632 };
633 
634 
639  : public Message
640 {
641  public:
642 
645  {
647  UNDEFINED = -1,
655  CREATE_DISTANCE_GRID
656  };
657 
659  MolecularTaskMessage(MolecularTaskMessageType type = UNDEFINED);
660 
662  void setType(MolecularTaskMessageType type);
663 
666  {return type_;}
667 
668  protected:
669 
671 };
672 
673 
678  :public Message
679 {
680  public:
683  : Message(){};
684 };
685 
690  :public Message
691 {
692  public:
695 
697  CreateRepresentationMessage(const std::list<Composite*>& composites,
698  ModelType model_type,
699  ColoringMethod coloring_method)
700  ;
701 
703  const std::list<Composite*>& getComposites() const
704  { return composites_;}
705 
708  { return model_type_;}
709 
712  { return coloring_method_;}
713 
714  private:
715  std::list<Composite*> composites_;
716  ModelType model_type_;
717  ColoringMethod coloring_method_;
718 };
719 
720 
725  : public Message
726 {
727  public:
729  : Message() {};
730 };
731 
732 
735  : public Message
736 {
737  public:
738 
741 
744 
746  void setMatrix(const Matrix4x4& m)
747  { matrix_ = m;}
748 
750  const Matrix4x4& getMatrix() const
751  { return matrix_;}
752 
753  private:
754 
755  Matrix4x4 matrix_;
756 };
757 
758 
761  : public Message
762 {
763  public:
764 
767 };
768 
769 
772  : public Message
773 {
774  public:
775 
778 };
779 
780 
783  : public Message
784 {
785  public:
786 
788  ShowHelpMessage(String url = "", String project = "BALLView", String entry = "");
789 
790  String getURL() const { return url_;}
791 
792  String getProject() const { return project_;}
793 
794  String getEntry() const { return entry_;}
795 
796  protected:
797 
801 };
802 
803 
809  : public Message
810 {
811  public:
812 
815 
817  void setObject(const QObject* object) { object_ = object;}
818 
820  void setURL(const String& url) { url_ = url;}
821 
823  void setRegisterMode(bool state) { register_ = state;}
824 
826  const QObject* getObject() const { return object_;}
827 
829  const String& getURL() const { return url_;}
830 
832  bool isRegister() const { return register_;}
833 
834  protected:
835 
836  const QObject* object_;
839  bool register_;
840 };
841 
842 
843 
846  :public Message
847 {
848  public:
851 
853  DockingFinishedMessage(bool abort);
854 
856  virtual ~DockingFinishedMessage();
857 
859  void setConformationSet(const ConformationSet* conformation_set)
860  {
861  conformation_set_ = conformation_set;
862  }
863 
864  //
865  const ConformationSet* getConformationSet() const { return conformation_set_; }
866 
868  bool wasAborted() { return abort_; }
869 
870  protected:
871 
874  bool abort_;
875 };
876 
878 
879 # ifndef BALL_NO_INLINE_FUNCTIONS
880 # include <BALL/VIEW/KERNEL/message.iC>
881 # endif
882 
883 } } // namespaces
884 
885 #endif // BALL_VIEW_KERNEL_MESSAGE_H
const Matrix4x4 & getMatrix() const
Definition: message.h:750
Update all datas for a Composite (but not in the MolecularControl)
Definition: message.h:220
Move the Camera in the Scene to the value in this message.
Definition: message.h:349
center the camera on a composite
Definition: message.h:232
const QObject * getObject() const
Definition: message.h:826
const ConformationSet * conformation_set_
this conformation set is deleted in DockResult
Definition: message.h:873
void setUpdateRepresentations(bool state)
Definition: message.h:291
Base class for all messages concerning a Representation.
Definition: message.h:569
ColoringMethod getColoringMethod() const
Definition: message.h:711
Redraw from the GLDisplayList objects.
Definition: message.h:346
bool updateRepresentations() const
Definition: message.h:295
void setRepresentation(Representation &rep)
Definition: message.h:614
Allow >90 different kinds of visualization.
Definition: message.h:164
const Stage & getStage() const
Get the Stage in this message.
Definition: message.h:416
Representation was selected in GeometriControl.
Definition: message.h:589
MolecularTaskMessageType getType() const
Definition: message.h:665
Type
Message type enumeration.
Definition: message.h:143
RepresentationMessageType getType() const
Definition: message.h:625
void setType(Type type)
Definition: message.h:177
Add a Representation to GeometricControl, but don't update in Scene.
Definition: message.h:598
DatasetMessage(Dataset *set=0, Type type=UNDEFINED)
void setObject(const QObject *object)
Definition: message.h:817
selected a composite (e.g. per checkboxes in MolecularControl)
Definition: message.h:226
void setURL(const String &url)
Definition: message.h:820
MolecularTaskMessageType type_
Definition: message.h:670
SceneMessageType getType() const
Get the type of the message.
Definition: message.h:403
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
Message to notify docking has finished.
Definition: message.h:845
void setMatrix(const Matrix4x4 &m)
Definition: message.h:746
void setShowSelectionInfos(bool state)
Definition: message.h:299
MolecularTaskMessageType
Enum for the different molecular tasks.
Definition: message.h:644
SceneMessageType
Types for SceneMessages.
Definition: message.h:337
Update all datas for a composite (also in MolecularControl)
Definition: message.h:223
Rebuild the GLDisplayList objects in the GLRenderer.
Definition: message.h:343
Started the update of a Representation, no changes allowed in GeometricControl.
Definition: message.h:592
void setType(CompositeMessageType type)
Definition: message.h:283
const ConformationSet * getConformationSet() const
Definition: message.h:865
void setConformationSet(const ConformationSet *conformation_set)
Definition: message.h:859
deselected a composite (e.g. per checkboxes in MolecularControl)
Definition: message.h:229
Move Composites or a Clipping Plane.
Definition: message.h:367
Representation * getRepresentation()
Definition: message.h:618
String getProject() const
Definition: message.h:792
void setOpenItems(bool state)
Definition: message.h:505
Finished the update of a Representation.
Definition: message.h:595
Was selected in Control.
Definition: message.h:158
void setSelection(const std::list< GeometricObject * > &selection)
Definition: message.h:540
RepresentationMessageType
Types of RepresentationMessage.
Definition: message.h:574
Dataset * getDataset() const
Definition: message.h:180
String getURL() const
Definition: message.h:790
CompositeMessageType type_
Definition: message.h:310
bool isSelected() const
Query if the GeometricObject are selected or deselected.
Definition: message.h:553
const std::list< GeometricObject * > & getSelection() const
Definition: message.h:545
void setDataset(Dataset *set)
Definition: message.h:183
bool openItems()
Open all SelectableListViewItems, if they have a selected child.
Definition: message.h:501
void setStage(Stage stage)
Definition: message.h:408
Update the Representation.
Definition: message.h:586
Type getType() const
Definition: message.h:174
void setSelected(bool state)
Set the GeometricObject's to be selected or deselected.
Definition: message.h:549
String getEntry() const
Definition: message.h:794
const std::list< Composite * > & getComposites() const
Definition: message.h:703
Stage & getStage()
Get the Stage in this message.
Definition: message.h:412
Remove a Representation.
Definition: message.h:583
Remove the coordinate system in the Scene.
Definition: message.h:352
const String & getURL() const
Definition: message.h:829
CompositeMessageType getType() const
Definition: message.h:287
boost::any & data()
Definition: message.h:115