├── .gitattributes ├── .github └── workflows │ ├── codeql.yml │ ├── continuous-integration-workflow.yml │ └── documentation-workflow.yml ├── .gitmodules ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── Quarter.pc.cmake.in ├── Quarter.pc.in ├── README.MACOSX ├── README.WIN32 ├── README.md ├── SIMCMakeMacros ├── FindCoin.cmake ├── FindSpacenav.cmake ├── README ├── SimArguments.cmake ├── SimFind.cmake └── SimMSVC.cmake ├── aclocal.m4 ├── appveyor.yml ├── build ├── README.txt ├── misc │ ├── create-directories.bat │ ├── install-headers.bat │ ├── install-plugin.bat │ ├── install-sdk.bat │ ├── sync-from-msvc6.sh │ ├── uninstall-headers.bat │ ├── uninstall-plugin.bat │ └── uninstall-sdk.bat ├── msvc6 │ ├── config-debug.h │ ├── config-release.h │ ├── config.h │ ├── minimal_example.dsp │ ├── quarter1.dsp │ ├── quarter1.dsw │ ├── quarter1_install.dsp │ ├── quarter1_uninstall.dsp │ ├── quarterwidgetplugin1.dsp │ ├── quarterwidgetplugin1_install.dsp │ └── quarterwidgetplugin1_uninstall.dsp ├── msvc7 │ ├── config-debug.h │ ├── config-release.h │ ├── config.h │ ├── minimal_example.vcproj │ ├── quarter1.sln │ ├── quarter1.vcproj │ ├── quarter1_install.vcproj │ ├── quarter1_uninstall.vcproj │ ├── quarterwidgetplugin1.vcproj │ ├── quarterwidgetplugin1_install.vcproj │ └── quarterwidgetplugin1_uninstall.vcproj ├── msvc8 │ ├── config-debug.h │ ├── config-release.h │ ├── config.h │ ├── minimal_example.vcproj │ ├── quarter1.sln │ ├── quarter1.vcproj │ ├── quarter1_install.vcproj │ ├── quarter1_uninstall.vcproj │ ├── quarterwidgetplugin1.vcproj │ ├── quarterwidgetplugin1_install.vcproj │ └── quarterwidgetplugin1_uninstall.vcproj ├── msvc9 │ ├── config-debug.h │ ├── config-release.h │ ├── config.h │ ├── minimal_example.vcproj │ ├── quarter1.sln │ ├── quarter1.vcproj │ ├── quarter1_install.vcproj │ ├── quarter1_uninstall.vcproj │ ├── quarterwidgetplugin1.vcproj │ ├── quarterwidgetplugin1_install.vcproj │ └── quarterwidgetplugin1_uninstall.vcproj └── qmake │ ├── Quarter.pro │ ├── QuarterWidgetPlugin.pro │ └── coin.pro ├── cfg ├── config.guess ├── config.sub ├── csubst.exe ├── depcomp ├── doxy4win.pl ├── errors.txt ├── gendsp.pl.in ├── gendsp.sh.in ├── install-sh ├── ltmain.sh ├── missing ├── mkinstalldirs └── wrapmsvc.exe ├── config.h.cmake.in ├── config.h.in ├── configure ├── configure.ac ├── docs ├── ChangeLog.v1.0.0 ├── ChangeLog.v1.1.0 ├── ChangeLog.v1.2.0 ├── ChangeLog.v1.2.1 ├── ChangeLog.v1.2.2 ├── RELEASE.txt ├── doxygen │ ├── Coin_logo.png │ ├── footer.html │ ├── header.html │ └── stylesheet.css ├── quarter.doxygen.awesome.cmake.in ├── quarter.doxygen.cmake.in └── quarter.doxygen.in ├── html ├── Makefile.am └── Makefile.in ├── include ├── Makefile.am ├── Makefile.in ├── Makefile.inc └── Quarter │ ├── Basic.h │ ├── Makefile.am │ ├── Makefile.in │ ├── QtCoinCompatibility.h │ ├── Quarter.h │ ├── QuarterWidget.h │ ├── devices │ ├── InputDevice.h │ ├── Keyboard.h │ ├── Makefile.am │ ├── Makefile.in │ ├── Mouse.h │ └── SpaceNavigatorDevice.h │ └── eventhandlers │ ├── DragDropHandler.h │ ├── EventFilter.h │ ├── FocusHandler.h │ ├── Makefile.am │ └── Makefile.in ├── packaging └── description-summary.txt ├── quarter-config.cmake.in └── src ├── CMakeLists.txt ├── Makefile.am ├── Makefile.in ├── Quarter ├── CMakeLists.txt ├── ContextMenu.cpp ├── ContextMenu.h ├── DragDropHandler.cpp ├── EventFilter.cpp ├── FocusHandler.cpp ├── ImageReader.cpp ├── ImageReader.h ├── InputDevice.cpp ├── InteractionMode.cpp ├── InteractionMode.h ├── Keyboard.cpp ├── KeyboardP.cpp ├── KeyboardP.h ├── Makefile.am ├── Makefile.in ├── Mouse.cpp ├── NativeEvent.cpp ├── NativeEvent.h ├── QtCoinCompatibility.cpp ├── Quarter.cpp ├── Quarter.rc.cmake.in ├── QuarterP.cpp ├── QuarterP.h ├── QuarterWidget.cpp ├── QuarterWidgetP.cpp ├── QuarterWidgetP.h ├── SensorManager.cpp ├── SensorManager.h ├── SignalThread.cpp ├── SignalThread.h └── SpaceNavigatorDevice.cpp ├── examples ├── CMakeLists.txt ├── Makefile.am ├── Makefile.in ├── MdiMainWindow.cpp ├── MdiMainWindow.h ├── MdiQuarterWidget.cpp ├── MdiQuarterWidget.h ├── QuarterViewer.cpp ├── QuarterViewer.h ├── QuarterViewer.ui ├── directui.cpp ├── dynamicui.cpp ├── examiner.cpp ├── inheritui.cpp ├── mdi.cpp ├── minimal.cpp ├── quarterviewer.qrc └── superimposition.cpp ├── plugins ├── CMakeLists.txt ├── Makefile.am ├── Makefile.in ├── QuarterWidgetPlugin.cpp ├── QuarterWidgetPlugin.h ├── QuarterWidgetPlugin.qrc ├── QuarterWidgetPlugin.rc.cmake.in ├── coinlogo.png └── coinlogo.qrc └── unit-tests └── events ├── EventTranslation.cpp ├── EventTranslation.h ├── events.cpp └── events.pro /.gitattributes: -------------------------------------------------------------------------------- 1 | # Support GitHub linguist library to display right repository language 2 | configure linguist-generated 3 | configure.ac linguist-generated 4 | Makefile.in linguist-generated 5 | Makefile.am linguist-generated 6 | ltmain.sh linguist-generated 7 | install-sh linguist-generated 8 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | workflow_dispatch: # Allow manual triggers 5 | push: 6 | branches: [ "master" ] 7 | pull_request: 8 | branches: [ "master" ] 9 | schedule: 10 | - cron: '36 10 * * 4' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | #strategy: 22 | # fail-fast: false 23 | # matrix: 24 | # language: [ 'c-cpp', 'python' ] 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v4 29 | with: 30 | submodules: recursive 31 | 32 | - name: Initialize CodeQL 33 | uses: github/codeql-action/init@v3 34 | with: 35 | languages: c-cpp 36 | config: | 37 | #disable-default-queries: true 38 | #queries: 39 | # - uses: security-and-quality 40 | query-filters: 41 | # Specifically hide the results of these queries. 42 | - exclude: 43 | id: cpp/assignment-does-not-return-this 44 | - exclude: 45 | id: cpp/fixme-comment 46 | - exclude: 47 | id: cpp/rule-of-two 48 | - exclude: 49 | id: cpp/use-of-goto 50 | #config-file: ./lgtm.yml 51 | 52 | #- name: Autobuild 53 | # uses: github/codeonfigureql-action/autobuild@v2 54 | 55 | - name: Create build with CMake 56 | run: | 57 | sudo apt-get -y update 58 | sudo apt-get -y install freeglut3-dev qtbase5-dev qttools5-dev 59 | mkdir cmake_download_dir 60 | DOWNLOAD_FILE_COIN=coin-latest-Ubuntu2204-gcc13-x64.tar.gz 61 | RELEASE_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases | jq -r --arg COIN_REPO_TAG_NAME "CI-builds" '.[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id'` 62 | ASSET_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_COIN "$DOWNLOAD_FILE_COIN" '.assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id'` 63 | export DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/$ASSET_ID 64 | echo download file $DOWNLOAD_FILE_COIN from address $DOWNLOAD_ADDRESS_COIN 65 | curl -s -S -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_COIN $DOWNLOAD_ADDRESS_COIN 66 | tar xzf $DOWNLOAD_FILE_COIN -C cmake_download_dir 67 | cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_PREFIX_PATH=cmake_download_dir/Coin3D 68 | 69 | - name: Build project with CMake 70 | run: cmake --build cmake_build_dir --target all --config Release -- -j4 71 | 72 | - name: Perform CodeQL Analysis 73 | uses: github/codeql-action/analyze@v3 74 | with: 75 | category: "/language:c-cpp" 76 | -------------------------------------------------------------------------------- /.github/workflows/documentation-workflow.yml: -------------------------------------------------------------------------------- 1 | name: Awesome Documentation Build 2 | 3 | on: 4 | workflow_dispatch: # Allow manual triggers 5 | push: 6 | branches: [ master ] 7 | 8 | jobs: 9 | ubuntu-build: 10 | name: Ubuntu Build 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v4 15 | with: 16 | submodules: recursive 17 | - name: Create build directory and run CMake 18 | run: | 19 | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y 20 | sudo apt-get -y update 21 | sudo apt-get -y install gcc-13 doxygen graphviz freeglut3-dev qtbase5-dev qttools5-dev 22 | mkdir cmake_download_dir 23 | DOWNLOAD_FILE_COIN=coin-latest-Ubuntu2204-gcc13-x64.tar.gz 24 | RELEASE_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases | jq -r --arg COIN_REPO_TAG_NAME "CI-builds" '.[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id'` 25 | ASSET_ID=`curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coin3d/coin/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_COIN "$DOWNLOAD_FILE_COIN" '.assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id'` 26 | export DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/$ASSET_ID 27 | echo download file $DOWNLOAD_FILE_COIN from address $DOWNLOAD_ADDRESS_COIN 28 | curl -s -S -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_COIN $DOWNLOAD_ADDRESS_COIN 29 | tar xzf $DOWNLOAD_FILE_COIN -C cmake_download_dir 30 | curl -L -o doxygen-1.10.0.linux.bin.tar.gz https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz 31 | tar xzf doxygen-1.10.0.linux.bin.tar.gz 32 | export PATH=${{ github.workspace }}/doxygen-1.10.0/bin:$PATH 33 | cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_PREFIX_PATH=cmake_download_dir/Coin3D -DQUARTER_BUILD_AWESOME_DOCUMENTATION=ON 34 | - name: Build project 35 | run: | 36 | export PATH=${{ github.workspace }}/doxygen-1.10.0/bin:$PATH 37 | doxygen --version 38 | cmake --build cmake_build_dir --target documentation_awesome --config Release -- -j4 39 | - name: Deploy Awesome Documentation to Github Pages 40 | uses: peaceiris/actions-gh-pages@v4 41 | with: 42 | github_token: ${{ secrets.GITHUB_TOKEN }} 43 | publish_dir: cmake_build_dir/html_awesome 44 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cpack.d"] 2 | path = cpack.d 3 | url = https://github.com/coin3d/cpack.d 4 | [submodule "docs/doxygen-awesome"] 5 | path = docs/doxygen-awesome 6 | url = https://github.com/coin3d/doxygen-awesome-css.git 7 | branch = coin3d 8 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/AUTHORS -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) Kongsberg Oil & Gas Technologies AS 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | The ChangeLog file is intentionally not updated in the repository as this 2 | information can be easily gathered through the revision control system. 3 | 4 | Upon release, don't forget to fill the ChangeLog file through e.g.: 5 | $ git log --no-merges --pretty=format:"%ai %an <%ae> (%h)%n%n%x09%s%n" --name-status ..HEAD > ChangeLog 6 | 7 | (replace the optional token with the commit SHA for the previous release) 8 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | if BUILD_HTMLPAGES 3 | HTMLDIR = html 4 | else 5 | HTMLDIR = 6 | endif 7 | 8 | if BUILD_LIBRARY 9 | SRCDIRS = src 10 | else 11 | SRCDIRS = 12 | endif 13 | 14 | SUBDIRS = include $(HTMLDIR) $(SRCDIRS) 15 | 16 | pkgconfigdir = $(libdir)/pkgconfig 17 | pkgconfig_DATA= Quarter.pc 18 | 19 | EXTRA_DIST = \ 20 | README.MACOSX \ 21 | README.WIN32 \ 22 | Quarter.pc.in \ 23 | docs/quarter.doxygen.in \ 24 | docs/doxygen/Coin_logo.png \ 25 | docs/ChangeLog.v1.0.0 \ 26 | docs/ChangeLog.v1.1.0 \ 27 | docs/ChangeLog.v1.2.0 \ 28 | docs/ChangeLog.v1.2.1 \ 29 | docs/ChangeLog.v1.2.2 \ 30 | cfg/wrapmsvc.exe \ 31 | cfg/errors.txt \ 32 | cfg/doxy4win.pl \ 33 | build/README.txt \ 34 | build/misc/create-directories.bat \ 35 | build/misc/install-headers.bat \ 36 | build/misc/install-sdk.bat \ 37 | build/misc/sync-from-msvc6.sh \ 38 | build/misc/uninstall-headers.bat \ 39 | build/misc/uninstall-sdk.bat \ 40 | build/msvc6/config-debug.h \ 41 | build/msvc6/config-release.h \ 42 | build/msvc6/config.h \ 43 | build/msvc6/quarter1.dsp \ 44 | build/msvc6/quarter1.dsw \ 45 | build/msvc6/quarter1_install.dsp \ 46 | build/msvc6/quarter1_uninstall.dsp \ 47 | build/msvc6/quarterwidgetplugin1.dsp \ 48 | build/msvc7/config-debug.h \ 49 | build/msvc7/config-release.h \ 50 | build/msvc7/config.h \ 51 | build/msvc7/quarter1.sln \ 52 | build/msvc7/quarter1.vcproj \ 53 | build/msvc7/quarter1_install.vcproj \ 54 | build/msvc7/quarter1_uninstall.vcproj \ 55 | build/msvc7/quarterwidgetplugin1.vcproj \ 56 | build/msvc8/config-debug.h \ 57 | build/msvc8/config-release.h \ 58 | build/msvc8/config.h \ 59 | build/msvc8/quarter1.sln \ 60 | build/msvc8/quarter1.vcproj \ 61 | build/msvc8/quarter1_install.vcproj \ 62 | build/msvc8/quarter1_uninstall.vcproj \ 63 | build/msvc8/quarterwidgetplugin1.vcproj \ 64 | build/msvc9/config-debug.h \ 65 | build/msvc9/config-release.h \ 66 | build/msvc9/config.h \ 67 | build/msvc9/quarter1.sln \ 68 | build/msvc9/quarter1.vcproj \ 69 | build/msvc9/quarter1_install.vcproj \ 70 | build/msvc9/quarter1_uninstall.vcproj \ 71 | build/msvc9/quarterwidgetplugin1.vcproj 72 | 73 | 74 | DISTCLEANFILES = docs/quarter.doxygen 75 | 76 | docs/quarter.doxygen: $(srcdir)/docs/quarter.doxygen.in config.status 77 | @if test -d docs; then :; else mkdir docs; fi 78 | @./config.status --file=$@:$@.in 79 | @$(srcdir)/cfg/doxy4win.pl docs/quarter.doxygen 80 | 81 | doxygen-doc: built-sources 82 | if test x"@QUARTER_DOC_HTML@" = x"YES"; then \ 83 | mkdir -p "@quarter_html_dir@"; \ 84 | else :; fi 85 | @sim_ac_doxygen_exe@ $(top_builddir)/docs/quarter.doxygen 86 | 87 | doxygen-docs: built-sources 88 | if test x"@QUARTER_DOC_HTML@" = x"YES"; then \ 89 | mkdir -p "@quarter_html_dir@"; \ 90 | else :; fi 91 | @sim_ac_doxygen_exe@ $(top_builddir)/docs/quarter.doxygen 92 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Quarter 1.2.2 (2024-09-04): 2 | * new: 3 | - Added support for building modern styled documentation 4 | - Added function setupDefaultCursors() to allow users with a custom navigation file to set default cursors quickly 5 | * bugfixes: 6 | - Implemented workaround for Qt bug QTBUG-91556 - reversed QWheelEvent axis when ALT key is pressed 7 | - Fixed bug that caused SoEventManager::NO_NAVIGATION even if interaction mode is finished 8 | - ALT key is now a toggle key that temporary switches the current mode (nav or interaction) to the other mode 9 | 10 | Quarter 1.2.1 (2024-02-04): 11 | * bugfixes: 12 | - Fix crash of Qt Designer plugin 13 | 14 | Quarter 1.2.0 (2024-02-03): 15 | * new: 16 | - Version control system has been changed from Mercurial to Git 17 | - Home of Coin3d organization has been changed from https://bitbucket.org/Coin3D 18 | to https://github.com/coin3d due to Bitbucket ending Mercurial support 19 | - Added CI for macOS, Windows, and Ubuntu per GitHub actions to repository 20 | - Added support for Qt6 21 | - Support qrc:/// URL schemes for navigationModeFile 22 | 23 | * bugfixes: 24 | - cpack.d was made optional and disabled by default (add -DQUARTER_USE_CPACK=ON 25 | to the cmake commandline to enable it) 26 | - Fixed numerous documentation issues 27 | - Added QUARTER_BUILD_TESTS option to control building of test code (default: ON) 28 | - Check for valid OpenGL context 29 | 30 | Quarter 1.1.0 (2019-12-25): 31 | * new: 32 | - Kongsberg Oil & Gas Technologies AS ended Quarter as a commercial product 33 | and re-licensed it under the BSD 3-clause license as a service to the 34 | user community. 35 | - The build system has been migrated from GNU Autotools to CMake 36 | - Added support for Qt5 37 | - Added support for high DPI displays in Qt5 38 | - New 3DConnexion Space Navigator support using the Spacenav opensource library 39 | - Support for BitBucket and AppVeyor as continuous integration service providers 40 | 41 | * bugfixes: 42 | - Always reinitialize SoRenderManager when GL context is (re-)initialized 43 | - Avoid unnecessary redraws when moving window around. Fixes COIN-173 44 | - Handle double click events 45 | - Buffer went out of scope, while a reference was still held 46 | 47 | Quarter 1.0.0 (2009-01-26): 48 | - first proper release. 49 | -------------------------------------------------------------------------------- /Quarter.pc.cmake.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | bindir=${exec_prefix}/bin 4 | libdir=${exec_prefix}/lib 5 | includedir=${prefix}/include 6 | datarootdir=${prefix}/share 7 | datadir=${datarootdir} 8 | docdir=${datarootdir}/doc/@PROJECT_NAME_LOWER@ 9 | infodir=${datarootdir}/info 10 | mandir=${datarootdir}/man 11 | htmldir=${docdir}/html 12 | 13 | Name: @PROJECT_NAME@ 14 | Description: A Qt Gui widget for Coin 15 | Version: @PROJECT_VERSION@ 16 | Requires: @QUARTER_PKG_DEPS@ 17 | Conflicts: 18 | Libs: -L${libdir} @QUARTER_PKG_LIBS@ 19 | Cflags: -I${includedir} @QUARTER_PKG_FLAGS@ 20 | 21 | frameworkdir=@frameworkdir@ 22 | qt_version=@QT_VERSION_MAJOR@.@QT_VERSION_MINOR@.@QT_VERSION_PATCH@ 23 | -------------------------------------------------------------------------------- /Quarter.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | datarootdir=@datarootdir@ 6 | datadir=${datarootdir} 7 | 8 | Name: Quarter 9 | Description: a Qt Gui widget for Coin 10 | Version: @QUARTER_VERSION@ 11 | Requires: Coin, QtCore, QtGui, QtOpenGL, QtXml 12 | Conflicts: 13 | Libs: -L${libdir} @QUARTER_USE_LDFLAGS@ @QUARTER_USE_LIBS@ 14 | Cflags: -I${includedir} @QUARTER_USE_CPPFLAGS@ 15 | 16 | quarter_host=@host@ 17 | frameworkdir=@frameworkdir@ 18 | htmldir=@htmldir@ 19 | qt_version=@QT_VERSION@ 20 | -------------------------------------------------------------------------------- /README.MACOSX: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | == BUILDING QUARTER ON MAC OS X == 3 | ============================================================================ 4 | 5 | For building Quarter on macOS platform, you should in general follow the 6 | instructions in the INSTALL file. 7 | 8 | This file contains additional information about building Quarter on Mac OS X. 9 | For more information on getting started, known issues, and more, see 10 | https://github.com/coin3d/coin/wiki/Mac%20information%20page. 11 | 12 | ============================================================================ 13 | == OLD INFORMATION ON BUILDING QUARTER ON MAC OS X == 14 | ============================================================================ 15 | 16 | Building Quarter should be straightforward: ./configure && make && 17 | sudo make install. See the file INSTALL for details. If any of these 18 | stages fails, it's a bug in Quarter. Please let us know about this, 19 | and we will be happy to fix it. 20 | 21 | Please make sure that you have the latest version of Apple's developer 22 | tools installed before building Quarter. 23 | 24 | By default, Quarter will be set up as Mac OS X framework. Frameworks 25 | are a concept central to Mac OS X, packing a dynamic shared library 26 | with the necessary resources for this library, like header files, 27 | images, and documentation. You can link against a framework by using 28 | the "-framework" compiler option. 29 | 30 | What this means, basically, is that instead of "cc 31 | -I/path/to/Coin/include -L/path/to/Coin/lib -lCoin -lGL -lGLU -o foo 32 | foo.cpp", the commandline for building applications against Coin would 33 | be something like this: "cc -framework Inventor -framework OpenGL -o 34 | foo foo.cpp" 35 | 36 | If you want to disable the creation of the framework and install 37 | Quarter as standalone shared library, you can use the configure option 38 | 39 | --without-framework 40 | 41 | which will install libQuarter.dylib into $prefix/lib and the headers 42 | into $prefix/include (/usr/local/lib and /usr/local/include by 43 | default). 44 | 45 | The Qt Designer Plugin 46 | ====================== 47 | 48 | Quarter comes with a plugin for Qt Designer. On Mac OS X, this plugin 49 | is installed by default in /usr/local/lib/designer. You'll have to set 50 | the environment variable QT_PLUGIN_PATH to point to this directory: 51 | 52 | export QT_PLUGIN_PATH=/usr/local/lib 53 | 54 | The plugin has to reside in a directory named 'plugins' and the envvar 55 | has to point to the directory above it, or Qt will not be able to find 56 | it. 57 | 58 | If you use the --prefix option with configure, the plugin will be 59 | installed in /lib/designer. 60 | 61 | You can specify another install directory for the plugin by specifying 62 | --with-qt-designer-plugin-path=. 63 | 64 | To verify that Quarter is installed properly, go to src/examples/ and 65 | run the examiner executable. If the examiner example fails with the 66 | assert 'could not find child QuarterWidget in ui file', double-check 67 | that you have set the correct QT_PLUGIN_PATH 68 | 69 | The Qt libtool problem 70 | ====================== 71 | 72 | If you have compiled and installed Qt yourself as a standalone shared 73 | library (not as a framework), the libtool archive files produced are 74 | usually buggy and can cause weird errors when linking the 75 | examples. Just go to the directory where you installed Qt and remove 76 | any *.la files there, you will not miss them. -------------------------------------------------------------------------------- /README.WIN32: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | == BUILDING QUARTER ON WINDOWS == 3 | ============================================================================ 4 | 5 | Building Quarter on Windows is done by using the CMake build configuration. 6 | Check out the detailed build instructions in the INSTALL file of the Coin 7 | installation directory. 8 | 9 | The Autotools build system is still maintained but at a significantly lower 10 | priority. 11 | 12 | ============================================================================ 13 | == OLD INFORMATION ON BUILDING QUARTER ON WINDOWS == 14 | ============================================================================ 15 | 16 | Microsoft Visual Studio 17 | ======================= 18 | 19 | The source code archive for Quarter comes with Microsoft Visual Studio 20 | files for building and installing the Quarter library and the Qt 21 | Designer Plugin. Visual Studio 6, Visual Studio 7/7.1, Visual Studio 22 | 8, and Visual Studio 9 are supported. For later versions in the 23 | future, you can probably just "upgrade" one of these to get a working 24 | set for that version as well. Visual Studio 6 will not be supported 25 | (at the C++ language level) for very much longer. 26 | 27 | A separate target "quarter1_install" is provided for copying the built 28 | Quarter library and the Qt Designer Plugin into the directory provided 29 | in the COINDIR environment variable. Set it to e.g. "C:\Coin3D" or 30 | wherever you want the Quarter SDK to reside by using 31 | 32 | Control Panel => System => Advanced => Environment Variables 33 | 34 | and make sure you create that directory before starting the build of 35 | that target - if the variable isn't set or the directory doesn't 36 | exist, the installation will break and you won't get a functional SDK. 37 | Using the source hierarchy as the SDK is not recommended - let Quarter 38 | be installed, and use COINDIR from your other projects that use Coin 39 | and Quarter. 40 | 41 | A target is also provided for installing the Qt Designer Plugin, 42 | "quarterwidgetplugin1_install". The plugin is copied into the 43 | $QTDIR/plugins/designer directory. 44 | 45 | For Microsoft Visual Studio 6, you will find the complete build file setup 46 | in the directory "build/msvc6/". Select the dsw file. 47 | 48 | For Microsoft Visual Studio 7/7.1, you will find the complete build file setup 49 | in the directory build/msvc7/. Select the sln file. 50 | 51 | For Microsoft Visual Studio 8, you will find the complete build file setup 52 | in the directory build/msvc8/. Select the sln file. 53 | 54 | For Microsoft Visual Studio 9, you will find the complete build file setup 55 | in the directory build/msvc9/. Select the sln file. 56 | 57 | 58 | ============================================================================ 59 | == OLD INFORMATION ON CYGWIN-BASED BUILDS BELOW == 60 | ============================================================================ 61 | 62 | Quarter can also be compiled on Windows with the use of Cygwin. See 63 | Coin's README.WIN32 for detailed information on building Coin with 64 | cygwin, that information goes for Quarter as well as Coin. 65 | 66 | There are a couple of things you need to be aware of. The binary 67 | distributions of Qt is usually built with the multithread-dynamic C 68 | library. In order for Coin, Qt and Quarter to work together, Coin and 69 | Quarter should be built with the same C-runtime as Qt. 70 | 71 | To specify which C library Coin should be linked against, you should 72 | use the --with-msvcrt= option. To specify multithread-dynamic, 73 | use --with-msvcrt=md. 74 | 75 | If you want to build Quarter in release mode on windows, specify 76 | --disable-symbols and --disable-debug when running configure. 77 | 78 | If you want to link against Qt debug DLLs, specify --with-qt-debug. 79 | 80 | The Qt Designer Plugin is placed in $QTDIR/plugins/designer by default 81 | when using cygwin. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Coin3D Quarter 2 | ============== 3 | 4 | Introduction 5 | ------------ 6 | Quarter is a light-weight glue library that provides seamless 7 | integration between Systems in Motions's Coin high-level 3D 8 | visualization library and Trolltech's Qt 2D user interface library. 9 | 10 | Qt and Coin is a perfect match since they are both open source, widely 11 | portable and easy to use. Quarter has evolved from Systems in Motion's 12 | own experiences using Coin and Qt together in our applications. 13 | 14 | The functionality in Quarter revolves around QuarterWidget, a subclass 15 | of QGLWidget. This widget provides functionality for rendering of Coin 16 | scenegraphs and translation of QEvents into SoEvents. Using this 17 | widget is as easy as using any other QWidget. 18 | 19 | How to install 20 | -------------- 21 | 22 | See the file INSTALL for installation instructions, and the README.* 23 | files for platform-specific notes. 24 | 25 | How to use 26 | ---------- 27 | See Doxygen documentation: https://coin3d.github.io/quarter/ 28 | 29 | Release history 30 | --------------- 31 | 32 | Quarter 1.0.0 (2009-01-26): 33 | - first proper release. 34 | - is only usable with Coin-3.x and Qt-4.x 35 | 36 | Quarter 1.1.0 (2019-12-25): 37 | * new: 38 | - Kongsberg Oil & Gas Technologies AS ended SoWin as a commercial product 39 | and re-licensed it under the BSD 3-clause license as a service to the 40 | user community. 41 | - The build system has been migrated from GNU Autotools to CMake 42 | - Added support for Qt5 43 | - Added support for high DPI displays in Qt5 44 | - New 3DConnexion Space Navigator support using the Spacenav opensource library 45 | - Support for BitBucket and AppVeyor as continuous integration service providers 46 | 47 | * bugfixes: 48 | - Always reinitialize SoRenderManager when GL context is (re-)initialized 49 | - Avoid unnecessary redraws when moving window around. Fixes COIN-173 50 | - Handle double click events 51 | - Buffer went out of scope, while a reference was still held 52 | 53 | -------------------------------------------------------------------------------- /SIMCMakeMacros/FindSpacenav.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(SimFind) 2 | 3 | SIM_FIND(Spacenav 4 | RELEASELIBNAMES spnav 5 | DEBUGLIBNAMES spnav 6 | INCLUDEFILE spnav.h 7 | INCLUDE_DIR_SUFFIXES include 8 | LIB_DIR_SUFFIXES lib 9 | NO_PKGCONFIG) 10 | 11 | IF(Spacenav_FOUND) 12 | ADD_DEFINITIONS(-DHAVE_SPACENAV_LIB) 13 | ENDIF(Spacenav_FOUND) 14 | -------------------------------------------------------------------------------- /SIMCMakeMacros/README: -------------------------------------------------------------------------------- 1 | Forked from internal repositories -------------------------------------------------------------------------------- /SIMCMakeMacros/SimMSVC.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(SimArguments) 2 | 3 | # SIM_ADD_HEADER_FILES(storeto RELATIVE path SOURCES sources) 4 | # Adds all header files found that has a name similar to a 5 | # file in the list of sourcefiles given. If the list of sources 6 | # is File1.cpp;File2.cpp;File3.cpp the macro will look for 7 | # File1.h, File1.hpp or File1.hxx and similar filenames for File2 8 | # and File3. Note that the result is appended to the result variable 9 | # (the first argument). 10 | MACRO(SIM_ADD_HEADER_FILES storeto) 11 | SIM_VALIDATE_ARGUMENTS(ValidArguments SIM_ADD_HEADER_FILES 12 | "RELATIVE;SOURCES" # Required 13 | "RELATIVE;SOURCES" # Allowed 14 | "${ARGN}") 15 | SIM_FETCH_ARGUMENTS(Path RELATIVE ${ARGN}) 16 | SIM_FETCH_ARGUMENTS(Sources SOURCES ${ARGN}) 17 | 18 | FOREACH(_source ${Sources}) 19 | GET_FILENAME_COMPONENT(_noextension ${_source} NAME_WE) 20 | GET_FILENAME_COMPONENT(_path ${_source} PATH) 21 | IF("${_path}" STREQUAL "") 22 | SET(BasePath "${Path}/${_noextension}") 23 | ELSE("${_path}" STREQUAL "") 24 | SET(BasePath "${Path}/${_path}/${_noextension}") 25 | ENDIF("${_path}" STREQUAL "") 26 | 27 | STRING(REPLACE "${Path}/" "" ShortPath ${BasePath}) 28 | IF(EXISTS "${BasePath}.h") 29 | LIST(APPEND ${storeto} "${ShortPath}.h") 30 | ELSEIF(EXISTS "${BasePath}.hpp") 31 | LIST(APPEND ${storeto} "${ShortPath}.hpp") 32 | ELSEIF(EXISTS "${BasePath}.hxx") 33 | LIST(APPEND ${storeto} "${ShortPath}.hxx") 34 | ENDIF(EXISTS "${BasePath}.h") 35 | ENDFOREACH(_source) 36 | ENDMACRO(SIM_ADD_HEADER_FILES) 37 | 38 | # SIM_GENERATE_MSVC_PROJECT(GroupPrefix SOURCES ProjectSources 39 | # [GENERATED_SOURCES GeneratedSources]) 40 | # Generates source groups for MSVC projects based on the directories 41 | # of the source files. 42 | MACRO(SIM_GENERATE_MSVC_PROJECT GroupPrefix) 43 | SIM_VALIDATE_ARGUMENTS(ValidArguments SIM_GENERATE_MSVC_PROJECT 44 | "SOURCES" # Required 45 | "SOURCES;GENERATED_SOURCES;PREFIX" # Allowed 46 | "${ARGN}") 47 | SIM_FETCH_ARGUMENTS(ProjectSources SOURCES ${ARGN}) 48 | SIM_HAS_ARGUMENT(HasGeneratedSources GENERATED_SOURCES ${ARGN}) 49 | SIM_FETCH_ARGUMENTS(GeneratedSources GENERATED_SOURCES ${ARGN}) 50 | 51 | SET(GroupPrefix ${GroupPrefix}\\) 52 | 53 | 54 | # Regular sources 55 | FOREACH(Source ${ProjectSources}) 56 | GET_FILENAME_COMPONENT(RelativePath ${Source} PATH) 57 | SET(RelativePath "${GroupPrefix}${RelativePath}") 58 | STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" RelativePath "${RelativePath}") 59 | STRING(REGEX REPLACE "^[\\\\/]" "" RelativePath "${RelativePath}") 60 | STRING(REGEX REPLACE "/" "\\\\\\\\" RelativePath "${RelativePath}") 61 | 62 | SOURCE_GROUP("${RelativePath}" FILES ${Source}) 63 | ENDFOREACH(Source) 64 | 65 | # Put all generated stuff in a seperate folder 66 | IF(HasGeneratedSources) 67 | SOURCE_GROUP(".generated" FILES ${GeneratedSources}) 68 | ENDIF(HasGeneratedSources) 69 | 70 | ENDMACRO(SIM_GENERATE_MSVC_PROJECT) 71 | -------------------------------------------------------------------------------- /build/README.txt: -------------------------------------------------------------------------------- 1 | Regarding the Visual Studio projects, they are a bit clumsily configured 2 | currently, partly because we want all build-configuration options to be 3 | available, but the solution/workspace is building libraries, plugins, and 4 | applications, and they have certain inter-dependencies. 5 | 6 | It is therefore important that you build following the following procedure: 7 | 8 | To build debug do this: 9 | 10 | 1) set the build configuration to "Debug (DLL)" 11 | 2) build "quarter1" 12 | 3) build "quarter1_install" 13 | 4) build "quarterwidgetplugin1" 14 | 5) build "quarterwidgetplugin1_install" 15 | 6) set the build configuration to "Debug" 16 | 7) build "minimal_example" 17 | 8) launch the example (e.g. Debug->Launch New Instance in the menu) 18 | 19 | Each component should be installed before the next one is built. 20 | 21 | To build release, switch 1) to "Release (DLL)" and 6) to "Release". 22 | 23 | There are no build-rules to build the example against static library 24 | builds. 25 | -------------------------------------------------------------------------------- /build/misc/create-directories.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM ********************************************************************** 4 | REM * Create all the directories for the installed files 5 | 6 | pushd %COINDIR% 7 | 8 | if exist bin\*.* goto binexists 9 | echo mkdir %COINDIR%\bin 10 | mkdir bin 11 | :binexists 12 | if exist lib\*.* goto libexists 13 | echo mkdir %COINDIR%\lib 14 | mkdir lib 15 | :libexists 16 | if exist include\*.* goto includeexists 17 | echo mkdir %COINDIR%\include 18 | mkdir include 19 | :includeexists 20 | 21 | pushd include 22 | 23 | if exist Quarter\*.* goto quarterincludeexists 24 | echo mkdir %COINDIR%\include\Quarter 25 | mkdir Quarter 26 | :quarterincludeexists 27 | 28 | popd 29 | 30 | pushd include\Quarter 31 | 32 | if exist devices\*.* goto devicesexists 33 | echo mkdir %COINDIR%\include\Quarter\devices 34 | mkdir devices 35 | :devicesexists 36 | 37 | if exist eventhandlers\*.* goto eventhandlersexists 38 | echo mkdir %COINDIR%\include\Quarter\eventhandlers 39 | mkdir eventhandlers 40 | :eventhandlersexists 41 | 42 | popd 43 | 44 | popd 45 | 46 | -------------------------------------------------------------------------------- /build/misc/install-headers.bat: -------------------------------------------------------------------------------- 1 | rem ************************************************************************ 2 | rem * install-headers.bat 3 | rem * 4 | 5 | set msvc=%1 6 | 7 | copy /Y ..\..\include\Quarter\Basic.h %COINDIR%\include\Quarter\Basic.h >nul: 8 | copy /Y ..\..\include\Quarter\Quarter.h %COINDIR%\include\Quarter\Quarter.h >nul: 9 | copy /Y ..\..\include\Quarter\QuarterWidget.h %COINDIR%\include\Quarter\QuarterWidget.h >nul: 10 | 11 | copy /Y ..\..\include\Quarter\devices\DeviceHandler.h %COINDIR%\include\Quarter\devices\DeviceHandler.h >nul: 12 | copy /Y ..\..\include\Quarter\devices\InputDevice.h %COINDIR%\include\Quarter\devices\InputDevice.h >nul: 13 | copy /Y ..\..\include\Quarter\devices\Keyboard.h %COINDIR%\include\Quarter\devices\Keyboard.h >nul: 14 | copy /Y ..\..\include\Quarter\devices\Mouse.h %COINDIR%\include\Quarter\devices\Mouse.h >nul: 15 | copy /Y ..\..\include\Quarter\devices\SpaceNavigatorDevice.h %COINDIR%\include\Quarter\devices\SpaceNavigatorDevice.h >nul: 16 | 17 | copy /Y ..\..\include\Quarter\eventhandlers\EventFilter.h %COINDIR%\include\Quarter\eventhandlers\EventFilter.h >nul: 18 | copy /Y ..\..\include\Quarter\eventhandlers\EventHandler.h %COINDIR%\include\Quarter\eventhandlers\EventHandler.h >nul: 19 | copy /Y ..\..\include\Quarter\eventhandlers\DragDropHandler.h %COINDIR%\include\Quarter\eventhandlers\DragDropHandler.h >nul: 20 | 21 | -------------------------------------------------------------------------------- /build/misc/install-plugin.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem ************************************************************************ 3 | 4 | echo Running ..\misc\install-plugin.bat 5 | 6 | set type=%1 7 | set mode=%2 8 | set msvc=%3 9 | set libname=%4 10 | 11 | rem ************************************************************************ 12 | rem * check script arguments 13 | 14 | if "%1"=="dll" goto argonegiven 15 | if "%1"=="lib" goto argonegiven 16 | goto argproblem 17 | 18 | :argonegiven 19 | if "%2"=="release" goto argtwogiven 20 | if "%2"=="debug" goto argtwogiven 21 | goto argproblem 22 | 23 | :argtwogiven 24 | goto argtestdone 25 | 26 | :argproblem 27 | echo Error with script arguments: %1 %2 %3 %4. 28 | echo Usage: 29 | echo install-plugin.bat dll/lib release/debug msvc# libname 30 | exit 31 | 32 | :argtestdone 33 | 34 | rem ************************************************************************ 35 | rem * check environment variables 36 | 37 | if not "%QTDIR%"=="" goto qtdirset 38 | echo The QTDIR environment variable must be set to point to a directory 39 | echo to be able to perform the installation procedure. 40 | exit 41 | 42 | :qtdirset 43 | if exist %QTDIR%\*.* goto qtdirexists 44 | echo The QTDIR environment variable must point to the Qt installation 45 | echo directory to be able to perform the installation procedure. 46 | exit 47 | 48 | :qtdirexists 49 | if exist %QTDIR%\plugins\*.* goto qtpluginsdirexists 50 | echo The QTDIR environment variable must point to the Qt installation 51 | echo directory to be able to perform the installation procedure. 52 | exit 53 | 54 | :qtpluginsdirexists 55 | if exist %QTDIR%\plugins\designer\*.* goto qtdesignerdirexists 56 | echo The QTDIR environment variable must point to the Qt installation 57 | echo directory to be able to perform the installation procedure. 58 | exit 59 | 60 | :qtdesignerdirexists 61 | 62 | echo Installing to %QTDIR%\plugins\designer\ 63 | 64 | rem ********************************************************************** 65 | rem * Copy files 66 | 67 | if "%1"=="dll" goto installdll 68 | goto installlib 69 | 70 | :installdll 71 | 72 | if "%2"=="debug" goto installdlldebug 73 | goto installdllrelease 74 | 75 | :installdlldebug 76 | xcopy %libname%d.dll %QTDIR%\plugins\designer\ /R /Y 77 | xcopy PluginDebug\%libname%d.pdb %QTDIR%\plugins\designer\ /R /Y 78 | xcopy PluginDebug\%libname%d.lib %QTDIR%\plugins\designer\ /R /Y 79 | goto binariesdone 80 | 81 | :installdllrelease 82 | xcopy %libname%.dll %QTDIR%\plugins\designer\ /R /Y 83 | xcopy PluginRelease\%libname%.lib %QTDIR%\plugins\designer\ /R /Y 84 | goto binariesdone 85 | 86 | :installlib 87 | 88 | echo The plugin can not be used when built as a static library. 89 | 90 | :binariesdone 91 | 92 | rem ** EOF *************************************************************** 93 | -------------------------------------------------------------------------------- /build/misc/install-sdk.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem ************************************************************************ 3 | 4 | echo Running ..\misc\install-sdk.bat 5 | 6 | set type=%1 7 | set mode=%2 8 | set msvc=%3 9 | set libname=%4 10 | 11 | rem ************************************************************************ 12 | rem * check script arguments 13 | 14 | if "%1"=="dll" goto argonegiven 15 | if "%1"=="lib" goto argonegiven 16 | goto argproblem 17 | 18 | :argonegiven 19 | if "%2"=="release" goto argtwogiven 20 | if "%2"=="debug" goto argtwogiven 21 | goto argproblem 22 | 23 | :argtwogiven 24 | goto argtestdone 25 | 26 | :argproblem 27 | echo Error with script arguments: %1 %2 %3 %4. 28 | echo Usage: 29 | echo install-sdk.bat dll/lib release/debug msvc# libname 30 | exit 31 | 32 | :argtestdone 33 | 34 | rem ************************************************************************ 35 | rem * check environment variables 36 | 37 | if not "%COINDIR%"=="" goto coindirset 38 | echo The COINDIR environment variable must be set to point to a directory 39 | echo to be able to perform the installation procedure. 40 | exit 41 | 42 | :coindirset 43 | if exist %COINDIR%\*.* goto coindirexists 44 | echo The COINDIR environment variable must point to an existing directory 45 | echo to be able to perform the installation procedure. 46 | exit 47 | 48 | :coindirexists 49 | 50 | echo Installing to %COINDIR% 51 | 52 | rem ********************************************************************** 53 | rem * Create all the directories 54 | 55 | call ..\misc\create-directories.bat 56 | 57 | rem ********************************************************************** 58 | rem * Copy files 59 | 60 | echo Installing header files... 61 | call ..\misc\install-headers.bat %msvc% 62 | 63 | rem ********************************************************************** 64 | 65 | echo Installing binaries... 66 | 67 | if "%1"=="dll" goto installdll 68 | goto installlib 69 | 70 | :installdll 71 | 72 | if "%2"=="debug" goto installdlldebug 73 | goto installdllrelease 74 | 75 | :installdlldebug 76 | xcopy %libname%d.dll %COINDIR%\bin\ /R /Y 77 | xcopy QuarterDebug\%libname%d.pdb %COINDIR%\bin\ /R /Y 78 | xcopy QuarterDebug\%libname%d.lib %COINDIR%\lib\ /R /Y 79 | goto binariesdone 80 | 81 | :installdllrelease 82 | xcopy %libname%.dll %COINDIR%\bin\ /R /Y 83 | xcopy QuarterRelease\%libname%.lib %COINDIR%\lib\ /R /Y 84 | goto binariesdone 85 | 86 | :installlib 87 | 88 | if "%2"=="debug" goto installlibdebug 89 | goto installlibrelease 90 | 91 | :installlibdebug 92 | xcopy %libname%sd.lib %COINDIR%\lib\ /R /Y 93 | goto binariesdone 94 | 95 | :installlibrelease 96 | xcopy %libname%s.lib %COINDIR%\lib\ /R /Y 97 | goto binariesdone 98 | 99 | :binariesdone 100 | 101 | rem ** EOF *************************************************************** 102 | -------------------------------------------------------------------------------- /build/misc/sync-from-msvc6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -x 4 | 5 | rm -f src/Quarter/moc_*.cpp 6 | rm -f quarter1.sln 7 | rm -f *.vcproj 8 | 9 | cp ../msvc6/*.dsw . 10 | cp ../msvc6/*.dsp . 11 | -------------------------------------------------------------------------------- /build/misc/uninstall-headers.bat: -------------------------------------------------------------------------------- 1 | rem ************************************************************************ 2 | rem * uninstall-headers.bat 3 | rem * 4 | 5 | set msvc=%1 6 | 7 | del %COINDIR%\include\Quarter\Basic.h 8 | del %COINDIR%\include\Quarter\Quarter.h 9 | del %COINDIR%\include\Quarter\QuarterWidget.h 10 | 11 | del %COINDIR%\include\Quarter\devices\DeviceHandler.h 12 | del %COINDIR%\include\Quarter\devices\InputDevice.h 13 | del %COINDIR%\include\Quarter\devices\Keyboard.h 14 | del %COINDIR%\include\Quarter\devices\Mouse.h 15 | del %COINDIR%\include\Quarter\devices\SpaceNavigatorDevice.h 16 | 17 | del %COINDIR%\include\Quarter\eventhandlers\EventFilter.h 18 | del %COINDIR%\include\Quarter\eventhandlers\EventHandler.h 19 | del %COINDIR%\include\Quarter\eventhandlers\DragDropHandler.h 20 | 21 | -------------------------------------------------------------------------------- /build/misc/uninstall-plugin.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/build/misc/uninstall-plugin.bat -------------------------------------------------------------------------------- /build/misc/uninstall-sdk.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/build/misc/uninstall-sdk.bat -------------------------------------------------------------------------------- /build/msvc6/config-debug.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* Define to 1 if you have the ANSI C header files. */ 59 | #define STDC_HEADERS 1 60 | 61 | /* Version number of package */ 62 | #define VERSION "1.0.1a" 63 | 64 | /* Define to 1 if the X Window System is missing or not being used. */ 65 | /* #undef X_DISPLAY_MISSING */ 66 | -------------------------------------------------------------------------------- /build/msvc6/config-release.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* Define to 1 if you have the ANSI C header files. */ 59 | #define STDC_HEADERS 1 60 | 61 | /* Version number of package */ 62 | #define VERSION "1.0.1a" 63 | 64 | /* Define to 1 if the X Window System is missing or not being used. */ 65 | /* #undef X_DISPLAY_MISSING */ 66 | -------------------------------------------------------------------------------- /build/msvc6/config.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_DEBUG 2 | #error The define QUARTER_DEBUG needs to be defined to true or false 3 | #endif 4 | 5 | #ifndef QUARTER_INTERNAL 6 | #error this is a private header file 7 | #endif 8 | 9 | #if QUARTER_DEBUG 10 | #include "config-debug.h" 11 | #else /* !QUARTER_DEBUG */ 12 | #include "config-release.h" 13 | #endif /* !QUARTER_DEBUG */ 14 | -------------------------------------------------------------------------------- /build/msvc6/quarter1.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "minimal_example"=.\minimal_example.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name quarter1 16 | End Project Dependency 17 | Begin Project Dependency 18 | Project_Dep_Name quarter1_install 19 | End Project Dependency 20 | }}} 21 | 22 | ############################################################################### 23 | 24 | Project: "quarter1"=.\quarter1.dsp - Package Owner=<4> 25 | 26 | Package=<5> 27 | {{{ 28 | }}} 29 | 30 | Package=<4> 31 | {{{ 32 | }}} 33 | 34 | ############################################################################### 35 | 36 | Project: "quarter1_install"=.\quarter1_install.dsp - Package Owner=<4> 37 | 38 | Package=<5> 39 | {{{ 40 | }}} 41 | 42 | Package=<4> 43 | {{{ 44 | Begin Project Dependency 45 | Project_Dep_Name quarter1 46 | End Project Dependency 47 | }}} 48 | 49 | ############################################################################### 50 | 51 | Project: "quarter1_uninstall"=.\quarter1_uninstall.dsp - Package Owner=<4> 52 | 53 | Package=<5> 54 | {{{ 55 | }}} 56 | 57 | Package=<4> 58 | {{{ 59 | }}} 60 | 61 | ############################################################################### 62 | 63 | Project: "quarterwidgetplugin1"=.\quarterwidgetplugin1.dsp - Package Owner=<4> 64 | 65 | Package=<5> 66 | {{{ 67 | }}} 68 | 69 | Package=<4> 70 | {{{ 71 | Begin Project Dependency 72 | Project_Dep_Name quarter1_install 73 | End Project Dependency 74 | }}} 75 | 76 | ############################################################################### 77 | 78 | Project: "quarterwidgetplugin1_install"=.\quarterwidgetplugin1_install.dsp - Package Owner=<4> 79 | 80 | Package=<5> 81 | {{{ 82 | }}} 83 | 84 | Package=<4> 85 | {{{ 86 | Begin Project Dependency 87 | Project_Dep_Name quarterwidgetplugin1 88 | End Project Dependency 89 | }}} 90 | 91 | ############################################################################### 92 | 93 | Project: "quarterwidgetplugin1_uninstall"=.\quarterwidgetplugin1_uninstall.dsp - Package Owner=<4> 94 | 95 | Package=<5> 96 | {{{ 97 | }}} 98 | 99 | Package=<4> 100 | {{{ 101 | }}} 102 | 103 | ############################################################################### 104 | 105 | Global: 106 | 107 | Package=<5> 108 | {{{ 109 | }}} 110 | 111 | Package=<3> 112 | {{{ 113 | }}} 114 | 115 | ############################################################################### 116 | 117 | -------------------------------------------------------------------------------- /build/msvc7/config-debug.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* Define to 1 if you have the ANSI C header files. */ 59 | #define STDC_HEADERS 1 60 | 61 | /* Version number of package */ 62 | #define VERSION "1.0.1a" 63 | 64 | /* Define to 1 if the X Window System is missing or not being used. */ 65 | /* #undef X_DISPLAY_MISSING */ 66 | -------------------------------------------------------------------------------- /build/msvc7/config-release.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* Define to 1 if you have the ANSI C header files. */ 59 | #define STDC_HEADERS 1 60 | 61 | /* Version number of package */ 62 | #define VERSION "1.0.1a" 63 | 64 | /* Define to 1 if the X Window System is missing or not being used. */ 65 | /* #undef X_DISPLAY_MISSING */ 66 | -------------------------------------------------------------------------------- /build/msvc7/config.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_DEBUG 2 | #error The define QUARTER_DEBUG needs to be defined to true or false 3 | #endif 4 | 5 | #ifndef QUARTER_INTERNAL 6 | #error this is a private header file 7 | #endif 8 | 9 | #if QUARTER_DEBUG 10 | #include "config-debug.h" 11 | #else /* !QUARTER_DEBUG */ 12 | #include "config-release.h" 13 | #endif /* !QUARTER_DEBUG */ 14 | -------------------------------------------------------------------------------- /build/msvc7/quarter1_install.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 21 | 26 | 27 | 34 | 39 | 40 | 47 | 52 | 53 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | 73 | 75 | 76 | 78 | 79 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /build/msvc7/quarter1_uninstall.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 21 | 26 | 27 | 34 | 39 | 40 | 47 | 52 | 53 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | 73 | 75 | 76 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /build/msvc7/quarterwidgetplugin1_install.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 21 | 26 | 27 | 34 | 39 | 40 | 47 | 52 | 53 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | 73 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /build/msvc7/quarterwidgetplugin1_uninstall.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 21 | 26 | 27 | 34 | 39 | 40 | 47 | 52 | 53 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | 73 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /build/msvc8/config-debug.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* Define to 1 if you have the ANSI C header files. */ 59 | #define STDC_HEADERS 1 60 | 61 | /* Version number of package */ 62 | #define VERSION "1.0.1a" 63 | 64 | /* Define to 1 if the X Window System is missing or not being used. */ 65 | /* #undef X_DISPLAY_MISSING */ 66 | -------------------------------------------------------------------------------- /build/msvc8/config-release.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* Define to 1 if you have the ANSI C header files. */ 59 | #define STDC_HEADERS 1 60 | 61 | /* Version number of package */ 62 | #define VERSION "1.0.1a" 63 | 64 | /* Define to 1 if the X Window System is missing or not being used. */ 65 | /* #undef X_DISPLAY_MISSING */ 66 | -------------------------------------------------------------------------------- /build/msvc8/config.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_DEBUG 2 | #error The define QUARTER_DEBUG needs to be defined to true or false 3 | #endif 4 | 5 | #ifndef QUARTER_INTERNAL 6 | #error this is a private header file 7 | #endif 8 | 9 | #if QUARTER_DEBUG 10 | #include "config-debug.h" 11 | #else /* !QUARTER_DEBUG */ 12 | #include "config-release.h" 13 | #endif /* !QUARTER_DEBUG */ 14 | -------------------------------------------------------------------------------- /build/msvc9/config-debug.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* define this to the libQuarter major version number */ 59 | #define QUARTER_MAJOR_VERSION 1 60 | 61 | /* define this to the libQuarter release version number */ 62 | #define QUARTER_MICRO_VERSION 0 63 | 64 | /* define this to the libQuarter minor version number */ 65 | #define QUARTER_MINOR_VERSION 1 66 | 67 | /* define this to the full libQuarter major.minor.micro version number */ 68 | #define QUARTER_VERSION 1.0.1 69 | 70 | /* Define to 1 if you have the ANSI C header files. */ 71 | #define STDC_HEADERS 1 72 | 73 | /* Version number of package */ 74 | #define VERSION "1.0.1a" 75 | 76 | /* Define to 1 if the X Window System is missing or not being used. */ 77 | /* #undef X_DISPLAY_MISSING */ 78 | -------------------------------------------------------------------------------- /build/msvc9/config-release.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | /* #undef HAVE_DLFCN_H */ 6 | 7 | /* define if the GL header should be included as GL/gl.h */ 8 | /* #undef HAVE_GL_GL_H */ 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_INTTYPES_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* define if the GL header should be included as OpenGL/gl.h */ 17 | /* #undef HAVE_OPENGL_GL_H */ 18 | 19 | /* Define to 1 if you have the header file. */ 20 | /* #undef HAVE_STDINT_H */ 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef HAVE_STRINGS_H */ 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | /* #undef HAVE_UNISTD_H */ 39 | 40 | /* Name of package */ 41 | #define PACKAGE "Quarter" 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "coin-support@coin3d.org" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "Quarter" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "Quarter 1.0.1a" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "quarter" 54 | 55 | /* Define to the version of this package. */ 56 | #define PACKAGE_VERSION "1.0.1a" 57 | 58 | /* define this to the libQuarter major version number */ 59 | #define QUARTER_MAJOR_VERSION 1 60 | 61 | /* define this to the libQuarter release version number */ 62 | #define QUARTER_MICRO_VERSION 0 63 | 64 | /* define this to the libQuarter minor version number */ 65 | #define QUARTER_MINOR_VERSION 1 66 | 67 | /* define this to the full libQuarter major.minor.micro version number */ 68 | #define QUARTER_VERSION 1.0.1 69 | 70 | /* Define to 1 if you have the ANSI C header files. */ 71 | #define STDC_HEADERS 1 72 | 73 | /* Version number of package */ 74 | #define VERSION "1.0.1a" 75 | 76 | /* Define to 1 if the X Window System is missing or not being used. */ 77 | /* #undef X_DISPLAY_MISSING */ 78 | -------------------------------------------------------------------------------- /build/msvc9/config.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_DEBUG 2 | #error The define QUARTER_DEBUG needs to be defined to true or false 3 | #endif 4 | 5 | #ifndef QUARTER_INTERNAL 6 | #error this is a private header file 7 | #endif 8 | 9 | #if QUARTER_DEBUG 10 | #include "config-debug.h" 11 | #else /* !QUARTER_DEBUG */ 12 | #include "config-release.h" 13 | #endif /* !QUARTER_DEBUG */ 14 | -------------------------------------------------------------------------------- /build/qmake/Quarter.pro: -------------------------------------------------------------------------------- 1 | TARGET = Quarter 2 | TEMPLATE = lib 3 | 4 | CONFIG += dll 5 | VERSION = 1.0.0 6 | QT += opengl 7 | 8 | include(coin.pro) 9 | 10 | INCLUDEPATH += ../../include; 11 | 12 | SOURCES = \ 13 | ../../src/Quarter/ContextMenu.cpp \ 14 | ../../src/Quarter/DragDropHandler.cpp \ 15 | ../../src/Quarter/EventFilter.cpp \ 16 | ../../src/Quarter/FocusHandler.cpp \ 17 | ../../src/Quarter/ImageReader.cpp \ 18 | ../../src/Quarter/InputDevice.cpp \ 19 | ../../src/Quarter/InteractionMode.cpp \ 20 | ../../src/Quarter/Keyboard.cpp \ 21 | ../../src/Quarter/KeyboardP.cpp \ 22 | ../../src/Quarter/Mouse.cpp \ 23 | ../../src/Quarter/Quarter.cpp \ 24 | ../../src/Quarter/QuarterP.cpp \ 25 | ../../src/Quarter/QuarterWidget.cpp \ 26 | ../../src/Quarter/QuarterWidgetP.cpp \ 27 | ../../src/Quarter/SensorManager.cpp \ 28 | ../../src/Quarter/SignalThread.cpp \ 29 | ../../src/Quarter/SpaceNavigatorDevice.cpp 30 | 31 | HEADERS = \ 32 | ../../src/Quarter/ContextMenu.h \ 33 | ../../src/Quarter/ImageReader.h \ 34 | ../../src/Quarter/InteractionMode.h \ 35 | ../../src/Quarter/KeyboardP.h \ 36 | ../../src/Quarter/QuarterP.h \ 37 | ../../src/Quarter/QuarterWidgetP.h \ 38 | ../../src/Quarter/SensorManager.h \ 39 | ../../src/Quarter/SignalThread.h \ 40 | ../../include/Quarter/Basic.h \ 41 | ../../include/Quarter/Quarter.h \ 42 | ../../include/Quarter/QuarterWidget.h \ 43 | ../../include/Quarter/devices/InputDevice.h \ 44 | ../../include/Quarter/devices/Keyboard.h \ 45 | ../../include/Quarter/devices/Mouse.h \ 46 | ../../include/Quarter/devices/SpaceNavigatorDevice.h \ 47 | ../../include/Quarter/eventhandlers/DragDropHandler.h \ 48 | ../../include/Quarter/eventhandlers/EventFilter.h \ 49 | ../../include/Quarter/eventhandlers/FocusHandler.h 50 | 51 | -------------------------------------------------------------------------------- /build/qmake/QuarterWidgetPlugin.pro: -------------------------------------------------------------------------------- 1 | TARGET = QuarterWidgetPlugin 2 | TEMPLATE = lib 3 | 4 | CONFIG += designer plugin debug_and_release 5 | VERSION = 0.1.0 6 | QT += opengl 7 | 8 | include(coin.pro) 9 | 10 | INCLUDEPATH += ../../include; 11 | LIBS += -L. -lQuarter 12 | 13 | RESOURCES = ../../src/plugins/QuarterWidgetPlugin.qrc 14 | 15 | SOURCES = \ 16 | ../../src/plugins/QuarterWidgetPlugin.cpp 17 | 18 | HEADERS = \ 19 | ../../src/plugins/QuarterWidgetPlugin.h 20 | -------------------------------------------------------------------------------- /build/qmake/coin.pro: -------------------------------------------------------------------------------- 1 | win32 { 2 | DEFINES += COIN_DLL 3 | INCLUDEPATH += $(COINDIR)/include; 4 | debug { 5 | LIBS += $(COINDIR)/lib/coin3d.lib 6 | } 7 | else { 8 | LIBS += $(COINDIR)/lib/coin3.lib 9 | } 10 | } 11 | macx { 12 | LIBS += -framework Inventor 13 | CONFIG += opengl 14 | } 15 | else { 16 | unix { 17 | CONFIG += opengl 18 | INCLUDEPATH += $(COINDIR)/include 19 | LIBS += $$system(coin-config --ldflags --libs) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cfg/csubst.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/cfg/csubst.exe -------------------------------------------------------------------------------- /cfg/doxy4win.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -p -i.bak 2 | 3 | sub cygpath { 4 | $path=`CYGWIN= cygpath -w "$_[0]"`; 5 | chop($path); 6 | $path; 7 | } 8 | 9 | s/\([^ ]*)/&cygpath($1)/eg; 10 | s/^HTML_OUTPUT.*/HTML_OUTPUT = html/; 11 | s/^MAN_OUTPUT.*/MAN_OUTPUT = man/; 12 | -------------------------------------------------------------------------------- /cfg/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | errstatus=0 8 | dirmode="" 9 | 10 | usage="\ 11 | Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." 12 | 13 | # process command line arguments 14 | while test $# -gt 0 ; do 15 | case $1 in 16 | -h | --help | --h*) # -h for help 17 | echo "$usage" 1>&2 18 | exit 0 19 | ;; 20 | -m) # -m PERM arg 21 | shift 22 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 23 | dirmode=$1 24 | shift 25 | ;; 26 | --) # stop option processing 27 | shift 28 | break 29 | ;; 30 | -*) # unknown option 31 | echo "$usage" 1>&2 32 | exit 1 33 | ;; 34 | *) # first non-opt arg 35 | break 36 | ;; 37 | esac 38 | done 39 | 40 | for file 41 | do 42 | if test -d "$file"; then 43 | shift 44 | else 45 | break 46 | fi 47 | done 48 | 49 | case $# in 50 | 0) exit 0 ;; 51 | esac 52 | 53 | case $dirmode in 54 | '') 55 | if mkdir -p -- . 2>/dev/null; then 56 | echo "mkdir -p -- $*" 57 | exec mkdir -p -- "$@" 58 | fi 59 | ;; 60 | *) 61 | if mkdir -m "$dirmode" -p -- . 2>/dev/null; then 62 | echo "mkdir -m $dirmode -p -- $*" 63 | exec mkdir -m "$dirmode" -p -- "$@" 64 | fi 65 | ;; 66 | esac 67 | 68 | for file 69 | do 70 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 71 | shift 72 | 73 | pathcomp= 74 | for d 75 | do 76 | pathcomp="$pathcomp$d" 77 | case $pathcomp in 78 | -*) pathcomp=./$pathcomp ;; 79 | esac 80 | 81 | if test ! -d "$pathcomp"; then 82 | echo "mkdir $pathcomp" 83 | 84 | mkdir "$pathcomp" || lasterr=$? 85 | 86 | if test ! -d "$pathcomp"; then 87 | errstatus=$lasterr 88 | else 89 | if test ! -z "$dirmode"; then 90 | echo "chmod $dirmode $pathcomp" 91 | lasterr="" 92 | chmod "$dirmode" "$pathcomp" || lasterr=$? 93 | 94 | if test ! -z "$lasterr"; then 95 | errstatus=$lasterr 96 | fi 97 | fi 98 | fi 99 | fi 100 | 101 | pathcomp="$pathcomp/" 102 | done 103 | done 104 | 105 | exit $errstatus 106 | 107 | # Local Variables: 108 | # mode: shell-script 109 | # sh-indentation: 2 110 | # End: 111 | # mkinstalldirs ends here 112 | -------------------------------------------------------------------------------- /cfg/wrapmsvc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/cfg/wrapmsvc.exe -------------------------------------------------------------------------------- /config.h.cmake.in: -------------------------------------------------------------------------------- 1 | /* define this to the Quarter major version number */ 2 | #define QUARTER_MAJOR_VERSION @PROJECT_VERSION_MAJOR@ 3 | 4 | /* define this to the Quarter minor version number */ 5 | #define QUARTER_MINOR_VERSION @PROJECT_VERSION_MINOR@ 6 | 7 | /* define this to the Quarter release version number */ 8 | #define QUARTER_MICRO_VERSION @PROJECT_VERSION_PATCH@ 9 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* define if the GL header should be included as GL/gl.h */ 7 | #undef HAVE_GL_GL_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_INTTYPES_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_MEMORY_H 14 | 15 | /* define if the GL header should be included as OpenGL/gl.h */ 16 | #undef HAVE_OPENGL_GL_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDINT_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STDLIB_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRINGS_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STRING_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_STAT_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_SYS_TYPES_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_UNISTD_H 38 | 39 | /* Name of package */ 40 | #undef PACKAGE 41 | 42 | /* Define to the address where bug reports for this package should be sent. */ 43 | #undef PACKAGE_BUGREPORT 44 | 45 | /* Define to the full name of this package. */ 46 | #undef PACKAGE_NAME 47 | 48 | /* Define to the full name and version of this package. */ 49 | #undef PACKAGE_STRING 50 | 51 | /* Define to the one symbol short name of this package. */ 52 | #undef PACKAGE_TARNAME 53 | 54 | /* Define to the home page for this package. */ 55 | #undef PACKAGE_URL 56 | 57 | /* Define to the version of this package. */ 58 | #undef PACKAGE_VERSION 59 | 60 | /* define this to the libQuarter major version number */ 61 | #undef QUARTER_MAJOR_VERSION 62 | 63 | /* define this to the libQuarter release version number */ 64 | #undef QUARTER_MICRO_VERSION 65 | 66 | /* define this to the libQuarter minor version number */ 67 | #undef QUARTER_MINOR_VERSION 68 | 69 | /* define this to the full libQuarter major.minor.micro version number */ 70 | #undef QUARTER_VERSION 71 | 72 | /* Define to 1 if you have the ANSI C header files. */ 73 | #undef STDC_HEADERS 74 | 75 | /* Version number of package */ 76 | #undef VERSION 77 | 78 | /* Define to 1 if the X Window System is missing or not being used. */ 79 | #undef X_DISPLAY_MISSING 80 | -------------------------------------------------------------------------------- /docs/ChangeLog.v1.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/docs/ChangeLog.v1.0.0 -------------------------------------------------------------------------------- /docs/ChangeLog.v1.1.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/docs/ChangeLog.v1.1.0 -------------------------------------------------------------------------------- /docs/ChangeLog.v1.2.1: -------------------------------------------------------------------------------- 1 | 2024-02-04 21:25:35 +0100 Volker Enderlein (18a1422) 2 | 3 | Simplify support for major Qt versions. 4 | 5 | M include/Quarter/QuarterWidget.h 6 | M src/Quarter/QuarterWidget.cpp 7 | M src/Quarter/QuarterWidgetP.cpp 8 | M src/Quarter/QuarterWidgetP.h 9 | M src/examples/MdiMainWindow.cpp 10 | M src/examples/MdiMainWindow.h 11 | M src/examples/MdiQuarterWidget.cpp 12 | M src/examples/MdiQuarterWidget.h 13 | M src/plugins/QuarterWidgetPlugin.cpp 14 | 15 | 2024-02-04 16:08:37 +0100 Volker Enderlein (78b1ce0) 16 | 17 | fix: check for valid context #61 18 | 19 | M src/Quarter/QuarterWidgetP.cpp 20 | -------------------------------------------------------------------------------- /docs/RELEASE.txt: -------------------------------------------------------------------------------- 1 | This document describes the process of making a new release of the Quarter 2 | library. 3 | 4 | Remember to include these points: 5 | 6 | * Copy trunk to the corresponding tag, and do the rest of the changes 7 | in the tag 8 | 9 | * When tagging the release in Subversion, make sure to edit the 10 | externals property to include the correct version of CMakeMacros. 11 | This probably includes modifying the svn:externals to point to a 12 | specific revision of the externals eg: 13 | $ svn propedit svn:externals . 14 | CMakeMacros https://svn.coin3d.org/repos/CMakeMacros/trunk 15 | 16 | should change to: 17 | CMakeMacros -r https://svn.coin3d.org/repos/CMakeMacros/trunk 18 | 19 | Remember to this for every external 20 | 21 | * Update configure.ac in the tag with release version and commit 22 | 23 | * Update configure.ac in trunk to point to next release version, but 24 | in alpha 25 | 26 | * Bootstrap both trunk and tag. 27 | 28 | * Run unittests 29 | 30 | * Test example programs, and at least a few others. 31 | 32 | * Test that doc generation looks reasonable.. 33 | 34 | * Commit and feel good! 35 | -------------------------------------------------------------------------------- /docs/doxygen/Coin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/docs/doxygen/Coin_logo.png -------------------------------------------------------------------------------- /docs/doxygen/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/doxygen/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | $projectname: $title 9 | $title 10 | 11 | 12 | 13 | $treeview 14 | $search 15 | $mathjax 16 | 17 | $extrastylesheet 18 | 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | 27 | 30 | 33 | 37 | 38 | 39 |
28 | Coin Logo 29 | 31 | Coin3D is Free Software,
published under the BSD 3-clause license. 32 |
34 | https://coin3d.github.io
35 | https://www.kongsberg.com/en/kogt/
36 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /html/Makefile.am: -------------------------------------------------------------------------------- 1 | # NOTES: 2 | # This Makefile.am relies on $(htmldir) being AC_SUBST'ed into place... 3 | 4 | if BUILD_HTMLPAGES 5 | 6 | # ************************************************************************** 7 | # build trickery 8 | 9 | $(top_builddir)/docs/quarter.doxygen: $(top_srcdir)/docs/quarter.doxygen.in $(top_builddir)/config.status 10 | @( cd $(top_builddir); $(MAKE) docs/quarter.doxygen ) 11 | 12 | index.html: $(top_builddir)/docs/quarter.doxygen 13 | @( cd ..; \ 14 | echo " $(sim_ac_doxygen_exe) docs/quarter.doxygen"; \ 15 | "$(sim_ac_doxygen_exe)" docs/quarter.doxygen ) 16 | 17 | filelist.txt: index.html 18 | @if cmp -s $(top_srcdir)/docs/doxygen/Coin_logo.png Coin_logo.png; then :; else \ 19 | echo " cp $(top_srcdir)/docs/doxygen/Coin_logo.png ."; \ 20 | cp $(top_srcdir)/docs/doxygen/Coin_logo.png .; \ 21 | fi 22 | @ls -1 | egrep '(\.html|\.png|\.gif|\.css|\.tag)$$' >filelist.txt 23 | 24 | all-local: filelist.txt 25 | 26 | install-data-local: install-html 27 | 28 | uninstall-local: uninstall-html 29 | 30 | if MAC_FRAMEWORK 31 | install-html: filelist.txt 32 | @$(NORMAL_INSTALL) 33 | $(mkinstalldirs) "$(DESTDIR)$(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Documentation" 34 | @echo " ln -sf Versions/Current/Documentation $(DESTDIR)$(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Documentation"; \ 35 | ln -sf Versions/Current/Documentation "$(DESTDIR)$(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Documentation" 36 | @destdir="$(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Documentation"; \ 37 | list="`cat filelist.txt`"; \ 38 | for file in $$list; do \ 39 | echo " $(INSTALL_DATA) $$file $(DESTDIR)$$destdir/$$file"; \ 40 | $(INSTALL_DATA) $$file "$(DESTDIR)$$destdir/$$file"; \ 41 | done 42 | 43 | uninstall-html: filelist.txt 44 | @$(NORMAL_UNINSTALL) 45 | @destdir="$(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Documentation"; \ 46 | list="`cat filelist.txt`"; \ 47 | for file in $$list; do \ 48 | echo " rm -f $(DESTDIR)$(destdir)/$$file"; \ 49 | rm -f "$(DESTDIR)$(destdir)/$$file"; \ 50 | done 51 | @echo " rmdir $(DESTDIR)$(destdir)"; \ 52 | rmdir $(DESTDIR)$(destdir) 2>/dev/null; \ 53 | : 54 | else # !MAC_FRAMEWORK 55 | install-html: filelist.txt 56 | @$(NORMAL_INSTALL) 57 | $(mkinstalldirs) $(DESTDIR)$(htmldir) 58 | @list="`cat filelist.txt`"; \ 59 | for file in $$list; do \ 60 | echo " $(INSTALL_DATA) $$file $(DESTDIR)$(htmldir)/$$file"; \ 61 | $(INSTALL_DATA) $$file "$(DESTDIR)$(htmldir)/$$file"; \ 62 | done 63 | 64 | uninstall-html: filelist.txt 65 | @$(NORMAL_UNINSTALL) 66 | @list="`cat filelist.txt`"; \ 67 | for file in $$list; do \ 68 | echo " rm -f $(DESTDIR)$(htmldir)/$$file"; \ 69 | rm -f "$(DESTDIR)$(htmldir)/$$file"; \ 70 | done 71 | @echo " rmdir $(DESTDIR)$(htmldir)"; \ 72 | rmdir $(DESTDIR)$(htmldir) 2>/dev/null; \ 73 | : 74 | endif 75 | endif -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = Quarter 2 | -------------------------------------------------------------------------------- /include/Quarter/Basic.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_BASIC_H 2 | #define QUARTER_BASIC_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | /* 37 | See Coin's Inventor/C/basic.h for an explanation to the below #define 38 | setup. 39 | */ 40 | 41 | #ifdef QUARTER_DLL_API 42 | #error Leave the QUARTER_DLL_API define alone 43 | #endif // QUARTER_MAKE_DLL 44 | 45 | #ifdef QUARTER_INTERNAL 46 | # ifdef QUARTER_NOT_DLL 47 | # error The QUARTER_DLL define should not be used when building the library - only when building win32 applications. 48 | # endif // QUARTER_NOT_DLL 49 | # ifdef QUARTER_DLL 50 | # error The QUARTER_NOT_DLL define should not be used when building the library - only when building win32 applications. 51 | # endif // QUARTER_DLL 52 | #endif // QUARTER_INTERNAL 53 | 54 | #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 55 | # ifdef QUARTER_INTERNAL 56 | # ifdef QUARTER_MAKE_DLL 57 | # define QUARTER_DLL_API __declspec(dllexport) 58 | # endif // QUARTER_MAKE_DLL 59 | # else // !QUARTER_INTERNAL 60 | # ifdef QUARTER_DLL 61 | # ifdef QUARTER_NOT_DLL 62 | # error Define _either_ QUARTER_DLL or QUARTER_NOT_DLL as appropriate for your linkage -- not both at the same time! See the Coin Inventor/C/basic.h for further instructions. 63 | # endif // QUARTER_NOT_DLL 64 | # define QUARTER_DLL_API __declspec(dllimport) 65 | # else // !QUARTER_DLL 66 | # ifndef QUARTER_NOT_DLL 67 | # error Define either QUARTER_DLL or QUARTER_NOT_DLL as appropriate for your linkage. See the Coin Inventor/C/basic.h for further instructions. 68 | # endif // !QUARTER_NOT_DLL 69 | # endif // !QUARTER_DLL 70 | # endif // !QUARTER_INTERNAL 71 | #endif // Microsoft Windows 72 | 73 | #ifndef QUARTER_DLL_API 74 | # define QUARTER_DLL_API 75 | #endif // !QUARTER_DLL_API 76 | 77 | #endif // !QUARTER_BASIC_H 78 | -------------------------------------------------------------------------------- /include/Quarter/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = devices eventhandlers 2 | 3 | libQuarterinc_HEADERS = \ 4 | Basic.h \ 5 | Quarter.h \ 6 | QuarterWidget.h \ 7 | QtCoinCompatibility.h 8 | 9 | if MAC_FRAMEWORK 10 | libQuarterincdir = $(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Headers 11 | else 12 | libQuarterincdir = $(includedir)/Quarter 13 | endif 14 | 15 | 16 | -------------------------------------------------------------------------------- /include/Quarter/QtCoinCompatibility.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_QTCOINCOMPATIBILITY_H 2 | #define QUARTER_QTCOINCOMPATIBILITY_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | class QImage; 37 | class SbImage; 38 | 39 | #include 40 | 41 | namespace SIM { namespace Coin3D { namespace Quarter { 42 | 43 | namespace QtCoinCompatibility { 44 | void QUARTER_DLL_API QImageToSbImage(const QImage &, SbImage & ); 45 | void QUARTER_DLL_API SbImageToQImage(const SbImage &, QImage & ); 46 | } 47 | 48 | }}} // namespace 49 | 50 | #endif // QUARTER_QTCOINCOMPATIBILITY_H 51 | -------------------------------------------------------------------------------- /include/Quarter/Quarter.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_QUARTER_H 2 | #define QUARTER_QUARTER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | 38 | namespace SIM { namespace Coin3D { namespace Quarter { 39 | 40 | namespace Quarter { 41 | void QUARTER_DLL_API init(bool initCoin = true); 42 | void QUARTER_DLL_API clean(void); 43 | void QUARTER_DLL_API setTimerEpsilon(double sec); 44 | }; 45 | 46 | }}} // namespace 47 | 48 | #endif // QUARTER_QUARTER_H 49 | -------------------------------------------------------------------------------- /include/Quarter/devices/InputDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_INPUTDEVICE_H 2 | #define QUARTER_INPUTDEVICE_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class QEvent; 40 | class SoEvent; 41 | class QInputEvent; 42 | 43 | namespace SIM { namespace Coin3D { namespace Quarter { 44 | 45 | class QuarterWidget; 46 | 47 | class QUARTER_DLL_API InputDevice { 48 | public: 49 | InputDevice(QuarterWidget* quarter); 50 | virtual ~InputDevice() {} 51 | 52 | /*! 53 | Subclasses must override this method to provide custom event 54 | handling 55 | */ 56 | virtual const SoEvent * translateEvent(QEvent * event) = 0; 57 | 58 | void setMousePosition(const SbVec2s & pos); 59 | void setWindowSize(const SbVec2s & size); 60 | void setModifiers(SoEvent * soevent, const QInputEvent * qevent); 61 | 62 | protected: 63 | SbVec2s mousepos; 64 | SbVec2s windowsize; 65 | QuarterWidget* quarter; 66 | }; 67 | 68 | }}} // namespace 69 | 70 | #endif // QUARTER_INPUTDEVICE_H 71 | -------------------------------------------------------------------------------- /include/Quarter/devices/Keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_KEYBOARD_H 2 | #define QUARTER_KEYBOARD_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class QEvent; 40 | class SoEvent; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class QUARTER_DLL_API Keyboard : public InputDevice { 45 | public: 46 | Keyboard(QuarterWidget* quarter); 47 | virtual ~Keyboard(); 48 | 49 | virtual const SoEvent * translateEvent(QEvent * event); 50 | 51 | private: 52 | friend class KeyboardP; 53 | class KeyboardP * pimpl; 54 | }; 55 | 56 | }}} // namespace 57 | 58 | #endif // QUARTER_KEYBOARD_H 59 | -------------------------------------------------------------------------------- /include/Quarter/devices/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libdevicesinc_HEADERS = \ 3 | InputDevice.h \ 4 | Keyboard.h \ 5 | Mouse.h 6 | 7 | if MAC_FRAMEWORK 8 | libdevicesincdir = $(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Headers/devices 9 | else 10 | libdevicesincdir = $(includedir)/Quarter/devices 11 | endif -------------------------------------------------------------------------------- /include/Quarter/devices/Mouse.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_MOUSE_H 2 | #define QUARTER_MOUSE_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class QEvent; 40 | class SoEvent; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class QuarterWidget; 45 | 46 | class QUARTER_DLL_API Mouse : public InputDevice { 47 | public: 48 | Mouse(QuarterWidget* quarter); 49 | virtual ~Mouse(); 50 | 51 | virtual const SoEvent * translateEvent(QEvent * event); 52 | 53 | private: 54 | friend class MouseP; 55 | class MouseP * pimpl; 56 | }; 57 | 58 | }}} // namespace 59 | 60 | #endif // QUARTER_MOUSEHANDLER_H 61 | -------------------------------------------------------------------------------- /include/Quarter/devices/SpaceNavigatorDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_SPACENAVIGATORDEVICE_H 2 | #define QUARTER_SPACENAVIGATORDEVICE_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | 38 | class SoEvent; 39 | class QEvent; 40 | 41 | namespace SIM { namespace Coin3D { namespace Quarter { 42 | 43 | class QUARTER_DLL_API SpaceNavigatorDevice : public InputDevice { 44 | public: 45 | SpaceNavigatorDevice(QuarterWidget* quarter); 46 | virtual ~SpaceNavigatorDevice(); 47 | virtual const SoEvent * translateEvent(QEvent * event); 48 | 49 | private: 50 | class SpaceNavigatorDeviceP * pimpl; 51 | friend class SpaceNavigatorDeviceP; 52 | }; 53 | 54 | }}} 55 | #endif // !QUARTER_SPACENAVIGATORDEVICE_H 56 | -------------------------------------------------------------------------------- /include/Quarter/eventhandlers/DragDropHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_DRAGDROPHANDLER_H 2 | #define QUARTER_DRAGDROPHANDLER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class QEvent; 40 | class SoEvent; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class QuarterWidget; 45 | 46 | class QUARTER_DLL_API DragDropHandler : public QObject { 47 | Q_OBJECT 48 | public: 49 | DragDropHandler(QuarterWidget * parent); 50 | virtual ~DragDropHandler(); 51 | 52 | protected: 53 | virtual bool eventFilter(QObject *, QEvent * event); 54 | 55 | private: 56 | friend class DragDropHandlerP; 57 | class DragDropHandlerP * pimpl; 58 | }; 59 | 60 | }}} // namespace 61 | 62 | #endif // QUARTER_DRAGDROPHANDLER_H 63 | -------------------------------------------------------------------------------- /include/Quarter/eventhandlers/EventFilter.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_EVENTFILTER_H 2 | #define QUARTER_EVENTFILTER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class QEvent; 40 | class QPoint; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class InputDevice; 45 | 46 | class QUARTER_DLL_API EventFilter : public QObject { 47 | Q_OBJECT 48 | 49 | public: 50 | EventFilter(QObject * parent); 51 | ~EventFilter(); 52 | 53 | void registerInputDevice(InputDevice * device); 54 | void unregisterInputDevice(InputDevice * device); 55 | 56 | const QPoint & globalMousePosition(void) const; 57 | 58 | protected: 59 | bool eventFilter(QObject * obj, QEvent * event); 60 | 61 | private: 62 | class EventFilterP * pimpl; 63 | }; 64 | 65 | }}} // namespace 66 | 67 | #endif // QUARTER_EVENTFILTER_H 68 | -------------------------------------------------------------------------------- /include/Quarter/eventhandlers/FocusHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_FOCUSHANDLER_H 2 | #define QUARTER_FOCUSHANDLER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class QEvent; 40 | 41 | namespace SIM { namespace Coin3D { namespace Quarter { 42 | 43 | class QuarterWidget; 44 | 45 | class FocusHandler : public QObject { 46 | Q_OBJECT 47 | public: 48 | FocusHandler(QObject * parent); 49 | virtual ~FocusHandler(); 50 | 51 | protected: 52 | virtual bool eventFilter(QObject *, QEvent * event); 53 | 54 | private: 55 | void focusEvent(const SbName & focusevent); 56 | QuarterWidget * quarterwidget; 57 | }; 58 | 59 | }}} // namespace 60 | 61 | #endif // QUARTER_FOCUSHANDLER_H 62 | -------------------------------------------------------------------------------- /include/Quarter/eventhandlers/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libeventhandlersinc_HEADERS = \ 3 | DragDropHandler.h \ 4 | EventFilter.h \ 5 | FocusHandler.h 6 | 7 | if MAC_FRAMEWORK 8 | libeventhandlersincdir = $(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Headers/eventhandlers 9 | else 10 | libeventhandlersincdir = $(includedir)/Quarter/eventhandlers 11 | endif -------------------------------------------------------------------------------- /packaging/description-summary.txt: -------------------------------------------------------------------------------- 1 | Quarter is a light-weight glue library that provides seamless 2 | integration between Systems in Motions's Coin high-level 3D 3 | visualization library and Trolltech's Qt 2D user interface library. 4 | 5 | Qt and Coin is a perfect match since they are both open source, widely 6 | portable and easy to use. Quarter has evolved from Systems in Motion's 7 | own experiences using Coin and Qt together in our applications. 8 | 9 | The functionality in Quarter revolves around QuarterWidget, a subclass 10 | of QGLWidget. This widget provides functionality for rendering of Coin 11 | scenegraphs and translation of QEvents into SoEvents. Using this 12 | widget is as easy as using any other QWidget. 13 | -------------------------------------------------------------------------------- /quarter-config.cmake.in: -------------------------------------------------------------------------------- 1 | # CMake package configuration file for @PROJECT_NAME@ 2 | # 3 | # Defines the target "@PROJECT_NAME@::@PROJECT_NAME@" 4 | # 5 | # Add the following lines to your CMakeLists.txt to depend on @PROJECT_NAME@ 6 | # 7 | # find_package(@PROJECT_NAME@ REQUIRED) 8 | # target_link_libraries(my_target_name @PROJECT_NAME@::@PROJECT_NAME@) 9 | # 10 | # Additionally you may one of the following variables (or their corresponding 11 | # upper case version) that are also defined. 12 | # 13 | # @PROJECT_NAME@_COMPILE_DEFINITIONS 14 | # @PROJECT_NAME@_DEFINITIONS 15 | # @PROJECT_NAME@_INCLUDE_DIRS 16 | # @PROJECT_NAME@_INCLUDE_DIR 17 | # @PROJECT_NAME@_LIBRARY 18 | # @PROJECT_NAME@_LIBRARIES 19 | # @PROJECT_NAME@_LIBRARY_DIRS 20 | # @PROJECT_NAME@_LIBRARY_DIR 21 | # 22 | # However, in most cases using the @PROJECT_NAME@::@PROJECT_NAME@ target is sufficient, 23 | # and you won't need these variables. 24 | 25 | @PACKAGE_INIT@ 26 | 27 | include(CMakeFindDependencyMacro) 28 | 29 | find_dependency(Coin) 30 | 31 | set(@PROJECT_NAME@_HAVE_QT6 @Qt6_FOUND@) 32 | set(@PROJECT_NAME@_HAVE_QT5 @Qt5_FOUND@) 33 | set(@PROJECT_NAME@_HAVE_QT4 @Qt4_FOUND@) 34 | if(@PROJECT_NAME@_HAVE_QT6) 35 | find_dependency(Qt6Widgets) 36 | find_dependency(Qt6UiTools) 37 | find_dependency(Qt6OpenGL) 38 | find_dependency(Qt6OpenGLWidgets) 39 | elseif(@PROJECT_NAME@_HAVE_QT5) 40 | find_dependency(Qt5Widgets) 41 | find_dependency(Qt5UiTools) 42 | find_dependency(Qt5OpenGL) 43 | elseif(@PROJECT_NAME@_HAVE_QT4) 44 | find_dependency(Qt4 COMPONENTS QtGui QtUiTools QtOpenGL) 45 | endif() 46 | 47 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME_LOWER@-export.cmake") 48 | 49 | get_property(@PROJECT_NAME@_COMPILE_DEFINITIONS TARGET @PROJECT_NAME@::@PROJECT_NAME@ PROPERTY INTERFACE_COMPILE_DEFINITIONS) 50 | foreach(_def ${@PROJECT_NAME@_COMPILE_DEFINITIONS}) 51 | list(APPEND @PROJECT_NAME@_DEFINITIONS -D${_def}) 52 | endforeach() 53 | 54 | set(@PROJECT_NAME@_VERSION @VERSION@) 55 | 56 | get_property(@PROJECT_NAME@_INCLUDE_DIRS TARGET @PROJECT_NAME@::@PROJECT_NAME@ PROPERTY INTERFACE_INCLUDE_DIRECTORIES) 57 | set(@PROJECT_NAME@_INCLUDE_DIR ${@PROJECT_NAME@_INCLUDE_DIRS}) 58 | set(@PROJECT_NAME@_LIBRARY @PROJECT_NAME@::@PROJECT_NAME@) 59 | get_property(@PROJECT_NAME@_LIBRARIES TARGET @PROJECT_NAME@::@PROJECT_NAME@ PROPERTY INTERFACE_LINK_LIBRARIES) 60 | set(@PROJECT_NAME@_LIBRARIES @PROJECT_NAME@::@PROJECT_NAME@ ${@PROJECT_NAME@_LIBRARIES}) 61 | 62 | set_and_check(@PROJECT_NAME@_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@") 63 | set(@PROJECT_NAME@_LIBRARY_DIR ${@PROJECT_NAME@_LIBRARY_DIRS}) 64 | 65 | # For backwards compatibility define upper case versions of output variables 66 | foreach(_var 67 | @PROJECT_NAME@_COMPILE_DEFINITIONS 68 | @PROJECT_NAME@_DEFINITIONS 69 | @PROJECT_NAME@_INCLUDE_DIRS 70 | @PROJECT_NAME@_INCLUDE_DIR 71 | @PROJECT_NAME@_LIBRARY 72 | @PROJECT_NAME@_LIBRARIES 73 | @PROJECT_NAME@_LIBRARY_DIRS 74 | @PROJECT_NAME@_LIBRARY_DIR 75 | @PROJECT_NAME@_VERSION 76 | ) 77 | string(TOUPPER ${_var} _uppercase_var) 78 | set(${_uppercase_var} ${${_var}}) 79 | endforeach() 80 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Quarter) 2 | 3 | if(QUARTER_BUILD_EXAMPLES) 4 | add_subdirectory(examples) 5 | endif() 6 | if(QUARTER_BUILD_PLUGIN) 7 | add_subdirectory(plugins) 8 | endif() 9 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = Quarter plugins examples -------------------------------------------------------------------------------- /src/Quarter/ContextMenu.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef QUARTER_CONTEXTMENUHANDLERP_H 34 | #define QUARTER_CONTEXTMENUHANDLERP_H 35 | 36 | #include 37 | 38 | class QMenu; 39 | class QAction; 40 | 41 | namespace SIM { namespace Coin3D { namespace Quarter { 42 | 43 | class QuarterWidget; 44 | 45 | class ContextMenu : public QObject { 46 | Q_OBJECT 47 | public: 48 | ContextMenu(QuarterWidget * quarterwidget); 49 | ~ContextMenu(); 50 | 51 | QMenu * getMenu(void) const; 52 | 53 | public slots: 54 | void changeRenderMode(QAction * action); 55 | void changeStereoMode(QAction * action); 56 | void changeTransparencyType(QAction * action); 57 | 58 | private: 59 | QuarterWidget * quarterwidget; 60 | 61 | QMenu * contextmenu; 62 | QMenu * rendermenu; 63 | QMenu * stereomenu; 64 | QMenu * functionsmenu; 65 | QMenu * transparencymenu; 66 | }; 67 | 68 | }}} // namespace 69 | 70 | #endif // QUARTER_CONTEXTMENUHANDLERP_H 71 | -------------------------------------------------------------------------------- /src/Quarter/FocusHandler.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class SIM::Coin3D::Quarter::FocusHandler FocusHandler.h Quarter/devices/FocusHandler.h 35 | 36 | \brief The FocusHandler event filter provides Coin with focus in and 37 | focus out events, if installed on a QuarterWidget. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | using namespace SIM::Coin3D::Quarter; 47 | 48 | FocusHandler::FocusHandler(QObject * parent) 49 | : QObject(parent) 50 | { 51 | this->quarterwidget = dynamic_cast(parent); 52 | } 53 | 54 | FocusHandler::~FocusHandler() 55 | { 56 | 57 | } 58 | 59 | bool 60 | FocusHandler::eventFilter(QObject * obj, QEvent * event) 61 | { 62 | switch (event->type()) { 63 | case QEvent::FocusIn: 64 | this->focusEvent("sim.coin3d.coin.InputFocus.IN"); 65 | break; 66 | case QEvent::FocusOut: 67 | this->focusEvent("sim.coin3d.coin.InputFocus.OUT"); 68 | break; 69 | default: 70 | break; 71 | } 72 | return QObject::eventFilter(obj, event); 73 | } 74 | 75 | void 76 | FocusHandler::focusEvent(const SbName & focusevent) 77 | { 78 | SoEventManager * eventmanager = this->quarterwidget->getSoEventManager(); 79 | for (int c = 0; c < eventmanager->getNumSoScXMLStateMachines(); ++c) { 80 | SoScXMLStateMachine * sostatemachine = 81 | eventmanager->getSoScXMLStateMachine(c); 82 | if (sostatemachine->isActive()) { 83 | sostatemachine->queueEvent(focusevent); 84 | sostatemachine->processEventQueue(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/Quarter/ImageReader.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "ImageReader.h" 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | using namespace SIM::Coin3D::Quarter; 41 | 42 | ImageReader::ImageReader(void) 43 | { 44 | SbImage::addReadImageCB(ImageReader::readImageCB, this); 45 | } 46 | 47 | ImageReader::~ImageReader(void) 48 | { 49 | SbImage::removeReadImageCB(ImageReader::readImageCB, this); 50 | } 51 | 52 | SbBool 53 | ImageReader::readImage(const SbString & filename, SbImage & sbimage) const 54 | { 55 | QImage image; 56 | if (image.load(filename.getString())) { 57 | int w = image.width(); 58 | int h = image.height(); 59 | 60 | // Keep in 8-bits mode if that was what we read 61 | if (image.depth() != 8 || !image.isGrayscale()) { 62 | // FIXME: consider if we should detect allGrayscale() and alpha (c = 2) 63 | image = image.convertToFormat(image.hasAlphaChannel() ? 64 | QImage::Format_ARGB32 : QImage::Format_RGB32); 65 | } 66 | 67 | QtCoinCompatibility::QImageToSbImage(image,sbimage); 68 | return TRUE; 69 | } 70 | return FALSE; 71 | } 72 | 73 | 74 | 75 | SbBool 76 | ImageReader::readImageCB(const SbString & filename, SbImage * image, void * closure) 77 | { 78 | return ((ImageReader*)closure)->readImage(filename, *image); 79 | } 80 | -------------------------------------------------------------------------------- /src/Quarter/ImageReader.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_IMAGELOADER_H 2 | #define QUARTER_IMAGELOADER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | 38 | class SbImage; 39 | class SbString; 40 | class QImage; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class ImageReader { 45 | public: 46 | ImageReader(void); 47 | ~ImageReader(void); 48 | 49 | SbBool readImage(const SbString & filename, SbImage & image) const; 50 | 51 | private: 52 | static SbBool readImageCB(const SbString & filename, SbImage * image, void * closure); 53 | }; 54 | 55 | }}} // namespace 56 | 57 | #endif // QUARTER_IMAGELOADER_H 58 | -------------------------------------------------------------------------------- /src/Quarter/InputDevice.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | using namespace SIM::Coin3D::Quarter; 39 | 40 | /*! 41 | \class SIM::Coin3D::Quarter::InputDevice InputDevice.h Quarter/devices/InputDevice.h 42 | 43 | \brief The InputDevice class is the base class for devices such as 44 | keyboard and mouse. It can be subclassed to support other devices. 45 | */ 46 | 47 | InputDevice::InputDevice(QuarterWidget* quart) : 48 | quarter(quart) 49 | { 50 | this->mousepos = SbVec2s(0, 0); 51 | } 52 | 53 | /*! 54 | Sets the mouse position 55 | 56 | \param[in] pos position of mouse in pixel coordinates 57 | */ 58 | void 59 | InputDevice::setMousePosition(const SbVec2s & pos) 60 | { 61 | this->mousepos = pos; 62 | } 63 | 64 | /*! 65 | Sets the window size of the owning window 66 | 67 | \param[in] size in pixels 68 | */ 69 | void 70 | InputDevice::setWindowSize(const SbVec2s & size) 71 | { 72 | this->windowsize = size; 73 | } 74 | 75 | /*! 76 | Transforms a QEvent into an SoEvent 77 | 78 | \param[in,out] SoEvent the transformed event 79 | \param[in] QEvent incoming QEvent 80 | */ 81 | void 82 | InputDevice::setModifiers(SoEvent * soevent, const QInputEvent * qevent) 83 | { 84 | // FIXME: How do we get the time from the qevent? (20070306 frodo) 85 | soevent->setTime(SbTime::getTimeOfDay()); 86 | 87 | // Note: On Mac OS X, the ControlModifier value corresponds to the 88 | // Command keys on the Macintosh keyboard, and the MetaModifier 89 | // value corresponds to the Control keys. 90 | soevent->setShiftDown(qevent->modifiers() & Qt::ShiftModifier); 91 | soevent->setAltDown(qevent->modifiers() & Qt::AltModifier); 92 | soevent->setCtrlDown(qevent->modifiers() & Qt::ControlModifier); 93 | } 94 | 95 | /*! 96 | \var InputDevice::mousepos 97 | 98 | Holds the last known position of the mouse. This should be set even 99 | for a keyboard event. 100 | */ 101 | 102 | /*! 103 | \var InputDevice::windowsize 104 | 105 | Holds the size of the owning window 106 | */ 107 | 108 | #undef PRIVATE 109 | -------------------------------------------------------------------------------- /src/Quarter/InteractionMode.cpp: -------------------------------------------------------------------------------- 1 | #include "InteractionMode.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | /* 9 | Adjust how QuarterWidget reacts to alt key events 10 | */ 11 | 12 | using namespace SIM::Coin3D::Quarter; 13 | 14 | InteractionMode::InteractionMode(QuarterWidget * quarterwidget) 15 | : QObject(quarterwidget) 16 | { 17 | this->quarterwidget = quarterwidget; 18 | this->altkeydown = false; 19 | this->prevcursor = QCursor(); 20 | this->prevnavstate = 21 | this->quarterwidget->getSoEventManager()->getNavigationState(); 22 | 23 | this->isenabled = true; 24 | this->ison = false; 25 | this->isinteractive = false; 26 | } 27 | 28 | InteractionMode::~InteractionMode() 29 | { 30 | 31 | } 32 | 33 | void 34 | InteractionMode::setEnabled(bool yes) 35 | { 36 | this->isenabled = yes; 37 | } 38 | 39 | bool 40 | InteractionMode::enabled(void) const 41 | { 42 | return this->isenabled; 43 | } 44 | 45 | void InteractionMode::setOn(bool on) 46 | { 47 | if (!this->isenabled) { 48 | return; 49 | } 50 | 51 | this->ison = on; 52 | updateNavigationState(); 53 | } 54 | 55 | 56 | void InteractionMode::updateNavigationState() 57 | { 58 | bool interactive = (this->ison != this->altkeydown); 59 | if (interactive == this->isinteractive) 60 | { 61 | return; 62 | } 63 | 64 | SoEventManager *eventmanager = this->quarterwidget->getSoEventManager(); 65 | if (interactive) 66 | { 67 | this->prevnavstate = eventmanager->getNavigationState(); 68 | this->prevcursor = this->quarterwidget->cursor(); 69 | this->quarterwidget->setCursor( 70 | this->quarterwidget->stateCursor("interact")); 71 | eventmanager->setNavigationState(SoEventManager::NO_NAVIGATION); 72 | } 73 | else 74 | { 75 | this->quarterwidget->setCursor(this->prevcursor); 76 | eventmanager->setNavigationState(this->prevnavstate); 77 | } 78 | 79 | this->isinteractive = interactive; 80 | } 81 | 82 | 83 | bool InteractionMode::on(void) const 84 | { 85 | return this->ison; 86 | } 87 | 88 | bool 89 | InteractionMode::eventFilter(QObject * obj, QEvent * event) 90 | { 91 | if (!this->isenabled) { 92 | return false; 93 | } 94 | 95 | assert(obj == this->quarterwidget); 96 | 97 | switch (event->type()) { 98 | case QEvent::KeyPress: 99 | return this->keyPressEvent(dynamic_cast(event)); 100 | case QEvent::KeyRelease: 101 | return this->keyReleaseEvent(dynamic_cast(event)); 102 | case QEvent::FocusOut: 103 | return this->focusOutEvent(dynamic_cast(event)); 104 | default: 105 | return QObject::eventFilter(obj, event); 106 | } 107 | } 108 | 109 | /* 110 | when alt is pressed, override navigation and allow scenegraph to 111 | process events so draggers and manipulators works 112 | */ 113 | bool 114 | InteractionMode::keyPressEvent(QKeyEvent * event) 115 | { 116 | if (!event || 117 | !(event->key() == Qt::Key_Alt) || 118 | !(event->modifiers() & Qt::AltModifier)) { 119 | return false; 120 | } 121 | 122 | this->altkeydown = true; 123 | updateNavigationState(); 124 | return true; 125 | } 126 | 127 | bool 128 | InteractionMode::keyReleaseEvent(QKeyEvent * event) 129 | { 130 | if (!event || !(event->key() == Qt::Key_Alt)) { 131 | return false; 132 | } 133 | 134 | this->altkeydown = false; 135 | updateNavigationState(); 136 | return true; 137 | } 138 | 139 | /* 140 | if we lose focus while alt is down, send an alt-release event 141 | */ 142 | bool 143 | InteractionMode::focusOutEvent(QFocusEvent * event) 144 | { 145 | if (this->altkeydown) { 146 | QKeyEvent keyevent(QEvent::KeyRelease, Qt::Key_Alt, Qt::NoModifier); 147 | return QCoreApplication::sendEvent(this->quarterwidget, &keyevent); 148 | } 149 | return false; 150 | } 151 | -------------------------------------------------------------------------------- /src/Quarter/InteractionMode.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_INTERACTIONMODE_H 2 | #define QUARTER_INTERACTIONMODE_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | class QEvent; 42 | class SoEvent; 43 | class QKeyEvent; 44 | class QFocusEvent; 45 | 46 | namespace SIM { namespace Coin3D { namespace Quarter { 47 | 48 | class QuarterWidget; 49 | 50 | class QUARTER_DLL_API InteractionMode : public QObject { 51 | Q_OBJECT 52 | public: 53 | InteractionMode(QuarterWidget * quarterwidget); 54 | virtual ~InteractionMode(); 55 | 56 | void setEnabled(bool yes); 57 | bool enabled(void) const; 58 | 59 | void setOn(bool on); 60 | bool on(void) const; 61 | 62 | protected: 63 | virtual bool eventFilter(QObject *, QEvent * event); 64 | 65 | private: 66 | bool keyPressEvent(QKeyEvent * event); 67 | bool keyReleaseEvent(QKeyEvent * event); 68 | bool focusOutEvent(QFocusEvent * event); 69 | void updateNavigationState(); 70 | 71 | QCursor prevcursor; 72 | QuarterWidget * quarterwidget; 73 | bool altkeydown; 74 | SoEventManager::NavigationState prevnavstate; 75 | bool isenabled; 76 | bool ison; 77 | bool isinteractive; 78 | }; 79 | 80 | }}} // namespace 81 | 82 | #endif // QUARTER_INTERACTIONMODE_H 83 | -------------------------------------------------------------------------------- /src/Quarter/Keyboard.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class SIM::Coin3D::Quarter::Keyboard Keyboard.h Quarter/devices/Keyboard.h 35 | 36 | \brief The Keyboard class provides translation of keyboard events on 37 | the QuarterWidget. 38 | */ 39 | 40 | 41 | #include 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include "KeyboardP.h" 49 | 50 | using namespace SIM::Coin3D::Quarter; 51 | 52 | #define PRIVATE(obj) obj->pimpl 53 | 54 | Keyboard::Keyboard(QuarterWidget* quart) : 55 | InputDevice(quart) 56 | { 57 | PRIVATE(this) = new KeyboardP(this); 58 | } 59 | 60 | Keyboard::~Keyboard() 61 | { 62 | delete PRIVATE(this); 63 | } 64 | 65 | /*! Translates from QKeyEvents to SoKeyboardEvents 66 | */ 67 | const SoEvent * 68 | Keyboard::translateEvent(QEvent * event) 69 | { 70 | switch (event->type()) { 71 | case QEvent::KeyPress: 72 | case QEvent::KeyRelease: 73 | return PRIVATE(this)->keyEvent((QKeyEvent *) event); 74 | default: 75 | return NULL; 76 | } 77 | } 78 | 79 | #undef PRIVATE 80 | -------------------------------------------------------------------------------- /src/Quarter/KeyboardP.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_KEYBOARDHANDLERP_H 2 | #define QUARTER_KEYBOARDHANDLERP_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | class SoEvent; 40 | template class QMap; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class Keyboard; 45 | 46 | class KeyboardP { 47 | public: 48 | KeyboardP(Keyboard * publ); 49 | ~KeyboardP(); 50 | 51 | const SoEvent * keyEvent(QKeyEvent * event); 52 | void initKeyMap(void); 53 | static bool debugKeyEvents(void); 54 | 55 | typedef QMap KeyMap; 56 | static KeyMap * keyboardmap; 57 | static KeyMap * keypadmap; 58 | 59 | SoKeyboardEvent * keyboard; 60 | Keyboard * publ; 61 | }; 62 | 63 | }}} // namespace 64 | 65 | #endif // QUARTER_KEYBOARDHANDLERP_H 66 | -------------------------------------------------------------------------------- /src/Quarter/NativeEvent.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | 34 | #include "NativeEvent.h" 35 | 36 | using namespace SIM::Coin3D::Quarter; 37 | 38 | #ifdef HAVE_SPACENAV_LIB 39 | NativeEvent::NativeEvent(XEvent * nativeevent) 40 | : QEvent(QEvent::User) 41 | { 42 | this->rawevent = nativeevent; 43 | } 44 | 45 | 46 | XEvent * 47 | NativeEvent::getEvent() const 48 | { 49 | return static_cast(this->rawevent); 50 | } 51 | 52 | #else // !HAVE_SPACENAV_LIB 53 | 54 | // Dummy constructor when Spacenav is not available. 55 | NativeEvent::NativeEvent() 56 | : QEvent(QEvent::User) 57 | { 58 | this->rawevent = NULL; 59 | } 60 | 61 | #endif // !HAVE_SPACENAV_LIB 62 | 63 | 64 | NativeEvent::~NativeEvent() 65 | { 66 | #ifdef HAVE_SPACENAV_LIB 67 | delete (XEvent *) this->rawevent; 68 | #endif // HAVE_SPACENAV_LIB 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/Quarter/NativeEvent.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_NATIVEEVENT_H 2 | #define QUARTER_NATIVEEVENT_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | #ifdef HAVE_SPACENAV_LIB 40 | #include 41 | #endif 42 | 43 | namespace SIM { namespace Coin3D { namespace Quarter { 44 | 45 | class NativeEvent : public QEvent { 46 | public: 47 | #ifdef HAVE_SPACENAV_LIB 48 | NativeEvent(XEvent * nativeevent); 49 | XEvent * getEvent() const; 50 | #else // !HAVE_SPACENAV_LIB 51 | NativeEvent(); 52 | #endif // !HAVE_SPACENAV_LIB 53 | 54 | virtual ~NativeEvent(); 55 | 56 | private: 57 | void * rawevent; 58 | }; 59 | 60 | }}} 61 | 62 | #endif // !QUARTER_NATIVEEVENT_H 63 | -------------------------------------------------------------------------------- /src/Quarter/QtCoinCompatibility.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace SIM::Coin3D::Quarter; 7 | 8 | void 9 | QtCoinCompatibility::QImageToSbImage(const QImage & image, SbImage & sbimage) 10 | { 11 | int w = image.width(); 12 | int h = image.height(); 13 | int c; 14 | 15 | // Keep in 8-bits mode if that was what we read 16 | if (image.depth() == 8 && image.isGrayscale()) { 17 | c = 1; 18 | } 19 | else { 20 | // FIXME: consider if we should detect allGrayscale() and alpha (c = 2) 21 | c = image.hasAlphaChannel() ? 4 : 3; 22 | } 23 | 24 | SbVec2s size((short) w, (short) h); 25 | sbimage.setValue(size, c, NULL); 26 | unsigned char * buffer = sbimage.getValue(size, c); 27 | 28 | if (c == 1) { 29 | for (int i = 0; i < h; i++) { 30 | memcpy(buffer + i*w, image.scanLine(h-(i+1)), w); 31 | } 32 | } 33 | else { // (c == 3 || c == 4) 34 | QRgb * bits = (QRgb*) image.bits(); 35 | for (int y = 0; y < h; y++) { 36 | unsigned char * line = &buffer[c*w*(h-(y+1))]; 37 | for (int x = 0; x < w; x++) { 38 | *line++ = qRed(*bits); 39 | *line++ = qGreen(*bits); 40 | *line++ = qBlue(*bits); 41 | if (c == 4) { 42 | *line++ = qAlpha(*bits); 43 | } 44 | bits++; 45 | } 46 | } 47 | } 48 | } 49 | 50 | void 51 | QtCoinCompatibility::SbImageToQImage(const SbImage & sbimage, QImage & img) 52 | { 53 | SbVec2s ivsize; 54 | int nc; 55 | const unsigned char* src = sbimage.getValue (ivsize, nc); 56 | QSize size(ivsize[0],ivsize[1]); 57 | assert(src && "Empty image"); 58 | if (nc!=3&&nc!=1&&nc!=4) { 59 | SoDebugError::postWarning("QtCoinCompatibility::SbImageToQImage", 60 | "Implementation not tested for 3 colors or more" 61 | ); 62 | } 63 | QImage::Format format; 64 | if (nc==3||nc==4) { 65 | format=QImage::Format_RGB32; 66 | } 67 | else if (nc==1) { 68 | QVector clut; 69 | for (int i=0;i<256;++i) { 70 | clut.append(qRgb(i,i,i)); 71 | } 72 | format=QImage::Format_Indexed8; 73 | } 74 | img = QImage(size,format); 75 | assert(img.size()==size); 76 | if (nc==1) { 77 | QVector clut; 78 | for (int i=0;i<256;++i) { 79 | clut.append(qRgb(i,i,i)); 80 | } 81 | img.setColorTable(clut); 82 | } 83 | 84 | for (int y = 0; y < size.height(); ++y) { 85 | QRgb * bits = reinterpret_cast(img.scanLine(size.height() - (y+1))); 86 | for (int x = 0; x < size.width(); ++x) { 87 | switch (nc) { 88 | default: 89 | case 1: 90 | { 91 | img.setPixel(x,size.height()-(y+1),*src++); 92 | } 93 | break; 94 | case 2: 95 | { 96 | unsigned char red=*src++; 97 | unsigned char alpha=*src++; 98 | *bits=qRgba(red,red,red,alpha); 99 | } 100 | break; 101 | case 3: 102 | { 103 | unsigned char red=*src++; 104 | unsigned char green=*src++; 105 | unsigned char blue=*src++; 106 | *bits=qRgb(red,green,blue); 107 | } 108 | break; 109 | case 4: 110 | { 111 | unsigned char red=*src++; 112 | unsigned char green=*src++; 113 | unsigned char blue=*src++; 114 | unsigned char alpha=*src++; 115 | *bits=qRgba(red,green,blue,alpha); 116 | } 117 | break; 118 | } 119 | ++bits; 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/Quarter/Quarter.rc.cmake.in: -------------------------------------------------------------------------------- 1 | 1 TYPELIB "@PROJECT_NAME@.rc" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 5 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 6 | FILEFLAGSMASK 0x3fL 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x4L 13 | FILETYPE 0x2L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904e4" 19 | BEGIN 20 | VALUE "CompanyName", "Kongsberg Oil & Gas Technologies AS" 21 | VALUE "FileDescription", "A Qt Gui-toolkit binding for Coin3D, 3D graphics rendering library - www.github.com/coin3d" 22 | VALUE "FileVersion","@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, @QUARTER_BETA_VERSION@" 23 | VALUE "InternalName", "@PROJECT_NAME@" 24 | VALUE "LegalCopyright", "Copyright (c) @QUARTER_BUILD_YEAR@ Kongsberg Oil & Gas Technologies AS" 25 | #ifdef _DEBUG 26 | VALUE "OriginalFilename", "@PROJECT_NAME@@PROJECT_VERSION_MAJOR@d.dll" 27 | #else 28 | VALUE "OriginalFilename", "@PROJECT_NAME@@PROJECT_VERSION_MAJOR@.dll" 29 | #endif 30 | VALUE "ProductName", "Coin3D" 31 | VALUE "ProductVersion","@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, @QUARTER_BETA_VERSION@" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x409, 1252 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /src/Quarter/QuarterP.cpp: -------------------------------------------------------------------------------- 1 | #include "QuarterP.h" 2 | #include "SensorManager.h" 3 | #include "ImageReader.h" 4 | #include "KeyboardP.h" 5 | 6 | using namespace SIM::Coin3D::Quarter; 7 | QuarterP::StateCursorMap * QuarterP::statecursormap = NULL; 8 | 9 | QuarterP::QuarterP(void) 10 | { 11 | this->sensormanager = new SensorManager; 12 | this->imagereader = new ImageReader; 13 | assert(QuarterP::statecursormap == NULL); 14 | QuarterP::statecursormap = new StateCursorMap; 15 | 16 | } 17 | 18 | QuarterP::~QuarterP() 19 | { 20 | delete this->imagereader; 21 | delete this->sensormanager; 22 | 23 | assert(QuarterP::statecursormap != NULL); 24 | delete QuarterP::statecursormap; 25 | 26 | // FIXME: Why not use an atexit mechanism for this? 27 | if (KeyboardP::keyboardmap != NULL) { 28 | KeyboardP::keyboardmap->clear(); 29 | KeyboardP::keypadmap->clear(); 30 | delete KeyboardP::keyboardmap; 31 | delete KeyboardP::keypadmap; 32 | KeyboardP::keyboardmap = NULL; 33 | KeyboardP::keypadmap = NULL; 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/Quarter/QuarterP.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_QUARTERP_H 2 | #define QUARTER_QUARTERP_H 3 | #include 4 | #include 5 | #include 6 | 7 | template class QMap; 8 | 9 | namespace SIM { namespace Coin3D { namespace Quarter { 10 | 11 | class QuarterP { 12 | public: 13 | QuarterP(); 14 | ~QuarterP(); 15 | 16 | class SensorManager * sensormanager; 17 | class ImageReader * imagereader; 18 | 19 | typedef QMap StateCursorMap; 20 | static StateCursorMap * statecursormap; 21 | 22 | bool initCoin; 23 | }; 24 | 25 | }}}; 26 | 27 | #define COIN_CT_ASSERT(expr) \ 28 | do { switch ( 0 ) { case 0: case (expr): break; } } while ( 0 ) 29 | 30 | #define COMPILE_ONLY_BEFORE(MAJOR,MINOR,MICRO,REASON) \ 31 | COIN_CT_ASSERT( (QUARTER_MAJOR_VERSION < MAJOR) || (QUARTER_MAJOR_VERSION == MAJOR && ((QUARTER_MINOR_VERSION < MINOR) || ( QUARTER_MINOR_VERSION == MINOR && (QUARTER_MICRO_VERSION < MICRO ))))) 32 | 33 | #endif //QUARTER_QUARTERP_H 34 | -------------------------------------------------------------------------------- /src/Quarter/SensorManager.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_SENSORMANAGER_H 2 | #define QUARTER_SENSORMANAGER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | 38 | class QTimer; 39 | 40 | namespace SIM { namespace Coin3D { namespace Quarter { 41 | 42 | class SignalThread; 43 | 44 | class SensorManager : public QObject { 45 | Q_OBJECT 46 | typedef QObject inherited; 47 | public: 48 | SensorManager(void); 49 | ~SensorManager(); 50 | 51 | public slots: 52 | void idleTimeout(void); 53 | void delayTimeout(void); 54 | void timerQueueTimeout(void); 55 | void sensorQueueChanged(void); 56 | void setTimerEpsilon(double sec); 57 | 58 | private: 59 | static void sensorQueueChangedCB(void * closure); 60 | QTimer * idletimer; 61 | QTimer * delaytimer; 62 | QTimer * timerqueuetimer; 63 | unsigned long mainthreadid; 64 | SignalThread * signalthread; 65 | double timerEpsilon; 66 | }; 67 | 68 | }}} // namespace 69 | 70 | #endif // QUARTER_SENSORMANAGER_H 71 | -------------------------------------------------------------------------------- /src/Quarter/SignalThread.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "SignalThread.h" 34 | 35 | using namespace SIM::Coin3D::Quarter; 36 | 37 | SignalThread::SignalThread(void) 38 | : isstopped(false) 39 | { 40 | } 41 | 42 | SignalThread::~SignalThread() 43 | { 44 | } 45 | 46 | void 47 | SignalThread::trigger(void) 48 | { 49 | // lock first to make sure the QThread is actually waiting for a signal 50 | this->mutex.lock(); 51 | this->waitcond.wakeOne(); 52 | this->mutex.unlock(); 53 | } 54 | 55 | void 56 | SignalThread::stopThread(void) 57 | { 58 | this->mutex.lock(); 59 | this->isstopped = true; 60 | this->waitcond.wakeOne(); 61 | this->mutex.unlock(); 62 | } 63 | 64 | 65 | void 66 | SignalThread::run(void) 67 | { 68 | this->mutex.lock(); 69 | while (!this->isstopped) { 70 | // just wait, and trigger every time we receive a signal 71 | this->waitcond.wait(&this->mutex); 72 | if (!this->isstopped) { 73 | emit triggerSignal(); 74 | } 75 | } 76 | this->mutex.unlock(); 77 | } 78 | -------------------------------------------------------------------------------- /src/Quarter/SignalThread.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_SIGNALTHREAD_H 2 | #define QUARTER_SIGNALTHREAD_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | class SoQtP; 41 | 42 | namespace SIM { namespace Coin3D { namespace Quarter { 43 | 44 | class SignalThread : public QThread { 45 | Q_OBJECT 46 | public: 47 | SignalThread(void); 48 | virtual ~SignalThread(); 49 | 50 | virtual void run(void); 51 | void trigger(void); 52 | void stopThread(void); 53 | 54 | signals: 55 | 56 | void triggerSignal(void); 57 | 58 | private: 59 | QWaitCondition waitcond; 60 | QMutex mutex; 61 | bool isstopped; 62 | }; 63 | 64 | }}} // namespace 65 | 66 | #endif // QUARTER_SIGNALTHREAD_H 67 | -------------------------------------------------------------------------------- /src/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | set(CMAKE_AUTOUIC ON) 3 | set(CMAKE_AUTORCC ON) 4 | 5 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 6 | 7 | # Minimal example 8 | add_executable(Example minimal.cpp) 9 | target_link_libraries(Example PUBLIC Quarter) 10 | 11 | # Dynamic UI Loader example 12 | add_executable(DynamicUILoaderExample dynamicui.cpp quarterviewer.qrc) 13 | target_link_libraries(DynamicUILoaderExample PUBLIC Quarter) 14 | 15 | # Direct UI loader example 16 | add_executable(DirectUILoaderExample directui.cpp QuarterViewer.ui) 17 | target_link_libraries(DirectUILoaderExample PUBLIC Quarter) 18 | 19 | # Examiner example 20 | add_executable(ExaminerExample examiner.cpp quarterviewer.qrc) 21 | target_link_libraries(ExaminerExample PUBLIC Quarter) 22 | 23 | # Inherit UI example 24 | add_executable(InheritUIExample inheritui.cpp 25 | QuarterViewer.cpp 26 | QuarterViewer.h 27 | QuarterViewer.ui 28 | ) 29 | target_link_libraries(InheritUIExample PUBLIC Quarter) 30 | 31 | # Multiple document interface example 32 | add_executable(MDIExample mdi.cpp 33 | MdiMainWindow.cpp 34 | MdiMainWindow.h 35 | MdiQuarterWidget.cpp 36 | MdiQuarterWidget.h 37 | ) 38 | target_link_libraries(MDIExample PUBLIC Quarter) 39 | 40 | # Superimposition example 41 | add_executable(SuperImpositionExample superimposition.cpp) 42 | target_link_libraries(SuperImpositionExample PUBLIC Quarter) 43 | -------------------------------------------------------------------------------- /src/examples/MdiMainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_MDI_MAINWINDOW_H 2 | #define QUARTER_MDI_MAINWINDOW_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | 37 | #include 38 | 39 | class QString; 40 | #if QT_VERSION >= 0x060000 41 | #define QUARTER_GL_WIDGET QOpenGLWidget 42 | #else 43 | #define QUARTER_GL_WIDGET QGLWidget 44 | #endif 45 | class QUARTER_GL_WIDGET; 46 | class QMdiArea; 47 | class QDropEvent; 48 | class QCloseEvent; 49 | class MdiQuarterWidget; 50 | 51 | class MdiMainWindow : public QMainWindow { 52 | typedef QMainWindow inherited; 53 | Q_OBJECT 54 | 55 | public: 56 | MdiMainWindow(void); 57 | ~MdiMainWindow(); 58 | 59 | protected: 60 | virtual void closeEvent(QCloseEvent * event); 61 | virtual void dragEnterEvent(QDragEnterEvent * event); 62 | virtual void dropEvent(QDropEvent * event); 63 | 64 | private slots: 65 | void open(void); 66 | void open(const QString & filename); 67 | 68 | private: 69 | MdiQuarterWidget * activeMdiChild(void); 70 | MdiQuarterWidget * createMdiChild(void); 71 | MdiQuarterWidget * findMdiChild(const QString & filename); 72 | 73 | QMdiArea * mdiarea; 74 | QUARTER_GL_WIDGET * firstwidget; // for context sharing 75 | }; 76 | 77 | #endif // QUARTER_MDI_MAINWINDOW_H 78 | -------------------------------------------------------------------------------- /src/examples/MdiQuarterWidget.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "MdiQuarterWidget.h" 34 | 35 | #include 36 | #include 37 | #include 38 | using namespace SIM::Coin3D::Quarter; 39 | 40 | #include 41 | #include 42 | 43 | MdiQuarterWidget::MdiQuarterWidget(QWidget * parent, const QUARTER_GL_WIDGET * sharewidget) 44 | : inherited(parent) 45 | { 46 | this->quarterwidget = new QuarterWidget(this, sharewidget); 47 | this->quarterwidget->installEventFilter(new DragDropHandler(this->quarterwidget)); 48 | //set default navigation mode file 49 | this->quarterwidget->setNavigationModeFile(); 50 | this->layout()->addWidget(this->quarterwidget); 51 | } 52 | 53 | MdiQuarterWidget::~MdiQuarterWidget() 54 | { 55 | delete this->quarterwidget; 56 | this->quarterwidget = NULL; 57 | } 58 | 59 | const QuarterWidget * 60 | MdiQuarterWidget::quarterWidget(void) const 61 | { 62 | return this->quarterwidget; 63 | } 64 | 65 | bool 66 | MdiQuarterWidget::loadFile(const QString & filename) 67 | { 68 | SoInput in; 69 | if (in.openFile(filename.toLatin1().constData())) { 70 | SoSeparator * root = SoDB::readAll(&in); 71 | if (root) { 72 | this->quarterwidget->setSceneGraph(root); 73 | this->currentfile = filename; 74 | this->setWindowTitle(filename); 75 | return true; 76 | } 77 | } 78 | return false; 79 | } 80 | 81 | const QString & 82 | MdiQuarterWidget::currentFile(void) const 83 | { 84 | return this->currentfile; 85 | } 86 | 87 | QSize 88 | MdiQuarterWidget::minimumSizeHint(void) const 89 | { 90 | return QSize(640, 480); 91 | } 92 | 93 | void 94 | MdiQuarterWidget::closeEvent(QCloseEvent * event) 95 | { 96 | delete this->quarterwidget; 97 | this->quarterwidget = NULL; 98 | } 99 | -------------------------------------------------------------------------------- /src/examples/MdiQuarterWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MDI_QUARTER_WIDGET_H 2 | #define MDI_QUARTER_WIDGET_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | namespace SIM { namespace Coin3D { namespace Quarter { 40 | class QuarterWidget; 41 | }}} 42 | 43 | class QString; 44 | #if QT_VERSION >= 0x060000 45 | #define QUARTER_GL_WIDGET QOpenGLWidget 46 | #else 47 | #define QUARTER_GL_WIDGET QGLWidget 48 | #endif 49 | class QUARTER_GL_WIDGET; 50 | using namespace SIM::Coin3D::Quarter; 51 | 52 | class MdiQuarterWidget : public QMdiSubWindow { 53 | typedef QMdiSubWindow inherited; 54 | public: 55 | MdiQuarterWidget(QWidget * parent = 0, const QUARTER_GL_WIDGET * sharewidget = 0); 56 | ~MdiQuarterWidget(); 57 | 58 | bool loadFile(const QString & filename); 59 | const QString & currentFile(void) const; 60 | const QuarterWidget * quarterWidget(void) const; 61 | 62 | virtual QSize minimumSizeHint(void) const; 63 | 64 | protected: 65 | virtual void closeEvent(QCloseEvent * event); 66 | 67 | private: 68 | QString currentfile; 69 | QuarterWidget * quarterwidget; 70 | }; 71 | 72 | #endif // MDI_QUARTER_WIDGET_H 73 | -------------------------------------------------------------------------------- /src/examples/QuarterViewer.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "QuarterViewer.h" 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | QuarterViewer::QuarterViewer(QWidget * parent) 40 | : QWidget(parent) 41 | { 42 | this->ui.setupUi(this); 43 | 44 | // Make a dead simple scene graph by using the Coin library, only 45 | // containing a single yellow cone under the scenegraph root. 46 | this->root = new SoSeparator; 47 | this->root->ref(); 48 | 49 | SoBaseColor * col = new SoBaseColor; 50 | col->rgb = SbColor(1, 1, 0); 51 | root->addChild(col); 52 | 53 | this->root->addChild(new SoCone); 54 | 55 | // Create a QuarterWidget for displaying a Coin scene graph 56 | ui.QuarterWidget->setSceneGraph(this->root); 57 | } 58 | 59 | QuarterViewer::~QuarterViewer() 60 | { 61 | this->root->unref(); 62 | } 63 | -------------------------------------------------------------------------------- /src/examples/QuarterViewer.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_QUARTERVIEWER_H 2 | #define QUARTER_QUARTERVIEWER_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include "ui_QuarterViewer.h" 37 | 38 | QT_BEGIN_NAMESPACE 39 | 40 | class QuarterViewer : public QWidget { 41 | public: 42 | QuarterViewer(QWidget * parent = 0); 43 | ~QuarterViewer(); 44 | 45 | private: 46 | Ui::QuarterViewer ui; 47 | class SoSeparator * root; 48 | }; 49 | 50 | QT_END_NAMESPACE 51 | 52 | #endif // QUARTER_QUARTERVIEWER_H 53 | -------------------------------------------------------------------------------- /src/examples/QuarterViewer.ui: -------------------------------------------------------------------------------- 1 | 2 | QuarterViewer 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | QuarterViewer 14 | 15 | 16 | 17 | 9 18 | 19 | 20 | 6 21 | 22 | 23 | 24 | 25 | true 26 | 27 | 28 | The QuarterWidget displays Open Inventor scene graphs. 29 | 30 | 31 | 32 | coin:/scxml/navigation/examiner.xml 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | SIM::Coin3D::Quarter::QuarterWidget 42 | QWidget 43 |
Quarter/QuarterWidget.h
44 |
45 |
46 | 47 | 48 |
49 | -------------------------------------------------------------------------------- /src/examples/directui.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \page directui A Direct Approach 35 | 36 | This example demonstrates how to create a simple viewer without 37 | subclassing the class generated from the UI file 38 | 39 | */ 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | #include "ui_QuarterViewer.h" 50 | 51 | using namespace SIM::Coin3D::Quarter; 52 | 53 | int 54 | main(int argc, char ** argv) 55 | { 56 | QApplication app(argc, argv); 57 | // Initializes Quarter (and implicitly also Coin and Qt 58 | Quarter::init(); 59 | 60 | QWidget * viewer = new QWidget; 61 | Ui::QuarterViewer ui; 62 | ui.setupUi(viewer); 63 | 64 | // Make a dead simple scene graph by using the Coin library, only 65 | // containing a single yellow cone under the scenegraph root. 66 | SoSeparator * root = new SoSeparator; 67 | root->ref(); 68 | 69 | SoBaseColor * col = new SoBaseColor; 70 | col->rgb = SbColor(1, 1, 0); 71 | root->addChild(col); 72 | 73 | root->addChild(new SoCone); 74 | 75 | // Create a QuarterWidget for displaying a Coin scene graph 76 | ui.QuarterWidget->setSceneGraph(root); 77 | 78 | // Pop up the QuarterWidget 79 | viewer->show(); 80 | // Loop until exit. 81 | app.exec(); 82 | // Clean up resources. 83 | root->unref(); 84 | delete viewer; 85 | Quarter::clean(); 86 | 87 | return 0; 88 | } 89 | -------------------------------------------------------------------------------- /src/examples/dynamicui.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \page dynamicui Dynamic Loading 35 | 36 | This example demonstrates how to dynamically load a QuarterWidget 37 | from a Qt Designer UI file. 38 | */ 39 | 40 | #include 41 | #include 42 | 43 | #include 44 | #include 45 | #include 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | using namespace SIM::Coin3D::Quarter; 52 | 53 | int main(int argc, char *argv[]) 54 | { 55 | QApplication app(argc, argv); 56 | Quarter::init(); 57 | 58 | QFile file(":/QuarterViewer.ui"); 59 | if (!file.open(QFile::ReadOnly)) { 60 | assert(0 && "could not open ui file"); 61 | } 62 | QUiLoader loader; 63 | QWidget * widget = loader.load(&file); 64 | assert(widget); 65 | file.close(); 66 | 67 | // Get the QuarterWidget 68 | QuarterWidget * viewer = widget->findChild("QuarterWidget"); 69 | assert(viewer && "could not find child QuarterWidget in ui file"); 70 | 71 | // Make a dead simple scene graph by using the Coin library, only 72 | // containing a single yellow cone under the scenegraph root. 73 | SoSeparator * root = new SoSeparator; 74 | root->ref(); 75 | 76 | SoBaseColor * col = new SoBaseColor; 77 | col->rgb = SbColor(1, 1, 0); 78 | root->addChild(col); 79 | 80 | root->addChild(new SoCone); 81 | viewer->setSceneGraph(root); 82 | 83 | // Pop up the QuarterWidget 84 | widget->show(); 85 | // Loop until exit. 86 | app.exec(); 87 | // Clean up resources. 88 | root->unref(); 89 | delete widget; 90 | Quarter::clean(); 91 | 92 | return 0; 93 | } 94 | -------------------------------------------------------------------------------- /src/examples/examiner.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \page examiner Examiner type Viewer 35 | 36 | This example demonstrates how to create a simple viewer that can load 37 | Inventor files 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | using namespace SIM::Coin3D::Quarter; 53 | 54 | int main(int argc, char *argv[]) 55 | { 56 | QApplication app(argc, argv); 57 | Quarter::init(); 58 | 59 | QFile file(":/QuarterViewer.ui"); 60 | if (!file.open(QFile::ReadOnly)) { 61 | assert(0 && "could not open ui file"); 62 | } 63 | QUiLoader loader; 64 | QWidget * widget = loader.load(&file); 65 | assert(widget); 66 | file.close(); 67 | 68 | // Get the QuarterWidget 69 | QuarterWidget * viewer = widget->findChild("QuarterWidget"); 70 | assert(viewer && "could not find child QuarterWidget in ui file"); 71 | 72 | // make viewer support drag and drop of Inventor files 73 | viewer->installEventFilter(new DragDropHandler(viewer)); 74 | 75 | // Make a dead simple scene graph by using the Coin library, only 76 | // containing a single yellow cone under the scenegraph root. 77 | SoSeparator * root = NULL; 78 | 79 | if (argc < 2) { 80 | root = new SoSeparator; 81 | root->addChild(new SoCone); 82 | } else { 83 | // Open the argument file.. 84 | SoInput in; 85 | SbBool ok = in.openFile(argv[1]); 86 | if (!ok) { 87 | qWarning("could not open file %s\n", argv[1]); 88 | exit(1); 89 | } 90 | 91 | // ..and import it. 92 | root = SoDB::readAll(&in); 93 | } 94 | 95 | if (root == NULL) { 96 | qWarning("could not read file %s\n", argv[1]); 97 | exit(1); 98 | } 99 | 100 | root->ref(); 101 | 102 | viewer->setSceneGraph(root); 103 | 104 | // Pop up the QuarterWidget 105 | widget->show(); 106 | // Loop until exit. 107 | app.exec(); 108 | // Clean up resources. 109 | root->unref(); 110 | delete widget; 111 | Quarter::clean(); 112 | 113 | return 0; 114 | } 115 | -------------------------------------------------------------------------------- /src/examples/inheritui.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \page inheritui Single Inheritance 35 | 36 | This example demonstrates how to create a simple viewer by 37 | subclassing a generated class from an UI file 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | #include "QuarterViewer.h" 45 | 46 | using namespace SIM::Coin3D::Quarter; 47 | 48 | int 49 | main(int argc, char ** argv) 50 | { 51 | QApplication app(argc, argv); 52 | // Initializes Quarter (and implicitly also Coin and Qt 53 | Quarter::init(); 54 | 55 | QuarterViewer * viewer = new QuarterViewer; 56 | // Pop up the viewer 57 | viewer->show(); 58 | // Loop until exit. 59 | app.exec(); 60 | // Clean up resources. 61 | delete viewer; 62 | Quarter::clean(); 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /src/examples/mdi.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \page mdi Multiple Document Interface 35 | 36 | This example shows how to implement a simple Multiple Document 37 | Interface using Qt's QWorkspace class and Quarter's QuarterWidget. 38 | */ 39 | 40 | #include "MdiMainWindow.h" 41 | #include 42 | 43 | int main(int argc, char *argv[]) 44 | { 45 | QApplication app(argc, argv); 46 | MdiMainWindow mainwin; 47 | mainwin.show(); 48 | return app.exec(); 49 | } 50 | -------------------------------------------------------------------------------- /src/examples/minimal.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 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 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | This example shows a minimal stand-alone 35 | example of a QuarterViewer without the use of UI files 36 | */ 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | #include 46 | #include 47 | 48 | using namespace SIM::Coin3D::Quarter; 49 | 50 | int 51 | main(int argc, char ** argv) 52 | { 53 | QApplication app(argc, argv); 54 | // Initializes Quarter (and implicitly also Coin and Qt 55 | Quarter::init(); 56 | 57 | // Make a dead simple scene graph by using the Coin library, only 58 | // containing a single yellow cone under the scenegraph root. 59 | SoSeparator * root = new SoSeparator; 60 | root->ref(); 61 | 62 | SoBaseColor * col = new SoBaseColor; 63 | col->rgb = SbColor(1, 1, 0); 64 | root->addChild(col); 65 | 66 | root->addChild(new SoCone); 67 | 68 | QMainWindow * mainwin = new QMainWindow(); 69 | 70 | // Create a QuarterWidget for displaying a Coin scene graph 71 | QuarterWidget * viewer = new QuarterWidget(mainwin); 72 | //set default navigation mode file 73 | viewer->setNavigationModeFile(); 74 | mainwin->setCentralWidget(viewer); 75 | viewer->setSceneGraph(root); 76 | 77 | // Pop up the QuarterWidget 78 | mainwin->show(); 79 | // Loop until exit. 80 | app.exec(); 81 | // Clean up resources. 82 | root->unref(); 83 | delete viewer; 84 | 85 | Quarter::clean(); 86 | 87 | return 0; 88 | } 89 | -------------------------------------------------------------------------------- /src/examples/quarterviewer.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | QuarterViewer.ui 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | set(CMAKE_AUTOUIC ON) 3 | set(CMAKE_AUTORCC ON) 4 | 5 | # If this directory is not explicitly included build fails with message "error: Undefined interface" 6 | if(Qt6_FOUND) 7 | include_directories(${Qt6Designer_INCLUDE_DIRS}) 8 | elseif(Qt5_FOUND) 9 | include_directories(${Qt5Designer_INCLUDE_DIRS}) 10 | else() 11 | include_directories(${QtDesigner_INCLUDE_DIRS}) 12 | endif() 13 | 14 | # ############################################################################ 15 | # Create the QtDesigner plugin 16 | # ############################################################################ 17 | 18 | add_library(QuarterWidgetPlugin SHARED QuarterWidgetPlugin.cpp QuarterWidgetPlugin.h QuarterWidgetPlugin.qrc coinlogo.qrc) 19 | if(WIN32) 20 | configure_file(QuarterWidgetPlugin.rc.cmake.in QuarterWidgetPlugin.rc) 21 | target_sources(QuarterWidgetPlugin PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/QuarterWidgetPlugin.rc") 22 | endif() 23 | target_link_libraries(QuarterWidgetPlugin PUBLIC Quarter ${QUARTER_PLUGIN_QT_TARGETS}) 24 | 25 | set_target_properties(QuarterWidgetPlugin PROPERTIES VERSION ${QUARTER_VERSION} SOVERSION ${QUARTER_SO_VERSION}) 26 | 27 | # ############################################################################ 28 | # Install the QtDesigner plugin 29 | # ############################################################################ 30 | 31 | if(QT_PLUGINS_DIR) 32 | # Legacy FindQt4. 33 | install(TARGETS QuarterWidgetPlugin 34 | RUNTIME DESTINATION "${QT_PLUGINS_DIR}/designer" 35 | LIBRARY DESTINATION "${QT_PLUGINS_DIR}/designer" 36 | ) 37 | else() 38 | if(Qt6_FOUND) 39 | # Get qmake location. 40 | get_target_property(QT_QMAKE_EXECUTABLE Qt6::qmake LOCATION) 41 | else() 42 | # Get qmake location. 43 | get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake LOCATION) 44 | endif() 45 | # Call qmake to query the installation prefix. 46 | execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PREFIX 47 | OUTPUT_VARIABLE QT_INSTALL_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE 48 | ) 49 | # Call qmake to query the plugin installation directory. 50 | execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS 51 | OUTPUT_VARIABLE QT_INSTALL_PLUGINS OUTPUT_STRIP_TRAILING_WHITESPACE 52 | ) 53 | # Compute relative plugin installation directory. 54 | file(RELATIVE_PATH CMAKE_INSTALL_QTPLUGINSDIR_DEFAULT 55 | "${QT_INSTALL_PREFIX}" "${QT_INSTALL_PLUGINS}" 56 | ) 57 | # Set cache variable like in GNUInstallDirs module 58 | set(CMAKE_INSTALL_QTPLUGINSDIR "${CMAKE_INSTALL_QTPLUGINSDIR_DEFAULT}" 59 | CACHE PATH "Qt plugins (${CMAKE_INSTALL_QTPLUGINSDIR_DEFAULT})" 60 | ) 61 | install(TARGETS QuarterWidgetPlugin 62 | RUNTIME DESTINATION "${CMAKE_INSTALL_QTPLUGINSDIR}/designer" COMPONENT development 63 | LIBRARY DESTINATION "${CMAKE_INSTALL_QTPLUGINSDIR}/designer" COMPONENT development 64 | ) 65 | endif() 66 | -------------------------------------------------------------------------------- /src/plugins/QuarterWidgetPlugin.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_QUARTERWIDGETPLUGIN_H 2 | #define QUARTER_QUARTERWIDGETPLUGIN_H 3 | 4 | /**************************************************************************\ 5 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from 21 | * this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | \**************************************************************************/ 35 | 36 | #include 37 | 38 | #if QT_VERSION >= 0x050000 39 | # include 40 | #else 41 | # include 42 | #endif 43 | 44 | namespace SIM { namespace Coin3D { namespace Quarter { namespace QtDesigner { 45 | 46 | class QuarterWidgetPlugin : public QObject, 47 | public QDesignerCustomWidgetInterface { 48 | Q_OBJECT 49 | #if QT_VERSION >= 0x050000 50 | Q_PLUGIN_METADATA(IID "org.coin3d.Qt.QDesignerCustomWidgetInterface") 51 | #endif 52 | Q_INTERFACES(QDesignerCustomWidgetInterface) 53 | 54 | public: 55 | QuarterWidgetPlugin(QObject * parent = 0); 56 | ~QuarterWidgetPlugin(); 57 | 58 | bool isContainer(void) const; 59 | bool isInitialized(void) const; 60 | QIcon icon(void) const; 61 | QString domXml(void) const; 62 | QString group(void) const; 63 | QString includeFile(void) const; 64 | QString name(void) const; 65 | QString toolTip(void) const; 66 | QString whatsThis(void) const; 67 | QWidget * createWidget(QWidget * parent); 68 | void initialize(QDesignerFormEditorInterface * core); 69 | 70 | private slots: 71 | void widgetDestroyed(QObject * obj); 72 | 73 | private: 74 | class QuarterWidgetPluginP * pimpl; 75 | }; 76 | 77 | }}}} // namespace 78 | 79 | #endif // QUARTER_QUARTERWIDGETPLUGIN_H 80 | -------------------------------------------------------------------------------- /src/plugins/QuarterWidgetPlugin.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | coinlogo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/plugins/QuarterWidgetPlugin.rc.cmake.in: -------------------------------------------------------------------------------- 1 | 1 TYPELIB "QuarterWidgetPlugin.rc" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 5 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 6 | FILEFLAGSMASK 0x3fL 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x4L 13 | FILETYPE 0x2L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904e4" 19 | BEGIN 20 | VALUE "CompanyName", "Kongsberg Oil & Gas Technologies AS" 21 | VALUE "FileDescription", "A QtDesigner Plugin for Quarter Gui-toolkit binding for Coin3D, 3D graphics rendering library - www.github.com/coin3d" 22 | VALUE "FileVersion","@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, @QUARTER_BETA_VERSION@" 23 | VALUE "InternalName", "QuarterWidgetPlugin" 24 | VALUE "LegalCopyright", "Copyright (c) @QUARTER_BUILD_YEAR@ Kongsberg Oil & Gas Technologies AS" 25 | #ifdef _DEBUG 26 | VALUE "OriginalFilename", "QuarterWidgetPlugin@PROJECT_VERSION_MAJOR@d.dll" 27 | #else 28 | VALUE "OriginalFilename", "QuarterWidgetPlugin@PROJECT_VERSION_MAJOR@.dll" 29 | #endif 30 | VALUE "ProductName", "Coin3D" 31 | VALUE "ProductVersion","@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, @QUARTER_BETA_VERSION@" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x409, 1252 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /src/plugins/coinlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/quarter/5dbe99671f4f1f9100fbb5372b2f462bb920a398/src/plugins/coinlogo.png -------------------------------------------------------------------------------- /src/plugins/coinlogo.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | coinlogo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/unit-tests/events/EventTranslation.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARTER_EVENTTRANSLATION_H 2 | #define QUARTER_EVENTTRANSLATION_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | using namespace SIM::Coin3D::Quarter; 11 | 12 | class EventTranslation : public QObject { 13 | Q_OBJECT 14 | 15 | private slots: 16 | void initTestCase(void); 17 | void cleanupTestCase(void); 18 | void translateKeyboardEvents_data(void); 19 | void translateKeyboardEvents(void); 20 | void translateKeypadEvents_data(void); 21 | void translateKeypadEvents(void); 22 | 23 | private: 24 | class QuarterWidget * quarterwidget; 25 | }; 26 | 27 | #endif // QUARTER_EVENTTRANSLATION_Hx 28 | -------------------------------------------------------------------------------- /src/unit-tests/events/events.cpp: -------------------------------------------------------------------------------- 1 | #include "EventTranslation.h" 2 | QTEST_MAIN(EventTranslation); 3 | -------------------------------------------------------------------------------- /src/unit-tests/events/events.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | CONFIG += qtestlib debug 4 | QT += opengl 5 | 6 | DEPENDPATH += . 7 | 8 | INCLUDEPATH += $(COINDIR)/include $(QUARTERDIR)/include 9 | #LIBS += -L$(COINDIR)/lib -lCoin 10 | LIBS += -framework Inventor 11 | LIBS += -L$(QUARTERDIR)/lib -lQuarter 12 | #LIBS += -framework Quarter 13 | 14 | 15 | # Input 16 | HEADERS += EventTranslation.h 17 | SOURCES += events.cpp \ 18 | EventTranslation.cpp 19 | 20 | --------------------------------------------------------------------------------