00001
00002
00003
00004
00005 #ifndef BALL_VIEW_KERNEL_MESSAGE_H
00006 #define BALL_VIEW_KERNEL_MESSAGE_H
00007
00008 #ifndef BALL_VIEW_KERNEL_STAGE_H
00009 # include <BALL/VIEW/KERNEL/stage.h>
00010 #endif
00011
00012 #ifndef BALL_VIEW_KERNEL_COMMON_H
00013 # include <BALL/VIEW/KERNEL/common.h>
00014 #endif
00015
00016 #include <boost/any.hpp>
00017
00018 class QWidget;
00019
00020 namespace BALL
00021 {
00022 class Composite;
00023 class ConformationSet;
00024
00025 namespace VIEW
00026 {
00027 class Dataset;
00028 class ConnectionObject;
00029 class GeometricObject;
00030
00033
00052 class BALL_VIEW_EXPORT Message
00053 {
00054 public:
00055
00059
00065 Message();
00066
00069 Message(const Message& message);
00070
00073 virtual ~Message();
00074
00076
00079
00085 void setSender(const ConnectionObject* sender);
00086
00092 const ConnectionObject* getSender() const;
00093
00105 void setDeletable(bool flag = true);
00106
00109 bool isDeletable() const;
00110
00115 boost::any& data() { return data_; }
00117
00118 private:
00119
00120 const ConnectionObject* connection_object_;
00121
00122 bool deletable_;
00123
00124 boost::any data_;
00125 };
00126
00127
00137 class DatasetMessage
00138 : public Message
00139 {
00140 public:
00141
00143 enum Type
00144 {
00146 UNDEFINED = -1,
00147
00149 ADD = 0,
00150
00152 REMOVE,
00153
00155 UPDATE,
00156
00158 SELECTED,
00159
00161 VISUALIZE,
00162
00164 VISUALIZE_END = 100
00165 };
00166
00168 DatasetMessage(Dataset* set = 0, Type type = UNDEFINED);
00169
00171 DatasetMessage(const DatasetMessage& msg);
00172
00174 Type getType() const { return type_;}
00175
00177 void setType(Type type) { type_ = type;}
00178
00180 Dataset* getDataset() const { return dataset_;}
00181
00183 void setDataset(Dataset* set) { dataset_ = set;}
00184
00186 bool isValid() const;
00187
00188 protected:
00189
00190 Dataset* dataset_;
00191 Type type_;
00192 String dataset_type_;
00193 };
00194
00195
00196
00200 class BALL_VIEW_EXPORT CompositeMessage
00201 : public Message
00202 {
00203 public:
00204
00206 enum CompositeMessageType
00207 {
00209 UNDEFINED = -1,
00210
00214 NEW_COMPOSITE,
00215
00217 REMOVED_COMPOSITE,
00218
00220 CHANGED_COMPOSITE,
00221
00223 CHANGED_COMPOSITE_HIERARCHY,
00224
00226 SELECTED_COMPOSITE,
00227
00229 DESELECTED_COMPOSITE,
00230
00232 CENTER_CAMERA,
00233
00237 NEW_MOLECULE
00238 };
00239
00243
00249 CompositeMessage();
00250
00252 CompositeMessage(const Composite& composite, CompositeMessageType type, bool update_representations = true);
00253
00255 CompositeMessage(const CompositeMessage& message);
00256
00258 virtual ~CompositeMessage();
00259
00261
00264
00267 void setComposite(const Composite& composite);
00268
00271 Composite* getComposite() const;
00272
00276 void setCompositeName(const String& name);
00277
00280 const String& getCompositeName() const;
00281
00283 void setType(CompositeMessageType type)
00284 { type_ = type;}
00285
00287 CompositeMessageType getType() const
00288 { return type_;}
00289
00291 void setUpdateRepresentations(bool state)
00292 { update_representations_ = state;}
00293
00295 bool updateRepresentations() const
00296 { return update_representations_;}
00297
00299 void setShowSelectionInfos(bool state)
00300 { show_selection_infos_ = state;}
00301
00303 bool showSelectionInfos()
00304 { return show_selection_infos_;}
00305
00307
00308 protected:
00309
00310 CompositeMessageType type_;
00311 Composite* composite_;
00312 String composite_name_;
00313 bool update_representations_;
00314 bool show_selection_infos_;
00315 };
00316
00317
00328 class BALL_VIEW_EXPORT SceneMessage: public Message
00329 {
00330 public:
00331
00335
00337 enum SceneMessageType
00338 {
00340 UNDEFINED = 0,
00341
00343 REBUILD_DISPLAY_LISTS,
00344
00346 REDRAW,
00347
00349 UPDATE_CAMERA,
00350
00352 REMOVE_COORDINATE_SYSTEM,
00353
00355 EXPORT_PNG,
00356
00358 EXPORT_POVRAY,
00359
00361 ENTER_ROTATE_MODE,
00362
00364 ENTER_PICKING_MODE,
00365
00367 ENTER_MOVE_MODE,
00368
00370 EXPORT_FINISHED
00371 };
00372
00374
00377
00384 SceneMessage(SceneMessageType type = UNDEFINED);
00385
00388 SceneMessage(const SceneMessage& message);
00389
00392 virtual ~SceneMessage();
00393
00395
00398
00400 void setType(SceneMessageType type);
00401
00403 SceneMessageType getType() const
00404 { return type_;}
00405
00408 void setStage(Stage stage)
00409 { stage_ = stage;}
00410
00412 Stage& getStage()
00413 { return stage_;}
00414
00416 const Stage& getStage() const
00417 { return stage_;}
00418
00420
00421 private:
00422
00423 SceneMessageType type_;
00424 Stage stage_;
00425 };
00426
00427
00433 class BALL_VIEW_EXPORT GenericSelectionMessage: public Message
00434 {
00435 public:
00436
00440
00445 GenericSelectionMessage();
00446
00449 GenericSelectionMessage(const GenericSelectionMessage& message);
00450
00453 virtual ~GenericSelectionMessage();
00454
00456
00459
00463 void setSelection(const std::list<Composite*>& selection);
00464
00467 const std::list<Composite*>& getSelection() const;
00468
00471 std::list<Composite*>& getSelection();
00472
00474
00475 private:
00476
00477 std::list<Composite*> selection_;
00478 };
00479
00480
00486 class BALL_VIEW_EXPORT ControlSelectionMessage: public GenericSelectionMessage
00487 {
00488 public:
00489 ControlSelectionMessage();
00490 };
00491
00492
00495 class BALL_VIEW_EXPORT NewSelectionMessage: public Message
00496 {
00497 public:
00498 NewSelectionMessage();
00499
00501 bool openItems()
00502 { return open_;}
00503
00505 void setOpenItems(bool state)
00506 { open_ = state;}
00507
00508 protected:
00509 bool open_;
00510 };
00511
00516 class BALL_VIEW_EXPORT GeometricObjectSelectionMessage: public Message
00517 {
00518 public:
00519
00523
00526 GeometricObjectSelectionMessage();
00527
00530 virtual ~GeometricObjectSelectionMessage();
00531
00533
00536
00540 void setSelection(const std::list<GeometricObject*>& selection)
00541 { selection_ = selection;}
00542
00545 const std::list<GeometricObject*>& getSelection() const
00546 { return selection_;}
00547
00549 void setSelected(bool state)
00550 { state_ = state;}
00551
00553 bool isSelected() const
00554 { return state_;}
00555
00557
00558 private:
00559
00560 std::list<GeometricObject*> selection_;
00561
00562 bool state_;
00563 };
00564
00565
00566 class Representation;
00567
00569 class BALL_VIEW_EXPORT RepresentationMessage: public Message
00570 {
00571 public:
00572
00574 enum RepresentationMessageType
00575 {
00577 UNDEFINED = -1,
00578
00580 ADD = 0,
00581
00583 REMOVE,
00584
00586 UPDATE,
00587
00589 SELECTED,
00590
00592 STARTED_UPDATE,
00593
00595 FINISHED_UPDATE,
00596
00598 ADD_TO_GEOMETRIC_CONTROL
00599 };
00600
00602 RepresentationMessage();
00603
00605 virtual ~RepresentationMessage();
00606
00608 RepresentationMessage(Representation& rep, RepresentationMessageType type);
00609
00611 void setRepresentation(Representation& rep)
00612 {representation_ = &rep;}
00613
00615 Representation* getRepresentation()
00616 {return representation_;}
00617
00619 void setType(RepresentationMessageType type);
00620
00622 RepresentationMessageType getType() const
00623 { return type_;}
00624
00625 private:
00626
00627 Representation* representation_;
00628 RepresentationMessageType type_;
00629 };
00630
00631
00635 class BALL_VIEW_EXPORT MolecularTaskMessage
00636 : public Message
00637 {
00638 public:
00639
00641 enum MolecularTaskMessageType
00642 {
00644 UNDEFINED = -1,
00646 BUILD_BONDS,
00648 CHECK_RESIDUE,
00650 ADD_HYDROGENS,
00652 CREATE_DISTANCE_GRID
00653 };
00654
00656 MolecularTaskMessage(MolecularTaskMessageType type = UNDEFINED);
00657
00659 void setType(MolecularTaskMessageType type);
00660
00662 MolecularTaskMessageType getType() const
00663 {return type_;}
00664
00665 protected:
00666
00667 MolecularTaskMessageType type_;
00668 };
00669
00670
00674 class BALL_VIEW_EXPORT ShowDisplayPropertiesMessage
00675 :public Message
00676 {
00677 public:
00679 ShowDisplayPropertiesMessage()
00680 : Message(){};
00681 };
00682
00686 class BALL_VIEW_EXPORT CreateRepresentationMessage
00687 :public Message
00688 {
00689 public:
00691 CreateRepresentationMessage();
00692
00694 CreateRepresentationMessage(const std::list<Composite*>& composites,
00695 ModelType model_type,
00696 ColoringMethod coloring_method)
00697 ;
00698
00700 const std::list<Composite*>& getComposites() const
00701 { return composites_;}
00702
00704 ModelType getModelType() const
00705 { return model_type_;}
00706
00708 ColoringMethod getColoringMethod() const
00709 { return coloring_method_;}
00710
00711 private:
00712 std::list<Composite*> composites_;
00713 ModelType model_type_;
00714 ColoringMethod coloring_method_;
00715 };
00716
00717
00721 class BALL_VIEW_EXPORT DeselectControlsMessage
00722 : public Message
00723 {
00724 public:
00725 DeselectControlsMessage()
00726 : Message() {};
00727 };
00728
00729
00731 class BALL_VIEW_EXPORT TransformationMessage
00732 : public Message
00733 {
00734 public:
00735
00737 TransformationMessage();
00738
00740 TransformationMessage(const Matrix4x4& m);
00741
00743 void setMatrix(const Matrix4x4& m)
00744 { matrix_ = m;}
00745
00747 const Matrix4x4& getMatrix() const
00748 { return matrix_;}
00749
00750 private:
00751
00752 Matrix4x4 matrix_;
00753 };
00754
00755
00757 class BALL_VIEW_EXPORT FinishedSimulationMessage
00758 : public Message
00759 {
00760 public:
00761
00763 FinishedSimulationMessage();
00764 };
00765
00766
00768 class BALL_VIEW_EXPORT SyncClippingPlanesMessage
00769 : public Message
00770 {
00771 public:
00772
00774 SyncClippingPlanesMessage(){};
00775 };
00776
00777
00779 class BALL_VIEW_EXPORT ShowHelpMessage
00780 : public Message
00781 {
00782 public:
00783
00785 ShowHelpMessage(String url = "", String project = "BALLView", String entry = "");
00786
00787 String getURL() const { return url_;}
00788
00789 String getProject() const { return project_;}
00790
00791 String getEntry() const { return entry_;}
00792
00793 protected:
00794
00795 String url_;
00796 String project_;
00797 String entry_;
00798 };
00799
00800
00805 class BALL_VIEW_EXPORT RegisterHelpSystemMessage
00806 : public Message
00807 {
00808 public:
00809
00811 RegisterHelpSystemMessage();
00812
00814 void setObject(const QObject* object) { object_ = object;}
00815
00817 void setURL(const String& url) { url_ = url;}
00818
00820 void setRegisterMode(bool state) { register_ = state;}
00821
00823 const QObject* getObject() const { return object_;}
00824
00826 const String& getURL() const { return url_;}
00827
00829 bool isRegister() const { return register_;}
00830
00831 protected:
00832
00833 const QObject* object_;
00834 Index menu_entry_;
00835 String url_;
00836 bool register_;
00837 };
00838
00839
00840
00842 class BALL_VIEW_EXPORT DockingFinishedMessage
00843 :public Message
00844 {
00845 public:
00847 DockingFinishedMessage();
00848
00850 DockingFinishedMessage(bool abort);
00851
00853 virtual ~DockingFinishedMessage();
00854
00856 void setConformationSet(const ConformationSet* conformation_set)
00857 {
00858 conformation_set_ = conformation_set;
00859 }
00860
00861
00862 const ConformationSet* getConformationSet() const { return conformation_set_; }
00863
00865 bool wasAborted() { return abort_; }
00866
00867 protected:
00868
00870 const ConformationSet* conformation_set_;
00871 bool abort_;
00872 };
00873
00875
00876 # ifndef BALL_NO_INLINE_FUNCTIONS
00877 # include <BALL/VIEW/KERNEL/message.iC>
00878 # endif
00879
00880 } }
00881
00882 #endif // BALL_VIEW_KERNEL_MESSAGE_H