Salome HOME
The 2D hypothesis SMESH_LengthFromEdges was implemented in C++ but not
authornadir <nadir>
Mon, 8 Dec 2003 13:13:59 +0000 (13:13 +0000)
committernadir <nadir>
Mon, 8 Dec 2003 13:13:59 +0000 (13:13 +0000)
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
src/SMESH_I/Makefile.in
src/SMESH_I/SMESH_HypothesisFactory_i.cxx
src/SMESH_I/SMESH_LengthFromEdges_i.cxx [new file with mode: 0644]
src/SMESH_I/SMESH_LengthFromEdges_i.hxx [new file with mode: 0644]

index 5b8d964ba4b5decddbea316a6ad23b90b7ea8a23..c0251517f7fb654b15792ea1bf740e060da313d9 100644 (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) 
index 22bb4be7686025e1f26dccdea5b22c5fd5175d73..44991ebdeec9bb8973eff68463628376962e85ba 100644 (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 \
index f0a9ce5c961cb7484157aa369cb6aa5181d2ecbf..ad363f06f45fe108f6789d95519c955075e42bd3 100644 (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>;
diff --git a/src/SMESH_I/SMESH_LengthFromEdges_i.cxx b/src/SMESH_I/SMESH_LengthFromEdges_i.cxx
new file mode 100644 (file)
index 0000000..1ab700f
--- /dev/null
@@ -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 (file)
index 0000000..d773fa0
--- /dev/null
@@ -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
+