VPTissue Reference Manual
SliceItem.h
Go to the documentation of this file.
1 #ifndef SIMPT_EDITOR_SLICE_ITEM_H_INCLUDED
2 #define SIMPT_EDITOR_SLICE_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  */
23 
24 #include <QGraphicsPolygonItem>
25 #include <QGraphicsScene>
26 #include <QObject>
27 
28 namespace SimPT_Editor {
29 
33 class SliceItem : public QObject, public QGraphicsPolygonItem
34 {
35  Q_OBJECT
36 public:
38  SliceItem(const QPolygonF& polygon, const QLineF& cut, std::shared_ptr<EditControlLogic> tissue, QGraphicsScene* scene);
39 
41  virtual ~SliceItem();
42 
43 signals:
44  void Truncated();
45 
46 private:
47  virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
48 
49  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
50 
51  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
52 
53  void TruncateLeaf();
54 
55 private:
56  QLineF m_cut;
57  std::shared_ptr<EditControlLogic> m_tissue;
58  QGraphicsScene* m_scene;
59 private:
60  static constexpr double g_accuracy = 1.0e-12;
61 };
62 
63 } // namespace
64 
65 #endif // end_of_include_guard
Represents a slice of a cell complex.
Definition: SliceItem.h:33
Namespace for SimPT tissue editor package.
Definition: Cell.h:32
see the online Qt documentation
SliceItem(const QPolygonF &polygon, const QLineF &cut, std::shared_ptr< EditControlLogic > tissue, QGraphicsScene *scene)
Constructor.
Definition: SliceItem.cpp:41
virtual ~SliceItem()
Destructor.
Definition: SliceItem.cpp:50
see the online Qt documentation
Interface for LeafControlLogic.