0026741: Problem with building samples and demo
[occt.git] / src / Voxel / Voxel_ColorDS.hxx
1 // Created on: 2008-05-08
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_ColorDS_HeaderFile
17 #define _Voxel_ColorDS_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_Byte.hxx>
27
28
29 //! A 3D voxel model keeping 4 bits for each voxel (one of 16 colors).
30 class Voxel_ColorDS  : public Voxel_DS
31 {
32 public:
33
34   DEFINE_STANDARD_ALLOC
35
36   
37   //! An empty constructor.
38   Standard_EXPORT Voxel_ColorDS();
39   
40   //! A constructor initializing the voxel model.
41   //! (x, y, z) - the start point of the box.
42   //! (x_len, y_len, z_len) - lengths in x, y and z directions along axes of a co-ordinate system.
43   //! (nb_x, nb_y, nb_z) - number of splits (voxels) along x, y and z directions.
44   Standard_EXPORT Voxel_ColorDS(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);
45   
46   //! Initialization of the voxel model.
47   //! (x, y, z) - the start point of the box.
48   //! (x_len, y_len, z_len) - lengths in x, y and z directions along axes of a co-ordinate system.
49   //! (nb_x, nb_y, nb_z) - number of splits (voxels) along x, y and z directions.
50   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;
51   
52   //! A destructor of the voxel model.
53   Standard_EXPORT void Destroy();
54 ~Voxel_ColorDS()
55 {
56   Destroy();
57 }
58   
59   //! The method sets all values equal to 0 (false) and
60   //! releases the memory.
61   Standard_EXPORT void SetZero();
62   
63   //! Defines a value for voxel with co-ordinates (ix, iy, iz).
64   //! Only the first four bits are used!
65   //! Initial state of the model is so that all voxels have value 0x0000,
66   //! and this data doesn't occupy memory.
67   //! Memory for data is allocating during setting non-zero values (0x0101, for example).
68   Standard_EXPORT void Set (const Standard_Integer ix, const Standard_Integer iy, const Standard_Integer iz, const Standard_Byte data);
69   
70   //! Returns the value of voxel with co-ordinates (ix, iy, iz).
71   Standard_EXPORT Standard_Byte 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_ColorDS_HeaderFile