]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL17688
authorapo <apo@opencascade.com>
Fri, 23 Nov 2007 07:50:47 +0000 (07:50 +0000)
committerapo <apo@opencascade.com>
Fri, 23 Nov 2007 07:50:47 +0000 (07:50 +0000)
  TC71: REGR: Preferences - ?Generate data table? works wrong

src/VISUGUI/VisuGUI_CutLinesDlg.cxx

index fca17c189417eb7ebe67627812bc7a831e777adf..554ba78d0ff5fcfafb30c44190ca57c32930efd0 100644 (file)
@@ -306,8 +306,8 @@ void VisuGUI_CutLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
   hasInit = true;
   myCutLines = VISU::TSameAsFactory<VISU::TCUTLINES>().Create(myPrsCopy, VISU::ColoredPrs3d_i::EDoNotPublish);
   myCutLines->CopyCurvesInverted(myPrsCopy->GetCurvesInverted());
-  if (myCutLines->IsAllCurvesInverted())
-    myAllCurvesInvertedCheck->setChecked(true);
+  myAllCurvesInvertedCheck->setChecked( myCutLines->IsAllCurvesInverted() );
+  myUseAbsoluteLengthCheck->setChecked( myCutLines->IsUseAbsoluteLength() );
   myBasePlanePos->setText( QString::number(myCutLines->GetBasePlanePosition()) );
   myCBSetDef->setChecked(myPrsCopy->IsDefault());
   DrawTable();
@@ -351,10 +351,12 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
   for (int i = 0; i < (int)myNbSpn->value(); ++i) {
     if (!((QCheckTableItem*)myPosTable->item( i, 1 ))->isChecked())
       myPrsCopy->SetLinePosition( i, myPosTable->text( i, 0 ).toDouble() );
-    else myPrsCopy->SetDefaultPosition(i);
+    else 
+      myPrsCopy->SetDefaultPosition(i);
   }
-  if (myAllCurvesInvertedCheck->isChecked())
-    myPrsCopy->SetAllCurvesInverted(true);
+
+  myPrsCopy->SetAllCurvesInverted( myAllCurvesInvertedCheck->isChecked() );
+  myPrsCopy->SetUseAbsoluteLength( myUseAbsoluteLengthCheck->isChecked() );
 
   VISU::TSameAsFactory<VISU::TCUTLINES>().Copy(myPrsCopy, thePrs);
 
@@ -757,14 +759,11 @@ void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
  */
 void VisuGUI_CutLinesDlg::onAllCurvesInvertedCheck(bool theInvert)
 {
-  if (myAllCurvesInvertedCheck->isChecked()){
-    myCutLines->SetAllCurvesInverted(true);
-    myPrsCopy->SetAllCurvesInverted(true);
-  }
-  else {
-    myCutLines->SetAllCurvesInverted(false);
-    myPrsCopy->SetAllCurvesInverted(false);
-  }
+  bool anIsAllCurvesInverted = myAllCurvesInvertedCheck->isChecked();
+
+  myCutLines->SetAllCurvesInverted( anIsAllCurvesInverted );
+  myPrsCopy->SetAllCurvesInverted( anIsAllCurvesInverted );
+
   updateGlyphs(true);
 }