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"
26 #include "hexa_base.hxx"
27 #include "HexPropagation_impl.hxx"
28 #include "HexEdge_impl.hxx"
29 #include "HexLaw_impl.hxx"
31 Propagation_impl::Propagation_impl( HEXA_NS::Propagation *ptrCpp ):_propagation_cpp(ptrCpp)
37 HEXA_NS::Propagation* Propagation_impl::GetImpl() throw (SALOME::SALOME_Exception)
39 return _propagation_cpp;
43 HEXABLOCK_ORB::Edges* Propagation_impl::getEdges() throw (SALOME::SALOME_Exception)
45 HEXABLOCK_ORB::Edges* result = new HEXABLOCK_ORB::Edges;
47 const HEXA_NS::Edges& edges_cpp = _propagation_cpp->getEdges();
50 result->length( edges_cpp.size() );
51 for ( HEXA_NS::Edges::const_iterator iter = edges_cpp.begin();
52 iter != edges_cpp.end();
54 Edge_impl *servantEdge = new Edge_impl( *iter );
55 (*result)[ i++ ] = servantEdge->_this();
62 void Propagation_impl::setLaw(HEXABLOCK_ORB::Law_ptr lawIn) throw (SALOME::SALOME_Exception)
64 Law_impl* lawInServant = ::DownCast<Law_impl*>( lawIn );
65 ASSERT( lawInServant );
68 HEXA_NS::Law* law = lawInServant->GetImpl();
69 _propagation_cpp->setLaw(law);
73 HEXABLOCK_ORB::Law_ptr Propagation_impl::getLaw() throw (SALOME::SALOME_Exception)
75 Law_ptr result = Law::_nil();
76 HEXA_NS::Law* l = _propagation_cpp->getLaw();
79 Law_impl* servantCorba = new Law_impl(l);
80 result = servantCorba->_this();
87 void Propagation_impl::setWay(::CORBA::Boolean w) throw (SALOME::SALOME_Exception)
89 _propagation_cpp->setWay(w);
94 ::CORBA::Boolean Propagation_impl::getWay() throw (SALOME::SALOME_Exception)
96 // bool way = _propagation_cpp->getWay();
97 // if ( way == true ) {
98 // return CORBA::TRUE;
100 // return CORBA::FALSE;
102 return _propagation_cpp->getWay();