Orfeo Toolbox  3.16
itkTubeSpatialObjectPoint.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Insight Segmentation & Registration Toolkit
4 Module:$RCSfile: itkTubeSpatialObjectPoint.txx,v $
5 Language:C++
6 Date:$Date: 2010-01-21 22:29:55 $
7 Version: $Revision: 1.11 $
8 
9 Copyright (c) Insight Software Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE.See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkTubeSpatialObjectPoint_txx
18 #define __itkTubeSpatialObjectPoint_txx
19 
21 
22 namespace itk
23 {
24 
26 template< unsigned int TPointDimension >
29 {
30  m_NumDimensions = TPointDimension;
31  m_T.Fill(0);
32  m_Normal1.Fill(0);
33  m_Normal2.Fill(0);
34  m_R = 0;
35 }
36 
38 template< unsigned int TPointDimension >
41 {
42 }
43 
45 template< unsigned int TPointDimension >
46 float
48 ::GetRadius( void ) const
49 {
50  return m_R;
51 }
52 
54 template< unsigned int TPointDimension >
55 void
57 ::SetRadius( const float newR )
58 {
59  m_R = newR;
60 }
61 
62 template< unsigned int TPointDimension >
65 ::GetTangent( void ) const
66 {
67  return m_T;
68 }
69 
70 // n-D case
71 template< unsigned int TPointDimension >
72 void
74 ::SetTangent( const VectorType & newT )
75 {
76  m_T = newT;
77 }
78 
79 // 3-D case
80 template< unsigned int TPointDimension >
81 void
83 ::SetTangent( const double t0, const double t1, const double t2 )
84 {
85  m_T[0] = t0;
86  m_T[1] = t1;
87  m_T[2] = t2;
88 }
89 
90 // 2-D case
91 template< unsigned int TPointDimension >
92 void
94 ::SetTangent( const double t0, const double t1 )
95 {
96  m_T[0] = t0;
97  m_T[1] = t1;
98 }
99 
100 template< unsigned int TPointDimension >
104 {
105  return m_Normal1;
106 }
107 
108 // n-D case
109 template< unsigned int TPointDimension >
110 void
113 {
114  m_Normal1 = newV1;
115 }
116 
117 // 3-D case
118 template< unsigned int TPointDimension >
119 void
121 ::SetNormal1( const double v10, const double v11, const double v12 )
122 {
123  m_Normal1[0] = v10;
124  m_Normal1[1] = v11;
125  m_Normal1[2] = v12;
126 }
127 
128 // 2-D case
129 template< unsigned int TPointDimension >
130 void
132 ::SetNormal1( const double v10, const double v11 )
133 {
134  m_Normal1[0] = v10;
135  m_Normal1[1] = v11;
136 }
137 
138 template< unsigned int TPointDimension >
142 {
143  return m_Normal2;
144 }
145 
146 
147 // n-D case
148 template< unsigned int TPointDimension >
149 void
152 {
153  m_Normal2 = newV2;
154 }
155 
156 // 3-D case
157 template< unsigned int TPointDimension >
158 void
160 ::SetNormal2( const double v20, const double v21, const double v22 )
161 {
162  m_Normal2[0] = v20;
163  m_Normal2[1] = v21;
164  m_Normal2[2] = v22;
165 }
166 
167 // 2-D case
168 template< unsigned int TPointDimension >
169 void
171 ::SetNormal2( const double v20, const double v21 )
172 {
173  m_Normal2[0] = v20;
174  m_Normal2[1] = v21;
175 }
176 
177 template< unsigned int TPointDimension >
178 unsigned short int
180 ::GetNumDimensions( void ) const
181 {
182  return m_NumDimensions;
183 }
184 
185 template< unsigned int TPointDimension >
186 void
188 ::PrintSelf( std::ostream & os, Indent indent) const
189 {
190  Superclass::PrintSelf(os,indent);
191  os << indent << "#Dims: " << m_NumDimensions << std::endl;
192  os << indent << "R: " << m_R << std::endl;
193  os << indent << "X: " << this->m_X << std::endl;
194  os << indent << "T: " << m_T << std::endl;
195  os << indent << "Normal1: " << m_Normal1 << std::endl;
196  os << indent << "Normal2: " << m_Normal2 << std::endl;
197 }
198 
199 
200 template< unsigned int TPointDimension >
204 {
205  this->m_ID = rhs.m_ID;
206  m_R = rhs.m_R;
207  m_NumDimensions = rhs.m_NumDimensions;
208  this->m_X = rhs.m_X;
209  m_T = rhs.m_T;
210  m_Normal1 = rhs.m_Normal1;
211  m_Normal2 = rhs.m_Normal2;
212  this->m_Color = rhs.m_Color;
213  return * this;
214 }
215 
216 } // end namespace itk
217 
218 #endif

Generated at Sun Feb 3 2013 00:10:32 for Orfeo Toolbox with doxygen 1.8.1.1