From 86ae4ed4f2e1cbe8d1dac229674b2f008290fbd6 Mon Sep 17 00:00:00 2001 From: nadir Date: Mon, 8 Dec 2003 13:13:59 +0000 Subject: [PATCH] The 2D hypothesis SMESH_LengthFromEdges was implemented in C++ but not mounted in the CORBA API and it was never used. Now it is visible through CORBA and used in the python script SMESH_flight_skin.py. --- idl/SMESH_BasicHypothesis.idl | 7 ++ src/SMESH_I/Makefile.in | 1 + src/SMESH_I/SMESH_HypothesisFactory_i.cxx | 2 + src/SMESH_I/SMESH_LengthFromEdges_i.cxx | 98 +++++++++++++++++++++++ src/SMESH_I/SMESH_LengthFromEdges_i.hxx | 59 ++++++++++++++ 5 files changed, 167 insertions(+) create mode 100644 src/SMESH_I/SMESH_LengthFromEdges_i.cxx create mode 100644 src/SMESH_I/SMESH_LengthFromEdges_i.hxx diff --git a/idl/SMESH_BasicHypothesis.idl b/idl/SMESH_BasicHypothesis.idl index 5b8d964ba..c0251517f 100644 --- a/idl/SMESH_BasicHypothesis.idl +++ b/idl/SMESH_BasicHypothesis.idl @@ -56,6 +56,13 @@ module SMESH double GetMaxElementArea(); }; + interface SMESH_LengthFromEdges : SMESH_Hypothesis + { + void SetMode(in long mode) + raises (SALOME::SALOME_Exception); + long GetMode(); + }; + interface SMESH_MaxElementVolume : SMESH_Hypothesis { void SetMaxElementVolume(in double volume) diff --git a/src/SMESH_I/Makefile.in b/src/SMESH_I/Makefile.in index 22bb4be76..44991ebde 100644 --- a/src/SMESH_I/Makefile.in +++ b/src/SMESH_I/Makefile.in @@ -54,6 +54,7 @@ LIB_SRC = SMESH_Gen_i.cxx SMESH_Mesh_i.cxx SMESH_MEDMesh_i.cxx \ SMESH_NumberOfSegments_i.cxx \ SMESH_LocalLength_i.cxx \ SMESH_MaxElementArea_i.cxx \ + SMESH_LengthFromEdges_i.cxx \ SMESH_MaxElementVolume_i.cxx \ SMESH_Regular_1D_i.cxx \ SMESH_Quadrangle_2D_i.cxx \ diff --git a/src/SMESH_I/SMESH_HypothesisFactory_i.cxx b/src/SMESH_I/SMESH_HypothesisFactory_i.cxx index f0a9ce5c9..ad363f06f 100644 --- a/src/SMESH_I/SMESH_HypothesisFactory_i.cxx +++ b/src/SMESH_I/SMESH_HypothesisFactory_i.cxx @@ -38,6 +38,7 @@ using namespace std; //--------------------------------------- #include "SMESH_LocalLength_i.hxx" #include "SMESH_NumberOfSegments_i.hxx" +#include "SMESH_LengthFromEdges_i.hxx" #include "SMESH_MaxElementArea_i.hxx" #include "SMESH_MaxElementVolume_i.hxx" #include "SMESH_Regular_1D_i.hxx" @@ -84,6 +85,7 @@ SMESH_HypothesisFactory_i::SMESH_HypothesisFactory_i() //--------------------------------------- _creatorMap["LocalLength"] = new HypothesisCreator_i; _creatorMap["NumberOfSegments"] = new HypothesisCreator_i; +_creatorMap["LengthFromEdges"] = new HypothesisCreator_i; _creatorMap["MaxElementArea"] = new HypothesisCreator_i; _creatorMap["MaxElementVolume"] = new HypothesisCreator_i; _creatorMap["Regular_1D"] = new HypothesisCreator_i; diff --git a/src/SMESH_I/SMESH_LengthFromEdges_i.cxx b/src/SMESH_I/SMESH_LengthFromEdges_i.cxx new file mode 100644 index 000000000..1ab700fd2 --- /dev/null +++ b/src/SMESH_I/SMESH_LengthFromEdges_i.cxx @@ -0,0 +1,98 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// 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 : SMESH_LengthFromEdges_i.cxx +// Author : Nadir BOUHAMOU CEA/DEN, Paul RASCLE, EDF +// Module : SMESH +// $Header$ + +using namespace std; +using namespace std; +#include "SMESH_LengthFromEdges_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_HypothesisFactory.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * Constructor: + * _name is related to the class name: prefix = SMESH_ ; suffix = _i . + */ +//============================================================================= + +SMESH_LengthFromEdges_i::SMESH_LengthFromEdges_i(const char* anHyp, + int studyId, + ::SMESH_Gen* genImpl) +{ + MESSAGE("SMESH_LengthFromEdges_i::SMESH_LengthFromEdges_i"); + _impl = new ::SMESH_LengthFromEdges(genImpl->_hypothesisFactory.GetANewId(), + studyId, + genImpl); + _baseImpl = _impl; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +SMESH_LengthFromEdges_i::~SMESH_LengthFromEdges_i() +{ +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +void SMESH_LengthFromEdges_i::SetMode(CORBA::Long mode) + throw (SALOME::SALOME_Exception) +{ + ASSERT(_impl); + try + { + _impl->SetMode(mode); + } + catch (SALOME_Exception& S_ex) + { + THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \ + SALOME::BAD_PARAM); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +CORBA::Long SMESH_LengthFromEdges_i::GetMode() +{ + ASSERT(_impl); + return _impl->GetMode(); +} + diff --git a/src/SMESH_I/SMESH_LengthFromEdges_i.hxx b/src/SMESH_I/SMESH_LengthFromEdges_i.hxx new file mode 100644 index 000000000..d773fa0a5 --- /dev/null +++ b/src/SMESH_I/SMESH_LengthFromEdges_i.hxx @@ -0,0 +1,59 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// 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 : SMESH_LengthFromEdges_i.hxx +// Author : Nadir BOUHAMOU CEA/DEN, Paul RASCLE, EDF +// Module : SMESH +// $Header$ + +#ifndef _SMESH_LENGTHFROMEDGES_I_HXX_ +#define _SMESH_LENGTHFROMEDGES_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) + +#include "SMESH_Hypothesis_i.hxx" + +#include "SMESH_LengthFromEdges.hxx" + +class SMESH_LengthFromEdges_i: + public POA_SMESH::SMESH_LengthFromEdges, + public SMESH_Hypothesis_i +{ +public: + SMESH_LengthFromEdges_i(const char* anHyp, + int studyId, + ::SMESH_Gen* genImpl); + virtual ~SMESH_LengthFromEdges_i(); + + void SetMode(CORBA::Long mode) + throw (SALOME::SALOME_Exception); + + CORBA::Long GetMode(); + +protected: + ::SMESH_LengthFromEdges* _impl; +}; + +#endif + -- 2.30.2