0024911: Avoid using virtual functions in NCollection classes
[occt.git] / src / Voxel / Voxel_TypeDef.hxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _VOXEL_TYPEDEF_HXX_
15 #define _VOXEL_TYPEDEF_HXX_
16
17 // Basic data types
18
19 typedef struct
20 {
21   Standard_Integer ix;
22   Standard_Integer iy;
23   Standard_Integer iz;
24 } iXYZ;
25
26
27 // Maps and Tables
28
29 inline Standard_Integer HashCode(const iXYZ& me, const Standard_Integer upper)
30 {
31   return (Abs(me.ix + me.iy + me.iz) % upper) + 1;
32 }
33
34 inline Standard_Boolean IsEqual(const iXYZ& one, const iXYZ& two)
35
36   return one.ix == two.ix && one.iy == two.iy && one.iz == two.iz;
37 }
38
39 #include <NCollection_DataMap.hxx>
40
41 typedef NCollection_DataMap<iXYZ, Standard_Integer> iXYZIndex;
42 typedef NCollection_DataMap<iXYZ, Standard_Byte> iXYZBool;
43
44 // Defines
45
46 #define VOXELS  "Voxels"
47 #define ASCII   "Ascii"
48 #define BINARY  "Binary"
49 #define BOOL    "Bool"
50 #define COLOR   "Color"
51 #define FLOAT   "Float"
52
53 #endif // _VOXEL_TYPEDEF_HXX_