diff --git a/adm/MODULES b/adm/MODULES
index 566647483f..10b1b2c6b8 100644
--- a/adm/MODULES
+++ b/adm/MODULES
@@ -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
diff --git a/adm/UDLIST b/adm/UDLIST
index 35248dbf5f..56446c378a 100644
--- a/adm/UDLIST
+++ b/adm/UDLIST
@@ -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
diff --git a/dox/FILES_HTML.txt b/dox/FILES_HTML.txt
index 7db38e4504..a1ef0b24e6 100644
--- a/dox/FILES_HTML.txt
+++ b/dox/FILES_HTML.txt
@@ -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
diff --git a/dox/FILES_PDF.txt b/dox/FILES_PDF.txt
index 3d1d797a1e..f4f7ffcdcb 100644
--- a/dox/FILES_PDF.txt
+++ b/dox/FILES_PDF.txt
@@ -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
diff --git a/dox/dev_guides/tests/tests.md b/dox/dev_guides/tests/tests.md
index fe36b4208c..2004d4850f 100644
--- a/dox/dev_guides/tests/tests.md
+++ b/dox/dev_guides/tests/tests.md
@@ -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
diff --git a/dox/overview/overview.md b/dox/overview/overview.md
index 199ebcd4d6..21957069ad 100644
--- a/dox/overview/overview.md
+++ b/dox/overview/overview.md
@@ -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:** Voxels User's guide
-
**Remarks:**
* Qt samples are available on all supported platforms;
diff --git a/dox/technical_overview/technical_overview.md b/dox/technical_overview/technical_overview.md
index 85fbcbf678..f0077cee03 100644
--- a/dox/technical_overview/technical_overview.md
+++ b/dox/technical_overview/technical_overview.md
@@ -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 E-learning & Training offerings.
diff --git a/dox/user_guides/user_guides.md b/dox/user_guides/user_guides.md
index 70b1a20a72..289ed21f3c 100644
--- a/dox/user_guides/user_guides.md
+++ b/dox/user_guides/user_guides.md
@@ -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
index 3e08944508..0000000000
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
index 666bca154e..0000000000
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
index 33bd9cc32a..0000000000
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
index 5d9222144a..0000000000
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
index 0e1723ce69..0000000000
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
index 9671a0afd5..0000000000
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
index 7228234e56..0000000000
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
index b024013e00..0000000000
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
index d6e05c5787..0000000000
--- a/dox/user_guides/voxels_wp/voxels_wp.md
+++ /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.
-* \::Fuse() summarizes the values of the corresponding voxels and limits the result by the upper limit (if succeeded).
-* \::Cut() 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
index 00a81bed2a..0000000000
--- a/samples/qt/VoxelDemo/VoxelDemo-vc10.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-
-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
index 7bf6231f7d..0000000000
--- a/samples/qt/VoxelDemo/VoxelDemo-vc12.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-
-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
index fabee776e4..0000000000
--- a/samples/qt/VoxelDemo/VoxelDemo-vc9.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-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
index 90a408003c..0000000000
--- a/samples/qt/VoxelDemo/VoxelDemo.pro
+++ /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
index 997b1612b8..0000000000
--- a/samples/qt/VoxelDemo/genproj.bat
+++ /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
index 48116014fb..0000000000
--- a/samples/qt/VoxelDemo/inc/Application.h
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef APPLICATION_H
-#define APPLICATION_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#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
index 0b1b146dfd..0000000000
--- a/samples/qt/VoxelDemo/inc/ConversionThread.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _CONVERSIONTHREAD_H_
-#define _CONVERSIONTHREAD_H_
-
-#include
-//#include
-#include
-
-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
index 338d7dc31b..0000000000
--- a/samples/qt/VoxelDemo/inc/Timer.h
+++ /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
-
-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
index 41c8f2dff5..0000000000
--- a/samples/qt/VoxelDemo/inc/Viewer.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _VIEWER_H_
-#define _VIEWER_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-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
index d79dbd0985..0000000000
--- a/samples/qt/VoxelDemo/inc/VoxelClient_VisDrawer.h
+++ /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
-
-#include
-
-//! 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
index cccdc4032d..0000000000
--- a/samples/qt/VoxelDemo/msvc.bat
+++ /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
index 87a3009028..0000000000
--- a/samples/qt/VoxelDemo/run.bat
+++ /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
index c7d5896a7e..0000000000
--- a/samples/qt/VoxelDemo/src/Application.cpp
+++ /dev/null
@@ -1,2343 +0,0 @@
-#include "Application.h"
-#include "ConversionThread.h"
-#include "Timer.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-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!"<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..."< 0.001)
- cout<<"Wrong value!"< 0.001)
- cout<<"Wrong value!"< 0.001)
- cout<<"Wrong value!"< 0.001)
- cout<<"Wrong value!"<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
index 6fee824a80..0000000000
--- a/samples/qt/VoxelDemo/src/ConversionThread.cpp
+++ /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
index e5f91752ea..0000000000
--- a/samples/qt/VoxelDemo/src/Main.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include
-#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
index 783b004290..0000000000
--- a/samples/qt/VoxelDemo/src/Timer.cpp
+++ /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<