Virtual Testbed
Ship dynamics simulator for extreme conditions
src
vtestbed
graphics
ShipCompartments.hh
1
#ifndef VTESTBED_GRAPHICS_SHIPCOMPARTMENTS_HH
2
#define VTESTBED_GRAPHICS_SHIPCOMPARTMENTS_HH
3
4
#include <vector>
5
6
#include <vtestbed/core/compartment.hh>
7
#include <vtestbed/core/types.hh>
8
#include <vtestbed/graphics/ShipCompartmentObject.hh>
9
#include <vtestbed/graphics/types.hh>
10
11
namespace
vtb
{
12
13
namespace
graphics {
14
15
template
<
class
T>
16
class
ShipCompartments
:
public
Object3D,
public
Drawable3D {
17
18
public
:
19
using
core_room_array
=
vtb::core::Compartment_array<T>
;
20
using
room_ptr
=
std::unique_ptr<ShipCompartmentObject<T>
>;
21
using
room_array
=
std::vector<room_ptr>
;
22
using
testbed_type
=
vtb::core::Testbed<T,3>
;
23
24
private
:
25
room_array
_rooms;
26
DrawableGroup3D _drawables;
27
bool
_show =
true
;
28
29
public
:
30
31
ShipCompartments
();
32
33
void
init(
const
testbed_type
& testbed);
34
void
update(
const
core_room_array
& rooms);
35
void
draw(
const
Matrix4& m, Camera3D& camera)
override
;
36
37
inline
void
show(
bool
b) { this->_show = b; }
38
inline
room_array
& rooms() {
return
this->_rooms; }
39
inline
const
room_array
& rooms()
const
{
return
this->_rooms; }
40
41
};
42
43
}
44
45
}
46
47
#endif // vim:filetype=cpp
vtb::core::Compartment_array
Definition:
compartment.hh:67
vtb::graphics::ShipCompartments
Definition:
ShipCompartments.hh:16
vtb
Main namespace.
Definition:
convert.hh:9
std::vector< room_ptr >
vtb::core::Testbed< T, 3 >
std::unique_ptr
Generated by
1.8.15