www.cemf.ir
selectorGeometric.cpp
Go to the documentation of this file.
1 
2 
3 template<typename GeomType>
4 bool
6 {
7  selectedPoints_.clear();
8 
9  auto maskH = pStruct().activePointsMaskHost();
10  const auto aRange = maskH.activeRange();
11  auto pPos = pStruct().pointPositionHost();
12 
13  for (uint32 i = aRange.start(); i < aRange.end(); i++)
14  {
15  if (maskH.isActive(i) && pRegion_.isInside(pPos[i]))
16  {
17  selectedPoints_.push_back(i);
18  }
19  }
20 
21  return true;
22 }
23 
24 template<typename GeomType>
26  const pointStructure& pStruct,
27  const dictionary& dict
28 )
29  : pStructSelector(pStruct, dict),
30  type_(dict.getVal<word>("selector")),
31  pRegion_(type_, dict.subDict(type_ + "Info"))
32 {
33  if (!selectPoints())
34  {
35  fatalExit;
36  }
37 }
38 
39 template<typename GeomType>
41  const word& type,
42  const pointStructure& pStruct,
43  const dictionary& dict
44 )
45  : pStructSelector(type, pStruct, dict),
46  type_(type),
47  pRegion_(type_, dict)
48 {
49  if (!selectPoints())
50  {
51  fatalExit;
52  }
53 }
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::selectorGeometric::selectPoints
bool selectPoints()
Definition: selectorGeometric.cpp:5
pFlow::pointStructure
Definition: pointStructure.hpp:34
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::pStructSelector
Definition: pStructSelector.hpp:36
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
pFlow::selectorGeometric::selectorGeometric
selectorGeometric(const pointStructure &pStruct, const dictionary &dict)
Definition: selectorGeometric.cpp:25