comparison Sources/StructureSetGeometry.h @ 35:ee3bc8f7df5b

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Apr 2024 20:37:08 +0200
parents
children
comparison
equal deleted inserted replaced
34:bee2017f3088 35:ee3bc8f7df5b
1 /**
2 * SPDX-FileCopyrightText: 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
3 * SPDX-License-Identifier: GPL-3.0-or-later
4 */
5
6 /**
7 * STL plugin for Orthanc
8 * Copyright (C) 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
9 *
10 * This program is free software: you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation, either version 3 of the
13 * License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 **/
23
24
25 #pragma once
26
27 #include "StructureSet.h"
28
29
30 class StructureSetGeometry : public boost::noncopyable
31 {
32 private:
33 Vector3D slicesNormal_;
34 double slicesSpacing_;
35 double minProjectionAlongNormal_;
36 double maxProjectionAlongNormal_;
37 size_t slicesCount_;
38
39 bool LookupProjectionIndex(size_t& index,
40 double z) const;
41
42 public:
43 StructureSetGeometry(const StructureSet& structures,
44 bool strict);
45
46 const Vector3D& GetSlicesNormal() const
47 {
48 return slicesNormal_;
49 }
50
51 double GetSlicesSpacing() const
52 {
53 return slicesSpacing_;
54 }
55
56 double GetMinProjectionAlongNormal() const
57 {
58 return minProjectionAlongNormal_;
59 }
60
61 double GetMaxProjectionAlongNormal() const
62 {
63 return maxProjectionAlongNormal_;
64 }
65
66 bool ProjectAlongNormal(double& z,
67 const StructurePolygon& polygon) const;
68
69 size_t GetSlicesCount() const
70 {
71 return slicesCount_;
72 }
73
74 bool LookupSliceIndex(size_t& slice,
75 const StructurePolygon& polygon) const;
76 };