X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMClient%2FGEOM_Client.cxx;h=3e8eb2058c0d164fe2b3d97b64240038852f1254;hb=04f3d723da1ae9133d108921c8f10338a9656d12;hp=35710a5062d1a402046a3c8c6af6b1f7d81212a6;hpb=ca429d817a18d6acc571443f6a596575dee03c2f;p=modules%2Fgeom.git diff --git a/src/GEOMClient/GEOM_Client.cxx b/src/GEOMClient/GEOM_Client.cxx index 35710a506..3e8eb2058 100644 --- a/src/GEOMClient/GEOM_Client.cxx +++ b/src/GEOMClient/GEOM_Client.cxx @@ -17,7 +17,7 @@ // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -26,18 +26,17 @@ // Module : GEOM // $Header$ -#include +#include + +#include -using namespace std; +#include #include "GEOM_Client.hxx" #include #include "OpUtil.hxx" #include "utilities.h" -#include CORBA_SERVER_HEADER(SALOMEDS) -#include CORBA_SERVER_HEADER(GEOM_Gen) - #include #include #include @@ -48,7 +47,14 @@ using namespace std; #include #include +#ifdef WNT +#include +#else #include +#endif + +#include CORBA_SERVER_HEADER(SALOMEDS) +#include CORBA_SERVER_HEADER(GEOM_Gen) #define HST_CLIENT_LEN 256 @@ -89,7 +95,12 @@ TopoDS_Shape GEOM_Client::Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr a //======================================================================= GEOM_Client::GEOM_Client() { - pid_client = (long)getpid(); + pid_client = +#ifdef WNT + (long)_getpid(); +#else + (long)getpid(); +#endif } //======================================================================= @@ -187,47 +198,46 @@ unsigned int GEOM_Client::BufferLength() // function : GetShape() // purpose : //======================================================================= +TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape ) +{ + TopoDS_Shape S; + TCollection_AsciiString IOR = geom->GetStringFromIOR(aShape); + Standard_Integer anIndex = Find(IOR, S); -TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape ) -{ - TopoDS_Shape S; - TCollection_AsciiString IOR = geom->GetStringFromIOR(aShape); - Standard_Integer anIndex = Find(IOR, S); - - if (anIndex !=0 ) return S ; + if (anIndex != 0) return S; - /******* in case of a MAIN GEOM::SHAPE ********/ - if (aShape->IsMainShape()) { - S = Load(geom, aShape); - Bind(IOR, S); - return S; - } + /******* in case of a MAIN GEOM::SHAPE ********/ + if (aShape->IsMainShape()) { + S = Load(geom, aShape); + Bind(IOR, S); + return S; + } - /******* in case of SUB GEOM::SHAPE ***********/ - // Load and Explore the Main Shape - TopoDS_Shape aMainShape = GetShape (geom, aShape->GetMainShape()); - GEOM::ListOfLong_var list = aShape->GetSubShapeIndices(); + /******* in case of SUB GEOM::SHAPE ***********/ + // Load and Explore the Main Shape + TopoDS_Shape aMainShape = GetShape (geom, aShape->GetMainShape()); + GEOM::ListOfLong_var list = aShape->GetSubShapeIndices(); TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(aMainShape, anIndices); - /* Case of only one subshape */ - if (list->length() == 1) - { - S = anIndices.FindKey(list[0]); - } + /* Case of only one subshape */ + if (list->length() == 1 && list[0] > 0) { + S = anIndices.FindKey(list[0]); + } else { BRep_Builder B; TopoDS_Compound aCompound; B.MakeCompound(aCompound); - for(int i=0; ilength(); i++) { - TopoDS_Shape aSubShape = anIndices.FindKey(list[i]); - B.Add(aCompound, aSubShape); + for (int i = 0; i < list->length(); i++) { + if (0 < list[i] && list[i] <= anIndices.Extent()) { + TopoDS_Shape aSubShape = anIndices.FindKey(list[i]); + B.Add(aCompound, aSubShape); + } } S = aCompound; } - Bind(IOR, S); - return S; -} - + Bind(IOR, S); + return S; +}