depend_idl:
(cd idl ; $(MAKE) $@) || exit 1
-resources: share/salome/resources/VISUCatalog.xml
+resources: share/salome/resources/visu/VISUCatalog.xml
-share/salome/resources/VISUCatalog.xml: VISUCatalog.xml
+share/salome/resources/visu/VISUCatalog.xml: VISUCatalog.xml
cp $< $@
# doc is already build : if you want to had documents, go manually to doc and run 'make doc'
install-resources: install-catalog
-install-catalog: share/salome/resources/VISUCatalog.xml
- $(INSTALL) -d $(datadir)/resources
- $(INSTALL_DATA) $< $(datadir)/resources/.
+install-catalog: share/salome/resources/visu/VISUCatalog.xml
+ $(INSTALL) -d $(datadir)/resources/visu
+ $(INSTALL_DATA) $< $(datadir)/resources/visu/.
# common directories to put headerfiles
inc_builddir=$(top_builddir)/include/salome
+MODULE_NAME=@MODULE_NAME@
+
@SET_MAKE@
SHELL=/bin/sh
PACKAGE=salome
AC_SUBST(PACKAGE)
-VERSION=3.2.0
-XVERSION=0x030200
+VERSION=3.2.2
+XVERSION=0x030202
AC_SUBST(VERSION)
AC_SUBST(XVERSION)
+# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
+MODULE_NAME=visu
+AC_SUBST(MODULE_NAME)
+
dnl
dnl Initialize source and build root directories
dnl
fi
# make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
img_whs3 { border:none; width:30px; height:30px; float:none; border-style:none; }
p.whs4 { font-family:'Times New Roman' , serif; margin-left:40px; color:#000000; font-style:normal; }
p.whs5 { font-family:'Times New Roman' , serif; font-style:italic; color:#ff0000; margin-left:40px; }
-img_whs6 { border:none; width:585px; height:241px; float:none; border-style:none; }
-p.whs7 { font-family:'Times New Roman' , serif; margin-left:40px; }
+img_whs6 { border:none; width:705px; height:209px; float:none; }
+p.whs7 { margin-left:36px; }
ul.whs8 { list-style:disc; }
-p.whs9 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:normal; }
+p.whs9 { font-family:'Times New Roman' , serif; margin-left:40px; }
p.whs10 { font-weight:bold; margin-left:40px; }
p.whs11 { font-weight:bold; margin-left:38px; }
p.whs12 { font-family:'Times New Roman' , serif; margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }
img_whs13 { border:none; float:none; width:36px; height:38px; border-style:none; }
-p.whs14 { margin-left:80px; }
-p.whs15 { font-family:'Times New Roman' , serif; margin-left:40px; font-weight:bold; }
-p.whs16 { font-family:'Times New Roman' , serif; margin-left:0px; }
+p.whs14 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:normal; }
+p.whs15 { margin-left:80px; }
+p.whs16 { font-family:'Times New Roman' , serif; margin-left:40px; font-weight:bold; }
+p.whs17 { font-family:'Times New Roman' , serif; margin-left:0px; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
var strNSS = "<style type='text/css'>";
- strNSS += "p.whs9 {margin-left:1pt; }";
strNSS += "p.whs12 {margin-left:1pt; }";
- strNSS += "p.whs16 {margin-left:1pt; }";
+ strNSS += "p.whs14 {margin-left:1pt; }";
+ strNSS += "p.whs17 {margin-left:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
<p class="whs4"> </p>
-<p class="whs4"><img src="../pics/setupplot2d.png" x-maintain-ratio="TRUE" width="585px" height="241px" border="0" class="img_whs6"></p>
+<p class="whs4"><img src="../pics/createcurves.png" x-maintain-ratio="TRUE" width="705px" height="209px" border="0" class="img_whs6"></p>
<p class="whs4"> </p>
-<p class="whs7">This
- dialog box has the form of a table; each row of this table represents
- one column of values of the imported data table. </p>
+<p class="whs7">This dialog box has the form of a table;
+ each row of this table represents one column of values of the imported
+ data table. </p>
-<p class="whs7">To
- construct curve lines, you should choose at least two columns of the data
- table by checking them in the <span style="font-weight: bold;"><B>Axis</B></span>
+<p class="whs7">To construct curve lines, you should choose
+ at least two columns of the data table by checking them in the <span style="font-weight: bold;"><B>Axis</B></span>
part of the dialog
box:</p>
<ul type="disc" class="whs8">
- <li class=kadov-p><p class="whs7"><span
- style="font-weight: bold;"><B>H</B></span> - the values of this column will correspond
- to X-coordinates of the curve.</p></li>
+ <li class=kadov-p><p class="whs9"><span
+ style="font-weight: bold;"><B>H</B></span> (horisontal) - the values of this
+ column will correspond to X-coordinates of the curve.</p></li>
- <li class=kadov-p><p class="whs7"><span
- style="font-weight: bold;"><B>V</B></span> - the values of this column will correspond
- to Y-coordinates of the curve.</p></li>
+ <li class=kadov-p><p class="whs9"><span
+ style="font-weight: bold;"><B>V</B></span> (vertical) - the values of this column
+ will correspond to Y-coordinates of the curve.</p></li>
</ul>
-<p class="whs9"> </p>
-
-<p class="whs7">To
- define the <span style="font-weight: bold;"><B>Attributes
- </B></span>of your curve<span> remove the checkmark from </span><span style="font-weight: bold;"><B>Auto
- assign </B></span><span> (if
- it is checked, default attributes are taken) and select</span><span style="font-family: 'Times New Roman', serif; margin-left: 40px;">:</span></p>
+<p class="whs7"><br>
+The column <span style="font-weight: bold;"><B>Assigned</B></span> allows to represent
+ the values assigned to the points of the curve (possible for V-rows only).
+ Any row, even coinciding with the current or empty (no values assigned),
+ can be represented. All values are indicated with tool tips over the corresponding
+ curve points in the Plot2d viewer <br>
+<br>
+To define the <span style="font-weight: bold;"><B>Attributes
+ </B></span>of your curve remove the checkmark from <span style="font-weight: bold;"><B>Auto
+ assign </B></span> (if
+ it is checked, default attributes are taken) and select<span style="margin-left: 40px;">:</span></p>
<ul type="disc" class="whs8">
- <li class=kadov-p><p class="whs7"><span
+ <li class=kadov-p><p class="whs9"><span
style="font-weight: bold;"><B>Line type </B></span>(None, Solid, Dash, Dot, Dash
- Dot, Dash - Dot - Dot),</p></li>
columns of your data table with the same units. <span style="font-weight: bold;"><B>Post-Pro</B></span>
allows to display at once up to 200 curves. </p>
-<p class="whs9"> </p>
+<p class="whs14"> </p>
-<p class="whs7">4.
+<p class="whs9">4.
Click <span
style="font-weight: bold;"><B>OK </B></span>to create your curves with the given
parameters. <span style="font-weight: bold;"><B>Post-Pro</B></span> will automatically
create your curve or curves in the structure of the study under two SALOME
objects:</p>
-<p class="whs14">- SALOME
+<p class="whs15">- SALOME
table object,</p>
-<p class="whs14">- <span
+<p class="whs15">- <span
style="font-weight: bold;"><B>Plot2DView </B></span>object:
SALOME container of curve lines which will be created automatically. </p>
-<p class="whs7"> </p>
+<p class="whs9"> </p>
-<p class="whs15"> </p>
+<p class="whs16"> </p>
-<p class="whs7"> </p>
+<p class="whs9"> </p>
-<p class="whs16"> </p>
+<p class="whs17"> </p>
<script type="text/javascript" language="javascript1.2">
<!--
<style type="text/css">
<!--
p.whs1 { margin-left:40px; }
-img_whs2 { border:none; width:170px; height:219px; }
-img_whs3 { border:none; width:195px; height:101px; }
+img_whs2 { border:none; width:170px; height:219px; border-style:none; }
+img_whs3 { border:none; width:195px; height:101px; border-style:none; }
img_whs4 { border:none; width:395px; height:189px; float:none; border-style:none; }
img_whs5 { border:none; width:109px; height:75px; border-style:none; }
p.whs6 { margin-left:0px; }
- hides all previously displayed curves from the viewer. </p>
<p class="whs1"><span style="font-weight: bold;"><B>Rename</B></span>
- - allows to rename the XY plot. </p>
+ - allows to rename the object currently selected in the Object Browser
+ (table, curve or XY plot). </p>
<p class="whs1"> </p>
image10.gif
pics\image88.gif
pics\warning.png
-pics\setupplot2d.png
pics\importtablefromfile.png
pics\surface.jpg
image11.gif
pics\vecticon.jpg
pics\shrink.jpg
i_blue.jpg
+pics\createcurves.png
pics\image50.gif
pics\image83.gif
pics\image109.gif
}
//-->
</script>
-</html>
\ No newline at end of file
+</html>
//-->
</script>
</body>
-</html>
\ No newline at end of file
+</html>
aTE(2,0,"Creating XY plots","files/creating_xy_plot.htm");
aTE(2,0,"Plot2D Viewer","plot2d_viewer.htm");
aTE(2,0,"Setting properties of XY plots","files/setting_properties_of_xy_plots.htm");
- aTE(2,0,"Access to Post-Pro module functionality from Python (using VISU_Gen.idl)","visugenidl_doc/VISU__Gen_8idl.html");
-
+aTE(2,0,"Access to Post-Pro module functionality from Python (using VISU_Gen.idl)","visugenidl_doc/VISU__Gen_8idl.html");
//-->
</script>
</body>
//-->
</script>
</body>
-</html>
\ No newline at end of file
+</html>
//-->
</script>
</body>
-</html>
\ No newline at end of file
+</html>
</head>
<frameset id="whPfset" cols="260,*"><noframes><p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p></noframes><frame src="whgdata/whnvp30.htm" title="navigation pane" name="navigation pane" scrolling="no"><frame src="files/introduction.htm" title="topic pane" name="bsscright" scrolling="yes"></frameset>
-</html>
\ No newline at end of file
+</html>
<indent attr="9pt" />
</glossary>
</paneskin>
-</resource>
\ No newline at end of file
+</resource>
<tr><td> Authoring Tool Name </td><td>RoboHelp X5</td></tr>
<table>
</body>
-</html>
\ No newline at end of file
+</html>
</body>
-</html>
\ No newline at end of file
+</html>
return true;
else
return false;
-}
\ No newline at end of file
+}
//-->
</script>
</body>
-</html>
\ No newline at end of file
+</html>
gbWhTopic=true;
}
else
- document.location.reload();
\ No newline at end of file
+ document.location.reload();
<item name="Plot2D Viewer" url="plot2d_viewer.htm" />
<item name="Setting properties of XY plots" url="files/setting_properties_of_xy_plots.htm" />
</book>
- <item name="Access to Post-Pro module functionality from Python (using VISU_Gen.idl)" url="visugenidl_doc/VISU__Gen_8idl.html" />
+<item name="Access to Post-Pro module functionality from Python (using VISU_Gen.idl)" url="visugenidl_doc/VISU__Gen_8idl.html" />
+
</book>
</tocdata>
@COMMENCE@
-usr_docs:
+dev_docs:
cp -fr $(srcdir)/VISU ./INPUT; \
cp -fr ./VISU/doxyfile ./INPUT; \
cp -fr ./VISU/sources/static/tree.js ./INPUT/sources/static; \
* \param VRow Index of the row in the table: ordinate of the point.
*/
Curve CreateCurve(in Table theTable, in long theHRow, in long theVRow);
+
+ /*!
+ * Creates a curve on the basis of points, whose values are taken from the table.
+ * Each point has also assigned value, that will be shown as tooltip in Plot2d
+ * \param theTable Table containing the data for construction of curves.
+ * \param HRow Index of the row in the table: abscissa of the point.
+ * \param VRow Index of the row in the table: ordinate of the point.
+ * \param ZRow Index of the row in the table: assigned value (so-called as Z).
+ */
+ Curve CreateCurveWithZ( in Table theTable, in long theHRow, in long theVRow, in long theZRow );
/*!
* Creates a presentation form containing an array of references to the curves.
<parameter name="point_sprite_results" value="true"/>
<parameter name="point_sprite_primitive_type" value="0" />
<parameter name="point_sprite_clamp" value="256"/>
- <parameter name="point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/sprite_texture.bmp" />
- <parameter name="point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/sprite_alpha.bmp" />
+ <parameter name="point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_texture.bmp" />
+ <parameter name="point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_alpha.bmp" />
<parameter name="point_sprite_alpha_threshold" value="0.5"/>
<parameter name="point_sprite_min_size" value="10" />
<parameter name="point_sprite_max_size" value="33" />
<parameter name="geom_sphere_face_limit" value="50000"/>
<parameter name="inside_point_sprite_primitive_type" value="0" />
<parameter name="inside_point_sprite_clamp" value="256"/>
- <parameter name="inside_point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/sprite_texture.bmp" />
- <parameter name="inside_point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/sprite_alpha.bmp" />
+ <parameter name="inside_point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_texture.bmp" />
+ <parameter name="inside_point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_alpha.bmp" />
<parameter name="inside_point_sprite_alpha_threshold" value="0.5"/>
<parameter name="inside_point_sprite_min_size" value="10" />
<parameter name="inside_point_sprite_max_size" value="33" />
<parameter name="inside_geom_sphere_face_limit" value="50000"/>
<parameter name="outside_point_sprite_primitive_type" value="0" />
<parameter name="outside_point_sprite_clamp" value="256"/>
- <parameter name="outside_point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/sprite_texture.bmp" />
- <parameter name="outside_point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/sprite_alpha.bmp" />
+ <parameter name="outside_point_sprite_main_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_texture.bmp" />
+ <parameter name="outside_point_sprite_alpha_texture" value="${VISU_ROOT_DIR}/share/salome/resources/visu/sprite_alpha.bmp" />
<parameter name="outside_point_sprite_alpha_threshold" value="0.5"/>
<parameter name="outside_point_sprite_size" value="25" />
<parameter name="outside_point_sprite_uniform" value="true"/>
</section>
<section name="resources">
<!-- Module resources -->
- <parameter name="VISU" value="${VISU_ROOT_DIR}/share/salome/resources"/>
+ <parameter name="VISU" value="${VISU_ROOT_DIR}/share/salome/resources/visu"/>
</section>
</document>
::GetVTKOutput()
{
if(!myFilter.GetPointer()){
- const TVTKAppendFilter& anAppendFilter = myIDMapper.GetFilter();
+ const TVTKAppendFilter& anAppendFilter = myIDMapper->GetFilter();
TVTKOutput* aGeometry = anAppendFilter->GetOutput();
const TVTKSource& aSource = mySource.GetSource();
TIDMapperFilter
::GetNodeObjID(vtkIdType theID) const
{
- return myIDMapper.GetNodeObjID(theID);
+ return myIDMapper->GetNodeObjID(theID);
}
vtkIdType
TIDMapperFilter
::GetNodeVTKID(vtkIdType theID) const
{
- return myIDMapper.GetNodeVTKID(theID);
+ return myIDMapper->GetNodeVTKID(theID);
}
vtkFloatingPointType*
TIDMapperFilter
::GetNodeCoord(vtkIdType theObjID)
{
- return myIDMapper.GetNodeCoord(theObjID);
+ return myIDMapper->GetNodeCoord(theObjID);
}
vtkIdType
TIDMapperFilter
::GetElemObjID(vtkIdType theID) const
{
- return myIDMapper.GetElemObjID(theID);
+ return myIDMapper->GetElemObjID(theID);
}
vtkIdType
TIDMapperFilter
::GetElemVTKID(vtkIdType theID) const
{
- return myIDMapper.GetElemVTKID(theID);
+ return myIDMapper->GetElemVTKID(theID);
}
vtkCell*
TIDMapperFilter
::GetElemCell(vtkIdType theObjID)
{
- return myIDMapper.GetElemCell(theObjID);
+ return myIDMapper->GetElemCell(theObjID);
}
int aMeshDimension = theMesh->myDim;
bool anIsDimPresent[3] = {false, false, false};
for(int iDim = 0; iDim < aMeshDimension; iDim++){
- const std::string& aName = aCoords.GetName(iDim);
+ std::string aName = aCoords.GetName(iDim);
+ if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16
+ aName = aName.substr(0,1);
if(aName == "x" || aName == "X")
anIsDimPresent[eX] = true;
else if(aName == "y" || aName == "Y")
vtkIdType anID = *aSubMeshIDIter;
PrintCells(i,aConnectivity,anArray[anID]);
aCellTypesArray->SetValue(j++,(unsigned char)aVGeom);
-
- anElemObj2VTKID[anID] = i;
- aMeshID[i] = anID;
+ vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
+ anElemObj2VTKID[anObjID] = i;
+ aMeshID[i] = anObjID;
}
}
vtkIdType *pts = 0, npts = 0;
TFamilyArr& aFamilyArr = aGroup->myFamilyArr;
aFamilyArr.resize(aFamilySet.size());
- for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++){
+ for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++, anID++){
PFamilyImpl aFamily = *anIter;
const std::string& aFamilyName = aFamily->myName;
const VISU::TEntity& anEntity = aFamily->myEntity;
VISU::TVTKOutput* anOutput = anIDMapper->GetVTKOutput();
anAppendFilter->AddInput(anOutput);
+ vtkIdType aStartID = anElemObj2VTKID.size();
vtkIdType aNbCells = anOutput->GetNumberOfCells();
for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){
- anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aCellID;
+ anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID;
}
aFamilyArr[anID] = aFamily;
}
TVTKOutput*
GetVTKOutput();
};
+ typedef SharedPtr<TAppendFilter> PAppendFilter;
//---------------------------------------------------------------
//! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct VISU_CONVERTOR_EXPORT TIDMapperFilter: virtual TMergeFilter
{
- TAppendFilter myIDMapper; //!< Responsible for numbering
+ PAppendFilter myIDMapper; //!< Responsible for numbering
TSource mySource; //!< Keeps assigned data
//! Reimplement the TIDMapper::GetNodeObjID
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_MedConvertor.cxx
#include "MED_GaussUtils.hxx"
#include "MED_Utilities.hxx"
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#define NO_CAS_CATCH
+#endif
+
+#include <Standard_Failure.hxx>
+
+#ifdef NO_CAS_CATCH
+#include <Standard_ErrorHandler.hxx>
+#else
#include "CASCatch.hxx"
+#endif
#include <vtkCellType.h>
#define _LOAD_FAMILIES_
#define _EDF_NODE_IDS_
-namespace VISU
-{
+//namespace
+//{
//---------------------------------------------------------------
vtkIdType
MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
"; aNbCells = "<<aGaussSubMesh->myNbCells<<
"; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
endl);
+
+ //break;
}
}
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
-// TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
+ TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
INITMSG(MYDEBUG,
"- aMEntity = "<<aMEntity<<
aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
- // must be implemented (shadow point for GRILLE STANDARD,CARTESIAN,...)
-// for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
-// TInt aFamId = theNodeInfo->GetFamNum(iElem);
-// if(aFamId != 0)
-// aFamilyID2CellsSize[aFamId] += 2;
-// }
+ if((theGrilleInfo->myFamNumNode).size() > 0)
+ for(TInt iElem = 0; iElem < theGrilleInfo->GetNbNodes(); iElem++){
+ TInt aFamId = theGrilleInfo->GetFamNumNode(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += 2;
+ }
INITMSG(MYDEBUG,
"- myNbCells = "<<aMeshOnEntity->myNbCells<<
"; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
endl);
-// for(TInt iElem = 0; iElem < aNbElem; iElem++){
-// TInt aFamId = aCellInfo->GetFamNum(iElem);
-// if(aFamId != 0)
-// aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
-// }
+ if((theGrilleInfo->myFamNum).size() > 0)
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ TInt aFamId = theGrilleInfo->GetFamNum(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ }
}
}
}
}
+
+ /*!
+ * Build grille family map
+ */
+ void
+ BuildGrilleFamilyMap(PMEDMesh theMesh,
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TFamilyInfoSet& theFamilyInfoSet,
+ MED::PWrapper theMEDWrapper)
+ {
+ TTimerLog aTimerLog(MYDEBUG,"BuildGrilleFamilyMap");
+ INITMSG(MYDEBUG,"BuildGrilleFamilyMap\n");
+
+ TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+
+ MED::TEntityInfo::const_iterator aEntityIter = theEntityInfo.begin();
+
+ const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
+ MED::PGrilleInfo aGrilleInfo = theMEDWrapper->GetPGrilleInfo(aMeshInfo);
+
+ const MED::TFamilyID2NbCells& aFam2NbCells = MED::GetFamilyID2NbCells(aGrilleInfo);
+
+ MED::TFamilyInfoSet::const_iterator aFamInter = theFamilyInfoSet.begin();
+ for(;aFamInter != theFamilyInfoSet.end();aFamInter++){
+ TInt anId = (*aFamInter)->GetId();
+
+ if(anId == 0)
+ continue;
+
+ std::string aFamilyName = (*aFamInter)->GetName();
+ const MED::EEntiteMaillage& aMEntity = MED::GetEntityByFamilyId(aGrilleInfo,
+ anId);
+ TEntity aVEntity = MEDEntityToVTK(aMEntity);
+
+ PMEDMeshOnEntity aMeshOnEntity;
+ TMeshOnEntityMap::iterator aMeshOnEntityIter = aMeshOnEntityMap.find(aVEntity);
+ if(aMeshOnEntityIter != aMeshOnEntityMap.end())
+ aMeshOnEntity = aMeshOnEntityIter->second;
+
+ TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+
+ PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
+ aFamily->myId = anId;
+ aFamily->myEntity = aVEntity;
+ aFamily->myName = aFamilyName;
+ aFamily->myNbCells = 0;
+ aFamily->myCellsSize = 0;
+
+ TFamilyID2CellsSize::iterator aFamilyid2CellsSizeIter = (aMeshOnEntity->myFamilyID2CellsSize).find(anId);
+ if(aFamilyid2CellsSizeIter != (aMeshOnEntity->myFamilyID2CellsSize).end())
+ aFamily->myCellsSize = aFamilyid2CellsSizeIter->second;
+ MED::TFamilyID2NbCells::const_iterator aFam2NbCellsIter = aFam2NbCells.find(anId);
+ if(aFam2NbCellsIter != aFam2NbCells.end())
+ aFamily->myNbCells = aFam2NbCellsIter->second;
+
+ INITMSG(MY_FAMILY_DEBUG,
+ "- aFamilyName =|"<<aFamily->myName<<"|"
+ << "; myId = "<<aFamily->myId
+ << "; aNbAttr = "<<(*aFamInter)->GetNbAttr()
+ << "; aNbGroup = "<<(*aFamInter)->GetNbGroup()
+ << "; aVEntity = "<<aVEntity
+ << "; myNbCells = "<<aFamily->myNbCells
+ << "; myCellsSize = "<<aFamily->myCellsSize
+ <<endl);
+
+
+ }
+ }
//---------------------------------------------------------------
void
}
};
-}
+//}
//---------------------------------------------------------------
INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
#ifndef _DEXCEPT_
- CASCatch_TRY{
- try{
+#ifdef NO_CAS_CATCH
+ try{
+ OCC_CATCH_SIGNALS;
+#else
+ CASCatch_TRY{
+ try{
+#endif
#endif
MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
aMEntity,
}
}
#ifndef _DEXCEPT_
+#ifdef NO_CAS_CATCH
+ }catch(Standard_Failure){
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ MSG(MYDEBUG,"Follow signal was occured in:\n"<<aFail->GetMessageString());
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
MSG(MYDEBUG,"Unknown exception !!!");
}
- }CASCatch_CATCH(Standard_Failure){
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- MSG(MYDEBUG,"Follow signal was occured in:\n"<<aFail->GetMessageString());
- }
+#else
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
+ }
+ }CASCatch_CATCH(Standard_Failure){
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ MSG(MYDEBUG,"Follow signal was occured in:\n"<<aFail->GetMessageString());
+ }
+#endif
#endif
}
for(TInt iComp = 0; iComp <= aNbComp; iComp++){
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
+ MED::EMaillage aType = aMeshInfo->GetType();
+
MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
#endif
MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(aMed,aMeshInfo);
- BuildFamilyMap(aMesh,
- anEntityInfo,
- anEntity2TGeom2ElemInfo,
- aFamilyInfoSet,
- aMed);
+ if(aType == MED::eNON_STRUCTURE)
+ BuildFamilyMap(aMesh,
+ anEntityInfo,
+ anEntity2TGeom2ElemInfo,
+ aFamilyInfoSet,
+ aMed);
+ else
+ BuildGrilleFamilyMap(aMesh,
+ anEntityInfo,
+ aFamilyInfoSet,
+ aMed);
BuildGroupMap(aMesh,
aFamilyInfoSet);
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
aCell2Connect.resize(aNbElem);
for (int iElem = 0; iElem < aNbElem; iElem++)
aCell2Connect[iElem] = VISU::TConnect(1,iElem);
+
}
theMesh->myIsDone = true;
if(theFamily->myIsDone)
return 0;
+ const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
+ MED::EMaillage aType = aMeshInfo->GetType();
+
//Main part of code
- MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
- TInt aNbElem = aNodeInfo->GetNbElem();
-
- if(aNbElem > 0){
- TInt anId = theFamily->myId;
- TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(aNodeInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
+ if(aType==MED::eNON_STRUCTURE){
+ MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
+ TInt aNbElem = aNodeInfo->GetNbElem();
+
+ if(aNbElem > 0){
+ TInt anId = theFamily->myId;
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aNodeInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ }
+ }
+ else {
+ MED::PGrilleInfo aGrilleInfo = theMed->GetPGrilleInfo(aMeshInfo);
+ TInt aNbElem = aGrilleInfo->GetNbNodes();
+
+ if(aNbElem > 0){
+ TInt anId = theFamily->myId;
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aGrilleInfo->GetFamNumNode(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ }
}
theFamily->myIsDone = true;
const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
TGeom2SubMeshID& aGeom2SubMeshID = theFamily->myGeom2SubMeshID;
+ MED::EMaillage aType = aMeshInfo->GetType();
const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
- MED::PElemInfo anElemInfo;
- switch(aMGeom){
- case MED::ePOLYGONE: {
- anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }
- case MED::ePOLYEDRE: {
- anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }
- default: {
- anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }}
- if(anElemInfo){
- if(TInt aNbElem = anElemInfo->GetNbElem()){
- TSubMeshID aSubMeshID;
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(anElemInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
- if(!aSubMeshID.empty()){
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
- aGeom2SubMeshID.insert(TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ if(aType == MED::eNON_STRUCTURE){
+ MED::PElemInfo anElemInfo;
+ switch(aMGeom){
+ case MED::ePOLYGONE: {
+ anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }
+ default: {
+ anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }}
+ if(anElemInfo){
+ if(TInt aNbElem = anElemInfo->GetNbElem()){
+ TSubMeshID aSubMeshID;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(anElemInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ if(!aSubMeshID.empty()){
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ aGeom2SubMeshID.insert(TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ }
+ }
+ }
+ } else {
+ MED::PGrilleInfo anElemInfo = theMed->GetPGrilleInfo(aMeshInfo);
+ if(anElemInfo){
+ TInt aNbElem = anElemInfo->GetNbCells();
+ if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){
+ TSubMeshID aSubMeshID;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(anElemInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ if(!aSubMeshID.empty()){
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ aGeom2SubMeshID.insert(TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ }
}
}
}
return myVisuGen->CreateCurve(theTable,theHRow,theVRow);
}
+ Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
+ {
+ return myVisuGen->CreateCurveWithZ(theTable,theHRow,theVRow,theZRow);
+ }
+
Container_ptr VISU_Gen_i::CreateContainer(){
return myVisuGen->CreateContainer();
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
+ virtual Curve_ptr CreateCurveWithZ(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow);
virtual Container_ptr CreateContainer();
virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
}
}
+/*!
+ Provides help on F1 button click
+*/
+void VisuGUI_TableDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
+
/*!
Constructor
*/
bool showColumnTitles = true );
~VisuGUI_TableDlg();
+private:
+ void keyPressEvent( QKeyEvent* e );
+
public slots:
void onOK();
void onHelp();
$(HDF5_INCLUDES) $(BOOST_CPPFLAGS)
LDFLAGS+= \
- $(VTK_LIBS) -lVTKViewer -lSVTK -lVisuConvertor \
+ $(VTK_LIBS) -lVTKViewer -lVisuConvertor \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace \
$(GUI_LDFLAGS) \
$(MED_LDFLAGS)
}
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
- {
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
- {
- const VISU::PField aField = aFieldMapIter->second;
- //if(aField->myNbComp == 1)
- // continue;
- const string& aFieldName = aFieldMapIter->first;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.begin();
- if(aValFieldIter == aValField.end()) return 0;
- int aTimeStamp = aValFieldIter->first;
-
- TPresent* aPresent = TPresent::New();
- VISU::PIDMapper anIDMapper;
- if(anEntity != VISU::NODE_ENTITY)
- {
- VISU::PGaussPtsIDMapper aGaussPtsIDMapper = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
- aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
- }
- else
- {
- continue;
- VISU::PIDMapper anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- aPresent->SetIDMapper(anIDMapper);
- }
-
- aPresent->Build();
- aPresent->Init();
-
- char aMainTexture[80];
- strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
- strcat( aMainTexture, "/share/salome/resources/sprite_texture.vti" );
- //cout << aMainTexture << endl;
-
- char anAlphaTexture[80];
- strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
- strcat( anAlphaTexture, "/share/salome/resources/sprite_alpha.vti" );
- //cout << anAlphaTexture << endl;
-
- vtkSmartPointer<vtkImageData> aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
- aPresent->SetImageData( aTextureValue.GetPointer() );
-
- aPresent->Update();
-
- vtkActor* anActor = vtkActor::New();
- anActor->SetMapper(aPresent->GetMapper());
-
- VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
- aScalarBar->SetLookupTable(aPresent->GetBarTable());
-
- ren->AddActor(anActor);
- ren->AddActor2D(aScalarBar);
-
- renWin->Render();
- ren->ResetCamera();
-
- iren->Start();
- return 0;
- }
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+ const VISU::PField aField = aFieldMapIter->second;
+ /*
+ if(aField->myNbComp == 1)
+ continue;
+ */
+ const string& aFieldName = aFieldMapIter->first;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ if(aValFieldIter == aValField.end()) return 0;
+ int aTimeStamp = aValFieldIter->first;
+
+ TPresent* aPresent = TPresent::New();
+ VISU::PIDMapper anIDMapper;
+ if(anEntity != VISU::NODE_ENTITY){
+ VISU::PGaussPtsIDMapper aGaussPtsIDMapper = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+ aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
+ }else{
+ continue;
+ VISU::PIDMapper anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ aPresent->SetIDMapper(anIDMapper);
+ }
+
+ aPresent->Build();
+ aPresent->Init();
+
+ char aMainTexture[80];
+ strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" );
+ //cout << aMainTexture << endl;
+
+ char anAlphaTexture[80];
+ strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
+ //cout << anAlphaTexture << endl;
+
+ vtkSmartPointer<vtkImageData> aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
+ aPresent->SetImageData( aTextureValue.GetPointer() );
+
+ aPresent->Update();
+
+ vtkActor* anActor = vtkActor::New();
+ anActor->SetMapper(aPresent->GetMapper());
+
+ VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
+ aScalarBar->SetLookupTable(aPresent->GetBarTable());
+
+ ren->AddActor(anActor);
+ ren->AddActor2D(aScalarBar);
+
+ renWin->Render();
+ ren->ResetCamera();
+
+ iren->Start();
+ return 0;
+ }
}
}
}
SetOrientation(aPipeLine->GetPlaneOrientation(1),
aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
SetDisplacement(aPipeLine->GetDisplacement(1),1);
- SetDefault();
- if (!aPipeLine->IsDefault()) SetPosition(aPipeLine->GetPosition());
+ if (aPipeLine->IsDefault())
+ SetDefault();
+ else
+ SetPosition(aPipeLine->GetPosition());
}
VISU_CutPlanesPL::ShallowCopy(thePipeLine);
}
#include <vtkTimerLog.h>
#include <vtkTriangle.h>
-#ifndef WIN32
-#include <dlfcn.h>
-#endif
-
#include <stdio.h>
#include <cmath>
#include <string>
+#ifndef WNT
+# ifndef GLX_GLXEXT_LEGACY
+# define GLX_GLXEXT_LEGACY
+# endif
+# include <GL/glx.h>
+# include <dlfcn.h>
+#else
+# include <wingdi.h>
+#endif
+
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkCxxRevisionMacro(VISU_OpenGLPointSpriteMapper, "Revision$");
vtkStandardNewMacro(VISU_OpenGLPointSpriteMapper);
static PFNGLBUFFERDATAARBPROC vglBufferDataARB = NULL;
static PFNGLDELETEBUFFERSARBPROC vglDeleteBuffersARB = NULL;
-void InitializeARB()
+#ifndef WNT
+#define GL_GetProcAddress( x ) glXGetProcAddressARB( (const GLubyte*)x )
+#else
+#define GL_GetProcAddress( x ) wglGetProcAddress( (const LPCSTR)x )
+#endif
+
+bool InitializeARB()
{
- vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)SVTK::getOpenGLExtension( "glShaderSourceARB" );
- vglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)SVTK::getOpenGLExtension( "glCreateShaderObjectARB" );
- vglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)SVTK::getOpenGLExtension( "glCompileShaderARB" );
- vglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)SVTK::getOpenGLExtension( "glCreateProgramObjectARB" );
- vglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)SVTK::getOpenGLExtension( "glAttachObjectARB" );
- vglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)SVTK::getOpenGLExtension( "glLinkProgramARB" );
- vglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)SVTK::getOpenGLExtension( "glUseProgramObjectARB" );
- vglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)SVTK::getOpenGLExtension( "glGetObjectParameterivARB" );
- vglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)SVTK::getOpenGLExtension( "glGetInfoLogARB" );
- vglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)SVTK::getOpenGLExtension( "glGetAttribLocationARB" );
- vglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)SVTK::getOpenGLExtension( "glVertexAttrib1fARB" );
-
- vglGenBuffersARB = (PFNGLGENBUFFERSARBPROC)SVTK::getOpenGLExtension( "glGenBuffersARB" );
- vglBindBufferARB = (PFNGLBINDBUFFERARBPROC)SVTK::getOpenGLExtension( "glBindBufferARB" );
- vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)SVTK::getOpenGLExtension( "glBufferDataARB" );
- vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)SVTK::getOpenGLExtension( "glDeleteBuffersARB" );
+ vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)GL_GetProcAddress( "glShaderSourceARB" );
+ if( !vglShaderSourceARB )
+ return false;
+
+ vglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)GL_GetProcAddress( "glCreateShaderObjectARB" );
+ if( !vglCreateShaderObjectARB )
+ return false;
+
+ vglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)GL_GetProcAddress( "glCompileShaderARB" );
+ if( !vglCompileShaderARB )
+ return false;
+
+ vglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)GL_GetProcAddress( "glCreateProgramObjectARB" );
+ if( !vglCreateProgramObjectARB )
+ return false;
+
+ vglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)GL_GetProcAddress( "glAttachObjectARB" );
+ if( !vglAttachObjectARB )
+ return false;
+
+ vglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)GL_GetProcAddress( "glLinkProgramARB" );
+ if( !vglLinkProgramARB )
+ return false;
+
+ vglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)GL_GetProcAddress( "glUseProgramObjectARB" );
+ if( !vglUseProgramObjectARB )
+ return false;
+
+ vglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)GL_GetProcAddress( "glGetObjectParameterivARB" );
+ if( !vglGetObjectParameterivARB )
+ return false;
+
+ vglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)GL_GetProcAddress( "glGetInfoLogARB" );
+ if( !vglGetInfoLogARB )
+ return false;
+
+ vglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)GL_GetProcAddress( "glGetAttribLocationARB" );
+ if( !vglGetAttribLocationARB )
+ return false;
+
+ vglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)GL_GetProcAddress( "glVertexAttrib1fARB" );
+ if( !vglVertexAttrib1fARB )
+ return false;
+
+ vglGenBuffersARB = (PFNGLGENBUFFERSARBPROC)GL_GetProcAddress( "glGenBuffersARB" );
+ if( !vglGenBuffersARB )
+ return false;
+
+ vglBindBufferARB = (PFNGLBINDBUFFERARBPROC)GL_GetProcAddress( "glBindBufferARB" );
+ if( !vglBindBufferARB )
+ return false;
+
+ vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)GL_GetProcAddress( "glBufferDataARB" );
+ if( !vglBufferDataARB )
+ return false;
+
+ vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)GL_GetProcAddress( "glDeleteBuffersARB" );
+ if( !vglDeleteBuffersARB )
+ return false;
+
+ return true;
};
+static bool IsARBInitialized = InitializeARB();
static float Tolerance = 1.0 / VTK_LARGE_FLOAT;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
VISU_OpenGLPointSpriteMapper::~VISU_OpenGLPointSpriteMapper()
{
- glDeleteTextures( 1, &PointSpriteTexture );
+ if( PointSpriteTexture>0 )
+ glDeleteTextures( 1, &PointSpriteTexture );
if( this->LastWindow )
this->ReleaseGraphicsResources(this->LastWindow);
//cout << "Initializing vertex program" << endl;
std::string fileName = std::string( getenv( "VISU_ROOT_DIR") ) +
- "/share/salome/resources/Vertex_Program_ARB.txt";
+ "/share/salome/resources/visu/Vertex_Program_ARB.txt";
char* shader = readFromFile( fileName );
char* ext = (char*)glGetString( GL_EXTENSIONS );
//cout << "OpenGL extensions : " << ext << endl;
- if( strstr( ext, "GL_ARB_point_sprite" ) == NULL ||
+ if( !IsARBInitialized ||
+ strstr( ext, "GL_ARB_point_sprite" ) == NULL ||
strstr( ext, "GL_ARB_shader_objects" ) == NULL ||
strstr( ext, "GL_ARB_vertex_buffer_object" ) == NULL )
{
theRenderer->ViewToDisplay();
theRenderer->GetDisplayPoint( p2 );
- vtkFloatingPointType coefficient = sqrt( (double)pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( (double)2 );
+ vtkFloatingPointType coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2. );
+ //cout << p1[0] << " " << p1[1] << " " << p1[2] << endl;
+ //cout << p2[0] << " " << p2[1] << " " << p2[2] << endl;
+ //cout << "ZOOM : " << coefficient << endl;
return coefficient;
}
// Sets geometry for merge filter
myMergeFilter->SetGeometry(myDeformVectors->GetOutput());
+ myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
// Sets data to mapper
myMapper->SetInput(myMergeFilter->GetOutput());
}
VISU_ScalarMapOnDeformedShapePL
::UpdateScalars()
{
- if(myScalars->GetCellData()->GetVectors() != NULL ||
- myScalars->GetPointData()->GetVectors() != NULL)
- myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
- else
- myMergeFilter->SetScalars(GetScalars());
+ myExtractorScalars->Update();
}
/*!
{
myScalars = theScalars;
vtkUnstructuredGrid* aScalars = GetScalars();
- myExtractorScalars->SetInput(aScalars);
+ vtkCellData *aInCellData = GetInput()->GetCellData();
+
+ if(aScalars->GetPointData()->GetScalars())
+ myExtractorScalars->SetInput(aScalars);
+ else if(aScalars->GetCellData()->GetScalars() &&
+ !aInCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){
+ //Approximate cell data values to point data by vtkCellDataToPointData filter.
+ vtkCellDataToPointData* aCellDataToPointData = vtkCellDataToPointData::New();
+ aCellDataToPointData->SetInput(aScalars);
+ aCellDataToPointData->Update();
+ myExtractorScalars->SetInput(aCellDataToPointData->GetUnstructuredGridOutput());
+ aCellDataToPointData->Delete();
+ } else {
+ myExtractorScalars->SetInput(aScalars);
+ }
+ Update();
Modified();
}
msgid "AXIS_LBL"
msgstr "Axis"
+msgid "ASSIGNED"
+msgstr "Assigned"
+
#: VisuGUI_SetupPlot2dDlg.cxx:69
msgid "DATA_LBL"
msgstr "Data"
// if study is not locked - create new container, create curves and insert them
// into container, then plot container if current viewer is of VIEW_PLOT2D type
int horIndex;
- QValueList<int> verIndices;
- dlg->getCurvesSource( horIndex, verIndices );
+ QValueList<int> verIndices, zIndices;
+ dlg->getCurvesSource( horIndex, verIndices, zIndices );
if ( horIndex >= 0 && verIndices.count() > 0 ) {
CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
if( !CORBA::is_nil( aContainer ) ) {
if ( pContainer ) {
for ( int i = 0; i < verIndices.count(); i++ ) {
CORBA::Object_var aNewCurve =
- GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
+ GetVisuGen(this)->CreateCurveWithZ( table->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
if( !CORBA::is_nil( aNewCurve ) ) {
VISU::Curve_i* pCrv =
dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
// if study is not locked - create new table and container objects, create curves
// and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
int horIndex;
- QValueList<int> verIndices;
- dlg->getCurvesSource( horIndex, verIndices );
+ QValueList<int> verIndices, zIndices;
+ dlg->getCurvesSource( horIndex, verIndices, zIndices );
if ( horIndex >= 0 && verIndices.count() > 0 ) {
CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
if ( pContainer && pTable ) {
for ( int i = 0; i < verIndices.count(); i++ ) {
- CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
- ( pTable->_this(), horIndex+1, verIndices[i]+1 );
+ CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurveWithZ
+ ( pTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
if( !CORBA::is_nil( aNewCurve ) ) {
VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
if ( pCrv ) {
int aTemp = int(1.E6 * aTempoDbl);
int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
- int aSteps = aResourceMgr->integerValue("VISU", "sweeping_time_step", 40);
+ int aSteps = aResourceMgr->integerValue("VISU", "sweeping_number_steps", 40);
// Sweep
QApplication::setOverrideCursor(Qt::waitCursor);
myFileNameLineEdit->setText( myFileName.section( '/', -1 ) );
}
}
+
+void VisuGUI_BuildProgressDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
QString fileName() const { return myFileName; }
void setFileName( const QString& theFileName );
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void done( int );
if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = VISU::GetSelectedObj(myVisuGUI, &anIO);
- myIO = anIO;
if (CORBA::is_nil(anObject)) return;
+
+ if (!anIO.IsNull())
+ myIO = anIO;
+
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if (!aServant.in()) return;
if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(vw);
}
+
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void VisuGUI_ClippingDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ ClickOnHelp();
+ }
+}
~VisuGUI_ClippingDlg();
+private:
+ void keyPressEvent( QKeyEvent* e );
+
private:
LightApp_SelectionMgr* mySelectionMgr;
QObject::tr("BUT_OK"));
}
}
+
+/*!
+ function : keyPressEvent()
+ purpose :
+*/
+void VisuGUI_CursorDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
QPushButton* buttonCancel;
QPushButton* buttonHelp;
+private:
+ void keyPressEvent( QKeyEvent* e );
+
private slots:
void onHelp();
//jfa tmp: if (theWnd != myStudyWnd)
//jfa tmp: reject();
//jfa tmp:}
+
+void VisuGUI_CutLinesDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
bool isGenerateTable() { return myCreateTable->isChecked(); }
bool isGenerateCurves() { return myCreateTable->isChecked() && myCurvesCheck->isChecked(); }
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
{
if (myPreviewActor == 0) return;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
- if(aRend)
+ vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+
+ if(aRend && aWnd)
myPreviewActor->RemoveFromRender(aRend);
// Bug IPAL11962: preview is still in the viewer, if viewer not active.
// if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
editline->setValidator(dvalidator);
return editline;
}
+
+void VisuGUI_CutPlanesDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void initFromPrsObject (VISU::CutPlanes_i* thePrs);
int storeToPrsObject (VISU::CutPlanes_i* thePrs);
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_DeformedShapeDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void initFromPrsObject(VISU::DeformedShape_i* thePrs);
int storeToPrsObject(VISU::DeformedShape_i* thePrs);
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_EditContainerDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void initFromPrsObject (VISU::Container_i* theContainer);
void storeToPrsObject (VISU::Container_i* theContainer);
+
+ private:
+ void keyPressEvent( QKeyEvent* e );
private slots:
void onLeftClicked();
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_GaussPointsDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
//! Update Gauss Points presentation using parameters from the dialog.
int storeToPrsObject(VISU::GaussPoints_i* thePrs);
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void onToggleDefShape( bool );
void onHelp();
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_IsoSurfacesDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
int storeToPrsObject(VISU::IsoSurfaces_i* thePrs)
{return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs);}
+ private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
delete dlg;
return n;
}
+
+void VisuGUI_NameDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
QString name();
static QString getName( QWidget* parent = 0, const QString& oldName = QString::null );
+
+private:
+ void keyPressEvent( QKeyEvent* e );
protected slots:
void accept();
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_OffsetDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void getOffset (vtkFloatingPointType* theOffset) const;
bool isToSave() const;
+ private:
+ void keyPressEvent( QKeyEvent* e );
+
public slots:
void onReset();
//=======================================================================
void VisuGUI_Plot3DPane::updatePreview()
{
- if (myInitFromPrs || !myPrs || !myViewWindow)
+ if(myPreviewActor){
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+ if (!aWnd) return;
+ }
+ if (myInitFromPrs || !myPrs || !myViewWindow)
return;
bool fitall = false;
if (PreviewChkB->isChecked()) // place preview plane
//=======================================================================
bool VisuGUI_Plot3DPane::check()
{
- if (myPreviewActor && myViewWindow) // erase preview
- {
+ if(!myPreviewActor) return true;
+
+ SVTK_ViewWindow* aView;
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+ if(aRend && aWnd){
myPreviewActor->SetVisibility(false);
myViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
}
-
+
return true;
}
{
myIsoPane->setPlane(theOrientation, theXRotation, theYRotation, thePlanePos);
}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void VisuGUI_Plot3DDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
+ private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
delete aDlg;
} else {
DeletePrs3d(theModule,aPrs3d,theIO);
+ QApplication::restoreOverrideCursor();
delete aDlg;
return false;
}
}
}
-
+ aViewWindow = GetViewWindow<TViewer>(theModule);
// Display created presentation.
if (aViewWindow) {
PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
if (myPreviewActor == 0) return;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
- if(aRend)
+ vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+ if(aRend && aWnd)
myPreviewActor->RemoveFromRender(aRend);
myPreviewActor->GetScalarBar()->VisibilityOff();
myPreviewActor->Delete();
}
}
+/*!
+ Provides help on F1 button click
+*/
+void VisuGUI_ScalarBarDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
//#######################################################################################
VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent)
QDialog::accept();
}
+
+/*!
+ Provides help on F1 button click
+*/
+void VisuGUI_TextPrefDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void storeBeginValues();
+ private:
+ void keyPressEvent( QKeyEvent* e );
+
public:
SVTK_FontWidget* myTitleFont;
SVTK_FontWidget* myLabelFont;
void initFromPrsObject(VISU::ScalarMap_i* thePrs) {myScalarPane->initFromPrsObject(thePrs);}
int storeToPrsObject(VISU::ScalarMap_i* thePrs) {return myScalarPane->storeToPrsObject(thePrs);}
+ private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
myFieldsCombo->setCurrentText(aFieldName);
AddAllTimes(myFieldsCombo->currentText());
myTimeStampsCombo->setCurrentText(aIteration);
- SetScalarField();
+ SetScalarField( false );
myScalarPane->initFromPrsObject(myPrs);
}
myTimeStampsCombo->currentItem() + 1,
myPrs->GetScalarEntity());
- if (theUpdateScalars) SetScalarField();
+ if (theUpdateScalars) SetScalarField( false );
thePrs->ShowColored(true);
return anEntity;
}
-void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(){
- SetScalarField(myTimeStampsCombo->currentItem()+1);
+void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField( const bool save_scalar_pane ){
+ SetScalarField( myTimeStampsCombo->currentItem()+1, "", save_scalar_pane );
}
-void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString theFieldName){
+void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString theFieldName, const bool save_scalar_pane ){
QString aFieldName;
theIter,
anEntity);
- myScalarPane->storeToPrsObject(myPrs);
-
- UpdateScalarField();
+ if( save_scalar_pane )
+ {
+ myScalarPane->storeToPrsObject(myPrs);
+ UpdateScalarField();
+ }
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
}
return ret;
}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
QString getCurrentScalarFieldName();
int getCurrentScalarNbIterations();
VISU::TEntity getCurrentScalarEntity();
- void SetScalarField(int theIter,QString theFieldName=QString(""));
+ void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
+
+private:
+ void keyPressEvent( QKeyEvent* e );
protected slots:
void accept();
protected:
void UpdateScalarField();
- void SetScalarField();
+ void SetScalarField( const bool = true );
void AddAllFieldNames();
void AddAllTimes(const QString& theFieldName);
float GetFloatValueOfTimeStamp(const char* theMeshName,
myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
- vtkFloatingPointType* aCoord;
vtkIdList *aPointList = aCell->GetPointIds();
-
for (int i = 0; i < aNbOfPoints; i++) {
- int idCurrent = aPointList->GetId(i);
- aCoord = aDataSet->GetPoint(idCurrent);
- aPointsMap.insert(PointsMap::value_type(idCurrent,aCoord));
+ int aNodeVTKId = aPointList->GetId(i);
+ vtkFloatingPointType* aCoord = aDataSet->GetPoint(aNodeVTKId);
+ vtkIdType aNodeObjId = anVISUActor->GetNodeObjId(aNodeVTKId);
+ aPointsMap.insert(PointsMap::value_type(aNodeObjId,aCoord));
}
}
}
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_SelectionDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
VisuGUI_SelectionDlg (const SalomeApp_Module* theModule);
virtual ~VisuGUI_SelectionDlg ();
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected:
void closeEvent (QCloseEvent* theEvent);
QFrame* lin;
QLabel* labAxis = new QLabel( tr( "AXIS_LBL" ), frame );
+ QLabel* labAssigned = new QLabel( tr( "ASSIGNED" ), frame );
QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
labAxis->setAlignment( AlignCenter );
+ labAssigned->setAlignment( AlignCenter );
labData->setAlignment( AlignCenter );
labUnit->setAlignment( AlignCenter );
labAttr->setAlignment( AlignCenter );
QFont font = labAxis->font(); font.setBold( true );
labAxis->setFont( font );
+ labAssigned->setFont( font );
labData->setFont( font );
labUnit->setFont( font );
labAttr->setFont( font );
frameLayout->addMultiCellWidget( labAxis, 0, 0, 0, 1 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
frameLayout->addWidget( lin, 0, 2 );
- frameLayout->addWidget( labData, 0, 3 );
+
+ frameLayout->addWidget( labAssigned, 0, 3 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
frameLayout->addWidget( lin, 0, 4 );
- frameLayout->addWidget( labUnit, 0, 5 );
+
+ frameLayout->addWidget( labData, 0, 5 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
frameLayout->addWidget( lin, 0, 6 );
- frameLayout->addMultiCellWidget( labAttr, 0, 0, 7, 11 );
- frameLayout->setColStretch( 12, 5 );
+ frameLayout->addWidget( labUnit, 0, 7 );
+ lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
+ frameLayout->addWidget( lin, 0, 8 );
+ frameLayout->addMultiCellWidget( labAttr, 0, 0, 9, 13 );
+ frameLayout->setColStretch( 14, 5 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
- frameLayout->addMultiCellWidget( lin, 1, 1, 0, 12 );
+ frameLayout->addMultiCellWidget( lin, 1, 1, 0, 14 );
int row = 2;
_PTR(GenericAttribute) anAttr;
int nbRows = tblIntAttr->GetNbRows() ;
vector<string> rowTitles = tblIntAttr->GetRowTitles();
vector<string> rowUnits = tblIntAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ )
+ rows.append( rowTitles[i] );
+
for ( int i = 0; i < nbRows; i++ ) {
VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame );
+ item->createWidgets( frame, rows );
frameLayout->addWidget( item->myHBtn, row, 0 );
frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myTitleLab, row, 3 );
+ frameLayout->addWidget( item->myAssigned, row, 3 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 5 );
if ( rowTitles.size() > 0 )
item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 5 );
+ frameLayout->addWidget( item->myUnitLab, row, 7 );
if ( rowUnits.size() > 0 )
item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 7 );
- frameLayout->addWidget( item->myLineCombo, row, 8 );
- frameLayout->addWidget( item->myLineSpin, row, 9 );
- frameLayout->addWidget( item->myMarkerCombo, row, 10 );
- frameLayout->addWidget( item->myColorBtn, row, 11 );
+ frameLayout->addWidget( item->myAutoCheck, row, 9 );
+ frameLayout->addWidget( item->myLineCombo, row, 10 );
+ frameLayout->addWidget( item->myLineSpin, row, 11 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 12 );
+ frameLayout->addWidget( item->myColorBtn, row, 13 );
connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
myItems.append( item );
int nbRows = tblRealAttr->GetNbRows() ;
vector<string> rowTitles = tblRealAttr->GetRowTitles();
vector<string> rowUnits = tblRealAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ )
+ rows.append( rowTitles[i] );
+
for ( int i = 0; i < nbRows; i++ ) {
VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame );
+ item->createWidgets( frame, rows );
frameLayout->addWidget( item->myHBtn, row, 0 );
frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myTitleLab, row, 3 );
+ frameLayout->addWidget( item->myAssigned, row, 3 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 5 );
if ( rowTitles.size() > 0 )
item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 5 );
+ frameLayout->addWidget( item->myUnitLab, row, 7 );
if ( rowUnits.size() > 0 )
item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 7 );
- frameLayout->addWidget( item->myLineCombo, row, 8 );
- frameLayout->addWidget( item->myLineSpin, row, 9 );
- frameLayout->addWidget( item->myMarkerCombo, row, 10 );
- frameLayout->addWidget( item->myColorBtn, row, 11 );
+ frameLayout->addWidget( item->myAutoCheck, row, 9 );
+ frameLayout->addWidget( item->myLineCombo, row, 10 );
+ frameLayout->addWidget( item->myLineSpin, row, 11 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 12 );
+ frameLayout->addWidget( item->myColorBtn, row, 13 );
connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
myItems.append( item );
/*!
Gets curves info ( indexes of row data in the table for horizontal and verical axes )
*/
-void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes )
+void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes,
+ QValueList<int>& zIndices )
{
/* collecting horizontal and vertical axis items */
horIndex = -1;
}
else if ( myItems.at( i )->isVerticalOn() ) {
verIndexes.append( i );
+ zIndices.append( myItems.at( i )->assigned() );
}
+
}
}
/*!
/* collecting horizontal and vertical axis items */
int horIndex;
int i, j;
- QValueList<int> verIndex;
- getCurvesSource( horIndex, verIndex );
+ QValueList<int> verIndex, zIndices;
+ getCurvesSource( horIndex, verIndex, zIndices );
if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
return;
if ( nbPoints > 0 ) {
double* xList = new double[ nbPoints ];
double* yList = new double[ nbPoints ];
+ QStringList zList;
for ( j = 1; j <= nbCols; j++ ) {
if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
}
}
- curve->setData( xList, yList, nbPoints );
+ curve->setData( xList, yList, nbPoints, zList );
}
// curve attributes
curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
if ( nbPoints > 0 ) {
double* xList = new double[ nbPoints ];
double* yList = new double[ nbPoints ];
+ QStringList zList;
for ( j = 1; j <= nbCols; j++ ) {
if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
}
}
- curve->setData( xList, yList, nbPoints );
+ curve->setData( xList, yList, nbPoints, zList );
}
// curve attributes
curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
VisuGUI_ItemContainer* item = ( VisuGUI_ItemContainer* )sender();
QPtrList<VisuGUI_ItemContainer> itemList;
itemList.setAutoDelete( false );
+ item->myAssigned->setEnabled( on );
int i;
if ( on ) {
int totalOn = 0;
myOkBtn->setEnabled( bHSet && bVSet );
}
+/*!
+ Provides help on F1 button click
+*/
+void VisuGUI_SetupPlot2dDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
+
// ====================================================================================
/*!
Constructor
/*!
Creates widgets
*/
-void VisuGUI_ItemContainer::createWidgets( QWidget* parentWidget )
+void VisuGUI_ItemContainer::createWidgets( QWidget* parentWidget, const QStringList& lst )
{
myHBtn = new QToolButton( parentWidget );
myHBtn->setText( tr( "H" ) );
myColorBtn = new QToolButton( parentWidget );
myColorBtn->setMinimumWidth( 20 );
+
+ myAssigned = new QComboBox( false, parentWidget );
+ myAssigned->insertItem( "" );
+ QStringList::const_iterator anIt = lst.begin(), aLast = lst.end();
+ for( ; anIt!=aLast; anIt++ )
+ myAssigned->insertItem( *anIt );
+ myAssigned->setEnabled( false );
connect( myAutoCheck, SIGNAL( clicked() ), this, SLOT( onAutoChanged() ) );
connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
}
}
-
-
-
-
+/*!
+ \return index of assigned row (0, if there is no assigned row)
+*/
+int VisuGUI_ItemContainer::assigned() const
+{
+ if( isVerticalOn() )
+ return myAssigned->currentItem()-1;
+ else
+ return -1;
+}
~VisuGUI_SetupPlot2dDlg();
void getCurves( QPtrList<Plot2d_Curve>& container );
- void getCurvesSource( int& horIndex, QValueList<int>& verIndexes );
+ void getCurvesSource( int& horIndex, QValueList<int>& verIndexes, QValueList<int>& zIndexes );
bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
+private:
+ void keyPressEvent( QKeyEvent* e );
+
private slots:
void onHBtnToggled( bool );
void onVBtnToggled( bool );
public:
VisuGUI_ItemContainer( QObject* parent = 0, const char* name = 0 );
- void createWidgets( QWidget* parentWidget );
+ void createWidgets( QWidget* parentWidget, const QStringList& );
void enableWidgets( bool enable );
void setHorizontalOn( bool on );
int getMarker() const;
void setColor( const QColor& color );
QColor getColor() const;
+ int assigned() const;
protected:
void updateState();
QCheckBox* myAutoCheck;
QComboBox* myLineCombo;
QSpinBox* myLineSpin;
- QComboBox* myMarkerCombo;
+ QComboBox* myMarkerCombo, *myAssigned;
QToolButton* myColorBtn;
};
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_StreamLinesDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void setColor( QColor color );
void enableMagnColor( bool enable );
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void accept();
void reject();
//------------------------------------------------------------------------
void SetupDlg::onRangeCheck (bool theCheck)
{
- for (int i = 0; i < myAnimator->getNbFields(); i++)
- myAnimator->clearData(myAnimator->getFieldData(i));
+// for (int i = 0; i < myAnimator->getNbFields(); i++)
+// myAnimator->clearData(myAnimator->getFieldData(i));
myMinVal->setEnabled(theCheck);
myMaxVal->setEnabled(theCheck);
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
{
- if (isClosing) {
- if(theEvent->type() == QEvent::Close){
- for (int i = 0; i < myAnimator->getNbFields(); i++)
- myAnimator->clearData(myAnimator->getFieldData(i));
- myAnimator->clearFieldData();
- }
- QDialog::closeEvent(theEvent);
- return;
- }
- if(myAnimator != NULL){
+ if(myAnimator != NULL){
myAnimator->stopAnimation();
- myAnimator->wait();
+ myAnimator->wait(500);
if (myAnimator->running() && (! myAnimator->finished())) {
isClosing = true;
myEvent = theEvent;
// * It needed for correcting destroing of myAnimator, which
// * depend from SVTK_RenderWindowInteractor() e.t.c.
if(theEvent->type() == QEvent::Close){
- for (int i = 0; i < myAnimator->getNbFields(); i++)
- myAnimator->clearData(myAnimator->getFieldData(i));
- myAnimator->clearFieldData();
+ for (int i = 0; i < myAnimator->getNbFields(); i++)
+ myAnimator->clearData(myAnimator->getFieldData(i));
+ myAnimator->clearFieldData();
}
} else {
- QDialog::closeEvent(theEvent);
+ QDialog::closeEvent(theEvent);
}
} else {
QDialog::closeEvent(theEvent);
{
myAnimator->dumpTo(myPathEdit->text());
}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
+
protected:
virtual void closeEvent(QCloseEvent* theEvent);
virtual void showEvent(QShowEvent* theEvent);
+ virtual void keyPressEvent(QKeyEvent* theEvent);
virtual void reject();
void stopAnimation();
plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
if ( nbPoints > 0 && xList && yList ) {
- plotCurve->setData( xList, yList, nbPoints );
+ plotCurve->setData( xList, yList, nbPoints, zList );
}
if ( !theCurve->IsAuto() ) {
plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
}
ValueHasChanged();
}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void VisuGUI_TransparencyDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ ClickOnHelp();
+ }
+}
~VisuGUI_TransparencyDlg();
+private:
+ void keyPressEvent( QKeyEvent* e );
+
private :
LightApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
QObject::tr("BUT_OK"));
}
}
+
+void VisuGUI_VectorsDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
void initFromPrsObject(VISU::Vectors_i* thePrs);
int storeToPrsObject(VISU::Vectors_i* thePrs);
+private:
+ void keyPressEvent( QKeyEvent* e );
+
+
protected slots:
void accept();
void reject();
VISU_Actor*
VISU::DeformedShape_i
-::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking)
{
- VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
+ VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO, true);
anActor->SetVTKMapping(false);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1);
bool toShrink = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false);
anActor->SetRepresentation(aDispMode);
- if (toShrink) anActor->SetShrink();
+ if (toShrink && !toSupressShrinking) anActor->SetShrink();
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
return anActor;
}
+VISU_Actor*
+VISU::DeformedShape_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ return CreateActor(theIO, false);
+}
void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) {
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
+
virtual void UpdateActor(VISU_Actor* theActor) ;
};
}
case VISU::TCURVE:
if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
{
- theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve(" <<
+ bool withZ = aServant->GetZRow()>0;
+
+ theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
+ if( withZ )
+ theStr << "WithZ";
+ theStr << "(" <<
theArgumentName<< // table
","<<aServant->GetHRow()<< // H row
- ","<<aServant->GetVRow()<< // V row
- ",'"<<aServant->GetTitle()<<"'"; // title
+ ","<<aServant->GetVRow(); // V row
+ if( withZ )
+ theStr << "," << aServant->GetZRow(); // Z row
+
+ theStr << ",'"<<aServant->GetTitle()<<"'"; // title
SALOMEDS::Color aColor = aServant->GetColor();
theStr << ",SALOMEDS.Color("<<
aColor.R<<","<<aColor.G<<","<<aColor.B<<")"; // color
CORBA::Boolean theIsPublished,
CORBA::Boolean& theIsValidScript)
{
+ theIsValidScript = false;
+
SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
if(CORBA::is_nil(aStudy))
return new Engines::TMPFile(0);
#endif
std::string aPrefix(PREFIX);
- aStr<<"### This file is generated by SALOME automatically by dump python funcitonality"
+ aStr<<"### This file is generated by SALOME automatically by dump python functionality"
" of VISU component"<<endl<<endl;
aStr<<"def RebuildData(theStudy):"<<endl;
aStr<<aPrefix<<"from batchmode_salome import orb, naming_service, lcc, myStudyManager"<<endl;
}
aStr<<aPrefix<<"pass"<<endl;
+ // theIsValidScript currently is not used by internal dump methods (DumpChildrenToPython(), etc.)
+ // If the situation changes, then the following line should be removed, and theIsValidScript
+ // should be set properly by those internal methods
+ theIsValidScript = true;
#ifndef COUT
std::string aResult = aStr.str();
int aFaceLimit = aResourceMgr->integerValue( "VISU", "geom_sphere_face_limit", GetFaceLimit() );
SetFaceLimit( aFaceLimit );
- QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
+ QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
aMainTexture = aResourceMgr->stringValue( "VISU", "point_sprite_main_texture", aMainTexture );
- QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
+ QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture );
SetTextures( aMainTexture, anAlphaTexture );
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : VISU_Gen_i.cc
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
// QT Includes
-#include <qstring.h>
+#include <qdir.h>
#include <qfileinfo.h>
-#include <qprocess.h>
+#include <qregexp.h>
// VTK Includes
#include <vtkRenderer.h>
#include "Utils_ExceptHandlers.hxx"
#include "CASCatch.hxx"
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#define NO_CAS_CATCH
+#endif
+
+#include <Standard_Failure.hxx>
+
+#ifdef NO_CAS_CATCH
+#include <Standard_ErrorHandler.hxx>
+#else
+#include "CASCatch.hxx"
+#endif
+
using namespace std;
static QFileInfo aFileInfo;
#ifndef _DEXCEPT_
try{
#endif
- if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
- return true;
+ if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
+ return true;
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
#endif
- }CASCatch_CATCH(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
- }
+ }CASCatch_CATCH(Standard_Failure){
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+ }
return false;
- }
+ }
VISU_Gen_i::~VISU_Gen_i(){
if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
}
+
+ void CorrectSObjectType(SALOMEDS::SObject_ptr theSObject)
+ {
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( theSObject->FindAttribute(anAttr, "AttributeComment") ) {
+ SALOMEDS::AttributeComment_var aAttComment = SALOMEDS::AttributeComment::_narrow(anAttr);
+ if ( aAttComment ) {
+ string aValue = aAttComment->Value();
+ if ( aValue.compare("") ) {
+ const QString aStr = QString( aValue.c_str() );
+ VISU::Storable::TRestoringMap aMap;
+ Storable::StrToMap( aStr, aMap );
+
+ bool isFind = false;
+ QString aType = Storable::FindValue( aMap, "myType", &isFind );
+ if ( isFind ) {
+ VISU::VISUType aVISUType = (VISU::VISUType)( aType.toInt() );
+ QString aComment = Storable::FindValue( aMap, "myComment", &isFind );
+ if ( isFind ) {
+ if ( !aComment.compare(QString("NONE")) ) aVISUType = VISU::TNONE;
+ else if ( !aComment.compare(QString("CURVE")) ) aVISUType = VISU::TCURVE;
+ else if ( !aComment.compare(QString("TABLE")) ) aVISUType = VISU::TTABLE;
+ else if ( !aComment.compare(QString("CONTAINER")) ) aVISUType = VISU::TCONTAINER;
+ else if ( !aComment.compare(QString("MESH")) ) aVISUType = VISU::TMESH;
+ else if ( !aComment.compare(QString("SCALARMAP")) ) aVISUType = VISU::TSCALARMAP;
+ else if ( !aComment.compare(QString("ISOSURFACE")) ) aVISUType = VISU::TISOSURFACE;
+ else if ( !aComment.compare(QString("DEFORMEDSHAPE")) ) aVISUType = VISU::TDEFORMEDSHAPE;
+ else if ( !aComment.compare(QString("SCALARMAPONDEFORMEDSHAPE")) ) aVISUType = VISU::TSCALARMAPONDEFORMEDSHAPE;
+ else if ( !aComment.compare(QString("GAUSSPOINTS")) ) aVISUType = VISU::TGAUSSPOINTS;
+ else if ( !aComment.compare(QString("PLOT3D")) ) aVISUType = VISU::TPLOT3D;
+ else if ( !aComment.compare(QString("CUTPLANES")) ) aVISUType = VISU::TCUTPLANES;
+ else if ( !aComment.compare(QString("CUTLINES")) ) aVISUType = VISU::TCUTLINES;
+ else if ( !aComment.compare(QString("VECTORS")) ) aVISUType = VISU::TVECTORS;
+ else if ( !aComment.compare(QString("STREAMLINES")) ) aVISUType = VISU::TSTREAMLINES;
+ else if ( !aComment.compare(QString("VISUGEN")) ) aVISUType = VISU::TVISUGEN;
+ else if ( !aComment.compare(QString("VIEWMANAGER")) ) aVISUType = VISU::TVIEWMANAGER;
+ else if ( !aComment.compare(QString("RESULT")) ) aVISUType = VISU::TRESULT;
+ else if ( !aComment.compare(QString("XYPLOT")) ) aVISUType = VISU::TXYPLOT;
+ else if ( !aComment.compare(QString("TABLEVIEW,")) ) aVISUType = VISU::TTABLEVIEW;
+ else if ( !aComment.compare(QString("VIEW3D")) ) aVISUType = VISU::TVIEW3D;
+ else if ( !aComment.compare(QString("GAUSSVIEW")) ) aVISUType = VISU::TGAUSSVIEW;
+ else if ( !aComment.compare(QString("ENTITY")) ) aVISUType = VISU::TENTITY;
+ else if ( !aComment.compare(QString("FAMILY")) ) aVISUType = VISU::TFAMILY;
+ else if ( !aComment.compare(QString("GROUP")) ) aVISUType = VISU::TGROUP;
+ else if ( !aComment.compare(QString("FIELD")) ) aVISUType = VISU::TFIELD;
+ else if ( !aComment.compare(QString("TIMESTAMP")) ) aVISUType = VISU::TTIMESTAMP;
+ else if ( !aComment.compare(QString("ANIMATION")) ) aVISUType = VISU::TANIMATION;
+ else if ( !aComment.compare(QString("ALL")) ) aVISUType = VISU::TALL;
+ else
+ if (MYDEBUG) MESSAGE("Error : Unknown type of VISU object!");
+ }
+ QString aNewStr = aStr;
+ aAttComment->SetValue( aNewStr.replace( QRegExp( QString("myType=") + aType ) ,
+ QString("myType=") + QString::number(aVISUType) ).latin1() );
+ }
+ }
+ }
+ }
+ }
+
//===========================================================================
CORBA::Boolean VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
const SALOMEDS::TMPFile & theStream,
{
Mutex mt(myMutex);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
+
+ SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
+ for (anIter->InitEx(true); anIter->More(); anIter->Next()) {
+ SALOMEDS::SObject_var aSObject = anIter->Value();
+ CorrectSObjectType(aSObject);
+ }
+
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
}
return aString._retn();
}
+
//===========================================================================
SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
std::string aFile = aFileInfo.filePath().latin1();
if(theIsMultiFile){
aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName;
- //std::ostringstream aStream;
- QString aCommand;
- aCommand.sprintf( " %s %s%s", aFile.c_str(), aTmpDir.c_str(), aFileName.c_str() );
- aCommand = QDir::convertSeparators( aCommand );
- aCommand.prepend( COPY_COMMAND );
-
- if(system(aCommand.latin1())){
+
+ std::ostringstream aStream;
+ aStream<<"cp "<<aFile<<" "<<aTmpDir<<aFileName;
+ std::string aCommand = aStream.str();
+ if(system(aCommand.c_str()) != 0){
INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
continue;
}
Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
CORBA::Long theHRow,
CORBA::Long theVRow)
+ {
+ return CreateCurveWithZ( theTable, theHRow, theVRow, 0 );
+ }
+
+ Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Curve::_nil();
Mutex mt(myMutex);
PortableServer::POA_ptr aPOA = GetPOA();
Table_i* pTable = dynamic_cast<Table_i*>(aPOA->reference_to_servant(theTable));
- Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow);
+ Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow,theZRow);
if(pPresent->Create() != NULL)
return pPresent->_this();
else{
CreateCurve(Table_ptr theTable,
CORBA::Long theHRow,
CORBA::Long theVRow);
+ virtual
+ Curve_ptr
+ CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow);
virtual
Container_ptr
myType = VISU::TGROUP;
if(MYDEBUG) MESSAGE("Mesh_i::Build - myType = "<<myType);
- QString aComment;
+ QString aComment,aTmp;
VISU::PIDMapper anIDMapper;
switch(myType){
case VISU::TENTITY :
anIDMapper = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
- aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
- VISU::TENTITY,myMeshName.c_str(),myEntity);
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=ENTITY;myType=%d;",VISU::TENTITY));
+ aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myId=%d",myEntity));
break;
case VISU::TFAMILY :
anIDMapper = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
- aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
- VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str());
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=FAMILY;myType=%d;",VISU::TFAMILY));
+ aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myEntityId=%d;",myEntity));
+ aComment.append("myName=");aComment.append(mySubMeshName);
break;
case VISU::TGROUP :
anIDMapper = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
- aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
- VISU::TGROUP,myMeshName.c_str(),mySubMeshName.c_str());
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=GROUP;myType=%d;",VISU::TGROUP));
+ aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+ aComment.append("myName=");aComment.append(mySubMeshName);
+
break;
}
if(!anIDMapper)
}
}
+struct TRemoveActorsFromRendererEvent: public SALOME_Event
+{
+ typedef boost::signal0<void> TRemoveActorsFromRendererSignalType;
+ const TRemoveActorsFromRendererSignalType& myRemoveActorsFromRendererSignalVar;
+
+ TRemoveActorsFromRendererEvent
+ (const TRemoveActorsFromRendererSignalType& theRemoveActorsFromRendererSignalVar):
+ myRemoveActorsFromRendererSignalVar(theRemoveActorsFromRendererSignalVar)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myRemoveActorsFromRendererSignalVar();
+ }
+};
+
VISU::Prs3d_i
-::~Prs3d_i()
+::~Prs3d_i()
{
if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
- myRemoveActorsFromRendererSignal();
+ ProcessVoidEvent(new TRemoveActorsFromRendererEvent(myRemoveActorsFromRendererSignal));
myPipeLine->Delete();
myResult->Destroy();
}
//----------------------------------------------------------------------------
-VISU::Storable*
+VISU::Storable*
VISU::Prs3d_i
::Restore(const Storable::TRestoringMap& theMap)
{
//----------------------------------------------------------------------------
-SALOMEDS::SObject_var
+SALOMEDS::SObject_var
VISU::Prs3d_i
::GetSObject()
{
return mySObject;
}
-Result_i*
+Result_i*
VISU::Prs3d_i
-::GetResult() const
-{
+::GetResult() const
+{
return myResult;
}
-const std::string&
+const std::string&
VISU::Prs3d_i
-::GetMeshName() const
-{
- return myMeshName;
+::GetMeshName() const
+{
+ return myMeshName;
}
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
-::Update()
+::Update()
{
if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
try{
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
-::CheckDataSet()
+::CheckDataSet()
{
vtkMapper *aMapper = myPipeLine->GetMapper();
vtkDataSet *aDataSet = aMapper->GetInput();
void
VISU::Prs3d_i
-::RemoveFromStudy()
+::RemoveFromStudy()
{
struct TRemoveFromStudy: public SALOME_Event
{
myRemovable(theRemovable),
myRemoveFromStudySignal(theRemoveFromStudySignal)
{}
-
+
virtual
void
Execute()
//----------------------------------------------------------------------------
-VISU_PipeLine*
+VISU_PipeLine*
VISU::Prs3d_i
::GetPipeLine()
{
return GetPL();
}
-VISU_PipeLine*
+VISU_PipeLine*
VISU::Prs3d_i
::GetPL()
{
return myPipeLine;
}
-vtkUnstructuredGrid*
+vtkUnstructuredGrid*
VISU::Prs3d_i::
GetInput()
{
void
VISU::Prs3d_i
-::RemoveActor(VISU_Actor* theActor)
+::RemoveActor(VISU_Actor* theActor)
{
if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActor - this = "<<this<<"; theActor = "<<theActor);
myActorCollection->RemoveItem(theActor);
::RemoveActors()
{
if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActors - this = "<<this);
- myRemoveActorsFromRendererSignal();
+ ProcessVoidEvent(new TRemoveActorsFromRendererEvent(myRemoveActorsFromRendererSignal));
myActorCollection->RemoveAllItems();
}
void
VISU::Prs3d_i
-::UpdateActor(VISU_Actor* theActor)
+::UpdateActor(VISU_Actor* theActor)
{
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
theActor->ShallowCopyPL(myPipeLine);
VISU::Prs3d_i
::UpdateActors()
{
+ struct TUpdateActorsEvent: public SALOME_Event
+ {
+ typedef boost::signal0<void> TUpdateActorsSignalType;
+ const TUpdateActorsSignalType& myUpdateActorsSignalVar;
+
+ TUpdateActorsEvent(const TUpdateActorsSignalType& theUpdateActorsSignalVar):
+ myUpdateActorsSignalVar(theUpdateActorsSignalVar)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myUpdateActorsSignalVar();
+ }
+ };
+
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
Update();
CheckDataSet();
- myUpdateActorsSignal();
+ ProcessVoidEvent(new TUpdateActorsEvent(myUpdateActorsSignal));
}
return myPipeLine->GetNumberOfClippingPlanes();
}
-vtkPlane*
+vtkPlane*
VISU::Prs3d_i::
GetClippingPlane(vtkIdType theID) const
{
void
VISU::Prs3d_i
-::SetPlaneParam (vtkFloatingPointType theDir[3],
- vtkFloatingPointType theDist,
- vtkPlane* thePlane)
+::SetPlaneParam (vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane)
{
myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
}
myPipeLine->GetMapper()->GetBounds(aBounds);
}
-void
+void
VISU::Prs3d_i
::SetOffset(const CORBA::Float* theOffsets)
{
void
VISU::Prs3d_i
-::SetOffset(CORBA::Float theDx,
- CORBA::Float theDy,
+::SetOffset(CORBA::Float theDx,
+ CORBA::Float theDy,
CORBA::Float theDz)
{
myOffset[0] = theDx;
theOffsets[2] = myOffset[2];
}
-void
+void
VISU::Prs3d_i
-::GetOffset(CORBA::Float& theDx,
- CORBA::Float& theDy,
+::GetOffset(CORBA::Float& theDx,
+ CORBA::Float& theDy,
CORBA::Float& theDz)
{
theDx = myOffset[0];
//----------------------------------------------------------------------------
-VISU::Result_i*
+VISU::Result_i*
VISU::GetResult(SALOMEDS::SObject_ptr theSObject)
{
VISU::Result_var aResult = FindResult(theSObject);
theInput->BuildEntities();
}
- QString aComment;
+ QString aComment,aTmp;
const TMeshMap& aMeshMap = theInput->GetMeshMap();
TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
if(aMeshOnEntityMap.empty())
continue;
-
- aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
- aMeshName.c_str(),
- aMesh->myDim);
+ aComment = "";
+ aComment.append("myComment=MESH;");
+ aComment.append("myName=");aComment.append(aMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myDim=%d",aMesh->myDim));
aMesh->myEntry =
CreateAttributes(theStudy,
theResultEntry,
aComment.latin1(),
true);
- aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
- aMeshName.c_str());
+ aComment = "";
+ aComment.append("myComment=FAMILIES;");
+ aComment.append("myMeshName=");aComment.append(aMeshName);
string aSubMeshesEntry =
CreateAttributes(theStudy,
aMesh->myEntry,
continue;
}
- aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
- VISU::TENTITY,
- aMeshName.c_str(),
- anEntity);
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=ENTITY;myType=%d;",VISU::TENTITY));
+ aComment.append("myMeshName=");aComment.append(aMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myId=%d",anEntity));
+
aMeshOnEntity->myEntry =
CreateAttributes(theStudy,
theInput->BuildGroups();
}
- QString aComment;
+ QString aComment,aTmp;
const TMeshMap& aMeshMap = theInput->GetMeshMap();
TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
const string& aFamilyName = aFamilyMapIter->first;
const PFamily& aFamily = aFamilyMapIter->second;
- aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
- TFAMILY,
- aMeshName.c_str(),
- anEntity,
- aFamilyName.c_str());
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=FAMILY;myType=%d;",TFAMILY));
+ aComment.append("myMeshName=");aComment.append(aMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myEntityId=%d;",anEntity));
+ aComment.append("myName=");aComment.append(aFamilyName);
+
aFamily->myEntry =
CreateAttributes(theStudy,
aMeshOnEntity->myEntry,
//Importing groups
const TGroupMap& aGroupMap = aMesh->myGroupMap;
if(!aGroupMap.empty()){
- aComment.sprintf("myComment=GROUPS;myMeshName=%s",
- aMeshName.c_str());
+ aComment = "";
+ aComment.append("myComment=GROUPS;");
+ aComment.append("myMeshName=");aComment.append(aMeshName);
UpdateAttributes(theStudy,
aMesh->myGroupsEntry,
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
const string& aGroupName = aGroupMapIter->first;
const PGroup& aGroup = aGroupMapIter->second;
- aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
- TGROUP,aMeshName.c_str(),aGroupName.c_str());
+ aComment = "";
+ aComment.sprintf("myComment=GROUP;myType=%d;",
+ TGROUP);
+ aComment.append("myMeshName=");aComment.append(aMeshName);aComment.append(";");
+ aComment.append("myName=");aComment.append(aGroupName);
aGroup->myEntry =
CreateAttributes(theStudy,
aMesh->myGroupsEntry,
theInput->BuildFields();
}
- QString aComment;
+ QString aComment,aTmp;
const TMeshMap& aMeshMap = theInput->GetMeshMap();
TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
if(!anIsFieldsEntryUpdated){
- aComment.sprintf("myComment=FIELDS;myMeshName=%s",
- aMeshName.c_str());
-
+ aComment = "";
+ aComment.append("myComment=FIELDS;");
+ aComment.append("myMeshName=");aComment.append(aMeshName);
+
UpdateAttributes(theStudy,
aMesh->myFieldsEntry,
"",
const PField& aField = aFieldMapIter->second;
const TValField& aValField = aField->myValField;
QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
- aComment.sprintf("myComment=FIELD;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s;myNbTimeStamps=%d;myNumComponent=%d",
- TFIELD,
- aMeshName.c_str(),
- anEntity,
- aFieldName.c_str(),
- aValField.size(),
- aField->myNbComp);
+ aComment = "";
+ aComment.sprintf("myComment=FIELD;myType=%d;",TFIELD);
+ aComment.append("myMeshName=");aComment.append(aMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myEntityId=%d;",anEntity));
+ aComment.append("myName=");aComment.append(aFieldName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myNbTimeStamps=%d;",aValField.size()));
+ aComment.append(aTmp.sprintf("myNumComponent=%d",aField->myNbComp));
aField->myEntry =
CreateAttributes(theStudy,
aMesh->myFieldsEntry,
for(; aValFieldIter != aValField.end(); aValFieldIter++){
int aTimeStamp = aValFieldIter->first;
const PValForTime& aValForTime = aValFieldIter->second;
- aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- TTIMESTAMP,
- aMeshName.c_str(),
- anEntity,
- aFieldName.c_str(),
- aTimeStamp,
- aField->myNbComp);
+ aComment = "";
+ aComment.sprintf("myComment=TIMESTAMP;myType=%d;",TTIMESTAMP);
+ aComment.append("myMeshName=");aComment.append(aMeshName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myEntityId=%d;",anEntity));
+ aComment.append("myFieldName=");aComment.append(aFieldName);aComment.append(";");
+ aComment.append(aTmp.sprintf("myTimeStampId=%d;myNumComponent=%d",aTimeStamp,aField->myNbComp));
+
string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
aValForTime->myEntry =
CreateAttributes(theStudy,
if(aCreationId == eImportMed || aCreationId == eImportMedField)
aSourceId = eRestoredComponent;
- CORBA::Boolean anIsBuildFields = Storable::FindValue(theMap,"myIsBuildFields","0").toInt();
- CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","0").toInt();
- CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","0").toInt();
+ CORBA::Boolean anIsBuildFields = Storable::FindValue(theMap,"myIsBuildFields","1").toInt();
+ CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","1").toInt();
+ CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","1").toInt();
VISU::Result_i* aResult = new VISU::Result_i(aStudy,
aSourceId,
return FindEntryWithComment(myStudyDocument,GetEntry().c_str(),theComment.c_str());
}
-
+#include <stdio.h>
//---------------------------------------------------------------
VISU::Result_i
::~Result_i()
#else
aCommand.sprintf("del /F %s",myFileInfo.filePath().latin1());
#endif
- MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+ int res = system(aCommand);
+ MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<res);
#ifndef WNT
aCommand.sprintf("rmdir --ignore-fail-on-non-empty %s",myFileInfo.dirPath().latin1());
#else
aCommand.sprintf("del /F %s",myFileInfo.dirPath().latin1());
#endif
- MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+
+ res = system(aCommand);
+ MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<res);
}
if(myInput) delete myInput;
}
VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
- VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
+ VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
//----------------------------------------------------------------------------
VISU_Actor*
VISU::ScalarMap_i
-::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking)
{
VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
try{
bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
anActor->SetRepresentation(aDispMode);
- if (toShrink) anActor->SetShrink();
+ if (toShrink && !toSupressShrinking) anActor->SetShrink();
anActor->SetShading(toUseShading);
UpdateActor(anActor);
}catch(...){
return anActor;
}
+VISU_Actor*
+VISU::ScalarMap_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ return CreateActor(theIO, false);
+}
+
void
VISU::ScalarMap_i
::UpdateActor(VISU_Actor* theActor)
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
virtual
void
VISU::StreamLines_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO, true)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1);
Constructor
NB : theHRow, theVRow are the indexes of rows in the Table object and numbered from the 1 to GetNbRows()
*/
-VISU::Curve_i::Curve_i(SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow )
- : PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ), myVRow( theVRow )
+VISU::Curve_i::Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
+ CORBA::Long theHRow, CORBA::Long theVRow,
+ CORBA::Long theZRow )
+: PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ),
+ myVRow( theVRow ), myZRow( theZRow )
{
myAuto = true;
myLine = VISU::Curve::SOLIDLINE;
/*!
Gets curve data
*/
-int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList )
+int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList, QStringList& zList )
{
theHorList = 0; theVerList = 0;
// getting table SObject by it's entry
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
+
+ QString tip = "%1: %2", z_data;
+
if ( !SO->_is_nil() ) {
if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
- int nbCols = anInt->GetNbColumns() ;
+ int nbCols = anInt->GetNbColumns(), nbRows = anInt->GetNbRows();
if ( nbCols > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() && myVRow > 0 && myVRow <= anInt->GetNbRows() ) {
int nbPoints = 0;
for ( int j = 1; j <= nbCols; j++ ) {
theHorList = new double[ nbPoints ];
theVerList = new double[ nbPoints ];
int k = 0;
+
+ SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
+
for ( int j = 1; j <= nbCols; j++ ) {
if ( anInt->HasValue( myHRow, j ) && anInt->HasValue( myVRow, j ) ) {
theHorList[k] = anInt->GetValue( myHRow, j );
theVerList[k] = anInt->GetValue( myVRow, j );
+
+ z_data = tip.arg( GetHorTitle().c_str() ).arg( theHorList[k] ) + "\n";
+ z_data += tip.arg( GetVerTitle().c_str() ).arg( theVerList[k] );
+
+ if( myZRow>0 && myZRow<=nbRows && anInt->HasValue( myZRow, j ) )
+ {
+ string title;
+ title = rowTitles[ myZRow-1 ];
+ z_data += "\n" + tip.arg( title.c_str() ).arg( anInt->GetValue( myZRow, j ) );
+ }
+ zList.append( z_data );
k++;
}
}
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
- int nbCols = aReal->GetNbColumns() ;
+ int nbCols = aReal->GetNbColumns(), nbRows = aReal->GetNbRows();
if ( nbCols > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() && myVRow > 0 && myVRow <= aReal->GetNbRows() ) {
int nbPoints = 0;
for ( int j = 1; j <= nbCols; j++ ) {
theHorList = new double[ nbPoints ];
theVerList = new double[ nbPoints ];
int k = 0;
+
+ SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
+
for ( int j = 1; j <= nbCols; j++ ) {
if ( aReal->HasValue( myHRow, j ) && aReal->HasValue( myVRow, j ) ) {
theHorList[k] = aReal->GetValue( myHRow, j );
theVerList[k] = aReal->GetValue( myVRow, j );
+
+ z_data = tip.arg( GetHorTitle().c_str() ).arg( theHorList[k] ) + "\n";
+ z_data += tip.arg( GetVerTitle().c_str() ).arg( theVerList[k] );
+
+ if( myZRow>0 && myZRow<=nbRows && aReal->HasValue( myZRow, j ) )
+ {
+ string title;
+ title = rowTitles[ myZRow-1 ];
+ z_data += "\n" + tip.arg( title.c_str() ).arg( aReal->GetValue( myZRow, j ) );
+ }
+ zList.append( z_data );
k++;
}
}
crv->setVerUnits( GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = GetData( xList, yList, zList );
if ( nbPoints > 0 && xList && yList ) {
- crv->setData( xList, yList, nbPoints );
+ crv->setData( xList, yList, nbPoints, zList );
}
//cout << "********** Number of points: " << nbPoints <<endl;
//for ( int i =0 ; i < nbPoints; i++ ) {
myName = VISU::Storable::FindValue(theMap,"myName").latin1();
myHRow = VISU::Storable::FindValue(theMap,"myHRow").toInt();
myVRow = VISU::Storable::FindValue(theMap,"myVRow").toInt();
+ bool ok = false;
+ QString z_str = VISU::Storable::FindValue(theMap,"myZRow", &ok);
+ myZRow = ok ? z_str.toInt() : 0;
+
myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
Storable::DataToStream( theStr, "myName", myName.c_str() );
Storable::DataToStream( theStr, "myHRow", myHRow );
Storable::DataToStream( theStr, "myVRow", myVRow );
+ Storable::DataToStream( theStr, "myZRow", myZRow );
Storable::DataToStream( theStr, "myColor.R", myColor.R );
Storable::DataToStream( theStr, "myColor.G", myColor.G );
Storable::DataToStream( theStr, "myColor.B", myColor.B );
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
if( pTable != NULL ) {
- VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0 );
+ VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0, 0 );
return pResent->Restore( theMap, theSObject);
}
return NULL;
Curve_i();
Curve_i( const Curve_i& );
public:
- Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow );
+ Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
+ CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow );
virtual ~Curve_i();
virtual VISU::VISUType GetType() { return VISU::TCURVE;};
Table_i* myTable;
int myHRow;
int myVRow;
+ int myZRow;
struct SALOMEDS::Color myColor;
VISU::Curve::MarkerType myMarker;
VISU::Curve::LineType myLine;
int GetHRow() const { return myHRow;}
int GetVRow() const { return myVRow;}
+ int GetZRow() const { return myZRow;}
virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
virtual std::string GetVerTitle();
virtual std::string GetHorUnits();
virtual std::string GetVerUnits();
- virtual int GetData( double*& theHorList, double*& theVerList );
+ virtual int GetData( double*& theHorList, double*& theVerList, QStringList& );
virtual SPlot2d_Curve* CreatePresentation();
};
#include <qstrlist.h>
#include <qdir.h>
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#define NO_CAS_CATCH
+#endif
+
+#include <Standard_Failure.hxx>
+
+#ifdef NO_CAS_CATCH
+#include <Standard_ErrorHandler.hxx>
+#else
+#include "CASCatch.hxx"
+#endif
+
using namespace std;
for (int i = 0; i < getNbFields(); i++) {
clearData(myFieldsLst[i]);
}
- clearFieldData();
+
/* Terminates the execution of the thread.
* The thread may or may not be terminated immediately,
* depending on the operating system's scheduling policies.
bool anIsCreated = false;
TPrs3d* aPresent = new TPrs3d(theResult, false);
- CASCatch_TRY{
- try{
- if(aPresent->Create(aMeshName.latin1(),anEntity,aFieldName.latin1(),aTimeStampId)){
- anIsCreated = true;
- theData.myPrs[aFrameId++] = aPresent;
- aMin = std::min(aPresent->GetMin(), aMin);
- aMax = std::max(aPresent->GetMax(), aMax);
- }
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
- }CASCatch_CATCH(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+#ifdef NO_CAS_CATCH
+ try{
+ OCC_CATCH_SIGNALS;
+#else
+ CASCatch_TRY{
+ try{
+#endif
+ if(aPresent->Create(aMeshName.latin1(),anEntity,aFieldName.latin1(),aTimeStampId)){
+ anIsCreated = true;
+ theData.myPrs[aFrameId++] = aPresent;
+ aMin = std::min(aPresent->GetMin(), aMin);
+ aMax = std::max(aPresent->GetMax(), aMax);
+ }
+#ifdef NO_CAS_CATCH
+ }catch(Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+#else
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ }CASCatch_CATCH(Standard_Failure){
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
}
+#endif
if(!anIsCreated)
aPresent->_remove_ref();
}
// We must unlock mutex for some time before grabbing to allow view updating
qApp->unlock();
msleep(delay);
- if (!myIsActive) {
- emit stopped();
- return;
- }
qApp->lock();
if(!(myFieldsLst[0].myField)) // break, if field was deleted.
- break;
+ break;
if (myDumpFormat.compare("AVI") != 0) {
- QString aFile(myDumpPath);
- QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
- int aPos = -1;
- while ((aPos = aName.find(".")) > -1 )
- aName.replace(aPos, 1, "_");
- aFile += aName;
- aFile += ".";
- aFile += myDumpFormat.lower();
- myView->dumpViewToFormat(aFile,myDumpFormat);
- }
- else
- {
- QFileInfo aFileInfo(myDumpPath);
- QString aDirPath = aFileInfo.dirPath(true);
- QString aBaseName = aFileInfo.fileName();
-
- switch (myFrame) {
- case 0:
- break;
- case 1:
- myFileIndex += 5;
- break;
- default:
- if (myProportional) {
- double p = (myFieldsLst[0].myTiming[myFrame] -
- myFieldsLst[0].myTiming[myFrame-1]) / aOneVal;
- myFileIndex += (long) (5*p);
- } else {
- myFileIndex += 5;
- }
- }
-
- QString aFile = aDirPath + QDir::separator() + aBaseName;
- aFile += "_";
- aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0');
-#ifndef WNT
- aFile += ".jpeg";
-#else
- aFile += ".bmp";
-#endif
+ QString aFile(myDumpPath);
+ QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
+ int aPos = -1;
+ while ((aPos = aName.find(".")) > -1 )
+ aName.replace(aPos, 1, "_");
+ aFile += aName;
+ aFile += ".";
+ aFile += myDumpFormat.lower();
+ myView->dumpViewToFormat(aFile,myDumpFormat);
+ } else {
+ QFileInfo aFileInfo(myDumpPath);
+ QString aDirPath = aFileInfo.dirPath(true);
+ QString aBaseName = aFileInfo.fileName();
- /* check image size is divisable 16
- myView->dumpViewToFormat(aFile,"JPEG");
- */
- SUIT_ViewWindow* aView = myView;
- QImage img = aView->dumpView();
- if (!img.isNull()) {
- int width = img.width(); width = (width/16)*16;
- int height = img.height(); height = (height/16)*16;
- QImage copy = img.copy(0, 0, width, height);
-#ifndef WNT
- if (copy.save(aFile, "JPEG")) {
-#else
- if (copy.save(aFile, "BMP")) {
-#endif
- anIndexList.append(myFileIndex);
- aNbFiles++;
- }
- }
+ switch (myFrame) {
+ case 0:
+ break;
+ case 1:
+ myFileIndex += 5;
+ break;
+ default:
+ if (myProportional) {
+ double p = (myFieldsLst[0].myTiming[myFrame] -
+ myFieldsLst[0].myTiming[myFrame-1]) / aOneVal;
+ myFileIndex += (long) (5*p);
+ } else {
+ myFileIndex += 5;
+ }
+ }
+
+ QString aFile = aDirPath + QDir::separator() + aBaseName;
+ aFile += "_";
+ aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0');
+ aFile += ".jpeg";
+
+ /* check image size is divisable 16
+ myView->dumpViewToFormat(aFile,"JPEG");
+ */
+ SUIT_ViewWindow* aView = myView;
+ QImage img = aView->dumpView();
+ if (!img.isNull()) {
+ int width = img.width(); width = (width/16)*16;
+ int height = img.height(); height = (height/16)*16;
+ QImage copy = img.copy(0, 0, width, height);
+ if (copy.save(aFile, "JPEG")) {
+ anIndexList.append(myFileIndex);
+ aNbFiles++;
+ }
+ }
}
}
}
// make AVI file if need
- if (isDumping && myDumpFormat.compare("AVI") == 0)
- {
+ if (isDumping && myDumpFormat.compare("AVI") == 0) {
double aFPS = 17.3 * mySpeed;
QFileInfo aFileInfo(myDumpPath);
QString aDirPath = aFileInfo.dirPath(true);
QString aBaseName = aFileInfo.fileName();
-#ifndef WNT
// add missing files
- if (anIndexList.count() > 1)
- {
+ if (anIndexList.count() > 1) {
QString aFFile = aDirPath + QDir::separator() + aBaseName;
aFFile += QString("_%1.jpeg");
int aStartIndex = anIndexList[0], anEndIndex;
- for (int i = 1; i < anIndexList.count(); i++)
- {
- anEndIndex = anIndexList[i];
- QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustify(8, '0'));
- QStringList aCommands;
- for (int j = aStartIndex+1; j < anEndIndex; j++)
- {
- QString aFile = aFFile.arg(QString::number(j).rightJustify(8, '0'));
- aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
- }
- system(aCommands.join(" ; \\\n").latin1());
- aStartIndex = anEndIndex;
+ for (int i = 1; i < anIndexList.count(); i++) {
+ anEndIndex = anIndexList[i];
+ QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustify(8, '0'));
+ QStringList aCommands;
+ for (int j = aStartIndex+1; j < anEndIndex; j++) {
+ QString aFile = aFFile.arg(QString::number(j).rightJustify(8, '0'));
+ aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+ }
+ system(aCommands.join(" ; \\\n").latin1());
+ aStartIndex = anEndIndex;
}
}
aCmd += " | xargs rm";
aCmd += " )";
system(aCmd.latin1());
-#else
-
- //create avi file
- IAVIFile *pfile;
- AVIFileInit();
- HRESULT hr = AVIFileOpen( &pfile, myDumpPath.latin1(), OF_WRITE|OF_CREATE, NULL );
- if ( hr!=AVIERR_OK )
- {
- AVIFileExit();
- QMessageBox::information( NULL, "INFO", "Can't Open Avi file", 1 );
- }
-
- if (anIndexList.count() > 1)
- {
- QString aFFile = aDirPath + QDir::separator() + aBaseName;
- aFFile += QString("_%1.bmp");
- int aStartIndex = anIndexList[0], anEndIndex;
-
- QImage anImage;
-
- IAVIStream *ps = 0;
- IAVIStream *psCompressed = 0;
- int index = 0;
-
- QStringList FileToDelete;
-
- for (int i = 1; i < anIndexList.count(); i++)
- {
- anEndIndex = anIndexList[i];
- QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustify(8, '0'));
-
- //load current image
- HBITMAP hbm=(HBITMAP)LoadImage(NULL,aCurFile.latin1(),IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION );
-
- DIBSECTION dibs; int sbm = GetObject(hbm,sizeof(dibs),&dibs);
- if ( sbm == 0 )
- {
- AVIFileExit();
- QMessageBox::information( NULL, "INFO", "BAD Param DIB", 1 );
- }
-
- for (int j = aStartIndex+1; j < anEndIndex; j++)
- {
- // if no avi stream - create it
- if ( !ps )
- {
- AVISTREAMINFO strhdr; ZeroMemory( &strhdr, sizeof( strhdr ) );
- strhdr.fccType = streamtypeVIDEO;// stream type
- strhdr.fccHandler = 0;
- strhdr.dwScale = 10;
- strhdr.dwRate = 173 * mySpeed;
- strhdr.dwSuggestedBufferSize = dibs.dsBmih.biSizeImage;
- SetRect(&strhdr.rcFrame, 0, 0, dibs.dsBmih.biWidth, dibs.dsBmih.biHeight);
- hr=AVIFileCreateStream( pfile, &ps, &strhdr );
- if ( hr!=AVIERR_OK )
- {
- AVIFileExit();
- QMessageBox::information( NULL, "INFO", "Can't create video stream", 1 );
- break;
- }
- }
- // if no avi compressed stream - create it
- if ( !psCompressed )
- {
- AVICOMPRESSOPTIONS opts; ZeroMemory( &opts, sizeof( opts ) );
- opts.fccHandler=mmioFOURCC('C','V','I','D');
- //opts.fccHandler=mmioFOURCC('M','P','4','2');
- //opts.dwQuality = -1;
- hr = AVIMakeCompressedStream( &psCompressed, ps, &opts, NULL );
- if ( hr != AVIERR_OK )
- {
- AVIFileExit();
- QMessageBox::information( NULL, "INFO", "Can't create video compressed stream", 1 );
- break;
- }
- hr = AVIStreamSetFormat( psCompressed, 0, &dibs.dsBmih, dibs.dsBmih.biSize+dibs.dsBmih.biClrUsed*sizeof(RGBQUAD));
- if ( hr != AVIERR_OK )
- {
- AVIFileExit();
- QMessageBox::information( NULL, "INFO", "Can't set format to compressed stream", 1 );
- break;
- }
- }
- // add image to avi stream
- hr = AVIStreamWrite( psCompressed, index, 1, dibs.dsBm.bmBits, dibs.dsBmih.biSizeImage, AVIIF_KEYFRAME, NULL, NULL);
- if ( hr!=AVIERR_OK )
- {
- AVIFileExit();
- QMessageBox::information( NULL, "INFO", "Can't add frame to stream ", 1 );
- break;
- }
- index++;
-
- }
- aStartIndex = anEndIndex;
- FileToDelete.append( aCurFile );
- }
-
- // close all streams and avi file
- AVIStreamRelease( psCompressed );
- AVIStreamRelease( ps );
- AVIFileRelease( pfile );
- AVIFileExit();
-
- //delete temporary pictures (bmp)
- system( QDir::convertSeparators(QString( "del %1_* /f /q" ).arg( myDumpPath )).latin1() );
- }
-#endif
}
emit stopped();
//------------------------------------------------------------------------
bool VISU_TimeAnimation::checkAVIMaker() const
{
-#ifndef WNT
QStrList aDumpFormats = QImageIO::outputFormats();
if (aDumpFormats.find("JPEG") < 0) return false;
aCmd += " >& /dev/null";
int iErr = system(aCmd.latin1());
return (iErr == 0);
-#else
- return true;
-#endif
}
//************************************************************************
anActor->GetProperty()->SetLineWidth(GetLineWidth());
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "vectors_represent", 1);
+ bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
anActor->SetRepresentation(aDispMode);
+ anActor->SetShading(toUseShading);
UpdateActor(anActor);
}catch(...){
anActor->Delete();
aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
if (nbPoints > 0 && xList && yList) {
- aSPlot2dC->setData( xList, yList, nbPoints );
+ aSPlot2dC->setData( xList, yList, nbPoints, zList );
}
if (!theCurve->IsAuto()) {
aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(),
aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
if ( nbPoints > 0 && xList && yList ) {
- aSPlot2dC->setData( xList, yList, nbPoints );
+ aSPlot2dC->setData( xList, yList, nbPoints, zList );
}
if ( !theCurve->IsAuto() ) {
aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth());
myApplication->setWindowShown(SalomeApp_Application::WT_LogWindow,myState);
break;
case VISU::View::VIEWER:{
- ViewManagerList aViewManagerList = myApplication->viewManagers();
- // to do something
- // ...
+ ViewManagerList mgrs = myApplication->viewManagers();
+ ViewManagerList::const_iterator anIt = mgrs.begin(), aLast = mgrs.end();
+ for( ; anIt!=aLast; anIt++ )
+ {
+ const QPtrVector<SUIT_ViewWindow>& views = (*anIt)->getViews();
+ for( int i=0; i<views.count(); i++ )
+ views[i]->setShown( myState );
+ }
break;
}}
}
static void SetFocalPoint (SUIT_ViewWindow* theViewWindow, const CORBA::Double theFocalPnt[3]);
virtual void SetFocalPoint (const VISU::View3D::XYZ theCoord);
- static void View3D_i::GetFocalPoint (SUIT_ViewWindow* theViewWindow, CORBA::Double theFocalPnt[3]);
+ static void GetFocalPoint (SUIT_ViewWindow* theViewWindow, CORBA::Double theFocalPnt[3]);
virtual VISU::View3D::XYZ_slice* GetFocalPoint();
static void SetParallelScale (SUIT_ViewWindow* theViewWindow, CORBA::Double theScale);
EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \
visu_table.py visu_big_table.py visu_view.py visu_delete.py \
- visu_swig_test.py test_events.py batch_test_events.py visu_split_views.py \
+ visu_swig_test.py visu_split_views.py \
VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py \
VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py
EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
%}
+/*
+ managing C++ exception in the Python API
+*/
+%exception
+{
+ class PyAllowThreadsGuard {
+ public:
+ // Py_BEGIN_ALLOW_THREADS
+ PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
+ // Py_END_ALLOW_THREADS
+ ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
+ private:
+ PyThreadState *_save;
+ };
+
+ PyAllowThreadsGuard guard;
+
+ $action
+}
+
class Convertor{
public:
Convertor(){};
View3D();
void Display(ScalarMap* theScalarMap);
void SetPosition(int theX, int theY);
-};
\ No newline at end of file
+};
print "OK"
return [aStudy, myViewManager, myView]
- raise RuntimeError, "Error: There is no shuch file."
+ raise RuntimeError, "Error: There is no such file."
def getMedSObject(theStudy = myLocalStudy ):
if theStudy is None:
//----------------------------------------------------------------------------
void VVTK_MainWindow::onDumpView()
{
+ QImage img = dumpView();
+ if( img.isNull() )
+ return;
+
SUIT_Application* app = SUIT_Session::session()->activeApplication();
QString fileName = app->getFileName( false, QString::null,
tr( "TLT_IMAGE_FILES" ),
if( fileName.isEmpty() )
return;
- QImage img = dumpView();
- if( img.isNull() )
- return;
-
QString fmt = SUIT_Tools::extension( fileName ).upper();
if( fmt.isEmpty() )
fmt = QString( "BMP" ); // default format
if ( accelAction == SUIT_Accel::ZoomFit )
onFitAll();
else {
- int anEvent = convertAction( accelAction );
+ int anEvent = SVTK::convertAction( accelAction );
InvokeEvent( anEvent, 0 );
}
}
if( aColor.isValid() )
mySelectionColorButton->setPaletteBackgroundColor( aColor );
}
+
+void VVTK_PickingDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onClickHelp();
+ }
+}
void* theCallData);
void KeyPressed();
+ void keyPressEvent( QKeyEvent* e );
private:
QtxDblSpinBox* myCursorSizeSpinBox;
myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
myMainTexture = aRootDir + "sprite_texture.bmp";
myAlphaTexture = aRootDir + "sprite_alpha.bmp";
void VVTK_PrimitiveBox::onBrowseMainTexture()
{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
if( aFileName.isNull() )
void VVTK_PrimitiveBox::onBrowseAlphaTexture()
{
- QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/";
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
QString aFileName = QFileDialog::getOpenFileName( aRootDir, "Bitmap (*.bmp *.jpg *.png)", this );
if( aFileName.isNull() )
return true;
}
+
+void VVTK_RecorderDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}
QString fileName() const { return myFileName; }
+private:
+ void keyPressEvent( QKeyEvent* e );
+
protected slots:
void onStart();
void onClose();
{
int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
vtkFloatingPointType aClamp = 200.0;
- QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
- QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
+ QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
+ QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
vtkFloatingPointType anAlphaThreshold = 0.1;
int aResolution = 8;
int aMinSize = 3;
{
vtkFloatingPointType aClamp = 256.0;
int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
- QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
- QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
+ QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
+ QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
vtkFloatingPointType anAlphaThreshold = 0.1;
int aResolution = 8;
int aSize = 25;
myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere &&
aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() );
}
+
+void VVTK_SegmentationCursorDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onClickHelp();
+ }
+}
unsigned long theEvent,
void* theClientData,
void* theCallData);
+
+ void keyPressEvent( QKeyEvent* e );
protected slots:
virtual void done( int );
SVTK_ViewWindow(theDesktop),
myMainWindow1(NULL),
myMainWindow2(NULL),
- myView2(NULL)
+ myView2(NULL),
+ myDumpImage(QImage())
{}
//----------------------------------------------------------------------------
::dumpView()
{
if( myMainWindow1->GetInteractor()->hasFocus() )
- return myMainWindow1->dumpView();
+ {
+ if ( myMainWindow1->getToolBar()->hasMouse() || myDumpImage.isNull() )
+ return myMainWindow1->dumpView();
+ else
+ return myDumpImage;
+ }
if( myMainWindow2->GetInteractor()->hasFocus() )
- return myMainWindow2->dumpView();
+ {
+ if ( myMainWindow1->getToolBar()->hasMouse() || myDumpImage.isNull() )
+ return myMainWindow2->dumpView();
+ else
+ return myDumpImage;
+ }
return QImage();
}
myMainWindow2->SetBackgroundColor( theColor );
}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::RefreshDumpImage()
+{
+ if( myMainWindow1->GetInteractor()->hasFocus() )
+ myDumpImage = myMainWindow1->dumpView();
+ else if ( myMainWindow2->GetInteractor()->hasFocus() )
+ myDumpImage = myMainWindow2->dumpView();
+}
#include "VVTK.h"
#include "SVTK_ViewWindow.h"
+#include <qimage.h>
+
#include <string>
class VVTK_MainWindow1;
setBackgroundColor( const QColor& );
//----------------------------------------------------------------------------
+
+ //! Refresh dump images of the viewers
+ virtual
+ void RefreshDumpImage();
+
public slots:
//! Redefine SVTK_ViewWindow::onSelectionChanged method
virtual
VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
SVTK_View* myView2; //!< The manage segmented view
+
+private:
+ QImage myDumpImage;
};
#ifdef WIN32