@COMMENCE@
-SUBDIRS = idl src doc
+SUBDIRS = idl src doc adm_local
BIN_SCRIPT= \
VERSION
--- /dev/null
+# source path
+top_srcdir=@top_srcdir@
+top_builddir=..
+srcdir=@srcdir@
+VPATH=.:$(srcdir)/adm_local
+
+
+all: resources
+
+install:
+ cp -rf @top_srcdir@/adm_local @prefix@
+
+bin:
+
+resources :
+ cp -rf @top_srcdir@/adm_local $(top_builddir)
+
+inc:
+
+lib:
+
+depend:
+
+depend_idl:
+
+install-end:
+
+install-include:
+
+install-bin:
+
+uninstall:
+
+uninstall-idl:
+
+distclean:
+
+clean:
+
+distclean-other:
+
+++ /dev/null
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#
-#------------------------------------------------------------
-# Check availability of Salome binary distribution
-#
-# Author : Marc Tajchman (CEA, 2002)
-#------------------------------------------------------------
-
-AC_DEFUN([CHECK_SALOME_GUI],[
-
-AC_CHECKING(for SalomeGUI)
-
-SalomeGUI_ok=yes
-
-AC_ARG_WITH(gui,
- --with-salome_gui=DIR root directory path of SALOME GUI installation,
- SALOME_GUI_DIR="$withval",SALOME_GUI_DIR="")
-
-if test "x$SALOME_GUI_DIR" = "x" ; then
- if test "x$GUI_ROOT_DIR" != "x" ; then
- SALOME_GUI_DIR=$GUI_ROOT_DIR
- else
- # search Salome binaries in PATH variable
- AC_PATH_PROG(TEMP, libSalomeApp.so)
- if test "x$TEMP" != "x" ; then
- SALOME_GUI_DIR=`dirname $TEMP`
- else
- fi
- fi
-fi
-
-if test -f ${SALOME_GUI_DIR}/lib/salome/libSalomeApp.so ; then
- SalomeGUI_ok=yes
- AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
- GUI_ROOT_DIR=${SALOME_GUI_DIR}
- AC_SUBST(GUI_ROOT_DIR)
-else
- AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
-fi
-
-AC_MSG_RESULT(for SALOME GUI: $SalomeGUI_ok)
-
-])dnl
-
+++ /dev/null
-# Check availability of Med binary distribution
-#
-# Author : Nicolas REJNERI (OPEN CASCADE, 2003)
-#
-
-AC_DEFUN([CHECK_MED],[
-
-AC_CHECKING(for Med)
-
-Med_ok=no
-
-AC_ARG_WITH(med,
- [ --with-med=DIR root directory path of MED installation ],
- MED_DIR="$withval",MED_DIR="")
-
-if test "x$MED_DIR" == "x" ; then
-
-# no --with-med-dir option used
-
- if test "x$MED_ROOT_DIR" != "x" ; then
-
- # MED_ROOT_DIR environment variable defined
- MED_DIR=$MED_ROOT_DIR
-
- fi
-#
-fi
-
-if test -f ${MED_DIR}/idl/salome/MED.idl ; then
- Med_ok=yes
- AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
-
- if test "x$MED_ROOT_DIR" == "x" ; then
- MED_ROOT_DIR=${MED_DIR}
- fi
- AC_SUBST(MED_ROOT_DIR)
-
-else
- AC_MSG_WARN("Cannot find Med module sources")
-fi
-
-AC_MSG_RESULT(for Med: $Med_ok)
-
-])dnl
-
--- /dev/null
+###########################################################
+# File : check_Visu.m4
+# Author : Vadim SANDLER (OCN)
+# Created : 13/07/05
+# Copyright (C) 2005 Open CASCADE
+# Check availability of VISU binary distribution
+###########################################################
+
+AC_DEFUN([CHECK_VISU],[
+
+AC_CHECKING(for VISU)
+
+Visu_ok=no
+
+AC_ARG_WITH(visu,
+ [ --with-visu=DIR root directory path of VISU module installation ],
+ VISU_DIR="$withval",VISU_DIR="")
+
+if test "x$VISU_DIR" == "x" ; then
+ # no --with-visu-dir option used
+ if test "x$VISU_ROOT_DIR" != "x" ; then
+ # VISU_ROOT_DIR environment variable defined
+ VISU_DIR=$VISU_ROOT_DIR
+ fi
+fi
+
+if test -f ${VISU_DIR}/idl/salome/VISU_Gen.idl ; then
+ Visu_ok=yes
+ AC_MSG_RESULT(Using VISU module distribution in ${VISU_DIR})
+
+ if test "x$VISU_ROOT_DIR" == "x" ; then
+ VISU_ROOT_DIR=${VISU_DIR}
+ fi
+ AC_SUBST(VISU_ROOT_DIR)
+else
+ AC_MSG_WARN("Cannot find VISU module sources")
+fi
+
+AC_MSG_RESULT(for VISU: $Visu_ok)
+
+])dnl
+
# BOOST Library
BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LIBSUFFIX = @BOOST_LIBSUFFIX@
BOOST_LIBS = @BOOST_LIBS@
# JAVA
ACLOCAL_SRC = \
-ac_cxx_bool.m4 check_corba.m4 check_vtk.m4 \
+ac_cxx_bool.m4 check_corba.m4 \
ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \
ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \
ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \
-ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \
+ac_cxx_partial_specialization.m4 python.m4 \
ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \
-ac_cc_warnings.m4 check_qt.m4 check_swig.m4
+ac_cc_warnings.m4 check_swig.m4
-$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%)
- cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files
+ACLOCAL_GUI = \
+check_vtk.m4 check_opengl.m4 check_qt.m4 \
+check_GUI.m4 check_corba_in_GUI.m4
+
+ACLOCAL_MED = check_Med.m4
+
+$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
+ $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \
+ $(ACLOCAL_MED:%=@MED_ROOT_DIR@/adm_local/unix/config_files/%)
+ cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
+ -I @GUI_ROOT_DIR@/adm_local/unix/config_files \
+ -I @MED_ROOT_DIR@/adm_local/unix/config_files
# echo "failed : KERNEL_SRC variable is not correct !"
# exit
#fi
+########################################################################
+# Test if the GUI_ROOT_DIR is set correctly
+
+if test ! -d "${GUI_ROOT_DIR}"; then
+ echo "failed : GUI_ROOT_DIR variable is not correct !"
+ exit
+fi
+
+########################################################################
+# Test if the MED_ROOT_DIR is set correctly
+
+if test ! -d "${MED_ROOT_DIR}"; then
+ echo "failed : MED_ROOT_DIR variable is not correct !"
+ exit
+fi
+
########################################################################
# find_in - utility function
#
echo -n "Creating 'configure' script ... "
fi
-aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${MED_ROOT_DIR}/adm_local/unix/config_files
if autoconf
then
echo "done"
CHECK_HTML_GENERATORS
+echo
+echo ---------------------------------------------
+echo Testing GUI
+echo ---------------------------------------------
+echo
+
+CHECK_SALOME_GUI
+
+echo
+echo ---------------------------------------------
+echo Testing full GUI
+echo ---------------------------------------------
+echo
+
+CHECK_CORBA_IN_GUI
+if test "x${CORBA_IN_GUI}" != "xyes"; then
+ echo "failed : For configure VISU module necessary full GUI !"
+ exit
+fi
+
echo
echo ---------------------------------------------
echo Testing Kernel
*/
double GetScale();
+ /*!
+ * Sets the scalar field
+ * \param theMeshName - mesh name
+ * \param theFieldName - the name of scalar field
+ * \param theIteration - the iteration number for scalar field
+ * \param theEntity - entity of scalar field
+ */
+ void SetScalarField(in string theMeshName,in string theFieldName,
+ in long theIteration,in Entity theEntity);
+
};
//-------------------------------------------------------
/*!
in Entity theEntity, in string theFieldName,
in double theIteration);
+ /*!
+ * Creates a deformed shape presentation.
+ * \param theResult Data generated in other sources. (MED object or file)
+ * \param theMeshName One of the meshes presented in MED file
+ * \param theEntity Type of entity where the field is defined
+ * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
+ * \param theIteration Number of iteration on the field
+ */
+ ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
+ in Entity theEntity, in string theFieldName,
+ in double theIteration);
+
/*!
* Creates a vector presentation.
* \param theResult Data generated in other sources. (MED object or file)
BIN = VISUConvertor
BIN_SRC =
-CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
+CPPFLAGS+= -ftemplate-depth-32 \
+ $(VTK_INCLUDES) \
+ $(HDF5_INCLUDES) \
+ $(QT_INCLUDES) \
+ $(OCC_INCLUDES) \
+ $(OCC_CXXFLAGS) \
-I${KERNEL_ROOT_DIR}/include/salome \
-I${MED_ROOT_DIR}/include/salome \
-I${GUI_ROOT_DIR}/include/salome \
$(BOOST_CPPFLAGS)
-LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) \
- $(BOOST_LIBS) -lboost_thread-mt \
+LDFLAGS+= $(VTK_LIBS) \
+ $(QT_LIBS) \
+ $(CAS_KERNEL) \
+ $(CAS_MATH) \
+ $(BOOST_LIBS) -lboost_thread${BOOST_LIBSUFFIX} \
-L${MED_ROOT_DIR}/lib/salome -lMEDWrapper \
-L${GUI_ROOT_DIR}/lib/salome -lVTKViewer
if(myIsAll)
return myMeshOnEntity->GetElemObjID(theID);
- vtkIdType anInputID;
+ vtkIdType anInputID, aStartID, anInputDataSetID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID);
- PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID];
- return aSubProfileImpl->GetElemObjID(aID);
+ anAppendFilter->GetCellInputID(theID,anInputID,aStartID,anInputDataSetID);
+ PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputDataSetID];
+ return aSubProfileImpl->GetElemObjID(anInputID);
}
vtkIdType
if(myIsAll)
return myMeshOnEntity->GetElemName(theObjID);
- vtkIdType anInputID;
vtkIdType aVTKId = GetElemVTKID(theObjID);
+ vtkIdType anInputID, aStartID, anInputDataSetID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID);
- PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID];
- vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(aSubID);
+ anAppendFilter->GetCellInputID(aVTKId,anInputID,aStartID,anInputDataSetID);
+ PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputDataSetID];
+ vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(anInputID);
return myMeshOnEntity->GetElemName(anEntityObjId);
}
TGaussPointID
TGaussSubMeshImpl
- ::GetObjID(vtkIdType theID) const
+ ::GetObjID(vtkIdType theID,
+ vtkIdType theStartID) const
{
- TCellID aCellID = theID / myGauss->myNbPoints;
+ TCellID aCellID = theStartID + theID / myGauss->myNbPoints;
TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
return TGaussPointID(aCellID,aLocalPntID);
TGaussMeshImpl
::GetObjID(vtkIdType theID) const
{
+ vtkIdType anInputID, aStartId, anInputDataSetID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType anInputDataSetID;
- vtkIdType anInputID = anAppendFilter->GetCellInputID(theID,anInputDataSetID);
+ anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID);
const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anInputDataSetID];
- return aSubMeshImpl.GetObjID(anInputID);
+ return aSubMeshImpl.GetObjID(anInputID,aStartId);
}
TVTKOutput*
TMeshOnEntityImpl
::GetElemObjID(vtkIdType theID) const
{
- vtkIdType anInputID;
+ vtkIdType anInputID, aStartId, anInputDataSetID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID);
- const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID];
- return aSubMesh->GetElemObjID(aID);
+ anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID);
+ const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID];
+ return aSubMesh->GetElemObjID(anInputID);
}
std::string
::GetElemName(vtkIdType theObjID) const
{
vtkIdType aVTKId = GetElemVTKID(theObjID);
- vtkIdType anInputID;
+ vtkIdType anInputID, aStartId, anInputDataSetID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID);
- const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID];
- return aSubMesh->GetElemName(aSubID);
+ anAppendFilter->GetCellInputID(aVTKId,anInputID,aStartId,anInputDataSetID);
+ const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID];
+ return aSubMesh->GetElemName(anInputID);
}
//---------------------------------------------------------------
TGroupImpl
::GetElemObjID(vtkIdType theID) const
{
- vtkIdType anInputID;
+ vtkIdType anInputID, aStartId, anInputDataSetID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType anID = anAppendFilter->GetCellInputID(theID,anInputID);
- const PFamilyImpl& aFamily = myFamilyArr[anInputID];
- return aFamily->GetElemObjID(anID);
+ anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID);
+ const PFamilyImpl& aFamily = myFamilyArr[anInputDataSetID];
+ return aFamily->GetElemObjID(anInputID);
}
vtkIdType
//! To implement the TGaussPtsIDMapper::GetObjID
virtual
TGaussPointID
- GetObjID(vtkIdType theID) const;
+ GetObjID(vtkIdType theID,
+ vtkIdType theStartID) const;
PGaussImpl myGauss; //<! Keep reference to corresponding TGauss structure
#include "MED_GaussUtils.hxx"
#include "MED_Utilities.hxx"
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
+#include "CASCatch.hxx"
#include <vtkCellType.h>
//---------------------------------------------------------------
TGaussPointID
TMEDGaussSubMesh
- ::GetObjID(vtkIdType theID) const
+ ::GetObjID(vtkIdType theID,
+ vtkIdType theStartID) const
{
- TInt aNbPoints = myGauss->myNbPoints;
- TCellID aCellID = theID / aNbPoints;
+ TCellID aCellID = theID / myGauss->myNbPoints;
+ TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
+
if(myIsElemNum)
aCellID = myElemNum[aCellID];
-
- TLocalPntID aLocalPntID = theID % aNbPoints;
+ else
+ aCellID += theStartID;
return TGaussPointID(aCellID,aLocalPntID);
}
::Init(const MED::PElemInfo& theElemInfo)
{
myIsElemNum = theElemInfo->IsElemNum();
- myElemNum = theElemInfo->myElemNum;
+
+ if(myIsElemNum)
+ myElemNum = theElemInfo->myElemNum;
+
if(theElemInfo->IsElemNames())
myElemInfo = theElemInfo;
}
VISU_Convertor*
CreateConvertor(const string& theFileName)
{
- if(MED::PWrapper aMed = MED::CrWrapper(theFileName))
+ if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
return new VISU_MedConvertor(theFileName);
return NULL;
}
INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
#ifndef _DEXCEPT_
- try{
+ CASCatch_TRY{
+ try{
#endif
- MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- iTimeStamp);
-
- MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
- aMKey2Profile,
- aKey2Gauss);
-
- const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
-
- const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
-
- const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
- MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
- for(; anIter != aGeom2Value.end(); anIter++){
- const MED::TMeshValue& aMMeshValue = anIter->second;
- MED::EGeometrieElement aMGeom = anIter->first;
+ MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
+ aMEntity,
+ aGeom2Size,
+ iTimeStamp);
- TInt aNbElem = aMMeshValue.myNbElem;
- TInt aNbGauss = aMMeshValue.myNbGauss;
+ MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
+ aMKey2Profile,
+ aKey2Gauss);
- MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
- if(aGaussIter == aGeom2Gauss.end())
- aNbGauss = 1;
+ const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- endl);
+ const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
- // To calculate min/max per components
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
- for(TInt iComp = 0; iComp < aNbComp; iComp++){
- const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
- TMinMax& aMinMax = aMinMaxArr[iComp+1];
- float& aMin = aMinMax.first;
- float& aMax = aMinMax.second;
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const float& aVal = aMValueSlice[iGauss];
- aMin = min(aMin,aVal);
- aMax = max(aMax,aVal);
+ const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
+ MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
+ for(; anIter != aGeom2Value.end(); anIter++){
+ const MED::TMeshValue& aMMeshValue = anIter->second;
+ MED::EGeometrieElement aMGeom = anIter->first;
+
+ TInt aNbElem = aMMeshValue.myNbElem;
+ TInt aNbGauss = aMMeshValue.myNbGauss;
+
+ MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+ if(aGaussIter == aGeom2Gauss.end())
+ aNbGauss = 1;
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
+
+ // To calculate min/max per components
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
+ for(TInt iComp = 0; iComp < aNbComp; iComp++){
+ const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
+ TMinMax& aMinMax = aMinMaxArr[iComp+1];
+ float& aMin = aMinMax.first;
+ float& aMax = aMinMax.second;
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const float& aVal = aMValueSlice[iGauss];
+ aMin = min(aMin,aVal);
+ aMax = max(aMax,aVal);
+ }
}
}
- }
-
- // To calculate min/max per vector modulus
- TMinMax& aMinMax = aMinMaxArr[0];
- float& aMin = aMinMax.first;
- float& aMax = aMinMax.second;
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
- float aValue = 0.0;
- for(TInt iComp = 0; iComp < aNbComp2; iComp++){
- float aVal = aMValueSlice[iComp];
- aValue += aVal*aVal;
+
+ // To calculate min/max per vector modulus
+ TMinMax& aMinMax = aMinMaxArr[0];
+ float& aMin = aMinMax.first;
+ float& aMax = aMinMax.second;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
+ float aValue = 0.0;
+ for(TInt iComp = 0; iComp < aNbComp2; iComp++){
+ float aVal = aMValueSlice[iComp];
+ aValue += aVal*aVal;
+ }
+ aValue = sqrt(aValue);
+ aMin = min(aMin,aValue);
+ aMax = max(aMax,aValue);
}
- aValue = sqrt(aValue);
- aMin = min(aMin,aValue);
- aMax = max(aMax,aValue);
}
}
- }
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
- }catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ }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
}
"; aNbGauss = "<<aNbGauss<<
"; aNbCells = "<<aNbCells<<
endl);
- }
+ }else
+ EXCEPTION(runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
}
aGaussMesh->myIsDone = true;
virtual
TGaussPointID
- GetObjID(vtkIdType theID) const;
+ GetObjID(vtkIdType theID,
+ vtkIdType theStartID) const;
};
typedef SharedPtr<TMEDGaussSubMesh> PMEDGaussSubMesh;
return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
+ ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Double theIteration)
+ {
+ return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+ }
Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult,
const char* theMeshName,
const char* theFieldName, CORBA::Double theIteration);
virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
+ virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, CORBA::Double theIteration);
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
@COMMENCE@
EXPORT_HEADERS = \
+ VISU_BoostSignals.h \
VISU_ActorFactory.h \
VISU_GaussPtsSettings.h \
VISU_GaussPtsActorFactory.h \
-L${KERNEL_ROOT_DIR}/lib/salome
LIBS+= \
- -lboost_signals-mt \
+ -lboost_signals${BOOST_LIBSUFFIX} \
-lSalomeObject \
-lVisuPipeLine \
-lSVTK
#include "SALOME_Actor.h"
#include "VISU_ActorFactory.h"
+#include "VISU_BoostSignals.h"
#include <string>
#include <vtkSmartPointer.h>
-#include <boost/signals/signal1.hpp>
-#include <boost/signals/trackable.hpp>
class vtkProp;
class vtkProperty;
//----------------------------------------------------------------------------
class VTKOCC_EXPORT VISU_Actor :
public SALOME_Actor,
- public boost::bsignals::trackable
+ public boost::signalslib::trackable
{
public:
vtkTypeMacro(VISU_Actor,SALOME_Actor);
#ifndef VISU_ACTOR_FACTORY_H
#define VISU_ACTOR_FACTORY_H
-#include <boost/signals/trackable.hpp>
+#include "VISU_BoostSignals.h"
class VISU_Actor;
This interface inherits from boost::bsignals::trackable in order to provide automatic
diconnection from defined signals if the object is destroyed.
*/
- struct TActorFactory: public virtual boost::bsignals::trackable
+ struct TActorFactory: public virtual boost::signalslib::trackable
{
//! Just to make this class virtual
virtual
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File :
+// Author :
+// Module : VISU
+// $Header$
+
+#ifndef VISU_BOOST_SIGNALS_H
+#define VISU_BOOST_SIGNALS_H
+
+#ifdef signals
+# ifndef QOBJECTDEFS_H
+# error "Cannot recover the siganlas macro definition"
+# else
+# define EXTERNAL_SIGNALS_DEFINITION
+# undef signals
+# endif
+#endif
+
+#include <boost/signals.hpp>
+
+namespace boost {
+ namespace signalslib = BOOST_SIGNALS_NAMESPACE;
+}
+
+#ifdef EXTERNAL_SIGNALS_DEFINITION
+# undef EXTERNAL_SIGNALS_DEFINITION
+# ifdef QT_MOC_CPP
+# define signals signals
+# else
+# define signals protected
+# endif
+#endif
+
+#endif //VISU_BOOST_SIGNALS_H
case 'M' :
case 'm' :
{
- if( myWidgetCtrl->GetEnabled() )
+ if( IsSegmentationEnabled() )
{
this->ChangeMagnification( myInteractor->GetShiftKey() );
return;
case 'D' :
case 'd' :
{
- if( myWidgetCtrl->GetEnabled() && myWidgetCtrl->IsSphereActive() )
+ if( IsSegmentationEnabled() && myWidgetCtrl->IsSphereActive() )
{
VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget();
aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() );
return;
myOutlineActor->SetVisibility(false);
- myTextActor->SetVisibility(0);
- myCursorPyramidSelected->SetVisibility(0);
- myCursorPyramid->SetVisibility(0);
- myCellActor->SetVisibility(0);
+ myTextActor->SetVisibility(false);
+ myCursorPyramidSelected->SetVisibility(false);
+ myCursorPyramid->SetVisibility(false);
+ myCellActor->SetVisibility(false);
GetScalarBarCtrl()->SetIsMarked(false);
GetScalarBarCtrl()->Update();
+ if(!theIsHighlight)
+ return;
+
bool anIsVisible = GetVisibility();
Selection_Mode aSelectionMode = mySelector->SelectionMode();
vtkStandardNewMacro(VISU_CutLinesPL);
-VISU_CutLinesPL::VISU_CutLinesPL(){}
+VISU_CutLinesPL::VISU_CutLinesPL(){
+ myCondition = 1;
+ myPosition = 0;
+}
void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
if(VISU_CutLinesPL *aPipeLine = dynamic_cast<VISU_CutLinesPL*>(thePipeLine)){
VISU_CutPlanesPL::VISU_CutPlanesPL(){
myAppendPolyData = vtkAppendPolyData::New();
myIsShrinkable = false;
+
+ myNbParts = 10;
+
+ myBasePlane[0] = YZ;
+ myBasePlane[0] = XY;
+
+ myDisplacement[0] = myDisplacement[1] = 0.5;
+
+ myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0;
+ myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0;
}
VISU_CutPlanesPL::~VISU_CutPlanesPL(){
# .po files to transform in .qm
PO_FILES = \
- VISU_msg_en.po VISU_images.po VISUM_msg_en.po VISUM_images.po
+ VISU_msg_en.po VISU_images.po
# Libraries targets
LIB = libVISU.la
+++ /dev/null
-# VISU VISUGUI : GUI of VISU component
-#
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#
-#
-#
-# File : VisuGUI_icons.po
-# Module : VISU
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: 2005-05-10 15:20+0400\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-msgid "ICON_GAUSS_NEW_VIEWER"
-msgstr "Visu_points.png"
-
-msgid "ICON_GAUSS_POINTS"
-msgstr "Visu_gauss_points.png"
-
-msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH"
-msgstr "Visu_vvtk_switch.png"
-
-msgid "ICON_VVTK_SELECTION_MODE_SWITCH"
-msgstr "Visu_points.png"
-
-msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH"
-msgstr "Visu_PlaneSegmentation.png"
-
-msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"
-msgstr "Visu_SphereSegmentation.png"
-
-msgid "ICON_VVTK_RECORDING_START"
-msgstr "Visu_recording_start.png"
-
-msgid "ICON_VVTK_RECORDING_PLAY"
-msgstr "Visu_recording_play.png"
-
-msgid "ICON_VVTK_RECORDING_PAUSE"
-msgstr "Visu_recording_pause.png"
-
-msgid "ICON_VVTK_RECORDING_STOP"
-msgstr "Visu_recording_stop.png"
-
-msgid "ICON_LOAD_TEXTURE"
-msgstr "Visu_load_texture.png"
+++ /dev/null
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2005-06-27 12:38+0400\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "INF_VISU"
-msgstr "Post-Pro Info"
-
-msgid "IMPORT_DONE"
-msgstr "Importing is done"
-
-msgid "VisuGUI_Module::MEN_VISUALISATION"
-msgstr "Visualization"
-
-msgid "VisuGUI_Module::TOOL_VISUALISATION"
-msgstr "Visualization Toolbar"
-
-msgid "VisuGUI_Module::MEN_SAVE_CONFIGURATION"
-msgstr "Store current configuration"
-
-msgid "VisuGUI_Module::MEN_OVERWRITE_CONFIGURATION"
-msgstr "Overwrite current configuration"
-
-msgid "VisuGUI_Module::MEN_RESTORE_CONFIGURATION"
-msgstr "Restore current configuration"
-
-msgid "VisuGUI_Module::MEN_GAUSS"
-msgstr "Gauss"
-
-msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER"
-msgstr "Points view"
-
-msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS"
-msgstr "Gauss Points"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TTL"
-msgstr "Gauss Points"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL"
-msgstr "Primitive"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE"
-msgstr "Primitive Type"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE"
-msgstr "Point sprite"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT"
-msgstr "OpenGL point"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE"
-msgstr "Geometrical sphere"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP"
-msgstr "Maximum Size (Clamp)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAIN_TEXTURE"
-msgstr "Main Texture (16x16)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_TEXTURE"
-msgstr "Alpha Channel Texture (16x16)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_THRESHOLD"
-msgstr "Alpha Channel Threshold"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_RESOLUTION"
-msgstr "Geometrical sphere resolution"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_FACE_LIMIT"
-msgstr "Notify when number of faces exceeds"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE_GROUP_TTL"
-msgstr "Size"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_MIN_SIZE"
-msgstr "Range value for min size (%)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAX_SIZE"
-msgstr "Range value for max size (%)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION"
-msgstr "Magnification (%)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_INCREMENT"
-msgstr "+/- Ratio"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOM_GROUP_TTL"
-msgstr "Geometry"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE"
-msgstr "Size of points (%)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR"
-msgstr "Color"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL"
-msgstr "Deformed Shape"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALE_FACTOR"
-msgstr "Scale factor"
-
-msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL"
-msgstr "Gauss Points Scalar Bar"
-
-msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL"
-msgstr "Gauss Points Scalar Bar"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_ACTIVE_BAR"
-msgstr "Active bar"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_LOCAL"
-msgstr "Local"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_GLOBAL"
-msgstr "Global"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_DISPLAY_GLOBAL"
-msgstr "Display global bar"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALAR_BAR_MODE"
-msgstr "Scalar bar mode"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_BICOLOR"
-msgstr "Bicolor"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_RAINBOW"
-msgstr "Rainbow"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_SPACING"
-msgstr "Spacing"
-
-msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL"
-msgstr "Inside Cursor"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL"
-msgstr "Magnification (Inside and Outside)"
-
-msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL"
-msgstr "Outside Cursor"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR"
-msgstr "Uniform Color"
-
-msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL"
-msgstr "Color"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_TAB_TTL"
-msgstr "Picking"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL"
-msgstr "Cursor"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE"
-msgstr "Size of the cursor"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT"
-msgstr "Height of the pyramids"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_SELECTION_COLOR"
-msgstr "Selection cursor color"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_TOLERANCE_GROUP_TTL"
-msgstr "Tolerance"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE"
-msgstr "Point selection tolerance"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL"
-msgstr "Information window"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_TRANSPARENCY"
-msgstr "Transparency"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_POSITION"
-msgstr "Position"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_BELOW_POINT"
-msgstr "Centered below the point"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_TOP_LEFT_CORNER"
-msgstr "Top-left corner of the 3D view"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_CAMERA_GROUP_TTL"
-msgstr "Movement of the camera"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_ZOOM_FACTOR"
-msgstr "Zoom at first selected point (ratio)"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_STEP_NUMBER"
-msgstr "Number of steps between two positions"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_PARENT_MESH_TTL"
-msgstr "Parent mesh element"
-
-msgid "VisuGUI_Module::VISU_PICKING_PREF_DISPLAY_PARENT_MESH"
-msgstr "Display parent mesh element"
-
-msgid "VisuGUI_Module::VISU_MOUSE_PREF_TAB_TLT"
-msgstr "Navigation"
-
-msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT"
-msgstr "Mouse"
-
-msgid "VisuGUI_Module::VISU_MOUSE_PREF"
-msgstr "Mouse behaviour"
-
-msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD"
-msgstr "Salome standard controls"
-
-msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE"
-msgstr "Keyboard free"
-
-msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL"
-msgstr "Keyboard"
-
-msgid "VisuGUI_Module::VISU_KEYBOARD_PREF"
-msgstr "[+]/[-] Speed increment"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF"
-msgstr "Spacemouse"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1"
-msgstr "Decrease speed increment"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2"
-msgstr "Increase speed increment"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3"
-msgstr "Decrease Gauss points magnification"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4"
-msgstr "Increase Gauss points magnification"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5"
-msgstr "Dominant / combined switch"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1"
-msgstr "Button 1"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2"
-msgstr "Button 2"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3"
-msgstr "Button 3"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4"
-msgstr "Button 4"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5"
-msgstr "Button 5"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6"
-msgstr "Button 6"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7"
-msgstr "Button 7"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8"
-msgstr "Button 8"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10"
-msgstr "Button 10"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11"
-msgstr "Button 11"
-
-msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*"
-msgstr "Button *"
-
-msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL"
-msgstr "Camera movements"
-
-msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF"
-msgstr "Number of steps between two positions"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_TAB_TTL"
-msgstr "Recorder"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_GROUP_TTL"
-msgstr "Settings"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_RECORDING_MODE"
-msgstr "Mode"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_SKIPPED_FRAMES"
-msgstr "Recording at a given FPS"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES"
-msgstr "Recording all displayed frames"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_FPS"
-msgstr "FPS"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_QUALITY"
-msgstr "Quality"
-
-msgid "VisuGUI_Module::VISU_RECORDER_PREF_PROGRESSIVE"
-msgstr "Progressive"
-
-msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE"
-msgstr "Gauss Points Preferences"
-
-msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE"
-msgstr "Gauss Points Properties"
-
-msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE"
-msgstr "Build progress"
-
-msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS"
-msgstr "Settings"
-
-msgid "VisuGUI_BuildProgressDlg::FILE_NAME"
-msgstr "Import file : "
-
-msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE"
-msgstr "Build at once"
-
-msgid "VisuGUI_BuildProgressDlg::BUILD_ALL"
-msgstr "Build all"
-
-msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS"
-msgstr "Import progress"
-
-msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES"
-msgstr "Build entities"
-
-msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS"
-msgstr "Build fields"
-
-msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS"
-msgstr "Build groups"
-
-msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX"
-msgstr "Build min/max"
-
-msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME"
-msgstr "Time"
-
-msgid "VisuGUI_BuildProgressDlg::TIME"
-msgstr "Elapsed time : "
-
-msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE"
-msgstr "Import from File"
-
-msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES"
-msgstr "All Files (*.*)"
-
-msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES"
-msgstr "MED Files (*.med)"
-
-msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH"
-msgstr "Close dialog at finish"
-
-msgid "VisuGUI_BuildProgressDlg::START"
-msgstr "Start"
-
-msgid "VisuGUI_BuildProgressDlg::CLOSE"
-msgstr "Close"
-
-msgid "VVTK_RecorderDlg::DLG_RECORDER_TITLE"
-msgstr "Recorder"
-
-msgid "VVTK_RecorderDlg::SETTINGS"
-msgstr "Settings"
-
-msgid "VVTK_RecorderDlg::FILE_NAME"
-msgstr "Save to file : "
-
-msgid "VVTK_RecorderDlg::FLT_ALL_FILES"
-msgstr "All Files (*.*)"
-
-msgid "VVTK_RecorderDlg::FLT_AVI_FILES"
-msgstr "AVI Files (*.avi)"
-
-msgid "VVTK_RecorderDlg::RECORDING_MODE"
-msgstr "Mode : "
-
-msgid "VVTK_RecorderDlg::SKIPPED_FRAMES"
-msgstr "Recording at a given FPS"
-
-msgid "VVTK_RecorderDlg::ALL_DISLPAYED_FRAMES"
-msgstr "Recording all displayed frames"
-
-msgid "VVTK_RecorderDlg::FPS"
-msgstr "FPS : "
-
-msgid "VVTK_RecorderDlg::QUALITY"
-msgstr "Quality : "
-
-msgid "VVTK_RecorderDlg::PROGRESSIVE"
-msgstr "Progressive"
-
-msgid "VVTK_RecorderDlg::START"
-msgstr "Start"
-
-msgid "VVTK_RecorderDlg::CLOSE"
-msgstr "Close"
-
-msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TITLE"
-msgstr "Change Transparency"
-
-msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TRANSPARENT"
-msgstr "Transparent"
-
-msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_OPAQUE"
-msgstr "Opaque"
-
-msgid "VisuGUI_TransparencyDlg::BUT_CLOSE"
-msgstr "Close"
-
-msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
-msgstr "VISU scene:%1 - viewer:%2"
-
-msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START"
-msgstr "Start recording"
-
-msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START"
-msgstr "Start recording"
-
-msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY"
-msgstr "Play recording"
-
-msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY"
-msgstr "Play recording"
-
-msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE"
-msgstr "Pause recording"
-
-msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE"
-msgstr "Pause recording"
-
-msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP"
-msgstr "Stop recording"
-
-msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP"
-msgstr "Stop recording"
-
-msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
-msgstr "Interaction Style Switch"
-
-msgid "VVTK_MainWindow1::DSC_VVTK_INTERACTOR_STYLE_SWITCH"
-msgstr "Interaction Style Switch"
-
-msgid "VVTK_MainWindow1::MNU_VVTK_SELECTION_MODE_SWITCH"
-msgstr "Selection Mode Switch"
-
-msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH"
-msgstr "Selection Mode Switch"
-
-msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH"
-msgstr "Plane Segmentation"
-
-msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH"
-msgstr "Plane Segmentation"
-
-msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"
-msgstr "Sphere Segmentation"
-
-msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"
-msgstr "Sphere Segmentation"
-
-msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE"
-msgstr "Primitive"
-
-msgid "VVTK_PrimitiveBox::POINT_SPRITE"
-msgstr "Point Sprite"
-
-msgid "VVTK_PrimitiveBox::OPENGL_POINT"
-msgstr "OpenGL Point"
-
-msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE"
-msgstr "Geometrical Sphere"
-
-msgid "VVTK_PrimitiveBox::CLAMP"
-msgstr "Maximum Size (Clamp) : "
-
-msgid "VVTK_PrimitiveBox::MAIN_TEXTURE"
-msgstr "Main Texture (16x16) : "
-
-msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE"
-msgstr "Alpha Channel Texture (16x16) : "
-
-msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD"
-msgstr "Alpha Channel Threshold : "
-
-msgid "VVTK_PrimitiveBox::RESOLUTION"
-msgstr "Resolution : "
-
-msgid "VVTK_PrimitiveBox::FACE_NUMBER"
-msgstr "Number of faces : "
-
-msgid "VVTK_PrimitiveBox::FACE_LIMIT"
-msgstr "Notify when number of faces exceeds : "
-
-msgid "VVTK_SizeBox::SIZE_TITLE"
-msgstr "Size"
-
-msgid "VVTK_SizeBox::OUTSIDE_SIZE"
-msgstr "Percentage of normal size(%) : "
-
-msgid "VVTK_SizeBox::GEOM_SIZE"
-msgstr "Size of points (%) : "
-
-msgid "VVTK_SizeBox::MIN_SIZE"
-msgstr "Range values for min size (%) : "
-
-msgid "VVTK_SizeBox::MAX_SIZE"
-msgstr "max size (%) : "
-
-msgid "VVTK_SizeBox::MAGNIFICATION"
-msgstr "Magnification (%) : "
-
-msgid "VVTK_SizeBox::INCREMENT"
-msgstr "+/- Ratio : "
-
-msgid "VVTK_SizeBox::COLOR_TITLE"
-msgstr "Color"
-
-msgid "VVTK_SizeBox::UNIFORM_COLOR"
-msgstr "Uniform Color"
-
-msgid "VVTK_SizeBox::COLOR"
-msgstr "Color : "
-
-msgid "VisuGUI_GaussPointsDlg::&Cancel"
-msgstr ""
-
-msgid "VisuGUI_GaussPointsDlg::&OK"
-msgstr ""
-
-msgid "VisuGUI_GaussPointsDlg::WARNING"
-msgstr "Warning"
-
-msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
-msgstr "Gauss Points"
-
-msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
-msgstr "Gauss Points"
-
-msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
-msgstr "Scalar Bar"
-
-msgid "VisuGUI_GaussPointsDlg::PRS_TITLE"
-msgstr "Presentation"
-
-msgid "VisuGUI_GaussPointsDlg::RESULTS"
-msgstr "Results"
-
-msgid "VisuGUI_GaussPointsDlg::GEOMETRY"
-msgstr "Geometry"
-
-msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE"
-msgstr "Deformed Shape"
-
-msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE_TITLE"
-msgstr "Deformed Shape"
-
-msgid "VisuGUI_GaussPointsDlg::SCALE_FACTOR"
-msgstr "Scale Factor :"
-
-msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP"
-msgstr "Active bar"
-
-msgid "VisuGUI_GaussScalarBarPane::LOCAL"
-msgstr "Local"
-
-msgid "VisuGUI_GaussScalarBarPane::GLOBAL"
-msgstr "Global"
-
-msgid "VisuGUI_GaussScalarBarPane::DISPLAYED"
-msgstr "Displayed"
-
-msgid "VisuGUI_GaussScalarBarPane::SCALAR_RANGE_GRP"
-msgstr "Scalar range"
-
-msgid "VisuGUI_GaussScalarBarPane::LOGARITHMIC_SCALING"
-msgstr "Logarithmic scaling"
-
-msgid "VisuGUI_GaussScalarBarPane::FIELD_RANGE_BTN"
-msgstr "Use field range"
-
-msgid "VisuGUI_GaussScalarBarPane::IMPOSED_RANGE_BTN"
-msgstr "Use imposed range"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_MIN"
-msgstr "Min:"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_MAX"
-msgstr "Max:"
-
-msgid "VisuGUI_GaussScalarBarPane::COLORS_LABELS_GRP"
-msgstr "Colors and labels"
-
-msgid "VisuGUI_GaussScalarBarPane::BICOLOR"
-msgstr "Bicolor"
-
-msgid "VisuGUI_GaussScalarBarPane::RAINBOW"
-msgstr "Rainbow"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_NB_COLORS"
-msgstr "Nb. of colors:"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_NB_LABELS"
-msgstr "Nb. of labels:"
-
-msgid "VisuGUI_GaussScalarBarPane::ORIENTATION_GRP"
-msgstr "Orientation"
-
-msgid "VisuGUI_GaussScalarBarPane::VERTICAL_BTN"
-msgstr "Vertical"
-
-msgid "VisuGUI_GaussScalarBarPane::HORIZONTAL_BTN"
-msgstr "Horizontal"
-
-msgid "VisuGUI_GaussScalarBarPane::ORIGIN_GRP"
-msgstr "Origin"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_X"
-msgstr "X:"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_Y"
-msgstr "Y:"
-
-msgid "VisuGUI_GaussScalarBarPane::DIMENSIONS_GRP"
-msgstr "Dimensions"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_WIDTH"
-msgstr "Width:"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_HEIGHT"
-msgstr "Height:"
-
-msgid "VisuGUI_GaussScalarBarPane::LBL_SPACING"
-msgstr "Spacing:"
-
-msgid "VisuGUI_GaussScalarBarPane::SAVE_DEFAULT_CHK"
-msgstr "Save as default values"
-
-msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL"
-msgstr "GAUSS viewer tools"
-
-msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_DLG_TITLE"
-msgstr "Segmentation Cursor"
-
-msgid "VVTK_SegmentationCursorDlg::ORIGIN_TITLE"
-msgstr "Origin"
-
-msgid "VVTK_SegmentationCursorDlg::ORIGIN_X"
-msgstr "X: "
-
-msgid "VVTK_SegmentationCursorDlg::ORIGIN_Y"
-msgstr "Y: "
-
-msgid "VVTK_SegmentationCursorDlg::ORIGIN_Z"
-msgstr "Z: "
-
-msgid "VVTK_SegmentationCursorDlg::DIRECTION_TITLE"
-msgstr "Direction"
-
-msgid "VVTK_SegmentationCursorDlg::DIRECTION_DX"
-msgstr "DX: "
-
-msgid "VVTK_SegmentationCursorDlg::DIRECTION_DY"
-msgstr "DY: "
-
-msgid "VVTK_SegmentationCursorDlg::DIRECTION_DZ"
-msgstr "DZ: "
-
-msgid "VVTK_SegmentationCursorDlg::DEPTH_TITLE"
-msgstr "Depth"
-
-msgid "VVTK_SegmentationCursorDlg::DEPTH"
-msgstr "Depth of the cursor: "
-
-msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE"
-msgstr "Radius"
-
-msgid "VVTK_SegmentationCursorDlg::RADIUS"
-msgstr "Radius of the cursor :"
-
-msgid "VVTK_SegmentationCursorDlg::RATIO"
-msgstr "+/- Ratio :"
-
-msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB"
-msgstr "Segmentation Cursor"
-
-msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB"
-msgstr "Gauss Points"
-
-msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS"
-msgstr "Inside Cursor Gauss Points Presentation"
-
-msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS"
-msgstr "Outside Cursor Gauss Points Presentation"
-
-msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION_TITLE"
-msgstr "Magnification"
-
-msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION"
-msgstr "Magnification (%) : "
-
-msgid "VVTK_SegmentationCursorDlg::INCREMENT"
-msgstr "+/- Ratio : "
-
-msgid "VVTK_PickingDlg::PICKING_DLG_TITLE"
-msgstr "Picking"
-
-msgid "VVTK_PickingDlg::CURSOR_TITLE"
-msgstr "Cursor"
-
-msgid "VVTK_PickingDlg::CURSOR_SIZE"
-msgstr "Size of the cursor :"
-
-msgid "VVTK_PickingDlg::PYRAMID_HEIGHT"
-msgstr "Height of the pyramids :"
-
-msgid "VVTK_PickingDlg::SELECTION_COLOR"
-msgstr "Selection cursor color :"
-
-msgid "VVTK_PickingDlg::TOLERANCE_TITLE"
-msgstr "Tolerance"
-
-msgid "VVTK_PickingDlg::POINT_TOLERANCE"
-msgstr "Point tolerance :"
-
-msgid "VVTK_PickingDlg::INFO_WINDOW_TITLE"
-msgstr "Information window"
-
-msgid "VVTK_PickingDlg::TRANSPARENCY"
-msgstr "Transparency :"
-
-msgid "VVTK_PickingDlg::POSITION"
-msgstr "Position :"
-
-msgid "VVTK_PickingDlg::BELOW_POINT"
-msgstr "Centered below the point"
-
-msgid "VVTK_PickingDlg::TOP_LEFT_CORNER"
-msgstr "Top-left corner of the 3D view"
-
-msgid "VVTK_PickingDlg::CAMERA_TITLE"
-msgstr "Movement of the camera"
-
-msgid "VVTK_PickingDlg::ZOOM_FACTOR"
-msgstr "Zoom at first selected point (ratio) :"
-
-msgid "VVTK_PickingDlg::STEP_NUMBER"
-msgstr "Number of steps between two positions :"
-
-msgid "VVTK_PickingDlg::PARENT_MESH_TITLE"
-msgstr "Parent mesh element"
-
-msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH"
-msgstr "Display parent mesh element"
\ No newline at end of file
+++ /dev/null
-# VISU VISUGUI : GUI of VISU component
-#
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#
-#
-#
-# File : VisuGUI_icons.po
-# Module : VISU
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-msgid "ICON_OBJBROWSER_Visu"
-msgstr "Visu_tree_visu.png"
-
-msgid "ICON_SCALAR_MAP"
-msgstr "Visu_scalars.png"
-
-msgid "ICON_DEFORMED_SHAPE"
-msgstr "Visu_deformed.png"
-
-msgid "ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"
-msgstr "Visu_scalarmapondeformedshape.png"
-
-msgid "ICON_VECTORS"
-msgstr "Visu_vectors.png"
-
-msgid "ICON_ISO_SURFACES"
-msgstr "Visu_isosurfaces.png"
-
-msgid "ICON_CUT_PLANES"
-msgstr "Visu_cutplane.png"
-
-msgid "ICON_CUT_LINES"
-msgstr "Visu_cutlines.png"
-
-msgid "ICON_STREAM_LINES"
-msgstr "Visu_streamlines.png"
msgid "ICON_SCALING"
msgstr "Visu_scaling.png"
-#
-
msgid "ICON_TIMEANIMATION"
msgstr "Visu_anim.png"
msgid "ICON_CUBE_AXES"
msgstr "Visu_graduated_axes.png"
+
+msgid "ICON_GAUSS_NEW_VIEWER"
+msgstr "Visu_points.png"
+
+msgid "ICON_GAUSS_POINTS"
+msgstr "Visu_gauss_points.png"
+
+msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Visu_vvtk_switch.png"
+
+msgid "ICON_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Visu_points.png"
+
+msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Visu_PlaneSegmentation.png"
+
+msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Visu_SphereSegmentation.png"
+
+msgid "ICON_VVTK_RECORDING_START"
+msgstr "Visu_recording_start.png"
+
+msgid "ICON_VVTK_RECORDING_PLAY"
+msgstr "Visu_recording_play.png"
+
+msgid "ICON_VVTK_RECORDING_PAUSE"
+msgstr "Visu_recording_pause.png"
+
+msgid "ICON_VVTK_RECORDING_STOP"
+msgstr "Visu_recording_stop.png"
+
+msgid "ICON_LOAD_TEXTURE"
+msgstr "Visu_load_texture.png"
#: VisuGUI.cxx
+msgid "VisuGUI::MEN_IMPORT"
+msgstr "Import"
+
msgid "VisuGUI::MEN_IMPORT_FROM_FILE"
+msgstr "MED file"
+
+msgid "VisuGUI::IMPORT_FROM_FILE"
msgstr "Import from File"
-msgid "VisuGUI::MEN_EXPLORE_MED_FILE"
-msgstr "Explore MED File"
+msgid "VisuGUI::USE_BUILD_PROGRESS"
+msgstr "Use build progress"
msgid "VisuGUI::MEN_IMPORT_TABLE"
-msgstr "Import table from File"
+msgstr "Table from file"
msgid "VisuGUI::MEN_SCALAR_MAP"
msgstr "Scalar Map"
msgstr "Arrange Actors"
-msgid "VisuGUI::ERR_ERROR_IN_THE_FILE"
-msgstr "Error in the file"
-
msgid "VisuGUI::ERR_ERROR_DURING_EXPORT"
msgstr "Error has been occured during exporting to file"
msgid "VisuGUI_SetupPlot2dDlg::QUE_WANT_SAME_UNITS"
msgstr "Do you want to choose all items with the same units for vertical axis?"
+msgid "INF_VISU"
+msgstr "Post-Pro Info"
+
+msgid "IMPORT_DONE"
+msgstr "Importing is done"
+
+msgid "VisuGUI_Module::MEN_VISUALISATION"
+msgstr "Visualization"
+
+msgid "VisuGUI_Module::TOOL_VISUALISATION"
+msgstr "Visualization Toolbar"
+
+msgid "VisuGUI_Module::MEN_SAVE_CONFIGURATION"
+msgstr "Store current configuration"
+
+msgid "VisuGUI_Module::MEN_OVERWRITE_CONFIGURATION"
+msgstr "Overwrite current configuration"
+
+msgid "VisuGUI_Module::MEN_RESTORE_CONFIGURATION"
+msgstr "Restore current configuration"
+
+msgid "VisuGUI_Module::MEN_GAUSS"
+msgstr "Gauss"
+
+msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER"
+msgstr "Points view"
+
+msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TTL"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL"
+msgstr "Primitive"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE"
+msgstr "Primitive Type"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE"
+msgstr "Point sprite"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT"
+msgstr "OpenGL point"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE"
+msgstr "Geometrical sphere"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP"
+msgstr "Maximum Size (Clamp)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAIN_TEXTURE"
+msgstr "Main Texture (16x16)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_TEXTURE"
+msgstr "Alpha Channel Texture (16x16)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_THRESHOLD"
+msgstr "Alpha Channel Threshold"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_RESOLUTION"
+msgstr "Geometrical sphere resolution"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_FACE_LIMIT"
+msgstr "Notify when number of faces exceeds"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE_GROUP_TTL"
+msgstr "Size"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MIN_SIZE"
+msgstr "Range value for min size (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAX_SIZE"
+msgstr "Range value for max size (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION"
+msgstr "Magnification (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_INCREMENT"
+msgstr "+/- Ratio"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOM_GROUP_TTL"
+msgstr "Geometry"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE"
+msgstr "Size of points (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR"
+msgstr "Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALE_FACTOR"
+msgstr "Scale factor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL"
+msgstr "Gauss Points Scalar Bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL"
+msgstr "Gauss Points Scalar Bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ACTIVE_BAR"
+msgstr "Active bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_LOCAL"
+msgstr "Local"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GLOBAL"
+msgstr "Global"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_DISPLAY_GLOBAL"
+msgstr "Display global bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALAR_BAR_MODE"
+msgstr "Scalar bar mode"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_BICOLOR"
+msgstr "Bicolor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_RAINBOW"
+msgstr "Rainbow"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SPACING"
+msgstr "Spacing"
+
+msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Inside Cursor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL"
+msgstr "Magnification (Inside and Outside)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Outside Cursor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL"
+msgstr "Color"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TAB_TTL"
+msgstr "Picking"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL"
+msgstr "Cursor"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE"
+msgstr "Size of the cursor"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT"
+msgstr "Height of the pyramids"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_SELECTION_COLOR"
+msgstr "Selection cursor color"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TOLERANCE_GROUP_TTL"
+msgstr "Tolerance"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE"
+msgstr "Point selection tolerance"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL"
+msgstr "Information window"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TRANSPARENCY"
+msgstr "Transparency"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_POSITION"
+msgstr "Position"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_BELOW_POINT"
+msgstr "Centered below the point"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TOP_LEFT_CORNER"
+msgstr "Top-left corner of the 3D view"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CAMERA_GROUP_TTL"
+msgstr "Movement of the camera"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_ZOOM_FACTOR"
+msgstr "Zoom at first selected point (ratio)"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_STEP_NUMBER"
+msgstr "Number of steps between two positions"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_PARENT_MESH_TTL"
+msgstr "Parent mesh element"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_DISPLAY_PARENT_MESH"
+msgstr "Display parent mesh element"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_TAB_TLT"
+msgstr "Navigation"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT"
+msgstr "Mouse"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF"
+msgstr "Mouse behaviour"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD"
+msgstr "Salome standard controls"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE"
+msgstr "Keyboard free"
+
+msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL"
+msgstr "Keyboard"
+
+msgid "VisuGUI_Module::VISU_KEYBOARD_PREF"
+msgstr "[+]/[-] Speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF"
+msgstr "Spacemouse"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1"
+msgstr "Decrease speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2"
+msgstr "Increase speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3"
+msgstr "Decrease Gauss points magnification"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4"
+msgstr "Increase Gauss points magnification"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5"
+msgstr "Dominant / combined switch"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1"
+msgstr "Button 1"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2"
+msgstr "Button 2"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3"
+msgstr "Button 3"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4"
+msgstr "Button 4"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5"
+msgstr "Button 5"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6"
+msgstr "Button 6"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7"
+msgstr "Button 7"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8"
+msgstr "Button 8"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10"
+msgstr "Button 10"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11"
+msgstr "Button 11"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*"
+msgstr "Button *"
+
+msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL"
+msgstr "Camera movements"
+
+msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF"
+msgstr "Number of steps between two positions"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_TAB_TTL"
+msgstr "Recorder"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_GROUP_TTL"
+msgstr "Settings"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_RECORDING_MODE"
+msgstr "Mode"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_SKIPPED_FRAMES"
+msgstr "Recording at a given FPS"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES"
+msgstr "Recording all displayed frames"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_FPS"
+msgstr "FPS"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_QUALITY"
+msgstr "Quality"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_PROGRESSIVE"
+msgstr "Progressive"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE"
+msgstr "Gauss Points Preferences"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE"
+msgstr "Gauss Points Properties"
+
+msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE"
+msgstr "Build progress"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS"
+msgstr "Settings"
+
+msgid "VisuGUI_BuildProgressDlg::FILE_NAME"
+msgstr "Import file : "
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE"
+msgstr "Build at once"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_ALL"
+msgstr "Build all"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS"
+msgstr "Import progress"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES"
+msgstr "Build entities"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS"
+msgstr "Build fields"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS"
+msgstr "Build groups"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX"
+msgstr "Build min/max"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME"
+msgstr "Time"
+
+msgid "VisuGUI_BuildProgressDlg::TIME"
+msgstr "Elapsed time : "
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE"
+msgstr "Import from File"
+
+msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES"
+msgstr "All Files (*.*)"
+
+msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES"
+msgstr "MED Files (*.med)"
+
+msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH"
+msgstr "Close dialog at finish"
+
+msgid "VisuGUI_BuildProgressDlg::START"
+msgstr "Start"
+
+msgid "VisuGUI_BuildProgressDlg::CLOSE"
+msgstr "Close"
+
+msgid "VisuGUI_BuildProgressDlg::ERR_ERROR_IN_THE_FILE"
+msgstr "Error in the file"
+
+msgid "VVTK_RecorderDlg::DLG_RECORDER_TITLE"
+msgstr "Recorder"
+
+msgid "VVTK_RecorderDlg::SETTINGS"
+msgstr "Settings"
+
+msgid "VVTK_RecorderDlg::FILE_NAME"
+msgstr "Save to file : "
+
+msgid "VVTK_RecorderDlg::FLT_ALL_FILES"
+msgstr "All Files (*.*)"
+
+msgid "VVTK_RecorderDlg::FLT_AVI_FILES"
+msgstr "AVI Files (*.avi)"
+
+msgid "VVTK_RecorderDlg::RECORDING_MODE"
+msgstr "Mode : "
+
+msgid "VVTK_RecorderDlg::SKIPPED_FRAMES"
+msgstr "Recording at a given FPS"
+
+msgid "VVTK_RecorderDlg::ALL_DISLPAYED_FRAMES"
+msgstr "Recording all displayed frames"
+
+msgid "VVTK_RecorderDlg::FPS"
+msgstr "FPS : "
+
+msgid "VVTK_RecorderDlg::QUALITY"
+msgstr "Quality : "
+
+msgid "VVTK_RecorderDlg::PROGRESSIVE"
+msgstr "Progressive"
+
+msgid "VVTK_RecorderDlg::START"
+msgstr "Start"
+
+msgid "VVTK_RecorderDlg::CLOSE"
+msgstr "Close"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TITLE"
+msgstr "Change Transparency"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TRANSPARENT"
+msgstr "Transparent"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_OPAQUE"
+msgstr "Opaque"
+
+msgid "VisuGUI_TransparencyDlg::BUT_CLOSE"
+msgstr "Close"
+
+msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
+msgstr "Gauss scene:%1 - viewer:%2"
+
+msgid "VVTK_MainWindow::LBL_TOOLBAR_RECORD_LABEL"
+msgstr "Recording Operations"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow1::LBL_TOOLBAR_GAUSS_LABEL"
+msgstr "Gauss Viewer Tools"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Interaction Style Switch"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Interaction Style Switch"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Selection Mode Switch"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Selection Mode Switch"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation"
+
+msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE"
+msgstr "Primitive"
+
+msgid "VVTK_PrimitiveBox::POINT_SPRITE"
+msgstr "Point Sprite"
+
+msgid "VVTK_PrimitiveBox::OPENGL_POINT"
+msgstr "OpenGL Point"
+
+msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE"
+msgstr "Geometrical Sphere"
+
+msgid "VVTK_PrimitiveBox::CLAMP"
+msgstr "Maximum Size (Clamp) : "
+
+msgid "VVTK_PrimitiveBox::MAIN_TEXTURE"
+msgstr "Main Texture (16x16) : "
+
+msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE"
+msgstr "Alpha Channel Texture (16x16) : "
+
+msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD"
+msgstr "Alpha Channel Threshold : "
+
+msgid "VVTK_PrimitiveBox::RESOLUTION"
+msgstr "Resolution : "
+
+msgid "VVTK_PrimitiveBox::FACE_NUMBER"
+msgstr "Number of faces : "
+
+msgid "VVTK_PrimitiveBox::FACE_LIMIT"
+msgstr "Notify when number of faces exceeds : "
+
+msgid "VVTK_SizeBox::SIZE_TITLE"
+msgstr "Size"
+
+msgid "VVTK_SizeBox::OUTSIDE_SIZE"
+msgstr "Percentage of normal size(%) : "
+
+msgid "VVTK_SizeBox::GEOM_SIZE"
+msgstr "Size of points (%) : "
+
+msgid "VVTK_SizeBox::MIN_SIZE"
+msgstr "Range values for min size (%) : "
+
+msgid "VVTK_SizeBox::MAX_SIZE"
+msgstr "max size (%) : "
+
+msgid "VVTK_SizeBox::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VVTK_SizeBox::INCREMENT"
+msgstr "+/- Ratio : "
+
+msgid "VVTK_SizeBox::COLOR_TITLE"
+msgstr "Color"
+
+msgid "VVTK_SizeBox::UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VVTK_SizeBox::COLOR"
+msgstr "Color : "
+
+msgid "VisuGUI_GaussPointsDlg::&Cancel"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::&OK"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::WARNING"
+msgstr "Warning"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
+msgstr "Scalar Bar"
+
+msgid "VisuGUI_GaussPointsDlg::PRS_TITLE"
+msgstr "Presentation"
+
+msgid "VisuGUI_GaussPointsDlg::RESULTS"
+msgstr "Results"
+
+msgid "VisuGUI_GaussPointsDlg::GEOMETRY"
+msgstr "Geometry"
+
+msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE_TITLE"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_GaussPointsDlg::SCALE_FACTOR"
+msgstr "Scale Factor :"
+
+msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP"
+msgstr "Active bar"
+
+msgid "VisuGUI_GaussScalarBarPane::LOCAL"
+msgstr "Local"
+
+msgid "VisuGUI_GaussScalarBarPane::GLOBAL"
+msgstr "Global"
+
+msgid "VisuGUI_GaussScalarBarPane::DISPLAYED"
+msgstr "Displayed"
+
+msgid "VisuGUI_GaussScalarBarPane::SCALAR_RANGE_GRP"
+msgstr "Scalar range"
+
+msgid "VisuGUI_GaussScalarBarPane::LOGARITHMIC_SCALING"
+msgstr "Logarithmic scaling"
+
+msgid "VisuGUI_GaussScalarBarPane::FIELD_RANGE_BTN"
+msgstr "Use field range"
+
+msgid "VisuGUI_GaussScalarBarPane::IMPOSED_RANGE_BTN"
+msgstr "Use imposed range"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_MIN"
+msgstr "Min:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_MAX"
+msgstr "Max:"
+
+msgid "VisuGUI_GaussScalarBarPane::COLORS_LABELS_GRP"
+msgstr "Colors and labels"
+
+msgid "VisuGUI_GaussScalarBarPane::BICOLOR"
+msgstr "Bicolor"
+
+msgid "VisuGUI_GaussScalarBarPane::RAINBOW"
+msgstr "Rainbow"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_NB_COLORS"
+msgstr "Nb. of colors:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_NB_LABELS"
+msgstr "Nb. of labels:"
+
+msgid "VisuGUI_GaussScalarBarPane::ORIENTATION_GRP"
+msgstr "Orientation"
+
+msgid "VisuGUI_GaussScalarBarPane::VERTICAL_BTN"
+msgstr "Vertical"
+
+msgid "VisuGUI_GaussScalarBarPane::HORIZONTAL_BTN"
+msgstr "Horizontal"
+
+msgid "VisuGUI_GaussScalarBarPane::ORIGIN_GRP"
+msgstr "Origin"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_X"
+msgstr "X:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_Y"
+msgstr "Y:"
+
+msgid "VisuGUI_GaussScalarBarPane::DIMENSIONS_GRP"
+msgstr "Dimensions"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_WIDTH"
+msgstr "Width:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_HEIGHT"
+msgstr "Height:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_SPACING"
+msgstr "Spacing:"
+
+msgid "VisuGUI_GaussScalarBarPane::SAVE_DEFAULT_CHK"
+msgstr "Save as default values"
+
+msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL"
+msgstr "GAUSS viewer tools"
+
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_DLG_TITLE"
+msgstr "Segmentation Cursor"
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_TITLE"
+msgstr "Origin"
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_X"
+msgstr "X: "
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_Y"
+msgstr "Y: "
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_Z"
+msgstr "Z: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_TITLE"
+msgstr "Direction"
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DX"
+msgstr "DX: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DY"
+msgstr "DY: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DZ"
+msgstr "DZ: "
+
+msgid "VVTK_SegmentationCursorDlg::DEPTH_TITLE"
+msgstr "Depth"
+
+msgid "VVTK_SegmentationCursorDlg::DEPTH"
+msgstr "Depth of the cursor: "
+
+msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE"
+msgstr "Radius"
+
+msgid "VVTK_SegmentationCursorDlg::RADIUS"
+msgstr "Radius of the cursor :"
+
+msgid "VVTK_SegmentationCursorDlg::RATIO"
+msgstr "+/- Ratio :"
+
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB"
+msgstr "Segmentation Cursor"
+
+msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS"
+msgstr "Inside Cursor Gauss Points Presentation"
+
+msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS"
+msgstr "Outside Cursor Gauss Points Presentation"
+
+msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION_TITLE"
+msgstr "Magnification"
+
+msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VVTK_SegmentationCursorDlg::INCREMENT"
+msgstr "+/- Ratio : "
+
+msgid "VVTK_PickingDlg::PICKING_DLG_TITLE"
+msgstr "Picking"
+
+msgid "VVTK_PickingDlg::CURSOR_TITLE"
+msgstr "Cursor"
+
+msgid "VVTK_PickingDlg::CURSOR_SIZE"
+msgstr "Size of the cursor :"
+
+msgid "VVTK_PickingDlg::PYRAMID_HEIGHT"
+msgstr "Height of the pyramids :"
+
+msgid "VVTK_PickingDlg::SELECTION_COLOR"
+msgstr "Selection cursor color :"
+
+msgid "VVTK_PickingDlg::TOLERANCE_TITLE"
+msgstr "Tolerance"
+
+msgid "VVTK_PickingDlg::POINT_TOLERANCE"
+msgstr "Point tolerance :"
+
+msgid "VVTK_PickingDlg::INFO_WINDOW_TITLE"
+msgstr "Information window"
+
+msgid "VVTK_PickingDlg::TRANSPARENCY"
+msgstr "Transparency :"
+
+msgid "VVTK_PickingDlg::POSITION"
+msgstr "Position :"
+
+msgid "VVTK_PickingDlg::BELOW_POINT"
+msgstr "Centered below the point"
+
+msgid "VVTK_PickingDlg::TOP_LEFT_CORNER"
+msgstr "Top-left corner of the 3D view"
+
+msgid "VVTK_PickingDlg::CAMERA_TITLE"
+msgstr "Movement of the camera"
+
+msgid "VVTK_PickingDlg::ZOOM_FACTOR"
+msgstr "Zoom at first selected point (ratio) :"
+
+msgid "VVTK_PickingDlg::STEP_NUMBER"
+msgstr "Number of steps between two positions :"
+
+msgid "VVTK_PickingDlg::PARENT_MESH_TITLE"
+msgstr "Parent mesh element"
+
+msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH"
+msgstr "Display parent mesh element"
\ No newline at end of file
#include "SalomeApp_Application.h"
#include "SalomeApp_DataModel.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_CheckFileDlg.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_Selection.h"
#include "LightApp_Preferences.h"
#include "VisuGUI_PopupTools.h"
#include "VisuGUI_NameDlg.h"
-#include "VisuGUI_FileDlg.h"
#include "VisuGUI_CursorDlg.h"
#include "VisuGUI_Selection.h"
#include "VisuGUI_TimeAnimation.h"
#include "VisuGUI_Timer.h"
+#include "VVTK_ViewModel.h"
+
using namespace VISU;
#ifdef _DEBUG_
if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
return;
+
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
- VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
- aBuildProgressDlg->setGenerator( GetVisuGen(this) );
- aBuildProgressDlg->show();
-}
-
-
-void
-VisuGUI::
-OnExploreMEDFile()
-{
- if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()");
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
- if ( CheckLock(aStudy,GetDesktop(this)) )
- return;
-
- SALOME_MED::MED_Gen_var aGen = GetMEDEngine();
-
+ // Get file name
QStringList aFilter;
- aFilter.append( tr("FLT_MED_FILES") );
- aFilter.append( tr("FLT_ALL_FILES") );
-
- QFileInfo aFileInfo =
- SUIT_FileDlg::getFileName(GetDesktop(this),
- "",
- aFilter,
- tr("MEN_EXPLORE_MED_FILE"),
- true);
- if(aFileInfo.exists()){
- application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
- std::string aStudyName = aStudy->Name();
- try
+ aFilter.append( tr( "FLT_MED_FILES" ) );
+ aFilter.append( tr( "FLT_ALL_FILES" ) );
+
+ bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
+
+ SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
+ fd->setCaption( tr( "IMPORT_FROM_FILE" ) );
+ fd->setFilters( aFilter );
+ fd->SetChecked( toUseBuildProgress );
+ fd->exec();
+ QFileInfo aFileInfo( fd->selectedFile() );
+ toUseBuildProgress = fd->IsChecked();
+ delete fd;
+
+ // Check the file name
+ if ( !aFileInfo.exists() )
+ return;
+
+ if ( !toUseBuildProgress )
{
- aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
+ bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
+ bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
+ bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
+ bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
+ bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
+
+ QString anInfo("Importing From File " + aFileInfo.filePath() + "..." );
+ application()->putInfo( anInfo );
+
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath() );
+
+ if (CORBA::is_nil(aResult.in())) {
+ SUIT_MessageBox::warn1(GetDesktop(this),
+ tr("WRN_VISU"),
+ VisuGUI_BuildProgressDlg::tr("ERR_ERROR_IN_THE_FILE"),
+ tr("BUT_OK"));
+ QApplication::restoreOverrideCursor();
+ }else{
+ aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+ aResult->SetBuildGroups( toBuildGroups );
+ aResult->Build( toBuildAll, toBuildAtOnce );
+
+ UpdateObjBrowser(this);
+ application()->putInfo( anInfo + tr("INF_DONE"));
+ QApplication::restoreOverrideCursor();
+ }
}
- catch(...)
+ else
{
- SUIT_MessageBox::warn1(GetDesktop(this),
- tr("WRN_VISU"),
- tr("ERR_ERROR_IN_THE_FILE"),
- tr("BUT_OK"));
+ VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+ aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+ aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+ aBuildProgressDlg->show();
}
- application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
- getApp()->updateObjectBrowser(true); // as need to update MED tree
- getApp()->updateActions();
- }
}
-
void
VisuGUI::
OnImportTableFromFile()
return;
// create a VTK view window if it does not exist
- GetViewWindow( this, /*create=*/true );
+ SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
- CreateMesh(this, anIO);
+ // create mesh presentation and display it in aViewWindow
+ CreateMesh(this, anIO, aViewWindow);
}
void
return;
// create a VTK view window if it does not exist
- GetViewWindow( this, /*create=*/true );
+ SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
// Get selected SObject
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
if (anIO.IsNull() || !anIO->hasEntry())
return;
- CreateMesh(this, anIO);
+ // create mesh presentation and display it in aViewWindow
+ CreateMesh(this, anIO, aViewWindow);
}
}
{
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
+ LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
+ if (!mgr) return;
+
QApplication::setOverrideCursor(Qt::waitCursor);
+
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
+
SALOME_ListIO aSel, aList;
- LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
- mgr->selectedObjects( aSel );
+ mgr->selectedObjects(aSel);
+ extractContainers(aSel, aList);
- extractContainers( aSel, aList );
+ for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+ Handle(SALOME_InteractiveObject) anIO = it.Value();
+ CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
- Handle(SALOME_InteractiveObject) anIO;
- for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
- anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
- if ( !CORBA::is_nil( anObject ) ) {
+ if (!CORBA::is_nil(anObject)) {
// is it Prs3d object ?
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
- if(aPrsObject){
+ if (aPrsObject) {
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
//UpdateViewer( this, aPrsObject );
- SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
- if ( vw )
- {
- displayer()->Display( anIO->getEntry() );
+ if (vw) {
+ displayer()->Display(anIO->getEntry());
vw->highlight(anIO, 1);
}
continue;
}
// is it Curve ?
VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
- if(aCurve){
+ if (aCurve) {
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
//PlotCurve( this, aCurve, VISU::eDisplay );
- displayer()->Display( anIO->getEntry() );
+ displayer()->Display(anIO->getEntry());
continue;
}
// is it Container ?
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
- if(aContainer){
+ if (aContainer) {
if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
//PlotContainer( this, aContainer, VISU::eDisplay );
- displayer()->Display( anIO->getEntry() );
+ displayer()->Display(anIO->getEntry());
continue;
}
// is it Table ?
VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
- if(aTable){
+ if (aTable) {
if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
//PlotTable( this, aTable, VISU::eDisplay );
- displayer()->Display( anIO->getEntry() );
+ displayer()->Display(anIO->getEntry());
continue;
}
}
}
- SVTK_ViewWindow* vw = GetViewWindow( this );
- if ( vw ) {
+
+ if (vw) {
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
}
+
QApplication::restoreOverrideCursor();
}
QApplication::setOverrideCursor(Qt::waitCursor);
- SVTK_ViewWindow* vw = GetViewWindow( this );
- if (vw)
- vw->unHighlightAll();
+ //SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
+ //if (vw)
+ // vw->unHighlightAll();
SALOME_ListIO aList, aSel;
LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
- mgr->selectedObjects( aSel );
+ mgr->selectedObjects(aSel);
+ extractContainers(aSel, aList);
- extractContainers( aSel, aList );
-
- Handle(SALOME_InteractiveObject) anIO;
- for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
- anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
- if (!CORBA::is_nil(anObject))
- RemoveScalarBarPosition(this,anObject);
- ErasePrs( this, anObject, false );
+ for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+ Handle(SALOME_InteractiveObject) anIO = it.Value();
+ CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+ //ErasePrs(this, anObject, /*repaint_view_window = */false);
+ ErasePrs(this, anObject, /*repaint_view_window = */true);
}
- if (vw)
- vw->Repaint();
+ //if (vw)
+ // vw->Repaint();
QApplication::restoreOverrideCursor();
}
OnEraseAll()
{
startOperation( myEraseAll );
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
+ if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
vw->unHighlightAll();
if (vtkRenderer *aRen = vw->getRenderer()) {
vtkActor *anActor;
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
if (anActor->GetVisibility() > 0)
if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- RemoveScalarBarPosition(this,anVISUActor->GetPrs3d());
+ RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
anVISUActor->VisibilityOff();
}
}
OnEditScalarMap()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditDeformedShape()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg, 1>(this, anIO, aPrs3d);
}
void
OnEditScalarMapOnDeformedShape()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg, 1>(this, anIO, aPrs3d);
}
void
OnEditCutPlanes()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg, 0>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditCutLines()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditIsoSurfaces()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditVectors()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditStreamLines()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg, 1>(this, anIO, aPrs3d);
}
-
void
VisuGUI::
OnEditPlot3D()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
- aViewWindow->highlight(anIO, 1);
- }
- }
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+ EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg, 0>(this, anIO, aPrs3d);
}
VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrs3d) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrs3d, vw);
VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrs3d) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrs3d, vw);
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrsObject, vw);
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrsObject, vw);
//jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
_PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
- VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
+ if ( aSObj )
+ VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
}
void
VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (!vw) return;
VISU_Actor* aActor = GetActor(aPrsObject, vw);
VisuGUI::
OnTimeAnimation()
{
- if(!VISU::GetViewWindow(this))
+ if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
return;
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
VisuGUI::
OnShowAnimation()
{
- if(!VISU::GetViewWindow(this))
+ if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
return;
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
aSameMesh->SameAs(aMeshPrs);
- UpdateViewer(this, aSameMesh);
}
break;
case VISU::TSCALARMAP:
VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
aSameScalar->SameAs(aScalarPrs);
- UpdateViewer(this, aSameScalar);
}
break;
case VISU::TDEFORMEDSHAPE:
VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
aSameDeformed->SameAs(aDefPrs);
- UpdateViewer(this, aSameDeformed);
}
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE:
{
- VISU::ScalarMapOnDeformedShape_i* aDefPrs = dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
- VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed = new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
+ VISU::ScalarMapOnDeformedShape_i* aDefPrs =
+ dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
+ VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed =
+ new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
aSameScalarMapOnDeformed->SameAs(aDefPrs);
- UpdateViewer(this, aSameScalarMapOnDeformed);
}
break;
case VISU::TCUTPLANES:
VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
aSameCut->SameAs(aCutPrs);
- UpdateViewer(this, aSameCut);
}
break;
case VISU::TCUTLINES:
VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
aSameCut->SameAs(aCutPrs);
- UpdateViewer(this, aSameCut);
}
break;
case VISU::TISOSURFACE:
VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
aSameIso->SameAs(aIsoPrs);
- UpdateViewer(this, aSameIso);
}
break;
case VISU::TSTREAMLINES:
VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
aSameLines->SameAs(aLinesPrs);
- UpdateViewer(this, aSameLines);
}
break;
case VISU::TVECTORS:
VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
aSameVectors->SameAs(aVectorsPrs);
- UpdateViewer(this, aSameVectors);
}
break;
case VISU::TPLOT3D:
VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
aSamePlot3D->SameAs(aPlot3DPrs);
- UpdateViewer(this, aSamePlot3D);
}
break;
}
VisuGUI::
OnSelectionInfo()
{
- if (GetViewWindow(this))
+ if (GetActiveViewWindow<SVTK_ViewWindow>(this))
(new VisuGUI_SelectionDlg(this))->show();
else
SUIT_MessageBox::warn1(GetDesktop(this),
}
}
if (update) {
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
-//}
+ if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
}
}
}
}
}
if (update) {
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
-//}
+ if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
}
}
}
VisuGUI::
OnArrangeActors()
{
- SVTK_ViewWindow* vw = GetViewWindow(this);
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
if (vw) {
ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
aDlg->exec();
tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
this, SLOT(OnImportFromFile()));
- createAction( VISU_EXPLORE_MED, "", QIconSet(),
- tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
- this, SLOT(OnExploreMEDFile()));
-
createAction( VISU_IMPORT_TABLE, "", QIconSet(),
tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
this, SLOT(OnImportTableFromFile()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
- //this, SLOT(OnEraseAll()));
this);
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
- //this, SLOT(OnEraseAll()));
this);
createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
int aMenuId;
aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( separator(), aMenuId, -1, 10 );
- createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
- createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
- createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
+
+ int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
+ createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
+ createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !aSObject )
+ continue;
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
if (CORBA::is_nil(aCORBAObject)) {
_PTR(GenericAttribute) anAttr;
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !aSObject )
+ continue;
_PTR(GenericAttribute) anAttr;
if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
_PTR(AttributeComment) aComment (anAttr);
CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
_PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
+ if ( !SO )
+ return;
bool isExist;
VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
viewManagers( QStringList& theList ) const
{
theList.clear();
- theList.append( SVTK_Viewer::Type() );
+ // append SVTK viewer only if there is neither SVTK nor VVTK is open
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ if ( !lst.count() ) {
+ lst.clear();
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ if ( !lst.count() )
+ theList.append( SVTK_Viewer::Type() );
+ }
}
// group: "MED files import"
int importGr = addPreference( tr( "MED files import" ), srangeTab );
setPreferenceProperty( importGr, "columns", 1 );
+ addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
if (b == QString("scalar_bar_orientation")) return;
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
float sbX1,sbY1,sbW,sbH;
+ float aTol = 1.00000009999999;
std::string aWarning;
if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1);
sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW);
- if(sbX1+sbW > 1.0){
+ if(sbX1+sbW > aTol){
aWarning = "Origin and Size Vertical: X+Width > 1\n";
sbX1=0.01;
sbW=0.05;
else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1);
sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH);
- if(sbY1+sbH > 1.0){
+ if(sbY1+sbH > aTol){
aWarning = "Origin and Size Vertical: Y+Height > 1\n";
sbY1=0.01;
sbH=0.5;
else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){
sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1);
sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW);
- if(sbX1+sbW > 1.0){
+ if(sbX1+sbW > aTol){
aWarning = "Origin and Size Horizontal: X+Width > 1\n";
sbX1=0.2;
sbW=0.6;
else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){
sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1);
sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH);
- if(sbY1+sbH > 1.0){
+ if(sbY1+sbH > aTol){
aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
sbY1=0.01;
sbH=0.12;
protected slots:
void OnImportFromFile();
- void OnExploreMEDFile();
void OnImportTableFromFile();
void OnExportTableToFile();
void OnImportMedField();
#define VISUGUI_ACTIONSDEF
//#define VISU_IMPORT_FROM_FILE 112
-//#define VISU_EXPLORE_MED 113
//#define VISU_IMPORT_MED 114
//#define VISU_IMPORT_TABLE 199
#define VISU_IMPORT_FROM_FILE 4002
-#define VISU_EXPLORE_MED 4003
-#define VISU_IMPORT_TABLE 4004
-#define VISU_IMPORT_MED_STRUCTURE 4005
-#define VISU_IMPORT_MED_TIMESTAMP 4006
-#define VISU_IMPORT_MED_FIELD 4007
+#define VISU_IMPORT_TABLE 4003
+#define VISU_IMPORT_MED_STRUCTURE 4004
+#define VISU_IMPORT_MED_TIMESTAMP 4005
+#define VISU_IMPORT_MED_FIELD 4006
#define VISU_SCALAR_MAP 4011
#define VISU_DEFORMED_SHAPE 4012
* Constructor
*/
VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
- QDialog( theParent, "VisuGUI_BuildProgressBar", false ),
+ QDialog( theParent,
+ "VisuGUI_BuildProgressBar",
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
myIsRaiseColor( false )
{
setCaption( tr( "DLG_BUILD_PROGRESS_TITLE" ) );
void VisuGUI_BuildProgressDlg::show()
{
- if( onBrowseFile() )
+ if( !myFileName.isNull() || onBrowseFile() )
QWidget::show();
}
if( myFileName.isNull() )
return;
- bool aBuildAll = myBuildAllCheckBox->isChecked();
- bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked();
-
myResult = myGenerator->CreateResult( myFileName );
- myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
- myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
-
- //setModal( false );
- myFileNameLineEdit->setReadOnly( true );
- /*
- myBuildAllCheckBox->setNoChange();
- myBuildAtOnceCheckBox->setNoChange();
- myBuildEntitiesCheckBox->setNoChange();
- myBuildFieldsCheckBox->setNoChange();
- myBuildMinMaxCheckBox->setNoChange();
- myBuildGroupsCheckBox->setNoChange();
- */
-
- myStartButton->setEnabled( false );
+ if (CORBA::is_nil(myResult.in())) {
+ SUIT_MessageBox::warn1(this,
+ tr("WRN_VISU"),
+ tr("ERR_ERROR_IN_THE_FILE"),
+ tr("BUT_OK"));
+ onClose();
+ }else{
+ myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
+ myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
+
+ //setModal( false );
+ myFileNameLineEdit->setReadOnly( true );
+ /*
+ myBuildAllCheckBox->setNoChange();
+ myBuildAtOnceCheckBox->setNoChange();
+ myBuildEntitiesCheckBox->setNoChange();
+ myBuildFieldsCheckBox->setNoChange();
+ myBuildMinMaxCheckBox->setNoChange();
+ myBuildGroupsCheckBox->setNoChange();
+ */
+
+ myStartButton->setEnabled( false );
+
+ bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked();
+ if( aBuildAtOnce )
+ {
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ myCurrentTime = vtkTimerLog::GetCurrentTime();
+ }
- if( aBuildAtOnce )
- {
- QApplication::setOverrideCursor( Qt::waitCursor );
- myCurrentTime = vtkTimerLog::GetCurrentTime();
+ myTime.setHMS( 0, 0, 0 );
+ myTimer->start( 100 );
+
+ bool aBuildAll = myBuildAllCheckBox->isChecked();
+ myResult->Build( aBuildAll, aBuildAtOnce );
}
-
- myTime.setHMS( 0, 0, 0 );
- myTimer->start( 100 );
-
- myResult->Build( aBuildAll, aBuildAtOnce );
}
void VisuGUI_BuildProgressDlg::onClose()
myBuildGroupsButton->setPaletteBackgroundColor( aColor );
}
+
+void VisuGUI_BuildProgressDlg::setFileName( const QString& theFileName )
+{
+ if ( !theFileName.isNull() )
+ {
+ myFileName = theFileName;
+ myFileNameLineEdit->setText( myFileName.section( '/', -1 ) );
+ }
+}
virtual void show();
QString fileName() const { return myFileName; }
+ void setFileName( const QString& theFileName );
protected slots:
void done( int );
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
{
// no need to delete child widgets, Qt does it all for us
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
- VISU::RenderViewWindow(VISU::GetViewWindow(myVisuGUI));
+ VISU::RenderViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI));
}
//=================================================================================
if (!myPrs3d)
return;
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
SUIT_OverrideCursor wc;
+ QWidget *aCurrWid = this->focusWidget();
+ aCurrWid->clearFocus();
+ aCurrWid->setFocus();
+
// Save clipping planes, currently applied to the presentation
// to enable restoring this state in case of failure.
// Refer to bugs IPAL8849, IPAL8850 for more information.
//=================================================================================
void VisuGUI_ClippingDlg::onSelectionChanged()
{
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = VISU::GetSelectedObj(myVisuGUI, &anIO);
myIO = anIO;
if (!myPrs3d)
return;
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
OrientedPlane* aPlane = OrientedPlane::New(aViewWindow);
VISU::TVTKPlane aTVTKPlane(aPlane);
myPlanes.push_back(aTVTKPlane);
ClickOnApply();
Sinchronize();
- if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI))
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(aViewWindow);
}
if (AutoApplyCheckBox->isChecked())
ClickOnApply();
- if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI))
+ if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(vw);
}
void VisuGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled)
{
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled));
- if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI))
+ if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
VISU::RenderViewWindow(vw);
}
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_Gen_i.hh"
#include "VISU_CutLines_i.hh"
QHBox* aPosBox = new QHBox (aPlanePane);
aPosBox->setSpacing(5);
- QLabel* aPosLbl = new QLabel (tr("LBL_POS"), aPosBox);
+ new QLabel (tr("LBL_POS"), aPosBox);
myPosSpn = new QtxDblSpinBox (0, 1, 0.1, aPosBox);
myPosSpn->setValue(0.5);
aPlaneLayout->addWidget(aPosBox);
QHBox* aNbBox = new QHBox(aLinesPane);
aNbBox->setSpacing(5);
- QLabel* aNbLbl = new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
+ new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
myNbSpn = new QtxDblSpinBox( 1, 100, 1, aNbBox );
myNbSpn->setValue( 10 );
QHBox* aPosBox2 = new QHBox(aLinesPane);
aPosBox2->setSpacing(5);
- QLabel* aPosLbl2 = new QLabel( tr( "LBL_POS" ), aPosBox2 );
+ new QLabel( tr( "LBL_POS" ), aPosBox2 );
myPosSpn2 = new QtxDblSpinBox( 0, 1, 0.1, aPosBox2 );
myPosSpn2->setValue( 0.5 );
aLinesLayout->addWidget( aPosBox2 );
deletePlanes();
if (myCutLines) //delete myCutLines;
myCutLines->Destroy();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
//------------------------------------------------------------------------------
void VisuGUI_CutLinesDlg::createPlanes()
{
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView == NULL) return;
if (myCutLines == NULL) return;
if (myPreviewActor != 0) return;
void VisuGUI_CutLinesDlg::deletePlanes()
{
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* aView = VISU::GetViewWindow()){
+ if (SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
aView->RemoveActor(myPreviewActor);
aView->RemoveActor(myPreviewActorGlyphs);
}
myRotXLbl2->setText( tr("LBL_ROT_Z"));
myRotYLbl2->setText( tr("LBL_ROT_X"));
}
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
/*myCutLines->SetOrientation2(getOrientaion(false),
/* float aPos = myCutLines->GetBasePlanePosition();
myBasePlanePos->setText( QString::number(aPos) );
myBasePlanePos->setEnabled(false);*/
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
//myCutLines->SetBasePlanePosition(aPos);
vh->setLabel( i, str.arg(i+1) );
}
// Update preview
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
// myCutLines->GetPL()->Update();
source->Delete();
aPlaneMapper->Delete();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
if (update)
vf->Repaint();
}
QString aTxt = myPosTable->text(theRow, 0);
bool isChanged = !aTxt.isEmpty();
((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged);
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
//Update Preview
if (isDefault) {
//myCutLines->SetDefaultPosition(theRow);
// myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
//Update Preview
void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
//storeToPrsObject(myCutLines);
// myCutLines->GetPL()->Update();
void VisuGUI_CutLinesDlg::onRotation (double theValue)
{
if (myCutLines == NULL) return;
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
{
if (myCutLines == NULL) return;
- SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
//myCutLines->SetBasePlanePosition(theValue.toDouble());
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_CutPlanes_i.hh"
#include "VISU_CutPlanesPL.hxx"
VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
{
- cout<<"### VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane"<<endl;
deletePlanes();
if (myCutPlanes)
myCutPlanes->Destroy();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
void VisuGUI_CutPlanesPane::createPlanes()
{
- if (VISU::GetViewWindow() == NULL) return;
+ if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
if (myCutPlanes == NULL) return;
if (myPreviewActor != 0) return;
myPreviewActor->PickableOff();
myPreviewActor->SetMapper(aPlaneMapper);
aPlaneMapper->Delete();
- VISU::GetViewWindow()->AddActor(myPreviewActor);
+ VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
}
int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
// Update preview
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->GetPL()->Update();
deletePlanes();
createPlanes();
if (myPreviewCheck->isChecked()) {
//Update Preview
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
myCutPlanes->GetPL()->Update();
deletePlanes();
myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow)));
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
//Update Preview
myCutPlanes->GetPL()->Update();
deletePlanes();
void VisuGUI_CutPlanesPane::deletePlanes()
{
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
{
if (myCutPlanes == NULL) return;
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
myCutPlanes->GetPL()->Update();
deletePlanes();
void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
storeToPrsObject(myCutPlanes);
myCutPlanes->GetPL()->Update();
// $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_Displayer.cxx
#include "VisuGUI_Displayer.h"
-#include "VVTK_ViewModel.h"
+
#include "VisuGUI_Tools.h"
+#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
+#include "VVTK_ViewModel.h"
+
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-#include "VISU_ViewManager_i.hh"
+#include <SUIT_MessageBox.h>
VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Application* app )
: LightApp_Displayer(),
if( CORBA::is_nil( anObj ) )
return 0;
- SVTK_Viewer* vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
+ SVTK_Viewer* vtk_viewer = dynamic_cast<VVTK_Viewer*>( aViewFrame );
+ if (!vtk_viewer)
+ vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
if( vtk_viewer )
{
SVTK_ViewWindow* wnd =
void VisuGUI_Displayer::buildPrs3d( SVTK_ViewWindow* wnd, VISU::Prs3d_i* thePrs ) const
{
- VISU_Actor* newAct = VISU::FindActor( wnd, thePrs );
- if( !newAct )
- {
- newAct = thePrs->CreateActor();
+ VISU_Actor* newAct = VISU::FindActor(wnd, thePrs);
+ if (!newAct) {
+ try {
+ newAct = thePrs->CreateActor();
+ } catch (std::runtime_error& exc) {
+ thePrs->RemoveActors();
+
+ INFOS(exc.what());
+ SUIT_MessageBox::warn1
+ (myApp->desktop(), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
+ }
}
- if( newAct )
- {
- wnd->AddActor( newAct );
+ if (newAct) {
+ wnd->AddActor(newAct);
wnd->Repaint();
}
}
-
+// VISU VISUGUI : GUI of VISU component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "LightApp_SelectionMgr.h"
#include "LightApp_VTKSelector.h"
#include "LightApp_Preferences.h"
+#include "LightApp_Displayer.h"
+
+#include "SALOMEDS_IParameters.hxx"
#include "VVTK_ViewManager.h"
#include "VVTK_ViewWindow.h"
#include "VISU_CutLines_i.hh"
#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ActionsDef.h"
#include <vtkRenderer.h>
#include <vtkCamera.h>
#include <vtkTimerLog.h>
+#include <vtkPlane.h>
#include <sstream>
}
//---------------------------------------------------------------
-VisuGUI_Module
-::VisuGUI_Module() :
+VisuGUI_Module::
+VisuGUI_Module() :
VisuGUI()
{
}
//---------------------------------------------------------------
-VisuGUI_Module
-::~VisuGUI_Module()
+VisuGUI_Module::
+~VisuGUI_Module()
{
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::initialize( CAM_Application* theApp )
+VisuGUI_Module::
+initialize( CAM_Application* theApp )
{
VisuGUI::initialize( theApp );
accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Key_Plus, aViewerType );
accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Key_Minus, aViewerType );
- connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
+ connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
+ this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
// Prepare popup menus
QtxPopupMgr* mgr = popupMgr();
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
mgr->setRule( action( GAUSS_ERASE_PRS ),
- aRule + " and (isVisible=true)", true );
+ aRule + " and ({true} in $canBeDisplayed) and (isVisible=true)", true );
createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_DISPLAY"), QIconSet(),
VisuGUI::tr("MEN_DISPLAY"), "", 0, this, false,
this, SLOT(OnDisplayPrs()));
mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display
mgr->setRule( action( GAUSS_DISPLAY_PRS ),
- aRule + " and (isVisible=false)", true );
+ aRule + " and ({true} in $canBeDisplayed) and (isVisible=false)", true );
createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIconSet(),
VisuGUI::tr("MEN_DISPLAY_ONLY"), "", 0, this, false,
this, SLOT(OnDisplayOnlyPrs()));
mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
- aRule, true );
+ aRule + " and ({true} in $canBeDisplayed)", true );
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIconSet(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
tr("MEN_SAVE_CONFIGURATION"), "", 0, this, false,
this, SLOT(OnSaveConfiguration()));
mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 );
- mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
+ mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ),
+ "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIconSet(),
tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false,
//---------------------------------------------------------------
bool
-VisuGUI_Module
-::activateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+activateModule( SUIT_Study* theStudy )
{
VisuGUI::activateModule( theStudy );
//---------------------------------------------------------------
bool
-VisuGUI_Module
-::deactivateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+deactivateModule( SUIT_Study* theStudy )
{
VisuGUI::deactivateModule( theStudy );
//---------------------------------------------------------------
SUIT_ViewManager*
-VisuGUI_Module
-::onCreateViewManager()
+VisuGUI_Module::
+onCreateViewManager()
{
Viewer* aViewer = new Viewer( this, myViewerMap );
return aViewer->getViewManager();
//---------------------------------------------------------------
void
-VisuGUI_Module
-::onLastViewClosed(SUIT_ViewManager* theViewManager)
+VisuGUI_Module::
+onLastViewClosed(SUIT_ViewManager* theViewManager)
{
myViewerMap.erase(theViewManager);
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createPreferences()
+VisuGUI_Module::
+createPreferences()
{
VisuGUI::createPreferences();
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createGaussPointsPreferences()
+VisuGUI_Module::
+createGaussPointsPreferences()
{
int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TTL" ) );
int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), gaussTab );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
setPreferenceProperty( maxSizePref, "max", 100 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_magnification" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createInsideCursorPreferences()
+VisuGUI_Module::
+createInsideCursorPreferences()
{
int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "inside_point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "inside_point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "inside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_min_size" );
setPreferenceProperty( minSizePref, "min", 1 );
setPreferenceProperty( minSizePref, "max", 100 );
int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
setPreferenceProperty( magnificationGr, "columns", 2 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr,
- LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "inside_point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( incrementPref, "step", 0.1 );
-
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createOutsideCursorPreferences()
+VisuGUI_Module::
+createOutsideCursorPreferences()
{
int outsideCursorTab = addPreference( tr( "VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" ) );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "outside_point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "outside_point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "outside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "outside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "outside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createPickingPreferences()
+VisuGUI_Module::
+createPickingPreferences()
{
int pickingTab = addPreference( tr( "VISU_PICKING_PREF_TAB_TTL" ) );
setPreferenceProperty( cursorGr, "columns", 1 );
int cursorSizePref = addPreference( tr( "VISU_PICKING_PREF_CURSOR_SIZE" ), cursorGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
setPreferenceProperty( cursorSizePref, "min", 0 );
setPreferenceProperty( cursorSizePref, "max", 1.0 );
setPreferenceProperty( cursorSizePref, "step", 0.1 );
setPreferenceProperty( pyramidHeightPref, "min", 1 );
setPreferenceProperty( pyramidHeightPref, "max", 100 );
- int selectionColorPref = addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
- LightApp_Preferences::Color, "VISU", "picking_selection_color" );
+ /*int selectionColorPref = */
+ addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
+ LightApp_Preferences::Color, "VISU", "picking_selection_color" );
// Tolerance
int toleranceGr = addPreference( tr( "VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" ), pickingTab );
int pointTolerancePref = addPreference( tr( "VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" ), toleranceGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
setPreferenceProperty( pointTolerancePref, "min", 0.001 );
setPreferenceProperty( pointTolerancePref, "max", 10 );
setPreferenceProperty( pointTolerancePref, "step", 0.01 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createSpaceMousePreferences()
+VisuGUI_Module::
+createSpaceMousePreferences()
{
int mouseTab = addPreference( tr( "VISU_MOUSE_PREF_TAB_TLT" ) );
int mouseGr = addPreference( tr( "VISU_MOUSE_PREF_GROUP_TLT" ), mouseTab );
- int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
+ int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr,
+ LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
QStringList values;
values.append( tr( "VISU_MOUSE_PREF_STANDARD" ) );
values.append( tr( "VISU_MOUSE_PREF_KEYBOARD_FREE" ) );
setPreferenceProperty( mousePref, "indexes", indices );
int keybrdGr = addPreference( tr( "VISU_KEYBOARD_PREF_GROUP_TTL" ), mouseTab );
- int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
+ int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr,
+ LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
setPreferenceProperty( keybrdPref, "max", 1000 );
int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), mouseTab );
setPreferenceProperty( spacemouseGr, "columns", 1 );
- int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func1_btn" ); //decrease_speed_increment
- int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func2_btn" ); //increase_speed_increment
- int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
- int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func4_btn" ); //increase_gauss_point_magnification
- int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func5_btn" ); //dominant_combined_switch
+ int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func1_btn" ); //decrease_speed_increment
+ int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func2_btn" ); //increase_speed_increment
+ int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
+ int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func4_btn" ); //increase_gauss_point_magnification
+ int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func5_btn" ); //dominant_combined_switch
values.clear();
values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) );
values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createRecorderPreferences()
+VisuGUI_Module::
+createRecorderPreferences()
{
int recorderTab = addPreference( tr( "VISU_RECORDER_PREF_TAB_TTL" ) );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::OnCreateGaussPoints()
+VisuGUI_Module::
+OnCreateGaussPoints()
{
double initialTime = vtkTimerLog::GetCPUTime();
- CreatePrs3d<VISU::GaussPoints_i,VVTK_Viewer,VisuGUI_GaussPointsDlg,1>(this,true);
+ CreatePrs3d<VISU::GaussPoints_i, VVTK_Viewer, VisuGUI_GaussPointsDlg, 1>(this);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
void
-VisuGUI_Module
-::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
+VisuGUI_Module::
+OnViewManagerAdded(SUIT_ViewManager* viewMgr)
{
QString type = viewMgr->getViewModel()->getType();
if ( type == VVTK_Viewer::Type() )
- connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
+ connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
+ this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
}
void
-VisuGUI_Module
-::OnViewCreated(SUIT_ViewWindow* view)
+VisuGUI_Module::
+OnViewCreated(SUIT_ViewWindow* view)
{
SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>( view );
if ( viewWindow ) {
}
void
-VisuGUI_Module
-::setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
+VisuGUI_Module::
+setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
{
if ( !viewWindow )
return;
}
void
-VisuGUI_Module
-::setProperty( SVTK_ViewManager* vm, const QString& prop )
+VisuGUI_Module::
+setProperty( SVTK_ViewManager* vm, const QString& prop )
{
if ( !vm )
return;
}
void
-VisuGUI_Module
-::preferencesChanged( const QString& group, const QString& pref )
+VisuGUI_Module::
+preferencesChanged( const QString& group, const QString& pref )
{
VisuGUI::preferencesChanged(group,pref);
//---------------------------------------------------------------
SUIT_ViewManager*
-VisuGUI_Module
-::getViewManager(const QString& theType,
- const bool theIsCreate)
+VisuGUI_Module::
+getViewManager(const QString& theType,
+ const bool theIsCreate)
{
- if(SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
+ if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
return aViewManager;
- if(theIsCreate && VVTK_Viewer::Type() == theType)
+ if (theIsCreate && theType == VVTK_Viewer::Type())
return onCreateViewManager();
return NULL;
//---------------------------------------------------------------
void
-VisuGUI_Module
-::OnEditGaussPoints()
+VisuGUI_Module::
+OnEditGaussPoints()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this,true)){
- aViewWindow->highlight(anIO,1);
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) {
+ // Create VVTK_ViewWindow, if it does not exist
+ if (VVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this)) {
+ EditPrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, anIO, aPrs3d, aViewWindow);
}
}
}
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayPrs()
-{
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs");
-
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- if(LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){
- SALOME_ListIO aSel, aList;
- aSelectionMgr->selectedObjects(aSel);
- extractContainers(aSel, aList);
-
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-
- // is it a Prs3d object ?
- if(!CORBA::is_nil(anObject)){
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Prs3d object");
- if(aPrs3d->GetType() == VISU::TGAUSSPOINTS)
- VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
- else if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- VISU::UpdateViewer<SVTK_Viewer>(this,aPrs3d,false,true,true);
- else if(aType == VVTK_Viewer::Type())
- VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
- }
- continue;
- }
- }
-
- // is it Curve ?
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Curve object");
- PlotCurve( this, aCurve, VISU::eDisplay );
- continue;
- }
-
- // is it Container ?
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Container object");
- PlotContainer( this, aContainer, VISU::eDisplay );
- continue;
- }
-
- // is it Table ?
- if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Table object");
- PlotTable( this, aTable, VISU::eDisplay );
- continue;
- }
- }
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnEraseAll()
-{
- if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- VISU::OnEraseAll<SVTK_Viewer>(this);
- else if(aType == VVTK_Viewer::Type())
- VISU::OnEraseAll<VVTK_Viewer>(this);
- else if(aType == SPlot2d_Viewer::Type())
- VISU::OnEraseAll<SPlot2d_Viewer>(this);
- }
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayOnlyPrs()
-{
- OnEraseAll();
- OnDisplayPrs();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnErasePrs()
-{
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
- SALOME_ListIO aSel, aList;
- aSelectionMgr->selectedObjects(aSel);
- extractContainers(aSel, aList);
-
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this),anIO->getEntry());
- if(!CORBA::is_nil(anObject)){
- VISU::Base_var aBase = VISU::Base::_narrow(anObject);
- if(!CORBA::is_nil(aBase))
- VISU::ErasePrs(this,aBase,true);
- }
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-
//---------------------------------------------------------------
namespace
{
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
// To set visiblity
- VISU::UpdateViewer<VVTK_Viewer>(theModule,aPrs3d,anIsFirst,false,false);
+ VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false);
anIsFirst = false;
// To update selection
}
return aRet;
}
+
+
+const char gSeparator = '_'; // character used to separate parameter names
+const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b)
+/*!
+ * \brief Virtual public
+ *
+ * This method is called just before the study document is saved, so the module has a possibility
+ * to store visual parameters in AttributeParameter attribue(s)
+ */
+void VisuGUI_Module::storeVisualParameters(int savePoint)
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study || !study->studyDS() )
+ return;
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+ SALOMEDS_IParameters ip(ap);
+
+ // viewers counters are used for storing view_numbers in IParameters
+ int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 );
+
+ // componentName is used for encoding of entries when storing them in IParameters
+ _PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS );
+ std::string componentName = visuEng->ComponentDataType();
+
+ QPtrList<SUIT_ViewManager> lst;
+
+ // saving VVTK viewer parameters. VVTK (Gauss Viewers) are NOT created by SalomeApp since
+ // VVTK is declared in VISU, so here we store VVTK view window parameters.
+ // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters.
+ ip.setProperty( "ActiveGaussViewer", "-1" );
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ if ( SUIT_ViewWindow* vwin = vman->getActiveView() ) {
+ // using predefined string "GaussViewer" as "entry".. it's a hardcoded "workaround".
+ // gauss viewer parameters are retrieved using this "entry" string.
+ // name of parameter = caption of gauss ViewWindow
+ // value of parameter = ViewWindow's visual parameters
+ ip.setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() );
+
+ if ( application()->desktop()->activeWindow() == vwin )
+ ip.setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() );
+ vvtkViewers++;
+ }
+ }
+
+ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
+ // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open..
+ /*
+ lst.clear();
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ ip.setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() );
+ */
+
+ // main cycle to store parameters of displayed objects
+ lst.clear();
+ getApp()->viewManagers( lst );
+ vvtkViewers = svtkViewers = plotViewers = 0;
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ QString vType = vman->getType();
+ int* viewsCounter = vType == SVTK_Viewer::Type() ? &svtkViewers :
+ vType == VVTK_Viewer::Type() ? &vvtkViewers :
+ vType == SPlot2d_Viewer::Type() ? &plotViewers : 0;
+
+ // saving VTK actors' properties
+ if ( vType == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers in the same
+ vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
+
+ QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+ for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+ if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( actor->GetVisibility() ) { // store only visible actors
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip.encodeEntry( io->getEntry(), componentName );
+
+ std::string param, vtkParam = vType.latin1(); vtkParam += gSeparator;
+ vtkParam += QString::number( *viewsCounter ).latin1(); vtkParam += gSeparator;
+
+ param = vtkParam + "Visibility";
+ ip.setParameter( entry, param, "On" );
+ param = vtkParam + "Name";
+ ip.setParameter( entry, param, vActor->getName() );
+ param = vtkParam + "RepresentationMode";
+ ip.setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() );
+ param = vtkParam + "Opacity";
+ ip.setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() );
+ float r, g, b;
+ vActor->GetColor(r, g, b);
+ QString colorStr = QString::number( r ); colorStr += gDigitsSep;
+ colorStr += QString::number( g ); colorStr += gDigitsSep;
+ colorStr += QString::number( b );
+ param = vtkParam + "Color";
+ ip.setParameter( entry, param, colorStr.latin1() );
+ param = vtkParam + "LineWidth";
+ ip.setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip.setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip.setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() );
+ }
+ VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
+ if ( scalarMapActor && scalarMapActor->IsShading() ) {
+ param = vtkParam + "Shading";
+ ip.setParameter( entry, param, "On" );
+ }
+ if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
+ param = vtkParam + "ClippingPlane_";
+ for ( int p = 0, nPlanes = vPrs->GetNumberOfClippingPlanes(); p < nPlanes; p++ ) {
+ vtkPlane* plane = vPrs->GetClippingPlane( p );
+ float normal[3], origin[3];
+ plane->GetNormal( normal );
+ plane->GetOrigin( origin );
+ std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[1] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[2] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[0] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[1] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[2] ).latin1();
+ param += QString::number( p+1 ).latin1();
+ ip.setParameter( entry, param, planeValue );
+ }
+ }
+
+ } // hasIO
+ } // salome_actor successfull downcast
+ } // isVisible
+ } // end of ..while.. actors traversal
+ } // if ( vtkView )
+ } // for ( views )
+ (*viewsCounter)++;
+ } // if ( SVTK view model )
+ else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
+ QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+ for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+ if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+ Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+ QPtrList<Plot2d_Curve> curves;
+ plotVF->getCurves( curves );
+
+ Plot2d_Curve* curve;
+ for ( curve = curves.first(); curve; curve = curves.next() ) {
+ if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( curve ) ) {
+ if ( sCurve->hasIO() ) {
+
+ Handle(SALOME_InteractiveObject) io = sCurve->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip.encodeEntry( io->getEntry(), componentName );
+
+ std::string param, plotParam = vType.latin1(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).latin1(); plotParam += gSeparator;
+
+ param = plotParam + "Visibility";
+ ip.setParameter( entry, param, "On" );
+ }
+ }
+ } // for curves
+ } // if ( plotView )
+ } // for ( views )
+ (*viewsCounter)++;
+ } // if ( SPlot2d view model )
+ }
+}
+
+// returns VISU_Actor with IO with given entry
+VISU_Actor* getActor( const QString& entry, SVTK_ViewWindow* vtkView )
+{
+ if ( vtkView && !entry.isEmpty() ) {
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ if ( entry == io->getEntry() )
+ return vActor;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+const int ViewerType = 0;
+const int ViewIndex = 1;
+const int ParamName = 2;
+// visual parameters are stored in strings as follows:
+// ViewerType_ViewNumber_ParamName. '_' is used as separator and should not be used in
+// viewer type or parameter names
+
+// return viewer type substring from parameter name
+std::string getParam( const std::string& paramName, const int index )
+{
+ QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) );
+ if ( !lst.isEmpty() && index < lst.size() )
+ return lst[index];
+ return "";
+}
+
+
+/*!
+ * \brief Virtual public
+ *
+ * This method is called after the study document is opened, so the module has a possibility to restore
+ * visual parameters
+ */
+void VisuGUI_Module::restoreVisualParameters(int savePoint)
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study || !study->studyDS() )
+ return;
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+ SALOMEDS_IParameters ip(ap);
+
+ // actors are stored in a map after displaying of them for quicker access in future
+ QMap<QString, QMap<QString, VISU_Actor*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
+
+ std::vector<std::string> entries = ip.getEntries();
+
+ for ( std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt ) {
+
+ std::vector<std::string> paramNames = ip.getAllParameterNames( *entIt );
+ std::vector<std::string> paramValues = ip.getAllParameterValues( *entIt );
+ std::vector<std::string>::iterator namesIt = paramNames.begin();
+ std::vector<std::string>::iterator valuesIt = paramValues.begin();
+
+ if ( *entIt == "GaussViewer" ) {
+ // parameter names are view window's captions, values - visual parameters.
+ for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+ SUIT_ViewManager* vman = onCreateViewManager();
+ SUIT_ViewWindow* vwin = vman->getActiveView();
+ vwin->setCaption( (*namesIt).c_str() );
+
+ // wait untill the window is really shown. This step fixes MANY bugs..
+ while ( !vwin->isVisible() )
+ qApp->processEvents();
+
+ vwin->setVisualParameters( (*valuesIt).c_str() );
+ }
+ continue; // skip to next entry
+ }
+
+ // entry is a normal entry - it should be "decoded" (setting base adress of component)
+ QString entry( ip.decodeEntry( *entIt ).c_str() );
+
+ for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+ std::string viewerType = ::getParam( *namesIt, ViewerType );
+
+ std::string paramName = ::getParam( *namesIt, ParamName );
+ bool ok;
+ std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
+ int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
+ if ( !ok ) // bad conversion of view index to integer
+ continue;
+
+ // cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
+
+ if ( viewerType == SVTK_Viewer::Type().latin1() ||
+ viewerType == VVTK_Viewer::Type().latin1() ) {
+
+ // used as inner map key for locating the actor.
+ QString viewerTypeIndex = viewerType + QString::number( viewIndex );
+
+ if ( paramName == "Visibility" && displayer() ) {
+ // if VVTK, then we must create viewer first, because
+
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( viewerType, lst );
+
+ // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ // vtkView->getRenderer()->ResetCameraClippingRange();
+ // vtkView->Repaint();
+
+ // store displayed actor so setting of color, opacity, etc. will be much faster
+ QMap<QString, VISU_Actor*> viewActorMap;
+ if ( vtkActors.contains( entry ) )
+ viewActorMap = vtkActors[ entry ];
+ viewActorMap[ viewerTypeIndex ] = getActor( entry, vtkView );
+ vtkActors[ entry ] = viewActorMap;
+ }
+ }
+ else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+ VISU_Actor* vActor = 0;
+ if ( vtkActors.contains( entry ) ) {
+ QMap<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
+ if ( viewActorMap.contains( viewerTypeIndex ) )
+ vActor = viewActorMap[ viewerTypeIndex ];
+ }
+ if ( !vActor )
+ continue;
+
+ QString val( (*valuesIt).c_str() );
+
+ if ( paramName == "Name" )
+ vActor->setName( val.latin1() );
+
+ else if ( paramName == "RepresentationMode" )
+ vActor->SetRepresentation( val.toInt() );
+
+ else if ( paramName == "Opacity" )
+ vActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = QStringList::split( gDigitsSep, val );
+ if ( colors.count() == 3 )
+ vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
+
+ else if ( paramName == "LineWidth" )
+ vActor->SetLineWidth( val.toFloat() );
+
+ else if ( paramName == "ShrinkMode" ) {
+ vActor->SetShrinkable( true );
+ vActor->SetShrink();
+ }
+
+ else if ( paramName == "ShrunkFactor" )
+ vActor->SetShrinkFactor( val.toFloat() );
+
+ else if ( paramName == "Shading" ) {
+ if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+ scalarMapActor->SetShading();
+ }
+
+ else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+ QStringList vals = QStringList::split( gDigitsSep, val );
+ if ( vals.count() == 6 && vActor->GetPrs3d() ) {
+ float normal[3], origin[3];
+ for (int x = 0; x < 3; x++ ) {
+ normal[x] = vals[x].toFloat();
+ origin[x] = vals[x+3].toFloat();
+ }
+ vtkPlane* plane = vtkPlane::New();
+ plane->SetNormal( normal );
+ plane->SetOrigin( origin );
+ vActor->GetPrs3d()->AddClippingPlane( plane );
+ }
+ }
+ } // else ..
+ } // if SVTK
+
+ else if ( viewerType == SPlot2d_Viewer::Type().latin1() ) {
+
+ if ( paramName == "Visibility" && displayer() ) {
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( viewerType, lst );
+
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+ }
+ }
+
+ } // if SPlot2d
+
+ } // for names/parameters iterator
+ } // for entries iterator
+
+ // [ update all SVTK/VVTK views
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( lst );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ if ( !vmodel )
+ continue;
+ if ( vmodel->getType() == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers
+ vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ vtkView->getRenderer()->ResetCameraClippingRange();
+ vtkView->Repaint();
+ }
+ else if ( vmodel->getType() == SPlot2d_Viewer::Type().latin1() ) {
+ Plot2d_ViewWindow* plotView = (Plot2d_ViewWindow*) vman->getActiveView();
+ plotView->getViewFrame()->Repaint();
+ }
+ } // ] end of update views
+
+ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
+ // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we close one
+ // default SVTK if needed.
+ /*
+ QString openedSvtkViewerStr = ip.getProperty( "VtkViewersCount" ).c_str();
+ int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok );
+ if ( ok && openedSvtkViewer == 0 ) {
+ lst.clear();
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ if ( lst.count() )
+ lst.at( 0 )->closeAllViews();
+ }
+ */
+
+ // if active Gauss Viewer is set ( != -1) then raise the gauss view window.
+ bool ok;
+ QString activeGaussViewerStr = ip.getProperty( "ActiveGaussViewer" ).c_str();
+ int activeGaussViewer = activeGaussViewerStr.toInt( &ok );
+ if ( ok && activeGaussViewer != -1 ) {
+ lst.clear();
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
+ SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
+ if ( activeView ) {
+ activeView->setActiveWindow();
+ activeView->setFocus();
+ }
+ }
+ }
+}
+
// File : VisuGUI_Module.h
// Author :
// Module : VISU
-// $Header$
#ifndef VisuGUI_Module_HeaderFile
#define VisuGUI_Module_HeaderFile
getViewManager(const QString& theType,
const bool theIsCreate);
+ virtual
+ void
+ storeVisualParameters(int savePoint);
+
+ virtual
+ void
+ restoreVisualParameters(int savePoint);
+
public slots:
//! Reimplemented method of the module deactivation.
virtual
void
OnEditGaussPoints();
- //! Reimplemented method of the Gauss Points displaying.
- virtual
- void
- OnDisplayPrs();
-
- //! Reimplemented method of the Gauss Points displaying only.
- virtual
- void
- OnDisplayOnlyPrs();
-
- //! Reimplemented method of the Gauss Points full erasing.
- virtual
- void
- OnEraseAll();
-
- //! Reimplemented method of the Gauss Points erasing.
- virtual
- void
- OnErasePrs();
-
//! Virtual method of saving configuration.
virtual
void
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SALOMEGUI_NonIsometricDlg.cxx
-// Author : Vasily Rusyaev
-// Module : VISU
-// $Header$
-
-#include "VisuGUI_NonIsometricDlg.h"
-
-#include "VisuGUI_Tools.h"
-
-#include "VISU_Actor.h"
-#include "VISU_PipeLine.hxx"
-
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
-
-#include "SVTK_ViewWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_ViewWindow.h"
-
-#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SALOME_ListIO.hxx"
-
-#include "QtxDblSpinBox.h"
-
-#include "utilities.h"
-
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-
-using namespace std;
-
-/*!
- Constructor
-*/
-VisuGUI_NonIsometricDlg::VisuGUI_NonIsometricDlg (QWidget* parent, const char* name, bool modal, WFlags fl)
- : QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- if (!name)
- setName("NonIsometricDlg");
- setCaption(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
-
- SVTK_ViewWindow* aViewWnd = VISU::GetViewWindow();
-
- // Create layout for this dialog
- QGridLayout* layoutDlg = new QGridLayout (this);
- layoutDlg->setSpacing(6);
- layoutDlg->setMargin(11);
-
- // Create croup box with grid layout
- QGroupBox* GroupBox = new QGroupBox(this, "GroupBox");
- QGridLayout* glGroupBox = new QGridLayout(GroupBox);
- glGroupBox->setMargin(11);
- glGroupBox->setSpacing(6);
-
- // "X" scaling
- QLabel* TextLabelX = new QLabel (tr("LBL_X"), GroupBox, "TextLabelX");
- m_sbXcoeff = new QtxDblSpinBox(-DBL_MAX, DBL_MAX, 0.1, GroupBox);
- m_sbXcoeff->setMinimumWidth(80);
- m_sbXcoeff->setValue(1.0);
-
- // "Y" scaling
- QLabel* TextLabelY = new QLabel (tr("LBL_Y"), GroupBox, "TextLabelY");
- m_sbYcoeff = new QtxDblSpinBox(-DBL_MAX, DBL_MAX, 0.1, GroupBox);
- m_sbYcoeff->setMinimumWidth(80);
- m_sbYcoeff->setValue(1.0);
-
- // "Z" scaling
- QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), GroupBox, "TextLabelZ");
- m_sbZcoeff = new QtxDblSpinBox(-DBL_MAX, DBL_MAX, 0.1, GroupBox);
- m_sbZcoeff->setMinimumWidth(80);
- m_sbZcoeff->setValue(1.0);
-
- // Get initial values from the current VTK viewer
- if (aViewWnd) {
- double aScaleFactor[3];
- aViewWnd->GetScale(aScaleFactor);
- m_sbXcoeff -> setValue(aScaleFactor[0]);
- m_sbYcoeff -> setValue(aScaleFactor[1]);
- m_sbZcoeff -> setValue(aScaleFactor[2]);
- }
-
- // Create <Reset> button
- m_bReset = new QPushButton(tr("&Reset"), GroupBox, "m_bReset");
-
- // Layout widgets in the group box
- glGroupBox->addWidget(TextLabelX, 0, 0);
- glGroupBox->addWidget(m_sbXcoeff, 0, 1);
- glGroupBox->addWidget(TextLabelY, 0, 2);
- glGroupBox->addWidget(m_sbYcoeff, 0, 3);
- glGroupBox->addWidget(TextLabelZ, 0, 4);
- glGroupBox->addWidget(m_sbZcoeff, 0, 5);
- glGroupBox->addWidget(m_bReset, 0, 6);
-
- // OK, CANCEL, Apply button
- QGroupBox* aWgt = new QGroupBox(this);
- QHBoxLayout* aHBoxLayout = new QHBoxLayout(aWgt);
- aHBoxLayout->setMargin(11);
- aHBoxLayout->setSpacing(6);
- // Create <OK> button
- QPushButton* m_bOk = new QPushButton(tr("O&K"), aWgt, "m_bOk");
- m_bOk->setDefault(TRUE);
- m_bOk->setAutoDefault(TRUE);
- // Create <Apply> button
- QPushButton* m_bApply = new QPushButton(tr("&Apply"), aWgt, "m_bApply");
- m_bApply->setAutoDefault(TRUE);
- // Create <Cancel> button
- QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aWgt, "m_bCancel");
- m_bCancel->setAutoDefault(TRUE);
-
- // Layout buttons
- aHBoxLayout->addWidget(m_bOk);
- aHBoxLayout->addWidget(m_bApply);
- aHBoxLayout->addStretch();
- aHBoxLayout->addWidget(m_bCancel);
-
- // Layout top level widgets
- layoutDlg->addWidget(GroupBox,0,0);
- layoutDlg->addWidget(aWgt,1,0);
-
- // signals and slots connections
- connect(m_bCancel, SIGNAL(clicked()), this, SLOT(reject()));
- connect(m_bOk, SIGNAL(clicked()), this, SLOT(onClickOk()));
- connect(m_bApply, SIGNAL(clicked()), this, SLOT(onClickApply()));
- connect(m_bReset, SIGNAL(clicked()), this, SLOT(onClickReset()));
-
- this->resize(100, this->sizeHint().height());
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-VisuGUI_NonIsometricDlg::~VisuGUI_NonIsometricDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-void VisuGUI_NonIsometricDlg::onClickOk()
-{
- //apply changes
- onClickApply();
- //Close dialog
- accept();
-}
-
-void VisuGUI_NonIsometricDlg::onClickApply()
-{
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
- LightApp_SelectionMgr* mgr = anApp->selectionMgr();
-
- SVTK_ViewWindow* vf = VISU::GetViewWindow();
- if (!vf)
- return;
-
- double aScale[3] = {m_sbXcoeff->value(), m_sbYcoeff->value(), m_sbZcoeff->value()};
- vf->SetScale(aScale);
-
- SALOME_ListIO selected;
- mgr->selectedObjects(selected);
- SALOME_ListIteratorOfListIO Itinit(selected);
-
- if (vf)
- for (; Itinit.More(); Itinit.Next()) {
- vf->highlight(Itinit.Value(), true);
- }
-}
-
-void VisuGUI_NonIsometricDlg::onClickReset()
-{
- m_bReset->setFocus();
- m_sbXcoeff->setValue(1.0);
- m_sbYcoeff->setValue(1.0);
- m_sbZcoeff->setValue(1.0);
-}
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_ViewManager_i.hh"
#include "VISU_Plot3DPL.hxx"
-#include "SALOME_Actor.h"
#include "SVTK_ViewWindow.h"
+
+#include "SALOME_Actor.h"
#include "SUIT_Desktop.h"
#include <qlayout.h>
//=======================================================================
VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent)
: QVBox(parent), myInitFromPrs(false), myPreviewActor(NULL),
- myViewWindow(VISU::GetViewWindow()), myPrs(NULL), myPipeCopy(NULL)
+ myViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>()), myPrs(NULL), myPipeCopy(NULL)
{
layout()->setAlignment(Qt::AlignTop);
setSpacing(6);
// Module : VISU
#include "VisuGUI_PopupTools.h"
+
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_Tools.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_Study.h"
+
+#include "VISU_Result_i.hh"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
-#include "VISU_Result_i.hh"
+
#include "SalomeApp_Study.h"
+#include "LightApp_Study.h"
using namespace VISU;
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ){
- if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ){
+ if (SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
+ if (VISU_Actor* anVISUActor = FindActor(aView, entry(ind).latin1())) {
int aRepresent = anVISUActor->GetRepresentation();
- switch ( aRepresent ){
+ switch (aRepresent) {
ENUM2STRING( aResStr, VISU::POINT );
ENUM2STRING( aResStr, VISU::WIREFRAME );
ENUM2STRING( aResStr, VISU::SHADED );
const QString& theEntry)
{
typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule))
- if(VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1()))
+ if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule))
+ if (VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1()))
return anActor->GetVisibility() ? "true" : "false";
return QString();
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
if ( anVISUActor->IsShrunkable() )
aResStr = anVISUActor->IsShrunk() ? "1" : "0";
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
if ( VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor) )
aResStr = anActor->IsShading() ? "1" : "0";
{
QString aResStr;
- if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
- {
- VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
- aResStr = anActor ? "1" : "0";
- }
-
+ {
+ VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
+ aResStr = anActor ? "1" : "0";
+ }
+
return aResStr;
}
// File : VisuGUI_Module.h
// Author :
// Module : VISU
-// $Header$
#ifndef VisuGUI_Prs3dTools_HeaderFile
#define VisuGUI_Prs3dTools_HeaderFile
template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
void
EditPrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs3d)
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow)
{
- if(TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)){
+ if (TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)) {
TDlg* aDlg = new TDlg (theModule);
aDlg->initFromPrsObject(aPrs3d);
if (runAndWait(aDlg,TIsDlgModal)) {
try {
aPrs3d->UpdateActors();
} catch (std::runtime_error& exc) {
+ aPrs3d->RemoveActors();
+
INFOS(exc.what());
SUIT_MessageBox::warn1
(GetDesktop(theModule), QObject::tr("WRN_VISU"),
QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
QObject::tr("BUT_OK"));
-
- aPrs3d->RemoveActors();
}
- typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
+ if (theViewWindow) {
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
}
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
template<class TPrs3d_i, class TDlg, int TIsDlgModal>
inline
void
- EditPrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs3d)
+ EditPrs3d(VisuGUI* theModule,
+ Handle(SALOME_InteractiveObject)& theIO,
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow = NULL)
{
- EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg,TIsDlgModal>(theModule,thePrs3d);
+ SVTK_ViewWindow* aViewWindow = theViewWindow;
+ if (!aViewWindow)
+ // Create SVTK_ViewWindow, if it does not exist
+ aViewWindow = GetViewWindow<SVTK_Viewer>(theModule);
+ if (aViewWindow) {
+ EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg,TIsDlgModal>(theModule, thePrs3d, aViewWindow);
+ aViewWindow->highlight(theIO, 1);
+ }
}
//---------------------------------------------------------------
bool
CreatePrs3d(VisuGUI* theModule,
_PTR(SObject) theTimeStamp,
- const Handle(SALOME_InteractiveObject)& theIO,
- const bool theIsCreateView = false)
+ const Handle(SALOME_InteractiveObject)& theIO)
{
Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
bool isExist;
QString aType = Storable::FindValue(aMap,"myType",&isExist);
- if(!isExist || aType.toInt() != TTIMESTAMP )
+ if (!isExist || aType.toInt() != TTIMESTAMP )
return false;
QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
- //
- int aPos = GetFreePositionOfDefaultScalarBar(theModule);
- GetResourceMgr()->setValue("VISU","scalar_bar_position_num",aPos);
- //
+
+ // Create new TViewWindow instance, if it does not exist.
+ typedef typename TViewer::TViewWindow TViewWindow;
+ TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule);
+
+ // Define free position for scalar bar.
+ int aPos = GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
+ GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
+
QApplication::setOverrideCursor(Qt::waitCursor);
-
+
TPrs3d_i* aPrs3d =
CreatePrs3d<TPrs3d_i>(theModule,
theTimeStamp,
(Entity)anEntity.toInt(),
aFieldName.latin1(),
aTimeStampId.toInt());
-
+
QApplication::restoreOverrideCursor();
- if(aPrs3d){
+ if (aPrs3d) {
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
- if(!aValue){
- if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode
+ if (!aValue) {
+ if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
aDlg->initFromPrsObject(aPrs3d);
- if(runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
+ if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
CreateCurves( theModule,
}
}
}
- PublishInView<TViewer>(theModule,aPrs3d,true,theIsCreateView);
- AddScalarBarPosition(theModule,aPrs3d,aPos);
+ // Display created presentation.
+ if (aViewWindow) {
+ PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
+ aViewWindow->onFitAll();
+
+ AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+ }
return true;
}
return false;
}
-
+
//---------------------------------------------------------------
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
inline
void
- CreatePrs3d(VisuGUI* theModule,
- const bool theIsCreateView = true)
+ CreatePrs3d(VisuGUI* theModule)
{
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
return;
-
+
_PTR(SObject) aTimeStampSObj;
Handle(SALOME_InteractiveObject) anIO;
- if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+ if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
return;
-
- if(!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO,theIsCreateView))
+
+ // Create new TViewWindow instance, if it does not exist.
+ typedef typename TViewer::TViewWindow TViewWindow;
+ if (!GetViewWindow<TViewer>(theModule))
return;
-
+
+ if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
+ return;
+
theModule->application()->putInfo(QObject::tr("INF_DONE"));
-
- typedef typename TViewer::TViewWindow TView;
- if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView))
- aView->onFitAll();
}
template<class TPrs3d_i, class TDlg, int IsDlgModal>
inline
void
- CreatePrs3d(VisuGUI* theModule,
- const bool theIsCreateView = true)
+ CreatePrs3d(VisuGUI* theModule)
{
- if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
+ if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()) {
QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
- else if(aType == VVTK_Viewer::Type())
- CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
+ if (aType == VVTK_Viewer::Type())
+ CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule);
+ else
+ CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule);
}
}
-
}
#endif
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
-
-#include "SVTK_FontWidget.h"
-
-#include "SVTK_ViewWindow.h"
+#include "VisuGUI_ViewTools.h"
#include "SVTK_ViewWindow.h"
+#include "SVTK_FontWidget.h"
#include "VISUConfig.hh"
#include "VISU_Convertor.hxx"
VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref):
QVBox(parent), myPreviewActor(0)
{
- myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80;
- myHorX = 0.20; myHorY = 0.01; myHorW = 0.60; myHorH = 0.12;
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ QString propertyName;
+ propertyName = QString("scalar_bar_vertical_");
+ myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", myVerX);
+ myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", myVerY);
+ myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", myVerW);
+ myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",myVerH);
+
+ propertyName = QString("scalar_bar_horizontal_");
+ myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", myHorX);
+ myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", myHorY);
+ myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", myHorW);
+ myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",myHorH);
+
Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0;
myRangeMode = -1;
void VisuGUI_ScalarBarPane::updatePreview()
{
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
deleteScalarBar();
createScalarBar();
vf->Repaint();
*/
void VisuGUI_ScalarBarPane::createScalarBar()
{
- if (VISU::GetViewWindow() == NULL) return;
+ if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
if (myPreviewActor != 0) return;
if (myScalarMap == NULL) return;
- if(!check()) return;
+ if (!check()) return;
if ( myBusy ) return;
aScalarBarActor->Modified();
- VISU::GetViewWindow()->AddActor(myPreviewActor);
+ VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
myBusy = false;
}
if ( myBusy ) return;
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()){
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
vf->RemoveActor(myPreviewActor);
myPreviewActor->GetScalarBar()->VisibilityOff();
}
void VisuGUI_ScalarBarPane::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
createScalarBar();
} else {
// Module : VISU
#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+
#include "VisuGUI_Tools.h"
+
#include "VISU_Result_i.hh"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
+
+#include "VISU_ScalarMapPL.hxx"
#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+
+#include "VISU_Convertor.hxx"
+
#include "SalomeApp_Module.h"
#include "LightApp_SelectionMgr.h"
#include "SUIT_Desktop.h"
-#include "VISU_ScalarMapPL.hxx"
#include "SALOME_ListIO.hxx"
-#include "VISU_Convertor.hxx"
-
#include "SALOMEDSClient_AttributeComment.hxx"
#include "SALOMEDSClient_AttributeName.hxx"
VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
: QDialog(VISU::GetDesktop(theModule), "VisuGUI_ScalarMapOnDeformedShapeDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myIsAnimation(false),
myVisuGUI(theModule)
{
myPrs = NULL;
TopGroupLayout->addWidget(FieldLabel, 1, 0);
TopGroupLayout->addWidget(myFieldsCombo,1,1);
-
+
// TimeStamps combo box
QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
-
+
//
aTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
-
}
-void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim)
+void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject
+ (VISU::ScalarMapOnDeformedShape_i* thePrs, bool isAnim)
{
+ myIsAnimation = isAnim;
myPrs = thePrs;
- setFactor(thePrs->GetScale());
+ setFactor(myPrs->GetScale());
myTimeStampsCombo->setDisabled(isAnim);
-
- QString aFieldName(thePrs->GetScalarFieldName());
- float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetMeshName().c_str(),
- thePrs->GetScalarFieldName().c_str(),
- thePrs->GetScalarIteration(),
- thePrs->GetScalarEntity());
+
+ QString aFieldName(myPrs->GetScalarFieldName());
+ float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ myPrs->GetScalarFieldName().c_str(),
+ myPrs->GetScalarIteration(),
+ myPrs->GetScalarEntity());
QString aIteration(QString("%1").arg(aIterFloat));
-
+
if (myMeshFieldsTimes.size() == 0)
{
// find all fields and time stamps on it
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+ _PTR(GenericAttribute) anTmpAttr;
+ if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aTmpComment (anTmpAttr);
+ string aTmpComm = aTmpComment->Value();
+ QString aTmpstrIn (aTmpComm.c_str());
+ VISU::Storable::TRestoringMap aTmpaMap;
+ VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+ bool aTmpisExist;
+ VISU::VISUType aTmpType =
+ (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+ switch(aTmpType){
+ case VISU::TTIMESTAMP:
+ {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD:
+ {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION:
+ {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
aSObject = aSObject->GetFather();
aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
+
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- VISU::Result_var aResult;
if (CORBA::is_nil(anObject)) {
mySelectionObj = mySelectionObj->GetFather();
}
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
- _PTR(AttributeComment) aComment (anAttr);
- string aComm = aComment->Value();
- QString strIn (aComm.c_str());
- VISU::Storable::TRestoringMap aMap;
- VISU::Storable::StrToMap(strIn,aMap);
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
- if (isExist) {
- if ((aType == VISU::TTIMESTAMP)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- QString aMeshName = VISU::getValue(aChildSObj,"myMeshName");
- if(QString(thePrs->GetMeshName().c_str()) != aMeshName) continue;
- myCurrMeshName = aMeshName;
- QString aFieldName = VISU::getValue(aChildSObj,"myFieldName");
- QString aTimeIter = VISU::getValue(aChildSObj,"myTimeStampId");
- QString aEntity = VISU::getValue(aChildSObj,"myEntityId");
- VISU::TEntity anEntity;
- switch(aEntity.toInt()){
- case 0: anEntity = VISU::NODE_ENTITY; break;
- case 1: anEntity = VISU::EDGE_ENTITY; break;
- case 2: anEntity = VISU::FACE_ENTITY; break;
- case 3: anEntity = VISU::CELL_ENTITY; break;
- }
- TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
- TFE aKey(aFieldName.latin1(),anEntity);
- aFieldsMap[aKey][aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
- aFieldName.latin1(),
- aTimeIter.toInt(),
- anEntity);
- }
- }
- }
- }
- }
}
}
-
- AddAllFieldNames();
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap(strIn,aMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+ if (isExist) {
+ if ((aType == VISU::TTIMESTAMP)) {
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ QString aMeshName = VISU::getValue(aChildSObj, "myMeshName");
+ if (QString(myPrs->GetMeshName().c_str()) != aMeshName) continue;
+ myCurrMeshName = aMeshName;
+ QString aFieldName = VISU::getValue(aChildSObj, "myFieldName");
+ QString aTimeIter = VISU::getValue(aChildSObj, "myTimeStampId");
+ QString aEntity = VISU::getValue(aChildSObj, "myEntityId");
+ VISU::TEntity anEntity;
+ switch (aEntity.toInt()) {
+ case 0: anEntity = VISU::NODE_ENTITY; break;
+ case 1: anEntity = VISU::EDGE_ENTITY; break;
+ case 2: anEntity = VISU::FACE_ENTITY; break;
+ case 3: anEntity = VISU::CELL_ENTITY; break;
+ }
+ TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
+ TFE aKey (aFieldName.latin1(), anEntity);
+ aFieldsMap[aKey][aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ aFieldName.latin1(),
+ aTimeIter.toInt(),
+ anEntity);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ AddAllFieldNames();
}
myFieldsCombo->setCurrentText(aFieldName);
AddAllTimes(myFieldsCombo->currentText());
myScalarPane->initFromPrsObject(myPrs);
}
-int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalar) {
-
+int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject
+ (VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalars, int theIter)
+{
thePrs->SetScale(getFactor());
-
- thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
- myPrs->GetScalarFieldName().c_str(),
- myPrs->GetScalarIteration(),
- myPrs->GetScalarEntity());
- if (theUpdateScalar) SetScalarField();
+ if (myIsAnimation)
+ thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+ getCurrentScalarFieldName().latin1(),
+ theIter,
+ myPrs->GetScalarEntity());
+ else
+ thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+ getCurrentScalarFieldName().latin1(),
+ myTimeStampsCombo->currentItem() + 1,
+ myPrs->GetScalarEntity());
+
+ if (theUpdateScalars) SetScalarField();
thePrs->ShowColored(true);
myScalarPane->storeToPrsObject(thePrs);
-
+
myPrs = thePrs;
return 1;
aFieldName.latin1(),
theIter,
anEntity);
-
+
myScalarPane->storeToPrsObject(myPrs);
UpdateScalarField();
void initFromPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim=false);
- int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalar=true);
+ int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalars=true,int theIter=1);
int getCurrentScalarFieldNamePos();
QString getCurrentScalarFieldName();
TMF myMeshFieldsTimes;
QString myCurrMeshName;
+ int myCurrScalarIter;
+ bool myIsAnimation;
_PTR(SObject) mySelectionObj;
VISU::ScalarMapOnDeformedShape_i* myPrs;
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_Actor.h"
#include "VISU_PrsObject_i.hh"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
#include "SVTK_Selector.h"
#include "utilities.h"
// Activate Points pane
myWidgetStack->raiseWidget(myPointsPane);
- if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule))
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
aViewWindow->SetSelectionMode(NodeSelection);
onSelectionEvent();
void VisuGUI_SelectionDlg::onSelectionChange (int theId)
{
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
if (!aViewWindow) return;
switch (theId) {
void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
{
- if( mySelectionDlg )
- {
+ if (mySelectionDlg) {
mySelectionDlg = NULL;
disconnect(mySelectionMgr,0,0,0);
- if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule)){
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
switch(aViewWindow->SelectionMode()){
case NodeSelection:
case CellSelection:
#define ABS(a) (a>=0)?a:-a
void VisuGUI_SelectionDlg::onSelectionEvent() {
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
if (!aViewWindow) return;
- switch(aViewWindow->SelectionMode()){
+ switch (aViewWindow->SelectionMode()) {
case NodeSelection:
case CellSelection:
case ActorSelection:
QLabel* theFieldName)
{
SalomeApp_Application* anApp = theModule->getApp();
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theModule);
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if (!aViewWindow) return false;
SVTK_Selector* aSelector = aViewWindow->GetSelector();
connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int)));
- // Find All prs obj
- //SUIT_Study* aActiveStudy = VISU::(myVisuGUI);
+ // Find all fields and time stamps on it
_PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
SALOME_ListIO selected;
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+ _PTR(GenericAttribute) anTmpAttr;
+ if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aTmpComment (anTmpAttr);
+ string aTmpComm = aTmpComment->Value();
+ QString aTmpstrIn (aTmpComm.c_str());
+ VISU::Storable::TRestoringMap aTmpaMap;
+ VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+ bool aTmpisExist;
+ VISU::VISUType aTmpType =
+ (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+ switch (aTmpType) {
+ case VISU::TTIMESTAMP:
+ {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD:
+ {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION:
+ {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
aSObject = aSObject->GetFather();
aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
+
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- VISU::Result_var aResult;
if (CORBA::is_nil(anObject)) {
mySelectionObj = mySelectionObj->GetFather();
}
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-
- if (!CORBA::is_nil(aChildObject)) {
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
- if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
- (aPrsObj->GetType() != VISU::TMESH)) {
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName (anAttr);
- myPrsLst += QString(aName->Value().c_str());
- myPrsList.append(aPrsObj);
- continue;
- }
- }
- }
- }
- // else { // This is not a Prs object
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
- _PTR(AttributeComment) aComment (anAttr);
- string aComm = aComment->Value();
- QString strIn (aComm.c_str());
- VISU::Storable::TRestoringMap aMap;
- VISU::Storable::StrToMap(strIn,aMap);
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
- if (isExist) {
- if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- switch (aType) {
- case VISU::TFAMILY:
- myFamilisLst += QString(aName->Value().c_str());
- myFamilyList.append(aPrsObj);
- break;
- case VISU::TGROUP:
- myGroupsLst += QString(aName->Value().c_str());
- myGroupList.append(aPrsObj);
- break;
- case VISU::TENTITY:
- myEntitiesLst += QString(aName->Value().c_str());
- myEntityList.append(aPrsObj);
- break;
- }
- }
- }
- }
- }
+ }
+ }
+
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+ if (!CORBA::is_nil(aChildObject)) {
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
+ if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
+ (aPrsObj->GetType() != VISU::TMESH)) {
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (anAttr);
+ myPrsLst += QString(aName->Value().c_str());
+ myPrsList.append(aPrsObj);
+ continue;
+ }
+ }
+ }
+ }
+
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap(strIn,aMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+ if (isExist) {
+ if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ switch (aType) {
+ case VISU::TFAMILY:
+ myFamilisLst += QString(aName->Value().c_str());
+ myFamilyList.append(aPrsObj);
+ break;
+ case VISU::TGROUP:
+ myGroupsLst += QString(aName->Value().c_str());
+ myGroupList.append(aPrsObj);
+ break;
+ case VISU::TENTITY:
+ myEntitiesLst += QString(aName->Value().c_str());
+ myEntityList.append(aPrsObj);
+ break;
+ }
+ }
+ }
+ }
}
}
}
}
-
void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs)
{
myScalarPane->initFromPrsObject(thePrs);
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : VisuGUI_SweepPrefDlg.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
-// Module : VISU
-// $Header$
-
-using namespace std;
-#include "VisuGUI_SweepPrefDlg.h"
-#include <qlayout.h>
-
-/*!
- Constructor
-*/
-VisuGUI_SweepPrefDlg::VisuGUI_SweepPrefDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
- : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
-{
- if (!name)
- setName("VisuGUI_SweepPrefDlg");
- setCaption(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
-
- QVBoxLayout* TopLayout = new QVBoxLayout( this );
- TopLayout->setSpacing( 6 );
- TopLayout->setMargin( 11 );
-
- TopGroup = new QGroupBox( this, "TopGroup" );
- TopGroup->setColumnLayout(0, Qt::Vertical );
- TopGroup->layout()->setSpacing( 0 );
- TopGroup->layout()->setMargin( 0 );
- QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() );
- TopGroupLayout->setAlignment( Qt::AlignTop );
- TopGroupLayout->setSpacing( 6 );
- TopGroupLayout->setMargin( 11 );
-
- TimeLabel = new QLabel (tr("LBL_TIME_STEP"), TopGroup, "TimeLabel");
- TimeSpin = new QtxDblSpinBox( 0.1, 1000.0, 0.1, TopGroup );
- TimeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- TimeSpin->setMinimumSize( 70, 0 );
- TimeSpin->setValue( 0.2 );
-
- CyclesLabel = new QLabel (tr("LBL_NB_CYCLES"), TopGroup, "CyclesLabel");
- CyclesSpin = new QSpinBox( 1, 100, 1, TopGroup, "CyclesSpin" );
- CyclesSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- CyclesSpin->setMinimumSize( 70, 0 );
- CyclesSpin->setValue( 1 );
-
- StepsLabel = new QLabel (tr("LBL_NB_STEPS"), TopGroup, "StepsLabel");
- StepsSpin = new QSpinBox( 1, 200, 1, TopGroup, "StepsSpin" );
- StepsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- StepsSpin->setMinimumSize( 70, 0 );
- StepsSpin->setValue( 20 );
-
- TopGroupLayout->addWidget( TimeLabel, 0, 0 );
- TopGroupLayout->addWidget( TimeSpin, 0, 1 );
- TopGroupLayout->addWidget( CyclesLabel, 1, 0 );
- TopGroupLayout->addWidget( CyclesSpin, 1, 1 );
- TopGroupLayout->addWidget( StepsLabel, 2, 0 );
- TopGroupLayout->addWidget( StepsSpin, 2, 1 );
-
- GroupButtons = new QGroupBox( this, "GroupButtons" );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 );
- GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
- buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
- buttonCancel->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
-
- TopLayout->addWidget( TopGroup, 0, 0);
- TopLayout->addWidget( GroupButtons, 1, 0 );
-
- // signals and slots connections ===========================================
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
-}
-
-/*!
- Destructor
-*/
-VisuGUI_SweepPrefDlg::~VisuGUI_SweepPrefDlg()
-{
-}
-
-/*!
- Sets Time step
-*/
-void VisuGUI_SweepPrefDlg::setTimeStep( double step )
-{
- TimeSpin->setValue( step );
-}
-
-/*!
- Gets Time step
-*/
-double VisuGUI_SweepPrefDlg::getTimeStep()
-{
- return TimeSpin->value();
-}
-
-/*!
- Sets Nb of cycles
-*/
-void VisuGUI_SweepPrefDlg::setNbCycles( int nbc )
-{
- CyclesSpin->setValue( nbc );
-}
-
-/*!
- Gets Nb of cycles
-*/
-int VisuGUI_SweepPrefDlg::getNbCycles()
-{
- return CyclesSpin->value();
-}
-
-/*!
- Sets Nb of Steps
-*/
-void VisuGUI_SweepPrefDlg::setNbSteps( int nbs )
-{
- StepsSpin->setValue( nbs );
-}
-
-/*!
- Gets Nb of Steps
-*/
-int VisuGUI_SweepPrefDlg::getNbSteps()
-{
- return StepsSpin->value();
-}
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : VisuGUI_SweepPrefDlg.h
-// Author : Laurent CORNABE & Hubert ROLLAND
-// Module : VISU
-// $Header$
-
-#ifndef VISUGUI_SWEEPPREFDLG_H
-#define VISUGUI_SWEEPPREFDLG_H
-
-#include <qdialog.h>
-#include <qgroupbox.h>
-#include <qpushbutton.h>
-#include <qspinbox.h>
-#include <qlabel.h>
-#include "QtxDblSpinBox.h"
-
-class VisuGUI_SweepPrefDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_SweepPrefDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~VisuGUI_SweepPrefDlg();
-
- void setTimeStep( double step );
- double getTimeStep();
- void setNbCycles( int nbc );
- int getNbCycles();
- void setNbSteps ( int nbs );
- int getNbSteps ();
-
-private:
- QGroupBox* TopGroup;
- QLabel* TimeLabel;
- QtxDblSpinBox* TimeSpin;
- QLabel* CyclesLabel;
- QSpinBox* CyclesSpin;
- QLabel* StepsLabel;
- QSpinBox* StepsSpin;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
-};
-
-#endif // VISUGUI_SWEEPPREFDLG_H
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VisuGUI_DeformedShapeDlg.h"
#include "VisuGUI_CutPlanesDlg.h"
#include "VisuGUI_CutLinesDlg.h"
#define MAXVAL 1e10
ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator)
- : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myAnimator(theAnimator), myViewWindow(theAnimator->getViewer())
+ : QDialog(theParent, "ArrangeDlg", true,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myAnimator(theAnimator),
+ myViewWindow(theAnimator->getViewer())
{
myCurrent = 0;
init();
QStringList aFieldNames;
// Find names of fields
- for (int i = 0; i < theAnimator->getNbFields(); i++) {
- aFieldNames.append(VISU::getValue(theAnimator->getFieldData(i).myField, "myName"));
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ aFieldNames.append(VISU::getValue(myAnimator->getFieldData(i).myField, "myName"));
Offset aOffs;
aOffs.myOffset[0] = myAnimator->getFieldData(i).myOffset[0];
aOffs.myOffset[1] = myAnimator->getFieldData(i).myOffset[1];
ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow)
: QDialog(theParent, "ArrangeDlg", true, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myAnimator(0), myViewWindow(theViewWindow)
+ myAnimator(NULL), myViewWindow(theViewWindow)
{
myCurrent = 0;
init();
void ArrangeDlg::accept()
{
- if (myAnimator) {
+ if (myAnimator != NULL) {
acceptAnimation();
} else {
acceptViewWindow();
QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6);
aMainLayout->setSpacing(5);
+ // Range of time stamps
QFrame* aRangeGrp = new QFrame(this);
QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp );
aRangeLayout->setSpacing( 6 );
aRangeLayout->addMultiCellWidget(myUseRangeChk, 0, 0, 0, 3);
myUseRangeChk->setChecked(myAnimator->isRangeDefined());
+ double aMaxTime = myAnimator->getMaxTime();
+ double aMinTime = myAnimator->getMinTime();
+ double aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+
QLabel* aMinLbl = new QLabel("From", aRangeGrp);
aMinLbl->setEnabled(myUseRangeChk->isChecked());
aRangeLayout->addWidget(aMinLbl, 1, 0);
- double aStep = (myAnimator->getMaxTime() - myAnimator->getMinTime())/(theAnimator->getFieldData(0).myNbTimes - 1);
- myMinVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+ myMinVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
myMinVal->setEnabled(myUseRangeChk->isChecked());
if (myUseRangeChk->isChecked())
myMinVal->setValue( myAnimator->getMinRange() );
else
- myMinVal->setValue( myAnimator->getMinTime() );
+ myMinVal->setValue( aMinTime );
connect(myMinVal, SIGNAL( valueChanged(double)),
this, SLOT( onMinValue(double) ));
QLabel* aMaxLbl = new QLabel("To", aRangeGrp);
aMaxLbl->setEnabled(myUseRangeChk->isChecked());
aRangeLayout->addWidget(aMaxLbl, 1, 2);
- myMaxVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+ myMaxVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
myMaxVal->setEnabled(myUseRangeChk->isChecked());
if (myUseRangeChk->isChecked())
myMaxVal->setValue( myAnimator->getMaxRange() );
else
- myMaxVal->setValue( myAnimator->getMaxTime() );
+ myMaxVal->setValue( aMaxTime );
connect(myMaxVal, SIGNAL( valueChanged(double)),
this, SLOT( onMaxValue(double) ));
aMainLayout->addWidget(aRangeGrp);
+ // Fields and Properties
QHBox* aPropFrame = new QHBox(this);
aPropFrame->setSpacing(5);
myFieldLst = new QListBox(aNamesBox);
QStringList aFieldNames;
// Find names of fields
- for (int i = 0; i < theAnimator->getNbFields(); i++) {
- _PTR(SObject) aSO = theAnimator->getFieldData(i).myField;
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ _PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
aFieldNames.append(VISU::getValue(aSO, "myName"));
}
myFieldLst->insertStringList(aFieldNames);
// this, SLOT( onScalarBarDlg() ) );
myPropBtn = new QPushButton("Properties...", aPropBox);
- // myPropBtn->setEnabled(theAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
+ // myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
connect( myPropBtn, SIGNAL( clicked() ),
this, SLOT( onPreferencesDlg() ) );
myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
- myTypeCombo->setCurrentItem(TSCALARMAPONDEFORMEDSHAPE_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]);
break;
case VISU::TVECTORS: //Vectors
myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
if (aDlg->exec())
{
int anbFrames=aDlg->getCurrentScalarNbIterations();
+ int aIter = 0;
for (int i = 0; i < aData.myNbFrames; i++){
TYPE* aCurrPrs_i = dynamic_cast<TYPE*>(aData.myPrs[i]);
+ aIter = i+1;
if(i+1 > anbFrames)
- aDlg->SetScalarField(anbFrames);
- else
- aDlg->SetScalarField(i+1);
- aDlg->storeToPrsObject(aCurrPrs_i,false);
+ aIter=anbFrames;
+ aDlg->storeToPrsObject(aCurrPrs_i,false,aIter);
}
}
delete aDlg;
myAnimator = new VISU_TimeAnimation (theStudy);
myAnimator->setSpeed(1);
- myAnimator->setViewer(VISU::GetViewWindow(theModule));
+ myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
SUIT_Study* aStudy = VISU::GetAppStudy(myModule);
connect(aStudy, SIGNAL(destroyed()), this, SLOT(close()));
+ connect(myAnimator->getViewer(), SIGNAL(destroyed()), this, SLOT(close()));
+ connect(myAnimator->getViewer(), SIGNAL(closing(SUIT_ViewWindow*)), this, SLOT(close()));
+
aMainLayout->addWidget(aBtnBox);
myPlayFrame->setEnabled(false);
//------------------------------------------------------------------------
VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg()
{
- delete myAnimator;
+ if(myAnimator != NULL){
+ delete myAnimator;
+ myAnimator = NULL;
+ }
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
{
- myAnimator->stopAnimation();
- myAnimator->wait(500);
- if (myAnimator->running() && (! myAnimator->finished())) {
- isClosing = true;
- myEvent = theEvent;
+ if(myAnimator != NULL){
+ myAnimator->stopAnimation();
+ myAnimator->wait(500);
+ if (myAnimator->running() && (! myAnimator->finished())) {
+ isClosing = true;
+ myEvent = theEvent;
+ // * Destroing data in myAnimator before study closed.
+ // * 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();
+ }
+ } else {
+ QDialog::closeEvent(theEvent);
+ }
} else {
QDialog::closeEvent(theEvent);
}
#include "VisuGUI_Tools.h"
+#include "VisuGUI.h"
+#include "VisuGUI_ViewTools.h"
+
#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
-#include "OB_Browser.h"
#include "LightApp_DataObject.h"
#include "LightApp_SelectionMgr.h"
+#include "OB_Browser.h"
+
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
#include "SVTK_Functor.h"
#include "VTKViewer_Algorithm.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
-#include "VisuGUI.h"
-
#include <vtkRenderer.h>
#include <vtkActorCollection.h>
for (; anIter.More(); anIter.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if (anIO->hasEntry()) {
+
+ // asv : if selected object is a Save Point object selected in object browser - return false
+ if ( QString( anIO->getEntry() ).startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) )
+ return false;
+
_PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
VISU::Storable::TRestoringMap pMap;
if (aSObject) {
return true;
}
- // Display/Erase
-
- void
- ErasePrs (const SalomeApp_Module* theModule,
- CORBA::Object_ptr theObject, bool theUpdate)
- {
- if (!CORBA::is_nil(theObject)) {
- VISU::Base_var aBase = VISU::Base::_narrow(theObject);
- if (CORBA::is_nil(aBase)) return;
- VISU::VISUType aType = aBase->GetType();
- switch (aType) {
- case VISU::TCURVE:
- {
- if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
- PlotCurve(theModule, aCurve, VISU::eErase );
- break;
- }
- case VISU::TCONTAINER:
- {
- if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
- PlotContainer(theModule, aContainer, VISU::eErase );
- break;
- }
- case VISU::TTABLE:
- {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
- PlotTable(theModule, aTable, VISU::eErase );
- break;
- }
- default:
- {
- if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
- ErasePrs3d(theModule, aPrsObject);
- if (theUpdate) {
- if (SVTK_ViewWindow* vw = GetViewWindow(theModule))
- vw->Repaint();
- }
- }
- }
- } // switch (aType)
- }
- }
-
void
DeleteSObject(VisuGUI* theModule,
_PTR(Study) theStudy,
_PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
_PTR(SObject) aChildSObject = aChildIter->Value();
-
CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
- RemoveScalarBarPosition(theModule,aChildObj);
- ErasePrs(theModule, aChildObj);
+ ErasePrs(theModule, aChildObj, /*repaint_view_window = */false);
}
CORBA::Object_var anObj = VISU::ClientSObjectToObject(theSObject);
if (!CORBA::is_nil(anObj)) {
- RemoveScalarBarPosition(theModule,anObj);
- ErasePrs(theModule, anObj);
+ ErasePrs(theModule, anObj, /*repaint_view_window = */true);
VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj);
if (!CORBA::is_nil(aRemovableObject)) {
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
return;
- RemoveScalarBarPosition(theModule,thePrs);
- thePrs->RemoveFromStudy();
- }
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ RemoveScalarBarPosition(theModule, vw, thePrs);
- void
- ErasePrs3d(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs)
- {
- if ( SVTK_ViewWindow* vw = GetViewWindow( theModule ) ){
- if (VISU_Actor* anVISUActor = FindActor( vw, thePrs )) {
- anVISUActor->VisibilityOff();
- }
- }
+ thePrs->RemoveFromStudy();
}
// Presentation management
ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::PresentationType theType)
{
- SVTK_ViewWindow* vw = GetViewWindow( theModule, false );
- if( !vw )
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ if (!vw)
return;
Handle(SALOME_InteractiveObject) anIO;
}
}
}
-
+
void
SetShading ( const SalomeApp_Module* theModule,
bool theOn )
{
- SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type());
- if (!aView) return;
- SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( aView );
- if( !vw )
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ if (!vw)
return;
-
+
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
if (CORBA::is_nil(anObject)) return;
return dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
}
- // Views
-
- SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, QString theType)
- {
- if(SalomeApp_Application* anApp = theModule->getApp()){
- if(SUIT_ViewManager* aViewManager = anApp->activeViewManager()){
- if (!theType.isNull()) {
- if (aViewManager->getType() != theType)
- return 0;
- }
- return aViewManager->getActiveView();
- }
- }
- return 0;
- }
-
// VTK View
- TViewWindows
- GetViews(const SalomeApp_Module* theModule)
- {
- TViewWindows aViewWindows;
- if(SalomeApp_Application* anApp = theModule->getApp()){
- ViewManagerList aViewManagerList;
- anApp->viewManagers(SVTK_Viewer::Type(),aViewManagerList);
- QPtrListIterator<SUIT_ViewManager> anIter(aViewManagerList);
- while(SUIT_ViewManager* aViewManager = anIter.current()){
- QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
- aViewWindows.push_back(aView);
- }
- ++anIter;
- }
- }
- return aViewWindows;
- }
-
- SVTK_ViewWindow*
- GetViewWindow( const SalomeApp_Module* theModule, const bool theCreate )
- {
- if (SalomeApp_Application* anApp = theModule->getApp())
- {
- SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
- if( wnd )
- return wnd;
- else
- {
- SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate );
- return aViewManager ? dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() ) : 0;
- }
- }
- return NULL;
- }
-
- /*SVTK_ViewWindow*
- GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate )
- {
- if (SalomeApp_Application* anApp = theModule->getApp())
- {
- SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
- if( wnd )
- return wnd;
- else
- {
- if(SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate ))
- return dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() );
- }
- }
- return NULL;
- }*/
-
-
- SVTK_ViewWindow*
- GetViewWindow()
- {
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
- if (anApp) {
- if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) {
- if (aViewManager->getType() == SVTK_Viewer::Type()) {
- if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
- return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- }
- }
- }
- }
- return NULL;
- }
-
VISU_Actor*
- PublishInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs)
+ PublishMeshInView(const SalomeApp_Module* theModule,
+ VISU::Prs3d_i* thePrs,
+ SVTK_ViewWindow* theViewWindow)
{
VISU_Actor* aActor = NULL;
- if(!thePrs)
+ if (!thePrs || !theViewWindow)
return aActor;
- if(SVTK_ViewWindow* aView = GetViewWindow(theModule)){
- QApplication::setOverrideCursor( Qt::waitCursor );
- try{
- if(aActor = thePrs->CreateActor())
- aView->AddActor(aActor);
- }catch(std::exception& exc){
- SUIT_MessageBox::warn1
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
- QObject::tr("BUT_OK"));
- }
- QApplication::restoreOverrideCursor();
- }
- return aActor;
- }
- VISU_Actor*
- UpdateViewer(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- bool theDispOnly)
- {
- SVTK_ViewWindow* vw = GetViewWindow( theModule );
- if (!vw) return NULL;
-
- vtkRenderer *aRen = vw->getRenderer();
- vtkActorCollection *anActColl = aRen->GetActors();
- anActColl->InitTraversal();
-
- vtkActor *anActor;
- VISU_Actor* anVISUActor = NULL;
- VISU_Actor* aResActor = NULL;
- while(vtkActor *anActor = anActColl->GetNextActor()){
- anVISUActor = VISU_Actor::SafeDownCast(anActor);
- if(anVISUActor){
- VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
- if(aPrs == NULL) continue;
- if (thePrs == aPrs) {
- try {
- aResActor = anVISUActor;
- thePrs->UpdateActor(aResActor);
- aResActor->VisibilityOn();
- } catch (std::runtime_error& exc) {
- aResActor->VisibilityOff();
- INFOS(exc.what());
- SUIT_MessageBox::warn1
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
- QObject::tr("BUT_OK"));
- }
- } else if (theDispOnly) {
- anVISUActor->VisibilityOff();
- } else {
- }
- } else if (theDispOnly && anActor->GetVisibility()) {
- anActor->VisibilityOff();
- } else {
- }
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ try {
+ if (aActor = thePrs->CreateActor())
+ theViewWindow->AddActor(aActor);
+ } catch(std::exception& exc) {
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
}
- if (aResActor)
- return aResActor;
+ QApplication::restoreOverrideCursor();
- //anVISUActor = PublishInView( theModule, thePrs );
- return anVISUActor;
+ return aActor;
}
void
// Others
void CreateMesh (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow)
{
_PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
//if (CheckLock(aStudy))
timer.Show();
#endif
- QApplication::restoreOverrideCursor();
+ //QApplication::restoreOverrideCursor();
VISU::Mesh_i* pPresent = NULL;
if (!CORBA::is_nil(aMesh))
pPresent = dynamic_cast<VISU::Mesh_i*>(VISU::GetServant(aMesh).in());
return;
}
- if (SVTK_ViewWindow* aView = GetViewWindow(theModule)) {
+ if (theViewWindow) {
try {
#ifdef CHECKTIME
Utils_Timer timer;
timer.Start();
#endif
- PublishInView(theModule, pPresent);
- //aView->onFitAll();
- SetFitAll(aView);
+ PublishMeshInView(theModule, pPresent, theViewWindow);
+ SetFitAll(theViewWindow);
#ifdef CHECKTIME
timer.Stop();
MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
timer.Show();
#endif
- theModule->application()->putInfo(QObject::tr("INF_DONE"));
- // Make "Save" button active
- theModule->getApp()->updateActions();
} catch (std::runtime_error& exc) {
INFOS(exc.what());
SUIT_MessageBox::warn1
QObject::tr("BUT_OK"));
}
}
+
+ theModule->application()->putInfo(QObject::tr("INF_DONE"));
+ // Make "Save" button active
+ theModule->getApp()->updateActions();
}
// ========================================================================================
}
return aList;
}
-
- int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule){
+
+ int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow)
+ {
int minIndx = 1;
std::set<int> aIndexes;
- SVTK_ViewWindow* vw = GetViewWindow(theModule);
TViewToPrs3d aMap = theModule->getScalarBarsMap();
- TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(vw);
- if (aViewToPrsIter != aMap.end()){
+ TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(theViewWindow);
+ if (aViewToPrsIter != aMap.end()) {
TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin();
- for(;aPrsIter!=(aViewToPrsIter->second).end();aPrsIter++){
+ for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) {
aIndexes.insert((*aPrsIter).second);
}
}
std::set<int>::const_iterator aIter = aIndexes.begin();
- for (int i=1,length=aIndexes.size(); i <= length; i++){
+ for (int i = 1,length = aIndexes.size(); i <= length; i++) {
std::set<int>::const_iterator aIter = aIndexes.find(i);
- if(aIter==aIndexes.end()){minIndx = i;break;}
+ if (aIter == aIndexes.end()) { minIndx = i; break; }
else minIndx = i + 1;
-
}
return minIndx;
}
-
- void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos){
- SVTK_ViewWindow* vw = GetViewWindow(theModule);
+
+ void AddScalarBarPosition (VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d, int pos)
+ {
TViewToPrs3d& aMap = theModule->myScalarBarsMap;
- TPrs3dToInd aPair; aPair.first=thePrs3d; aPair.second=pos;
- aMap[vw].insert(aPair);
+ TPrs3dToInd aPair; aPair.first = thePrs3d; aPair.second = pos;
+ aMap[theViewWindow].insert(aPair);
}
-
- void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d){
+
+ void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d)
+ {
TViewToPrs3d& aMap = theModule->myScalarBarsMap;
- TSetPrs3d::iterator aIter = aMap[vw].begin();
- for(;aIter!=aMap[vw].end();aIter++)
- if((*aIter).first == thePrs3d){
- aMap[vw].erase(*aIter);
+ TSetPrs3d::iterator aIter = aMap[theViewWindow].begin();
+ for (; aIter != aMap[theViewWindow].end(); aIter++)
+ if ((*aIter).first == thePrs3d) {
+ aMap[theViewWindow].erase(*aIter);
return;
}
}
-
- void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d){
- SVTK_ViewWindow* vw = GetViewWindow(theModule);
- RemoveScalarBarPosition(theModule,vw,thePrs3d);
- }
-
- void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject){
- if (!CORBA::is_nil(theObject)) {
- Base_var aBase = Base::_narrow(theObject);
- if (CORBA::is_nil(aBase)) return;
- if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
- RemoveScalarBarPosition(theModule,aPrsObject);
- }
- }
- }
}
bool IsRemovableSelected(const SalomeApp_Module* theModule);
- // Display/Erase
- void ErasePrs(const SalomeApp_Module* theModule,
- CORBA::Object_ptr theObject,
- bool theUpdate = true);
void DeleteSObject(VisuGUI* theModule,
_PTR(Study) theStudy,
_PTR(SObject) theSObject);
void DeletePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
const Handle(SALOME_InteractiveObject)& theIO);
- void ErasePrs3d(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs);
// Presentation management
void ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::Result_var& theResult);
bool IsSObjectTable(_PTR(SObject) theSObject);
- // Views
- SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule,
- QString theType = QString::null);
-
- // VTK View
- TViewWindows GetViews(const SalomeApp_Module* theModule);
- SVTK_ViewWindow* GetViewWindow(const SalomeApp_Module* theModule,
- const bool theCreate = false );
- SVTK_ViewWindow* GetViewWindow();
-
- VISU_Actor* PublishInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs);
- VISU_Actor* UpdateViewer(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- bool theDispOnly = false);
+ /*! Display mesh presentation in given VTK view window
+ */
+ VISU_Actor* PublishMeshInView(const SalomeApp_Module* theModule,
+ VISU::Prs3d_i* thePrs,
+ SVTK_ViewWindow* theViewWindow);
/*!
* \brief Repaint all SVTK view windows, where the given object is displayed.
void CreatePlot( SalomeApp_Module* theModule,
_PTR(SObject) theSobj );
+ /*! Display/Erase/Update a curve presentation.
+ * Parameter \a frame may be NULL, in this case there is only update without display/erase
+ */
void UpdateCurve( VISU::Curve_i*,
Plot2d_ViewFrame* frame,
SPlot2d_Curve*,
int theDisplaying );
- //parameter frame may be 0, in this case there is only update without display/erase
- // Others
+ /*! Create mesh presentation and display it in \a theViewWindow.
+ * If \a theViewWindow is NULL, no displaying will be done.
+ */
void CreateMesh (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow = NULL);
+ // Others
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
const Handle(SALOME_InteractiveObject)& theIO);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
_PTR(SObject) theObject);
- int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule);
- void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos);
- void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d);
- void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d);
- void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject);
+ int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow);
+ void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d, int pos);
+ void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+ VISU::Prs3d_i* thePrs3d);
}
#endif
: QDialog( VISU::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
mySelectionMgr( VISU::GetSelectionMgr( theModule ) ),
- myViewWindow( VISU::GetViewWindow( theModule ) )
+ myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule) )
{
if (!name)
setName("VisuGUI_TransparencyDlg");
{
void
ErasePrs(VisuGUI* theModule,
- VISU::Base_ptr theBase,
- bool thIsUpdate)
+ CORBA::Object_ptr theObject,
+ bool theDoRepaintVW)
{
- VISU::VISUType aType = theBase->GetType();
+ if (CORBA::is_nil(theObject)) return;
+ VISU::Base_var aBase = VISU::Base::_narrow(theObject);
+ if (CORBA::is_nil(aBase)) return;
+
+ VISU::VISUType aType = aBase->GetType();
switch (aType) {
case VISU::TCURVE: {
- if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(theBase).in()))
+ if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
PlotCurve(theModule, aCurve, VISU::eErase );
break;
}
case VISU::TCONTAINER: {
- if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(theBase).in()))
+ if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
PlotContainer(theModule, aContainer, VISU::eErase );
break;
}
case VISU::TTABLE: {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(theBase).in()))
+ if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
PlotTable(theModule, aTable, VISU::eErase );
break;
}
default: {
- if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(theBase).in())){
- if(aType == VISU::TGAUSSPOINTS)
- ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- else if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- ErasePrs3d<SVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- else if(aType == VVTK_Viewer::Type())
- ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- }
+ if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
+ SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+ RemoveScalarBarPosition(theModule, vw, aPrsObject);
+ ErasePrs3d(theModule, aPrsObject, theDoRepaintVW);
}
}} // switch (aType)
}
#include "VisuGUI.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ViewManager.h"
-#include "SUIT_ViewWindow.h"
+#include "VisuGUI_Tools.h"
+
+#include "VISU_Prs3d_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_ViewManager_i.hh"
+
+#include "VISU_Actor.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Application.h"
-#include "VISU_Prs3d_i.hh"
-
#include "VVTK_ViewModel.h"
#include "VVTK_ViewWindow.h"
+#include "SVTK_Functor.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
-#include "VisuGUI_Tools.h"
+#include "SPlot2d_ViewModel.h"
+
#include "VTKViewer_Algorithm.h"
-#include "SVTK_Functor.h"
-#include "VISU_Table_i.hh"
-#include "VISU_ViewManager_i.hh"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ViewManager.h"
+#include "SUIT_ViewWindow.h"
+
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SPlot2d_ViewModel.h"
-
-#include "VISU_Actor.h"
-
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
namespace VISU
{
- //---------------------------------------------------------------
+ /*! Return active view window, if it instantiates TViewer::TViewWindow class,
+ * overwise find or create corresponding view window, make it active and return it.
+ * \note Active VVTK_ViewWindow can be returned by request GetViewWindow<SVTK_Viewer>(),
+ * because VVTK_ViewWindow inherits SVTK_ViewWindow.
+ */
template<class TViewer>
inline
typename TViewer::TViewWindow*
- GetViewWindow(VisuGUI* theModule,
- const bool theIsViewCreate = false)
+ GetViewWindow(VisuGUI* theModule)
{
- typedef typename TViewer::TViewWindow TView;
- if(SUIT_ViewManager* aViewManager = theModule->getViewManager(TViewer::Type(),theIsViewCreate)){
- if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){
- if(TView* aView = dynamic_cast<TView*>(aViewWindow)){
+ typedef typename TViewer::TViewWindow TViewWindow;
+ if (SalomeApp_Application* anApp = theModule->getApp()) {
+ if (TViewWindow* aView = dynamic_cast<TViewWindow*>(anApp->desktop()->activeWindow()))
+ return aView;
+ }
+ SUIT_ViewManager* aViewManager =
+ theModule->getViewManager(TViewer::Type(), /*create = */true);
+ if (aViewManager) {
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
+ if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
aViewWindow->raise();
aViewWindow->setFocus();
return aView;
return NULL;
}
+ /*! Return active view window, if it instantiates TViewWindow class, overwise return NULL.
+ * \note Active VVTK_ViewWindow can be returned by request GetActiveViewWindow<SVTK_ViewWindow>(),
+ * because VVTK_ViewWindow inherits SVTK_ViewWindow.
+ */
+ template<class TViewWindow>
+ inline
+ TViewWindow*
+ GetActiveViewWindow(const SalomeApp_Module* theModule = NULL)
+ {
+ SalomeApp_Application* anApp = NULL;
+ if (theModule)
+ anApp = theModule->getApp();
+ else
+ anApp = dynamic_cast<SalomeApp_Application*>
+ (SUIT_Session::session()->activeApplication());
+
+ if (anApp)
+ if (SUIT_ViewManager* aViewManager = anApp->activeViewManager())
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
+ return dynamic_cast<TViewWindow*>(aViewWindow);
+
+ return NULL;
+ }
+
//---------------------------------------------------------------
- template<class TViewer>
inline
VISU_Actor*
PublishInView(VisuGUI* theModule,
Prs3d_i* thePrs,
- const bool theIsHighlight = false,
- const bool theIsCreateView = false)
+ SVTK_ViewWindow* theViewWindow,
+ const bool theIsHighlight = false)
{
- typedef typename TViewer::TViewWindow TView;
- if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView)){
+ if (theViewWindow) {
QApplication::setOverrideCursor( Qt::waitCursor );
try {
- if(VISU_Actor* anActor = thePrs->CreateActor()){
- aView->AddActor(anActor);
- if(theIsHighlight)
- aView->highlight(anActor->getIO(),true);
- aView->getRenderer()->ResetCameraClippingRange();
- aView->Repaint();
+ if (VISU_Actor* anActor = thePrs->CreateActor()) {
+ theViewWindow->AddActor(anActor);
+ if (theIsHighlight)
+ theViewWindow->highlight(anActor->getIO(),true);
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
QApplication::restoreOverrideCursor();
return anActor;
}
} catch(std::exception& exc) {
+ thePrs->RemoveActors();
+
QApplication::restoreOverrideCursor();
INFOS(exc.what());
SUIT_MessageBox::warn1
//---------------------------------------------------------------
- template<class TViewer>
inline
VISU_Actor*
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly = false,
- const bool theIsHighlight = false,
- const bool theIsViewCreate = false)
+ const bool theIsHighlight = false)
{
- typedef typename TViewer::TViewWindow TView;
- if(TView* aView = GetViewWindow<TViewer>(theModule,theIsViewCreate)){
- vtkRenderer *aRen = aView->getRenderer();
+ if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+ vtkRenderer *aRen = aViewWindow->getRenderer();
vtkActorCollection *anActColl = aRen->GetActors();
anActColl->InitTraversal();
VISU_Actor* aResActor = NULL;
- while(vtkActor *anAct = anActColl->GetNextActor()){
- if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
- if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){
- if(thePrs == aPrs3d){
+ bool isOk = true;
+ while (vtkActor *anAct = anActColl->GetNextActor()) {
+ if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
+ if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) {
+ if (thePrs == aPrs3d) {
try {
+ aResActor = anActor;
thePrs->UpdateActors();
+ aResActor->VisibilityOn();
} catch (std::runtime_error& exc) {
+ thePrs->RemoveActors();
+ isOk = false;
+
INFOS(exc.what());
- QApplication::restoreOverrideCursor();
SUIT_MessageBox::warn1
(GetDesktop(theModule), QObject::tr("WRN_VISU"),
QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
QObject::tr("BUT_OK"));
-
- thePrs->RemoveActors();
- return NULL;
}
- aResActor = anActor;
- aResActor->VisibilityOn();
- }else if(theDispOnly){
+ } else if (theDispOnly) {
anActor->VisibilityOff();
}
- }else if(theDispOnly && anActor->GetVisibility()){
+ } else if (theDispOnly && anActor->GetVisibility()) {
anActor->VisibilityOff();
}
}
}
- if(aResActor){
- if(theIsHighlight)
- aView->highlight(aResActor->getIO(),true);
- aView->getRenderer()->ResetCameraClippingRange();
- aView->Repaint();
+ if (aResActor) {
+ if (theIsHighlight && isOk)
+ aViewWindow->highlight(aResActor->getIO(), true);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
return aResActor;
}
- return PublishInView<TViewer>(theModule,thePrs,theIsHighlight,theIsViewCreate);
+ return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight);
}
return NULL;
}
OnEraseAll(VisuGUI* theModule)
{
typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
+ if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule)) {
aViewWindow->unHighlightAll();
- if(vtkRenderer *aRen = aViewWindow->getRenderer()){
+ if (vtkRenderer *aRen = aViewWindow->getRenderer()) {
vtkActorCollection *aCollection = aRen->GetActors();
aCollection->InitTraversal();
- while(vtkActor *anAct = aCollection->GetNextActor()){
- if(anAct->GetVisibility() > 0)
- if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
+ while (vtkActor *anAct = aCollection->GetNextActor()) {
+ if (anAct->GetVisibility() > 0)
+ if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)) {
anActor->VisibilityOff();
}
}
}
}
}
-
+
template<>
inline
void
OnEraseAll<SPlot2d_Viewer>(VisuGUI* theModule)
{
- if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule,false))
+ if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false))
aPlot2d->EraseAll();
}
//---------------------------------------------------------------
- template<class TVieweWindow>
- inline
- VISU_Actor*
- FindActor(TVieweWindow* theViewWindow,
- const char* theEntry)
- {
- using namespace SVTK;
- if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
- if(vtkActorCollection* aCollection = aRenderer->GetActors()){
- if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
- return anActor;
- }
- }
- }
- return NULL;
- }
-
- template<class TViewer>
inline
void
ErasePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
- const bool thIsUpdate = true)
+ const bool theDoRepaintVW = true)
{
- typedef typename TViewer::TViewWindow TViewWindow;
- if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
- if(VISU_Actor* anActor = FindActor(aViewWindow,thePrs)){
+ if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+ if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs)) {
anActor->VisibilityOff();
- if(thIsUpdate)
+ if (theDoRepaintVW)
aViewWindow->Repaint();
}
}
}
-
void
ErasePrs(VisuGUI* theModule,
- VISU::Base_ptr theBase,
- bool thIsUpdate);
+ CORBA::Object_ptr theObject,
+ bool theDoRepaintVW);
}
#endif
-L${GUI_ROOT_DIR}/lib/salome \
-L${MED_ROOT_DIR}/lib/salome
-LIBS+= -lboost_signals-mt \
+LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \
-lSalomeHDFPersist \
-lSalomeGenericObj \
-lSalomeContainer \
-lTOOLSDS \
-lOpUtil \
-lEvent \
- -lCASCatch \
-lSalomeApp \
-lSalomeSession \
-lVTKViewer \
-lVisuConvertor \
-lVisuPipeLine \
-lVisuObject \
+ -lVVTK \
-lVISUGUITOOLS
LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \
-lSalomeNotification \
-lSALOMELocalTrace \
-lSalomeResourcesManager \
- -lSalomeDS \
+ -lSalomeDSClient \
-lSalomeDSImpl \
+ -lSalomeDS \
-lSalomeObject \
-lqtx \
-lsuit \
}
+ QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, const QString& theDefaultValue)
+ {
+ bool anIsFound = false;
+ QString aValue = FindValue(theMap,theArg,&anIsFound);
+ if(anIsFound)
+ return aValue;
+ return theDefaultValue;
+ }
+
+
//===========================================================================
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){
if(CORBA::is_nil(theObject)) return NULL;
static void Registry(const char* theComment, TStorableEngine theEngine);
static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
+ static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, const QString& theDefaultValue);
static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
myField = anOrigin->GetField();
myMeshName = myField->myMeshName;
- myEntity = myField->myEntity;
+ myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity;
myIteration = anOrigin->GetIteration();
myFieldName = anOrigin->GetFieldName();
void
SameAsParams(const ColoredPrs3d_i* theOrigin);
- const VISU::PField&
+ virtual const VISU::PField&
GetField() const;
const std::string&
theStr<<thePrefix<<"if "<<theName<<":"<<endl;
thePrefix += PREFIX;
+ // Add to Name->Object map
theStr<<thePrefix<<"aName2ObjectMap['"<<theName<<"'] = "<<theName<<endl;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<thePrefix<<"visu.SetName("<<theName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
+ // Set parameters
theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
switch(theServant->GetScaling()){
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
std::string aPrefix2 = thePrefix + PREFIX;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<aPrefix2<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 1"<<endl;
+
DumpChildrenToPython(theStudy,
theIsPublished,
theIsValidScript,
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
thePrefix += PREFIX;
+ // Add to Name->Object map
theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<thePrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
+ // Set presentation parameters
SALOMEDS::Color aColor;
aColor = aServant->GetCellColor();
theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
return;
case VISU::TTABLE:
if(Table_i* aServant = dynamic_cast<Table_i*>(GetServant(anObj).in())){
- SALOMEDS::SObject_var aSObject = aServant->GetSObject();
SALOMEDS::GenericAttribute_var anAttr;
if(theSObject->FindAttribute(anAttr,"AttributeComment")){
using namespace SALOMEDS;
theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 2"<<endl;
+
theStr<<endl;
theArgumentName = aName;
theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = theSObject->GetName();
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
theStr<<endl;
theArgumentName = aName;
return;
}
}
- }else{
+ }else{ /*if(!CORBA::is_nil(anObj))*/
SALOMEDS::GenericAttribute_var anAttr;
if(theSObject->FindAttribute(anAttr,"AttributeComment")){
SALOMEDS::AttributeComment_var aComment =
std::string aPrefix = thePrefix + PREFIX;
theArgumentName = aName;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = aSObject->GetName();
+ theStr<<aPrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
SALOMEDS::SObject_var aRefSObj = aCurveIter->Value();
#include <strstream>
#include "Utils_ExceptHandlers.hxx"
+#include "CASCatch.hxx"
using namespace std;
const char* theFieldName,
CORBA::Double theIteration)
{
+ CASCatch_TRY{
#ifndef _DEXCEPT_
- try{
+ 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());
+ }
return false;
}
//===========================================================================
SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
- bool isMultiFile)
+ bool theIsMultiFile)
{
Mutex mt(myMutex);
- string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
- TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
+ string aTmpDir = theURL;
if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
- int aCounter = 0;
- TColStd_SequenceOfAsciiString aFileNames;
- SALOMEDS::Study_var aStudy = theComponent->GetStudy();
-
- //CORBA::Boolean anIsValidScript;
- //Engines::TMPFile_var aDump = DumpPython(aStudy,false,anIsValidScript);
+
+ typedef std::vector<std::string> TFileNames;
+ TFileNames aFileNames;
+ TFileNames aFiles;
- SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent);
- for (; itBig->More(); itBig->Next()) {
- SALOMEDS::SObject_var gotBranch = itBig->Value();
+ SALOMEDS::Study_var aStudy = theComponent->GetStudy();
+ SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
+ for (; anIter->More(); anIter->Next()) {
+ SALOMEDS::SObject_var gotBranch = anIter->Value();
CORBA::Object_var anObj = SObjectToObject(gotBranch);
if(CORBA::is_nil(anObj)) continue;
- if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
- switch(pResult->GetCreationId()){
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+ switch(aResult->GetCreationId()){
case Result_i::eImportFile:
case Result_i::eCopyAndImportFile: {
- const QFileInfo& aFileInfo = pResult->GetFileInfo();
- QString aPrefix("");
- if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
- QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
- static QString aCommand;
- aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
-
- int aRes = system(aCommand);
- if(aRes){
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
- continue;
- }else
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aCommand = "<<aCommand);
-
- TCollection_AsciiString aString(strdup(aFileName.latin1()));
- aFileNames.Append(aString);
+ const QFileInfo& aFileInfo = aResult->GetFileInfo();
+ const std::string& aName = aResult->GetName();
+ std::string aFileName = std::string("_") + aName;
+ std::string aFile = aFileInfo.filePath().latin1();
+ if(theIsMultiFile){
+ aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName;
+
+ 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;
+ }
+ }
+ aFileNames.push_back(aFileName);
+ aFiles.push_back(aFile);
}}
}
}
- SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
- if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.Length() - "<<aFileNames.Length());
- if(aFileNames.Length() > 0){
- SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
- aSeq->length(aFileNames.Length());
- for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--)
- aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString());
- aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), isMultiFile);
- if(!isMultiFile)
- SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
+
+ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<<aFileNames.size());
+
+ SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
+ if(!aFileNames.empty()){
+ aListOfFileNames->length(aFileNames.size());
+ for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
+ aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str();
}
+
+ SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames;
+ aListOfFiles->length(aFiles.size());
+ if(!aFiles.empty()){
+ for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
+ aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str();
+ }
+
+ SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
+ if(theIsMultiFile)
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile);
+ else
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in());
+
return aStreamFile._retn();
}
throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
if (!theRestoring) {
myPresentType = VISU::SHADED;
+ if(myEntity == VISU::NODE_ENTITY)
+ myPresentType = VISU::POINT;
myName = GenerateName().latin1();
myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
myMeshPL->Init();
string aResultEntry = myResult->GetEntry();
string anEntry = myResult->GetEntry(aComment.latin1());
- if(anEntry == "") throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
+ if(anEntry == "")
+ throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
mySObject = myStudy->FindObjectID(anEntry.c_str());
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
}catch(std::bad_alloc& ex){
throw std::runtime_error("CreateActor >> No enough memory");
throw ex;
- } catch(std::exception& ex){
- throw ex;
+ } catch(std::exception&){
+ throw;
}catch(...) {
throw std::runtime_error("CreateActor >> unexpected exception was caught!!!");
}
#include "SALOME_GenericObj_i.hh"
#include "SALOME_InteractiveObject.hxx"
-#include <boost/signals/signal0.hpp>
#include <vtkSmartPointer.h>
class VISU_PipeLine;
::Result_i (SALOMEDS::Study_ptr theStudy,
const ESourceId& theSourceId,
const ECreationId& theCreationId,
- CORBA::Boolean theIsBuildImmediately):
+ CORBA::Boolean theIsBuildImmediately,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildMinMax,
+ CORBA::Boolean theIsBuildGroups):
myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)),
myCreationId(theCreationId),
mySourceId(theSourceId),
myIsBuildImmediately(theIsBuildImmediately),
- myInput(NULL),
+ myIsBuildFields(theIsBuildFields),
+ myIsBuildMinMax(theIsBuildMinMax),
+ myIsBuildGroups(theIsBuildGroups),
myIsEntitiesDone(false),
myIsFieldsDone(false),
myIsGroupsDone(false),
myIsMinMaxDone(false),
- myIsBuildFields(true),
- myIsBuildGroups(true),
- myIsBuildMinMax(true),
- myIsAllDone(false)
+ myIsAllDone(false),
+ myInput(NULL)
{
myStudy = ProcessEvent(new TGetStudy(myStudyDocument->StudyId()));
}
SALOMEDS::SObject_var aRefSObj, aTargetRefSObj;
if (mySObject->FindSubObject(1, aRefSObj) &&
- aRefSObj->ReferencedObject(aTargetRefSObj)) {
+ aRefSObj->ReferencedObject(aTargetRefSObj))
+ {
if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference.");
SALOMEDS::SComponent_var aCompRefSObj = aTargetRefSObj->GetFatherComponent();
CORBA::String_var aDataType = aCompRefSObj->ComponentDataType();
}
if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId);
myInput = CreateConvertor(myFileInfo.filePath().latin1());
- myInput->Build();
+
+ myInput->BuildEntities();
+ if(myIsBuildFields){
+ myInput->BuildFields();
+ myIsFieldsDone = true;
+ if(myIsBuildMinMax){
+ myInput->BuildMinMax();
+ myIsMinMaxDone = true;
+ }
+ }
+ if(myIsBuildGroups){
+ myInput->BuildGroups();
+ myIsGroupsDone = true;
+ }
+
QString aComment;
aComment.sprintf("myComment=%s;myType=%d;myFileName=%s;myInitFileName=%s",
GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(),
SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
aCmnt->SetValue(aComment.latin1());
}
- bool isBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
- if (isBuildAll)
+ bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
+ if(anIsBuildAll)
BuildAll();
return this;
} catch(std::exception& exc) {
Storable::DataToStream(theStr,"myName",myName.c_str());
Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
Storable::DataToStream(theStr,"myCreationId",myCreationId);
+ Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
+ Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
+ Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone);
}
if(aCreationId == eImportMed || aCreationId == eImportMedField)
aSourceId = eRestoredComponent;
- VISU::Result_i* pResult = new VISU::Result_i(aStudy,aSourceId,aCreationId);
- if (pResult == NULL)
+ 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();
+
+ VISU::Result_i* aResult = new VISU::Result_i(aStudy,
+ aSourceId,
+ aCreationId,
+ anIsBuildFields,
+ anIsBuildMinMax,
+ anIsBuildGroups);
+ if (aResult == NULL)
return NULL;
- return pResult->Restore(theSObject,theMap,thePrefix);
+ return aResult->Restore(theSObject,theMap,thePrefix);
}
#define __VISU_RESULT_I_H__
#include "VISUConfig.hh"
+#include "VISU_BoostSignals.h"
#include "SALOME_GenericObj_i.hh"
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/signal0.hpp>
-
#include <gp_Dir.hxx>
#include <vector>
namespace VISU
{
//----------------------------------------------------------------------------
- class MinMaxCunsomer: public virtual boost::bsignals::trackable
+ class MinMaxCunsomer: public virtual boost::signalslib::trackable
{
protected:
bool myMinMaxIsInitilized;
Result_i(SALOMEDS::Study_ptr theStudy,
const ESourceId& theSourceId,
const ECreationId& theCreationId,
- CORBA::Boolean theIsBuildImmediately = true);
+ CORBA::Boolean theIsBuildImmediately = true,
+ CORBA::Boolean theIsBuildFields = true,
+ CORBA::Boolean theIsBuildMinMax = true,
+ CORBA::Boolean theIsBuildGroups = true);
virtual ~Result_i();
virtual void RemoveFromStudy();
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
myIsColored = true;
myColor.R = myColor.G = myColor.B = 0.5;
VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
TSuperClass::Restore(theMap);
SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
VISU::ScalarMapOnDeformedShape_i
::SameAs(const Prs3d_i* theOrigin)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
+ int theScalarIter = this->GetScalarIteration();
+ string theScalarMeshName = this->GetScalarMeshName();
+ string theScalarFieldName = this->GetScalarFieldName();
+ if(MYDEBUG) cout << "SameAs:"<<endl
+ << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
+
TSuperClass::SameAs(theOrigin);
if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
- // increment the scalar iteration for using in VISU_TimeAnimation class implementation.
this->SetScalarField(anOrigin->GetScalarMeshName().c_str(),
anOrigin->GetScalarFieldName().c_str(),
- anOrigin->GetScalarIteration() + 1,
+ theScalarIter,
anOrigin->GetScalarEntity());
Update();
}
void VISU::ScalarMapOnDeformedShape_i::DoHook()
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
if(!myPipeLine)
myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
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);
anActor->SetRepresentation(2);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<<endl;
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
anActor->SetBarVisibility(true);
const int theIteration,
const VISU::TEntity theEntity)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
+ if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
+ if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
+ myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+ TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)->GetVTKOutput();
if (myScalarMapOnDeformedShapePL){
- myField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
- TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theIteration)->GetVTKOutput();
myScalarMapOnDeformedShapePL->SetScalars(aOut);
}
this->SetScalarMeshName(theMeshName);
this->SetScalarEntity(theEntity);
}
+void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ const long theIteration,
+ const VISU::Entity theEntity)
+{
+ this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
+}
void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
myScalarMeshName = theName;
void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
myScalarIteration = theValue;
}
+
+
int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
return myScalarIteration;
}
void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
myScalarEntity = theValue;
}
+
VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
return myScalarEntity;
}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+ myScalarEntity = VISU::TEntity(theValue);
+}
+
+VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+ return VISU::Entity(myScalarEntity);
+}
+
+const VISU::PField&
+VISU::ScalarMapOnDeformedShape_i
+::GetField() const
+{
+ return myScalarField;
+}
void
SameAs(const Prs3d_i* theOrigin);
+ virtual const VISU::PField&
+ GetField() const;
+
VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
protected:
std::string myScalarFieldName;
VISU::TEntity myScalarEntity;
int myScalarIteration;
+ PField myScalarField;
public:
static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName,
const int theIteration,
const VISU::TEntity theEntity);
+
+ virtual void SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ const long theIteration,
+ const VISU::Entity theEntity);
virtual void SetScalarFieldName(const char* theName);
virtual std::string GetScalarFieldName();
virtual std::string GetScalarMeshName();
virtual void SetScalarEntity(const VISU::TEntity theValue);
virtual VISU::TEntity GetScalarEntity();
+ virtual void SetScalarEEntity(const VISU::Entity theValue);
+ virtual VISU::Entity GetScalarEEntity();
};
}
#endif
if (!CORBA::is_nil(theView3D)) {
VISU::View3D_i* pView = dynamic_cast<VISU::View3D_i*>(GetServant(theView3D).in());
SUIT_ViewWindow* aVW = pView->GetViewWindow();
- myView = VISU::GetViewWindow(aVW);
+ myView = dynamic_cast<SVTK_ViewWindow*>(aVW);
connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
}
- myMaxVal = 0;
- myMinVal = 0;
+ myTimeMinVal = 0;
+ myTimeMaxVal = 0;
myTimeMin = 0;
myTimeMax = 0;
myLastError = "";
FieldData& theData,
VISU::Result_i* theResult,
bool theIsRangeDefined,
- CORBA::Double& theMinVal,
- CORBA::Double& theMaxVal,
CORBA::Double theTimeMin,
CORBA::Double theTimeMax)
{
- theMinVal = VTK_LARGE_FLOAT;
- theMaxVal = -VTK_LARGE_FLOAT;
+ double aMin = VTK_LARGE_FLOAT, aMax = -VTK_LARGE_FLOAT;
_PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
anIter->Next(); // First is reference on support
aFieldName.latin1(), aTimeStampId);
theData.myPrs[aFrameId++] = aPresent;
- theMinVal = std::min(aPresent->GetMin(),theMinVal);
- theMaxVal = std::max(aPresent->GetMax(),theMaxVal);
+ aMin = std::min(aPresent->GetMin(), aMin);
+ aMax = std::max(aPresent->GetMax(), aMax);
}
theData.myNbFrames = aFrameId;
if( aRangeType != 1 ){
for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
- aPrs->SetRange(theMinVal, theMaxVal);
+ aPrs->SetRange(aMin, aMax);
aPrs->SetOffset(theData.myOffset);
}
}
if (theData.myPrsType == VISU::TISOSURFACE)
for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++)
if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(theData.myPrs[aFrameId]))
- aPrs->SetSubRange(theMinVal, theMaxVal);
+ aPrs->SetSubRange(aMin, aMax);
}
}
}
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TISOSURFACE: // Iso Surfaces
GeneratePresentations<IsoSurfaces_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TCUTPLANES: // Cut Planes
GeneratePresentations<CutPlanes_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TCUTLINES: // Cut Lines
GeneratePresentations<CutLines_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TPLOT3D: // Plot3d
GeneratePresentations<Plot3D_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TDEFORMEDSHAPE: // Deformed Shape
GeneratePresentations<DeformedShape_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TVECTORS: // Vectors
GeneratePresentations<Vectors_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TSTREAMLINES: // Stream Lines
GeneratePresentations<StreamLines_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TGAUSSPOINTS: // Gauss Points
GeneratePresentations<GaussPoints_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
qApp->unlock();
msleep(100);
qApp->lock();
-
- QPixmap px = QPixmap::grabWindow(myView->winId());
QString aFile(myDumpPath);
QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
int aPos = -1;
aFile += aName;
aFile += ".";
aFile += myDumpFormat.lower();
- px.save(aFile, myDumpFormat);
+ myView->dumpViewToFormat(aFile,myDumpFormat);
}
if (!myIsActive) break;
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
- VISU::TANIMATION,myMinVal,myMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","",
GenerateName(),"",aComment,true);
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
- VISU::TANIMATION,myMinVal,myMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
_PTR(GenericAttribute) anAttr;
anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment");
VISU::Storable::StrToMap(strIn,aMap);
bool isExist;
- myMinVal = VISU::Storable::FindValue(aMap,"myMinVal",&isExist).toDouble();
- myMaxVal = VISU::Storable::FindValue(aMap,"myMaxVal",&isExist).toDouble();
+ myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble();
+ myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble();
_PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
for (anIter->Init(); anIter->More(); anIter->Next()) {
aData.myPrs[0]->GetOffset(aData.myOffset);
for (int i = 1; i < aData.myNbFrames; i++) {
//jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
- //enk 06.02.2006:aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
- aData.myPrs[i]->SameAsParams(aData.myPrs[i-1]);//enk 06.02.2006: initializing from previous presentation
+ aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
}
}
string aStr = aAnimSObject->GetID();
SVTK_ViewWindow* getViewer() { return myView; }
void clearView();
void clearData(FieldData& theData);
+ void clearFieldData() { myFieldsLst.clear();};
void stopAnimation();
void startAnimation();
CORBA::Boolean isProportional() { return myProportional; }
void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
- { myMaxVal = theMax; myMinVal = theMin; }
+ { myTimeMinVal = theMin; myTimeMaxVal = theMax; }
- CORBA::Double getMinRange() { return myMinVal; }
- CORBA::Double getMaxRange() { return myMaxVal; }
- CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
+ CORBA::Double getMinRange() { return myTimeMinVal; }
+ CORBA::Double getMaxRange() { return myTimeMaxVal; }
+ CORBA::Boolean isRangeDefined() { return !((myTimeMaxVal == 0) && (myTimeMinVal == myTimeMaxVal)); }
void dumpTo(const char* thePath) { myDumpPath = thePath; }
std::string setDumpFormat(const char* theFormat);
private slots:
void onViewDeleted();
-
+
private:
QString myLastError;
bool myCycling;
_PTR(Study) myStudy;
- double myMaxVal, myMinVal;
- double myTimeMin, myTimeMax;
+ double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
+ double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation
QString myDumpPath;
QString myDumpFormat;
SVTK_ViewWindow* myView;
//===========================================================================
// VISU namespace functions
//===========================================================================
- SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame)
+ vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow)
{
- return dynamic_cast<SVTK_ViewWindow*>(theStudyFrame);
- }
-
- vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame)
- {
- return GetViewWindow(theStudyFrame)->getRenderer();
+ if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(theViewWindow))
+ return vw->getRenderer();
+ return NULL;
}
- vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame)
+ vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow)
{
- return GetRenderer(theStudyFrame)->GetActiveCamera();
+ return GetRenderer(theViewWindow)->GetActiveCamera();
}
void RepaintView (SUIT_ViewWindow* theViewWindow)
{
- SVTK_ViewWindow* vf = GetViewWindow(theViewWindow);
- vf->getRenderer()->ResetCameraClippingRange();
- vf->getRenderWindow()->Render();
+ if (SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow)) {
+ vf->getRenderer()->ResetCameraClippingRange();
+ vf->getRenderWindow()->Render();
+ }
}
- VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs)
+ VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs)
{
- SVTK_ViewWindow* vf = GetViewWindow(theStudyFrame);
+ SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
if (!vf) return NULL;
if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
vtkRenderer *aRen = vf->getRenderer();
}
}
if (aResActor) {
- RepaintView(theStudyFrame);
+ RepaintView(theViewWindow);
return aResActor;
}
if(thePrs != NULL && theDisplaing < eErase){
return NULL;
}
}
- RepaintView(theStudyFrame);
+ RepaintView(theViewWindow);
return anVISUActor;
}
SalomeApp_Application *myApplication;
};
- SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame);
- vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame);
- vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame);
+ vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow);
+ vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow);
- void RepaintView (SUIT_ViewWindow* theStudyFrame);
+ void RepaintView (SUIT_ViewWindow* theViewWindow);
enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
- VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs = NULL);
+ VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs = NULL);
void UpdatePlot2d (Plot2d_ViewFrame *theView, int theDisplaying, Curve_i* theCurve);
VISU_Actor* GetActor (VISU::Prs3d_i* thePrs, SVTK_ViewWindow* theViewWindow);
{}
virtual void Execute()
{
- SVTK_ViewWindow* vf = VISU::GetViewWindow(myVW);
+ SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(myVW);
vtkRenderer* Renderer = vf->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theViewWindow));
double aScaleFactor[3];
- VISU::GetViewWindow(theViewWindow)->GetScale(aScaleFactor);
+ (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->GetScale(aScaleFactor);
Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]);
Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]);
Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]);
aColor[1] = int(255.0*theColor.G);
aColor[2] = int(255.0*theColor.B);
QColor aNewColor (aColor[0],aColor[1],aColor[2]);
- VISU::GetViewWindow(theViewWindow)->setBackgroundColor(aNewColor);
+ (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->setBackgroundColor(aNewColor);
}
SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow)
SUIT_ViewWindow* aVW = GetViewWindow();
if (aVW) {
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFitAll));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFitAll));
Update();
}
}
switch (theType) {
case VISU::View3D::FRONT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFrontView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFrontView));
break;
case VISU::View3D::BACK :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onBackView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onBackView));
break;
case VISU::View3D::LEFT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onLeftView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onLeftView));
break;
case VISU::View3D::RIGHT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onRightView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onRightView));
break;
case VISU::View3D::TOP :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onTopView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onTopView));
break;
case VISU::View3D::BOTTOM :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onBottomView));
+ (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onBottomView));
break;
}
Update();
void View3D_i::ScaleView (SUIT_ViewWindow* theViewWindow,
VISU::View3D::Axis theAxis, CORBA::Double theParam)
{
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theViewWindow);
+ SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
double aScaleFactor[3];
aViewWindow->GetScale(aScaleFactor);
aScaleFactor[theAxis] = theParam;
void SetScaleView (SUIT_ViewWindow* theViewWindow, const CORBA::Double theScale[3])
{
double aScale[3] = {theScale[0], theScale[1], theScale[2]};
- VISU::GetViewWindow(theViewWindow)->SetScale(aScale);
+ (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->SetScale(aScale);
}
void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam)
SUIT_ViewWindow* aVW = GetViewWindow();
if (aVW) {
double aScale[3];
- VISU::GetViewWindow(aVW)->GetScale(aScale);
+ (dynamic_cast<SVTK_ViewWindow*>(aVW))->GetScale(aScale);
aScale[theAxis] = theParam;
ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
}
cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
myView.DisplayOnly(cutplanes)
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+if scalarmapondefshape is None : print "Error"
+else : print "OK"
+scalarmapondefshape.SetScalarField(myMeshName,'pression',2,myCellEntity);
+myView.DisplayOnly(scalarmapondefshape)
+
#%====================Stage4: Opening a new study and Med file import====================%
# Opening a new study tempoparily commented due to a problem
cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
myView1.DisplayOnly(cutplanes1)
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+if scalarmapondefshape1 is None : print "Error"
+else : print "OK"
+myView1.DisplayOnly(scalarmapondefshape1)
#%====================Stage6: Object browser popup====================%
print "**** Stage6: Object browser popup"
pass
return aSComponent;
+
+def SetName(theObj, theName):
+ anIOR = myORB.object_to_string(theObj)
+ aSObj = myLocalStudy.FindObjectIOR(anIOR)
+ anAttr = aSObj.FindAttribute("AttributeName")[1]
+ anAttr.SetValue(theName)
def StrToMap(theString) :
aPairList = split(theString,";")
aPrsObj.RemoveFromStudy()
else :
aVISUObjList.append(aPrsObj)
+
+ if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
+ print " Creating ScalarMapOnDeformedShapeOnField",
+ aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+ if aPrsObj is None : print "Error"
+ else :
+ print ",OK"
+ theView.DisplayOnly(aPrsObj)
+ theView.FitAll()
+ aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+ aPictureName = re.sub("\s+","_", aPictureName)
+ theView.SavePicture(aPictureName)
+ if theIsAutoDelete :
+ aPrsObj.RemoveFromStudy()
+ else :
+ aVISUObjList.append(aPrsObj)
+
return aVISUObjList
// Recording
myRecordingToolBar = new QToolBar(this);
myRecordingToolBar->setCloseMode(QDockWindow::Undocked);
- myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_RECORD_LABEL"));
moveDockWindow(myRecordingToolBar,Qt::DockLeft);
myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"),
{
myPtsToolBar = new QToolBar(this);
myPtsToolBar->setCloseMode(QDockWindow::Undocked);
- myPtsToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ myPtsToolBar->setLabel(tr("LBL_TOOLBAR_GAUSS_LABEL"));
moveDockWindow(myPtsToolBar,Qt::DockLeft);
QPixmap aPixmap;
//----------------------------------------------------------------------------
VVTK_Renderer1::VVTK_Renderer1():
- //myImplicitFunctionWidget(VISU_ImplicitFunctionWidget::New()),
myWidgetCtrl(VISU_WidgetCtrl::New()),
myOutsideCursorSettings(NULL)
{
if(MYDEBUG) INFOS("VVTK_Renderer1() - "<<this);
- //myImplicitFunctionWidget->SetPlaceFactor(1.1);
myWidgetCtrl->SetPlaceFactor(1.1);
//
- VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- pPlanesWidget->SetOutlineTranslation(false);
- vtkProperty* aSelectedPlaneProperty = pPlanesWidget->GetSelectedPlaneProperty();
- vtkProperty* aPlaneProperty = pPlanesWidget->GetPlaneProperty();
+ VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
+ aPlanesWidget->SetOutlineTranslation(false);
+ vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty();
+ vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty();
aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5);
//
myWidgetCtrl->Delete();
}
}
+
//----------------------------------------------------------------------------
void
VVTK_Renderer1
AdjustWidgetCtrl();
}
}
+
+
//----------------------------------------------------------------------------
-void VVTK_Renderer1::AdjustWidgetCtrl()
+void
+VVTK_Renderer1
+::AdjustWidgetCtrl()
{
- if(SVTK_Renderer::OnAdjustActors()){
- VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- pPlanesWidget->InitialPlaceWidget(myBndBox);
- pPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
- 0.5*(myBndBox[3] + myBndBox[2]),
- 0.5*(myBndBox[5] + myBndBox[4]));
- //
- VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- pSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
- 0.5*(myBndBox[3] + myBndBox[2]),
- 0.5*(myBndBox[5] + myBndBox[4]));
- float dX, dXmin=1.e20;
- for (int i=0; i<3; ++i) {
- dX=myBndBox[2*i+1]-myBndBox[2*i];
- if (dX<dXmin){
- dXmin=dX;
- }
- }
- pSphereWidget->SetRadius(dXmin);
+ VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
+ aPlanesWidget->InitialPlaceWidget(myBndBox);
+ aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
+ 0.5*(myBndBox[3] + myBndBox[2]),
+ 0.5*(myBndBox[5] + myBndBox[4]));
+ //
+ VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget();
+ aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
+ 0.5*(myBndBox[3] + myBndBox[2]),
+ 0.5*(myBndBox[5] + myBndBox[4]));
+
+ float aMinLength = VTK_LARGE_FLOAT;
+ for (int i=0; i<3; ++i) {
+ float aLength = myBndBox[2*i+1]-myBndBox[2*i];
+ aMinLength = std::min(aMinLength,aLength);
}
+ aSphereWidget->SetRadius(aMinLength);
}
+
//----------------------------------------------------------------------------
void
VVTK_Renderer1
}
//----------------------------------------------------------------------------
-VISU_WidgetCtrl* VVTK_Renderer1::GetWidgetCtrl()
+VISU_WidgetCtrl*
+VVTK_Renderer1
+::GetWidgetCtrl()
{
return myWidgetCtrl.GetPointer();
}
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
-
#include "VVTK_ViewModel.h"
-#include "VVTK_ViewWindow.h"
-
-#include "SVTK_View.h"
-#include "SVTK_MainWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
-#include "VTKViewer_ViewModel.h"
+#include "VVTK_ViewWindow.h"
-//==========================================================
-VVTK_Viewer
-::VVTK_Viewer()
+VVTK_Viewer::
+VVTK_Viewer()
{
- myTrihedronSize = 105;
}
-VVTK_Viewer
-::~VVTK_Viewer()
-{}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::setViewManager(SUIT_ViewManager* theViewManager)
+VVTK_Viewer::
+~VVTK_Viewer()
{
- SUIT_ViewModel::setViewManager(theViewManager);
-
- if ( !theViewManager )
- return;
-
- connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
-
- connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
-
- connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
}
-
//==========================================================
-SUIT_ViewWindow*
-VVTK_Viewer
-::createView( SUIT_Desktop* theDesktop )
+SUIT_ViewWindow*
+VVTK_Viewer::
+createView( SUIT_Desktop* theDesktop )
{
- TViewWindow* aViewWindow = new TViewWindow(theDesktop);
+ TViewWindow* aViewWindow = new TViewWindow (theDesktop);
aViewWindow->Initialize(this);
-
+
aViewWindow->setBackgroundColor( backgroundColor() );
aViewWindow->SetTrihedronSize( trihedronSize() );
return aViewWindow;
}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::contextMenuPopup( QPopupMenu* thePopup )
-{
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
-
- thePopup->insertSeparator();
-
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
- if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
- }
- }
-}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::Repaint()
-{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
- aView->getMainWindow()->Repaint();
- }
- }
-}
-
-
-//==========================================================
-bool
-VVTK_Viewer
-::isVisible( const Handle(SALOME_InteractiveObject)& io )
-{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow))
- if(!aView->getView()->isVisible( io ))
- return false;
-
- return true;
-}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-void
-VVTK_Viewer
-::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-void
-VVTK_Viewer
-::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-
-//==========================================================
-QColor
-VVTK_Viewer
-::backgroundColor() const
-{
- return myBgColor;
-}
-
-void
-VVTK_Viewer
-::setBackgroundColor( const QColor& theColor )
-{
- if ( !theColor.isValid() )
- return;
-
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
- aView->setBackgroundColor(theColor);
- }
- }
- }
-
- myBgColor = theColor;
-}
-
-//==========================================================
-int
-VVTK_Viewer
-::trihedronSize() const
-{
- return myTrihedronSize;
-}
-
-void
-VVTK_Viewer
-::setTrihedronSize( const int theSize )
-{
- myTrihedronSize = theSize;
- if(SUIT_ViewManager* aViewManager = getViewManager()){
- QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
- for ( int i = 0; i < aViews.count(); i++ ){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i ))){
- aView->getMainWindow()->SetTrihedronSize( theSize );
- }
- }
- }
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onDumpView()
-{
- if(SUIT_ViewWindow* aView = myViewManager->getActiveView())
- aView->onDumpView();
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onChangeBgColor()
-{
- if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
- QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
- setBackgroundColor(aColor);
- }
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onShowToolbar()
-{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
- aView->getMainWindow()->getToolBar()->show();
- }
- }
-}
-
#include <qcolor.h>
#include "VVTK.h"
-#include "SVTK_ViewModelBase.h"
-
-#include "SALOME_Prs.h"
-#include "SALOME_InteractiveObject.hxx"
+#include "SVTK_ViewModel.h"
class VVTK_ViewWindow;
-//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View
-class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
+//! VVTK View Model
+class VVTK_EXPORT VVTK_Viewer : public SVTK_Viewer
{
Q_OBJECT;
VVTK_Viewer();
virtual ~VVTK_Viewer();
- //! Redefine SUIT_ViewModel::createView
+ //! See #SUIT_ViewModel::createView
virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
- //! Redefine SUIT_ViewModel::setViewManager
- virtual void setViewManager(SUIT_ViewManager* theViewManager);
- //! Redefine SUIT_ViewModel::contextMenuPopup
- virtual void contextMenuPopup( QPopupMenu* );
//! See SUIT_ViewModel::getType
virtual QString getType() const { return Type(); }
-
- //! Redefine SALOME_View::Repaint
- virtual void Repaint();
-
- //! Redefine SALOME_View::isVisible
- virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
-
- //! Get background color of the viewer
- QColor backgroundColor() const;
-
- //! Set background color to the viewer
- void setBackgroundColor( const QColor& );
-
- //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
- int trihedronSize() const;
-
- //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
- void setTrihedronSize( const int );
-
-protected slots:
- void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
-
- void onDumpView();
- void onShowToolbar();
- void onChangeBgColor();
-
-private:
- QColor myBgColor;
- int myTrihedronSize;
- bool mySelectionEnabled;
- bool myMultiSelectionEnabled;
};
#endif