Salome HOME
projects
/
modules
/
med.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[MEDCalc] : better slices + more error handling when invalid params
[modules/med.git]
/
src
/
MEDCalc
/
cmp
/
MEDPresentationContour.cxx
diff --git
a/src/MEDCalc/cmp/MEDPresentationContour.cxx
b/src/MEDCalc/cmp/MEDPresentationContour.cxx
index d8b6b48d8a565280308ee5433930e21a9230f636..ee4628505aef623b148b0ff522c007eebc8cff3b 100644
(file)
--- a/
src/MEDCalc/cmp/MEDPresentationContour.cxx
+++ b/
src/MEDCalc/cmp/MEDPresentationContour.cxx
@@
-66,6
+66,12
@@
MEDPresentationContour::internalGeneratePipeline()
STDLOG(msg);
throw KERNEL::createSalomeException(msg);
}
STDLOG(msg);
throw KERNEL::createSalomeException(msg);
}
+ if (_params.nbContours < 1)
+ {
+ const char * mes = "Invalid number of contours!";
+ STDLOG(mes);
+ throw KERNEL::createSalomeException(mes);
+ }
setOrCreateRenderView(); // instanciate __viewXXX
setOrCreateRenderView(); // instanciate __viewXXX
@@
-103,7
+109,15
@@
MEDPresentationContour::updatePipeline(const MEDCALC::ContourParameters& params)
updateColorMap<MEDPresentationContour, MEDCALC::ContourParameters>(params.colorMap);
if (params.nbContours != _params.nbContours)
updateColorMap<MEDPresentationContour, MEDCALC::ContourParameters>(params.colorMap);
if (params.nbContours != _params.nbContours)
- updateNbContours(params.nbContours);
+ {
+ if (params.nbContours < 1)
+ {
+ const char * mes = "Invalid number of contours!";
+ STDLOG(mes);
+ throw KERNEL::createSalomeException(mes);
+ }
+ updateNbContours(params.nbContours);
+ }
}
void
}
void