VPTissue Reference Manual
EditableNodeItem.h
Go to the documentation of this file.
1 #ifndef SIMPT_EDITOR_EDITABLE_NODE_ITEM_H_INCLUDED
2 #define SIMPT_EDITOR_EDITABLE_NODE_ITEM_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "editor/EditableItem.h"
23 #include "bio/Node.h"
24 
25 #include <QGraphicsEllipseItem>
26 #include <QGraphicsScene>
27 
28 namespace SimPT_Sim {
29  class Cell;
30  class Wall;
31 }
32 
33 namespace SimPT_Editor {
34 
35 using namespace SimPT_Sim;
36 
41 {
42  Q_OBJECT
43 public:
50  EditableNodeItem(SimPT_Sim::Node* node, double radius);
51 
55  virtual ~EditableNodeItem();
56 
60  virtual bool IsAtBoundary() const;
61 
68  bool Contains(SimPT_Sim::Node* node) const;
69 
75  virtual void Highlight(bool highlighted);
76 
82  virtual void SetHighlightColor(const QColor& color = DEFAULT_HIGHLIGHT_COLOR);
83 
90  void SetToolTip(std::list<SimPT_Sim::Cell*> cells, std::list<SimPT_Sim::Wall*> walls);
91 
97  SimPT_Sim::Node* Node() const;
98 
102  void Revert();
103 
104 signals:
108  void Moved();
109 
110 public slots:
114  void Update();
115 
116 private:
125  virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
126 
130  virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
131 
132 private:
133  SimPT_Sim::Node* m_node;
134 
135  QColor m_highlight_color;
136  QPointF m_prev_pos;
137  double m_radius;
138 
139 private:
140  static const QColor DEFAULT_HIGHLIGHT_COLOR;
141 };
142 
143 } // namespace
144 
145 #endif // end_of_include_guard
Interface for an editable graphical representation.
Definition: EditableItem.h:30
Namespace for SimPT tissue editor package.
Definition: Cell.h:32
Node in cell wall.
Definition: Node.h:39
see the online Qt documentation
Namespace for the core simulator.
Editable graphical representation for Node.
Interface for Node.
Interface for EditableItem.
see the online Qt documentation