*/
double GetScale();
+ /*!
+ * Sets the scalar field
+ * \param theMeshName - mesh name
+ * \param theFieldName - the name of scalar field
+ * \param theIteration - the iteration number for scalar field
+ * \param theEntity - entity of scalar field
+ */
+ void SetScalarField(in string theMeshName,in string theFieldName,
+ in long theIteration,in Entity theEntity);
+
};
//-------------------------------------------------------
/*!
in Entity theEntity, in string theFieldName,
in double theIteration);
+ /*!
+ * Creates a deformed shape presentation.
+ * \param theResult Data generated in other sources. (MED object or file)
+ * \param theMeshName One of the meshes presented in MED file
+ * \param theEntity Type of entity where the field is defined
+ * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
+ * \param theIteration Number of iteration on the field
+ */
+ ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
+ in Entity theEntity, in string theFieldName,
+ in double theIteration);
+
/*!
* Creates a vector presentation.
* \param theResult Data generated in other sources. (MED object or file)
$(BOOST_CPPFLAGS)
LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) \
- $(BOOST_LIBS) -lboost_thread${BOOST_LIBTHREAD} \
+ $(BOOST_LIBS) -lboost_thread${BOOST_LIBSUFFIX} \
-L${MED_ROOT_DIR}/lib/salome -lMEDWrapper \
-L${GUI_ROOT_DIR}/lib/salome -lVTKViewer
VISU_Convertor*
CreateConvertor(const string& theFileName)
{
- if(MED::PWrapper aMed = MED::CrWrapper(theFileName))
+ if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
return new VISU_MedConvertor(theFileName);
return NULL;
}
"; aNbGauss = "<<aNbGauss<<
"; aNbCells = "<<aNbCells<<
endl);
- }
+ }else
+ EXCEPTION(runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
}
aGaussMesh->myIsDone = true;
return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
+ ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Double theIteration)
+ {
+ return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+ }
Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult,
const char* theMeshName,
const char* theFieldName, CORBA::Double theIteration);
virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
+ virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, CORBA::Double theIteration);
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
@COMMENCE@
EXPORT_HEADERS = \
+ VISU_BoostSignals.h \
VISU_ActorFactory.h \
VISU_GaussPtsSettings.h \
VISU_GaussPtsActorFactory.h \
-L${KERNEL_ROOT_DIR}/lib/salome
LIBS+= \
- -lboost_signals${BOOST_LIBTHREAD} \
+ -lboost_signals${BOOST_LIBSUFFIX} \
-lSalomeObject \
-lVisuPipeLine \
-lSVTK
#include "SALOME_Actor.h"
#include "VISU_ActorFactory.h"
+#include "VISU_BoostSignals.h"
#include <string>
#include <vtkSmartPointer.h>
-#include <boost/signals/signal1.hpp>
-#include <boost/signals/trackable.hpp>
class vtkProp;
class vtkProperty;
//----------------------------------------------------------------------------
class VTKOCC_EXPORT VISU_Actor :
public SALOME_Actor,
- public boost::BOOST_SIGNALS_NAMESPACE::trackable
+ public boost::signalslib::trackable
{
public:
vtkTypeMacro(VISU_Actor,SALOME_Actor);
#ifndef VISU_ACTOR_FACTORY_H
#define VISU_ACTOR_FACTORY_H
-#include <boost/signals/trackable.hpp>
+#include "VISU_BoostSignals.h"
class VISU_Actor;
This interface inherits from boost::bsignals::trackable in order to provide automatic
diconnection from defined signals if the object is destroyed.
*/
- struct TActorFactory: public virtual boost::BOOST_SIGNALS_NAMESPACE::trackable
+ struct TActorFactory: public virtual boost::signalslib::trackable
{
//! Just to make this class virtual
virtual
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File :
+// Author :
+// Module : VISU
+// $Header$
+
+#ifndef VISU_BOOST_SIGNALS_H
+#define VISU_BOOST_SIGNALS_H
+
+#ifdef signals
+# ifndef QOBJECTDEFS_H
+# error "Cannot recover the siganlas macro definition"
+# else
+# define EXTERNAL_SIGNALS_DEFINITION
+# undef signals
+# endif
+#endif
+
+#include <boost/signals.hpp>
+
+namespace boost {
+ namespace signalslib = BOOST_SIGNALS_NAMESPACE;
+}
+
+#ifdef EXTERNAL_SIGNALS_DEFINITION
+# undef EXTERNAL_SIGNALS_DEFINITION
+# ifdef QT_MOC_CPP
+# define signals signals
+# else
+# define signals protected
+# endif
+#endif
+
+#endif //VISU_BOOST_SIGNALS_H
-L${GUI_ROOT_DIR}/lib/salome \
-L${MED_ROOT_DIR}/lib/salome
-LIBS+= -lboost_signals${BOOST_LIBTHREAD} \
+LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \
-lSalomeHDFPersist \
-lSalomeGenericObj \
-lSalomeContainer \
-lSalomeNotification \
-lSALOMELocalTrace \
-lSalomeResourcesManager \
- -lSalomeDS \
- -lSalomeDSImpl \
+ -lSalomeDSClient \
-lSalomeObject \
-lqtx \
-lsuit \
myField = anOrigin->GetField();
myMeshName = myField->myMeshName;
- myEntity = myField->myEntity;
+ myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity;
myIteration = anOrigin->GetIteration();
myFieldName = anOrigin->GetFieldName();
void
SameAsParams(const ColoredPrs3d_i* theOrigin);
- const VISU::PField&
+ virtual const VISU::PField&
GetField() const;
const std::string&
VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
- //Output the script that sets up the visul parameters.
- if(theIsPublished) {
- char* script = aStudy->GetDefaultScript("Post-Pro", aPrefix.c_str());
- if(script && strlen(script) > 0) {
- aStr << script;
- CORBA::string_free(script);
- }
- }
-
aStr<<aPrefix<<"pass"<<endl;
#ifndef COUT
#include "SALOME_GenericObj_i.hh"
#include "SALOME_InteractiveObject.hxx"
-#include <boost/signals/signal0.hpp>
#include <vtkSmartPointer.h>
class VISU_PipeLine;
mySourceId(theSourceId),
myIsBuildImmediately(theIsBuildImmediately),
myIsBuildFields(theIsBuildFields),
- myIsBuildGroups(theIsBuildMinMax),
- myIsBuildMinMax(theIsBuildGroups),
+ myIsBuildMinMax(theIsBuildMinMax),
+ myIsBuildGroups(theIsBuildGroups),
myIsEntitiesDone(false),
myIsFieldsDone(false),
myIsGroupsDone(false),
#define __VISU_RESULT_I_H__
#include "VISUConfig.hh"
+#include "VISU_BoostSignals.h"
#include "SALOME_GenericObj_i.hh"
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/signal0.hpp>
-
#include <gp_Dir.hxx>
#include <vector>
namespace VISU
{
//----------------------------------------------------------------------------
- class MinMaxCunsomer: public virtual boost::BOOST_SIGNALS_NAMESPACE::trackable
+ class MinMaxCunsomer: public virtual boost::signalslib::trackable
{
protected:
bool myMinMaxIsInitilized;
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, int theIteration)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
myIsColored = true;
myColor.R = myColor.G = myColor.B = 0.5;
VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
TSuperClass::Restore(theMap);
SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
VISU::ScalarMapOnDeformedShape_i
::SameAs(const Prs3d_i* theOrigin)
{
- int theScalarIter = GetScalarIteration();
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
+ int theScalarIter = this->GetScalarIteration();
+ string theScalarMeshName = this->GetScalarMeshName();
+ string theScalarFieldName = this->GetScalarFieldName();
+ if(MYDEBUG) cout << "SameAs:"<<endl
+ << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
TSuperClass::SameAs(theOrigin);
if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
- // increment the scalar iteration for using in VISU_TimeAnimation class implementation.
- int anOriginScalarIter = anOrigin->GetScalarIteration();
this->SetScalarField(anOrigin->GetScalarMeshName().c_str(),
anOrigin->GetScalarFieldName().c_str(),
theScalarIter,
void VISU::ScalarMapOnDeformedShape_i::DoHook()
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
if(!myPipeLine)
myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
anActor->SetRepresentation(2);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<<endl;
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
anActor->SetBarVisibility(true);
const int theIteration,
const VISU::TEntity theEntity)
{
+ if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
+ if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
+ if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
+ myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+ TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)->GetVTKOutput();
if (myScalarMapOnDeformedShapePL){
- myField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
- TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theIteration)->GetVTKOutput();
myScalarMapOnDeformedShapePL->SetScalars(aOut);
}
this->SetScalarMeshName(theMeshName);
this->SetScalarEntity(theEntity);
}
+void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ const long theIteration,
+ const VISU::Entity theEntity)
+{
+ this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
+}
void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
myScalarMeshName = theName;
void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
myScalarIteration = theValue;
}
+
+
int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
return myScalarIteration;
}
void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
myScalarEntity = theValue;
}
+
VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
return myScalarEntity;
}
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+ myScalarEntity = VISU::TEntity(theValue);
+}
+
+VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+ return VISU::Entity(myScalarEntity);
+}
+
+const VISU::PField&
+VISU::ScalarMapOnDeformedShape_i
+::GetField() const
+{
+ return myScalarField;
+}
void
SameAs(const Prs3d_i* theOrigin);
+ virtual const VISU::PField&
+ GetField() const;
+
VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
protected:
std::string myScalarFieldName;
VISU::TEntity myScalarEntity;
int myScalarIteration;
+ PField myScalarField;
public:
static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName,
const int theIteration,
const VISU::TEntity theEntity);
+
+ virtual void SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ const long theIteration,
+ const VISU::Entity theEntity);
virtual void SetScalarFieldName(const char* theName);
virtual std::string GetScalarFieldName();
virtual std::string GetScalarMeshName();
virtual void SetScalarEntity(const VISU::TEntity theValue);
virtual VISU::TEntity GetScalarEntity();
+ virtual void SetScalarEEntity(const VISU::Entity theValue);
+ virtual VISU::Entity GetScalarEEntity();
};
}
#endif
cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
myView.DisplayOnly(cutplanes)
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+if scalarmapondefshape is None : print "Error"
+else : print "OK"
+scalarmapondefshape.SetScalarField(myMeshName,'pression',2,myCellEntity);
+myView.DisplayOnly(scalarmapondefshape)
+
#%====================Stage4: Opening a new study and Med file import====================%
# Opening a new study tempoparily commented due to a problem
cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
myView1.DisplayOnly(cutplanes1)
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+if scalarmapondefshape1 is None : print "Error"
+else : print "OK"
+myView1.DisplayOnly(scalarmapondefshape1)
#%====================Stage6: Object browser popup====================%
print "**** Stage6: Object browser popup"
aPrsObj.RemoveFromStudy()
else :
aVISUObjList.append(aPrsObj)
+
+ if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
+ print " Creating ScalarMapOnDeformedShapeOnField",
+ aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+ if aPrsObj is None : print "Error"
+ else :
+ print ",OK"
+ theView.DisplayOnly(aPrsObj)
+ theView.FitAll()
+ aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+ aPictureName = re.sub("\s+","_", aPictureName)
+ theView.SavePicture(aPictureName)
+ if theIsAutoDelete :
+ aPrsObj.RemoveFromStudy()
+ else :
+ aVISUObjList.append(aPrsObj)
+
return aVISUObjList