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.
This commit is contained in:
nadir 2003-12-08 13:13:59 +00:00
parent a2dd7522d6
commit 86ae4ed4f2
5 changed files with 167 additions and 0 deletions

View File

@ -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)

View File

@ -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 \

View File

@ -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<SMESH_LocalLength_i>;
_creatorMap["NumberOfSegments"] = new HypothesisCreator_i<SMESH_NumberOfSegments_i>;
_creatorMap["LengthFromEdges"] = new HypothesisCreator_i<SMESH_LengthFromEdges_i>;
_creatorMap["MaxElementArea"] = new HypothesisCreator_i<SMESH_MaxElementArea_i>;
_creatorMap["MaxElementVolume"] = new HypothesisCreator_i<SMESH_MaxElementVolume_i>;
_creatorMap["Regular_1D"] = new HypothesisCreator_i<SMESH_Regular_1D_i>;

View File

@ -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();
}

View File

@ -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 <SALOMEconfig.h>
#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