BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/ParticleView.h
6 //! @brief Defines class ParticleView
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_PARTICLEVIEW_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_PARTICLEVIEW_H
17 
19 #include <QPixmap>
20 
21 //! Class representing view of Particle item
22 class ParticleView : public ConnectableView {
23  Q_OBJECT
24 
25 public:
26  ParticleView(QGraphicsItem* parent = 0);
27 
28  int type() const { return ViewTypes::PARTICLE; }
29 
30  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
31 
32  void onPropertyChange(const QString& propertyName);
33 
34  void addView(IView* childView, int row = 0); // to add Transformation
35 
36 protected:
37  void update_appearance();
38 
39 private:
40  void updatePixmap();
41  void updateToolTip();
42 
43  QPixmap m_pixmap;
44 };
45 
46 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_PARTICLEVIEW_H
Defines class ConnectableView.
view of ISampleNode's with rectangular shape and node functionality
parent class for graphic representation of all ISampleNode's
Definition: IView.h:25
Class representing view of Particle item.
Definition: ParticleView.h:22
void addView(IView *childView, int row=0)
int type() const
Definition: ParticleView.h:28
void updateToolTip()
void updatePixmap()
ParticleView(QGraphicsItem *parent=0)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void update_appearance()
updates visual appearance of the item (color, icons, size etc)
QPixmap m_pixmap
Definition: ParticleView.h:43
void onPropertyChange(const QString &propertyName)
@ PARTICLE
Definition: ViewTypes.h:39