0025133: TKOpenGl - Crash on closing a view containing presentations with capping
[occt.git] / src / VrmlData / VrmlData_DataMapOfShapeAppearance.hxx
1 // Created on: 2008-06-03
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2008-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef VrmlData_DataMapOfShapeAppearance_HeaderFile
17 #define VrmlData_DataMapOfShapeAppearance_HeaderFile
18
19 #include <NCollection_DataMap.hxx>
20 #include <VrmlData_Appearance.hxx>
21 #include <TopoDS_TShape.hxx>
22
23 /**
24  * Data Map that provides the link between each Shape obtained in VRML import
25  * and the corresponding Appearance.
26  */
27 class VrmlData_DataMapOfShapeAppearance
28   : public NCollection_DataMap<Handle(TopoDS_TShape), Handle(VrmlData_Appearance)>
29 {
30 public:
31   //! Constructor
32   inline VrmlData_DataMapOfShapeAppearance
33                 (const Standard_Integer                   NbBuckets=1,
34                  const Handle(NCollection_BaseAllocator)& theAllocator = 0L)
35     :  NCollection_DataMap<Handle(TopoDS_TShape),
36                            Handle(VrmlData_Appearance)> (NbBuckets, theAllocator)
37   {}
38
39   //! Copy constructor
40   inline VrmlData_DataMapOfShapeAppearance
41                 (const VrmlData_DataMapOfShapeAppearance& theOther)
42     :  NCollection_DataMap<Handle(TopoDS_TShape),
43                            Handle(VrmlData_Appearance)> (theOther)
44   {}
45   
46   
47   friend Standard_Boolean IsEqual (const Handle(TopoDS_TShape)& one,
48                                    const Handle(TopoDS_TShape)& two);
49
50 };
51
52 //=======================================================================
53 //function : IsEqual
54 //purpose  : for NCollection_DataMap interface
55 //=======================================================================
56 inline Standard_Boolean IsEqual (const Handle(TopoDS_TShape)& one,
57                                  const Handle(TopoDS_TShape)& two) 
58 {
59   return one == two;
60 }
61
62
63 #endif