Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/SlicesSorter.h @ 73:ffa6dded91bd wasm
reorganization
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 May 2017 11:59:24 +0200 |
parents | |
children | f5f54ed8d307 |
comparison
equal
deleted
inserted
replaced
72:c1cc3bdba18c | 73:ffa6dded91bd |
---|---|
1 /** | |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017 Osimis, Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "Slice.h" | |
25 | |
26 namespace OrthancStone | |
27 { | |
28 class SlicesSorter : public boost::noncopyable | |
29 { | |
30 private: | |
31 class SliceWithDepth; | |
32 struct Comparator; | |
33 | |
34 typedef std::vector<SliceWithDepth*> Slices; | |
35 | |
36 Slices slices_; | |
37 bool hasNormal_; | |
38 | |
39 public: | |
40 SlicesSorter() : hasNormal_(false) | |
41 { | |
42 } | |
43 | |
44 ~SlicesSorter(); | |
45 | |
46 void Reserve(size_t count) | |
47 { | |
48 slices_.reserve(count); | |
49 } | |
50 | |
51 void AddSlice(const Slice& slice); | |
52 | |
53 size_t GetSliceCount() const | |
54 { | |
55 return slices_.size(); | |
56 } | |
57 | |
58 const Slice& GetSlice(size_t i) const; | |
59 | |
60 void SetNormal(const Vector& normal); | |
61 | |
62 void Sort(); | |
63 | |
64 void FilterNormal(const Vector& normal); | |
65 | |
66 bool SelectNormal(Vector& normal) const; | |
67 }; | |
68 } |