TSCALARMAP, /*!< Scalarmap 3D presentation object */
TISOSURFACE, /*!< Iso surface 3D presentation object */
TDEFORMEDSHAPE, /*!< Deformed shape 3D presentation object */
+ TSCALARMAPONDEFORMEDSHAPE, /*!< Scalar map on deformed shape 3D presentation object */
TGAUSSPOINTS, /*!< Gauss Points 3D presentation object */
TPLOT3D, /*!< Plot3D 3D presentation object */
TCUTPLANES, /*!< Cut planes 3D presentation object */
void SetColor(in SALOMEDS::Color theColor);
};
+ //-------------------------------------------------------
+ /*! \brief Scalar Map on Deformed shape presentation interface
+ *
+ * Presentation parameters of the scalar map on deformed shape presentation.
+ */
+ interface ScalarMapOnDeformedShape : ScalarMap {
+
+ /*!
+ * Sets the source ranges of pipeline
+ */
+ void SetSourceRange(in double theMinRange,in double theMaxRange);
+ /*!
+ * Gets the minimum source range of pipeline
+ */
+ double GetSourceRangeMin();
+ /*!
+ * Gets the maximum source range of pipeline
+ */
+ double GetSourceRangeMax();
+
+ /*!
+ * Sets the scale of the presentatable object.
+ * \param theScale Double value defining the scale of this presentable object.
+ */
+ void SetScale(in double theScale);
+
+ /*!
+ * Gets the scale of the presentatable object.
+ */
+ double GetScale();
+
+ };
//-------------------------------------------------------
/*!
* \brief Plot3D interface
<popup-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4020" pos-id="" label-id="Scalar Map on Deformed Shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************* Selection (menubar) ************************************** -->
<toolbutton-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="Cut Lines" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="Stream Lines" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="Plot 3D" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4020" pos-id="" label-id="Scalar map on deformed shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="Scalar Map on Deformed Shape" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
</desktop> <!-- DESKTOP END -->
<popup-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4020" pos-id="" label-id="Scalar Map on Deformed Shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************* Selection (menubar) ************************************** -->
<toolbutton-item item-id="4018" pos-id="" label-id="Cut Lines" icon-id="Visu_cutlines.png" tooltip-id="Cut Lines" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4016" pos-id="" label-id="Stream Lines" icon-id="Visu_streamlines.png" tooltip-id="Stream Lines" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="4017" pos-id="" label-id="Plot 3D" icon-id="Visu_plot3d.png" tooltip-id="Plot 3D" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4020" pos-id="" label-id="Scalar map on deformed shape" icon-id="Visu_scalarmapondeformedshape.png" tooltip-id="Scalar Map on Deformed Shape" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
</desktop> <!-- DESKTOP END -->
VISU_ScalarBarCtrl.hxx \
VISU_PlanesWidget.hxx \
VISU_SphereWidget.hxx \
- VISU_WidgetCtrl.hxx
+ VISU_WidgetCtrl.hxx \
+ VISU_ScalarMapOnDeformedShapePL.hxx
# Libraries targets
VISU_PlanesWidget.cxx \
VISU_SphereWidget.cxx \
VISU_WidgetCtrl.cxx \
- VISU_ScalarBarCtrl.cxx
+ VISU_ScalarBarCtrl.cxx \
+ VISU_ScalarMapOnDeformedShapePL.cxx
# Executables targets
--- /dev/null
+// VISU ScalarMapOnDeformedShapePL
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File: VISU_ScalarMapOnDeformedShapePL.cxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "VISU_DeformedShapePL.hxx"
+#include "VISU_PipeLineUtils.hxx"
+#include "VTKViewer_TransformFilter.h"
+#include "VTKViewer_Transform.h"
+
+#include <vtkWarpVector.h>
+#include <vtkMergeFilter.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkCellDataToPointData.h>
+#include <vtkPointDataToCellData.h>
+
+#include <VISU_Convertor.hxx>
+
+vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL)
+
+/*!
+ * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
+ * Where:
+ * \li myDeformVectors is vtkWarpVector - deformation vectors data
+ * \li myMergeFilter is vtkMergeFilter - merge filter.
+ * Merge filter which unify the deformation and scalars
+ * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
+*/
+VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){
+ myDeformVectors = vtkWarpVector::New();
+ myMergeFilter = vtkMergeFilter::New();
+ myExtractorScalars = VISU_Extractor::New();
+ myCellDataToPointData = vtkCellDataToPointData::New();
+}
+
+/*!
+ * Destructor.
+ * Delete all fields.
+*/
+VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){
+ myDeformVectors->UnRegisterAllOutputs();
+ myDeformVectors->Delete();
+
+ myMergeFilter->UnRegisterAllOutputs();
+ myMergeFilter->Delete();
+
+ myExtractorScalars->UnRegisterAllOutputs();
+ myExtractorScalars->Delete();
+
+ myCellDataToPointData->UnRegisterAllOutputs();
+ myCellDataToPointData->Delete();
+}
+
+/*!
+ * Initial method
+ */
+void VISU_ScalarMapOnDeformedShapePL::Init(){
+
+ if (GetScalars() == NULL) SetScalars(GetInput2());
+
+ Superclass::Init();
+
+ float aScalarRange[2];
+ GetSourceRange(aScalarRange);
+ static double EPS = 1.0 / VTK_LARGE_FLOAT;
+ if(aScalarRange[1] > EPS)
+ SetScale(VISU_DeformedShapePL::GetScaleFactor(GetInput2())/aScalarRange[1]);
+ else
+ SetScale(0.0);
+
+ myMapper->SetColorModeToMapScalars();
+ myMapper->ScalarVisibilityOn();
+
+ // Sets input for field transformation filter
+ myFieldTransform->SetInput(myExtractor->GetOutput());
+
+}
+
+/*!
+ * Build method
+ * Building of deformation and puts result to merge filter.
+ */
+void VISU_ScalarMapOnDeformedShapePL::Build()
+{
+ // Set input for extractor
+ myExtractor->SetInput(GetInput2());
+
+ VISU::CellDataToPoint(myDeformVectors,myCellDataToPointData,
+ GetInput2(),myFieldTransform);
+
+ // Sets geometry for merge filter
+ myMergeFilter->SetGeometry(myDeformVectors->GetOutput());
+ // Sets data to mapper
+ myMapper->SetInput(myMergeFilter->GetOutput());
+}
+
+/*!
+ * Update method
+ */
+void VISU_ScalarMapOnDeformedShapePL::Update(){
+ this->UpdateScalars();
+
+ float aRange[2];
+ GetSourceRange(aRange);
+ float aScalarRange[2] = {aRange[0], aRange[1]};
+
+ if(myBarTable->GetScale() == VTK_SCALE_LOG10)
+ VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
+ myMapperTable->SetRange(aScalarRange);
+
+ myMapperTable->Build();
+ myBarTable->Build();
+
+ myMapper->SetLookupTable(myMapperTable);
+ myMapper->SetScalarRange(aScalarRange);
+
+ VISU_PipeLine::Update();
+}
+
+/*!
+ * Update scalars method.
+ * Put scalars to merge filter.
+ */
+void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){
+ if(myScalars->GetCellData()->GetVectors() != NULL ||
+ myScalars->GetPointData()->GetVectors() != NULL)
+ myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
+ else
+ myMergeFilter->SetScalars(GetScalars());
+}
+
+/*!
+ * Copy information about pipline.
+ * Copy scale and scalars.
+ */
+void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+ VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
+ if(aPipeLine){
+ SetScale(aPipeLine->GetScale());
+ SetScalars(aPipeLine->GetScalars());
+ float aRange[2];
+ aPipeLine->GetSourceRange(aRange);
+ SetScalarRange(aRange);
+ }
+ Superclass::ShallowCopy(thePipeLine);
+}
+
+/*!
+ * Set scalars.
+ * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
+ */
+void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){
+ myScalars = theScalars;
+ vtkUnstructuredGrid* aScalars = GetScalars();
+ myExtractorScalars->SetInput(aScalars);
+ Modified();
+}
+
+/*!
+ * Get pointer to input scalars.
+ */
+vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){
+ return myScalars.GetPointer();
+}
+
+/*!
+ * Sets scale for deformed shape
+ */
+void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) {
+ if(myScaleFactor == theScale) return;
+ myScaleFactor = theScale;
+ myDeformVectors->SetScaleFactor(myScaleFactor);
+ Modified();
+}
+
+/*!
+ * Gets scale of deformed shape.
+ */
+float VISU_ScalarMapOnDeformedShapePL::GetScale() {
+ float aScale=myDeformVectors->GetScaleFactor();
+ return aScale;
+}
+
+/*!
+ * Set scale factor of deformation.
+ */
+void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){
+ myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale);
+ Modified();
+}
+
+/*!
+ * Gets scalar mode.
+ */
+int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){
+ int aMode=myExtractorScalars->GetScalarMode();
+ return aMode;
+}
+
+/*!
+ * Sets scalar mode.
+ */
+void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){
+ myExtractorScalars->SetScalarMode(theScalarMode);
+ Modified();
+}
+
+/*!
+ * Gets ranges of extracted scalars
+ * \param theRange[2] - output values
+ * \li theRange[0] - minimum value
+ * \li theRange[1] - maximum value
+ */
+void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){
+ myExtractorScalars->Update();
+ myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange);
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File: VISU_ScalarMapOnDeformedShapePL.hxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile
+#define VISU_ScalarMapOnDeformedShapePL_HeaderFile
+
+#include "VISU_ScalarMapPL.hxx"
+
+class vtkMergeFilter;
+class vtkWarpVector;
+class vtkUnstructuredGrid;
+class vtkCellDataToPointData;
+class vtkPointDataToCellData;
+
+class VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
+{
+protected:
+ VISU_ScalarMapOnDeformedShapePL();
+
+ virtual ~VISU_ScalarMapOnDeformedShapePL();
+
+ VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
+public:
+ vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL,VISU_ScalarMapPL);
+
+ static VISU_ScalarMapOnDeformedShapePL* New();
+
+ virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual void SetScale(float theScale);
+ virtual float GetScale();
+
+ virtual int GetScalarMode();
+ virtual void SetScalarMode(int theScalarMode = 0);
+
+ virtual void GetSourceRange(float theRange[2]);
+
+ virtual void SetScalars(vtkDataSet *theScalars);
+ virtual vtkUnstructuredGrid* GetScalars();
+
+public:
+ //! Redefined method for initialization of the pipeline.
+ virtual
+ void
+ Init();
+
+ //! Redefined method for building the pipeline.
+ virtual
+ void
+ Build();
+
+ //! Redefined method for updating the pipeline.
+ virtual
+ void
+ Update();
+
+ //! Update scalars.
+ void
+ UpdateScalars();
+
+ virtual void SetMapScale(float theMapScale = 1.0);
+
+protected:
+ float myScaleFactor;
+ vtkWarpVector *myDeformVectors;
+ vtkMergeFilter *myMergeFilter;
+ vtkSmartPointer<vtkUnstructuredGrid> myScalars;
+ VISU_Extractor* myExtractorScalars;
+ vtkCellDataToPointData* myCellDataToPointData;
+};
+
+#endif
VisuGUI_StreamLinesDlg.cxx \
VisuGUI_VectorsDlg.cxx \
VisuGUI_Displayer.cxx \
+ VisuGUI_ScalarMapOnDeformedShapeDlg.cxx \
VisuGUI_SetupPlot2dDlg.cxx \
VisuGUI_BuildProgressDlg.cxx \
VisuGUI_TransparencyDlg.cxx \
VisuGUI_CutPlanesDlg.h \
VisuGUI_StreamLinesDlg.h \
VisuGUI_VectorsDlg.h \
+ VisuGUI_ScalarMapOnDeformedShapeDlg.h \
VisuGUI_SetupPlot2dDlg.h \
VisuGUI_BuildProgressDlg.h \
VisuGUI_TransparencyDlg.h
msgid "ICON_DEFORMED_SHAPE"
msgstr "Visu_deformed.png"
+msgid "ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"
+msgstr "Visu_scalarmapondeformedshape.png"
+
msgid "ICON_VECTORS"
msgstr "Visu_vectors.png"
msgid "ICON_DEFORMED_SHAPE"
msgstr "Visu_deformed.png"
+msgid "ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"
+msgstr "Visu_scalarmapondeformedshape.png"
+
msgid "ICON_VECTORS"
msgstr "Visu_vectors.png"
msgid "VisuGUI::MEN_DEFORMED_SHAPE"
msgstr "Deformed Shape"
+msgid "VisuGUI::MEN_SCALAR_MAP_ON_DEFORMED_SHAPE"
+msgstr "Scalar Map on Deformed Shape"
+
msgid "VisuGUI::MEN_VISUALIZATION"
msgstr "Visualization"
msgstr "Scale Factor:"
+#: VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::DLG_TITLE"
+msgstr "Scalar Map on Deformed Shape"
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::&Cancel"
+msgstr ""
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::&OK"
+msgstr ""
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"
+msgstr "Scalar Map on Deformed Shape"
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_BAR_TAB"
+msgstr "Scalar Bar"
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALE_FACTOR"
+msgstr "Scale Factor:"
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::FIELD_ITEM"
+msgstr "Fields"
+
+msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::TIMESTAMP_ITEM"
+msgstr "Time stamp"
+
#: VisuGUI_EditContainerDlg.cxx
msgid "VisuGUI_EditContainerDlg::&Cancel"
#include "VISU_DeformedShape_i.hh"
#include "VisuGUI_DeformedShapeDlg.h"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+
#include "VISU_IsoSurfaces_i.hh"
#include "VisuGUI_IsoSurfacesDlg.h"
CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
}
+void
+VisuGUI::
+OnCreateScalarMapOnDeformedShape()
+{
+ CreatePrs3d<VISU::ScalarMapOnDeformedShape_i,VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this);
+}
+
void
VisuGUI::
OnCreateVectors()
}
}
+void
+VisuGUI::
+OnEditScalarMapOnDeformedShape()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+ EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this, aPrs3d);
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}
void
VisuGUI::
UpdateViewer(this, aSameDeformed);
}
break;
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ {
+ VISU::ScalarMapOnDeformedShape_i* aDefPrs = dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
+ VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed = new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
+ aSameScalarMapOnDeformed->SameAs(aDefPrs);
+ UpdateViewer(this, aSameScalarMapOnDeformed);
+ }
+ break;
case VISU::TCUTPLANES:
{
VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
this, SLOT(OnCreateDeformedShape()));
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"));
+ createAction( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, tr("MEN_SCALAR_MAP_ON_DEFORMED_SHAPE"), QIconSet(aPixmap),
+ tr("MEN_SCALAR_MAP_ON_DEFORMED_SHAPE"), "", 0, aParent, false,
+ this, SLOT(OnCreateScalarMapOnDeformedShape()));
+
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
tr("MEN_VECTORS"), "", 0, aParent, false,
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
this, SLOT(OnEditPlot3D()));
+ createAction( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditScalarMapOnDeformedShape()));
+
createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
+ createMenu( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, aMenuId, 10 ); // scalar map on deformed shape
aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
createTool( VISU_CUT_LINES, aToolId );
createTool( VISU_STREAM_LINES, aToolId );
createTool( VISU_PLOT_3D, aToolId );
+ createTool( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, aToolId );
aToolId = createTool(tr("TOOL_REPRESENTATION"));
createTool( VISU_POINTS, aToolId );
mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
+ mgr->insert( action( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE ), -1, -1, -1 ); // scalar map on deformed shape
mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
// rename
// Rules
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
- "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'");
+ "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'");
// VISU root commands
QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
mgr->setRule( action( VISU_VECTORS ), aRule, true );
mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
+ mgr->setRule( action( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE ), aRule, true );
// display/erase commands
QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
QString aSurfType = " and $type in {'VISU::TMESH'}";
QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
- "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D'}";
+ "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
- "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'}";
+ "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' }";
aRule = "selcount=1";
mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType, true );
"selcount=1 and type='VISU::TSCALARMAP'", true );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
"selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
+ mgr->setRule( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ),
+ "selcount=1 and type='VISU::TSCALARMAPONDEFORMEDSHAPE'", true );
mgr->setRule( action( VISU_EDIT_CUTPLANES ),
"selcount=1 and type='VISU::TCUTPLANES'", true );
mgr->setRule( action( VISU_EDIT_CUTLINES ),
void OnCreatePlot3D();
void OnCreateManyMesh();
void OnCreatePlot2dView();
+ void OnCreateScalarMapOnDeformedShape();
void OnEditScalarMap();
void OnEditDeformedShape();
void OnEditVectors();
void OnEditStreamLines();
void OnEditPlot3D();
+ void OnEditScalarMapOnDeformedShape();
virtual void OnDisplayPrs();
virtual void OnDisplayOnlyPrs();
#define VISU_CUT_LINES 4017
#define VISU_PLOT2D 4018
#define VISU_PLOT_3D 4019
+#define VISU_SCALAR_MAP_ON_DEFORMED_SHAPE 40110
//#define VISU_DELETE 4021
#define VISU_DELETE_OBJS 4022
#define VISU_EDIT_VECTORS 40625
#define VISU_EDIT_STREAMLINES 40626
#define VISU_EDIT_PLOT3D 40627
+#define VISU_EDIT_SCALARMAPONDEFORMEDSHAPE 40628
#define VISU_EDIT_PRS 4062
#define VISU_CREATE_TABLE 4063
ENUM2STRING( aResStr, VISU::TSCALARMAP );
ENUM2STRING( aResStr, VISU::TISOSURFACE );
ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
+ ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
ENUM2STRING( aResStr, VISU::TCUTPLANES );
ENUM2STRING( aResStr, VISU::TCUTLINES );
ENUM2STRING( aResStr, VISU::TVECTORS );
changeRange( 0 );
}
+/*!
+ Sets default values and range mode
+*/
+void VisuGUI_ScalarBarPane::setDefaultRange(double imin, double imax){
+ Rmin = imin;
+ Rmax = imax;
+}
+
/*!
Sets size and position
*/
~VisuGUI_ScalarBarPane() {};
void setRange( double imin, double imax, /*double fmin, double fmax,*/ bool sbRange );
+ void setDefaultRange(double imin, double imax);
bool isIRange() {return RBIrange->isChecked();}
double getMin() {return MinEdit->text().toDouble();}
double getMax() {return MaxEdit->text().toDouble();}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+#include "VisuGUI_Tools.h"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "SalomeApp_Module.h"
+#include "LightApp_SelectionMgr.h"
+#include "SUIT_Desktop.h"
+#include "VISU_ScalarMapPL.hxx"
+
+#include "SALOME_ListIO.hxx"
+
+#include "VISU_Convertor.hxx"
+
+#include "SALOMEDSClient_AttributeComment.hxx"
+#include "SALOMEDSClient_AttributeName.hxx"
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+
+using namespace std;
+
+#define MYDEBUG 0
+
+/*!
+ * Constructor
+ */
+VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
+ : QDialog(VISU::GetDesktop(theModule), "VisuGUI_ScalarMapOnDeformedShapeDlg", false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myVisuGUI(theModule)
+{
+ myPrs = NULL;
+ setCaption(tr("DLG_TITLE"));
+ setSizeGripEnabled(TRUE);
+
+ QVBoxLayout* TopLayout = new QVBoxLayout (this);
+ TopLayout->setSpacing(6);
+ TopLayout->setMargin(11);
+
+ QTabWidget* aTabBox = new QTabWidget (this);
+
+ // Scalar Map on Deformed shape pane
+ QVBox* aBox = new QVBox (this);
+ aBox->setMargin(11);
+ QFrame* TopGroup = new QFrame (aBox, "TopGroup");
+ TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ TopGroup->setLineWidth(1);
+ QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
+ TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ TopGroupLayout->setSpacing(6);
+ TopGroupLayout->setMargin(11);
+
+ // Scale factor
+ QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup, "ScaleLabel");
+ TopGroupLayout->addWidget(ScaleLabel, 0, 0);
+
+ ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
+ ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ ScalFact->setPrecision(5);
+ ScalFact->setValue(0.1);
+ TopGroupLayout->addWidget(ScalFact, 0, 1);
+
+ // Fields combo box
+ QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup, "FieldLabel");
+ myFieldsCombo = new QComboBox (TopGroup,"Fields");
+
+ TopGroupLayout->addWidget(FieldLabel, 1, 0);
+ TopGroupLayout->addWidget(myFieldsCombo,1,1);
+
+ // TimeStamps combo box
+ QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
+ myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
+
+ TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
+ TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
+
+ //
+ aTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
+
+ // Scalar bar pane
+ myScalarPane = new VisuGUI_ScalarBarPane (this, false);
+ myScalarPane->setMargin(5);
+
+ aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
+
+ // Buttons
+ QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons");
+ GroupButtons->setGeometry(QRect(10, 10, 281, 48));
+ GroupButtons->setColumnLayout(0, Qt::Vertical);
+ GroupButtons->layout()->setSpacing(0);
+ GroupButtons->layout()->setMargin(0);
+ QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
+ GroupButtonsLayout->setAlignment(Qt::AlignTop);
+ GroupButtonsLayout->setSpacing(6);
+ GroupButtonsLayout->setMargin(11);
+
+ QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk");
+ buttonOk->setAutoDefault(TRUE);
+ buttonOk->setDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+
+ GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding,
+ QSizePolicy::Minimum), 0, 1);
+
+ QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
+ buttonCancel->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+
+ // Add Tab box and Buttons to the top layout
+ TopLayout->addWidget(aTabBox);
+ TopLayout->addWidget(GroupButtons);
+
+ // signals and slots connections
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
+ connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
+
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim)
+{
+ myPrs = thePrs;
+
+ setFactor(thePrs->GetScale());
+ myTimeStampsCombo->setDisabled(isAnim);
+
+ QString aFieldName(thePrs->GetScalarFieldName());
+ float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetScalarIteration());
+ QString aIteration(QString("%1").arg(aIterFloat));
+
+ if (myMeshFieldsTimes.size() == 0)
+ {
+ // find all fields and time stamps on it
+ _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
+ LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
+ SALOME_ListIO selected;
+ aSel->selectedObjects(selected);
+ if (selected.Extent() > 0) {
+ Handle(SALOME_InteractiveObject) aIO = selected.First();
+ if (aIO->hasEntry()) {
+ _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ mySelectionObj = aSObject;
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
+ VISU::Result_var aResult;
+ if (CORBA::is_nil(anObject)) {
+ mySelectionObj = mySelectionObj->GetFather();
+ }
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap(strIn,aMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+ if (isExist) {
+ if ((aType == VISU::TTIMESTAMP)) {
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ QString aMeshName = VISU::getValue(aChildSObj,"myMeshName");
+ if(QString(thePrs->GetMeshName().c_str()) != aMeshName) continue;
+ myCurrMeshName = aMeshName;
+ QString aFieldName = VISU::getValue(aChildSObj,"myFieldName");
+ QString aTimeIter = VISU::getValue(aChildSObj,"myTimeStampId");
+ QString aEntity = VISU::getValue(aChildSObj,"myEntityId");
+ VISU::TEntity anEntity;
+ switch(aEntity.toInt()){
+ case 0: anEntity = VISU::NODE_ENTITY; break;
+ case 1: anEntity = VISU::EDGE_ENTITY; break;
+ case 2: anEntity = VISU::FACE_ENTITY; break;
+ case 3: anEntity = VISU::CELL_ENTITY; break;
+ }
+ TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
+ TFE aKey(aFieldName.latin1(),anEntity);
+ aFieldsMap[aKey][aTimeIter.toInt()] = GetFloatValueOfTimeStamp(aTimeIter.toInt());
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ AddAllFieldNames();
+
+ }
+ myFieldsCombo->setCurrentText(aFieldName);
+ AddAllTimes(myFieldsCombo->currentText());
+ myTimeStampsCombo->setCurrentText(aIteration);
+ SetScalarField();
+
+ myScalarPane->initFromPrsObject(myPrs);
+}
+
+int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalar) {
+
+ thePrs->SetScale(getFactor());
+
+ thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+ myPrs->GetScalarFieldName().c_str(),
+ myPrs->GetScalarIteration(),
+ myPrs->GetScalarEntity());
+
+ if (theUpdateScalar) SetScalarField();
+
+ thePrs->ShowColored(true);
+
+ myScalarPane->storeToPrsObject(thePrs);
+
+ myPrs = thePrs;
+
+ return 1;
+}
+
+int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldNamePos(){
+ return myFieldsCombo->currentItem();
+}
+
+QString VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldName(){
+ return myFieldsCombo->currentText();
+}
+
+int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarNbIterations(){
+ return myTimeStampsCombo->count();
+}
+
+VISU::TEntity VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarEntity(){
+ VISU::TEntity anEntity;
+ TFT::const_iterator aIterField = myMeshFieldsTimes[myCurrMeshName].begin();
+ for(;aIterField != myMeshFieldsTimes[myCurrMeshName].end();aIterField++){
+ if (aIterField->first.first == myFieldsCombo->currentText()){
+ anEntity = aIterField->first.second;
+ break;
+ }
+ }
+ return anEntity;
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(){
+ SetScalarField(myTimeStampsCombo->currentItem()+1);
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString theFieldName){
+
+ QString aFieldName;
+
+ if(theFieldName.isEmpty())
+ aFieldName = myFieldsCombo->currentText();
+ else
+ aFieldName = theFieldName;
+
+ VISU::TEntity anEntity = getCurrentScalarEntity();
+
+ myPrs->SetScalarField(myCurrMeshName.latin1(),
+ aFieldName.latin1(),
+ theIter,
+ anEntity);
+
+ myScalarPane->storeToPrsObject(myPrs);
+
+ UpdateScalarField();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
+{
+ if (myScalarPane->check()){
+ myScalarPane->deletePreview();
+ QDialog::accept();
+ }
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::reject()
+{
+ myScalarPane->deletePreview();
+ QDialog::reject();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
+ TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin();
+ for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){
+ QString aMeshName = aIterMesh->first;
+ TFT::const_iterator aIterField = (aIterMesh->second).begin();
+ for(;aIterField != (aIterMesh->second).end(); aIterField++){
+ QString aFieldName = aIterField->first.first;
+ myFieldsCombo->insertItem(aFieldName);
+ }
+ }
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldName){
+ TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin();
+ for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){
+ QString aMeshName = aIterMesh->first;
+ TFT::const_iterator aIterField = (aIterMesh->second).begin();
+ for(;aIterField != (aIterMesh->second).end(); aIterField++){
+ QString aFieldName = aIterField->first.first;
+ if(theFieldName != aFieldName) continue;
+ myTimeStampsCombo->clear();
+ TTL::const_iterator aTimeIter = (aIterField->second).begin();
+ for(;aTimeIter != (aIterField->second).end(); aTimeIter++)
+ myTimeStampsCombo->insertItem(QString("%1").arg(aTimeIter->second));
+ return;
+ }
+ }
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::onFieldChanged(int){
+ AddAllTimes(myFieldsCombo->currentText());
+ SetScalarField();
+ UpdateScalarField();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){
+ SetScalarField();
+ UpdateScalarField();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
+ myPrs->SetScale(getFactor());
+ float aRange[2];
+ myPrs->GetScalarMapOnDeformedShapePL()->Build();
+ myPrs->GetScalarMapOnDeformedShapePL()->Update();
+ myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange);
+ double aDoubleRange[2];
+ aDoubleRange[0] = double(aRange[0]);
+ aDoubleRange[1] = double(aRange[1]);
+ myScalarPane->initFromPrsObject(myPrs);
+ myScalarPane->setRange(aDoubleRange[0],aDoubleRange[1],myScalarPane->isIRange());
+}
+
+float VisuGUI_ScalarMapOnDeformedShapeDlg::GetFloatValueOfTimeStamp(int theIter){
+ float ret=1;
+ VISU::PField aField = myPrs->GetField();
+ VISU::TValField& aValField = aField->myValField;
+ VISU::PValForTime aValForTime = aValField.find(theIter)->second;
+ if(aValForTime)
+ ret = float(aValForTime->myTime.first);
+ return ret;
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VisuGUI_ScalarMapOnDeformedShapeDlg.h
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
+#define VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
+
+#include "VisuGUI_ScalarBarDlg.h"
+
+#include "QtxDblSpinBox.h"
+
+#include <qdialog.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+
+#include <set>
+
+class SalomeApp_Module;
+class QComboBox;
+class QString;
+
+namespace VISU{
+ class ScalarMapOnDeformedShape_i;
+}
+
+class VisuGUI_ScalarMapOnDeformedShapeDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule);
+ ~VisuGUI_ScalarMapOnDeformedShapeDlg() {};
+
+ double getFactor()
+ { return ScalFact->value(); }
+ void setFactor(double theFactor)
+ { ScalFact->setValue(theFactor); }
+
+
+ void initFromPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim=false);
+ int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalar=true);
+
+ int getCurrentScalarFieldNamePos();
+ QString getCurrentScalarFieldName();
+ int getCurrentScalarNbIterations();
+ VISU::TEntity getCurrentScalarEntity();
+ void SetScalarField(int theIter,QString theFieldName=QString(""));
+
+protected slots:
+ void accept();
+ void reject();
+
+private slots:
+ void onFieldChanged(int i=0);
+ void onTimeStampChanged(int i=0);
+
+private:
+ QtxDblSpinBox* ScalFact;
+ VisuGUI_ScalarBarPane* myScalarPane;
+ QComboBox *myFieldsCombo;
+ QComboBox *myTimeStampsCombo;
+
+ typedef std::map<int,float> TTL; // Times map definition (iteration time, real value of time)
+ typedef std::pair<QString,VISU::TEntity> TFE; // pair field name and entity
+ typedef std::map<TFE,TTL> TFT; // Field name and enity to Times
+ typedef std::map<QString,TFT> TMF; // Mesh to fields map
+
+ TMF myMeshFieldsTimes;
+ QString myCurrMeshName;
+
+ _PTR(SObject) mySelectionObj;
+ VISU::ScalarMapOnDeformedShape_i* myPrs;
+ SalomeApp_Module* myVisuGUI;
+
+protected:
+ void UpdateScalarField();
+ void SetScalarField();
+ void AddAllFieldNames();
+ void AddAllTimes(const QString& theFieldName);
+ float GetFloatValueOfTimeStamp(int iteration);
+};
+
+#endif // VISUGUI_DEFORMEDSHAPEDLS_H
#include "VisuGUI_VectorsDlg.h"
#include "VisuGUI_IsoSurfacesDlg.h"
#include "VisuGUI_StreamLinesDlg.h"
+#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
#include "VisuGUI_GaussPointsDlg.h"
#include "VISU_TimeAnimation.h"
#include "VISU_CutLines_i.hh"
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
#include "VISU_GaussPoints_i.hh"
#include "VISU_ViewManager_i.hh"
TDEFORMEDSHAPE_ITEM = 4, // VISU::TDEFORMEDSHAPE
TVECTORS_ITEM = 5, // VISU::TVECTORS
TSTREAMLINES_ITEM = 6, // VISU::TSTREAMLINES
- TGAUSSPOINTS_ITEM = 7 // VISU::TGAUSSPOINTS
+ TGAUSSPOINTS_ITEM = 7, // VISU::TGAUSSPOINTS
+ TSCALARMAPONDEFORMEDSHAPE_ITEM = 8 // VISU::TSCALARMAPONDEFORMEDSHAPE
};
//------------------------------------------------------------------------
myTypeCombo->insertItem("Stream Lines"); // item 6
myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
+
+ myTypeCombo->insertItem("Scalar map on Deformed shape"); // item 8
+ myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
+ myComboId2TypeId.push_back(TSCALARMAPONDEFORMEDSHAPE_ITEM);;
+
}
long anEntityId = VISU::getValue(aSObject, "myEntityId").toLong();
case VISU::TDEFORMEDSHAPE: //Deformed Shape
myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
break;
+ case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
+ myTypeCombo->setCurrentItem(TSCALARMAPONDEFORMEDSHAPE_ITEM);
+ break;
case VISU::TVECTORS: //Vectors
myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
break;
case TDEFORMEDSHAPE_ITEM: //Deformed Shape
aData.myPrsType = VISU::TDEFORMEDSHAPE;
break;
+ case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
+ aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
+ break;
case TVECTORS_ITEM: //Vectors
aData.myPrsType = VISU::TVECTORS;
break;
delete aDlg;
}
}
-
+
+
void SetupDlg::onPreferencesDlg()
{
SUIT_OverrideCursor c;
c.suspend();
EditPrs<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg>(myModule,aData);
break;
+ case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
+ c.suspend();
+ {
+ typedef VisuGUI_ScalarMapOnDeformedShapeDlg DLG;
+ typedef VISU::ScalarMapOnDeformedShape_i TYPE;
+ DLG* aDlg = new DLG (myModule);
+ aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs[0]),true);
+ if (aDlg->exec())
+ {
+ int anbFrames=aDlg->getCurrentScalarNbIterations();
+ for (int i = 0; i < aData.myNbFrames; i++){
+ TYPE* aCurrPrs_i = dynamic_cast<TYPE*>(aData.myPrs[i]);
+ if(i+1 > anbFrames)
+ aDlg->SetScalarField(anbFrames);
+ else
+ aDlg->SetScalarField(i+1);
+ aDlg->storeToPrsObject(aCurrPrs_i,false);
+ }
+ }
+ delete aDlg;
+ }
+ break;
case TVECTORS_ITEM: //Vectors
c.suspend();
EditPrs<VISU::Vectors_i,VisuGUI_VectorsDlg>(myModule,aData);
case VISU::TVECTORS:
case VISU::TSTREAMLINES:
case VISU::TPLOT3D:
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
{
PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
if (aServant.in()) {
VISU_View_i.cc \
VISU_TimeAnimation.cxx \
VISU_CorbaMedConvertor.cxx \
- VISU_DumpPython.cc
+ VISU_DumpPython.cc \
+ VISU_ScalarMapOnDeformedShape_i.cc
LIB_MOC = \
VISU_TimeAnimation.h
VISU_GaussPoints_i.hh \
VISU_ViewManager_i.hh \
VISU_View_i.hh \
- VISU_TimeAnimation.h
+ VISU_TimeAnimation.h \
+ VISU_ScalarMapOnDeformedShape_i.hh
# additionnal information to compil and link file
CPPFLAGS += \
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File : VISU_ScalarMapOnDeformedShape_i.cc
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "VISU_Result_i.hh"
+#include "VISU_ScalarMap_i.hh"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_Convertor.hxx"
+#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
+
+#include <vtkUnstructuredGrid.h>
+
+using namespace VISU;
+using namespace std;
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+static int INCMEMORY = 4+12;
+
+int VISU::ScalarMapOnDeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration, int isMemoryCheck)
+{
+ bool aResult = false;
+ try{
+ aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
+ if(isMemoryCheck && aResult){
+ float aSize = INCMEMORY*
+ theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
+ aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ return aResult;
+}
+
+int VISU::ScalarMapOnDeformedShape_i::myNbPresent = 0;
+QString VISU::ScalarMapOnDeformedShape_i::GenerateName() { return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);}
+
+const string VISU::ScalarMapOnDeformedShape_i::myComment = "SCALARMAPONDEFORMEDSHAPE";
+const char* VISU::ScalarMapOnDeformedShape_i::GetComment() const { return myComment.c_str();}
+
+VISU::ScalarMapOnDeformedShape_i::
+ScalarMapOnDeformedShape_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
+ ScalarMap_i(theResult,theAddToStudy),
+ myScalarMapOnDeformedShapePL(NULL),
+ myScalarIteration(1)
+{
+}
+
+VISU::ScalarMapOnDeformedShape_i::
+ScalarMapOnDeformedShape_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
+ ScalarMap_i(theResult,theSObject),
+ myScalarMapOnDeformedShapePL(NULL),
+ myScalarIteration(1)
+{
+}
+
+VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration)
+{
+ myIsColored = true;
+ myColor.R = myColor.G = myColor.B = 0.5;
+ VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+ SetScalarFieldName(theFieldName);
+ SetScalarIteration(theIteration);
+ SetScalarMeshName(theMeshName);
+ int anEntity = theEntity;
+ SetScalarEntity(VISU::TEntity(anEntity));
+ SetScalarField(myScalarMeshName.c_str(),myScalarFieldName.c_str(),myScalarIteration,myScalarEntity);
+ return aRes;
+}
+
+VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
+{
+ TSuperClass::Restore(theMap);
+
+ SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
+ SetScalarMeshName(VISU::Storable::FindValue(theMap,"myScalarMeshName"));
+ SetScalarIteration(VISU::Storable::FindValue(theMap,"myScalarIteration").toInt());
+ SetScalarEntity(VISU::TEntity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt()));
+ SetScalarField(GetScalarFieldName().c_str(),
+ GetScalarFieldName().c_str(),
+ GetScalarIteration(),
+ GetScalarEntity());
+
+ SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
+ myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
+ myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
+ myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
+ myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
+
+ return this;
+}
+
+void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
+ Storable::DataToStream( theStr, "myScalarMeshName", myScalarMeshName.c_str());
+ Storable::DataToStream( theStr, "myScalarIteration", myScalarIteration);
+ Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
+
+ Storable::DataToStream( theStr, "myFactor", GetScale() );
+ Storable::DataToStream( theStr, "myIsColored", myIsColored );
+ Storable::DataToStream( theStr, "myColor.R", myColor.R );
+ Storable::DataToStream( theStr, "myColor.G", myColor.G );
+ Storable::DataToStream( theStr, "myColor.B", myColor.B );
+
+}
+
+VISU::ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i(){
+ if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()");
+}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScale(CORBA::Double theScale) {
+ myScalarMapOnDeformedShapePL->SetScale(theScale);
+}
+
+CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){
+ return myScalarMapOnDeformedShapePL->GetScale();
+}
+
+void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){
+ float aRange[2];
+ aRange[0] = float(theMinRange);
+ aRange[1] = float(theMaxRange);
+ myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
+}
+
+CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){
+ float aRange[2];
+ myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
+ return aRange[0];
+}
+
+CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){
+ float aRange[2];
+ myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
+ return aRange[1];
+}
+
+void VISU::ScalarMapOnDeformedShape_i::DoHook()
+{
+ if(!myPipeLine)
+ myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
+
+ myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(myPipeLine);
+ myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
+
+ TSuperClass::DoHook();
+}
+
+VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
+ anActor->SetRepresentation(2);
+ anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+ anActor->SetVTKMapping(false);
+ return anActor;
+}
+
+
+void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+ if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+ if(IsColored()){
+ anActor->SetBarVisibility(true);
+ myPipeLine->GetMapper()->SetScalarVisibility(1);
+ }else{
+ anActor->SetBarVisibility(false);
+ myPipeLine->GetMapper()->SetScalarVisibility(0);
+ anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+ }
+ TSuperClass::UpdateActor(theActor);
+ }
+}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ const int theIteration,
+ const VISU::TEntity theEntity)
+{
+ if (myScalarMapOnDeformedShapePL){
+ myField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+ TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)->GetVTKOutput();
+ myScalarMapOnDeformedShapePL->SetScalars(aOut);
+
+ SetScalarMeshName(theMeshName);
+ SetScalarFieldName(theFieldName);
+ SetScalarIteration(theIteration);
+ SetScalarEntity(theEntity);
+ }
+}
+
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
+ myScalarMeshName = theName;
+}
+std::string VISU::ScalarMapOnDeformedShape_i::GetScalarMeshName(){
+ return myScalarMeshName;
+}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarFieldName(const char* theName){
+ myScalarFieldName = theName;
+}
+std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
+ return myScalarFieldName;
+}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
+ myScalarIteration = theValue;
+}
+int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
+ return myScalarIteration;
+}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
+ myScalarEntity = theValue;
+}
+VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
+ return myScalarEntity;
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File: VISU_ScalarMapOnDeformedShape_i.hh
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_ScalarMapOnDeformedShape_i_HeaderFile
+#define VISU_ScalarMapOnDeformedShape_i_HeaderFile
+
+#include "VISU_ScalarMap_i.hh"
+
+class VISU_ScalarMapOnDeformedShapePL;
+
+namespace VISU{
+
+ //! Class of Scalar Map on Deformed Shape presentation.
+ class ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
+ public virtual ScalarMap_i
+ {
+ static int myNbPresent;
+ ScalarMapOnDeformedShape_i();
+ ScalarMapOnDeformedShape_i(const ScalarMapOnDeformedShape_i&);
+
+ public:
+
+ typedef ScalarMap_i TSuperClass;
+
+ explicit
+ ScalarMapOnDeformedShape_i(Result_i* theResult,
+ bool theAddToStudy);
+ explicit
+ ScalarMapOnDeformedShape_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject);
+
+ virtual ~ScalarMapOnDeformedShape_i();
+
+ virtual VISU::VISUType GetType()
+ {
+ return VISU::TSCALARMAPONDEFORMEDSHAPE;
+ };
+
+ typedef VISU::ScalarMapOnDeformedShape TInterface;
+
+ virtual void SetScale(CORBA::Double theScale);
+ virtual CORBA::Double GetScale();
+
+ virtual CORBA::Boolean IsColored() { return myIsColored; }
+ virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
+
+ virtual SALOMEDS::Color GetColor() { return myColor;}
+ virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
+
+ virtual void SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange);
+ virtual CORBA::Double GetSourceRangeMin();
+ virtual CORBA::Double GetSourceRangeMax();
+
+ VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
+
+ protected:
+
+ virtual
+ void
+ DoHook();
+
+ VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
+ SALOMEDS::Color myColor;
+ bool myIsColored;
+ std::string myScalarMeshName;
+ std::string myScalarFieldName;
+ VISU::TEntity myScalarEntity;
+ int myScalarIteration;
+
+ public:
+ static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration, int isMemoryCheck = true);
+ virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, int theIteration);
+
+ virtual void ToStream(std::ostringstream& theStr);
+
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+
+ static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix, const Storable::TRestoringMap& theMap);
+
+ static const std::string myComment;
+ virtual const char* GetComment() const;
+ virtual QString GenerateName();
+
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual void UpdateActor(VISU_Actor* theActor) ;
+
+ virtual void SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ const int theIteration,
+ const VISU::TEntity theEntity);
+
+ virtual void SetScalarFieldName(const char* theName);
+ virtual std::string GetScalarFieldName();
+ virtual void SetScalarIteration(const int theValue);
+ virtual int GetScalarIteration();
+ virtual void SetScalarMeshName(const char* theName);
+ virtual std::string GetScalarMeshName();
+ virtual void SetScalarEntity(const VISU::TEntity theValue);
+ virtual VISU::TEntity GetScalarEntity();
+ };
+}
+#endif
#include "VISU_ScalarMap_i.hh"
#include "VISU_IsoSurfaces_i.hh"
#include "VISU_DeformedShape_i.hh"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
#include "VISU_CutPlanes_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_CutLines_i.hh"
case VISU::TGAUSSPOINTS: // Gauss Points
GeneratePresentations<GaussPoints_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
break;
+ case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
+ GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+ break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
return;
case VISU::TGAUSSPOINTS:
aPrsCmt = VISU::GaussPoints_i::myComment;
break;
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ aPrsCmt = VISU::ScalarMapOnDeformedShape_i::myComment;
+ break;
default:
aPrsCmt = "Unknown presentation";
break;
aData.myPrsType = VISU::TSTREAMLINES;
else if (strName == VISU::GaussPoints_i::myComment.c_str())
aData.myPrsType = VISU::TGAUSSPOINTS;
+ else if (strName == VISU::ScalarMapOnDeformedShape_i::myComment.c_str())
+ aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
else
continue;
generatePresentations(getNbFields()-1);