├── .gitattributes ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── LICENSE.txt ├── README.rst ├── appveyor.yml ├── bindings ├── c │ ├── displaz.c │ └── example.c ├── cpp │ ├── displaz.h │ └── example.cpp ├── matlab │ ├── dclf.m │ ├── dhold.m │ ├── dplot.m │ └── get_dcursor_pos.m └── python │ ├── .gitignore │ ├── displaz.py │ └── example.py ├── cmake ├── DeployQt5.cmake ├── FindGLEW.cmake ├── FindImath.cmake ├── FindLASlib.cmake └── GitUtils.cmake ├── doc └── userguide.rst ├── docker ├── README.md ├── debian_bookworm │ └── Dockerfile ├── debian_bullseye │ └── Dockerfile ├── debian_buster │ └── Dockerfile ├── fedora_32 │ └── Dockerfile ├── fedora_33 │ └── Dockerfile ├── fedora_34 │ └── Dockerfile ├── fedora_35 │ └── Dockerfile ├── fedora_36 │ └── Dockerfile ├── fedora_37 │ └── Dockerfile ├── fedora_38 │ └── Dockerfile ├── fedora_39 │ └── Dockerfile ├── fedora_40 │ └── Dockerfile ├── fedora_41 │ └── Dockerfile ├── fedora_42 │ └── Dockerfile ├── ubuntu_16_04 │ └── Dockerfile ├── ubuntu_18_04 │ └── Dockerfile ├── ubuntu_20_04 │ └── Dockerfile ├── ubuntu_22_04 │ └── Dockerfile └── ubuntu_24_04 │ └── Dockerfile ├── package ├── FileAssoc.nsh ├── NSIS.InstallOptions.ini.in ├── displaz.ico ├── icon.svg ├── make_icon.sh └── windows_resources.rc ├── shaders ├── annotation.glsl ├── axes_label.glsl ├── axes_lines.glsl ├── axes_quad.glsl ├── bounding_box.glsl ├── cursor.glsl ├── cylindrical_proj.glsl ├── distance.glsl ├── generic_points.glsl ├── grid.glsl ├── las_points.glsl ├── las_points_lod.glsl ├── lod_debug.glsl ├── meshedge.glsl ├── meshface.glsl ├── point_normals.glsl ├── point_vectors.glsl ├── selection_sphere.glsl └── simple_example.glsl ├── src ├── CMakeLists.txt ├── DrawCostModel.cpp ├── DrawCostModel.h ├── HookFormatter.cpp ├── HookFormatter.h ├── HookManager.cpp ├── HookManager.h ├── InterProcessLock.cpp ├── InterProcessLock.h ├── InterProcessLock_test.cpp ├── IpcChannel.cpp ├── IpcChannel.h ├── PolygonBuilder.cpp ├── PolygonBuilder.h ├── config.h.in.cmake ├── dvox.cpp ├── experimental │ └── pointio.cpp ├── fileloader.h ├── geometrycollection.cpp ├── geometrycollection.h ├── gui │ ├── DataSetListView.cpp │ ├── DataSetListView.h │ ├── DataSetUI.cpp │ ├── DataSetUI.h │ ├── DragSpinBox.h │ ├── GLSLHighlighter.cpp │ ├── GLSLHighlighter.h │ ├── HelpDialog.h │ ├── InteractiveCamera.h │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── QtLogger.cpp │ ├── QtLogger.h │ ├── ShaderEditor.cpp │ ├── ShaderEditor.h │ ├── guimain.cpp │ ├── guimain.h │ └── qtutil.h ├── hcloud.cpp ├── hcloud.h ├── las_io.cpp ├── logger.cpp ├── logger.h ├── main.cpp ├── octreebuilder.h ├── ply_io.cpp ├── ply_io.h ├── pointdb.cpp ├── pointdb.h ├── pointdbwriter.cpp ├── pointdbwriter.h ├── render │ ├── Annotation.cpp │ ├── Annotation.h │ ├── ClipBox.h │ ├── FrameRate.cpp │ ├── FrameRate.h │ ├── GeomField.cpp │ ├── GeomField.h │ ├── Geometry.cpp │ ├── Geometry.h │ ├── GeometryMutator.cpp │ ├── GeometryMutator.h │ ├── HCloudView.cpp │ ├── HCloudView.h │ ├── OctreeNode.h │ ├── PointArray.cpp │ ├── PointArray.h │ ├── TransformState.cpp │ ├── TransformState.h │ ├── TriMesh.cpp │ ├── TriMesh.h │ ├── View3D.cpp │ ├── View3D.h │ ├── gldebug.cpp │ ├── gldebug.h │ ├── glutil.cpp │ └── glutil.h ├── resource.qrc ├── resource │ ├── axes.png │ ├── axes.xcf │ ├── displaz_icon_256.png │ ├── x.png │ ├── xyz.xcf │ ├── y.png │ └── z.png ├── shader │ ├── Enable.cpp │ ├── Enable.h │ ├── Shader.cpp │ ├── Shader.h │ ├── ShaderParam.h │ ├── ShaderProgram.cpp │ └── ShaderProgram.h ├── streampagecache.h ├── streampagecache_test.cpp ├── test_main.cpp ├── typespec.cpp ├── typespec.h ├── util.cpp ├── util.h ├── util_test.cpp ├── voxelizer.cpp └── voxelizer.h ├── test ├── bad_mesh_indices.ply ├── color_lines.ply ├── displaz_ply_points.ply ├── grid.jl ├── grid.ply ├── polygon_2d.ply ├── polygon_explicitly_closed.ply ├── polygon_holes.ply ├── polygon_oriented_complex.ply ├── polygon_simple.ply ├── single_point.ply ├── standard_ply_points.ply ├── testhook_draw_polygons.sh ├── tetrahedra.ply ├── textured.ply ├── triangles.ply └── uv_texture.png └── thirdparty ├── argparse.cpp ├── argparse.h ├── catch.hpp ├── external ├── .gitignore ├── CMakeLists.txt └── LAStools │ ├── CHANGES.txt │ ├── CMakeLists.txt │ ├── COPYING.txt │ ├── HALL_OF_SHAME.txt │ ├── LASlib │ ├── .gitignore │ ├── CHANGES.txt │ ├── README.txt │ ├── inc │ │ ├── lascopc.hpp │ │ ├── lasdefinitions.hpp │ │ ├── lasfilter.hpp │ │ ├── lasignore.hpp │ │ ├── laskdtree.hpp │ │ ├── lasprogress.hpp │ │ ├── lasreader.hpp │ │ ├── lasreader_asc.hpp │ │ ├── lasreader_bil.hpp │ │ ├── lasreader_bin.hpp │ │ ├── lasreader_dtm.hpp │ │ ├── lasreader_las.hpp │ │ ├── lasreader_ply.hpp │ │ ├── lasreader_qfit.hpp │ │ ├── lasreader_shp.hpp │ │ ├── lasreader_txt.hpp │ │ ├── lasreaderbuffered.hpp │ │ ├── lasreadermerged.hpp │ │ ├── lasreaderpipeon.hpp │ │ ├── lasreaderstored.hpp │ │ ├── lastransform.hpp │ │ ├── lasutility.hpp │ │ ├── lasvlr.hpp │ │ ├── lasvlrpayload.hpp │ │ ├── laswaveform13reader.hpp │ │ ├── laswaveform13writer.hpp │ │ ├── laswriter.hpp │ │ ├── laswriter_bin.hpp │ │ ├── laswriter_las.hpp │ │ ├── laswriter_qfit.hpp │ │ ├── laswriter_txt.hpp │ │ ├── laswriter_wrl.hpp │ │ └── laswritercompatible.hpp │ └── src │ │ ├── CMakeLists.txt │ │ ├── Makefile │ │ ├── fopen_compressed.cpp │ │ ├── lascopc.cpp │ │ ├── lasfilter.cpp │ │ ├── lasignore.cpp │ │ ├── laskdtree.cpp │ │ ├── laslib-config.cmake │ │ ├── lasreader.cpp │ │ ├── lasreader_asc.cpp │ │ ├── lasreader_bil.cpp │ │ ├── lasreader_bin.cpp │ │ ├── lasreader_dtm.cpp │ │ ├── lasreader_las.cpp │ │ ├── lasreader_ply.cpp │ │ ├── lasreader_qfit.cpp │ │ ├── lasreader_shp.cpp │ │ ├── lasreader_txt.cpp │ │ ├── lasreaderbuffered.cpp │ │ ├── lasreadermerged.cpp │ │ ├── lasreaderpipeon.cpp │ │ ├── lasreaderstored.cpp │ │ ├── lastransform.cpp │ │ ├── lasutility.cpp │ │ ├── lasvlr.cpp │ │ ├── laswaveform13reader.cpp │ │ ├── laswaveform13writer.cpp │ │ ├── laswriter.cpp │ │ ├── laswriter_bin.cpp │ │ ├── laswriter_las.cpp │ │ ├── laswriter_qfit.cpp │ │ ├── laswriter_txt.cpp │ │ ├── laswriter_wrl.cpp │ │ └── laswritercompatible.cpp │ ├── LASzip │ ├── CHANGES.txt │ ├── CMakeLists.txt │ ├── COPYING.txt │ ├── LICENSE.txt │ ├── Makefile │ ├── README.txt │ ├── dll │ │ ├── CMakeLists.txt │ │ ├── demzip_api.c │ │ ├── demzip_api.h │ │ ├── laszip_api.c │ │ ├── laszip_api.h │ │ ├── laszip_dll.c │ │ └── laszip_dll.h │ ├── include │ │ └── laszip │ │ │ └── laszip_api_version.h │ └── src │ │ ├── CMakeLists.txt │ │ ├── Makefile │ │ ├── arithmeticdecoder.cpp │ │ ├── arithmeticdecoder.hpp │ │ ├── arithmeticencoder.cpp │ │ ├── arithmeticencoder.hpp │ │ ├── arithmeticmodel.cpp │ │ ├── arithmeticmodel.hpp │ │ ├── bytestreamin.hpp │ │ ├── bytestreamin_array.hpp │ │ ├── bytestreamin_file.hpp │ │ ├── bytestreamin_istream.hpp │ │ ├── bytestreaminout.hpp │ │ ├── bytestreaminout_file.hpp │ │ ├── bytestreamout.hpp │ │ ├── bytestreamout_array.hpp │ │ ├── bytestreamout_file.hpp │ │ ├── bytestreamout_nil.hpp │ │ ├── bytestreamout_ostream.hpp │ │ ├── demzip_dll.cpp │ │ ├── endian.hpp │ │ ├── integercompressor.cpp │ │ ├── integercompressor.hpp │ │ ├── lasattributer.hpp │ │ ├── lasindex.cpp │ │ ├── lasindex.hpp │ │ ├── lasinterval.cpp │ │ ├── lasinterval.hpp │ │ ├── lasmessage.cpp │ │ ├── lasmessage.hpp │ │ ├── laspoint.hpp │ │ ├── lasquadtree.cpp │ │ ├── lasquadtree.hpp │ │ ├── lasquantizer.hpp │ │ ├── lasreaditem.hpp │ │ ├── lasreaditemcompressed_v1.cpp │ │ ├── lasreaditemcompressed_v1.hpp │ │ ├── lasreaditemcompressed_v2.cpp │ │ ├── lasreaditemcompressed_v2.hpp │ │ ├── lasreaditemcompressed_v3.cpp │ │ ├── lasreaditemcompressed_v3.hpp │ │ ├── lasreaditemcompressed_v4.cpp │ │ ├── lasreaditemcompressed_v4.hpp │ │ ├── lasreaditemraw.hpp │ │ ├── lasreadpoint.cpp │ │ ├── lasreadpoint.hpp │ │ ├── lasunzipper.cpp │ │ ├── lasunzipper.hpp │ │ ├── laswriteitem.hpp │ │ ├── laswriteitemcompressed_v1.cpp │ │ ├── laswriteitemcompressed_v1.hpp │ │ ├── laswriteitemcompressed_v2.cpp │ │ ├── laswriteitemcompressed_v2.hpp │ │ ├── laswriteitemcompressed_v3.cpp │ │ ├── laswriteitemcompressed_v3.hpp │ │ ├── laswriteitemcompressed_v4.cpp │ │ ├── laswriteitemcompressed_v4.hpp │ │ ├── laswriteitemraw.hpp │ │ ├── laswritepoint.cpp │ │ ├── laswritepoint.hpp │ │ ├── laszip.cpp │ │ ├── laszip.hpp │ │ ├── laszip_common_v1.hpp │ │ ├── laszip_common_v2.hpp │ │ ├── laszip_common_v3.hpp │ │ ├── laszip_decompress_selective_v3.hpp │ │ ├── laszip_dll.cpp │ │ ├── laszipper.cpp │ │ ├── laszipper.hpp │ │ ├── mydefs.cpp │ │ └── mydefs.hpp │ ├── LICENSE.txt │ └── README.txt ├── glew ├── GL │ ├── eglew.h │ ├── glew.h │ ├── glxew.h │ └── wglew.h ├── LICENSE.txt └── glew.c ├── licenses ├── LASlib.txt ├── OpenImageIO.txt ├── Qt.txt ├── README.txt ├── ilmbase.txt └── rply.txt ├── polypartition ├── polypartition.cpp └── polypartition.h ├── rply ├── cube_tri.ply ├── rply.c ├── rply.h └── rplyfile.h └── tinyformat.h /.gitattributes: -------------------------------------------------------------------------------- 1 | *.xcf binary 2 | *.png binary 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build* 2 | /data 3 | gh-pages 4 | *.swp 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - linux 5 | - osx 6 | 7 | sudo: required 8 | dist: trusty # Use ubuntu 14.04 for qt5 support 9 | 10 | compiler: 11 | - gcc 12 | - clang 13 | 14 | env: 15 | matrix: 16 | - DISPLAZ_BUILD_TYPE=Release 17 | - DISPLAZ_BUILD_TYPE=Debug 18 | 19 | # either whitelist or blacklist branches 20 | branches: 21 | only: 22 | - master 23 | # except: 24 | # - experimental 25 | 26 | before_install: 27 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi 28 | - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi 29 | 30 | install: 31 | - > 32 | if [ "$TRAVIS_OS_NAME" == "linux" ]; then 33 | sudo apt-get install -qq -y git g++ cmake qt5-default python-docutils 34 | fi 35 | - > 36 | if [ "$TRAVIS_OS_NAME" == "osx" ]; then 37 | # There seems to be some inconsistency about whether git is installed 38 | # on OSX worker nodes. See https://github.com/github/git-lfs/pull/1557 39 | brew ls --versions git && brew upgrade git || brew install git 40 | brew install qt5 41 | brew unlink qt5 42 | brew link qt5 --force 43 | fi 44 | 45 | before_script: 46 | # Build external tools 47 | - mkdir -p build_external 48 | - cd build_external 49 | - cmake ../thirdparty/external 50 | - make -j4 51 | - cd .. 52 | - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH=/usr/local/opt/qt5/bin:$PATH; fi 53 | 54 | script: 55 | # Build displaz 56 | - mkdir -p build 57 | - cd build 58 | - cmake -DCMAKE_BUILD_TYPE=${DISPLAZ_BUILD_TYPE} .. 59 | - make -j4 60 | # NB: IPC lock test disabled on OSX so that the whole build doesn't fail 61 | # Needs investigation by someone with an OSX machine. 62 | - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then ctest -VV -E InterProcessLock_test ; fi 63 | - if [ "$TRAVIS_OS_NAME" != "osx" ] ; then ctest -VV ; fi 64 | - cd .. 65 | 66 | matrix: 67 | exclude: 68 | # Only check gcc on linux and clang on OS X 69 | - os: linux 70 | compiler: clang 71 | - os: osx 72 | compiler: gcc 73 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Displaz is licensed under the BSD 3-clause license: 2 | 3 | 4 | ---------------------------------------------------------------------------- 5 | Copyright (C) 2012-2015, Christopher J. Foster and the other displaz 6 | contributors: https://github.com/c42f/displaz/contributors 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, 12 | this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | * Neither the name of the software's owners nor the names of its 17 | contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 24 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /bindings/c/example.c: -------------------------------------------------------------------------------- 1 | #include "displaz.c" 2 | 3 | #include 4 | 5 | #define N 1000 6 | 7 | int main() 8 | { 9 | double position[3*N]; 10 | float color[3*N]; 11 | 12 | // Simple example using conical spiral 13 | int i; 14 | for (i = 0; i < N; ++i) 15 | { 16 | double t = 100*(double)i/N - 50; 17 | position[3*i] = t*cos(t); 18 | position[3*i+1] = t*sin(t); 19 | position[3*i+2] = t; 20 | 21 | color[3*i] = (double)i/N; 22 | color[3*i+1] = 0; 23 | color[3*i+2] = 1-(double)i/N; 24 | } 25 | 26 | displaz_points(N, position, color, NULL); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /bindings/cpp/example.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "displaz.h" 5 | #include 6 | 7 | // Simple example of using displaz to plot points from a separate proces 8 | // Compile in C++11 mode. 9 | int main() 10 | { 11 | displaz::Window win; 12 | win.setDebug(true); 13 | 14 | displaz::PointList points; 15 | points.addAttribute("position", 3) 16 | .addAttribute("intensity", 1) 17 | .addAttribute("color", 3); 18 | 19 | 20 | int N = 10000; 21 | for (int i = 0; i < N; ++i) 22 | { 23 | double t = double(i)/N; 24 | double r= 10*sqrt(t) + 2; 25 | points.append(r*cos(200*t), r*sin(200*t), 10*t, 26 | 255*t, 27 | 255*t, 255*(1-t), 0); 28 | } 29 | 30 | points.append(0, 0, 0, 31 | 1000, 32 | 0, 0, 255); 33 | 34 | win.setShader("generic_points.glsl"); 35 | 36 | win.plot(points); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /bindings/matlab/dclf.m: -------------------------------------------------------------------------------- 1 | function dclf() 2 | fixLdLibPath = ''; 3 | if isunix() 4 | % Reset LD_LIBRARY_PATH on unix - matlab adds to it to get the 5 | % matlab version of libraries, which tend to conflict with the 6 | % libraries used when building displaz. 7 | fixLdLibPath = 'env LD_LIBRARY_PATH=""'; 8 | end 9 | system(sprintf('%s displaz -script -clear', fixLdLibPath)); 10 | end 11 | -------------------------------------------------------------------------------- /bindings/matlab/dhold.m: -------------------------------------------------------------------------------- 1 | function dhold(h) 2 | global g_DisplazHold; 3 | 4 | if nargin == 1 && ( isnumeric(h) || islogical(h) ) 5 | g_DisplazHold = logical(h); 6 | elseif nargin == 1 && ischar(h) 7 | if strcmp(h,'on') 8 | g_DisplazHold = true; 9 | elseif strcmp(h,'off') 10 | g_DisplazHold = false; 11 | else 12 | warning('Invalid hold option %s',h); 13 | end 14 | elseif ~isempty(g_DisplazHold) 15 | g_DisplazHold = ~g_DisplazHold; 16 | else 17 | g_DisplazHold = true; 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /bindings/matlab/get_dcursor_pos.m: -------------------------------------------------------------------------------- 1 | function pos = get_dcursor_pos() 2 | 3 | %Get the position of the point under the current displaz cursor focus 4 | 5 | fixLdLibPath = ''; 6 | if isunix() 7 | % Reset LD_LIBRARY_PATH on unix - matlab adds to it to get the 8 | % matlab version of libraries, which tend to conflict with the 9 | % libraries used when building displaz. 10 | fixLdLibPath = 'env LD_LIBRARY_PATH=""'; 11 | end 12 | 13 | commandLine = sprintf('%s displaz -querycursor', fixLdLibPath); 14 | 15 | [exitStatus, commandStdout] = system(commandLine); 16 | 17 | if exitStatus ~= 0 18 | errorStr = []; 19 | errorStr = strcat(errorStr, sprintf('ERROR: Failed to get displaz cursor position. Stdout was:\n')); 20 | errorStr = strcat(errorStr, sprintf('\n%s\n',commandStdout)); 21 | errorStr = strcat(errorStr, sprintf('\nERROR: Command Line used was:\n')); 22 | errorStr = strcat(errorStr, sprintf('\n%s\n',commandLine)); 23 | error(errorStr); 24 | end 25 | 26 | pos = sscanf(commandStdout,'%f')'; -------------------------------------------------------------------------------- /bindings/python/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /bindings/python/example.py: -------------------------------------------------------------------------------- 1 | import displaz 2 | from numpy.random import randn, rand 3 | 4 | N = 100000 5 | displaz.plot(40*randn(N, 3), color=rand(N,3)*[1,0.2,0.8]) 6 | -------------------------------------------------------------------------------- /cmake/FindGLEW.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Try to find GLEW library and include path. 3 | # Once done this will define 4 | # 5 | # GLEW_FOUND 6 | # GLEW_INCLUDE_DIR 7 | # GLEW_LIBRARY 8 | # 9 | 10 | IF (WIN32) 11 | FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h 12 | $ENV{PROGRAMFILES}/GLEW/include 13 | ${GLEW_ROOT_DIR}/include 14 | DOC "The directory where GL/glew.h resides") 15 | 16 | FIND_LIBRARY( GLEW_LIBRARY 17 | NAMES glew GLEW glew32s glew32 18 | PATHS 19 | $ENV{PROGRAMFILES}/GLEW/lib 20 | DOC "The GLEW library") 21 | ELSE (WIN32) 22 | FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h 23 | /usr/include 24 | /usr/local/include 25 | /opt/local/include 26 | ${GLEW_ROOT_DIR}/include 27 | DOC "The directory where GL/glew.h resides") 28 | 29 | # Prefer the static library. 30 | FIND_LIBRARY( GLEW_LIBRARY 31 | NAMES libGLEW.a GLEW 32 | PATHS 33 | /usr/lib64 34 | /usr/lib 35 | /usr/local/lib64 36 | /usr/local/lib 37 | /opt/local/lib 38 | ${GLEW_ROOT_DIR}/lib 39 | DOC "The GLEW library") 40 | ENDIF (WIN32) 41 | 42 | SET(GLEW_FOUND "NO") 43 | IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) 44 | SET(GLEW_LIBRARIES ${GLEW_LIBRARY}) 45 | SET(GLEW_FOUND "YES") 46 | ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) 47 | 48 | mark_as_advanced(GLEW_FOUND) 49 | mark_as_advanced(GLEW_INCLUDE_DIR) 50 | mark_as_advanced(GLEW_LIBRARY) 51 | 52 | 53 | # FindGLEW.cmake original copyright notice from nvidia texture tools: 54 | # 55 | # NVIDIA Texture Tools 2.0 is licensed under the MIT license. 56 | # 57 | # Copyright (c) 2007 NVIDIA Corporation 58 | # 59 | # Permission is hereby granted, free of charge, to any person 60 | # obtaining a copy of this software and associated documentation 61 | # files (the "Software"), to deal in the Software without 62 | # restriction, including without limitation the rights to use, 63 | # copy, modify, merge, publish, distribute, sublicense, and/or sell 64 | # copies of the Software, and to permit persons to whom the 65 | # Software is furnished to do so, subject to the following 66 | # conditions: 67 | # 68 | # The above copyright notice and this permission notice shall be 69 | # included in all copies or substantial portions of the Software. 70 | # 71 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 72 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 73 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 74 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 75 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 76 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 77 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 78 | # OTHER DEALINGS IN THE SOFTWARE. 79 | -------------------------------------------------------------------------------- /cmake/FindImath.cmake: -------------------------------------------------------------------------------- 1 | # Find Imath 2 | # 3 | # This sets: 4 | # - IMATH_FOUND: system has Imath 5 | # - IMATH_INCLUDE_DIRS: the Imath include directories 6 | # - IMATH_LIBRARIES: the Imath libraries 7 | # - IMATH_VERSION: the version string for Imath 8 | 9 | find_path(IMATH_INCLUDE_DIRS Imath/ImathConfig.h) 10 | find_library(IMATH_IMATH_LIBRARY Imath-3_1) 11 | 12 | set(IMATH_LIBRARIES ${IMATH_IMATH_LIBRARY}) 13 | 14 | file(STRINGS ${IMATH_INCLUDE_DIRS}/Imath/ImathConfig.h version_line 15 | REGEX "IMATH_VERSION_STRING|PACKAGE_VERSION") 16 | string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" IMATH_VERSION_STRING ${version_line}) 17 | 18 | include(FindPackageHandleStandardArgs) 19 | find_package_handle_standard_args(Imath 20 | REQUIRED_VARS IMATH_INCLUDE_DIRS IMATH_IMATH_LIBRARY 21 | VERSION_VAR IMATH_VERSION_STRING 22 | ) 23 | 24 | mark_as_advanced(IMATH_IMATH_LIBRARY IMATH_INCLUDE_DIRS) 25 | -------------------------------------------------------------------------------- /cmake/FindLASlib.cmake: -------------------------------------------------------------------------------- 1 | # Find LASlib 2 | # 3 | # This sets: 4 | # - LASLIB_FOUND: system has LASlib 5 | # - LASLIB_INCLUDE_DIRS: the LASlib include directories 6 | # - LASLIB_LIBRARIES: the LASlib library 7 | # - LASLIB_VERSION: the version string for LASlib 8 | 9 | find_path (LASLIB_INCLUDE_DIRS NAMES lasdefinitions.hpp) 10 | find_library (LASLIB_LIBRARY NAMES LASlib) 11 | 12 | set (LASLIB_LIBRARIES ${LASLIB_LIBRARY}) 13 | 14 | if (LASLIB_INCLUDE_DIRS) 15 | file(STRINGS ${LASLIB_INCLUDE_DIRS}/lasdefinitions.hpp version_line 16 | REGEX "#define *LAS_TOOLS_VERSION") 17 | string(REGEX MATCH "[0-9]+" LASLIB_VERSION_STRING ${version_line}) 18 | endif() 19 | 20 | include(FindPackageHandleStandardArgs) 21 | find_package_handle_standard_args(LASlib 22 | REQUIRED_VARS LASLIB_INCLUDE_DIRS LASLIB_LIBRARY 23 | VERSION_VAR LASLIB_VERSION_STRING 24 | ) 25 | 26 | mark_as_advanced(LASLIB_LIBRARY LASLIB_LIBRARIES LASLIB_INCLUDE_DIRS) 27 | -------------------------------------------------------------------------------- /cmake/GitUtils.cmake: -------------------------------------------------------------------------------- 1 | find_package(Git) 2 | 3 | # Call git describe with given argument list and return the output, stripped of 4 | # whitespace 5 | # 6 | # If git returns error, set outputVar to git_describe-NOTFOUND 7 | function(git_describe outputVar) 8 | execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --show-toplevel 9 | OUTPUT_VARIABLE gitTopLevelDir 10 | RESULT_VARIABLE gitResult 11 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 12 | OUTPUT_STRIP_TRAILING_WHITESPACE) 13 | if (NOT gitResult STREQUAL "0") 14 | set(${outputVar} "git_describe-NOTFOUND" PARENT_SCOPE) 15 | return() 16 | endif() 17 | # Crude way to force cmake rerun for any changes a developer makes to the 18 | # HEAD revision - we force cmake to add a file dependency on the internal 19 | # git log file for HEAD. Note that this can't detect changes to git 20 | # describe output due to added tags, but it detects most other things. 21 | # configure_file("${gitTopLevelDir}/.git/logs/HEAD" git_HEAD_change_check COPYONLY) 22 | # Call git describe 23 | execute_process(COMMAND ${GIT_EXECUTABLE} describe ${ARGN} 24 | OUTPUT_VARIABLE gitOutput 25 | RESULT_VARIABLE gitResult 26 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 27 | OUTPUT_STRIP_TRAILING_WHITESPACE) 28 | if (NOT gitResult STREQUAL "0") 29 | set(${outputVar} "git_describe-NOTFOUND" PARENT_SCOPE) 30 | else() 31 | set(${outputVar} ${gitOutput} PARENT_SCOPE) 32 | endif() 33 | endfunction() 34 | 35 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker builds of displaz 2 | 3 | ## Motivation 4 | 5 | Check the displaz builds and tests for a variety of Linux flavours. 6 | 7 | ## User Guide 8 | 9 | 1. `docker build --pull docker/ubuntu_24_04` 10 | 2. `docker image prune -af` 11 | 12 | ## Options 13 | 14 | * REPO build from specified from git repository 15 | * MIRROR use Ubuntu package mirror 16 | * Australia: `http://au.archive.ubuntu.com/ubuntu/` 17 | 18 | For example: 19 | 20 | `docker build --pull docker/ubuntu_24_04 --build-arg MIRROR=http://au.archive.ubuntu.com/ubuntu/ ` 21 | 22 | ## Notes 23 | 24 | * Ubuntu 12.04 Precise does not support C++11 required for displaz 25 | * Ubuntu 16.04 Xenial has Qt 5.5.1 - not working 26 | * Ubuntu 18.04 Bionic has Qt 5.9.5 - not working -------------------------------------------------------------------------------- /docker/debian_bookworm/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Debian 12 (bookworm) 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM debian:bookworm 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN apt update 16 | RUN apt dist-upgrade -y 17 | 18 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 19 | RUN apt install -y g++ cmake qtbase5-dev python3 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/debian_bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Debian 11 (bullseye) 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM debian:bullseye 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN apt update 16 | RUN apt dist-upgrade -y 17 | 18 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 19 | RUN apt install -y g++ cmake qtbase5-dev python3 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/debian_buster/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Debian 10 (buster) 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM debian:buster 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN apt update 16 | RUN apt dist-upgrade -y 17 | 18 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 19 | RUN apt install -y g++ cmake qt5-default python-docutils wget 20 | 21 | # CMake 3.12 or higher is required 22 | 23 | RUN wget -nv https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-linux-x86_64.sh 24 | RUN chmod a+x ./cmake-3.25.2-linux-x86_64.sh 25 | 26 | ENV CMAKE_PREFIX /opt/cmake-3.25.2 27 | RUN mkdir -p ${CMAKE_PREFIX} 28 | RUN ./cmake-3.25.2-linux-x86_64.sh --skip-license --prefix=${CMAKE_PREFIX} 29 | 30 | # 31 | # Clone repo 32 | # 33 | 34 | ENV SCRATCH /scratch 35 | RUN mkdir ${SCRATCH} 36 | WORKDIR ${SCRATCH} 37 | 38 | ARG BRANCH 39 | ENV BRANCH ${BRANCH:-master} 40 | 41 | ARG REPO 42 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 43 | 44 | RUN git clone --branch ${BRANCH} ${REPO} repo 45 | 46 | # 47 | # Build 48 | # 49 | 50 | RUN mkdir -p ${SCRATCH}/repo/build_external 51 | WORKDIR ${SCRATCH}/repo/build_external 52 | RUN ${CMAKE_PREFIX}/bin/cmake ../thirdparty/external 53 | RUN make -j 54 | 55 | RUN mkdir -p ${SCRATCH}/repo/build 56 | WORKDIR ${SCRATCH}/repo/build 57 | RUN ${CMAKE_PREFIX}/bin/cmake .. 58 | RUN make -j 59 | 60 | # 61 | # Test 62 | # 63 | 64 | RUN ${CMAKE_PREFIX}/bin/ctest 65 | 66 | # 67 | # Install 68 | # 69 | 70 | RUN make install 71 | RUN find /usr/local 72 | -------------------------------------------------------------------------------- /docker/fedora_32/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 32 3 | 4 | FROM fedora:32 5 | MAINTAINER Nigel Stewart (nigels@nigels.com) 6 | 7 | # 8 | # Update and install build tools, dependencies 9 | # 10 | 11 | ENV DEBIAN_FRONTEND noninteractive 12 | 13 | RUN dnf -y upgrade 14 | 15 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils findutils 16 | 17 | # 18 | # Clone repo 19 | # 20 | 21 | ENV SCRATCH /scratch 22 | RUN mkdir ${SCRATCH} 23 | WORKDIR ${SCRATCH} 24 | 25 | ARG BRANCH 26 | ENV BRANCH ${BRANCH:-master} 27 | 28 | ARG REPO 29 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 30 | 31 | RUN git clone --branch ${BRANCH} ${REPO} repo 32 | 33 | # 34 | # Build 35 | # 36 | 37 | RUN mkdir -p ${SCRATCH}/repo/build_external 38 | WORKDIR ${SCRATCH}/repo/build_external 39 | RUN cmake ../thirdparty/external 40 | RUN make -j 41 | 42 | RUN mkdir -p ${SCRATCH}/repo/build 43 | WORKDIR ${SCRATCH}/repo/build 44 | RUN cmake .. 45 | RUN make -j 46 | 47 | # 48 | # Test 49 | # 50 | 51 | RUN ctest 52 | 53 | # 54 | # Install 55 | # 56 | 57 | RUN make install 58 | RUN find /usr/local 59 | -------------------------------------------------------------------------------- /docker/fedora_33/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 33 3 | 4 | # Fedora 33 EOL: 2021-11-30 5 | 6 | # Status: Confirmed working April 20th 2025 7 | 8 | FROM fedora:33 9 | MAINTAINER Nigel Stewart (nigels@nigels.com) 10 | 11 | # 12 | # Update and install build tools, dependencies 13 | # 14 | 15 | ENV DEBIAN_FRONTEND noninteractive 16 | 17 | RUN dnf -y upgrade 18 | 19 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils findutils 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/fedora_34/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 34 3 | 4 | # Fedora 34 EOL: 2022-06-07 5 | 6 | # Status: Confirmed working April 20th 2025 7 | 8 | FROM fedora:34 9 | MAINTAINER Nigel Stewart (nigels@nigels.com) 10 | 11 | # 12 | # Update and install build tools, dependencies 13 | # 14 | 15 | ENV DEBIAN_FRONTEND noninteractive 16 | 17 | RUN dnf -y upgrade 18 | 19 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils findutils 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/fedora_35/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 35 3 | 4 | # Fedora 35 EOL: 2022-12-13 5 | 6 | # Status: Confirmed working April 20th 2025 7 | 8 | FROM fedora:35 9 | MAINTAINER Nigel Stewart (nigels@nigels.com) 10 | 11 | # 12 | # Update and install build tools, dependencies 13 | # 14 | 15 | ENV DEBIAN_FRONTEND noninteractive 16 | 17 | RUN dnf -y upgrade 18 | 19 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils findutils 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/fedora_36/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 36 3 | 4 | # Fedora 36 EOL: 2023-05-16 5 | 6 | # Status: Confirmed working April 20th 2025 7 | 8 | FROM fedora:36 9 | MAINTAINER Nigel Stewart (nigels@nigels.com) 10 | 11 | # 12 | # Update and install build tools, dependencies 13 | # 14 | 15 | ENV DEBIAN_FRONTEND noninteractive 16 | 17 | RUN dnf -y upgrade 18 | 19 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/fedora_37/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 37 3 | 4 | # Fedora 37 EOL: 2023-12-05 5 | 6 | # Status: Confirmed working April 20th 2025 7 | 8 | FROM fedora:37 9 | MAINTAINER Nigel Stewart (nigels@nigels.com) 10 | 11 | # 12 | # Update and install build tools, dependencies 13 | # 14 | 15 | ENV DEBIAN_FRONTEND noninteractive 16 | 17 | RUN dnf -y upgrade 18 | 19 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 20 | 21 | # 22 | # Clone repo 23 | # 24 | 25 | ENV SCRATCH /scratch 26 | RUN mkdir ${SCRATCH} 27 | WORKDIR ${SCRATCH} 28 | 29 | ARG BRANCH 30 | ENV BRANCH ${BRANCH:-master} 31 | 32 | ARG REPO 33 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 34 | 35 | RUN git clone --branch ${BRANCH} ${REPO} repo 36 | 37 | # 38 | # Build 39 | # 40 | 41 | RUN mkdir -p ${SCRATCH}/repo/build_external 42 | WORKDIR ${SCRATCH}/repo/build_external 43 | RUN cmake ../thirdparty/external 44 | RUN make -j 45 | 46 | RUN mkdir -p ${SCRATCH}/repo/build 47 | WORKDIR ${SCRATCH}/repo/build 48 | RUN cmake .. 49 | RUN make -j 50 | 51 | # 52 | # Test 53 | # 54 | 55 | RUN ctest 56 | 57 | # 58 | # Install 59 | # 60 | 61 | RUN make install 62 | RUN find /usr/local 63 | -------------------------------------------------------------------------------- /docker/fedora_38/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 38 3 | 4 | # Fedora 38 EOL: 2024-05-21 5 | 6 | FROM fedora:38 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN dnf -y upgrade 16 | 17 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 18 | 19 | # 20 | # Clone repo 21 | # 22 | 23 | ENV SCRATCH /scratch 24 | RUN mkdir ${SCRATCH} 25 | WORKDIR ${SCRATCH} 26 | 27 | ARG BRANCH 28 | ENV BRANCH ${BRANCH:-master} 29 | 30 | ARG REPO 31 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 32 | 33 | RUN git clone --branch ${BRANCH} ${REPO} repo 34 | 35 | # 36 | # Build 37 | # 38 | 39 | RUN mkdir -p ${SCRATCH}/repo/build_external 40 | WORKDIR ${SCRATCH}/repo/build_external 41 | RUN cmake ../thirdparty/external 42 | RUN make -j 43 | 44 | RUN mkdir -p ${SCRATCH}/repo/build 45 | WORKDIR ${SCRATCH}/repo/build 46 | RUN cmake .. 47 | RUN make -j 48 | 49 | # 50 | # Test 51 | # 52 | 53 | RUN ctest 54 | 55 | # 56 | # Install 57 | # 58 | 59 | RUN make install 60 | RUN find /usr/local 61 | -------------------------------------------------------------------------------- /docker/fedora_39/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 39 3 | 4 | # Fedora 39 EOL: 2024-11-26 5 | 6 | FROM fedora:39 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN dnf -y upgrade 16 | 17 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 18 | 19 | # 20 | # Clone repo 21 | # 22 | 23 | ENV SCRATCH /scratch 24 | RUN mkdir ${SCRATCH} 25 | WORKDIR ${SCRATCH} 26 | 27 | ARG BRANCH 28 | ENV BRANCH ${BRANCH:-master} 29 | 30 | ARG REPO 31 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 32 | 33 | RUN git clone --branch ${BRANCH} ${REPO} repo 34 | 35 | # 36 | # Build 37 | # 38 | 39 | RUN mkdir -p ${SCRATCH}/repo/build_external 40 | WORKDIR ${SCRATCH}/repo/build_external 41 | RUN cmake ../thirdparty/external 42 | RUN make -j 43 | 44 | RUN mkdir -p ${SCRATCH}/repo/build 45 | WORKDIR ${SCRATCH}/repo/build 46 | RUN cmake .. 47 | RUN make -j 48 | 49 | # 50 | # Test 51 | # 52 | 53 | RUN ctest 54 | 55 | # 56 | # Install 57 | # 58 | 59 | RUN make install 60 | RUN find /usr/local 61 | -------------------------------------------------------------------------------- /docker/fedora_40/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 40 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM fedora:40 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN dnf -y upgrade 16 | 17 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 18 | 19 | # 20 | # Clone repo 21 | # 22 | 23 | ENV SCRATCH /scratch 24 | RUN mkdir ${SCRATCH} 25 | WORKDIR ${SCRATCH} 26 | 27 | ARG BRANCH 28 | ENV BRANCH ${BRANCH:-master} 29 | 30 | ARG REPO 31 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 32 | 33 | RUN git clone --branch ${BRANCH} ${REPO} repo 34 | 35 | # 36 | # Build 37 | # 38 | 39 | RUN mkdir -p ${SCRATCH}/repo/build_external 40 | WORKDIR ${SCRATCH}/repo/build_external 41 | RUN cmake ../thirdparty/external 42 | RUN make -j 43 | 44 | RUN mkdir -p ${SCRATCH}/repo/build 45 | WORKDIR ${SCRATCH}/repo/build 46 | RUN cmake .. 47 | RUN make -j 48 | 49 | # 50 | # Test 51 | # 52 | 53 | RUN ctest 54 | 55 | # 56 | # Install 57 | # 58 | 59 | RUN make install 60 | RUN find /usr/local 61 | -------------------------------------------------------------------------------- /docker/fedora_41/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 41 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM fedora:41 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN dnf -y upgrade 16 | 17 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 18 | 19 | # 20 | # Clone repo 21 | # 22 | 23 | ENV SCRATCH /scratch 24 | RUN mkdir ${SCRATCH} 25 | WORKDIR ${SCRATCH} 26 | 27 | ARG BRANCH 28 | ENV BRANCH ${BRANCH:-master} 29 | 30 | ARG REPO 31 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 32 | 33 | RUN git clone --branch ${BRANCH} ${REPO} repo 34 | 35 | # 36 | # Build 37 | # 38 | 39 | RUN mkdir -p ${SCRATCH}/repo/build_external 40 | WORKDIR ${SCRATCH}/repo/build_external 41 | RUN cmake ../thirdparty/external 42 | RUN make -j 43 | 44 | RUN mkdir -p ${SCRATCH}/repo/build 45 | WORKDIR ${SCRATCH}/repo/build 46 | RUN cmake .. 47 | RUN make -j 48 | 49 | # 50 | # Test 51 | # 52 | 53 | RUN ctest 54 | 55 | # 56 | # Install 57 | # 58 | 59 | RUN make install 60 | RUN find /usr/local 61 | -------------------------------------------------------------------------------- /docker/fedora_42/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Fedora 42 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM fedora:42 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Update and install build tools, dependencies 11 | # 12 | 13 | ENV DEBIAN_FRONTEND noninteractive 14 | 15 | RUN dnf -y upgrade 16 | 17 | RUN dnf -y install git gcc-c++ make patch cmake qt5-qtbase-devel mesa-libGLU-devel python-docutils 18 | 19 | # 20 | # Clone repo 21 | # 22 | 23 | ENV SCRATCH /scratch 24 | RUN mkdir ${SCRATCH} 25 | WORKDIR ${SCRATCH} 26 | 27 | ARG BRANCH 28 | ENV BRANCH ${BRANCH:-master} 29 | 30 | ARG REPO 31 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 32 | 33 | RUN git clone --branch ${BRANCH} ${REPO} repo 34 | 35 | # 36 | # Build 37 | # 38 | 39 | RUN mkdir -p ${SCRATCH}/repo/build_external 40 | WORKDIR ${SCRATCH}/repo/build_external 41 | RUN cmake ../thirdparty/external 42 | RUN make -j 43 | 44 | RUN mkdir -p ${SCRATCH}/repo/build 45 | WORKDIR ${SCRATCH}/repo/build 46 | RUN cmake .. 47 | RUN make -j 48 | 49 | # 50 | # Test 51 | # 52 | 53 | RUN ctest 54 | 55 | # 56 | # Install 57 | # 58 | 59 | RUN make install 60 | RUN find /usr/local 61 | -------------------------------------------------------------------------------- /docker/ubuntu_16_04/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Ubuntu 16.04 (Xenial) 3 | 4 | # Status: Not working April 20th 2025 5 | # QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 6 | 7 | FROM ubuntu:xenial 8 | MAINTAINER Nigel Stewart (nigels@nigels.com) 9 | 10 | # 11 | # Optional custom package mirror 12 | # 13 | # --build-arg MIRROR=http://au.archive.ubuntu.com/ubuntu/ 14 | # 15 | 16 | ARG MIRROR 17 | ENV MIRROR ${MIRROR:-http://archive.ubuntu.com/ubuntu} 18 | 19 | RUN sed -i -r "/#.*/d" /etc/apt/sources.list 20 | RUN sed -i -r "/^$/d" /etc/apt/sources.list 21 | RUN cat /etc/apt/sources.list 22 | RUN sed -i -r "s#deb .* xenial(-.*)? #deb ${MIRROR} xenial\\1 #" /etc/apt/sources.list 23 | RUN cat /etc/apt/sources.list 24 | 25 | # 26 | # Update and install build tools, dependencies 27 | # 28 | 29 | ENV DEBIAN_FRONTEND noninteractive 30 | 31 | RUN apt update 32 | RUN apt dist-upgrade -y 33 | 34 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 35 | RUN apt install -y g++ cmake qt5-default python-docutils wget 36 | 37 | # CMake 3.12 or higher is required 38 | 39 | RUN wget -nv https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-linux-x86_64.sh 40 | RUN chmod a+x ./cmake-3.25.2-linux-x86_64.sh 41 | 42 | ENV CMAKE_PREFIX /opt/cmake-3.25.2 43 | RUN mkdir -p ${CMAKE_PREFIX} 44 | RUN ./cmake-3.25.2-linux-x86_64.sh --skip-license --prefix=${CMAKE_PREFIX} 45 | 46 | # Needs g++-7 toolchains 47 | 48 | RUN apt install -y software-properties-common 49 | RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt install -y gcc-7 g++-7 50 | 51 | # 52 | # Clone repo 53 | # 54 | 55 | ENV SCRATCH /scratch 56 | RUN mkdir ${SCRATCH} 57 | WORKDIR ${SCRATCH} 58 | 59 | ARG BRANCH 60 | ENV BRANCH ${BRANCH:-master} 61 | 62 | ARG REPO 63 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 64 | 65 | RUN git clone --branch ${BRANCH} ${REPO} repo 66 | 67 | # 68 | # Build 69 | # 70 | 71 | RUN mkdir -p ${SCRATCH}/repo/build_external 72 | WORKDIR ${SCRATCH}/repo/build_external 73 | RUN CC=gcc-7 CXX=g++-7 ${CMAKE_PREFIX}/bin/cmake ../thirdparty/external 74 | RUN make 75 | 76 | RUN mkdir -p ${SCRATCH}/repo/build 77 | WORKDIR ${SCRATCH}/repo/build 78 | RUN CC=gcc-7 CXX=g++-7 ${CMAKE_PREFIX}/bin/cmake .. 79 | RUN make 80 | 81 | # 82 | # Test 83 | # 84 | 85 | RUN ${CMAKE_PREFIX}/bin/ctest 86 | 87 | # 88 | # Install 89 | # 90 | 91 | RUN make install 92 | RUN find /usr/local 93 | -------------------------------------------------------------------------------- /docker/ubuntu_18_04/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Ubuntu 18.04 (Bionic) 3 | 4 | # Status: Not working April 20th 2025 5 | # error: 'class QFontMetrics' has no member named 'horizontalAdvance' 6 | 7 | FROM ubuntu:bionic 8 | MAINTAINER Nigel Stewart (nigels@nigels.com) 9 | 10 | # 11 | # Optional custom package mirror 12 | # 13 | # --build-arg MIRROR=http://au.archive.ubuntu.com/ubuntu/ 14 | # 15 | 16 | ARG MIRROR 17 | ENV MIRROR ${MIRROR:-http://archive.ubuntu.com/ubuntu} 18 | 19 | RUN sed -i -r "/#.*/d" /etc/apt/sources.list 20 | RUN sed -i -r "/^$/d" /etc/apt/sources.list 21 | RUN cat /etc/apt/sources.list 22 | RUN sed -i -r "s#deb .* bionic(-.*)? #deb ${MIRROR} bionic\\1 #" /etc/apt/sources.list 23 | RUN cat /etc/apt/sources.list 24 | 25 | # 26 | # Update and install build tools, dependencies 27 | # 28 | 29 | ENV DEBIAN_FRONTEND noninteractive 30 | 31 | RUN apt update 32 | RUN apt dist-upgrade -y 33 | 34 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 35 | RUN apt install -y g++ cmake qt5-default python-docutils wget 36 | 37 | # CMake 3.12 or higher is required 38 | 39 | RUN wget -nv https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-linux-x86_64.sh 40 | RUN chmod a+x ./cmake-3.25.2-linux-x86_64.sh 41 | 42 | ENV CMAKE_PREFIX /opt/cmake-3.25.2 43 | RUN mkdir -p ${CMAKE_PREFIX} 44 | RUN ./cmake-3.25.2-linux-x86_64.sh --skip-license --prefix=${CMAKE_PREFIX} 45 | 46 | # 47 | # Clone repo 48 | # 49 | 50 | ENV SCRATCH /scratch 51 | RUN mkdir ${SCRATCH} 52 | WORKDIR ${SCRATCH} 53 | 54 | ARG BRANCH 55 | ENV BRANCH ${BRANCH:-master} 56 | 57 | ARG REPO 58 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 59 | 60 | RUN git clone --branch ${BRANCH} ${REPO} repo 61 | 62 | # 63 | # Build 64 | # 65 | 66 | RUN mkdir -p ${SCRATCH}/repo/build_external 67 | WORKDIR ${SCRATCH}/repo/build_external 68 | RUN ${CMAKE_PREFIX}/bin/cmake ../thirdparty/external 69 | RUN make -j 70 | 71 | RUN mkdir -p ${SCRATCH}/repo/build 72 | WORKDIR ${SCRATCH}/repo/build 73 | RUN ${CMAKE_PREFIX}/bin/cmake .. 74 | RUN make -j 75 | 76 | # 77 | # Test 78 | # 79 | 80 | RUN ${CMAKE_PREFIX}/bin/ctest 81 | 82 | # 83 | # Install 84 | # 85 | 86 | RUN make install 87 | RUN find /usr/local 88 | -------------------------------------------------------------------------------- /docker/ubuntu_20_04/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Ubuntu 20.04 (Focal) 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM ubuntu:focal 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Optional custom package mirror 11 | # 12 | # --build-arg MIRROR=http://au.archive.ubuntu.com/ubuntu/ 13 | # 14 | 15 | ARG MIRROR 16 | ENV MIRROR ${MIRROR:-http://archive.ubuntu.com/ubuntu} 17 | 18 | RUN sed -i -r "/#.*/d" /etc/apt/sources.list 19 | RUN sed -i -r "/^$/d" /etc/apt/sources.list 20 | RUN cat /etc/apt/sources.list 21 | RUN sed -i -r "s#deb .* focal(-.*)? #deb ${MIRROR} focal\\1 #" /etc/apt/sources.list 22 | RUN cat /etc/apt/sources.list 23 | 24 | # 25 | # Update and install build tools, dependencies 26 | # 27 | 28 | ENV DEBIAN_FRONTEND noninteractive 29 | 30 | RUN apt update 31 | RUN apt dist-upgrade -y 32 | 33 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 34 | RUN apt install -y g++ cmake qt5-default python-docutils 35 | 36 | # 37 | # Clone repo 38 | # 39 | 40 | ENV SCRATCH /scratch 41 | RUN mkdir ${SCRATCH} 42 | WORKDIR ${SCRATCH} 43 | 44 | ARG BRANCH 45 | ENV BRANCH ${BRANCH:-master} 46 | 47 | ARG REPO 48 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 49 | 50 | RUN git clone --branch ${BRANCH} ${REPO} repo 51 | 52 | # 53 | # Build 54 | # 55 | 56 | RUN mkdir -p ${SCRATCH}/repo/build_external 57 | WORKDIR ${SCRATCH}/repo/build_external 58 | RUN cmake ../thirdparty/external 59 | RUN make -j 60 | 61 | RUN mkdir -p ${SCRATCH}/repo/build 62 | WORKDIR ${SCRATCH}/repo/build 63 | RUN cmake .. 64 | RUN make -j 65 | 66 | # 67 | # Test 68 | # 69 | 70 | RUN ctest 71 | 72 | # 73 | # Install 74 | # 75 | 76 | RUN make install 77 | RUN find /usr/local 78 | -------------------------------------------------------------------------------- /docker/ubuntu_22_04/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Ubuntu 22.04 (Jammy) 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM ubuntu:jammy 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Optional custom package mirror 11 | # 12 | # --build-arg MIRROR=http://au.archive.ubuntu.com/ubuntu/ 13 | # 14 | 15 | ARG MIRROR 16 | ENV MIRROR ${MIRROR:-http://archive.ubuntu.com/ubuntu} 17 | 18 | RUN sed -i -r "/#.*/d" /etc/apt/sources.list 19 | RUN sed -i -r "/^$/d" /etc/apt/sources.list 20 | RUN cat /etc/apt/sources.list 21 | RUN sed -i -r "s#deb .* jammy(-.*)? #deb ${MIRROR} jammy\\1 #" /etc/apt/sources.list 22 | RUN cat /etc/apt/sources.list 23 | 24 | # 25 | # Update and install build tools, dependencies 26 | # 27 | 28 | ENV DEBIAN_FRONTEND noninteractive 29 | 30 | RUN apt update 31 | RUN apt dist-upgrade -y 32 | 33 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 34 | RUN apt install -y g++ cmake qtbase5-dev python3 35 | 36 | # 37 | # Clone repo 38 | # 39 | 40 | ENV SCRATCH /scratch 41 | RUN mkdir ${SCRATCH} 42 | WORKDIR ${SCRATCH} 43 | 44 | ARG BRANCH 45 | ENV BRANCH ${BRANCH:-master} 46 | 47 | ARG REPO 48 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 49 | 50 | RUN git clone --branch ${BRANCH} ${REPO} repo 51 | 52 | # 53 | # Build 54 | # 55 | 56 | RUN mkdir -p ${SCRATCH}/repo/build_external 57 | WORKDIR ${SCRATCH}/repo/build_external 58 | RUN cmake ../thirdparty/external 59 | RUN make -j 60 | 61 | RUN mkdir -p ${SCRATCH}/repo/build 62 | WORKDIR ${SCRATCH}/repo/build 63 | RUN cmake .. 64 | RUN make -j 65 | 66 | # 67 | # Test 68 | # 69 | 70 | RUN ctest 71 | 72 | # 73 | # Install 74 | # 75 | 76 | RUN make install 77 | RUN find /usr/local 78 | -------------------------------------------------------------------------------- /docker/ubuntu_24_04/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal displaz Qt5 build, test and install 2 | # using Docker Ubuntu 24.04 (Noble) 3 | 4 | # Status: Confirmed working April 20th 2025 5 | 6 | FROM ubuntu:noble 7 | MAINTAINER Nigel Stewart (nigels@nigels.com) 8 | 9 | # 10 | # Optional custom package mirror 11 | # 12 | # --build-arg MIRROR=http://au.archive.ubuntu.com/ubuntu/ 13 | # 14 | 15 | ARG MIRROR 16 | ENV MIRROR ${MIRROR:-http://archive.ubuntu.com/ubuntu} 17 | 18 | #RUN sed -i -r "/#.*/d" /etc/apt/sources.list 19 | #RUN sed -i -r "/^$/d" /etc/apt/sources.list 20 | #RUN cat /etc/apt/sources.list 21 | #RUN sed -i -r "s#deb .* noble(-.*)? #deb ${MIRROR} noble\\1 #" /etc/apt/sources.list 22 | #RUN cat /etc/apt/sources.list 23 | 24 | # 25 | # Update and install build tools, dependencies 26 | # 27 | 28 | ENV DEBIAN_FRONTEND noninteractive 29 | 30 | RUN apt update 31 | RUN apt dist-upgrade -y 32 | 33 | RUN apt install -y build-essential git cmake doxygen graphviz cppcheck 34 | RUN apt install -y g++ cmake qtbase5-dev python3 35 | 36 | # 37 | # Clone repo 38 | # 39 | 40 | ENV SCRATCH /scratch 41 | RUN mkdir ${SCRATCH} 42 | WORKDIR ${SCRATCH} 43 | 44 | ARG BRANCH 45 | ENV BRANCH ${BRANCH:-master} 46 | 47 | ARG REPO 48 | ENV REPO ${REPO:-https://github.com/c42f/displaz.git} 49 | 50 | RUN git clone --branch ${BRANCH} ${REPO} repo 51 | 52 | # 53 | # Build 54 | # 55 | 56 | RUN mkdir -p ${SCRATCH}/repo/build_external 57 | WORKDIR ${SCRATCH}/repo/build_external 58 | RUN cmake ../thirdparty/external 59 | RUN make -j 60 | 61 | RUN mkdir -p ${SCRATCH}/repo/build 62 | WORKDIR ${SCRATCH}/repo/build 63 | RUN cmake .. 64 | RUN make -j 65 | 66 | # 67 | # Test 68 | # 69 | 70 | RUN ctest 71 | 72 | # 73 | # Install 74 | # 75 | 76 | RUN make install 77 | RUN find /usr/local 78 | -------------------------------------------------------------------------------- /package/NSIS.InstallOptions.ini.in: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=6 3 | 4 | [Field 1] 5 | Type=label 6 | Text=By default @CPACK_PACKAGE_INSTALL_DIRECTORY@ does not add its directory to the system PATH. 7 | Left=0 8 | Right=-1 9 | Top=0 10 | Bottom=20 11 | 12 | [Field 2] 13 | Type=radiobutton 14 | Text=Do not add @CPACK_PACKAGE_NAME@ to the system PATH 15 | Left=0 16 | Right=-1 17 | Top=30 18 | Bottom=40 19 | State=1 20 | 21 | [Field 3] 22 | Type=radiobutton 23 | Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for all users 24 | Left=0 25 | Right=-1 26 | Top=40 27 | Bottom=50 28 | State=0 29 | 30 | [Field 4] 31 | Type=radiobutton 32 | Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for current user 33 | Left=0 34 | Right=-1 35 | Top=50 36 | Bottom=60 37 | State=0 38 | 39 | [Field 5] 40 | Type=CheckBox 41 | Text=Create @CPACK_PACKAGE_NAME@ Desktop Icon 42 | Left=0 43 | Right=-1 44 | Top=80 45 | Bottom=90 46 | State=0 47 | 48 | [Field 6] 49 | Type=CheckBox 50 | Text=Associate las files (*.laz,*.las) with @CPACK_PACKAGE_NAME@ 51 | Left=0 52 | Right=-1 53 | Top=110 54 | Bottom=120 55 | State=1 56 | -------------------------------------------------------------------------------- /package/displaz.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/package/displaz.ico -------------------------------------------------------------------------------- /package/make_icon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files="" 4 | for width in 16 32 48 256 ; do 5 | name=tmp_icon_$(printf "%.3d" $width).png 6 | inkscape \ 7 | --export-png=$name \ 8 | --export-area-page \ 9 | --export-width=$width \ 10 | icon.svg 11 | files="$files $name" 12 | done 13 | 14 | convert $files displaz.ico 15 | 16 | cp tmp_icon_256.png ../src/resource/displaz_icon_256.png 17 | 18 | rm $files 19 | -------------------------------------------------------------------------------- /package/windows_resources.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "displaz.ico" 2 | -------------------------------------------------------------------------------- /shaders/annotation.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | // Draws annotations, which are textured quads that always face the camera, 6 | // arent't obscured by other objects, and don't shrink when they're further 7 | // away. 8 | 9 | uniform mat4 modelViewMatrix; 10 | uniform mat4 projectionMatrix; 11 | uniform mat4 modelViewProjectionMatrix; 12 | uniform vec2 annotationSize; // In pixels 13 | uniform vec2 viewportSize; // In pixels 14 | 15 | //------------------------------------------------------------------------------ 16 | #if defined(VERTEX_SHADER) 17 | 18 | // Position of the current quad vertex. The bottom-left vertex is at (-1,-1) 19 | // and the top-right at (1,1). 20 | in vec2 position; 21 | in vec2 texCoord; 22 | 23 | out vec2 ftexCoord; 24 | 25 | void main() 26 | { 27 | gl_Position = modelViewProjectionMatrix * vec4(0, 0, 0, 1.0); 28 | gl_Position /= gl_Position.w; 29 | gl_Position.xy += position * annotationSize / viewportSize; 30 | ftexCoord = texCoord; 31 | } 32 | 33 | 34 | //------------------------------------------------------------------------------ 35 | #elif defined(FRAGMENT_SHADER) 36 | 37 | uniform sampler2D texture0; 38 | 39 | in vec2 ftexCoord; 40 | 41 | // Output fragment color 42 | out vec4 fragColor; 43 | 44 | void main() 45 | { 46 | fragColor = texture(texture0, vec2(ftexCoord)); 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /shaders/axes_label.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | uniform vec3 center; 10 | uniform vec3 offset; 11 | 12 | uniform sampler2D texture0; 13 | 14 | //------------------------------------------------------------------------------ 15 | #if defined(VERTEX_SHADER) 16 | 17 | in vec2 position; 18 | in vec2 texCoord; 19 | 20 | // Point color which will be picked up by the fragment shader 21 | out vec2 textureCoords; 22 | 23 | void main() 24 | { 25 | textureCoords = texCoord; 26 | 27 | vec3 axes_pos = offset; 28 | vec4 rot_pos = vec4(position,0.0,0.0) + modelViewMatrix * vec4(axes_pos, 1.0); 29 | 30 | gl_Position = projectionMatrix * vec4(rot_pos.xy + center.xy,0.0,1.0); 31 | } 32 | 33 | 34 | //------------------------------------------------------------------------------ 35 | #elif defined(FRAGMENT_SHADER) 36 | 37 | // Input texture coordinates 38 | in vec2 textureCoords; 39 | 40 | // Output fragment color 41 | out vec4 fragColor; 42 | 43 | void main() 44 | { 45 | // Trivial fragment shader reads from texture 46 | vec4 tex = texture(texture0, vec2(textureCoords)); 47 | fragColor = tex; 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /shaders/axes_lines.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | uniform vec3 center; 10 | 11 | //------------------------------------------------------------------------------ 12 | #if defined(VERTEX_SHADER) 13 | 14 | in vec3 position; 15 | in vec4 color; 16 | 17 | // Point color which will be picked up by the fragment shader 18 | out vec4 lineColor; 19 | 20 | void main() 21 | { 22 | lineColor = vec4(color); 23 | 24 | vec3 org_pos = position - center; 25 | vec4 rot_pos = modelViewMatrix * vec4(org_pos, 1.0); 26 | 27 | gl_Position = projectionMatrix * vec4(rot_pos.xy + center.xy,0.0,1.0); 28 | } 29 | 30 | 31 | //------------------------------------------------------------------------------ 32 | #elif defined(FRAGMENT_SHADER) 33 | 34 | // Input color (per point) 35 | in vec4 lineColor; 36 | 37 | // Output fragment color 38 | out vec4 fragColor; 39 | 40 | void main() 41 | { 42 | // Trivial fragment shader copies the colour and makes it opaque 43 | fragColor = vec4(lineColor); 44 | } 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /shaders/axes_quad.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | uniform sampler2D texture0; 10 | 11 | //------------------------------------------------------------------------------ 12 | #if defined(VERTEX_SHADER) 13 | 14 | in vec2 position; 15 | in vec2 texCoord; 16 | 17 | // Point color which will be picked up by the fragment shader 18 | out vec2 textureCoords; 19 | 20 | void main() 21 | { 22 | textureCoords = texCoord; 23 | gl_Position = modelViewProjectionMatrix * vec4(position,0.0,1.0); 24 | } 25 | 26 | 27 | //------------------------------------------------------------------------------ 28 | #elif defined(FRAGMENT_SHADER) 29 | 30 | // Input texture coordinates 31 | in vec2 textureCoords; 32 | 33 | // Output fragment color 34 | out vec4 fragColor; 35 | 36 | void main() 37 | { 38 | // Trivial fragment shader reads from texture 39 | vec4 tex = texture(texture0, vec2(textureCoords)); 40 | fragColor = tex; 41 | } 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /shaders/bounding_box.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | uniform vec4 color; 10 | 11 | //------------------------------------------------------------------------------ 12 | #if defined(VERTEX_SHADER) 13 | 14 | in vec3 position; 15 | 16 | // Point color which will be picked up by the fragment shader 17 | out vec4 lineColor; 18 | 19 | void main() 20 | { 21 | //gl_Position = vec4(position,1.0); 22 | 23 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 24 | lineColor = vec4(color); 25 | } 26 | 27 | 28 | //------------------------------------------------------------------------------ 29 | #elif defined(FRAGMENT_SHADER) 30 | 31 | // Input color (per point) 32 | in vec4 lineColor; 33 | 34 | // Output fragment color 35 | out vec4 fragColor; 36 | 37 | void main() 38 | { 39 | // Trivial fragment shader copies the colour and makes it opaque 40 | fragColor = vec4(lineColor); 41 | } 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /shaders/cursor.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | uniform vec4 color; 10 | 11 | //------------------------------------------------------------------------------ 12 | #if defined(VERTEX_SHADER) 13 | 14 | in vec3 position; 15 | 16 | // Point color which will be picked up by the fragment shader 17 | out vec4 lineColor; 18 | 19 | void main() 20 | { 21 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 22 | lineColor = vec4(color); 23 | } 24 | 25 | 26 | //------------------------------------------------------------------------------ 27 | #elif defined(FRAGMENT_SHADER) 28 | 29 | // Input color (per point) 30 | in vec4 lineColor; 31 | 32 | // Output fragment color 33 | out vec4 fragColor; 34 | 35 | void main() 36 | { 37 | // Trivial fragment shader copies the colour and makes it opaque 38 | fragColor = lineColor; 39 | } 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /shaders/grid.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | uniform vec3 color; 10 | 11 | //------------------------------------------------------------------------------ 12 | #if defined(VERTEX_SHADER) 13 | 14 | in vec3 position; 15 | 16 | // Point color which will be picked up by the fragment shader 17 | out vec4 lineColor; 18 | 19 | void main() 20 | { 21 | lineColor = vec4(1.0,1.0,1.0,0.25); 22 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 23 | } 24 | 25 | 26 | //------------------------------------------------------------------------------ 27 | #elif defined(FRAGMENT_SHADER) 28 | 29 | // Input color (per point) 30 | in vec4 lineColor; 31 | 32 | // Output fragment color 33 | out vec4 fragColor; 34 | 35 | void main() 36 | { 37 | // Trivial fragment shader copies the colour and makes it opaque 38 | fragColor = vec4(lineColor); 39 | } 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /shaders/meshedge.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | #if defined(VERTEX_SHADER) 10 | in vec3 position; 11 | in vec3 color; 12 | 13 | out vec4 col; 14 | 15 | void main() 16 | { 17 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 18 | // Use a z offset to push edges in front of faces. We aim for an absolute 19 | // offset (some small multiple of FLT_EPSILON) after the perspective divide 20 | // to allow for varying data scales. Before the perspective divide this 21 | // corresponds to a multiple of w. 22 | gl_Position.z -= 1e-5*gl_Position.w; 23 | col = vec4(color, 1.0); 24 | } 25 | 26 | 27 | //------------------------------------------------------------------------------ 28 | #elif defined(FRAGMENT_SHADER) 29 | in vec4 col; 30 | 31 | out vec4 fragColor; 32 | 33 | void main() 34 | { 35 | fragColor = col; 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /shaders/meshface.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | #if defined(VERTEX_SHADER) 10 | 11 | in vec3 position; 12 | in vec3 normal; 13 | in vec3 color; 14 | in vec2 texCoord; 15 | out vec3 position_eye; 16 | out vec3 fcolor; 17 | out vec2 ftexCoord; 18 | 19 | void main() 20 | { 21 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 22 | position_eye = (modelViewMatrix * vec4(position,1.0)).xyz; 23 | fcolor = color; 24 | ftexCoord = texCoord; 25 | //gl_FrontColor = vec4(color*abs(dot(normal, lightDir)), 1.0); 26 | } 27 | 28 | 29 | //------------------------------------------------------------------------------ 30 | #elif defined(FRAGMENT_SHADER) 31 | 32 | uniform vec3 lightDir_eye = vec3(0.0,0.0,-1.0); 33 | 34 | uniform bool hasTexture = false; 35 | uniform sampler2D texture0; 36 | 37 | in vec3 position_eye; 38 | in vec3 fcolor; 39 | in vec2 ftexCoord; 40 | 41 | out vec4 fragColor; 42 | 43 | void main() 44 | { 45 | if (hasTexture) 46 | { 47 | fragColor = texture(texture0, vec2(ftexCoord)); 48 | } 49 | else 50 | { 51 | // Faceted shading, without requiring special support in the C++ code. 52 | vec3 normal = normalize(cross(dFdx(position_eye), dFdy(position_eye))); 53 | fragColor = vec4(fcolor*abs(dot(normal, lightDir_eye)), 1); 54 | } 55 | } 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /shaders/selection_sphere.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | // Very simple shader setup for rendering a semitransparent selection sphere. 6 | 7 | uniform mat4 modelViewMatrix; 8 | uniform mat4 projectionMatrix; 9 | uniform mat4 modelViewProjectionMatrix; 10 | 11 | //------------------------------------------------------------------------------ 12 | #if defined(VERTEX_SHADER) 13 | 14 | uniform vec4 color = vec4(1); 15 | 16 | in vec3 position; 17 | 18 | out vec4 color2; 19 | 20 | void main() 21 | { 22 | color2 = color; 23 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 24 | } 25 | 26 | 27 | //------------------------------------------------------------------------------ 28 | #elif defined(FRAGMENT_SHADER) 29 | 30 | in vec4 color2; 31 | 32 | out vec4 fragColor; 33 | 34 | void main() 35 | { 36 | fragColor = color2; 37 | } 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /shaders/simple_example.glsl: -------------------------------------------------------------------------------- 1 | #version 150 2 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 3 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 4 | 5 | uniform mat4 modelViewMatrix; 6 | uniform mat4 projectionMatrix; 7 | uniform mat4 modelViewProjectionMatrix; 8 | 9 | //------------------------------------------------------------------------------ 10 | #if defined(VERTEX_SHADER) 11 | 12 | // Shader parameters which may be set via the user interface 13 | uniform float pointRadius = 0.1; //# uiname=Point Radius (m); min=0.001; max=10 14 | uniform float exposure = 1.0; //# uiname=Exposure; min=0.001; max=10000 15 | 16 | // Point size multiplier to get from a width in projected coordinates to the 17 | // number of pixels across as required for gl_PointSize 18 | uniform float pointPixelScale = 0; 19 | 20 | // Each point has an intensity and position 21 | in float intensity; 22 | in vec3 position; 23 | 24 | // Point color which will be picked up by the fragment shader 25 | flat out vec3 pointColor; 26 | 27 | void main() 28 | { 29 | gl_Position = modelViewProjectionMatrix * vec4(position,1.0); 30 | gl_PointSize = 2*pointPixelScale*pointRadius/gl_Position.w; 31 | pointColor = exposure*intensity/400.0 * vec3(1); 32 | } 33 | 34 | 35 | //------------------------------------------------------------------------------ 36 | #elif defined(FRAGMENT_SHADER) 37 | 38 | // Input color per point 39 | flat in vec3 pointColor; 40 | 41 | // Output fragment color 42 | out vec4 fragColor; 43 | 44 | void main() 45 | { 46 | // Trivial fragment shader copies the colour and makes it opaque 47 | fragColor = vec4(pointColor, 1); 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /src/DrawCostModel.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DRAW_COST_MODEL_H_INCLUDED 5 | #define DRAW_COST_MODEL_H_INCLUDED 6 | 7 | #include 8 | #include 9 | 10 | #include "Geometry.h" 11 | #include "util.h" 12 | 13 | /// Frame time cost model for drawn geometry 14 | /// 15 | /// We want to draw as much geometry per frame as possible, without the time 16 | /// blowing out and the application becoming laggy. This class models the 17 | /// frame time as a function of an overall draw quality factor. The same 18 | /// quality factor is applied to all geometry to achive some consistency in the 19 | /// amount of per-geometry quality degradation. 20 | /// 21 | /// We model the cost of drawing geometry as the function 22 | /// 23 | /// t(T,q) = a*Nv(T,q) 24 | /// 25 | /// where 26 | /// * t is the frame time 27 | /// * T is the camera transformation 28 | /// * q is the quality 29 | /// * Nv is the number of vertices shaded 30 | /// 31 | /// and a is an unknown fitting parameter which depends on the shader, speed of 32 | /// the GPU etc. 33 | class DrawCostModel 34 | { 35 | public: 36 | DrawCostModel() 37 | : m_quality(1), 38 | m_incQuality(1), 39 | m_maxDrawRecords(20), 40 | m_drawRecords(), 41 | m_modelCoeffs(fitCostModel(m_drawRecords)) 42 | { } 43 | 44 | double quality(double targetMillisecs, 45 | const std::vector& geoms, 46 | const TransformState& transState, bool firstIncrementalFrame); 47 | 48 | void addSample(const DrawCount& drawCount, double frameTime) 49 | { 50 | m_drawRecords.push_back(std::make_pair(drawCount, double(frameTime))); 51 | if ((int)m_drawRecords.size() > m_maxDrawRecords) 52 | m_drawRecords.pop_front(); 53 | m_modelCoeffs = fitCostModel(m_drawRecords); 54 | } 55 | 56 | private: 57 | typedef std::deque> DrawRecords; 58 | 59 | static V3d fitCostModel(const DrawRecords& drawRecords); 60 | 61 | double m_quality; 62 | double m_incQuality; 63 | int m_maxDrawRecords; 64 | DrawRecords m_drawRecords; 65 | V3d m_modelCoeffs; 66 | }; 67 | 68 | 69 | #endif // DRAW_COST_MODEL_H_INCLUDED 70 | -------------------------------------------------------------------------------- /src/HookFormatter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "HookFormatter.h" 5 | 6 | #include "IpcChannel.h" 7 | #include "MainWindow.h" 8 | 9 | 10 | HookFormatter::HookFormatter(MainWindow* getPayload, QByteArray hookSpec, 11 | QByteArray hookPayload, QObject* parent) 12 | : QObject(parent), 13 | m_hookSpec(hookSpec), 14 | m_hookPayload(hookPayload), 15 | m_getPayload(getPayload), 16 | m_eventId(0) 17 | { 18 | connect(this, SIGNAL(sendIpcMessage(QByteArray)), parent, SLOT(sendMessage(QByteArray))); 19 | connect(parent, SIGNAL(disconnected()), this, SLOT(channelDisconnected())); 20 | } 21 | 22 | /// Get payload and dispatch signal to IpcChannel 23 | void HookFormatter::hookActivated() 24 | { 25 | QByteArray hookPayload = m_getPayload->hookPayload(m_hookPayload); 26 | QByteArray message = m_hookSpec + " " + hookPayload + "\n"; 27 | 28 | emit sendIpcMessage(message); 29 | } 30 | -------------------------------------------------------------------------------- /src/HookFormatter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_HOOKFORMATTER_H_INCLUDED 5 | #define DISPLAZ_HOOKFORMATTER_H_INCLUDED 6 | 7 | #include 8 | #include 9 | 10 | class MainWindow; 11 | 12 | /// Class for formatting hook event messages 13 | 14 | class HookFormatter : public QObject 15 | { 16 | Q_OBJECT 17 | public: 18 | HookFormatter(MainWindow* getPayload, QByteArray hookSpec, 19 | QByteArray hookPayload, QObject* parent = NULL); 20 | 21 | void setEventId(int eventId) { m_eventId = eventId; } 22 | 23 | public slots: 24 | void hookActivated(void); 25 | 26 | signals: 27 | /// Triggered on event of custom shortcut 28 | void sendIpcMessage(QByteArray message); 29 | 30 | /// Triggered on disconnect of parent channel 31 | void hookRemoved(int eventId); 32 | 33 | private slots: 34 | void channelDisconnected(void) { emit hookRemoved(m_eventId); } 35 | 36 | private: 37 | QByteArray m_hookSpec; 38 | QByteArray m_hookPayload; 39 | MainWindow* m_getPayload; 40 | int m_eventId; 41 | }; 42 | 43 | #endif // DISPLAZ_HOOKFORMATTER_H_INCLUDED 44 | -------------------------------------------------------------------------------- /src/HookManager.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_HOOKMANAGER_H_INCLUDED 5 | #define DISPLAZ_HOOKMANAGER_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class HookFormatter; 12 | 13 | /// Class for registering custom hook events. Implemented via QShortCut, 14 | /// i.e. for QKeySequences only. 15 | class HookManager : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | HookManager(QObject* parent = NULL); 20 | 21 | /// Connect events defined by `eventSpec` to the HookFormatter hookActivated() function. 22 | void connectHook(QByteArray eventSpec, HookFormatter* formatter); 23 | 24 | public slots: 25 | void deactivateEvent(int eventId); 26 | 27 | private: 28 | QVector m_events; 29 | QList m_eventSpecs; 30 | QVector m_hooksSignedUp; 31 | }; 32 | 33 | #endif // DISPLAZ_HOOKMANAGER_H_INCLUDED 34 | -------------------------------------------------------------------------------- /src/InterProcessLock.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERPROCESS_LOCK_H_INCLUDED 2 | #define INTERPROCESS_LOCK_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | 8 | /// Interprocess lock 9 | /// 10 | /// Use this class to limit a given operation to a single processes. For 11 | /// example, to ensure only a single instance of a GUI application runs. 12 | /// 13 | /// An acquired lock has process lifetime - the system will clean it up in the 14 | /// event that the process crashes. 15 | /// 16 | /// On unix, the implementation is based on the flock() API, so the lock is 17 | /// shared between parent and child after a call to either fork() or execve(). 18 | /// In this case, both processes must exit or call unlock() before the lock is 19 | /// released. 20 | class InterProcessLock 21 | { 22 | public: 23 | /// Create lock named with the UTF-8 string `lockName` 24 | InterProcessLock(const std::string& lockName); 25 | 26 | /// Calls unlock() 27 | ~InterProcessLock(); 28 | 29 | /// Try to acquire the lock, returning immediately. 30 | /// 31 | /// Return true if the lock was acquired; return false if the lock 32 | /// could not be acquired immediately (ie, it's held by another 33 | /// process). 34 | bool tryLock(); 35 | 36 | /// Inherit lock from a parent process. 37 | /// 38 | /// The lockId parameter provides a way pass a system dependent lock id 39 | /// from a parent to child process. Depending on the system, the lock 40 | /// may already have been inherited during the creation of the child 41 | /// process, in which case this is just book keeping and hooks things 42 | /// up so that unlock() can be used. 43 | /// 44 | /// Return true if the lock was successfully inherited, false otherwise. 45 | bool inherit(const std::string& lockId); 46 | 47 | /// Release the lock and clean up. 48 | /// 49 | /// Do nothing if the lock wasn't previously acquired. 50 | void unlock(); 51 | 52 | /// Format lock identifier as a string for passing to a child process. 53 | /// 54 | /// If currently unlocked, return the empty string. 55 | std::string makeLockId() const; 56 | 57 | private: 58 | class Impl; 59 | // Hidden system-dependent implementation 60 | std::unique_ptr m_impl; 61 | }; 62 | 63 | 64 | #endif // INTERPROCESS_LOCK_H_INCLUDED 65 | -------------------------------------------------------------------------------- /src/InterProcessLock_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "InterProcessLock.h" 8 | #include "util.h" 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | if (argc < 2) 13 | return EXIT_FAILURE; 14 | if (argv[1] == std::string("master")) 15 | { 16 | QCoreApplication app(argc, argv); 17 | QString prog = QCoreApplication::applicationFilePath(); 18 | std::vector> procs; 19 | QStringList args; 20 | args << "slave"; 21 | // Start a whole bunch of processes. Unfortunately QtProcess isn't 22 | // robust enough to start more than about 100 at once on linux so 23 | // stress testing more requires a different strategy. 24 | const int nprocs = 100; 25 | for (int i = 0; i < nprocs; ++i) 26 | { 27 | std::unique_ptr proc(new QProcess()); 28 | proc->start(prog, args); 29 | procs.push_back(std::move(proc)); 30 | } 31 | // Wait for them all to finish, accumulating exit status 32 | int numAcquiredLocks = 0; 33 | int numBlockedLocks = 0; 34 | for (int i = 0; i < nprocs; ++i) 35 | { 36 | if (!procs[i]->waitForFinished() && 37 | procs[i]->exitStatus() != QProcess::NormalExit) 38 | { 39 | std::cerr << "Error in waitForFinished()\n"; 40 | return EXIT_FAILURE; 41 | } 42 | if (procs[i]->exitCode() == 0) 43 | ++numAcquiredLocks; 44 | else if (procs[i]->exitCode() == 1) 45 | ++numBlockedLocks; 46 | } 47 | tfm::printfln("Acquired locks: %d", numAcquiredLocks); 48 | tfm::printfln("Blocked locks: %d", numBlockedLocks); 49 | if (numAcquiredLocks != 1) 50 | { 51 | std::cerr << "Exactly one process should have got the lock\n"; 52 | return EXIT_FAILURE; 53 | } 54 | if (numBlockedLocks != nprocs-1) 55 | { 56 | std::cerr << "Should have exactly N-1 blocked locks\n"; 57 | return EXIT_FAILURE; 58 | } 59 | return EXIT_SUCCESS; 60 | } 61 | else 62 | { 63 | // Slave process. This is what we're trying to test. 64 | InterProcessLock lk("InterProcessLock_test"); 65 | if (!lk.tryLock()) 66 | return 1; 67 | // We have the lock: sleep to let other processes exit 68 | milliSleep(4000); 69 | return 0; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/PolygonBuilder.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef POLYGON_BUILDER_H_INCLUDED 5 | #define POLYGON_BUILDER_H_INCLUDED 6 | 7 | #include 8 | 9 | #include "glutil.h" 10 | 11 | /// Temporary storage for polygon vertex indices during file read 12 | class PolygonBuilder 13 | { 14 | public: 15 | enum FacePropertyType 16 | { 17 | OuterRingInds = 0x1, 18 | InnerRingSizes = 0x2, 19 | InnerRingInds = 0x4, 20 | }; 21 | 22 | PolygonBuilder(); 23 | 24 | /// Set which ply properties are available 25 | void setPropertiesAvailable(int avail) { m_propsAvail = avail; } 26 | 27 | /// Set total number of vertices available 28 | void setVertexCount(long vertexCount) { m_vertexCount = vertexCount; } 29 | 30 | /// Add index to polygon definition. 31 | /// 32 | /// propType - One of FacePropertyType 33 | /// plyListLength - Length of ply property list currently being read. 34 | /// plyListIndex - Index in current ply property list. If negative, 35 | /// addIndex will ignore plyListIndex and vertexIndex, 36 | /// but consider propType to have been seen for this 37 | /// polygon (used to support polygons with zero holes). 38 | /// vertexIndex - Index of vertex to be added 39 | /// 40 | /// Return true if the current polygon is complete. 41 | bool addIndex(long propType, long plyListLength, 42 | long plyListIndex, long vertexIndex); 43 | 44 | /// Triangulate polygon, using vertex list `verts`, pushing new 45 | /// triangle faces into triangleInds 46 | void triangulate(const std::vector& verts, std::vector& triangleInds); 47 | 48 | /// Reset polygon ready for reading next set of indices 49 | void reset(); 50 | 51 | private: 52 | bool m_valid; 53 | long m_vertexCount; 54 | int m_propsAvail; 55 | int m_propsRead; 56 | std::vector m_outerRingInds; // Vertex indices of outer ring 57 | std::vector m_innerRingSizes; // Number of vertices for each inner ring 58 | std::vector m_innerRingInds; // Count of inner ring indices 59 | }; 60 | 61 | 62 | #endif // POLYGON_BUILDER_H_INCLUDED 63 | -------------------------------------------------------------------------------- /src/config.h.in.cmake: -------------------------------------------------------------------------------- 1 | #define DISPLAZ_VERSION_STRING "@DISPLAZ_VERSION_STRING@" 2 | #define DISPLAZ_SHADER_DIR "@DISPLAZ_SHADER_DIR@" 3 | #define DISPLAZ_DOC_DIR "@DISPLAZ_DOC_DIR@" 4 | -------------------------------------------------------------------------------- /src/geometrycollection.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include "Geometry.h" 12 | #include "fileloader.h" 13 | #include "GeometryMutator.h" 14 | 15 | class QRegExp; 16 | 17 | /// Collection of loaded data sets for use with Qt's model view architecture 18 | /// 19 | /// Data sets can be points, lines or meshes. 20 | class GeometryCollection : public QAbstractListModel 21 | { 22 | Q_OBJECT 23 | public: 24 | typedef std::vector> GeometryVec; 25 | 26 | GeometryCollection(QObject * parent = nullptr); 27 | 28 | /// Get current list of geometries 29 | const GeometryVec& get() const { return m_geometries; } 30 | 31 | /// Remove all geometries from the list 32 | void clear(); 33 | /// Remove and unload all geometries whose filenames matched by given QRegExp object 34 | void unloadFiles(const QRegExp & filenameRegex); 35 | 36 | /// Find the first index to a geometry with label matching the given pattern 37 | QModelIndex findLabel(const QRegExp & labelPattern); 38 | 39 | // Specialisation of QAbstractListModel 40 | virtual int rowCount(const QModelIndex & parent = QModelIndex()) const; 41 | virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; 42 | virtual Qt::ItemFlags flags(const QModelIndex& index) const; 43 | virtual bool setData(const QModelIndex & index, const QVariant & value, 44 | int role = Qt::EditRole); 45 | 46 | virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); 47 | 48 | 49 | public slots: 50 | /// Add to the list of loaded geometries 51 | /// 52 | /// If `reloaded` is true, search existing geometry for 53 | /// `geom->fileName()` and if found, replace the existing geometry. 54 | /// 55 | /// If `replaceLabel` is true, search existing geometry for a matching 56 | /// `geom->label()` and replace the existing geometry if found. 57 | void addGeometry(std::shared_ptr geom, bool replaceLabel = false, bool reloaded = false); 58 | void mutateGeometry(std::shared_ptr mutator); 59 | 60 | private: 61 | void loadPointFilesImpl(const QStringList& fileNames, bool removeAfterLoad); 62 | int findMatchingRow(const QRegExp & filenameRegex); 63 | 64 | GeometryVec m_geometries; 65 | }; 66 | -------------------------------------------------------------------------------- /src/gui/DataSetListView.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "DataSetListView.h" 5 | 6 | #include 7 | 8 | DataSetListView::DataSetListView(QWidget* parent) 9 | : QListView(parent) 10 | { 11 | setContextMenuPolicy(Qt::CustomContextMenu); 12 | connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenu(const QPoint &))); 13 | } 14 | 15 | void DataSetListView::keyPressEvent(QKeyEvent* event) 16 | { 17 | switch (event->key()) 18 | { 19 | case Qt::Key_Delete: 20 | { 21 | QModelIndexList sel = selectionModel()->selectedRows(); 22 | std::sort(sel.begin(), sel.end()); 23 | for (int i = sel.size()-1; i >= 0; --i) 24 | model()->removeRows(sel[i].row(), 1); 25 | return; 26 | } 27 | 28 | case Qt::Key_R: 29 | { 30 | QModelIndexList sel = selectionModel()->selectedRows(); 31 | for (const auto& i : sel) 32 | { 33 | emit reloadFile(i); 34 | } 35 | return; 36 | } 37 | 38 | default: 39 | { 40 | QListView::keyPressEvent(event); 41 | return; 42 | } 43 | } 44 | } 45 | 46 | void DataSetListView::wheelEvent(QWheelEvent* event) 47 | { 48 | if (event->modifiers() & Qt::ControlModifier) 49 | { 50 | int row = 0; 51 | if (selectionModel()->currentIndex().isValid()) 52 | row = selectionModel()->currentIndex().row(); 53 | row += (event->angleDelta().y() < 0) ? 1 : -1; 54 | if (row < 0) 55 | row = 0; 56 | if (row >= model()->rowCount()) 57 | row = model()->rowCount() - 1; 58 | QModelIndex newIndex = model()->index(row, 0); 59 | selectionModel()->select(newIndex, QItemSelectionModel::ClearAndSelect); 60 | selectionModel()->setCurrentIndex(newIndex, QItemSelectionModel::Current); 61 | } 62 | else 63 | { 64 | QListView::wheelEvent(event); 65 | } 66 | } 67 | 68 | void DataSetListView::customContextMenu(const QPoint &point) 69 | { 70 | QModelIndex index = indexAt(point); 71 | 72 | if (index.isValid()) 73 | { 74 | qDebug() << index.data(); 75 | } 76 | else 77 | { 78 | qDebug() << "None"; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/gui/DataSetListView.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | //------------------------------------------------------------------------------ 9 | /// List view for data sets with additional mouse and keyboard controls: 10 | /// 11 | /// * Pressing delete removes the currently selected elements 12 | /// * Mouse wheel scrolls the current selection rather than the scroll area 13 | class DataSetListView : public QListView 14 | { 15 | Q_OBJECT 16 | public: 17 | DataSetListView(QWidget* parent = nullptr); 18 | 19 | signals: 20 | void reloadFile(const QModelIndex& index); 21 | 22 | private slots: 23 | void customContextMenu(const QPoint &point); 24 | 25 | protected: 26 | virtual void keyPressEvent(QKeyEvent* event); 27 | virtual void wheelEvent(QWheelEvent* event); 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /src/gui/DataSetUI.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include 5 | #include 6 | 7 | /// User interface for overview of loaded data sets 8 | /// 9 | /// The interface contains mechanisms for showing which data sets are currently 10 | /// loaded, for manipulating the current selection, etc. 11 | class DataSetUI : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | DataSetUI(QWidget* parent = nullptr); 16 | 17 | /// Return underlying view which displays loaded data set list 18 | QAbstractItemView* view(); 19 | 20 | public slots: 21 | void selectIndex(int); 22 | 23 | private slots: 24 | // Slots to manipulate model selection 25 | void selectAll(); 26 | void selectNone(); 27 | void selectionInvert(); 28 | 29 | private: 30 | QListView* m_listView = nullptr; 31 | }; 32 | -------------------------------------------------------------------------------- /src/gui/GLSLHighlighter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_GLSL_HIGHLIGHTER_H_INCLUDED 5 | #define DISPLAZ_GLSL_HIGHLIGHTER_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | /// Highlights GLSL code 12 | class GLSLHighlighter : public QSyntaxHighlighter 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | GLSLHighlighter(QTextDocument* parent = 0); 18 | 19 | protected: 20 | void highlightBlock(const QString& text) Q_DECL_OVERRIDE; 21 | 22 | private: 23 | enum class TextStyle 24 | { 25 | Plain, 26 | Italic, 27 | }; 28 | 29 | /// States a section of text can have 30 | enum BlockState 31 | { 32 | // QSyntaxHighlighter defaults all text to -1 33 | Default = -1, 34 | MultilineComment, 35 | }; 36 | 37 | /// Describes how text matching regexp should be formatted 38 | struct Rule 39 | { 40 | QRegExp regexp; 41 | QTextCharFormat format; 42 | }; 43 | 44 | /// Adds a rule to m_rules 45 | void addRule(const QString& color, TextStyle style, const QString& pattern); 46 | 47 | QVector m_rules; 48 | QTextCharFormat m_comment; 49 | QRegExp m_commentBegin; // Matches a /* 50 | QRegExp m_commentEnd; // Matches a */ 51 | }; 52 | 53 | #endif // DISPLAZ_GLSL_HIGHLIGHTER_H_INCLUDED 54 | -------------------------------------------------------------------------------- /src/gui/HelpDialog.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef HELP_DIALOG_H_INCLUDED 5 | #define HELP_DIALOG_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /// A very simple help dialog, which reads the text or generated html README 13 | /// documentation from the installed doc directory. 14 | class HelpDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | public: 18 | HelpDialog(QWidget* parent = 0) 19 | : QDialog(parent) 20 | { 21 | resize(700,900); 22 | setSizeGripEnabled(true); 23 | setWindowTitle("Displaz user guide"); 24 | QGridLayout* gridLayout = new QGridLayout(this); 25 | gridLayout->setContentsMargins(2, 2, 2, 2); 26 | QTextEdit* textEdit = new QTextEdit(this); 27 | textEdit->setReadOnly(true); 28 | setHelpText(textEdit); 29 | gridLayout->addWidget(textEdit, 0, 0, 1, 1); 30 | } 31 | 32 | private: 33 | void setHelpText(QTextEdit* textEdit) 34 | { 35 | QFile docFile("doc:userguide.html"); 36 | if (docFile.open(QIODevice::ReadOnly)) 37 | { 38 | textEdit->setHtml(docFile.readAll()); 39 | return; 40 | } 41 | // Look for text doc as backup 42 | docFile.setFileName("doc:userguide.rst"); 43 | if (docFile.open(QIODevice::ReadOnly)) 44 | { 45 | textEdit->setPlainText(docFile.readAll()); 46 | return; 47 | } 48 | textEdit->setPlainText("Documentation not found"); 49 | } 50 | }; 51 | 52 | 53 | #endif // HELP_DIALOG_H_INCLUDED 54 | -------------------------------------------------------------------------------- /src/gui/QtLogger.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "QtLogger.h" 5 | 6 | QtLogger g_logger; 7 | 8 | 9 | //------------------------------------------------------------------------------ 10 | LogViewer::LogViewer(QWidget* parent) 11 | : QPlainTextEdit(parent) 12 | { } 13 | 14 | 15 | void LogViewer::connectLogger(QtLogger* logger) 16 | { 17 | connect(logger, SIGNAL(logMessage(int, QString)), 18 | this, SLOT(appendLogMessage(int, QString)), 19 | Qt::QueuedConnection); 20 | } 21 | 22 | 23 | void LogViewer::appendLogMessage(int logLevel, QString msg) 24 | { 25 | moveCursor(QTextCursor::End); 26 | switch (logLevel) 27 | { 28 | case Logger::Warning: 29 | appendHtml("WARNING: "); 30 | insertPlainText(msg); 31 | break; 32 | case Logger::Error: 33 | appendHtml("ERROR: "); 34 | insertPlainText(msg); 35 | break; 36 | case Logger::Info: 37 | appendHtml(""); // Force new paragraph 38 | insertPlainText(msg); 39 | break; 40 | } 41 | ensureCursorVisible(); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/gui/QtLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef QT_LOGGER_H_INCLUDED 5 | #define QT_LOGGER_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "logger.h" 12 | #include "qtutil.h" 13 | 14 | /// Logger class which logs output to qt signals 15 | class QtLogger : public QObject, public Logger 16 | { 17 | Q_OBJECT 18 | public: 19 | QtLogger(QObject* parent = 0) : QObject(parent) {} 20 | 21 | signals: 22 | /// Signal emitted every time a log message comes in 23 | void logMessage(int logLevel, QString msg); 24 | 25 | /// Signal emitted when processing progress has been made 26 | void progressPercent(int percent); 27 | 28 | protected: 29 | virtual void logImpl(LogLevel level, const std::string& msg) 30 | { 31 | emit logMessage(level, QString::fromUtf8(msg.c_str())); 32 | } 33 | 34 | virtual void progressImpl(double progressFraction) 35 | { 36 | emit progressPercent(int(100*progressFraction)); 37 | } 38 | }; 39 | 40 | 41 | /// Global displaz logger instance 42 | extern QtLogger g_logger; 43 | 44 | 45 | //------------------------------------------------------------------------------ 46 | /// Viewer widget for log messages. 47 | /// 48 | /// This is intended to work together with the Logger class as a frontend which 49 | /// does to the actual log message formatting. The logger frontend is 50 | /// threadsafe, but LogViewer must run on the GUI thread. 51 | class LogViewer : public QPlainTextEdit 52 | { 53 | Q_OBJECT 54 | public: 55 | LogViewer(QWidget* parent = 0); 56 | 57 | public slots: 58 | /// Connect given logger to the viewer. 59 | /// 60 | /// Note that for thread safety this must be a queued connection, hence 61 | /// the special purpose method here. 62 | void connectLogger(QtLogger* logger); 63 | 64 | /// Append plain text message to the running log 65 | void appendLogMessage(int logLevel, QString msg); 66 | }; 67 | 68 | 69 | #endif // QT_LOGGER_H_INCLUDED 70 | -------------------------------------------------------------------------------- /src/gui/ShaderEditor.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "ShaderEditor.h" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | ShaderEditor::ShaderEditor(QWidget* parent) 13 | : QPlainTextEdit(parent) 14 | { 15 | setLineWrapMode(QPlainTextEdit::NoWrap); 16 | // Use fixed-width font 17 | QFont font("Courier"); 18 | font.setStyleHint(QFont::TypeWriter); 19 | setFont(font); 20 | m_highlighter = new GLSLHighlighter(document()); 21 | m_compileShaderAct = new QAction(tr("&Compile"), this); 22 | m_compileShaderAct->setShortcut(Qt::Key_Return | Qt::SHIFT); 23 | m_compileShaderAct->setToolTip(tr("Compile current shader and use in 3D view")); 24 | addAction(m_compileShaderAct); 25 | } 26 | 27 | 28 | void ShaderEditor::contextMenuEvent(QContextMenuEvent *event) 29 | { 30 | // Add compile action into the menu 31 | std::unique_ptr menu(createStandardContextMenu()); 32 | menu->addSeparator(); 33 | menu->addAction(m_compileShaderAct); 34 | menu->exec(event->globalPos()); 35 | } 36 | 37 | 38 | void ShaderEditor::keyPressEvent(QKeyEvent *event) 39 | { 40 | if (event->key() == Qt::Key_Return && 41 | event->modifiers() & Qt::ShiftModifier) 42 | { 43 | // Ick: QPlainTextEdit won't allow Shift+return to be intercepted by 44 | // m_compileShaderAct, so trigger it here instead. 45 | m_compileShaderAct->trigger(); 46 | } 47 | else 48 | QPlainTextEdit::keyPressEvent(event); 49 | } 50 | -------------------------------------------------------------------------------- /src/gui/ShaderEditor.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_SHADER_EDITOR_H_INCLUDED 5 | #define DISPLAZ_SHADER_EDITOR_H_INCLUDED 6 | 7 | #include 8 | 9 | #include "GLSLHighlighter.h" 10 | 11 | /// Very basic shader editor widget 12 | class ShaderEditor : public QPlainTextEdit 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | ShaderEditor(QWidget* parent = 0); 18 | 19 | /// Get the shader Compile action 20 | /// 21 | /// This action may be triggered from the editor context menu or by the 22 | /// keyboard shortcut. 23 | QAction* compileAction() { return m_compileShaderAct; } 24 | 25 | protected: 26 | void keyPressEvent(QKeyEvent *event); 27 | void contextMenuEvent(QContextMenuEvent *event); 28 | 29 | private: 30 | QAction* m_compileShaderAct; 31 | GLSLHighlighter* m_highlighter; 32 | }; 33 | 34 | #endif // DISPLAZ_SHADER_EDITOR_H_INCLUDED 35 | -------------------------------------------------------------------------------- /src/gui/guimain.h: -------------------------------------------------------------------------------- 1 | #ifndef DISPLAZ_GUI_MAIN_INCLUDED 2 | #define DISPLAZ_GUI_MAIN_INCLUDED 3 | 4 | /// Run the main GUI window 5 | int guimain(int argc, char* argv[]); 6 | 7 | 8 | #endif // DISPLAZ_GUI_MAIN_INCLUDED 9 | -------------------------------------------------------------------------------- /src/gui/qtutil.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef QT_UTIL_H_INCLUDED 5 | #define QT_UTIL_H_INCLUDED 6 | 7 | #include 8 | #include 9 | 10 | /// Print QByteArray to std stream as raw data 11 | inline std::ostream& operator<<(std::ostream& out, const QByteArray& s) 12 | { 13 | out.write(s.constData(), s.size()); 14 | return out; 15 | } 16 | 17 | /// Print QString to std stream as utf8 18 | inline std::ostream& operator<<(std::ostream& out, const QString& s) 19 | { 20 | out << s.toUtf8(); 21 | return out; 22 | } 23 | 24 | 25 | #endif // QT_UTIL_H_INCLUDED 26 | -------------------------------------------------------------------------------- /src/hcloud.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | 5 | #ifndef DISPLAZ_HCLOUD_H_INCLUDED 6 | #define DISPLAZ_HCLOUD_H_INCLUDED 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | //------------------------------------------------------------------------------ 14 | /// Magic number at start of each hcloud file, and size in bytes 15 | #define HCLOUD_MAGIC "HierarchicalPointCloud\n\x0c" 16 | #define HCLOUD_MAGIC_SIZE 24 17 | #define HCLOUD_VERSION 1 18 | 19 | 20 | /// Collection of header metadata stored in a hcloud file 21 | struct HCloudHeader 22 | { 23 | uint16_t version; ///< Version of file format 24 | mutable uint32_t headerSize; ///< Size of header in bytes 25 | uint64_t numPoints; ///< Total number of raw points in leaf nodes 26 | uint64_t numVoxels; ///< Total number of voxels 27 | uint64_t indexOffset; ///< Offset to tree index in bytes 28 | uint64_t dataOffset; ///< Offset to start of data section, in bytes 29 | 30 | Imath::V3d offset; ///< Offset for positions stored in data section (TODO: remove) 31 | Imath::Box3d boundingBox; ///< Bounding box of raw data 32 | Imath::Box3d treeBoundingBox; ///< Bouding box of root node of tree 33 | uint16_t brickSize; ///< Voxel resolution of interior nodes in tree 34 | 35 | HCloudHeader() 36 | : version(HCLOUD_VERSION), 37 | headerSize(0), 38 | numPoints(0), 39 | numVoxels(0), 40 | indexOffset(0), 41 | dataOffset(0), 42 | offset(0), 43 | brickSize(0) 44 | { } 45 | 46 | 47 | /// Write HCloud header to given stream 48 | void write(std::ostream& out) const; 49 | 50 | /// Read HCloud header from given stream 51 | void read(std::istream& in); 52 | }; 53 | 54 | std::ostream& operator<<(std::ostream& out, const HCloudHeader& h); 55 | 56 | 57 | //------------------------------------------------------------------------------ 58 | 59 | enum IndexFlags 60 | { 61 | IndexFlags_Points = 0, 62 | IndexFlags_Voxels = 1, 63 | }; 64 | 65 | 66 | struct NodeIndexData 67 | { 68 | IndexFlags flags; 69 | uint64_t dataOffset; 70 | uint32_t numPoints; 71 | 72 | NodeIndexData() 73 | : flags(IndexFlags_Points), 74 | dataOffset(0), 75 | numPoints(0) 76 | { } 77 | }; 78 | 79 | 80 | // TODO: HCloudInput & HCloudOutput classes for hcloud IO 81 | 82 | 83 | #endif // DISPLAZ_HCLOUD_H_INCLUDED 84 | -------------------------------------------------------------------------------- /src/logger.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "logger.h" 5 | 6 | #include 7 | 8 | //------------------------------------------------------------------------------ 9 | Logger::LogLevel Logger::parseLogLevel(const std::string& logLevel, LogLevel defaultLevel) 10 | { 11 | if (logLevel == "error") return Logger::Error; 12 | else if (logLevel == "warning") return Logger::Warning; 13 | else if (logLevel == "info") return Logger::Info; 14 | else if (logLevel == "debug") return Logger::Debug; 15 | else return defaultLevel; 16 | } 17 | 18 | 19 | //------------------------------------------------------------------------------ 20 | void Logger::log(LogLevel level, const char* fmt, tfm::FormatListRef flist, int maxMsgs) 21 | { 22 | if (level > m_logLevel) 23 | return; 24 | if (maxMsgs > 0) 25 | { 26 | int& count = m_logCountLimit[LogCountKey(fmt, level)]; 27 | if (count >= maxMsgs) 28 | return; 29 | ++count; 30 | } 31 | std::ostringstream ss; 32 | tfm::vformat(ss, fmt, flist); 33 | logImpl(level, ss.str()); 34 | } 35 | 36 | 37 | //------------------------------------------------------------------------------ 38 | StreamLogger::StreamLogger(std::ostream& outStream) 39 | : m_prevPrintWasProgress(false), 40 | m_prevProgressFraction(-100), 41 | m_out(outStream) 42 | { } 43 | 44 | StreamLogger::~StreamLogger() 45 | { 46 | if (m_prevPrintWasProgress) 47 | m_out << "\n"; 48 | } 49 | 50 | void StreamLogger::logImpl(LogLevel level, const std::string& msg) 51 | { 52 | if (m_prevPrintWasProgress) 53 | tfm::format(m_out, "\n"); 54 | m_prevPrintWasProgress = false; 55 | if (level == Progress) 56 | { 57 | m_progressPrefix = msg; 58 | progress(0.0); 59 | } 60 | else if (level == Debug) 61 | tfm::format(m_out, "DEBUG: %s\n", msg); 62 | else if (level == Info) 63 | tfm::format(m_out, "%s\n", msg); 64 | else if (level == Warning) 65 | tfm::format(m_out, "WARNING: %s\n", msg); 66 | else if (level == Error) 67 | tfm::format(m_out, "ERROR: %s\n", msg); 68 | } 69 | 70 | void StreamLogger::progressImpl(double progressFraction) 71 | { 72 | if (fabs(progressFraction - m_prevProgressFraction) < 0.01) 73 | return; 74 | const int barFullWidth = std::max(10, 60 - 3 - (int)m_progressPrefix.size()); 75 | const int barFraction = (int)floor(barFullWidth*std::min(1.0, std::max(0.0, progressFraction)) + 0.5); 76 | m_prevProgressFraction = progressFraction; 77 | tfm::format(m_out, "%s [%s%s]\r", m_progressPrefix, 78 | std::string(barFraction, '='), 79 | std::string(barFullWidth - barFraction, ' ')); 80 | m_prevPrintWasProgress = true; 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/pointdbwriter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_POINTDBWRITER_H_INCLUDED 5 | #define DISPLAZ_POINTDBWRITER_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "util.h" 12 | 13 | #include "logger.h" 14 | 15 | /// Writer for a simple on-disk point database format 16 | /// 17 | /// The idea here is to create a very simple database which allows spatial 18 | /// bounding box queries from an unordered set of points. This is done by 19 | /// tiling them into files, working on the assumption that the full set of 20 | /// points may exceed available memory. 21 | class PointDbWriter 22 | { 23 | public: 24 | PointDbWriter(const std::string& dirName, const Imath::Box3d& boundingBox, 25 | double tileSize, size_t flushInterval, Logger& logger); 26 | 27 | /// Compute current memory usage in bytes of the internal cache 28 | size_t cacheSizeBytes() const; 29 | 30 | /// Return total number of points written 31 | uint64_t pointsWritten() const { return m_pointsWritten; } 32 | 33 | /// Write a single point to the database with given position and 34 | /// intensity 35 | void writePoint(Imath::V3d P, float intensity); 36 | 37 | /// Close database, and write config file 38 | void close(); 39 | 40 | private: 41 | struct PointDbTile; 42 | 43 | PointDbTile& findTile(const TilePos& pos); 44 | 45 | void flushTiles(bool forceFlushAll = false); 46 | 47 | void flushToDisk(PointDbTile& tile); 48 | 49 | std::string m_dirName; 50 | Imath::Box3d m_boundingBox; 51 | double m_tileSize; 52 | Imath::V3d m_offset; 53 | std::map m_cache; 54 | bool m_computeBounds; 55 | size_t m_flushInterval; 56 | bool m_haveOffset; 57 | PointDbTile* m_prevTile; 58 | uint64_t m_pointsWritten; 59 | Logger& m_logger; 60 | }; 61 | 62 | 63 | /// Convert a list of las files to PointDb format 64 | void convertLasToPointDb(const std::string& outDirName, 65 | const std::vector& lasFileNames, 66 | const Imath::Box3d& boundingBox, double tileSize, 67 | Logger& logger); 68 | 69 | 70 | #endif // DISPLAZ_POINTDBWRITER_H_INCLUDED 71 | -------------------------------------------------------------------------------- /src/render/Annotation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_ANNOTATION_H_INCLUDED 5 | #define DISPLAZ_ANNOTATION_H_INCLUDED 6 | 7 | #include 8 | 9 | #include "glutil.h" 10 | #include 11 | #include 12 | #include 13 | 14 | struct TransformState; 15 | 16 | /// Annotations display text, always face the camera, and aren't obscured by 17 | /// other objects 18 | class Annotation 19 | { 20 | 21 | public: 22 | Annotation(const QString& label, 23 | GLuint annotationShaderProg, 24 | const QString& text, 25 | Imath::V3d position); 26 | 27 | ~Annotation(); 28 | 29 | QString label() const { return m_label; } 30 | 31 | /// Draw the annotation using the given shader program 32 | /// 33 | /// Requires that `annotationShaderProg` is already bound and that 34 | /// the viewportSize uniform variable has been set. 35 | /// 36 | /// transState specifies the camera transform. 37 | void draw(QOpenGLShaderProgram& annotationShaderProg, 38 | const TransformState& transState) const; 39 | 40 | private: 41 | QString m_label; 42 | QString m_text; 43 | Imath::V3d m_position; 44 | std::shared_ptr m_texture; 45 | GLuint m_vao; 46 | }; 47 | 48 | #endif // DISPLAZ_ANNOTATION_H_INCLUDED 49 | -------------------------------------------------------------------------------- /src/render/FrameRate.cpp: -------------------------------------------------------------------------------- 1 | #include "FrameRate.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | FrameRate::FrameRate() 8 | { 9 | m_timer.start(); 10 | } 11 | 12 | FrameRate & 13 | FrameRate::operator++() 14 | { 15 | m_frames++; 16 | m_buffer.push_back(m_timer.elapsed()); 17 | 18 | // Recalculate frame rate and frame time 19 | // if we have sufficient samples and 20 | // enough time has elapsed. 21 | 22 | if (m_buffer.size() >= 2) 23 | { 24 | if (m_buffer.back() - m_lastCalc >= m_step) 25 | { 26 | m_lastCalc = m_buffer.back(); 27 | m_lastFrameTime = double(m_buffer.back() - m_buffer.front()) / (1000.0 * (m_buffer.size()-1)); 28 | m_lastFrameRate = 1.0 / m_lastFrameTime; 29 | m_buffer.clear(); 30 | 31 | std::cout << detailed() << std::endl; 32 | } 33 | } 34 | 35 | return *this; 36 | } 37 | 38 | double FrameRate::elapsedTime() const { return m_timer.elapsed() / 1000.0; } 39 | size_t FrameRate::totalFrames() const { return m_frames; } 40 | 41 | double FrameRate::frameRate() const { return m_lastFrameRate; } 42 | double FrameRate::frameTime() const { return m_lastFrameTime; } 43 | 44 | std::string 45 | FrameRate::summary() const 46 | { 47 | return tfm::format("%3.0f fps", frameRate()); 48 | } 49 | 50 | std::string 51 | FrameRate::detailed() const 52 | { 53 | return tfm::format("%5.3f sec %3.0f fps", frameTime(), frameRate()); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/render/FrameRate.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | // Adapted from GLT OpenGL Toolkit and re-licensed by author 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | class FrameRate 14 | { 15 | public: 16 | FrameRate(); 17 | ~FrameRate() = default; 18 | 19 | /// Call this once for each redraw 20 | FrameRate &operator++(); 21 | 22 | /// Get the total elapsed time since construction 23 | double elapsedTime() const; 24 | /// Get the total number of frames 25 | size_t totalFrames() const; 26 | 27 | /// Get the (averaged) frame rate 28 | double frameRate() const; 29 | /// Get the (averaged) time per frame 30 | double frameTime() const; 31 | 32 | /// Summary frame rate information 33 | std::string summary() const; 34 | 35 | /// Detailed fram rate information 36 | std::string detailed() const; 37 | 38 | private: 39 | 40 | QElapsedTimer m_timer; // Timer used for frame rate calculation 41 | size_t m_frames = 0; // Total number of frames 42 | int64_t m_step = 500; // Minimum time step between recalculation 43 | 44 | int64_t m_lastCalc = 0; // Time of last recalculation 45 | double m_lastFrameRate = 0.0; // Previously calculated frame rate (frame/s) 46 | double m_lastFrameTime = 0.0; // Previously calculated frame time (s/frame) 47 | 48 | std::vector m_buffer; // storage 49 | }; 50 | -------------------------------------------------------------------------------- /src/render/GeometryMutator.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "GeometryMutator.h" 5 | #include "ply_io.h" 6 | #include "QtLogger.h" 7 | 8 | GeometryMutator::GeometryMutator() 9 | : m_npoints(0), 10 | m_indexFieldIdx(-1), 11 | m_index(0) 12 | { } 13 | 14 | 15 | GeometryMutator::~GeometryMutator() 16 | { } 17 | 18 | 19 | 20 | bool GeometryMutator::loadFile(const QString& fileName) 21 | { 22 | // Check it is ply 23 | if (!fileName.toLower().endsWith(".ply")) 24 | { 25 | g_logger.error("Expected ply for file %s", fileName); 26 | return false; 27 | } 28 | 29 | try 30 | { 31 | std::unique_ptr ply( 32 | ply_open(fileName.toUtf8().constData(), logRplyError, 0, NULL), ply_close); 33 | if (!ply || !ply_read_header(ply.get())) 34 | return false; 35 | // Parse out header data 36 | p_ply_element vertexElement = findVertexElement(ply.get(), m_npoints); 37 | if (vertexElement) 38 | { 39 | g_logger.error("Expected displaz formatted ply for file %s", fileName); 40 | return false; 41 | } 42 | else 43 | { 44 | if (!loadDisplazNativePly(fileName, ply.get(), m_fields, m_offset, m_npoints)) 45 | return false; 46 | } 47 | } 48 | catch(...) 49 | { 50 | g_logger.error("Unkown load error for file %s", fileName); 51 | return false; 52 | } 53 | 54 | // Search for index field 55 | m_indexFieldIdx = -1; 56 | for (size_t i = 0; i < m_fields.size(); ++i) 57 | { 58 | if (m_fields[i].name == "index") 59 | { 60 | if (!(m_fields[i].spec == TypeSpec::uint32())) 61 | { 62 | g_logger.error("The \"index\" field found in file %s is not of type uint32", fileName); 63 | return false; 64 | } 65 | m_indexFieldIdx = (int)i; 66 | break; 67 | } 68 | } 69 | if (m_indexFieldIdx == -1) 70 | { 71 | g_logger.error("No \"index\" field found in file %s", fileName); 72 | return false; 73 | } 74 | m_index = m_fields[m_indexFieldIdx].as(); 75 | 76 | g_logger.info("Loaded %d point mutations from file %s", 77 | m_npoints, fileName); 78 | 79 | return true; 80 | } 81 | -------------------------------------------------------------------------------- /src/render/GeometryMutator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef DISPLAZ_GEOMETRYMUTATOR_H_INCLUDED 5 | #define DISPLAZ_GEOMETRYMUTATOR_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include "util.h" 16 | #include "typespec.h" 17 | #include "GeomField.h" 18 | 19 | 20 | //------------------------------------------------------------------------------ 21 | /// Container for loaded data which will be used to modify (mutate) an 22 | /// existing PointArray. 23 | class GeometryMutator : public QObject 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | GeometryMutator(); 29 | ~GeometryMutator(); 30 | 31 | bool loadFile(const QString& fileName); 32 | 33 | /// Get the arbitrary user-defined label for the geometry. 34 | const QString& label() const { return m_label; } 35 | 36 | /// Set the arbitrary user-defined label for the geometry. 37 | void setLabel(const QString& label) { m_label = label; } 38 | 39 | /// Get number of points to mutate 40 | size_t pointCount() const { return m_npoints; } 41 | 42 | /// Get index of points to mutate 43 | uint32_t* index() const { return m_index; } 44 | 45 | /// Return offset applied to "position" field. 46 | const V3d& offset() const { return m_offset; } 47 | 48 | /// Get fields to mutate 49 | const std::vector& fields() const { return m_fields; } 50 | 51 | private: 52 | 53 | /// Label of data to mutate 54 | QString m_label; 55 | /// Total number of loaded points 56 | size_t m_npoints; 57 | /// Position offset 58 | V3d m_offset; 59 | /// Point data field storage 60 | std::vector m_fields; 61 | /// An index field is required, plus an alias for convenience: 62 | int m_indexFieldIdx; 63 | uint32_t* m_index; 64 | }; 65 | 66 | Q_DECLARE_METATYPE(std::shared_ptr) 67 | 68 | #endif // DISPLAZ_GEOMETRYMUTATOR_H_INCLUDED 69 | -------------------------------------------------------------------------------- /src/render/HCloudView.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | 5 | #ifndef DISPLAZ_HCLOUDVIEW_H_INCLUDED 6 | #define DISPLAZ_HCLOUDVIEW_H_INCLUDED 7 | 8 | #include 9 | 10 | #include "Geometry.h" 11 | #include "hcloud.h" 12 | 13 | struct HCloudNode; 14 | class StreamPageCache; 15 | class ShaderProgram; 16 | 17 | /// Viewer for hcloud file format 18 | /// 19 | /// HCloudView uses incremental loading of the LoD structure to avoid loading 20 | /// the whole thing into memory at once. 21 | class HCloudView : public Geometry 22 | { 23 | Q_OBJECT 24 | public: 25 | HCloudView(); 26 | 27 | ~HCloudView(); 28 | 29 | virtual bool loadFile(QString fileName, size_t maxVertexCount); 30 | 31 | virtual void initializeGL(); 32 | 33 | virtual void draw(const TransformState& transState, double quality) const; 34 | 35 | virtual size_t pointCount() const; 36 | 37 | virtual void estimateCost(const TransformState& transState, 38 | bool incrementalDraw, const double* qualities, 39 | DrawCount* drawCounts, int numEstimates) const; 40 | 41 | virtual bool pickVertex(const V3d& cameraPos, 42 | const EllipticalDist& distFunc, 43 | V3d& pickedVertex, 44 | double* distance = 0, 45 | std::string* info = 0) const; 46 | 47 | 48 | private: 49 | HCloudHeader m_header; // TODO: Put in HCloudInput class 50 | // TODO: Do we really want all this mutable state? 51 | // Should draw() be logically non-const? 52 | mutable uint64_t m_sizeBytes; 53 | mutable std::ifstream m_input; 54 | mutable std::unique_ptr m_inputCache; 55 | std::unique_ptr m_rootNode; 56 | std::unique_ptr m_shader; 57 | mutable std::vector m_simplifyThreshold; 58 | }; 59 | 60 | 61 | #endif // DISPLAZ_HCLOUDVIEW_H_INCLUDED 62 | -------------------------------------------------------------------------------- /src/render/TransformState.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "TransformState.h" 5 | 6 | #include "glutil.h" 7 | 8 | void TransformState::setUniform(GLuint prog, const char* name, const M44d& mat) 9 | { 10 | GLint loc = glGetUniformLocation(prog, name); 11 | if (loc == -1) 12 | return; 13 | M44f M(mat); 14 | glUniformMatrix4fv(loc, 1, GL_FALSE, &M[0][0]); 15 | } 16 | 17 | TransformState TransformState::translate(const Imath::V3d& offset) const 18 | { 19 | TransformState res(*this); 20 | res.modelViewMatrix = M44d().setTranslation(offset) * modelViewMatrix; 21 | return res; 22 | } 23 | 24 | TransformState TransformState::scale(const Imath::V3d& scalar) const 25 | { 26 | TransformState res(*this); 27 | res.modelViewMatrix = M44d().setScale(scalar) * modelViewMatrix; 28 | return res; 29 | } 30 | 31 | TransformState TransformState::rotate(const Imath::V4d& rotation) const 32 | { 33 | TransformState res(*this); 34 | res.modelViewMatrix = M44d().rotate(V3d(rotation.x*rotation.w,rotation.y*rotation.w,rotation.z*rotation.w)) * modelViewMatrix; 35 | return res; 36 | } 37 | 38 | 39 | void TransformState::setUniforms(GLuint prog) const 40 | { 41 | // Note: The matrices must have a sensible representation in float32 42 | // precision by the time they get here. 43 | setUniform(prog, "projectionMatrix", projMatrix); 44 | setUniform(prog, "modelViewMatrix", modelViewMatrix); 45 | M44d mvproj = modelViewMatrix * projMatrix; 46 | setUniform(prog, "modelViewProjectionMatrix", mvproj); 47 | } 48 | 49 | void TransformState::setOrthoProjection(double left, double right, double bottom, double top, double nearVal, double farVal) 50 | { 51 | // Note: Create an orthographic matrix from input values 52 | if ((left == right) || (bottom == top) || (nearVal == farVal)) 53 | throw DisplazError("Invalid input for orthographic projection."); 54 | 55 | double xx = 2.0/(right-left); 56 | double yy = 2.0/(top-bottom); 57 | double zz = -2.0/(farVal-nearVal); 58 | 59 | double tx = -(right+left)/(right-left); 60 | double ty = -(top+bottom)/(top-bottom); 61 | double tz = -(farVal+nearVal)/(farVal-nearVal); 62 | 63 | projMatrix = M44d(xx,0.0,0.0,0.0, 64 | 0.0,yy,0.0,0.0, 65 | 0.0,0.0,zz,0.0, 66 | tx,ty,tz,1.0); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/render/TransformState.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include "util.h" 9 | 10 | //------------------------------------------------------------------------------ 11 | /// Utility to handle transformation state 12 | 13 | struct TransformState 14 | { 15 | Imath::V2i viewSize; 16 | Imath::M44d projMatrix; 17 | Imath::M44d modelViewMatrix; 18 | 19 | TransformState(const Imath::V2i& viewSize, const M44d& projMatrix, 20 | const M44d& modelViewMatrix) 21 | : viewSize(viewSize), projMatrix(projMatrix), 22 | modelViewMatrix(modelViewMatrix) 23 | { } 24 | 25 | /// Return position of camera in model space 26 | V3d cameraPos() const 27 | { 28 | return V3d(0)*modelViewMatrix.inverse(); 29 | } 30 | 31 | /// Translate model by given offset 32 | TransformState translate(const Imath::V3d& offset) const; 33 | 34 | /// Scale model by given scalar 35 | TransformState scale(const Imath::V3d& scalar) const; 36 | 37 | /// Rotate model by given rotation vector 38 | TransformState rotate(const Imath::V4d& rotation) const; 39 | 40 | /// Load matrix uniforms onto the currently bound shader program: 41 | /// 42 | /// "projectionMatrix" 43 | /// "modelViewMatrix" 44 | /// "modelViewProjectionMatrix" 45 | /// 46 | static void setUniform(GLuint prog, const char* name, const M44d& mat); 47 | void setUniforms(GLuint prog) const; 48 | 49 | void setOrthoProjection(double left, double right, double bottom, double top, double nearVal, double farVal); 50 | }; 51 | 52 | -------------------------------------------------------------------------------- /src/render/gldebug.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef GLDEBUG_H_INCLUDED 5 | #define GLDEBUG_H_INCLUDED 6 | 7 | #include 8 | 9 | void _glError(const char *file, int line); 10 | void _glFrameBufferStatus(GLenum target, const char *file, int line); 11 | 12 | 13 | // #define GL_CHECK 14 | #ifdef GL_CHECK 15 | 16 | #define glCheckError() _glError(__FILE__,__LINE__) 17 | #define glCheckFrameBufferStatus() _glFrameBufferStatus(GL_FRAMEBUFFER, __FILE__,__LINE__) 18 | 19 | #else 20 | 21 | #define glCheckError() 22 | #define glCheckFrameBufferStatus() 23 | 24 | #endif //GL_CHECK 25 | 26 | void _debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *msg, const void *data); 27 | 28 | class PushDebugGroup 29 | { 30 | public: 31 | PushDebugGroup(const char* message) 32 | { 33 | #ifdef GL_CHECK 34 | if (glPushDebugGroup) 35 | { 36 | glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, message); 37 | } 38 | #endif 39 | } 40 | 41 | ~PushDebugGroup() 42 | { 43 | #ifdef GL_CHECK 44 | if (glPopDebugGroup) 45 | { 46 | glPopDebugGroup(); 47 | } 48 | #endif 49 | } 50 | }; 51 | 52 | inline void pushDebugGroup(const char* message) 53 | { 54 | #ifdef GL_CHECK 55 | if (glPushDebugGroup) 56 | { 57 | glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, message); 58 | } 59 | #endif 60 | } 61 | 62 | inline void popDebugGroup() 63 | { 64 | #ifdef GL_CHECK 65 | if (glPopDebugGroup) 66 | { 67 | glPopDebugGroup(); 68 | } 69 | #endif 70 | } 71 | 72 | inline void objectLabel(GLenum identifier, GLuint name, const char* label) 73 | { 74 | #ifdef GL_CHECK 75 | if (glObjectLabel) 76 | { 77 | glObjectLabel(identifier, name, -1, label); 78 | } 79 | #endif 80 | } 81 | 82 | #endif // GLDEBUG_H_INCLUDED 83 | -------------------------------------------------------------------------------- /src/resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resource/axes.png 4 | resource/x.png 5 | resource/y.png 6 | resource/z.png 7 | resource/displaz_icon_256.png 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/resource/axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/axes.png -------------------------------------------------------------------------------- /src/resource/axes.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/axes.xcf -------------------------------------------------------------------------------- /src/resource/displaz_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/displaz_icon_256.png -------------------------------------------------------------------------------- /src/resource/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/x.png -------------------------------------------------------------------------------- /src/resource/xyz.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/xyz.xcf -------------------------------------------------------------------------------- /src/resource/y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/y.png -------------------------------------------------------------------------------- /src/resource/z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/src/resource/z.png -------------------------------------------------------------------------------- /src/shader/Enable.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "Enable.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | static void glEnableDisable(const std::optional& enable, GLenum f) 13 | { 14 | if (enable == GL_TRUE) 15 | { 16 | glEnable(f); 17 | return; 18 | } 19 | 20 | if (enable == GL_FALSE) 21 | { 22 | glDisable(f); 23 | return; 24 | } 25 | } 26 | 27 | void Enable::enableOrDisable() const 28 | { 29 | glEnableDisable(DEPTH_TEST, GL_DEPTH_TEST); 30 | glEnableDisable(STENCIL_TEST, GL_STENCIL_TEST); 31 | glEnableDisable(BLEND, GL_BLEND); 32 | glEnableDisable(VERTEX_PROGRAM_POINT_SIZE, GL_VERTEX_PROGRAM_POINT_SIZE); 33 | } 34 | 35 | bool Enable::set(const QString& src) 36 | { 37 | DEPTH_TEST = true; 38 | STENCIL_TEST = false; 39 | BLEND = false; 40 | VERTEX_PROGRAM_POINT_SIZE = true; 41 | 42 | // Search source code looking for glEnable/glDisable 43 | QStringList lines = src.split('\n'); 44 | QRegularExpression re("//\\s?gl(Enable|Disable)\\(([A-Z0-9_]+)\\)\\s?$"); 45 | for (const auto& line : lines) 46 | { 47 | const auto match = re.match(line); 48 | if (!match.hasMatch()) 49 | { 50 | continue; 51 | } 52 | 53 | const QByteArray enable = match.captured(1).toUtf8().constData(); 54 | const QByteArray name = match.captured(2).toUtf8().constData(); 55 | 56 | const bool e = enable == "Enable"; 57 | 58 | std::cout << name.data() << " " << enable.data() << std::endl; 59 | 60 | if (name == "GL_DEPTH_TEST") 61 | { 62 | DEPTH_TEST = (e ? GL_TRUE : GL_FALSE); 63 | } 64 | 65 | if (name == "GL_STENCIL_TEST") 66 | { 67 | STENCIL_TEST = (e ? GL_TRUE : GL_FALSE); 68 | } 69 | 70 | if (name == "GL_BLEND") 71 | { 72 | BLEND = (e ? GL_TRUE : GL_FALSE); 73 | } 74 | 75 | if (name == "GL_VERTEX_PROGRAM_POINT_SIZE") 76 | { 77 | VERTEX_PROGRAM_POINT_SIZE = (e ? GL_TRUE : GL_FALSE); 78 | } 79 | } 80 | 81 | return true; 82 | } 83 | -------------------------------------------------------------------------------- /src/shader/Enable.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef ENABLE_H_INCLUDED 5 | #define ENABLE_H_INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include 12 | 13 | class Enable 14 | { 15 | public: 16 | std::optional DEPTH_TEST { GL_TRUE }; 17 | std::optional STENCIL_TEST { GL_FALSE }; 18 | std::optional BLEND { GL_FALSE }; 19 | std::optional VERTEX_PROGRAM_POINT_SIZE { GL_TRUE }; 20 | 21 | void enableOrDisable() const; 22 | 23 | bool set(const QString& src); 24 | }; 25 | 26 | 27 | #endif // ENABLE_H_INCLUDED 28 | -------------------------------------------------------------------------------- /src/shader/Shader.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef SHADER_H_INCLUDED 5 | #define SHADER_H_INCLUDED 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "ShaderParam.h" 12 | 13 | /// Wrapper for QOpenGLShader, with functionality added to parse 14 | /// the list of uniform parameters. 15 | class Shader 16 | { 17 | public: 18 | Shader(QOpenGLShader::ShaderType type, const char* label = nullptr); 19 | 20 | /// Return list of uniform shader parameters 21 | const QList& uniforms() const 22 | { 23 | return m_uniforms; 24 | } 25 | 26 | /// Return original source code. 27 | QByteArray sourceCode() const 28 | { 29 | return m_source; 30 | } 31 | 32 | /// Access to underlying shader 33 | QOpenGLShader* shader() 34 | { 35 | return &m_shader; 36 | } 37 | 38 | bool compileSourceCode(const QByteArray& src); 39 | 40 | private: 41 | QList m_uniforms; 42 | QOpenGLShader m_shader; ///< Underlying shader 43 | QByteArray m_source; ///< Non-mangled source code 44 | }; 45 | 46 | 47 | #endif // SHADER_H_INCLUDED 48 | -------------------------------------------------------------------------------- /src/shader/ShaderParam.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #ifndef SHADER_PARAM_H_INCLUDED 5 | #define SHADER_PARAM_H_INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | /// Representation of a shader "parameter" (uniform variable or attribute) 16 | struct ShaderParam 17 | { 18 | using Variant = std::variant; 19 | 20 | QByteArray name; ///< Name of the variable in the shader 21 | Variant defaultValue; ///< Default value 22 | QMap kvPairs; ///< name,value pairs with additional metadata 23 | int ordering; ///< Ordering in source file 24 | 25 | QString uiName() const 26 | { 27 | return kvPairs.value("uiname", name); 28 | } 29 | 30 | double getDouble(QString name, double defaultVal) const 31 | { 32 | if (!kvPairs.contains(name)) 33 | return defaultVal; 34 | bool convOk = false; 35 | double val = kvPairs[name].toDouble(&convOk); 36 | if (!convOk) 37 | return defaultVal; 38 | return val; 39 | } 40 | 41 | int getInt(QString name, int defaultVal) const 42 | { 43 | if (!kvPairs.contains(name)) 44 | return defaultVal; 45 | bool convOk = false; 46 | double val = kvPairs[name].toInt(&convOk); 47 | if (!convOk) 48 | return defaultVal; 49 | return val; 50 | } 51 | 52 | ShaderParam(QByteArray name="", 53 | Variant defaultValue = Variant()) 54 | : name(name), defaultValue(defaultValue), ordering(0) {} 55 | }; 56 | 57 | 58 | inline bool operator==(const ShaderParam& p1, const ShaderParam& p2) 59 | { 60 | return 61 | p1.name == p2.name && 62 | p1.defaultValue.index() == p2.defaultValue.index() && 63 | p1.kvPairs == p2.kvPairs && 64 | p1.ordering == p2.ordering; 65 | } 66 | 67 | 68 | // Operator for ordering in QMap 69 | inline bool operator<(const ShaderParam& p1, const ShaderParam& p2) 70 | { 71 | if (p1.name != p2.name) 72 | return p1.name < p2.name; 73 | return p1.defaultValue.index() < p2.defaultValue.index(); 74 | } 75 | 76 | #endif // SHADER_PARAM_H_INCLUDED 77 | -------------------------------------------------------------------------------- /src/streampagecache_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include "streampagecache.h" 10 | 11 | // gcc 4.6 and 4.7 warns/suggests parentheses around == comparison 12 | #ifdef __GNUC__ 13 | #pragma GCC diagnostic ignored "-Wparentheses" 14 | #endif 15 | 16 | TEST_CASE("Test page cache for std::istream") 17 | { 18 | const size_t size = 12345; 19 | char buf[size]; 20 | for (size_t i = 0; i < size; ++i) 21 | buf[i] = rand() % 256; 22 | std::string tmpFileName = "streampagecache_test.dat"; 23 | { 24 | std::ofstream out(tmpFileName, std::ios::binary); 25 | out.write(buf, size); 26 | } 27 | 28 | std::ifstream in(tmpFileName, std::ios::binary); 29 | StreamPageCache cache(in, 1001); 30 | 31 | char buf2[size] = {0}; 32 | 33 | CHECK_FALSE(cache.prefetch(900, 200)); 34 | cache.fetchNow(2); 35 | CHECK(cache.read(buf2, 900, 200)); 36 | //checkEqual(buf + 900, buf2, 200); 37 | CHECK(std::memcmp(buf + 900, buf2, 200) == 0); 38 | 39 | for (size_t i = 0; i < size-3; ++i) 40 | { 41 | if (!cache.prefetch(i, 3)) 42 | cache.fetchNow(2); 43 | CHECK(cache.read(buf2, i, 3)); 44 | CHECK(std::memcmp(buf + i, buf2, 3) == 0); 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/test_main.cpp: -------------------------------------------------------------------------------- 1 | // Define main() for running tests 2 | #define CATCH_CONFIG_MAIN 3 | #include 4 | 5 | -------------------------------------------------------------------------------- /src/typespec.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Christopher J. Foster and the other displaz contributors. 2 | // Use of this code is governed by the BSD-style license found in LICENSE.txt 3 | 4 | #include "typespec.h" 5 | #include "glutil.h" 6 | 7 | #include 8 | 9 | //------------------------------------------------------------------------------ 10 | // TypeSpec functions 11 | 12 | int glBaseType(const TypeSpec& spec) 13 | { 14 | switch (spec.type) 15 | { 16 | case TypeSpec::Float: 17 | if (spec.elsize == 2) return GL_HALF_FLOAT; 18 | if (spec.elsize == 4) return GL_FLOAT; 19 | if (spec.elsize == 8) return GL_DOUBLE; 20 | break; 21 | case TypeSpec::Int: 22 | if (spec.elsize == 1) return GL_BYTE; 23 | if (spec.elsize == 2) return GL_SHORT; 24 | if (spec.elsize == 4) return GL_INT; 25 | break; 26 | case TypeSpec::Uint: 27 | if (spec.elsize == 1) return GL_UNSIGNED_BYTE; 28 | if (spec.elsize == 2) return GL_UNSIGNED_SHORT; 29 | if (spec.elsize == 4) return GL_UNSIGNED_INT; 30 | break; 31 | default: 32 | break; 33 | } 34 | assert(0 && "Unable to convert TypeSpec -> GL type"); 35 | return GL_BYTE; 36 | } 37 | 38 | 39 | 40 | std::ostream& operator<<(std::ostream& out, const TypeSpec& spec) 41 | { 42 | if (spec.type == TypeSpec::Float) 43 | { 44 | const char* baseTypeStr = ""; 45 | switch (spec.elsize) 46 | { 47 | case 2: baseTypeStr = "half"; break; 48 | case 4: baseTypeStr = "float"; break; 49 | case 8: baseTypeStr = "double"; break; 50 | default: baseTypeStr = "?"; assert(0); break; 51 | } 52 | tfm::format(out, "%s[%d]", baseTypeStr, spec.count); 53 | return out; 54 | } 55 | const char* baseTypeStr = ""; 56 | switch (spec.type) 57 | { 58 | case TypeSpec::Int: baseTypeStr = "int"; break; 59 | case TypeSpec::Uint: baseTypeStr = "uint"; break; 60 | case TypeSpec::Unknown: baseTypeStr = "unknown"; break; 61 | default: assert(0); 62 | } 63 | tfm::format(out, "%s%d_t[%d]", baseTypeStr, 8*spec.elsize, spec.count); 64 | return out; 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /test/bad_mesh_indices.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment A polygon and some edges containing various combinations of invalid 4 | comment vertex indices. These should cause displaz to discard the invalid 5 | comment geometry and carry on loading the rest of the file. 6 | element vertex 4 7 | property double x 8 | property double y 9 | property double z 10 | element face 3 11 | property list int int vertex_index 12 | element edge 6 13 | property list int int vertex_index 14 | end_header 15 | 0 0 0 16 | 1 1 0 17 | 2 0 0 18 | 1 2 0 19 | 4 0 1 2 3 20 | 4 -1 0 1 3 21 | 4 1 2 3 4 22 | 5 0 1 2 3 0 23 | 2 -1 1 24 | 2 0 4 25 | 2 -1000000 1 26 | 2 0 1000000 27 | 3 4 5 0 28 | -------------------------------------------------------------------------------- /test/color_lines.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment A set of vertices joined by coloured line segments 4 | element vertex 20 5 | property float x 6 | property float y 7 | property float z 8 | element color 20 9 | property float r 10 | property float g 11 | property float b 12 | element edge 2 13 | property list uchar int vertex_index 14 | end_header 15 | 0.00000000e+00 1.00000000e+00 0 16 | 3.24699469e-01 9.45817242e-01 0 17 | 6.14212713e-01 7.89140509e-01 0 18 | 8.37166478e-01 5.46948158e-01 0 19 | 9.69400266e-01 2.45485487e-01 0 20 | 9.96584493e-01 -8.25793455e-02 0 21 | 9.15773327e-01 -4.01695425e-01 0 22 | 7.35723911e-01 -6.77281572e-01 0 23 | 4.75947393e-01 -8.79473751e-01 0 24 | 1.64594590e-01 -9.86361303e-01 0 25 | -1.64594590e-01 -9.86361303e-01 0 26 | -4.75947393e-01 -8.79473751e-01 0 27 | -7.35723911e-01 -6.77281572e-01 0 28 | -9.15773327e-01 -4.01695425e-01 0 29 | -9.96584493e-01 -8.25793455e-02 0 30 | -9.69400266e-01 2.45485487e-01 0 31 | -8.37166478e-01 5.46948158e-01 0 32 | -6.14212713e-01 7.89140509e-01 0 33 | -3.24699469e-01 9.45817242e-01 0 34 | -2.44929360e-16 1.00000000e+00 0 35 | 0.0 1.0 0.0 36 | 0.101961 0.898039 0.0 37 | 0.376471 0.623529 0.0 38 | 0.701961 0.298039 0.0 39 | 0.941176 0.0588235 0.0 40 | 0.996078 0.00392157 0.0 41 | 0.839216 0.160784 0.0 42 | 0.541176 0.458824 0.0 43 | 0.223529 0.776471 0.0 44 | 0.0235294 0.976471 0.0 45 | 0.0235294 0.976471 0.0 46 | 0.223529 0.776471 0.0 47 | 0.541176 0.458824 0.0 48 | 0.839216 0.160784 0.0 49 | 0.996078 0.00392157 0.0 50 | 0.941176 0.0588235 0.0 51 | 0.701961 0.298039 0.0 52 | 0.376471 0.623529 0.0 53 | 0.101961 0.898039 0.0 54 | 0.0 1.0 0.0 55 | 5 0 1 2 3 4 56 | 5 10 11 12 13 14 57 | -------------------------------------------------------------------------------- /test/grid.jl: -------------------------------------------------------------------------------- 1 | # Script to generate a regular grid of lines in ply format for testing 2 | 3 | f = open("grid.ply", "w") 4 | 5 | N = 7 6 | 7 | write(f, """ 8 | ply 9 | format ascii 1.0 10 | element vertex $(N^3) 11 | property float x 12 | property float y 13 | property float z 14 | element color $(N^3) 15 | property float r 16 | property float g 17 | property float b 18 | element edge $(3*N^2*(N-1)) 19 | property list uchar int vertex_index 20 | end_header 21 | """) 22 | 23 | 24 | # Vertex positions 25 | for i=1:N 26 | for j=1:N 27 | for k=1:N 28 | write(f, "$i $j $k\n") 29 | end 30 | end 31 | end 32 | 33 | # Vertex colors 34 | for i=1:N 35 | for j=1:N 36 | for k=1:N 37 | r = rand() 38 | gb = rand() 39 | if gb > r 40 | gb = r 41 | end 42 | write(f, "$r $gb $gb\n") 43 | end 44 | end 45 | end 46 | 47 | # Edges 48 | strides = [1,N,N*N] 49 | for axis=0:2 50 | for i=1:N, j=1:N, k=1:N-1 51 | i1 = sum(strides .* (circshift([i,j,k], axis) - 1)) 52 | i2 = sum(strides .* (circshift([i,j,k+1], axis) - 1)) 53 | write(f, "2 $i1 $i2\n") 54 | end 55 | end 56 | 57 | close(f) 58 | -------------------------------------------------------------------------------- /test/polygon_2d.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment A simple nonconvex polygon 4 | element face 1 5 | property list int int vertex_index 6 | element vertex 4 7 | property double x 8 | property double y 9 | end_header 10 | 4 0 1 2 3 11 | 1 1 12 | 2 0 13 | 1 2 14 | 0 0 15 | -------------------------------------------------------------------------------- /test/polygon_explicitly_closed.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | element vertex 13 4 | property double x 5 | property double y 6 | property double z 7 | element polygon 1 8 | property list int int vertex_index 9 | property list int int inner_vertex_counts 10 | property list int int inner_vertex_index 11 | property double radius 12 | end_header 13 | 0.7500000000000000 44.5000000000000000 0.0000000000000000 14 | -0.7500000000000000 44.5000000000000000 0.0000000000000000 15 | -4.5000000000000000 35.5000000000000000 0.0000000000000000 16 | -3.0000000000000000 35.5000000000000000 0.0000000000000000 17 | -1.8750000000000000 38.5000000000000000 0.0000000000000000 18 | 1.8750000000000000 38.5000000000000000 0.0000000000000000 19 | 3.0000000000000000 35.5000000000000000 0.0000000000000000 20 | 4.5000000000000000 35.5000000000000000 0.0000000000000000 21 | 0.7500000000000000 44.5000000000000000 0.0000000000000000 22 | 0.0000000000000000 42.2500000000000000 0.0000000000000000 23 | -1.1250000000000000 40.0000000000000000 0.0000000000000000 24 | 1.1250000000000000 40.0000000000000000 0.0000000000000000 25 | 0.0000000000000000 42.2500000000000000 0.0000000000000000 26 | 9 0 1 2 3 4 5 6 7 8 1 4 4 9 10 11 12 0.2500000000000000 27 | -------------------------------------------------------------------------------- /test/polygon_holes.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment Experimental format for polygons with holes. 4 | comment 5 | comment Should look like the following: 6 | comment 7 | comment xxxxxxxxxxxxxxxxxx 8 | comment xxxxxxxxxxxxxxxxxx 9 | comment xx xx xx 10 | comment xx xx xx 11 | comment xx xx xx 12 | comment xxxxxxxxxxxxxxxxxx 13 | comment xxxxxxxxxxxxxxxxxx 14 | comment 15 | comment 16 | comment xxxxxxxxxxxxxxxxxx 17 | comment xxxxxxxxxxxxxxxxxx 18 | comment xxxx xxxxx xxx xxx 19 | comment xxx xxxx x xxx 20 | comment xx xxx xxx 21 | comment xxxxxxxxxxxxxxxxxx 22 | comment xxxxxxxxxxxxxxxxxx 23 | comment 24 | comment 25 | comment xxxxxxxxxxxxxxxxxx 26 | comment xxxxxxxxxxxxxxxxxx 27 | comment xxxxxxxxxxxxxxxxxx 28 | comment xxxxxxxxxxxxxxxxxx 29 | comment xxxxxxxxxxxxxxxxxx 30 | comment xxxxxxxxxxxxxxxxxx 31 | comment xxxxxxxxxxxxxxxxxx 32 | element vertex 28 33 | property double x 34 | property double y 35 | property double z 36 | element polygon 3 37 | property list int int vertex_index 38 | property list int int inner_vertex_counts 39 | property list int int inner_vertex_index 40 | end_header 41 | 0 0 0 42 | 0 3 0 43 | 5 3 0 44 | 5 0 0 45 | 1 1 0 46 | 2 1 0 47 | 2 2 0 48 | 1 2 0 49 | 3 1 0 50 | 4 1 0 51 | 4 2 0 52 | 3 2 0 53 | 0 6 0 54 | 0 9 0 55 | 5 9 0 56 | 5 6 0 57 | 1 7 0 58 | 2 7 0 59 | 2 8 0 60 | 1.5 7.5 0 61 | 1 8 0 62 | 3 7 0 63 | 4 7 0 64 | 3.5 8 0 65 | 0 12 0 66 | 0 15 0 67 | 5 15 0 68 | 5 12 0 69 | 4 0 1 2 3 2 4 4 8 4 5 6 7 8 9 10 11 70 | 4 12 13 14 15 2 5 3 8 16 17 18 19 20 21 22 23 71 | 4 24 25 26 27 0 0 72 | -------------------------------------------------------------------------------- /test/polygon_simple.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment A simple nonconvex polygon 4 | element face 1 5 | property list int int vertex_index 6 | element vertex 4 7 | property double x 8 | property double y 9 | property double z 10 | end_header 11 | 4 0 1 2 3 12 | 0 0 0 13 | 1 1 0 14 | 2 0 0 15 | 1 2 0 16 | -------------------------------------------------------------------------------- /test/single_point.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment Test reasonable behaviour when only a single point is loaded 4 | element vertex 1 5 | property float x 6 | property float y 7 | property float z 8 | end_header 9 | 1 2 3 10 | -------------------------------------------------------------------------------- /test/standard_ply_points.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment Point cloud test containing some standard ply field names + extras 4 | element vertex 20 5 | property float x 6 | property float y 7 | property float z 8 | property float nx 9 | property float ny 10 | property float nz 11 | property uint8 red 12 | property uint8 green 13 | property uint8 blue 14 | property float a[0] 15 | property float a[1] 16 | end_header 17 | 0.00000000e+00 1.00000000e+00 0 1.00000000e+00 -0.00000000e+00 1 0 255 0 0.00000000e+00 1.00000000e+00 18 | 3.24699469e-01 9.45817242e-01 0 9.45817242e-01 -3.24699469e-01 1 26 229 0 1.05429745e-01 8.94570255e-01 19 | 6.14212713e-01 7.89140509e-01 0 7.89140509e-01 -6.14212713e-01 1 96 159 0 3.77257256e-01 6.22742744e-01 20 | 8.37166478e-01 5.46948158e-01 0 5.46948158e-01 -8.37166478e-01 1 179 76 0 7.00847712e-01 2.99152288e-01 21 | 9.69400266e-01 2.45485487e-01 0 2.45485487e-01 -9.69400266e-01 1 240 15 0 9.39736876e-01 6.02631244e-02 22 | 9.96584493e-01 -8.25793455e-02 0 -8.25793455e-02 -9.96584493e-01 1 254 1 0 9.93180652e-01 6.81934830e-03 23 | 9.15773327e-01 -4.01695425e-01 0 -4.01695425e-01 -9.15773327e-01 1 214 41 0 8.38640786e-01 1.61359214e-01 24 | 7.35723911e-01 -6.77281572e-01 0 -6.77281572e-01 -7.35723911e-01 1 138 117 0 5.41289673e-01 4.58710327e-01 25 | 4.75947393e-01 -8.79473751e-01 0 -8.79473751e-01 -4.75947393e-01 1 57 198 0 2.26525921e-01 7.73474079e-01 26 | 1.64594590e-01 -9.86361303e-01 0 -9.86361303e-01 -1.64594590e-01 1 6 249 0 2.70913791e-02 9.72908621e-01 27 | -1.64594590e-01 -9.86361303e-01 0 -9.86361303e-01 1.64594590e-01 1 6 249 0 2.70913791e-02 9.72908621e-01 28 | -4.75947393e-01 -8.79473751e-01 0 -8.79473751e-01 4.75947393e-01 1 57 198 0 2.26525921e-01 7.73474079e-01 29 | -7.35723911e-01 -6.77281572e-01 0 -6.77281572e-01 7.35723911e-01 1 138 117 0 5.41289673e-01 4.58710327e-01 30 | -9.15773327e-01 -4.01695425e-01 0 -4.01695425e-01 9.15773327e-01 1 214 41 0 8.38640786e-01 1.61359214e-01 31 | -9.96584493e-01 -8.25793455e-02 0 -8.25793455e-02 9.96584493e-01 1 254 1 0 9.93180652e-01 6.81934830e-03 32 | -9.69400266e-01 2.45485487e-01 0 2.45485487e-01 9.69400266e-01 1 240 15 0 9.39736876e-01 6.02631244e-02 33 | -8.37166478e-01 5.46948158e-01 0 5.46948158e-01 8.37166478e-01 1 179 76 0 7.00847712e-01 2.99152288e-01 34 | -6.14212713e-01 7.89140509e-01 0 7.89140509e-01 6.14212713e-01 1 96 159 0 3.77257256e-01 6.22742744e-01 35 | -3.24699469e-01 9.45817242e-01 0 9.45817242e-01 3.24699469e-01 1 26 229 0 1.05429745e-01 8.94570255e-01 36 | -2.44929360e-16 1.00000000e+00 0 1.00000000e+00 2.44929360e-16 1 0 255 0 5.99903913e-32 1.00000000e+00 37 | -------------------------------------------------------------------------------- /test/testhook_draw_polygons.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # A small test script for the displaz event hook system. 4 | # 5 | # Allows the user to draw polygons by moving the 3D cursor, pressing the 6 | # "Space" key to insert a vertex, and Shift+Space to finish a polygon and start 7 | # the next. 8 | 9 | set -u 10 | 11 | make_polygon() { 12 | numverts=$1 13 | shift 14 | verts=$(echo -n -e "$@") 15 | cat <= 3 )) ; then 43 | tmp=$(mktemp /tmp/polygon_XXXXXXXXX.ply) 44 | make_polygon $numverts "$verts" > $tmp 45 | displaz -script -rmtemp -label $label $tmp 46 | fi 47 | fi 48 | if [[ $event_key != key:Space ]] ; then 49 | i=$((i+1)) 50 | label="Polygon$i" 51 | numverts=0 52 | verts="" 53 | fi 54 | done 55 | 56 | -------------------------------------------------------------------------------- /test/tetrahedra.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment Simple test of mixed 3D solid and edge rendering. 4 | comment Edges should show in front of faces without excessive z fighting. 5 | element vertex 8 6 | property float x 7 | property float y 8 | property float z 9 | property float r 10 | property float g 11 | property float b 12 | element face 8 13 | property list int int vertex_index 14 | element edge 12 15 | property list int int vertex_index 16 | end_header 17 | 1.0 1.0 1.0 1 0.5 0.5 18 | 1.0 -1.0 -1.0 0.5 1 0.5 19 | -1.0 1.0 -1.0 0.5 0.5 1 20 | -1.0 -1.0 1.0 1 1 1 21 | -1.3 -1.3 -1.3 1 0.5 0.5 22 | -1.3 1.3 1.3 0.5 1 0.5 23 | 1.3 -1.3 1.3 0.5 0.5 1 24 | 1.3 1.3 -1.3 1 1 1 25 | 3 0 1 2 26 | 3 0 2 3 27 | 3 0 3 1 28 | 3 3 2 1 29 | 3 4 5 6 30 | 3 4 6 7 31 | 3 4 7 5 32 | 3 7 6 5 33 | 2 0 1 34 | 2 0 2 35 | 2 0 3 36 | 2 1 2 37 | 2 1 3 38 | 2 2 3 39 | 2 4 5 40 | 2 4 6 41 | 2 4 7 42 | 2 5 6 43 | 2 5 7 44 | 2 6 7 45 | -------------------------------------------------------------------------------- /test/textured.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment TextureFile uv_texture.png 4 | element vertex 4 5 | property double x 6 | property double y 7 | property double z 8 | property double u 9 | property double v 10 | element face 1 11 | property list int int vertex_index 12 | end_header 13 | -2 -1.5 0 0 1 14 | 2 -1.5 0 1 1 15 | 2 1.5 0 1 0 16 | -2 1.5 0 0 0 17 | 4 0 1 2 3 18 | -------------------------------------------------------------------------------- /test/triangles.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment Test of triangle mesh and reading of XY hull 4 | element vertex 22 5 | property float x 6 | property float y 7 | property float z 8 | property float r 9 | property float g 10 | property float b 11 | element face 20 12 | property list int int vertex_index 13 | end_header 14 | 0 0 0.1 1 1 1 15 | 0 0 -0.1 0 0 0 16 | 0.00000000e+00 1.00000000e+00 0 0.00e+00 1.00e+00 0 17 | 3.09016994e-01 9.51056516e-01 0 3.09e-01 9.51e-01 0 18 | 5.87785252e-01 8.09016994e-01 0 5.87e-01 8.09e-01 0 19 | 8.09016994e-01 5.87785252e-01 0 8.09e-01 5.87e-01 0 20 | 9.51056516e-01 3.09016994e-01 0 9.51e-01 3.09e-01 0 21 | 1.00000000e+00 6.12323400e-17 0 1.00e+00 6.12e-17 0 22 | 9.51056516e-01 -3.09016994e-01 0 9.51e-01 -3.09e-01 0 23 | 8.09016994e-01 -5.87785252e-01 0 8.09e-01 -5.87e-01 0 24 | 5.87785252e-01 -8.09016994e-01 0 5.87e-01 -8.09e-01 0 25 | 3.09016994e-01 -9.51056516e-01 0 3.09e-01 -9.51e-01 0 26 | 1.22464680e-16 -1.00000000e+00 0 1.22e-16 -1.00e+00 0 27 | -3.09016994e-01 -9.51056516e-01 0 -3.09e-01 -9.51e-01 0 28 | -5.87785252e-01 -8.09016994e-01 0 -5.87e-01 -8.09e-01 0 29 | -8.09016994e-01 -5.87785252e-01 0 -8.09e-01 -5.87e-01 0 30 | -9.51056516e-01 -3.09016994e-01 0 -9.51e-01 -3.09e-01 0 31 | -1.00000000e+00 0.00000000e+00 0 -1.00e+00 0.00e+00 0 32 | -9.51056516e-01 3.09016994e-01 0 -9.51e-01 3.09e-01 0 33 | -8.09016994e-01 5.87785252e-01 0 -8.09e-01 5.87e-01 0 34 | -5.87785252e-01 8.09016994e-01 0 -5.87e-01 8.09e-01 0 35 | -3.09016994e-01 9.51056516e-01 0 -3.09e-01 9.51e-01 0 36 | 3 0 2 3 37 | 3 0 4 5 38 | 3 0 6 7 39 | 3 0 8 9 40 | 3 0 10 11 41 | 3 0 12 13 42 | 3 0 14 15 43 | 3 0 16 17 44 | 3 0 18 19 45 | 3 0 20 21 46 | 3 1 3 4 47 | 3 1 5 6 48 | 3 1 7 8 49 | 3 1 9 10 50 | 3 1 11 12 51 | 3 1 13 14 52 | 3 1 15 16 53 | 3 1 17 18 54 | 3 1 19 20 55 | 3 1 21 2 56 | -------------------------------------------------------------------------------- /test/uv_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/test/uv_texture.png -------------------------------------------------------------------------------- /thirdparty/external/.gitignore: -------------------------------------------------------------------------------- 1 | downloads 2 | -------------------------------------------------------------------------------- /thirdparty/external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build system for a subset of third party libraries required by displaz. 2 | 3 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING 4 | "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." 5 | ) 6 | 7 | if(NOT WIN32) 8 | set(CMAKE_CXX_FLAGS "-std=c++0x" 9 | CACHE STRING "Flags used by the compiler during all build types.") 10 | endif() 11 | 12 | project(external_libs) 13 | 14 | cmake_minimum_required(VERSION 2.8.12) 15 | 16 | set(DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/downloads" 17 | CACHE PATH "Location for downloaded source archives") 18 | set(THIRDPARTY_INSTALL_PREFIX "dist" 19 | CACHE PATH "Location to install third party libraries") 20 | 21 | set(CMAKE_INSTALL_PREFIX ${THIRDPARTY_INSTALL_PREFIX}) 22 | 23 | include(ExternalProject) 24 | 25 | ExternalProject_Add( 26 | Imath 27 | URL https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.6.tar.gz 28 | URL_MD5 dccea95a752b7a772706e5cc8b0043dc 29 | CMAKE_ARGS 30 | -D CMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} 31 | -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} 32 | -D CMAKE_INSTALL_PREFIX:PATH= 33 | -D NAMESPACE_VERSIONING:BOOL=OFF 34 | -D BUILD_SHARED_LIBS:BOOL=OFF 35 | INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" 36 | DOWNLOAD_DIR "${DOWNLOAD_DIR}" 37 | ) 38 | 39 | ExternalProject_Add( 40 | laslib 41 | SOURCE_DIR ${PROJECT_SOURCE_DIR}/LAStools 42 | CMAKE_ARGS 43 | -D CMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} 44 | -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} 45 | -D CMAKE_CONFIGURATION_TYPES:STRING=${CMAKE_BUILD_TYPE} 46 | -D CMAKE_INSTALL_PREFIX:PATH= 47 | INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" 48 | DOWNLOAD_DIR "${DOWNLOAD_DIR}" 49 | ) 50 | 51 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/CHANGES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/thirdparty/external/LAStools/CHANGES.txt -------------------------------------------------------------------------------- /thirdparty/external/LAStools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1 FATAL_ERROR) 2 | set(CMAKE_SUPPRESS_REGENERATION true) 3 | set(CMAKE_CXX_STANDARD 17) 4 | project("LAStools" CXX C) 5 | 6 | if (!MSVC) 7 | add_compile_options(-O3 -Wall -Wno-strict-aliasing) 8 | else() 9 | add_definitions(-D_CRT_SECURE_NO_WARNINGS) 10 | endif() 11 | 12 | option(BUILD_SHARED_LIBS "Build LASlib as DLL" OFF) 13 | 14 | if (BUILD_SHARED_LIBS AND UNIX AND NOT APPLE) 15 | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/LASlib") 16 | endif() 17 | 18 | add_subdirectory(LASlib/src) 19 | #add_subdirectory(src) 20 | if (EXISTS src_full) 21 | add_subdirectory(src_full) 22 | endif() 23 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/HALL_OF_SHAME.txt: -------------------------------------------------------------------------------- 1 | HALL OF SHAME 2 | ============= 3 | 4 | 1) Tennessee Geographic Information Council (TNGIC) self-declared goals set at 5 | their first user forum held at the Garden Plaza in Murfreesboro in late 1993 are 6 | to "promote and facilitate data sharing", to "promote data standardization", as 7 | well as to "avoid duplication of effort". TNGIC was nominated for providing their 8 | state-wide open LiDAR data solely in the closed and proprietary vendor format with 9 | the file extension *.zlas despite being repeatedly asked to offer this data (also) 10 | in a vendor-agnostic open format ... 11 | 12 | 2) ... 13 | 14 | The "HALL OF SHAME" is our funny-provocative and dicussion-starting way to 15 | assure that our "open LiDAR data" is stored and distributed in our "open 16 | LiDAR formats" to the benefits of users on any platform using any software. 17 | 18 | We list agencies or portals that are distributers of "locked-up LiDAR" 19 | and promote proprietary LiDAR formats by providing raw "pseudo-open" point 20 | clouds exclusively in closed formats such as *.sid, *.zlas, *.rar, ... 21 | 22 | Please let us know once you have corrected your course and should be removed 23 | from the HALL. We are always taking new "HALL OF SHAME" nominations ... (-; 24 | 25 | [1] http://rapidlasso.com/2015/04/20/new-lasliberator-frees-lidar-from-closed-format/ 26 | [2] http://github.com/LASliberator 27 | [3] http://github.com/LASliberator/lasliberate/archive/master.zip 28 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/.gitignore: -------------------------------------------------------------------------------- 1 | Release 2 | Debug 3 | LASlib.ncb 4 | LASlib.opt 5 | LASlib.plg 6 | *~ 7 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/CHANGES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/thirdparty/external/LAStools/LASlib/CHANGES.txt -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/README.txt: -------------------------------------------------------------------------------- 1 | LASlib (with LASzip) is a C++ programming API for reading / writing LIDAR 2 | data stored in standard LAS or in compressed LAZ format (1.0 - 1.3). Both 3 | libraries - LASlib with LASzip - are released together under the terms of 4 | the GNU Lesser General Public Licence also known as LGPL. See LICENSE.txt 5 | for details. 6 | 7 | Internally LASlib includes my stand-alone LASzip compression library that 8 | provides lossless compression for LAS data. This allows you to read or 9 | write *.laz (LASzip compressed *.las files) directly like you would an 10 | uncompressed .las file using the same LASreader and LASwriter classes. 11 | 12 | This distribution comes with a small tool called "laszip" or "laszip.exe" 13 | compresses LAS files into much more compact LAZ files and vice versa. The 14 | resulting files are around 7 - 20 percent of their original size without 15 | a single bit being different (i.e. absolutely lossless compression). 16 | 17 | LASlib (with LASzip) is easy-to-use, light-weight, yet extremely fast. Just 18 | download it here and you are ready to go. For Windows users "laszip.exe" and 19 | other binary LAStools and a MSVC6.0 project environment are included. For 20 | Linux users there are simple Makefiles. 21 | 22 | The best way is get LASlib is to download LAStools, which contains the 23 | full LASlib (with LASzip) distribution: 24 | 25 | wget http://www.lastools.org/download/LAStools.zip 26 | unzip LAStools.zip 27 | cd LAStools/ 28 | make 29 | 30 | -------------------- 31 | 32 | Here is how simple the programming API is: 33 | 34 | #include "lasreader.hpp" 35 | #include "laswriter.hpp" 36 | 37 | int main(int argc, char *argv[]) 38 | { 39 | LASreadOpener lasreadopener; 40 | lasreadopener.set_file_name("original.las"); 41 | LASreader* lasreader = lasreadopener.open(); 42 | 43 | LASwriteOpener laswriteopener; 44 | laswriteopener.set_file_name("compressed.laz"); 45 | LASwriter* laswriter = laswriteopener.open(&lasreader->header); 46 | 47 | while (lasreader->read_point()) laswriter->write_point(&lasreader->point); 48 | 49 | laswriter->close(); 50 | delete laswriter; 51 | 52 | lasreader->close(); 53 | delete lasreader; 54 | 55 | return 0; 56 | } 57 | 58 | -------------------- 59 | 60 | Many LAStools are "free" open source (LGPL). But some of the more powerful 61 | LAStools (i.e. for contour extraction, boundary polygon computation, TIN 62 | generation, DEM creation, thinning, clipping, tiling, sorting, ...) need 63 | a license for commercial and government use. 64 | 65 | -------------------- 66 | 67 | (c) 2007-2014 info@rapidlasso.de 68 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/lasfilter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasfilter.hpp 5 | 6 | CONTENTS: 7 | 8 | Filters LIDAR points based on certain criteria being true (or not). 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2021, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 9 June 2021 -- disallow use of '-keep_class' together with '-keep_extended_class' 28 | 3 April 2021 -- new filter '-keep_profile p1_x p1_y p2_x p2_y width' 29 | 6 March 2018 -- changed '%g' to '%lf' for all sprintf() of F64 values 30 | 14 December 2017 -- keep multiple flightlines with '-keep_point_source 2 3 4' 31 | 10 December 2017 -- new '-keep_random_fraction 0.2 4711' uses 4711 as seed 32 | 25 December 2010 -- created after swinging in Mara's hammock for hours 33 | 34 | =============================================================================== 35 | */ 36 | #ifndef LAS_FILTER_HPP 37 | #define LAS_FILTER_HPP 38 | 39 | #include "lasdefinitions.hpp" 40 | #include "laszip_decompress_selective_v3.hpp" 41 | 42 | class LAScriterion 43 | { 44 | public: 45 | virtual const CHAR * name() const = 0; 46 | virtual I32 get_command(CHAR* string) const = 0; 47 | virtual U32 get_decompress_selective() const { return LASZIP_DECOMPRESS_SELECTIVE_CHANNEL_RETURNS_XY; }; 48 | virtual BOOL filter(const LASpoint* point) = 0; 49 | virtual void reset(){}; 50 | virtual ~LAScriterion(){}; 51 | }; 52 | 53 | class LASfilter 54 | { 55 | public: 56 | 57 | void usage() const; 58 | void clean(); 59 | BOOL parse(int argc, char* argv[]); 60 | BOOL parse(CHAR* string); 61 | I32 unparse(CHAR* string) const; 62 | inline BOOL active() const { return (num_criteria != 0); }; 63 | U32 get_decompress_selective() const; 64 | 65 | void addClipCircle(F64 x, F64 y, F64 radius); 66 | void addClipBox(F64 min_x, F64 min_y, F64 min_z, F64 max_x, F64 max_y, F64 max_z); 67 | void addKeepScanDirectionChange(); 68 | 69 | BOOL filter(const LASpoint* point); 70 | void reset(); 71 | 72 | LASfilter(); 73 | ~LASfilter(); 74 | 75 | private: 76 | 77 | void add_criterion(LAScriterion* criterion); 78 | U32 num_criteria; 79 | U32 alloc_criteria; 80 | LAScriterion** criteria; 81 | I32* counters; 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/lasignore.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasignore.hpp 5 | 6 | CONTENTS: 7 | 8 | Implements the various rules for ignoring points when processing LiDAR. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2019, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 21 July 2021 -- fixed '-ignore_extended_class 128'. please memoy, call me! 28 | 18 August 2019 -- created after Memoy's cousine stole USD 300 and EUR 100 29 | 30 | =============================================================================== 31 | */ 32 | #ifndef LAS_IGNORE_HPP 33 | #define LAS_IGNORE_HPP 34 | 35 | #include "lasdefinitions.hpp" 36 | 37 | #define LASIGNORE_CLASSIFICATIONS 0x000000FF 38 | #define LASIGNORE_RETURNS 0x00000F00 39 | #define LASIGNORE_FLAGS 0x0000F000 40 | 41 | #define LASIGNORE_FIRST_OF_MANY 0x00000100 42 | #define LASIGNORE_LAST_OF_MANY 0x00000200 43 | #define LASIGNORE_INTERMEDIATE 0x00000400 44 | #define LASIGNORE_SINGLE 0x00000800 45 | 46 | #define LASIGNORE_SYNTHETIC 0x00001000 47 | #define LASIGNORE_KEYPOINT 0x00002000 48 | #define LASIGNORE_WITHHELD 0x00004000 49 | #define LASIGNORE_OVERLAP 0x00008000 50 | 51 | class LASignore 52 | { 53 | public: 54 | void usage() const; 55 | 56 | void ignore_class(U8 classification); 57 | void dont_ignore_class(U8 classification); 58 | 59 | BOOL parse(int& i, int argc, char *argv[]); 60 | I32 unparse(CHAR* string) const; 61 | 62 | BOOL parse(U32 curr_parameter, const U32 num_parameters, const F64* parameters); 63 | void unparse(U32& num_parameters, F64* parameters) const; 64 | 65 | U32 get_decompress_selective() const; 66 | 67 | BOOL ignore(const LASpoint* point) const; 68 | 69 | LASignore(); 70 | ~LASignore(); 71 | protected: 72 | U32 ignore_mask; 73 | U32 ignore_classification_mask[8]; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/lasreader_bin.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasreader_bin.hpp 5 | 6 | CONTENTS: 7 | 8 | Reads LIDAR from Terrascan's BIN format via on-the-fly conversion as LAS. 9 | 10 | Format description: http://www.terrasolid.fi/system/files/tscan.pdf 11 | 12 | PROGRAMMERS: 13 | 14 | info@rapidlasso.de - https://rapidlasso.de 15 | 16 | COPYRIGHT: 17 | 18 | (c) 2007-2012, rapidlasso GmbH - fast tools to catch reality 19 | 20 | This is free software; you can redistribute and/or modify it under the 21 | terms of the GNU Lesser General Licence as published by the Free Software 22 | Foundation. See the LICENSE.txt file for more information. 23 | 24 | This software is distributed WITHOUT ANY WARRANTY and without even the 25 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 26 | 27 | CHANGE HISTORY: 28 | 29 | 4 September 2011 -- created on Labor Day Sunday far from beloved mountains 30 | 31 | =============================================================================== 32 | */ 33 | #ifndef LAS_READER_BIN_HPP 34 | #define LAS_READER_BIN_HPP 35 | 36 | #include "lasreader.hpp" 37 | 38 | #include 39 | 40 | class LASreaderBIN : public LASreader 41 | { 42 | public: 43 | 44 | BOOL open(const char* file_name); 45 | 46 | I32 get_format() const { return LAS_TOOLS_FORMAT_BIN; }; 47 | 48 | BOOL seek(const I64 p_index); 49 | 50 | ByteStreamIn* get_stream() const; 51 | void close(BOOL close_stream=TRUE); 52 | BOOL reopen(const char* file_name); 53 | 54 | LASreaderBIN(LASreadOpener* opener); 55 | virtual ~LASreaderBIN(); 56 | 57 | protected: 58 | virtual BOOL open(ByteStreamIn* stream); 59 | BOOL read_point_default(); 60 | 61 | private: 62 | FILE* file; 63 | ByteStreamIn* stream; 64 | I32 version; 65 | }; 66 | 67 | class LASreaderBINrescale : public virtual LASreaderBIN 68 | { 69 | public: 70 | virtual BOOL open(ByteStreamIn* stream); 71 | LASreaderBINrescale(LASreadOpener* opener, F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor); 72 | 73 | protected: 74 | F64 scale_factor[3]; 75 | }; 76 | 77 | class LASreaderBINreoffset : public virtual LASreaderBIN 78 | { 79 | public: 80 | virtual BOOL open(ByteStreamIn* stream); 81 | LASreaderBINreoffset(LASreadOpener* opener, F64 x_offset, F64 y_offset, F64 z_offset); 82 | protected: 83 | F64 offset[3]; 84 | }; 85 | 86 | class LASreaderBINrescalereoffset : public LASreaderBINrescale, LASreaderBINreoffset 87 | { 88 | public: 89 | BOOL open(ByteStreamIn* stream); 90 | LASreaderBINrescalereoffset(LASreadOpener* opener, F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset); 91 | }; 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/lasreaderpipeon.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasreaderpipeon.hpp 5 | 6 | CONTENTS: 7 | 8 | Reads LIDAR points from another LASreader and writes them also to the stdout 9 | before returning them to the instance that is reading the points. 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2012, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the GNU Lesser General Licence as published by the Free Software 21 | Foundation. See the LICENSE.txt file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 28 | 2 May 2023 -- adding support of COPC spatial index standard 29 | 21 August 2012 -- created after swimming in the Main river 3 days in a row 30 | 31 | =============================================================================== 32 | */ 33 | #ifndef LAS_READER_PIPE_ON_HPP 34 | #define LAS_READER_PIPE_ON_HPP 35 | 36 | #include "lasreader.hpp" 37 | #include "laswriter.hpp" 38 | 39 | class LASreaderPipeOn : public LASreader 40 | { 41 | public: 42 | 43 | BOOL open(LASreader* lasreader); 44 | LASreader* get_lasreader() const { return lasreader; }; 45 | 46 | I32 get_format() const; 47 | 48 | void set_index(LASindex* index); 49 | LASindex* get_index() const; 50 | void set_copcindex(COPCindex* copcindex); 51 | COPCindex* get_copcindex() const; 52 | void set_filter(LASfilter* filter); 53 | void set_transform(LAStransform* transform); 54 | 55 | BOOL inside_tile(const F32 ll_x, const F32 ll_y, const F32 size); 56 | BOOL inside_circle(const F64 center_x, const F64 center_y, const F64 radius); 57 | BOOL inside_rectangle(const F64 min_x, const F64 min_y, const F64 max_x, const F64 max_y); 58 | BOOL inside_copc_depth(const U8 mode, const I32 depth, const F32 resolution); 59 | 60 | BOOL seek(const I64 p_index){ return FALSE; }; 61 | 62 | ByteStreamIn* get_stream() const { return 0; }; 63 | void close(BOOL close_stream=TRUE); 64 | 65 | LASreaderPipeOn(LASreadOpener* opener); 66 | ~LASreaderPipeOn(); 67 | 68 | protected: 69 | BOOL read_point_default(); 70 | 71 | private: 72 | LASreader* lasreader; 73 | LASwriter* laswriter; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/lasreaderstored.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasreaderstored.hpp 5 | 6 | CONTENTS: 7 | 8 | Reads LiDAR points from another LASreader and stores them in compressed form 9 | so they can be read from memory on the second read. This is especially used 10 | for piping LiDAR from one process to another for those modules that perform 11 | two reading passes over the input. 12 | 13 | PROGRAMMERS: 14 | 15 | info@rapidlasso.de - https://rapidlasso.de 16 | 17 | COPYRIGHT: 18 | 19 | (c) 2007-2017, rapidlasso GmbH - fast tools to catch reality 20 | 21 | This is free software; you can redistribute and/or modify it under the 22 | terms of the GNU Lesser General Licence as published by the Free Software 23 | Foundation. See the LICENSE.txt file for more information. 24 | 25 | This software is distributed WITHOUT ANY WARRANTY and without even the 26 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 27 | 28 | CHANGE HISTORY: 29 | 30 | 9 December 2017 -- created at Octopus Resort on Waya Island in Fiji 31 | 32 | =============================================================================== 33 | */ 34 | #ifndef LAS_READER_STORED_HPP 35 | #define LAS_READER_STORED_HPP 36 | 37 | #include "lasreader.hpp" 38 | #include "laswriter.hpp" 39 | #include "bytestreamin_array.hpp" 40 | #include "bytestreamout_array.hpp" 41 | 42 | class LASreaderStored : public LASreader 43 | { 44 | public: 45 | 46 | BOOL open(LASreader* lasreader); 47 | BOOL reopen(); 48 | LASreader* get_lasreader() const { return lasreader; }; 49 | 50 | I32 get_format() const; 51 | 52 | void set_index(LASindex* index); 53 | LASindex* get_index() const; 54 | void set_filter(LASfilter* filter); 55 | void set_transform(LAStransform* transform); 56 | 57 | BOOL inside_tile(const F32 ll_x, const F32 ll_y, const F32 size); 58 | BOOL inside_circle(const F64 center_x, const F64 center_y, const F64 radius); 59 | BOOL inside_rectangle(const F64 min_x, const F64 min_y, const F64 max_x, const F64 max_y); 60 | 61 | BOOL seek(const I64 p_index){ return FALSE; }; 62 | 63 | ByteStreamIn* get_stream() const { return 0; }; 64 | void close(BOOL close_stream=TRUE); 65 | 66 | LASreaderStored(LASreadOpener* opener); 67 | ~LASreaderStored(); 68 | 69 | protected: 70 | BOOL read_point_default(); 71 | 72 | private: 73 | LASreader* lasreader; 74 | LASwriter* laswriter; 75 | ByteStreamInArray* streaminarray; 76 | ByteStreamOutArray* streamoutarray; 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/lasvlr.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasvlr.hpp 5 | 6 | CONTENTS: 7 | 8 | This class defines those VLRs and EVLRs that are defined either in the LAS 9 | specification or are specific to and used by LAStools. 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2019, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the GNU Lesser General Licence as published by the Free Software 21 | Foundation. See the LICENSE.txt file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 28 | 28 November 2019 -- created after Tobago paddle week in flight POS -> PTY 29 | 30 | =============================================================================== 31 | */ 32 | #ifndef LAS_VLR_HPP 33 | #define LAS_VLR_HPP 34 | 35 | #include "mydefs.hpp" 36 | 37 | class LASvlr_lastiling 38 | { 39 | public: 40 | U32 level; 41 | U32 level_index; 42 | U32 implicit_levels : 30; 43 | U32 buffer : 1; 44 | U32 reversible : 1; 45 | F32 min_x; 46 | F32 max_x; 47 | F32 min_y; 48 | F32 max_y; 49 | 50 | LASvlr_lastiling() 51 | { 52 | memset((void*)this, 0, sizeof(LASvlr_lastiling)); 53 | }; 54 | }; 55 | 56 | class LASvlr_lasoriginal 57 | { 58 | public: 59 | I64 number_of_point_records; 60 | I64 number_of_points_by_return[15]; 61 | F64 max_x; 62 | F64 min_x; 63 | F64 max_y; 64 | F64 min_y; 65 | F64 max_z; 66 | F64 min_z; 67 | I64 position; 68 | 69 | LASvlr_lasoriginal() 70 | { 71 | memset((void*)this, 0, sizeof(LASvlr_lasoriginal)); 72 | }; 73 | }; 74 | 75 | 76 | #endif // LAS_VLR_HPP 77 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswaveform13reader.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswaveform13reader.hpp 5 | 6 | CONTENTS: 7 | 8 | Interface to read the Waveform Data Packets that are associated with points 9 | of type 4 and 5 in LAS 1.3. 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2012, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the GNU Lesser General Licence as published by the Free Software 21 | Foundation. See the LICENSE.txt file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 28 | 7 September 2018 -- replaced calls to _strdup with calls to the LASCopyString macro 29 | 17 October 2011 -- created after bauarbeiter on the roof next door woke me 30 | 31 | =============================================================================== 32 | */ 33 | #ifndef LAS_WAVEFORM_13_READER_HPP 34 | #define LAS_WAVEFORM_13_READER_HPP 35 | 36 | #include "lasdefinitions.hpp" 37 | 38 | class ByteStreamIn; 39 | class LASwaveformDescription; 40 | class ArithmeticDecoder; 41 | class IntegerCompressor; 42 | 43 | class LASLIB_DLL LASwaveform13reader 44 | { 45 | public: 46 | U32 nbits; 47 | U32 nsamples; 48 | U32 temporal; 49 | F32 location; 50 | F32 XYZt[3]; 51 | F64 XYZreturn[3]; 52 | 53 | F64 XYZsample[3]; 54 | 55 | U32 s_count; 56 | U32 sample; 57 | 58 | U32 sampleMin; 59 | U32 sampleMax; 60 | 61 | U8* samples; 62 | 63 | BOOL open(const char* file_name, I64 start_of_waveform_data_packet_record, const LASvlr_wave_packet_descr * const * wave_packet_descr); 64 | BOOL is_compressed() const; 65 | 66 | BOOL read_waveform(const LASpoint* point); 67 | 68 | BOOL get_samples(); 69 | BOOL has_samples(); 70 | 71 | BOOL get_samples_xyz(); 72 | BOOL has_samples_xyz(); 73 | 74 | void close(); 75 | 76 | LASwaveform13reader(); 77 | ~LASwaveform13reader(); 78 | 79 | private: 80 | BOOL compressed; 81 | U32 size; 82 | const LASvlr_wave_packet_descr * const * wave_packet_descr; 83 | FILE* file; 84 | ByteStreamIn* stream; 85 | I64 start_of_waveform_data_packet_record; 86 | I64 last_position; 87 | ArithmeticDecoder* dec; 88 | IntegerCompressor* ic8; 89 | IntegerCompressor* ic16; 90 | }; 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswaveform13writer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswaveform13writer.hpp 5 | 6 | CONTENTS: 7 | 8 | Interface to write the Waveform Data Packets that are associated with points 9 | of type 4 and 5 in LAS 1.3. 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2012, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the GNU Lesser General Licence as published by the Free Software 21 | Foundation. See the LICENSE.txt file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 04 August 2023 -- set default of VLR header "reserved" to 0 instead of 0xAABB 28 | 7 September 2018 -- replaced calls to _strdup with calls to the LASCopyString macro 29 | 17 October 2011 -- created after bauarbeiter on the roof next door woke me 30 | 31 | =============================================================================== 32 | */ 33 | #ifndef LAS_WAVEFORM_13_WRITER_HPP 34 | #define LAS_WAVEFORM_13_WRITER_HPP 35 | 36 | #include "lasdefinitions.hpp" 37 | 38 | class ByteStreamOut; 39 | class LASwaveformDescription; 40 | class ArithmeticEncoder; 41 | class IntegerCompressor; 42 | 43 | class LASLIB_DLL LASwaveform13writer 44 | { 45 | public: 46 | BOOL open(const char* file_name, const LASvlr_wave_packet_descr * const * wave_packet_descr); 47 | 48 | BOOL write_waveform(LASpoint* point, U8* samples); 49 | 50 | void close(); 51 | 52 | LASwaveform13writer(); 53 | ~LASwaveform13writer(); 54 | 55 | private: 56 | LASwaveformDescription** waveforms; 57 | FILE* file; 58 | ByteStreamOut* stream; 59 | 60 | ArithmeticEncoder* enc; 61 | IntegerCompressor* ic8; 62 | IntegerCompressor* ic16; 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswriter_bin.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswriter_bin.hpp 5 | 6 | CONTENTS: 7 | 8 | Writes LIDAR points from to ASCII through on-the-fly conversion from LAS. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2014, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 13 October 2014 -- changed default IO buffer size with setvbuf() to 262144 28 | 5 November 2011 -- changed default IO buffer size with setvbuf() to 65536 29 | 5 September 2011 -- created after sampling grapes in the sommerhausen hills 30 | 31 | =============================================================================== 32 | */ 33 | #ifndef LAS_WRITER_BIN_HPP 34 | #define LAS_WRITER_BIN_HPP 35 | 36 | #include "laswriter.hpp" 37 | 38 | #include 39 | 40 | class ByteStreamOut; 41 | 42 | class LASwriterBIN : public LASwriter 43 | { 44 | public: 45 | 46 | BOOL refile(FILE* file); 47 | 48 | BOOL open(const char* file_name, const LASheader* header, const char* version, U32 io_buffer_size=LAS_TOOLS_IO_OBUFFER_SIZE ); 49 | BOOL open(FILE* file, const LASheader* header, const char* version); 50 | BOOL open(ByteStreamOut* stream, const LASheader* header, const char* version); 51 | 52 | BOOL write_point(const LASpoint* point); 53 | BOOL chunk() { return FALSE; }; 54 | 55 | BOOL update_header(const LASheader* header, BOOL use_inventory=FALSE, BOOL update_extra_bytes=FALSE); 56 | I64 close(BOOL update_npoints=TRUE); 57 | 58 | LASwriterBIN(); 59 | ~LASwriterBIN(); 60 | 61 | private: 62 | ByteStreamOut* stream; 63 | FILE* file; 64 | U32 version; 65 | I32 units; 66 | F64 origin_x; 67 | F64 origin_y; 68 | F64 origin_z; 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswriter_qfit.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswriter_qfit.hpp 5 | 6 | CONTENTS: 7 | 8 | Writes LIDAR points from to ASCII through on-the-fly conversion from LAS. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2014, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 23 December 2011 -- created after by new OGIO laptop bagpack arrived 28 | 29 | =============================================================================== 30 | */ 31 | #ifndef LAS_WRITER_QFIT_HPP 32 | #define LAS_WRITER_QFIT_HPP 33 | 34 | #include "laswriter.hpp" 35 | 36 | #include 37 | 38 | class ByteStreamOut; 39 | 40 | class LASwriterQFIT : public LASwriter 41 | { 42 | public: 43 | 44 | BOOL refile(FILE* file); 45 | 46 | BOOL open(const char* file_name, const LASheader* header, I32 version=48, U32 io_buffer_size=65536); 47 | BOOL open(FILE* file, const LASheader* header, I32 version=48); 48 | BOOL open(ByteStreamOut* stream, const LASheader* header, I32 version=48); 49 | 50 | BOOL write_point(const LASpoint* point); 51 | BOOL chunk() { return FALSE; }; 52 | 53 | BOOL update_header(const LASheader* header, BOOL use_inventory=FALSE, BOOL update_extra_bytes=FALSE); 54 | I64 close(BOOL update_npoints=TRUE); 55 | 56 | LASwriterQFIT(); 57 | ~LASwriterQFIT(); 58 | 59 | private: 60 | ByteStreamOut* stream; 61 | FILE* file; 62 | I32 version; 63 | BOOL endian_swap; 64 | BOOL rescale_reoffset; 65 | I32 buffer[14]; 66 | I32 scan_azimuth_array_offset; 67 | I32 pitch_array_offset; 68 | I32 roll_array_offset; 69 | I32 pulse_width_array_offset; 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswriter_txt.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswriter_txt.hpp 5 | 6 | CONTENTS: 7 | 8 | Writes LIDAR points to ASCII through on-the-fly conversion from LAS. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2014, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 7 September 2018 -- replaced calls to _strdup with calls to the LASCopyString macro 28 | 10 April 2011 -- created after a sunny weekend of biking to/from Buergel 29 | 30 | =============================================================================== 31 | */ 32 | #ifndef LAS_WRITER_TXT_HPP 33 | #define LAS_WRITER_TXT_HPP 34 | 35 | #include "laswriter.hpp" 36 | 37 | #include 38 | 39 | class LASwriterTXT : public LASwriter 40 | { 41 | public: 42 | 43 | void set_pts(BOOL pts); 44 | void set_ptx(BOOL ptx); 45 | void set_scale_rgb(F32 scale_rgb); 46 | 47 | BOOL refile(FILE* file); 48 | 49 | BOOL open(const CHAR* file_name, const LASheader* header, const CHAR* parse_string=0, const CHAR* separator=0); 50 | BOOL open(FILE* file, const LASheader* header, const CHAR* parse_string=0, const CHAR* separator=0); 51 | 52 | BOOL write_point(const LASpoint* point); 53 | BOOL chunk() { return FALSE; }; 54 | 55 | BOOL update_header(const LASheader* header, BOOL use_inventory=FALSE, BOOL update_extra_bytes=FALSE); 56 | I64 close(BOOL update_npoints=TRUE); 57 | 58 | LASwriterTXT(); 59 | ~LASwriterTXT(); 60 | 61 | private: 62 | BOOL close_file; 63 | FILE* file; 64 | const LASheader* header; 65 | CHAR* parse_string; 66 | BOOL opts; 67 | BOOL optx; 68 | F32 scale_rgb; 69 | CHAR separator_sign; 70 | CHAR printstring[512]; 71 | I32 attribute_starts[10]; 72 | BOOL check_parse_string(const CHAR* parse_string); 73 | BOOL unparse_attribute(const LASpoint* point, I32 index); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswriter_wrl.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswriter_wrl.hpp 5 | 6 | CONTENTS: 7 | 8 | Writes LIDAR points to VRML through on-the-fly conversion from LAS. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2014, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 26 August 2012 -- after a slice of cake at the Volksfest Sommerhausen 28 | 29 | =============================================================================== 30 | */ 31 | #ifndef LAS_WRITER_WRL_HPP 32 | #define LAS_WRITER_WRL_HPP 33 | 34 | #include "laswriter.hpp" 35 | 36 | #include 37 | 38 | class LASwriterWRL : public LASwriter 39 | { 40 | public: 41 | 42 | BOOL open(const CHAR* file_name, const LASheader* header, const CHAR* parse_string=0); 43 | BOOL open(FILE* file, const LASheader* header, const CHAR* parse_string=0); 44 | 45 | BOOL write_point(const LASpoint* point); 46 | BOOL chunk() { return FALSE; }; 47 | 48 | BOOL update_header(const LASheader* header, BOOL use_inventory=FALSE, BOOL update_extra_bytes=FALSE); 49 | I64 close(BOOL update_npoints=TRUE); 50 | 51 | LASwriterWRL(); 52 | ~LASwriterWRL(); 53 | 54 | private: 55 | BOOL close_file; 56 | FILE* file; 57 | const LASheader* header; 58 | CHAR printstring[512]; 59 | U8* rgb; 60 | I32 rgb_alloc; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/inc/laswritercompatible.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswritercompatible.hpp 5 | 6 | CONTENTS: 7 | 8 | Interface to write LIDAR points to the LAS format versions 1.0 - 1.4 and 9 | per on-the-fly conversion to simple ASCII files. 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2015, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the GNU Lesser General Licence as published by the Free Software 21 | Foundation. See the LICENSE.txt file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 28 | 29 March 2015 -- created on the last PHIL LiDAR tour 2015 day in Ali Mall 29 | 30 | =============================================================================== 31 | */ 32 | #ifndef LAS_WRITER_COMPATIBLE_HPP 33 | #define LAS_WRITER_COMPATIBLE_HPP 34 | 35 | #include "laswriter.hpp" 36 | 37 | class LASLIB_DLL LASwriterCompatibleDown : public LASwriter 38 | { 39 | public: 40 | BOOL open(LASheader* header, LASwriteOpener* laswriteopener, BOOL moveCRSfromEVLRtoVLR=FALSE, BOOL moveEVLRtoVLR=FALSE); 41 | 42 | BOOL write_point(const LASpoint* point); 43 | BOOL chunk() { return FALSE; }; 44 | 45 | BOOL update_header(const LASheader* header, BOOL use_inventory=FALSE, BOOL update_extra_bytes=FALSE); 46 | I64 close(BOOL update_npoints=TRUE); 47 | 48 | LASwriterCompatibleDown(); 49 | ~LASwriterCompatibleDown(); 50 | 51 | private: 52 | LASpoint pointCompatibleDown; 53 | LASheader* header; 54 | LASwriter* writer; 55 | I32 start_scan_angle; 56 | I32 start_extended_returns; 57 | I32 start_classification; 58 | I32 start_flags_and_channel; 59 | I32 start_NIR_band; 60 | }; 61 | 62 | class LASLIB_DLL LASwriterCompatibleUp : public LASwriter 63 | { 64 | public: 65 | BOOL open(LASheader* header, LASwriteOpener* laswriteopener); 66 | 67 | BOOL write_point(const LASpoint* point); 68 | BOOL chunk() { return FALSE; }; 69 | 70 | BOOL update_header(const LASheader* header, BOOL use_inventory=FALSE, BOOL update_extra_bytes=FALSE); 71 | I64 close(BOOL update_npoints=TRUE); 72 | 73 | LASwriterCompatibleUp(); 74 | ~LASwriterCompatibleUp(); 75 | 76 | private: 77 | LASpoint pointCompatibleUp; 78 | LASheader* header; 79 | LASwriter* writer; 80 | I32 start_scan_angle; 81 | I32 start_extended_returns; 82 | I32 start_classification; 83 | I32 start_flags_and_channel; 84 | I32 start_NIR_band; 85 | }; 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/src/Makefile: -------------------------------------------------------------------------------- 1 | # makefile for liblas.a 2 | # 3 | #COPTS = -g -Wall -DUNORDERED -DHAVE_UNORDERED_MAP -std=c++11 4 | COPTS = -O3 -Wall -Wno-deprecated -Wno-strict-aliasing -Wno-write-strings -Wno-unused-result -Wcast-qual -DNDEBUG -DUNORDERED -DHAVE_UNORDERED_MAP -std=c++11 5 | COMPILER = g++ 6 | AR = ar rc 7 | #BITS = -64 8 | 9 | INCLUDE = -I/usr/include/ -I../../LASzip/src -I../inc -I. 10 | 11 | OBJ_LAS = lasreader.o lasignore.o laswriter.o lasreader_las.o lasreader_bin.o lasreader_shp.o lasreader_asc.o lasreader_bil.o lasreader_dtm.o lasreader_ply.o lasreader_qfit.o lasreader_txt.o lasreadermerged.o lasreaderbuffered.o lasreaderstored.o lasreaderpipeon.o laswriter_las.o laswriter_bin.o laswriter_qfit.o laswriter_wrl.o laswriter_txt.o laswritercompatible.o laswaveform13reader.o laswaveform13writer.o lasutility.o lasfilter.o lastransform.o laskdtree.o fopen_compressed.o lascopc.o 12 | 13 | OBJ_LAZ = ../../LASzip/src/laszip.o ../../LASzip/src/lasreadpoint.o ../../LASzip/src/lasreaditemcompressed_v1.o ../../LASzip/src/lasreaditemcompressed_v2.o ../../LASzip/src/lasreaditemcompressed_v3.o ../../LASzip/src/lasreaditemcompressed_v4.o ../../LASzip/src/laswritepoint.o ../../LASzip/src/laswriteitemcompressed_v1.o ../../LASzip/src/laswriteitemcompressed_v2.o ../../LASzip/src/laswriteitemcompressed_v3.o ../../LASzip/src/laswriteitemcompressed_v4.o ../../LASzip/src/integercompressor.o ../../LASzip/src/arithmeticdecoder.o ../../LASzip/src/arithmeticencoder.o ../../LASzip/src/arithmeticmodel.o ../../LASzip/src/lasindex.o ../../LASzip/src/lasquadtree.o ../../LASzip/src/lasinterval.o ../../LASzip/src/mydefs.o ../../LASzip/src/lasmessage.o 14 | 15 | all: liblas.a 16 | 17 | liblas.a: ${OBJ_LAZ} ${OBJ_LAS} 18 | $(AR) $@ ${OBJ_LAZ} ${OBJ_LAS} 19 | cp -p $@ ../lib 20 | 21 | .cpp.o: 22 | ${COMPILER} ${BITS} -c ${COPTS} ${INCLUDE} $< -o $@ 23 | 24 | .c.o: 25 | ${COMPILER} ${BITS} -c ${COPTS} ${INCLUDE} $< -o $@ 26 | 27 | clean: 28 | rm -rf ${OBJ_LAZ} ${OBJ_LAS} 29 | 30 | clobber: 31 | rm -rf liblas.a 32 | rm -rf ${OBJ_LAZ} ${OBJ_LAS} 33 | rm -rf *~ 34 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/src/lasfilter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/thirdparty/external/LAStools/LASlib/src/lasfilter.cpp -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/src/laslib-config.cmake: -------------------------------------------------------------------------------- 1 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 2 | include(${SELF_DIR}/laslib-targets.cmake) 3 | get_filename_component(LASlib_INCLUDE_DIRS "${SELF_DIR}/../../../include/LASlib" ABSOLUTE) 4 | set_property(TARGET LASlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LASlib_INCLUDE_DIRS}) 5 | 6 | set(LASlib_FOUND true) 7 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASlib/src/lasvlr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasvlr.cpp 5 | 6 | CONTENTS: 7 | 8 | see corresponding header file 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2019, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the GNU Lesser General Licence as published by the Free Software 20 | Foundation. See the LICENSE.txt file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | see corresponding header file 28 | 29 | =============================================================================== 30 | */ 31 | #include "lasvlr.hpp" 32 | 33 | LASvlr_lastiling::LASvlr_lastiling() 34 | { 35 | memset((void*)this, 0, sizeof(LASvlr_lastiling)); 36 | } 37 | 38 | LASvlr_lasoriginal::LASvlr_lasoriginal() 39 | { 40 | memset((void*)this, 0, sizeof(LASvlr_lasoriginal)); 41 | } 42 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/CHANGES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c42f/displaz/07f55d82ebdff38874244a74307128a6fd654caf/thirdparty/external/LAStools/LASzip/CHANGES.txt -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/LICENSE.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------- 2 | 3 | LICENSE AGREEMENT (for LASzip LiDAR compression): 4 | 5 | LASzip is open-source and is licensed with the standard LGPL version 2.1 6 | (see COPYING.txt) modified by the following static linking exception. 7 | 8 | As a special exception, the copyright holders of this library give you 9 | permission to link this library with independent modules to produce an 10 | executable, regardless of the license terms of these independent modules, 11 | and to copy and distribute the resulting executable under terms of your 12 | choice, provided that you also meet, for each linked independent module, 13 | the terms and conditions of the license of that module. An independent 14 | module is a module which is not derived from or based on this library. 15 | If you modify this library, you may extend this exception to your version 16 | of the library, but you are not obliged to do so. If you do not wish to 17 | do so, delete this exception statement from your version. 18 | 19 | This software is distributed WITHOUT ANY WARRANTY and without even the 20 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | 22 | -------------------------------------------------------------------------- 23 | 24 | PROGRAMMERS: 25 | 26 | info@rapidlasso.de 27 | 28 | -------------------------------------------------------------------------- 29 | 30 | COPYRIGHT: 31 | 32 | (c) 2007-2015, rapidlasso GmbH - fast tools to catch reality 33 | 34 | -------------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/Makefile: -------------------------------------------------------------------------------- 1 | clean: 2 | cd example && make clean 3 | cd src && make clean 4 | 5 | clobber: 6 | cd example && make clobber 7 | cd src && make clobber 8 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/README.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------- 2 | 3 | LASzip LiDAR compression DLL 4 | 5 | -------------------------------------------------------------------------- 6 | 7 | The LASzip LiDAR compressor packaged as a simple stand-alone DLL for 8 | easy inclusion of compression and decompression functionality into 9 | other software. It compresses LAS files into much more compact LAZ 10 | files and vice versa. The resulting files are around 7 - 20 percent 11 | of their original size. Follow the code in laszipdllexample.cpp for 12 | a simple example how to use the DLL. 13 | 14 | To get LASzip just download the LAStools distribution which contains 15 | the LASlib as well as the LASzip sources together with the binaries 16 | of the popular LAStools software and some small example LAZ files. 17 | 18 | http://laszip.org/ 19 | http://lastools.org/ 20 | https://rapidlasso.de/LAStools/ 21 | 22 | -------------------------------------------------------------------------- 23 | 24 | PROGRAMMERS: 25 | 26 | info@rapidlasso.de 27 | 28 | -------------------------------------------------------------------------- 29 | 30 | COPYRIGHT: 31 | 32 | (c) 2007-2017, rapidlasso GmbH - fast tools to catch reality 33 | 34 | -------------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/dll/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LASZIP_API_SOURCES 2 | laszip_api.c 3 | ) 4 | 5 | LASZIP_ADD_LIBRARY(${LASZIP_API_LIB_NAME} ${LASZIP_API_SOURCES}) 6 | LASZIP_ADD_INCLUDES("laszip" "${LASZIP_HEADERS_DIR}/laszip_api.h" ${LASZIP_API_VERSION_H}) 7 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/include/laszip/laszip_api_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laszip_api_version.h 5 | 6 | CONTENTS: 7 | 8 | Version information for LASzip API interface 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 22 August 2017 -- Created 28 | 29 | =============================================================================== 30 | */ 31 | 32 | #ifndef LASZIP_API_VERSION_H 33 | #define LASZIP_API_VERSION_H 34 | 35 | /* 36 | * version settings 37 | */ 38 | #define LASZIP_API_VERSION_MAJOR 3 39 | #define LASZIP_API_VERSION_MINOR 5 40 | #define LASZIP_API_VERSION_PATCH 1 41 | 42 | #define HAVE_UNORDERED_MAP 1 43 | 44 | #endif /* LASZIP_API_VERSION_H */ 45 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # src/CMakeLists.txt controls building of laszip library 4 | # 5 | # Copyright (c) 2009 Mateusz Loskot 6 | # 7 | ############################################################################### 8 | set(LASZIP_SOURCES 9 | arithmeticdecoder.cpp 10 | arithmeticencoder.cpp 11 | arithmeticmodel.cpp 12 | integercompressor.cpp 13 | lasindex.cpp 14 | lasinterval.cpp 15 | lasquadtree.cpp 16 | lasreaditemcompressed_v1.cpp 17 | lasreaditemcompressed_v2.cpp 18 | lasreaditemcompressed_v3.cpp 19 | lasreaditemcompressed_v4.cpp 20 | lasreadpoint.cpp 21 | laswriteitemcompressed_v1.cpp 22 | laswriteitemcompressed_v2.cpp 23 | laswriteitemcompressed_v3.cpp 24 | laswriteitemcompressed_v4.cpp 25 | laswritepoint.cpp 26 | laszip.cpp 27 | laszip_dll.cpp 28 | mydefs.cpp 29 | lasmessage.cpp 30 | ) 31 | 32 | add_definitions(-DLASZIPDLL_EXPORTS) 33 | add_definitions(-DUNORDERED) 34 | 35 | if(HAVE_UNORDERED_MAP) 36 | add_definitions(-DHAVE_UNORDERED_MAP=1) 37 | endif(HAVE_UNORDERED_MAP) 38 | LASZIP_ADD_LIBRARY(${LASZIP_BASE_LIB_NAME} ${LASZIP_SOURCES}) 39 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/Makefile: -------------------------------------------------------------------------------- 1 | # makefile for cleanup of LAStools\LASzip\src 2 | # 3 | 4 | clean: 5 | rm -rf *.o 6 | 7 | clobber: 8 | rm -rf *.o 9 | rm -rf *~ 10 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/bytestreaminout.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: bytestreaminout.hpp 5 | 6 | CONTENTS: 7 | 8 | Abstract base class for streams that both input and output with endian handling. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 29 December 2013 -- created after helping a client to QA their Optech LiDAR 28 | 29 | =============================================================================== 30 | */ 31 | #ifndef BYTE_STREAM_INOUT_HPP 32 | #define BYTE_STREAM_INOUT_HPP 33 | 34 | #include "mydefs.hpp" 35 | #include "bytestreamin.hpp" 36 | #include "bytestreamout.hpp" 37 | 38 | class ByteStreamInOut : public ByteStreamIn, ByteStreamOut 39 | { 40 | public: 41 | /* destructor */ 42 | virtual ~ByteStreamInOut() {}; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/bytestreaminout_file.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: bytestreaminout_file.hpp 5 | 6 | CONTENTS: 7 | 8 | Class for FILE*-based streams that both input and output with endian handling. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2023, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 29 December 2013 -- created after helping a client to QA their Optech LiDAR 28 | 29 | =============================================================================== 30 | */ 31 | #ifndef BYTE_STREAM_INOUT_FILE_HPP 32 | #define BYTE_STREAM_INOUT_FILE_HPP 33 | 34 | #include "bytestreamin_file.hpp" 35 | #include "bytestreamout_file.hpp" 36 | 37 | class ByteStreamInOutFileLE : public ByteStreamInFileLE, public ByteStreamOutFileLE 38 | { 39 | public: 40 | ByteStreamInOutFileLE(FILE* file); 41 | }; 42 | 43 | class ByteStreamInOutFileBE : public ByteStreamInFileBE, public ByteStreamOutFileBE 44 | { 45 | public: 46 | ByteStreamInOutFileBE(FILE* file); 47 | }; 48 | 49 | inline ByteStreamInOutFileLE::ByteStreamInOutFileLE(FILE* file) : ByteStreamInFileLE(file), ByteStreamOutFileLE(file) 50 | { 51 | } 52 | 53 | inline ByteStreamInOutFileBE::ByteStreamInOutFileBE(FILE* file) : ByteStreamInFileBE(file), ByteStreamOutFileBE(file) 54 | { 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/lasreaditem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasreaditem.hpp 5 | 6 | CONTENTS: 7 | 8 | Common interface for all classes that read the items that compose a point. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 28 August 2017 -- moving 'context' from global development hack to interface 28 | 23 August 2016 -- layering of items for selective decompression in LAS 1.4 29 | 10 January 2011 -- licensing change for LGPL release and liblas integration 30 | 7 December 2010 -- refactored after getting invited to KAUST in Saudi Arabia 31 | 32 | =============================================================================== 33 | */ 34 | #ifndef LAS_READ_ITEM_HPP 35 | #define LAS_READ_ITEM_HPP 36 | 37 | #include "mydefs.hpp" 38 | 39 | class ByteStreamIn; 40 | 41 | class LASreadItem 42 | { 43 | public: 44 | virtual void read(U8* item, U32& context)=0; 45 | 46 | virtual ~LASreadItem(){}; 47 | }; 48 | 49 | class LASreadItemRaw : public LASreadItem 50 | { 51 | public: 52 | LASreadItemRaw() 53 | { 54 | instream = 0; 55 | }; 56 | BOOL init(ByteStreamIn* instream) 57 | { 58 | if (!instream) return FALSE; 59 | this->instream = instream; 60 | return TRUE; 61 | }; 62 | virtual ~LASreadItemRaw(){}; 63 | protected: 64 | ByteStreamIn* instream; 65 | }; 66 | 67 | class LASreadItemCompressed : public LASreadItem 68 | { 69 | public: 70 | virtual BOOL chunk_sizes() { return FALSE; }; 71 | virtual BOOL init(const U8* item, U32& context)=0; 72 | 73 | virtual ~LASreadItemCompressed(){}; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/lasunzipper.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: lasunzipper.hpp 5 | 6 | CONTENTS: 7 | 8 | Reads (optionally compressed) LIDAR points to LAS formats 1.0 - 1.3. This 9 | particular class is only used for adding LASzip to libLAS (not to LASlib). 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the Apache Public License 2.0 published by the Apache Software 21 | Foundation. See the COPYING file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 28 | 23 April 2011 -- changed interface for easier future compressor support 29 | 10 January 2011 -- licensing change for LGPL release and liblas integration 30 | 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-; 31 | 32 | =============================================================================== 33 | */ 34 | #ifndef LAS_UNZIPPER_HPP 35 | #define LAS_UNZIPPER_HPP 36 | 37 | #include 38 | 39 | #include "laszip.hpp" 40 | 41 | #ifdef LZ_WIN32_VC6 42 | #include 43 | #else 44 | #include 45 | #include 46 | using namespace std; 47 | #endif 48 | 49 | class ByteStreamIn; 50 | class LASreadPoint; 51 | 52 | class LASunzipper 53 | { 54 | public: 55 | bool open(FILE* file, const LASzip* laszip); 56 | bool open(istream& stream, const LASzip* laszip); 57 | 58 | unsigned int tell() const; 59 | bool seek(const unsigned int position); 60 | bool read(unsigned char * const * point); 61 | bool close(); 62 | 63 | LASunzipper(); 64 | ~LASunzipper(); 65 | 66 | // in case a function returns false this string describes the problem 67 | const char* get_error() const; 68 | 69 | private: 70 | unsigned int count; 71 | ByteStreamIn* stream; 72 | LASreadPoint* reader; 73 | bool return_error(const char* err); 74 | char* error_string; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/laswriteitem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laswriteitem.hpp 5 | 6 | CONTENTS: 7 | 8 | Common interface for all classes that write the items that compose a point. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 28 August 2017 -- moving 'context' from global development hack to interface 28 | 23 August 2016 -- layering of items for selective decompression in LAS 1.4 29 | 10 January 2011 -- licensing change for LGPL release and liblas integration 30 | 12 December 2010 -- refactored after watching two movies with silke 31 | 32 | =============================================================================== 33 | */ 34 | #ifndef LAS_WRITE_ITEM_HPP 35 | #define LAS_WRITE_ITEM_HPP 36 | 37 | #include "mydefs.hpp" 38 | 39 | class ByteStreamOut; 40 | 41 | class LASwriteItem 42 | { 43 | public: 44 | virtual BOOL write(const U8* item, U32& context)=0; 45 | 46 | virtual ~LASwriteItem(){}; 47 | }; 48 | 49 | class LASwriteItemRaw : public LASwriteItem 50 | { 51 | public: 52 | LASwriteItemRaw() 53 | { 54 | outstream = 0; 55 | }; 56 | BOOL init(ByteStreamOut* outstream) 57 | { 58 | if (!outstream) return FALSE; 59 | this->outstream = outstream; 60 | return TRUE; 61 | }; 62 | virtual ~LASwriteItemRaw(){}; 63 | protected: 64 | ByteStreamOut* outstream; 65 | }; 66 | 67 | class LASwriteItemCompressed : public LASwriteItem 68 | { 69 | public: 70 | virtual BOOL init(const U8* item, U32& context)=0; 71 | virtual BOOL chunk_sizes() { return FALSE; }; 72 | virtual BOOL chunk_bytes() { return FALSE; }; 73 | 74 | virtual ~LASwriteItemCompressed(){}; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/laszip_decompress_selective_v3.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laszip_decompress_selective_v3.hpp 5 | 6 | CONTENTS: 7 | 8 | Contains bit mask definitions for selective decompression. 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | 14 April 2017 -- created at Lo Que Hay where Gui was having birthday dinner 28 | 29 | =============================================================================== 30 | */ 31 | #ifndef LASZIP_DECOMPRESS_SELECTIVE_V3_HPP 32 | #define LASZIP_DECOMPRESS_SELECTIVE_V3_HPP 33 | 34 | #define LASZIP_DECOMPRESS_SELECTIVE_ALL 0xFFFFFFFF 35 | 36 | #define LASZIP_DECOMPRESS_SELECTIVE_CHANNEL_RETURNS_XY 0x00000000 37 | #define LASZIP_DECOMPRESS_SELECTIVE_Z 0x00000001 38 | #define LASZIP_DECOMPRESS_SELECTIVE_CLASSIFICATION 0x00000002 39 | #define LASZIP_DECOMPRESS_SELECTIVE_FLAGS 0x00000004 40 | #define LASZIP_DECOMPRESS_SELECTIVE_INTENSITY 0x00000008 41 | #define LASZIP_DECOMPRESS_SELECTIVE_SCAN_ANGLE 0x00000010 42 | #define LASZIP_DECOMPRESS_SELECTIVE_USER_DATA 0x00000020 43 | #define LASZIP_DECOMPRESS_SELECTIVE_POINT_SOURCE 0x00000040 44 | #define LASZIP_DECOMPRESS_SELECTIVE_GPS_TIME 0x00000080 45 | #define LASZIP_DECOMPRESS_SELECTIVE_RGB 0x00000100 46 | #define LASZIP_DECOMPRESS_SELECTIVE_NIR 0x00000200 47 | #define LASZIP_DECOMPRESS_SELECTIVE_WAVEPACKET 0x00000400 48 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE0 0x00010000 49 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE1 0x00020000 50 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE2 0x00040000 51 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE3 0x00080000 52 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE4 0x00100000 53 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE5 0x00200000 54 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE6 0x00400000 55 | #define LASZIP_DECOMPRESS_SELECTIVE_BYTE7 0x00800000 56 | #define LASZIP_DECOMPRESS_SELECTIVE_EXTRA_BYTES 0xFFFF0000 57 | 58 | #endif // LASZIP_DECOMPRESS_SELECTIVE_V3_HPP 59 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/laszipper.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: laszipper.hpp 5 | 6 | CONTENTS: 7 | 8 | Writes (optionally compressed) LIDAR points to LAS formats 1.0 - 1.3. This 9 | particular class is only used for adding LASzip to libLAS (not to LASlib). 10 | 11 | PROGRAMMERS: 12 | 13 | info@rapidlasso.de - https://rapidlasso.de 14 | 15 | COPYRIGHT: 16 | 17 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 18 | 19 | This is free software; you can redistribute and/or modify it under the 20 | terms of the Apache Public License 2.0 published by the Apache Software 21 | Foundation. See the COPYING file for more information. 22 | 23 | This software is distributed WITHOUT ANY WARRANTY and without even the 24 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 | 26 | CHANGE HISTORY: 27 | 28 | 8 May 2011 -- added an option for variable chunking via chunk() 29 | 23 April 2011 -- changed interface for simplicity and chunking support 30 | 10 January 2011 -- licensing change for LGPL release and liblas integration 31 | 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-; 32 | 33 | =============================================================================== 34 | */ 35 | #ifndef LAS_ZIPPER_HPP 36 | #define LAS_ZIPPER_HPP 37 | 38 | #include 39 | 40 | #include "laszip.hpp" 41 | 42 | #ifdef LZ_WIN32_VC6 43 | #include 44 | #else 45 | #include 46 | #include 47 | using namespace std; 48 | #endif 49 | 50 | class ByteStreamOut; 51 | class LASwritePoint; 52 | 53 | class LASzipper 54 | { 55 | public: 56 | bool open(FILE* outfile, const LASzip* laszip); 57 | bool open(ostream& outstream, const LASzip* laszip); 58 | 59 | bool write(const unsigned char* const * point); 60 | bool chunk(); 61 | bool close(); 62 | 63 | LASzipper(); 64 | ~LASzipper(); 65 | 66 | // in case a function returns false this string describes the problem 67 | const char* get_error() const; 68 | 69 | private: 70 | unsigned int count; 71 | ByteStreamOut* stream; 72 | LASwritePoint* writer; 73 | bool return_error(const char* err); 74 | char* error_string; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /thirdparty/external/LAStools/LASzip/src/mydefs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =============================================================================== 3 | 4 | FILE: mydefs.cpp 5 | 6 | CONTENTS: 7 | 8 | see corresponding header file 9 | 10 | PROGRAMMERS: 11 | 12 | info@rapidlasso.de - https://rapidlasso.de 13 | 14 | COPYRIGHT: 15 | 16 | (c) 2007-2022, rapidlasso GmbH - fast tools to catch reality 17 | 18 | This is free software; you can redistribute and/or modify it under the 19 | terms of the Apache Public License 2.0 published by the Apache Software 20 | Foundation. See the COPYING file for more information. 21 | 22 | This software is distributed WITHOUT ANY WARRANTY and without even the 23 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 24 | 25 | CHANGE HISTORY: 26 | 27 | see corresponding header file 28 | 29 | =============================================================================== 30 | */ 31 | #include "mydefs.hpp" 32 | 33 | #if defined(_MSC_VER) 34 | #include 35 | wchar_t* UTF8toUTF16(const char* utf8) 36 | { 37 | wchar_t* utf16 = 0; 38 | int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, 0, 0); 39 | if (len > 0) 40 | { 41 | utf16 = new wchar_t[len]; 42 | MultiByteToWideChar(CP_UTF8, 0, utf8, -1, utf16, len); 43 | } 44 | return utf16; 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /thirdparty/licenses/OpenImageIO.txt: -------------------------------------------------------------------------------- 1 | Copyright 2008 Larry Gritz and the other authors and contributors. 2 | All Rights Reserved. 3 | Based on BSD-licensed software Copyright 2004 NVIDIA Corp. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of the software's owners nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | (This is the Modified BSD License) 29 | -------------------------------------------------------------------------------- /thirdparty/licenses/README.txt: -------------------------------------------------------------------------------- 1 | Some of the third party software used by displaz requires licenses to be 2 | distributed with any binaries. For consistency, this directory contains 3 | copies of licenses for *all* third party software libraries used by displaz. 4 | -------------------------------------------------------------------------------- /thirdparty/licenses/ilmbase.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004, Industrial Light & Magic, a division of Lucas 2 | Digital Ltd. LLC 3 | 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution. 13 | * Neither the name of Industrial Light & Magic nor the names of 14 | its contributors may be used to endorse or promote products derived 15 | from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /thirdparty/licenses/rply.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2003-2011 Diego Nehab. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /thirdparty/rply/cube_tri.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment made by Greg Turk 4 | comment this file is a cube 5 | element vertex 8 6 | property float x 7 | property float y 8 | property float z 9 | element face 12 10 | property list uchar int vertex_index 11 | end_header 12 | -1 -1 -1 13 | -1 -1 1 14 | -1 1 1 15 | -1 1 -1 16 | 1 -1 -1 17 | 1 -1 1 18 | 1 1 1 19 | 1 1 -1 20 | 3 0 1 2 21 | 3 7 6 5 22 | 3 0 4 5 23 | 3 1 5 6 24 | 3 2 6 7 25 | 3 3 7 4 26 | 3 0 2 3 27 | 3 7 5 4 28 | 3 0 5 1 29 | 3 1 6 2 30 | 3 2 7 3 31 | 3 3 4 0 32 | --------------------------------------------------------------------------------