2 #include "HEXABLOCK.hxx"
8 #include "hexa_base.hxx"
9 #include "HexPropagation_impl.hxx"
10 #include "HexEdge_impl.hxx"
11 #include "HexLaw_impl.hxx"
13 Propagation_impl::Propagation_impl( HEXA_NS::Propagation *ptrCpp ):_propagation_cpp(ptrCpp)
19 HEXA_NS::Propagation* Propagation_impl::GetImpl() throw (SALOME::SALOME_Exception)
21 return _propagation_cpp;
25 HEXABLOCK_ORB::Edges* Propagation_impl::getEdges() throw (SALOME::SALOME_Exception)
27 HEXABLOCK_ORB::Edges* result = new HEXABLOCK_ORB::Edges;
29 const HEXA_NS::Edges& edges_cpp = _propagation_cpp->getEdges();
30 // HEXA_NS::Edges edges_cpp = _propagation_cpp->getEdges();
31 std::cout<<"XX edges_cpp.size() ->"<<edges_cpp.size()<<std::endl;
34 result->length( edges_cpp.size() );
35 // HEXA_NS::Edges::const_iterator itertest = edges_cpp.begin();
36 // itertest != edges_cpp.end();
37 for ( HEXA_NS::Edges::const_iterator iter = edges_cpp.begin();
38 iter != edges_cpp.end();
41 // (*iter)->getVertex (0)->printName (", ");
42 // (*iter)->getVertex (1)->printName (")\n");
43 Edge_impl *servantEdge = new Edge_impl( *iter );
44 (*result)[ i++ ] = servantEdge->_this();
51 // HEXABLOCK_ORB::Ways* Propagation_impl::getWays() throw (SALOME::SALOME_Exception)
53 // HEXABLOCK_ORB::Ways* result = new HEXABLOCK_ORB::Ways;
54 // const vector<bool>& ways_cpp = _propagation_cpp->getWays();
56 // CORBA::ULong i = 0;
57 // result->length( ways_cpp.size() );
58 // for ( vector<bool>::const_iterator iter = ways_cpp.begin();
59 // iter != ways_cpp.end(); ++iter ){
60 // (*result)[ i++ ] = *iter;
61 // // if (*iter == true ) {
62 // // (*result)[ i++ ] = ::CORBA::TRUE;
64 // // (*result)[ i++ ] = ::CORBA::FALSE;
71 void Propagation_impl::setLaw(HEXABLOCK_ORB::Law_ptr lawIn) throw (SALOME::SALOME_Exception)
73 Law_impl* lawInServant = ::DownCast<Law_impl*>( lawIn );
74 ASSERT( lawInServant );
77 HEXA_NS::Law* law = lawInServant->GetImpl();
78 _propagation_cpp->setLaw(law);
82 HEXABLOCK_ORB::Law_ptr Propagation_impl::getLaw() throw (SALOME::SALOME_Exception)
84 Law_ptr result = Law::_nil();
85 HEXA_NS::Law* l = _propagation_cpp->getLaw();
88 Law_impl* servantCorba = new Law_impl(l);
89 result = servantCorba->_this();
96 void Propagation_impl::setWay(::CORBA::Boolean w) throw (SALOME::SALOME_Exception)
98 _propagation_cpp->setWay(w);
103 ::CORBA::Boolean Propagation_impl::getWay() throw (SALOME::SALOME_Exception)
105 // bool way = _propagation_cpp->getWay();
106 // if ( way == true ) {
107 // return CORBA::TRUE;
109 // return CORBA::FALSE;
111 return _propagation_cpp->getWay();