PLaSK library
Loading...
Searching...
No Matches
separator.cpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#include "separator.hpp"
15
16#define PLASK_SEPARATOR2D_NAME ("separator" PLASK_GEOMETRY_TYPE_NAME_SUFFIX_2D)
17#define PLASK_SEPARATOR3D_NAME ("separator" PLASK_GEOMETRY_TYPE_NAME_SUFFIX_3D)
18
19namespace plask {
20
21template < int dim >
23
24template < int dim >
26
27template < int dim >
28std::string GeometryObjectSeparator<dim>::getTypeName() const { return NAME; }
29
30template < int dim >
34
35/*template < int dim >
36void GeometryObjectSeparator<dim>::getLeafsInfoToVec(std::vector<std::tuple<shared_ptr<const GeometryObject>, GeometryObjectSeparator<dim>::Box, GeometryObjectSeparator<dim>::DVec> > &dest, const PathHints *path) const {
37 // do nothing
38}*/
39
40template < int dim >
41void GeometryObjectSeparator<dim>::getBoundingBoxesToVec(const GeometryObject::Predicate &/*predicate*/, std::vector<typename GeometryObjectSeparator<dim>::Box> &/*dest*/, const PathHints* /*path*/) const {
42 //do nothing
43 //if (predicate(*this)) dest.push_back(this->getBoundingBox());
44}
45
46template < int dim >
48 if (predicate(*this)) dest.push_back(this->shared_from_this());
49}
50
51template < int dim >
53 if (predicate(*this)) dest.push_back(Primitive<dim>::ZERO_VEC);
54}
55
56template < int dim >
58 return &el == this;
59}
60
61template < int dim >
65
66template < int dim >
70
71template < int dim >
73 throw OutOfBoundsException("geometryObjectLeaf::getChildNo", "child_no");
74}
75
76template < int dim >
82
83template < int dim >
85 auto found = copied.find(this);
86 if (found != copied.end()) return found->second;
87 shared_ptr<GeometryObject> result = this->shallowCopy();
88 copied[this] = result;
89 return result;
90}
91
92
93template < int dim >
95 return false;
96}
97
98
99
100
101
104
105
106
107}