/*!
-\page scalar_map_on_deformed_shape_page Scalar Map on Deformed Shape presentation
+\page scalar_map_on_deformed_shape_page Deformed Shape and Scalar Map presentation
-\n <b>Scalar Map on Deformed Shape</b> presentation is a mix of the
+\n <b>Deformed Shape and Scalar Map</b> presentation is a mix of the
two: \ref scalar_map_page "Scalar Map" and \ref deformed_shape_page
"Deformed Shape". In this presentation the Scalar Map is built on a
Deformed Shape.
-<em>To create a Scalar Map on Deformed Shape presentation:</em>
+<em>To create a Deformed Shape and Scalar Map presentation:</em>
\par
– Right-click on one of the time stamps of the field in the
-Object browser and from the pop-up menu choose <b>Scalar Map on
-Deformed Shape</b>, or
+Object browser and from the pop-up menu choose <b>Deformed Shape and
+Scalar Map</b>, or
\n – Click on one of the time stamps of the field in the Object
-browser and select from the main menu <b>Visualization > Scalar Map on
-Deformed Shape</b>, or click <em>"Scalar Map on Deformed Shape"</em>
+browser and select from the main menu <b>Visualization > Deformed Shape and
+Scalar Map</b>, or click <em>"Deformed Shape and Scalar Map"</em>
icon in the <b>Visualization Toolbar</b>.
\image html image40.gif
-<center><em>"Scalar Map on Deformed Shape" icon</em></center>
+<center><em>"Deformed Shape and Scalar Map" icon</em></center>
\image html smds1.png
\par
-<b>Scalar Map on Deformed Shape</b> tab allows you to set additional
-parameters of your Scalar Map on Deformed Shape presentation:
+<b>Deformed Shape and Scalar Map</b> tab allows you to set additional
+parameters of your Deformed Shape and Scalar Map presentation:
<ul>
<li><b>Scale Factor:</b> visualization scaling of all vector values
applied to the cells of the mesh.</li>
\image html smds-example1.png
-with Scalar Map on Deformed Shape presentation:
+with Deformed Shape and Scalar Map presentation:
\image html smds-example.png
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape presentation interface. <a href="interfaceVISU_1_1DeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">VISU.ScalarMapOnDeformedShape</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Scalar Map on Deformed shape presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape and Scalar Map presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1Plot3D.html">VISU.Plot3D</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a> interface. <a href="interfaceVISU_1_1Plot3D.html#_details">More...</a><br></td></tr>
<!-- Generated by Doxygen 1.4.7 -->
<div class="nav">
<a class="el" href="namespaceVISU.html">VISU</a>.<a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">ScalarMapOnDeformedShape</a></div>
-<h1>VISU.ScalarMapOnDeformedShape Interface Reference</h1><!-- doxytag: class="VISU::ScalarMapOnDeformedShape" --><!-- doxytag: inherits="VISU::ScalarMap" -->Scalar Map on Deformed shape presentation interface.
+<h1>VISU.ScalarMapOnDeformedShape Interface Reference</h1><!-- doxytag: class="VISU::ScalarMapOnDeformedShape" --><!-- doxytag: inherits="VISU::ScalarMap" -->Deformed shape and Scalar Map presentation interface.
<a href="#_details">More...</a>
<p>
<code>import "VISU_Gen.idl";</code>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape presentation interface. <a href="interfaceVISU_1_1DeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">ScalarMapOnDeformedShape</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Scalar Map on Deformed shape presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape and Scalar Map presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a> interface. <a href="interfaceVISU_1_1Plot3D.html#_details">More...</a><br></td></tr>
aTE("Plot 3D presentation","plot_3d_presentation.htm");
aTE("Primitive Types","primitive_types.htm");
aTE("Scalar Bar","scalar_bar.htm");
-aTE("Scalar Map on Deformed Shape presentation","scalar_map_on_deformed_shape_presentation.htm");
+aTE("Deformed Shape and Scalar Map presentation","scalar_map_on_deformed_shape_presentation.htm");
aTE("Segmentation","segmentation.htm");
aTE("Types of Gauss Points Presentations","types_of_gauss_points_presentations.htm");
aTE("VTK 3D Viewer","vtk_3d_viewer.htm");
aTE(2,0,"Deformed Shape presentation","files/deformed_shape_presentation.htm");
aTE(2,0,"Vectors Presentation","files/vectors_presentation.htm");
aTE(2,0,"Stream Lines presentation","files/stream_lines_presentation.htm");
- aTE(2,0,"Scalar Map on Deformed Shape presentation","scalar_map_on_deformed_shape_presentation.htm");
+ aTE(2,0,"Deformed Shape and Scalar Map presentation","scalar_map_on_deformed_shape_presentation.htm");
aTE(2,0,"Plot 3D presentation","plot_3d_presentation.htm");
aTE(2,0,"Animating presentations","files/animating_presentations.htm");
aTE(1,9,"Gauss Points Presentations");
<nobr><a href="../files/deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape presentation</a></nobr><br>
<nobr><a href="../files/vectors_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Vectors Presentation</a></nobr><br>
<nobr><a href="../files/stream_lines_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Stream Lines presentation</a></nobr><br>
- <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Scalar Map on Deformed Shape presentation</a></nobr><br>
+ <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape and Scalar Map presentation</a></nobr><br>
<nobr><a href="../plot_3d_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Plot 3D presentation</a></nobr><br>
<nobr><a href="../files/animating_presentations.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Animating presentations</a></nobr><br>
<nobr><a name="4"></a><a href="whlstt4.htm#4" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Gauss Points Presentations</a></nobr><br>
<nobr><a href="../files/deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape presentation</a></nobr><br>
<nobr><a href="../files/vectors_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Vectors Presentation</a></nobr><br>
<nobr><a href="../files/stream_lines_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Stream Lines presentation</a></nobr><br>
- <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Scalar Map on Deformed Shape presentation</a></nobr><br>
+ <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape and Scalar Map presentation</a></nobr><br>
<nobr><a href="../plot_3d_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Plot 3D presentation</a></nobr><br>
<nobr><a href="../files/animating_presentations.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Animating presentations</a></nobr><br>
<nobr><a name="4"></a><a href="whlstt3.htm#4" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> Gauss Points Presentations</a></nobr><br>
<topic name="Plot 3D presentation" url="plot_3d_presentation.htm" />
<topic name="Primitive Types" url="primitive_types.htm" />
<topic name="Scalar Bar" url="scalar_bar.htm" />
-<topic name="Scalar Map on Deformed Shape presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
+<topic name="Deformed Shape and Scalar Map presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
<topic name="Segmentation" url="segmentation.htm" />
<topic name="Types of Gauss Points Presentations" url="types_of_gauss_points_presentations.htm" />
<topic name="VTK 3D Viewer" url="vtk_3d_viewer.htm" />
<item name="Deformed Shape presentation" url="files/deformed_shape_presentation.htm" />
<item name="Vectors Presentation" url="files/vectors_presentation.htm" />
<item name="Stream Lines presentation" url="files/stream_lines_presentation.htm" />
- <item name="Scalar Map on Deformed Shape presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
+ <item name="Deformed Shape and Scalar Map presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
<item name="Plot 3D presentation" url="plot_3d_presentation.htm" />
<item name="Animating presentations" url="files/animating_presentations.htm" />
<book name="Gauss Points Presentations" >
TSCALARMAP, /*!< Scalarmap 3D presentation object */
TISOSURFACES, /*!< Iso surface 3D presentation object */
TDEFORMEDSHAPE, /*!< Deformed shape 3D presentation object */
- TSCALARMAPONDEFORMEDSHAPE, /*!< Scalar map on deformed shape 3D presentation object */
+ TSCALARMAPONDEFORMEDSHAPE, /*!< Scalar map on deformed shape 3D presentation object. It is obsolete. Use TDEFORMEDSHAPEANDSCALARMAP instead */
+ TDEFORMEDSHAPEANDSCALARMAP, /*!< Deformed shape and scalar map 3D presentation object */
TGAUSSPOINTS, /*!< Gauss Points 3D presentation object */
TPLOT3D, /*!< Plot3D 3D presentation object */
TPOINTMAP3D, /*!< 3D presentation for table object */
*
* Presentation parameters of the scalar map on deformed shape presentation.
*/
- interface ScalarMapOnDeformedShape : ScalarMap {
+ interface DeformedShapeAndScalarMap : ScalarMap {
/*!
* Sets the scale of the presentatable object.
in Entity theEntity, in string theFieldName,
in long theTimeStampNumber);
+ /*!
+ * Creates a deformed shape presentation. This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
+ * \param theResult Data generated in other sources. (MED object or file)
+ * \param theMeshName One of the meshes presented in MED file
+ * \param theEntity Type of entity where the field is defined
+ * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
+ * \param theTimeStampNumber Number of iteration on the field
+ */
+ DeformedShapeAndScalarMap ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
+
/*!
* Creates a deformed shape presentation.
* \param theResult Data generated in other sources. (MED object or file)
* \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
* \param theTimeStampNumber Number of iteration on the field
*/
- ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
- in Entity theEntity, in string theFieldName,
- in long theTimeStampNumber);
+ DeformedShapeAndScalarMap DeformedShapeAndScalarMapOnField(in Result theResult, in string theMeshName,
+ in Entity theEntity, in string theFieldName,
+ in long theTimeStampNumber);
/*!
* Creates a vector presentation.
return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- ScalarMapOnDeformedShape_ptr
+ DeformedShapeAndScalarMap_ptr
VISU_Gen_i
::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
const char* theMeshName,
const char* theFieldName,
CORBA::Long theIteration)
{
- return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+ return DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+ }
+
+ DeformedShapeAndScalarMap_ptr
+ VISU_Gen_i
+ ::DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
+ {
+ return myVisuGen->DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
Vectors_ptr
const char* theFieldName,
CORBA::Long theIteration);
+ //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
virtual
- ScalarMapOnDeformedShape_ptr
+ DeformedShapeAndScalarMap_ptr
ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
CORBA::Long theIteration);
+ virtual
+ DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
VISU_PlanesWidget.hxx \
VISU_SphereWidget.hxx \
VISU_WidgetCtrl.hxx \
- VISU_ScalarMapOnDeformedShapePL.hxx \
+ VISU_DeformedShapeAndScalarMapPL.hxx \
VISUPipeline.hxx \
VISU_LabelPointsFilter.hxx
VISU_SphereWidget.cxx \
VISU_WidgetCtrl.cxx \
VISU_ScalarBarCtrl.cxx \
- VISU_ScalarMapOnDeformedShapePL.cxx \
+ VISU_DeformedShapeAndScalarMapPL.cxx \
VISU_LabelPointsFilter.cxx
libVisuPipeLine_la_CPPFLAGS= \
#include "VISU_VectorsPL.hxx"
#include "VISU_StreamLinesPL.hxx"
#include "VISU_GaussPointsPL.hxx"
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
#include "VISU_Plot3DPL.hxx"
#include "VISU_ScalarBarActor.hxx"
--- /dev/null
+// VISU DeformedShapeAndScalarMapPL
+//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_DeformedShapeAndScalarMapPL.cxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
+#include "VISU_FieldTransform.hxx"
+#include "VISU_Extractor.hxx"
+#include "VISU_LookupTable.hxx"
+#include "VISU_DeformedShapePL.hxx"
+#include "VTKViewer_TransformFilter.h"
+#include "VTKViewer_Transform.h"
+#include "VISU_MergeFilter.hxx"
+
+#include "VISU_PipeLineUtils.hxx"
+
+#include <vtkWarpVector.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkCellDataToPointData.h>
+#include <vtkPointDataToCellData.h>
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_DeformedShapeAndScalarMapPL)
+
+//----------------------------------------------------------------------------
+/*!
+ * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
+ * Where:
+ * \li myDeformVectors is vtkWarpVector - deformation vectors data
+ * \li myScalarsMergeFilter is vtkMergeFilter - merge filter.
+ * Merge filter which unify the deformation and scalars
+ * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
+*/
+VISU_DeformedShapeAndScalarMapPL
+::VISU_DeformedShapeAndScalarMapPL():
+ myScaleFactor(0.0)
+{
+ myWarpVector = vtkWarpVector::New();
+
+ myScalarsMergeFilter = VISU_MergeFilter::New();
+ myScalarsMergeFilter->SetMergingInputs(true);
+
+ myScalarsExtractor = VISU_Extractor::New();
+
+ myScalarsFieldTransform = VISU_FieldTransform::New();
+
+ myCellDataToPointData = vtkCellDataToPointData::New();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Destructor.
+ * Delete all fields.
+*/
+VISU_DeformedShapeAndScalarMapPL
+::~VISU_DeformedShapeAndScalarMapPL()
+{
+ myWarpVector->Delete();
+
+ myScalarsMergeFilter->Delete();
+
+ myScalarsExtractor->Delete();
+
+ myScalarsFieldTransform->Delete();
+
+ myCellDataToPointData->Delete();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Initial method
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::Init()
+{
+ Superclass::Init();
+
+ SetScale(VISU_DeformedShapePL::GetDefaultScale(this));
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Build method
+ * Building of deformation and puts result to merge filter.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::Build()
+{
+ Superclass::Build();
+}
+
+
+//----------------------------------------------------------------------------
+vtkDataSet*
+VISU_DeformedShapeAndScalarMapPL
+::InsertCustomPL()
+{
+ GetMapper()->SetColorModeToMapScalars();
+ GetMapper()->ScalarVisibilityOn();
+
+ VISU::CellDataToPoint(myWarpVector,
+ myCellDataToPointData,
+ GetMergedInput());
+
+ myScalars = GetMergedInput();
+
+ UpdateScalars();
+
+ myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput());
+
+ // Sets geometry for merge filter
+ myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput());
+
+ vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput();
+ myScalarsMergeFilter->SetScalars(aScalarsDataSet);
+ myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet);
+ myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet);
+
+ return myScalarsMergeFilter->GetOutput();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ * Update method
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::Update()
+{
+ Superclass::Update();
+ //{
+ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
+ // VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
+ //}
+ //{
+ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
+ // VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
+ //}
+ //{
+ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk";
+ // VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName);
+ //}
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_DeformedShapeAndScalarMapPL
+::GetMemorySize()
+{
+ unsigned long int aSize = Superclass::GetMemorySize();
+
+ if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(myCellDataToPointData->GetInput())
+ if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ return aSize;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Update scalars method.
+ * Put scalars to merge filter.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::UpdateScalars()
+{
+ vtkDataSet* aScalars = GetScalars();
+ myScalarsExtractor->SetInput(aScalars);
+
+ if(VISU::IsDataOnCells(aScalars))
+ GetMapper()->SetScalarModeToUseCellData();
+ else
+ GetMapper()->SetScalarModeToUsePointData();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Copy information about pipline.
+ * Copy scale and scalars.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput)
+{
+ Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
+
+ if(VISU_DeformedShapeAndScalarMapPL *aPipeLine = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine)){
+ SetScale(aPipeLine->GetScale());
+ SetScalars(aPipeLine->GetScalars());
+ }
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scalars.
+ * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScalars(vtkDataSet *theScalars)
+{
+ if(GetScalars() == theScalars)
+ return;
+
+ myScalars = theScalars;
+ UpdateScalars();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Get pointer to input scalars.
+ */
+vtkDataSet*
+VISU_DeformedShapeAndScalarMapPL
+::GetScalars()
+{
+ return myScalars.GetPointer();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets scale for deformed shape
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScale(vtkFloatingPointType theScale)
+{
+ if(VISU::CheckIsSameValue(myScaleFactor, theScale))
+ return;
+
+ myWarpVector->SetScaleFactor(theScale);
+ myScaleFactor = theScale;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scale of deformed shape.
+ */
+vtkFloatingPointType
+VISU_DeformedShapeAndScalarMapPL
+::GetScale()
+{
+ return myWarpVector->GetScaleFactor();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scale factor of deformation.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
+ Superclass::SetMapScale(theMapScale);
+ myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scalar mode.
+ */
+int
+VISU_DeformedShapeAndScalarMapPL
+::GetScalarMode()
+{
+ return myScalarsExtractor->GetScalarMode();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets scalar mode.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScalarMode(int theScalarMode)
+{
+ VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScaling(int theScaling)
+{
+ if(GetScaling() == theScaling)
+ return;
+
+ GetBarTable()->SetScale(theScaling);
+
+ if(theScaling == VTK_SCALE_LOG10)
+ myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10));
+ else
+ myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident));
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScalarRange(vtkFloatingPointType theRange[2])
+{
+ if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
+ return;
+
+ myScalarsFieldTransform->SetScalarRange(theRange);
+ GetBarTable()->SetRange(theRange);
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType*
+VISU_DeformedShapeAndScalarMapPL
+::GetScalarRange()
+{
+ return myScalarsFieldTransform->GetScalarRange();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets ranges of extracted scalars
+ * \param theRange[2] - output values
+ * \li theRange[0] - minimum value
+ * \li theRange[1] - maximum value
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+ myScalarsExtractor->Update();
+ myScalarsExtractor->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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_DeformedShapeAndScalarMapPL.hxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_DeformedShapeAndScalarMapPL_HeaderFile
+#define VISU_DeformedShapeAndScalarMapPL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_ScalarMapPL.hxx"
+
+class VISU_MergeFilter;
+class vtkWarpVector;
+class vtkUnstructuredGrid;
+class vtkCellDataToPointData;
+class vtkPointDataToCellData;
+
+
+//----------------------------------------------------------------------------
+class VISU_PIPELINE_EXPORT VISU_DeformedShapeAndScalarMapPL : public VISU_ScalarMapPL
+{
+public:
+ vtkTypeMacro(VISU_DeformedShapeAndScalarMapPL, VISU_ScalarMapPL);
+
+ static
+ VISU_DeformedShapeAndScalarMapPL*
+ New();
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
+
+ virtual
+ int
+ GetScalarMode();
+
+ virtual
+ void
+ SetScalarMode(int theScalarMode = 0);
+
+ virtual
+ void
+ SetScaling(int theScaling);
+
+ virtual
+ void
+ SetScalarRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ vtkFloatingPointType*
+ GetScalarRange();
+
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ void
+ SetScalars(vtkDataSet *theScalars);
+
+ virtual
+ vtkDataSet*
+ 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();
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
+ //! Update scalars.
+ void
+ UpdateScalars();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
+
+protected:
+ VISU_DeformedShapeAndScalarMapPL();
+
+ virtual
+ ~VISU_DeformedShapeAndScalarMapPL();
+
+ virtual
+ vtkDataSet*
+ InsertCustomPL();
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput);
+
+private:
+ VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&);
+
+ vtkFloatingPointType myScaleFactor;
+ vtkWarpVector *myWarpVector;
+ VISU_MergeFilter *myScalarsMergeFilter;
+ vtkSmartPointer<vtkUnstructuredGrid> myScalars;
+ vtkCellDataToPointData* myCellDataToPointData;
+ VISU_FieldTransform* myScalarsFieldTransform;
+ VISU_Extractor* myScalarsExtractor;
+};
+
+#endif
+++ /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_ScalarMapOnDeformedShapePL.cxx
-// Author: Eugeny Nikolaev
-// Module : VISU
-
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
-#include "VISU_FieldTransform.hxx"
-#include "VISU_Extractor.hxx"
-#include "VISU_LookupTable.hxx"
-#include "VISU_DeformedShapePL.hxx"
-#include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_Transform.h"
-#include "VISU_MergeFilter.hxx"
-
-#include "VISU_PipeLineUtils.hxx"
-
-#include <vtkWarpVector.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
-#include <vtkPointDataToCellData.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL)
-
-//----------------------------------------------------------------------------
-/*!
- * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
- * Where:
- * \li myDeformVectors is vtkWarpVector - deformation vectors data
- * \li myScalarsMergeFilter 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():
- myScaleFactor(0.0),
- myMapScaleFactor(1.0)
-{
- myWarpVector = vtkWarpVector::New();
-
- myScalarsMergeFilter = VISU_MergeFilter::New();
- myScalarsMergeFilter->SetMergingInputs(true);
-
- myScalarsExtractor = VISU_Extractor::New();
-
- myScalarsFieldTransform = VISU_FieldTransform::New();
-
- myCellDataToPointData = vtkCellDataToPointData::New();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Destructor.
- * Delete all fields.
-*/
-VISU_ScalarMapOnDeformedShapePL
-::~VISU_ScalarMapOnDeformedShapePL()
-{
- myWarpVector->Delete();
-
- myScalarsMergeFilter->Delete();
-
- myScalarsExtractor->Delete();
-
- myScalarsFieldTransform->Delete();
-
- myCellDataToPointData->Delete();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Initial method
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::Init()
-{
- Superclass::Init();
-
- SetScale(VISU_DeformedShapePL::GetDefaultScale(this));
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Build method
- * Building of deformation and puts result to merge filter.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::Build()
-{
- Superclass::Build();
-}
-
-
-//----------------------------------------------------------------------------
-vtkDataSet*
-VISU_ScalarMapOnDeformedShapePL
-::InsertCustomPL()
-{
- GetMapper()->SetColorModeToMapScalars();
- GetMapper()->ScalarVisibilityOn();
-
- VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
-
- myScalars = GetMergedInput();
-
- UpdateScalars();
-
- myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput());
-
- // Sets geometry for merge filter
- myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput());
-
- vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput();
- myScalarsMergeFilter->SetScalars(aScalarsDataSet);
- myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet);
- myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet);
-
- return myScalarsMergeFilter->GetOutput();
-}
-
-
-//----------------------------------------------------------------------------
-/*!
- * Update method
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::Update()
-{
- Superclass::Update();
- //{
- // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
- // VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
- //}
- //{
- // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
- // VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
- //}
- //{
- // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk";
- // VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName);
- //}
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_ScalarMapOnDeformedShapePL
-::GetMemorySize()
-{
- unsigned long int aSize = Superclass::GetMemorySize();
-
- if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(myCellDataToPointData->GetInput())
- if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- return aSize;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Update scalars method.
- * Put scalars to merge filter.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::UpdateScalars()
-{
- vtkDataSet* aScalars = GetScalars();
- myScalarsExtractor->SetInput(aScalars);
-
- if(VISU::IsDataOnCells(aScalars))
- GetMapper()->SetScalarModeToUseCellData();
- else
- GetMapper()->SetScalarModeToUsePointData();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Copy information about pipline.
- * Copy scale and scalars.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
-{
- Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
-
- if(VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine)){
- SetScale(aPipeLine->GetScale());
- SetScalars(aPipeLine->GetScalars());
- }
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scalars.
- * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScalars(vtkDataSet *theScalars)
-{
- if(GetScalars() == theScalars)
- return;
-
- myScalars = theScalars;
- UpdateScalars();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Get pointer to input scalars.
- */
-vtkDataSet*
-VISU_ScalarMapOnDeformedShapePL
-::GetScalars()
-{
- return myScalars.GetPointer();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Sets scale for deformed shape
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScale(vtkFloatingPointType theScale)
-{
- if(VISU::CheckIsSameValue(myScaleFactor, theScale))
- return;
-
- myWarpVector->SetScaleFactor(theScale*myMapScaleFactor);
- myScaleFactor = theScale;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scale of deformed shape.
- */
-vtkFloatingPointType
-VISU_ScalarMapOnDeformedShapePL
-::GetScale()
-{
- return myScaleFactor;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scale factor of deformation.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetMapScale(vtkFloatingPointType theMapScale)
-{
- myMapScaleFactor = theMapScale;
- Superclass::SetMapScale(theMapScale);
-
- vtkFloatingPointType aMapScale = myScaleFactor * theMapScale;
-
- if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), aMapScale))
- return;
-
- myWarpVector->SetScaleFactor(aMapScale);
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scalar mode.
- */
-int
-VISU_ScalarMapOnDeformedShapePL
-::GetScalarMode()
-{
- return myScalarsExtractor->GetScalarMode();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Sets scalar mode.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScalarMode(int theScalarMode)
-{
- VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor);
-}
-
-//----------------------------------------------------------------------------
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScaling(int theScaling)
-{
- if(GetScaling() == theScaling)
- return;
-
- GetBarTable()->SetScale(theScaling);
-
- if(theScaling == VTK_SCALE_LOG10)
- myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10));
- else
- myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident));
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScalarRange(vtkFloatingPointType theRange[2])
-{
- if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
- return;
-
- myScalarsFieldTransform->SetScalarRange(theRange);
- GetBarTable()->SetRange(theRange);
-}
-
-
-//----------------------------------------------------------------------------
-vtkFloatingPointType*
-VISU_ScalarMapOnDeformedShapePL
-::GetScalarRange()
-{
- return myScalarsFieldTransform->GetScalarRange();
-}
-
-
-//----------------------------------------------------------------------------
-/*!
- * Gets ranges of extracted scalars
- * \param theRange[2] - output values
- * \li theRange[0] - minimum value
- * \li theRange[1] - maximum value
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::GetSourceRange(vtkFloatingPointType theRange[2])
-{
- myScalarsExtractor->Update();
- myScalarsExtractor->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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_ScalarMapOnDeformedShapePL.hxx
-// Author: Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile
-#define VISU_ScalarMapOnDeformedShapePL_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include "VISU_ScalarMapPL.hxx"
-
-class VISU_MergeFilter;
-class vtkWarpVector;
-class vtkUnstructuredGrid;
-class vtkCellDataToPointData;
-class vtkPointDataToCellData;
-
-
-//----------------------------------------------------------------------------
-class VISU_PIPELINE_EXPORT VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
-{
-public:
- vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL, VISU_ScalarMapPL);
-
- static
- VISU_ScalarMapOnDeformedShapePL*
- New();
-
- virtual
- void
- SetScale(vtkFloatingPointType theScale);
-
- virtual
- vtkFloatingPointType
- GetScale();
-
- virtual
- int
- GetScalarMode();
-
- virtual
- void
- SetScalarMode(int theScalarMode = 0);
-
- virtual
- void
- SetScaling(int theScaling);
-
- virtual
- void
- SetScalarRange(vtkFloatingPointType theRange[2]);
-
- virtual
- vtkFloatingPointType*
- GetScalarRange();
-
- virtual
- void
- GetSourceRange(vtkFloatingPointType theRange[2]);
-
- virtual
- void
- SetScalars(vtkDataSet *theScalars);
-
- virtual
- vtkDataSet*
- 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();
-
- //! Gets memory size used by the instance (bytes).
- virtual
- unsigned long int
- GetMemorySize();
-
- //! Update scalars.
- void
- UpdateScalars();
-
- virtual
- void
- SetMapScale(vtkFloatingPointType theMapScale = 1.0);
-
-protected:
- VISU_ScalarMapOnDeformedShapePL();
-
- virtual
- ~VISU_ScalarMapOnDeformedShapePL();
-
- virtual
- vtkDataSet*
- InsertCustomPL();
-
- virtual
- void
- DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
-
-private:
- VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
-
- vtkFloatingPointType myScaleFactor;
- vtkFloatingPointType myMapScaleFactor;
- vtkWarpVector *myWarpVector;
- VISU_MergeFilter *myScalarsMergeFilter;
- vtkSmartPointer<vtkUnstructuredGrid> myScalars;
- vtkCellDataToPointData* myCellDataToPointData;
- VISU_FieldTransform* myScalarsFieldTransform;
- VISU_Extractor* myScalarsExtractor;
-};
-
-#endif
VisuGUI_StreamLinesDlg.cxx \
VisuGUI_VectorsDlg.cxx \
VisuGUI_Displayer.cxx \
- VisuGUI_ScalarMapOnDeformedShapeDlg.cxx \
+ VisuGUI_DeformedShapeAndScalarMapDlg.cxx \
VisuGUI_SetupPlot2dDlg.cxx \
VisuGUI_BuildProgressDlg.cxx \
VisuGUI_Table3dDlg.cxx \
VisuGUI_CutPlanesDlg_moc.cxx \
VisuGUI_StreamLinesDlg_moc.cxx \
VisuGUI_VectorsDlg_moc.cxx \
- VisuGUI_ScalarMapOnDeformedShapeDlg_moc.cxx \
+ VisuGUI_DeformedShapeAndScalarMapDlg_moc.cxx \
VisuGUI_SetupPlot2dDlg_moc.cxx \
VisuGUI_BuildProgressDlg_moc.cxx \
VisuGUI_Table3dDlg_moc.cxx \
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: 2005-05-10 15:20+0400\n"
+"PO-Revision-Date: 2008-05-04 15:01+0400\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2007-12-11 17:26+0300\n"
+"PO-Revision-Date: 2008-05-04 10:12+0400\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
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_DEFORMED_SHAPE_AND_SCALAR_MAP"
+msgstr "Deformed Shape and Scalar Map"
msgid "VisuGUI::MEN_VISUALIZATION"
msgstr "Visualization"
msgstr "Scale Factor:"
-#: VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
+#: VisuGUI_DeformedShapeAndScalarMapDlg.cxx
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::DLG_TITLE"
-msgstr "Scalar Map on Deformed Shape"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::DLG_TITLE"
+msgstr "Deformed Shape and Scalar Map"
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::&Cancel"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::&Cancel"
msgstr ""
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::&OK"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::&OK"
msgstr ""
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"
-msgstr "Scalar Map on Deformed Shape"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::DEFORMED_SHAPE_AND_SCALAR_MAP_TAB"
+msgstr "Deformed Shape and Scalar Map"
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_BAR_TAB"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::SCALAR_BAR_TAB"
msgstr "Scalar Bar"
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::INPUT_TAB"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::INPUT_TAB"
msgstr "Input"
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALE_FACTOR"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::SCALE_FACTOR"
msgstr "Scale Factor:"
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::FIELD_ITEM"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::FIELD_ITEM"
msgstr "Scalar Field:"
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::TIMESTAMP_ITEM"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::TIMESTAMP_ITEM"
msgstr "Current Time Stamp:"
#: VisuGUI_EditContainerDlg.cxx
msgid "VISU_PLOT3D"
msgstr "Plot3D"
-msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
-msgstr "Scalar Map on Def. Shape"
+msgid "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP"
+msgstr "Def. Shape and Scalar Map"
# MULTIPR
msgid "VisuGUI::MEN_MULTIPR_VIEW_FULL_RES"
#include "VISU_DeformedShape_i.hh"
#include "VisuGUI_DeformedShapeDlg.h"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
+#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
#include "VISU_IsoSurfaces_i.hh"
#include "VisuGUI_IsoSurfacesDlg.h"
void
VisuGUI
-::OnCreateScalarMapOnDeformedShape()
+::OnCreateDeformedShapeAndScalarMap()
{
- CreatePrs3d<VISU::ScalarMapOnDeformedShape_i,VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this);
+ CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
}
void
//----------------------------------------------------------------------------
void
VisuGUI
-::OnEditScalarMapOnDeformedShape()
+::OnEditDeformedShapeAndScalarMap()
{
Handle(SALOME_InteractiveObject) anIO;
if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
- EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg, 1>(this, anIO, aPrs3d);
+ EditPrs3d<VISU::DeformedShapeAndScalarMap_i, VisuGUI_DeformedShapeAndScalarMapDlg, 1>(this, anIO, aPrs3d);
}
//----------------------------------------------------------------------------
TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE:
- TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
break;
case VISU::TCUTPLANES:
TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, 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()));
+ createAction( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), QIconSet(aPixmap),
+ tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), "", 0, aParent, false,
+ this, SLOT(OnCreateDeformedShapeAndScalarMap()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
this, SLOT(OnEditPlot3D()));
- createAction( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
+ createAction( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP, tr("MEN_EDIT_PRS"), QIconSet(),
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
- this, SLOT(OnEditScalarMapOnDeformedShape()));
+ this, SLOT(OnEditDeformedShapeAndScalarMap()));
createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
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
+ createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, 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 );
+ createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, 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_DEFORMED_SHAPE_AND_SCALAR_MAP ), -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_DEFORMEDSHAPEANDSCALARMAP ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
"'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
- "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TCOLOREDPRS3DHOLDER'");
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
// 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 );
+ mgr->setRule( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), aRule, true );
// display/erase commands
QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
// 3D presentations commands
QString aPrsType = " and $type in {'VISU::TMESH'" + aPrsAll + "}";
QString aPrsType2 = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
- QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
- QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
+ QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
+ QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
- " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
- QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
+ " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
+ QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
- "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
+ "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
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_DEFORMEDSHAPEANDSCALARMAP ),
+ "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}", true );
mgr->setRule( action( VISU_EDIT_CUTPLANES ),
"selcount=1 and type='VISU::TCUTPLANES'", true );
mgr->setRule( action( VISU_EDIT_CUTLINES ),
setPreferenceProperty( plot3d_represent, "indexes", indices2 );
addPreference( "", representGr, LightApp_Preferences::Space );
- int scalar_def_represent = addPreference( tr( "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
+ int scalar_def_represent = addPreference( tr( "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
setPreferenceProperty( scalar_def_represent, "strings", modes1 );
setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
void OnCreatePlot3D();
void OnCreateManyMesh();
void OnCreatePlot2dView();
- void OnCreateScalarMapOnDeformedShape();
+ void OnCreateDeformedShapeAndScalarMap();
void OnEditScalarMap();
void OnEditDeformedShape();
void OnEditVectors();
void OnEditStreamLines();
void OnEditPlot3D();
- void OnEditScalarMapOnDeformedShape();
+ void OnEditDeformedShapeAndScalarMap();
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_DEFORMED_SHAPE_AND_SCALAR_MAP 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_DEFORMEDSHAPEANDSCALARMAP 40628
#define VISU_EDIT_PRS 4062
#define VISU_CREATE_TABLE 4063
--- /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_DeformedShapeAndScalarMapDlg.cxx
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
+
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_InputPane.h"
+
+#include "VISU_Result_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#include "VISU_ScalarMapPL.hxx"
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
+
+#include "VISU_Convertor.hxx"
+
+#include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SALOME_ListIO.hxx"
+
+#include "SALOMEDSClient_AttributeString.hxx"
+#include "SALOMEDSClient_AttributeName.hxx"
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+
+using namespace std;
+
+#define MYDEBUG 0
+
+/*!
+ * Constructor
+ */
+VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule),
+ myIsAnimation(false),
+ myUpdateScalars(true),
+ myVisuGUI(theModule)
+{
+ setCaption(tr("DLG_TITLE"));
+ setSizeGripEnabled(TRUE);
+
+ QVBoxLayout* TopLayout = new QVBoxLayout (this);
+ TopLayout->setSpacing(6);
+ TopLayout->setMargin(11);
+
+ myTabBox = 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(38);
+ 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);
+
+ //
+ myTabBox->addTab(aBox, tr("DEFORMED_SHAPE_AND_SCALAR_MAP_TAB"));
+
+ // Scalar bar pane
+ myInputPane = new VisuGUI_InputPane(VISU::TDEFORMEDSHAPEANDSCALARMAP, theModule, this);
+
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
+ myTabBox->addTab(myInputPane, tr("INPUT_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);
+
+ QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
+ // Add Tab box and Buttons to the top layout
+ TopLayout->addWidget(myTabBox);
+ TopLayout->addWidget(GroupButtons);
+
+ // signals and slots connections
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
+ connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
+ connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
+}
+
+VisuGUI_DeformedShapeAndScalarMapDlg::~VisuGUI_DeformedShapeAndScalarMapDlg()
+{}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
+{
+ if( theInit )
+ myPrsCopy = VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
+ setFactor(myPrsCopy->GetScale());
+ myTimeStampsCombo->setDisabled(myIsAnimation);
+
+ CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
+ QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
+ aFieldName.in(),
+ myPrsCopy->GetScalarTimeStampNumber());
+ if (myEntity2Fields.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());
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ switch(aType){
+ case VISU::TTIMESTAMP: {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD: {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION: {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }}
+
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+
+ mySelectionObj = aSObject;
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
+ if (CORBA::is_nil(anObject)) {
+ mySelectionObj = mySelectionObj->GetFather();
+ }
+ }
+ }
+
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
+ if (!aRestoringMap.empty()) {
+ VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
+ if (aType == VISU::TTIMESTAMP) {
+ QString aMeshName = aRestoringMap["myMeshName"];
+ CORBA::String_var aName = myPrsCopy->GetMeshName();
+ if (aMeshName != aName.in())
+ continue;
+ QString aFieldName = aRestoringMap["myFieldName"];
+ QString aTimeIter = aRestoringMap["myTimeStampId"];
+ QString aEntity = aRestoringMap["myEntityId"];
+ VISU::Entity anEntity;
+ switch (aEntity.toInt()) {
+ case 0: anEntity = VISU::NODE; break;
+ case 1: anEntity = VISU::EDGE; break;
+ case 2: anEntity = VISU::FACE; break;
+ case 3: anEntity = VISU::CELL; break;
+ }
+ TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
+ TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
+ aTimeStampNumber2Time[aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(anEntity,
+ aFieldName.latin1(),
+ aTimeIter.toInt());
+ }
+ }
+ }
+ }
+ AddAllFieldNames();
+ }
+ myFieldsCombo->setCurrentText(aFieldName.in());
+ AddAllTimes(myFieldsCombo->currentText());
+ myTimeStampsCombo->setCurrentText(aIteration);
+ SetScalarField( false );
+
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
+ if( !theInit )
+ return;
+
+ myInputPane->initFromPrsObject( myPrsCopy );
+ myTabBox->setCurrentPage( 0 );
+}
+
+int
+VisuGUI_DeformedShapeAndScalarMapDlg
+::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
+{
+ if(!myInputPane->check() || !GetScalarPane()->check())
+ return 0;
+
+ int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
+
+ myPrsCopy->SetScale(getFactor());
+
+ myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
+ getCurrentScalarFieldName().latin1(),
+ myTimeStampID[ myTimeStampsCombo->currentItem() ]);
+
+ if(myUpdateScalars)
+ SetScalarField( false );
+
+ VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Copy(myPrsCopy, thePrs);
+
+ return anIsOk;
+}
+
+int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldNamePos(){
+ return myFieldsCombo->currentItem();
+}
+
+QString VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldName(){
+ return myFieldsCombo->currentText();
+}
+
+int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarNbIterations(){
+ return myTimeStampsCombo->count();
+}
+
+VISU::Entity
+VisuGUI_DeformedShapeAndScalarMapDlg
+::getCurrentScalarEntity()
+{
+ VISU::Entity anEntity = VISU::Entity(-1);
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ if (aFieldName == myFieldsCombo->currentText()) {
+ anEntity = anIter->first;
+ break;
+ }
+ }
+ }
+ return anEntity;
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::SetScalarField( const bool save_scalar_pane ){
+ SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane );
+}
+
+void
+VisuGUI_DeformedShapeAndScalarMapDlg
+::SetScalarField(int theIter,
+ QString theFieldName,
+ const bool save_scalar_pane )
+{
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ if( save_scalar_pane )
+ GetScalarPane()->storeToPrsObject(myPrsCopy);
+
+ QString aFieldName;
+
+ if(theFieldName.isEmpty())
+ aFieldName = myFieldsCombo->currentText();
+ else
+ aFieldName = theFieldName;
+
+ VISU::Entity anEntity = getCurrentScalarEntity();
+
+ myPrsCopy->SetScalarField(anEntity,
+ aFieldName.latin1(),
+ theIter);
+
+ if( save_scalar_pane )
+ UpdateScalarField();
+
+ QApplication::restoreOverrideCursor();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::accept()
+{
+ VisuGUI_ScalarBarBaseDlg::accept();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::reject()
+{
+ VisuGUI_ScalarBarBaseDlg::reject();
+}
+
+QString VisuGUI_DeformedShapeAndScalarMapDlg::GetContextHelpFilePath()
+{
+ return "scalar_map_on_deformed_shape_page.html";
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllFieldNames(){
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ myFieldsCombo->insertItem(aFieldName);
+ }
+ }
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldName){
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ if(theFieldName != aFieldName)
+ continue;
+
+ myTimeStampID.clear();
+ myTimeStampsCombo->clear();
+
+ const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
+ TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
+ for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
+ int aTimeStampNumber = aTimeStampIter->first;
+ myTimeStampID.push_back(aTimeStampNumber);
+
+ QString aTimeStampTime = aTimeStampIter->second;
+ myTimeStampsCombo->insertItem(aTimeStampTime);
+ }
+ return;
+ }
+ }
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::onFieldChanged(int){
+ AddAllTimes(myFieldsCombo->currentText());
+ SetScalarField();
+ UpdateScalarField();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::onTimeStampChanged(int){
+ SetScalarField();
+ UpdateScalarField();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){
+ GetScalarPane()->initFromPrsObject(myPrsCopy);
+}
+
+QString
+VisuGUI_DeformedShapeAndScalarMapDlg
+::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
+{
+ QString aTime("");
+ VISU::TEntity anEntity = VISU::TEntity(theEntity);
+ VISU::Result_i* theResult = myPrsCopy->GetCResult();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
+ VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
+ anEntity,
+ theFieldName);
+ if(!aField)
+ return aTime;
+
+ VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
+ if(aIter != aValField.end()){
+ VISU::PValForTime aValForTime = aIter->second;
+ aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
+ }
+ return aTime;
+}
--- /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_DeformedShapeAndScalarMapDlg.h
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
+#define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
+
+#include "VisuGUI_Prs3dDlg.h"
+
+#include "VISUConfig.hh"
+
+#include "QtxDblSpinBox.h"
+
+#include <qdialog.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qtabwidget.h>
+
+#include <set>
+#include <vector>
+
+class SalomeApp_Module;
+class VisuGUI_InputPane;
+
+namespace VISU
+{
+ class DeformedShapeAndScalarMap_i;
+}
+
+class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
+ ~VisuGUI_DeformedShapeAndScalarMapDlg();
+
+ double getFactor()
+ { return ScalFact->value(); }
+ void setFactor(double theFactor)
+ { ScalFact->setValue(theFactor); }
+
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
+ virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
+
+ int getCurrentScalarFieldNamePos();
+ QString getCurrentScalarFieldName();
+ int getCurrentScalarNbIterations();
+ VISU::Entity getCurrentScalarEntity();
+ void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
+
+protected:
+ virtual QString GetContextHelpFilePath();
+
+protected slots:
+ void accept();
+ void reject();
+
+private slots:
+ void onFieldChanged(int i=0);
+ void onTimeStampChanged(int i=0);
+
+private:
+ QtxDblSpinBox* ScalFact;
+ QTabWidget* myTabBox;
+ VisuGUI_ScalarBarPane* myScalarPane;
+ VisuGUI_InputPane* myInputPane;
+ QComboBox *myFieldsCombo;
+ QComboBox *myTimeStampsCombo;
+
+ typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
+ typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
+ typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
+
+ TEntity2Fields myEntity2Fields;
+ int myCurrScalarIter;
+ bool myIsAnimation;
+ bool myUpdateScalars;
+ std::vector<int> myTimeStampID;
+
+ _PTR(SObject) mySelectionObj;
+ SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
+ SalomeApp_Module* myVisuGUI;
+
+protected:
+ void UpdateScalarField();
+ void SetScalarField( const bool = true );
+ void AddAllFieldNames();
+ void AddAllTimes(const QString& theFieldName);
+ QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
+};
+
+#endif // VISUGUI_DEFORMEDSHAPEDLS_H
ENUM2STRING( aResStr, VISU::TISOSURFACES );
ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
+ ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPEANDSCALARMAP );
ENUM2STRING( aResStr, VISU::TCUTPLANES );
ENUM2STRING( aResStr, VISU::TCUTLINES );
ENUM2STRING( aResStr, VISU::TVECTORS );
+++ /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
-// Author : Eugeny Nikolaev
-// Module : VISU
-
-#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
-
-#include "VisuGUI_Tools.h"
-#include "VisuGUI_InputPane.h"
-
-#include "VISU_Result_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VISU_ColoredPrs3dFactory.hh"
-
-#include "VISU_ScalarMapPL.hxx"
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
-
-#include "VISU_Convertor.hxx"
-
-#include "SalomeApp_Module.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "SALOME_ListIO.hxx"
-
-#include "SALOMEDSClient_AttributeString.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)
- : VisuGUI_ScalarBarBaseDlg(theModule),
- myIsAnimation(false),
- myUpdateScalars(true),
- myVisuGUI(theModule)
-{
- setCaption(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
-
- QVBoxLayout* TopLayout = new QVBoxLayout (this);
- TopLayout->setSpacing(6);
- TopLayout->setMargin(11);
-
- myTabBox = 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(38);
- 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);
-
- //
- myTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
-
- // Scalar bar pane
- myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAPONDEFORMEDSHAPE, theModule, this);
-
- myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
- myTabBox->addTab(myInputPane, tr("INPUT_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);
-
- QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
-
- // Add Tab box and Buttons to the top layout
- TopLayout->addWidget(myTabBox);
- TopLayout->addWidget(GroupButtons);
-
- // signals and slots connections
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
- connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
- connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
-}
-
-VisuGUI_ScalarMapOnDeformedShapeDlg::~VisuGUI_ScalarMapOnDeformedShapeDlg()
-{}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
-{
- if( theInit )
- myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- setFactor(myPrsCopy->GetScale());
- myTimeStampsCombo->setDisabled(myIsAnimation);
-
- CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
- QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
- aFieldName.in(),
- myPrsCopy->GetScalarTimeStampNumber());
- if (myEntity2Fields.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());
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- switch(aType){
- case VISU::TTIMESTAMP: {
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- break;
- }
- case VISU::TFIELD: {
- _PTR(SObject) newSObject;
- if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
- aSObject = aSObject->GetFather();
- break;
- }
- case VISU::TANIMATION: {
- _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
- for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
- _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
- _PTR(SObject) newSObject;
- if(aTmpChildSObj->ReferencedObject(newSObject)){
- aSObject = newSObject;
- aSObject->GetFather();
- break;
- }
- }
- break;
- }}
-
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
-
- mySelectionObj = aSObject;
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- if (CORBA::is_nil(anObject)) {
- mySelectionObj = mySelectionObj->GetFather();
- }
- }
- }
-
- if (mySelectionObj) {
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
- if (!aRestoringMap.empty()) {
- VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
- if (aType == VISU::TTIMESTAMP) {
- QString aMeshName = aRestoringMap["myMeshName"];
- CORBA::String_var aName = myPrsCopy->GetMeshName();
- if (aMeshName != aName.in())
- continue;
- QString aFieldName = aRestoringMap["myFieldName"];
- QString aTimeIter = aRestoringMap["myTimeStampId"];
- QString aEntity = aRestoringMap["myEntityId"];
- VISU::Entity anEntity;
- switch (aEntity.toInt()) {
- case 0: anEntity = VISU::NODE; break;
- case 1: anEntity = VISU::EDGE; break;
- case 2: anEntity = VISU::FACE; break;
- case 3: anEntity = VISU::CELL; break;
- }
- TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
- TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
- aTimeStampNumber2Time[aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(anEntity,
- aFieldName.latin1(),
- aTimeIter.toInt());
- }
- }
- }
- }
- AddAllFieldNames();
- }
- myFieldsCombo->setCurrentText(aFieldName.in());
- AddAllTimes(myFieldsCombo->currentText());
- myTimeStampsCombo->setCurrentText(aIteration);
- SetScalarField( false );
-
- VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
-
- if( !theInit )
- return;
-
- myInputPane->initFromPrsObject( myPrsCopy );
- myTabBox->setCurrentPage( 0 );
-}
-
-int
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
-{
- if(!myInputPane->check() || !GetScalarPane()->check())
- return 0;
-
- int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
-
- myPrsCopy->SetScale(getFactor());
-
- myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
- getCurrentScalarFieldName().latin1(),
- myTimeStampID[ myTimeStampsCombo->currentItem() ]);
-
- if(myUpdateScalars)
- SetScalarField( false );
-
- VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(myPrsCopy, thePrs);
-
- return anIsOk;
-}
-
-int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldNamePos(){
- return myFieldsCombo->currentItem();
-}
-
-QString VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldName(){
- return myFieldsCombo->currentText();
-}
-
-int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarNbIterations(){
- return myTimeStampsCombo->count();
-}
-
-VISU::Entity
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::getCurrentScalarEntity()
-{
- VISU::Entity anEntity = VISU::Entity(-1);
- TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
- for(; anIter != myEntity2Fields.end(); anIter++){
- const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
- TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
- for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
- const QString& aFieldName = aFieldIter->first;
- if (aFieldName == myFieldsCombo->currentText()) {
- anEntity = anIter->first;
- break;
- }
- }
- }
- return anEntity;
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField( const bool save_scalar_pane ){
- SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane );
-}
-
-void
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::SetScalarField(int theIter,
- QString theFieldName,
- const bool save_scalar_pane )
-{
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- if( save_scalar_pane )
- GetScalarPane()->storeToPrsObject(myPrsCopy);
-
- QString aFieldName;
-
- if(theFieldName.isEmpty())
- aFieldName = myFieldsCombo->currentText();
- else
- aFieldName = theFieldName;
-
- VISU::Entity anEntity = getCurrentScalarEntity();
-
- myPrsCopy->SetScalarField(anEntity,
- aFieldName.latin1(),
- theIter);
-
- if( save_scalar_pane )
- UpdateScalarField();
-
- QApplication::restoreOverrideCursor();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
-{
- VisuGUI_ScalarBarBaseDlg::accept();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::reject()
-{
- VisuGUI_ScalarBarBaseDlg::reject();
-}
-
-QString VisuGUI_ScalarMapOnDeformedShapeDlg::GetContextHelpFilePath()
-{
- return "scalar_map_on_deformed_shape_page.html";
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
- TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
- for(; anIter != myEntity2Fields.end(); anIter++){
- const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
- TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
- for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
- const QString& aFieldName = aFieldIter->first;
- myFieldsCombo->insertItem(aFieldName);
- }
- }
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldName){
- TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
- for(; anIter != myEntity2Fields.end(); anIter++){
- const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
- TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
- for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
- const QString& aFieldName = aFieldIter->first;
- if(theFieldName != aFieldName)
- continue;
-
- myTimeStampID.clear();
- myTimeStampsCombo->clear();
-
- const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
- TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
- for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
- int aTimeStampNumber = aTimeStampIter->first;
- myTimeStampID.push_back(aTimeStampNumber);
-
- QString aTimeStampTime = aTimeStampIter->second;
- myTimeStampsCombo->insertItem(aTimeStampTime);
- }
- return;
- }
- }
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::onFieldChanged(int){
- AddAllTimes(myFieldsCombo->currentText());
- SetScalarField();
- UpdateScalarField();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){
- SetScalarField();
- UpdateScalarField();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
- GetScalarPane()->initFromPrsObject(myPrsCopy);
-}
-
-QString
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
-{
- QString aTime("");
- VISU::TEntity anEntity = VISU::TEntity(theEntity);
- VISU::Result_i* theResult = myPrsCopy->GetCResult();
- VISU::Result_i::PInput anInput = theResult->GetInput();
- VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
- anEntity,
- theFieldName);
- if(!aField)
- return aTime;
-
- VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
- if(aIter != aValField.end()){
- VISU::PValForTime aValForTime = aIter->second;
- aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
- }
- return aTime;
-}
+++ /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VisuGUI_ScalarMapOnDeformedShapeDlg.h
-// Author : Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
-#define VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
-
-#include "VisuGUI_Prs3dDlg.h"
-
-#include "VISUConfig.hh"
-
-#include "QtxDblSpinBox.h"
-
-#include <qdialog.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-
-#include <set>
-#include <vector>
-
-class SalomeApp_Module;
-class VisuGUI_InputPane;
-
-namespace VISU
-{
- class ScalarMapOnDeformedShape_i;
-}
-
-class VisuGUI_ScalarMapOnDeformedShapeDlg : public VisuGUI_ScalarBarBaseDlg
-{
- Q_OBJECT
-
-public:
- VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule);
- ~VisuGUI_ScalarMapOnDeformedShapeDlg();
-
- double getFactor()
- { return ScalFact->value(); }
- void setFactor(double theFactor)
- { ScalFact->setValue(theFactor); }
-
- virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
-
- virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-
- int getCurrentScalarFieldNamePos();
- QString getCurrentScalarFieldName();
- int getCurrentScalarNbIterations();
- VISU::Entity getCurrentScalarEntity();
- void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
-
-protected:
- virtual QString GetContextHelpFilePath();
-
-protected slots:
- void accept();
- void reject();
-
-private slots:
- void onFieldChanged(int i=0);
- void onTimeStampChanged(int i=0);
-
-private:
- QtxDblSpinBox* ScalFact;
- QTabWidget* myTabBox;
- VisuGUI_ScalarBarPane* myScalarPane;
- VisuGUI_InputPane* myInputPane;
- QComboBox *myFieldsCombo;
- QComboBox *myTimeStampsCombo;
-
- typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
- typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
- typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
-
- TEntity2Fields myEntity2Fields;
- int myCurrScalarIter;
- bool myIsAnimation;
- bool myUpdateScalars;
- std::vector<int> myTimeStampID;
-
- _PTR(SObject) mySelectionObj;
- SALOME::GenericObjPtr<VISU::ScalarMapOnDeformedShape_i> myPrsCopy;
- SalomeApp_Module* myVisuGUI;
-
-protected:
- void UpdateScalarField();
- void SetScalarField( const bool = true );
- void AddAllFieldNames();
- void AddAllTimes(const QString& theFieldName);
- QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
-};
-
-#endif // VISUGUI_DEFORMEDSHAPEDLS_H
#include "VisuGUI_VectorsDlg.h"
#include "VisuGUI_IsoSurfacesDlg.h"
#include "VisuGUI_StreamLinesDlg.h"
-#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+#include "VisuGUI_DeformedShapeAndScalarMapDlg.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_DeformedShapeAndScalarMap_i.hh"
#include "VISU_GaussPoints_i.hh"
#include "VISU_ViewManager_i.hh"
TVECTORS_ITEM = 6, // VISU::TVECTORS
TSTREAMLINES_ITEM = 7, // VISU::TSTREAMLINES
TGAUSSPOINTS_ITEM = 8, // VISU::TGAUSSPOINTS
- TSCALARMAPONDEFORMEDSHAPE_ITEM = 9 // VISU::TSCALARMAPONDEFORMEDSHAPE
+ TDEFORMEDSHAPEANDSCALARMAP_ITEM = 9 // VISU::TDEFORMEDSHAPEANDSCALARMAP
};
//------------------------------------------------------------------------
myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
- myTypeCombo->insertItem("Scalar map on Deformed shape"); // item 9
- myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
- myComboId2TypeId.push_back(TSCALARMAPONDEFORMEDSHAPE_ITEM);;
+ myTypeCombo->insertItem("Deformed shape and Scalar map"); // item 9
+ myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM] = myComboId2TypeId.size();
+ myComboId2TypeId.push_back(TDEFORMEDSHAPEANDSCALARMAP_ITEM);;
}
if(anEnableGP){
myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
- myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]);
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM]);
break;
case VISU::TVECTORS: //Vectors
myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
case TDEFORMEDSHAPE_ITEM: //Deformed Shape
aData.myPrsType = VISU::TDEFORMEDSHAPE;
break;
- case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
- aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
+ case TDEFORMEDSHAPEANDSCALARMAP_ITEM: //Scalar Map on Deformed Shape
+ aData.myPrsType = VISU::TDEFORMEDSHAPEANDSCALARMAP;
break;
case TVECTORS_ITEM: //Vectors
aData.myPrsType = VISU::TVECTORS;
c.suspend();
EditPrs<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg>(myModule, aData, myAnimator);
break;
- case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
+ case TDEFORMEDSHAPEANDSCALARMAP_ITEM: //Scalar Map on Deformed Shape
c.suspend();
{
- typedef VisuGUI_ScalarMapOnDeformedShapeDlg DLG;
- typedef VISU::ScalarMapOnDeformedShape_i TYPE;
+ typedef VisuGUI_DeformedShapeAndScalarMapDlg DLG;
+ typedef VISU::DeformedShapeAndScalarMap_i TYPE;
DLG* aDlg = new DLG (myModule);
TYPE* aPrs3d = dynamic_cast<TYPE*>(aData.myPrs[0]);
aDlg->initFromPrsObject(aPrs3d, true);
case VISU::TSTREAMLINES:
case VISU::TPLOT3D:
case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
{
PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
if (aServant.in()) {
VISU_ViewManager_i.hh \
VISU_View_i.hh \
VISU_TimeAnimation.h \
- VISU_ScalarMapOnDeformedShape_i.hh \
+ VISU_DeformedShapeAndScalarMap_i.hh \
VISU_ColoredPrs3dFactory.hh \
VISU_MonoColorPrs_i.hh \
SALOME_GenericObjPointer.hh
VISU_CutLines_i.cc \
VISU_Vectors_i.cc \
VISU_StreamLines_i.cc \
- VISU_ScalarMapOnDeformedShape_i.cc \
+ VISU_DeformedShapeAndScalarMap_i.cc \
VISU_ColoredPrs3dCache_i.cc \
VISU_ColoredPrs3dHolder_i.cc \
VISU_ColoredPrs3dFactory.cc \
return VISU::TISOSURFACES;
if ( theComment == "DEFORMEDSHAPE" )
return VISU::TDEFORMEDSHAPE;
- if ( theComment == "SCALARMAPONDEFORMEDSHAPE" )
- return VISU::TSCALARMAPONDEFORMEDSHAPE;
+ if ( theComment == "DEFORMEDSHAPEANDSCALARMAP" )
+ return VISU::TDEFORMEDSHAPEANDSCALARMAP;
if ( theComment == "GAUSSPOINTS" )
return VISU::TGAUSSPOINTS;
if ( theComment == "PLOT3D" )
aPrs3d->SameAs(thePrs);
// special case for deformed shape
- VISU::ScalarMapOnDeformedShape_i* dShape =
- dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>( aPrs3d.get() );
+ VISU::DeformedShapeAndScalarMap_i* dShape =
+ dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>( aPrs3d.get() );
if ( dShape && dShape->GetScalarTimeStampNumber() != theInput.myTimeStampNumber )
{
dShape->SetScalarField( dShape->GetScalarEntity(),
case TDEFORMEDSHAPE:
return VISU::CreatePrs3dByEnum<TDEFORMEDSHAPE>(theStudy, thePublishInStudyMode);
case TSCALARMAPONDEFORMEDSHAPE:
- return VISU::CreatePrs3dByEnum<TSCALARMAPONDEFORMEDSHAPE>(theStudy, thePublishInStudyMode);
+ case TDEFORMEDSHAPEANDSCALARMAP:
+ return VISU::CreatePrs3dByEnum<TDEFORMEDSHAPEANDSCALARMAP>(theStudy, thePublishInStudyMode);
case TISOSURFACES:
return VISU::CreatePrs3dByEnum<TISOSURFACES>(theStudy, thePublishInStudyMode);
case TSTREAMLINES:
aMemory = CheckIsPossible<TDEFORMEDSHAPE>(theInput, theMemoryCheck);
break;
case TSCALARMAPONDEFORMEDSHAPE:
- aMemory = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput, theMemoryCheck);
+ case TDEFORMEDSHAPEANDSCALARMAP:
+ aMemory = CheckIsPossible<TDEFORMEDSHAPEANDSCALARMAP>(theInput, theMemoryCheck);
break;
case TISOSURFACES:
aMemory = CheckIsPossible<TISOSURFACES>(theInput, theMemoryCheck);
#include "VISU_I.hxx"
#include "SALOME_GenericObjPointer.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_GaussPoints_i.hh"
#include "VISU_StreamLines_i.hh"
namespace TL
{
//----------------------------------------------------------------------------
- typedef TList<ScalarMapOnDeformedShape_i,
+ typedef TList<DeformedShapeAndScalarMap_i,
+ TList<DeformedShapeAndScalarMap_i,
TList<DeformedShape_i,
TList<StreamLines_i,
TList<GaussPoints_i,
TList<CutLines_i,
TList<Vectors_i,
TList<Plot3D_i,
- TNullType> > > > > > > > > >
+ TNullType> > > > > > > > > > >
TColoredPrs3dTypeList;
typedef TList<TInt2Type<TSCALARMAPONDEFORMEDSHAPE>,
+ TList<TInt2Type<TDEFORMEDSHAPEANDSCALARMAP>,
TList<TInt2Type<TDEFORMEDSHAPE>,
TList<TInt2Type<TSTREAMLINES>,
TList<TInt2Type<TGAUSSPOINTS>,
TList<TInt2Type<TCUTLINES>,
TList<TInt2Type<TVECTORS>,
TList<TInt2Type<TPLOT3D>,
- TNullType> > > > > > > > > >
+ TNullType> > > > > > > > > > >
TColoredPrs3dEnumList;
--- /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_DeformedShapeAndScalarMap_i.cc
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_Result_i.hh"
+
+#include "VISU_ScalarMapAct.h"
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
+#include "VISU_Convertor.hxx"
+
+#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
+
+#include <vtkUnstructuredGrid.h>
+#include <vtkProperty.h>
+#include <vtkMapper.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+static int INCMEMORY = 4+12;
+
+
+//---------------------------------------------------------------
+size_t
+VISU::DeformedShapeAndScalarMap_i
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
+{
+ size_t aResult = 0;
+ try{
+ aResult = TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ false);
+ if(theIsMemoryCheck && aResult){
+ VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ VISU::PField aField = anInput->GetField(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName);
+ if(aField->myNbComp <= 1)
+ return 0;
+
+ bool anIsEstimated = true;
+ size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ anIsEstimated);
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
+ aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ if(MYDEBUG)
+ MESSAGE("DeformedShapeAndScalarMap_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::DeformedShapeAndScalarMap_i::myNbPresent = 0;
+
+//---------------------------------------------------------------
+QString
+VISU::DeformedShapeAndScalarMap_i
+::GenerateName()
+{
+ return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
+const string VISU::DeformedShapeAndScalarMap_i::myComment = "SCALARMAPONDEFORMEDSHAPE"; // It is obsolete. Use "DEFORMEDSHAPEANDSCALARMAP" instead.
+
+//---------------------------------------------------------------
+const char*
+VISU::DeformedShapeAndScalarMap_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+//----------------------------------------------------------------------------
+const char*
+VISU::DeformedShapeAndScalarMap_i
+::GetIconName()
+{
+ if (!IsGroupsUsed())
+ return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
+ else
+ return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
+}
+
+//---------------------------------------------------------------
+VISU::DeformedShapeAndScalarMap_i
+::DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyMode) :
+ ColoredPrs3d_i(thePublishInStudyMode),
+ ScalarMap_i(thePublishInStudyMode),
+ myDeformedShapeAndScalarMapPL(NULL),
+ myScalarTimeStampNumber(1)
+{}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::DeformedShapeAndScalarMap_i
+::Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ TSuperClass::Create(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ SetScalarField(theEntity,
+ theFieldName.c_str(),
+ theTimeStampNumber);
+ return this;
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::DeformedShapeAndScalarMap_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap)
+{
+ if(!TSuperClass::Restore(theSObject, theMap))
+ return NULL;
+
+ QString aMeshName = VISU::Storable::FindValue(theMap,"myScalarMeshName");
+ VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt());
+
+ QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
+ int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
+
+ SetScalarField(anEntity,
+ aFieldName,
+ aTimeStampNumber);
+
+ SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
+
+ return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
+ Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
+ Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
+
+ Storable::DataToStream( theStr, "myFactor", GetScale() );
+}
+
+
+//---------------------------------------------------------------
+VISU::DeformedShapeAndScalarMap_i
+::~DeformedShapeAndScalarMap_i()
+{
+ if(MYDEBUG) MESSAGE("DeformedShapeAndScalarMap_i::~DeformedShapeAndScalarMap_i()");
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
+
+ if(const DeformedShapeAndScalarMap_i* aPrs3d = dynamic_cast<const DeformedShapeAndScalarMap_i*>(theOrigin)){
+ DeformedShapeAndScalarMap_i* anOrigin = const_cast<DeformedShapeAndScalarMap_i*>(aPrs3d);
+ CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
+
+ SetScalarField(anOrigin->GetScalarEntity(),
+ aFieldName,
+ anOrigin->GetScalarTimeStampNumber());
+ Update();
+ }
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SetScale(CORBA::Double theScale)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapeAndScalarMapPL, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScale, theScale));
+}
+
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::DeformedShapeAndScalarMap_i
+::GetScale()
+{
+ return myDeformedShapeAndScalarMapPL->GetScale();
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
+{
+ if(!thePipeLine){
+ myDeformedShapeAndScalarMapPL = VISU_DeformedShapeAndScalarMapPL::New();
+ }else
+ myDeformedShapeAndScalarMapPL = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine);
+
+ myDeformedShapeAndScalarMapPL->GetMapper()->SetScalarVisibility(1);
+
+ TSuperClass::CreatePipeLine(myDeformedShapeAndScalarMapPL);
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::DeformedShapeAndScalarMap_i
+::CheckIsPossible()
+{
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+}
+
+
+//---------------------------------------------------------------
+VISU_Actor*
+VISU::DeformedShapeAndScalarMap_i
+::CreateActor()
+{
+ VISU_Actor* anActor = TSuperClass::CreateActor(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
+ bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
+ anActor->SetRepresentation(aDispMode);
+ if (toShrink)
+ anActor->SetShrink();
+ anActor->SetVTKMapping(false);
+ return anActor;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::UpdateActor(VISU_Actor* theActor)
+{
+ if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+ anActor->SetBarVisibility(true);
+ GetPipeLine()->GetMapper()->SetScalarVisibility(1);
+ }
+ TSuperClass::UpdateActor(theActor);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SetField(VISU::PField theField)
+{
+ TSuperClass::SetField(theField);
+
+ if(!myScalarField)
+ myScalarField = theField;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SetScalarField(VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ bool anIsModified = false;
+
+ if(!anIsModified)
+ anIsModified |= myScalarEntity != theEntity;
+
+ if(!anIsModified)
+ anIsModified |= myScalarFieldName != theFieldName;
+
+ if(!anIsModified)
+ anIsModified |= myScalarTimeStampNumber != theTimeStampNumber;
+
+ if(!anIsModified)
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ VISU::TEntity aEntity = VISU::TEntity(theEntity);
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
+
+ VISU::PUnstructuredGridIDMapper anIDMapper =
+ anInput->GetTimeStampOnMesh(GetCMeshName(),
+ aEntity,
+ theFieldName,
+ theTimeStampNumber);
+
+ vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
+ if(myDeformedShapeAndScalarMapPL && anOutput)
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapeAndScalarMapPL, vtkDataSet*>
+ (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScalars, anOutput));
+
+ myScalarEntity = theEntity;
+ myScalarFieldName = theFieldName;
+ myScalarTimeStampNumber = theTimeStampNumber;
+
+ SetTitle(theFieldName);
+ SetScalarMode(GetScalarMode());
+ if(!IsRangeFixed() && IsPipeLineExists())
+ SetSourceRange();
+
+ myParamsTime.Modified();
+}
+
+
+//---------------------------------------------------------------
+VISU::Entity
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarEntity()
+{
+ return myScalarEntity;
+}
+
+
+//---------------------------------------------------------------
+char*
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarFieldName()
+{
+ return CORBA::string_dup(myScalarFieldName.c_str());
+}
+
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarTimeStampNumber()
+{
+ return myScalarTimeStampNumber;
+}
+
+
+//---------------------------------------------------------------
+VISU::PField
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarField()
+{
+ return myScalarField;
+}
--- /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_DeformedShapeAndScalarMap_i.hh
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_DeformedShapeAndScalarMap_i_HeaderFile
+#define VISU_DeformedShapeAndScalarMap_i_HeaderFile
+
+#include "VISU_ScalarMap_i.hh"
+
+class VISU_DeformedShapeAndScalarMapPL;
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ //! Class of Scalar Map on Deformed Shape presentation.
+ class VISU_I_EXPORT DeformedShapeAndScalarMap_i : public virtual POA_VISU::DeformedShapeAndScalarMap,
+ public virtual ScalarMap_i
+ {
+ static int myNbPresent;
+ DeformedShapeAndScalarMap_i(const DeformedShapeAndScalarMap_i&);
+
+ public:
+ //----------------------------------------------------------------------------
+ typedef ScalarMap_i TSuperClass;
+ typedef VISU::DeformedShapeAndScalarMap TInterface;
+
+ explicit
+ DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
+
+ virtual
+ ~DeformedShapeAndScalarMap_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TDEFORMEDSHAPEANDSCALARMAP;
+ }
+
+ virtual
+ void
+ SetScale(CORBA::Double theScale);
+
+ virtual
+ CORBA::Double
+ GetScale();
+
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
+
+ VISU_DeformedShapeAndScalarMapPL*
+ GetSpecificPL()
+ {
+ return myDeformedShapeAndScalarMapPL;
+ }
+
+ protected:
+ //! Redefines VISU_ColoredPrs3d_i::SetField
+ virtual
+ void
+ SetField(VISU::PField theField);
+
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine(VISU_PipeLine* thePipeLine);
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
+
+ public:
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ static
+ size_t
+ IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
+
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ virtual
+ Storable*
+ Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber);
+
+ //! Redefines VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ //! Redefines VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap);
+
+ static const std::string myComment;
+
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
+
+ virtual
+ const char*
+ GetIconName();
+
+ virtual
+ VISU_Actor*
+ CreateActor();
+
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor) ;
+
+ virtual
+ void
+ SetScalarField(VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theTimeStampNumber);
+
+ virtual
+ VISU::Entity
+ GetScalarEntity();
+
+ virtual
+ char*
+ GetScalarFieldName();
+
+ virtual
+ CORBA::Long
+ GetScalarTimeStampNumber();
+
+ virtual
+ VISU::PField
+ GetScalarField();
+
+ private:
+ VISU_DeformedShapeAndScalarMapPL *myDeformedShapeAndScalarMapPL;
+
+ PField myScalarField;
+ VISU::Entity myScalarEntity;
+ std::string myScalarFieldName;
+ CORBA::Long myScalarTimeStampNumber;
+ };
+}
+#endif
#include "VISU_Table_i.hh"
#include "VISU_PointMap3d_i.hh"
#include "VISU_GaussPoints_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
#include "VISU_ColoredPrs3dCache_i.hh"
#include "VISU_ColoredPrs3dHolder_i.hh"
//---------------------------------------------------------------------------
std::string
- ScalarMapOnDeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::ScalarMapOnDeformedShape_i* theServant,
- std::ostream& theStr,
- const std::string& theName,
- TColoredPrs3dFactory& thePrsFactory,
- std::string thePrefix)
+ DeformedShapeAndScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::DeformedShapeAndScalarMap_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
{
thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<endl;
}
return;
case VISU::TSCALARMAPONDEFORMEDSHAPE:
- if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnDeformedShapeOnField", theArgumentName);
- thePrefix = ScalarMapOnDeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeAndScalarMapOnField", theArgumentName);
+ thePrefix = DeformedShapeAndScalarMapToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
break;
}
case VISU::TSCALARMAPONDEFORMEDSHAPE:
- if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(aDevice)){
- ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(aDevice)){
+ DeformedShapeAndScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
break;
}
case VISU::TVECTORS:
Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine<StreamLines_i>));
Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine<Plot3D_i>));
Storable::RegistryStorableEngine(Vectors_i::myComment.c_str(),&(StorableEngine<Vectors_i>));
- Storable::RegistryStorableEngine(ScalarMapOnDeformedShape_i::myComment.c_str(),&(StorableEngine<ScalarMapOnDeformedShape_i>));
+ Storable::RegistryStorableEngine(DeformedShapeAndScalarMap_i::myComment.c_str(),&(StorableEngine<DeformedShapeAndScalarMap_i>));
Storable::RegistryStorableEngine(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::StorableEngine));
Storable::RegistryStorableEngine(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::StorableEngine));
//---------------------------------------------------------------
- ScalarMapOnDeformedShape_ptr
+ DeformedShapeAndScalarMap_ptr
VISU_Gen_i
::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
const char* theMeshName,
const char* theFieldName,
CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::ScalarMapOnDeformedShape_i>(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theIteration)._retn();
+ return DeformedShapeAndScalarMapOnField(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration);
+ }
+
+
+//---------------------------------------------------------------
+ DeformedShapeAndScalarMap_ptr
+ VISU_Gen_i
+ ::DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
+ {
+ return Prs3dOnField<VISU::DeformedShapeAndScalarMap_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
const char* theFieldName,
CORBA::Long theIteration);
+ //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
virtual
- ScalarMapOnDeformedShape_ptr
+ DeformedShapeAndScalarMap_ptr
ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
CORBA::Long theIteration);
+
+ virtual
+ DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
virtual
Vectors_ptr
VectorsOnField(Result_ptr theResult,
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
#include "VISU_GaussPoints_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
#include "VISU_ViewManager_i.hh"
#include "VISU_View_i.hh"
#include "VISU_TimeAnimation.h"
+++ /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_ScalarMapOnDeformedShape_i.cc
-// Author : Eugeny Nikolaev
-// Module : VISU
-
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VISU_Prs3dUtils.hh"
-#include "VISU_Result_i.hh"
-
-#include "VISU_ScalarMapAct.h"
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
-#include "VISU_Convertor.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SALOME_Event.hxx"
-
-#include <vtkUnstructuredGrid.h>
-#include <vtkProperty.h>
-#include <vtkMapper.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-static int INCMEMORY = 4+12;
-
-
-//---------------------------------------------------------------
-size_t
-VISU::ScalarMapOnDeformedShape_i
-::IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber,
- bool theIsMemoryCheck)
-{
- size_t aResult = 0;
- try{
- aResult = TSuperClass::IsPossible(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber,
- false);
- if(theIsMemoryCheck && aResult){
- VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
- VISU::PField aField = anInput->GetField(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName);
- if(aField->myNbComp <= 1)
- return 0;
-
- bool anIsEstimated = true;
- size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber,
- anIsEstimated);
- if(anIsEstimated)
- aSize *= INCMEMORY;
- aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- if(MYDEBUG)
- 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();
-}
-
-//----------------------------------------------------------------------------
-const char*
-VISU::ScalarMapOnDeformedShape_i
-::GetIconName()
-{
- if (!IsGroupsUsed())
- return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
- else
- return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
-}
-
-//---------------------------------------------------------------
-VISU::ScalarMapOnDeformedShape_i
-::ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyMode) :
- ColoredPrs3d_i(thePublishInStudyMode),
- ScalarMap_i(thePublishInStudyMode),
- myScalarMapOnDeformedShapePL(NULL),
- myScalarTimeStampNumber(1)
-{}
-
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::ScalarMapOnDeformedShape_i
-::Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber)
-{
- TSuperClass::Create(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
- SetScalarField(theEntity,
- theFieldName.c_str(),
- theTimeStampNumber);
- return this;
-}
-
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::ScalarMapOnDeformedShape_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap)
-{
- if(!TSuperClass::Restore(theSObject, theMap))
- return NULL;
-
- QString aMeshName = VISU::Storable::FindValue(theMap,"myScalarMeshName");
- VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt());
-
- QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
- int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
-
- SetScalarField(anEntity,
- aFieldName,
- aTimeStampNumber);
-
- SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
-
- return this;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::ToStream(std::ostringstream& theStr)
-{
- TSuperClass::ToStream(theStr);
-
- Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
- Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
- Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
-
- Storable::DataToStream( theStr, "myFactor", GetScale() );
-}
-
-
-//---------------------------------------------------------------
-VISU::ScalarMapOnDeformedShape_i
-::~ScalarMapOnDeformedShape_i()
-{
- if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()");
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SameAs(const Prs3d_i* theOrigin)
-{
- TSuperClass::SameAs(theOrigin);
-
- if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
- ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
- CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
-
- SetScalarField(anOrigin->GetScalarEntity(),
- aFieldName,
- anOrigin->GetScalarTimeStampNumber());
- Update();
- }
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetScale(CORBA::Double theScale)
-{
- VISU::TSetModified aModified(this);
-
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkFloatingPointType>
- (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale));
-}
-
-
-//---------------------------------------------------------------
-CORBA::Double
-VISU::ScalarMapOnDeformedShape_i
-::GetScale()
-{
- return myScalarMapOnDeformedShapePL->GetScale();
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::CreatePipeLine(VISU_PipeLine* thePipeLine)
-{
- if(!thePipeLine){
- myScalarMapOnDeformedShapePL = VISU_ScalarMapOnDeformedShapePL::New();
- }else
- myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
-
- myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(1);
-
- TSuperClass::CreatePipeLine(myScalarMapOnDeformedShapePL);
-}
-
-
-//---------------------------------------------------------------
-bool
-VISU::ScalarMapOnDeformedShape_i
-::CheckIsPossible()
-{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
-}
-
-
-//---------------------------------------------------------------
-VISU_Actor*
-VISU::ScalarMapOnDeformedShape_i
-::CreateActor()
-{
- VISU_Actor* anActor = TSuperClass::CreateActor(true);
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
- bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
- anActor->SetRepresentation(aDispMode);
- if (toShrink)
- anActor->SetShrink();
- anActor->SetVTKMapping(false);
- return anActor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::UpdateActor(VISU_Actor* theActor)
-{
- if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
- anActor->SetBarVisibility(true);
- GetPipeLine()->GetMapper()->SetScalarVisibility(1);
- }
- TSuperClass::UpdateActor(theActor);
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetField(VISU::PField theField)
-{
- TSuperClass::SetField(theField);
-
- if(!myScalarField)
- myScalarField = theField;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetScalarField(VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theTimeStampNumber)
-{
- bool anIsModified = false;
-
- if(!anIsModified)
- anIsModified |= myScalarEntity != theEntity;
-
- if(!anIsModified)
- anIsModified |= myScalarFieldName != theFieldName;
-
- if(!anIsModified)
- anIsModified |= myScalarTimeStampNumber != theTimeStampNumber;
-
- if(!anIsModified)
- return;
-
- VISU::TSetModified aModified(this);
-
- VISU::TEntity aEntity = VISU::TEntity(theEntity);
- VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
- theEntity,
- theFieldName,
- theTimeStampNumber);
- myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
-
- VISU::PUnstructuredGridIDMapper anIDMapper =
- anInput->GetTimeStampOnMesh(GetCMeshName(),
- aEntity,
- theFieldName,
- theTimeStampNumber);
-
- vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
- if(myScalarMapOnDeformedShapePL && anOutput)
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkDataSet*>
- (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScalars, anOutput));
-
- myScalarEntity = theEntity;
- myScalarFieldName = theFieldName;
- myScalarTimeStampNumber = theTimeStampNumber;
-
- SetTitle(theFieldName);
- SetScalarMode(GetScalarMode());
- if(!IsRangeFixed() && IsPipeLineExists())
- SetSourceRange();
-
- myParamsTime.Modified();
-}
-
-
-//---------------------------------------------------------------
-VISU::Entity
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarEntity()
-{
- return myScalarEntity;
-}
-
-
-//---------------------------------------------------------------
-char*
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarFieldName()
-{
- return CORBA::string_dup(myScalarFieldName.c_str());
-}
-
-
-//---------------------------------------------------------------
-CORBA::Long
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarTimeStampNumber()
-{
- return myScalarTimeStampNumber;
-}
-
-
-//---------------------------------------------------------------
-VISU::PField
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarField()
-{
- return myScalarField;
-}
+++ /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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// 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 VISU_I_EXPORT ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
- public virtual ScalarMap_i
- {
- static int myNbPresent;
- ScalarMapOnDeformedShape_i(const ScalarMapOnDeformedShape_i&);
-
- public:
- //----------------------------------------------------------------------------
- typedef ScalarMap_i TSuperClass;
- typedef VISU::ScalarMapOnDeformedShape TInterface;
-
- explicit
- ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyModep);
-
- virtual
- ~ScalarMapOnDeformedShape_i();
-
- virtual
- VISU::VISUType
- GetType()
- {
- return VISU::TSCALARMAPONDEFORMEDSHAPE;
- }
-
- virtual
- void
- SetScale(CORBA::Double theScale);
-
- virtual
- CORBA::Double
- GetScale();
-
- virtual
- void
- SameAs(const Prs3d_i* theOrigin);
-
- VISU_ScalarMapOnDeformedShapePL*
- GetSpecificPL()
- {
- return myScalarMapOnDeformedShapePL;
- }
-
- protected:
- //! Redefines VISU_ColoredPrs3d_i::SetField
- virtual
- void
- SetField(VISU::PField theField);
-
- //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
- virtual
- void
- CreatePipeLine(VISU_PipeLine* thePipeLine);
-
- //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
- virtual
- bool
- CheckIsPossible();
-
- public:
- //! Redefines VISU_ColoredPrs3d_i::IsPossible
- static
- size_t
- IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber,
- bool theIsMemoryCheck);
-
- //! Redefines VISU_ColoredPrs3d_i::IsPossible
- virtual
- Storable*
- Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber);
-
- //! Redefines VISU_ColoredPrs3d_i::ToStream
- virtual
- void
- ToStream(std::ostringstream& theStr);
-
- //! Redefines VISU_ColoredPrs3d_i::Restore
- virtual
- Storable*
- Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap);
-
- static const std::string myComment;
-
- virtual
- const char*
- GetComment() const;
-
- virtual
- QString
- GenerateName();
-
- virtual
- const char*
- GetIconName();
-
- virtual
- VISU_Actor*
- CreateActor();
-
- virtual
- void
- UpdateActor(VISU_Actor* theActor) ;
-
- virtual
- void
- SetScalarField(VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theTimeStampNumber);
-
- virtual
- VISU::Entity
- GetScalarEntity();
-
- virtual
- char*
- GetScalarFieldName();
-
- virtual
- CORBA::Long
- GetScalarTimeStampNumber();
-
- virtual
- VISU::PField
- GetScalarField();
-
- private:
- VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
-
- PField myScalarField;
- VISU::Entity myScalarEntity;
- std::string myScalarFieldName;
- CORBA::Long myScalarTimeStampNumber;
- };
-}
-#endif
#include "VISU_Mesh_i.hh"
#include "VISU_IsoSurfaces_i.hh"
#include "VISU_DeformedShape_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
#include "VISU_CutPlanes_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_CutLines_i.hh"
aSequence);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
- GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ GeneratePresentations<DeformedShapeAndScalarMap_i>(myStudy,
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
aPrsCmt = VISU::GaussPoints_i::myComment;
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE:
- aPrsCmt = VISU::ScalarMapOnDeformedShape_i::myComment;
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ aPrsCmt = VISU::DeformedShapeAndScalarMap_i::myComment;
break;
default:
aPrsCmt = "Unknown presentation";
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 if (strName == VISU::DeformedShapeAndScalarMap_i::myComment.c_str())
+ aData.myPrsType = VISU::TDEFORMEDSHAPEANDSCALARMAP;
else
continue;
generatePresentations(getNbFields()-1);
VISU::VISUType aType = myPrs->GetType();
if (aType != VISU::TSCALARMAP &&
aType != VISU::TDEFORMEDSHAPE &&
- aType != VISU::TSCALARMAPONDEFORMEDSHAPE) {
+ aType != VISU::TSCALARMAPONDEFORMEDSHAPE &&
+ aType != VISU::TDEFORMEDSHAPEANDSCALARMAP) {
myResult = "Insideframe representation is not available for this type of presentations.";
return;
}
myView.DisplayOnly(cutplanes)
print "Creating Scalar Map On Deformed Shape.......",
-scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+scalarmapondefshape = myVisu.DeformedShapeAndScalarMapOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
if scalarmapondefshape is None : print "Error"
else : print "OK"
scalarmapondefshape.SetScalarField(myCellEntity,'pression',2);
myView1.DisplayOnly(cutplanes1)
print "Creating Scalar Map On Deformed Shape.......",
-scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+scalarmapondefshape1 = myVisu.DeformedShapeAndScalarMapOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
if scalarmapondefshape1 is None : print "Error"
else : print "OK"
myView1.DisplayOnly(scalarmapondefshape1)
ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3)
print "Creating Scalar Map On Deformed Shape.......",
-scmap = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,VISU.NODE,myFieldName,1);
+scmap = myVisu.DeformedShapeAndScalarMapOnField(myResult,myMeshName,VISU.NODE,myFieldName,1);
ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3)
print "Creating Deformed Shape.......",
else :
aVISUObjList.append(aPrsObj)
- if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
- print " Creating ScalarMapOnDeformedShapeOnField",
- aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+ if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) or HasValue(thePrsTypeList,VISU.TDEFORMEDSHAPEANDSCALARMAP) :
+ print " Creating DeformedShapeAndScalarMapOnField",
+ aPrsObj = theVisu.DeformedShapeAndScalarMapOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
if aPrsObj is None : print "Error"
else :
print ",OK"
theView.DisplayOnly(aPrsObj)
theView.FitAll()
- aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+ aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TDEFORMEDSHAPEANDSCALARMAP." + thePictureExt
aPictureName = re.sub("\s+","_", aPictureName)
theView.SavePicture(aPictureName)
if theIsAutoDelete :
PRS3D_TYPE_LIST.append(VISU.TVECTORS)
PRS3D_TYPE_LIST.append(VISU.TSTREAMLINES)
PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
+PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPEANDSCALARMAP)
#---------------------------------------------------------------
anInput.myFieldName = "pression";
WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
-#execfile('/data/apo/a.py')
\ No newline at end of file
+#execfile('/data/apo/a.py')