MCPcopy Create free account
hub / github.com/Kitware/VTK / GetTranslationVector

Method GetTranslationVector

Interaction/Widgets/vtkHandleRepresentation.cxx:152–182  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

150
151//------------------------------------------------------------------------------
152void vtkHandleRepresentation::GetTranslationVector(
153 const double* p1, const double* p2, double* v) const
154{
155 double p12[3];
156 vtkMath::Subtract(p2, p1, p12);
157 if (this->TranslationAxis == Axis::NONE)
158 {
159 for (int i = 0; i < 3; ++i)
160 {
161 v[i] = p12[i];
162 }
163 }
164 else if (this->TranslationAxis == Axis::Custom)
165 {
166 vtkMath::ProjectVector(p12, this->CustomTranslationAxis, v);
167 }
168 else
169 {
170 for (int i = 0; i < 3; ++i)
171 {
172 if (this->TranslationAxis == i)
173 {
174 v[i] = p12[i];
175 }
176 else
177 {
178 v[i] = 0.0;
179 }
180 }
181 }
182}
183
184//------------------------------------------------------------------------------
185void vtkHandleRepresentation::Translate(const double* p1, const double* p2)

Callers 4

TranslateMethod · 0.95
TranslateMethod · 0.80
MoveFocusRequestMethod · 0.80
TranslateMethod · 0.80

Calls 2

ProjectVectorFunction · 0.85
SubtractFunction · 0.50

Tested by

no test coverage detected