Salome HOME
0020907: Werror in GEOM: integrate patch from Erwan ADAM
[modules/geom.git] / src / GEOMClient / GEOM_Client.hxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
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 #ifdef HAVE_FINITE
36 #undef HAVE_FINITE // E.A. fix a warning about redefinition of HAVE_FINITE in re-inclusion of Standard_values.h
37 #endif
38 #ifndef _TColStd_SequenceOfAsciiString_HeaderFile
39 #include <TColStd_SequenceOfAsciiString.hxx>
40 #endif
41 #ifndef _TopTools_SequenceOfShape_HeaderFile
42 #include <TopTools_SequenceOfShape.hxx>
43 #endif
44 #ifndef _Standard_Integer_HeaderFile
45 #include <Standard_Integer.hxx>
46 #endif
47 class TCollection_AsciiString;
48 class TopoDS_Shape;
49
50
51 #ifndef _Standard_HeaderFile
52 #include <Standard.hxx>
53 #endif
54 #ifndef _Standard_Macro_HeaderFile
55 #include <Standard_Macro.hxx>
56 #endif
57
58 #ifdef WNT
59  #if defined GEOMCLIENT_EXPORTS || defined GEOMClient_EXPORTS
60   #if defined WIN32
61    #define GEOMCLIENT_EXPORT __declspec( dllexport )
62   #else
63    #define GEOMCLIENT_EXPORT
64   #endif
65  #else
66   #if defined WIN32
67    #define GEOMCLIENT_EXPORT __declspec( dllimport )
68   #else
69    #define GEOMCLIENT_EXPORT
70   #endif
71  #endif
72 #else
73  #define GEOMCLIENT_EXPORT
74 #endif
75
76 //=====================================================================
77 // GEOM_Client : class definition
78 //=====================================================================
79 class GEOMCLIENT_EXPORT GEOM_Client  {
80
81 public:
82   
83   inline void* operator new(size_t,void* anAddress) 
84   {
85     return anAddress;
86   }
87   inline void* operator new(size_t size) 
88   { 
89     return Standard::Allocate(size); 
90   }
91   inline void  operator delete(void *anAddress) 
92   { 
93     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
94   }
95   // Methods PUBLIC
96   // 
97    //Standard_EXPORT   
98   GEOM_Client();
99   //Standard_EXPORT   
100   GEOM_Client(Engines::Container_ptr client);
101   //Standard_EXPORT   
102   Standard_Integer Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
103   //Standard_EXPORT   
104   Standard_Integer Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
105   //Standard_EXPORT   
106   void Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S ) ;
107   //Standard_EXPORT   
108   TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape );
109   //Standard_EXPORT   
110   void RemoveShapeFromBuffer( const TCollection_AsciiString& IOR ) ;
111   //Standard_EXPORT   
112   void ClearClientBuffer() ;
113   //Standard_EXPORT   
114   unsigned int BufferLength() ;
115   TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
116
117 private: 
118   // Fields PRIVATE
119   //
120   TColStd_SequenceOfAsciiString myIORs ;
121   TopTools_SequenceOfShape myShapes ;
122   long  pid_client;
123 };
124
125
126 #endif