]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Mistakes in implementation of absolute/relative cutlines length option corrected
authorepa <epa@opencascade.com>
Tue, 31 Oct 2006 16:10:50 +0000 (16:10 +0000)
committerepa <epa@opencascade.com>
Tue, 31 Oct 2006 16:10:50 +0000 (16:10 +0000)
src/VISU_I/VISU_CutLines_i.cc

index e650bda06998c911a1ffc4de18bcdfa013f98bf6..bdc199d49327cca8ef9749f1f07d47de950647cc 100644 (file)
@@ -387,11 +387,14 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
       if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
       aLineIdCont[iLine] = jLine++;
       TXYMap& aXYMap = aXYMapCont[iLine];
-      vtkFloatingPointType aPnt[3], aVect[3], aDist, aTopBnd;
+      vtkFloatingPointType aPnt[3], aVect[3], aDist, aTopBnd, aDivide;
       aTopBnd = aBoundPrjLn[2];
+      aDivide = aBoundPrjLn[2];
       if( !IsUseAbsoluteLength() ){
         aTopBnd = 1.0;
       }
+      else aDivide = 1.0;
+
       for(int i = 0; i < aNbPoints; i++){
        aDataSet->GetPoint(i,aPnt);
        Sub(aPnt,aBasePnt,aVect);
@@ -399,7 +402,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
          aDist = 0.5;
        else
          {
-           aDist = vtkMath::Dot(aVect,aDirLn)/aTopBnd
+           aDist = vtkMath::Dot(aVect,aDirLn)/aDivide
            // the workaround
            if(aDist < 0.0) aDist = 0.0; 
            if(aDist > aTopBnd) aDist = aTopBnd;
@@ -438,7 +441,11 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
            // Warning: value '1.0' come from workaround:
            // see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
            // aDist >= 0 and aDist<=1.0
-           aNewXYMap[1.0 - *aIter] = aXYMap[*aIter];
+           vtkFloatingPointType aTopBnd = aBoundPrjLn[2];
+           if( !IsUseAbsoluteLength() ){
+             aTopBnd = 1.0;
+           }
+           aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter];
          }
          TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin();
          aXYMap.clear();