From: apo Date: Thu, 25 Aug 2005 12:55:37 +0000 (+0000) Subject: To introduce Gauss Points IDL interface X-Git-Tag: BR-D5-38-2003_D2005-12-09~104 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2b07019488e84f49b01bbf66be5db2d128bf0622;p=modules%2Fvisu.git To introduce Gauss Points IDL interface --- diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index a4b58de1..46b78203 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -59,6 +59,7 @@ module VISU { TSCALARMAP, /*!< Scalarmap 3D presentation object */ TISOSURFACE, /*!< Iso surface 3D presentation object */ TDEFORMEDSHAPE, /*!< Deformed shape 3D presentation object */ + TGAUSSPOINTS, /*!< Gauss Points 3D presentation object */ TPLOT3D, /*!< Plot3D 3D presentation object */ TCUTPLANES, /*!< Cut planes 3D presentation object */ TCUTLINES, /*!< Cut lines 3D presentation object */ @@ -506,6 +507,14 @@ module VISU { }; //------------------------------------------------------- + /*! \brief Gauss Points presentation interface + * + * Presentation parameters of the Gauss Points presentation. + */ + //------------------------------------------------------- + interface GaussPoints : ScalarMap { + }; + /*! \brief Deformed shape presentation interface * * Presentation parameters of the deformed shape presentation. @@ -1330,6 +1339,18 @@ module VISU { in Entity theEntity, in string theFieldName, in double theIteration); + /*! + * Creates a Gauss Points 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 + */ + GaussPoints GaussPointsOnField(in Result theResult, in string theMeshName, + 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) diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 63ccfd1f..77413b19 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -212,6 +212,16 @@ namespace VISU{ } + GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return myVisuGen->GaussPointsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); + } + + DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index 841c0198..fbcc3b48 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -69,6 +69,8 @@ namespace VISU{ virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); + virtual GaussPoints_ptr GaussPointsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, diff --git a/src/VISU_I/Makefile.in b/src/VISU_I/Makefile.in index bb527ff9..d8631a47 100644 --- a/src/VISU_I/Makefile.in +++ b/src/VISU_I/Makefile.in @@ -23,7 +23,7 @@ LIB_SRC = VISUConfig.cc VISU_Gen_i.cc \ VISU_Prs3d_i.cc VISU_Mesh_i.cc VISU_ScalarMap_i.cc \ VISU_IsoSurfaces_i.cc VISU_DeformedShape_i.cc \ VISU_Plot3D_i.cc VISU_CutPlanes_i.cc VISU_CutLines_i.cc \ - VISU_Vectors_i.cc VISU_StreamLines_i.cc \ + VISU_Vectors_i.cc VISU_StreamLines_i.cc VISU_GaussPoints_i.cc \ VISU_ViewManager_i.cc VISU_View_i.cc \ VISU_TimeAnimation.cxx VISU_CorbaMedConvertor.cxx \ VISU_DumpPython.cc @@ -47,7 +47,7 @@ EXPORT_HEADERS = VISUConfig.hh VISU_Gen_i.hh \ VISU_Prs3d_i.hh VISU_Mesh_i.hh VISU_ScalarMap_i.hh \ VISU_IsoSurfaces_i.hh VISU_DeformedShape_i.hh \ VISU_Plot3D_i.hh VISU_CutPlanes_i.hh VISU_CutLines_i.hh \ - VISU_Vectors_i.hh VISU_StreamLines_i.hh \ + VISU_Vectors_i.hh VISU_StreamLines_i.hh VISU_GaussPoints_i.hh \ VISU_ViewManager_i.hh VISU_View_i.hh \ VISU_TimeAnimation.h diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc new file mode 100644 index 00000000..4f04ec45 --- /dev/null +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -0,0 +1,146 @@ +// 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 : + +#include "VISU_GaussPoints_i.hh" +#include "VISU_Result_i.hh" + +using namespace VISU; +using namespace std; + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +int +VISU::GaussPoints_i +::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, int theIteration, int isMemoryCheck) +{ + try{ + return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<GetStudyDocument()), + Prs3d_i(theResult,theAddToStudy), + ScalarMap_i(theResult,theAddToStudy), + myGaussPointsPL(NULL) +{ + if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i"); +} + + +VISU::GaussPoints_i:: +GaussPoints_i(Result_i* theResult, + SALOMEDS::SObject_ptr theSObject) : + PrsObject_i(theResult->GetStudyDocument()), + Prs3d_i(theResult,theSObject), + ScalarMap_i(theResult,theSObject), + myGaussPointsPL(NULL) +{ + if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i"); +} + + +VISU::Storable* +VISU::GaussPoints_i +::Create(const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, int theIteration) +{ + return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration); +} + + +VISU::Storable* +VISU::GaussPoints_i +::Restore(const Storable::TRestoringMap& theMap) +{ + DoHook(); + return ScalarMap_i::Restore(theMap); +} + + +void +VISU::GaussPoints_i +::ToStream(std::ostringstream& theStr) +{ + ScalarMap_i::ToStream(theStr); +} + + +VISU::GaussPoints_i +::~GaussPoints_i() +{ + if(MYDEBUG) MESSAGE("GaussPoints_i::~GaussPoints_i()"); +} + + +void +VISU::GaussPoints_i +::DoHook() +{ + ScalarMap_i::DoHook(); +} + +VISU_Actor* +VISU::GaussPoints_i +::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) +{ + VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO); + return anActor; +} + + +void +VISU::GaussPoints_i +::UpdateActor(VISU_Actor* theActor) +{ + VISU::ScalarMap_i::UpdateActor(theActor); +} diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh new file mode 100644 index 00000000..44a45e6e --- /dev/null +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -0,0 +1,81 @@ +// 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 : VISU_PrsObject_i.hxx +// Author : Alexey PETROV +// Module : VISU + +#ifndef VISU_GaussPoints_i_HeaderFile +#define VISU_GaussPoints_i_HeaderFile + +#include "VISU_ScalarMap_i.hh" + +class VISU_GaussPointsPL; + +namespace VISU +{ + class GaussPoints_i : public virtual POA_VISU::GaussPoints, + public virtual ScalarMap_i + { + static int myNbPresent; + GaussPoints_i(); + GaussPoints_i(const GaussPoints_i&); + + public: + explicit + GaussPoints_i(Result_i* theResult, + bool theAddToStudy); + explicit + GaussPoints_i(Result_i* theResult, + SALOMEDS::SObject_ptr theSObject); + virtual ~GaussPoints_i(); + + virtual VISU::VISUType GetType() { return VISU::TGAUSSPOINTS;}; + + typedef VISU::GaussPoints TInterface; + + protected: + virtual void DoHook(); + + VISU_GaussPointsPL *myGaussPointsPL; + + public: + static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, int theIteration, int isMemoryCheck = true); + virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, int theIteration); + + static const std::string myComment; + virtual const char* GetComment() const; + virtual QString GenerateName(); + + virtual void ToStream(std::ostringstream& theStr); + + virtual Storable* Restore(const Storable::TRestoringMap& theMap); + + virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL); + + virtual void UpdateActor(VISU_Actor* theActor) ; + }; +} + +#endif diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index d1b47cf3..1c005cad 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -38,6 +38,7 @@ #include "VISU_CutLines_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_StreamLines_i.hh" +#include "VISU_GaussPoints_i.hh" #include "VISU_Plot3D_i.hh" #include "VISU_Table_i.hh" #include "VISU_TimeAnimation.h" @@ -607,6 +608,15 @@ namespace VISU{ return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn(); } + GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn(); + } + DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index abaac0a6..f8157bfd 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -90,6 +90,9 @@ namespace VISU{ virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); + virtual GaussPoints_ptr GaussPointsOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration);