1 // Copyright (C) 2009-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "HEXABLOCK.hxx"
21 #include "utilities.h"
25 #include "hexa_base.hxx"
26 #include "HexLaw_impl.hxx"
28 Law_impl::Law_impl( HEXA_NS::Law *ptrCpp ):_law_cpp(ptrCpp)
32 HEXA_NS::Law* Law_impl::GetImpl()
33 throw (SALOME::SALOME_Exception)
38 // HEXA_NS::Vertex* v = _hexa_cpp->getVertex(n);
39 // Vertex_impl* servantCorba = new Vertex_impl(v);
40 // return servantCorba->_this();
43 void Law_impl::setName(const char* name)
44 throw (SALOME::SALOME_Exception)
46 _law_cpp->setName(name);
49 char* Law_impl::getName()
50 throw (SALOME::SALOME_Exception)
52 return CORBA::string_dup( _law_cpp->getName() );
55 void Law_impl::setNodes(::CORBA::Long n)
56 throw (SALOME::SALOME_Exception)
58 _law_cpp->setNodes(n);
61 ::CORBA::Long Law_impl::getNodes()
62 throw (SALOME::SALOME_Exception)
64 return _law_cpp->getNodes();
67 void Law_impl::setKind( HEXABLOCK_ORB::KindLaw kIn )
68 throw (SALOME::SALOME_Exception)
70 HEXA_NS::KindLaw k_impl;
72 case HEXABLOCK_ORB::UNIFORM : k_impl = HEXA_NS::Uniform; break;
73 case HEXABLOCK_ORB::ARITHMETIC : k_impl = HEXA_NS::Arithmetic; break;
74 case HEXABLOCK_ORB::GEOMETRIC : k_impl = HEXA_NS::Geometric; break;
76 _law_cpp->setKind(k_impl);
79 HEXABLOCK_ORB::KindLaw Law_impl::getKind()
80 throw (SALOME::SALOME_Exception)
82 HEXABLOCK_ORB::KindLaw k;
83 HEXA_NS::KindLaw k_cpp = _law_cpp->getKind();
85 case HEXA_NS::Uniform : k = HEXABLOCK_ORB::UNIFORM; break;
86 case HEXA_NS::Arithmetic : k = HEXABLOCK_ORB::ARITHMETIC; break;
87 case HEXA_NS::Geometric : k = HEXABLOCK_ORB::GEOMETRIC; break;
88 default : ASSERT( false ); break;
94 void Law_impl::setCoefficient(::CORBA::Double c)
95 throw (SALOME::SALOME_Exception)
97 _law_cpp->setCoefficient(c);
100 ::CORBA::Double Law_impl::getCoefficient()
101 throw (SALOME::SALOME_Exception)
103 return _law_cpp->getCoefficient();