0026741: Problem with building samples and demo
[occt.git] / src / Voxel / Voxel_BoolDS.hxx
1 // Created on: 2008-05-04
2 // Created by: Vladislav ROMASHKO
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 _Voxel_BoolDS_HeaderFile
17 #define _Voxel_BoolDS_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
22
23 #include <Voxel_DS.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27
28
29 //! A 3D voxel model keeping a bool flag (1 or 0)
30 //! value for each voxel.
31 class Voxel_BoolDS  : public Voxel_DS
32 {
33 public:
34
35   DEFINE_STANDARD_ALLOC
36
37   
38   //! An empty constructor.
39   Standard_EXPORT Voxel_BoolDS();
40   
41   //! A constructor initializing the voxel model.
42   //! (x, y, z) - the start point of the box.
43   //! (x_len, y_len, z_len) - lengths in x, y and z directions along axes of a co-ordinate system.
44   //! (nb_x, nb_y, nb_z) - number of splits (voxels) along x, y and z directions.
45   Standard_EXPORT Voxel_BoolDS(const Standard_Real x, const Standard_Real y, const Standard_Real z, const Standard_Real x_len, const Standard_Real y_len, const Standard_Real z_len, const Standard_Integer nb_x, const Standard_Integer nb_y, const Standard_Integer nb_z);
46   
47   //! Initialization of the voxel model.
48   //! (x, y, z) - the start point of the box.
49   //! (x_len, y_len, z_len) - lengths in x, y and z directions along axes of a co-ordinate system.
50   //! (nb_x, nb_y, nb_z) - number of splits (voxels) along x, y and z directions.
51   Standard_EXPORT virtual void Init (const Standard_Real x, const Standard_Real y, const Standard_Real z, const Standard_Real x_len, const Standard_Real y_len, const Standard_Real z_len, const Standard_Integer nb_x, const Standard_Integer nb_y, const Standard_Integer nb_z) Standard_OVERRIDE;
52   
53   //! A destructor of the voxel model.
54   Standard_EXPORT void Destroy();
55 ~Voxel_BoolDS()
56 {
57   Destroy();
58 }
59   
60   //! The method sets all values equal to 0 (false) and
61   //! releases the memory.
62   Standard_EXPORT void SetZero();
63   
64   //! Defines a value for voxel with co-ordinates (ix, iy, iz).
65   //! Initial state of the model is so that all voxels have value 0 (false),
66   //! and this data doesn't occupy memory.
67   //! Memory for data is allocating during setting non-zero values (true).
68   Standard_EXPORT void Set (const Standard_Integer ix, const Standard_Integer iy, const Standard_Integer iz, const Standard_Boolean data = Standard_True);
69   
70   //! Returns the value of voxel with co-ordinates (ix, iy, iz).
71   Standard_EXPORT Standard_Boolean Get (const Standard_Integer ix, const Standard_Integer iy, const Standard_Integer iz) const;
72
73
74
75
76 protected:
77
78
79
80
81
82 private:
83
84
85
86
87
88 };
89
90
91
92
93
94
95
96 #endif // _Voxel_BoolDS_HeaderFile