Salome HOME
Windows porting
[modules/geom.git] / src / GEOMClient / GEOM_Client.hxx
1 //  GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GEOM_Client.hxx
25 //  Author : Yves FRICAUD
26 //  Module : GEOM
27 //  $Header$
28
29 #ifndef _GEOM_Client_HeaderFile
30 #define _GEOM_Client_HeaderFile
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(GEOM_Gen)
34 #
35 #ifndef _TColStd_SequenceOfAsciiString_HeaderFile
36 #include <TColStd_SequenceOfAsciiString.hxx>
37 #endif
38 #ifndef _TopTools_SequenceOfShape_HeaderFile
39 #include <TopTools_SequenceOfShape.hxx>
40 #endif
41 #ifndef _Standard_Integer_HeaderFile
42 #include <Standard_Integer.hxx>
43 #endif
44 class TCollection_AsciiString;
45 class TopoDS_Shape;
46
47
48 #ifndef _Standard_HeaderFile
49 #include <Standard.hxx>
50 #endif
51 #ifndef _Standard_Macro_HeaderFile
52 #include <Standard_Macro.hxx>
53 #endif
54 #if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS
55 #define GEOMCLIENT_WNT_EXPORT __declspec( dllexport )
56 #else
57 #define GEOMCLIENT_WNT_EXPORT
58 #endif
59
60 //=====================================================================
61 // GEOM_Client : class definition
62 //=====================================================================
63 class GEOMCLIENT_WNT_EXPORT GEOM_Client  {
64
65 public:
66   
67   inline void* operator new(size_t,void* anAddress) 
68   {
69     return anAddress;
70   }
71   inline void* operator new(size_t size) 
72   { 
73     return Standard::Allocate(size); 
74   }
75   inline void  operator delete(void *anAddress) 
76   { 
77     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
78   }
79   // Methods PUBLIC
80   // 
81    //Standard_EXPORT   
82   GEOM_Client();
83   //Standard_EXPORT   
84   GEOM_Client(Engines::Container_ptr client);
85   //Standard_EXPORT   
86   Standard_Integer Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
87   //Standard_EXPORT   
88   Standard_Integer Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
89   //Standard_EXPORT   
90   void Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S ) ;
91   //Standard_EXPORT   
92   TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape );
93   //Standard_EXPORT   
94   void RemoveShapeFromBuffer( const TCollection_AsciiString& IOR ) ;
95   //Standard_EXPORT   
96   void ClearClientBuffer() ;
97   //Standard_EXPORT   
98   unsigned int BufferLength() ;
99   TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
100
101 private: 
102   // Fields PRIVATE
103   //
104   TColStd_SequenceOfAsciiString myIORs ;
105   TopTools_SequenceOfShape myShapes ;
106   long  pid_client;
107 };
108
109
110 #endif