class AffineTransformOps
{
protected:
- AffineTransformOps() { }
+ AffineTransformOps() = default;
};
template<typename T>
class AffineTransformOps<T, 2>
{
protected:
- AffineTransformOps() { }
+ AffineTransformOps() = default;
public:
static AffineTransform<T, 2> rotation(Angle<T>);
class AffineTransformOps<T, 3>
{
protected:
- AffineTransformOps() { }
+ AffineTransformOps() = default;
public:
static AffineTransform<T, 3> rotation(Angle<T>, const LinAl::Vector<T, 3> &);
BoundingBox<T, D> transform(const BoundingBox<T, D> &) const;
};
-template<typename T, unsigned D>
-inline AffineTransform<T, D>::AffineTransform()
-{
- this->matrix = LinAl::Matrix<T, D+1, D+1>::identity();
-}
+template<typename T, unsigned D>
+inline AffineTransform<T, D>::AffineTransform():
+ matrix(LinAl::Matrix<T, D+1, D+1>::identity())
+{ }
template<typename T, unsigned D>
AffineTransform<T, D> AffineTransform<T, D>::translation(const LinAl::Vector<T, D> &v)
class Angle
{
private:
- T value;
+ T value = T(0);
explicit Angle(T v): value(v) { }
public:
- Angle(): value(0) { }
+ Angle() = default;
template<typename U>
Angle(Angle<U> other): value(other.radians()) { }
private:
LinAl::Vector<T, D> min_pt;
LinAl::Vector<T, D> max_pt;
- bool empty;
- bool negated;
+ bool empty = true;
+ bool negated = false;
public:
- BoundingBox();
+ BoundingBox() = default;
BoundingBox(const LinAl::Vector<T, D> &, const LinAl::Vector<T, D> &);
static BoundingBox negate(const BoundingBox &);
bool is_negated() const { return negated; }
};
-template<typename T, unsigned D>
-inline BoundingBox<T, D>::BoundingBox():
- empty(true),
- negated(false)
-{ }
template<typename T, unsigned D>
inline BoundingBox<T, D>::BoundingBox(const LinAl::Vector<T, D> &n, const LinAl::Vector<T, D> &x):
min_pt(n),
max_pt(x),
- empty(false),
- negated(false)
+ empty(false)
{
for(unsigned i=0; i<D; ++i)
if(min_pt[i]>max_pt[i])
{
private:
LinAl::Vector<T, N> center;
- T radius;
- bool empty;
+ T radius = T(0);
+ bool empty = true;
public:
- BoundingSphere();
+ BoundingSphere() = default;
BoundingSphere(const LinAl::Vector<T, N> &, T);
template<typename Iter>
bool is_empty() const { return empty; }
};
-template<typename T, unsigned N>
-BoundingSphere<T, N>::BoundingSphere():
- radius(0),
- empty(true)
-{ }
template<typename T, unsigned N>
BoundingSphere<T, N>::BoundingSphere(const LinAl::Vector<T, N> &c, T r):
class Box: public HyperBox<T, 3>
{
public:
- Box() { }
+ Box() = default;
explicit Box(const LinAl::Vector<T, 3> &d): HyperBox<T, 3>(d) { }
Box(T w, T h, T d): HyperBox<T, 3>(LinAl::Vector<T, 3>(w, h, d)) { }
class Circle: public HyperSphere<T, 2>
{
public:
- Circle() { }
+ Circle() = default;
explicit Circle(T r): HyperSphere<T, 2>(r) { }
};
ShapeArray shapes;
unsigned max_isect;
- CompositeShape() { }
+ CompositeShape() = default;
CompositeShape(const Shape<T, D> &, const Shape<T, D> &);
template<typename Iter>
void init_from_iter_range(const Iter &, const Iter &);
class ExtrudedShape: public Shape<T, D>
{
private:
- Shape<T, D-1> *base;
- T length;
+ Shape<T, D-1> *base = 0;
+ T length = T(1);
public:
ExtrudedShape(const Shape<T, D-1> &, T);
class HyperSphere: public Shape<T, D>
{
private:
- T radius;
+ T radius = T(1);
public:
- HyperSphere(): radius(1) { }
+ HyperSphere() = default;
explicit HyperSphere(T);
virtual HyperSphere *clone() const;
class Intersection: public CompositeShape<T, D, IntersectionOps<T, D> >
{
private:
- Intersection() { }
+ Intersection() = default;
public:
Intersection(const Shape<T, D> &, const Shape<T, D> &);
class DimensionIndependentLoader: public DataFile::Loader
{
protected:
- bool single;
+ bool single = true;
std::list<Shape<T, D> *> shapes;
DimensionIndependentLoader(bool = true);
class Negation: public Shape<T, D>
{
private:
- Shape<T, D> *shape;
+ Shape<T, D> *shape = 0;
public:
Negation(const Shape<T, D> &);
template<typename T>
struct Quaternion
{
- T a, b, c, d;
+ T a = T(0);
+ T b = T(0);
+ T c = T(0);
+ T d = T(0);
- Quaternion(): a(0), b(0), c(0), d(0) { }
+ Quaternion() = default;
Quaternion(T a_, T b_, T c_, T d_): a(a_), b(b_), c(c_), d(d_) { }
static Quaternion one() { return Quaternion(1, 0, 0, 0); }
private:
LinAl::Vector<T, D> start;
LinAl::Vector<T, D> direction;
- T limit;
+ T limit = T(0);
public:
Ray();
};
template<typename T, unsigned D>
-inline Ray<T, D>::Ray():
- limit(0)
+inline Ray<T, D>::Ray()
{
direction[0] = T(1);
}
template<typename T, unsigned D>
inline Ray<T, D>::Ray(const LinAl::Vector<T, D> &s, const LinAl::Vector<T, D> &d):
start(s),
- direction(normalize(d)),
- limit(0)
+ direction(normalize(d))
{ }
template<typename T, unsigned D>
class Rectangle: public HyperBox<T, 2>
{
public:
- Rectangle() { }
+ Rectangle() = default;
explicit Rectangle(const LinAl::Vector<T, 2> &d): HyperBox<T, 2>(d) { }
Rectangle(T w, T h): HyperBox<T, 2>(LinAl::Vector<T, 2>(w, h)) { }
Coverage coverage;
};
- Shape() { }
+ Shape() = default;
public:
- virtual ~Shape() { }
+ virtual ~Shape() = default;
virtual Shape *clone() const = 0;
{
LinAl::Vector<T, N> position;
LinAl::Vector<T, N> normal;
- T distance;
- bool entry;
+ T distance = T(0);
+ bool entry = true;
};
template<typename T, unsigned N>
class TransformedShape: public Shape<T, D>
{
private:
- Shape<T, D> *shape;
+ Shape<T, D> *shape = 0;
AffineTransform<T, D> transformation;
AffineTransform<T, D> inverse_trans;
class Union: public CompositeShape<T, D, UnionOps<T, D> >
{
private:
- Union() { }
+ Union() = default;
public:
Union(const Shape<T, D> &, const Shape<T, D> &);
LinAl::Vector<T, D+1> coeff;
public:
- Polynomial() { }
+ Polynomial() = default;
Polynomial(const LinAl::Vector<T, D+1> &c): coeff(c) { }
template<typename U, unsigned G>
Polynomial(const Polynomial<U, G> &);
private:
enum { STRIDE = sizeof(Segment)-sizeof(Knot) };
- unsigned short n_segments;
- unsigned short capacity;
- char *segments;
+ unsigned short n_segments = 0;
+ unsigned short capacity = 0;
+ char *segments = 0;
public:
- Spline();
+ Spline() = default;
protected:
Spline(const Knot &);
public:
Value operator()(T) const;
};
-template<typename T, unsigned D, unsigned N>
-inline Spline<T, D, N>::Spline():
- n_segments(0),
- capacity(0),
- segments(0)
-{ }
-
template<typename T, unsigned D, unsigned N>
inline Spline<T, D, N>::Spline(const Knot &k):
- n_segments(0),
- capacity(0),
segments(new char[sizeof(Knot)])
{
new(segments) Knot(k);
}
template<typename T, unsigned D, unsigned N>
-inline Spline<T, D, N>::Spline(const Spline &s):
- n_segments(0),
- capacity(0),
- segments(0)
+inline Spline<T, D, N>::Spline(const Spline &s)
{
*this = s;
}
typedef T ElementType;
private:
- unsigned rows_;
- unsigned columns_;
- T *data;
+ unsigned rows_ = 0;
+ unsigned columns_ = 0;
+ T *data = 0;
public:
DynamicMatrix(unsigned, unsigned);
typedef T ElementType;
private:
- unsigned size_;
- T *data;
+ unsigned size_ = 0;
+ T *data = 0;
public:
DynamicVector(unsigned);
T data[N];
protected:
- VectorComponents() { }
+ VectorComponents() = default;
public:
T &operator[](unsigned i) { return data[i]; }
T x, y;
protected:
- VectorComponents() { }
+ VectorComponents() = default;
public:
T &operator[](unsigned i) { return *(&x+i); }
T x, y, z;
protected:
- VectorComponents() { }
+ VectorComponents() = default;
public:
T &operator[](unsigned i) { return *(&x+i); }
T x, y, z, w;
protected:
- VectorComponents() { }
+ VectorComponents() = default;
public:
T &operator[](unsigned i) { return *(&x+i); }