Computer Assited Medical Intervention Tool Kit  version 5.0
CreateSC.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
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 CREATESC_H
27 #define CREATESC_H
28 
29 #include <Action.h>
30 
31 class PMLComponent;
32 
41 class CreateSC : public camitk::Action {
42 
43 public:
46 
48  virtual ~CreateSC() = default;
49 
51  virtual QWidget* getWidget();
52 
54  virtual bool event(QEvent* e);
55 
56 public slots:
59 
60 private:
63 
66  bool computeBoundsOfSelection(PMLComponent* comp, QString selectionName, double bounds[6]);
67 
69  void computeBoundsOfPointIds(PMLComponent* comp, vtkSmartPointer<vtkIdTypeArray> selectedIds, double bounds[6]);
70 
72  void computeBoundsOfCellIds(PMLComponent* comp, vtkSmartPointer<vtkIdTypeArray> selectedIds, double bounds[6]);
73 
74  // merge 1st bounds to 2nd bounds (expand 2nd bounding box if needed)
75  void mergeBounds(double bounds1[6], double bounds2[6]);
76 
79 };
80 
81 #endif // CREATESC_H
camitk::Action::setFamily
void setFamily(QString family)
the name of the family in which this action is associated
Definition: Action.cpp:136
CreateSC::checkEvents
bool checkEvents
if this is initialization time, do not consider any event
Definition: CreateSC.h:78
CreateSC::apply
virtual camitk::Action::ApplyStatus apply()
method applied when the action is called
Definition: CreateSC.cpp:270
CreateSC::updateCorners
void updateCorners(PMLComponent *)
compute and update bound properties (bottom and top corner) considering selection parameters
Definition: CreateSC.cpp:230
StructuralComponent::getNumberOfStructures
unsigned int getNumberOfStructures() const
get the number of structures
Definition: StructuralComponent.h:252
CreateSC
Action to generate MML/Sofa scn from a vtk mesh.
Definition: CreateSC.h:41
Atom
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
PMLComponent::getPhysicalModel
PhysicalModel * getPhysicalModel()
Definition: PMLComponent.cpp:104
camitk::Action::SUCCESS
@ SUCCESS
everything went according to plan
Definition: Action.h:248
CreateSC::~CreateSC
virtual ~CreateSC()=default
the destructor
PhysicalModel::getInformativeComponents
MultiComponent * getInformativeComponents() const
get all the informative components
Definition: PhysicalModel.h:377
CreateSC::computeBoundsOfPointIds
void computeBoundsOfPointIds(PMLComponent *comp, vtkSmartPointer< vtkIdTypeArray > selectedIds, double bounds[6])
compute bounds of a given point selection (list of Point Ids)
Definition: CreateSC.cpp:137
camitk::Action::ApplyStatus
ApplyStatus
Definition: Action.h:247
a
#define a
camitk::Action::setName
void setName(QString name)
Definition: Action.cpp:120
CreateSC::event
virtual bool event(QEvent *e)
intercept signal for dynamic property changed
Definition: CreateSC.cpp:62
camitk::Action::setAutoUpdateProperties
void setAutoUpdateProperties(bool)
are the properties to be udpated every time the user makes a change in the widget (default is false)?
Definition: Action.cpp:426
CreateSC::computeBoundsOfCellIds
void computeBoundsOfCellIds(PMLComponent *comp, vtkSmartPointer< vtkIdTypeArray > selectedIds, double bounds[6])
compute bounds of a given cell selection (list of cell Ids)
Definition: CreateSC.cpp:167
PhysicalModel::getAtom
Atom * getAtom(const unsigned int id)
Get the atom that has the global index given in parameters.
Definition: PhysicalModel.h:385
Structure::getIndex
unsigned int getIndex() const
get the structure unique index (stored in its property)
Definition: Structure.cpp:30
camitk::Action::setComponent
void setComponent(QString component)
the name of the component class that can be used by this action
Definition: Action.cpp:131
camitk::Component::setModified
virtual void setModified(bool modified=true)
set the modified flag
Definition: sdk/libraries/core/component/Component.h:943
camitk::Action::getTargets
const ComponentList getTargets() const
the currently selected and valid (regarding the component property) components, for which this action...
Definition: Action.cpp:166
camitk::Action::getName
QString getName() const
get the name of the action
Definition: Action.h:338
Action.h
StructuralComponent
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
StructuralComponent::addStructure
void addStructure(Structure *s, bool check=true)
Add a Structure in the list (and tells the structure to add this structural component in its list).
Definition: StructuralComponent.h:212
camitk::Action::addTag
void addTag(QString tag)
add a tag to the tags list of this action
Definition: Action.cpp:141
Log.h
CreateSC::mergeBounds
void mergeBounds(double bounds1[6], double bounds2[6])
Definition: CreateSC.cpp:185
PhysicalModel
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
camitk::Action
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
PMLComponent::init
void init()
initialize information (properties) and geometric representation from the physical model
Definition: PMLComponent.cpp:109
Cell
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
CreateSC.h
Component::getName
const std::string getName() const
get the name of the component
Definition: modeling/libraries/pml/Component.h:147
camitk::MeshComponent::getSelection
vtkSmartPointer< vtkSelectionNode > getSelection(const QString &name) const
Get a selection from its name.
Definition: MeshComponent.cpp:478
PhysicalModel::getComponentByName
Component * getComponentByName(const std::string n)
get a structural or multi component by its name.
Definition: PhysicalModel.cpp:553
PMLComponent
This class manages a physical model (PML) CamiTK component.
Definition: PMLComponent.h:103
CreateSC::getWidget
virtual QWidget * getWidget()
use the default widget (but update the values)
Definition: CreateSC.cpp:85
camitk::Action::setDescription
void setDescription(QString description)
the description of the action
Definition: Action.cpp:126
MultiComponent::addSubComponent
void addSubComponent(Component *)
add a component in the list of subcomponents (and set the isExclusive flag accordingly to the state o...
Definition: MultiComponent.h:122
CreateSC::CreateSC
CreateSC(camitk::ActionExtension *)
the constructor
Definition: CreateSC.cpp:40
StructuralComponent::getStructure
Structure * getStructure(const unsigned int) const
get a structure by its index (fisrt structure is at index 0)
Definition: StructuralComponent.h:220
camitk::Component::getBounds
void getBounds(double *bounds) override
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax], see Component....
Definition: sdk/libraries/core/component/Component.cpp:671
camitk::ActionExtension
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:80
PhysicalModel.h
CAMITK_TRACE
#define CAMITK_TRACE(MSG)
Log for trace verbosity (the most verbose one, should be used for bug report) The msg will appear onl...
Definition: Log.h:256
PhysicalModel::getCell
Cell * getCell(const unsigned int id)
get the cell that has the global index given in parameters.
Definition: PhysicalModel.h:405
StructureProperties::POLY_VERTEX
@ POLY_VERTEX
the structure is a poly vertex, i.e it must be a cell and it is a point clouds
Definition: StructureProperties.h:164
PhysicalModel::getAtoms
StructuralComponent * getAtoms() const
get all the atoms
Definition: PhysicalModel.h:380
MultiComponent.h
PhysicalModel::setInformativeComponents
void setInformativeComponents(MultiComponent *)
set the exclusive multi component. Becareful: the physical model takes control of this MultiComponent
Definition: PhysicalModel.cpp:686
camitk::refresh
void refresh()
refresh the display
PMLComponent.h
MultiComponent
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
StructuralComponent::addStructureIfNotIn
bool addStructureIfNotIn(Structure *s)
Add a Structure in the list, only if it is not already in (and in this case tells the structure to ad...
Definition: StructuralComponent.cpp:248
Application.h
CreateSC::computeBoundsOfSelection
bool computeBoundsOfSelection(PMLComponent *comp, QString selectionName, double bounds[6])
compute the bounds of a named selection
Definition: CreateSC.cpp:201
camitk
Definition: Action.cpp:35