STIR  6.2.0
Ellipsoid.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000- 2007, 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 #ifndef __stir_Shape_Ellipsoid_h__
20 #define __stir_Shape_Ellipsoid_h__
21 
24 
25 START_NAMESPACE_STIR
26 
51 class Ellipsoid : public RegisteredParsingObject<Ellipsoid, Shape3D, Shape3DWithOrientation>
52 {
53 public:
55  static const char* const registered_name;
56 
57  Ellipsoid();
59  const CartesianCoordinate3D<float>& centre,
60  const Array<2, float>& direction_vectors = diagonal_matrix(3, 1.F));
62  float get_geometric_volume() const override;
63 #if 0
64  float get_geometric_area() const;
66 #endif
67 
68  bool is_inside_shape(const CartesianCoordinate3D<float>& coord) const override;
69 
70  Shape3D* clone() const override;
71 
73 
74  bool operator==(const Ellipsoid&) const;
75 
76  bool operator==(const Shape3D& shape) const override;
77 
78  inline float get_radius_x() const
79  {
80  return radii.x();
81  }
82  inline float get_radius_y() const
83  {
84  return radii.y();
85  }
86  inline float get_radius_z() const
87  {
88  return radii.z();
89  }
90  inline CartesianCoordinate3D<float> get_radii() const
91  {
92  return radii;
93  }
94  void set_radii(const CartesianCoordinate3D<float>& new_radii);
95 
96 protected:
99 
101 
102  void set_defaults() override;
103  void initialise_keymap() override;
104  bool post_processing() override;
105 };
106 
107 END_NAMESPACE_STIR
108 
109 #endif
Declaration of class stir::Shape3DWithOrientation.
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
CartesianCoordinate3D< float > radii
Radii in 3 directions (before using the direction vectors)
Definition: Ellipsoid.h:98
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Declaration of class stir::RegisteredParsingObject.
Three-dimensional ellipsoid.
Definition: Ellipsoid.h:51
static const char *const registered_name
Name which will be used when parsing a Shape3D object.
Definition: Ellipsoid.h:55