Pārlūkot izejas kodu

Merge branch 'ctkmaterialpropertywidget'

* ctkmaterialpropertywidget:
  Remove shadow function warning onBackfaceCullingChanged
  Update default properties of ctkMaterialPropertyWidget
Julien Finet 14 gadi atpakaļ
vecāks
revīzija
4d3bdd12f7

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

@@ -36,7 +36,7 @@
 int ctkVTKSurfaceMaterialPropertyWidgetTest1(int argc, char * argv [] )
 {
   QApplication app(argc, argv);
-
+ 
   ctkVTKSurfaceMaterialPropertyWidget propertyWidget(0);
   
   if (propertyWidget.isEnabled())
@@ -223,7 +223,7 @@ int ctkVTKSurfaceMaterialPropertyWidgetTest1(int argc, char * argv [] )
 
   propertyWidget.setBackfaceCulling(true);
   
-  if (property->GetBackfaceCulling() != true)
+  if (property->GetBackfaceCulling() != 1)
     {
     std::cerr << "ctkVTKSurfaceMaterialPropertyWidget::setBackfaceCulling() failed: "
               << property->GetBackfaceCulling() << std::endl;

+ 1 - 1
Libs/Visualization/VTK/Widgets/ctkVTKSurfaceMaterialPropertyWidget.cpp

@@ -198,7 +198,7 @@ void ctkVTKSurfaceMaterialPropertyWidget::onSpecularPowerChanged(double newSpecu
 }
 
 // --------------------------------------------------------------------------
-void ctkVTKSurfaceMaterialPropertyWidget::onBackfaceCullingChanged(double newBackfaceCulling)
+void ctkVTKSurfaceMaterialPropertyWidget::onBackfaceCullingChanged(bool newBackfaceCulling)
 {
   Q_D(ctkVTKSurfaceMaterialPropertyWidget);
   this->Superclass::onBackfaceCullingChanged(newBackfaceCulling);

+ 1 - 1
Libs/Visualization/VTK/Widgets/ctkVTKSurfaceMaterialPropertyWidget.h

@@ -59,7 +59,7 @@ protected:
   virtual void onDiffuseChanged(double newDiffuse);
   virtual void onSpecularChanged(double newSpecular);
   virtual void onSpecularPowerChanged(double newSpecularPower);
-  virtual void onBackfaceCullingChanged(double newBackfaceCulling);
+  virtual void onBackfaceCullingChanged(bool newBackfaceCulling);
 
 private:
   Q_DECLARE_PRIVATE(ctkVTKSurfaceMaterialPropertyWidget);

+ 36 - 16
Libs/Widgets/Resources/UI/ctkMaterialPropertyWidget.ui

@@ -121,6 +121,16 @@
      <property name="specularPower">
       <double>1.000000000000000</double>
      </property>
+     <property name="color">
+      <color alpha="0">
+       <red>255</red>
+       <green>255</green>
+       <blue>255</blue>
+      </color>
+     </property>
+     <property name="opacity">
+      <double>1.000000000000000</double>
+     </property>
      <property name="gridOpacity">
       <double>0.600000000000000</double>
      </property>
@@ -195,6 +205,9 @@
      <property name="maximum">
       <double>1.000000000000000</double>
      </property>
+     <property name="value">
+      <double>1.000000000000000</double>
+     </property>
     </widget>
    </item>
    <item row="0" column="0">
@@ -206,6 +219,13 @@
    </item>
    <item row="0" column="1" colspan="4">
     <widget class="ctkColorPickerButton" name="ColorPickerButton">
+     <property name="color">
+      <color>
+       <red>255</red>
+       <green>255</green>
+       <blue>255</blue>
+      </color>
+     </property>
      <property name="displayColorName">
       <bool>false</bool>
      </property>
@@ -326,21 +346,21 @@
     </hint>
    </hints>
   </connection>
-   <connection>
-     <sender>OpacitySliderSpinBox</sender>
-     <signal>valueChanged(double)</signal>
-     <receiver>MaterialPropertyPreviewLabel</receiver>
-     <slot>setOpacity(double)</slot>
-     <hints>
-       <hint type="sourcelabel">
-         <x>105</x>
-         <y>24</y>
-       </hint>
-       <hint type="destinationlabel">
-         <x>103</x>
-         <y>191</y>
-       </hint>
-     </hints>
-   </connection>
+  <connection>
+   <sender>OpacitySliderSpinBox</sender>
+   <signal>valueChanged(double)</signal>
+   <receiver>MaterialPropertyPreviewLabel</receiver>
+   <slot>setOpacity(double)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>105</x>
+     <y>24</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>103</x>
+     <y>191</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>