]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug IPAL19693(Qt4 porting: CRASH after applying "setPresentationType()").
authormzn <mzn@opencascade.com>
Fri, 6 Jun 2008 14:48:30 +0000 (14:48 +0000)
committermzn <mzn@opencascade.com>
Fri, 6 Jun 2008 14:48:30 +0000 (14:48 +0000)
idl/VISU_Gen.idl
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.h

index 9e1958f81ca9824a65e117903946e1505c60f096..d3fb0c9ed93fcf717466b3fa4970563eaa0a098a 100644 (file)
@@ -1571,11 +1571,15 @@ module VISU {
 
     /*! Sets the type of presentation (vectors, deformed shape etc.)
      *  which will be generated by the method <VAR>generatePresentations</VAR>.
+     *  \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 <VAR>generatePresentations</VAR>.
+     *  be generated by the method <VAR>generatePresentations</VAR>.
+     *  \note \c addField() method should be called before in order to add field
+     *  with number theFieldNum.
      */
     VISUType getPresentationType(in long theFieldNum);
 
index f7f5a08dedcac1f3d68664b9c616ed5a57f989b0..448c6222ab36bd64069962b260c10645433db2ac 100644 (file)
@@ -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() {
index d9fbbdc0f3aab2112d1f9d6aea17a12a44d26daf..09221faad4bafc848d8946b7b3f53134fb8e109f 100644 (file)
@@ -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; }