1 // Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : GEOM_Client.hxx
23 // Author : Yves FRICAUD
26 #ifndef _GEOM_Client_HeaderFile
27 #define _GEOM_Client_HeaderFile
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(GEOM_Gen)
32 #include <Standard_Boolean.hxx>
33 #include <TCollection_AsciiString.hxx>
34 #include <TopoDS_Shape.hxx>
40 #if defined GEOMCLIENT_EXPORTS || defined GEOMClient_EXPORTS
41 #define GEOMCLIENT_EXPORT __declspec( dllexport )
43 #define GEOMCLIENT_EXPORT __declspec( dllimport )
46 #define GEOMCLIENT_EXPORT
50 * if define SINGLE_CLIENT is not commented, the method get_client always returns the same GEOM_Client object (singleton object)
51 * and the SHAPE_READER macro can be used to define an object that is always this singleton object
52 * if define SINGLE_CLIENT is commented, we get the old way to define the GEOM_Client objects : get_client returns a new object
53 * and the SHAPE_READER macro defines also a new object
57 //=====================================================================
58 // GEOM_Client : class definition
59 //=====================================================================
60 class GEOMCLIENT_EXPORT GEOM_Client {
66 GEOM_Client(Engines::Container_ptr client);
67 GEOM_Client(const GEOM_Client& client);
69 TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape );
70 Standard_Boolean Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
71 void RemoveShapeFromBuffer( const TCollection_AsciiString& IOR ) ;
72 void ClearClientBuffer() ;
75 static GEOM_Client& get_client();
77 static GEOM_Client get_client();
83 Standard_Boolean Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
84 void Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S, int Tick ) ;
85 TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
89 std::map< TCollection_AsciiString , std::vector<TopoDS_Shape> > _mySubShapes;
90 std::map< TCollection_AsciiString , TopoDS_Shape > myShapesMap;
91 std::map< TCollection_AsciiString , int > myTicksMap;
96 #define SHAPE_READER(obj) GEOM_Client& obj=GEOM_Client::get_client()
98 #define SHAPE_READER(obj) GEOM_Client obj