1 #ifndef VTESTBED_CORE_COMPARTMENT_HH 2 #define VTESTBED_CORE_COMPARTMENT_HH 8 #include <vtestbed/base/constants.hh> 9 #include <vtestbed/core/types.hh> 10 #include <vtestbed/geometry/polyhedron.hh> 21 using vec3 = Vector3<T>;
23 using face_array = Array<face_type,1>;
35 inline const std::string& name()
const {
return this->_name; }
36 inline void name(
const std::string& rhs) { this->_name = rhs; }
37 inline const polyhedron_type& polyhedron()
const {
return this->_polyhedron; }
38 inline void polyhedron(
const polyhedron_type& rhs) { this->_polyhedron = rhs; }
39 inline void polyhedron(
polyhedron_type&& rhs) { this->_polyhedron = std::move(rhs); }
40 inline T flooded_volume()
const {
return this->_flooded_volume; }
41 T flooded_volume(T rhs);
42 inline void fire(
bool rhs) { this->_fire = rhs; }
43 inline bool fire()
const {
return this->_fire; }
44 inline bool flooding()
const {
return this->_flooded_volume > 0; }
45 inline const vec3& flooded_mass_centre()
const {
return this->_centre; }
46 void calc_flooded_mass_centre();
49 flooded_mass()
const {
51 return this->_flooded_volume*constants::water_density();
54 void box(
const vec3& x0,
const vec3& x1);
74 using value_type =
typename base_type::value_type;
75 using pointer =
typename base_type::pointer;
76 using const_pointer =
typename base_type::const_pointer;
77 using reference =
typename base_type::reference;
78 using const_reference =
typename base_type::const_reference;
79 using iterator =
typename base_type::iterator;
80 using const_iterator =
typename base_type::const_iterator;
81 using size_type =
typename base_type::size_type;
82 using difference_type =
typename base_type::difference_type;
83 using reverse_iterator =
typename base_type::reverse_iterator;
84 using const_reverse_iterator =
typename base_type::const_reverse_iterator;
88 using base_type::base_type;
89 using base_type::operator=;
90 using base_type::operator[];
95 generate(
const polyhedron_type& hull,
const int3& nrooms);
103 #endif // vim:filetype=cpp