STIR 6.4.0
Box3D.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2005- 2008, Hammersmith Imanet Ltd
5 This file is part of STIR.
6
7 SPDX-License-Identifier: Apache-2.0
8
9 See STIR/LICENSE.txt for details
10*/
19
20#ifndef __stir_Shape_Box3D_h__
21#define __stir_Shape_Box3D_h__
22
25
26START_NAMESPACE_STIR
27
49class Box3D : public RegisteredParsingObject<Box3D, Shape3D, Shape3DWithOrientation>
50{
51public:
53 static const char* const registered_name;
54
55 Box3D();
56#if 0
57 Box3D( const float length_x,
58 const float length_y,
59 const float length_z,
60 const CartesianCoordinate3D<float>& centre,
61 const float alpha,
62 const float beta,
63 const float gamma);
64#endif
65
66 Box3D(const float length_x,
67 const float length_y,
68 const float length_z,
69 const CartesianCoordinate3D<float>& centre,
70 const Array<2, float>& direction_vectors = diagonal_matrix(3, 1.F));
71
72 float get_geometric_volume() const override;
73 // float get_geometric_area() const;
74
75 bool is_inside_shape(const CartesianCoordinate3D<float>& coord) const override;
76
77 Shape3D* clone() const override;
78
80
81 bool operator==(const Box3D&) const;
82
83 bool operator==(const Shape3D& shape) const override;
84
85protected:
87 float length_x;
89 float length_y;
91 float length_z;
92
93private:
94 void set_defaults() override;
95 void initialise_keymap() override;
96 bool post_processing() override;
97};
98
99END_NAMESPACE_STIR
100
101#endif
Declaration of class stir::RegisteredParsingObject.
Declaration of class stir::Shape3DWithOrientation.
This class defines multi-dimensional (numeric) arrays.
Definition Array.h:78
static const char *const registered_name
Name which will be used when parsing a Shape3D object.
Definition Box3D.h:53
float length_z
Length in z-direction if the shape is not rotated.
Definition Box3D.h:91
bool is_inside_shape(const CartesianCoordinate3D< float > &coord) const override
determine if a point is inside the shape or not (up to floating point errors)
Definition Box3D.cxx:112
bool operator==(const Box3D &) const
Compare boxes.
Definition Box3D.cxx:148
float get_geometric_volume() const override
Compute approximate volume.
Definition Box3D.cxx:125
Shape3D * clone() const override
Allocate a new Shape3D object which is a copy of the current one.
Definition Box3D.cxx:142
float length_y
Length in y-direction if the shape is not rotated.
Definition Box3D.h:89
float length_x
Length in x-direction if the shape is not rotated.
Definition Box3D.h:87
a templated class for 3-dimensional coordinates.
Definition CartesianCoordinate3D.h:53
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
The base class for all 3 dimensional shapes.
Definition Shape3D.h:66
Array< 2, elemT > diagonal_matrix(const unsigned dimension, const elemT value)
construct a diagonal matrix with all elements on the diagonal equal
Definition MatrixFunction.inl:182