Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _GEOM_Client_HeaderFile
00027 #define _GEOM_Client_HeaderFile
00028
00029 #include <SALOMEconfig.h>
00030 #include CORBA_SERVER_HEADER(GEOM_Gen)
00031
00032 #ifdef HAVE_FINITE
00033 #undef HAVE_FINITE // E.A. fix a warning about redefinition of HAVE_FINITE in re-inclusion of Standard_values.h
00034 #endif
00035 #ifndef _TColStd_SequenceOfAsciiString_HeaderFile
00036 #include <TColStd_SequenceOfAsciiString.hxx>
00037 #endif
00038 #ifndef _TopTools_SequenceOfShape_HeaderFile
00039 #include <TopTools_SequenceOfShape.hxx>
00040 #endif
00041 #ifndef _Standard_Integer_HeaderFile
00042 #include <Standard_Integer.hxx>
00043 #endif
00044
00045 class TCollection_AsciiString;
00046 class TopoDS_Shape;
00047
00048 #ifndef _Standard_HeaderFile
00049 #include <Standard.hxx>
00050 #endif
00051 #ifndef _Standard_Macro_HeaderFile
00052 #include <Standard_Macro.hxx>
00053 #endif
00054
00055 #ifdef WNT
00056 #if defined GEOMCLIENT_EXPORTS || defined GEOMClient_EXPORTS
00057 #if defined WIN32
00058 #define GEOMCLIENT_EXPORT __declspec( dllexport )
00059 #else
00060 #define GEOMCLIENT_EXPORT
00061 #endif
00062 #else
00063 #if defined WIN32
00064 #define GEOMCLIENT_EXPORT __declspec( dllimport )
00065 #else
00066 #define GEOMCLIENT_EXPORT
00067 #endif
00068 #endif
00069 #else
00070 #define GEOMCLIENT_EXPORT
00071 #endif
00072
00073 #include <TCollection_AsciiString.hxx>
00074 #include <TopoDS_Shape.hxx>
00075 #include <map>
00076 #include <vector>
00077
00078
00079
00080
00081
00082
00083
00084 #define SINGLE_CLIENT
00085
00086
00087
00088
00089 class GEOMCLIENT_EXPORT GEOM_Client {
00090
00091 public:
00092
00093 inline void* operator new(size_t,void* anAddress)
00094 {
00095 return anAddress;
00096 }
00097 inline void* operator new(size_t size)
00098 {
00099 return Standard::Allocate(size);
00100 }
00101 inline void operator delete(void *anAddress)
00102 {
00103 if (anAddress) Standard::Free((Standard_Address&)anAddress);
00104 }
00105
00106
00107
00108 GEOM_Client();
00109
00110 GEOM_Client(Engines::Container_ptr client);
00111
00112 GEOM_Client(const GEOM_Client& client);
00113
00114 Standard_Boolean Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
00115
00116 Standard_Boolean Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
00117
00118 void Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S ) ;
00119
00120 TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape );
00121
00122 void RemoveShapeFromBuffer( const TCollection_AsciiString& IOR ) ;
00123
00124 void ClearClientBuffer() ;
00125
00126 unsigned int BufferLength() ;
00127 TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
00128 #ifdef SINGLE_CLIENT
00129 static GEOM_Client& get_client();
00130 #else
00131 static GEOM_Client get_client();
00132 #endif
00133
00134 private:
00135
00136
00137 std::map< TCollection_AsciiString , std::vector<TopoDS_Shape> > _mySubShapes;
00138 std::map< TCollection_AsciiString , TopoDS_Shape > myShapesMap;
00139 long pid_client;
00140 };
00141
00142 #ifdef SINGLE_CLIENT
00143 #define SHAPE_READER(obj) GEOM_Client& obj=GEOM_Client::get_client()
00144 #else
00145 #define SHAPE_READER(obj) GEOM_Client obj
00146 #endif
00147
00148 #endif