Salome HOME
Windows port
[modules/geom.git] / src / GEOMClient / GEOM_Client.hxx
1 //  Copyright (C) 2007-2008  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 //  GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
23 //  File   : GEOM_Client.hxx
24 //  Author : Yves FRICAUD
25 //  Module : GEOM
26 //  $Header$
27 //
28 #ifndef _GEOM_Client_HeaderFile
29 #define _GEOM_Client_HeaderFile
30
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(GEOM_Gen)
33 #
34 #ifndef _TColStd_SequenceOfAsciiString_HeaderFile
35 #include <TColStd_SequenceOfAsciiString.hxx>
36 #endif
37 #ifndef _TopTools_SequenceOfShape_HeaderFile
38 #include <TopTools_SequenceOfShape.hxx>
39 #endif
40 #ifndef _Standard_Integer_HeaderFile
41 #include <Standard_Integer.hxx>
42 #endif
43 class TCollection_AsciiString;
44 class TopoDS_Shape;
45
46
47 #ifndef _Standard_HeaderFile
48 #include <Standard.hxx>
49 #endif
50 #ifndef _Standard_Macro_HeaderFile
51 #include <Standard_Macro.hxx>
52 #endif
53
54 #ifdef WNT
55  #if defined GEOMCLIENT_EXPORTS || defined GEOMClient_EXPORTS
56   #if defined WIN32
57    #define GEOMCLIENT_EXPORT __declspec( dllexport )
58   #else
59    #define GEOMCLIENT_EXPORT
60   #endif
61  #else
62   #if defined WIN32
63    #define GEOMCLIENT_EXPORT __declspec( dllimport )
64   #else
65    #define GEOMCLIENT_EXPORT
66   #endif
67  #endif
68 #else
69  #define GEOMCLIENT_EXPORT
70 #endif
71
72 //=====================================================================
73 // GEOM_Client : class definition
74 //=====================================================================
75 class GEOMCLIENT_EXPORT GEOM_Client  {
76
77 public:
78   
79   inline void* operator new(size_t,void* anAddress) 
80   {
81     return anAddress;
82   }
83   inline void* operator new(size_t size) 
84   { 
85     return Standard::Allocate(size); 
86   }
87   inline void  operator delete(void *anAddress) 
88   { 
89     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
90   }
91   // Methods PUBLIC
92   // 
93    //Standard_EXPORT   
94   GEOM_Client();
95   //Standard_EXPORT   
96   GEOM_Client(Engines::Container_ptr client);
97   //Standard_EXPORT   
98   Standard_Integer Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
99   //Standard_EXPORT   
100   Standard_Integer Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
101   //Standard_EXPORT   
102   void Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S ) ;
103   //Standard_EXPORT   
104   TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape );
105   //Standard_EXPORT   
106   void RemoveShapeFromBuffer( const TCollection_AsciiString& IOR ) ;
107   //Standard_EXPORT   
108   void ClearClientBuffer() ;
109   //Standard_EXPORT   
110   unsigned int BufferLength() ;
111   TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
112
113 private: 
114   // Fields PRIVATE
115   //
116   TColStd_SequenceOfAsciiString myIORs ;
117   TopTools_SequenceOfShape myShapes ;
118   long  pid_client;
119 };
120
121
122 #endif