------------------------------------------------------------------------------
| 181 | |
| 182 | //------------------------------------------------------------------------------ |
| 183 | void vtkAnnulus::UpdateTransform() |
| 184 | { |
| 185 | const vtkVector3d yAxis(0., 1., 0.); |
| 186 | |
| 187 | vtkVector3d cross = yAxis.Cross(this->Axis); |
| 188 | const double crossNorm = cross.Normalize(); |
| 189 | const double dot = yAxis.Dot(this->Axis); |
| 190 | const double angle = vtkMath::DegreesFromRadians(std::atan2(crossNorm, dot)); |
| 191 | |
| 192 | vtkNew<vtkTransform> transform; |
| 193 | transform->Identity(); |
| 194 | transform->Translate(this->Center.GetData()); |
| 195 | transform->RotateWXYZ(angle, cross.GetData()); |
| 196 | transform->Inverse(); |
| 197 | |
| 198 | this->SetTransform(transform.GetPointer()); |
| 199 | this->Modified(); |
| 200 | } |
| 201 | |
| 202 | VTK_ABI_NAMESPACE_END |
no test coverage detected