0026765: Visualization - drop TKVoxel toolkit
authorkgv <kgv@opencascade.com>
Sat, 10 Oct 2015 19:17:37 +0000 (22:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 15 Oct 2015 07:58:58 +0000 (10:58 +0300)
97 files changed:
adm/MODULES
adm/UDLIST
dox/FILES_HTML.txt
dox/FILES_PDF.txt
dox/dev_guides/tests/tests.md
dox/overview/overview.md
dox/technical_overview/technical_overview.md
dox/user_guides/user_guides.md
dox/user_guides/voxels_wp/images/voxels_wp_image003.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image004.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image005.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image006.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image007.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image008.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image009.png [deleted file]
dox/user_guides/voxels_wp/images/voxels_wp_image010.png [deleted file]
dox/user_guides/voxels_wp/voxels_wp.md [deleted file]
samples/qt/VoxelDemo/VoxelDemo-vc10.sln [deleted file]
samples/qt/VoxelDemo/VoxelDemo-vc12.sln [deleted file]
samples/qt/VoxelDemo/VoxelDemo-vc9.sln [deleted file]
samples/qt/VoxelDemo/VoxelDemo.pro [deleted file]
samples/qt/VoxelDemo/genproj.bat [deleted file]
samples/qt/VoxelDemo/inc/Application.h [deleted file]
samples/qt/VoxelDemo/inc/ConversionThread.h [deleted file]
samples/qt/VoxelDemo/inc/Timer.h [deleted file]
samples/qt/VoxelDemo/inc/Viewer.h [deleted file]
samples/qt/VoxelDemo/inc/VoxelClient_VisDrawer.h [deleted file]
samples/qt/VoxelDemo/msvc.bat [deleted file]
samples/qt/VoxelDemo/run.bat [deleted file]
samples/qt/VoxelDemo/src/Application.cpp [deleted file]
samples/qt/VoxelDemo/src/ConversionThread.cpp [deleted file]
samples/qt/VoxelDemo/src/Main.cpp [deleted file]
samples/qt/VoxelDemo/src/Timer.cpp [deleted file]
samples/qt/VoxelDemo/src/Viewer.cpp [deleted file]
samples/qt/VoxelDemo/src/VoxelClient_VisDrawer.cxx [deleted file]
src/OS/Visualization.tcl
src/QABugs/QABugs_19.cxx
src/TKQADraw/EXTERNLIB
src/TKViewerTest/EXTERNLIB
src/TKVoxel/CMakeLists.txt [deleted file]
src/TKVoxel/EXTERNLIB [deleted file]
src/TKVoxel/FILES [deleted file]
src/TKVoxel/PACKAGES [deleted file]
src/ViewerTest/FILES
src/ViewerTest/ViewerTest.cxx
src/ViewerTest/ViewerTest.hxx
src/ViewerTest/ViewerTest_VoxelCommands.cxx [deleted file]
src/Voxel/FILES [deleted file]
src/Voxel/Voxel_BoolDS.cxx [deleted file]
src/Voxel/Voxel_BoolDS.hxx [deleted file]
src/Voxel/Voxel_BooleanOperation.cxx [deleted file]
src/Voxel/Voxel_BooleanOperation.hxx [deleted file]
src/Voxel/Voxel_CollisionDetection.cxx [deleted file]
src/Voxel/Voxel_CollisionDetection.hxx [deleted file]
src/Voxel/Voxel_ColorDS.cxx [deleted file]
src/Voxel/Voxel_ColorDS.hxx [deleted file]
src/Voxel/Voxel_DS.cxx [deleted file]
src/Voxel/Voxel_DS.hxx [deleted file]
src/Voxel/Voxel_FastConverter.cxx [deleted file]
src/Voxel/Voxel_FastConverter.hxx [deleted file]
src/Voxel/Voxel_FloatDS.cxx [deleted file]
src/Voxel/Voxel_FloatDS.hxx [deleted file]
src/Voxel/Voxel_OctBoolDS.cxx [deleted file]
src/Voxel/Voxel_OctBoolDS.hxx [deleted file]
src/Voxel/Voxel_Prs.cxx [deleted file]
src/Voxel/Voxel_Prs.hxx [deleted file]
src/Voxel/Voxel_ROctBoolDS.cxx [deleted file]
src/Voxel/Voxel_ROctBoolDS.hxx [deleted file]
src/Voxel/Voxel_Reader.cxx [deleted file]
src/Voxel/Voxel_Reader.hxx [deleted file]
src/Voxel/Voxel_Selector.cxx [deleted file]
src/Voxel/Voxel_Selector.hxx [deleted file]
src/Voxel/Voxel_SplitData.cxx [deleted file]
src/Voxel/Voxel_SplitData.hxx [deleted file]
src/Voxel/Voxel_TypeDef.hxx [deleted file]
src/Voxel/Voxel_VisData.h [deleted file]
src/Voxel/Voxel_VoxelDisplayMode.hxx [deleted file]
src/Voxel/Voxel_VoxelFileFormat.hxx [deleted file]
src/Voxel/Voxel_Writer.cxx [deleted file]
src/Voxel/Voxel_Writer.hxx [deleted file]
tests/bugs/vis/bug19820 [deleted file]
tests/bugs/vis/bug24019 [deleted file]
tests/bugs/vis/bug24051 [deleted file]
tests/v3d/grids.list
tests/v3d/voxel/A1 [deleted file]
tests/v3d/voxel/A2 [deleted file]
tests/v3d/voxel/A3 [deleted file]
tests/v3d/voxel/A4 [deleted file]
tests/v3d/voxel/A5 [deleted file]
tests/v3d/voxel/A6 [deleted file]
tests/v3d/voxel/A7 [deleted file]
tests/v3d/voxel/A8 [deleted file]
tests/v3d/voxel/A9 [deleted file]
tests/v3d/voxel/B1 [deleted file]
tests/v3d/voxel/B2 [deleted file]
tests/v3d/voxel/B3 [deleted file]
tests/v3d/voxel/begin [deleted file]

index 5666474..10b1b2c 100644 (file)
@@ -1,7 +1,7 @@
 FoundationClasses TKernel TKMath
 ModelingData TKG2d TKG3d TKGeomBase TKBRep
 ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
-Visualization TKService TKV3d TKOpenGl TKMeshVS TKVoxel TKIVtk
+Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk
 ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml FWOSPlugin TKTObj TKBinTObj TKXmlTObj
 DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF
 Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
\ No newline at end of file
index 35248db..56446c3 100644 (file)
@@ -212,7 +212,6 @@ n StdPrs
 n StdSelect
 n TColQuantity
 n V3d
-n Voxel
 n WNT
 n Xw
 n Cocoa
@@ -223,7 +222,6 @@ t TKOpenGl
 t TKD3DHost
 t TKService
 t TKV3d
-t TKVoxel
 n BinTObjDrivers
 n LDOM
 n TObj
index 7db38e4..a1ef0b2 100644 (file)
@@ -35,7 +35,6 @@ user_guides/brep_wp/brep_wp.md
 user_guides/ocaf_functionmechanism_wp/ocaf_functionmechanism_wp.md
 user_guides/ocaf_tree_wp/ocaf_tree_wp.md
 user_guides/ocaf_wp/ocaf_wp.md
-user_guides/voxels_wp/voxels_wp.md
 user_guides/vis/vis.md
 
 dev_guides/dev_guides.md
index 3d1d797..f4f7ffc 100644 (file)
@@ -19,7 +19,6 @@ user_guides/step/step.md
 user_guides/draw_test_harness/draw_test_harness.md
 user_guides/tobj/tobj.md
 user_guides/visualization/visualization.md
-user_guides/voxels_wp/voxels_wp.md
 user_guides/xde/xde.md
 user_guides/vis/vis.md
 
index fe36b42..2004d48 100644 (file)
@@ -987,7 +987,7 @@ This group allows  testing extended data exchange packages.
 | Foundation Classes | TKernel, TKMath | fclasses |
 | Modeling_algorithms |        TKGeomAlgo, TKTopAlgo, TKPrim, TKBO, TKBool, TKHLR, TKFillet, TKOffset, TKFeat, TKXMesh |       modalg |
 | Modeling Data | TKG2d, TKG3d, TKGeomBase, TKBRep     | moddata |
-| Visualization | TKService, TKV2d, TKV3d, TKOpenGl, TKMeshVS, TKNIS, TKVoxel  | vis |
+| Visualization | TKService, TKV2d, TKV3d, TKOpenGl, TKMeshVS, TKNIS   | vis |
 
 
 @subsection testmanual_5_3 Recommended approaches to checking test results
index 199ebcd..2195706 100644 (file)
@@ -556,13 +556,6 @@ The combination of these resources allows creating substantial applications.
 
 **See also:** @ref occt__tutorial "OCCT Tutorial" 
 
- Voxel
-------
-
-This is a demonstration application showing OCCT voxel models. It also includes a set of non-regression tests and other commands for testing this functionality (accessible only through TEST pre-processor definition).
-
-**See also:** <a href="occt_voxels_wp.html">Voxels User's guide</a> 
-
 **Remarks:**
 
   * Qt samples are available on all supported platforms;
index 85fbcbf..f0077ce 100644 (file)
@@ -208,10 +208,6 @@ For more details see @ref occt_user_guides__visualization "Visualization User's
 
 The visualization of OCCT topological shapes by means of VTK library provided by VIS component is described in a separate @ref occt_user_guides__vis "VTK Integration Services" User's Guide.
 
-Open CASCADE Technology also supports voxel representation providing basic data containers and visualization of voxels as colored or grayscale bricks.
-
-See @ref occt_user_guides__voxels_wp "Voxels User's Guide" for more information.
-
 See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
 
 
index 70b1a20..289ed21 100644 (file)
@@ -10,7 +10,6 @@ OCCT User Guides are organized by OCCT modules:
   * @subpage occt_user_guides__boolean_operations "Boolean Operations"
   * @subpage occt_user_guides__shape_healing "Shape Healing"
 * @subpage occt_user_guides__visualization "Visualization"
-  * @subpage occt_user_guides__voxels_wp "Voxels"
   * @subpage occt_user_guides__vis "VTK Integration Services"
 * Data Exchange
   * @subpage occt_user_guides__iges "IGES translator"
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image003.png b/dox/user_guides/voxels_wp/images/voxels_wp_image003.png
deleted file mode 100644 (file)
index 3e08944..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image003.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image004.png b/dox/user_guides/voxels_wp/images/voxels_wp_image004.png
deleted file mode 100644 (file)
index 666bca1..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image004.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image005.png b/dox/user_guides/voxels_wp/images/voxels_wp_image005.png
deleted file mode 100644 (file)
index 33bd9cc..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image005.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image006.png b/dox/user_guides/voxels_wp/images/voxels_wp_image006.png
deleted file mode 100644 (file)
index 5d92221..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image006.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image007.png b/dox/user_guides/voxels_wp/images/voxels_wp_image007.png
deleted file mode 100644 (file)
index 0e1723c..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image007.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image008.png b/dox/user_guides/voxels_wp/images/voxels_wp_image008.png
deleted file mode 100644 (file)
index 9671a0a..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image008.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image009.png b/dox/user_guides/voxels_wp/images/voxels_wp_image009.png
deleted file mode 100644 (file)
index 7228234..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image009.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/images/voxels_wp_image010.png b/dox/user_guides/voxels_wp/images/voxels_wp_image010.png
deleted file mode 100644 (file)
index b024013..0000000
Binary files a/dox/user_guides/voxels_wp/images/voxels_wp_image010.png and /dev/null differ
diff --git a/dox/user_guides/voxels_wp/voxels_wp.md b/dox/user_guides/voxels_wp/voxels_wp.md
deleted file mode 100644 (file)
index d6e05c5..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-Voxel Package {#occt_user_guides__voxels_wp}
-========================
-
-@tableofcontents 
-@section occt_voxels_wp_1 Introduction
-
-  A voxel is a sub-volume box with constant  scalar/vector value. 
-  The object in voxel representation is split into many  small sub-volumes (voxels) 
-  and its properties are distributed through voxels.  
-  
-  Voxels are used for analysis and visualization of  3D-dimensional distribution of data. 
-  Medicine (mainly, tomography),  computational physics (hydrodynamics, aerodynamics, nuclear physics) 
-  and many  other industries use voxels for 3D data visualization and analysis of physical  processes.  
-  
-  To produce a voxel representation the 3D space is split by equal intervals 
-  along the main orthogonal coordinate axes to obtain nx  x ny x nz voxels (small cubes):  
-
-@image html voxels_wp_image003.png "A cube of 3 X 3 X 3  = 9 voxels."
-@image latex voxels_wp_image003.png "A cube of 3 X 3 X 3  = 9 voxels."
-
-  The data are attached to each voxel and remain the same  within the voxel. 
-  It means that we obtain the 3D space with discrete data distribution.  
-  
-  The number of voxels used in a calculation can vary. 
-  An  average model contains several tens of millions of voxels. 
-  Such a great amount  of data requires special algorithms of computation, 
-  data containers keeping  data in memory and visualization tools.  
-  
-  Open CASCADE Technology provides several basic data containers for voxels 
-  with fast access to the data and optimal allocation of  data in memory.   
-  
-  Also, a special visualization toolkit allows visualizing voxels 
-  as colored or black/white points and cubes, displaying only the voxels 
-  visible from the user's point of view.  
-
-@image html voxels_wp_image004.png "A shape and its voxel representation"
-@image html voxels_wp_image005.png  "A shape and its voxel representation"
-
-@image latex voxels_wp_image004.png "A shape and its voxel representation"
-@image latex voxels_wp_image005.png "A shape and its voxel representation"
-
-In these images a boundary representation is displayed to the  left.  In the center and to the right there are 3D discrete representations (or  3D discrete topology).  Any solid shape can be translated into a voxel  representation.  
-
-@section occt_voxels_wp_2 Data structure
-
-  The data structure to store the voxels data is a  special class which gives 
-  fast access to the data of each voxel and allocates the data in an optimal way in the memory of a computer.
-  
-  Fast access to the data is provided by means of  bit-wise operators on the indices of internal arrays.  
-  
-  The optimal data allocation is reached through  division 
-  of the whole data set into data subsets and keeping only non-zero  pieces of data in memory.  
-  
-  A voxel can contain different data types,  
-  but  presently Open CASCADE Technology implements only several basic ones:  
-  * 1 bit or Boolean data type – a voxel contains a flag: 0 or 1  (false or true).
-  * 4 bits or Color data type – a voxel contains a value occupying 4  bits.
-  It is an integer in the range of 0 .. 15. The data can be divided into 16  subsets and displayed by Color-voxels.
-  * 4 bytes or Float data type – a voxel contains a floating-point  data type.
-
-  In addition, the data structures provide methods for calculation of a center point 
-  by voxel indices and a reverse task – fast search  of a voxel by a point inside the cube of voxels.
-
-@section occt_voxels_wp_3 Algorithms
-
-  There are two service classes implemented for data  structures of voxels:  
-
-  * Boolean operations – provides simple boolean operations on cubes  of voxels (fuse and cut).
-  * Voxelization – the conversion of a geometrical model into its voxel representation.
-  
-### Boolean operations 
-
-Fusion and cutting of two cubes of voxels are performed the class *Voxel_BooleanOperations*.   The cubes should have the same size and be split into voxels in the same way.
-* <i>\::Fuse()</i> summarizes the values of the corresponding  voxels and limits the result by the upper limit (if succeeded).  
-* <i>\::Cut()</i> subtracts the values of the corresponding  voxels and limits the result by zero.  
-
-### Voxelization 
-
-A class *Voxel_Convert* converts a *TopoDS_Shape*   into one of the voxel data structures filling the  solid shape by non-zero values.  
-
-The algorithm of voxelization generates only 1-bit or  4-bit voxels.   Other data types may be obtained by conversion of voxels from one  type to another.  
-
-Voxelization of a shape is performed by means of computation of intersection points  between lines filling the volume and  triangulation of the shape.  The lines are parallel to main orthogonal axes and  can intersect the shape from different sides: along +X, +Y and/or +Z axes.  
-  
-The algorithm can run in multi-threaded mode (the number  of threads is unlimited).   The user can see an integer value indicating the  progress of computation.  
-
-@section occt_voxels_wp_4 Visualization
-
-  Visualization of voxels is not a simple task due to a  great amount of data used for 3D analysis.  
-  
-  Open CASCADE Technology allows visualization of a cube of voxels in two modes:  
-  * Points – the centers of voxels as 3D points.
-  * Boxes – the voxels as 3D cubes of adjustable size.
-  
-  A degenerated mode displays only the points (boxes) visible 
-  from the point of view of the user for transformation operations (zoom, pan and  rotate).  
-  
-  To focus on a particular part of the model non-relevant voxels can be erased. 
-  The displayed region is defined by six co-ordinates along  X, Y and Z axes .  
-  
-  It is possible to display the voxels from a particular range of values (iso-volume):  
-
-@image html voxels_wp_image006.png  "Iso-volume of a shape"
-@image latex voxels_wp_image006.png  "Iso-volume of a shape"
-
-The voxels are displayed by means of "direct drawing  in Open GL" technology or "user draw" technology.   Therefore, some visualization  files are compiled within Open CASCADE Technology, but the files of "direct  drawing" are compiled  by the end-user application.  
-  
-It is necessary to include the files *Voxel_VisData.h*,  *VoxelClient_VisDrawer.h* and *VoxelClient_VisDrawer.cxx*   into the  visualization library of the application (containing all files of *OpenGl*  package) and call the method *Voxel_VisDrawer::Init()* from the  application before the visualization of voxels.  
-
-@section occt_voxels_wp_5 Demo-application
-
-  A demonstration application has been created to show  OCCT voxel models. 
-  This is a test demo application because it includes a set of  non-regression tests 
-  and other commands for testing the functionality  (accessible only through TEST pre-processor definition).  
-  
-  The *File* menu allows creation of canonical  shapes (box, cylinder, sphere, torus) or loading of shapes in BREP format:  
-
-@image html voxels_wp_image007.png "Demo-application. Creation or loading of a shape"
-@image latex voxels_wp_image007.png "Demo-application. Creation or loading of a shape"
-
-The menu *Converter* voxelizes the shape.   Two  types of voxels can be obtained: 1-bit or 4-bit voxels. 
-  * 1-bit voxels are displayed in white color on black background. 
-  * 4-bit voxels use 16 colors filling the model in a special way for demonstrative purposes:  
-
-@image html voxels_wp_image008.png "Demo-application.  Voxelization"
-@image latex voxels_wp_image008.png "Demo-application.  Voxelization"
-
-  The converter uses two threads (two processors, if  available) to perform voxelization.  
-  
-  The menu *Visualization* offers two modes of  visualization: Points and Boxes, 
-  allows defining the size of points and boxes  (quadrangles), 
-  the minimum and the maximum displayed color, and the boundaries of the bounding box for displayed voxels:  
-
-@image html voxels_wp_image009.png "Demo-application.  Visualization"
-@image latex voxels_wp_image009.png "Demo-application.  Visualization"
-
-  The last menu, *Demo* contains a demo-command for  running waves of 4-bit voxels:  
-
-@image html voxels_wp_image010.png  "Demo-application.  Running waves"
-@image latex voxels_wp_image010.png  "Demo-application.  Running waves"
-
-@section occt_voxels_wp_6 Future development
-
-In the future OPEN CASCADE  plans to develop the platform of voxels in the following directions:  
-  * Data structure:
-    * Extension of the list of basic data types.  
-    * Development of a deeper hierarchy of voxels (for example, octree  – division of a voxel into 8 sub-voxels).  
-    * Development of a doxel (4D voxels where the fourth co-ordinate is  the time, for example).  
-       
-  * Algorithms:
-    * Conversion of a voxel model into a geometrical model (a reversed  operation to voxelization).  
-       
-  * Visualization:
-    * Optimization of visualization (mainly, the speed of  visualization).  
-    * New shapes of voxel presentation in the 3D Viewer and new  approaches to visualization.  
-    * Selection of voxels.  
diff --git a/samples/qt/VoxelDemo/VoxelDemo-vc10.sln b/samples/qt/VoxelDemo/VoxelDemo-vc10.sln
deleted file mode 100644 (file)
index 00a81be..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-\feff
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VoxelDemo", "VoxelDemo.vcxproj", "{EF9DFAE9-E10E-42D4-87D1-52431728AFDF}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Debug|x64 = Debug|x64
-               Release|Win32 = Release|Win32
-               Release|x64 = Release|x64
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Debug|Win32.ActiveCfg = Debug|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Debug|Win32.Build.0 = Debug|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Debug|x64.ActiveCfg = Debug|x64
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Debug|x64.Build.0 = Debug|x64
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Release|Win32.ActiveCfg = Release|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Release|Win32.Build.0 = Release|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Release|x64.ActiveCfg = Release|x64
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Release|x64.Build.0 = Release|x64
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/samples/qt/VoxelDemo/VoxelDemo-vc12.sln b/samples/qt/VoxelDemo/VoxelDemo-vc12.sln
deleted file mode 100644 (file)
index 7bf6231..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-\feff
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VoxelDemo", "VoxelDemo.vcxproj", "{59F93AA4-FBAD-3468-B4E7-2D6290D2D461}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Debug|x64 = Debug|x64
-               Release|Win32 = Release|Win32
-               Release|x64 = Release|x64
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {59F93AA4-FBAD-3468-B4E7-2D6290D2D461}.Debug|Win32.ActiveCfg = Debug|x64
-               {59F93AA4-FBAD-3468-B4E7-2D6290D2D461}.Debug|x64.ActiveCfg = Debug|x64
-               {59F93AA4-FBAD-3468-B4E7-2D6290D2D461}.Debug|x64.Build.0 = Debug|x64
-               {59F93AA4-FBAD-3468-B4E7-2D6290D2D461}.Release|Win32.ActiveCfg = Release|x64
-               {59F93AA4-FBAD-3468-B4E7-2D6290D2D461}.Release|x64.ActiveCfg = Release|x64
-               {59F93AA4-FBAD-3468-B4E7-2D6290D2D461}.Release|x64.Build.0 = Release|x64
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/samples/qt/VoxelDemo/VoxelDemo-vc9.sln b/samples/qt/VoxelDemo/VoxelDemo-vc9.sln
deleted file mode 100644 (file)
index fabee77..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-\feff
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VoxelDemo", "VoxelDemo.vcproj", "{EF9DFAE9-E10E-42D4-87D1-52431728AFDF}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Release|Win32 = Release|Win32
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Debug|Win32.ActiveCfg = Debug|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Debug|Win32.Build.0 = Debug|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Release|Win32.ActiveCfg = Release|Win32
-               {EF9DFAE9-E10E-42D4-87D1-52431728AFDF}.Release|Win32.Build.0 = Release|Win32
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/samples/qt/VoxelDemo/VoxelDemo.pro b/samples/qt/VoxelDemo/VoxelDemo.pro
deleted file mode 100644 (file)
index 90a4080..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-TEMPLATE = app
-CONFIG += debug_and_release qt opengl
-
-TARGET = VoxelDemo
-
-SAMPLESROOT = $$(CASROOT)/samples/qt
-
-HEADERS   = $${SAMPLESROOT}/voxeldemo/inc/*.h
-
-SOURCES   = $${SAMPLESROOT}/voxeldemo/src/*.cxx \
-            $${SAMPLESROOT}/voxeldemo/src/*.cpp
-
-
-INCLUDEPATH += $$quote($${SAMPLESROOT}/voxeldemo/inc)
-
-DEFINES = 
-
-unix {
-    UNAME = $$system(uname -s)
-    INCLUDES = $$(CSF_OPT_INC)
-    PATHS = $$split(INCLUDES,":")
-    for(path, PATHS):INCLUDEPATH += $${path}
-    LIBLIST = $$(LD_LIBRARY_PATH)
-    LIBPATHS = $$split(LIBLIST,":")
-    for(lib, LIBPATHS):LIBS += -L$${lib}
-
-    CONFIG(debug, debug|release) {
-       DESTDIR = ./$$UNAME/bind
-       OBJECTS_DIR = ./$$UNAME/objd
-       MOC_DIR = ./$$UNAME/srcd
-    } else {
-       DESTDIR = ./$$UNAME/bin
-       OBJECTS_DIR = ./$$UNAME/obj
-       MOC_DIR = ./$$UNAME/src
-    }
-
-    MACOSX_USE_GLX = $$(MACOSX_USE_GLX)
-
-    !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD
-    !macx | equals(MACOSX_USE_GLX, true): DEFINES += LIN LININTEL
-    equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
-    DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
-    !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
-    LIBS += -lfreeimageplus
-    LIBS += -ltbb -ltbbmalloc
-}
-
-win32 {
-    INCLUDES = $$(CSF_OPT_INC)
-    PATHS = $$split(INCLUDES,";")
-    for(path, PATHS):INCLUDEPATH += $${path}
-
-    CONFIG(debug, debug|release) {
-       DEFINES += _DEBUG
-       !contains(QMAKE_HOST.arch, x86_64) {
-               LIBS = -L$(CSF_OPT_LIB32D)
-               contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
-               DESTDIR = ./win32/vc7/bind
-               OBJECTS_DIR = ./win32/vc7/objd
-               MOC_DIR = ./win32/vc7/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
-               DESTDIR = ./win32/vc8/bind
-               OBJECTS_DIR = ./win32/vc8/objd
-               MOC_DIR = ./win32/vc8/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
-               DESTDIR = ./win32/vc9/bind
-               OBJECTS_DIR = ./win32/vc9/objd
-               MOC_DIR = ./win32/vc9/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
-               DESTDIR = ./win32/vc10/bind
-               OBJECTS_DIR = ./win32/vc10/objd
-               MOC_DIR = ./win32/vc10/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
-               DESTDIR = ./win32/vc11/bind
-               OBJECTS_DIR = ./win32/vc11/objd
-               MOC_DIR = ./win32/vc11/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1800) {
-               DESTDIR = ./win32/vc12/bind
-               OBJECTS_DIR = ./win32/vc12/objd
-               MOC_DIR = ./win32/vc12/srcd
-           }
-       } else {
-               LIBS = -L$(CSF_OPT_LIB64D)
-               contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
-               DESTDIR = ./win64/vc8/bind
-               OBJECTS_DIR = ./win64/vc8/objd
-               MOC_DIR = ./win64/vc8/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
-               DESTDIR = ./win64/vc9/bind
-               OBJECTS_DIR = ./win64/vc9/objd
-               MOC_DIR = ./win64/vc9/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
-               DESTDIR = ./win64/vc10/bind
-               OBJECTS_DIR = ./win64/vc10/objd
-               MOC_DIR = ./win64/vc10/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
-               DESTDIR = ./win64/vc11/bind
-               OBJECTS_DIR = ./win64/vc11/objd
-               MOC_DIR = ./win64/vc11/srcd
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1800) {
-               DESTDIR = ./win64/vc12/bind
-               OBJECTS_DIR = ./win64/vc12/objd
-               MOC_DIR = ./win64/vc12/srcd
-           }
-       }
-    } else {
-       DEFINES += NDEBUG
-       !contains(QMAKE_HOST.arch, x86_64) {
-               LIBS = -L$(CSF_OPT_LIB32)
-               contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
-               DESTDIR = ./win32/vc7/bin
-               OBJECTS_DIR = ./win32/vc7/obj
-               MOC_DIR = ./win32/vc7/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
-               DESTDIR = ./win32/vc8/bin
-               OBJECTS_DIR = ./win32/vc8/obj
-               MOC_DIR = ./win32/vc8/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
-               DESTDIR = ./win32/vc9/bin
-               OBJECTS_DIR = ./win32/vc9/obj
-               MOC_DIR = ./win32/vc9/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
-               DESTDIR = ./win32/vc10/bin
-               OBJECTS_DIR = ./win32/vc10/obj
-               MOC_DIR = ./win32/vc10/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
-               DESTDIR = ./win32/vc11/bin
-               OBJECTS_DIR = ./win32/vc11/obj
-               MOC_DIR = ./win32/vc11/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1800) {
-               DESTDIR = ./win32/vc12/bin
-               OBJECTS_DIR = ./win32/vc12/obj
-               MOC_DIR = ./win32/vc12/src
-           }
-       } else {
-               LIBS = -L$(CSF_OPT_LIB64)
-               contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
-               DESTDIR = ./win64/vc8/bin
-               OBJECTS_DIR = ./win64/vc8/obj
-               MOC_DIR = ./win64/vc8/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
-               DESTDIR = ./win64/vc9/bin
-               OBJECTS_DIR = ./win64/vc9/obj
-               MOC_DIR = ./win64/vc9/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
-               DESTDIR = ./win64/vc10/bin
-               OBJECTS_DIR = ./win64/vc10/obj
-               MOC_DIR = ./win64/vc10/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
-               DESTDIR = ./win64/vc11/bin
-               OBJECTS_DIR = ./win64/vc11/obj
-               MOC_DIR = ./win64/vc11/src
-           }
-           contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1800) {
-               DESTDIR = ./win64/vc12/bin
-               OBJECTS_DIR = ./win64/vc12/obj
-               MOC_DIR = ./win64/vc12/src
-           }
-       }
-    }
-    DEFINES +=WNT WIN32 NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
-}
-
-LIBS += -lTKernel -lTKMath -lTKService -lTKV3d \
-        -lTKBRep -lTKGeomBase -lTKTopAlgo -lTKPrim \
-        -lTKBool -lTKVoxel -lTKOpenGl \
-
-QMAKE_CXXFLAGS            = -Zc:wchar_t 
diff --git a/samples/qt/VoxelDemo/genproj.bat b/samples/qt/VoxelDemo/genproj.bat
deleted file mode 100644 (file)
index 997b161..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-REM Generation of vcproj files with qmake utilite
-REM Variable QTDIR and PATH to qmake executable must be defined without fail
-
-REM Use first argument to specify version of Visual Studio (vc8, vc9, or vc10),
-REM second argument specifies architecture) (win32 or win64)
-REM third argument specifies Debug or Release mode
-
-call "%~dp0../../../env.bat" %1 %2 %3
-
-set EXT=vcxproj
-
-if not "%1" == "" (
-    if /I "%1" == "vc8" (
-        set VCVER=vc8
-        set "VCVARS=%VS80COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc9" (
-        set VCVER=vc9
-        set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc10" (
-        set VCVER=vc10
-        set EXT=vcxproj
-        set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc11" (
-        set VCVER=vc11
-        set EXT=vcxproj
-        set "VCVARS=%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc12" (
-        set VCVER=vc12
-        set EXT=vcxproj
-        set "VCVARS=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else (
-        echo Error: first argument ^(%1^) should specify supported version of Visual C++,
-        echo one of: vc8 ^(VS 2005 SP1^), vc9 ^(VS 2008 SP1^), vc10 ^(VS 2010^) or vc11 ^(VS 2012^)
-        exit
-    )
-)
-
-if ["%ARCH%"] == ["32"] set VCARCH=x86
-if ["%ARCH%"] == ["64"] set VCARCH=amd64
-
-call "%VCVARS%" %VCARCH%
-
-qmake -tp vc -o VoxelDemo.%EXT% VoxelDemo.pro
diff --git a/samples/qt/VoxelDemo/inc/Application.h b/samples/qt/VoxelDemo/inc/Application.h
deleted file mode 100755 (executable)
index 4811601..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef APPLICATION_H
-#define APPLICATION_H
-
-#include <qmainwindow.h>
-#include <AIS_ColorScale.hxx>
-#include <AIS_Shape.hxx>
-#include <Voxel_Prs.hxx>
-#include <Voxel_BoolDS.hxx>
-#include <Voxel_ColorDS.hxx>
-#include "Viewer.h"
-
-class Application: public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    Application();
-    ~Application();
-
-protected:
-    void closeEvent( QCloseEvent* );
-
-private slots:
-    void box();
-    void cylinder();
-    void torus();
-    void sphere();
-    void choose();
-    void load( const QString & );
-    void load( const TopoDS_Shape & );
-    void save();
-    void open();
-
-    void testBoolDS();
-    void testColorDS();
-    void testFloatDS();
-    void testOctBoolDS();
-    void testROctBoolDS();
-
-    void testFuseBoolDS();
-    void testFuseColorDS();
-    void testFuseFloatDS();
-    void testCutBoolDS();
-    void testCutColorDS();
-    void testCutFloatDS();
-    
-    void convert2bool();
-    void convert2color();
-    void convert(const int );
-
-    void setNbX();
-    void setNbY();
-    void setNbZ();
-
-    void setScanSide();
-
-    void setVolumicBoolValue();
-    void setVolumicColorValue();
-
-    void setQuadrangleSize();
-    void setPointSize();
-
-    void setColorMinValue();
-    void setColorMaxValue();
-
-    void setUsageOfGLlists();
-    
-    void setDisplayedXMin();
-    void setDisplayedXMax();
-    void setDisplayedYMin();
-    void setDisplayedYMax();
-    void setDisplayedZMin();
-    void setDisplayedZMax();
-
-    void displayPoints();
-    void displayNearestPoints();
-    void displayBoxes();
-    void displayNearestBoxes();
-
-    void displayColorScale();
-    
-    void displayWaves();
-    void displayCut();
-    void displayCollisions();
-
-    void about();
-
-private:
-    void display(Voxel_VoxelDisplayMode );
-    void initPrs();
-
-       Viewer* myViewer;
-       Handle(AIS_Shape) myShape;
-       Handle(Voxel_Prs) myVoxels;
-       Voxel_BoolDS* myBoolVoxels;
-       Voxel_ColorDS* myColorVoxels;
-  Handle(AIS_ColorScale) myColorScale;
-       int myNbX;
-       int myNbY;
-       int myNbZ;
-    unsigned char myScanSide;
-    bool myVolumicBoolValue;
-    unsigned char myVolumicColorValue;
-    int myQuadrangleSize;
-    int myPointSize;
-    unsigned char myColorMinValue;
-    unsigned char myColorMaxValue;
-    double myDisplayedXMin;
-    double myDisplayedXMax;
-    double myDisplayedYMin;
-    double myDisplayedYMax;
-    double myDisplayedZMin;
-    double myDisplayedZMax;
-};
-
-#endif // APPLICATION_H
diff --git a/samples/qt/VoxelDemo/inc/ConversionThread.h b/samples/qt/VoxelDemo/inc/ConversionThread.h
deleted file mode 100755 (executable)
index 0b1b146..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _CONVERSIONTHREAD_H_
-#define _CONVERSIONTHREAD_H_
-
-#include <QThread.h>
-//#include <Voxel_Converter.hxx>
-#include <Voxel_FastConverter.hxx>
-
-class ConversionThread : public QThread
-{
-
-public:
-
-    ConversionThread();
-    ~ConversionThread();
-
-//    void setConverter(Voxel_Converter*     converter);
-    void setConverter(Voxel_FastConverter* converter);
-
-    void setVolumicValue(const int value);
-    void setScanSide(const int side);
-    void setThreadIndex(const int ithread);
-
-    int* getProgress();
-
-protected:
-
-    void run();
-
-private:
-
-//    Voxel_Converter*     myConverter;
-    Voxel_FastConverter* myFastConverter;
-
-    int myVolumicValue;
-    int myScanSide;
-    int myThreadIndex;
-    int myProgress;
-};
-
-#endif // _CONVERSIONTHREAD_H_
diff --git a/samples/qt/VoxelDemo/inc/Timer.h b/samples/qt/VoxelDemo/inc/Timer.h
deleted file mode 100755 (executable)
index 338d7dc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Timer.h: interface for the Timer class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_TIMER_H__528FB454_797E_11D7_9B1B_000103C0F1F9__INCLUDED_)
-#define AFX_TIMER_H__528FB454_797E_11D7_9B1B_000103C0F1F9__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include <OSD_Timer.hxx>
-
-class Timer  
-{
-public:
-       Standard_EXPORT Timer();
-       Standard_EXPORT Timer(const char* filename);
-       Standard_EXPORT ~Timer();
-       Standard_EXPORT void Start();
-       Standard_EXPORT void Stop();
-       Standard_EXPORT void Continue();
-       Standard_EXPORT void Reset();
-  Standard_EXPORT float Seconds();
-  Standard_EXPORT int Minutes();
-       Standard_EXPORT void Print(char* label);
-
-private:
-       OSD_Timer myTimer;
-       FILE* myWriter;
-};
-
-#endif // !defined(AFX_TIMER_H__528FB454_797E_11D7_9B1B_000103C0F1F9__INCLUDED_)
diff --git a/samples/qt/VoxelDemo/inc/Viewer.h b/samples/qt/VoxelDemo/inc/Viewer.h
deleted file mode 100755 (executable)
index 41c8f2d..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _VIEWER_H_
-#define _VIEWER_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include <QWidget.h>
-
-#include <AIS_InteractiveContext.hxx>
-#include <OpenGl_GraphicDriver.hxx>
-#include <V3d_View.hxx>
-#include <OpenGl_View.hxx>
-
-#include <Voxel_Prs.hxx>
-#include <Voxel_Selector.hxx>
-
-class Viewer : public QWidget 
-{
-       
-       Q_OBJECT
-
-public:
-
-       Viewer(QWidget* parent);
-       virtual ~Viewer();
-
-       Handle(AIS_InteractiveContext) getIC() const { return myIC; }
-       Handle(V3d_View) getView() const { return myView; }
-    Handle(OpenGl_GraphicDriver) getGraphicDriver() const { return myGraphicDriver; }
-    Voxel_Selector& getSelector() { return mySelector; }
-    void setPrs(const Handle(Voxel_Prs)& prs) { myPrs = prs; }
-       virtual QPaintEngine*          paintEngine() const;
-
-signals:
-       
-       void mousePressed(Qt::KeyboardModifiers,int,int);
-       void mouseMoved(Qt::KeyboardModifiers,int,int);
-       void mouseReleased(Qt::KeyboardModifiers,int,int);
-       void mouseDoubleClick(Qt::KeyboardModifiers,int,int);
-
-protected:
-       virtual void paintEvent(QPaintEvent* pEvent);
-       virtual void resizeEvent(QResizeEvent* rsEvent);
-       virtual void mousePressEvent(QMouseEvent* mpEvent);
-       virtual void mouseMoveEvent(QMouseEvent* mmEvent);
-       virtual void mouseReleaseEvent(QMouseEvent* mrEvent);
-       virtual void mouseDoubleClickEvent(QMouseEvent* mdcEvent);
-
-private:
-       Handle(AIS_InteractiveContext) myIC;
-       Handle(V3d_View)               myView;
-    Handle(OpenGl_GraphicDriver)   myGraphicDriver;
-
-       bool myRotate;
-       bool myZoom;
-       bool myPan;
-
-       QPoint myStartPnt;
-
-    void setDegenerateMode(const bool );
-
-    Voxel_Selector mySelector;
-    Handle(Voxel_Prs) myPrs;
-};
-
-#endif // _VIEWER_H_
diff --git a/samples/qt/VoxelDemo/inc/VoxelClient_VisDrawer.h b/samples/qt/VoxelDemo/inc/VoxelClient_VisDrawer.h
deleted file mode 100644 (file)
index d79dbd0..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright (c) 1999-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and / or modify it
- under the terms of the GNU Lesser General Public version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-*/
-
-#ifndef _VOXEL_VISDRAWER_H_
-#define _VOXEL_VISDRAWER_H_
-
-#include "Voxel_VisData.h"
-#include <Graphic3d_BndBox4f.hxx>
-
-#include <Voxel_Prs.hxx>
-
-//! Voxel presentation using UserDraw.
-class VoxelClient_PrsGl : public Voxel_Prs
-{
-
-public:
-
-  //! Empty constructor.
-  VoxelClient_PrsGl() {}
-
-protected:
-
-  //! Override compute to create UserDraw element.
-  Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
-                                        const Handle(Prs3d_Presentation)&           thePrs,
-                                        const Standard_Integer                      theMode) Standard_OVERRIDE;
-
-public:
-
-  DEFINE_STANDARD_RTTI(VoxelClient_PrsGl, Voxel_Prs)
-
-};
-
-DEFINE_STANDARD_HANDLE(VoxelClient_PrsGl, Voxel_Prs)
-
-class VoxelClient_VisDrawer
-{
-public:
-
-  class VisElement;
-
-public:
-
-       Standard_EXPORT VoxelClient_VisDrawer(Voxel_VisData* theData);
-       Standard_EXPORT virtual ~VoxelClient_VisDrawer();
-
-       Standard_EXPORT void EvalMinMax(Graphic3d_BndBox4f& theMinMax) const;
-       Standard_EXPORT void Display(const Standard_Boolean theHighlight);
-
-private:
-    
-       Standard_EXPORT void DisplayVoxels(const Standard_Boolean theHighlight);
-       Standard_EXPORT void DisplayPoints(const Standard_Boolean nearest);
-       Standard_EXPORT void DisplayBoxes(const Standard_Boolean nearest);
-    Standard_EXPORT void HighlightVoxel();
-       
-    Standard_EXPORT void DisplayTriangulation(const Standard_Boolean theHighlight);
-
-       Voxel_VisData* myData;
-};
-
-#endif // _VOXEL_VISDRAWER_H_
diff --git a/samples/qt/VoxelDemo/msvc.bat b/samples/qt/VoxelDemo/msvc.bat
deleted file mode 100644 (file)
index cccdc40..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-@echo off
-
-rem Setup environment
-call "%~dp0..\..\..\env.bat" %1 %2 %3
-
-rem Define path to project file
-set "PRJFILE=%~dp0VoxelDemo-%VCVER%.sln"
-
-set "VisualStudioExpressName=VCExpress"
-
-if "%VCVER%" == "vc8" (
-  set "DevEnvDir=%VS80COMNTOOLS%..\IDE"
-) else if "%VCVER%" == "vc9" (
-  set "DevEnvDir=%VS90COMNTOOLS%..\IDE"
-) else if "%VCVER%" == "vc10" (
-  set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
-) else if "%VCVER%" == "vc11" (
-  set "DevEnvDir=%VS110COMNTOOLS%..\IDE"
-  rem Visual Studio Express starting from VS 2012 is called "for Windows Desktop"
-  rem and has a new name for executable - WDExpress
-  set "VisualStudioExpressName=WDExpress"
-) else if "%VCVER%" == "vc12" (
-  set "DevEnvDir=%VS120COMNTOOLS%..\IDE"
-  set "VisualStudioExpressName=WDExpress"
-) else (
-  echo Error: wrong VS identifier
-  exit /B
-)
-
-rem Launch Visual Studio - either professional (devenv) or Express, as available
-if exist "%DevEnvDir%\devenv.exe"  (
-  start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
-) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe"  (
-  start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
-) else (
-  echo Error: Could not find MS Visual Studio ^(%VCVER%^)
-  echo Check relevant environment variable ^(e.g. VS80COMNTOOLS for vc8^)
-)
diff --git a/samples/qt/VoxelDemo/run.bat b/samples/qt/VoxelDemo/run.bat
deleted file mode 100644 (file)
index 87a3009..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-call "%~dp0..\..\..\env.bat" %1 %2 %3
-
-set "BIN_DIR=win%ARCH%\%VCVER%\bind"
-if ["%CASDEB%"] == [""] (
-  set "BIN_DIR=win%ARCH%\%VCVER%\bin"
-)
-
-if not exist "%~dp0%BIN_DIR%\VoxelDemo.exe" goto ERR_EXE
-
-echo Starting VoxelDemo .....
-"%~dp0%BIN_DIR%\VoxelDemo.exe"
-
-goto END
-
-:ERR_EXE
-echo Executable %~dp0%BIN_DIR%\VoxelDemo.exe not found.
-echo Probably you didn't compile the application.
-pause
-goto END
-
-:END
\ No newline at end of file
diff --git a/samples/qt/VoxelDemo/src/Application.cpp b/samples/qt/VoxelDemo/src/Application.cpp
deleted file mode 100644 (file)
index c7d5896..0000000
+++ /dev/null
@@ -1,2343 +0,0 @@
-#include "Application.h"
-#include "ConversionThread.h"
-#include "Timer.h"
-
-#include <QPixmap.h>
-#include <QToolButton.h>
-#include <QWhatsThis.h>
-#include <QMenu.h>
-#include <QMenuBar.h>
-#include <QStatusBar.h>
-#include <QApplication.h>
-#include <QFileDialog.h>
-#include <QMessageBox.h>
-#include <QInputDialog.h>
-#include <QCloseEvent>
-
-#include <Voxel_BoolDS.hxx>
-#include <Voxel_ColorDS.hxx>
-#include <Voxel_FloatDS.hxx>
-#include <Voxel_OctBoolDS.hxx>
-#include <Voxel_ROctBoolDS.hxx>
-#include <Voxel_BooleanOperation.hxx>
-#include <Voxel_CollisionDetection.hxx>
-#include <Voxel_FastConverter.hxx>
-#include <Voxel_Writer.hxx>
-#include <Voxel_Reader.hxx>
-#include <VoxelClient_VisDrawer.h>
-
-#include <BRepTools.hxx>
-#include <BRepBndLib.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepPrimAPI_MakeBox.hxx>
-#include <BRepPrimAPI_MakeTorus.hxx>
-#include <BRepPrimAPI_MakeSphere.hxx>
-#include <BRepPrimAPI_MakeCylinder.hxx>
-
-#include <Windows.h>
-
-Application::Application()
-    : QMainWindow( 0 )
-{
-    // File
-    QMenu * file = menuBar()->addMenu( "&File" );
-
-    QAction* a;
-    // Box
-    a = new QAction("Box", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(box()));
-    file->addAction(a);
-    // Cylinder
-    a = new QAction("Cylinder", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(cylinder()));
-    file->addAction(a);
-    // Torus
-    a = new QAction("Torus", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(torus()));
-    file->addAction(a);
-    // Sphere
-    a = new QAction("Sphere", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(sphere()));
-    file->addAction(a);
-    // Load shape...
-    a = new QAction("Load shape...", this);
-    a->setShortcut(tr("Ctrl+O"));
-    connect(a, SIGNAL(triggered()), this, SLOT(choose()));
-    file->addAction(a);
-
-    file->addSeparator();
-
-    // Open
-    a = new QAction("Open", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(open()));
-    file->addAction(a);
-
-    // Save
-    a = new QAction("Save", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(save()));
-    file->addAction(a);
-
-    file->addSeparator();
-
-    // Quit
-    a = new QAction("&Quit", this);
-    a->setShortcut(tr("Ctrl+Q"));
-    connect(a, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
-    file->addAction(a);
-
-    menuBar()->addSeparator();
-
-
-#ifdef TEST
-    QMenu * test = menuBar()->addMenu( "Test" );
-
-    a = new QAction("Test boolean", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testBoolDS()));
-    test->addAction(a);
-
-    a = new QAction("Test color", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testColorDS()));
-    test->addAction(a);
-
-    a = new QAction("Test float", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testFloatDS()));
-    test->addAction(a);
-
-    a = new QAction("Test boolean / 8", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testOctBoolDS()));
-    test->addAction(a);
-
-    a = new QAction("Test boolean / 8 / 8..", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testROctBoolDS()));
-    test->addAction(a);
-
-    test->addSeparator();
-
-    a = new QAction("Test fusion of booleans", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testFuseBoolDS()));
-    test->addAction(a);
-
-    a = new QAction("Test fusion of colors", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testFuseColorDS()));
-    test->addAction(a);
-
-    a = new QAction("Test fusion of floating-points", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testFuseFloatDS()));
-    test->addAction(a);
-
-    a = new QAction("Test cutting of booleans", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testCutBoolDS()));
-    test->addAction(a);
-
-    a = new QAction("Test cutting of booleans", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testCutColorDS()));
-    test->addAction(a);
-
-    a = new QAction("Test cutting of floating-points", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(testCutFloatDS()));
-    test->addAction(a);
-
-#endif // TEST
-
-    QMenu * converter = menuBar()->addMenu( "Converter" );
-
-#ifdef TEST
-    
-    a = new QAction("Number of splits along X", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setNbX()));
-    converter->addAction(a);
-
-    a = new QAction("Number of splits along Y", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setNbY()));
-    converter->addAction(a);
-
-    a = new QAction("Number of splits along Z", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setNbZ()));
-    converter->addAction(a);
-
-    converter->addSeparator();
-
-    a = new QAction("Side of scanning", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setScanSide()));
-    converter->addAction(a);
-
-    converter->addSeparator();
-
-    a = new QAction("Volumic value of 1bit voxels", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setVolumicBoolValue()));
-    converter->addAction(a);
-    
-    a = new QAction("Volumic value of 4bit voxels", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setVolumicColorValue()));
-    converter->addAction(a);
-
-    converter->addSeparator();
-
-#endif // TEST
-
-    a = new QAction("Convert to 1bit voxels", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(convert2bool()));
-    converter->addAction(a);
-
-    a = new QAction("Convert to 4bit voxels", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(convert2color()));
-    converter->addAction(a);
-
-    QMenu * vis = menuBar()->addMenu( "&Visualization" );
-
-    a = new QAction("Points", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayPoints()));
-    vis->addAction(a);
-
-#ifdef TEST
-    
-    a = new QAction("Nearest points", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayNearestPoints()));
-    vis->addAction(a);
-
-#endif // TEST
-
-    a = new QAction("Boxes", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayBoxes()));
-    vis->addAction(a);
-
-#ifdef TEST
-
-    a = new QAction("Nearest boxes", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayNearestBoxes()));
-    vis->addAction(a);
-
-#endif // TEST
-    
-    vis->addSeparator();
-
-    a = new QAction("Point size", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setPointSize()));
-    vis->addAction(a);
-    
-    a = new QAction("Quadrangle size (%)", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setQuadrangleSize()));
-    vis->addAction(a);
-
-    vis->addSeparator();
-
-    a = new QAction("Color min value", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setColorMinValue()));
-    vis->addAction(a);
-
-    a = new QAction("Color max value", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setColorMaxValue()));
-    vis->addAction(a);
-
-#ifdef TEST
-
-    vis->addSeparator();
-
-    a = new QAction("Use GL lists", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setUsageOfGLlists()));
-    vis->addAction(a);
-
-#endif // TEST
-
-    vis->addSeparator();
-
-    a = new QAction("Displayed X min", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setDisplayedXMin()));
-    vis->addAction(a);
-
-    a = new QAction("Displayed X max", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setDisplayedXMax()));
-    vis->addAction(a);
-
-    a = new QAction("Displayed Y min", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setDisplayedYMin()));
-    vis->addAction(a);
-
-    a = new QAction("Displayed Y max", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setDisplayedYMax()));
-    vis->addAction(a);
-
-    a = new QAction("Displayed Z min", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setDisplayedZMin()));
-    vis->addAction(a);
-
-    a = new QAction("Displayed Z max", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(setDisplayedZMax()));
-    vis->addAction(a);
-
-
-    QMenu * demo = menuBar()->addMenu( "Demo" );
-
-    a = new QAction("Waves", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayWaves()));
-    demo->addAction(a);
-
-    a = new QAction("Cut", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayCut()));
-    demo->addAction(a);
-
-    a = new QAction("Collisions", this);
-    connect(a, SIGNAL(triggered()), this, SLOT(displayCollisions()));
-    demo->addAction(a);
-
-
-    QMenu * help = menuBar()->addMenu( "Help" );
-
-    a = new QAction("About", this);
-    a->setShortcut(tr("F1"));
-    connect(a, SIGNAL(triggered()), this, SLOT(about()));
-    help->addAction(a);
-
-
-    myViewer = new Viewer( this );
-    myViewer->setFocus();
-    setCentralWidget( myViewer );
-    statusBar()->showMessage( "Ready", 2000 );
-
-       myNbX = 100;
-       myNbY = 100;
-       myNbZ = 100;
-
-    myScanSide = 7;
-
-    myVolumicBoolValue = false;
-    myVolumicColorValue = 0;
-
-    myQuadrangleSize = 40;
-    
-    myColorMinValue = 1;
-    myColorMaxValue = 15;
-
-       myBoolVoxels = 0;
-       myColorVoxels = 0;
-  myColorScale = new AIS_ColorScale;
-  myColorScale->SetZLayer (Graphic3d_ZLayerId_TopOSD);
-  myColorScale->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
-
-
-    myDisplayedXMin = -DBL_MAX;
-    myDisplayedXMax =  DBL_MAX;
-    myDisplayedYMin = -DBL_MAX;
-    myDisplayedYMax =  DBL_MAX;
-    myDisplayedZMin = -DBL_MAX;
-    myDisplayedZMax =  DBL_MAX;
-
-    resize( 450, 600 );
-
-    myViewer->getIC()->SetAutoActivateSelection (Standard_False);
-}
-
-Application::~Application()
-{
-       if (myBoolVoxels)
-               delete myBoolVoxels;
-       if (myColorVoxels)
-               delete myColorVoxels;
-}
-
-void Application::choose()
-{
-    QString fn = QFileDialog::getOpenFileName( this, QString::null, QString::null, "*.brep");
-    if ( !fn.isEmpty() )
-               load( fn );
-    else
-               statusBar()->showMessage( "Loading aborted", 2000 );
-}
-
-void Application::load( const QString &fileName )
-{
-    QFile f( fileName );
-    if ( !f.open( QIODevice::ReadOnly ) )
-               return;
-
-    // Read shape
-       TopoDS_Shape S;
-       BRep_Builder B;
-       if (!BRepTools::Read(S, (char*) fileName.constData(), B))
-               statusBar()->showMessage( "Loading failed", 2000 );
-    
-    load(S);
-}
-
-void Application::open()
-{
-    QString fn = QFileDialog::getOpenFileName( this, QString::null, QString::null, "*.vx");
-    if ( fn.isEmpty() || !QFile::exists(fn) )
-    {
-               statusBar()->showMessage( "Open aborted", 2000 );
-        return;
-    }
-
-    Timer timer;
-    timer.Start();
-
-    // Read the voxels
-    Voxel_Reader reader;
-    if (!reader.Read((char*)fn.constData()))
-    {
-               statusBar()->showMessage( "Open failed... sorry", 2000 );
-        return;
-    }
-
-    timer.Stop();
-    timer.Print("Open");
-
-    // Release current voxels
-    if (myBoolVoxels)
-    {
-        delete myBoolVoxels;
-        myBoolVoxels = 0;
-    }
-    if (myColorVoxels)
-    {
-        delete myColorVoxels;
-        myColorVoxels = 0;
-    }
-
-    // Take the voxels
-    if (reader.IsBoolVoxels())
-    {
-        myBoolVoxels = (Voxel_BoolDS*) reader.GetBoolVoxels();
-        myViewer->getSelector().SetVoxels(*myBoolVoxels);
-    }
-    else if (reader.IsColorVoxels())
-    {
-        myColorVoxels = (Voxel_ColorDS*) reader.GetColorVoxels();
-        myViewer->getSelector().SetVoxels(*myColorVoxels);
-    }
-    
-    // Display the voxels
-    myViewer->getIC()->EraseAll(false);
-    Voxel_DS* ds = myBoolVoxels;
-    if (!ds)
-        ds = myColorVoxels;
-    if (ds)
-    {
-        myDisplayedXMin = ds->GetX() - 10.0 * Precision::Confusion();
-        myDisplayedXMax = ds->GetX() + ds->GetXLen() + 10.0 * Precision::Confusion();
-        myDisplayedYMin = ds->GetY() - 10.0 * Precision::Confusion();
-        myDisplayedYMax = ds->GetY() + ds->GetYLen() + 10.0 * Precision::Confusion();
-        myDisplayedZMin = ds->GetZ() - 10.0 * Precision::Confusion();
-        myDisplayedZMax = ds->GetZ() + ds->GetZLen() + 10.0 * Precision::Confusion();
-    }
-
-    // Init visual data
-    initPrs();
-
-    // Set voxels and display
-    Handle(Poly_Triangulation) empty;
-    myVoxels->SetBoolVoxels(myBoolVoxels);
-       myVoxels->SetColorVoxels(myColorVoxels);
-    myVoxels->SetTriangulation(empty);
-    if (myViewer->getIC()->IsDisplayed(myVoxels))
-        myViewer->getIC()->Redisplay(myVoxels, false);
-    else
-           myViewer->getIC()->Display(myVoxels, false);
-   
-    // Color scale
-    if (myColorVoxels)
-        displayColorScale();
-    else
-      myViewer->getIC()->Erase(myColorScale);
-
-       myViewer->getView()->FitAll();
-
-    statusBar()->showMessage( "Ready.", 2000 );
-}
-
-void Application::save()
-{
-    QString fn = QFileDialog::getSaveFileName( this, QString::null, QString::null, "*.vx");
-    if ( fn.isEmpty() )
-    {
-               statusBar()->showMessage( "Storage aborted", 2000 );
-        return;
-    }
-    if (fn.indexOf(".vx", -1, Qt::CaseInsensitive) == -1)
-        fn += ".vx";
-
-    Timer timer;
-    timer.Start();
-
-    // Write the voxels
-    Voxel_Writer writer;
-    writer.SetFormat(Voxel_VFF_BINARY);
-    if (myBoolVoxels)
-        writer.SetVoxels(*myBoolVoxels);
-    else if (myColorVoxels)
-        writer.SetVoxels(*myColorVoxels);
-    else
-    {
-               statusBar()->showMessage( "Nothing to store", 2000 );
-        return;
-    }
-    if (!writer.Write((char*)fn.constData()))
-    {
-               statusBar()->showMessage( "Storage failed... sorry", 2000 );
-        return;
-    }
-
-    timer.Stop();
-    timer.Print("Save");
-
-    statusBar()->showMessage( "Saved.", 2000 );
-}
-
-void Application::closeEvent( QCloseEvent* ce )
-{
-    ce->accept();
-}
-
-void Application::about()
-{
-    QMessageBox::about( this, "Voxel demo-application",
-                       "This example demonstrates simple usage of "
-                       "voxel models of Open CASCADE.");
-}
-
-void Application::testBoolDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. BoolDS:
-
-       timer.Start();
-
-       Voxel_BoolDS ds(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds.Set(ix, iy, iz, false);
-                               else
-                                       ds.Set(ix, iy, iz, true);
-                       }
-               }
-       }
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               bool value = ds.Get(ix, iy, iz) == Standard_True;
-                               if (ix & 0x01)
-                               {
-                                       if (value != false)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                                       if (value != true)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("BoolDS");
-}
-
-void Application::testColorDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. ColorDS:
-
-       timer.Start();
-
-       Voxel_ColorDS ds(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                if (ix & 0x01)
-                           ds.Set(ix, iy, iz, 8);
-                else
-                    ds.Set(ix, iy, iz, 7);
-                       }
-               }
-       }
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               unsigned char value = ds.Get(ix, iy, iz);
-                if (ix & 0x01)
-                {
-                                   if (value != 8)
-                                           cout<<"Wrong value!"<<endl;
-                }
-                else
-                {
-                                   if (value != 7)
-                                           cout<<"Wrong value!"<<endl;
-                }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("ColorDS");
-}
-
-void Application::testFloatDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. FloatDS:
-
-       timer.Start();
-
-       Voxel_FloatDS ds(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                if (ix & 0x01)
-                           ds.Set(ix, iy, iz, 8.8f);
-                else
-                    ds.Set(ix, iy, iz, 7.7f);
-                       }
-               }
-       }
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               float value = ds.Get(ix, iy, iz);
-                if (ix & 0x01)
-                {
-                                   if (value != 8.8f)
-                                           cout<<"Wrong value!"<<endl;
-                }
-                else
-                {
-                                   if (value != 7.7f)
-                                           cout<<"Wrong value!"<<endl;
-                }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("FloatDS");
-}
-
-void Application::testOctBoolDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 30, nby = 30, nbz = 30;
-
-
-       // 1. OctBoolDS:
-
-       timer.Start();
-
-       Voxel_OctBoolDS ds(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                {
-                                       ds.Set(ix, iy, iz, true);
-                }
-                               else
-                {
-                    for (int i = 0; i < 8; i++)
-                    {
-                        if (i & 0x01)
-                                               ds.Set(ix, iy, iz, i, true);
-                        else
-                            ds.Set(ix, iy, iz, i, false);
-                    }
-                }
-                       }
-               }
-       }
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                               {
-                               bool value = ds.Get(ix, iy, iz) == Standard_True;
-                                       if (value != true)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                    for (int i = 0; i < 8; i++)
-                    {
-                        if (i & 0x01)
-                        {
-                                       bool value = ds.Get(ix, iy, iz, i) == Standard_True;
-                                               if (value != true)
-                                                       cout<<"Wrong value!"<<endl;
-                        }
-                        else
-                        {
-                                       bool value = ds.Get(ix, iy, iz, i) == Standard_True;
-                                               if (value != false)
-                                                       cout<<"Wrong value!"<<endl;
-                        }
-                    }
-                               }
-                       }
-               }
-       }
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                               {
-                    for (int i = 0; i < 8; i++)
-                    {
-                        ds.Set(ix, iy, iz, i, true);
-                    }
-                               }
-                else
-                {
-                    for (int i = 0; i < 8; i++)
-                    {
-                        ds.Set(ix, iy, iz, i, false);
-                    }
-                }
-                       }
-               }
-       }
-
-    ds.OptimizeMemory();
-
-       timer.Stop();
-       timer.Print("OctBoolDS");
-}
-
-void Application::testROctBoolDS()
-{
-       Timer timer;
-       int ix, iy, iz, i, j;
-       int nbx = 30, nby = 30, nbz = 30;
-
-       // 1. ROctBoolDS:
-
-       timer.Start();
-
-       Voxel_ROctBoolDS ds(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-    for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                ds.Set(ix, iy, iz, true);
-                       }
-               }
-       }
-
-    for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                for (i = 0; i < 8; i++)
-                {
-                    for (j = 0; j < 8; j++)
-                    {
-                        ds.Set(ix, iy, iz, i, j, true);
-                    }
-                }
-                       }
-               }
-       }
-
-    ds.OptimizeMemory();
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                if (ds.Deepness(ix, iy, iz) == 0)
-                {
-                    bool value = ds.Get(ix, iy, iz);
-                    if (value != true)
-                        cout<<"Wrong value..."<<endl;
-                }
-                if (ds.Deepness(ix, iy, iz) == 1)
-                {
-                    for (i = 0; i < 8; i++)
-                    {
-                        bool value = ds.Get(ix, iy, iz, i);
-                        if (value != true)
-                            cout<<"Wrong value..."<<endl;
-                    }
-                }
-                if (ds.Deepness(ix, iy, iz) == 2)
-                {
-                    for (i = 0; i < 8; i++)
-                    {
-                        for (j = 0; j < 8; j++)
-                        {
-                            bool value = ds.Get(ix, iy, iz, i, j);
-                            if (value != true)
-                                cout<<"Wrong value..."<<endl;
-                        }
-                    }
-                }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("ROctBoolDS");
-
-
-    // Test converter
-    TopoDS_Shape S = BRepPrimAPI_MakeSphere(100.0);
-
-    timer.Start();
-
-    int progress = 0;
-    Voxel_ROctBoolDS* ds2 = new Voxel_ROctBoolDS;
-    Voxel_FastConverter converter(S, *ds2, 0.1, myNbX, myNbY, myNbZ, 1);
-    converter.Convert(progress);
-    ds2->OptimizeMemory();
-
-       timer.Stop();
-       timer.Print("ROctBoolDS::converter");
-
-
-    // Display 
-    myViewer->getIC()->EraseAll(false);
-    initPrs();
-    myVoxels->SetBoolVoxels(0);
-       myVoxels->SetColorVoxels(0);
-    Handle(Poly_Triangulation) empty;
-    myVoxels->SetTriangulation(empty);
-    myVoxels->SetROctBoolVoxels(ds2);
-    myViewer->getIC()->Display(myVoxels, false);
-    myViewer->getIC()->Erase(myColorScale);
-       myViewer->getView()->FitAll();
-    myViewer->getSelector().SetVoxels(*ds2);
-}
-
-void Application::testFuseBoolDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. Set two BoolDS:
-
-       timer.Start();
-
-       Voxel_BoolDS ds1(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-       Voxel_BoolDS ds2(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds2.Set(ix, iy, iz, false);
-                               else
-                                       ds2.Set(ix, iy, iz, true);
-                       }
-               }
-       }
-
-    // 2. Fuse them
-
-    Voxel_BooleanOperation fuser;
-    if (!fuser.Fuse(ds1, ds2))
-        cout<<"The operation failed..."<<endl;
-
-    // 3. Check result
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               bool value = ds1.Get(ix, iy, iz) == Standard_True;
-                               if (ix & 0x01)
-                               {
-                                       if (value != false)
-                                       cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                                       if (value != true)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("Fusion of BoolDS");
-}
-
-void Application::testFuseColorDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. Set two ColorDS:
-
-       timer.Start();
-
-       Voxel_ColorDS ds1(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-       Voxel_ColorDS ds2(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               ds1.Set(ix, iy, iz, 11);
-                       }
-               }
-       }
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds2.Set(ix, iy, iz, 3);
-                               else
-                                       ds2.Set(ix, iy, iz, 5);
-                       }
-               }
-       }
-
-    // 2. Fuse them
-
-    Voxel_BooleanOperation fuser;
-    if (!fuser.Fuse(ds1, ds2))
-        cout<<"The operation failed..."<<endl;
-
-    // 3. Check result
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               unsigned char value = ds1.Get(ix, iy, iz);
-                               if (ix & 0x01)
-                               {
-                                       if (value != 14)
-                                       cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                                       if (value != 15)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("Fusion of ColorDS");
-}
-
-void Application::testFuseFloatDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. Set two FloatDS:
-
-       timer.Start();
-
-       Voxel_FloatDS ds1(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-       Voxel_FloatDS ds2(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               ds1.Set(ix, iy, iz, 11.1f);
-                       }
-               }
-       }
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds2.Set(ix, iy, iz, 3.3f);
-                               else
-                                       ds2.Set(ix, iy, iz, 5.5f);
-                       }
-               }
-       }
-
-    // 2. Fuse them
-
-    Voxel_BooleanOperation fuser;
-    if (!fuser.Fuse(ds1, ds2))
-        cout<<"The operation failed..."<<endl;
-
-    // 3. Check result
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               float value = ds1.Get(ix, iy, iz);
-                               if (ix & 0x01)
-                               {
-                    if (fabs(value - 14.4f) > 0.001)
-                                       cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                    if (fabs(value - 16.6f) > 0.001)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("Fusion of FloatDS");
-}
-
-void Application::testCutBoolDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. Set two BoolDS:
-
-       timer.Start();
-
-       Voxel_BoolDS ds1(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-       Voxel_BoolDS ds2(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               ds1.Set(ix, iy, iz, true);
-                       }
-               }
-       }
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds2.Set(ix, iy, iz, false);
-                               else
-                                       ds2.Set(ix, iy, iz, true);
-                       }
-               }
-       }
-
-    // 2. Cut them
-
-    Voxel_BooleanOperation cutter;
-    if (!cutter.Cut(ds1, ds2))
-        cout<<"The operation failed..."<<endl;
-
-    // 3. Check result
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               bool value = ds1.Get(ix, iy, iz) == Standard_True;
-                               if (ix & 0x01)
-                               {
-                                       if (value != true)
-                                       cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                                       if (value != false)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("Cut of BoolDS");
-}
-
-void Application::testCutColorDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. Set two ColorDS:
-
-       timer.Start();
-
-       Voxel_ColorDS ds1(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-       Voxel_ColorDS ds2(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               ds1.Set(ix, iy, iz, 11);
-                       }
-               }
-       }
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds2.Set(ix, iy, iz, 3);
-                               else
-                                       ds2.Set(ix, iy, iz, 5);
-                       }
-               }
-       }
-
-    // 2. Cut them
-
-    Voxel_BooleanOperation cutter;
-    if (!cutter.Cut(ds1, ds2))
-        cout<<"The operation failed..."<<endl;
-
-    // 3. Check result
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               unsigned char value = ds1.Get(ix, iy, iz);
-                               if (ix & 0x01)
-                               {
-                                       if (value != 8)
-                                       cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                                       if (value != 6)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("Cut of ColorDS");
-}
-
-void Application::testCutFloatDS()
-{
-       Timer timer;
-       int ix, iy, iz;
-       int nbx = 100, nby = 100, nbz = 100;
-
-
-       // 1. Set two FloatDS:
-
-       timer.Start();
-
-       Voxel_FloatDS ds1(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-       Voxel_FloatDS ds2(0, 0, 0, 1, 1, 1, nbx, nby, nbz);
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               ds1.Set(ix, iy, iz, 11.1f);
-                       }
-               }
-       }
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               if (ix & 0x01)
-                                       ds2.Set(ix, iy, iz, 3.3f);
-                               else
-                                       ds2.Set(ix, iy, iz, 5.5f);
-                       }
-               }
-       }
-
-    // 2. Cut them
-
-    Voxel_BooleanOperation cutter;
-    if (!cutter.Cut(ds1, ds2))
-        cout<<"The operation failed..."<<endl;
-
-    // 3. Check result
-
-       for (ix = 0; ix < nbx; ix++)
-       {
-               for (iy = 0; iy < nby; iy++)
-               {
-                       for (iz = 0; iz < nbz; iz++)
-                       {
-                               float value = ds1.Get(ix, iy, iz);
-                               if (ix & 0x01)
-                               {
-                    if (fabs(value - 7.8f) > 0.001)
-                                       cout<<"Wrong value!"<<endl;
-                               }
-                               else
-                               {
-                    if (fabs(value - 5.6f) > 0.001)
-                                               cout<<"Wrong value!"<<endl;
-                               }
-                       }
-               }
-       }
-
-       timer.Stop();
-       timer.Print("Cut of FloatDS");
-}
-
-void Application::convert2bool()
-{
-    convert(0);
-}
-
-void Application::convert2color()
-{
-    convert(1);
-}
-
-void Application::convert(const int ivoxel)
-{
-       TopoDS_Shape S;
-       if (!myShape.IsNull())
-               S = myShape->Shape();
-    if (S.IsNull())
-       {
-               QMessageBox::warning( this, "Voxel demo-application", "No shape for conversion!");
-               return;
-       }
-
-    switch (ivoxel)
-    {
-        case 0:
-        {
-               if (!myBoolVoxels)
-                       myBoolVoxels = new Voxel_BoolDS;
-            if (myColorVoxels)
-            {
-                delete myColorVoxels;
-                myColorVoxels = 0;
-            }
-            break;
-        }
-        case 1:
-        {
-               if (!myColorVoxels)
-                       myColorVoxels = new Voxel_ColorDS;
-            if (myBoolVoxels)
-            {
-                delete myBoolVoxels;
-                myBoolVoxels = 0;
-            }
-            break;
-        }
-    }
-
-    switch (ivoxel)
-    {
-        case 0:
-        {
-            Timer timer;
-            timer.Start();
-
-            /*
-            int progress;
-            Voxel_Converter converter(S, *myBoolVoxels, myNbX, myNbY, myNbZ);
-               if (!converter.Convert(progress, myVolumicBoolValue, myScanSide))
-               {
-                       QMessageBox::warning( this, "Voxel demo-application", "Conversion failed...");
-                       return;
-               }
-            */
-
-            /*
-            Voxel_Converter converter(S, *myBoolVoxels, myNbX, myNbY, myNbZ, 2);
-            ConversionThread thread1, thread2;
-            
-            thread1.setConverter(&converter);
-            thread2.setConverter(&converter);
-
-            thread1.setVolumicValue(myVolumicBoolValue);
-            thread2.setVolumicValue(myVolumicBoolValue);
-
-            thread1.setScanSide(myScanSide);
-            thread2.setScanSide(myScanSide);
-
-            thread1.setThreadIndex(1);
-            thread2.setThreadIndex(2);
-
-            thread1.start();
-            thread2.start();
-
-            while (thread1.running() || thread2.running())
-            {
-                ::Sleep(100);
-            }
-            */
-
-            /*
-            int progress;
-            Voxel_FastConverter converter(S, *myBoolVoxels, 0.1, myNbX, myNbY, myNbZ, 1);
-            converter.Convert(progress, 1);
-            //if (myVolumicBoolValue)
-            //    converter.FillInVolume(myVolumicBoolValue);
-            */
-
-            Voxel_FastConverter converter(S, *myBoolVoxels, 0.1, myNbX, myNbY, myNbZ, 2);
-            ConversionThread thread1, thread2;
-            
-            thread1.setConverter(&converter);
-            thread2.setConverter(&converter);
-
-            thread1.setThreadIndex(1);
-            thread2.setThreadIndex(2);
-
-            thread1.start();
-            thread2.start();
-
-            while (thread1.isRunning() || thread2.isRunning())
-            {
-                ::Sleep(100);
-            }
-
-            timer.Print("Converter");
-
-            myViewer->getSelector().SetVoxels(*myBoolVoxels);
-            break;
-        }
-        case 1:
-        {
-
-            Timer timer;
-            timer.Start();
-
-            /*
-            int progress;
-            Voxel_Converter converter(S, *myColorVoxels, myNbX, myNbY, myNbZ);
-               if (!converter.Convert(progress, myVolumicColorValue, myScanSide))
-               {
-                       QMessageBox::warning( this, "Voxel demo-application", "Conversion failed...");
-                       return;
-               }
-            */
-
-            /*
-            Voxel_Converter converter(S, *myColorVoxels, myNbX, myNbY, myNbZ, 2);
-            ConversionThread thread1, thread2;
-            
-            thread1.setConverter(&converter);
-            thread2.setConverter(&converter);
-
-            thread1.setVolumicValue(myVolumicColorValue);
-            thread2.setVolumicValue(myVolumicColorValue);
-
-            thread1.setScanSide(myScanSide);
-            thread2.setScanSide(myScanSide);
-
-            thread1.setThreadIndex(1);
-            thread2.setThreadIndex(2);
-
-            thread1.start();
-            thread2.start();
-
-            while (thread1.running() || thread2.running())
-            {
-                ::Sleep(100);
-            }
-            */
-
-            /*
-            int progress;
-            Voxel_FastConverter converter(S, *myColorVoxels, myNbX, myNbY, myNbZ, 1);
-            converter.Convert(progress, 1);
-            if (myVolumicColorValue)
-                converter.FillInVolume(myVolumicColorValue);
-            */
-
-            Voxel_FastConverter converter(S, *myColorVoxels, 0.1, myNbX, myNbY, myNbZ, 2);
-            ConversionThread thread1, thread2;
-            
-            thread1.setConverter(&converter);
-            thread2.setConverter(&converter);
-
-            thread1.setThreadIndex(1);
-            thread2.setThreadIndex(2);
-
-            thread1.start();
-            thread2.start();
-
-            while (thread1.isRunning() || thread2.isRunning())
-            {
-                ::Sleep(100);
-            }
-
-            timer.Print("Converter");
-
-
-            // Set color for demonstration
-            double maxd = 
-                fabs(myColorVoxels->GetX()) > fabs(myColorVoxels->GetY()) ? 
-                fabs(myColorVoxels->GetX()) : fabs(myColorVoxels->GetY());
-            maxd = maxd > fabs(myColorVoxels->GetZ()) ? maxd : fabs(myColorVoxels->GetZ());
-            maxd = maxd > fabs(myColorVoxels->GetX() + myColorVoxels->GetXLen()) ?
-                maxd : fabs(myColorVoxels->GetX() + myColorVoxels->GetXLen());
-            maxd = maxd > fabs(myColorVoxels->GetY() + myColorVoxels->GetYLen()) ?
-                maxd : fabs(myColorVoxels->GetY() + myColorVoxels->GetYLen());
-            maxd = maxd > fabs(myColorVoxels->GetZ() + myColorVoxels->GetZLen()) ?
-                maxd : fabs(myColorVoxels->GetZ() + myColorVoxels->GetZLen());
-            for (int ix = 0; ix < myNbX; ix++)
-            {
-                for (int iy = 0; iy < myNbY; iy++)
-                {
-                    for (int iz = 0; iz < myNbZ; iz++)
-                    {
-                        unsigned char value = myColorVoxels->Get(ix, iy, iz);
-                        if (value)
-                        {
-                            double xc, yc, zc, xd, yd, zd;
-                            myColorVoxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            xd = fabs(xc);
-                            yd = fabs(yc);
-                            zd = fabs(zc);
-                            double mind = xd < yd ? xd : yd;
-                            mind = zd < mind ? zd : mind;
-                            value = unsigned char(15.0 * (maxd - mind) / maxd);
-                            if (value <= 0)
-                                value = 1;
-                            myColorVoxels->Set(ix, iy, iz, value);
-                        }
-                    }
-                }
-            }
-
-            myViewer->getSelector().SetVoxels(*myColorVoxels);
-            break;
-        }
-    }
-
-    myViewer->getIC()->EraseAll(false);
-
-    Voxel_DS* ds = myBoolVoxels;
-    if (!ds)
-        ds = myColorVoxels;
-    if (ds)
-    {
-        myDisplayedXMin = ds->GetX() - 10.0 * Precision::Confusion();
-        myDisplayedXMax = ds->GetX() + ds->GetXLen() + 10.0 * Precision::Confusion();
-        myDisplayedYMin = ds->GetY() - 10.0 * Precision::Confusion();
-        myDisplayedYMax = ds->GetY() + ds->GetYLen() + 10.0 * Precision::Confusion();
-        myDisplayedZMin = ds->GetZ() - 10.0 * Precision::Confusion();
-        myDisplayedZMax = ds->GetZ() + ds->GetZLen() + 10.0 * Precision::Confusion();
-    }
-
-    // Init visual data
-    initPrs();
-
-    // Set voxels and display
-    Handle(Poly_Triangulation) empty;
-    myVoxels->SetBoolVoxels(myBoolVoxels);
-       myVoxels->SetColorVoxels(myColorVoxels);
-    myVoxels->SetTriangulation(empty);
-    if (myViewer->getIC()->IsDisplayed(myVoxels))
-        myViewer->getIC()->Redisplay(myVoxels, false);
-    else
-           myViewer->getIC()->Display(myVoxels, false);
-    
-    // Color scale
-    if (myColorVoxels)
-        displayColorScale();
-    else
-      myViewer->getIC()->Erase(myColorScale);
-
-       myViewer->getView()->FitAll();
-}
-
-void Application::setNbX()
-{
-       bool ok;
-       myNbX = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Number of splits in X-direction:", myNbX,
-                                                                                                                1, 100000, 1, &ok);
-}
-
-void Application::setNbY()
-{
-       bool ok;
-       myNbY = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Number of splits in X-direction:", myNbY,
-                                                                                                                1, 100000, 1, &ok);
-}
-
-void Application::setNbZ()
-{
-       bool ok;
-       myNbZ = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Number of splits in X-direction:", myNbZ,
-                                                                                                                1, 100000, 1, &ok);
-}
-
-void Application::setColorMinValue()
-{
-       bool ok;
-       myColorMinValue = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Minimum value for color [0 .. 15]:", myColorMinValue,
-                                                                0, 15, 1, &ok);
-    if (!myVoxels.IsNull())
-        myVoxels->SetColorRange(myColorMinValue, myColorMaxValue);
-}
-
-void Application::setColorMaxValue()
-{
-       bool ok;
-       myColorMaxValue = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Maximum value for color [0 .. 15]:", myColorMaxValue,
-                                                                0, 15, 1, &ok);
-    if (!myVoxels.IsNull())
-        myVoxels->SetColorRange(myColorMinValue, myColorMaxValue);
-}
-
-void Application::setUsageOfGLlists()
-{
-    int res = QMessageBox::question( this, "Voxel demo-application", "Press Yes to use GL lists and No not to use them.", QMessageBox::Yes, QMessageBox::No);
-    if (!myVoxels.IsNull())
-        myVoxels->SetUsageOfGLlists(res == QMessageBox::Yes);
-}
-
-void Application::setDisplayedXMin()
-{
-       myDisplayedXMin = QInputDialog::getDouble(this, "Voxel demo-application", "Minimum X value:", myDisplayedXMin);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetSizeRange(myDisplayedXMin, myDisplayedXMax,
-                               myDisplayedYMin, myDisplayedYMax,
-                               myDisplayedZMin, myDisplayedZMax);
-    }
-}
-
-void Application::setDisplayedXMax()
-{
-       myDisplayedXMax = QInputDialog::getDouble(this, "Voxel demo-application", "Maximum X value:", myDisplayedXMax);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetSizeRange(myDisplayedXMin, myDisplayedXMax,
-                               myDisplayedYMin, myDisplayedYMax,
-                               myDisplayedZMin, myDisplayedZMax);
-    }
-}
-
-void Application::setDisplayedYMin()
-{
-       myDisplayedYMin = QInputDialog::getDouble(this, "Voxel demo-application", "Minimum Y value:", myDisplayedYMin);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetSizeRange(myDisplayedXMin, myDisplayedXMax,
-                               myDisplayedYMin, myDisplayedYMax,
-                               myDisplayedZMin, myDisplayedZMax);
-    }
-}
-
-void Application::setDisplayedYMax()
-{
-       myDisplayedYMax = QInputDialog::getDouble(this, "Voxel demo-application", "Maximum Y value:", myDisplayedYMax);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetSizeRange(myDisplayedXMin, myDisplayedXMax,
-                               myDisplayedYMin, myDisplayedYMax,
-                               myDisplayedZMin, myDisplayedZMax);
-    }
-}
-
-void Application::setDisplayedZMin()
-{
-       myDisplayedZMin = QInputDialog::getDouble(this, "Voxel demo-application", "Minimum Z value:", myDisplayedZMin);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetSizeRange(myDisplayedXMin, myDisplayedXMax,
-                               myDisplayedYMin, myDisplayedYMax,
-                               myDisplayedZMin, myDisplayedZMax);
-    }
-}
-
-void Application::setDisplayedZMax()
-{
-       myDisplayedZMax = QInputDialog::getDouble(this, "Voxel demo-application", "Maximum Z value:", myDisplayedZMax);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetSizeRange(myDisplayedXMin, myDisplayedXMax,
-                               myDisplayedYMin, myDisplayedYMax,
-                               myDisplayedZMin, myDisplayedZMax);
-    }
-}
-
-void Application::setScanSide()
-{
-       myScanSide = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Side of scanning (1: +X side, 2: +Y side, 3: +Z side, 4: +X & +Y sides, .. 7: +X, +Y,& +Z sides):", 
-                                 myScanSide, 1, 7, 1);
-}
-
-void Application::setVolumicBoolValue()
-{
-       myVolumicBoolValue = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Volumic value on voxelization [0 .. 1]:", 
-                                 myVolumicBoolValue, 0, 1, 1);
-}
-
-void Application::setVolumicColorValue()
-{
-       myVolumicColorValue = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Volumic value on voxelization [0 .. 15]:", 
-                                 myVolumicColorValue, 0, 15, 1);
-}
-
-void Application::setQuadrangleSize()
-{
-       myQuadrangleSize = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Size of quadrangles (0% .. 100%):", 
-                                 myQuadrangleSize, 1, 100, 10);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetQuadrangleSize(myQuadrangleSize);
-    }
-}
-
-void Application::setPointSize()
-{
-       myPointSize = 
-               QInputDialog::getInteger(this, "Voxel demo-application", "Size of points (1 .. 10):", 
-                                 myPointSize, 1, 10, 1);
-    if (!myVoxels.IsNull())
-    {
-        myVoxels->SetPointSize(myPointSize);
-    }
-}
-
-void Application::display(Voxel_VoxelDisplayMode mode)
-{
-    if (myVoxels.IsNull() || !myViewer->getIC()->IsDisplayed(myVoxels))
-    {
-               QMessageBox::warning( this, "Voxel demo-application", "Voxels are not displayed");
-               return;
-       }
-
-    myVoxels->SetDisplayMode(mode);
-
-    if (myColorVoxels)
-        displayColorScale();
-    else
-        myViewer->getIC()->Erase(myColorScale);
-
-    myViewer->getIC()->Redisplay(myVoxels, true);
-}
-
-void Application::displayPoints()
-{
-    display(Voxel_VDM_POINTS);
-}
-
-void Application::displayNearestPoints()
-{
-    display(Voxel_VDM_NEARESTPOINTS);
-}
-
-void Application::displayBoxes()
-{
-    display(Voxel_VDM_BOXES);
-}
-
-void Application::displayNearestBoxes()
-{
-    display(Voxel_VDM_NEARESTBOXES);
-}
-
-void Application::displayColorScale()
-{
-  if (myColorScale.IsNull())
-  {
-    myColorScale = new AIS_ColorScale;
-  }
-       if (!myColorScale.IsNull())
-       {
-        int nb_colors = 1<<4 /* 4 bits */;
-        myColorScale->SetRange(0, nb_colors - 1);
-        myColorScale->SetNumberOfIntervals(nb_colors);
-               myColorScale->SetPosition(0.01, 0.5 - 0.01);
-               myColorScale->SetSize(0.5 - 0.01, 0.5 - 0.01);
-       }
-  myViewer->getIC()->Display(myColorScale);
-}
-
-void Application::displayWaves()
-{
-    myViewer->getIC()->EraseAll(false);
-
-    // Make voxels
-    if (myBoolVoxels)
-    {
-        delete myBoolVoxels;
-        myBoolVoxels = 0;
-    }
-    if (myColorVoxels)
-        delete myColorVoxels;
-
-    int nbx = 500, nby = 50, nbz = 50;
-    double xlen = 100.0, ylen = 100.0, zlen = 20.0;
-    double dx = xlen / (double) nbx, dy = ylen / (double) nby, dz = zlen / (double) nbz;
-    myColorVoxels = new Voxel_ColorDS(0.0, 0.0, 0.0, xlen, ylen, zlen, nbx, nby, nbz);
-
-    // Initial state - no colors
-    int ix, iy, iz;
-    for (ix = 0; ix < nbx; ix++)
-    {
-        for (iy = 0; iy < nby; iy++)
-        {
-            for (iz = 0; iz < nbz; iz++)
-            {
-                myColorVoxels->Set(ix, iy, iz, 0);
-            }
-        }
-    }
-
-    // Init visual data
-    initPrs();
-    myVoxels->SetDisplayMode(Voxel_VDM_POINTS);
-    myVoxels->SetUsageOfGLlists(false);
-       myVoxels->SetBoolVoxels(myBoolVoxels);
-       myVoxels->SetColorVoxels(myColorVoxels);
-    if (myViewer->getIC()->IsDisplayed(myVoxels))
-        myViewer->getIC()->Redisplay(myVoxels, false);
-    else
-           myViewer->getIC()->Display(myVoxels, false);
-    myViewer->getView()->FitAll();
-
-    // Prepare arrays of values
-    // X&Z values
-    int i = 0, di = 5 /* nb waves */;
-    int* zvalues = new int[nbx];
-    unsigned char* xvalues = new unsigned char[nbx];
-    for (ix = 0; ix < nbx; ix++, i += di)
-    {
-        if (i > nbx || i < 0)
-        {
-            di *= -1;
-            i += di;
-        }
-        double rad = -M_PI / 2.0 + double(i) / (double) nbx * M_PI;
-        double c = cos(rad);
-        xvalues[ix] = 15.0 * c;
-        if (xvalues[ix] == 0)
-            xvalues[ix] = 1;
-        zvalues[ix] = (nbz - 2) * c;
-    }
-
-    // Make waves
-    unsigned char value = 0;
-    for (i = 0; i <= 100; i++)
-    {
-        for (ix = 0; ix < nbx; ix++)
-        {
-            int ixi = ix + i;
-            if (ixi >= nbx)
-                ixi -= nbx;
-            for (iz = 0; iz < nbz; iz++)
-            {
-                value = 0;
-                if (iz < zvalues[ixi])
-                    value = xvalues[ixi];
-                for (iy = 0; iy < nby; iy++)
-                {
-                    myColorVoxels->Set(ix, iy, iz, value);
-                }
-            }
-        }
-        myViewer->getIC()->Redisplay(myVoxels, true);
-        qApp->processEvents();
-    }
-
-    delete[] xvalues;
-    delete[] zvalues;
-}
-
-void Application::initPrs()
-{
-       if (myVoxels.IsNull())
-    {
-               myVoxels = new VoxelClient_PrsGl();
-        myVoxels->SetDisplayMode(Voxel_VDM_POINTS);
-        myVoxels->SetColor(Quantity_NOC_WHITE);
-        myVoxels->SetPointSize(1.0);
-        myVoxels->SetSmoothPoints(false);
-        myVoxels->SetQuadrangleSize(myQuadrangleSize);
-        myVoxels->SetColorRange(myColorMinValue, myColorMaxValue);
-        // Colors of ColorDS
-        int nb_colors = 16 /* 4 bits */;
-        Handle(Quantity_HArray1OfColor) colors = new Quantity_HArray1OfColor(0, nb_colors - 1);
-        for (int icolor = 0; icolor < nb_colors; icolor++)
-        {
-            Quantity_Color color;
-            AIS_ColorScale::FindColor(icolor, 0, nb_colors - 1, nb_colors, color);
-            colors->SetValue(icolor, color);
-        }
-        myVoxels->SetColors(colors);
-        myViewer->setPrs(myVoxels);
-    }
-    else
-    {
-        myViewer->getIC()->RecomputePrsOnly(myVoxels, false);
-    }
-}
-
-void Application::box()
-{
-    gp_Ax2 axes(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
-    TopoDS_Shape S = BRepPrimAPI_MakeBox(axes, 100, 100, 100);
-    load(S);
-}
-
-void Application::cylinder()
-{
-    TopoDS_Shape S = BRepPrimAPI_MakeCylinder(50, 100);
-    load(S);
-}
-
-void Application::torus()
-{
-    TopoDS_Shape S = BRepPrimAPI_MakeTorus(100, 20);
-    load(S);
-}
-
-void Application::sphere()
-{
-    TopoDS_Shape S = BRepPrimAPI_MakeSphere(100);
-    load(S);
-}
-
-void Application::load(const TopoDS_Shape& S)
-{
-       myViewer->getIC()->EraseAll(false);
-
-    // Delete voxels of previous shape.
-    if (myBoolVoxels)
-    {
-        delete myBoolVoxels;
-        myBoolVoxels = 0;
-    }
-    if (myColorVoxels)
-    {
-        delete myColorVoxels;
-        myColorVoxels = 0;
-    }
-    
-    // Set view size
-    Bnd_Box box;
-    double xmin, ymin, zmin, xmax, ymax, zmax, length = 0;
-    BRepBndLib::Add(S, box);
-    box.Get(xmin, ymin, zmin, xmax, ymax, zmax);
-    length = xmax - xmin > ymax - ymin ? xmax - xmin : ymax - ymin;
-    length = length > zmax - zmin ? length : zmax - zmin;
-    length *= 2.0;
-    myViewer->getView()->SetSize(length);
-    myViewer->getView()->SetZSize(length);
-
-    // Display shape
-       if (myShape.IsNull())
-       {
-               myShape = new AIS_Shape(S);
-               myShape->SetDisplayMode(1);
-       }
-       else
-       {
-               myShape->Set(S);
-        myViewer->getIC()->RecomputePrsOnly(myShape, false);
-       }
-    if (myViewer->getIC()->IsDisplayed(myShape))
-        myViewer->getIC()->Redisplay(myShape, false);
-    else
-           myViewer->getIC()->Display(myShape, false);
-       myViewer->getView()->FitAll();
-}
-
-void Application::displayCut()
-{
-    myViewer->getIC()->EraseAll(false);
-
-    // Make a sphere with a lot of toruses, 
-    // cut the toruses from the sphere.
-    TopoDS_Shape sphere = BRepPrimAPI_MakeSphere(100.0);
-    TopoDS_Shape torus1 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt( 80,   0, 20), gp::DZ()), 30, 10);
-    TopoDS_Shape torus2 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(  0,  80, 20), gp::DZ()), 30, 10);
-    TopoDS_Shape torus3 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(-80,   0, 20), gp::DZ()), 30, 10);
-    TopoDS_Shape torus4 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(  0, -80, 20), gp::DZ()), 30, 10);
-
-    // Compute bounding box of the shapes
-    Bnd_Box box;
-    BRepBndLib::Add(sphere, box);
-    BRepBndLib::Add(torus1, box);
-    BRepBndLib::Add(torus2, box);
-    BRepBndLib::Add(torus3, box);
-    BRepBndLib::Add(torus4, box);
-
-    // Nullify voxels
-    if (myColorVoxels)
-    {
-        delete myColorVoxels;
-        myColorVoxels = 0;
-    }
-    if (myBoolVoxels)
-    {
-        delete myBoolVoxels;
-        myBoolVoxels = 0;
-    }
-
-    Timer timer;
-    timer.Start();
-
-    // Create a cube of voxels
-    int nbx = 100, nby = 100, nbz = 100;
-    double xmin, ymin, zmin, xmax, ymax, zmax;
-    box.Get(xmin, ymin, zmin, xmax, ymax, zmax);
-    myColorVoxels = new Voxel_ColorDS(xmin, ymin, zmin, 
-                                      xmax - xmin, ymax - ymin, zmax - zmin,
-                                      nbx, nby, nbz);
-    Voxel_ColorDS vtorus(xmin, ymin, zmin, 
-                         xmax - xmin, ymax - ymin, zmax - zmin,
-                         nbx, nby, nbz);
-
-    // Make a cube of voxels for the sphere.
-    int progress;
-    Voxel_FastConverter converter(sphere, *myColorVoxels, 0.1, nbx, nby, nbz);
-    converter.Convert(progress);
-    converter.FillInVolume(15);
-   
-    // Torus 1
-    Voxel_FastConverter converter1(torus1, vtorus, 0.1, nbx, nby, nbz);
-    converter1.Convert(progress);
-    converter1.FillInVolume(3);
-   
-    // Torus 2
-    Voxel_FastConverter converter2(torus2, vtorus, 0.1, nbx, nby, nbz);
-    converter2.Convert(progress);
-    converter2.FillInVolume(7);
-   
-    // Torus 3
-    Voxel_FastConverter converter3(torus3, vtorus, 0.1, nbx, nby, nbz);
-    converter3.Convert(progress);
-    converter3.FillInVolume(10);
-   
-    // Torus 4
-    Voxel_FastConverter converter4(torus4, vtorus, 0.1, nbx, nby, nbz);
-    converter4.Convert(progress);
-    converter4.FillInVolume(12);
-
-    // Cut
-    Voxel_BooleanOperation cutter;
-    cutter.Cut(*myColorVoxels, vtorus);
-
-    // Remove volumic voxels
-    converter.FillInVolume(0);
-
-    timer.Stop();
-    timer.Print("Cut");
-
-    // Display
-    initPrs();
-    myVoxels->SetDisplayMode(Voxel_VDM_POINTS);
-    myVoxels->SetUsageOfGLlists(true);
-       myVoxels->SetBoolVoxels(myBoolVoxels);
-       myVoxels->SetColorVoxels(myColorVoxels);
-    if (myViewer->getIC()->IsDisplayed(myVoxels))
-        myViewer->getIC()->Redisplay(myVoxels, false);
-    else
-           myViewer->getIC()->Display(myVoxels, false);
-    myViewer->getView()->FitAll();
-}
-
-void Application::displayCollisions()
-{
-    myViewer->getIC()->EraseAll(false);
-
-    // Make a big box with a lot of small spheres inside.
-    double x = 0.0, y = 0.0, z = 0.0, xlen = 100.0, ylen = 100.0, zlen = 100.0, r = 10.0;
-    gp_Pnt P1(x, y, z); // center point of moving sphere (S1).
-    TopoDS_Shape B   = BRepPrimAPI_MakeBox(gp_Pnt(x-r, y-r, z-r), gp_Pnt(xlen+r, ylen+r, zlen+r));
-    TopoDS_Shape S1  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       y,       z),       gp::DZ()), r / 2.0);
-    TopoDS_Shape S2  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., y,       z),       gp::DZ()), r);
-    TopoDS_Shape S3  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    y,       z),       gp::DZ()), r);
-    TopoDS_Shape S4  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       ylen/2., z),       gp::DZ()), r);
-    TopoDS_Shape S5  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., ylen/2., z),       gp::DZ()), r);
-    TopoDS_Shape S6  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    ylen/2., z),       gp::DZ()), r);
-    TopoDS_Shape S7  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       ylen,    z),       gp::DZ()), r);
-    TopoDS_Shape S8  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., ylen,    z),       gp::DZ()), r);
-    TopoDS_Shape S9  = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    ylen,    z),       gp::DZ()), r);
-    TopoDS_Shape S10 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       y,       zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S11 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., y,       zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S12 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    y,       zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S13 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       ylen/2., zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S14 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., ylen/2., zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S15 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    ylen/2., zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S16 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       ylen,    zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S17 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., ylen,    zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S18 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    ylen,    zlen/2.), gp::DZ()), r);
-    TopoDS_Shape S19 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       y,       zlen),    gp::DZ()), r);
-    TopoDS_Shape S20 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., y,       zlen),    gp::DZ()), r);
-    TopoDS_Shape S21 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    y,       zlen),    gp::DZ()), r);
-    TopoDS_Shape S22 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       ylen/2., zlen),    gp::DZ()), r);
-    TopoDS_Shape S23 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., ylen/2., zlen),    gp::DZ()), r);
-    TopoDS_Shape S24 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    ylen/2., zlen),    gp::DZ()), r);
-    TopoDS_Shape S25 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(x,       ylen,    zlen),    gp::DZ()), r);
-    TopoDS_Shape S26 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen/2., ylen,    zlen),    gp::DZ()), r);
-    TopoDS_Shape S27 = BRepPrimAPI_MakeSphere(gp_Ax2(gp_Pnt(xlen,    ylen,    zlen),    gp::DZ()), r);
-
-    // Planes of the big box
-    gp_Ax2 xminusPlane(gp_Pnt(x,    y,    z),    gp::DX());
-    gp_Ax2 xplusPlane (gp_Pnt(xlen, y,    z),    gp::DX());
-    gp_Ax2 yminusPlane(gp_Pnt(x,    y,    z),    gp::DY());
-    gp_Ax2 yplusPlane (gp_Pnt(x,    ylen, z),    gp::DY());
-    gp_Ax2 zminusPlane(gp_Pnt(x,    y,    z),    gp::DZ());
-    gp_Ax2 zplusPlane (gp_Pnt(x,    y,    zlen), gp::DZ());
-
-    // Nullify voxels
-    if (myColorVoxels)
-    {
-        delete myColorVoxels;
-        myColorVoxels = 0;
-    }
-    if (myBoolVoxels)
-    {
-        delete myBoolVoxels;
-        myBoolVoxels = 0;
-    }
-
-    // Prepare visualization
-    initPrs();
-    myVoxels->SetDisplayMode(Voxel_VDM_POINTS);
-    myVoxels->SetColor(Quantity_NOC_RED);
-    myVoxels->SetPointSize(4);
-    myVoxels->SetSmoothPoints(false);
-    myVoxels->SetUsageOfGLlists(false);
-       myVoxels->SetColorVoxels(myColorVoxels);
-
-    // Display all shapes
-    double transparency = 0.9;
-    Handle(AIS_Shape) aisB   = new AIS_Shape(B);
-    Handle(AIS_Shape) aisS1  = new AIS_Shape(S1);
-    Handle(AIS_Shape) aisS2  = new AIS_Shape(S2);
-    Handle(AIS_Shape) aisS3  = new AIS_Shape(S3);
-    Handle(AIS_Shape) aisS4  = new AIS_Shape(S4);
-    Handle(AIS_Shape) aisS5  = new AIS_Shape(S5);
-    Handle(AIS_Shape) aisS6  = new AIS_Shape(S6);
-    Handle(AIS_Shape) aisS7  = new AIS_Shape(S7);
-    Handle(AIS_Shape) aisS8  = new AIS_Shape(S8);
-    Handle(AIS_Shape) aisS9  = new AIS_Shape(S9);
-    Handle(AIS_Shape) aisS10 = new AIS_Shape(S10);
-    Handle(AIS_Shape) aisS11 = new AIS_Shape(S11);
-    Handle(AIS_Shape) aisS12 = new AIS_Shape(S12);
-    Handle(AIS_Shape) aisS13 = new AIS_Shape(S13);
-    Handle(AIS_Shape) aisS14 = new AIS_Shape(S14);
-    Handle(AIS_Shape) aisS15 = new AIS_Shape(S15);
-    Handle(AIS_Shape) aisS16 = new AIS_Shape(S16);
-    Handle(AIS_Shape) aisS17 = new AIS_Shape(S17);
-    Handle(AIS_Shape) aisS18 = new AIS_Shape(S18);
-    Handle(AIS_Shape) aisS19 = new AIS_Shape(S19);
-    Handle(AIS_Shape) aisS20 = new AIS_Shape(S20);
-    Handle(AIS_Shape) aisS21 = new AIS_Shape(S21);
-    Handle(AIS_Shape) aisS22 = new AIS_Shape(S22);
-    Handle(AIS_Shape) aisS23 = new AIS_Shape(S23);
-    Handle(AIS_Shape) aisS24 = new AIS_Shape(S24);
-    Handle(AIS_Shape) aisS25 = new AIS_Shape(S25);
-    Handle(AIS_Shape) aisS26 = new AIS_Shape(S26);
-    Handle(AIS_Shape) aisS27 = new AIS_Shape(S27);
-    aisS1-> SetDisplayMode(1);
-    aisS2-> SetDisplayMode(1);
-    aisS3-> SetDisplayMode(1);
-    aisS4-> SetDisplayMode(1);
-    aisS5-> SetDisplayMode(1);
-    aisS6-> SetDisplayMode(1);
-    aisS7-> SetDisplayMode(1);
-    aisS8-> SetDisplayMode(1);
-    aisS9-> SetDisplayMode(1);
-    aisS10->SetDisplayMode(1);
-    aisS11->SetDisplayMode(1);
-    aisS12->SetDisplayMode(1);
-    aisS13->SetDisplayMode(1);
-    aisS14->SetDisplayMode(1);
-    aisS15->SetDisplayMode(1);
-    aisS16->SetDisplayMode(1);
-    aisS17->SetDisplayMode(1);
-    aisS18->SetDisplayMode(1);
-    aisS19->SetDisplayMode(1);
-    aisS20->SetDisplayMode(1);
-    aisS21->SetDisplayMode(1);
-    aisS22->SetDisplayMode(1);
-    aisS23->SetDisplayMode(1);
-    aisS24->SetDisplayMode(1);
-    aisS25->SetDisplayMode(1);
-    aisS26->SetDisplayMode(1);
-    aisS27->SetDisplayMode(1);
-    aisS1-> SetTransparency(2.0 * transparency / 3.0);
-    aisS2-> SetTransparency(transparency);
-    aisS3-> SetTransparency(transparency);
-    aisS4-> SetTransparency(transparency);
-    aisS5-> SetTransparency(transparency);
-    aisS6-> SetTransparency(transparency);
-    aisS7-> SetTransparency(transparency);
-    aisS8-> SetTransparency(transparency);
-    aisS9-> SetTransparency(transparency);
-    aisS10->SetTransparency(transparency);
-    aisS11->SetTransparency(transparency);
-    aisS12->SetTransparency(transparency);
-    aisS13->SetTransparency(transparency);
-    aisS14->SetTransparency(transparency);
-    aisS15->SetTransparency(transparency);
-    aisS16->SetTransparency(transparency);
-    aisS17->SetTransparency(transparency);
-    aisS18->SetTransparency(transparency);
-    aisS19->SetTransparency(transparency);
-    aisS20->SetTransparency(transparency);
-    aisS21->SetTransparency(transparency);
-    aisS22->SetTransparency(transparency);
-    aisS23->SetTransparency(transparency);
-    aisS24->SetTransparency(transparency);
-    aisS25->SetTransparency(transparency);
-    aisS26->SetTransparency(transparency);
-    aisS27->SetTransparency(transparency);
-    myViewer->getIC()->Display(aisB, false);
-    myViewer->getIC()->Display(aisS1, false);
-    myViewer->getIC()->Display(aisS2, false);
-    myViewer->getIC()->Display(aisS3, false);
-    myViewer->getIC()->Display(aisS4, false);
-    myViewer->getIC()->Display(aisS5, false);
-    myViewer->getIC()->Display(aisS6, false);
-    myViewer->getIC()->Display(aisS7, false);
-    myViewer->getIC()->Display(aisS8, false);
-    myViewer->getIC()->Display(aisS9, false);
-    myViewer->getIC()->Display(aisS10, false);
-    myViewer->getIC()->Display(aisS11, false);
-    myViewer->getIC()->Display(aisS12, false);
-    myViewer->getIC()->Display(aisS13, false);
-    myViewer->getIC()->Display(aisS14, false);
-    myViewer->getIC()->Display(aisS15, false);
-    myViewer->getIC()->Display(aisS16, false);
-    myViewer->getIC()->Display(aisS17, false);
-    myViewer->getIC()->Display(aisS18, false);
-    myViewer->getIC()->Display(aisS19, false);
-    myViewer->getIC()->Display(aisS20, false);
-    myViewer->getIC()->Display(aisS21, false);
-    myViewer->getIC()->Display(aisS22, false);
-    myViewer->getIC()->Display(aisS23, false);
-    myViewer->getIC()->Display(aisS24, false);
-    myViewer->getIC()->Display(aisS25, false);
-    myViewer->getIC()->Display(aisS26, false);
-    myViewer->getIC()->Display(aisS27, false);
-
-    // Prepare computer of collisions
-    double deflection = 0.1;
-    int nbx = 100, nby = 100, nbz = 100;
-    
-    Voxel_CollisionDetection coldet(deflection, nbx, nby, nbz);
-    coldet.SetUsageOfVolume(false);
-    coldet.KeepCollisions(false);
-    coldet.AddShape(S1);
-    coldet.AddShape(S2);
-    coldet.AddShape(S3);
-    coldet.AddShape(S4);
-    coldet.AddShape(S5);
-    coldet.AddShape(S6);
-    coldet.AddShape(S7);
-    coldet.AddShape(S8);
-    coldet.AddShape(S9);
-    coldet.AddShape(S10);
-    coldet.AddShape(S11);
-    coldet.AddShape(S12);
-    coldet.AddShape(S13);
-    coldet.AddShape(S14);
-    coldet.AddShape(S15);
-    coldet.AddShape(S16);
-    coldet.AddShape(S17);
-    coldet.AddShape(S18);
-    coldet.AddShape(S19);
-    coldet.AddShape(S20);
-    coldet.AddShape(S21);
-    coldet.AddShape(S22);
-    coldet.AddShape(S23);
-    coldet.AddShape(S24);
-    coldet.AddShape(S25);
-    coldet.AddShape(S26);
-    coldet.AddShape(S27);
-    //coldet.AddShape(BRepPrimAPI_MakeBox(gp_Pnt(x, y, z), gp_Pnt(xlen, ylen, zlen)));
-    
-    Bnd_Box box;
-    BRepBndLib::Add(B, box);
-    coldet.SetBoundaryBox(box);
-
-    coldet.Voxelize();
-
-    // Move one of the spheres inside the box
-    // and compute collisions
-    gp_Trsf trsf;
-    gp_Vec vmove(1, 0.5, 0.25);
-
-    int imove = 0, nb_moves = 900;
-    while (imove < nb_moves)
-    {
-        // Move
-        trsf.SetTranslation(vmove);
-        TopLoc_Location loc(trsf);
-        S1.Move(loc);
-        P1.Translate(vmove);
-        
-        // Check whether S1 is inside the big box
-        // Detect the plane S1 touches to.
-        if (P1.X() < x)
-            vmove.Mirror(xminusPlane);
-        else if (P1.X() > xlen)
-            vmove.Mirror(xplusPlane);
-        else if (P1.Y() < y)
-            vmove.Mirror(yminusPlane);
-        else if (P1.Y() > ylen)
-            vmove.Mirror(yplusPlane);
-        else if (P1.Z() < z)
-            vmove.Mirror(zminusPlane);
-        else if (P1.Z() > zlen)
-            vmove.Mirror(zplusPlane);
-
-        // Compute collisions
-        coldet.ReplaceShape(1, S1);
-        coldet.Voxelize(1); // only the first sphere (S1)
-        coldet.Compute();
-        myBoolVoxels = &((Voxel_BoolDS&) coldet.GetCollisions());
-
-        // Redisplay S1
-        aisS1->Set(S1);
-        myViewer->getIC()->Redisplay(aisS1, false);
-
-        // Display the collisions
-        myVoxels->SetBoolVoxels(myBoolVoxels);
-        if (myViewer->getIC()->IsDisplayed(myVoxels))
-            myViewer->getIC()->Redisplay(myVoxels, true);
-        else
-        {
-               myViewer->getIC()->Display(myVoxels, false);
-            myViewer->getView()->FitAll();
-        }
-
-        imove++;
-        qApp->processEvents();
-    }
-
-    // Copy the result of collision detection
-    int ix, iy, iz;
-    myBoolVoxels = new Voxel_BoolDS(coldet.GetCollisions().GetX(), 
-                                    coldet.GetCollisions().GetY(), 
-                                    coldet.GetCollisions().GetZ(), 
-                                    coldet.GetCollisions().GetXLen(), 
-                                    coldet.GetCollisions().GetYLen(), 
-                                    coldet.GetCollisions().GetZLen(), 
-                                    nbx, nby, nbz);
-    for (ix = 0; ix < nbx; ix++)
-    {
-        for (iy = 0; iy < nby; iy++)
-        {
-            for (iz = 0; iz < nbz; iz++)
-            {
-                if (coldet.GetCollisions().Get(ix, iy, iz))
-                    myBoolVoxels->Set(ix, iy, iz, Standard_True);
-            }
-        }
-    }
-    myVoxels->SetBoolVoxels(myBoolVoxels);
-}
\ No newline at end of file
diff --git a/samples/qt/VoxelDemo/src/ConversionThread.cpp b/samples/qt/VoxelDemo/src/ConversionThread.cpp
deleted file mode 100644 (file)
index 6fee824..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "ConversionThread.h"
-
-ConversionThread::ConversionThread():QThread(),
-/*myConverter(0),*/myFastConverter(0),
-myVolumicValue(0),myScanSide(1),
-myThreadIndex(1)
-{
-
-}
-
-ConversionThread::~ConversionThread()
-{
-
-}
-
-/*
-void ConversionThread::setConverter(Voxel_Converter* converter)
-{
-    myConverter = converter;
-    myFastConverter = 0;
-}
-*/
-
-void ConversionThread::setConverter(Voxel_FastConverter* converter)
-{
-    myFastConverter = converter;
-    //myConverter = 0;
-}
-
-void ConversionThread::setVolumicValue(const int value)
-{
-    myVolumicValue = value;
-}
-
-void ConversionThread::setScanSide(const int side)
-{
-    myScanSide = side;
-}
-
-void ConversionThread::setThreadIndex(const int ithread)
-{
-    myThreadIndex = ithread;
-}
-
-int* ConversionThread::getProgress()
-{
-    return &myProgress;
-}
-
-void ConversionThread::run()
-{
-    if (/*!myConverter && */!myFastConverter)
-        return;
-    //if (myConverter)
-    //    myConverter->Convert(myProgress, myVolumicValue, myScanSide, myThreadIndex);
-    //else
-        myFastConverter->Convert(myProgress, myThreadIndex);
-}
diff --git a/samples/qt/VoxelDemo/src/Main.cpp b/samples/qt/VoxelDemo/src/Main.cpp
deleted file mode 100644 (file)
index e5f9175..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <qapplication.h>
-#include "application.h"
-
-int main( int argc, char ** argv ) 
-{
-    QApplication a( argc, argv );
-
-    Application *w = new Application();
-    w->setWindowTitle( "Voxel demo-application" );
-    w->show();
-    a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
-    return a.exec();
-}
diff --git a/samples/qt/VoxelDemo/src/Timer.cpp b/samples/qt/VoxelDemo/src/Timer.cpp
deleted file mode 100644 (file)
index 783b004..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// Timer.cpp: implementation of the Timer class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "Timer.h"
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-Timer::Timer():myWriter(0) {}
-
-Timer::Timer(const char* filename)
-{
-       fopen_s(&myWriter,filename, "a");
-}
-
-Timer::~Timer()
-{
-       if (myWriter)
-               fclose(myWriter);
-}
-
-void Timer::Start() {
-       myTimer.Reset();
-       myTimer.Start();
-}
-
-void Timer::Stop() {
-       myTimer.Stop();
-}
-
-void Timer::Continue() {
-       myTimer.Start();
-}
-
-void Timer::Reset() {
-       myTimer.Reset();
-}
-
-float Timer::Seconds() {
-  Standard_Real sec, cpu;
-  Standard_Integer minutes, hours;
-  myTimer.Show(sec, minutes, hours, cpu);
-  return (float) sec;
-}
-
-int Timer::Minutes() {
-  Standard_Real sec, cpu;
-  Standard_Integer minutes, hours;
-  myTimer.Show(sec, minutes, hours, cpu);
-  return minutes;
-}
-
-void Timer::Print(char* label) {
-       Standard_Real seconds, cpu;
-       Standard_Integer minutes, hours;
-       myTimer.Show(seconds, minutes, hours, cpu);
-       if (myWriter)
-       {
-               fprintf(myWriter, "%s took %d minutes %g seconds\n", label, minutes, seconds);
-       }
-       else
-       {
-               cout<<label<<" took "<<minutes<<" minutes, "<<seconds<<" seconds"<<endl;
-       }
-}
\ No newline at end of file
diff --git a/samples/qt/VoxelDemo/src/Viewer.cpp b/samples/qt/VoxelDemo/src/Viewer.cpp
deleted file mode 100644 (file)
index 5c639b6..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-#include "Viewer.h"
-#include "Timer.h"
-
-#include <QApplication.h>
-#include <QCursor.h>
-#include <QMessagebox.h>
-
-#include <QMouseEvent>
-
-#include <WNT_Window.hxx>
-
-#include <Voxel_Prs.hxx>
-#include <AIS_ListOfInteractive.hxx>
-#include <AIS_ListIteratorOfListOfInteractive.hxx>
-#include <Aspect_DisplayConnection.hxx>
-#include <OpenGl_GraphicDriver.hxx>
-#include <V3d_DirectionalLight.hxx>
-#include <V3d_AmbientLight.hxx>
-
-static Handle(Graphic3d_GraphicDriver) Viewer_aGraphicDriver;
-
-Viewer::Viewer(QWidget* parent):QWidget(parent)
-{
-    if (myGraphicDriver.IsNull())
-    {
-      if (Viewer_aGraphicDriver.IsNull())
-      {
-        Handle(Aspect_DisplayConnection) aDisplayConnection;
-        Viewer_aGraphicDriver = new OpenGl_GraphicDriver (aDisplayConnection);
-      }
-      myGraphicDriver = Handle(OpenGl_GraphicDriver)::DownCast(Viewer_aGraphicDriver);
-    }
-
-       Handle(V3d_Viewer) aViewer = new V3d_Viewer(myGraphicDriver, TCollection_ExtendedString("Visu3D").ToExtString(), "",
-                                                1000, V3d_XposYnegZpos,
-                                                Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
-                                                true, true, V3d_TEX_NONE);
-
-       aViewer->SetDefaultBackgroundColor(Quantity_NOC_BLACK);
-
-    myView = aViewer->CreateView();
-    myIC = new AIS_InteractiveContext(aViewer);
-    myIC->SetDeviationCoefficient(1.e-3);
-
-    Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
-    Handle(WNT_Window) hWnd = new WNT_Window (aWindowHandle);
-
-    myView->SetWindow(hWnd);
-    if(!hWnd->IsMapped())
-        hWnd->Map();
-
-    myView->MustBeResized();
-    myView->SetSurfaceDetail(V3d_TEX_NONE);
-    myView->SetSize(10000.0);
-    myView->SetZSize(10000.0);
-    myView->SetViewMappingDefault();
-
-    myZoom = false;
-    myPan = false;
-    myRotate = false;
-    setMouseTracking(true);
-
-    setMinimumSize(400, 200);
-    
-    myView->ZBufferTriedronSetup();
-    myView->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_BLACK, 0.1, V3d_ZBUFFER);
-
-    mySelector.Init(myView);
-
-       setBackgroundRole( QPalette::NoRole );//NoBackground );
-       // set focus policy to threat QContextMenuEvent from keyboard  
-       setFocusPolicy( Qt::StrongFocus );
-       setAttribute( Qt::WA_PaintOnScreen );
-       setAttribute( Qt::WA_NoSystemBackground );
-
-    aViewer->SetLightOn(new V3d_DirectionalLight(aViewer, V3d_XnegYnegZneg, Quantity_NOC_WHITE, Standard_True));
-    aViewer->SetLightOn(new V3d_AmbientLight(aViewer, Quantity_NOC_WHITE));
-}
-
-Viewer::~Viewer()
-{
-
-}
-
-void Viewer::paintEvent(QPaintEvent * pEvent)
-{
-    if (!myView.IsNull())
-        myView->Redraw();
-}
-
-
-/*!
-  Get paint engine for the OpenGL viewer. [ virtual public ]
-*/
-QPaintEngine* Viewer::paintEngine() const
-{
-  return 0;
-}
-
-void Viewer::resizeEvent(QResizeEvent * e)
-{
-    if (!myView.IsNull())
-    {
-        myView->MustBeResized();
-    }
-}
-
-void Viewer::mousePressEvent(QMouseEvent * mpEvent)
-{
-    // Memorize start point
-    myStartPnt.setX(mpEvent->x());
-    myStartPnt.setY(mpEvent->y());
-    
-    // Inform IC that the mouse cursor is at the point
-    myIC->MoveTo(myStartPnt.x(), myStartPnt.y(), myView);
-
-    // In case of rotation, define the start rotation point
-    if ((mpEvent->modifiers() & Qt::ControlModifier) && (mpEvent->buttons() & Qt::RightButton))
-    {
-        myView->StartRotation(myStartPnt.x(), myStartPnt.y());
-    }
-
-    // Start degenerate mode
-    setDegenerateMode(true);
-
-    emit mousePressed(mpEvent->modifiers(), mpEvent->x(), mpEvent->y());
-}
-
-void Viewer::mouseMoveEvent(QMouseEvent * mmEvent)
-{
-    QPoint currentPnt(mmEvent->x(), mmEvent->y());
-
-    if (mmEvent->modifiers() & Qt::ControlModifier)
-    {
-        if (mmEvent->buttons() & Qt::LeftButton)
-        {
-            myView->Zoom(myStartPnt.x(), myStartPnt.y(), currentPnt.x(), currentPnt.y());
-            myStartPnt = currentPnt;
-        }
-        else if (mmEvent->buttons() & Qt::MidButton)
-        {
-            myView->Pan(currentPnt.x() - myStartPnt.x(), myStartPnt.y() - currentPnt.y());
-            myStartPnt = currentPnt;
-        }
-        else if (mmEvent->buttons() & Qt::RightButton)
-        {
-            myView->Rotation(currentPnt.x(), currentPnt.y());
-        }
-    }
-    else
-    {
-        myIC->MoveTo(currentPnt.x(), currentPnt.y(), myView);
-    }
-
-    emit mouseMoved(mmEvent->modifiers(), currentPnt.x(), currentPnt.y());
-}
-
-void Viewer::mouseReleaseEvent(QMouseEvent * mrEvent)
-{
-    if(mrEvent->button() == Qt::LeftButton)
-    {
-        if(!myZoom && !myPan && !myRotate)
-        {
-            if(mrEvent->modifiers() & Qt::ShiftModifier)
-                myIC->ShiftSelect();
-            else
-                myIC->Select();
-
-            // Select a voxel
-            int ix = -1, iy = -1, iz = -1;
-            bool detected = mySelector.Detect(mrEvent->x(), mrEvent->y(), ix, iy, iz);
-            if (detected)
-            {
-                cout<<"("<<ix<<", "<<iy<<", "<<iz<<")"<<endl;
-            }
-            if (!myPrs.IsNull())
-                myPrs->Highlight(ix, iy, iz);
-        }
-    }
-    else if(mrEvent->button() == Qt::RightButton)
-    {
-        // Popup menu:
-
-    
-       }
-
-    // Finish degenerate mode
-    setDegenerateMode(false);
-    
-    emit mouseReleased(mrEvent->modifiers(), mrEvent->x(), mrEvent->y());
-}
-
-void Viewer::mouseDoubleClickEvent(QMouseEvent * mdcEvent)
-{
-    emit mouseDoubleClick(mdcEvent->modifiers(), mdcEvent->x(), mdcEvent->y());
-}
-
-void Viewer::setDegenerateMode(const bool on)
-{
-    AIS_ListOfInteractive displayed;
-    myIC->DisplayedObjects(displayed);
-    AIS_ListIteratorOfListOfInteractive itri(displayed);
-    for (; itri.More(); itri.Next())
-    {
-        Handle(Voxel_Prs) prs = Handle(Voxel_Prs)::DownCast(itri.Value());
-        if (!prs.IsNull())
-        {
-            prs->SetDegenerateMode(on);
-            myView->Redraw();
-            break;
-        }
-    }
-}
diff --git a/samples/qt/VoxelDemo/src/VoxelClient_VisDrawer.cxx b/samples/qt/VoxelDemo/src/VoxelClient_VisDrawer.cxx
deleted file mode 100644 (file)
index f23e525..0000000
+++ /dev/null
@@ -1,3374 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-// required for correct APIENTRY definition
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-  #define WIN32_LEAN_AND_MEAN
-  #include <windows.h>
-#endif
-
-#if defined(__APPLE__)
-  #include <OpenGL/glu.h>
-#else
-  #include <GL/glu.h>
-#endif
-
-#include "VoxelClient_VisDrawer.h"
-
-#include <OpenGl_GlCore11.hxx>
-
-#include <ElSLib.hxx>
-#include <gp_Dir.hxx>
-#include <Geom_Plane.hxx>
-#include <gce_MakePln.hxx>
-#include <Quantity_Color.hxx>
-#include <Aspect_TypeOfLine.hxx>
-#include <Prs3d_Root.hxx>
-
-#include <InterfaceGraphic_telem.hxx>
-#include <OpenGl_Element.hxx>
-#include <OpenGl_GraphicDriver.hxx>
-#include <OpenGl_NamedStatus.hxx>
-#include <OpenGl_Workspace.hxx>
-
-/**************************************************************************/
-
-class VoxelClient_VisDrawer::VisElement : public OpenGl_Element
-{
-public:
-
-  VisElement (Voxel_VisData*);
-  virtual ~VisElement();
-
-  void EvaluateBounds (Graphic3d_BndBox4f& theMinMax);
-
-  void Render (const Handle(OpenGl_Workspace) &theWorkspace) const;
-
-  virtual void Release (OpenGl_Context* theContext)
-  {
-    //
-  }
-
-private:
-
-  VoxelClient_VisDrawer* myHandler;
-
-public:
-
-  DEFINE_STANDARD_ALLOC
-
-};
-
-//=======================================================================
-//function : VisElement
-//purpose  : Constructor
-//=======================================================================
-
-VoxelClient_VisDrawer::VisElement::VisElement (Voxel_VisData* theData)
-{
-  myHandler = new VoxelClient_VisDrawer (theData);
-}
-
-//=======================================================================
-//function : ~VisElement
-//purpose  : Destructor
-//=======================================================================
-
-VoxelClient_VisDrawer::VisElement::~VisElement ()
-{
-  delete myHandler;
-}
-
-//=======================================================================
-//function : EvaluateBounds
-//purpose  :
-//=======================================================================
-
-void VoxelClient_VisDrawer::VisElement::EvaluateBounds
-  (Graphic3d_BndBox4f& theMinMax)
-{
-  myHandler->EvalMinMax (theMinMax);
-}
-
-//=======================================================================
-//function : Render
-//purpose  : display element
-//=======================================================================
-
-void VoxelClient_VisDrawer::VisElement::Render
-  (const Handle (OpenGl_Workspace) &theWorkspace) const
-{
-  const Standard_Boolean aHl = (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT);
-  myHandler->Display (aHl);
-}
-
-//=======================================================================
-//function : VisDrawerCallBack
-//purpose  : visdrawer element create callback, adds an element to graphic
-//           driver's structure
-//=======================================================================
-void VoxelClient_PrsGl::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
-                                 const Handle(Prs3d_Presentation)&           thePrs,
-                                 const Standard_Integer                      theMode)
-{
-  if (myVisData == NULL)
-  {
-    return;
-  }
-  Voxel_Prs::Compute (thePrsMgr, thePrs, theMode);
-
-  Handle(OpenGl_Group) aGroup = Handle(OpenGl_Group)::DownCast (Prs3d_Root::CurrentGroup (thePrs));
-  VoxelClient_VisDrawer::VisElement* anElem = new VoxelClient_VisDrawer::VisElement ((Voxel_VisData* )myVisData);
-  aGroup->AddElement (anElem);
-
-  Graphic3d_BndBox4f aMinMax;
-  anElem->EvaluateBounds (aMinMax);
-  aGroup->SetMinMaxValues (aMinMax.CornerMin().x(), aMinMax.CornerMin().y(), aMinMax.CornerMin().z(),
-                           aMinMax.CornerMax().x(), aMinMax.CornerMax().y(), aMinMax.CornerMax().z());
-  thePrsMgr->StructureManager()->Update (thePrsMgr->StructureManager()->UpdateMode());
-}
-
-/**************************************************************************/
-VoxelClient_VisDrawer::VoxelClient_VisDrawer(Voxel_VisData * theData):myData(theData)
-{
-
-}
-
-/**************************************************************************/
-VoxelClient_VisDrawer::~VoxelClient_VisDrawer()
-{
-    if (myData)
-    {
-        // Because a pointer to the data is copied, 
-        // it is possible to make an attempt to delete GL lists for
-        // a structure, which is already deleted.
-        // Such a situation may happen on close of the application.
-        // Therefore, this try / catch is used.
-
-        try
-        {
-            Standard_Integer idir;
-
-            // Points
-
-            // BoolDS
-            if (myData->myDisplay.myBoolPointsList > 0)
-            {
-                glDeleteLists(myData->myDisplay.myBoolPointsList, 1);
-                myData->myDisplay.myBoolPointsList = -1;
-            }
-            for (idir = Xminus; idir <= Zplus; idir++)
-            {
-                if (myData->myDisplay.myBoolNearestPointsList[idir] > 0)
-                {
-                    glDeleteLists(myData->myDisplay.myBoolNearestPointsList[idir], 1);
-                    myData->myDisplay.myBoolNearestPointsList[idir] = -1;
-                }
-            }
-
-            // ColorDS
-            if (myData->myDisplay.myColorPointsList > 0)
-            {
-                glDeleteLists(myData->myDisplay.myColorPointsList, 1);
-                myData->myDisplay.myColorPointsList = -1;
-            }
-            for (idir = Xminus; idir <= Zplus; idir++)
-            {
-                if (myData->myDisplay.myColorNearestPointsList[idir] > 0)
-                {
-                    glDeleteLists(myData->myDisplay.myColorNearestPointsList[idir], 1);
-                    myData->myDisplay.myColorNearestPointsList[idir] = -1;
-                }
-            }
-
-            // ROctBoolDS
-            if (myData->myDisplay.myROctBoolPointsList > 0)
-            {
-                glDeleteLists(myData->myDisplay.myROctBoolPointsList, 1);
-                myData->myDisplay.myROctBoolPointsList = -1;
-            }
-            for (idir = Xminus; idir <= Zplus; idir++)
-            {
-                if (myData->myDisplay.myROctBoolNearestPointsList[idir] > 0)
-                {
-                    glDeleteLists(myData->myDisplay.myROctBoolNearestPointsList[idir], 1);
-                    myData->myDisplay.myROctBoolNearestPointsList[idir] = -1;
-                }
-            }
-
-            // Triangulation
-            if (myData->myDisplay.myTriangulationList > 0)
-            {
-                glDeleteLists(myData->myDisplay.myTriangulationList, 1);
-                myData->myDisplay.myTriangulationList = -1;
-            }
-        }
-        catch (...)
-        {
-
-        }
-    }
-}
-
-/**************************************************************************/
-void VoxelClient_VisDrawer::EvalMinMax(Graphic3d_BndBox4f& theMinMax) const
-{
-    Graphic3d_Vec4 aMinPt (FLT_MAX, FLT_MAX, FLT_MAX, 1.0f);
-    Graphic3d_Vec4 aMaxPt (-FLT_MAX, -FLT_MAX, -FLT_MAX, 1.0f);
-
-    if(!myData)
-        return;
-    if(myData->myBoolVoxels)
-    {
-        Graphic3d_Vec4 aBoolVoxelsMin (RealToShortReal (myData->myBoolVoxels->GetX()),
-                                       RealToShortReal (myData->myBoolVoxels->GetY()),
-                                       RealToShortReal (myData->myBoolVoxels->GetZ()),
-                                       1.0f);
-        Graphic3d_Vec4 aBoolVoxelsMax (
-          RealToShortReal (myData->myBoolVoxels->GetX() + myData->myBoolVoxels->GetXLen()),
-          RealToShortReal (myData->myBoolVoxels->GetY() + myData->myBoolVoxels->GetYLen()),
-          RealToShortReal (myData->myBoolVoxels->GetZ() + myData->myBoolVoxels->GetZLen()),
-          1.0f);
-
-        aMinPt = aMinPt.cwiseMin (aBoolVoxelsMin);
-        aMaxPt = aMaxPt.cwiseMax (aBoolVoxelsMax);
-    }
-    if(myData->myColorVoxels)
-    {
-        Graphic3d_Vec4 aColorVoxelsMin (RealToShortReal (myData->myColorVoxels->GetX()),
-                                        RealToShortReal (myData->myColorVoxels->GetY()),
-                                        RealToShortReal (myData->myColorVoxels->GetZ()),
-                                        1.0f);
-        Graphic3d_Vec4 aColorVoxelsMax (
-          RealToShortReal (myData->myColorVoxels->GetX() + myData->myColorVoxels->GetXLen()),
-          RealToShortReal (myData->myColorVoxels->GetY() + myData->myColorVoxels->GetYLen()),
-          RealToShortReal (myData->myColorVoxels->GetZ() + myData->myColorVoxels->GetZLen()),
-          1.0f);
-
-        aMinPt = aMinPt.cwiseMin (aColorVoxelsMin);
-        aMaxPt = aMaxPt.cwiseMax (aColorVoxelsMax);
-    }
-    if(myData->myROctBoolVoxels)
-    {
-        Graphic3d_Vec4 aROctBoolVoxelsMin (RealToShortReal (myData->myROctBoolVoxels->GetX()),
-                                           RealToShortReal (myData->myROctBoolVoxels->GetY()),
-                                           RealToShortReal (myData->myROctBoolVoxels->GetZ()),
-                                           1.0f);
-        Graphic3d_Vec4 aROctBoolVoxelsMax (
-          RealToShortReal (myData->myROctBoolVoxels->GetX() + myData->myROctBoolVoxels->GetXLen()),
-          RealToShortReal (myData->myROctBoolVoxels->GetY() + myData->myROctBoolVoxels->GetYLen()),
-          RealToShortReal (myData->myROctBoolVoxels->GetZ() + myData->myROctBoolVoxels->GetZLen()),
-          1.0f);
-
-        aMinPt = aMinPt.cwiseMin (aROctBoolVoxelsMin);
-        aMaxPt = aMaxPt.cwiseMax (aROctBoolVoxelsMax);
-    }
-    if (!myData->myTriangulation.IsNull())
-    {
-        Standard_Real x, y, z;
-        const TColgp_Array1OfPnt& nodes = myData->myTriangulation->Nodes();
-        Standard_Integer inode = nodes.Lower(), nb_nodes = nodes.Upper();
-        for (; inode <= nb_nodes; inode++)
-        {
-            nodes.Value(inode).Coord(x, y, z);
-            Graphic3d_Vec4 aNodeCoord (RealToShortReal (x),
-                                       RealToShortReal (y),
-                                       RealToShortReal (z),
-                                       1.0f);
-            aMinPt = aMinPt.cwiseMin (aNodeCoord);
-            aMaxPt = aMaxPt.cwiseMax (aNodeCoord);
-        }
-    }
-
-    if (theMinMax.IsValid())
-    {
-      theMinMax.CornerMin() = aMinPt;
-      theMinMax.CornerMax() = aMaxPt;
-    }
-    else
-    {
-      theMinMax.Add (aMinPt);
-      theMinMax.Add (aMaxPt);
-    }
-}
-
-/**************************************************************************/
-void VoxelClient_VisDrawer::Display(const Standard_Boolean theHighlight)
-{
-    if (!myData)
-        return;
-    if (myData->myBoolVoxels)
-        DisplayVoxels(theHighlight);
-    if (myData->myColorVoxels)
-        DisplayVoxels(theHighlight);
-    if (myData->myROctBoolVoxels)
-        DisplayVoxels(theHighlight);
-    if (!myData->myTriangulation.IsNull())
-        DisplayTriangulation(theHighlight);
-}
-
-// Some static method to define Open GL visual attributes
-// COlor
-static void setColor(const Quantity_Color& color, const Standard_Boolean highlight)
-{
-    static Quantity_Color highlight_color(Quantity_NOC_BLUE1);
-               if(highlight)
-        glColor3f((GLfloat)highlight_color.Red(), (GLfloat)highlight_color.Green(), (GLfloat)highlight_color.Blue());
-    else
-        glColor3d(color.Red(), color.Green(), color.Blue());
-}
-
-// Type of Line
-static void setTypeOfLine(const Aspect_TypeOfLine type)
-{
-    if(type == Aspect_TOL_SOLID)
-    {
-        glDisable(GL_LINE_STIPPLE);
-    }
-    else
-    {
-        glEnable(GL_LINE_STIPPLE);
-        if(type == Aspect_TOL_DOT)
-            glLineStipple(1, 0xCCCC);
-        else if(type == Aspect_TOL_DASH)
-            glLineStipple(1, 0xFFC0);
-        else if(type == Aspect_TOL_DOTDASH)
-            glLineStipple(1, 0xFF18);
-    }
-}
-
-// Width of Line
-static void setWidthOfLine(const Standard_Integer width)
-{
-    glLineWidth((Standard_ShortReal) width);
-}
-
-// Normal of the view
-static void getNormal(gp_Dir& normal) 
-{
-       Standard_Real x, y, z;
-       GLint viewport[4];
-       GLdouble model_matrix[16], proj_matrix[16];
-
-       glGetDoublev(GL_MODELVIEW_MATRIX,  model_matrix);
-       glGetDoublev(GL_PROJECTION_MATRIX, proj_matrix);
-       glGetIntegerv(GL_VIEWPORT, viewport);
-
-       gluUnProject(viewport[0], viewport[1], 0., model_matrix, proj_matrix, viewport, &x, &y, &z);
-       gp_Pnt p1(x, y, z);
-       gluUnProject(viewport[0] + viewport[2], viewport[1], 0., model_matrix, proj_matrix, viewport, &x, &y, &z);
-       gp_Pnt p2(x, y, z);
-       gluUnProject(viewport[0], viewport[1] + viewport[3], 0., model_matrix, proj_matrix, viewport, &x, &y, &z);
-       gp_Pnt p3(x, y, z);
-
-       gce_MakePln mkNormal(p1, p2, p3);
-       if (mkNormal.IsDone()) 
-       {
-               const gp_Pln& normal_plane = mkNormal.Value();
-               normal = normal_plane.Axis().Direction();
-       }
-       else
-       {
-               normal = gp::DZ();
-       }
-}
-
-// Normal 2 VoxelDirection converter
-static VoxelDirection getVoxelDirection(const gp_Dir& viewnormal)
-{
-    VoxelDirection vdir;
-       Standard_Real fabsviewnormalx = fabs(viewnormal.X());
-       Standard_Real fabsviewnormaly = fabs(viewnormal.Y());
-       Standard_Real fabsviewnormalz = fabs(viewnormal.Z());
-       if (fabsviewnormalx >= fabsviewnormaly &&
-               fabsviewnormalx >= fabsviewnormalz)
-       {
-               if (viewnormal.X() > 0)
-                       vdir = Xminus;
-               else
-                       vdir = Xplus;
-       }
-       else if (fabsviewnormaly >= fabsviewnormalx &&
-                        fabsviewnormaly >= fabsviewnormalz)
-       {
-               if (viewnormal.Y() > 0)
-                       vdir = Yminus;
-               else
-                       vdir = Yplus;
-       }
-       else if (fabsviewnormalz >= fabsviewnormalx &&
-                        fabsviewnormalz >= fabsviewnormaly)
-       {
-               if (viewnormal.Z() > 0)
-                       vdir = Zminus;
-               else
-                       vdir = Zplus;
-       }
-    return vdir;
-}
-
-// Normal 2 VoxelDirection 3 converter
-static void getVoxel3Directions(const gp_Dir& viewnormal,
-                                VoxelDirection& vdir1,
-                                VoxelDirection& vdir2,
-                                VoxelDirection& vdir3)
-{
-    Standard_Boolean vdir1_set = Standard_False, vdir2_set = Standard_False, vdir3_set = Standard_False;
-
-    // Test X minus
-    Standard_Real dot = viewnormal.Dot(-gp::DX());
-    if (dot >= 0.0)
-    {
-        if (!vdir1_set)
-        {
-            vdir1 = Xminus;
-            vdir1_set = Standard_True;
-        }
-        else if (!vdir2_set)
-        {
-            vdir2 = Xminus;
-            vdir2_set = Standard_True;
-        }
-        else if (!vdir3_set)
-        {
-            vdir3 = Xminus;
-            vdir3_set = Standard_True;
-        }
-    }
-
-    // Test X plus
-    dot = viewnormal.Dot(gp::DX());
-    if (dot >= 0.0)
-    {
-        if (!vdir1_set)
-        {
-            vdir1 = Xplus;
-            vdir1_set = Standard_True;
-        }
-        else if (!vdir2_set)
-        {
-            vdir2 = Xplus;
-            vdir2_set = Standard_True;
-        }
-        else if (!vdir3_set)
-        {
-            vdir3 = Xplus;
-            vdir3_set = Standard_True;
-        }
-    }
-
-    // Test Y minus
-    dot = viewnormal.Dot(-gp::DY());
-    if (dot >= 0.0)
-    {
-        if (!vdir1_set)
-        {
-            vdir1 = Yminus;
-            vdir1_set = Standard_True;
-        }
-        else if (!vdir2_set)
-        {
-            vdir2 = Yminus;
-            vdir2_set = Standard_True;
-        }
-        else if (!vdir3_set)
-        {
-            vdir3 = Yminus;
-            vdir3_set = Standard_True;
-        }
-    }
-
-    // Test Y plus
-    dot = viewnormal.Dot(gp::DY());
-    if (dot >= 0.0)
-    {
-        if (!vdir1_set)
-        {
-            vdir1 = Yplus;
-            vdir1_set = Standard_True;
-        }
-        else if (!vdir2_set)
-        {
-            vdir2 = Yplus;
-            vdir2_set = Standard_True;
-        }
-        else if (!vdir3_set)
-        {
-            vdir3 = Yplus;
-            vdir3_set = Standard_True;
-        }
-    }
-
-    // Test Z minus
-    dot = viewnormal.Dot(-gp::DZ());
-    if (dot >= 0.0)
-    {
-        if (!vdir1_set)
-        {
-            vdir1 = Zminus;
-            vdir1_set = Standard_True;
-        }
-        else if (!vdir2_set)
-        {
-            vdir2 = Zminus;
-            vdir2_set = Standard_True;
-        }
-        else if (!vdir3_set)
-        {
-            vdir3 = Zminus;
-            vdir3_set = Standard_True;
-        }
-    }
-
-    // Test Y plus
-    dot = viewnormal.Dot(gp::DZ());
-    if (dot >= 0.0)
-    {
-        if (!vdir1_set)
-        {
-            vdir1 = Zplus;
-            vdir1_set = Standard_True;
-        }
-        else if (!vdir2_set)
-        {
-            vdir2 = Zplus;
-            vdir2_set = Standard_True;
-        }
-        else if (!vdir3_set)
-        {
-            vdir3 = Zplus;
-            vdir3_set = Standard_True;
-        }
-    }
-}
-
-static Standard_Boolean CheckSize(Voxel_DS* voxels, 
-                      const Standard_Integer ix, const Standard_Integer iy, const Standard_Integer iz, 
-                      const Standard_Real xmin, const Standard_Real xmax,
-                      const Standard_Real ymin, const Standard_Real ymax,
-                      const Standard_Real zmin, const Standard_Real zmax,
-                      Standard_Real& xc, Standard_Real& yc, Standard_Real& zc)
-{
-    voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-    if (xc < xmin || xc > xmax)
-        return Standard_False;
-    if (yc < ymin || yc > ymax)
-        return Standard_False;
-    if (zc < zmin || zc > zmax)
-        return Standard_False;
-    return Standard_True;
-}
-
-static Standard_Boolean CheckSize(Voxel_ROctBoolDS* voxels, 
-                      const Standard_Integer ix, const Standard_Integer iy, const Standard_Integer iz, 
-                      const Standard_Integer i, const Standard_Integer j,
-                      const Standard_Real xmin, const Standard_Real xmax,
-                      const Standard_Real ymin, const Standard_Real ymax,
-                      const Standard_Real zmin, const Standard_Real zmax,
-                      Standard_Real& xc, Standard_Real& yc, Standard_Real& zc)
-{
-    if (j == -1)
-        voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-    else
-        voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-    if (xc < xmin || xc > xmax)
-        return Standard_False;
-    if (yc < ymin || yc > ymax)
-        return Standard_False;
-    if (zc < zmin || zc > zmax)
-        return Standard_False;
-    return Standard_True;
-}
-
-static void drawBoolPoints(const VoxelDirection vdir, const Standard_Boolean nearest,
-                           Voxel_BoolDS* voxels,
-                           const Standard_Real xmin, const Standard_Real xmax,
-                           const Standard_Real ymin, const Standard_Real ymax,
-                           const Standard_Real zmin, const Standard_Real zmax)
-{
-       Standard_Real xc, yc, zc;
-       Standard_Integer ix = 0, nbx = voxels->GetNbX();
-       Standard_Integer iy = 0, nby = voxels->GetNbY();
-       Standard_Integer iz = 0, nbz = voxels->GetNbZ();
-
-    Standard_Boolean check_size = (xmin <= DBL_MAX && xmax >= DBL_MAX &&
-                       ymin <= DBL_MAX && ymax >= DBL_MAX &&
-                       zmin <= DBL_MAX && zmax >= DBL_MAX);
-    check_size = !check_size;
-
-    glBegin(GL_POINTS);
-    switch (vdir)
-       {
-               case Xminus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = 0; ix < nbx; ix++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                                               Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                               if (value)
-                                               {
-                            if (!check_size)
-                                                           voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                       glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                                               }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Xplus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = nbx - 1; ix >= 0; ix--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                                               Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                               if (value)
-                                               {
-                            if (!check_size)
-                                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                       glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                                               }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = 0; iy < nby; iy++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                                               Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                               if (value)
-                                               {
-                            if (!check_size)
-                                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                       glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                                               }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = nby - 1; iy >= 0; iy--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                                               Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                               if (value)
-                                               {
-                            if (!check_size)
-                                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                       glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                                               }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = 0; iz < nbz; iz++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                                               Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                               if (value)
-                                               {
-                            if (!check_size)
-                                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                       glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                                               }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = nbz - 1; iz >= 0; iz--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                                               Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                               if (value)
-                                               {
-                            if (!check_size)
-                                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                       glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                                               }
-                                       }
-                               }
-                       }
-                       break;
-               }
-       }
-    glEnd();
-}
-
-static void drawROctBoolPoints(const VoxelDirection vdir, const Standard_Boolean nearest,
-                               Voxel_ROctBoolDS* voxels,
-                               const Standard_Real xmin, const Standard_Real xmax,
-                               const Standard_Real ymin, const Standard_Real ymax,
-                               const Standard_Real zmin, const Standard_Real zmax)
-{
-       Standard_Real xc, yc, zc;
-       Standard_Integer ix = 0, nbx = voxels->GetNbX();
-       Standard_Integer iy = 0, nby = voxels->GetNbY();
-       Standard_Integer iz = 0, nbz = voxels->GetNbZ();
-    Standard_Integer i, j;
-
-    Standard_Boolean check_size = (xmin <= DBL_MAX && xmax >= DBL_MAX &&
-                       ymin <= DBL_MAX && ymax >= DBL_MAX &&
-                       zmin <= DBL_MAX && zmax >= DBL_MAX);
-    check_size = !check_size;
-
-    glBegin(GL_POINTS);
-    switch (vdir)
-       {
-               case Xminus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = 0; ix < nbx; ix++)
-                                       {
-                        switch (voxels->Deepness(ix, iy, iz))
-                        {
-                            case 0:
-                            {
-                                if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                    continue;
-                                                       Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                                       if (value)
-                                                       {
-                                    if (!check_size)
-                                                                   ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                               glVertex3d(xc, yc, zc);
-                                    if (nearest)
-                                        break;
-                                                       }
-                                break;
-                            }
-                            case 1:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                                           Standard_Boolean value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                                           if (value)
-                                                           {
-                                        if (!check_size)
-                                                                       voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                                   glVertex3d(xc, yc, zc);
-                                        if (nearest)
-                                            break;
-                                                           }
-                                }
-                                break;
-                            }
-                            case 2:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    for (j = 0; j < 8; j++)
-                                    {
-                                        if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                            continue;
-                                                               Standard_Boolean value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                                               if (value)
-                                                               {
-                                            if (!check_size)
-                                                                           voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                                       glVertex3d(xc, yc, zc);
-                                            if (nearest)
-                                                break;
-                                                               }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Xplus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = nbx - 1; ix >= 0; ix--)
-                                       {
-                        switch (voxels->Deepness(ix, iy, iz))
-                        {
-                            case 0:
-                            {
-                                if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                    continue;
-                                                       Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                                       if (value)
-                                                       {
-                                    if (!check_size)
-                                                                   ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                               glVertex3d(xc, yc, zc);
-                                    if (nearest)
-                                        break;
-                                                       }
-                                break;
-                            }
-                            case 1:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                                           Standard_Boolean value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                                           if (value)
-                                                           {
-                                        if (!check_size)
-                                                                       voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                                   glVertex3d(xc, yc, zc);
-                                        if (nearest)
-                                            break;
-                                                           }
-                                }
-                                break;
-                            }
-                            case 2:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    for (j = 0; j < 8; j++)
-                                    {
-                                        if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                            continue;
-                                                               Standard_Boolean value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                                               if (value)
-                                                               {
-                                            if (!check_size)
-                                                                           voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                                       glVertex3d(xc, yc, zc);
-                                            if (nearest)
-                                                break;
-                                                               }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = 0; iy < nby; iy++)
-                                       {
-                        switch (voxels->Deepness(ix, iy, iz))
-                        {
-                            case 0:
-                            {
-                                if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                    continue;
-                                                       Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                                       if (value)
-                                                       {
-                                    if (!check_size)
-                                                                   ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                               glVertex3d(xc, yc, zc);
-                                    if (nearest)
-                                        break;
-                                                       }
-                                break;
-                            }
-                            case 1:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                                           Standard_Boolean value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                                           if (value)
-                                                           {
-                                        if (!check_size)
-                                                                       voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                                   glVertex3d(xc, yc, zc);
-                                        if (nearest)
-                                            break;
-                                                           }
-                                }
-                                break;
-                            }
-                            case 2:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    for (j = 0; j < 8; j++)
-                                    {
-                                        if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                            continue;
-                                                               Standard_Boolean value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                                               if (value)
-                                                               {
-                                            if (!check_size)
-                                                                           voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                                       glVertex3d(xc, yc, zc);
-                                            if (nearest)
-                                                break;
-                                                               }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = nby - 1; iy >= 0; iy--)
-                                       {
-                        switch (voxels->Deepness(ix, iy, iz))
-                        {
-                            case 0:
-                            {
-                                if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                    continue;
-                                                       Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                                       if (value)
-                                                       {
-                                    if (!check_size)
-                                                                   ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                               glVertex3d(xc, yc, zc);
-                                    if (nearest)
-                                        break;
-                                                       }
-                                break;
-                            }
-                            case 1:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                                           Standard_Boolean value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                                           if (value)
-                                                           {
-                                        if (!check_size)
-                                                                       voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                                   glVertex3d(xc, yc, zc);
-                                        if (nearest)
-                                            break;
-                                                           }
-                                }
-                                break;
-                            }
-                            case 2:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    for (j = 0; j < 8; j++)
-                                    {
-                                        if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                            continue;
-                                                               Standard_Boolean value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                                               if (value)
-                                                               {
-                                            if (!check_size)
-                                                                           voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                                       glVertex3d(xc, yc, zc);
-                                            if (nearest)
-                                                break;
-                                                               }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = 0; iz < nbz; iz++)
-                                       {
-                        switch (voxels->Deepness(ix, iy, iz))
-                        {
-                            case 0:
-                            {
-                                if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                    continue;
-                                                       Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                                       if (value)
-                                                       {
-                                    if (!check_size)
-                                                                   ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                               glVertex3d(xc, yc, zc);
-                                    if (nearest)
-                                        break;
-                                                       }
-                                break;
-                            }
-                            case 1:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                                           Standard_Boolean value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                                           if (value)
-                                                           {
-                                        if (!check_size)
-                                                                       voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                                   glVertex3d(xc, yc, zc);
-                                        if (nearest)
-                                            break;
-                                                           }
-                                }
-                                break;
-                            }
-                            case 2:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    for (j = 0; j < 8; j++)
-                                    {
-                                        if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                            continue;
-                                                               Standard_Boolean value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                                               if (value)
-                                                               {
-                                            if (!check_size)
-                                                                           voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                                       glVertex3d(xc, yc, zc);
-                                            if (nearest)
-                                                break;
-                                                               }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = nbz - 1; iz >= 0; iz--)
-                                       {
-                        switch (voxels->Deepness(ix, iy, iz))
-                        {
-                            case 0:
-                            {
-                                if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                    continue;
-                                                       Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                                                       if (value)
-                                                       {
-                                    if (!check_size)
-                                                                   ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                               glVertex3d(xc, yc, zc);
-                                    if (nearest)
-                                        break;
-                                                       }
-                                break;
-                            }
-                            case 1:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                                           Standard_Boolean value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                                           if (value)
-                                                           {
-                                        if (!check_size)
-                                                                       voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                                   glVertex3d(xc, yc, zc);
-                                        if (nearest)
-                                            break;
-                                                           }
-                                }
-                                break;
-                            }
-                            case 2:
-                            {
-                                for (i = 0; i < 8; i++)
-                                {
-                                    for (j = 0; j < 8; j++)
-                                    {
-                                        if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                            continue;
-                                                               Standard_Boolean value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                                               if (value)
-                                                               {
-                                            if (!check_size)
-                                                                           voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                                       glVertex3d(xc, yc, zc);
-                                            if (nearest)
-                                                break;
-                                                               }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-       }
-    glEnd();
-}
-
-
-
-static void drawColorPoints(const VoxelDirection vdir, const Standard_Boolean nearest,
-                            Voxel_ColorDS* voxels, const Handle(Quantity_HArray1OfColor)& hcolors,
-                            const Standard_Byte minvalue, const Standard_Byte maxvalue,
-                            const Standard_Real xmin, const Standard_Real xmax,
-                            const Standard_Real ymin, const Standard_Real ymax,
-                            const Standard_Real zmin, const Standard_Real zmax)
-{
-       Standard_Real xc, yc, zc;
-       Standard_Integer ix = 0, nbx = voxels->GetNbX();
-       Standard_Integer iy = 0, nby = voxels->GetNbY();
-       Standard_Integer iz = 0, nbz = voxels->GetNbZ();
-    Standard_Byte value;
-
-    // Colors
-    const Quantity_Array1OfColor& colors = hcolors->Array1();
-
-    Standard_Boolean check_size = (xmin <= DBL_MAX && xmax >= DBL_MAX &&
-                       ymin <= DBL_MAX && ymax >= DBL_MAX &&
-                       zmin <= DBL_MAX && zmax >= DBL_MAX);
-    check_size = !check_size;
-
-    glBegin(GL_POINTS);
-    switch (vdir)
-       {
-               case Xminus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = 0; ix < nbx; ix++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                           value = voxels->Get(ix, iy, iz);
-                           if (value >= minvalue && value <= maxvalue)
-                           {
-                            if (!check_size)
-                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            setColor(colors.Value(value), Standard_False);
-                                   glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Xplus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = nbx - 1; ix >= 0; ix--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                           value = voxels->Get(ix, iy, iz);
-                           if (value >= minvalue && value <= maxvalue)
-                           {
-                            if (!check_size)
-                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            setColor(colors.Value(value), Standard_False);
-                                   glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = 0; iy < nby; iy++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                           value = voxels->Get(ix, iy, iz);
-                           if (value >= minvalue && value <= maxvalue)
-                           {
-                            if (!check_size)
-                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            setColor(colors.Value(value), Standard_False);
-                                   glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = nby - 1; iy >= 0; iy--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                           value = voxels->Get(ix, iy, iz);
-                           if (value >= minvalue && value <= maxvalue)
-                           {
-                            if (!check_size)
-                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            setColor(colors.Value(value), Standard_False);
-                                   glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = 0; iz < nbz; iz++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                           value = voxels->Get(ix, iy, iz);
-                           if (value >= minvalue && value <= maxvalue)
-                           {
-                            if (!check_size)
-                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            setColor(colors.Value(value), Standard_False);
-                                   glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = nbz - 1; iz >= 0; iz--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                           value = voxels->Get(ix, iy, iz);
-                           if (value >= minvalue && value <= maxvalue)
-                           {
-                            if (!check_size)
-                                       voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            setColor(colors.Value(value), Standard_False);
-                                   glVertex3d(xc, yc, zc);
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-    }
-    glEnd();
-}
-
-static void drawBoolQuadrangles(Voxel_BoolDS* voxels, const VoxelDirection vdir, 
-                                const gp_Dir& viewnormal, const Standard_Boolean nearest,
-                                const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4,
-                                const Standard_Real xmin, const Standard_Real xmax,
-                                const Standard_Real ymin, const Standard_Real ymax,
-                                const Standard_Real zmin, const Standard_Real zmax)
-{
-    gp_Vec vc;
-    gp_Pnt pc1, pc2, pc3, pc4;
-    Standard_Real xc, yc, zc, xn = 0.0, yn = 0.0, zn = 1.0;
-    Standard_Integer ix, iy, iz, nbx = voxels->GetNbX(), nby = voxels->GetNbY(), nbz = voxels->GetNbZ();
-
-    // Normal
-    viewnormal.Coord(xn, yn, zn);
-
-    Standard_Boolean check_size = (xmin <= DBL_MAX && xmax >= DBL_MAX &&
-                       ymin <= DBL_MAX && ymax >= DBL_MAX &&
-                       zmin <= DBL_MAX && zmax >= DBL_MAX);
-    check_size = !check_size;
-
-    glBegin(GL_QUADS);
-    switch (vdir)
-       {
-               case Xminus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = 0; ix < nbx; ix++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                        if (value)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Display
-                            glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                    }
-                               }
-                       }
-                       break;
-               }
-               case Xplus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = nbx - 1; ix >= 0; ix--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                        if (value)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Display
-                            glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = 0; iy < nby; iy++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                        if (value)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Display
-                            glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = nby - 1; iy >= 0; iy--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                        if (value)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Display
-                            glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = 0; iz < nbz; iz++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                        if (value)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Display
-                            glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = nbz - 1; iz >= 0; iz--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        Standard_Boolean value = voxels->Get(ix, iy, iz) == Standard_True;
-                        if (value)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Display
-                            glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-    }
-    glEnd();
-}
-
-static void drawROctBoolQuadrangles(Voxel_ROctBoolDS* voxels, const VoxelDirection vdir, 
-                                    const gp_Dir& viewnormal, const Standard_Boolean nearest,
-                                    const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4,
-                                    const Standard_Real xmin, const Standard_Real xmax,
-                                    const Standard_Real ymin, const Standard_Real ymax,
-                                    const Standard_Real zmin, const Standard_Real zmax)
-{
-    gp_Vec vc;
-    gp_Pnt pc1, pc2, pc3, pc4;
-    Standard_Real xc, yc, zc, xn = 0.0, yn = 0.0, zn = 1.0;
-    Standard_Integer ix, iy, iz, nbx = voxels->GetNbX(), nby = voxels->GetNbY(), nbz = voxels->GetNbZ(), i, j, deepness;
-
-    // Normal
-    viewnormal.Coord(xn, yn, zn);
-
-    Standard_Boolean check_size = (xmin <= DBL_MAX && xmax >= DBL_MAX &&
-                       ymin <= DBL_MAX && ymax >= DBL_MAX &&
-                       zmin <= DBL_MAX && zmax >= DBL_MAX);
-    check_size = !check_size;
-
-    glBegin(GL_QUADS);
-    switch (vdir)
-       {
-               case Xminus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = 0; ix < nbx; ix++)
-                                       {
-                        deepness = voxels->Deepness(ix, iy, iz);
-                        for (i = 0; i < 8; i++)
-                        {
-                            for (j = 0; j < 8; j++)
-                            {
-                                if (deepness == 0 && j)
-                                {
-                                    i = 8;
-                                    break;
-                                }
-                                if (deepness == 1 && j)
-                                    break;
-                                if (deepness == 0)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 1)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 2)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-
-                                Standard_Boolean value;
-                                switch (deepness)
-                                {
-                                    case 0:
-                                        value = voxels->Get(ix, iy, iz) == Standard_True;
-                                        break;
-                                    case 1:
-                                        value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                        break;
-                                    case 2:
-                                        value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                        break;
-                                }
-                                
-                                if (value)
-                                {
-                                    // Define translation vector
-                                    if (!check_size)
-                                    {
-                                        switch (deepness)
-                                        {
-                                            case 0:
-                                                ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                break;
-                                            case 1:
-                                                voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                break;
-                                            case 2:
-                                                voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                break;
-                                        }
-                                    }
-                                    vc.SetCoord(xc, yc, zc);
-
-                                    // Translate
-                                    pc1 = p1.Translated(vc);
-                                    pc2 = p2.Translated(vc);
-                                    pc3 = p3.Translated(vc);
-                                    pc4 = p4.Translated(vc);
-
-                                    // Display
-                                    glNormal3d(xn, yn, zn);
-                                    pc1.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc2.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc3.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc4.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-
-                                    if (nearest)
-                                        break;
-                                }
-                            }
-                        }
-                    }
-                               }
-                       }
-                       break;
-               }
-               case Xplus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = nbx - 1; ix >= 0; ix--)
-                                       {
-                        deepness = voxels->Deepness(ix, iy, iz);
-                        for (i = 0; i < 8; i++)
-                        {
-                            for (j = 0; j < 8; j++)
-                            {
-                                if (deepness == 0 && j)
-                                {
-                                    i = 8;
-                                    break;
-                                }
-                                if (deepness == 1 && j)
-                                    break;
-                                if (deepness == 0)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 1)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 2)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-
-                                Standard_Boolean value;
-                                switch (deepness)
-                                {
-                                    case 0:
-                                        value = voxels->Get(ix, iy, iz) == Standard_True;
-                                        break;
-                                    case 1:
-                                        value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                        break;
-                                    case 2:
-                                        value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                        break;
-                                }
-                                
-                                if (value)
-                                {
-                                    // Define translation vector
-                                    if (!check_size)
-                                    {
-                                        switch (deepness)
-                                        {
-                                            case 0:
-                                                ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                break;
-                                            case 1:
-                                                voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                break;
-                                            case 2:
-                                                voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                break;
-                                        }
-                                    }
-                                    vc.SetCoord(xc, yc, zc);
-
-                                    // Translate
-                                    pc1 = p1.Translated(vc);
-                                    pc2 = p2.Translated(vc);
-                                    pc3 = p3.Translated(vc);
-                                    pc4 = p4.Translated(vc);
-
-                                    // Display
-                                    glNormal3d(xn, yn, zn);
-                                    pc1.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc2.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc3.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc4.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-
-                                    if (nearest)
-                                        break;
-                                }
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = 0; iy < nby; iy++)
-                                       {
-                        deepness = voxels->Deepness(ix, iy, iz);
-                        for (i = 0; i < 8; i++)
-                        {
-                            for (j = 0; j < 8; j++)
-                            {
-                                if (deepness == 0 && j)
-                                {
-                                    i = 8;
-                                    break;
-                                }
-                                if (deepness == 1 && j)
-                                    break;
-                                if (deepness == 0)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 1)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 2)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-
-                                Standard_Boolean value;
-                                switch (deepness)
-                                {
-                                    case 0:
-                                        value = voxels->Get(ix, iy, iz) == Standard_True;
-                                        break;
-                                    case 1:
-                                        value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                        break;
-                                    case 2:
-                                        value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                        break;
-                                }
-                                
-                                if (value)
-                                {
-                                    // Define translation vector
-                                    if (!check_size)
-                                    {
-                                        switch (deepness)
-                                        {
-                                            case 0:
-                                                ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                break;
-                                            case 1:
-                                                voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                break;
-                                            case 2:
-                                                voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                break;
-                                        }
-                                    }
-                                    vc.SetCoord(xc, yc, zc);
-
-                                    // Translate
-                                    pc1 = p1.Translated(vc);
-                                    pc2 = p2.Translated(vc);
-                                    pc3 = p3.Translated(vc);
-                                    pc4 = p4.Translated(vc);
-
-                                    // Display
-                                    glNormal3d(xn, yn, zn);
-                                    pc1.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc2.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc3.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc4.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-
-                                    if (nearest)
-                                        break;
-                                }
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = nby - 1; iy >= 0; iy--)
-                                       {
-                        deepness = voxels->Deepness(ix, iy, iz);
-                        for (i = 0; i < 8; i++)
-                        {
-                            for (j = 0; j < 8; j++)
-                            {
-                                if (deepness == 0 && j)
-                                {
-                                    i = 8;
-                                    break;
-                                }
-                                if (deepness == 1 && j)
-                                    break;
-                                if (deepness == 0)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 1)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 2)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-
-                                Standard_Boolean value;
-                                switch (deepness)
-                                {
-                                    case 0:
-                                        value = voxels->Get(ix, iy, iz) == Standard_True;
-                                        break;
-                                    case 1:
-                                        value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                        break;
-                                    case 2:
-                                        value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                        break;
-                                }
-                                
-                                if (value)
-                                {
-                                    // Define translation vector
-                                    if (!check_size)
-                                    {
-                                        switch (deepness)
-                                        {
-                                            case 0:
-                                                ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                break;
-                                            case 1:
-                                                voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                break;
-                                            case 2:
-                                                voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                break;
-                                        }
-                                    }
-                                    vc.SetCoord(xc, yc, zc);
-
-                                    // Translate
-                                    pc1 = p1.Translated(vc);
-                                    pc2 = p2.Translated(vc);
-                                    pc3 = p3.Translated(vc);
-                                    pc4 = p4.Translated(vc);
-
-                                    // Display
-                                    glNormal3d(xn, yn, zn);
-                                    pc1.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc2.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc3.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc4.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-
-                                    if (nearest)
-                                        break;
-                                }
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = 0; iz < nbz; iz++)
-                                       {
-                        deepness = voxels->Deepness(ix, iy, iz);
-                        for (i = 0; i < 8; i++)
-                        {
-                            for (j = 0; j < 8; j++)
-                            {
-                                if (deepness == 0 && j)
-                                {
-                                    i = 8;
-                                    break;
-                                }
-                                if (deepness == 1 && j)
-                                    break;
-                                if (deepness == 0)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 1)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 2)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-
-                                Standard_Boolean value;
-                                switch (deepness)
-                                {
-                                    case 0:
-                                        value = voxels->Get(ix, iy, iz) == Standard_True;
-                                        break;
-                                    case 1:
-                                        value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                        break;
-                                    case 2:
-                                        value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                        break;
-                                }
-                                
-                                if (value)
-                                {
-                                    // Define translation vector
-                                    if (!check_size)
-                                    {
-                                        switch (deepness)
-                                        {
-                                            case 0:
-                                                ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                break;
-                                            case 1:
-                                                voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                break;
-                                            case 2:
-                                                voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                break;
-                                        }
-                                    }
-                                    vc.SetCoord(xc, yc, zc);
-
-                                    // Translate
-                                    pc1 = p1.Translated(vc);
-                                    pc2 = p2.Translated(vc);
-                                    pc3 = p3.Translated(vc);
-                                    pc4 = p4.Translated(vc);
-
-                                    // Display
-                                    glNormal3d(xn, yn, zn);
-                                    pc1.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc2.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc3.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc4.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-
-                                    if (nearest)
-                                        break;
-                                }
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = nbz - 1; iz >= 0; iz--)
-                                       {
-                        deepness = voxels->Deepness(ix, iy, iz);
-                        for (i = 0; i < 8; i++)
-                        {
-                            for (j = 0; j < 8; j++)
-                            {
-                                if (deepness == 0 && j)
-                                {
-                                    i = 8;
-                                    break;
-                                }
-                                if (deepness == 1 && j)
-                                    break;
-                                if (deepness == 0)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 1)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, -1, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-                                else if (deepness == 2)
-                                {
-                                    if (check_size && !CheckSize(voxels, ix, iy, iz, i, j, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                                        continue;
-                                }
-
-                                Standard_Boolean value;
-                                switch (deepness)
-                                {
-                                    case 0:
-                                        value = voxels->Get(ix, iy, iz) == Standard_True;
-                                        break;
-                                    case 1:
-                                        value = voxels->Get(ix, iy, iz, i) == Standard_True;
-                                        break;
-                                    case 2:
-                                        value = voxels->Get(ix, iy, iz, i, j) == Standard_True;
-                                        break;
-                                }
-                                
-                                if (value)
-                                {
-                                    // Define translation vector
-                                    if (!check_size)
-                                    {
-                                        switch (deepness)
-                                        {
-                                            case 0:
-                                                ((Voxel_DS*)voxels)->GetCenter(ix, iy, iz, xc, yc, zc);
-                                                break;
-                                            case 1:
-                                                voxels->GetCenter(ix, iy, iz, i, xc, yc, zc);
-                                                break;
-                                            case 2:
-                                                voxels->GetCenter(ix, iy, iz, i, j, xc, yc, zc);
-                                                break;
-                                        }
-                                    }
-                                    vc.SetCoord(xc, yc, zc);
-
-                                    // Translate
-                                    pc1 = p1.Translated(vc);
-                                    pc2 = p2.Translated(vc);
-                                    pc3 = p3.Translated(vc);
-                                    pc4 = p4.Translated(vc);
-
-                                    // Display
-                                    glNormal3d(xn, yn, zn);
-                                    pc1.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc2.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc3.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-                                    pc4.Coord(xc, yc, zc);
-                                    glVertex3d(xc, yc, zc);
-
-                                    if (nearest)
-                                        break;
-                                }
-                            }
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-    }
-    glEnd();
-}
-
-
-
-static void drawColorQuadrangles(Voxel_ColorDS* voxels, const VoxelDirection vdir, 
-                                 const gp_Dir& viewnormal, const Standard_Boolean nearest,
-                                 const Handle(Quantity_HArray1OfColor)& hcolors,
-                                 const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4,
-                                 const Standard_Byte minvalue, const Standard_Byte maxvalue,
-                                 const Standard_Real xmin, const Standard_Real xmax,
-                                 const Standard_Real ymin, const Standard_Real ymax,
-                                 const Standard_Real zmin, const Standard_Real zmax)
-{
-    gp_Vec vc;
-    gp_Pnt pc1, pc2, pc3, pc4;
-    Standard_Real xc, yc, zc, xn = 0.0, yn = 0.0, zn = 0.0;
-    Standard_Integer ix, iy, iz, nbx = voxels->GetNbX(), nby = voxels->GetNbY(), nbz = voxels->GetNbZ();
-    Standard_Byte value;
-
-    // Normal
-    //viewnormal.Coord(xn, yn, zn);
-    glNormal3d(xn, yn, zn);
-
-    // Colors
-    const Quantity_Array1OfColor& colors = hcolors->Array1();
-
-    Standard_Boolean check_size = (xmin <= DBL_MAX && xmax >= DBL_MAX &&
-                       ymin <= DBL_MAX && ymax >= DBL_MAX &&
-                       zmin <= DBL_MAX && zmax >= DBL_MAX);
-    check_size = !check_size;
-
-    glBegin(GL_QUADS);
-    switch (vdir)
-       {
-               case Xminus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = 0; ix < nbx; ix++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        value = voxels->Get(ix, iy, iz);
-                        if (value >= minvalue && value <= maxvalue)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Color
-                            setColor(colors.Value(value), Standard_False);
-
-                            // Display
-                            //glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                    }
-                               }
-                       }
-                       break;
-               }
-               case Xplus:
-               {
-                       for (iy = 0; iy < nby; iy++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (ix = nbx - 1; ix >= 0; ix--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        value = voxels->Get(ix, iy, iz);
-                        if (value >= minvalue && value <= maxvalue)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Color
-                            setColor(colors.Value(value), Standard_False);
-
-                            // Display
-                            //glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = 0; iy < nby; iy++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        value = voxels->Get(ix, iy, iz);
-                        if (value >= minvalue && value <= maxvalue)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Color
-                            setColor(colors.Value(value), Standard_False);
-
-                            // Display
-                            //glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Yplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iz = 0; iz < nbz; iz++)
-                               {
-                                       for (iy = nby - 1; iy >= 0; iy--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        value = voxels->Get(ix, iy, iz);
-                        if (value >= minvalue && value <= maxvalue)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Color
-                            setColor(colors.Value(value), Standard_False);
-
-                            // Display
-                            //glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zminus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = 0; iz < nbz; iz++)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        value = voxels->Get(ix, iy, iz);
-                        if (value >= minvalue && value <= maxvalue)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Color
-                            setColor(colors.Value(value), Standard_False);
-
-                            // Display
-                            //glNormal3d(xn, yn, zn);
-                            pc1.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc2.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc3.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-                            pc4.Coord(xc, yc, zc);
-                            glVertex3d(xc, yc, zc);
-
-                            if (nearest)
-                                break;
-                        }
-                                       }
-                               }
-                       }
-                       break;
-               }
-               case Zplus:
-               {
-                       for (ix = 0; ix < nbx; ix++)
-                       {
-                               for (iy = 0; iy < nby; iy++)
-                               {
-                                       for (iz = nbz - 1; iz >= 0; iz--)
-                                       {
-                        if (check_size && !CheckSize(voxels, ix, iy, iz, xmin, xmax, ymin, ymax, zmin, zmax, xc, yc, zc))
-                            continue;
-                        value = voxels->Get(ix, iy, iz);
-                        if (value >= minvalue && value <= maxvalue)
-                        {
-                            // Define translation vector
-                            if (!check_size)
-                                voxels->GetCenter(ix, iy, iz, xc, yc, zc);
-                            vc.SetCoord(xc, yc, zc);
-
-                            // Translate
-                            pc1 = p1.Translated(vc);
-                            pc2 = p2.Translated(vc);
-                            pc3 = p3.Translated(vc);
-                            pc4 = p4.Translated(vc);
-
-                            // Color
-                            setColor(colors.Value(value), Standard_False);
-
-          &nb