ITK  6.0.0
Insight Toolkit
itkArrowSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkArrowSpatialObject_h
19 #define itkArrowSpatialObject_h
20 
21 #include "itkSpatialObject.h"
22 
23 namespace itk
24 {
36 template <unsigned int TDimension = 3>
37 class ITK_TEMPLATE_EXPORT ArrowSpatialObject : public SpatialObject<TDimension>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(ArrowSpatialObject);
41 
46  using ScalarType = double;
49  using typename Superclass::TransformType;
51 
53  itkNewMacro(Self);
54 
56  itkOverrideGetNameOfClassMacro(ArrowSpatialObject);
57 
60  void
61  Clear() override;
62 
64  itkSetMacro(PositionInObjectSpace, PointType);
65 
67  itkGetConstMacro(PositionInObjectSpace, PointType);
68 
70  itkSetMacro(DirectionInObjectSpace, VectorType);
71 
73  itkGetConstMacro(DirectionInObjectSpace, VectorType);
74 
76  itkSetMacro(LengthInObjectSpace, double);
77 
79  itkGetConstReferenceMacro(LengthInObjectSpace, double);
80 
82  bool
83  IsInsideInObjectSpace(const PointType & point) const override;
84 
85  /* Avoid hiding the overload that supports depth and name arguments */
86  using Superclass::IsInsideInObjectSpace;
87 
88  PointType
89  GetPositionInWorldSpace() const;
91  GetDirectionInWorldSpace() const;
92  double
93  GetLengthInWorldSpace() const;
94 
95 protected:
97  void
98  ComputeMyBoundingBox() override;
99 
101  ~ArrowSpatialObject() override = default;
102 
103  void
104  PrintSelf(std::ostream & os, Indent indent) const override;
105 
106  typename LightObject::Pointer
107  InternalClone() const override;
108 
109 private:
110  VectorType m_DirectionInObjectSpace{};
111  PointType m_PositionInObjectSpace{};
112  double m_LengthInObjectSpace{};
113 };
114 
115 } // end namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 # include "itkArrowSpatialObject.hxx"
119 #endif
120 
121 #endif // itkArrowSpatialObject_h
itkSpatialObject.h
itk::ArrowSpatialObject::MatrixType
typename TransformType::MatrixType MatrixType
Definition: itkArrowSpatialObject.h:50
itk::Vector< double, TDimension >
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension >
itk::ArrowSpatialObject::ScalarType
double ScalarType
Definition: itkArrowSpatialObject.h:46
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ArrowSpatialObject
Representation of a Arrow based on the spatial object classes.
Definition: itkArrowSpatialObject.h:37
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::Point< double, TDimension >
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293