STIR  6.2.0
EllipsoidalCylinder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000-2008, Hammersmith Imanet Ltd
3  This file is part of STIR.
4 
5  SPDX-License-Identifier: Apache-2.0
6 
7  See STIR/LICENSE.txt for details
8 */
19 #ifndef __stir_Shape_EllipsoidalCylinder_h__
20 #define __stir_Shape_EllipsoidalCylinder_h__
21 
24 
25 START_NAMESPACE_STIR
26 
67 class EllipsoidalCylinder : public RegisteredParsingObject<EllipsoidalCylinder, Shape3D, Shape3DWithOrientation>
68 {
69 
70 public:
72  static const char* const registered_name;
73 
76 
78 
79  EllipsoidalCylinder(const float length_z,
80  const float radius_y,
81  const float radius_x,
82  const CartesianCoordinate3D<float>& centre,
83  const Array<2, float>& direction_vectors = diagonal_matrix(3, 1.F));
84 
86 
89  EllipsoidalCylinder(const float length_z,
90  const float radius_y,
91  const float radius_x,
92  const float theta_1,
93  const float theta_2,
94  const CartesianCoordinate3D<float>& centre,
95  const Array<2, float>& direction_vectors = diagonal_matrix(3, 1.F));
96 
97  Shape3D* clone() const override;
98 
100 
101  bool operator==(const EllipsoidalCylinder& cylinder) const;
102 
103  bool operator==(const Shape3D& shape) const override;
104 
106  float get_geometric_volume() const override;
107 #if 0
108  float get_geometric_area() const;
110 #endif
111 
112  bool is_inside_shape(const CartesianCoordinate3D<float>& coord) const override;
113 
114  inline float get_length() const
115  {
116  return length;
117  }
118  inline float get_radius_x() const
119  {
120  return radius_x;
121  }
122  inline float get_radius_y() const
123  {
124  return radius_y;
125  }
126  // TODOXXX add theta_1,2
127  void set_length(const float);
128  void set_radius_x(const float);
129  void set_radius_y(const float);
130 
131 protected:
133  float length;
135  float radius_x;
137  float radius_y;
139  float theta_1;
141  float theta_2;
142 
144 
145  void set_defaults() override;
146  void initialise_keymap() override;
147  bool post_processing() override;
148 };
149 
150 END_NAMESPACE_STIR
151 
152 #endif
Declaration of class stir::Shape3DWithOrientation.
float radius_x
Radius in x-direction if the shape is not rotated.
Definition: EllipsoidalCylinder.h:135
float theta_2
final theta if the shape is not rotated (in degrees)
Definition: EllipsoidalCylinder.h:141
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
The base class for all 3 dimensional shapes.
Definition: Shape3D.h:65
float theta_1
initial theta if the shape is not rotated (in degrees)
Definition: EllipsoidalCylinder.h:139
static const char *const registered_name
Name which will be used when parsing a Shape3D object.
Definition: EllipsoidalCylinder.h:72
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Three-dimensional ellipsoidal cylinder.
Definition: EllipsoidalCylinder.h:67
float radius_y
Radius in y-direction if the shape is not rotated.
Definition: EllipsoidalCylinder.h:137
float length
Length of the cylinder.
Definition: EllipsoidalCylinder.h:133
Declaration of class stir::RegisteredParsingObject.