1 #ifndef VTESTBED_VSL_VESSEL_HH 2 #define VTESTBED_VSL_VESSEL_HH 8 #include <blitz/array.h> 10 #include <vtestbed/geometry/polygon.hh> 11 #include <vtestbed/iges/types.hh> 12 #include <vtestbed/vsl/description.hh> 13 #include <vtestbed/vsl/name.hh> 20 template <
class T>
class Section;
21 template <
class T>
class Vessel;
28 using vec2 = blitz::TinyVector<T,2>;
29 using vec3 = blitz::TinyVector<T,3>;
35 frame_container _frames;
36 frame_container _bottom_frames;
37 frame_container _top_frames;
39 vertex_array _terminal_frame;
40 polygon_type _polygon;
44 inline const frame_container& bottom_frames()
const {
return this->_bottom_frames; }
45 inline const frame_container& top_frames()
const {
return this->_top_frames; }
46 inline const frame_container& frames()
const {
return this->_frames; }
47 inline const vertex_array& terminal_frame()
const {
return this->_terminal_frame; }
48 inline const vertex_array& polyline()
const {
return this->_arr; }
51 friend class Vessel<T>;
62 void clip_to_polygon(
size_t begin_offset,
size_t end_offset);
63 void aft_generate_horizontal_frames();
64 void bow_generate_horizontal_frames();
65 void bow_terminal_frame();
66 void main_generate_horizontal_frames();
86 using vec2 = blitz::TinyVector<T,2>;
87 using vec3 = blitz::TinyVector<T,3>;
90 using section_type = Section<T>;
96 FrameStart, Frame, FrameEnd,
104 Description _description;
106 size_t _middleframe = 0;
110 vertex_array _aft_width;
111 vertex_array _bow_width;
112 section_type _aft_section;
113 section_type _bow_section;
114 section_type _main_section;
124 inline const Name& name()
const {
return this->_name; }
125 inline T length()
const {
return this->_length; }
126 inline T beam()
const {
return this->_beam; }
127 inline T draught()
const {
return this->_draught; }
128 inline const section_type& aft()
const {
return this->_aft_section; }
129 inline const section_type& bow()
const {
return this->_bow_section; }
130 inline const section_type& main_section()
const {
return this->_main_section; }
131 inline void filename(
const std::string& filename) { this->_filename = filename; }
132 inline const std::string& filename()
const {
return this->_filename; }
133 inline const Description& description()
const {
return this->_description; }
139 void set_bow_and_aft_x_coordinates();
141 void detach_aft(T max_x);
142 void detach_bow(T min_x);
161 #endif // vim:filetype=cpp