VPTissue Reference Manual
TissueSlicer.h
Go to the documentation of this file.
1 #ifndef SIMPT_EDITOR_TISSUE_SLICER_H_INCLUDED
2 #define SIMPT_EDITOR_TISSUE_SLICER_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/EditControlLogic.h"
23 
24 #include "slicer/SliceItem.h"
25 #include <QGraphicsLineItem>
26 #include <QGraphicsScene>
27 #include <QObject>
28 
29 namespace SimPT_Editor {
30 
34 class TissueSlicer : public QObject
35 {
36  Q_OBJECT
37 public:
44  TissueSlicer(std::shared_ptr<EditControlLogic> tissue, QGraphicsScene* scene);
45 
49  virtual ~TissueSlicer();
50 
56  void StartCut(const QPointF& point);
57 
63  void EndCut();
64 
71  bool MoveCut(const QPointF& point);
72 
78  bool CutEnded() const;
79 
80 signals:
85  void Finished();
86 
87 private slots:
91  void Finish();
92 
93 private:
94  std::shared_ptr<EditControlLogic> m_tissue;
95  QGraphicsScene* m_scene;
96  QGraphicsLineItem* m_cut;
97  std::list<SliceItem*> m_slices;
98 };
99 
100 } // namespace
101 
102 #endif // end_of_include_guard
Namespace for SimPT tissue editor package.
Definition: Cell.h:32
bool CutEnded() const
Checks whether the cut-action has ended.
see the online Qt documentation
bool MoveCut(const QPointF &point)
This procedure is for dynamically moving the line in the canvas (the first point is fixed)...
Functionality and visual representation of slicing a cell complex.
Definition: TissueSlicer.h:34
void EndCut()
End the cut procedure by putting a second point for the cut.
void Finished()
Emitted when the slicing has finished.
virtual ~TissueSlicer()
Destructor.
void StartCut(const QPointF &point)
Start the cut procedure by putting a starting point for the cut.
TissueSlicer(std::shared_ptr< EditControlLogic > tissue, QGraphicsScene *scene)
Constructor.
see the online Qt documentation
Interface for SliceItem.