From: vsr Date: Tue, 23 Nov 2010 16:51:21 +0000 (+0000) Subject: Merge from V5_1_5_BR 23/11/2010 X-Git-Tag: V5_1_main_20101125 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7a10b9cbc6bbcd4a0d13e8426de1231e766a3757;p=modules%2Fvisu.git Merge from V5_1_5_BR 23/11/2010 --- diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index a14d401e..ec81c1fd 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -517,3 +517,12 @@ VISU_ColoredPL GetSourceRange( aRange ); SetScalarRange( aRange ); } + +//---------------------------------------------------------------------------- +void +VISU_ColoredPL +::UpdateMapperLookupTable() +{ + //rnv: This method update pointer to the myMapperTable in the MapperHolder + GetMapperHolder()->SetLookupTable(GetMapperTable()); +} diff --git a/src/PIPELINE/VISU_ColoredPL.hxx b/src/PIPELINE/VISU_ColoredPL.hxx index e5771969..a43c157e 100644 --- a/src/PIPELINE/VISU_ColoredPL.hxx +++ b/src/PIPELINE/VISU_ColoredPL.hxx @@ -141,6 +141,11 @@ public: void SetSourceRange(); + virtual + void + UpdateMapperLookupTable(); + + protected: //---------------------------------------------------------------------------- VISU_ColoredPL(); diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index 61b0e2e2..b67b34b7 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -612,6 +612,10 @@ Input value precision can be adjusted using WRN_NO_APPROPRIATE_SELECTION No appropriate objects selected + + VISU_PLUGINS_OTHER + VISU plugins + VisuGUI diff --git a/src/VISUGUI/VISU_msg_fr.ts b/src/VISUGUI/VISU_msg_fr.ts index 30953b5c..6f07d2eb 100755 --- a/src/VISUGUI/VISU_msg_fr.ts +++ b/src/VISUGUI/VISU_msg_fr.ts @@ -611,6 +611,10 @@ le '%1' paramètre des préférences du module Post-Pro. WRN_NO_APPROPRIATE_SELECTION Les objets appropriés ne sont pas choisis + + VISU_PLUGINS_OTHER + Extensions VISU + VisuGUI diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index fd8d1557..3b23f2c8 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -24,7 +24,10 @@ // File : VisuGUI.cxx // Author : // Module : VISU -// + +#include // E.A. must be included before Python.h to fix compilation on windows +#include "Python.h" + #include "VisuGUI.h" // STL Includes @@ -3657,6 +3660,21 @@ VisuGUI setMenuShown( true ); setToolShown( true ); + // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module) + PyGILState_STATE gstate = PyGILState_Ensure(); + PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager"); + if(pluginsmanager==NULL) + PyErr_Print(); + else + { + PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str()); + if(result==NULL) + PyErr_Print(); + Py_XDECREF(result); + } + PyGILState_Release(gstate); + // end of GEOM plugins loading + // Reset actions accelerator keys QList shortcuts; shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) ); diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 30c672db..bfbcfc7a 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -1150,6 +1150,13 @@ namespace for (long aFrameId = 1; aFrameId < theData.myNbFrames; aFrameId++){ VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId]; aColoredPrs3d->SameAs(aPrs3d); + // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation. + // special case for the "Gauss Points" presentation, + // update the LookupTable in the mapper, after assign properties of the presentation + // using SameAs(...) method. + if(theData.myPrsType == VISU::TGAUSSPOINTS) { + aColoredPrs3d->UpdateMapperLookupTable(); + } } if ( theAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) { @@ -1158,7 +1165,15 @@ namespace for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId]; std::string aTitle = aColoredPrs3d->GetCTitle(); - aColoredPrs3d->SameAs(aPrs3d); + aColoredPrs3d->SameAs(aPrs3d); + // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation. + // special case for the "Gauss Points" presentation, + // update the LookupTable in the mapper, after assign properties of the presentation + // using SameAs(...) method. + if(theData.myPrsType == VISU::TGAUSSPOINTS) { + aColoredPrs3d->UpdateMapperLookupTable(); + } + aColoredPrs3d->SetTitle(aTitle.c_str()); } } diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 82ae9dfd..532e18dd 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -673,6 +673,15 @@ VISU::ColoredPrs3dCache_i aPrs3d->SameAs(thePrs); + // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation. + // special case for the "Gauss Points" presentation, + // update the LookupTable in the mapper, after assign properties of the presentation + // using SameAs(...) method. + VISU::GaussPoints_i* gPoints = dynamic_cast( aPrs3d.get() ); + if(gPoints) { + gPoints->UpdateMapperLookupTable(); + } + // special case for deformed shape VISU::DeformedShapeAndScalarMap_i* dShape = dynamic_cast( aPrs3d.get() ); diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index cbf800a3..3b32d82e 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -2158,3 +2158,12 @@ VISU::ColoredPrs3d_i //---------------------------------------------------------------------------- +void +VISU::ColoredPrs3d_i +::UpdateMapperLookupTable() +{ + ProcessVoidEvent(new TVoidMemFunEvent + (GetSpecificPL(), &VISU_ColoredPL::UpdateMapperLookupTable)); +} + +//----------------------------------------------------------------------------^ diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index ae796d2f..dbae3b8b 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -628,6 +628,11 @@ namespace VISU SetValLblFontColor( const vtkFloatingPointType theR, const vtkFloatingPointType theG, const vtkFloatingPointType theB ); + + virtual + void + UpdateMapperLookupTable(); + //---------------------------------------------------------------------------- protected: