소스 검색

ctkSurfaceMaterialPropertyWidget doesn't support more than 2 decimals

by default.
Todo: add a property to control the number of decimals.
Julien Finet 13 년 전
부모
커밋
8a44e6e40b
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKSurfaceMaterialPropertyWidgetTest1.cpp

+ 3 - 3
Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKSurfaceMaterialPropertyWidgetTest1.cpp

@@ -128,8 +128,8 @@ int ctkVTKSurfaceMaterialPropertyWidgetTest1(int argc, char * argv [] )
     }
 
   property->SetOpacity(0.111);
-
-  if (propertyWidget.opacity() != 0.111)
+  // Only 2 decimals are supported by the widget
+  if (propertyWidget.opacity() != 0.11)
     {
     std::cerr << "vtkProperty::SetOpacity() failed: " << propertyWidget.opacity() << std::endl;
     return EXIT_FAILURE;
@@ -137,7 +137,7 @@ int ctkVTKSurfaceMaterialPropertyWidgetTest1(int argc, char * argv [] )
 
   propertyWidget.setOpacity(0.999);
   
-  if (property->GetOpacity() != 0.999)
+  if (property->GetOpacity() != 1.00)
     {
     std::cerr << "ctkVTKSurfaceMaterialPropertyWidget::setOpacity() failed: "
               << property->GetOpacity() << std::endl;