-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsize3.h
More file actions
26 lines (21 loc) · 976 Bytes
/
size3.h
File metadata and controls
26 lines (21 loc) · 976 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
#pragma once
#include <iostream>
namespace libMesh {
struct Size3 {
public:
Size3(float width, float height, float depth)
: width(width), height(height), depth(depth) {}
Size3(const Size3& other) : Size3(other.width, other.height, other.depth) {}
float width;
float height;
float depth;
Size3 scale(float scale) {
return Size3(width * scale, height * scale, depth * scale);
}
bool operator ==(const Size3& other) const { return Math::Equals(width, other.width) && Math::Equals(height, other.height) && Math::Equals(depth, other.depth); }
bool operator !=(const Size3& other) const { return !(*this == other); }
friend std::ostream& operator <<(std::ostream& os, const Size3& size) {
return os << "Size3(" << size.width << ", " << size.height << ", " << size.depth << ")";
}
};
}