Virtual Testbed
Ship dynamics simulator for extreme conditions
parametric_spline_surface.hh
1 #ifndef VTESTBED_IGES_PARAMETRIC_SPLINE_SURFACE_HH
2 #define VTESTBED_IGES_PARAMETRIC_SPLINE_SURFACE_HH
3 
4 #include <blitz/array.h>
5 
6 #include <vtestbed/iges/entity.hh>
7 #include <vtestbed/iges/types.hh>
8 
9 namespace vtb {
10 
11  namespace iges {
12 
14  template <class T>
16 
17  public:
18 
19  struct Coefficients {
20  T x[16] {};
21  T y[16] {};
22  T z[16] {};
23  };
24 
25  static_assert(sizeof(Coefficients) == 48*sizeof(T), "bad size");
26 
27  typedef std::vector<T> array_1d;
29  typedef blitz::TinyVector<T,3> vec3;
32 
33  private:
34  Integer _boundary_type = 1;
35  Integer _patch_type = 0;
36  Integer _nsegments_u = 0;
37  Integer _nsegments_v = 0;
38  array_1d _u;
39  array_1d _v;
40  coefficient_array _coefficients;
41 
42  public:
43 
44  explicit
45  Parametric_spline_surface(const vertex_array_2d& data, bool cyclic=false);
46 
47  protected:
48 
49  void
50  parameters(iges_ostream& out) const override;
51 
52  };
53 
54  }
55 
56 }
57 
58 #endif // vim:filetype=cpp
Base class for entities.
Definition: iges/entity.hh:17
Main namespace.
Definition: convert.hh:9
Output stream that automatically wraps text for IGES files.
Definition: stream.hh:143