]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL14552:
authorenk <enk@opencascade.com>
Mon, 22 Jan 2007 11:55:23 +0000 (11:55 +0000)
committerenk <enk@opencascade.com>
Mon, 22 Jan 2007 11:55:23 +0000 (11:55 +0000)
Application hangs up after trying to set negative value of the planes for the CutPlanes presentation.

src/PIPELINE/VISU_CutPlanesPL.cxx

index 91a2f6492ad2b70716c57bf7f68adcbdddeadb8f..b858181d4c7e433b91d16ba6178c3a6b16a00422 100644 (file)
@@ -36,6 +36,8 @@
 using namespace std;
 
 static vtkFloatingPointType EPS = 1.0E-3;
+static int MIN_NB_PLANES = 1;
+static int MAX_NB_PLANES = 100;
 
 vtkStandardNewMacro(VISU_CutPlanesPL);
 
@@ -261,7 +263,7 @@ void
 VISU_CutPlanesPL
 ::SetNbParts(int theNb) 
 {
-  myNbParts = theNb;
+  myNbParts = (theNb<MIN_NB_PLANES?MIN_NB_PLANES:(theNb>MAX_NB_PLANES?MAX_NB_PLANES:theNb));
   myPartPosition.resize(myNbParts);
   myPartCondition.resize(myNbParts,1);
   Modified();