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
10#endif
11
12#ifndef BALL_VIEW_KERNEL_COMMON_H
14#endif
15
16#include <boost/any.hpp>
17
18class QWidget;
19
20namespace 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
66
69 Message(const Message& message);
70
73 virtual ~Message();
74
76
79
85 void setSender(const ConnectionObject* sender);
86
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 {
147
149 ADD = 0,
150
153
156
159
162
164 VISUALIZE_END = 100
165 };
166
169
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
256
259
261
264
267 void setComposite(const Composite& composite);
268
272
276 void setCompositeName(const String& name);
277
280 const String& getCompositeName() const;
281
284 { type_ = type;}
285
288 { return type_;}
289
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
385
388 SceneMessage(const SceneMessage& message);
389
392 virtual ~SceneMessage();
393
395
398
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
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
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
566class 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
609
612
615 {representation_ = &rep;}
616
619 {return representation_;}
620
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
660
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
841};
842
843
844
847 :public Message
848{
849 public:
852
855
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
Definition: constants.h:13
void setDeletable(bool flag=true)
void setSender(const ConnectionObject *sender)
const ConnectionObject * getSender() const
Message(const Message &message)
bool isDeletable() const
boost::any & data()
Definition: message.h:115
DatasetMessage(Dataset *set=0, Type type=UNDEFINED)
void setDataset(Dataset *set)
Definition: message.h:183
Type
Message type enumeration.
Definition: message.h:144
@ SELECTED
Was selected in Control.
Definition: message.h:158
@ REMOVE
To be removed.
Definition: message.h:152
@ VISUALIZE_END
Allow >90 different kinds of visualization.
Definition: message.h:164
@ UNDEFINED
Default Value.
Definition: message.h:146
Type getType() const
Definition: message.h:174
void setType(Type type)
Definition: message.h:177
DatasetMessage(const DatasetMessage &msg)
Dataset * getDataset() const
Definition: message.h:180
void setType(CompositeMessageType type)
Definition: message.h:283
CompositeMessage(const CompositeMessage &message)
Copy constructor.
void setUpdateRepresentations(bool state)
Definition: message.h:291
virtual ~CompositeMessage()
Destructor.
CompositeMessageType getType() const
Definition: message.h:287
const String & getCompositeName() const
bool updateRepresentations() const
Definition: message.h:295
Composite * getComposite() const
void setShowSelectionInfos(bool state)
Definition: message.h:299
CompositeMessageType type_
Definition: message.h:310
void setComposite(const Composite &composite)
CompositeMessage(const Composite &composite, CompositeMessageType type, bool update_representations=true)
void setCompositeName(const String &name)
@ CHANGED_COMPOSITE
Update all datas for a Composite (but not in the MolecularControl)
Definition: message.h:220
@ CENTER_CAMERA
center the camera on a composite
Definition: message.h:232
@ SELECTED_COMPOSITE
selected a composite (e.g. per checkboxes in MolecularControl)
Definition: message.h:226
@ DESELECTED_COMPOSITE
deselected a composite (e.g. per checkboxes in MolecularControl)
Definition: message.h:229
@ REMOVED_COMPOSITE
A Composite to be removed.
Definition: message.h:217
@ CHANGED_COMPOSITE_HIERARCHY
Update all datas for a composite (also in MolecularControl)
Definition: message.h:223
void setStage(Stage stage)
Definition: message.h:408
SceneMessageType
Types for SceneMessages.
Definition: message.h:338
@ UPDATE_CAMERA
Move the Camera in the Scene to the value in this message.
Definition: message.h:349
@ EXPORT_PNG
Export a PNG.
Definition: message.h:355
@ EXPORT_POVRAY
Export a POVRay.
Definition: message.h:358
@ REBUILD_DISPLAY_LISTS
Rebuild the GLDisplayList objects in the GLRenderer.
Definition: message.h:343
@ REMOVE_COORDINATE_SYSTEM
Remove the coordinate system in the Scene.
Definition: message.h:352
@ REDRAW
Redraw from the GLDisplayList objects.
Definition: message.h:346
@ ENTER_MOVE_MODE
Move Composites or a Clipping Plane.
Definition: message.h:367
void setType(SceneMessageType type)
Set the type of the Message.
SceneMessageType getType() const
Get the type of the message.
Definition: message.h:403
const Stage & getStage() const
Get the Stage in this message.
Definition: message.h:416
SceneMessage(SceneMessageType type=UNDEFINED)
SceneMessage(const SceneMessage &message)
Stage & getStage()
Get the Stage in this message.
Definition: message.h:412
std::list< Composite * > & getSelection()
const std::list< Composite * > & getSelection() const
GenericSelectionMessage(const GenericSelectionMessage &message)
void setSelection(const std::list< Composite * > &selection)
bool openItems()
Open all SelectableListViewItems, if they have a selected child.
Definition: message.h:501
void setOpenItems(bool state)
Definition: message.h:505
void setSelection(const std::list< GeometricObject * > &selection)
Definition: message.h:540
bool isSelected() const
Query if the GeometricObject are selected or deselected.
Definition: message.h:553
void setSelected(bool state)
Set the GeometricObject's to be selected or deselected.
Definition: message.h:549
const std::list< GeometricObject * > & getSelection() const
Definition: message.h:545
Base class for all messages concerning a Representation.
Definition: message.h:570
RepresentationMessageType
Types of RepresentationMessage.
Definition: message.h:575
@ ADD_TO_GEOMETRIC_CONTROL
Add a Representation to GeometricControl, but don't update in Scene.
Definition: message.h:598
@ UPDATE
Update the Representation.
Definition: message.h:586
@ FINISHED_UPDATE
Finished the update of a Representation.
Definition: message.h:595
@ REMOVE
Remove a Representation.
Definition: message.h:583
@ SELECTED
Representation was selected in GeometriControl.
Definition: message.h:589
@ STARTED_UPDATE
Started the update of a Representation, no changes allowed in GeometricControl.
Definition: message.h:592
Representation * getRepresentation()
Definition: message.h:618
RepresentationMessageType getType() const
Definition: message.h:625
void setType(RepresentationMessageType type)
RepresentationMessage(Representation &rep, RepresentationMessageType type)
void setRepresentation(Representation &rep)
Definition: message.h:614
MolecularTaskMessageType
Enum for the different molecular tasks.
Definition: message.h:645
MolecularTaskMessageType getType() const
Definition: message.h:665
MolecularTaskMessageType type_
Definition: message.h:670
MolecularTaskMessage(MolecularTaskMessageType type=UNDEFINED)
void setType(MolecularTaskMessageType type)
ColoringMethod getColoringMethod() const
Definition: message.h:711
CreateRepresentationMessage(const std::list< Composite * > &composites, ModelType model_type, ColoringMethod coloring_method)
const std::list< Composite * > & getComposites() const
Definition: message.h:703
void setMatrix(const Matrix4x4 &m)
Definition: message.h:746
TransformationMessage(const Matrix4x4 &m)
const Matrix4x4 & getMatrix() const
Definition: message.h:750
String getURL() const
Definition: message.h:790
String getEntry() const
Definition: message.h:794
ShowHelpMessage(String url="", String project="BALLView", String entry="")
String getProject() const
Definition: message.h:792
void setURL(const String &url)
Definition: message.h:821
const String & getURL() const
Definition: message.h:830
void setObject(const QObject *object)
Definition: message.h:818
const QObject * getObject() const
Definition: message.h:827
Message to notify docking has finished.
Definition: message.h:848
void setConformationSet(const ConformationSet *conformation_set)
Definition: message.h:860
const ConformationSet * getConformationSet() const
Definition: message.h:866
const ConformationSet * conformation_set_
this conformation set is deleted in DockResult
Definition: message.h:874
#define BALL_DEPRECATED
Definition: COMMON/global.h:64
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52