2 #include "HEXABLOCK.hxx"
6 #include "hexa_base.hxx"
8 #include "HexVertex_impl.hxx"
9 #include "HexEdge_impl.hxx"
10 #include "HexShape.hxx"
12 using namespace HEXABLOCK_ORB;
14 Edge_impl::Edge_impl( HEXA_NS::Edge *ptrCpp ):
19 HEXA_NS::Edge* Edge_impl::GetImpl()
20 throw (SALOME::SALOME_Exception)
26 ::CORBA::Boolean Edge_impl::getWay() throw (SALOME::SALOME_Exception)
28 // bool way = _edge_cpp->getWay();
29 // if ( way == true ) {
30 // return CORBA::TRUE;
32 // return CORBA::FALSE;
34 return _edge_cpp->getWay();
38 Vertex_ptr Edge_impl::getVertex(::CORBA::Long n)
39 throw (SALOME::SALOME_Exception)
41 Vertex_ptr result = Vertex::_nil();
43 HEXA_NS::Vertex* v = _edge_cpp->getVertex(n);
45 Vertex_impl* servantCorba = new Vertex_impl(v);
46 result = servantCorba->_this();
52 void Edge_impl::dump() throw (SALOME::SALOME_Exception)
58 void Edge_impl::printName()throw (SALOME::SALOME_Exception)
60 _edge_cpp->printName();
65 void Edge_impl::setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception)
67 _edge_cpp->setScalar(val);
71 ::CORBA::Long Edge_impl::addAssociation( GEOM::GEOM_Object_ptr geom_object_1D, double debut, double fin )
72 throw (SALOME::SALOME_Exception)
75 TopoDS_Shape aShape = HEXABLOCK::GetHEXABLOCKGen()->geomObjectToShape( geom_object_1D );
76 string strBrep = shape2string( aShape );
77 HEXA_NS::Shape* s = new HEXA_NS::Shape( strBrep );
80 ok = _edge_cpp->addAssociation( s );
83 Edge_impl::Assoc assoc;
84 assoc.geomObj = GEOM::GEOM_Object::_duplicate( geom_object_1D );
87 _associations.push_back(assoc);
94 // EdgeAssociations* Edge_impl::getAssociations() //CS_NOT_SPEC
95 // throw (SALOME::SALOME_Exception)
97 // HEXABLOCK_ORB::EdgeAssociations* result = new HEXABLOCK_ORB::EdgeAssociations;
98 // result->length( _associations.size() );
100 // HEXABLOCK_ORB::EdgeAssociation assoc;
101 // CORBA::ULong i = 0;
102 // for ( std::vector<Edge_impl::Assoc>::const_iterator iter = _associations.begin();
103 // iter != _associations.end();
105 // // assoc.geomObj = (*iter).geomObj;
106 // assoc.geomObj = GEOM::GEOM_Object::_duplicate( (*iter).geomObj );
107 // assoc.debut = (*iter).debut;
108 // assoc.fin = (*iter).fin;
109 // (*result)[i++] = assoc;
117 EdgeAssociations* Edge_impl::getAssociations ()
118 throw (SALOME::SALOME_Exception)
120 HEXABLOCK_ORB::EdgeAssociations* result = new HEXABLOCK_ORB::EdgeAssociations;
121 // HEXABLOCK_ORB::GEOM_Object_ptr ge;
122 // GEOM::GEOM_Object_ptr ge;
124 const std::vector<HEXA_NS::Shape*> shapes = _edge_cpp->getAssociations();
126 result->length( shapes.size() );
127 HEXABLOCK_ORB::EdgeAssociation assoc;
129 for ( std::vector<HEXA_NS::Shape*>::const_iterator iter = shapes.begin();
130 iter != shapes.end();
132 aShape = string2shape( (*iter)->getBrep());
133 // ge = GEOM::GEOM_Object::_duplicate(HEXABLOCK::GetHEXABLOCKGen()->shapeToGeomObject( aShape ));
134 // ge = HEXABLOCK_ORB::GEOM_Edge::_duplicate(HEXABLOCK::GetHEXABLOCKGen()->shapeToGeomObject( aShape ));
135 // ge = HEXABLOCK::GetHEXABLOCKGen()->shapeToGeomObject( aShape );
136 // ge->debut( (*iter)->debut );
137 // ge->fin( (*iter)->fin );
139 // assoc.geomObj = GEOM::GEOM_Object::_duplicate( (*iter).geomObj );
140 std::cout <<"AAAAAA"<<std::endl;
141 assoc.geomObj = HEXABLOCK::GetHEXABLOCKGen()->shapeToGeomObject( aShape );
142 assoc.debut = (*iter)->debut;
143 assoc.fin = (*iter)->fin;
144 (*result)[ i++ ] = assoc;