-This is the version 1.4.0 of VISU
+This is the version 1.4.1 of VISU
Compatible with :
- - KERNEL 1.4.0
- - MED 1.4.0
+ - KERNEL 1.4.1
+ - MED 1.4.1
@COMMENCE@
-SUBDIRS = idl src
+SUBDIRS = idl src doc
RESOURCES_FILES = \
ModuleVisu.png \
Visu_scaling.png \
VISU_en.xml \
VISU_fr.xml \
+VISU.config \
VISUCatalog.xml \
Visu_tree_visu.png \
Visu_streamlines.png
# test if SALOMEconfig.h has changed (contents)
salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
@if ! [ -a $@ ]; then \
- cp -p $< $@; \
+ cp -p -f $< $@; \
fi; \
if ! cmp $< $@; then \
- cp -p $< $@; \
+ cp -p -f $< $@; \
fi; \
include/salome/sstream: salome_adm/unix/sstream
$(INSTALL) -d $(includedir)
@for f in X $(include_list); do \
if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(includedir)/. || exit 1); \
+ ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \
fi; \
done
AC_SUBST(MED_ROOT_DIR)
else
- AC_MSG_WARN("Cannot find compiled Med module distribution")
+ AC_MSG_WARN("Cannot find Med module sources")
fi
AC_MSG_RESULT(for Med: $Med_ok)
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
-OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
+OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/salome/idl \
+ -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@
OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
CORBA_LIBS = @CORBA_LIBS@
CORBA_CXXFLAGS = @CORBA_CXXFLAGS@
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome \
+ -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@
IDL = @IDL@
sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
incmakedir=${prefix}/salome_adm/unix
-docdir=$(datadir)/doc
+docdir=${prefix}/doc/salome
#
# begin of package rules
#
-.PHONY: all lib bin inc resources data doc tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
+.PHONY: all lib bin inc resources data docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
-THIS IS SALOME - VISU VERSION: 1.4.0
+THIS IS SALOME - VISU VERSION: 1.4.1
fi
# make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl directory
-cd bin
+mkdir -p bin/salome
+cd bin/salome
for i in $ROOT_SRCDIR/bin/*
do
local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
case "$local_bin" in
*.in | *~) ;;
- ./bin/CVS) ;;
- *) ln -fs $i; echo $local_bin ;;
+ ./bin/CVS | ./bin/salome) ;;
+ *) /usr/bin/install -C $i .; echo $local_bin ;;
esac
done
cd $ROOT_BUILDDIR
srcdir=@srcdir@
VPATH=.:@srcdir@
-SUBDIRS=html
+SUBDIRS= salome
-doc:
+@COMMENCE@
+
+docs:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
+
+uninstall:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
-VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
+VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
@COMMENCE@
PY_CLIENT_IDL = $(IDL_FILES)
# we copy all idl file in $(top_builddir)/idl
-inc: $(IDL_FILES:%=$(top_builddir)/idl/%)
+inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(IDL_FILES:%=$(top_builddir)/idl/%):$(top_builddir)/idl/%:%
+$(top_builddir)/idl/salome:
+ mkdir $@
+
+$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
# $(CP) $< $@
- cp -f $< $@
+ cp -f $^ $(top_builddir)/idl/salome
lib: pyidl
$(PYTHON_BUILD_SITE):
$(INSTALL) -d $@
-$(PYTHON_BUILD_SITE)/%_idl.py: %.idl
+$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
$(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
install: install-pyidl install-idl
# create directory $(idldir) and copy idl files into it
-install-idl: $(IDL_FILES)
+install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(idldir)
$(INSTALL_DATA) $^ $(idldir)
-install-pyidl: $(IDL_FILES)
+install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(PYTHON_SITE_INSTALL)
@for file in $^ dummy; do \
if [ $$file != "dummy" ]; then \
distclean:
-$(RM) *.py
- -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/%)
+ -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(RM) Makefile
<!-- ************************* Selection (menubar) ************************************** -->
<menu-item label-id="Selection" item-id="41" pos-id="4">
- <submenu label-id="Cell" item-id="411" pos-id="">
- <popup-item item-id="4111" pos-id="" label-id="Select by number" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4112" pos-id="" label-id="Return attributes" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- </submenu>
- <endsubmenu />
- <submenu label-id="Point" item-id="412" pos-id="">
- <popup-item item-id="4121" pos-id="" label-id="Select by number" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4122" pos-id="" label-id="Return attributes" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- </submenu>
- <endsubmenu />
- <popup-item item-id="413" pos-id="" label-id="Shape" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4111" pos-id="" label-id="Selection info..." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************* Representation (menubar) ************************************** -->
<!-- ************************* Preferences (menubar) ************************************** -->
<menu-item label-id="Preferences" item-id="4" pos-id="">
- <submenu label-id="Visu" item-id="" pos-id="-1">
+ <submenu label-id="Visu" item-id="50" pos-id="-1">
<popup-item item-id="51" pos-id="" label-id="Scalar Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="52" pos-id="" label-id="Sweeping" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<!--toolbutton-item item-id="4017" pos-id="" label-id="Same As..." icon-id="Visu_sameas.png" tooltip-id="Same As" accel-id="" toggle-id="" execute-action=""/-->
</toolbar>
-<toolbar label-id="Selection Toolbar">
- <toolbutton-item item-id="101" pos-id="" label-id="Point" icon-id="Visu_selectionpoint.png" tooltip-id="Point selection" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="102" pos-id="" label-id="Edge" icon-id="Visu_selectionedge.png" tooltip-id="Edge selection" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="103" pos-id="" label-id="Cell" icon-id="Visu_selectioncell.png" tooltip-id="Cell selection" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="104" pos-id="" label-id="Actor" icon-id="Visu_selectionactor.png" tooltip-id="Actor selection" accel-id="" toggle-id="" execute-action=""/>
-</toolbar>
-
</desktop> <!-- DESKTOP END -->
</application> <!-- APPLICATION END -->
<!-- ************************* Preferences (menubar) ************************************** -->
<menu-item label-id="Preferences" item-id="4" pos-id="">
- <submenu label-id="Visu" item-id="" pos-id="-1">
+ <submenu label-id="Visu" item-id="50" pos-id="-1">
<popup-item item-id="51" pos-id="" label-id="Scalar Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="52" pos-id="" label-id="Sweeping" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
static int MYDEBUG = 0;
#endif
-void parseFile(const char* theFileName) throw(std::runtime_error&){
+void parseFile(const char* theFileName) {
try{
cout<<"'"<<theFileName<<"'...\n";
auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
#endif
extern "C" {
- VISU_Convertor* CreateConvertor(const string& theFileName) throw(std::runtime_error&){
+ VISU_Convertor* CreateConvertor(const string& theFileName) {
if(QFileInfo(theFileName.c_str()).extension(false) == "med")
return CreateMedConvertor(theFileName);
else
}
pair<int,int> TMeshOnEntity::GetCellsDims(const string& theFamilyName) const
- throw(std::runtime_error&)
{
bool isFamilyPresent = (theFamilyName != "");
int aNbCells = 0, aCellsSize = 0;
}
const TFamily* GetFamily(const VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName)
- throw(std::runtime_error&)
{
if(theFamilyName == "") return NULL;
const VISU::TFamilyMap& aFamilyMap = theMeshOnEntity.myFamilyMap;
}
TFamily* GetFamily(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName)
- throw(std::runtime_error&)
{
if(theFamilyName == "") return NULL;
VISU::TFamilyMap& aFamilyMap = theMeshOnEntity.myFamilyMap;
}
-const VISU::TMeshMap& VISU_Convertor::GetMeshMap() throw(std::runtime_error&){
+const VISU::TMeshMap& VISU_Convertor::GetMeshMap() {
if(!myIsDone) { myIsDone = true; Build();}
return myMeshMap;
}
TFamilyMap myFamilyMap;
TFieldMap myFieldMap;
TMeshOnEntity() : myNbCells(0), myCellsSize(0) {}
- std::pair<vtkIdType,vtkIdType> GetCellsDims(const std::string& theFamilyName = "") const
- throw(std::runtime_error&);
+ std::pair<vtkIdType,vtkIdType> GetCellsDims(const std::string& theFamilyName = "") const;
+
};
typedef std::map<TEntity,TMeshOnEntity> TMeshOnEntityMap;
const TFamily* GetFamily(const VISU::TMeshOnEntity& theMeshOnEntity,
- const std::string& theFamilyName)
- throw(std::runtime_error&);
+ const std::string& theFamilyName);
+
TFamily* GetFamily(VISU::TMeshOnEntity& theMeshOnEntity,
- const std::string& theFamilyName)
- throw(std::runtime_error&);
+ const std::string& theFamilyName);
typedef std::pair<std::string,TEntity> TFamilyAndEntity;
typedef std::set<TFamilyAndEntity> TFamilyAndEntitySet;
virtual int IsDone() const { return myIsDone;}
typedef vtkUnstructuredGrid TOutput;
- virtual VISU_Convertor* Build() throw (std::runtime_error&) = 0;
- virtual const VISU::TMeshMap& GetMeshMap() throw(std::runtime_error&);
- virtual float GetSize() throw (std::runtime_error&) = 0;
+ virtual VISU_Convertor* Build() = 0;
+ virtual const VISU::TMeshMap& GetMeshMap() ;
+ virtual float GetSize() = 0;
virtual TOutput* GetMeshOnEntity(const std::string& theMeshName,
const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "")
- throw(std::runtime_error&) = 0;
+ const std::string& theFamilyName = "") = 0;
+
virtual float GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "")
- throw (std::runtime_error&) = 0;
-
+ const std::string& theFamilyName = "") = 0;
virtual TOutput* GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName)
- throw(std::runtime_error&) = 0;
+ const std::string& theGroupName) = 0;
+
virtual float GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName)
- throw(std::runtime_error&) = 0;
-
+ const std::string& theGroupName) = 0;
virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
- throw(std::runtime_error&) = 0;
+ int theStampsNum) = 0;
+
virtual float GetTimeStampSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
- throw(std::runtime_error&) = 0;
+ int theStampsNum) = 0;
+
virtual float GetFieldOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
- const std::string& theFieldName)
- throw(std::runtime_error&) = 0;
+ const std::string& theFieldName) = 0;
+
virtual const VISU::TField& GetField(const std::string& theMeshName,
VISU::TEntity theEntity,
- const std::string& theFieldName)
- throw(std::runtime_error&) = 0;
+ const std::string& theFieldName) = 0;
+
virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
- throw(std::runtime_error&) = 0;
-
+ int theStampsNum) = 0;
+
static std::string GenerateName(const VISU::TField::TTime& aTime);
static std::string GenerateName(const std::string& theName, unsigned int theTimeId);
static void WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName);
};
extern "C"{
- VISU_Convertor* CreateMedConvertor(const std::string& theFileName) throw(std::runtime_error&);
- VISU_Convertor* CreateDatConvertor(const std::string& theFileName) throw(std::runtime_error&);
- VISU_Convertor* CreateConvertor(const std::string& theFileName) throw(std::runtime_error&);
+ VISU_Convertor* CreateMedConvertor(const std::string& theFileName) ;
+ VISU_Convertor* CreateDatConvertor(const std::string& theFileName) ;
+ VISU_Convertor* CreateConvertor(const std::string& theFileName) ;
};
#endif
namespace{
void GetPoints(VISU::TVTKSource& theStorage, VISU::TMesh& theMesh)
- throw (std::runtime_error&)
{
vtkPoints* aPoints = theMesh.myPoints.GetPointer();
if(!aPoints){
void GetCellsOnEntity(VISU::TVTKSource& theStorage,
const VISU::TMeshOnEntity& theMeshOnEntity,
const string& theFamilyName)
- throw (std::runtime_error&)
{
//Check on existing family
const VISU::TFamily* pFamily = VISU::GetFamily(theMeshOnEntity,theFamilyName);
void GetCellsOnGroup(VISU::TVTKSource& theStorage,
const VISU::TMesh& theMesh,
const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&)
{
//Calculate dimentions of the group
int aNbCells = 0, aCellsSize = 0;
void InitProfile(VISU::TVTKExtractFilter& theFilter,
const VISU::TMeshOnEntity& theMeshOnEntity,
const VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
const VISU::TField::TValForCells& aValForCells = theValForTime.myValForCells;
const VISU::TMeshOnEntity::TCellsConn &aCellsConn = theMeshOnEntity.myCellsConn;
const std::string& theFieldName,
const VISU::TField& theField,
const VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
//theFloatArray->DebugOn();
theFloatArray->SetNumberOfTuples(theNumberOfTuples);
const VISU::TMeshOnEntity& theMeshOnEntity,
const VISU::TField& theField,
const VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
int aNumberOfTuples = theField.myDataSize/theField.myNbComp;
string aFieldName = GenerateFieldName(theField,theValForTime);
const VISU::TMeshOnEntity& theMeshOnEntity,
const VISU::TField& theField,
const VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
int aNumberOfTuples = theField.myDataSize/theField.myNbComp;
string aFieldName = GenerateFieldName(theField,theValForTime);
VISU_Convertor_impl::GetMeshOnEntity(const string& theMeshName,
const VISU::TEntity& theEntity,
const string& theFamilyName)
- throw (std::runtime_error&)
{
if(MYDEBUG)
MESSAGE("GetMeshOnEntity - theMeshName = '"<<theMeshName<<
VISU_Convertor::TOutput*
VISU_Convertor_impl::GetMeshOnGroup(const string& theMeshName,
const string& theGroupName)
- throw(std::runtime_error&)
{
if(MYDEBUG) MESSAGE("GetMeshOnGroup - theMeshName = '"<<theMeshName<<
"'; theGroupName = '"<<theGroupName<<"'");
const VISU::TEntity& theEntity,
const string& theFieldName,
int theStampsNum)
- throw(std::runtime_error&)
{
if(MYDEBUG){
MESSAGE("GetTimeStampOnMesh - theMeshName = '"<<theMeshName<<"; theEntity = "<<theEntity);
}
void VISU_Convertor_impl::FindMesh(const string& theMeshName, VISU::TMesh*& theMesh)
- throw (std::runtime_error&)
{
GetMeshMap();
if(myMeshMap.find(theMeshName) == myMeshMap.end())
VISU::TMeshOnEntity*& theMeshOnEntity,
const string& theFamilyName,
VISU::TFamily*& theFamily)
- throw (std::runtime_error&)
{
FindMesh(theMeshName,theMesh);
VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
}
-float VISU_Convertor_impl::GetSize() throw (std::runtime_error&){
+float VISU_Convertor_impl::GetSize() {
float aResult = 0.0;
const VISU::TMeshMap& aMeshMap = GetMeshMap();
VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
float VISU_Convertor_impl::GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFamilyName)
- throw (std::runtime_error&)
{
VISU::TMesh* pMesh = NULL;
VISU::TFamily* pFamily = NULL;
void VISU_Convertor_impl::FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
const std::string& theGroupName, VISU::TGroup*& theGroup)
- throw (std::runtime_error&)
{
FindMesh(theMeshName,theMesh);
VISU::TGroupMap& aGroupMap = theMesh->myGroupMap;
float VISU_Convertor_impl::GetMeshOnGroupSize(const std::string& theMeshName,
const std::string& theGroupName)
- throw (std::runtime_error&)
{
VISU::TMesh* pMesh = NULL;
VISU::TGroup* pGroup = NULL;
VISU::TMeshOnEntity*& theMeshOnEntity,
VISU::TMeshOnEntity*& theVTKMeshOnEntity,
const string& theFieldName, VISU::TField*& theField)
- throw (std::runtime_error&)
{
VISU::TFamily* pFamily = NULL;
VISU::TMeshOnEntity* pMeshOnEntity = NULL;
float VISU_Convertor_impl::GetFieldOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName)
- throw(std::runtime_error&)
{
VISU::TMesh* pMesh = NULL;
VISU::TField* pField = NULL;
VISU::TMeshOnEntity*& theVTKMeshOnEntity,
const std::string& theFieldName, VISU::TField*& theField,
int theStampsNum, VISU::TField::TValForTime*& theValForTime)
- throw (std::runtime_error&)
{
FindField(theMeshName,theMesh,theEntity,theMeshOnEntity,theVTKMeshOnEntity,theFieldName,theField);
VISU::TField::TValField& aValField = theField->myValField;
const VISU::TEntity& theEntity,
const std::string& theFieldName,
int theStampsNum)
- throw (std::runtime_error&)
{
VISU::TMesh* pMesh = NULL;
VISU::TField* pField = NULL;
VISU_Convertor_impl::GetField(const string& theMeshName,
VISU::TEntity theEntity,
const string& theFieldName)
- throw (std::runtime_error&)
{
VISU::TMesh* pMesh = NULL;
VISU::TField* pField = NULL;
const VISU::TEntity& theEntity,
const std::string& theFieldName,
int theStampsNum)
- throw (std::runtime_error&)
{
VISU::TMesh* pMesh = NULL;
VISU::TField* pField = NULL;
class VISU_Convertor_impl: public VISU_Convertor{
public:
- virtual float GetSize() throw (std::runtime_error&);
+ virtual float GetSize() ;
virtual float GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "")
- throw (std::runtime_error&);
+ const std::string& theFamilyName = "");
virtual float GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName)
- throw(std::runtime_error&);
+ const std::string& theGroupName);
virtual float GetTimeStampSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
- throw(std::runtime_error&);
+ int theStampsNum);
virtual float GetFieldOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
- const std::string& theFieldName)
- throw(std::runtime_error&);
+ const std::string& theFieldName);
virtual const VISU::TField& GetField(const std::string& theMeshName,
VISU::TEntity theEntity,
- const std::string& theFieldName)
- throw(std::runtime_error&);
+ const std::string& theFieldName);
virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
- throw(std::runtime_error&);
+ int theStampsNum);
public:
VISU_Convertor_impl();
virtual ~VISU_Convertor_impl();
- virtual VISU_Convertor* Build() throw (std::runtime_error&) { return this;};
+ virtual VISU_Convertor* Build() { return this;};
virtual TOutput* GetMeshOnEntity(const std::string& theMeshName,
const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "")
- throw(std::runtime_error&);
+ const std::string& theFamilyName = "");
virtual TOutput* GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName)
- throw(std::runtime_error&);
+ const std::string& theGroupName);
virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
- throw(std::runtime_error&);
+ int theStampsNum);
protected:
- void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh)
- throw(std::runtime_error&);
+ void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh);
void FindMeshOnEntity(const std::string& theMeshName, VISU::TMesh*& theMesh,
const VISU::TEntity& theEntity, VISU::TMeshOnEntity*& theMeshOnEntity,
- const std::string& theFamilyName, VISU::TFamily*& theFamily)
- throw (std::runtime_error&);
+ const std::string& theFamilyName, VISU::TFamily*& theFamily);
void FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
- const std::string& theGroupName, VISU::TGroup*& theGroup)
- throw (std::runtime_error&);
+ const std::string& theGroupName, VISU::TGroup*& theGroup);
void FindField(const std::string& theMeshName, VISU::TMesh*& theMesh,
const VISU::TEntity& theEntity,
VISU::TMeshOnEntity*& theMeshOnEntity,
VISU::TMeshOnEntity*& theVTKMeshOnEntity,
- const std::string& theFieldName, VISU::TField*& theField)
- throw (std::runtime_error&);
+ const std::string& theFieldName, VISU::TField*& theField);
void FindTimeStamp(const std::string& theMeshName, VISU::TMesh*& theMesh,
const VISU::TEntity& theEntity,
VISU::TMeshOnEntity*& theMeshOnEntity,
VISU::TMeshOnEntity*& theVTKMeshOnEntity,
const std::string& theFieldName, VISU::TField*& theField,
- int theStampsNum, VISU::TField::TValForTime*& theValForTime)
- throw (std::runtime_error&);
+ int theStampsNum, VISU::TField::TValForTime*& theValForTime);
protected:
virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
- const std::string& theFamilyName = "")
- throw (std::runtime_error&) = 0;
+ const std::string& theFamilyName = "") = 0;
virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&) = 0;
+ const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet) = 0;
virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField,
- VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&) = 0;
+ VISU::TField::TValForTime& theValForTime) = 0;
};
#endif
static int PRECISION = 7;
extern "C"
-VISU_Convertor* CreateDatConvertor(const string& theFileName) throw(std::runtime_error&){
+VISU_Convertor* CreateDatConvertor(const string& theFileName) {
VISU_DatConvertor* aConvertor = new VISU_DatConvertor(theFileName);
aConvertor->Build();
return aConvertor;
}
-VISU_DatConvertor::VISU_DatConvertor(const string& theFileName) throw(std::runtime_error&){
+VISU_DatConvertor::VISU_DatConvertor(const string& theFileName) {
myFileInfo.setFile(QString(theFileName.c_str()));
myName = (const char*)(myFileInfo.baseName());
}
-VISU_Convertor* VISU_DatConvertor::Build() throw (std::runtime_error&){
+VISU_Convertor* VISU_DatConvertor::Build() {
/*
ifstream stmIn(myFileInfo.absFilePath());
if(!stmIn.good())
}
int VISU_DatConvertor::ImportField(ifstream* pStmIn, int theNbPoints, vector<int>* pCellsType)
- throw (std::runtime_error&)
{
/*
ifstream &stmIn = *pStmIn;
int VISU_DatConvertor::ImportHead(ifstream* pStmIn, int* theNbPoints,
int* theNbCells, int* theNbFields)
- throw (std::runtime_error&)
{
/*
ifstream &stmIn = *pStmIn;
}
int VISU_DatConvertor::ImportPoints(ifstream* pStmIn, int theNbPoints)
- throw (std::runtime_error&)
{
/*
ifstream &stmIn = *pStmIn;
}
int VISU_DatConvertor::ImportCells(ifstream* pStmIn, vector<int>* pCellsType)
- throw (std::runtime_error&)
{
/*
ifstream &stmIn = *pStmIn;
#include "VISU_Convertor_impl.hxx"
#include <fstream>
+using namespace std;
+
class VISU_DatConvertor: public VISU_Convertor_impl{
VISU_DatConvertor();
VISU_DatConvertor(const VISU_DatConvertor&);
public:
- VISU_DatConvertor(const string& theFileName) throw (std::runtime_error&);
- virtual VISU_Convertor* Build() throw (std::runtime_error&);
+ VISU_DatConvertor(const string& theFileName) ;
+ virtual VISU_Convertor* Build() ;
protected:
QFileInfo myFileInfo;
- int ImportHead(ifstream* pStmIn, int* theNbPoints, int* theNbCells, int* theNbFields)
- throw (std::runtime_error&);
- int ImportPoints(ifstream*, int theNbPoints)
- throw (std::runtime_error&);
- int ImportCells(ifstream*, vector<int>* aCellsType)
- throw (std::runtime_error&);
- int ImportField(ifstream*, int theNbPoints, vector<int>* aCellsType)
- throw (std::runtime_error&);
+ int ImportHead(ifstream* pStmIn, int* theNbPoints, int* theNbCells, int* theNbFields) ;
+
+ int ImportPoints(ifstream*, int theNbPoints) ;
+
+ int ImportCells(ifstream*, vector<int>* aCellsType) ;
+
+ int ImportField(ifstream*, int theNbPoints, vector<int>* aCellsType) ;
+
protected:
virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
const string& theFamilyName = "")
- throw (std::runtime_error&) {return 1;}
+ {return 1;}
virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&) {return 1;}
+ {return 1;}
virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField,
VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&) {return 1;}
+ {return 1;}
};
#endif
};
void GetEntity2Geom(const VISU::TEntity& theEntity, med_geometrie_element*& theVector, int* theEnd)
- throw (std::runtime_error&)
{
switch(theEntity){
case VISU::CELL_ENTITY: theVector = CELLGEOM; *theEnd = MED_NBR_GEOMETRIE_MAILLE; break;
}
extern "C"
-VISU_Convertor* CreateMedConvertor(const string& theFileName) throw(std::runtime_error&){
+VISU_Convertor* CreateMedConvertor(const string& theFileName) {
return new VISU_MedConvertor(theFileName);
}
MedFile();
MedFile(const MedFile&);
public:
- MedFile(const char* theFileName) throw(std::runtime_error&) :
+ MedFile(const char* theFileName) :
myFileName(strdup(theFileName))
{
myFid = MEDouvrir(myFileName,MED_LECT);
const med_idt& GetFid() const { return myFid;};
};
-VISU_MedConvertor::VISU_MedConvertor(const string& theFileName) throw (std::runtime_error&) {
+VISU_MedConvertor::VISU_MedConvertor(const string& theFileName) {
myFileInfo.setFile(QString(theFileName.c_str()));
myName = myFileInfo.baseName().latin1();
}
-VISU_Convertor* VISU_MedConvertor::Build() throw (std::runtime_error&) {
+VISU_Convertor* VISU_MedConvertor::Build() {
MedFile aMedFile(myFileInfo.absFilePath());
med_idt fid = aMedFile.GetFid();
med_int iMeshEnd = MEDnMaa(fid); //Get number of meshes
int VISU_MedConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
const string& theFamilyName)
- throw (std::runtime_error&)
{
//Open the med file (it will be closed by call of destructor)
MedFile aMedFile(myFileInfo.absFilePath());
int VISU_MedConvertor::LoadMeshOnGroup(VISU::TMesh& theMesh,
const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&)
{
//Open the med file (it will be closed by call of destructor)
MedFile aMedFile(myFileInfo.absFilePath());
VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField,
VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
//Open the med file (it will be closed by call of destructor)
MedFile aMedFile(myFileInfo.absFilePath());
}
int VISU_MedConvertor::LoadPoints(const med_idt& fid, VISU::TMesh& theMesh, const string& theFamilyName)
- throw (std::runtime_error&)
{
try{
//Check on existing family
int VISU_MedConvertor::LoadCellsOnEntity(const med_idt& fid, VISU::TMeshOnEntity& theMeshOnEntity,
const string& theFamilyName)
- throw (std::runtime_error&)
{
try{
//Check on existing family
int VISU_MedConvertor::LoadField(const med_idt& fid, const VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
//Check on loading already done
if(!theValForTime.myValForCells.empty()) return 0;
VISU_MedConvertor();
VISU_MedConvertor(const VISU_MedConvertor&);
public:
- VISU_MedConvertor(const std::string& theFileName) throw (std::runtime_error&);
- virtual VISU_Convertor* Build() throw (std::runtime_error&);
+ VISU_MedConvertor(const std::string& theFileName) ;
+ virtual VISU_Convertor* Build() ;
protected:
QFileInfo myFileInfo;
virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
- const std::string& theFamilyName = "")
- throw (std::runtime_error&);
+ const std::string& theFamilyName = "");
+
virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&);
+ const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+
virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField,
- VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&);
+ VISU::TField::TValForTime& theValForTime);
int LoadPoints(const med_idt& fid, VISU::TMesh& theMesh,
- const std::string& theFamilyName = "")
- throw (std::runtime_error&);
+ const std::string& theFamilyName = "");
+
int LoadCellsOnEntity(const med_idt& fid, VISU::TMeshOnEntity& theMeshOnEntity,
- const std::string& theFamilyName = "")
- throw (std::runtime_error&);
+ const std::string& theFamilyName = "");
+
int LoadField(const med_idt& fid, const VISU::TMeshOnEntity& theMeshOnEntity,
- VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&);
+ VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
+
};
#endif
VISU_Actor::VISU_Actor(){
SetDebug(MYVTKDEBUG);
- myIsShrunk = false;
- myIsShrinkable = false;
myParent = this;
myPipeLine = NULL;
myPrs3d = NULL;
+ myStoreMapping = true;
+
+ myIsShrunk = false;
+ myIsShrinkable = false;
+ myShrinkFilter = vtkShrinkPolyData::New();
+
myIO = NULL;
myName = "";
ishighlighted = false;
IsHighlighting = true;
HighlightProperty = vtkProperty::New();
- HighlightProperty->SetAmbient(0.5);
- HighlightProperty->SetDiffuse(0.3);
- HighlightProperty->SetSpecular(0.2);
+ HighlightProperty->SetAmbient(0.5);
+ HighlightProperty->SetDiffuse(0.3);
+ HighlightProperty->SetSpecular(0.2);
HighlightProperty->SetRepresentationToSurface();
HighlightProperty->SetAmbientColor(1, 1, 1);
HighlightProperty->SetDiffuseColor(1, 1, 1);
HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5);
+
+ vtkProperty* aProperty = this->GetProperty();
+ aProperty->SetAmbient(0.5);
+ aProperty->SetDiffuse(0.2);
+ aProperty->SetSpecular(0.2);
+ aProperty->SetAmbientColor(1, 1, 1);
+ aProperty->SetDiffuseColor(1, 1, 1);
+ aProperty->SetSpecularColor(0.5, 0.5, 0.5);
+ this->SetProperty(aProperty);
}
VISU_Actor::~VISU_Actor(){
SALOME_Actor::SetProperty(NULL);
HighlightProperty->Delete();
if(myPipeLine) myPipeLine->UnRegister(this);
+
+ myShrinkFilter->UnRegisterAllOutputs();
+ myShrinkFilter->Delete();
}
void VISU_Actor::setIO(const Handle(SALOME_InteractiveObject)& theIO){
myPrs3d = thePrs3d;
}
-void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&){
+void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) {
if (myPipeLine != thePipeLine){
if (myPipeLine != NULL) myPipeLine->UnRegister(this);
myPipeLine = thePipeLine;
}
void VISU_Actor::SetRepresentation(int theMode) {
- int aRepresent = GetRepresentation();
SALOME_Actor::SetRepresentation(theMode);
- if(GetMapper() && GetMapper()->GetInput()){
- vtkGeometryFilter* aGeometryFilter = vtkGeometryFilter::New();
- aGeometryFilter->SetInput(GetMapper()->GetInput());
- vtkPolyData* aPolyData = aGeometryFilter->GetOutput();
- aPolyData->Update();
- static int INCMEMORY = 7;
- float aSize = INCMEMORY*aPolyData->GetActualMemorySize()*1024.0;
- int isPoss = VISU_PipeLine::CheckAvailableMemory(aSize);
- if(MYDEBUG) MESSAGE("SetRepresentation - aSize = "<<aSize<<"; isPoss = "<<isPoss);
- aPolyData->Delete();
- if(!isPoss){
- SALOME_Actor::SetRepresentation(aRepresent);
- throw std::runtime_error("SetRepresentation >> There is no enough memory !!!");
- }
- }
+}
+
+void VISU_Actor::SetOpacity(float theValue){
+ GetProperty()->SetOpacity(theValue);
+}
+
+float VISU_Actor::GetOpacity(){
+ return GetProperty()->GetOpacity();
}
void VISU_Actor::SetShrinkable(bool theIsShrinkable){
}
void VISU_Actor::SetShrink(float theFactor){
- if(!myIsShrinkable || myIsShrunk) return;
- vtkShrinkPolyData *aShrinkFilter = vtkShrinkPolyData::New();
- aShrinkFilter->SetShrinkFactor(theFactor);
- // use for post-filtering
- aShrinkFilter->SetInput(myPassFilter[2]->GetPolyDataOutput());
- myPassFilter[3]->SetInput(aShrinkFilter->GetOutput());
- aShrinkFilter->Register(myPassFilter[3]);
- aShrinkFilter->Delete();
- myIsShrunk = true;
+ if(!myIsShrinkable) return;
+ if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
+ myShrinkFilter->SetShrinkFactor(theFactor);
+ myShrinkFilter->SetInput(aDataSet);
+ myPassFilter.at(2)->SetInput(myShrinkFilter->GetOutput());
+ myIsShrunk = true;
+ }
}
void VISU_Actor::UnShrink(){
if(!myIsShrunk) return;
- myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
- myPassFilter[3]->Modified();
- myIsShrunk = false;
+ if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
+ myPassFilter.at(2)->SetInput(aDataSet);
+ myPassFilter.at(2)->Modified();
+ myIsShrunk = false;
+ }
}
void VISU_Actor::SetVisibility(int theMode){
if(ishighlighted) ishighlighted=false;
}
}
+
+int VISU_Actor::GetObjId(int theVtkID){
+ if (GetRepresentation() == 0) return -1; // points
+ return myGeomFilter->GetObjId(theVtkID);
+}
+
+VISU_Actor::TVectorId VISU_Actor::GetVtkId(int theObjID){
+ return myGeomFilter->GetVtkId(theObjID);
+}
#define VISU_ACTOR_H
#include "SALOME_Actor.h"
+#include "SALOME_GeometryFilter.h"
#include <stdexcept>
#include <string>
class vtkProp;
class vtkProperty;
+class vtkShrinkPolyData;
+
+class VISU_PipeLine;
namespace VISU {
class Prs3d_i;
}
-class VISU_PipeLine;
#ifdef _WIN_32
#define VTKOCC_EXPORT __declspec (dllexport)
virtual void SetPrs3d(VISU::Prs3d_i* thePrs3d);
virtual VISU_PipeLine* GetPipeLine() { return myPipeLine;}
- virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
+ virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
VISU_Actor* GetParent(){ return myParent;}
virtual void SetParent(VISU_Actor* theParent);
- void highlight(Standard_Boolean highlight);
+ virtual void highlight(Standard_Boolean highlight);
Standard_Boolean isHighlighted() { return true; };
- void SetOpacity(float opa) {};
- float GetOpacity() { return 0;};
+ virtual void SetOpacity(float theValue);
+ virtual float GetOpacity();
virtual void SetShrinkable(bool theIsShrinkable);
virtual bool GetShrinkable() { return myIsShrinkable;}
virtual void SetLineWidth(float theLineWidth);
virtual float GetLineWidth();
+
+ int GetObjId(int theVtkID);
+ TVectorId GetVtkId(int theObjID);
bool IsHighlighting;
std::string myFieldName;
VISU::Prs3d_i* myPrs3d;
VISU_PipeLine* myPipeLine;
vtkProperty* HighlightProperty;
+
+ vtkShrinkPolyData* myShrinkFilter;
bool myIsShrinkable;
bool myIsShrunk;
};
#include <vtkFeatureEdges.h>
#include <vtkDataSetMapper.h>
#include <vtkDataSet.h>
+#include <vtkMatrix4x4.h>
+#include <vtkMapperCollection.h>
vtkStandardNewMacro(VISU_MeshAct);
VISU_MeshAct::VISU_MeshAct(){
+
+ vtkMatrix4x4 *m;
+ m = vtkMatrix4x4::New();
+
mySurfaceActor = VISU_Actor::New();
mySurfaceActor->SetParent(this);
mySurfaceActor->GetProperty()->FrontfaceCullingOff();
mySurfaceActor->GetProperty()->BackfaceCullingOff();
+ mySurfaceActor->SetUserMatrix(m);
mySurfaceActor->SetRepresentation(2); //SURFACE
myEdgeActor = VISU_Actor::New();
myEdgeActor->PickableOff();
myEdgeActor->GetProperty()->FrontfaceCullingOff();
myEdgeActor->GetProperty()->BackfaceCullingOff();
+ myEdgeActor->SetUserMatrix(m);
myEdgeActor->SetRepresentation(1); //WIREFRAME
myNodeActor = VISU_Actor::New();
myNodeActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE);
myNodeActor->GetProperty()->FrontfaceCullingOff();
myNodeActor->GetProperty()->BackfaceCullingOff();
+ myNodeActor->SetUserMatrix(m);
myNodeActor->SetRepresentation(0); //POINT
+ m->Delete();
SetRepresentation(2); //SURFACE
}
}
void VISU_MeshAct::setIO(const Handle(SALOME_InteractiveObject)& theIO){
+ VISU_Actor::setIO(theIO);
mySurfaceActor->setIO(theIO);
myEdgeActor->setIO(theIO);
myNodeActor->setIO(theIO);
}
void VISU_MeshAct::AddToRender(vtkRenderer* theRenderer){
- theRenderer->AddActor(mySurfaceActor);
+ theRenderer->AddActor(this);
theRenderer->AddActor(myEdgeActor);
- theRenderer->AddActor(myNodeActor);
}
void VISU_MeshAct::RemoveFromRender(vtkRenderer* theRenderer){
- theRenderer->RemoveActor(mySurfaceActor);
+ theRenderer->RemoveActor(this);
theRenderer->RemoveActor(myEdgeActor);
- theRenderer->RemoveActor(myNodeActor);
}
-void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&){
+void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
VISU_Actor::SetPipeLine(thePipeLine);
mySurfaceActor->SetPipeLine(thePipeLine);
myEdgeActor->SetPipeLine(thePipeLine);
}
void VISU_MeshAct::SetTransform(SALOME_Transform* theTransform){
+ VISU_Actor::SetTransform(theTransform);
mySurfaceActor->SetTransform(theTransform);
myEdgeActor->SetTransform(theTransform);
myNodeActor->SetTransform(theTransform);
myNodeActor->SetShrinkable(theIsShrinkable);
}
-vtkProperty* VISU_MeshAct::GetProperty(){
+vtkProperty* VISU_MeshAct::GetSurfaceProperty(){
mySurfaceActor->GetProperty();
}
-void VISU_MeshAct::SetProperty(vtkProperty* theProperty){
+void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){
mySurfaceActor->SetProperty(theProperty);
}
myNodeActor->SetProperty(theProperty);
}
+void VISU_MeshAct::highlight(Standard_Boolean highlight){
+ VISU_Actor::highlight(highlight);
+ mySurfaceActor->highlight(highlight);
+ myEdgeActor->highlight(highlight);
+ myNodeActor->highlight(highlight);
+}
+
+void VISU_MeshAct::SetOpacity(float theValue){
+ GetSurfaceProperty()->SetOpacity(theValue);
+}
+
+float VISU_MeshAct::GetOpacity(){
+ return GetSurfaceProperty()->GetOpacity();
+}
+
void VISU_MeshAct::SetLineWidth(float theLineWidth){
GetEdgeProperty()->SetLineWidth(theLineWidth);
}
mySurfaceActor->VisibilityOff();
}
}
+
+// From vtkLODActor
+void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
+{
+ float myTime, bestTime, tempTime;
+ vtkMatrix4x4 *matrix;
+ vtkMapper *mapper, *bestMapper;
+
+ if (this->Mapper == NULL)
+ {
+ vtkErrorMacro("No mapper for actor.");
+ return;
+ }
+
+ // first time through create lods if non have been added
+ if (this->LODMappers->GetNumberOfItems() == 0)
+ {
+ this->CreateOwnLODs();
+ }
+
+ // If the actor has changed or the primary mapper has changed ...
+ // Is this the correct test?
+ if (this->MediumMapper)
+ {
+ if (this->GetMTime() > this->BuildTime ||
+ this->Mapper->GetMTime() > this->BuildTime)
+ {
+ this->UpdateOwnLODs();
+ }
+ }
+
+ // figure out how much time we have to render
+ myTime = this->AllocatedRenderTime;
+
+ // Figure out which resolution to use
+ // none is a valid resolution. Do we want to have a lowest:
+ // bbox, single point, ...
+ // There is no order to the list, so it is assumed that mappers that take
+ // longer to render are better quality.
+ // Timings might become out of date, but we rely on
+
+ bestMapper = this->Mapper;
+ bestTime = bestMapper->GetTimeToDraw();
+ if (bestTime > myTime)
+ {
+ this->LODMappers->InitTraversal();
+ while ((mapper = this->LODMappers->GetNextItem()) != NULL &&
+ bestTime != 0.0)
+ {
+ tempTime = mapper->GetTimeToDraw();
+
+ // If the LOD has never been rendered, select it!
+ if (tempTime == 0.0)
+ {
+ bestMapper = mapper;
+ bestTime = 0.0;
+ }
+ else
+ {
+ if (bestTime > myTime && tempTime < bestTime)
+ {
+ bestMapper = mapper;
+ bestTime = tempTime;
+ }
+ if (tempTime > bestTime && tempTime < myTime)
+ {
+ bestMapper = mapper;
+ bestTime = tempTime;
+ }
+ }
+ }
+ }
+
+ switch(GetRepresentation()){
+ case 0: //POINTS
+ myNodeActor->GetProperty()->Render(this, ren);
+ break;
+ case 1: //WIREFRAME
+ //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ break;
+ case 2: //SURFACE
+ mySurfaceActor->GetProperty()->Render(this, ren);
+ break;
+ case 3: //INSIDEFRAME
+ //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ break;
+ case 4: //SURFACEFRAME
+ //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ mySurfaceActor->GetProperty()->Render(this, ren);
+ break;
+ }
+
+ // render the texture
+ if (this->Texture)
+ {
+ this->Texture->Render(ren);
+ }
+
+ switch(GetRepresentation()){
+ case 0: //POINTS
+ matrix = myNodeActor->GetUserMatrix();
+ break;
+ case 1: //WIREFRAME
+ matrix = myEdgeActor->GetUserMatrix();
+ break;
+ case 2: //SURFACE
+ matrix = mySurfaceActor->GetUserMatrix();
+ break;
+ case 3: //INSIDEFRAME
+ matrix = myEdgeActor->GetUserMatrix();
+ break;
+ case 4: //SURFACEFRAME
+ matrix = myEdgeActor->GetUserMatrix();
+ this->GetMatrix(matrix);
+ matrix = mySurfaceActor->GetUserMatrix();
+ break;
+ }
+ this->GetMatrix(matrix);
+
+ switch(GetRepresentation()){
+ case 0: //POINTS
+ myNodeActor->Render(ren,bestMapper);
+ break;
+ case 1: //WIREFRAME
+ //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ break;
+ case 2: //SURFACE
+ mySurfaceActor->Render(ren,bestMapper);
+ break;
+ case 3: //INSIDEFRAME
+ //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ break;
+ case 4: //SURFACEFRAME
+ //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ mySurfaceActor->Render(ren,bestMapper);
+ break;
+ }
+
+ this->EstimatedRenderTime = bestMapper->GetTimeToDraw();
+}
+
+// From vtkLODActor
+void VISU_MeshAct::Modified()
+{
+ myNodeActor->Modified();
+ //PAL5268: myEdgeActor->Modified();
+ mySurfaceActor->Modified();
+ this->vtkActor::Modified();
+}
virtual void AddToRender(vtkRenderer* theRenderer);
virtual void RemoveFromRender(vtkRenderer* theRenderer);
- virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
+ virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
virtual void SetTransform(SALOME_Transform* theTransform);
- virtual vtkProperty* GetProperty();
- virtual void SetProperty(vtkProperty* theProperty);
+ virtual void highlight(Standard_Boolean highlight);
+
+ virtual vtkProperty* GetSurfaceProperty();
+ virtual void SetSurfaceProperty(vtkProperty* theProperty);
virtual vtkProperty* GetEdgeProperty();
virtual void SetEdgeProperty(vtkProperty* theProperty);
virtual vtkProperty* GetNodeProperty();
virtual void SetNodeProperty(vtkProperty* theProperty);
+ virtual void SetOpacity(float theValue);
+ virtual float GetOpacity();
+
virtual void SetLineWidth(float theLineWidth);
virtual float GetLineWidth();
virtual void SetShrink(float theFactor = 0.8);
virtual void UnShrink();
+ virtual void Render(vtkRenderer *, vtkMapper *);
+ void Modified();
+
protected:
VISU_MeshAct();
VISU_Actor *mySurfaceActor, *myEdgeActor, *myNodeActor;
VISU_VectorsAct::~VISU_VectorsAct(){}
-void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&){
+void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
if(myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine)){
VISU_Actor::SetPipeLine(myPipeLine);
myPipeLine->Delete();
static VISU_VectorsAct* New();
~VISU_VectorsAct();
- virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
+ virtual void SetPipeLine(VISU_PipeLine* thePipeLine);
virtual void SetTransform(SALOME_Transform* theTransform);
CPPFLAGS+= $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS+= $(VTK_LIBS) -lSalomeVTKFilter -lVisuConvertor \
- -L${KERNEL_ROOT_DIR}/lib/salome
+ -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace
@CONCLUDE@
myMapper->Update();
}
-
int VISU_PipeLine::CheckAvailableMemory(const float& theSize){
try{
if(theSize > ULONG_MAX) return 0;
MESSAGE("CheckAvailableMemory("<<theSize<<") - cannot alloacate such amount of memory!!!");
return aCheck != NULL;
//return theSize < 1000*1024*1024;
- }catch(...){
- if(MYDEBUG)
+ }catch(std::bad_alloc& exc){
+ if(MYDEBUG)
+ MESSAGE("CheckAvailableMemory("<<theSize<<") " << exc.what());
+ } catch(...) {
+ if(MYDEBUG)
MESSAGE("CheckAvailableMemory("<<theSize<<") - unexpected exception was caught!!!");
}
return 0;
#include "VISU_DeformedShapePL.hxx"
#include <vtkStreamLine.h>
+using namespace std;
+
class vtkPointSet;
class vtkCellCenters;
class SALOME_GeometryFilter;
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2003-10-07 11:25+0400\n"
+"PO-Revision-Date: 2004-02-17 11:17+0300\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
msgid "WRN_CANT_VISUALIZE_PRS"
msgstr "The presentation can't be visualized.\nNull actor is created."
+msgid "ERR_NO_MEMORY"
+msgstr "There is no enough memory"
+
msgid "LBL_SOURCE_TYPE"
msgstr "Source type"
#include "Plot2d_SetupPlot2dDlg.h"
#include "Plot2d_ViewFrame.h"
#include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_InteractorStyleSALOME.h"
#include "VisuGUI_FileDlg.h"
// QT Includes
return dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
}
+static void UpdateViewFrame() {
+ QList<QAD_StudyFrame> aFrameList = VisuGUI::GetActiveStudy()->getStudyFrames();
+
+ for (QAD_StudyFrame* aStudyFrame = aFrameList.first(); aStudyFrame; aStudyFrame = aFrameList.next()) {
+ if (aStudyFrame->getTypeView() == VIEW_VTK) {
+ QAD_ViewFrame* aViewFrame = aStudyFrame->getRightFrame()->getViewFrame();
+ VTKViewer_ViewFrame* aVtkViewFrame = dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
+ if (!aVtkViewFrame) continue;
+ VTKViewer_RenderWindowInteractor* anInteractor = aVtkViewFrame->getRWInteractor();
+ if (anInteractor) {
+ anInteractor->SetSelectionProp();
+ anInteractor->SetSelectionTolerance();
+ VTKViewer_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
+ if (aStyle) {
+ aStyle->setPreselectionProp();
+ }
+ }
+ }
+ }
+}
+
SALOMEDS::Study_var VisuGUI::GetStudyDocument(){
return GetActiveStudy()->getStudyDocument();
}
visuGUI->SelectionInfo();
break;
- /* ========================================================================================================================= */
- /* Selection - Shape */
- /* ========================================================================================================================= */
-
- //case 413 :
-
/* ========================================================================================================================= */
/* Visualization - Wireframe */
/* ========================================================================================================================= */
tr ("VISU_BUT_OK") );
break;
}
+ } catch (const std::bad_alloc& e ) {
+ INFOS("bad_alloc exception is caught "<<e.what());
+ QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+ tr("ERR_NO_MEMORY") + " " + tr(e.what()),
+ tr("VISU_BUT_OK") );
+ return false;
+ }
+ catch (std::exception& e){
+ INFOS(e.what());
+ QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+ tr(e.what()),
+ tr("VISU_BUT_OK") );
}catch (const SALOME::SALOME_Exception& S_ex) {
+ INFOS("const SALOME::SALOME_Exception& S_ex");
QtCatchCorbaException(S_ex);
return false;
}
catch(...) {
+ INFOS(tr("ERR_UNKNOWN_EXCEPTION").latin1());
QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr ("VISU_WARNING"),
tr("ERR_UNKNOWN_EXCEPTION"),
tr("VISU_BUT_OK") );
// Slot-functions for presentations creation
//=====================================================================================
-
#define CREATEPRESENTATION(FunctionName) \
void FunctionName() { \
if (checkLock(GetStudyDocument())) return; \
-
//=====================================================================================
// function : setSettings()
// purpose :
if(aValue.isEmpty()? 0 : aValue.toInt())
pp->setItemChecked(anId, true);
+ anId = 50;
+ parent->menuBar()->changeItem(anId,parent->getComponentUserName("VISU"));
+
+ ::UpdateViewFrame();
+
return true;
}
thePrs->UpdateActor(anActor);
}
}catch(std::runtime_error& ex){
- QApplication::restoreOverrideCursor();
INFOS(ex.what());
+ QApplication::restoreOverrideCursor();
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr ("ERR_CANT_BUILD_PRESENTATION"),
+ tr ("ERR_CANT_BUILD_PRESENTATION") + " " + tr(ex.what()),
tr ("VISU_BUT_OK") );
for(int i = 0, nbFrames = GetActiveStudy()->getStudyFramesCount(); i < nbFrames; i++)
if(QAD_StudyFrame* aFrame = GetActiveStudy()->getStudyFrame(i)){
{
VISU::CutPlanes_i* aPrsObject = dynamic_cast<VISU::CutPlanes_i*>(aPrs3d);
if (aPrsObject) {
- VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg(false, false);
+ VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg(false, false);
aDlg->initFromPrsObject(aPrsObject);
aDlg->show();
myActiveDialogBox = aDlg;
}catch(std::runtime_error& exc){
INFOS(exc.what());
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr ("ERR_CANT_CREATE_ACTOR"),
+ tr ("ERR_CANT_CREATE_ACTOR") + " " + tr(exc.what()),
tr ("VISU_BUT_OK") );
}
}
}
QApplication::setOverrideCursor( Qt::waitCursor );
- for (int j=0 ; j<aCycles; j++) {
- for (int i=0 ; i<=aSteps; i++) {
- float aPercents = float(i)/aSteps;
- aPrsObject->SetMapScale(aPercents);
- aPrsObject->UpdateActor(aActor);
- vf->getRW()->getRenderWindow()->Render();
- usleep(aTemp);
+ try{
+ for (int j=0 ; j<aCycles; j++) {
+ for (int i=0 ; i<=aSteps; i++) {
+ float aPercents = float(i)/aSteps;
+ aPrsObject->SetMapScale(aPercents);
+ aPrsObject->UpdateActor(aActor);
+ vf->getRW()->getRenderWindow()->Render();
+ usleep(aTemp);
+ }
}
+ }catch(std::exception& exc){
+ INFOS("Follow exception was accured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was accured!");
}
QApplication::restoreOverrideCursor();
}
thePopup->clear();
SALOME_Selection* aSelection = SALOME_Selection::Selection(GetActiveStudy()->getSelection());
if ( aSelection->IObjectCount() == 0 ) {
- if ( theParent == "Viewer" && isVTKViewer)
- // Available only for VTK viewer
+ if ( theParent == "Viewer" && isVTKViewer && !aIsLocked)
thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) );
return false;
}
if ( !aIsLocked )thePopup->insertItem("Create Presentation", visuGUI, SLOT(CreateMesh()));
break;
case VISU::TVIEW3D:
+ if ( GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK )
+ thePopup->insertItem( "Restore view parameters", visuGUI, SLOT( RestoreViewParams() ) );
if ( !aIsLocked ) {
if ( GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) {
// Available only for VTK viewer
thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) );
- thePopup->insertItem( "Restore view parameters", visuGUI, SLOT( RestoreViewParams() ) );
}
thePopup->insertItem( "Rename...", visuGUI, SLOT( Rename() ) );
thePopup->insertItem("Delete", visuGUI, SLOT(DeleteViewParams()));
vf->AddActor(SelectedActor);
}catch(std::runtime_error& exc){
INFOS(exc.what());
+ throw exc;
}
}else
if(MYDEBUG) MESSAGE("CORBA::is_nil(anObject) = true");
VisuGUI::DefinePopup( theContext, theParent, theObject );
}
- bool activeStudyChanged ( QAD_Desktop* parent )
+ bool activeStudyChanged ( QAD_Desktop* parent )
{
- //VisuGUI::activeStudyChanged( parent );
+ ::UpdateViewFrame();
}
- void buildPresentation ( const Handle(SALOME_InteractiveObject)& theIO )
+
+ void buildPresentation ( const Handle(SALOME_InteractiveObject)& theIO )
{
VisuGUI::BuildPresentation(theIO);
}
if (--bufferSize) buffer[1] = (int)VIEW_PLOT2D;
}
+ void deactivate()
+ {
+ visuGUI->EmitSignalCloseAllDialogs();
+ }
}
//////////////////////////////////////////////////////////////////////////////////
int intopac;
CursorDlg->Comment1->setText( tr( "Set value between") );
CursorDlg->Comment2->setText( tr( "0 (transparent) and 100 (opaque)" ) );
- oldopac=Actor->GetProperty()->GetOpacity();
- intopac=int(oldopac*100.);
+ oldopac=Actor->GetOpacity();
+ intopac=int(oldopac*100.+0.5);
CursorDlg->SpinBox1->setMinValue(0);
CursorDlg->SpinBox1->setMaxValue(100);
CursorDlg->SpinBox1->setValue(intopac);
{
intopac = CursorDlg->SpinBox1->value() ;
newopac = intopac/100.;
- Actor->GetProperty()->SetOpacity(newopac);
+ Actor->SetOpacity(newopac);
}
delete CursorDlg;
}
return false; \
} \
} \
- CreateActor(pPresent); \
+ try { \
+ CreateActor(pPresent); \
+ }catch (...) {\
+ return false;} \
return true; \
} \
return false; \
bool VisuGUI::CreateCutPlanes(SALOMEDS::SObject_var theField) {
+ try {
VISU::Storable::TRestoringMap aMap = getMapOfValue(theField);
bool isExist;
QString aType = VISU::Storable::FindValue(aMap,"myType",&isExist);
return true;
}
}
+}catch (...){return false;}
return false;
}
bool VisuGUI::CreateCutLines(SALOMEDS::SObject_var theField) {
+try {
VISU::Storable::TRestoringMap aMap = getMapOfValue(theField);
bool isExist;
QString aType = VISU::Storable::FindValue(aMap,"myType",&isExist);
// return true;
}
}
+}catch (...){return false; }
return false;
}
try {
GetVisuGen() -> ExportTableToFile(aSObj, aFile.latin1());
QAD_Application::getDesktop()->putInfo(aFile+" exported.");
+ } catch(std::exception& ex) {
+ INFOS(ex.what());
+ QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+ tr ("ERR_ERROR_DURING_EXPORT") + " " + tr(ex.what()),
+ tr ("VISU_BUT_OK") );
} catch(...) {
+ INFOS(tr ("ERR_ERROR_DURING_EXPORT"));
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
tr ("ERR_ERROR_DURING_EXPORT"),
tr ("VISU_BUT_OK") );
try{
//APO - aResult->GetInput()->ToFile(aFile.latin1());
QAD_Application::getDesktop()->putInfo(aFile+" exported.");
- }catch(...){
+ }catch(std::exception& ex) {
+ INFOS(ex.what());
+ QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+ tr ("ERR_ERROR_DURING_EXPORT") + " " +tr(ex.what()),
+ tr ("VISU_BUT_OK") );
+ }
+ catch(...){
+ INFOS(tr ("ERR_ERROR_DURING_EXPORT").latin1());
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
tr ("ERR_ERROR_DURING_EXPORT"),
tr ("VISU_BUT_OK") );
try{
anVISUActor = thePrs->CreateActor();
vf->AddActor(anVISUActor);
- }catch(std::runtime_error& exc){
+ } catch ( std::runtime_error& exc ){
INFOS(exc.what());
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr ("ERR_CANT_VISUALIZE_OBJECT"),
- tr ("VISU_BUT_OK") );
+ tr("ERR_CANT_VISUALIZE_OBJECT") + " " + tr(exc.what()),
+ tr ("VISU_BUT_OK") );
anVISUActor = NULL;
}
return anVISUActor;
timer.Start();
#endif
try{
+ MESSAGE("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
VISU_Actor* aActor = thePrs->CreateActor();
vf->AddActor(aActor);
- }catch(std::runtime_error& exc){
- INFOS(exc.what());
+ }catch(std::runtime_error& exc) {
+ INFOS("std::runtime_error "<<exc.what());
+ INFOS("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
QApplication::restoreOverrideCursor();
QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
- tr ("WRN_CANT_VISUALIZE_PRS"),
- tr ("VISU_BUT_OK") );
+ tr ("WRN_CANT_VISUALIZE_PRS") + " " + tr(exc.what()),
+ tr ("VISU_BUT_OK") );
+ throw exc;
+ } catch (...) {
+ cout<<" Unknown exception"<<endl;
+ QApplication::restoreOverrideCursor();
+ INFOS("Unknown exception is caught in VisuGUI::CreateActor");
+ INFOS("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
+ QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+ tr ("WRN_CANT_VISUALIZE_PRS") + " " + tr("ERR_UNKNOWN_EXCEPTION"),
+ tr ("VISU_BUT_OK") );
+ throw ;
}
#ifdef CHECKTIME
timer.Stop();
MYGenerateTable = myCreateTable->isChecked();
MYGenerateCurve = myCurvesCheck->isChecked();
if (myScalarPane->check()) {
+ ((QWidget*)sender())->setDisabled(true);
storeToPrsObject(myPrs);
if (myIsCreation) {
if (isGenerateTable()) {
}
}
if (myStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- visuGUI->CreateActor(myPrs);
+ try {
+ visuGUI->CreateActor(myPrs);
+ }
+ catch (...) {
+ reject();
+ return;
+ }
GET_VTK_VIEWFRAME(myStudy)->onViewFitAll();
}
} else {
vtkAppendPolyData* aPolyData = myCutPlanes->GetCutPlanesPL()->GetAppendPolyData();
vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
+ if (!aPolyData->GetOutput()->GetNumberOfCells()) {
+ onPreviewCheck(false);
+ return;
+ }
aPlaneMapper->SetInput(aPolyData->GetOutput());
aPlaneMapper->ScalarVisibilityOff();
if (storeToPrsObject(myPrs)) {
if (myIsCreation) {
if (myStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ try {
visuGUI->CreateActor(myPrs);
+ }
+ catch (...) {
+ reject();
+ return;
+ }
GET_VTK_VIEWFRAME(myStudy)->onViewFitAll();
}
} else {
reject();
}
-VisuGUI_CutPlanesDlg::~VisuGUI_CutPlanesDlg () {
- reject();
-}
-
-
//###################################################################
public:
VisuGUI_CutPlanesDlg(bool theIsCreation, bool theIsModal);
- ~VisuGUI_CutPlanesDlg();
+ ~VisuGUI_CutPlanesDlg() {};
void initFromPrsObject(VISU::CutPlanes_i* thePrs)
{myPrs=thePrs; myScalarPane->initFromPrsObject(thePrs); myCutPane->initFromPrsObject(thePrs);}
bool VisuGUI_IsoSurfPane::check() {
if (MinIso->text().toDouble() >= MaxIso->text().toDouble()) {
+ MESSAGE(tr("MSG_MINMAX_VALUES"));
QAD_MessageBox::warn1( this,tr("VISU_WARNING"),
tr("MSG_MINMAX_VALUES"),
tr("VISU_BUT_OK"));
// Module : VISU
// $Header$
-using namespace std;
-#include "utilities.h"
+#include "VisuGUI_Selection.h"
+
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SALOME_Selection.h"
#include "VISU_Actor.h"
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <map>
+
#include <qstring.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <vtkCell.h>
#include <qvalidator.h>
-#include "VisuGUI_Selection.h"
+#include "utilities.h"
+using namespace std;
extern VisuGUI *visuGUI;
void VisuGUI_SelectionDlg::onSelectionChange(int theId) {
- clearFields();
+ // clearFields();
switch (theId) {
case 0: // Points
myWidgetStack->raiseWidget(myPointsPane);
- QAD_Application::getDesktop()->SetSelectionMode(1, true);
+ QAD_Application::getDesktop()->SetSelectionMode(NodeSelection, true);
+ onPointIdEdit(myIDValLbl->text());
break;
case 1: // Cells
myWidgetStack->raiseWidget(myCellsPane);
- QAD_Application::getDesktop()->SetSelectionMode(3, true);
+ QAD_Application::getDesktop()->SetSelectionMode(CellSelection, true);
+ onCellIdEdit(myCellIDValLbl->text());
break;
case 2: // Actor
myWidgetStack->raiseWidget(myActorsPane);
- QAD_Application::getDesktop()->SetSelectionMode(4, true);
+ QAD_Application::getDesktop()->SetSelectionMode(ActorSelection, true);
}
onSelectionEvent();
// if (VTKViewer_ViewFrame* vf = visuGUI->GetVtkViewFrame())
void VisuGUI_SelectionDlg::closeEvent(QCloseEvent* theEvent) {
- QAD_Application::getDesktop()->SetSelectionMode(4, true);
+ QAD_Application::getDesktop()->SetSelectionMode(ActorSelection, true);
disconnect(mySelection,0,0,0);
QDialog::closeEvent(theEvent);
}
#define ABS(a) (a>=0)?a:-a
void VisuGUI_SelectionDlg::onSelectionEvent() {
+ if (myFl) return;
+ myFl = true;
Handle(SALOME_InteractiveObject) anIO;
int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){
myDYLbl->setText(QString::number( ABS(aCoord[3]-aCoord[2]) ));
myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
}
+
TColStd_MapOfInteger aMapIndex;
+ typedef map<int,float*> PointsMap;
+ PointsMap aPointsMap;
mySelection->GetIndex(anIO, aMapIndex);
TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex);
- if(anIter.More()){
- VISU_Actor* anActor = visuGUI->GetActor(aPrs3d);
- vtkDataSet* aDataSet = anActor->GetMapper()->GetInput();
- // vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
+
+ VISU_Actor* anActor = visuGUI->GetActor(aPrs3d);
+ vtkDataSet* aDataSet = anActor->GetMapper()->GetInput();
+ vtkPointData* aPntData = aDataSet->GetPointData();
+
+ for (;anIter.More();anIter.Next()){
int aID = anIter.Key();
- vtkPointData* aPntData = aDataSet->GetPointData();
switch (aType) {
case 0:
break;
case 1:
{
- int aMaxId = aDataSet->GetNumberOfCells();
+ //int aMaxId = aDataSet->GetNumberOfCells();
//cout<<"### MaxId="<<aMaxId<<endl;
//cout<<"### SelectedId="<<aID<<endl;
vtkCellData* aData = aDataSet->GetCellData();
vtkCell* aCell = aDataSet->GetCell(aID);
- if (aCell == NULL) return;
-
- int aNbOfPoints = aCell->GetNumberOfPoints();
- if (aNbOfPoints <=1 ) { // Cell is point
- clearFields();
- return;
- }
-
- myCellIDValLbl->setText( QString::number(aID) );
- myCellScalarValLbl->setText(getValue(aData, aID));
- myCellVectorValLbl->setText(getVector(aData, aID));
+ if (aCell != NULL) {
+ int aNbOfPoints = aCell->GetNumberOfPoints();
+ if (aNbOfPoints <=1 ) { // Cell is point
+ clearFields();
+ }
+ else {
+ int aDSId = anActor->GetObjId(aID);
+ if (aDSId==-1) aDSId = aID;
+ myCellIDValLbl->setText( QString::number(aDSId) );
+ myCellScalarValLbl->setText(getValue(aData, aID));
+ myCellVectorValLbl->setText(getVector(aData, aID));
- float aCoord[3];
- vtkIdList *aPointList = aCell->GetPointIds();
- QListViewItem* anItem = NULL;
- myListPoints->setNumRows(aNbOfPoints);
- for(int i = 0; i < aNbOfPoints; i++){
- int idCurrent = aPointList->GetId(i);
- aDataSet->GetPoint(idCurrent,aCoord);
- myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
- myListPoints->setText(i, 0, QString::number( idCurrent ));
- myListPoints->setText(i, 1, QString::number( aCoord[0] ));
- myListPoints->setText(i, 2, QString::number( aCoord[1] ));
- myListPoints->setText(i, 3, QString::number( aCoord[2] ));
- myListPoints->setText(i, 4, getValue(aPntData, idCurrent));
- myListPoints->setText(i, 5, getVector(aPntData, idCurrent));
+ float* aCoord;
+ vtkIdList *aPointList = aCell->GetPointIds();
+ QListViewItem* anItem = NULL;
+
+ for(int i = 0; i < aNbOfPoints; i++){
+ int idCurrent = aPointList->GetId(i);
+ aCoord = aDataSet->GetPoint(idCurrent);
+ aPointsMap.insert(PointsMap::value_type(idCurrent,aCoord));
+ }
+ }
}
}
break;
}
}
+
+ myListPoints->setNumRows(aPointsMap.size());
+ PointsMap::const_iterator It = aPointsMap.begin();
+ for(int i=0; It!=aPointsMap.end()&&i<myListPoints->numRows() ; It++,i++){
+ myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
+ int id = It->first;
+ myListPoints->setText(i, 0, QString::number( id ));
+ float* aCoord = It->second;
+ myListPoints->setText(i, 1, QString::number( aCoord[0] ));
+ myListPoints->setText(i, 2, QString::number( aCoord[1] ));
+ myListPoints->setText(i, 3, QString::number( aCoord[2] ));
+ myListPoints->setText(i, 4, getValue(aPntData, id));
+ myListPoints->setText(i, 5, getVector(aPntData, id));
+ }
+
} else {
clearFields();
}
+ myFl = false;
}
#undef ABS
}
}
+typedef vtkIdType (vtkDataSet::* TDataSetMethod)();
-#define SELECTBYNUM(METHODNAME, DATASETMETHOD) \
-void VisuGUI_SelectionDlg::METHODNAME(const QString& theText) { \
- int anId = theText.toInt(); \
- Handle(SALOME_InteractiveObject) anIO; \
- if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){ \
- TColStd_MapOfInteger aMapIndex; \
- mySelection->GetIndex(anIO, aMapIndex); \
- TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex); \
- if(anIter.More()){ \
- vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput(); \
- int aMaxId = aDataSet->DATASETMETHOD(); \
- if(0 <= anId && anId < aMaxId){ \
- mySelection->AddIObject(anIO); \
- mySelection->AddOrRemoveIndex(anIO, anId, false); \
- } \
- } \
- } else { \
- myMeshName->setText(tr ("WRN_NO_AVAILABLE_DATA")); \
- myFieldName->setText(""); \
- } \
+void onIdEdit(const QString& theText,
+ TDataSetMethod theMethod,
+ bool theIsCell,
+ SALOME_Selection* theSelection,
+ QLabel* theMeshName,
+ QString theValue,
+ QLabel* theFieldName)
+{
+ int anId = theText.toInt();
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){
+ vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
+ int aMaxId = (aDataSet->*theMethod)();
+ if(anId < 0) anId = 0;
+ if(aMaxId <= anId) anId = aMaxId-1;
+ theSelection->AddIObject(anIO);
+ VISU_Actor* anVISUActor = visuGUI->GetActor(aPrs3d);
+ if(theIsCell && !anVISUActor->GetVtkId(anId).empty()){
+ theSelection->AddOrRemoveIndex( anIO, anVISUActor->GetVtkId(anId), false );
+ }else{
+ theSelection->AddOrRemoveIndex(anIO, anId, false);
+ }
+ }else{
+ theMeshName->setText(theValue);
+ theFieldName->setText("");
+ }
}
-SELECTBYNUM(onPointIdEdit, GetNumberOfPoints);
-SELECTBYNUM(onCellIdEdit, GetNumberOfCells);
-
-#undef SELECTBYNUM
+void VisuGUI_SelectionDlg::onPointIdEdit(const QString& theText){
+ if (myFl) return;
+ TDataSetMethod aMethod = &vtkDataSet::GetNumberOfPoints;
+ onIdEdit(theText,aMethod,false,mySelection,
+ myMeshName,tr("WRN_NO_AVAILABLE_DATA"),myFieldName);
+}
+void VisuGUI_SelectionDlg::onCellIdEdit(const QString& theText){
+ if (myFl) return;
+ TDataSetMethod aMethod = &vtkDataSet::GetNumberOfCells;
+ onIdEdit(theText,aMethod,true,mySelection,
+ myMeshName,tr("WRN_NO_AVAILABLE_DATA"),myFieldName);
+}
QLabel* myDZLbl;
SALOME_Selection* mySelection;
+ bool myFl;
};
void SetupDlg::onPreferencesDlg() {
QApplication::setOverrideCursor( Qt::waitCursor );
FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
- if (aData.myPrs == 0)
+ if (aData.myPrs.empty())
myAnimator->generatePresentations(myFieldLst->currentItem());
QApplication::restoreOverrideCursor();
#define EDITPRS(TYPE, DLG) \
{ \
DLG* aDlg = new DLG(); \
- aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs[0])); \
+ aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs.at(0))); \
if (aDlg->exec()) { \
for (int i = 0; i < aData.myNbFrames; i++) \
- aDlg->storeToPrsObject(dynamic_cast<TYPE*>(aData.myPrs[i])); \
+ aDlg->storeToPrsObject(dynamic_cast<TYPE*>(aData.myPrs.at(i))); \
} \
delete aDlg; \
}
// EDITPRS(VISU::CutPlanes_i, VisuGUI_CutPlanesDlg);
{
VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg(false, true);
- aDlg->initFromPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs[0]));
+ aDlg->initFromPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs.at(0)));
if (aDlg->exec()) {
for (int i = 0; i < aData.myNbFrames; i++)
- aDlg->storeToPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs[i]));
+ aDlg->storeToPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs.at(i)));
}
delete aDlg;
}
mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox);
aSaveLay->addMultiCellWidget(mySaveCheck, 0, 0, 0, 2);
+ connect(mySaveCheck, SIGNAL( toggled(bool)),
+ aWheel, SLOT( setDisabled(bool) ));
QLabel* aPathLbl = new QLabel("Path:", aSaveBox);
aPathLbl->setEnabled(false);
QApplication::setOverrideCursor( Qt::waitCursor );
for (int i = 0; i < myAnimator->getNbFields(); i++) {
- if (myAnimator->getFieldData(i).myPrs == 0)
+ if (myAnimator->getFieldData(i).myPrs.empty())
myAnimator->generatePresentations(i);
}
if (myAnimator->getNbFrames() == 0) {
}
void Storable::Registry(const char* theComment, TStorableEngine theEngine)
- throw(std::logic_error&)
{
if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
}
Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const string& theLocalPersistentID)
- throw (std::runtime_error&)
{
try{
QString strIn( theLocalPersistentID.c_str() );
}
const QString& Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
- throw(std::logic_error&)
{
TRestoringMap::const_iterator i = theMap.find(theArg);
if(i == theMap.end()) {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
aCmnt->SetValue(theComment);
- INFOS("CreateAttributes - Comment = "<<theComment);
+ if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
}
if(strcmp(theRefFatherEntry,"") != 0){
SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
const std::string& thePrefix, const TRestoringMap& theMap);
typedef std::map<string,TStorableEngine> TCallbackMap;
- static void Registry(const char* theComment, TStorableEngine theEngine)
- throw(std::logic_error&);
- static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString)
- throw(std::runtime_error&);
- static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL)
- throw(std::logic_error&);
+ static void Registry(const char* theComment, TStorableEngine theEngine);
+ static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
+ static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
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);
static med_err ret = 0;
extern "C" {
- VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) throw(std::runtime_error&){
+ VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) {
return new VISU_MEDConvertor(theMedSObject);
}
- VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) throw(std::runtime_error&){
+ VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) {
return new VISU_MEDFieldConvertor(theField);
}
}
};
void GetEntity2Geom(const VISU::TEntity& theEntity, int*& theVector, int* theEnd)
- throw (std::runtime_error&)
{
switch(theEntity){
case VISU::CELL_ENTITY: theVector = CELLGEOM; *theEnd = MED_NBR_GEOMETRIE_MAILLE; break;
}
-VISU_Convertor* VISU_MEDFieldConvertor::Build() throw (std::runtime_error&){
+VISU_Convertor* VISU_MEDFieldConvertor::Build() {
if(myField->_is_nil())
throw std::runtime_error("VISU_MEDFieldConvertor::Build >> myField->_is_nil() !!!");
return this;
}
-VISU_Convertor* VISU_MEDConvertor::Build() throw (std::runtime_error&){
+VISU_Convertor* VISU_MEDConvertor::Build() {
if(mySObject->_is_nil())
throw std::runtime_error("VISU_MEDConvertor::Build >> mySObject->_is_nil() !!!");
SALOMEDS::Study_var aStudy = mySObject->GetStudy();
int VISU_MEDConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
const string& theFamilyName)
- throw (std::runtime_error&)
{
//Main part of code
const string& aMeshName = theMeshOnEntity.myMeshName;
int VISU_MEDConvertor::LoadMeshOnGroup(VISU::TMesh& theMesh,
const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&)
{
//Main part of code
int isPointsUpdated = 0;
VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField,
VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
//Main part of code
int isPointsUpdated = LoadPoints(theMesh);
}
int VISU_MEDConvertor::LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName)
- throw (std::runtime_error&)
{
//Check on existing family
VISU::TMeshOnEntity& aMeshOnEntity = theMesh.myMeshOnEntityMap[VISU::NODE_ENTITY];
if(MYDEBUG) MESSAGE("LoadPoints - iNumElemEnd = "<<iNumElemEnd);
if (iNumElemEnd <= 0) throw std::runtime_error("LoadPoints >> There is no points in the mesh !!!");
aPointsCoord.resize(theMesh.myDim*iNumElemEnd,0.0);
- SALOME_MED::double_array_var coord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
+ SALOME_MED::double_array_var coord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
if(!isPointsLoaded){
for (int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
for(int iDim = 0, iNumElem2Dim = iNumElem*theMesh.myDim; iDim < theMesh.myDim; iDim++, iNumElem2Dim++)
}
int VISU_MEDConvertor::LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName)
- throw (std::runtime_error&)
{
//Check on existing family
VISU::TFamily* pFamily = VISU::GetFamily(theMeshOnEntity,theFamilyName);
int VISU_MEDConvertor::LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
const VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&)
{
//Check on loading already done
if(!theValForTime.myValForCells.empty()) return 0;
VISU_MEDConvertor() {};
public:
VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
- virtual VISU_Convertor* Build() throw (std::runtime_error&);
+ virtual VISU_Convertor* Build() ;
protected:
virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
- const string& theFamilyName = "")
- throw (std::runtime_error&);
+ const string& theFamilyName = "");
+
virtual int LoadMeshOnGroup(VISU::TMesh& theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
- throw (std::runtime_error&);
+ const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+
virtual int LoadFieldOnMesh(VISU::TMesh& theMesh,
VISU::TMeshOnEntity& theMeshOnEntity,
VISU::TField& theField,
- VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&);
- int LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName = "")
- throw (std::runtime_error&);
- int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName = "")
- throw (std::runtime_error&);
+ VISU::TField::TValForTime& theValForTime);
+
+ int LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName = "") ;
+
+ int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName = "");
+
int LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
- const VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
- throw (std::runtime_error&);
+ const VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
+
};
class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
SALOME_MED::FIELD_var myField;
public:
VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) : myField(SALOME_MED::FIELD::_duplicate(theField)) {}
- virtual VISU_Convertor* Build() throw (std::runtime_error&);
+ virtual VISU_Convertor* Build() ;
};
extern "C" {
- VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) throw(std::runtime_error&);
- VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) throw(std::runtime_error&);
+ VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) ;
+ VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) ;
}
#endif
VISU::Storable* VISU::CutLines_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt());
virtual void ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
VISU::Storable* VISU::CutPlanes_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
SetNbPlanes(VISU::Storable::FindValue(theMap,"myNbPlanes").toInt());
virtual void ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
static const string myComment;
virtual const char* GetComment() const;
VISU::Storable* VISU::DeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
VISU_Actor* VISU::DeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
- throw (std::runtime_error&)
{
VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
anActor->SetRepresentation(1);
}
-void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) {
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
anActor->SetBarVisibility(true);
virtual void ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
virtual void SetMapScale(double theMapScale = 1.0);
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&);
- virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual void UpdateActor(VISU_Actor* theActor) ;
};
}
#include <qstring.h>
#include <qfileinfo.h>
+#include "Utils_ExceptHandlers.hxx"
using namespace std;
static int MYDEBUG = 0;
#endif
+UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
+
extern "C" {
PortableServer::ObjectId *
VISUEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId,
aStudyBuilder->CommitCommand();
}
return aSComponent;
- }
-
+ }
- void RegistryStorable() throw(std::logic_error&) {
+ void RegistryStorable() {
Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
const char* theName)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SalomeException);
if(MYDEBUG) MESSAGE("VISU_Gen_i::PublishInStudy : "<<myMutex);
if(myMutex){
Mutex mt(myMutex,qApp);
VISU::Storable* VISU::IsoSurfaces_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
SetNbSurfaces(VISU::Storable::FindValue(theMap,"myNbSurface").toInt());
virtual void ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
virtual void SetMapScale(double theMapScale = 1.0);
};
int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, Entity theEntity, const char* theFamilyName){
try{
- INFOS("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
+ MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
float aSize = INCMEMORY*
theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity,theFamilyName);
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
return aResult;
}catch(std::runtime_error& exc){
INFOS("Follow exception was accured :\n"<<exc.what());
int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName){
try{
- INFOS("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
+ MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
float aSize = INCMEMORY*
theResult->GetInput()->GetMeshOnGroupSize(theMeshName,theGroupName);
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
VISU::Storable* VISU::Mesh_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
Prs3d_i::Restore(theMap);
VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
- throw (std::runtime_error&)
{
VISU_MeshAct* anActor = VISU_MeshAct::New();
try{
VISU::Prs3d_i::CreateActor(anActor,theIO);
UpdateActor(anActor);
- }catch(std::runtime_error& exc){
+ }catch (...) {
anActor->Delete();
- throw exc;
+ throw ;
}
return anActor;
}
-void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) {
if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
if(MYDEBUG) MESSAGE("Mesh_i::UpdateActor");
VISU::Prs3d_i::UpdateActor(anActor);
anActor->SetRepresentation(myPresentType);
- anActor->GetProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
+ anActor->GetSurfaceProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
anActor->GetEdgeProperty()->SetColor(myLinkColor.R, myLinkColor.G, myLinkColor.B);
anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
}
static const string myComment;
virtual QString GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&);
- virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual void UpdateActor(VISU_Actor* theActor);
};
}
myAddToStudy = true;
myPipeLine = NULL;
CORBA::String_var aName = myStudy->Name();
- INFOS("Prs3d_i - this = "<<this<<"; StudyId = "<<myStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
+ MESSAGE("Prs3d_i - this = "<<this<<"; StudyId = "<<myStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
}
void VISU::Prs3d_i::SameAs(const Prs3d_i* theOrigin)
}
VISU::Prs3d_i::~Prs3d_i() {
- INFOS("~Prs3d_i() - this = "<<this<<"; GetReferenceCount() = "<<myPipeLine->GetReferenceCount());
+ MESSAGE("~Prs3d_i() - this = "<<this<<"; GetReferenceCount() = "<<myPipeLine->GetReferenceCount());
myPipeLine->Delete();
myResult->Destroy();
}
void VISU::Prs3d_i::CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO)
- throw (std::runtime_error&)
{
try{
Update();
}
theActor->SetPipeLine(GetPipeLine());
theActor->SetPrs3d(this);
- }catch(std::runtime_error& ex){
+ }catch(std::bad_alloc& ex){
+ throw std::runtime_error("CreateActor >> No enough memory");
throw ex;
- }catch(...){
+ } catch(std::exception& ex){
+ throw ex;
+ }catch(...) {
throw std::runtime_error("CreateActor >> unexpected exception was caught!!!");
- }
+ }
}
-void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) throw (std::runtime_error&){
- try{
- vtkGeometryFilter* aGeometryFilter = vtkGeometryFilter::New();
- vtkDataSet *aDataSet = theActor->GetMapper()->GetInput();
- aGeometryFilter->SetInput(aDataSet);
- vtkPolyData* aPolyData = aGeometryFilter->GetOutput();
- aPolyData->Update();
- static int INCMEMORY = 7;
- float aSize = INCMEMORY*aPolyData->GetActualMemorySize()*1024.0;
- int isPoss = VISU_PipeLine::CheckAvailableMemory(aSize);
- INFOS("UpdateActor - aSize = "<<aSize<<"; isPoss = "<<isPoss);
- aPolyData->Delete();
- if (aSize <= 0)
- throw std::runtime_error("Prs3d_i::UpdateActor >> Actor is empty !!!");
- if(!isPoss)
- throw std::runtime_error("Prs3d_i::UpdateActor >> There is no enough memory !!!");
-
- theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
- theActor->Modified();
- }catch(std::runtime_error& ex){
- throw ex;
- }catch(...){
- throw std::runtime_error("Prs3d_i::UpdateActor >> unexpected exception was caught!!!");
- }
+void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) {
+ theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+ theActor->Modified();
}
VISU::Storable* VISU::Prs3d_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
myName = VISU::Storable::FindValue(theMap,"myName").latin1();
return this;
Storable::DataToStream( theStr, "myName", myName.c_str() );
}
-void VISU::Prs3d_i::Update() throw (std::runtime_error&){
+void VISU::Prs3d_i::Update() {
try{
myPipeLine->Update();
}catch(...){
VISU_PipeLine *myPipeLine;
SALOMEDS::SObject_var mySObject;
- void CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&);
+ void CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO = NULL);
virtual VISU_PipeLine* GetPipeLine();
public:
- virtual void Update() throw(std::runtime_error&);
+ virtual void Update() ;
VISU_PipeLine* GetPL();
void GetBounds(float aBounds[6]);
virtual const char* GetComment() const = 0;
virtual QString GenerateName() = 0;
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+
virtual void ToStream(std::ostringstream& theStr);
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&) = 0;
- virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL) = 0;
+
+ virtual void UpdateActor(VISU_Actor* theActor) ;
Result_i* GetResult() const { return myResult;}
virtual SALOMEDS::SObject_var GetSObject();
template<class TPrs3d>
Storable* Restore(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
VISU::Result_i* pResult = GetResult(theSObject);
if(pResult != NULL){
if(!CORBA::is_nil(aSObject.in()))
anEntry = aSObject->GetID();
else
- INFOS("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<<myStudy->StudyId()<<" !!!");
+ MESSAGE("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<<myStudy->StudyId()<<" !!!");
return anEntry.in();
}
myInput = NULL;
myIsDone = 0;
CORBA::String_var aName = theStudy->Name();
- INFOS("Result_i::Result_i - this = "<<this<<"; StudyId = "<<
+ MESSAGE("Result_i::Result_i - this = "<<this<<"; StudyId = "<<
theStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
}
try{
float aSize = myInput->GetSize();
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- INFOS("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
+ MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
return aResult;
}catch(std::runtime_error& exc){
INFOS("Follow exception was accured :\n"<<exc.what());
}
VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject)
- throw (std::runtime_error&)
{
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
static QString aCommand;
aCommand.sprintf("cp %s %s",myFileInfo.absFilePath().latin1(),aTmpDir.get());
if(system(aCommand) == -1){
- INFOS("Create - Can't execute the command :"<<aCommand);
+ MESSAGE("Create - Can't execute the command :"<<aCommand);
return NULL;
}
if(MYDEBUG) MESSAGE("Result_i::Create - aCommand = "<<aCommand);
VISU::Storable* VISU::Result_i::Restore(SALOMEDS::SObject_ptr theSObject,
const Storable::TRestoringMap& theMap, const string& thePrefix)
- throw(std::logic_error&)
{
if(MYDEBUG) MESSAGE("Result_i::Restore - "<<thePrefix);
try{
VISU::Storable* VISU::Result_i::Restore(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Result_i* pResult = new VISU::Result_i(aStudy);
const SALOMEDS::SComponent_var& VISU::Result_i::GetSComponent() const { return mySComponent;}
VISU::Result_i::~Result_i() {
- INFOS("Result_i::~Result_i() - this = "<<this);
+ MESSAGE("Result_i::~Result_i() - this = "<<this);
if(GetSourceId() == eRestoredFile){
static QString aCommand;
aCommand.sprintf("rm %s",myFileInfo.filePath().latin1());
- INFOS("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+ MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
aCommand.sprintf("rmdir --ignore-fail-on-non-empty %s",myFileInfo.dirPath().latin1());
- INFOS("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+ MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
}
if(myInput) delete myInput;
}
QFileInfo myFileInfo;
protected:
- virtual Storable* Build(SALOMEDS::SObject_ptr theSObject = SALOMEDS::SObject::_nil())
- throw (std::runtime_error&);
+ virtual Storable* Build(SALOMEDS::SObject_ptr theSObject = SALOMEDS::SObject::_nil()) ;
public:
virtual int IsPossible();
virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap, const string& thePrefix)
- throw(std::logic_error&);
+ const Storable::TRestoringMap& theMap, const string& thePrefix);
+
static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ const string& thePrefix, const Storable::TRestoringMap& theMap);
+
virtual void ToStream(std::ostringstream& theStr);
virtual const char* GetComment() const;
static const string myComment;
bool aResult = true;
if(isMemoryCheck){
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- INFOS("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
return aResult;
}catch(std::runtime_error& exc){
VISU::Storable* VISU::ScalarMap_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
}
-void VISU::ScalarMap_i::Update() throw(std::runtime_error&){
+void VISU::ScalarMap_i::Update() {
VISU::Prs3d_i::Update();
}
}
VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
- throw (std::runtime_error&)
{
VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
try{
anActor->SetRepresentation(2);
anActor->myFieldName = myFieldName;
UpdateActor(anActor);
- }catch(std::runtime_error& exc){
+ }catch(...) {
anActor->Delete();
- throw exc;
+ throw std::runtime_error("CreateActor error");
}
return anActor;
}
-void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) {
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
VISU::Prs3d_i::UpdateActor(theActor);
VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
virtual const char* GetComment() const;
virtual QString GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+
static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ const string& thePrefix, const Storable::TRestoringMap& theMap);
- virtual void Update() throw(std::runtime_error&);
+ virtual void Update() ;
virtual void SetMapScale(double theMapScale = 1.0);
const VISU::TField* GetField() const { return myField;}
virtual int GetIteration() { return myIteration; }
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&);
- virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual void UpdateActor(VISU_Actor* theActor) ;
};
}
VISU_Convertor::TOutput *anOutput =
theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
bool aResult = VISU_StreamLinesPL::IsPossible(anOutput);
- INFOS("StreamLines_i::IsPossible - aResult = "<<aResult);
+ MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
return aResult;
}catch(std::runtime_error& exc){
INFOS("Follow exception was accured :\n"<<exc.what());
VISU::Storable* VISU::StreamLines_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
VISU::Storable* aStorable = DeformedShape_i::Restore(theMap);
}
-void VISU::StreamLines_i::Update() throw(std::runtime_error&){
+void VISU::StreamLines_i::Update() {
SetSource();
VISU::DeformedShape_i::Update();
}
VISU_Actor* VISU::StreamLines_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
- throw (std::runtime_error&)
{
return VISU::DeformedShape_i::CreateActor(theIO);
}
-void VISU::StreamLines_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::StreamLines_i::UpdateActor(VISU_Actor* theActor) {
VISU::DeformedShape_i::UpdateActor(theActor);
}
virtual const char* GetComment() const;
virtual QString GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
- virtual void Update() throw(std::runtime_error&);
+ virtual void Update() ;
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&);
- virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual void UpdateActor(VISU_Actor* theActor);
virtual QString GetSourceEntry() { return QString(mySourceEntry.c_str()); }
};
*/
VISU::Table_i::~Table_i()
{
- INFOS("Table_i::~Table_i");
+ MESSAGE("Table_i::~Table_i");
}
/*!
Gets number of rows in table
SALOMEDS::GenericAttribute_var anAttr;
if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
- return anInt->GetNbRows();
+ return anInt->GetNbRows();
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
{
// generate name ...
myName = GetTableTitle();
+
+ // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
+ if ( myName == "" )
+ if ( !mySObj->_is_nil() ) {
+ CutLines_i* pCutLines = NULL;
+ CORBA::Object_var anObj = SObjectToObject(mySObj);
+ if(!CORBA::is_nil(anObj)){
+ VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+ if(!aCutLines->_is_nil())
+ pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+ }
+ if (!pCutLines)
+ if (mySObj->GetName()) myName = mySObj->GetName();
+ }
+
if ( myName == "" )
myName = GenerateName();
// ... and build the object
GetName(),
"",
aComment.latin1(),
- true );
+ pCutLines );
// create SObject referenced to real table object
mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID( anEntry.c_str() ));
if(pCutLines) {
pCutLines->BuildTableOfReal(mySObj);
}
- SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
- Builder->Addreference( refSO, SO );
+ // mpv (PAL5357): reference attributes are unnecessary now
+ //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+ //Builder->Addreference( refSO, SO );
}
return this;
}
Restores table object from stream
*/
VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
- throw( std::logic_error& )
{
if(MYDEBUG) MESSAGE(GetComment());
myName = (const char*)(VISU::Storable::FindValue(theMap,"myName"));
*/
VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Table_i* pResent = new VISU::Table_i( aStudy, "" );
*/
VISU::Curve_i::~Curve_i()
{
- INFOS("Curve_i::~Curve_i");
+ MESSAGE("Curve_i::~Curve_i");
}
/*!
Creates curve object
Restores curve object from stream
*/
VISU::Storable* VISU::Curve_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO)
- throw( std::logic_error& )
{
if(MYDEBUG) MESSAGE(GetComment());
mySObj = SALOMEDS::SObject::_duplicate(theSO);
*/
VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
*/
VISU::Container_i::~Container_i()
{
- INFOS("Container_i::~Container_i");
+ MESSAGE("Container_i::~Container_i");
myCurves.clear();
}
/*!
Restores container data from the stream
*/
VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMap )
- throw( std::logic_error& )
{
if(MYDEBUG) MESSAGE(GetComment());
myName = VISU::Storable::FindValue( theMap, "myName" ).latin1();
*/
VISU::Storable* VISU::Container_i::Restore(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Container_i* pResent = new VISU::Container_i( aStudy );
public:
virtual Storable* Create();
- virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
- throw(std::logic_error&);
+ virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO);
static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ const string& thePrefix, const Storable::TRestoringMap& theMap);
virtual void ToStream( std::ostringstream& theStr );
static const string myComment;
virtual const char* GetComment() const;
public:
virtual Storable* Create();
- virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO)
- throw(std::logic_error&);
+ virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
+
static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ const string& thePrefix, const Storable::TRestoringMap& theMap);
+
virtual void ToStream( std::ostringstream& theStr );
static const string myComment;
virtual const char* GetComment() const;
public:
virtual Storable* Create();
- virtual Storable* Restore( const Storable::TRestoringMap& theMap )
- throw(std::logic_error&);
+ virtual Storable* Restore( const Storable::TRestoringMap& theMap );
+
static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ const string& thePrefix, const Storable::TRestoringMap& theMap);
+
virtual void ToStream( std::ostringstream& theStr );
static const string myComment;
virtual const char* GetComment() const;
FieldData aNewData;
aNewData.myField = SALOMEDS::SObject::_duplicate(theField);
aNewData.myNbFrames = 0;
- aNewData.myPrs = 0;
- aNewData.myActors = 0;
- aNewData.myTiming = 0;
aNewData.myPrsType = VISU::TSCALARMAP;
VISU::Storable::TRestoringMap aMap = getMapOfValue(aNewData.myField);
aNewData.myNbTimes = VISU::Storable::FindValue(aMap,"myNbTimeStamps").toLong();
//************************************************************************
void VISU_TimeAnimation::clearData(FieldData& theData) {
- if (theData.myTiming) {
- free(theData.myTiming);
- theData.myTiming = 0;
- }
+ theData.myTiming.clear();
vtkRenderer* aRen = myView->getRenderer();
- if (theData.myActors) {
- for (int i = 0; i < theData.myNbFrames; i++) {
- if (theData.myActors[i] != 0) {
- theData.myActors[i]->RemoveFromRender(aRen);
- theData.myActors[i]->Delete();
+ if (!theData.myActors.empty()) {
+ for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) {
+ if (theData.myActors.at(i) != 0) {
+ theData.myActors.at(i)->RemoveFromRender(aRen);
+ theData.myActors.at(i)->Delete();
}
}
- free(theData.myActors);
- theData.myActors = 0;
+ theData.myActors.clear();
}
- if (theData.myPrs) {
- for (int i = 0; i < theData.myNbFrames; i++)
- theData.myPrs[i]->_remove_ref();
- free(theData.myPrs);
- theData.myPrs = 0;
+ if (!theData.myPrs.empty()) {
+ for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++)
+ if (theData.myPrs.at(i) != 0) {
+ theData.myPrs.at(i)->_remove_ref();
+ }
+ theData.myPrs.clear();
}
theData.myNbFrames = 0;
myView->update();
aData.myNbFrames = aData.myNbTimes;
//VISU::Storable::FindValue(aMap,"myNbTimeStamps").toLong();
- aData.myPrs = (VISU::ScalarMap_i**) malloc(aData.myNbTimes * sizeof(VISU::ScalarMap_i*));
- aData.myTiming = (double*) malloc(aData.myNbTimes * sizeof(double));
+ aData.myPrs.resize(aData.myNbTimes,NULL);
+ aData.myTiming.resize(aData.myNbTimes);
SALOMEDS::ChildIterator_var anIter = myStudy->NewChildIterator(aData.myField);
SALOMEDS::SObject_var aTimeStamp;
aTimeStamp = anIter->Value();
if (aTimeStamp->_is_nil()) continue;
- aData.myTiming[i] = getTimeValue(aTimeStamp);
+ aData.myTiming.at(i) = getTimeValue(aTimeStamp);
if (isRangeDefined()) {
- if (aData.myTiming[i] < myMinVal) continue;
- if (aData.myTiming[i] > myMaxVal) break;
+ if (aData.myTiming.at(i) < myMinVal) continue;
+ if (aData.myTiming.at(i) > myMaxVal) break;
}
VISU::Storable::TRestoringMap aTimeMap = getMapOfValue(aTimeStamp);
aFieldName.latin1(), aTimeStampId);
//VISU::ScalarMap_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- aData.myPrs[i] = aPresent;
+ aData.myPrs.at(i) = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::IsoSurfaces_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- aData.myPrs[i] = aPresent;
+ aData.myPrs.at(i) = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::CutPlanes_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- aData.myPrs[i] = aPresent;
+ aData.myPrs.at(i) = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::DeformedShape_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- aData.myPrs[i] = aPresent;
+ aData.myPrs.at(i) = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::Vectors_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- aData.myPrs[i] = aPresent;
+ aData.myPrs.at(i) = aPresent;
}
break;
aFieldName.latin1(), aTimeStampId);
//VISU::StreamLines_var aTmp = aPresent->_this();
//aPresent->_remove_ref();
- aData.myPrs[i] = aPresent;
+ aData.myPrs.at(i) = aPresent;
}
break;
}
- if (aData.myPrs[i]->GetMin() < aMin) aMin = aData.myPrs[i]->GetMin();
- if (aData.myPrs[i]->GetMax() > aMax) aMax = aData.myPrs[i]->GetMax();
+ if (aData.myPrs.at(i)->GetMin() < aMin) aMin = aData.myPrs.at(i)->GetMin();
+ if (aData.myPrs.at(i)->GetMax() > aMax) aMax = aData.myPrs.at(i)->GetMax();
i++;
}
aData.myNbFrames = i;
QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
if (aFixRange.compare("true") != 0) {
for (i = 0; i < aData.myNbFrames; i++)
- aData.myPrs[i]->SetRange(aMin, aMax);
+ aData.myPrs.at(i)->SetRange(aMin, aMax);
if(aData.myPrsType == VISU::TISOSURFACE)
for (i = 0; i < aData.myNbFrames; i++)
- if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs[i]))
+ if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs.at(i)))
aPrs->SetSubRange(aMin, aMax);
}
}
MESSAGE("Viewer is nod defined for animation");
return false;
}
+
myLastError = QString("Frame(s) for ");
bool aNoError = true;
VISU::Mutex mt(myMutex,qApp,MYDELAY);
+
clearView();
vtkRenderer* aRen = myView->getRenderer();
+
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
- aData.myActors = (VISU_Actor**) malloc(aData.myNbFrames * sizeof(VISU_Actor*));
+ aData.myActors.resize(aData.myNbFrames,NULL);
for (long j = 0; j < aData.myNbFrames; j++) {
VISU_Actor* aActor = NULL;
try{
- aActor = aData.myPrs[j]->CreateActor();
+ aActor = aData.myPrs.at(j)->CreateActor();
myView->AddActor(aActor);
if(j == 0)
aActor->VisibilityOn();
else
aActor->VisibilityOff();
- }catch(std::runtime_error& exc){
+ }catch(...){ //catch(std::runtime_error& exc){
aNoError = false;
- myLastError += QString("%1 ").arg(aData.myTiming[j]);
+ myLastError += QString("%1 ").arg(aData.myTiming.at(j));
}
- aData.myActors[j] = aActor;
+ aData.myActors.at(j) = aActor;
}
}
myFrame = 0;
myLastError += QString(" timestamp(s) cannot be created.");
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
myView->Repaint();
return aNoError;
}
vtkRenderer* aRen = myView->getRenderer();
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
- if (aData.myActors) {
- for (int i = 0; i < aData.myNbFrames; i++) {
- if (aData.myActors[i] != 0) {
- aData.myActors[i]->RemoveFromRender(aRen);
- aData.myActors[i]->Delete();
+ if (!aData.myActors.empty()) {
+ for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) {
+ if (aData.myActors.at(i) != 0) {
+ aData.myActors.at(i)->RemoveFromRender(aRen);
+ aData.myActors.at(i)->Delete();
}
}
- free(aData.myActors);
- aData.myActors = 0;
+ aData.myActors.clear();
}
}
myView->update();
if (myFrame < (myFieldsLst[0].myNbFrames-1)) {
int i;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
myFrame++;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
myView->Repaint();
}
}
if (myFrame > 0) {
int i;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
myFrame--;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
myView->Repaint();
}
}
stopAnimation();
int i;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+ if(!myFieldsLst[i].myActors.empty())
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
myFrame = 0;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
-
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
- myView->Repaint();
+ if(!myFieldsLst[i].myActors.empty())
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
+ if(!myFieldsLst[0].myTiming.empty()){
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
+ myView->Repaint();
+ }
}
//************************************************************************
stopAnimation();
int i;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
myFrame = myFieldsLst[0].myNbFrames-1;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
myView->Repaint();
}
qApp->syncX();
int i;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
myFrame = theFrame;
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ if (myFieldsLst[i].myActors.at(myFrame) != 0)
+ myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
myView->Repaint();
qApp->flushX();
qApp->processEvents(3);
return VISU::ScalarMap::_nil();
if ((theFrame < 0) || (theFrame > (myFieldsLst[theField].myNbFrames - 1)))
return VISU::ScalarMap::_nil();
- return myFieldsLst[theField].myPrs[theFrame]->_this();
+ return myFieldsLst[theField].myPrs.at(theFrame)->_this();
}
MESSAGE("Viewer is nod defined for animation");
return;
}
-
double k=1;
double aOneVal;
bool isDumping = !myDumpPath.isEmpty();
aOneVal = (myFieldsLst[0].myNbFrames > 2) ?
- myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0] : 1;
-
+ myFieldsLst[0].myTiming.at(1) - myFieldsLst[0].myTiming.at(0) : 1;
qApp->lock();
while (myIsActive) {
- emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+ emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
if (myFrame > 0) {
- if (aData.myActors[myFrame-1] != 0)
- aData.myActors[myFrame-1]->VisibilityOff();
+ if (aData.myActors.at(myFrame-1) != 0)
+ aData.myActors.at(myFrame-1)->VisibilityOff();
} else {
- if (aData.myActors[aData.myNbFrames-1] != 0)
- aData.myActors[aData.myNbFrames-1]->VisibilityOff();
+ if (aData.myActors.at(aData.myNbFrames-1) != 0)
+ aData.myActors.at(aData.myNbFrames-1)->VisibilityOff();
}
- if (aData.myActors[myFrame] != 0) {
- aData.myActors[myFrame]->VisibilityOn();
+ if (aData.myActors.at(myFrame) != 0) {
+ aData.myActors.at(myFrame)->VisibilityOn();
}
}
myView->Repaint(false);
if (isDumping) {
QPixmap px = QPixmap::grabWindow(myView->getViewWidget()->winId());
QString aFile(myDumpPath);
- QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
+ QString aName = QString("%1").arg(myFieldsLst[0].myTiming.at(myFrame));
int aPos = -1;
while ((aPos = aName.find(".")) > -1 )
aName.replace(aPos, 1, "_");
break;
case 1:
if (myFieldsLst[0].myNbFrames > 2)
- k = (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal;
+ k = (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal;
else
k = 1;
break;
default:
k = (myFrame < (myFieldsLst[0].myNbFrames-1))?
- (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal : 1;
+ (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal : 1;
}
} else
k = 1;
-
qApp->unlock();
msleep((int)(1000.*k/mySpeed));
qApp->lock();
#include "VISUConfig.hh"
-class VTKViewer_ViewFrame;
-class VISU_Actor;
+#include <vector>
#include <qobject.h>
#include <qvaluelist.h>
#include <qthread.h>
+class VTKViewer_ViewFrame;
+class VISU_Actor;
+
namespace VISU{
class Result_i;
class ScalarMap_i;
SALOMEDS::SObject_var myField; // field label
long myNbTimes; // number of Timestamps
long myNbFrames; // number of created Frames
- VISU::ScalarMap_i** myPrs; // Presentations
- VISU_Actor** myActors; // Actors
- double* myTiming; // time values
+ std::vector<VISU::ScalarMap_i*> myPrs; // Presentations
+ std::vector<VISU_Actor*> myActors; // Actors
+ std::vector<double> myTiming; // time values
};
float aSize = INCMEMORY*
theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- INFOS("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
}catch(std::runtime_error& exc){
INFOS("Follow exception was accured :\n"<<exc.what());
VISU::Storable* VISU::Vectors_i::Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&)
{
DoHook();
SetGlyphType(VISU::Vectors::GlyphType(VISU::Storable::FindValue(theMap,"myTypeGlyph").toInt()));
VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
- throw (std::runtime_error&)
{
VISU_VectorsAct* anActor = VISU_VectorsAct::New();
try{
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
anActor->GetProperty()->SetLineWidth(GetLineWidth());
UpdateActor(anActor);
- }catch(std::runtime_error& exc){
+ }catch(...){
anActor->Delete();
- throw exc;
+ throw ;
}
return anActor;
}
-void VISU::Vectors_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::Vectors_i::UpdateActor(VISU_Actor* theActor) {
if(VISU_VectorsAct* anActor = dynamic_cast<VISU_VectorsAct*>(theActor)){
VISU::DeformedShape_i::UpdateActor(anActor);
anActor->GetProperty()->SetLineWidth(GetLineWidth());
virtual void ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap);
static const string myComment;
virtual const char* GetComment() const;
virtual QString GenerateName();
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
- throw (std::runtime_error&);
- virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+ virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual void UpdateActor(VISU_Actor* theActor) ;
};
}
#endif
return 0;
}
- Storable* View3D_i::Restore(const Storable::TRestoringMap& theMap) throw(std::logic_error&) {
+ Storable* View3D_i::Restore(const Storable::TRestoringMap& theMap) {
// if(MYDEBUG) MESSAGE("View3D_i::Restore");
//myName = VISU::Storable::FindValue(theMap,"myName").latin1();
public:
virtual Storable* Create(int theNew);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap) throw(std::logic_error&);
+ virtual Storable* Restore(const Storable::TRestoringMap& theMap) ;
virtual void ToStream(std::ostringstream& theStr);
virtual const char* GetComment() const;
static const string myComment;
import VISU
import math
+#--------------------------------------------------------------------------
+modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
+
# >>> Getting study builder ==================================================
myBuilder = myStudy.NewBuilder()
if not myComponent:
myComponent = myBuilder.NewComponent("VISU")
aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
- aName.SetValue("Visu")
+ #aName.SetValue("Visu")
+ Comp = modulecatalog.GetComponent( "VISU" )
+ aName.SetValue( Comp._get_componentusername() )
+
+ A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap");
+ aPixmap = A2._narrow(SALOMEDS.AttributePixMap);
+ aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" );
+
myBuilder.DefineComponentInstance(myComponent,myVisu)
# >>> Creating object with Table of real[ 200 * 20 ] ========================
#medFile = "brideResultats.dat"
#myFieldName = "VM_Elem.";
-medFile = os.getenv('SALOME_ROOT_DIR') + '/data/' + medFile
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
myResult = myVisu.ImportFile(medFile)
if not myComponent:
myComponent = myBuilder.NewComponent("VISU")
aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
- aName.SetValue("Visu")
+ #aName.SetValue("Visu")
+ aName.SetValue( salome.sg.getComponentUserName("VISU") )
+
+ A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap");
+ aPixmap = A2._narrow(SALOMEDS.AttributePixMap);
+ aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" );
+
myBuilder.DefineComponentInstance(myComponent,myVisu)
# >>> Creating object with Table of real[ 200 * 20 ] ========================
myVisu = visu_gui.myVisu
medFile = "pointe.med"
-medFile = os.getenv('SALOME_ROOT_DIR') + '/data/' + medFile
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
print medFile
studyCurrent = salome.myStudyName
from libVISU_Swig import *
-medFile = os.getenv('SALOME_ROOT_DIR') + '/data/fra.med'
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/fra.med'
myCon=Convertor(medFile)
myPrs=ScalarMap(myCon,"LE VOLUME",0,"VITESSE",1)
myView=View3D()
if not myComponent:
myComponent = myBuilder.NewComponent("VISU")
aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
- aName.SetValue("Visu")
+ #aName.SetValue("Visu")
+ aName.SetValue( salome.sg.getComponentUserName("VISU") )
+
+ A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap");
+ aPixmap = A2._narrow(SALOMEDS.AttributePixMap);
+ aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" );
+
myBuilder.DefineComponentInstance(myComponent,myVisu)
# >>> Creating object with Table of integer ==================================
medFile = "fra.med"
myFieldName = "VITESSE";
-medFile = os.getenv('SALOME_ROOT_DIR') + '/data/' + medFile
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
myResult = myVisu.ImportFile(medFile)
aMeshName ="LE VOLUME"