From: mzn Date: Fri, 6 Jun 2008 14:48:30 +0000 (+0000) Subject: Fix for bug IPAL19693(Qt4 porting: CRASH after applying "setPresentationType()"). X-Git-Tag: before_mergefrom_BR_Dev_For_4_0_07Jul08~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2faea040537e0c344fb7359fb4dde5a7aae3d834;p=modules%2Fvisu.git Fix for bug IPAL19693(Qt4 porting: CRASH after applying "setPresentationType()"). --- diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 9e1958f8..d3fb0c9e 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -1571,11 +1571,15 @@ module VISU { /*! Sets the type of presentation (vectors, deformed shape etc.) * which will be generated by the method generatePresentations. + * \note \c addField() method should be called before in order to add field + * with number theFieldNum. */ void setPresentationType(in long theFieldNum, in VISUType theType); /*! Gets the type of presentation (vectors, deformed shape etc.) which will - * be generated by the method generatePresentations. + * be generated by the method generatePresentations. + * \note \c addField() method should be called before in order to add field + * with number theFieldNum. */ VISUType getPresentationType(in long theFieldNum); diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index f7f5a08d..448c6222 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -1091,6 +1091,21 @@ VISU::ColoredPrs3d_ptr VISU_TimeAnimation::getPresentation(CORBA::Long theField, return myFieldsLst[theField].myPrs[theFrame]->_this(); } +//------------------------------------------------------------------------ +void VISU_TimeAnimation::setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType) { + if ( theFieldNum < 0 || theFieldNum >= myFieldsLst.size() ) + return; + + myFieldsLst[theFieldNum].myPrsType = theType; +} + +//------------------------------------------------------------------------ +VISU::VISUType VISU_TimeAnimation::getPresentationType(CORBA::Long theFieldNum) { + if ( theFieldNum < 0 || theFieldNum >= myFieldsLst.size() ) + return VISU::TNONE; + + return myFieldsLst[theFieldNum].myPrsType; +} //------------------------------------------------------------------------ CORBA::Long VISU_TimeAnimation::getNbFrames() { diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index d9fbbdc0..09221faa 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -123,10 +123,8 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QThread VISU::ColoredPrs3d_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame); - void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType) - { myFieldsLst[theFieldNum].myPrsType = theType; } - VISU::VISUType getPresentationType(CORBA::Long theFieldNum) - { return myFieldsLst[theFieldNum].myPrsType; } + void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType); + VISU::VISUType getPresentationType(CORBA::Long theFieldNum); void setSpeed(CORBA::Long theSpeed); CORBA::Long getSpeed() { return mySpeed; }