| 293 | } |
| 294 | |
| 295 | void mitk::GizmoMapper2D::SetDefaultProperties(mitk::DataNode *node, |
| 296 | mitk::BaseRenderer *renderer /*= nullptr*/, |
| 297 | bool /*= false*/) |
| 298 | { |
| 299 | node->SetProperty("color", ColorProperty::New(0.3, 0.3, 0.3)); // a little lighter than the |
| 300 | // "plane widgets" of |
| 301 | // QmitkStdMultiWidget |
| 302 | node->SetProperty("scalar visibility", BoolProperty::New(true), renderer); |
| 303 | node->SetProperty("ScalarsRangeMinimum", DoubleProperty::New(0), renderer); |
| 304 | node->SetProperty("ScalarsRangeMaximum", DoubleProperty::New((int)Gizmo::NoHandle), renderer); |
| 305 | |
| 306 | double colorMoveFreely[] = {1, 0, 0, 1}; // RGBA |
| 307 | double colorAxisX[] = {0.753, 0, 0, 1}; // colors copied from QmitkStdMultiWidget to |
| 308 | double colorAxisY[] = {0, 0.69, 0, 1}; // look alike |
| 309 | double colorAxisZ[] = {0, 0.502, 1, 1}; |
| 310 | double colorInactive[] = {0.7, 0.7, 0.7, 1}; |
| 311 | |
| 312 | // build a nice color table |
| 313 | vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New(); |
| 314 | lut->SetNumberOfTableValues((int)Gizmo::NoHandle + 1); |
| 315 | lut->SetTableRange(0, (int)Gizmo::NoHandle); |
| 316 | lut->SetTableValue(Gizmo::MoveFreely, colorMoveFreely); |
| 317 | lut->SetTableValue(Gizmo::MoveAlongAxisX, colorAxisX); |
| 318 | lut->SetTableValue(Gizmo::MoveAlongAxisY, colorAxisY); |
| 319 | lut->SetTableValue(Gizmo::MoveAlongAxisZ, colorAxisZ); |
| 320 | lut->SetTableValue(Gizmo::RotateAroundAxisX, colorAxisX); |
| 321 | lut->SetTableValue(Gizmo::RotateAroundAxisY, colorAxisY); |
| 322 | lut->SetTableValue(Gizmo::RotateAroundAxisZ, colorAxisZ); |
| 323 | lut->SetTableValue(Gizmo::ScaleX, colorAxisX); |
| 324 | lut->SetTableValue(Gizmo::ScaleY, colorAxisY); |
| 325 | lut->SetTableValue(Gizmo::ScaleZ, colorAxisZ); |
| 326 | lut->SetTableValue(Gizmo::NoHandle, colorInactive); |
| 327 | |
| 328 | mitk::LookupTable::Pointer mlut = mitk::LookupTable::New(); |
| 329 | mlut->SetVtkLookupTable(lut); |
| 330 | |
| 331 | mitk::LookupTableProperty::Pointer lutProp = mitk::LookupTableProperty::New(); |
| 332 | lutProp->SetLookupTable(mlut); |
| 333 | node->SetProperty("LookupTable", lutProp, renderer); |
| 334 | |
| 335 | node->SetProperty("helper object", BoolProperty::New(true), renderer); |
| 336 | node->SetProperty("visible", BoolProperty::New(true), renderer); |
| 337 | node->SetProperty("show in 2D", BoolProperty::New(true), renderer); |
| 338 | // no "show in 3D" because this would require a specialized mapper for gizmos in 3D |
| 339 | } |
nothing calls this directly
no test coverage detected