Computer Assited Medical Intervention Tool Kit  version 4.0
MeshClipping.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2016 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef MESH_CLIPPING_H
27 #define MESH_CLIPPING_H
28 
29 //-- Specific action stuffs
30 #include "PlaneWidget.h"
31 
32 //-- Core stuffs
33 #include <Action.h>
34 #include <MeshComponent.h>
35 
36 // VTK stuffs
37 #include <vtkSmartPointer.h>
38 #include <vtkPlane.h>
39 
60 class MeshClipping : public camitk::Action {
61  Q_OBJECT
62 
63 public:
66 
68  virtual ~MeshClipping();
69 
71  virtual QWidget *getWidget();
72 
73 public slots:
75  virtual ApplyStatus apply();
76 
78  virtual void meshDeleted();
79 private:
83  void customizeActionLayout();
84 
86  void clipMesh(camitk::MeshComponent *mesh, vtkSmartPointer<vtkPlane> plane);
87 
90 
93 
95  bool smoothing;
96 
99 
102 
104  bool save;
105 
107  double limBounds[6];
108 
109 private slots:
110 
114  void updateBox();
115 
117  void restoreMeshes();
118 
120  void changeAllComponents();
121 
123  void changeSmoothing();
124 
126  void changeVisibility();
127 
129  void saveClippedMeshes();
130 
131 private:
134  void updateBox(bool refreshViewer);
135 
136 };
137 
138 #endif // MESH_CLIPPING_H
void saveClippedMeshes()
Method called when the saving button is clicked.
Definition: MeshClipping.cpp:391
camitk::ComponentList list
List of MeshComponent that are currently targeted by the clipping.
Definition: MeshClipping.h:89
void clipMesh(camitk::MeshComponent *mesh, vtkSmartPointer< vtkPlane > plane)
Clips the mesh throughout the plane specified.
Definition: MeshClipping.cpp:257
bool allComponents
Controls which components are clipped : all opened components or only selected components.
Definition: MeshClipping.h:98
Action class is an abstract class that enables you to build a action (generally on a component)...
Definition: Action.h:208
void changeSmoothing()
Method called when the smooth button is clicked.
Definition: MeshClipping.cpp:358
void updateBox()
Method called when the update button is clicked re-calculates the widget box size when new components...
Definition: MeshClipping.cpp:212
This action allows the user to clip several kinds of MeshComponents : vtkStructuredGridClip, vtkUnstructuredGridClip, vtkPolyData.
Definition: MeshClipping.h:60
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:51
bool planeVisibility
Controls the clipping widget visibility.
Definition: MeshClipping.h:101
void changeVisibility()
Method called when the visibility button is clicked.
Definition: MeshClipping.cpp:345
void restoreMeshes()
Method called when the restore button is clicked.
Definition: MeshClipping.cpp:335
virtual void meshDeleted()
specific slot called when the mesh currently clipped is deleted
Definition: MeshClipping.cpp:165
CAMITK_API QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:86
This class describes what is a generic Action extension.
Definition: ActionExtension.h:61
bool smoothing
Controls smooth or chiselled (raw) clipping.
Definition: MeshClipping.h:95
This class implements a VTK implicit plane in the CamiTK application.
Definition: PlaneWidget.h:44
double limBounds[6]
Contains the clipping widget bounding box [xmin, xmax, ymin, ymax, zmin, zmax].
Definition: MeshClipping.h:107
void customizeActionLayout()
Customizes the action viewer.
Definition: MeshClipping.cpp:170
ApplyStatus
describes what happened during the application of an algorithm (i.e. results of the apply method) ...
Definition: Action.h:220
virtual QWidget * getWidget()
Method called when the action when the action is triggered (i.e. started).
Definition: MeshClipping.cpp:80
virtual ApplyStatus apply()
Method called when the action is applied.
Definition: MeshClipping.cpp:133
bool save
Controls the saving of the clipped component.
Definition: MeshClipping.h:104
void changeAllComponents()
Method called when the clip all components button is clicked.
Definition: MeshClipping.cpp:373
PlaneWidget * widget
Class which contains the widget (implements vtkCommand).
Definition: MeshClipping.h:92
MeshClipping(camitk::ActionExtension *)
The constructor.
Definition: MeshClipping.cpp:53
virtual ~MeshClipping()
The destructor.
Definition: MeshClipping.cpp:75