BALL  1.5.0
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 
810  : public Message
811 {
812  public:
813 
816 
818  void setObject(const QObject* object) { object_ = object;}
819 
821  void setURL(const String& url) { url_ = url;}
822 
824  void setRegisterMode(bool state) { register_ = state;}
825 
827  const QObject* getObject() const { return object_;}
828 
830  const String& getURL() const { return url_;}
831 
833  bool isRegister() const { return register_;}
834 
835  protected:
836 
837  const QObject* object_;
840  bool register_;
841 };
842 
843 
844 
847  :public Message
848 {
849  public:
852 
854  DockingFinishedMessage(bool abort);
855 
857  virtual ~DockingFinishedMessage();
858 
860  void setConformationSet(const ConformationSet* conformation_set)
861  {
862  conformation_set_ = conformation_set;
863  }
864 
865  //
866  const ConformationSet* getConformationSet() const { return conformation_set_; }
867 
869  bool wasAborted() { return abort_; }
870 
871  protected:
872 
875  bool abort_;
876 };
877 
879 
880 # ifndef BALL_NO_INLINE_FUNCTIONS
881 # include <BALL/VIEW/KERNEL/message.iC>
882 # endif
883 
884 } } // namespaces
885 
886 #endif // BALL_VIEW_KERNEL_MESSAGE_H
BALL::VIEW::TransformationMessage::setMatrix
void setMatrix(const Matrix4x4 &m)
Definition: message.h:746
BALL::VIEW::RegisterHelpSystemMessage::getURL
const String & getURL() const
Definition: message.h:830
BALL::VIEW::Stage
Definition: stage.h:238
BALL::VIEW::DeselectControlsMessage
Definition: message.h:724
BALL::VIEW::CreateRepresentationMessage::getModelType
ModelType getModelType() const
Definition: message.h:707
BALL::VIEW::DatasetMessage::setType
void setType(Type type)
Definition: message.h:177
BALL_INDEX_TYPE
BALL::VIEW::RegisterHelpSystemMessage::menu_entry_
Index menu_entry_
Definition: message.h:838
BALL::VIEW::RepresentationMessage::setRepresentation
void setRepresentation(Representation &rep)
Definition: message.h:614
BALL::VIEW::RegisterHelpSystemMessage::register_
bool register_
Definition: message.h:840
BALL::VIEW::DatasetMessage::getType
Type getType() const
Definition: message.h:174
BALL::VIEW::DatasetMessage::getDataset
Dataset * getDataset() const
Definition: message.h:180
BALL::VIEW::CompositeMessage::type_
CompositeMessageType type_
Definition: message.h:310
BALL::VIEW::MolecularTaskMessage::ADD_HYDROGENS
Definition: message.h:653
BALL::VIEW::DatasetMessage::DatasetMessage
DatasetMessage(Dataset *set=0, Type type=UNDEFINED)
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::CompositeMessage::setUpdateRepresentations
void setUpdateRepresentations(bool state)
Definition: message.h:291
BALL::VIEW::RegisterHelpSystemMessage::url_
String url_
Definition: message.h:839
BALL::VIEW::RepresentationMessage::FINISHED_UPDATE
Finished the update of a Representation.
Definition: message.h:595
BALL::VIEW::DatasetMessage::isValid
bool isValid() const
BALL::VIEW::CompositeMessage::setType
void setType(CompositeMessageType type)
Definition: message.h:283
BALL::VIEW::SceneMessage::ENTER_PICKING_MODE
Definition: message.h:364
BALL::VIEW::ShowHelpMessage::entry_
String entry_
Definition: message.h:800
BALL::VIEW::RegisterHelpSystemMessage::setRegisterMode
void setRegisterMode(bool state)
Definition: message.h:824
BALL::VIEW::GeometricObjectSelectionMessage::getSelection
const std::list< GeometricObject * > & getSelection() const
Definition: message.h:545
BALL::VIEW::ColoringMethod
ColoringMethod
Definition: VIEW/KERNEL/common.h:242
BALL::VIEW::RepresentationMessage::STARTED_UPDATE
Started the update of a Representation, no changes allowed in GeometricControl.
Definition: message.h:592
QWidget
BALL::VIEW::SceneMessage::ENTER_MOVE_MODE
Move Composites or a Clipping Plane.
Definition: message.h:367
BALL::ConformationSet
Definition: conformationSet.h:32
BALL::VIEW::SceneMessage::getStage
Stage & getStage()
Get the Stage in this message.
Definition: message.h:412
BALL::VIEW::RepresentationMessage::getRepresentation
Representation * getRepresentation()
Definition: message.h:618
BALL::VIEW::ShowHelpMessage
Definition: message.h:782
BALL::VIEW::ShowDisplayPropertiesMessage::ShowDisplayPropertiesMessage
ShowDisplayPropertiesMessage()
Definition: message.h:682
BALL::VIEW::DockingFinishedMessage::wasAborted
bool wasAborted()
Definition: message.h:869
BALL::VIEW::CompositeMessage::DESELECTED_COMPOSITE
deselected a composite (e.g. per checkboxes in MolecularControl)
Definition: message.h:229
BALL::VIEW::ConnectionObject
Definition: connectionObject.h:39
BALL::VIEW::CompositeMessage::show_selection_infos_
bool show_selection_infos_
Definition: message.h:314
BALL::VIEW::ModelType
ModelType
Definition: VIEW/KERNEL/common.h:165
BALL::VIEW::MolecularTaskMessage::CHECK_RESIDUE
Definition: message.h:651
BALL::VIEW::SceneMessage::getType
SceneMessageType getType() const
Get the type of the message.
Definition: message.h:403
BALL::VIEW::CompositeMessage::update_representations_
bool update_representations_
Definition: message.h:313
BALL::VIEW::RepresentationMessage::ADD_TO_GEOMETRIC_CONTROL
Add a Representation to GeometricControl, but don't update in Scene.
Definition: message.h:598
BALL::VIEW::RepresentationMessage::getType
RepresentationMessageType getType() const
Definition: message.h:625
BALL::VIEW::MolecularTaskMessage::getType
MolecularTaskMessageType getType() const
Definition: message.h:665
BALL::VIEW::MolecularTaskMessage
Definition: message.h:638
BALL::VIEW::DockingFinishedMessage
Message to notify docking has finished.
Definition: message.h:846
BALL::VIEW::GeometricObjectSelectionMessage::setSelected
void setSelected(bool state)
Set the GeometricObject's to be selected or deselected.
Definition: message.h:549
BALL::VIEW::MolecularTaskMessage::type_
MolecularTaskMessageType type_
Definition: message.h:670
BALL::VIEW::Dataset
Definition: dataset.h:60
BALL::TMatrix4x4< float >
BALL::VIEW::SyncClippingPlanesMessage
Definition: message.h:771
BALL::VIEW::DatasetMessage::setDataset
void setDataset(Dataset *set)
Definition: message.h:183
QObject
BALL
Definition: constants.h:12
BALL::VIEW::DatasetMessage::UPDATE
Update.
Definition: message.h:155
BALL::VIEW::CompositeMessage::CENTER_CAMERA
center the camera on a composite
Definition: message.h:232
BALL::VIEW::GeometricObjectSelectionMessage
Definition: message.h:516
BALL::VIEW::DockingFinishedMessage::getConformationSet
const ConformationSet * getConformationSet() const
Definition: message.h:866
BALL::String
Definition: string.h:56
BALL::VIEW::Representation
Definition: representation.h:57
BALL::VIEW::GenericSelectionMessage
Definition: message.h:433
BALL::VIEW::TransformationMessage
Definition: message.h:734
BALL::VIEW::SceneMessage::REBUILD_DISPLAY_LISTS
Rebuild the GLDisplayList objects in the GLRenderer.
Definition: message.h:343
BALL::VIEW::GeometricObjectSelectionMessage::isSelected
bool isSelected() const
Query if the GeometricObject are selected or deselected.
Definition: message.h:553
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition: COMMON/global.h:64
BALL::VIEW::CompositeMessage::SELECTED_COMPOSITE
selected a composite (e.g. per checkboxes in MolecularControl)
Definition: message.h:226
BALL::VIEW::Message::data
boost::any & data()
Definition: message.h:115
BALL::VIEW::CompositeMessage::updateRepresentations
bool updateRepresentations() const
Definition: message.h:295
BALL::VIEW::DeselectControlsMessage::DeselectControlsMessage
DeselectControlsMessage()
Definition: message.h:728
BALL::VIEW::SceneMessage::REMOVE_COORDINATE_SYSTEM
Remove the coordinate system in the Scene.
Definition: message.h:352
BALL::VIEW::DatasetMessage::type_
Type type_
Definition: message.h:191
BALL::VIEW::CompositeMessage::composite_name_
String composite_name_
Definition: message.h:312
BALL::VIEW::CompositeMessage::showSelectionInfos
bool showSelectionInfos()
Definition: message.h:303
BALL::VIEW::CompositeMessage
Definition: message.h:200
BALL::VIEW::RegisterHelpSystemMessage::getObject
const QObject * getObject() const
Definition: message.h:827
BALL::VIEW::ShowHelpMessage::url_
String url_
Definition: message.h:798
BALL::VIEW::DatasetMessage::SELECTED
Was selected in Control.
Definition: message.h:158
BALL::VIEW::DatasetMessage::Type
Type
Message type enumeration.
Definition: message.h:143
BALL::VIEW::CompositeMessage::getType
CompositeMessageType getType() const
Definition: message.h:287
BALL::VIEW::ShowHelpMessage::getProject
String getProject() const
Definition: message.h:792
BALL::VIEW::SceneMessage::EXPORT_PNG
Export a PNG.
Definition: message.h:355
BALL::VIEW::DockingFinishedMessage::conformation_set_
const ConformationSet * conformation_set_
this conformation set is deleted in DockResult
Definition: message.h:874
BALL::VIEW::RepresentationMessage::REMOVE
Remove a Representation.
Definition: message.h:583
BALL::VIEW::TransformationMessage::getMatrix
const Matrix4x4 & getMatrix() const
Definition: message.h:750
BALL::VIEW::ShowHelpMessage::getEntry
String getEntry() const
Definition: message.h:794
BALL::VIEW::CreateRepresentationMessage
Definition: message.h:689
BALL::VIEW::RegisterHelpSystemMessage::isRegister
bool isRegister() const
Definition: message.h:833
BALL::VIEW::RegisterHelpSystemMessage::object_
const QObject * object_
Definition: message.h:837
BALL::VIEW::CompositeMessage::composite_
Composite * composite_
Definition: message.h:311
BALL::VIEW::RepresentationMessage::RepresentationMessageType
RepresentationMessageType
Types of RepresentationMessage.
Definition: message.h:574
BALL::VIEW::DatasetMessage::VISUALIZE
Definition: message.h:161
BALL::VIEW::MolecularTaskMessage::BUILD_BONDS
Definition: message.h:649
BALL::VIEW::CompositeMessage::setShowSelectionInfos
void setShowSelectionInfos(bool state)
Definition: message.h:299
stage.h
BALL::VIEW::DatasetMessage::ADD
To add.
Definition: message.h:149
BALL::VIEW::DatasetMessage::dataset_type_
String dataset_type_
Definition: message.h:192
BALL::VIEW::CompositeMessage::REMOVED_COMPOSITE
A Composite to be removed.
Definition: message.h:217
BALL::VIEW::MolecularTaskMessage::MolecularTaskMessageType
MolecularTaskMessageType
Enum for the different molecular tasks.
Definition: message.h:644
BALL::VIEW::SceneMessage::EXPORT_POVRAY
Export a POVRay.
Definition: message.h:358
BALL::VIEW::NewSelectionMessage
Definition: message.h:495
BALL::VIEW::RepresentationMessage::SELECTED
Representation was selected in GeometriControl.
Definition: message.h:589
BALL::VIEW::ShowHelpMessage::project_
String project_
Definition: message.h:799
BALL::VIEW::CreateRepresentationMessage::getComposites
const std::list< Composite * > & getComposites() const
Definition: message.h:703
BALL::VIEW::ShowDisplayPropertiesMessage
Definition: message.h:677
BALL::VIEW::SceneMessage::UPDATE_CAMERA
Move the Camera in the Scene to the value in this message.
Definition: message.h:349
BALL::VIEW::RepresentationMessage::UPDATE
Update the Representation.
Definition: message.h:586
BALL::VIEW::NewSelectionMessage::open_
bool open_
Definition: message.h:509
BALL::VIEW::SceneMessage::ENTER_ROTATE_MODE
Definition: message.h:361
BALL::VIEW::CompositeMessage::NEW_COMPOSITE
Definition: message.h:214
BALL::Composite
Definition: composite.h:71
BALL::VIEW::DatasetMessage
Definition: message.h:137
BALL::VIEW::DatasetMessage::VISUALIZE_END
Allow >90 different kinds of visualization.
Definition: message.h:164
BALL::VIEW::CompositeMessage::CHANGED_COMPOSITE
Update all datas for a Composite (but not in the MolecularControl)
Definition: message.h:220
BALL::VIEW::CompositeMessage::CompositeMessageType
CompositeMessageType
Definition: message.h:206
BALL::VIEW::RepresentationMessage
Base class for all messages concerning a Representation.
Definition: message.h:569
BALL::VIEW::SceneMessage::setStage
void setStage(Stage stage)
Definition: message.h:408
BALL::VIEW::ControlSelectionMessage
Definition: message.h:486
BALL::VIEW::GeometricObjectSelectionMessage::setSelection
void setSelection(const std::list< GeometricObject * > &selection)
Definition: message.h:540
BALL::VIEW::SyncClippingPlanesMessage::SyncClippingPlanesMessage
SyncClippingPlanesMessage()
Definition: message.h:777
BALL::VIEW::CreateRepresentationMessage::getColoringMethod
ColoringMethod getColoringMethod() const
Definition: message.h:711
BALL::VIEW::RegisterHelpSystemMessage::setURL
void setURL(const String &url)
Definition: message.h:821
BALL::VIEW::DatasetMessage::dataset_
Dataset * dataset_
Definition: message.h:190
BALL::VIEW::SceneMessage::getStage
const Stage & getStage() const
Get the Stage in this message.
Definition: message.h:416
BALL::VIEW::DatasetMessage::UNDEFINED
Default Value.
Definition: message.h:146
BALL::VIEW::NewSelectionMessage::setOpenItems
void setOpenItems(bool state)
Definition: message.h:505
BALL::VIEW::CompositeMessage::CHANGED_COMPOSITE_HIERARCHY
Update all datas for a composite (also in MolecularControl)
Definition: message.h:223
BALL::VIEW::SceneMessage::REDRAW
Redraw from the GLDisplayList objects.
Definition: message.h:346
BALL::VIEW::DatasetMessage::REMOVE
To be removed.
Definition: message.h:152
BALL::VIEW::SceneMessage
Definition: message.h:328
BALL::VIEW::RegisterHelpSystemMessage
Definition: message.h:809
BALL::VIEW::DockingFinishedMessage::setConformationSet
void setConformationSet(const ConformationSet *conformation_set)
Definition: message.h:860
BALL::VIEW::RegisterHelpSystemMessage::setObject
void setObject(const QObject *object)
Definition: message.h:818
BALL::VIEW::Message
Definition: message.h:52
BALL::VIEW::SceneMessage::SceneMessageType
SceneMessageType
Types for SceneMessages.
Definition: message.h:337
BALL::VIEW::FinishedSimulationMessage
Definition: message.h:760
common.h
BALL::VIEW::DockingFinishedMessage::abort_
bool abort_
Definition: message.h:875
BALL::VIEW::NewSelectionMessage::openItems
bool openItems()
Open all SelectableListViewItems, if they have a selected child.
Definition: message.h:501
BALL::VIEW::ShowHelpMessage::getURL
String getURL() const
Definition: message.h:790