-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathGraphVolume.cpp
More file actions
34 lines (26 loc) · 800 Bytes
/
Copy pathGraphVolume.cpp
File metadata and controls
34 lines (26 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "GraphVolume.h"
GraphVolume::GraphVolume() {}
GraphVolume::GraphVolume(const GraphVolume& other) :
DiscreteVolume(other) {
copy(other);
}
GraphVolume&
GraphVolume::operator=(const GraphVolume& other) {
DiscreteVolume::operator=(other);
copy(other);
return *this;
}
void
GraphVolume::copy(const GraphVolume& other) {
lemon::GraphCopy<Graph, Graph> copy(other.graph(), *_graph);
copy.nodeMap(other.positions(), *_positions);
copy.run();
}
util::box<unsigned int,3>
GraphVolume::computeDiscreteBoundingBox() const {
util::box<unsigned int,3> bb;
// bounding box of discrete points
for (Graph::NodeIt node(graph()); node != lemon::INVALID; ++node)
bb.fit(util::box<unsigned int,3>(positions()[node], positions()[node] + util::point<unsigned int,3>(1, 1, 1)));
return bb;
}