Computer Assited Medical Intervention Tool Kit  version 5.0
TargetList.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 TARGETLIST_H
27 #define TARGETLIST_H
28 
29 #include <vector>
30 #include <string>
31 
45 class TargetList {
46 
47 public:
49  TargetList() = default;
50 
55  TargetList(const std::string);
56 
58  TargetList(const TargetList&);
59 
61  void add(const unsigned int);
62 
64  void add(const std::string);
65 
67  unsigned int getNumberOfTargets() const;
68 
72  int getIndexedTarget(const unsigned int) const;
73 
77  std::string getNamedTarget(const unsigned int) const;
78 
80  void clear();
81 
83  std::string toString() const;
84 
86  std::string toAnsys() const;
87 
89  bool indexedTargets() const;
90 
94  bool isIn(unsigned int) const;
95 
96 private:
98  std::vector <unsigned int> indexedTargetList;
99 
101  std::vector <std::string> namedTargetList;
102 };
103 
104 #endif
TargetList::namedTargetList
std::vector< std::string > namedTargetList
list of named target = name of the entities
Definition: TargetList.h:124
TargetList::clear
void clear()
clear the list
Definition: TargetList.cpp:162
TargetList::toString
std::string toString() const
return the list in a handy/compact format (compact interval, i.e. 4,5,6 becomes 4-6,...
Definition: TargetList.cpp:168
isDigit
#define isDigit(c)
Definition: TargetList.cpp:46
TargetList.h
TargetList::add
void add(const unsigned int)
add a load using an integer
Definition: TargetList.cpp:39
TargetList::getIndexedTarget
int getIndexedTarget(const unsigned int) const
get an indexed target
Definition: TargetList.cpp:142
TargetList::indexedTargets
bool indexedTargets() const
return true only if the list of target are indexes
Definition: TargetList.cpp:265
TargetList::indexedTargetList
std::vector< unsigned int > indexedTargetList
list of indexed target = index of the entities
Definition: TargetList.h:121
TargetList::toAnsys
std::string toAnsys() const
return the ANSYS command to select the list of target (only work for indexed targets)
Definition: TargetList.cpp:216
TargetList::TargetList
TargetList()=default
default constructor, the target list is empty
TargetList::getNumberOfTargets
unsigned int getNumberOfTargets() const
get the nr of indevidual targets
Definition: TargetList.cpp:132
TargetList::isIn
bool isIn(unsigned int) const
return true only if this is the list of target are indexes and the given index is in the list or if t...
Definition: TargetList.cpp:270
TargetList::getNamedTarget
std::string getNamedTarget(const unsigned int) const
get a named target
Definition: TargetList.cpp:152
TargetList
Manage a list of targets, can be created/modified using either an integer, a name,...
Definition: TargetList.h:45