------------------------------------------------------------------------------
| 150 | |
| 151 | //------------------------------------------------------------------------------ |
| 152 | void 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 | //------------------------------------------------------------------------------ |
| 185 | void vtkHandleRepresentation::Translate(const double* p1, const double* p2) |
no test coverage detected