diff --git a/.github/actions/build-sample-csharp/action.yml b/.github/actions/build-sample-csharp/action.yml deleted file mode 100644 index 1f02efb0ad..0000000000 --- a/.github/actions/build-sample-csharp/action.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: 'Build CSharp Sample' -description: 'Build CSharp sample using OCCT installation' - -inputs: - platform: - description: 'Build platform (windows)' - required: true - install-artifact-name: - description: 'OCCT installation artifact name' - required: true - -runs: - using: "composite" - steps: - - name: Download OCCT installation - uses: ./.github/actions/download-artifacts - with: - name: ${{ inputs.install-artifact-name }} - path: occt-install - - - name: Build CSharp Sample - if: inputs.platform == 'windows' - shell: cmd - run: | - REM Setup environment - call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64 - set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%" - - cd ${{ github.workspace }}/samples/CSharp - - REM First upgrade solutions to VS2022 - echo "Upgrading solution files to VS2022..." - devenv.exe CSharp.sln /upgrade - devenv.exe CSharp_D3D.sln /upgrade - - REM Update project platform toolset - powershell -Command "(Get-Content OCCTProxy\OCCTProxy.vcxproj) -replace 'v100', 'v143' | Set-Content OCCTProxy\OCCTProxy.vcxproj" - powershell -Command "(Get-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj) -replace 'v100', 'v143' | Set-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj" - - REM Restore NuGet packages - echo "Upgrading solution files..." - msbuild.exe CSharp.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_csharp.log;Verbosity=detailed - msbuild.exe CSharp_D3D.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_d3d.log;Verbosity=detailed - - REM Build solutions with real-time console output - echo "Building CSharp.sln..." - msbuild.exe CSharp.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_csharp.log;Verbosity=detailed /m - echo "Building CSharp_D3D.sln..." - msbuild.exe CSharp_D3D.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_d3d.log;Verbosity=detailed /m - - - name: Upload CSharp Sample - uses: actions/upload-artifact@v4.6.2 - with: - name: csharp-sample-${{ inputs.platform }}-x64 - path: samples/CSharp - retention-days: 7 diff --git a/.github/actions/build-sample-mfc/action.yml b/.github/actions/build-sample-mfc/action.yml deleted file mode 100644 index e4103b2415..0000000000 --- a/.github/actions/build-sample-mfc/action.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: 'Build MFC Sample' -description: 'Build MFC sample using OCCT installation' - -inputs: - platform: - description: 'Build platform (windows)' - required: true - install-artifact-name: - description: 'OCCT installation artifact name' - required: true - -runs: - using: "composite" - steps: - - name: Download OCCT installation - uses: ./.github/actions/download-artifacts - with: - name: ${{ inputs.install-artifact-name }} - path: occt-install - - - name: Build MFC Sample - if: inputs.platform == 'windows' - shell: cmd - run: | - REM Setup environment - call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64 - - cd ${{ github.workspace }}/samples/mfc/standard - set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%" - - REM First restore the solution - echo "Restoring solution..." - msbuild.exe ALL-vc14.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore.log;Verbosity=detailed - - REM Build solution with detailed logging - echo "Building solution..." - msbuild.exe ALL-vc14.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build.log;Verbosity=detailed /m - - REM Display logs if build fails - if errorlevel 1 ( - echo "Build failed. Contents of restore.log:" - type restore.log - echo "Contents of build.log:" - type build.log - exit /b 1 - ) - - - name: Upload MFC Sample - uses: actions/upload-artifact@v4.6.2 - with: - name: mfc-sample-${{ inputs.platform }}-x64 - path: samples/mfc/ - retention-days: 7 diff --git a/.github/actions/build-sample-qt/action.yml b/.github/actions/build-sample-qt/action.yml deleted file mode 100644 index c910d6829d..0000000000 --- a/.github/actions/build-sample-qt/action.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: 'Build Qt Sample' -description: 'Build Qt samples using OCCT installation' - -inputs: - platform: - description: 'Build platform (windows/linux)' - required: true - install-artifact-name: - description: 'OCCT installation artifact name' - required: true - thirdparty_url: - description: 'URL to download 3rdparty dependencies' - required: false - default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip' - -runs: - using: "composite" - steps: - - name: Download OCCT installation - uses: ./.github/actions/download-artifacts - with: - name: ${{ inputs.install-artifact-name }} - path: occt-install - - - name: Download vcpkg cache - uses: ./.github/actions/download-vcpkg-cache - with: - artifact-name: ${{ inputs.install-artifact-name }}-cache - - - name: Install Windows dependencies - if: inputs.platform == 'windows' - shell: pwsh - run: | - Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip - Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath . - Remove-Item 3rdparty-vc14-64.zip - - - name: Install Linux dependencies - if: inputs.platform == 'linux' - shell: bash - run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools - - - name: Setup MSBuild - if: inputs.platform == 'windows' - uses: microsoft/setup-msbuild@v2 - - - name: Build Qt Samples - Windows - if: inputs.platform == 'windows' - shell: cmd - run: | - REM Setup environment - cd ${{ github.workspace }}/occt-install/ - call env.bat vc14 win64 Release - - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64 - - REM Setup Qt environment - set "QTDIR=${{ github.workspace }}\3rdparty-vc14-64\qt5.11.2-vc14-64" - set "PATH=%QTDIR%\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%" - - cd ${{ github.workspace }}/samples/qt - - for %%s in (IESample Tutorial FuncDemo) do ( - cd %%s - echo "Generating project for %%s..." - qmake -tp vc -r -o %%s.sln %%s0.pro - - echo "Restoring %%s..." - msbuild.exe %%s.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_restore.log;Verbosity=detailed - - echo "Building %%s..." - msbuild.exe %%s.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_build.log;Verbosity=detailed /m - - REM Display logs if build fails - if errorlevel 1 ( - echo "Build failed for %%s. Contents of restore log:" - type %%s_restore.log - echo "Contents of build log:" - type %%s_build.log - exit /b 1 - ) - - cd .. - ) - - - name: Build Qt Samples - Linux - if: inputs.platform == 'linux' - shell: bash - run: | - cd ${{ github.workspace }}/occt-install/bin - source env.sh - - # Set library paths for vcpkg dependencies - export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH" - export LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LIBRARY_PATH" - export PKG_CONFIG_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH" - - cd ${{ github.workspace }}/samples/qt - - for sample in IESample Tutorial FuncDemo; do - cd $sample - aQMakePath=`which qmake` - host=`uname -s` - export STATION=$host - export RES_DIR="${{ github.workspace }}/samples/qt/${sample}/result" - - # Configure qmake with vcpkg paths - qmake $sample.pro \ - "LIBS += -L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \ - "LIBS += -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \ - "INCLUDEPATH += ${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/include" - - aNbJobs="$(getconf _NPROCESSORS_ONLN)" - make -j$aNbJobs release - cd .. - done - - - name: Upload Qt Samples - uses: actions/upload-artifact@v4.6.2 - with: - name: qt-samples-${{ inputs.platform }}-x64 - path: | - samples/qt/ - samples/qt/ - retention-days: 7 diff --git a/.github/actions/build-tinspector/action.yml b/.github/actions/build-tinspector/action.yml deleted file mode 100644 index 2565967e8f..0000000000 --- a/.github/actions/build-tinspector/action.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: 'Build TInspector' -description: 'Build TInspector using OCCT installation as a separate job' - -inputs: - platform: - description: 'Build platform (windows/linux)' - required: true - install-artifact-name: - description: 'OCCT installation artifact name' - required: true - thirdparty_url: - description: 'URL to download 3rdparty dependencies' - required: false - default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip' - -runs: - using: "composite" - steps: - - name: Download OCCT installation - uses: ./.github/actions/download-artifacts - with: - name: ${{ inputs.install-artifact-name }} - path: occt-install - - - name: Download vcpkg cache - uses: ./.github/actions/download-vcpkg-cache - with: - artifact-name: ${{ inputs.install-artifact-name }}-cache - - - name: Install Windows dependencies - if: inputs.platform == 'windows' - shell: pwsh - run: | - Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip - Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath . - Remove-Item 3rdparty-vc14-64.zip - - - name: Install Linux dependencies - if: inputs.platform == 'linux' - shell: bash - run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools - - - name: Checkout TInspector - shell: bash - run: | - git clone https://github.com/Open-Cascade-SAS/Inspector.git inspector - cd inspector - git checkout efe00930adc2130a91744ba950c5270986d19739 - - - name: Configure TInspector - Windows - if: inputs.platform == 'windows' - shell: pwsh - run: | - cd inspector - mkdir build - cd build - cmake -G "Visual Studio 17 2022" -A x64 ` - -D CMAKE_BUILD_TYPE=Release ` - -D BUILD_SHARED_LIBS=ON ` - -D QtX=Qt5 ` - -D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 ` - -D OpenCASCADE_DIR=${{ github.workspace }}/occt-install ` - -D INSTALL_DIR=${{ github.workspace }}/inspector/install ` - -D CMAKE_POLICY_VERSION_MINIMUM=3.5 ` - .. - - - name: Configure TInspector - Linux - if: inputs.platform == 'linux' - shell: bash - run: | - cd inspector - mkdir build - cd build - export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH" - cmake -G "Unix Makefiles" \ - -D CMAKE_BUILD_TYPE=Release \ - -D BUILD_SHARED_LIBS=ON \ - -D OpenCASCADE_DIR=${{ github.workspace }}/occt-install \ - -D INSTALL_DIR=${{ github.workspace }}/inspector/install \ - -D QtX=Qt5 \ - -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -D CMAKE_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \ - -D CMAKE_INCLUDE_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/include" \ - -D CMAKE_EXE_LINKER_FLAGS="-L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \ - -D CMAKE_SHARED_LINKER_FLAGS="-L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \ - .. - - - name: Build TInspector - Windows - if: inputs.platform == 'windows' - shell: pwsh - run: | - cd inspector/build - cmake --build . --config Release --target install - - - name: Build TInspector - Linux - if: inputs.platform == 'linux' - shell: bash - run: | - cd inspector/build - # Set library paths for build and runtime - export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH" - export LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LIBRARY_PATH" - export PKG_CONFIG_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH" - make install -j$(nproc) - - - name: Upload TInspector installation - uses: actions/upload-artifact@v4.6.2 - with: - name: inspector-${{ inputs.platform }}-x64 - path: inspector/install - retention-days: 7 diff --git a/.github/workflows/build-and-test-multiplatform.yml b/.github/workflows/build-and-test-multiplatform.yml index 56d61661cc..a4fc53dc17 100644 --- a/.github/workflows/build-and-test-multiplatform.yml +++ b/.github/workflows/build-and-test-multiplatform.yml @@ -57,12 +57,6 @@ jobs: needs: - clang-format - ascii-check - - build-inspector-windows - - build-inspector-linux - - build-csharp-windows - - build-mfc-windows - - build-qt-windows - - build-qt-linux - retest-windows-x64 - retest-macos-x64 - retest-linux-clang-x64 @@ -147,96 +141,6 @@ jobs: cmake-build-type: 'Debug' github-token: ${{ secrets.GITHUB_TOKEN }} - build-inspector-windows: - name: Build TInspector on Windows - needs: prepare-and-build-windows-x64 - runs-on: windows-2025 - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Build TInspector - uses: ./.github/actions/build-tinspector - with: - platform: windows - install-artifact-name: install-windows-x64 - - build-inspector-linux: - name: Build TInspector on Linux - needs: prepare-and-build-linux-clang-x64 - runs-on: ubuntu-24.04 - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Build TInspector - uses: ./.github/actions/build-tinspector - with: - platform: linux - install-artifact-name: install-linux-clang-x64 - - build-csharp-windows: - name: Build CSharp Sample on Windows - needs: prepare-and-build-windows-x64 - runs-on: windows-2025 - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Build CSharp Sample - uses: ./.github/actions/build-sample-csharp - with: - platform: windows - install-artifact-name: install-windows-x64 - - build-mfc-windows: - name: Build MFC Sample on Windows - needs: prepare-and-build-windows-x64 - runs-on: windows-2025 - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Build MFC Sample - uses: ./.github/actions/build-sample-mfc - with: - platform: windows - install-artifact-name: install-windows-x64 - - build-qt-windows: - name: Build Qt Sample on Windows - needs: prepare-and-build-windows-x64 - runs-on: windows-2025 - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Build Qt Sample - uses: ./.github/actions/build-sample-qt - with: - platform: windows - install-artifact-name: install-windows-x64 - - build-qt-linux: - name: Build Qt Sample on Linux - needs: prepare-and-build-linux-clang-x64 - runs-on: ubuntu-24.04 - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Build Qt Sample - uses: ./.github/actions/build-sample-qt - with: - platform: linux - install-artifact-name: install-linux-clang-x64 - test-windows-x64: name: Test on Windows (x64) runs-on: windows-2025 diff --git a/.gitignore b/.gitignore index e255c8c4f1..38a912d45c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ !/cmake/ !/data/ !/dox/ -!/samples/ !/src/ !/tests/ !/tools/ diff --git a/CMakeLists.txt b/CMakeLists.txt index e8e743430e..f13ccd569c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,9 +241,6 @@ if (CMAKE_VERSION VERSION_LESS "3.14") OCCT_CHECK_AND_UNSET (BUILD_INCLUDE_SYMLINK) endif() -# copy samples to install directory -set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}") - # install dir of the project if (NOT DEFINED INSTALL_DIR) # set default install directory for Windows @@ -369,11 +366,6 @@ endif() set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}") separate_arguments (BUILD_ADDITIONAL_TOOLKITS) -if (MSVC) - set (BUILD_SAMPLES_MFC OFF CACHE BOOL "${BUILD_SAMPLES_MFC_DESCR}") -endif() -set (BUILD_SAMPLES_QT OFF CACHE BOOL "${BUILD_SAMPLES_QT_DESCR}") - # uwp sample if (MSVC) if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") @@ -834,18 +826,6 @@ else() OCCT_CHECK_AND_UNSET ("INSTALL_GTEST") endif() -# qt for samples -if (BUILD_SAMPLES_QT) - # check qt 3rdparty path - add_definitions (-DHAVE_QT) - list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/qt") - message (STATUS "Info: Qt is used by OCCT") -else() - OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT") - OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC") - OCCT_CHECK_AND_UNSET ("INSTALL_QT") -endif() - # VCPKG require delayed processing of 3rdparty. # That is why we delay the creating project and setting up # the platform specific variables. @@ -937,20 +917,6 @@ if (NOT DEFINED INSTALL_DIR_DATA) endif() endif() -# OCCT samples -if (NOT DEFINED INSTALL_DIR_SAMPLES) - if (LAYOUT_IS_UNIX) - set (INSTALL_DIR_SAMPLES "share/opencascade/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}") - if (INSTALL_DIR_WITH_VERSION) - set (INSTALL_DIR_SAMPLES "share/opencascade-${OCC_VERSION_STRING_EXT}/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}" FORCE) - endif() - elseif (LAYOUT_IS_VCPKG) - set (INSTALL_DIR_SAMPLES "share/${OCCT_PROJECT_NAME}/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}") - else() - set (INSTALL_DIR_SAMPLES "samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}") - endif() -endif() - # OCCT tests if (NOT DEFINED INSTALL_DIR_TESTS) if (LAYOUT_IS_UNIX) @@ -1143,58 +1109,20 @@ CONFIGURE_AND_INSTALL_VERSION_HEADER() string(TIMESTAMP CURRENT_TIME "%H:%M:%S") message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting") -list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX) -if (${DRAWEXE_INDEX} GREATER -1) - OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}") - OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}") -endif() - if (WIN32) set (SCRIPT_EXT bat) else() set (SCRIPT_EXT sh) endif() -# OCCT samples -# get absolute path from INSTALL_DIR -set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}") -if(NOT IS_ABSOLUTE "${INSTALL_DIR_ABSOLUTE}") - get_filename_component(INSTALL_DIR_ABSOLUTE "${CMAKE_BINARY_DIR}/${INSTALL_DIR}" ABSOLUTE) -endif() - -if (INSTALL_SAMPLES) - OCCT_CONFIGURE ("adm/templates/env.samples.${SCRIPT_EXT}.in" "env.samples.${SCRIPT_EXT}") - if (WIN32) - OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_DIR_SAMPLES}") - OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_DIR_SAMPLES}") - - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") - OCCT_INSTALL_FILE_OR_DIR ("samples/xaml" "${INSTALL_DIR_SAMPLES}") - endif() - - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/CSharp" RENAME "env.${SCRIPT_EXT}") - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/mfc/standard" RENAME "env.${SCRIPT_EXT}") - endif() - - OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}") - OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}") - - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}") - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}") - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/OCCTOverview" RENAME "env.${SCRIPT_EXT}") - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}") -endif() - if (INSTALL_TEST_CASES) OCCT_INSTALL_FILE_OR_DIR ("tests/" "${INSTALL_DIR_TESTS}") endif() list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX) if (${DRAWEXE_INDEX} GREATER -1) - # copy data and samples/tcl folders to install script folder + # copy data folder (includes tcl samples) to install folder OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}") - OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}") install (FILES "${OCCT_ROOT_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) @@ -1259,7 +1187,6 @@ if (LAYOUT_IS_VCPKG) set \"CSF_OCCTIncludePath=%CASCONTENTROOT%\\include\" set \"CSF_OCCTResourcePath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\" set \"CSF_OCCTDataPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\" - set \"CSF_OCCTSamplesPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\\samples\" set \"CSF_OCCTTestsPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\\tests\" set \"CSF_OCCTDocPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\\doc\"") else() @@ -1273,7 +1200,6 @@ if (LAYOUT_IS_VCPKG) export CSF_OCCTIncludePath=\"\${CASCONTENTROOT}/include\" export CSF_OCCTResourcePath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}\" export CSF_OCCTDataPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}\" - export CSF_OCCTSamplesPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}/samples\" export CSF_OCCTTestsPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}/tests\" export CSF_OCCTDocPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}/doc\"") endif() @@ -1288,7 +1214,6 @@ else() set (OCCT_CUSTOM_ADDITIONAL_PATHS "set \"CSF_OCCTIncludePath=%CASROOT%/${INSTALL_DIR_INCLUDE}\" set \"CSF_OCCTResourcePath=%CASROOT%/${INSTALL_DIR_RESOURCE}\" set \"CSF_OCCTDataPath=%CASROOT%/${INSTALL_DIR_DATA}\" - set \"CSF_OCCTSamplesPath=%CASROOT%/${INSTALL_DIR_SAMPLES}\" set \"CSF_OCCTTestsPath=%CASROOT%/${INSTALL_DIR_TESTS}\" set \"CSF_OCCTDocPath=%CASROOT%/${INSTALL_DIR_DOC}\"") else() @@ -1297,7 +1222,6 @@ else() set (OCCT_CUSTOM_ADDITIONAL_PATHS "export CSF_OCCTIncludePath=\"\${CASROOT}/${INSTALL_DIR_INCLUDE}\" export CSF_OCCTResourcePath=\"\${CASROOT}/${INSTALL_DIR_RESOURCE}\" export CSF_OCCTDataPath=\"\${CASROOT}/${INSTALL_DIR_DATA}\" - export CSF_OCCTSamplesPath=\"\${CASROOT}/${INSTALL_DIR_SAMPLES}\" export CSF_OCCTTestsPath=\"\${CASROOT}/${INSTALL_DIR_TESTS}\" export CSF_OCCTDocPath=\"\${CASROOT}/${INSTALL_DIR_DOC}\"") endif() @@ -1342,11 +1266,6 @@ endif() # write current custom.bat/sh (for build directory) OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}") -if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT) - OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}") - OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}") -endif() - if (WIN32) # Set custom script path variable for Windows template if (LAYOUT_IS_VCPKG) @@ -1405,24 +1324,6 @@ foreach(RESOURCE ${RESOURCES}) endif() endforeach() -if (BUILD_SAMPLES_QT) - FILE_TO_LIST ("adm/SAMPLES_RESOURCES" SAMPLES_RESOURCES) - foreach(RESOURCE ${SAMPLES_RESOURCES}) - OCCT_INSTALL_FILE_OR_DIR ("samples/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/samples") - #message("Copy Sample resources: samples/${RESOURCE} into ${INSTALL_DIR_RESOURCE}/samples") - endforeach() - - ## Copy sources of OCCTOverview for using in the sample - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/DataExchangeSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/OcafSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/GeometrySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/TopologySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/TriangulationSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/Viewer2dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") - OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/Viewer3dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") -endif() - - # patch installed DrawDefault file if BUILD_SHARED_LIBRARY_NAME_POSTFIX is changed if (NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "") OCCT_UPDATE_DRAW_DEFAULT_FILE() @@ -1477,68 +1378,6 @@ if (MSVC AND 3RDPARTY_DLL_DIRS) endif() endif() -message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed") -# samples do not support patch usage -if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT) - set (OCCT_ROOT ${OCCT_ROOT_DIR}) -endif() - -if (BUILD_SAMPLES_MFC) - set (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard) - set (COMMON_WINMAIN_FILE ${MFC_STANDARD_SAMPLES_DIR}/Common/Winmain.cpp) - - add_subdirectory(samples/mfc/standard/mfcsample) - add_subdirectory(samples/mfc/standard/01_Geometry) - add_subdirectory(samples/mfc/standard/02_Modeling) - add_subdirectory(samples/mfc/standard/03_ImportExport) - add_subdirectory(samples/mfc/standard/04_HLR) - - message (STATUS "Info: \(${CURRENT_TIME}\) MFC Sample projects added") -endif() - -OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES) - -# Load sample configuration files -foreach (OCCT_SAMPLE ${OCCT_SAMPLES}) - foreach (BUILD_SAMPLE_TOOLKIT ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS}) - OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}/PACKAGES) - OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}/EXTERNLIB) - OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}/FILES) - foreach (PACKAGE ${OCCT_${BUILD_SAMPLE_TOOLKIT}_LIST_OF_PACKAGES}) - OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${PACKAGE}/FILES) - endforeach() - endforeach() -endforeach() - -if (BUILD_SAMPLES_QT) - if (BUILD_SAMPLES_QT) - if (NOT Qt5_FOUND OR "${Qt5Gui_EGL_INCLUDE_DIRS}" STREQUAL "" OR NOT WIN32) - list (REMOVE_ITEM qt_SAMPLES_TOOLKITS AndroidQt) - message (STATUS "Info: AndroidQt sample excluded due to OS is not Windows or Qt is configured without ANGLE") - endif() - else() - list (REMOVE_ITEM OCCT_SAMPLES qt) - message (STATUS "Info: qt samples excluded due to BUILD_SAMPLES_QT is disabled") - endif() - - foreach (OCCT_SAMPLE ${OCCT_SAMPLES}) - list (APPEND BUILD_SAMPLE_TOOLKITS ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS}) - - # collect all the headers to /inc/samples folder - string(TIMESTAMP CURRENT_TIME "%H:%M:%S") - message (STATUS "Info: \(${CURRENT_TIME}\) ${OCCT_SAMPLE} Sample projects added") - - # include patched toolkit projects or original ones - foreach (BUILD_SAMPLE_TOOLKIT ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS}) - OCCT_ADD_SUBDIRECTORY ("samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}") - endforeach() - endforeach() -endif() - -if (BUILD_MODULE_UwpSample) - add_subdirectory(samples/xaml) -endif() - # Prepare variables for configuration of OpenCASCADE cmake config file set (OCCT_MODULES_ENABLED) set (OCCT_LIBRARIES) diff --git a/adm/RESOURCES b/adm/RESOURCES index a0dd9bf5be..029466f242 100644 --- a/adm/RESOURCES +++ b/adm/RESOURCES @@ -1,4 +1,5 @@ DrawResources +samples/tcl StdResource SHMessage Textures diff --git a/adm/SAMPLES b/adm/SAMPLES deleted file mode 100644 index 92496b7397..0000000000 --- a/adm/SAMPLES +++ /dev/null @@ -1 +0,0 @@ -qt AndroidQt FuncDemo IESample Tutorial OCCTOverview \ No newline at end of file diff --git a/adm/SAMPLES_RESOURCES b/adm/SAMPLES_RESOURCES deleted file mode 100644 index 42b0dea440..0000000000 --- a/adm/SAMPLES_RESOURCES +++ /dev/null @@ -1,3 +0,0 @@ -qt/Common/res/ -qt/Tutorial/res/ -qt/OCCTOverview/res/ \ No newline at end of file diff --git a/adm/cmake/occt_doc.cmake b/adm/cmake/occt_doc.cmake index 20ff54146f..5ec9c8ef21 100644 --- a/adm/cmake/occt_doc.cmake +++ b/adm/cmake/occt_doc.cmake @@ -388,9 +388,6 @@ function(OCCT_DOC_CONFIGURE_DOXYGEN OUTPUT_DIR CONFIG_FILE DOC_TYPE) else() file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OCCT_ROOT_DIR}/dox/resources\n") endif() - - # Example paths - file(APPEND ${DOXYGEN_CONFIG_FILE} "EXAMPLE_PATH = ${OCCT_ROOT_DIR}/src ${OCCT_ROOT_DIR}/samples\n") else() # Settings for Reference Manual file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NAME = \"Open CASCADE Technology Reference Manual\"\n") diff --git a/adm/cmake/occt_gtest.cmake b/adm/cmake/occt_gtest.cmake index 036e0bca2b..be7c7c7333 100644 --- a/adm/cmake/occt_gtest.cmake +++ b/adm/cmake/occt_gtest.cmake @@ -152,7 +152,6 @@ function(OCCT_SET_GTEST_ENVIRONMENT) "CSF_OCCTResourcePath=${OCCT_ROOT_DIR}/resources" "CSF_OCCTDataPath=${OCCT_ROOT_DIR}/data" "CSF_OCCTDocPath=${OCCT_ROOT_DIR}/doc" - "CSF_OCCTSamplesPath=${OCCT_ROOT_DIR}/samples" "CSF_OCCTTestsPath=${OCCT_ROOT_DIR}/tests" "CSF_OCCTBinPath=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "CSF_OCCTLibPath=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}" diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake index 360a5306cf..4d5442d7f5 100644 --- a/adm/cmake/occt_macros.cmake +++ b/adm/cmake/occt_macros.cmake @@ -27,7 +27,6 @@ macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS) OCCT_CHECK_AND_UNSET (INSTALL_DIR_INCLUDE) OCCT_CHECK_AND_UNSET (INSTALL_DIR_RESOURCE) OCCT_CHECK_AND_UNSET (INSTALL_DIR_DATA) - OCCT_CHECK_AND_UNSET (INSTALL_DIR_SAMPLES) OCCT_CHECK_AND_UNSET (INSTALL_DIR_TESTS) OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC) endmacro() diff --git a/adm/cmake/vardescr.cmake b/adm/cmake/vardescr.cmake index f874b18a00..617ec63723 100644 --- a/adm/cmake/vardescr.cmake +++ b/adm/cmake/vardescr.cmake @@ -50,10 +50,10 @@ OFF - using a reference file with direct include to the origin, ON - symbolic link to the origin file are created") # install variables -set (INSTALL_DIR_DESCR +set (INSTALL_DIR_DESCR "The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable), -samples (INSTALL_SAMPLES_DESCR variable) and certain 3rdparties (INSTALL_TBB and -other similar variables) will be placed during the installation process (building INSTALL project)") +and certain 3rdparties (INSTALL_TBB and other similar variables) will be placed +during the installation process (building INSTALL project)") set (INSTALL_DIR_WITH_VERSION_DESCR "Use OCCT version number as suffix for names of directories") @@ -73,10 +73,8 @@ set (INSTALL_DIR_DOC_DESCR "Subdirectory of INSTALL_DIR where documentation will be installed") set (INSTALL_DIR_LIB_DESCR "Subdirectory of INSTALL_DIR where libraries (.so on Linux, .lib on Windows) will be installed") -set (INSTALL_DIR_RESOURCE_DESCR +set (INSTALL_DIR_RESOURCE_DESCR "Subdirectory of INSTALL_DIR where OCCT resource files will be installed") -set (INSTALL_DIR_SAMPLES_DESCR -"Subdirectory of INSTALL_DIR where samples will be installed") set (INSTALL_DIR_TESTS_DESCR "Subdirectory of INSTALL_DIR where test scripts will be installed") set (INSTALL_DIR_SCRIPT_DESCR @@ -91,7 +89,6 @@ set (${INSTALL_TARGET_VARIABLE}_DESCR project) into the installation directory (INSTALL_DIR variable)") endmacro() -INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples") INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts") INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)") INSTALL_MESSAGE (INSTALL_FFMPEG "FFmpeg binaries") @@ -130,19 +127,6 @@ want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding BUILD_MODUE_* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically") -set (BUILD_SAMPLES_MFC_DESCR -"Indicates whether OCCT MFC samples should be built together with OCCT. -These samples show some possibilities of using OCCT and they can be executed -with script samples.bat from the installation directory (INSTALL_DIR)") - -set (BUILD_SAMPLES_QT_DESCR -"Indicates whether OCCT Qt samples should be built together with OCCT. -These samples show some possibilities of using OCCT and they can be executed -with script samples.bat from the installation directory (INSTALL_DIR)") - -set (BUILD_MODULE_UwpSample_DESCR -"Indicates whether OCCT UWP sample should be built together with OCCT.") - set (BUILD_DOC_Overview_DESCR "Indicates whether OCCT overview documentation project (Markdown format) should be created together with OCCT. It is not built together with OCCT. Checking this options diff --git a/adm/templates/DRAWEXE.vcxproj.user.in b/adm/templates/DRAWEXE.vcxproj.user.in index e19f3328ab..ff3e612fa3 100644 --- a/adm/templates/DRAWEXE.vcxproj.user.in +++ b/adm/templates/DRAWEXE.vcxproj.user.in @@ -6,7 +6,6 @@ CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources DRAWHOME=@OCCT_ROOT_DIR@/resources/DrawResources CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data -CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH% @@ -19,7 +18,6 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH% CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data -CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH% @@ -33,7 +31,6 @@ CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ DRAWHOME=@OCCT_ROOT_DIR@/resources/DrawResources CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data -CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH% diff --git a/adm/templates/custom.build.bat.in b/adm/templates/custom.build.bat.in index a511fcb43e..d23f784ad8 100644 --- a/adm/templates/custom.build.bat.in +++ b/adm/templates/custom.build.bat.in @@ -30,7 +30,6 @@ if /I "%VCVER%" == "@COMPILER@" ( set "CSF_OCCTIncludePath=@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@" set "CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources" set "CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data" - set "CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples" set "CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests" set "CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc" diff --git a/adm/templates/custom.build.sh.in b/adm/templates/custom.build.sh.in index f281aeaed1..609fa5b671 100644 --- a/adm/templates/custom.build.sh.in +++ b/adm/templates/custom.build.sh.in @@ -27,7 +27,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@" export CSF_OCCTResourcePath="@OCCT_ROOT_DIR@/resources" export CSF_OCCTDataPath="@OCCT_ROOT_DIR@/data" - export CSF_OCCTSamplesPath="@OCCT_ROOT_DIR@/samples" export CSF_OCCTTestsPath="@OCCT_ROOT_DIR@/tests" export CSF_OCCTDocPath="@OCCT_ROOT_DIR@/doc" diff --git a/adm/templates/env.bat b/adm/templates/env.bat index 33e129a457..45c9d81a48 100644 --- a/adm/templates/env.bat +++ b/adm/templates/env.bat @@ -257,7 +257,6 @@ set "CSF_OPT_LNK64I=%CSF_OPT_LNK64I% %OPT_LIB64%" rem ----- Default paths to sub-folders (can be different in install env) ----- if "%CSF_OCCTIncludePath%" == "" set "CSF_OCCTIncludePath=%CASROOT%\inc" if "%CSF_OCCTResourcePath%" == "" set "CSF_OCCTResourcePath=%CASROOT%\src" -if "%CSF_OCCTSamplesPath%" == "" set "CSF_OCCTSamplesPath=%CASROOT%\samples" if "%CSF_OCCTDataPath%" == "" set "CSF_OCCTDataPath=%CASROOT%\data" if "%CSF_OCCTTestsPath%" == "" set "CSF_OCCTTestsPath=%CASROOT%\tests" if "%CSF_OCCTBinPath%" == "" set "CSF_OCCTBinPath=%CASROOT%\win%ARCH%\%VCLIB%\bin%CASDEB%" diff --git a/adm/templates/env.samples.bat.in b/adm/templates/env.samples.bat.in deleted file mode 100644 index a787deed46..0000000000 --- a/adm/templates/env.samples.bat.in +++ /dev/null @@ -1,32 +0,0 @@ -@echo off - -if exist "%~dp0custom.bat" ( - call "%~dp0custom.bat" %1 %2 %3 -) - -call "@INSTALL_DIR_ABSOLUTE@\@INSTALL_DIR_SCRIPT@\env.bat" %1 %2 %3 -if /I ["%1"] == ["vc141"] set "VCVER=vc141" -if /I ["%1"] == ["vc142"] set "VCVER=vc142" -if /I ["%1"] == ["vc143"] set "VCVER=vc143" -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -set "LIB_DIR=win%ARCH%\%VCVER%\libd" - -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" - set "LIB_DIR=win%ARCH%\%VCVER%\lib" -) - -set "PATH=%~dp0%BIN_DIR%;%PATH%" - -if not "%QTDIR%" == "" ( - set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res" - - set "CSF_ResourcesDefaults=!RES_DIR!" - set "CSF_TutorialResourcesDefaults=!RES_DIR!" - set "CSF_IEResourcesDefaults=!RES_DIR!" - - set "PATH=%QTDIR%/bin;%PATH%" - set "QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms" -) - -set "CSF_OCCTOverviewSampleCodePath=%~dp0..\..\OCCTOverview\code" diff --git a/adm/templates/env.samples.sh.in b/adm/templates/env.samples.sh.in deleted file mode 100644 index 08db608092..0000000000 --- a/adm/templates/env.samples.sh.in +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "custom.sh" ]; then - source "custom.sh"; -fi - -if [ -e "@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SCRIPT@/env.sh" ]; then - source "@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SCRIPT@/env.sh"; -fi - -if test "${QTDIR}" == ""; then - echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script." - exit 1 -fi - -host=`uname -s` -export STATION=$host -export RES_DIR=${aSamplePath}/${STATION}/res - -export PATH=${QTDIR}/bin:${PATH} - -export "CSF_OCCTOverviewSampleCodePath=${aSamplePath}/../../qt/OCCTOverview/code" diff --git a/adm/templates/env.sh b/adm/templates/env.sh index dc2e811b2e..7ac45fb947 100644 --- a/adm/templates/env.sh +++ b/adm/templates/env.sh @@ -188,7 +188,6 @@ fi # ----- Default paths to sub-folders (can be different in install env) ----- export CSF_OCCTIncludePath="${CSF_OCCTIncludePath:-$CASROOT/inc}" export CSF_OCCTResourcePath="${CSF_OCCTResourcePath:-$CASROOT/src}" -export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}" export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}" export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}" diff --git a/adm/templates/sample.bat b/adm/templates/sample.bat deleted file mode 100644 index 576984ed8a..0000000000 --- a/adm/templates/sample.bat +++ /dev/null @@ -1,43 +0,0 @@ -@echo off - -if ["%1"] == [""] ( - echo Launch selected sample as follows: - echo sample.bat SampleName vc10 win32 d - echo or to use last sample build configuration: - echo sample.bat SampleName - echo available samples: - echo Geometry - echo Modeling - echo Viewer2d - echo Viewer3d - echo ImportExport - echo Ocaf - echo Triangulation - echo HLR - echo Animation - echo Convert - echo AndroidQt - echo FuncDemo - echo IESample - echo OCCTOverview - echo Tutorial - PAUSE - exit /B -) - -call "%~dp0env.bat" %2 %3 %4 -if not ["%QTDIR%"] == [""] if exist "%QTDIR%\qml" if ["%QML2_IMPORT_PATH%"] == [""] set "QML2_IMPORT_PATH=%QTDIR%/qml" -set "EXE_PATH=%CSF_OCCTBinPath%/%1.exe" - -if not exist "%EXE_PATH%" ( - echo Executable %EXE_PATH% not found. - echo Probably you didn't compile the application. - PAUSE - exit /B -) - -rem Set path to location where sample code is installed -set "CSF_OCCTOverviewSampleCodePath=%CSF_OCCTSamplesPath%\OCCTOverview\code" - -"%EXE_PATH%" - diff --git a/adm/templates/sample.sh b/adm/templates/sample.sh deleted file mode 100644 index 65647576a7..0000000000 --- a/adm/templates/sample.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -if [ "$1" == "" ]; then - echo Launch selected sample as follows: - echo sample.sh SampleName d - echo or to use last sample build configuration: - echo sample.sh SampleName - echo available samples: - echo FuncDemo - echo IESample - echo OCCTOverview - echo Tutorial -fi - - -aCurrentPath="$PWD" -aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD"; - -source "${aScriptPath}/env.sh" "$2" - -if test "${QTDIR}" == ""; then - if [ -d "$QTDIR%\qml" ]; - then export QML2_IMPORT_PATH="$QTDIR\qml"; - fi -fi - -export "EXE_PATH=$CSF_OCCTBinPath/$1" - -if [ ! -f "$EXE_PATH" ]; then - echo "Executable \"$EXE_PATH\" not found." - echo "Probably you didn't compile the application." - exit 1 -fi - -export CSF_OCCTOverviewSampleCodePath="${CSF_OCCTSamplesPath}/qt/OCCTOverview/code" - -cd ${aCurrentPath} -"$EXE_PATH" diff --git a/adm/templates/uwp.toolchain.config.cmake b/adm/templates/uwp.toolchain.config.cmake deleted file mode 100644 index 4dbd2ae6a9..0000000000 --- a/adm/templates/uwp.toolchain.config.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# A toolchain file to configure a Visual Studio generator for a Windows 10 Universal Application (UWP) -# Specify the CMAKE_SYSTEM_VERSION variable to be 10.0 to build with the latest available Windows 10 SDK. - -set (CMAKE_SYSTEM_NAME WindowsStore) -set (CMAKE_SYSTEM_VERSION 10.0) diff --git a/dox/build/build_occt/building_occt.md b/dox/build/build_occt/building_occt.md index 500359ef41..ce095d6118 100644 --- a/dox/build/build_occt/building_occt.md +++ b/dox/build/build_occt/building_occt.md @@ -143,7 +143,6 @@ The following table gives the full list of environment variables used at the con | INSTALL_DIR_RESOURCE | Path | Relative path to the resources installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}) | | INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables | | INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) | -| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) | | INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) | | INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) | | INSTALL_FREETYPE | Boolean | Indicates whether FreeType binaries should be installed into the installation directory | diff --git a/dox/samples/draw_scripts.md b/dox/samples/draw_scripts.md index 786e8962c6..5de2f17bb9 100644 --- a/dox/samples/draw_scripts.md +++ b/dox/samples/draw_scripts.md @@ -1,12 +1,12 @@ Draw: Demo Scripts {#samples__draw_scripts} ================ -All demo scripts are provided with OCCT sources and locate in CASROOT/samples/tcl. To play around them please +All demo scripts are provided with OCCT sources and locate in CASROOT/resources/samples/tcl. To play around them please follow the steps below: -1. Start DRAWEXE +1. Start DRAWEXE 2. Type *cd ../..* to return to the root directory -3. Type *cd samples/tcl* to reach the *DrawResources* directory +3. Type *cd resources/samples/tcl* to reach the demo scripts directory 4. Type *source \* to run the demonstration file provided with Open CASCADE. The following demonstration files are available: * DataExchangeDemo.tcl: demonstrates sample sequence of operations with writing and reading IGES file @@ -105,7 +105,7 @@ Type pload ALL **Running demonstration files** 1. Type *cd ../..* to return to the root directory -2. Type *cd samples/tcl* to reach the *DrawResources* directory +2. Type *cd resources/samples/tcl* to reach the demo scripts directory 3. Type *source \* to run the demonstration file provided with Open CASCADE. The following demonstration files are available: * DataExchangeDemo.tcl: demonstrates sample sequence of operations with writing and reading IGES file * ModelingDemo.tcl: demonstrates creation of simple shape and displaying it in HLR mode diff --git a/samples/tcl/ANC101.tcl b/resources/samples/tcl/ANC101.tcl similarity index 100% rename from samples/tcl/ANC101.tcl rename to resources/samples/tcl/ANC101.tcl diff --git a/samples/tcl/DataExchangeDemo.tcl b/resources/samples/tcl/DataExchangeDemo.tcl similarity index 100% rename from samples/tcl/DataExchangeDemo.tcl rename to resources/samples/tcl/DataExchangeDemo.tcl diff --git a/samples/tcl/MBBGehauseRohteil.tcl b/resources/samples/tcl/MBBGehauseRohteil.tcl similarity index 100% rename from samples/tcl/MBBGehauseRohteil.tcl rename to resources/samples/tcl/MBBGehauseRohteil.tcl diff --git a/samples/tcl/ModelingDemo.tcl b/resources/samples/tcl/ModelingDemo.tcl similarity index 100% rename from samples/tcl/ModelingDemo.tcl rename to resources/samples/tcl/ModelingDemo.tcl diff --git a/samples/tcl/Penrose.tcl b/resources/samples/tcl/Penrose.tcl similarity index 100% rename from samples/tcl/Penrose.tcl rename to resources/samples/tcl/Penrose.tcl diff --git a/samples/tcl/Readme.txt b/resources/samples/tcl/Readme.txt similarity index 71% rename from samples/tcl/Readme.txt rename to resources/samples/tcl/Readme.txt index 377c441e3a..061b335c88 100644 --- a/samples/tcl/Readme.txt +++ b/resources/samples/tcl/Readme.txt @@ -1,4 +1,4 @@ This directory provides a set of demo scripts for using OCCT functionality from within DRAW Test Harness. Call the scripts from DRAW prompt, e.g.: -Draw[]> source samples/tcl/VisualizationDemo.tcl +Draw[]> source resources/samples/tcl/VisualizationDemo.tcl diff --git a/samples/tcl/VisualizationDemo.tcl b/resources/samples/tcl/VisualizationDemo.tcl similarity index 100% rename from samples/tcl/VisualizationDemo.tcl rename to resources/samples/tcl/VisualizationDemo.tcl diff --git a/samples/tcl/bottle.tcl b/resources/samples/tcl/bottle.tcl similarity index 100% rename from samples/tcl/bottle.tcl rename to resources/samples/tcl/bottle.tcl diff --git a/samples/tcl/cad.tcl b/resources/samples/tcl/cad.tcl similarity index 100% rename from samples/tcl/cad.tcl rename to resources/samples/tcl/cad.tcl diff --git a/samples/tcl/cpu.tcl b/resources/samples/tcl/cpu.tcl similarity index 100% rename from samples/tcl/cpu.tcl rename to resources/samples/tcl/cpu.tcl diff --git a/samples/tcl/cutter.tcl b/resources/samples/tcl/cutter.tcl similarity index 100% rename from samples/tcl/cutter.tcl rename to resources/samples/tcl/cutter.tcl diff --git a/samples/tcl/dimensions.tcl b/resources/samples/tcl/dimensions.tcl similarity index 100% rename from samples/tcl/dimensions.tcl rename to resources/samples/tcl/dimensions.tcl diff --git a/samples/tcl/drill.tcl b/resources/samples/tcl/drill.tcl similarity index 100% rename from samples/tcl/drill.tcl rename to resources/samples/tcl/drill.tcl diff --git a/samples/tcl/logo2019.tcl b/resources/samples/tcl/logo2019.tcl similarity index 100% rename from samples/tcl/logo2019.tcl rename to resources/samples/tcl/logo2019.tcl diff --git a/samples/tcl/markers.tcl b/resources/samples/tcl/markers.tcl similarity index 100% rename from samples/tcl/markers.tcl rename to resources/samples/tcl/markers.tcl diff --git a/samples/tcl/materials.tcl b/resources/samples/tcl/materials.tcl similarity index 100% rename from samples/tcl/materials.tcl rename to resources/samples/tcl/materials.tcl diff --git a/samples/tcl/pathtrace_ball.tcl b/resources/samples/tcl/pathtrace_ball.tcl similarity index 100% rename from samples/tcl/pathtrace_ball.tcl rename to resources/samples/tcl/pathtrace_ball.tcl diff --git a/samples/tcl/pathtrace_cube.tcl b/resources/samples/tcl/pathtrace_cube.tcl similarity index 100% rename from samples/tcl/pathtrace_cube.tcl rename to resources/samples/tcl/pathtrace_cube.tcl diff --git a/samples/tcl/pathtrace_materials.tcl b/resources/samples/tcl/pathtrace_materials.tcl similarity index 100% rename from samples/tcl/pathtrace_materials.tcl rename to resources/samples/tcl/pathtrace_materials.tcl diff --git a/samples/tcl/pencil.tcl b/resources/samples/tcl/pencil.tcl similarity index 100% rename from samples/tcl/pencil.tcl rename to resources/samples/tcl/pencil.tcl diff --git a/samples/tcl/raytrace.tcl b/resources/samples/tcl/raytrace.tcl similarity index 100% rename from samples/tcl/raytrace.tcl rename to resources/samples/tcl/raytrace.tcl diff --git a/samples/tcl/snowflake.tcl b/resources/samples/tcl/snowflake.tcl similarity index 100% rename from samples/tcl/snowflake.tcl rename to resources/samples/tcl/snowflake.tcl diff --git a/samples/tcl/spheres.tcl b/resources/samples/tcl/spheres.tcl similarity index 100% rename from samples/tcl/spheres.tcl rename to resources/samples/tcl/spheres.tcl diff --git a/samples/tcl/vis_pbr_spheres.tcl b/resources/samples/tcl/vis_pbr_spheres.tcl similarity index 100% rename from samples/tcl/vis_pbr_spheres.tcl rename to resources/samples/tcl/vis_pbr_spheres.tcl diff --git a/samples/tcl/xde.tcl b/resources/samples/tcl/xde.tcl similarity index 100% rename from samples/tcl/xde.tcl rename to resources/samples/tcl/xde.tcl diff --git a/samples/CSharp/CSharp.sln b/samples/CSharp/CSharp.sln deleted file mode 100644 index e67bae1fa2..0000000000 --- a/samples/CSharp/CSharp.sln +++ /dev/null @@ -1,45 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF_WinForms", "WPF_WinForms\IE_WPF_WinForms.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WinForms", "WinForms\IE_WinForms.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy", "OCCTProxy\OCCTProxy.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|x86 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.Build.0 = Debug|x86 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.ActiveCfg = Debug|x64 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.Build.0 = Debug|x64 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|x86 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.Build.0 = Release|x86 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.ActiveCfg = Release|x64 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.Build.0 = Release|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/CSharp/CSharp_D3D.sln b/samples/CSharp/CSharp_D3D.sln deleted file mode 100644 index a0fedddcac..0000000000 --- a/samples/CSharp/CSharp_D3D.sln +++ /dev/null @@ -1,35 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF_D3D", "WPF_D3D\IE_WPF_D3D.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy_D3D", "OCCTProxy_D3D\OCCTProxy_D3D.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64 - {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64 - {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/CSharp/OCCTProxy/OCCTProxy.cpp b/samples/CSharp/OCCTProxy/OCCTProxy.cpp deleted file mode 100644 index ce6afca7ed..0000000000 --- a/samples/CSharp/OCCTProxy/OCCTProxy.cpp +++ /dev/null @@ -1,1052 +0,0 @@ -// Prevent Windows from defining min/max macros -#ifndef NOMINMAX - #define NOMINMAX -#endif - -// include required OCCT headers -#include -#include -#include -//for OCC graphic -#include -#include -#include -//for object display -#include -#include -#include -#include -//topology -#include -#include -//brep tools -#include -#include -// iges I/E -#include -#include -#include -#include -#include -//step I/E -#include -#include -//for stl export -#include -//for vrml export -#include -//wrapper of pure C++ classes to ref classes -#include - -#include - -// list of required OCCT libraries -#pragma comment(lib, "TKernel.lib") -#pragma comment(lib, "TKMath.lib") -#pragma comment(lib, "TKBRep.lib") -#pragma comment(lib, "TKXSBase.lib") -#pragma comment(lib, "TKService.lib") -#pragma comment(lib, "TKV3d.lib") -#pragma comment(lib, "TKOpenGl.lib") -#pragma comment(lib, "TKDEIGES.lib") -#pragma comment(lib, "TKDESTEP.lib") -#pragma comment(lib, "TKDESTL.lib") -#pragma comment(lib, "TKDEVRML.lib") -#pragma comment(lib, "TKLCAF.lib") - -//! Auxiliary tool for converting C# string into UTF-8 string. -static TCollection_AsciiString toAsciiString (String^ theString) -{ - if (theString == nullptr) - { - return TCollection_AsciiString(); - } - - pin_ptr aPinChars = PtrToStringChars (theString); - const wchar_t* aWCharPtr = aPinChars; - if (aWCharPtr == NULL - || *aWCharPtr == L'\0') - { - return TCollection_AsciiString(); - } - return TCollection_AsciiString (aWCharPtr); -} - -/// -/// Proxy class encapsulating calls to OCCT C++ classes within -/// C++/CLI class visible from .Net (CSharp) -/// -public ref class OCCTProxy -{ -public: - // ============================================ - // Viewer functionality - // ============================================ - - /// - ///Initialize a viewer - /// - /// System.IntPtr that contains the window handle (HWND) of the control - bool InitViewer(System::IntPtr theWnd) - { - try - { - Handle(Aspect_DisplayConnection) aDisplayConnection; - myGraphicDriver() = new OpenGl_GraphicDriver (aDisplayConnection); - } - catch (Standard_Failure) - { - return false; - } - - myViewer() = new V3d_Viewer (myGraphicDriver()); - myViewer()->SetDefaultLights(); - myViewer()->SetLightOn(); - myView() = myViewer()->CreateView(); - Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast (theWnd.ToPointer())); - myView()->SetWindow(aWNTWindow); - if (!aWNTWindow->IsMapped()) - { - aWNTWindow->Map(); - } - myAISContext() = new AIS_InteractiveContext( myViewer() ); - myAISContext()->UpdateCurrentViewer(); - myView()->Redraw(); - myView()->MustBeResized(); - return true; - } - - /// - /// Make dump of current view to file - /// - /// Name of dump file - bool Dump(const TCollection_AsciiString& theFileName) - { - if (myView().IsNull()) - { - return false; - } - myView()->Redraw(); - return myView()->Dump(theFileName.ToCString()) != Standard_False; - } - - /// - ///Redraw view - /// - void RedrawView(void) - { - if (!myView().IsNull()) - { - myView()->Redraw(); - } - } - - /// - ///Update view - /// - void UpdateView(void) - { - if (!myView().IsNull()) - { - myView()->MustBeResized(); - } - } - - /// - ///Set computed mode in false - /// - void SetDegenerateModeOn(void) - { - if (!myView().IsNull()) - { - myView()->SetComputedMode (Standard_False); - myView()->Redraw(); - } - } - - /// - ///Set computed mode in true - /// - void SetDegenerateModeOff(void) - { - if (!myView().IsNull()) - { - myView()->SetComputedMode (Standard_True); - myView()->Redraw(); - } - } - - /// - ///Fit all - /// - void WindowFitAll(int theXmin, int theYmin, int theXmax, int theYmax) - { - if (!myView().IsNull()) - { - myView()->WindowFitAll(theXmin, theYmin, theXmax, theYmax); - } - } - - /// - ///Current place of window - /// - /// Current zoom - void Place(int theX, int theY, float theZoomFactor) - { - Standard_Real aZoomFactor = theZoomFactor; - if (!myView().IsNull()) - { - myView()->Place(theX, theY, aZoomFactor); - } - } - - /// - ///Set Zoom - /// - void Zoom(int theX1, int theY1, int theX2, int theY2) - { - if (!myView().IsNull()) - { - myView()->Zoom(theX1, theY1, theX2, theY2); - } - } - - /// - ///Set Pan - /// - void Pan(int theX, int theY) - { - if (!myView().IsNull()) - { - myView()->Pan(theX, theY); - } - } - - /// - ///Rotation - /// - void Rotation(int theX, int theY) - { - if (!myView().IsNull()) - { - myView()->Rotation(theX, theY); - } - } - - /// - ///Start rotation - /// - void StartRotation(int theX, int theY) - { - if (!myView().IsNull()) - { - myView()->StartRotation(theX, theY); - } - } - - /// - ///Select by rectangle - /// - void Select(int theX1, int theY1, int theX2, int theY2) - { - if (!myAISContext().IsNull()) - { - myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1), - Graphic3d_Vec2i (theX2, theY2), - myView()); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Select by click - /// - void Select(void) - { - if (!myAISContext().IsNull()) - { - myAISContext()->SelectDetected(); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Move view - /// - void MoveTo(int theX, int theY) - { - if ((!myAISContext().IsNull()) && (!myView().IsNull())) - { - myAISContext()->MoveTo (theX, theY, myView(), Standard_True); - } - } - - /// - ///Select by rectangle with pressed "Shift" key - /// - void ShiftSelect(int theX1, int theY1, int theX2, int theY2) - { - if ((!myAISContext().IsNull()) && (!myView().IsNull())) - { - myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1), - Graphic3d_Vec2i (theX2, theY2), - myView(), - AIS_SelectionScheme_XOR); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Select by "Shift" key - /// - void ShiftSelect(void) - { - if (!myAISContext().IsNull()) - { - myAISContext()->SelectDetected (AIS_SelectionScheme_XOR); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Set background color - /// - void BackgroundColor(int& theRed, int& theGreen, int& theBlue) - { - Standard_Real R1; - Standard_Real G1; - Standard_Real B1; - if (!myView().IsNull()) - { - myView()->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1); - } - theRed = (int)R1*255; - theGreen = (int)G1*255; - theBlue = (int)B1*255; - } - - /// - ///Get background color Red - /// - int GetBGColR(void) - { - int aRed, aGreen, aBlue; - BackgroundColor(aRed, aGreen, aBlue); - return aRed; - } - - /// - ///Get background color Green - /// - int GetBGColG(void) - { - int aRed, aGreen, aBlue; - BackgroundColor(aRed, aGreen, aBlue); - return aGreen; - } - - /// - ///Get background color Blue - /// - int GetBGColB(void) - { - int aRed, aGreen, aBlue; - BackgroundColor(aRed, aGreen, aBlue); - return aBlue; - } - - /// - ///Update current viewer - /// - void UpdateCurrentViewer(void) - { - if (!myAISContext().IsNull()) - { - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Front side - /// - void FrontView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_Yneg); - } - } - - /// - ///Top side - /// - void TopView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_Zpos); - } - } - - /// - ///Left side - /// - void LeftView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_Xneg); - } - } - - /// - ///Back side - /// - void BackView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_Ypos); - } - } - - /// - ///Right side - /// - void RightView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_Xpos); - } - } - - /// - ///Bottom side - /// - void BottomView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_Zneg); - } - } - - /// - ///Axo side - /// - void AxoView(void) - { - if (!myView().IsNull()) - { - myView()->SetProj(V3d_XposYnegZpos); - } - } - - /// - ///Scale - /// - float Scale(void) - { - if (myView().IsNull()) - { - return -1; - } - else - { - return (float)myView()->Scale(); - } - } - - /// - ///Zoom in all view - /// - void ZoomAllView(void) - { - if (!myView().IsNull()) - { - myView()->FitAll(); - myView()->ZFitAll(); - } - } - - /// - ///Reset view - /// - void Reset(void) - { - if (!myView().IsNull()) - { - myView()->Reset(); - } - } - - /// - ///Set display mode of objects - /// - /// Set current mode - void SetDisplayMode(int theMode) - { - if (myAISContext().IsNull()) - { - return; - } - AIS_DisplayMode aCurrentMode; - if (theMode == 0) - { - aCurrentMode=AIS_WireFrame; - } - else - { - aCurrentMode=AIS_Shaded; - } - - if(myAISContext()->NbSelected()==0) - { - myAISContext()->SetDisplayMode (aCurrentMode, Standard_False); - } - else - { - for(myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetDisplayMode (myAISContext()->SelectedInteractive(), theMode, Standard_False); - } - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///Set color - /// - void SetColor(int theR, int theG, int theB) - { - if (myAISContext().IsNull()) - { - return; - } - Quantity_Color aCol = Quantity_Color(theR/255.,theG/255.,theB/255.,Quantity_TOC_RGB); - for (; myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol, Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///Get object color red - /// - int GetObjColR(void) - { - int aRed, aGreen, aBlue; - ObjectColor(aRed, aGreen, aBlue); - return aRed; - } - - /// - ///Get object color green - /// - int GetObjColG(void) - { - int aRed, aGreen, aBlue; - ObjectColor(aRed, aGreen, aBlue); - return aGreen; - } - - /// - ///Get object color R/G/B - /// - void ObjectColor(int& theRed, int& theGreen, int& theBlue) - { - if (myAISContext().IsNull()) - { - return; - } - theRed=255; - theGreen=255; - theBlue=255; - Handle(AIS_InteractiveObject) aCurrent ; - myAISContext()->InitSelected(); - if (!myAISContext()->MoreSelected()) - { - return; - } - aCurrent = myAISContext()->SelectedInteractive(); - if ( aCurrent->HasColor () ) - { - Quantity_Color anObjCol; - myAISContext()->Color (aCurrent, anObjCol); - Standard_Real r1, r2, r3; - anObjCol.Values(r1, r2, r3, Quantity_TOC_RGB); - theRed=(int)r1*255; - theGreen=(int)r2*255; - theBlue=(int)r3*255; - } - } - - /// - ///Get object color blue - /// - int GetObjColB(void) - { - int aRed, aGreen, aBlue; - ObjectColor(aRed, aGreen, aBlue); - return aBlue; - } - - /// - ///Set background color R/G/B - /// - void SetBackgroundColor(int theRed, int theGreen, int theBlue) - { - if (!myView().IsNull()) - { - myView()->SetBackgroundColor(Quantity_TOC_RGB, theRed/255.,theGreen/255.,theBlue/255.); - } - } - - /// - ///Erase objects - /// - void EraseObjects(void) - { - if (myAISContext().IsNull()) - { - return; - } - - myAISContext()->EraseSelected (Standard_False); - myAISContext()->ClearSelected (Standard_True); - } - - /// - ///Get version - /// - float GetOCCVersion(void) - { - return (float)OCC_VERSION; - } - - /// - ///set material - /// - void SetMaterial(int theMaterial) - { - if (myAISContext().IsNull()) - { - return; - } - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetMaterial (myAISContext()->SelectedInteractive(), (Graphic3d_NameOfMaterial)theMaterial, Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///set transparency - /// - void SetTransparency(int theTrans) - { - if (myAISContext().IsNull()) - { - return; - } - for( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() ) - { - myAISContext()->SetTransparency (myAISContext()->SelectedInteractive(), ((Standard_Real)theTrans) / 10.0, Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///Return true if object is selected - /// - bool IsObjectSelected(void) - { - if (myAISContext().IsNull()) - { - return false; - } - myAISContext()->InitSelected(); - return myAISContext()->MoreSelected() != Standard_False; - } - - /// - ///Return display mode - /// - int DisplayMode(void) - { - if (myAISContext().IsNull()) - { - return -1; - } - int aMode = -1; - bool OneOrMoreInShading = false; - bool OneOrMoreInWireframe = false; - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - if ( myAISContext()->IsDisplayed( myAISContext()->SelectedInteractive(), 1 ) ) - { - OneOrMoreInShading = true; - } - if ( myAISContext()->IsDisplayed( myAISContext()->SelectedInteractive(), 0 ) ) - { - OneOrMoreInWireframe = true; - } - } - if (OneOrMoreInShading && OneOrMoreInWireframe) - { - aMode=10; - } - else if(OneOrMoreInShading) - { - aMode=1; - } - else if (OneOrMoreInWireframe) - { - aMode=0; - } - - return aMode; - } - - /// - ///Create new view - /// - /// System.IntPtr that contains the window handle (HWND) of the control - void CreateNewView(System::IntPtr theWnd) - { - if (myAISContext().IsNull()) - { - return; - } - myView() = myAISContext()->CurrentViewer()->CreateView(); - if (myGraphicDriver().IsNull()) - { - myGraphicDriver() = new OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)()); - } - Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast (theWnd.ToPointer())); - myView()->SetWindow(aWNTWindow); - Standard_Integer w=100, h=100; - aWNTWindow->Size(w,h); - if (!aWNTWindow->IsMapped()) - { - aWNTWindow->Map(); - } - } - - /// - ///Set AISContext - /// - bool SetAISContext(OCCTProxy^ theViewer) - { - this->myAISContext() = theViewer->GetContext(); - if (myAISContext().IsNull()) - { - return false; - } - return true; - } - - /// - ///Get AISContext - /// - Handle(AIS_InteractiveContext) GetContext(void) - { - return myAISContext(); - } - -public: - // ============================================ - // Import / export functionality - // ============================================ - - /// - ///Import BRep file - /// - /// Name of import file - bool ImportBrep(System::String^ theFileName) - { - return ImportBrep (toAsciiString (theFileName)); - } - - /// - ///Import BRep file - /// - /// Name of import file - bool ImportBrep (const TCollection_AsciiString& theFileName) - { - TopoDS_Shape aShape; - BRep_Builder aBuilder; - Standard_Boolean isResult = BRepTools::Read(aShape,theFileName.ToCString(),aBuilder); - if (!isResult) - { - return false; - } - - myAISContext()->Display (new AIS_Shape (aShape), Standard_True); - return true; - } - - /// - ///Import Step file - /// - /// Name of import file - bool ImportStep(const TCollection_AsciiString& theFileName) - { - STEPControl_Reader aReader; - IFSelect_ReturnStatus aStatus = aReader.ReadFile(theFileName.ToCString()); - if ( aStatus == IFSelect_RetDone ) - { - bool isFailsonly = false; - aReader.PrintCheckLoad( isFailsonly, IFSelect_ItemsByEntity ); - - int aNbRoot = aReader.NbRootsForTransfer(); - aReader.PrintCheckTransfer( isFailsonly, IFSelect_ItemsByEntity ); - for ( Standard_Integer n = 1; n <= aNbRoot; n++ ) - { - Standard_Boolean ok = aReader.TransferRoot( n ); - int aNbShap = aReader.NbShapes(); - if ( aNbShap > 0 ) - { - for ( int i = 1; i <= aNbShap; i++ ) - { - TopoDS_Shape aShape = aReader.Shape( i ); - myAISContext()->Display (new AIS_Shape (aShape), Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - } - } - else - { - return false; - } - - return true; - } - - /// - ///Import Iges file - /// - /// Name of import file - bool ImportIges(const TCollection_AsciiString& theFileName) - { - IGESControl_Reader aReader; - int aStatus = aReader.ReadFile( theFileName.ToCString() ); - - if ( aStatus == IFSelect_RetDone ) - { - aReader.TransferRoots(); - TopoDS_Shape aShape = aReader.OneShape(); - myAISContext()->Display (new AIS_Shape (aShape), Standard_False); - } - else - { - return false; - } - - myAISContext()->UpdateCurrentViewer(); - return true; - } - - /// - ///Export BRep file - /// - /// Name of export file - bool ExportBRep(const TCollection_AsciiString& theFileName) - { - myAISContext()->InitSelected(); - if (!myAISContext()->MoreSelected()) - { - return false; - } - - Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive(); - Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast(anIO); - return BRepTools::Write (anIS->Shape(), theFileName.ToCString()) != Standard_False; - } - - /// - ///Export Step file - /// - /// Name of export file - bool ExportStep(const TCollection_AsciiString& theFileName) - { - STEPControl_StepModelType aType = STEPControl_AsIs; - IFSelect_ReturnStatus aStatus; - STEPControl_Writer aWriter; - for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() ) - { - Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive(); - Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO); - TopoDS_Shape aShape = anIS->Shape(); - aStatus = aWriter.Transfer( aShape , aType ); - if ( aStatus != IFSelect_RetDone ) - { - return false; - } - } - - aStatus = aWriter.Write(theFileName.ToCString()); - if ( aStatus != IFSelect_RetDone ) - { - return false; - } - - return true; - } - - /// - ///Export Iges file - /// - /// Name of export file - bool ExportIges(const TCollection_AsciiString& theFileName) - { - IGESControl_Controller::Init(); - IGESControl_Writer aWriter( Interface_Static::CVal( "XSTEP.iges.unit" ), - Interface_Static::IVal( "XSTEP.iges.writebrep.mode" ) ); - - for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() ) - { - Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive(); - Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO); - TopoDS_Shape aShape = anIS->Shape(); - aWriter.AddShape ( aShape ); - } - - aWriter.ComputeModel(); - return aWriter.Write(theFileName.ToCString()) != Standard_False; - } - - /// - ///Export Vrml file - /// - /// Name of export file - bool ExportVrml(const TCollection_AsciiString& theFileName) - { - TopoDS_Compound aRes; - BRep_Builder aBuilder; - aBuilder.MakeCompound( aRes ); - - for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() ) - { - Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive(); - Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO); - TopoDS_Shape aShape = anIS->Shape(); - if ( aShape.IsNull() ) - { - return false; - } - - aBuilder.Add( aRes, aShape ); - } - - VrmlAPI_Writer aWriter; - aWriter.Write(aRes, theFileName.ToCString()); - - return true; - } - - /// - ///Export Stl file - /// - /// Name of export file - bool ExportStl(const TCollection_AsciiString& theFileName) - { - TopoDS_Compound aComp; - BRep_Builder aBuilder; - aBuilder.MakeCompound( aComp ); - - for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() ) - { - Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive(); - Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO); - TopoDS_Shape aShape = anIS->Shape(); - if ( aShape.IsNull() ) - { - return false; - } - aBuilder.Add( aComp, aShape ); - } - - StlAPI_Writer aWriter; - aWriter.Write(aComp, theFileName.ToCString()); - return true; - } - - /// - ///Define which Import/Export function must be called - /// - /// Name of Import/Export file - /// Determines format of Import/Export file - /// Determines is Import or not - bool TranslateModel(System::String^ theFileName, int theFormat, bool theIsImport) - { - bool isResult; - - const TCollection_AsciiString aFilename = toAsciiString (theFileName); - if (theIsImport) - { - switch(theFormat) - { - case 0: - isResult = ImportBrep(aFilename); - break; - case 1: - isResult = ImportStep(aFilename); - break; - case 2: - isResult = ImportIges(aFilename); - break; - default: - isResult = false; - } - } - else - { - switch(theFormat) - { - case 0: - isResult = ExportBRep(aFilename); - break; - case 1: - isResult = ExportStep(aFilename); - break; - case 2: - isResult = ExportIges(aFilename); - break; - case 3: - isResult = ExportVrml(aFilename); - break; - case 4: - isResult = ExportStl(aFilename); - break; - case 5: - isResult = Dump(aFilename); - break; - default: - isResult = false; - } - } - return isResult; - } - - /// - ///Initialize OCCTProxy - /// - void InitOCCTProxy(void) - { - myGraphicDriver()=NULL; - myViewer()=NULL; - myView()=NULL; - myAISContext()=NULL; - } - -private: - // fields - NCollection_Haft myViewer; - NCollection_Haft myView; - NCollection_Haft myAISContext; - NCollection_Haft myGraphicDriver; -}; diff --git a/samples/CSharp/OCCTProxy/OCCTProxy.vcproj b/samples/CSharp/OCCTProxy/OCCTProxy.vcproj deleted file mode 100644 index 5eb62a5e01..0000000000 --- a/samples/CSharp/OCCTProxy/OCCTProxy.vcproj +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/CSharp/OCCTProxy/OCCTProxy.vcxproj b/samples/CSharp/OCCTProxy/OCCTProxy.vcxproj deleted file mode 100644 index 7e3c0265d9..0000000000 --- a/samples/CSharp/OCCTProxy/OCCTProxy.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {969912D9-78E7-4AB8-B4FF-6B52B4F03991} - OCCTProxy - Win32Proj - - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - true - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - ..\win32\$(VCVER)\bind\ - obj\$(Platform)\$(Configuration)\ - true - ..\win64\$(VCVER)\bind\ - obj\$(Platform)\$(Configuration)\ - true - ..\win32\$(VCVER)\bin\ - obj\$(Platform)\$(Configuration)\ - false - ..\win64\$(VCVER)\bin\ - obj\$(Platform)\$(Configuration)\ - false - - - stdcpp17 - - - - Disabled - ..\OCC\;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - false - Default - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - true - $(OutDir)OCCTProxy.pdb - Windows - false - - - $(OutDir)OCCTProxy.lib - MachineX86 - - - - - X64 - - - Disabled - ..\OCC\;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - false - Default - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - true - $(OutDir)OCCTProxy.pdb - Windows - false - - - $(OutDir)OCCTProxy.lib - MachineX64 - - - - - ..\OCC\;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - Windows - true - true - false - - - $(OutDir)OCCTProxy.lib - MachineX86 - - - - - X64 - - - ..\OCC\;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - Windows - true - true - false - - - $(OutDir)OCCTProxy.lib - MachineX64 - - - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp b/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp deleted file mode 100644 index 446d1fabf2..0000000000 --- a/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp +++ /dev/null @@ -1,989 +0,0 @@ -// Prevent Windows from defining min/max macros -#ifndef NOMINMAX - #define NOMINMAX -#endif - -#include -#include - -// include required OCCT headers -#include -#include -#include -//for OCC graphic -#include -#include -#include -#include -#include -#include -#include -//for object display -#include -#include -#include -#include -//topology -#include -#include -//brep tools -#include -#include -// iges I/E -#include -#include -#include -#include -#include -//step I/E -#include -#include -//for stl export -#include -//for vrml export -#include -//wrapper of pure C++ classes to ref classes -#include - -#include - -// list of required OCCT libraries -#pragma comment(lib, "TKernel.lib") -#pragma comment(lib, "TKMath.lib") -#pragma comment(lib, "TKBRep.lib") -#pragma comment(lib, "TKXSBase.lib") -#pragma comment(lib, "TKService.lib") -#pragma comment(lib, "TKV3d.lib") -#pragma comment(lib, "TKOpenGl.lib") -#pragma comment(lib, "TKD3dHost.lib") -#pragma comment(lib, "TKDEIGES.lib") -#pragma comment(lib, "TKDESTEP.lib") -#pragma comment(lib, "TKDESTL.lib") -#pragma comment(lib, "TKDEVRML.lib") -#pragma comment(lib, "TKLCAF.lib") - -#pragma comment(lib, "D3D9.lib") - -//! Auxiliary tool for converting C# string into UTF-8 string. -static TCollection_AsciiString toAsciiString (String^ theString) -{ - if (theString == nullptr) - { - return TCollection_AsciiString(); - } - - pin_ptr aPinChars = PtrToStringChars (theString); - const wchar_t* aWCharPtr = aPinChars; - if (aWCharPtr == NULL - || *aWCharPtr == L'\0') - { - return TCollection_AsciiString(); - } - return TCollection_AsciiString (aWCharPtr); -} - -/// -/// Proxy class encapsulating calls to OCCT C++ classes within -/// C++/CLI class visible from .Net (CSharp) -/// -public ref class OCCTProxyD3D -{ -public: - - OCCTProxyD3D() {} - - // ============================================ - // Viewer functionality - // ============================================ - - /// - ///Initialize a viewer - /// - /// System.IntPtr that contains the window handle (HWND) of the control - bool InitViewer() - { - myGraphicDriver() = new D3DHost_GraphicDriver(); - myGraphicDriver()->ChangeOptions().buffersNoSwap = true; - //myGraphicDriver()->ChangeOptions().contextDebug = true; - - myViewer() = new V3d_Viewer (myGraphicDriver()); - myViewer()->SetDefaultLights(); - myViewer()->SetLightOn(); - myView() = myViewer()->CreateView(); - - static Handle(WNT_WClass) aWClass = new WNT_WClass ("OCC_Viewer", NULL, CS_OWNDC); - Handle(WNT_Window) aWNTWindow = new WNT_Window ("OCC_Viewer", aWClass, WS_POPUP, 64, 64, 64, 64); - aWNTWindow->SetVirtual (Standard_True); - myView()->SetWindow(aWNTWindow); - myAISContext() = new AIS_InteractiveContext (myViewer()); - myAISContext()->UpdateCurrentViewer(); - myView()->MustBeResized(); - return true; - } - - /// Resizes custom FBO for Direct3D output. - System::IntPtr ResizeBridgeFBO (int theWinSizeX, - int theWinSizeY) - { - Handle(WNT_Window) aWNTWindow = Handle(WNT_Window)::DownCast (myView()->Window()); - aWNTWindow->SetPos (0, 0, theWinSizeX, theWinSizeY); - myView()->MustBeResized(); - myView()->Invalidate(); - return System::IntPtr(Handle(D3DHost_View)::DownCast (myView()->View())->D3dColorSurface()); - } - - /// - /// Make dump of current view to file - /// - /// Name of dump file - bool Dump (const TCollection_AsciiString& theFileName) - { - if (myView().IsNull()) - { - return false; - } - myView()->Redraw(); - return myView()->Dump (theFileName.ToCString()) != Standard_False; - } - - /// - ///Redraw view - /// - void RedrawView() - { - if (!myView().IsNull()) - { - myView()->Redraw(); - } - } - - /// - ///Update view - /// - void UpdateView(void) - { - if (!myView().IsNull()) - { - myView()->MustBeResized(); - } - } - - /// - ///Set computed mode in false - /// - void SetDegenerateModeOn() - { - if (!myView().IsNull()) - { - myView()->SetComputedMode (Standard_False); - myView()->Redraw(); - } - } - - /// - ///Set computed mode in true - /// - void SetDegenerateModeOff() - { - if (!myView().IsNull()) - { - myView()->SetComputedMode (Standard_True); - myView()->Redraw(); - } - } - - /// - ///Fit all - /// - void WindowFitAll (int theXmin, int theYmin, - int theXmax, int theYmax) - { - if (!myView().IsNull()) - { - myView()->WindowFitAll (theXmin, theYmin, theXmax, theYmax); - } - } - - /// - ///Current place of window - /// - /// Current zoom - void Place (int theX, int theY, float theZoomFactor) - { - Standard_Real aZoomFactor = theZoomFactor; - if (!myView().IsNull()) - { - myView()->Place (theX, theY, aZoomFactor); - } - } - - /// - ///Set Zoom - /// - void Zoom (int theX1, int theY1, int theX2, int theY2) - { - if (!myView().IsNull()) - { - myView()->Zoom (theX1, theY1, theX2, theY2); - } - } - - /// - ///Set Pan - /// - void Pan (int theX, int theY) - { - if (!myView().IsNull()) - { - myView()->Pan (theX, theY); - } - } - - /// - ///Rotation - /// - void Rotation (int theX, int theY) - { - if (!myView().IsNull()) - { - myView()->Rotation (theX, theY); - } - } - - /// - ///Start rotation - /// - void StartRotation (int theX, int theY) - { - if (!myView().IsNull()) - { - myView()->StartRotation (theX, theY); - } - } - - /// - ///Select by rectangle - /// - void Select (int theX1, int theY1, int theX2, int theY2) - { - if (!myAISContext().IsNull()) - { - myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1), - Graphic3d_Vec2i (theX2, theY2), - myView()); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Select by click - /// - void Select() - { - if (!myAISContext().IsNull()) - { - myAISContext()->SelectDetected(); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Move view - /// - void MoveTo (int theX, int theY) - { - if (!myAISContext().IsNull() && !myView().IsNull()) - { - myAISContext()->MoveTo (theX, theY, myView(), Standard_True); - } - } - - /// - ///Select by rectangle with pressed "Shift" key - /// - void ShiftSelect (int theX1, int theY1, int theX2, int theY2) - { - if (!myAISContext().IsNull() && !myView().IsNull()) - { - myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1), - Graphic3d_Vec2i (theX2, theY2), - myView(), - AIS_SelectionScheme_XOR); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Select by "Shift" key - /// - void ShiftSelect() - { - if (!myAISContext().IsNull()) - { - myAISContext()->SelectDetected (AIS_SelectionScheme_XOR); - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Set background color - /// - void BackgroundColor (int& theRed, int& theGreen, int& theBlue) - { - if (!myView().IsNull()) - { - Quantity_Color aColor = myView()->BackgroundColor(); - theRed = (int )aColor.Red() * 255; - theGreen = (int )aColor.Green() * 255; - theBlue = (int )aColor.Blue() * 255; - } - } - - /// - ///Get background color Red - /// - int GetBGColR() - { - int anRgb[3]; - BackgroundColor (anRgb[0], anRgb[1], anRgb[2]); - return anRgb[0]; - } - - /// - ///Get background color Green - /// - int GetBGColG() - { - int anRgb[3]; - BackgroundColor (anRgb[0], anRgb[1], anRgb[2]); - return anRgb[1]; - } - - /// - ///Get background color Blue - /// - int GetBGColB() - { - int anRgb[3]; - BackgroundColor (anRgb[0], anRgb[1], anRgb[2]); - return anRgb[2]; - } - - /// - ///Update current viewer - /// - void UpdateCurrentViewer() - { - if (!myAISContext().IsNull()) - { - myAISContext()->UpdateCurrentViewer(); - } - } - - /// - ///Front side - /// - void FrontView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_Yneg); - } - } - - /// - ///Top side - /// - void TopView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_Zpos); - } - } - - /// - ///Left side - /// - void LeftView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_Xneg); - } - } - - /// - ///Back side - /// - void BackView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_Ypos); - } - } - - /// - ///Right side - /// - void RightView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_Xpos); - } - } - - /// - ///Bottom side - /// - void BottomView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_Zneg); - } - } - - /// - ///Axo side - /// - void AxoView() - { - if (!myView().IsNull()) - { - myView()->SetProj (V3d_XposYnegZpos); - } - } - - /// - ///Scale - /// - float Scale() - { - return myView().IsNull() - ? -1.0f - : float(myView()->Scale()); - } - - /// - ///Zoom in all view - /// - void ZoomAllView() - { - if (!myView().IsNull()) - { - myView()->FitAll(); - myView()->ZFitAll(); - } - } - - /// - ///Reset view - /// - void Reset() - { - if (!myView().IsNull()) - { - myView()->Reset(); - } - } - - /// - ///Set display mode of objects - /// - /// Set current mode - void SetDisplayMode (int theMode) - { - if (myAISContext().IsNull()) - { - return; - } - - AIS_DisplayMode aCurrentMode = theMode == 0 - ? AIS_WireFrame - : AIS_Shaded; - if (myAISContext()->NbSelected() == 0) - { - myAISContext()->SetDisplayMode (aCurrentMode, Standard_False); - } - else - { - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetDisplayMode (myAISContext()->SelectedInteractive(), theMode, Standard_False); - } - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///Set color - /// - void SetColor (int theR, int theG, int theB) - { - if (myAISContext().IsNull()) - { - return; - } - - Quantity_Color aCol (theR / 255.0, theG / 255.0, theB / 255.0, Quantity_TOC_RGB); - for (; myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol, false); - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///Get object color red - /// - int GetObjColR() - { - int anRgb[3]; - ObjectColor (anRgb[0], anRgb[1], anRgb[2]); - return anRgb[0]; - } - - /// - ///Get object color green - /// - int GetObjColG() - { - int anRgb[3]; - ObjectColor (anRgb[0], anRgb[1], anRgb[2]); - return anRgb[1]; - } - - /// - ///Get object color blue - /// - int GetObjColB() - { - int anRgb[3]; - ObjectColor (anRgb[0], anRgb[1], anRgb[2]); - return anRgb[2]; - } - - /// - ///Get object color R/G/B - /// - void ObjectColor (int& theRed, int& theGreen, int& theBlue) - { - if (myAISContext().IsNull()) - { - return; - } - - theRed = 255; - theGreen = 255; - theBlue = 255; - myAISContext()->InitSelected(); - if (!myAISContext()->MoreSelected()) - { - return; - } - - Handle(AIS_InteractiveObject) aCurrent = myAISContext()->SelectedInteractive(); - if (aCurrent->HasColor()) - { - Quantity_Color anObjCol; - myAISContext()->Color (aCurrent, anObjCol); - theRed = int(anObjCol.Red() * 255.0); - theGreen = int(anObjCol.Green() * 255.0); - theBlue = int(anObjCol.Blue() * 255.0); - } - } - - /// - ///Set background color R/G/B - /// - void SetBackgroundColor (int theRed, int theGreen, int theBlue) - { - if (!myView().IsNull()) - { - myView()->SetBackgroundColor (Quantity_TOC_RGB, theRed / 255.0, theGreen / 255.0, theBlue / 255.0); - } - } - - /// - ///Erase objects - /// - void EraseObjects() - { - if (myAISContext().IsNull()) - { - return; - } - - myAISContext()->EraseSelected (Standard_False); - myAISContext()->ClearSelected (Standard_True); - } - - /// - ///Get version - /// - float GetOCCVersion() - { - return (float )OCC_VERSION; - } - - /// - ///set material - /// - void SetMaterial (int theMaterial) - { - if (myAISContext().IsNull()) - { - return; - } - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetMaterial (myAISContext()->SelectedInteractive(), (Graphic3d_NameOfMaterial )theMaterial, Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///set transparency - /// - void SetTransparency (int theTrans) - { - if (myAISContext().IsNull()) - { - return; - } - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - myAISContext()->SetTransparency (myAISContext()->SelectedInteractive(), ((Standard_Real )theTrans) / 10.0, Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - - /// - ///Return true if object is selected - /// - bool IsObjectSelected() - { - if (myAISContext().IsNull()) - { - return false; - } - myAISContext()->InitSelected(); - return myAISContext()->MoreSelected() != Standard_False; - } - - /// - ///Return display mode - /// - int DisplayMode() - { - if (myAISContext().IsNull()) - { - return -1; - } - - bool isOneOrMoreInShading = false; - bool isOneOrMoreInWireframe = false; - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - if (myAISContext()->IsDisplayed (myAISContext()->SelectedInteractive(), AIS_Shaded)) - { - isOneOrMoreInShading = true; - } - if (myAISContext()->IsDisplayed (myAISContext()->SelectedInteractive(), AIS_WireFrame)) - { - isOneOrMoreInWireframe = true; - } - } - if (isOneOrMoreInShading - && isOneOrMoreInWireframe) - { - return 10; - } - else if (isOneOrMoreInShading) - { - return 1; - } - else if (isOneOrMoreInWireframe) - { - return 0; - } - return -1; - } - - /// - ///Set AISContext - /// - bool SetAISContext (OCCTProxyD3D^ theViewer) - { - this->myAISContext() = theViewer->GetContext(); - if (myAISContext().IsNull()) - { - return false; - } - return true; - } - - /// - ///Get AISContext - /// - Handle(AIS_InteractiveContext) GetContext() - { - return myAISContext(); - } - -public: - // ============================================ - // Import / export functionality - // ============================================ - - /// - ///Import BRep file - /// - /// Name of import file - bool ImportBrep (System::String^ theFileName) - { - return ImportBrep (toAsciiString (theFileName)); - } - - /// - ///Import BRep file - /// - /// Name of import file - bool ImportBrep (const TCollection_AsciiString& theFileName) - { - TopoDS_Shape aShape; - BRep_Builder aBuilder; - if (!BRepTools::Read (aShape, theFileName.ToCString(), aBuilder)) - { - return false; - } - - Handle(AIS_Shape) aPrs = new AIS_Shape (aShape); - myAISContext()->SetMaterial (aPrs, Graphic3d_NameOfMaterial_Gold, Standard_False); - myAISContext()->SetDisplayMode(aPrs, AIS_Shaded, Standard_False); - myAISContext()->Display (aPrs, Standard_True); - return true; - } - - /// - ///Import Step file - /// - /// Name of import file - bool ImportStep (const TCollection_AsciiString& theFileName) - { - STEPControl_Reader aReader; - if (aReader.ReadFile (theFileName.ToCString()) != IFSelect_RetDone) - { - return false; - } - - bool isFailsonly = false; - aReader.PrintCheckLoad( isFailsonly, IFSelect_ItemsByEntity ); - - int aNbRoot = aReader.NbRootsForTransfer(); - aReader.PrintCheckTransfer (isFailsonly, IFSelect_ItemsByEntity); - for (Standard_Integer aRootIter = 1; aRootIter <= aNbRoot; ++aRootIter) - { - aReader.TransferRoot (aRootIter); - int aNbShap = aReader.NbShapes(); - if (aNbShap > 0) - { - for (int aShapeIter = 1; aShapeIter <= aNbShap; ++aShapeIter) - { - myAISContext()->Display (new AIS_Shape (aReader.Shape (aShapeIter)), Standard_False); - } - myAISContext()->UpdateCurrentViewer(); - } - } - return true; - } - - /// - ///Import Iges file - /// - /// Name of import file - bool ImportIges (const TCollection_AsciiString& theFileName) - { - IGESControl_Reader aReader; - if (aReader.ReadFile (theFileName.ToCString()) != IFSelect_RetDone) - { - return false; - } - - aReader.TransferRoots(); - TopoDS_Shape aShape = aReader.OneShape(); - myAISContext()->Display (new AIS_Shape (aShape), Standard_False); - myAISContext()->UpdateCurrentViewer(); - return true; - } - - /// - ///Export BRep file - /// - /// Name of export file - bool ExportBRep (const TCollection_AsciiString& theFileName) - { - myAISContext()->InitSelected(); - if (!myAISContext()->MoreSelected()) - { - return false; - } - - Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive()); - return !anIS.IsNull() - && BRepTools::Write (anIS->Shape(), theFileName.ToCString()); - } - - /// - ///Export Step file - /// - /// Name of export file - bool ExportStep (const TCollection_AsciiString& theFileName) - { - STEPControl_StepModelType aType = STEPControl_AsIs; - STEPControl_Writer aWriter; - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive()); - if (anIS.IsNull()) - { - return false; - } - - TopoDS_Shape aShape = anIS->Shape(); - if (aWriter.Transfer (aShape, aType) != IFSelect_RetDone) - { - return false; - } - } - return aWriter.Write (theFileName.ToCString()) == IFSelect_RetDone; - } - - /// - ///Export Iges file - /// - /// Name of export file - bool ExportIges (const TCollection_AsciiString& theFileName) - { - IGESControl_Controller::Init(); - IGESControl_Writer aWriter (Interface_Static::CVal ("XSTEP.iges.unit"), - Interface_Static::IVal ("XSTEP.iges.writebrep.mode")); - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive()); - if (anIS.IsNull()) - { - return false; - } - - aWriter.AddShape (anIS->Shape()); - } - - aWriter.ComputeModel(); - return aWriter.Write (theFileName.ToCString()) != Standard_False; - } - - /// - ///Export Vrml file - /// - /// Name of export file - bool ExportVrml (const TCollection_AsciiString& theFileName) - { - TopoDS_Compound aRes; - BRep_Builder aBuilder; - aBuilder.MakeCompound (aRes); - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive()); - if (anIS.IsNull()) - { - return false; - } - aBuilder.Add (aRes, anIS->Shape()); - } - - VrmlAPI_Writer aWriter; - aWriter.Write (aRes, theFileName.ToCString()); - return true; - } - - /// - ///Export Stl file - /// - /// Name of export file - bool ExportStl (const TCollection_AsciiString& theFileName) - { - TopoDS_Compound aComp; - BRep_Builder aBuilder; - aBuilder.MakeCompound (aComp); - for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected()) - { - Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive()); - if (anIS.IsNull()) - { - return false; - } - aBuilder.Add (aComp, anIS->Shape()); - } - - StlAPI_Writer aWriter; - aWriter.Write (aComp, theFileName.ToCString()); - return true; - } - - /// - ///Define which Import/Export function must be called - /// - /// Name of Import/Export file - /// Determines format of Import/Export file - /// Determines is Import or not - bool TranslateModel (System::String^ theFileName, int theFormat, bool theIsImport) - { - bool isResult = false; - const TCollection_AsciiString aFilename = toAsciiString (theFileName); - if (theIsImport) - { - switch (theFormat) - { - case 0: isResult = ImportBrep (aFilename); break; - case 1: isResult = ImportStep (aFilename); break; - case 2: isResult = ImportIges (aFilename); break; - } - } - else - { - switch (theFormat) - { - case 0: isResult = ExportBRep (aFilename); break; - case 1: isResult = ExportStep (aFilename); break; - case 2: isResult = ExportIges (aFilename); break; - case 3: isResult = ExportVrml (aFilename); break; - case 4: isResult = ExportStl (aFilename); break; - case 5: isResult = Dump (aFilename); break; - } - } - return isResult; - } - - /// - ///Initialize OCCTProxyD3D - /// - void InitOCCTProxy() - { - myGraphicDriver().Nullify(); - myViewer().Nullify(); - myView().Nullify(); - myAISContext().Nullify(); - } - -private: - - NCollection_Haft myViewer; - NCollection_Haft myView; - NCollection_Haft myAISContext; - NCollection_Haft myGraphicDriver; - -}; diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj b/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj deleted file mode 100644 index 7ab2689cd6..0000000000 --- a/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj b/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj deleted file mode 100644 index ac8c560f62..0000000000 --- a/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj +++ /dev/null @@ -1,201 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {969912D9-78E7-4AB8-B4FF-6B52B4F03991} - OCCTProxy_D3D - Win32Proj - OCCTProxy_D3D - - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - true - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - ..\win32\$(VCVER)\bind\ - obj\$(Platform)\$(Configuration)\ - false - ..\win64\$(VCVER)\bind\ - obj\$(Platform)\$(Configuration)\ - false - ..\win32\$(VCVER)\bin\ - obj\$(Platform)\$(Configuration)\ - false - ..\win64\$(VCVER)\bin\ - obj\$(Platform)\$(Configuration)\ - false - - - stdcpp17 - - - - Disabled - ..\OCC\;$(CSF_OCCTIncludePath);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories) - _DEBUG;%(PreprocessorDefinitions) - false - Default - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy_D3D.dll - $(CSF_OCCTLibPath);$(DXSDK_DIR)Lib\x86;%(AdditionalLibraryDirectories) - true - true - $(OutDir)OCCTProxy_D3D.pdb - Windows - false - - - $(OutDir)OCCTProxy_D3D.lib - MachineX86 - d3d9.lib;d3dx9d.lib;%(AdditionalDependencies) - - - - - X64 - - - Disabled - ..\OCC\;$(CSF_OCCTIncludePath);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories) - _DEBUG;%(PreprocessorDefinitions) - false - Default - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy_D3D.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - true - $(OutDir)OCCTProxy_D3D.pdb - Windows - false - - - $(OutDir)OCCTProxy_D3D.lib - MachineX64 - - - - - ..\OCC\;$(CSF_OCCTIncludePath);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy_D3D.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - Windows - true - true - false - - - $(OutDir)OCCTProxy_D3D.lib - MachineX86 - - - - - X64 - - - ..\OCC\;$(CSF_OCCTIncludePath);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - $(OutDir)OCCTProxy_D3D.dll - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - Windows - true - true - false - - - $(OutDir)OCCTProxy_D3D.lib - MachineX64 - - - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/ReadMe.md b/samples/CSharp/ReadMe.md deleted file mode 100644 index a64ca6bc35..0000000000 --- a/samples/CSharp/ReadMe.md +++ /dev/null @@ -1,54 +0,0 @@ -.NET: Import/Export (C#|C++/CLI|WinForms|WPF) {#samples_csharp_occt} -================== - -This sample demonstrates how to use OCCT libraries in .Net application -written using **CSharp** and **Windows Forms** or **Windows Presentation Foundation** (WPF). -The sample could be found within OCCT repository in folder `/samples/CSharp/`. - -The connection between .Net and OCCT (C++) level is provided by proxy library -**OCCProxy**, written in C++/CLI. The proxy library contains a single *ref* class -encapsulating OCCT viewer and providing the functionality to manipulate this viewer -and to import / export OCCT shapes from / to several supported CAD file formats (IGES, STEP, BREP). - -The sample implements two approaches to the development of a user interface with C#. -Both applications provide the same functionality as the standard OCCT Import/Export sample. -The first project is called *IE_WinForms* and uses Windows Forms for GUI. -The second application is called *IE_WPF_WinForms* and uses Windows Presentation Foundation. - -@figure{samples_c__ie.png} - -Note a few important details: - -- OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class; - -- It is necessary to explicitly set the target platform for C# assemblies to *x86* - in project **Properties - Build** to work consistently on 64-bit systems with OCCT libraries built in 32-bit mode; - -- this sample demonstrates indirect method of wrapping C++ to C# using a manually - created proxy library. There is an alternative method of wrapping individual - OCCT classes to C# equivalents to make their full API available to a C# user - and to let the code be programmed on C# level similarly to C++ one. See the description - of **OCCT C# Wrapper** in **Advanced Samples and Tools** at - http://www.opencascade.org/support/products/advsamples - -- in WPF sample, **WinForms** control is used to encapsulate OCC viewer since WPF - does not provide the necessary interface to embed OpenGl view. Other possible - solution could be to render OpenGl scene in an off-screen buffer and to map it - to WPF control as an image. That approach would allow using all WPF features to - control the OCCT viewer. - -Run *msvc.bat* to start MS Visual Studio for building the sample. -Note that project files are provided only for VS 2010, you can open them in -newer versions of Visual Studio the using automatic converter. - -After conversion check option **Target framework** in the properties of C# projects -(tab **Application**) to make sure that it corresponds to the version set in -the properties of C++ projects (e.g. .Net Framework 4.0 for VS 2010). - -Run *run_winforms.bat* or *run_wpf.bat* to launch the corresponding sample. - -Note that all batch scripts use the configuration defined in OCCT *custom.bat* file -as default; you can provide arguments specifying VS version, bitness, and mode -to override these settings, e.g.: - - > msvc.bat vc10 win64 Debug diff --git a/samples/CSharp/ReadMe_D3D.md b/samples/CSharp/ReadMe_D3D.md deleted file mode 100644 index 7c1649d348..0000000000 --- a/samples/CSharp/ReadMe_D3D.md +++ /dev/null @@ -1,55 +0,0 @@ -.NET: D3D/OpenGL Viewer (C#|C++/CLI|WPF) {#samples_csharp_direct3d} -================== - -This sample demonstrates how to use OCCT and DirectX libraries in .Net application -written using **CSharp** and **Windows Presentation Foundation** (WPF). -The sample could be found within OCCT repository in folder `/samples/CSharp/`. - -The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraries, -**OCCProxy** and **D3DProxy**, written in C++/CLI. The proxy library **OCCProxy** contains a single -*ref* class encapsulating OCCT viewer and providing the functionality to manipulate this viewer -and to import / export OCCT shapes from / to several supported CAD file formats (IGES, STEP, -BREP). The proxy library **D3DProxy** contains helper methods for rendering via DirectX. - -The user interface in this sample is based on Windows Presentation Foundation (WPF). -It has the same functionality as the standard OCCT Import/Export sample. The project is -called *IE_WPF_D3D*. - -Note a few important details: - -- to build this sample you should to download and install DirectX SDK - http://www.microsoft.com/en-us/download/details.aspx?id=6812 - -- OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class; - -- It is necessary to explicitly set the target platform for C# assemblies to *x86* - in project **Properties - Build** to work consistently on 64-bit systems with OCCT libraries built in 32-bit mode; - -- this sample demonstrates indirect method of wrapping C++ to C# using a manually - created proxy library. There is an alternative method of wrapping individual - OCCT classes to C# equivalents to make their full API available to a C# user - and to let the code be programmed on C# level similarly to C++ one. See the description - of **OCCT C# Wrapper** in **Advanced Samples and Tools** at - http://www.opencascade.org/support/products/advsamples - -- in WPF sample, **WinForms** control is used to encapsulate OCC viewer since WPF - does not provide the necessary interface to embed OpenGl view. Other possible - solution could be to render OpenGl scene in an off-screen buffer and to map it - to WPF control as an image. That approach would allow using all WPF features to - control the OCCT viewer. - -Run *msvc.bat* to start MS Visual Studio for building the sample. -Note that project files are provided only for VS 2010, you can open them in -newer versions of Visual Studio using an automatic converter. - -After conversion check option **Target framework** in the properties of C# projects -(tab **Application**) to make sure that it corresponds to the version set in -the properties of C++ projects (e.g. .Net Framework 4.0 for VS 2010). - -Run *run_wpf-D3D.bat* to launch the corresponding sample. - -Note that all batch scripts use the configuration defined in OCCT *custom.bat* file -as default; you can provide arguments specifying VS version, bitness, and mode -to override these settings, e.g.: - - > msvc.bat vc10 win64 Debug diff --git a/samples/CSharp/WPF_D3D/About.xaml b/samples/CSharp/WPF_D3D/About.xaml deleted file mode 100644 index c9f4fb29fe..0000000000 --- a/samples/CSharp/WPF_D3D/About.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/samples/CSharp/WPF_D3D/MainWindow.xaml.cs b/samples/CSharp/WPF_D3D/MainWindow.xaml.cs deleted file mode 100644 index fab4967e0d..0000000000 --- a/samples/CSharp/WPF_D3D/MainWindow.xaml.cs +++ /dev/null @@ -1,695 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Forms.Integration; -using System.Windows.Interop; -using System.Runtime.InteropServices; - -namespace IE_WPF_D3D -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window, INotifyPropertyChanged - { - public event PropertyChangedEventHandler PropertyChanged; - protected void RaisePropertyChanged (string thePropertyName) - { - if (PropertyChanged != null) - { - PropertyChanged (this, new PropertyChangedEventArgs (thePropertyName)); - } - } - - public MainWindow () - { - InitializeComponent (); - - StatusBarText = String.Empty; - IsHlrOffPushed = false; - IsHlrOnPushed = true; - IsZoomWinEnabled = true; - - #region menu operations - - CommandBinding aBind_New = new CommandBinding (IECommands.New); - aBind_New.Executed += NewCommand_Executed; - CommandBindings.Add (aBind_New); - - CommandBinding aBind_Close = new CommandBinding (IECommands.Close); - aBind_Close.Executed += CloseCommand_Executed; - aBind_Close.CanExecute += CloseCommand_CanExecute; - CommandBindings.Add (aBind_Close); - - CommandBinding aBind_Quit = new CommandBinding (IECommands.Quit); - aBind_Quit.Executed += QuitCommand_Executed; - CommandBindings.Add (aBind_Quit); - - CommandBinding aBind_About = new CommandBinding (IECommands.About); - aBind_About.Executed += AboutCommand_Executed; - CommandBindings.Add (aBind_About); - - #endregion - } - - private String myStatusBarText; - public String StatusBarText - { - get - { - return myStatusBarText; - } - private set - { - myStatusBarText = value; - RaisePropertyChanged ("StatusBarText"); - } - } - - private bool isHlrOffPushed; - public Boolean IsHlrOffPushed - { - get - { - return isHlrOffPushed; - } - set - { - isHlrOffPushed = value; - RaisePropertyChanged ("isHlrOffPushed"); - } - } - - private bool isHlrOnPushed; - public Boolean IsHlrOnPushed - { - get - { - return isHlrOnPushed; - } - set - { - isHlrOnPushed = value; - RaisePropertyChanged ("IsHlrOnPushed"); - } - } - - private bool isZoomWinEnabled; - public Boolean IsZoomWinEnabled - { - get - { - return isZoomWinEnabled; - } - set - { - isZoomWinEnabled = value; - RaisePropertyChanged ("IsZoomWinEnabled"); - } - } - - private OCCViewer ActiveViewer - { - get - { - if (!IsDocumentOpen) - { - return null; - } - - Grid aGrid = (ViewPanel.SelectedContent) as Grid; - - if (aGrid == null) - { - return null; - } - - return Map[aGrid].Viewer; - } - } - - public Boolean IsDocumentOpen - { - get - { - return ViewPanel.Items.Count > 0; - } - } - - private int myDocumentCounter = 1; - - Dictionary Map = new Dictionary (); - - private void NewCommand_Executed (object sender, ExecutedRoutedEventArgs e) - { - D3DViewer aViwer = new D3DViewer (); - - Grid g = new Grid (); - - Map.Add (g, aViwer); - - ImageBrush anImage = new ImageBrush (aViwer.Image); - - //anImage.RelativeTransform = new ScaleTransform (1.0, -1.0, 0.5, 0.5); - - g.Background = anImage; - g.MouseMove += new MouseEventHandler (g_MouseMove); - g.MouseDown += new MouseButtonEventHandler (g_MouseDown); - g.MouseUp += new MouseButtonEventHandler (g_MouseUp); - - g.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; - - - TabItem aNewTab = new TabItem (); - aNewTab.Content = g; - - aNewTab.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; - aNewTab.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch; - aNewTab.VerticalContentAlignment = System.Windows.VerticalAlignment.Stretch; - - g.SizeChanged += new SizeChangedEventHandler (g_SizeChanged); - - aNewTab.IsSelected = true; - aNewTab.Header = "Document " + myDocumentCounter.ToString (); - myDocumentCounter++; - - ViewPanel.Items.Add (aNewTab); - - ViewPanel.Focus (); - - // update XAML property - RaisePropertyChanged ("IsDocumentOpen"); - } - - void g_SizeChanged (object sender, SizeChangedEventArgs e) - { - if (!IsDocumentOpen) - return; - - Grid aGrid = (ViewPanel.SelectedContent) as Grid; - - if (aGrid == null) - return; - - Map[aGrid].Resize (Convert.ToInt32 (e.NewSize.Width), - Convert.ToInt32 (e.NewSize.Height)); - } - - void g_MouseUp (object sender, MouseButtonEventArgs e) - { - Grid aGrid = (ViewPanel.SelectedContent) as Grid; - - if (aGrid != null) - { - ActiveViewer.OnMouseUp(aGrid, e); - } - } - - void g_MouseDown (object sender, MouseButtonEventArgs e) - { - Grid aGrid = (ViewPanel.SelectedContent) as Grid; - - if (aGrid != null) - { - ActiveViewer.OnMouseDown(ViewPanel, e); - } - } - - void g_MouseMove (object sender, MouseEventArgs e) - { - Grid aGrid = (ViewPanel.SelectedContent) as Grid; - - if (aGrid != null) - { - ActiveViewer.OnMouseMove (aGrid, e); - } - } - - private void CloseCommand_Executed (object sender, ExecutedRoutedEventArgs e) - { - if (ViewPanel.Items.Count > 0) - { - Grid aGrid = (ViewPanel.SelectedContent) as Grid; - - if (aGrid == null) - { - return; - } - - Map[aGrid].StopRenderingScene (); - - ViewPanel.Items.Remove (ViewPanel.SelectedItem); - } - - // update XAML property - RaisePropertyChanged ("IsDocumentOpen"); - } - - private void CloseCommand_CanExecute (object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = IsDocumentOpen; - } - - private void QuitCommand_Executed (object sender, ExecutedRoutedEventArgs e) - { - this.Close (); - } - - private void ImportBRep_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ImportModel (ModelFormat.BREP); - } - } - - private void ImportIges_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ImportModel (ModelFormat.IGES); - } - } - - private void ImportStep_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ImportModel (ModelFormat.STEP); - } - } - - private void ExportBRep_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ExportModel (ModelFormat.BREP); - } - } - - private void ExportStep_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ExportModel (ModelFormat.STEP); - } - } - - private void ExportIges_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ExportModel (ModelFormat.IGES); - } - } - - private void ExportStl_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ExportModel (ModelFormat.STL); - } - } - - private void ExportVrml_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ExportModel (ModelFormat.VRML); - } - } - - private void ExportImage_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.ExportModel (ModelFormat.IMAGE); - } - } - - private void FitAllBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.FitAll (); - } - } - - private void ZoomWindowBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - IsZoomWinEnabled = false; - ActiveViewer.ZoomWindow (); - } - } - - private void DynamicZoomingBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.DynamicZooming (); - } - } - - private void DynamicPanningBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.DynamicPanning (); - } - } - - private void GlobalPanningBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.GlobalPanning (); - } - } - - private void FrontBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.FrontView (); - } - } - - private void BackBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.BackView (); - } - } - - private void TopBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.TopView (); - } - } - - private void BottomBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.BottomView (); - } - } - - private void LeftBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.LeftView (); - } - } - - private void RightBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.RightView (); - } - } - - private void AxoBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.AxoView (); - } - } - - private void ResetBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Reset (); - } - } - - private void DynamicRotationBtn_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.DynamicRotation (); - } - } - - private void HiddenOffBtn_Click (object sender, RoutedEventArgs e) - { - IsHlrOffPushed = true; - IsHlrOnPushed = false; - if (ActiveViewer != null) - { - ActiveViewer.HiddenOff (); - } - } - - private void HiddenOnBtn_Click (object sender, RoutedEventArgs e) - { - IsHlrOffPushed = false; - IsHlrOnPushed = true; - if (ActiveViewer != null) - { - ActiveViewer.HiddenOn (); - } - } - - private void AboutCommand_Executed (object sender, ExecutedRoutedEventArgs e) - { - AboutDialog aDlg = new AboutDialog (); - aDlg.ShowDialog (); - } - - private void ToolBar_MouseEnter (object sender, MouseEventArgs e) - { - StatusBarText = "Toolbar"; - } - - private void DocumentToolBar_MouseEnter (object sender, MouseEventArgs e) - { - StatusBarText = "Document toolbar"; - } - - private void ViewToolBar_MouseEnter (object sender, MouseEventArgs e) - { - StatusBarText = "View toolbar"; - } - - private void ToolBar_MouseLeave (object sender, MouseEventArgs e) - { - StatusBarText = ""; - } - - public void OnZoomingFinished (object sender, EventArgs e) - { - IsZoomWinEnabled = true; - } - - public bool IsWireframeEnabled - { - get - { - if (ActiveViewer != null) - { - return ActiveViewer.IsWireframeEnabled; - } - return false; - } - } - - private void Wireframe_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Wireframe (); - } - } - - private void Shading_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Shading (); - } - } - - public bool IsShadingEnabled - { - get - { - if (ActiveViewer != null) - { - return ActiveViewer.IsShadingEnabled; - } - return false; - } - } - - private void Color_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Color (); - } - } - - public bool IsColorEnabled - { - get - { - if (ActiveViewer != null) - { - return ActiveViewer.IsColorEnabled; - } - return false; - } - } - - private void Material_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Material (); - } - } - - public bool IsMaterialEnabled - { - get - { - if (ActiveViewer != null) - { - return ActiveViewer.IsMaterialEnabled; - } - return false; - } - } - - private void Transparency_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Transparency (); - } - } - - public bool IsTransparencyEnabled - { - get - { - if (ActiveViewer != null) - { - return ActiveViewer.IsTransparencyEnabled; - } - return false; - } - } - - private void Delete_Click (object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Delete (); - } - } - - private void Background_Click(object sender, RoutedEventArgs e) - { - if (ActiveViewer != null) - { - ActiveViewer.Background(); - } - } - - public bool IsDeleteEnabled - { - get - { - if (ActiveViewer != null) - { - return ActiveViewer.IsDeleteEnabled; - } - return false; - } - } - - private void AvaliabiltyOfOperationToolbarChanged () - { - RaisePropertyChanged ("IsWireframeEnabled"); - RaisePropertyChanged ("IsShadingEnabled"); - RaisePropertyChanged ("IsTransparencyEnabled"); - RaisePropertyChanged ("IsColorEnabled"); - RaisePropertyChanged ("IsMaterialEnabled"); - RaisePropertyChanged ("IsDeleteEnabled"); - } - - public void OnAvaliabiltyOfOperationsChanged (object sender, EventArgs e) - { - AvaliabiltyOfOperationToolbarChanged (); - } - - private void OnViewerChanged (object sender, SelectionChangedEventArgs e) - { - if (e.RemovedItems.Count > 0) - { - Grid aHost = ((e.RemovedItems[0] as TabItem).Content) as Grid; - if (aHost == null) - { - return; - } - - OCCViewer aViewer = Map[aHost].Viewer; - if (aViewer != null) - { - aViewer.ZoomingFinished -= new EventHandler (OnZoomingFinished); - aViewer.AvaliabiltyOfOperationsChanged -= new EventHandler (OnAvaliabiltyOfOperationsChanged); - } - } - - if (e.AddedItems.Count > 0) - { - Grid aHost = ((e.AddedItems[0] as TabItem).Content) as Grid; - if (aHost == null) - { - return; - } - - OCCViewer aViewer = Map[aHost].Viewer; - if (aViewer != null) - { - aViewer.ZoomingFinished += new EventHandler (OnZoomingFinished); - aViewer.AvaliabiltyOfOperationsChanged += new EventHandler (OnAvaliabiltyOfOperationsChanged); - } - } - - AvaliabiltyOfOperationToolbarChanged (); - } - - private void OnContextOpened(object sender, RoutedEventArgs e) - { - this.WireframeItem.IsEnabled = IsWireframeEnabled; - this.ShadingItem.IsEnabled = IsShadingEnabled; - this.ColorItem.IsEnabled = IsColorEnabled; - this.MaterialItem.IsEnabled = IsMaterialEnabled; - this.TransparencyItem.IsEnabled = IsTransparencyEnabled; - this.DeleteItem.IsEnabled = IsDeleteEnabled; - } - } -} diff --git a/samples/CSharp/WPF_D3D/MaterialDlg.xaml b/samples/CSharp/WPF_D3D/MaterialDlg.xaml deleted file mode 100644 index dafa734a31..0000000000 --- a/samples/CSharp/WPF_D3D/MaterialDlg.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/WPF_D3D/MaterialDlg.xaml.cs b/samples/CSharp/WPF_D3D/MaterialDlg.xaml.cs deleted file mode 100644 index 4751ed8376..0000000000 --- a/samples/CSharp/WPF_D3D/MaterialDlg.xaml.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace IE_WPF_D3D -{ - public enum Material - { - Brass, - Bronze, - Copper, - Gold, - Pewter, - Plaster, - Plastic, - Silver - } - - /// - /// Interaction logic for MaterialDlg.xaml - /// - public partial class MaterialDlg : Window - { - public MaterialDlg( OCCTProxyD3D theView ) - { - this.InitializeComponent(); - - if ( theView == null ) - { - MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" ); - } - - View = theView; - - SetInitialState(); - } - - public OCCTProxyD3D View { get; private set; } - - private void PlasterBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Plaster ); - View.UpdateCurrentViewer(); - } - - private void BrassBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Brass ); - View.UpdateCurrentViewer(); - } - - private void BronzeBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Bronze ); - View.UpdateCurrentViewer(); - } - - private void CopperBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Copper ); - View.UpdateCurrentViewer(); - } - - private void GoldBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Gold ); - View.UpdateCurrentViewer(); - } - - private void PewterBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Pewter ); - View.UpdateCurrentViewer(); - } - - private void PlasticBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Plastic ); - View.UpdateCurrentViewer(); - } - - private void SilverBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Silver ); - View.UpdateCurrentViewer(); - } - - private void SetInitialState() - { - // TODO - } - } -} \ No newline at end of file diff --git a/samples/CSharp/WPF_D3D/OCCViewer.cs b/samples/CSharp/WPF_D3D/OCCViewer.cs deleted file mode 100644 index 7ec4355bad..0000000000 --- a/samples/CSharp/WPF_D3D/OCCViewer.cs +++ /dev/null @@ -1,665 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.Windows.Input; -using System.Drawing; - -namespace IE_WPF_D3D -{ - public enum CurrentAction3d - { - CurAction3d_Nothing, - CurAction3d_DynamicZooming, - CurAction3d_WindowZooming, - CurAction3d_DynamicPanning, - CurAction3d_GlobalPanning, - CurAction3d_DynamicRotation - } - public enum CurrentPressedKey - { - CurPressedKey_Nothing, - CurPressedKey_Ctrl, - CurPressedKey_Shift - } - public enum ModelFormat - { - BREP, - STEP, - IGES, - VRML, - STL, - IMAGE - } - - public enum DisplayMode - { - Wireframe, - Shading - } - - public class OCCViewer - { - public event EventHandler ZoomingFinished; - protected void RaiseZoomingFinished () - { - if (ZoomingFinished != null) - { - ZoomingFinished (this, EventArgs.Empty); - } - } - - public event EventHandler AvaliabiltyOfOperationsChanged; - protected void RaiseAvaliabiltyOfOperationsChanged () - { - if (AvaliabiltyOfOperationsChanged != null) - { - AvaliabiltyOfOperationsChanged (this, EventArgs.Empty); - } - } - - public OCCTProxyD3D View { get; private set; } - public CurrentAction3d CurrentMode { get; private set; } - private bool IsRectVisible { get; set; } - public bool DegenerateMode { get; private set; } - - public bool IsWireframeEnabled { get; private set; } - public bool IsShadingEnabled { get; private set; } - public bool IsTransparencyEnabled { get; private set; } - public bool IsColorEnabled { get; private set; } - public bool IsMaterialEnabled { get; private set; } - public bool IsDeleteEnabled { get; private set; } - - private float myCurZoom; - private int myXmin; - private int myYmin; - private int myXmax; - private int myYmax; - private int myButtonDownX; - private int myButtonDownY; - public OCCViewer() - { - View = new OCCTProxyD3D (); - View.InitOCCTProxy (); - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - IsRectVisible = false; - DegenerateMode = true; - } - - public bool InitViewer() - { - return View.InitViewer(); - } - - public void ImportModel (ModelFormat theFormat) - { - int aFormat = 10; - OpenFileDialog anOpenDialog = new OpenFileDialog (); - string aDataDir = Environment.GetEnvironmentVariable ("CSF_OCCTDataPath"); - string aFilter = ""; - - switch (theFormat) - { - case ModelFormat.BREP: - anOpenDialog.InitialDirectory = (aDataDir + "\\occ"); - aFormat = 0; - aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; - break; - case ModelFormat.STEP: - anOpenDialog.InitialDirectory = (aDataDir + "\\step"); - aFormat = 1; - aFilter = "STEP Files (*.stp *.step)|*.stp; *.step"; - break; - case ModelFormat.IGES: - anOpenDialog.InitialDirectory = (aDataDir + "\\iges"); - aFormat = 2; - aFilter = "IGES Files (*.igs *.iges)|*.igs; *.iges"; - break; - default: - break; - } - - anOpenDialog.Filter = aFilter + "|All files (*.*)|*.*"; - if (anOpenDialog.ShowDialog () == DialogResult.OK) - { - string aFileName = anOpenDialog.FileName; - if (aFileName == "") - { - return; - } - - if (!View.TranslateModel (aFileName, aFormat, true)) - { - MessageBox.Show ("Can't read this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - } - View.ZoomAllView (); - } - - public void ExportModel (ModelFormat theFormat) - { - int aFormat = 10; - SaveFileDialog saveDialog = new SaveFileDialog (); - string aDataDir = Environment.GetEnvironmentVariable ("CSF_OCCTDataPath"); - string aFilter = ""; - - switch (theFormat) - { - case ModelFormat.BREP: - saveDialog.InitialDirectory = (aDataDir + "\\occ"); - aFormat = 0; - aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; - break; - case ModelFormat.STEP: - saveDialog.InitialDirectory = (aDataDir + "\\step"); - aFormat = 1; - aFilter = "STEP Files (*.stp *.step)|*.step; *.stp"; - break; - case ModelFormat.IGES: - saveDialog.InitialDirectory = (aDataDir + "\\iges"); - aFormat = 2; - aFilter = "IGES Files (*.igs *.iges)| *.iges; *.igs"; - break; - case ModelFormat.VRML: - saveDialog.InitialDirectory = (aDataDir + "\\vrml"); - aFormat = 3; - aFilter = "VRML Files (*.vrml)|*.vrml"; - break; - case ModelFormat.STL: - saveDialog.InitialDirectory = (aDataDir + "\\stl"); - aFormat = 4; - aFilter = "STL Files (*.stl)|*.stl"; - break; - case ModelFormat.IMAGE: - saveDialog.InitialDirectory = (aDataDir + "\\images"); - aFormat = 5; - aFilter = "Images Files (*.bmp)|*.bmp"; - break; - default: - break; - } - - saveDialog.Filter = aFilter; - if (saveDialog.ShowDialog () == DialogResult.OK) - { - string aFileName = saveDialog.FileName; - if (aFileName == "") - { - return; - } - - if (!View.TranslateModel (aFileName, aFormat, false)) - { - MessageBox.Show ("Can not write this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - } - } - - public void FitAll () - { - View.ZoomAllView (); - } - - public void ZoomWindow () - { - CurrentMode = CurrentAction3d.CurAction3d_WindowZooming; - } - - public void DynamicZooming () - { - CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming; - } - - public void DynamicPanning () - { - CurrentMode = CurrentAction3d.CurAction3d_DynamicPanning; - } - - public void GlobalPanning () - { - myCurZoom = View.Scale (); - CurrentMode = CurrentAction3d.CurAction3d_GlobalPanning; - } - - public void AxoView () - { - View.AxoView (); - } - - public void FrontView () - { - View.FrontView (); - } - - public void TopView () - { - View.TopView (); - } - - public void LeftView () - { - View.LeftView (); - } - - public void BackView () - { - View.BackView (); - } - - public void RightView () - { - View.RightView (); - } - - public void Reset () - { - View.Reset (); - } - - public void BottomView () - { - View.BottomView (); - } - - public void HiddenOff () - { - View.SetDegenerateModeOff (); - DegenerateMode = false; - } - - public void HiddenOn () - { - View.SetDegenerateModeOn (); - DegenerateMode = true; - } - - public void DynamicRotation () - { - CurrentMode = CurrentAction3d.CurAction3d_DynamicRotation; - } - - public void SelectionChanged () - { - switch (View.DisplayMode ()) - { - case -1: - IsShadingEnabled = false; - IsWireframeEnabled = false; - break; - case 0: - IsWireframeEnabled = false; - IsShadingEnabled = true; - IsTransparencyEnabled = false; - break; - case 1: - IsWireframeEnabled = true; - IsShadingEnabled = false; - IsTransparencyEnabled = true; - break; - case 10: - IsWireframeEnabled = true; - IsShadingEnabled = true; - IsTransparencyEnabled = true; - break; - default: - break; - } - - if (View.IsObjectSelected ()) - { - IsColorEnabled = true; - IsMaterialEnabled = true; - IsDeleteEnabled = true; - } - else - { - IsColorEnabled = false; - IsMaterialEnabled = false; - IsTransparencyEnabled = false; - IsDeleteEnabled = false; - } - - RaiseAvaliabiltyOfOperationsChanged (); - } - - public void ChangeColor (bool IsObjectColor) - { - int r, g, b; - if (IsObjectColor) - { - r = View.GetObjColR (); - g = View.GetObjColG (); - b = View.GetObjColB (); - } - else - { - r = View.GetBGColR (); - g = View.GetBGColG (); - b = View.GetBGColB (); - } - System.Windows.Forms.ColorDialog ColDlg = new System.Windows.Forms.ColorDialog (); - ColDlg.Color = System.Drawing.Color.FromArgb (r, g, b); - if (ColDlg.ShowDialog () == System.Windows.Forms.DialogResult.OK) - { - System.Drawing.Color c = ColDlg.Color; - r = c.R; - g = c.G; - b = c.B; - if (IsObjectColor) - { - View.SetColor (r, g, b); - } - else - { - View.SetBackgroundColor (r, g, b); - } - } - View.UpdateCurrentViewer (); - } - - public void Wireframe () - { - View.SetDisplayMode ((int)DisplayMode.Wireframe); - View.UpdateCurrentViewer (); - - SelectionChanged (); - RaiseZoomingFinished (); - } - - public void Shading () - { - View.SetDisplayMode ((int)DisplayMode.Shading); - View.UpdateCurrentViewer (); - - SelectionChanged (); - RaiseZoomingFinished (); - } - - public void Color () - { - ChangeColor (true); - } - - public void Background () - { - ChangeColor (false); - } - - public void Material () - { - MaterialDlg aDlg = new MaterialDlg (View); - aDlg.ShowDialog (); - } - - public void Transparency () - { - TransparencyDialog dlg = new TransparencyDialog (); - dlg.View = View; - dlg.ShowDialog (); - } - - public void Delete () - { - View.EraseObjects (); - SelectionChanged (); - } - - protected void MultiDragEvent (int x, int y, int theState) - { - if (theState == -1) //mouse is down - { - myButtonDownX = x; - myButtonDownY = y; - } - else if (theState == 1) //mouse is up - { - View.ShiftSelect (Math.Min (myButtonDownX, x), Math.Min (myButtonDownY, y), - Math.Max (myButtonDownX, x), Math.Max (myButtonDownY, y)); - } - } - - protected void DragEvent (int x, int y, int theState) - { - if (theState == -1) //mouse is down - { - myButtonDownX = x; - myButtonDownY = y; - } - else if (theState == 1) //mouse is up - { - View.Select (Math.Min (myButtonDownX, x), Math.Min (myButtonDownY, y), - Math.Max (myButtonDownX, x), Math.Max (myButtonDownY, y)); - } - } - - public void OnMouseDown (System.Windows.IInputElement sender, MouseButtonEventArgs e) - { - System.Windows.Controls.TabControl aTabControl = sender as System.Windows.Controls.TabControl; - System.Windows.Controls.Grid aGrid = aTabControl.SelectedContent as System.Windows.Controls.Grid; - - Point p = new Point((int)e.GetPosition(aGrid).X, (int)e.GetPosition(aGrid).Y); - - // to avoid the context menu opening - aTabControl.ContextMenu.Visibility = System.Windows.Visibility.Collapsed; - aTabControl.ContextMenu.IsOpen = false; - - if (e.LeftButton == MouseButtonState.Pressed) - { - myXmin = p.X; - myXmax = p.X; - myYmin = p.Y; - myYmax = p.Y; - - if (Keyboard.IsKeyDown (Key.LeftCtrl) || Keyboard.IsKeyDown (Key.RightCtrl)) - { - // start the dynamic zooming.... - CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming; - } - else - { - switch (CurrentMode) - { - case CurrentAction3d.CurAction3d_Nothing: - if (Keyboard.IsKeyDown (Key.LeftShift) || Keyboard.IsKeyDown (Key.RightShift)) - { - MultiDragEvent (myXmax, myYmax, -1); - } - else - { - DragEvent (myXmax, myYmax, -1); - } - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - if (!DegenerateMode) - { - View.SetDegenerateModeOn (); - } - View.StartRotation (p.X, p.Y); - break; - default: - break; - } - } - } - else if (e.RightButton == MouseButtonState.Pressed) - { - if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) - { - if (!DegenerateMode) - { - View.SetDegenerateModeOn(); - } - View.StartRotation(p.X, p.Y); - } - else - { - // show context menu only in this case - aTabControl.ContextMenu.Visibility = System.Windows.Visibility.Visible; - } - } - } - - public void OnMouseUp(System.Windows.IInputElement sender, MouseButtonEventArgs e) - { - Point p = new Point((int)e.GetPosition(sender).X, (int)e.GetPosition(sender).Y); - - if (e.ChangedButton == MouseButton.Left) - { - if (Keyboard.IsKeyDown (Key.LeftCtrl) || Keyboard.IsKeyDown (Key.RightCtrl)) - { - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - return; - } - switch (CurrentMode) - { - case CurrentAction3d.CurAction3d_Nothing: - if (p.X == myXmin && p.Y == myYmin) - { - myXmax = p.X; - myYmax = p.Y; - if (Keyboard.IsKeyDown (Key.LeftShift) || Keyboard.IsKeyDown (Key.RightShift)) - { - View.ShiftSelect (); - } - else - { - View.Select (); - } - } - else - { - myXmax = p.X; - myYmax = p.Y; - if (Keyboard.IsKeyDown (Key.LeftShift) || Keyboard.IsKeyDown (Key.RightShift)) - { - MultiDragEvent (myXmax, myYmax, 1); - } - else - { - DragEvent (myXmax, myYmax, 1); - } - } - break; - case CurrentAction3d.CurAction3d_DynamicZooming: - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_WindowZooming: - myXmax = p.X; - myYmax = p.Y; - int ValZWMin = 1; - if (Math.Abs (myXmax - myXmin) > ValZWMin && - Math.Abs (myXmax - myYmax) > ValZWMin) - { - View.WindowFitAll (myXmin, myYmin, myXmax, myYmax); - } - RaiseZoomingFinished (); - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_DynamicPanning: - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_GlobalPanning: - View.Place (p.X, p.Y, myCurZoom); - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - if (!DegenerateMode) - { - View.SetDegenerateModeOff (); - } - else - { - View.SetDegenerateModeOn (); - } - break; - default: - break; - } - } - else if (e.ChangedButton == MouseButton.Right) - { - if (!DegenerateMode) - { - View.SetDegenerateModeOff (); - } - else - { - View.SetDegenerateModeOn (); - } - } - - SelectionChanged (); - } - - public void OnMouseMove (System.Windows.IInputElement sender, System.Windows.Input.MouseEventArgs e) - { - Point p = new Point ((int)e.GetPosition (sender).X, (int)e.GetPosition (sender).Y); - - if (e.LeftButton == MouseButtonState.Pressed) //left button is pressed - { - if (Keyboard.IsKeyDown (Key.LeftCtrl) || Keyboard.IsKeyDown (Key.RightCtrl)) - { - View.Zoom (myXmax, myYmax, p.X, p.Y); - myXmax = p.X; - myYmax = p.Y; - } - else - { - switch (CurrentMode) - { - case CurrentAction3d.CurAction3d_Nothing: - myXmax = p.X; - myYmax = p.Y; - break; - case CurrentAction3d.CurAction3d_DynamicZooming: - View.Zoom (myXmax, myYmax, p.X, p.Y); - myXmax = p.X; - myYmax = p.Y; - break; - case CurrentAction3d.CurAction3d_WindowZooming: - myXmax = p.X; - myYmax = p.Y; - break; - case CurrentAction3d.CurAction3d_DynamicPanning: - View.Pan (p.X - myXmax, myYmax - p.Y); - myXmax = p.X; - myYmax = p.Y; - break; - case CurrentAction3d.CurAction3d_GlobalPanning: - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - View.Rotation (p.X, p.Y); - View.RedrawView (); - break; - default: - break; - } - } - } - else if (e.MiddleButton == MouseButtonState.Pressed) //middle button is pressed - { - if (Keyboard.IsKeyDown (Key.LeftCtrl) || Keyboard.IsKeyDown (Key.RightCtrl)) - { - View.Pan (p.X - myXmax, myYmax - p.Y); - myXmax = p.X; - myYmax = p.Y; - } - } - else if (e.RightButton == MouseButtonState.Pressed) //right button is pressed - { - if (Keyboard.IsKeyDown (Key.LeftCtrl) || Keyboard.IsKeyDown (Key.RightCtrl)) - { - View.Rotation (p.X, p.Y); - } - } - else // no buttons are pressed - { - myXmax = p.X; - myYmax = p.Y; - View.MoveTo (p.X, p.Y); - } - } - } -} diff --git a/samples/CSharp/WPF_D3D/Properties/AssemblyInfo.cs b/samples/CSharp/WPF_D3D/Properties/AssemblyInfo.cs deleted file mode 100644 index 02445ca672..0000000000 --- a/samples/CSharp/WPF_D3D/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("IE")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("IE")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/CSharp/WPF_D3D/Properties/Resources.Designer.cs b/samples/CSharp/WPF_D3D/Properties/Resources.Designer.cs deleted file mode 100644 index 1388afa068..0000000000 --- a/samples/CSharp/WPF_D3D/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18444 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace IE_WPF_D3D.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IE_WPF_D3D.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/samples/CSharp/WPF_D3D/Properties/Resources.resx b/samples/CSharp/WPF_D3D/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/samples/CSharp/WPF_D3D/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/samples/CSharp/WPF_D3D/Properties/Settings.Designer.cs b/samples/CSharp/WPF_D3D/Properties/Settings.Designer.cs deleted file mode 100644 index 34d904b27f..0000000000 --- a/samples/CSharp/WPF_D3D/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18444 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace IE_WPF_D3D.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/samples/CSharp/WPF_D3D/Properties/Settings.settings b/samples/CSharp/WPF_D3D/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9e..0000000000 --- a/samples/CSharp/WPF_D3D/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/WPF_D3D/Simple Styles.xaml b/samples/CSharp/WPF_D3D/Simple Styles.xaml deleted file mode 100644 index 3be3f557c0..0000000000 --- a/samples/CSharp/WPF_D3D/Simple Styles.xaml +++ /dev/null @@ -1,1134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/CSharp/WPF_D3D/TransparencyDialog.cs b/samples/CSharp/WPF_D3D/TransparencyDialog.cs deleted file mode 100644 index ab885b7f98..0000000000 --- a/samples/CSharp/WPF_D3D/TransparencyDialog.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace IE_WPF_D3D -{ - /// - /// Summary description for TransparencyDialog. - /// - public class TransparencyDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.NumericUpDown MyTransparency; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private OCCTProxyD3D myView; - - public TransparencyDialog() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - myView = null; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog)); - this.MyTransparency = new System.Windows.Forms.NumericUpDown(); - ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit(); - this.SuspendLayout(); - // - // MyTransparency - // - this.MyTransparency.Location = new System.Drawing.Point(16, 16); - this.MyTransparency.Maximum = new System.Decimal(new int[] { - 10, - 0, - 0, - 0}); - this.MyTransparency.Name = "MyTransparency"; - this.MyTransparency.Size = new System.Drawing.Size(96, 20); - this.MyTransparency.TabIndex = 0; - this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged); - // - // TransparencyDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(128, 53); - this.Controls.Add(this.MyTransparency); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TransparencyDialog"; - this.Text = "TransparencyDialog"; - ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit(); - this.ResumeLayout(false); - - } - #endregion - - private void MyTransparency_ValueChanged(object sender, System.EventArgs e) - { - if (this.myView == null) - return; - int transp = (int)this.MyTransparency.Value; - this.myView.SetTransparency(transp); - } - - public OCCTProxyD3D View - { - set - { - this.myView = value; - } - } - - } -} diff --git a/samples/CSharp/WPF_D3D/TransparencyDialog.resx b/samples/CSharp/WPF_D3D/TransparencyDialog.resx deleted file mode 100644 index 688fd72e80..0000000000 --- a/samples/CSharp/WPF_D3D/TransparencyDialog.resx +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - TransparencyDialog - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW - FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA - MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm - /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/ - zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm - ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM - /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz - mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM - MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz - MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM - AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA - mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ - MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/ - zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m - zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ - ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy - sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT - ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA - AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId - CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx - ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS - MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA - AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G - T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA - AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA//////// - AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H/// - AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w - AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D - AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA - - - \ No newline at end of file diff --git a/samples/CSharp/WPF_D3D/app.config b/samples/CSharp/WPF_D3D/app.config deleted file mode 100644 index 786a845b30..0000000000 --- a/samples/CSharp/WPF_D3D/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/samples/CSharp/WPF_D3D/res/MainFrame.ico b/samples/CSharp/WPF_D3D/res/MainFrame.ico deleted file mode 100644 index 99dbceb637..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/MainFrame.ico and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/document.png b/samples/CSharp/WPF_D3D/res/document.png deleted file mode 100644 index 1ba28fff33..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/document.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/help.png b/samples/CSharp/WPF_D3D/res/help.png deleted file mode 100644 index e57336285e..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/help.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/lamp.png b/samples/CSharp/WPF_D3D/res/lamp.png deleted file mode 100644 index a5a6775c33..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/lamp.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/new.png b/samples/CSharp/WPF_D3D/res/new.png deleted file mode 100644 index 953757a62f..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/new.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/occ_logo.bmp b/samples/CSharp/WPF_D3D/res/occ_logo.bmp deleted file mode 100644 index 443a7de612..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/occ_logo.bmp and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/tool_color.png b/samples/CSharp/WPF_D3D/res/tool_color.png deleted file mode 100644 index b37ad7d480..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/tool_color.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/tool_delete.png b/samples/CSharp/WPF_D3D/res/tool_delete.png deleted file mode 100644 index aaab07fc9f..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/tool_delete.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/tool_material.png b/samples/CSharp/WPF_D3D/res/tool_material.png deleted file mode 100644 index 41e936855e..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/tool_material.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/tool_shading.png b/samples/CSharp/WPF_D3D/res/tool_shading.png deleted file mode 100644 index 6bb9dc46de..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/tool_shading.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/tool_transparency.png b/samples/CSharp/WPF_D3D/res/tool_transparency.png deleted file mode 100644 index 6b42536eae..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/tool_transparency.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/tool_wireframe.png b/samples/CSharp/WPF_D3D/res/tool_wireframe.png deleted file mode 100644 index 57c560f15a..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/tool_wireframe.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_axo.png b/samples/CSharp/WPF_D3D/res/view_axo.png deleted file mode 100644 index c9a9226180..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_axo.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_back.png b/samples/CSharp/WPF_D3D/res/view_back.png deleted file mode 100644 index 0798f52938..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_back.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_bottom.png b/samples/CSharp/WPF_D3D/res/view_bottom.png deleted file mode 100644 index c7cfdc208a..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_bottom.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_comp_off.png b/samples/CSharp/WPF_D3D/res/view_comp_off.png deleted file mode 100644 index c900b196f0..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_comp_off.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_comp_on.png b/samples/CSharp/WPF_D3D/res/view_comp_on.png deleted file mode 100644 index 73ca4c83d0..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_comp_on.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_fitall.png b/samples/CSharp/WPF_D3D/res/view_fitall.png deleted file mode 100644 index 21d2f423ef..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_fitall.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_fitarea.png b/samples/CSharp/WPF_D3D/res/view_fitarea.png deleted file mode 100644 index f20f5c0554..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_fitarea.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_front.png b/samples/CSharp/WPF_D3D/res/view_front.png deleted file mode 100644 index a9e99c59b6..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_front.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_glpan.png b/samples/CSharp/WPF_D3D/res/view_glpan.png deleted file mode 100644 index 02a9c1cb8d..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_glpan.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_left.png b/samples/CSharp/WPF_D3D/res/view_left.png deleted file mode 100644 index 7d25b6ab2f..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_left.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_pan.png b/samples/CSharp/WPF_D3D/res/view_pan.png deleted file mode 100644 index 0e9a6a5a03..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_pan.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_reset.png b/samples/CSharp/WPF_D3D/res/view_reset.png deleted file mode 100644 index 38849fd694..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_reset.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_right.png b/samples/CSharp/WPF_D3D/res/view_right.png deleted file mode 100644 index 5540220cfa..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_right.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_rotate.png b/samples/CSharp/WPF_D3D/res/view_rotate.png deleted file mode 100644 index 7e5d013b9f..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_rotate.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_top.png b/samples/CSharp/WPF_D3D/res/view_top.png deleted file mode 100644 index b788de36fb..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_top.png and /dev/null differ diff --git a/samples/CSharp/WPF_D3D/res/view_zoom.png b/samples/CSharp/WPF_D3D/res/view_zoom.png deleted file mode 100644 index 1b50a37bc8..0000000000 Binary files a/samples/CSharp/WPF_D3D/res/view_zoom.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/About.xaml b/samples/CSharp/WPF_WinForms/About.xaml deleted file mode 100644 index 950405f605..0000000000 --- a/samples/CSharp/WPF_WinForms/About.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/samples/CSharp/WPF_WinForms/MainWindow.xaml.cs b/samples/CSharp/WPF_WinForms/MainWindow.xaml.cs deleted file mode 100644 index c4a40742af..0000000000 --- a/samples/CSharp/WPF_WinForms/MainWindow.xaml.cs +++ /dev/null @@ -1,614 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Forms.Integration; - -namespace IE_WPF_WinForms -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window, INotifyPropertyChanged - { - public event PropertyChangedEventHandler PropertyChanged; - protected void RaisePropertyChanged( string thePropertyName ) - { - if ( PropertyChanged != null ) - { - PropertyChanged( this, new PropertyChangedEventArgs( thePropertyName ) ); - } - } - - public MainWindow() - { - InitializeComponent(); - - StatusBarText = String.Empty; - IsHlrOffPushed = false; - IsHlrOnPushed = true; - IsZoomWinEnabled = true; - - #region menu operations - - CommandBinding aBind_New = new CommandBinding( IECommands.New ); - aBind_New.Executed += NewCommand_Executed; - CommandBindings.Add( aBind_New ); - - CommandBinding aBind_Close = new CommandBinding( IECommands.Close ); - aBind_Close.Executed += CloseCommand_Executed; - aBind_Close.CanExecute += CloseCommand_CanExecute; - CommandBindings.Add( aBind_Close ); - - CommandBinding aBind_Quit = new CommandBinding( IECommands.Quit ); - aBind_Quit.Executed += QuitCommand_Executed; - CommandBindings.Add( aBind_Quit ); - - CommandBinding aBind_About = new CommandBinding( IECommands.About ); - aBind_About.Executed += AboutCommand_Executed; - CommandBindings.Add( aBind_About ); - - # endregion - - PreviewKeyDown += new KeyEventHandler( OnPreviewKeyDown ); - PreviewKeyUp += new KeyEventHandler( OnPreviewKeyUp ); - } - - private String myStatusBarText; - public String StatusBarText - { - get - { - return myStatusBarText; - } - private set - { - myStatusBarText = value; - RaisePropertyChanged( "StatusBarText" ); - } - } - - private bool isHlrOffPushed; - public Boolean IsHlrOffPushed - { - get - { - return isHlrOffPushed; - } - set - { - isHlrOffPushed = value; - RaisePropertyChanged("isHlrOffPushed"); - } - } - - private bool isHlrOnPushed; - public Boolean IsHlrOnPushed - { - get - { - return isHlrOnPushed; - } - set - { - isHlrOnPushed = value; - RaisePropertyChanged("IsHlrOnPushed"); - } - } - - private bool isZoomWinEnabled; - public Boolean IsZoomWinEnabled - { - get - { - return isZoomWinEnabled; - } - set - { - isZoomWinEnabled = value; - RaisePropertyChanged("IsZoomWinEnabled"); - } - } - - private OCCViewer ActiveViewer - { - get - { - if ( !IsDocumentOpen ) - { - return null; - } - - WindowsFormsHost aHost = ( ViewPanel.SelectedContent ) as WindowsFormsHost; - if( aHost == null ) - { - return null; - } - - return aHost.Child as OCCViewer; - } - } - - public Boolean IsDocumentOpen - { - get - { - return ViewPanel.Items.Count > 0; - } - } - - private int myDocumentCounter = 1; - - private void NewCommand_Executed( object sender, ExecutedRoutedEventArgs e ) - { - WindowsFormsHost aHost = new WindowsFormsHost(); - OCCViewer aForm = new OCCViewer(); - aForm.Show(); - aHost.Child = aForm; - - TabItem aNewTab = new TabItem(); - aNewTab.Content = aHost; - aNewTab.IsSelected = true; - aNewTab.Header = "Document " + myDocumentCounter.ToString(); - myDocumentCounter++; - - ViewPanel.Items.Add( aNewTab ); - - // update XAML property - RaisePropertyChanged("IsDocumentOpen"); - } - - private void CloseCommand_Executed(object sender, ExecutedRoutedEventArgs e) - { - if ( ViewPanel.Items.Count > 0 ) - { - ViewPanel.Items.Remove( ViewPanel.SelectedItem ); - } - - // update XAML property - RaisePropertyChanged( "IsDocumentOpen" ); - } - - private void CloseCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = IsDocumentOpen; - } - - private void QuitCommand_Executed( object sender, ExecutedRoutedEventArgs e ) - { - this.Close(); - } - - private void ImportBRep_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ImportModel( ModelFormat.BREP ); - } - } - - private void ImportIges_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ImportModel( ModelFormat.IGES ); - } - } - - private void ImportStep_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ImportModel( ModelFormat.STEP ); - } - } - - private void ExportBRep_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ExportModel( ModelFormat.BREP ); - } - } - - private void ExportStep_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ExportModel( ModelFormat.STEP ); - } - } - - private void ExportIges_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ExportModel( ModelFormat.IGES ); - } - } - - private void ExportStl_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ExportModel( ModelFormat.STL ); - } - } - - private void ExportVrml_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ExportModel( ModelFormat.VRML ); - } - } - - private void ExportImage_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.ExportModel( ModelFormat.IMAGE ); - } - } - - private void FitAllBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.FitAll(); - } - } - - private void ZoomWindowBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - IsZoomWinEnabled = false; - ActiveViewer.ZoomWindow(); - } - } - - private void DynamicZoomingBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.DynamicZooming(); - } - } - - private void DynamicPanningBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.DynamicPanning(); - } - } - - private void GlobalPanningBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.GlobalPanning(); - } - } - - private void FrontBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.FrontView(); - } - } - - private void BackBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.BackView(); - } - } - - private void TopBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.TopView(); - } - } - - private void BottomBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.BottomView(); - } - } - - private void LeftBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.LeftView(); - } - } - - private void RightBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.RightView(); - } - } - - private void AxoBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.AxoView(); - } - } - - private void ResetBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Reset(); - } - } - - private void DynamicRotationBtn_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.DynamicRotation(); - } - } - - private void HiddenOffBtn_Click( object sender, RoutedEventArgs e ) - { - IsHlrOffPushed = true; - IsHlrOnPushed = false; - if ( ActiveViewer != null ) - { - ActiveViewer.HiddenOff(); - } - } - - private void HiddenOnBtn_Click( object sender, RoutedEventArgs e ) - { - IsHlrOffPushed = false; - IsHlrOnPushed = true; - if (ActiveViewer != null) - { - ActiveViewer.HiddenOn(); - } - } - - private void AboutCommand_Executed( object sender, ExecutedRoutedEventArgs e ) - { - AboutDialog aDlg = new AboutDialog(); - aDlg.ShowDialog(); - } - - private void ToolBar_MouseEnter( object sender, MouseEventArgs e ) - { - StatusBarText = "Toolbar"; - } - - private void DocumentToolBar_MouseEnter(object sender, MouseEventArgs e) - { - StatusBarText = "Document toolbar"; - } - - private void ViewToolBar_MouseEnter(object sender, MouseEventArgs e) - { - StatusBarText = "View toolbar"; - } - - private void ToolBar_MouseLeave( object sender, MouseEventArgs e ) - { - StatusBarText = ""; - } - - public void OnZoomingFinished( object sender, EventArgs e ) - { - IsZoomWinEnabled = true; - } - - public bool IsWireframeEnabled - { - get - { - if ( ActiveViewer != null ) - { - return ActiveViewer.IsWireframeEnabled; - } - return false; - } - } - - private void Wireframe_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Wireframe(); - } - } - - private void Shading_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Shading(); - } - } - - public bool IsShadingEnabled - { - get - { - if ( ActiveViewer != null ) - { - return ActiveViewer.IsShadingEnabled; - } - return false; - } - } - - private void Color_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Color(); - } - } - - public bool IsColorEnabled - { - get - { - if ( ActiveViewer != null ) - { - return ActiveViewer.IsColorEnabled; - } - return false; - } - } - - private void Material_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Material(); - } - } - - public bool IsMaterialEnabled - { - get - { - if ( ActiveViewer != null ) - { - return ActiveViewer.IsMaterialEnabled; - } - return false; - } - } - - private void Transparency_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Transparency(); - } - } - - public bool IsTransparencyEnabled - { - get - { - if ( ActiveViewer != null ) - { - return ActiveViewer.IsTransparencyEnabled; - } - return false; - } - } - - private void Delete_Click( object sender, RoutedEventArgs e ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.Delete(); - } - } - - public bool IsDeleteEnabled - { - get - { - if ( ActiveViewer != null ) - { - return ActiveViewer.IsDeleteEnabled; - } - return false; - } - } - - private void AvaliabiltyOfOperationToolbarChanged() - { - RaisePropertyChanged( "IsWireframeEnabled" ); - RaisePropertyChanged( "IsShadingEnabled" ); - RaisePropertyChanged( "IsTransparencyEnabled" ); - RaisePropertyChanged( "IsColorEnabled" ); - RaisePropertyChanged( "IsMaterialEnabled" ); - RaisePropertyChanged( "IsDeleteEnabled" ); - } - - public void OnAvaliabiltyOfOperationsChanged( object sender, EventArgs e ) - { - AvaliabiltyOfOperationToolbarChanged(); - } - - private void OnViewerChanged( object sender, SelectionChangedEventArgs e ) - { - if ( e.RemovedItems.Count > 0 ) - { - WindowsFormsHost aHost = ( ( e.RemovedItems[0] as TabItem).Content ) as WindowsFormsHost; - if( aHost == null ) - { - return; - } - OCCViewer aViewer = aHost.Child as OCCViewer; - if( aViewer != null ) - { - aViewer.ZoomingFinished -= new EventHandler( OnZoomingFinished ); - aViewer.AvaliabiltyOfOperationsChanged -= new EventHandler( OnAvaliabiltyOfOperationsChanged ); - } - } - - if ( e.AddedItems.Count > 0 ) - { - WindowsFormsHost aHost = ( (e.AddedItems[0] as TabItem).Content ) as WindowsFormsHost; - if ( aHost == null ) - { - return; - } - OCCViewer aViewer = aHost.Child as OCCViewer; - if ( aViewer != null ) - { - aViewer.ZoomingFinished += new EventHandler( OnZoomingFinished ); - aViewer.AvaliabiltyOfOperationsChanged += new EventHandler( OnAvaliabiltyOfOperationsChanged ); - } - } - - AvaliabiltyOfOperationToolbarChanged(); - } - - private void OnPreviewKeyDown( object sender, KeyEventArgs args ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.OnKeyDown( args.Key ); - } - } - - private void OnPreviewKeyUp( object sender, KeyEventArgs args ) - { - if ( ActiveViewer != null ) - { - ActiveViewer.OnKeyUp(); - } - } - } -} diff --git a/samples/CSharp/WPF_WinForms/MaterialDlg.xaml b/samples/CSharp/WPF_WinForms/MaterialDlg.xaml deleted file mode 100644 index 8b2249dfc9..0000000000 --- a/samples/CSharp/WPF_WinForms/MaterialDlg.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/WPF_WinForms/MaterialDlg.xaml.cs b/samples/CSharp/WPF_WinForms/MaterialDlg.xaml.cs deleted file mode 100644 index e89ace7d59..0000000000 --- a/samples/CSharp/WPF_WinForms/MaterialDlg.xaml.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace IE_WPF_WinForms -{ - public enum Material - { - Brass, - Bronze, - Copper, - Gold, - Pewter, - Plaster, - Plastic, - Silver - } - - /// - /// Interaction logic for MaterialDlg.xaml - /// - public partial class MaterialDlg : Window - { - public MaterialDlg( OCCTProxy theView ) - { - this.InitializeComponent(); - - if ( theView == null ) - { - MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" ); - } - - View = theView; - - SetInitialState(); - } - - public OCCTProxy View { get; private set; } - - private void PlasterBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Plaster ); - View.UpdateCurrentViewer(); - } - - private void BrassBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Brass ); - View.UpdateCurrentViewer(); - } - - private void BronzeBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Bronze ); - View.UpdateCurrentViewer(); - } - - private void CopperBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Copper ); - View.UpdateCurrentViewer(); - } - - private void GoldBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Gold ); - View.UpdateCurrentViewer(); - } - - private void PewterBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Pewter ); - View.UpdateCurrentViewer(); - } - - private void PlasticBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Plastic ); - View.UpdateCurrentViewer(); - } - - private void SilverBtn_Checked( object sender, RoutedEventArgs e ) - { - View.SetMaterial( (int)Material.Silver ); - View.UpdateCurrentViewer(); - } - - private void SetInitialState() - { - // TODO - } - } -} \ No newline at end of file diff --git a/samples/CSharp/WPF_WinForms/OCCViewer.cs b/samples/CSharp/WPF_WinForms/OCCViewer.cs deleted file mode 100644 index 733ae7204b..0000000000 --- a/samples/CSharp/WPF_WinForms/OCCViewer.cs +++ /dev/null @@ -1,832 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace IE_WPF_WinForms -{ - public enum CurrentAction3d - { - CurAction3d_Nothing, - CurAction3d_DynamicZooming, - CurAction3d_WindowZooming, - CurAction3d_DynamicPanning, - CurAction3d_GlobalPanning, - CurAction3d_DynamicRotation - } - public enum CurrentPressedKey - { - CurPressedKey_Nothing, - CurPressedKey_Ctrl, - CurPressedKey_Shift - } - public enum ModelFormat - { - BREP, - STEP, - IGES, - VRML, - STL, - IMAGE - } - - public enum DisplayMode - { - Wireframe, - Shading - } - - public class OCCViewer : System.Windows.Forms.Form - { - public event EventHandler ZoomingFinished; - protected void RaiseZoomingFinished() - { - if ( ZoomingFinished != null ) - { - ZoomingFinished( this, EventArgs.Empty ); - } - } - - public event EventHandler AvaliabiltyOfOperationsChanged; - protected void RaiseAvaliabiltyOfOperationsChanged() - { - if ( AvaliabiltyOfOperationsChanged != null ) - { - AvaliabiltyOfOperationsChanged( this, EventArgs.Empty ); - } - } - - public OCCTProxy View { get; private set; } - public CurrentAction3d CurrentMode { get; private set; } - private CurrentPressedKey CurrentPressedKey { get; set; } - private bool IsRectVisible { get; set; } - public bool DegenerateMode { get; private set; } - - public bool IsWireframeEnabled { get; private set; } - public bool IsShadingEnabled { get; private set; } - public bool IsTransparencyEnabled { get; private set; } - public bool IsColorEnabled { get; private set; } - public bool IsMaterialEnabled { get; private set; } - public bool IsDeleteEnabled { get; private set; } - - private float myCurZoom; - private int myXmin; - private int myYmin; - private int myXmax; - private int myYmax; - private int myRectDownX; - private int myRectDownY; - private int myButtonDownX; - private int myButtonDownY; - - private ContextMenu Popup { get; set; } - private MenuItem ContextWireframe; - private MenuItem ContextShading; - private MenuItem ContextColor; - private MenuItem ContextMaterial; - private MenuItem ContextDelete; - private MenuItem ContextBackground; - private MenuItem ContextTransparency; - - - public OCCViewer() - { - InitializeComponent(); - - View = new OCCTProxy(); - View.InitOCCTProxy(); - if ( !View.InitViewer( this.Handle ) ) - { - MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" ); - } - - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - CurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing; - IsRectVisible = false; - DegenerateMode = true; - } - - private void InitializeComponent() - { - ControlBox = false; - TopLevel = false; - - this.ImeMode = System.Windows.Forms.ImeMode.NoControl; - - SizeChanged += new System.EventHandler( OnSizeChanged ); - Paint += new System.Windows.Forms.PaintEventHandler( OnPaint ); - - MouseDown += new System.Windows.Forms.MouseEventHandler( OnMouseDown ); - MouseUp += new System.Windows.Forms.MouseEventHandler( OnMouseUp ); - MouseMove += new System.Windows.Forms.MouseEventHandler( OnMouseMove ); - - Popup = new ContextMenu(); - ContextWireframe = new MenuItem(); - ContextShading = new MenuItem(); - ContextColor = new MenuItem(); - ContextMaterial = new MenuItem(); - ContextTransparency = new MenuItem(); - ContextDelete = new MenuItem(); - ContextBackground = new MenuItem(); - - ContextWireframe.Text = "Wireframe"; - ContextShading.Text = "Shading"; - ContextColor.Text = "Color"; - ContextMaterial.Text = "Material"; - ContextTransparency.Text = "Transparency"; - ContextDelete.Text = "Delete"; - ContextBackground.Text = "Background"; - - ContextWireframe.Click += new System.EventHandler( ContextWireframe_Click ); - ContextShading.Click += new System.EventHandler( ContextShading_Click ); - ContextColor.Click += new System.EventHandler( ContextColor_Click ); - ContextMaterial.Click += new System.EventHandler( ContextMaterial_Click ); - ContextTransparency.Click += new System.EventHandler( ContextTransparency_Click ); - ContextDelete.Click += new System.EventHandler( ContextDelete_Click ); - ContextBackground.Click += new System.EventHandler( ContextBackground_Click ); - - Popup.MenuItems.AddRange( new MenuItem[] { ContextWireframe, - ContextShading, - ContextColor, - ContextMaterial, - ContextTransparency, - ContextDelete, - ContextBackground } ); - Popup.Popup += new System.EventHandler( OnPopup ); - } - - private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e) - { - View.RedrawView(); - View.UpdateView(); - } - - private void OnSizeChanged(object sender, System.EventArgs e) - { - View.UpdateView(); - } - - public void ImportModel( ModelFormat theFormat ) - { - int aFormat = 10; - OpenFileDialog anOpenDialog = new OpenFileDialog(); - string aDataDir = Environment.GetEnvironmentVariable("CSF_OCCTDataPath"); - string aFilter = ""; - - switch ( theFormat ) - { - case ModelFormat.BREP: - anOpenDialog.InitialDirectory = (aDataDir + "\\occ"); - aFormat = 0; - aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; - break; - case ModelFormat.STEP: - anOpenDialog.InitialDirectory = (aDataDir + "\\step"); - aFormat = 1; - aFilter = "STEP Files (*.stp *.step)|*.stp; *.step"; - break; - case ModelFormat.IGES: - anOpenDialog.InitialDirectory = (aDataDir + "\\iges"); - aFormat = 2; - aFilter = "IGES Files (*.igs *.iges)|*.igs; *.iges"; - break; - default: - break; - } - - anOpenDialog.Filter = aFilter + "|All files (*.*)|*.*"; - if (anOpenDialog.ShowDialog() == DialogResult.OK) - { - string aFileName = anOpenDialog.FileName; - if (aFileName == "") - { - return; - } - - Cursor = System.Windows.Forms.Cursors.WaitCursor; - if ( !View.TranslateModel( aFileName, aFormat, true ) ) - { - MessageBox.Show( "Can't read this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning ); - } - Cursor = System.Windows.Forms.Cursors.Default; - } - View.ZoomAllView(); - } - - public void ExportModel( ModelFormat theFormat ) - { - int aFormat = 10; - SaveFileDialog saveDialog = new SaveFileDialog(); - string aDataDir = Environment.GetEnvironmentVariable("CSF_OCCTDataPath"); - string aFilter = ""; - - switch ( theFormat ) - { - case ModelFormat.BREP: - saveDialog.InitialDirectory = ( aDataDir + "\\occ" ); - aFormat = 0; - aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; - break; - case ModelFormat.STEP: - saveDialog.InitialDirectory = ( aDataDir + "\\step" ); - aFormat = 1; - aFilter = "STEP Files (*.stp *.step)|*.step; *.stp"; - break; - case ModelFormat.IGES: - saveDialog.InitialDirectory = ( aDataDir + "\\iges" ); - aFormat = 2; - aFilter = "IGES Files (*.igs *.iges)| *.iges; *.igs"; - break; - case ModelFormat.VRML: - saveDialog.InitialDirectory = ( aDataDir + "\\vrml" ); - aFormat = 3; - aFilter = "VRML Files (*.vrml)|*.vrml"; - break; - case ModelFormat.STL: - saveDialog.InitialDirectory = ( aDataDir + "\\stl" ); - aFormat = 4; - aFilter = "STL Files (*.stl)|*.stl"; - break; - case ModelFormat.IMAGE: - saveDialog.InitialDirectory = ( aDataDir + "\\images" ); - aFormat = 5; - aFilter = "Images Files (*.bmp)|*.bmp"; - break; - default: - break; - } - - saveDialog.Filter = aFilter; - if ( saveDialog.ShowDialog() == DialogResult.OK ) - { - string aFileName = saveDialog.FileName; - if ( aFileName == "" ) - { - return; - } - - Cursor = System.Windows.Forms.Cursors.WaitCursor; - if ( !View.TranslateModel( aFileName, aFormat, false ) ) - { - MessageBox.Show( "Can not write this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning ); - } - Cursor = System.Windows.Forms.Cursors.Default; - } - } - - public void FitAll() - { - View.ZoomAllView(); - } - - public void ZoomWindow() - { - CurrentMode = CurrentAction3d.CurAction3d_WindowZooming; - } - - public void DynamicZooming() - { - CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming; - } - - public void DynamicPanning() - { - CurrentMode = CurrentAction3d.CurAction3d_DynamicPanning; - } - - public void GlobalPanning() - { - myCurZoom = View.Scale(); - CurrentMode = CurrentAction3d.CurAction3d_GlobalPanning; - } - - public void AxoView() - { - View.AxoView(); - } - - public void FrontView() - { - View.FrontView(); - } - - public void TopView() - { - View.TopView(); - } - - public void LeftView() - { - View.LeftView(); - } - - public void BackView() - { - View.BackView(); - } - - public void RightView() - { - View.RightView(); - } - - public void Reset() - { - View.Reset(); - } - - public void BottomView() - { - View.BottomView(); - } - - public void HiddenOff() - { - View.SetDegenerateModeOff(); - DegenerateMode = false; - } - - public void HiddenOn() - { - View.SetDegenerateModeOn(); - DegenerateMode = true; - } - - public void DynamicRotation() - { - CurrentMode = CurrentAction3d.CurAction3d_DynamicRotation; - } - - public void SelectionChanged() - { - switch ( View.DisplayMode() ) - { - case -1: - IsShadingEnabled = false; - IsWireframeEnabled = false; - break; - case 0: - IsWireframeEnabled = false; - IsShadingEnabled = true; - IsTransparencyEnabled = false; - break; - case 1: - IsWireframeEnabled = true; - IsShadingEnabled = false; - IsTransparencyEnabled = true; - break; - case 10: - IsWireframeEnabled = true; - IsShadingEnabled = true; - IsTransparencyEnabled = true; - break; - default: - break; - } - - if ( View.IsObjectSelected() ) - { - IsColorEnabled = true; - IsMaterialEnabled = true; - IsDeleteEnabled = true; - } - else - { - IsColorEnabled = false; - IsMaterialEnabled = false; - IsTransparencyEnabled = false; - IsDeleteEnabled = false; - } - - RaiseAvaliabiltyOfOperationsChanged(); - } - - public void ChangeColor( bool IsObjectColor ) - { - int r, g, b; - if ( IsObjectColor ) - { - r = View.GetObjColR(); - g = View.GetObjColG(); - b = View.GetObjColB(); - } - else - { - r = View.GetBGColR(); - g = View.GetBGColG(); - b = View.GetBGColB(); - } - System.Windows.Forms.ColorDialog ColDlg = new System.Windows.Forms.ColorDialog(); - ColDlg.Color = System.Drawing.Color.FromArgb( r, g, b ); - if ( ColDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK ) - { - System.Drawing.Color c = ColDlg.Color; - r = c.R; - g = c.G; - b = c.B; - if ( IsObjectColor ) - { - View.SetColor( r, g, b ); - } - else - { - View.SetBackgroundColor( r, g, b ); - } - } - View.UpdateCurrentViewer(); - } - - public void Wireframe() - { - View.SetDisplayMode( (int)DisplayMode.Wireframe ); - View.UpdateCurrentViewer(); - - SelectionChanged(); - RaiseZoomingFinished(); - } - - public void Shading() - { - View.SetDisplayMode( (int)DisplayMode.Shading ); - View.UpdateCurrentViewer(); - - SelectionChanged(); - RaiseZoomingFinished(); - } - - public void Color() - { - ChangeColor( true ); - } - - public void Background() - { - ChangeColor( false ); - } - - public void Material() - { - MaterialDlg aDlg = new MaterialDlg( View ); - aDlg.ShowDialog(); - } - - public void Transparency() - { - TransparencyDialog dlg = new TransparencyDialog(); - dlg.View = View; - dlg.ShowDialog( this ); - } - - public void Delete() - { - View.EraseObjects(); - SelectionChanged(); - } - - public void OnKeyDown( System.Windows.Input.Key theKey ) - { - if ( theKey == System.Windows.Input.Key.LeftShift || - theKey == System.Windows.Input.Key.RightShift ) - { - CurrentPressedKey = CurrentPressedKey.CurPressedKey_Shift; - } - else if (theKey == System.Windows.Input.Key.LeftCtrl || - theKey == System.Windows.Input.Key.RightCtrl ) - { - CurrentPressedKey = CurrentPressedKey.CurPressedKey_Ctrl; - } - } - - public void OnKeyUp() - { - CurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing; - } - - protected void MultiDragEvent( int x, int y, int theState ) - { - if ( theState == -1 ) //mouse is down - { - myButtonDownX = x; - myButtonDownY = y; - } - else if ( theState == 1) //mouse is up - { - View.ShiftSelect( Math.Min( myButtonDownX, x ), Math.Min( myButtonDownY, y ), - Math.Max( myButtonDownX, x ), Math.Max( myButtonDownY, y ) ); - } - } - - protected void DragEvent( int x, int y, int theState ) - { - if ( theState == -1 ) //mouse is down - { - myButtonDownX = x; - myButtonDownY = y; - } - else if ( theState == 1 ) //mouse is up - { - View.Select( Math.Min( myButtonDownX, x ), Math.Min( myButtonDownY, y ), - Math.Max( myButtonDownX, x ), Math.Max( myButtonDownY, y ) ); - } - } - - private void DrawRectangle( bool draw ) - { - System.Drawing.Graphics gr = System.Drawing.Graphics.FromHwnd(Handle); - System.Drawing.Pen p = null; - if ( IsRectVisible || !draw )//erase the rect - { - int r = View.GetBGColR(); - int g = View.GetBGColG(); - int b = View.GetBGColB(); - p = new System.Drawing.Pen( System.Drawing.Color.FromArgb(r, g, b) ); - IsRectVisible = false; - View.UpdateView(); - } - else if ( draw ) - { - p = new System.Drawing.Pen( System.Drawing.Color.White ); - IsRectVisible = true; - } - if ( p == null ) - { - return; - } - int x = Math.Min( myXmin, myXmax ); - int y = Math.Min( myYmin, myYmax ); - gr.DrawRectangle( p, x, y, Math.Abs(myXmax - myXmin), Math.Abs(myYmax - myYmin) ); - myRectDownX = Math.Max( myXmin, myXmax ); - myRectDownY = Math.Max( myYmin, myYmax ); - } - - private void OnMouseDown( object sender, System.Windows.Forms.MouseEventArgs e ) - { - if ( e.Button == MouseButtons.Left ) - { - myXmin = e.X; - myXmax = e.X; - myYmin = e.Y; - myYmax = e.Y; - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl ) - { - // start the dynamic zooming.... - CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming; - } - else - { - switch ( CurrentMode ) - { - case CurrentAction3d.CurAction3d_Nothing: - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift ) - { - MultiDragEvent( myXmax, myYmax, -1 ); - } - else - { - DragEvent( myXmax, myYmax, -1 ); - } - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - if ( !DegenerateMode ) - { - View.SetDegenerateModeOn(); - } - View.StartRotation( e.X, e.Y ); - break; - case CurrentAction3d.CurAction3d_WindowZooming: - Cursor = Cursors.Hand; - break; - default: - break; - } - } - } - else if ( e.Button == MouseButtons.Right ) - { - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl ) - { - if ( !DegenerateMode ) - { - View.SetDegenerateModeOn(); - } - View.StartRotation( e.X, e.Y ); - } - else - { - Popup.Show( this, new System.Drawing.Point( e.X, e.Y ) ); - } - } - } - - private void OnMouseUp( object sender, System.Windows.Forms.MouseEventArgs e ) - { - if ( e.Button == MouseButtons.Left ) - { - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl ) - { - return; - } - switch ( CurrentMode ) - { - case CurrentAction3d.CurAction3d_Nothing: - if ( e.X == myXmin && e.Y == myYmin ) - { - myXmax = e.X; - myYmax = e.Y; - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift ) - { - View.ShiftSelect(); - } - else - { - View.Select(); - } - } - else - { - myXmax = e.X; - myYmax = e.Y; - DrawRectangle( false ); - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift ) - { - MultiDragEvent( myXmax, myYmax, 1 ); - } - else - { - DragEvent( myXmax, myYmax, 1 ); - } - } - break; - case CurrentAction3d.CurAction3d_DynamicZooming: - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_WindowZooming: - myXmax = e.X; - myYmax = e.Y; - DrawRectangle( false ); - int ValZWMin = 1; - if ( Math.Abs(myXmax - myXmin) > ValZWMin && - Math.Abs(myXmax - myYmax) > ValZWMin ) - { - View.WindowFitAll( myXmin, myYmin, myXmax, myYmax ); - } - Cursor = Cursors.Arrow; - RaiseZoomingFinished(); - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_DynamicPanning: - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_GlobalPanning: - View.Place( e.X, e.Y, myCurZoom ); - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - CurrentMode = CurrentAction3d.CurAction3d_Nothing; - if ( !DegenerateMode ) - { - View.SetDegenerateModeOff(); - } - else - { - View.SetDegenerateModeOn(); - } - break; - default: - break; - } - } - else if ( e.Button == MouseButtons.Right ) - { - if ( !DegenerateMode ) - { - View.SetDegenerateModeOff(); - } - else - { - View.SetDegenerateModeOn(); - } - } - - SelectionChanged(); - } - - private void OnMouseMove( object sender, System.Windows.Forms.MouseEventArgs e ) - { - if ( e.Button == MouseButtons.Left ) //left button is pressed - { - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl ) - { - View.Zoom(myXmax, myYmax, e.X, e.Y); - myXmax = e.X; - myYmax = e.Y; - } - else - { - switch ( CurrentMode ) - { - case CurrentAction3d.CurAction3d_Nothing: - DrawRectangle( false ); - myXmax = e.X; - myYmax = e.Y; - DrawRectangle( true ); - break; - case CurrentAction3d.CurAction3d_DynamicZooming: - View.Zoom( myXmax, myYmax, e.X, e.Y ); - myXmax = e.X; - myYmax = e.Y; - break; - case CurrentAction3d.CurAction3d_WindowZooming: - DrawRectangle( false ); - myXmax = e.X; - myYmax = e.Y; - DrawRectangle( true );//add brush here - break; - case CurrentAction3d.CurAction3d_DynamicPanning: - View.Pan( e.X - myXmax, myYmax - e.Y ); - myXmax = e.X; - myYmax = e.Y; - break; - case CurrentAction3d.CurAction3d_GlobalPanning: - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - View.Rotation( e.X, e.Y ); - View.RedrawView(); - break; - default: - break; - } - } - } - else if ( e.Button == MouseButtons.Middle ) //middle button is pressed - { - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl ) - { - View.Pan( e.X - myXmax, myYmax - e.Y ); - myXmax = e.X; - myYmax = e.Y; - } - } - else if ( e.Button == MouseButtons.Right ) //right button is pressed - { - if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - { - View.Rotation( e.X, e.Y ); - } - } - else // no buttons are pressed - { - myXmax = e.X; - myYmax = e.Y; - View.MoveTo( e.X, e.Y ); - } - } - - private void OnPopup( object sender, System.EventArgs e ) - { - ContextWireframe.Enabled = IsWireframeEnabled; - ContextShading.Enabled = IsShadingEnabled; - ContextColor.Enabled = IsColorEnabled; - ContextMaterial.Enabled = IsMaterialEnabled; - ContextDelete.Enabled = IsDeleteEnabled; - ContextTransparency.Enabled = IsTransparencyEnabled; - ContextBackground.Enabled = true; - } - - private void ContextWireframe_Click( object sender, System.EventArgs e ) - { - Wireframe(); - } - - private void ContextShading_Click( object sender, System.EventArgs e ) - { - Shading(); - } - - private void ContextColor_Click( object sender, System.EventArgs e ) - { - Color(); - } - - private void ContextMaterial_Click( object sender, System.EventArgs e ) - { - Material(); - } - - private void ContextTransparency_Click( object sender, System.EventArgs e ) - { - Transparency(); - } - - private void ContextDelete_Click( object sender, System.EventArgs e ) - { - Delete(); - } - - private void ContextBackground_Click( object sender, System.EventArgs e ) - { - Background(); - } - } -} diff --git a/samples/CSharp/WPF_WinForms/Properties/AssemblyInfo.cs b/samples/CSharp/WPF_WinForms/Properties/AssemblyInfo.cs deleted file mode 100644 index 02445ca672..0000000000 --- a/samples/CSharp/WPF_WinForms/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("IE")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("IE")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/CSharp/WPF_WinForms/Properties/Resources.Designer.cs b/samples/CSharp/WPF_WinForms/Properties/Resources.Designer.cs deleted file mode 100644 index e6c1eac679..0000000000 --- a/samples/CSharp/WPF_WinForms/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18444 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace IE_WPF_WinForms.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IE_WPF_WinForms.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/samples/CSharp/WPF_WinForms/Properties/Resources.resx b/samples/CSharp/WPF_WinForms/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/samples/CSharp/WPF_WinForms/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/samples/CSharp/WPF_WinForms/Properties/Settings.Designer.cs b/samples/CSharp/WPF_WinForms/Properties/Settings.Designer.cs deleted file mode 100644 index 117456a5c0..0000000000 --- a/samples/CSharp/WPF_WinForms/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18444 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace IE_WPF_WinForms.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/samples/CSharp/WPF_WinForms/Properties/Settings.settings b/samples/CSharp/WPF_WinForms/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9e..0000000000 --- a/samples/CSharp/WPF_WinForms/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/WPF_WinForms/Simple Styles.xaml b/samples/CSharp/WPF_WinForms/Simple Styles.xaml deleted file mode 100644 index 3be3f557c0..0000000000 --- a/samples/CSharp/WPF_WinForms/Simple Styles.xaml +++ /dev/null @@ -1,1134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/CSharp/WPF_WinForms/TransparencyDialog.cs b/samples/CSharp/WPF_WinForms/TransparencyDialog.cs deleted file mode 100644 index ba7a456252..0000000000 --- a/samples/CSharp/WPF_WinForms/TransparencyDialog.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace IE_WPF_WinForms -{ - /// - /// Summary description for TransparencyDialog. - /// - public class TransparencyDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.NumericUpDown MyTransparency; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private OCCTProxy myView; - - public TransparencyDialog() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - myView = null; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog)); - this.MyTransparency = new System.Windows.Forms.NumericUpDown(); - ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit(); - this.SuspendLayout(); - // - // MyTransparency - // - this.MyTransparency.Location = new System.Drawing.Point(16, 16); - this.MyTransparency.Maximum = new System.Decimal(new int[] { - 10, - 0, - 0, - 0}); - this.MyTransparency.Name = "MyTransparency"; - this.MyTransparency.Size = new System.Drawing.Size(96, 20); - this.MyTransparency.TabIndex = 0; - this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged); - // - // TransparencyDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(128, 53); - this.Controls.Add(this.MyTransparency); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TransparencyDialog"; - this.Text = "TransparencyDialog"; - ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit(); - this.ResumeLayout(false); - - } - #endregion - - private void MyTransparency_ValueChanged(object sender, System.EventArgs e) - { - if (this.myView == null) - return; - int transp = (int)this.MyTransparency.Value; - this.myView.SetTransparency(transp); - } - - public OCCTProxy View - { - set - { - this.myView = value; - } - } - - } -} diff --git a/samples/CSharp/WPF_WinForms/TransparencyDialog.resx b/samples/CSharp/WPF_WinForms/TransparencyDialog.resx deleted file mode 100644 index 688fd72e80..0000000000 --- a/samples/CSharp/WPF_WinForms/TransparencyDialog.resx +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - TransparencyDialog - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW - FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA - MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm - /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/ - zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm - ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM - /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz - mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM - MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz - MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM - AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA - mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ - MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/ - zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m - zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ - ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy - sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT - ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA - AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId - CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx - ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS - MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA - AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G - T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA - AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA//////// - AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H/// - AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w - AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D - AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA - - - \ No newline at end of file diff --git a/samples/CSharp/WPF_WinForms/app.config b/samples/CSharp/WPF_WinForms/app.config deleted file mode 100644 index 786a845b30..0000000000 --- a/samples/CSharp/WPF_WinForms/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/samples/CSharp/WPF_WinForms/res/MainFrame.ico b/samples/CSharp/WPF_WinForms/res/MainFrame.ico deleted file mode 100644 index 99dbceb637..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/MainFrame.ico and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/document.png b/samples/CSharp/WPF_WinForms/res/document.png deleted file mode 100644 index 1ba28fff33..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/document.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/help.png b/samples/CSharp/WPF_WinForms/res/help.png deleted file mode 100644 index e57336285e..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/help.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/lamp.png b/samples/CSharp/WPF_WinForms/res/lamp.png deleted file mode 100644 index a5a6775c33..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/lamp.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/new.png b/samples/CSharp/WPF_WinForms/res/new.png deleted file mode 100644 index 953757a62f..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/new.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/occ_logo.bmp b/samples/CSharp/WPF_WinForms/res/occ_logo.bmp deleted file mode 100644 index 443a7de612..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/occ_logo.bmp and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/tool_color.png b/samples/CSharp/WPF_WinForms/res/tool_color.png deleted file mode 100644 index b37ad7d480..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/tool_color.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/tool_delete.png b/samples/CSharp/WPF_WinForms/res/tool_delete.png deleted file mode 100644 index aaab07fc9f..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/tool_delete.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/tool_material.png b/samples/CSharp/WPF_WinForms/res/tool_material.png deleted file mode 100644 index 41e936855e..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/tool_material.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/tool_shading.png b/samples/CSharp/WPF_WinForms/res/tool_shading.png deleted file mode 100644 index 6bb9dc46de..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/tool_shading.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/tool_transparency.png b/samples/CSharp/WPF_WinForms/res/tool_transparency.png deleted file mode 100644 index 6b42536eae..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/tool_transparency.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/tool_wireframe.png b/samples/CSharp/WPF_WinForms/res/tool_wireframe.png deleted file mode 100644 index 57c560f15a..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/tool_wireframe.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_axo.png b/samples/CSharp/WPF_WinForms/res/view_axo.png deleted file mode 100644 index c9a9226180..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_axo.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_back.png b/samples/CSharp/WPF_WinForms/res/view_back.png deleted file mode 100644 index 0798f52938..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_back.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_bottom.png b/samples/CSharp/WPF_WinForms/res/view_bottom.png deleted file mode 100644 index c7cfdc208a..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_bottom.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_comp_off.png b/samples/CSharp/WPF_WinForms/res/view_comp_off.png deleted file mode 100644 index c900b196f0..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_comp_off.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_comp_on.png b/samples/CSharp/WPF_WinForms/res/view_comp_on.png deleted file mode 100644 index 73ca4c83d0..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_comp_on.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_fitall.png b/samples/CSharp/WPF_WinForms/res/view_fitall.png deleted file mode 100644 index 21d2f423ef..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_fitall.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_fitarea.png b/samples/CSharp/WPF_WinForms/res/view_fitarea.png deleted file mode 100644 index f20f5c0554..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_fitarea.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_front.png b/samples/CSharp/WPF_WinForms/res/view_front.png deleted file mode 100644 index a9e99c59b6..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_front.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_glpan.png b/samples/CSharp/WPF_WinForms/res/view_glpan.png deleted file mode 100644 index 02a9c1cb8d..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_glpan.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_left.png b/samples/CSharp/WPF_WinForms/res/view_left.png deleted file mode 100644 index 7d25b6ab2f..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_left.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_pan.png b/samples/CSharp/WPF_WinForms/res/view_pan.png deleted file mode 100644 index 0e9a6a5a03..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_pan.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_reset.png b/samples/CSharp/WPF_WinForms/res/view_reset.png deleted file mode 100644 index 38849fd694..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_reset.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_right.png b/samples/CSharp/WPF_WinForms/res/view_right.png deleted file mode 100644 index 5540220cfa..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_right.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_rotate.png b/samples/CSharp/WPF_WinForms/res/view_rotate.png deleted file mode 100644 index 7e5d013b9f..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_rotate.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_top.png b/samples/CSharp/WPF_WinForms/res/view_top.png deleted file mode 100644 index b788de36fb..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_top.png and /dev/null differ diff --git a/samples/CSharp/WPF_WinForms/res/view_zoom.png b/samples/CSharp/WPF_WinForms/res/view_zoom.png deleted file mode 100644 index 1b50a37bc8..0000000000 Binary files a/samples/CSharp/WPF_WinForms/res/view_zoom.png and /dev/null differ diff --git a/samples/CSharp/WinForms/AboutDialog.cs b/samples/CSharp/WinForms/AboutDialog.cs deleted file mode 100644 index 73c98a726b..0000000000 --- a/samples/CSharp/WinForms/AboutDialog.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace IE_WinForms -{ - /// - /// Summary description for AboutDialog. - /// - public class AboutDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label myVersion; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public AboutDialog() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - // - // Create OCCT proxy object and get OCCT version - // - OCCTProxy t = new OCCTProxy(); - t.InitOCCTProxy(); - float version = t.GetOCCVersion(); - this.myVersion.Text = this.myVersion.Text + version; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDialog)); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.button1 = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.myVersion = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // pictureBox1 - // - this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(59, 64); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(196, 102); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(96, 248); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(128, 24); - this.button1.TabIndex = 1; - this.button1.Text = "OK"; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(16, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(288, 24); - this.label1.TabIndex = 2; - this.label1.Text = "Import/Export Sample,"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // myVersion - // - this.myVersion.Location = new System.Drawing.Point(16, 32); - this.myVersion.Name = "myVersion"; - this.myVersion.Size = new System.Drawing.Size(288, 16); - this.myVersion.TabIndex = 3; - this.myVersion.Text = "Open CASCADE Technology "; - this.myVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label3 - // - this.label3.Location = new System.Drawing.Point(24, 168); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(280, 23); - this.label3.TabIndex = 4; - this.label3.Text = "Copyright (C) 2004-2013, Open CASCADE S.A.S"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label4 - // - this.label4.Location = new System.Drawing.Point(8, 200); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(296, 24); - this.label4.TabIndex = 5; - this.label4.Text = "http://www.opencascade.com"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // AboutDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(312, 285); - this.ControlBox = false; - this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.myVersion); - this.Controls.Add(this.label1); - this.Controls.Add(this.button1); - this.Controls.Add(this.pictureBox1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AboutDialog"; - this.Text = "About Import/Export Sample"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - #endregion - - private void button1_Click(object sender, System.EventArgs e) - { - this.Close(); - } - } -} diff --git a/samples/CSharp/WinForms/AboutDialog.resx b/samples/CSharp/WinForms/AboutDialog.resx deleted file mode 100644 index 0406147f1f..0000000000 --- a/samples/CSharp/WinForms/AboutDialog.resx +++ /dev/null @@ -1,1167 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - Qk1W5AAAAAAAADYAAAAoAAAAwgAAAGQAAAABABgAAAAAAAAAAAAgLgAAIC4AAAAAAAAAAAAA//////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////AAD///////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////8AAP////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////wAA//////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////AAD///////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////8AAP////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////wAA//////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - AAD///////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////8AAP////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////wAA//////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////AAD///////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////8AAP// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////wAA//////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////AAD///////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////8AAP////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////wAA//////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////AAD///////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////8AAP////////////////////////////////////////////////// - /////////////////9Px9szm7P/8/PT19fr7+/////////7///7///////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////wAA////////////////////////////////////////////////////////////////////qerz - NZam19ve5ebn5ufp+Pn5/////////////v////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////AAD///////////// - ///////////////////////////////////////////////////////k/v9FpbGAoKnh3d/R1dfp6ev+ - /f7////////9//////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////8AAP////////////////////////////////// - //////////////////////////////////z//37U3zx8is7M0c7O0Nvc3vf3+P7///7///////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////wAA//////////////////////////////////////////////////////// - ///////////+////v/P7KIqYjaar0M7Rzc/U6err//////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - AAD///////////////////////////////////////////////////////////////////////7j//9L - tcNMeoTJy83FyMva2t35+fn////+//////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////7///// - /v////7///////////////////////////////////////////////////7////+/v////////////// - /////////////////////v/+//7//v////////////////////////////////7///////////////// - //7////////////////+//7+///////+///////////////////+//79///+/////v////////////// - /////////////////////v/////////////////////////////////////////////////////+//7+ - //7///7////////////////////////////////+///+///+///+/v7+/v7///////////////////// - /////////////////////v/9/v/+/////////////v7//v7////////////////+//7+/v7///////// - //////////////////////////////////////////////////////////8AAP////////////////// - ///////////////////////////////////////////////////+/vn+/5bm8Cd4h52pssjHysnNz+zs - 7f7///7///////////////////////////////////////////////////////////////////////// - /////////////////////////////////9ve36uvsa+ytenr7P///////////////+vr7bO1t7CytbCz - t6+ytbCztrCztrCzt7Cztq2ws7y/w/j6+/////7//v////39/c3O0pmcoISHjIyPla+yturs7f////7+ - /v7+/////87R06uusLW3uvT19f///////////////87R1Kyvsba5u/Dy8////9zg4qyvsLW4ue7u8P// - //////7//////8nMza2usLG0ue7w8v////3+//////////T19r7CxZSXnIOGjIyPlK6xtebn6f////// - /v///////////8THyq2wtK+zt7G0t6+zt7CytrCztrCzt6yws8/R0v////3+/////////9/h4qmssIqN - koWHjZaan8THyfn5+f////////////7+/v7+/v////////Hy8r2/wZOXmoOIjIyQlamtsd3e4P////// - //7////+///+/v///////////8zQ0KqusLW3u/X09v////////////////////////////////////// - /////////////////////////////////////wAA//////////////////////////////////////// - //////////////////////////////////7/1P3/PaOzU3uEwsXIv8TI29zf+/r6//////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////o6erKjAzMjc7x8nL////////////////x8rOOj9DMzg8MzY6LjI3LzM4LjM3LjM3LzQ4 - KCwwTlFV8PPz////////7O3tfoSHPUFFLzQ3LTE1LjM2NDg7WFphvcDD////////////f4OHKC0xQ0ZM - 4OHj////////////////gISIKS4xQ0dM293f////p6quLDA0QERI0NLV///////+////3uDiRkxQMDQ4 - NzxC1tnb///////+////z9DSZ2lvOD5BLzM4LjI2LjM2Mzk6U1dcr7G1/////////////v7+Z2twLzQ3 - NDk9MDQ4LzQ3LzQ4LzM3MDU4JiwvfoKG/////////Pz9n6KlSk9TMjY6LjM2LTI1LjM3OT5BcHd73t/g - ///////////////+////v8LEXGNmNjxALzM3LjE2LTQ2Mzk8SU1RgoaK2Nrc///////+/////v7+//// - ////f4OFJy0xQERJ4uPk///////+//////////////////////////////////////////////////// - ////////////////AAD///////////////////////////////////////////////////////////// - ///////+//////7v//951uMoa3mnsbS9wcTMztHt7+/+//////////////////////////////////// - //////////////////////////////////////////////////////////////////////+pq64zODw7 - P0PKzc7////////+/v7////KzM9CRko6P0JLT1NbX2NYXGFXXF9ZXWFZXWFSVltydXrz9fX////w8fJr - bnMxNjo2PD5PVVhpbnJbYGU6PkMzODxBREnJy83///////+Gio4wNTlKTlPg4+X////+/v7///////+E - iI0xNjlLUFXe3+D///+srbIzODtHTE/U1dj////////8/P16foE0OTw7P0NARUrY2tv////////MztBI - TFAyNzo3O0BTV1pscHReY2c9QUc0ODw2Oz6ipqf////////+//9ucXc2Oj1CR0lXXF9aXWBYXWFYXGFY - XWBQVVqYnJ/////7/PyQk5Y0OD00OT1AREhhZWdrbnNPVVc2Oz4zNztVWV3g4uP///////////+0uLk+ - QkcxNjk8P0JaX2Jpb3JbYGQ+QkY0OTwyNzpNUVbS1Nb///////////////////+EiIowNThITlDj5eX/ - ///+/v7///////////////////////////////////////////////////////////////////8AAP// - //////////////////////////////////////////////////////////////////3//v/+//7//7j0 - /iuOnmqIj8XEyMLFyODi4/39/P////////////////////////////////////////////////////// - /////////////////////////////////////////////////6mqrzM3PDo/RMrMzv////7///7+/v// - /8rMz0BFSTY6Ppean/Hy8+3u8O3v8O3v8e3u8O3t7/Dx8v3+/v///5OWmjE0Ozc8P36DiOHi5P////Hx - 86Smqj9DRjA1N2Fma/P09P///4SIjDE0OUtPU+Dj5f/////+/v///////4OIjjI2OUtQVd7f4P///6uu - sTM5PEhNUNPV2P///////7q9wDg+QTxAQzw/Q0BESdra3P////L09GFlajM4Ojg8P46RleXl6P////T0 - 97C0uEVLTjQ4PENHTNbY2v///////29yeTE1OlxgZt/i5u/w8uzu8O3u8e7v8ezu7/X19v///8HDxTk9 - QTU6PVFWWb7Cxvb2+f///+Hi5IGFiTg8PzA1OXl7f/z7/P///+Hh5EhPUjQ6PkZJTq2wtPDw8v////Dx - 88LEx2RpbDk8Pjo+Qra6vf////7+/v///////////4SIijI1OUlNUeTl5/////////////////////// - /////////////////////////////////////////////////////wAA//////////////////////// - /////////////////////////////////////////v///v/+/v7/////6P3/Zs/bJWtzprK0wsLI0dPX - 8vT0/////////v////////////////////////////////////////////////////////////////// - ////////////////////////////p6uuMzc7Oz9EysvO//////////7+////yszRQUVLNTk9oKSm//// - ////////////////////////////6OnrVFdcMjc6WV5k9vb2/////v//////////f4KGKzE1UVZb3N3f - ////hYmNMTU6S05S4ePl////////////////hIiNMTY4Sk9U3t/h////q66xNDg8SExQ1NXY////8PLz - Wl9kNjs+Oz9CPD9EQEVJ2drb////v8PENjs+Njo/eXyA/f7+////////////////q6yvNjxAMTc7kJOY - ////////bnJ2MTU4X2Rn8fL0////////////////////////////dXh+Mzg8PUFGv8HE/////////v// - ////+fr6ZGhsMzg8QUdM1tnb////lpmdMjc7OT5BpKir////////////////////tbe6Njs/PEFGvL7B - /////v7+/v//////////hIiLMTU6SU1S4+Pn///////+//////////////////////////////////// - ////////////////////////////////AAD///////////////////////////////////////////// - /////////////////////////v79///////5//+t9PsiiZVui5LEw8bCxMff4uP8/f3+///9///+///+ - //////////////////////////////////////////////////////////////////////////////// - //////+nq64zODs6P0PKzM7////////////////LzNFBRko1Oj2ipqj////////////////////////+ - ///////O0NE6P0MzOTyQk5n////////////+/v7////X2dqtr7Lg4eL7/P3///+EiYwwNTlMUFTo6+z/ - //////////////+IjJExNjhMT1Td3uH///+qrbI1OTxGS1DU1tn///+WmZw0OD0+Q0VgZGk+QkVARUnZ - 29z///+QlJc0ODs7P0PDxcf////////////////////u7u9OU1c0OTxkaW33+Pn///9ucnYwNThdYmfu - 7vH//////////////////v/////y8vNRVFkzNztgZWn09fb////+/v7///////////+qrbEzOTszNzyw - s7X+//9oa28wNDhSVlrp7O3////////U1tmfo6inqq99gIU5PUE7QUa7vcL///////////////////+H - i44wNjlJT1Ln6ev///////////////////////////////////////////////////////////////// - //////////8AAP////////////////////////////////////////////////////////////////// - ///+//7//////////97+/1jF0zFse7O4ub/AwsvP0+/v8f////////////////////////////////// - /////////////////////////////////////////////////////////////////6errjM4Ozo/Q8rM - zv///////////////8vM0UFGSjg9QG90d6Snq56jp56ipp6ipqChpp+jp+vs7f///7W5vDQ5PTQ4PKyv - sf////////7+/v/////+/v///////////////////4WJjDI4O0RITJGVmaGlqZ+ipp+jpqGlqWNnazU6 - PUtPVN7f4f///6qtszQ4PEdMUNvd39vc3kNISzE2OXR3fa+0tzY5PUBFSdrb3P///3t+gjE3OklOUtja - 3P////////////////////f3+GptcjM4O1JWW/Dx8f///25ydjA1OV1hZ+7u8f////////////////// - /////9ze4ERITDE1OX2AhP///////////v///////////83O0Ds/RDM4OpqdoO3v8VVaXjE1OGdscf// - /////////5yeoigsMTI3OzM6PDY7PzY9Qbe6vv////////7+/v////n5+mpvcjQ4Oz9ESMfKzP////// - /////////////////////////////////////////////////////////////////////wAA//////// - /////////////////////////////////////////////////////////v///v///////f/////+9v7/ - ofD6IImZboWRwcLHwcLF3uDi/Pz9//////////////////////////////////////////////////// - ////////////////////////////////////////////p6uuMzk7Oj9DyszO////////////////y8zR - QUZKPEBDNDk8KS0xKS8zKy8yKi8xKS4wKi8z0dPU////sLK2NDg8Mzc7trm7/////////////v7+/v7+ - /f/+/v///v7+////////hYqONjo+PEBDLTE0Ky8zKi4yKi8yKS4zNjo+OT1BSlBU3t/g////qq2xMzk7 - SU5S2dvgenyAMTY5QEVJ1tfaur3ANDg8QEVJ2drb////eHt/MDY5TVJW3d/h//////7///////////// - +fr7cXZ6Mjc7TlNX7/Dw////bnJ2MTY5XWFo7u7x/////////////////v/+////1tjbQkdLMDU4hYiM - ///////////+////////////1NXXQERJMzY6lZmd5ujqUVZaMjQ4b3R5////////////tLe7WV5jYWZq - Y2ZrY2ZsYmdrxsrN///////+////////q66xODtAOj9CNDk9aW1w8/T1//////////////////////// - ////////////////////////////////////////////////AAD///////////////////////////// - ///////////////////////////////////////////////+///9//7////f+/9ez9wlaXSgrLK+wMLO - z9Hu7vD////////+/v7///////////////////////////////////////////////////////////// - //////////////////////+nq64zOTs7P0PKzc/////////////////LzNFCRko6P0NUWV5vcnZrb3Jr - b3NqcHRrb3Nrb3Te4eL////CxMY2Oz8zNzunqa3////////+///+//////////////////////////+F - iY00OD1AREllam5scHRrb3Nrb3RucnVPU1Y3Oz9LUFTe3+H///+qrrIzODxQVFiPkphBRUkyNjqMj5P/ - //+xs7Y0ODxARUnZ2tv///+ChYkyNzpFSk7U1tj////+/v7////////////29vdjaGwzODtWW2Dy8/P/ - //9ucncwNTlcYWbu7vH////////////////9/v7////l5ulHS08xNjl4e3////////////7///////// - ///Hycw4PEEyNzqfoqX09fdYXGAwNThnam/////////////9/f38/f38/f3////////+///+//7///3/ - ///////k5eZNU1Y3PEBESU0/REg1Oj2jpqj///////////////////////////////////////////// - //////////////////////////8AAP////////////////////////////////////////////////// - //////////////////7+//3///////7//v///vj+/qv1/SeWo19/hcLCxMDCxt3e3/r6+v7///////// - //////////////////////////////////////////////////////////////////////////////// - /6errjM4Ozo/Q8rNzv///////////////8vM0UFGSjU6Ppyfo/v8/fj5+vj5+/f5+/j5+fn5+f3+/v// - /9rb3UJHSzI4OoGEif///////////v///////9vc3tXW2vT19f39/v///4WJjDA2OktPU9/g4/n6+/j5 - +vj5+vr7+4WIjjE2OUpOVN3f4v///6qssjY7P0BFSUJGSTY7PlNWW+nq7P///6+xtTM5O0BESdja3P// - /6GlqTM4Ozg7P7W3uf////////7+/v7+/v///+Pk5UdLUDQ5PG90ePv7/P///25ydzA1OF1hZu7u8f// - //////////7///7+/v////n5+VxfZTI3O1ZbX+3u7/////7//////////////5mdoDM4OzY6P7u/wf// - /25zdzA2OUxQVOLk5v///////////////////+zs7eTn6Pj4+f79/v3////////+/3+ChjM4Oz5CRbi8 - wHB1ejA2OkpNUtze3/////////////////////////////////////////////////////////////// - /////wAA//////////////////////////////////////////////////////////////////////// - ////////////////////6f3/adbkH216lqerwMHEyszO7Ozt/v///////v7+//////////////////// - /////////////////////////////////////////v//////////////////rrG1Mzg7Oj9C0tTW//// - ////////////yszQQUVKMzk9o6ep////////////////////////////////9fb3aGtvMDY4SE1R3N3f - ////////////9PX2ZGZrODxBY2hv4+Tm////homMMDU5S09U5ubo////////////////hYmPMjU4S1BU - 3t/h////q66yNzxBPUFEOz9COD1AsbS3////////rrG0Mzg7QERJ2dvc////2NrbPkNHNDo+XmNm7e7w - /////////////v//io6RNTo+Mzg9pqqs////////bXJ4MTU5XWJm7e7w/////v7+/v////////////// - ////kJOWMTU6NztAoaSn////////////////5eboUVZaMTY5TlNY5ujp////q6+xMzc8NzxAiI2Q/f7/ - ////////////+Pj5bXBzP0RJZ2tw4ePk////////v8HDOT1DMzc6eHt+////xsrNO0FFMjc5eX2A/Pz8 - /////////////v///v//////////////////////////////////////////////AAD///////////// - ///////////+/v7////////////////////////////////////////////////////////+/v7///7+ - /v+39v83o7NHdH69vsLAwsbY2dz3+Pj////+///////+/v7///////////////////////////////// - ///////////////////////W2dy7vsG+wcXAw8iGio82Oz87QESeoKXCxMe+wMO/wcT5+fnNztNBRUs1 - OkB/g4fCxcm+wMO+wcS+wcS+wMS7vcHS1Nj///////++wMM6P0Q1OTxWWmCwsrbc3eDFyMtzdnw3PUEv - NDdtcXb3+Pj///+Hio0xNjpKT1Ph4uT///////////////+Eh40xNTlKT1Te3+L///+rrrE3PD89QkU0 - Oj1zdXz6+vv///////+vsrQ1ODxARUnY2tv////8/f2Hio8xNjo2Oz1kZ224ur3c3eDIyc6BhIo8QUUy - NzpeYGTs7O////////9tcnYwNTddYWbu7vH//////////////v/////+/v7////e4OBOUlY0ODxARUmL - j5LMz9La292xsrZaX2E3Oz8zNzydoqL////////y8/NkaG0zNzs6PkJ8gIPCxcna3N/Exsl1eHw5PkEx - NThjZWj19/f////w8PFcX2MzNztGSk/V19r///////99gIQ0OTw3PEG4ubz///////////////////// - //////////////////////////////////////////8AAP////////////////////////////////// - //////7///7///////////////////////////////////////////7//v///ur+/4Dl8Bp0goKZnr/C - xMfIzOPl5vv8/P////////////////////////////////////////////////////////////////// - /3x/hiowMzI3OjI4OzU5PTg9Pzc9QDU5PDM4OzI2OjM6Pt/g4NDR1TxBRDU6PjY6PjQ4OzI3OzM4OzI4 - OzI4OikuMnJ1ev///////////5+jpjg9QS8zNzM4PT1BRTk9PzI2OTI2OlBUWNvd3v///////4KFiSsw - M0RJTeDh5P/////+/v///////4CEiSswNEVKTtze4P///6irrzI2OjY5PkFGSdXW2f///////v///6yw - sS0yNjo/RNfZ2v///////+zu72tvczE2OjE1OzQ5PT5DRTc9QDA1ODA1OFJVWtPU1/////////7//2ds - cSovMldbX+3t7/////////7+/v/+/v///////////////7/Bw0NITDE1OTA1ODo+QT1CRjQ5PTA1OTQ5 - PYaKjfn5+v////3//////93f4FpeYjA0Ny80Nzc8Pz5ERzg8PzE2OTE2OUtQU9DT1v////z8/Y6SlC0y - Ni80OJGUlv////3//////9vc3kNITC0xNFFWWubo6f///////v////////////////////////////// - /////////////////////wAA/////////////////////////////v///////////////////v79+vz8 - +/39/v///////////////////////////v///v///v/+xfr/R7vML2l0prG2wcDDy87R6+3u///+//// - ////////////////////////////////////////////////////////////kZWZS1BVUldbU1hbU1dc - U1dbU1dcU1dcU1hcUldaVVpe5OTm1dfaVlpeUVVaU1hcU1dbU1dcU1dbU1dbU1ZbS09UiIyP/////v/+ - ////////u7/Ca25zSk9TQkZKQ0hNTlNYgoSI3+Hi////////////k5aaSExPX2Rn5eXn//////////// - ////k5aaR0xQX2Jn4eLl////s7a7TVJWTVFVnaGk/////v//////////ubu8SU5SVFld3N7f///////+ - ////8fLzmpygWl9iRktQQUZLRUlNVFddiIuQ4ePk////////////////jJCUXWBjfoKH8fLz/////v// - //7+/////////////////v7+////09bXd3t/TVJXQkhMQUZJSU1RZWdsr7K1+/v7///////+/v///v7/ - ////6evsjpKWVVpeRUpPQUZLREhNUFVafICC2Nnb////////2tzeV1tgTVFVZWht7Ozt//////////7+ - ////mJygTFBUSU5UnKCj//7///////7///////////////////////////////////////////////// - AAD////////////////////////+//////7/////+vvy8PPm5+rk4+Tl4ePr5ebs6ens7u7z9/b9/f3/ - ///////////+///9/v7///70/f+Z8/0olqZLcny2ur/AwsLV2Nr19PT///////////////////////// - ///////////////////////////////+///+///z9fXq6+7q7O7r7O7r7O7q7O7r7O/r7O/r7e/q7O7r - 7O78/Pz5+vvr7O7q7O7q7O7r7O/r7O/r7O/r7O/r7O7p6uzw8vP///7+/v7+/v/////////+///d3+HK - zM/Oz9Pm5+r////////+///+//7////x8/Xq6+vr7e/7/P3///7+/v7+/v7+/v7y8/Xo6evt7vD7/P3/ - /v729/jp6+3p6+78/f7////////9/v7+/v739/fq6uzr7O37+/v+/v79//7////////////y9PXV1tnJ - y8/R0tXt7fD////////////+///+/v7///78/v/9/v38/v7////+/v/+/v7////+/v7////////////+ - /v7////////////k5ujO0NLKzM7Z2937/P3////////9//7+//7//v7+///+/v7////////w8PLR09fJ - zM/P0NPo6ez////////////////y8/Tm6Onq6+309fb////+//7//v7+/v7////8/f7q6+zp6uzq6+z9 - /f3///7///7///////////////////////////////////////////////8AAP////7///3///7///7/ - //7//////+j3+6fn8XTW42DK1lu8yFu1wGKttoettq67wNHN0NzY3OHi4+/v7/n7+v/////////+/v7/ - /////+P5/3fi8Bt4hXCHkbu+v8HExd7g4fz7+/////////////7///////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////7///////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////wAA///////+/f///f7+///////+1fb9duP1MNXqE8/i - E9PpKdToK8/jLcPVKKy6NJWhYZeilaewv8HG0dHT3dve6Orr9/n5/v///v//////+/7+vPf/T8fZI2Zz - lKKnuL3BxMnN5+jq/v/+/////v////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////AAD///////7//////v/+//7T+Pxw5fUuxdQytcNjucd/y9mH2OWB4e9r4/Jf3vJL - 1OcruMkhlqNFh5CKoKS/wMTMz9DZ3N3s7e/8/Pv////////n+v2b8P0qo7E9a3Wwtbm/vcHJ0NLt7u7/ - ///+//////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////8AAP// - //////3//////vT8/5Hq+S2ou06Xoae4vsjDx9fT1Ovh5e3s79zu88Pt86Ht9Xjm9VXa7i61xySHlFmG - kZmmrcfGyNHR1ODi5PX3+P///////9n5/3rn8x6GlVt5gba2vLzBxdfZ2/f39/////7+/v////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////wAA/////////v/+//7/0Pj/TL7O - QnqEvbzAyMbH1dbW7O/w/vz9//////7///7+/Pv94PX5su74iOn7V9jqKau8JHiFbYqSuLu/ysfN2djb - 7vDw/f79/P//yPj+Y9jmHHF/co2UvLzBvsTI3+Dj+/v6//////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////AAD////+/v7////1/f+N6fUihJORn6TJxcjHzM/o6Or///7/ - /////////////////////////v3j+Pqw7/l25/lJyNkegpBKd32mq6/Cw8fL0NTk5ub8+vrw+/609P9B - wNAlZ3GWn6W8u8DEx8vj6Of9/f7///////7//////////v7//v/////+///////+///////////+//// - ///+/////v/////////9///////////+///////+///////////////////////////////////////+ - /v7//////////////////////////////////v7+///////+///+/v7////////////////////+//// - ///////+//////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////8AAP///////v///+D9/2bN2y90gbC4u7+/w9DT1fPz9P////////////////////////// - //////////v9/sv0+pTt+lrb7CGbqi1weIybosS/xMjKzOPj5Pn39uL4/ZPu/C2mtDVnc6mtsr28wM/P - 0uzt7v3+/v////7+/v3///3+//7+//7+/v7///7///3///7///////7///////////z///3///7///7/ - //7///////7///7///7///3////+/v/////+/v7+/v7///////////////////////////////////// - //////////3///7////+/v////3//v7////+/v7+/v////////7///z+/v////7+/v////7///7///// - //////7///7///////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////wAA/////v// - ////3v3/X8DPOnJ/tbq+vb/D1NbY+Pj4/////////////////////////////////v7/////////5/v9 - s+/7duf3LLDBI2p2g5KXvr7Bx8fL3t7f8fHz2Pf7guv5I5WmQ253qrO3vL7D0NPV7fDw/////////f/+ - /f7+/f///////////////////////v////7+/////v///v///v///v///////v/+/v/+/////v////// - /////////////////////v///////////////////////////////////////////////v7//v///f7+ - /f7+/v///v///v7+/////////////////////////////////////////////v///v////7+//////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////AAD//////v////7j//9fw9E3b32ytry8 - v8PT1dj4+Pj////////////////////////////+///9//7+///+///////4/P7C8/1+7Po1usodanaA - kJa7vsHAxsva3d/t8PDO+P5y5PQjh5ROcXuwtby/wMTU1tjy9Pb9//////7////////////6+fj49/f5 - +Pn8/f3+///////////+/////////////////////v7//f38+/v6+/r3+/v29/j29/f2+Pjz9fX4+Pj9 - /f3////////////+/v7////////////////////////////+///////////////+//////////////// - ///////9///5+vv29/f39/f59vjz9fb29/f9/f3///////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////8AAP////7//////+n//2TJ2DRve661uby+wdHT1fX29v////////// - //////////////////7///7///7///7///7//////vr9/sz2/Irt+z3B0SBxf3OKkL24v8LGx9nZ2+bs - 77r1/13a5x14iWWFi7e5u73CxNTZ2/bz8/z9/Nv0+qzc4bTO1MvP1NXS1NrY2d/i4ebs7Pb29v78/P/9 - /P/7+v/39/Dx8uTm6NLc38/X2dnV19bW1tXS1dbS1tXV19fY29jZ29rZ2t/g4fHz8/3+/v////////// - ///////////////////////9/f35+PPw7+/q7O7u7/X49/7+/v////////38/Pj19Ozp6d/f397Y2tbR - 1dLP09DLz8/Pz9HV1d7j5Pb3+P////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////wAA//////7+////8///fNnnKnF8oa+xvr7Bzs/R8PHx/////////////////////////////v// - /v///////v/////////+////////2Pf+nfD9RMfVGm97bIiQvLq9v8LE1djX5+3xrPX/T9DiHXF+bYmP - ubq/wcXI3tvezu/1aeDxIMPULKa4Pp+tU5ujhZ+ptLO5zcTH1c/Q3Nja2t7itt/mgdbiYMzaUMbVQbzN - Qq67U6Grcp+llaKoqa+ypre9o7e/prO5tba8vbu+wsHD09PV5OPl7e/v+vv9/////f7++vr8+Pf49vX1 - 7u7xuuHojMTMn7O4uLe8xMTG2Nna4+fn5+fo5t/i4NjbvdTbjMvUf77Jc7vEbLK8eqOskaGor7S4uL3A - zNLU9vb3//////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////AAD////+///////4 - //+d7fcifImFmZ/AwcPFyMzn5uf+/v/////////////////////////////////////////////+/v7/ - ///////+/v/g9/yU7/s8xtYZb35siJC7t727w8ja2dzd7fGo9P9KyNcabnt0jJG9urvFyszK9fqD6PU8 - 2+o30+Yty90tusoqnKpBjpx7q7hwwMxdx9VV0uI52+4n1ewp1uok2ewq1usz0eMnxNUlrLw3o7FEu8o6 - ytgxv9A3q7lGnqpan6pvnqWRoKatrrO+vcHKy87U1dfa3N7f4ePl5ufu7OzX7fJy4vMswtMsnalChpN6 - lJ2xrrfHvcHGx8mz0dmH2edT3Owu1ukuy94szeEvyd0puMgphJBgeoKrrK+2vb/Z2d37+vz///////// - ///+/v7///////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////8AAP////7//////vz//8H6/ziaqld6gru+wL3B - xd3d3/r7+/////////////////////////////////////////////////39/v7//////v///tr4/ZDv - /jvB0h9odn+Ql726wb7Dxdnb29jv9J7x/UjI1iF1gmiEiLq5u7/W3Zjp9mvi9Fnf8kbg8jLd8DDW5zHG - 1yjI2yLU5yjX6y7U5jDL3TDJ20DK2UnM21HT5HTi8Hrp+FPf8DXT5TDY6zXb7TTW6SrX6TXR4i/E1Cev - vy2WoUeMlX6SmqCjp7O0t7+9wcjKzdDV193e4Nfz+Ibo9jLZ7DTS5iu5yCiVo0GRnm+rs3zN217g70zf - 8jnX6yvP4irQ4jDV6jLZ7THi8yK6yh9ibY+aoLu/wtXW2Pb19v////////7+/v7//v////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////wAA/////////v/+/v//4vz/YMXULGl0rbS4vL/B0dLV8vLy//////////// - /////////////////////////////////f///f7//f7+/v///////f/+3Pj9k+v6NLrJJGh0hpacv7rA - w8bH3d7e1+/zovL/S8zbHHWCZIGIt7W4s73DqM3XlNvoct3rT9vrXN7vb+L0XuDzSd7vPtvtMLrJTZKc - dZmfiZuppKqvsbq+v8vQyOTqlun5N9/uMtrrOtnqNcDQRbfGXtjnZuf4UuL0QNPkL7zLJZqtOoKRb4yR - n6WqtbG3v77Cw8fJ2u/0kOv3M9XoM9fqPN/xTdjrOMbYLsraO9rxQNToK7nLM6q4Ya+7gbbAkb/HlMbM - l9DXhcvWhK+4tb3Bz8/R5ebn+vn5//////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - AAD////+///9/v7///74/v+a6vQde4p9lp3CwsTEx8nk5uf9/v7///////////////////////////// - ///////////+///////////8///+///////+///b9/6N7/0vq7opZG+Uo6e3vMDJyMvk4eHc8/if7/5F - y9sdbnxyhou3tbjCubzFyMrR1tzP2+LQ4eXL6O6l6PN35fRW3vExwNMzdoJxen+hnZ+nqK3CwMfU09Tf - 6u2C5vM31OZk4fRQ3u8qrL5Ib3aDkJeIu8aE0t6I5/Vt5/ZJ2+wzvdAkmKc5iJFkjJOVn6Wyq6/N192n - 9P48zuE2p7hiu8pw4Otl5/gr3e8dxdYtp7dgn6igsLW9u77OxsnSzNHa1Nfe1tjh2tvd3N3d3uDl5un2 - 9/f+/v7///////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////8AAP///////v/+/f7//vz/ - /8/8/0KzwUBwere6vri/wtPV2fX19v////////7//////////////////////////////////v7///// - //////////7//////v7//tD4/nbn9ySaqD9rcaats7m6wdHS0+rp6trz95ju/D7F1h94hV6CirKzt7vA - v8rN0eXe4fDt7Pn19vT2+dLz+qHq+WXj9Cy1wiBocXuNkq2us7u7v9PX2Nn2+1jN2Vujs7Dj7ZPx/kHK - 3B5tdGp4faOfpayutb3I0LHd6JDl9HPm9k/c7jXF2COgrjSGkHGWoK7Ax63w+0PO3Sd0gHV/hJ2mrJPM - 1nXS4n/EzbXIzd3Y3efj5Ofq6+/x8vb4+Pj3+Pf19vT19vHx9fT29vv9/f////////////////////// - //////////////////////////////////////////////////////////////////////////79/v38 - /f////////////////////////////////////////////////////////////////////7///////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////wAA/////v/+/f///v//////7/7/hub0InWEf5WXv8DD - wMfJ5OXn/v7+/////v///////////////////////////////////////////////////v///P/+///+ - 9v3/vfL9aePwG4GPVXV9s7a6v7/D1tfY7O3v1/P7me/7TtLiGYeUTHN+p6itv8HEys/P4OPl9fX1///+ - ////6fn7u/D6eev4Kqu7MGRvlJyjr7O3ytDV3Pz/VL7QPmVoj3ZxttTZgvT+JaCtNVxignFtn5SRyMLE - 6Ofq5e3xze3yoez1duz8UeP2OcfWJ7bJQNDfbOLzQNblJHSBXXN5o6Kmvbu92dfc9/Hx//3++vv8+fn4 - +/v5/Pr6+/j4/v//////////////////////+PX15NXSz7OsyKecyqWczayh2Ly2697d/Pr6//////// - //7+/f7//v///////v/+/////v/+////////+vb15dTQ0LKpyaOXvpKJu5GGw5yPzKuj487K9/Hv//// - //////////7++ff3+vj4+/n5/////////v/+/v/9///+/v///f///////v7+/////////v//+PLx9vLx - 9/Py+fb0/v38/////////v//+PTz+PPz+PP0+PX1+fX19/Py9/T0/Pv7/v///////////////v7+///+ - /f7////+/v7+/v////////z9+fLy+fPy+PTy+fTz+PTz+fTz+PPy+PTy+PP0+fP0+PX09vPx+/b2//// - ////////////////AAD//////////v/+///////8/v7F+f9FscE2bnS0ur69wMTT1df09PT///////// - ///////////////////////////////////////////////+/v/+///+//////71/P658/9Q0uEbcX5w - h420t7u/xMXY3N359fTl9/uh7/te3e8hnKw0bnqJmZ+/vsDMyczW29/t8PH9+/v////6/PzG8/xq5vgd - kp9GanGnrbShm5vG1NR52ucjXmZcOSuJamW48/hV1eYhaHdLQDlpQTSEY1i3oZzz7ev++fq7lY6bn5qH - 1d546/pg5vhE3O493PA30+Yic4Bke4C2tbvO0NHw8PD////x6Oa4jHyteWqxfGuyfW2sd2fSta3///// - ///////y7OvTtaqyf3CmZ1ajZE6jZU2lZE6hY0ugZU6mbVmzgXPUu7T49PL////+//7+/v79///+//78 - ///////8+fnWvLSxemykaFGiYk6hYEygYUykZFChY06fYEylZlGvdmXHoJTs4Nz++/zMqJ+ud2aveWqu - fG7Vvbb+/fz//v/+//7+///+///+/v/9/v/9///////y7uy9loyweWqyfG+xfGyqeWfJqZ7////49PLF - opSwemuwe22vfW6yfW21fW2zfm20gHK5h3vCnJHXv7bp4d7////////9///9/v7+/v7+/v7////p4t63 - in6xemuzfW2zfm+yfm+xfW+zfnCzfm6yf26yfm+xfm+xfnCwfG6yemzgzsf///////////////8AAP// - //7///////7///7+/////+/9/43o8x19i3qQl8TBxcTFyeLj5f39/f////////////////////////// - /////////////////////////////v/+//3+/v3//////+/7/6Px/T/C0h5kcIOXnri7vsfHzOPm5vz5 - +e74+6zw+Wvl9C62xSN/jlqFkaOqr8XExs/R1ODg5O7v8Pn4+e71+Lr2/0/T4SJqeWlsbGg8Nquhn5z1 - /SF/jlZIRGk4K6+vr5b0/h+Il0ZLTGxANXZJOYRINLyXjv7//7J+bZ1aQJ9rWZeRi5bN1Hbk9DXe8B25 - yTN3hKOtscnKz+Dj5fz7+////8GZjpxcQ6doUqNnUKRpUp5eSLuShf////jz8tCxqql0YqBgSqNnUKVt - V6VtWKhuWKpvWqlsWqdsW6drVqRnUaBfS7J9b+LTz/////3//v/////+/v7///j087qTg6FfSqZnUadu - WahtWKdsV6ZuWalvWqhuWadsWKZsV6prVpxfRqRsWvDm5b+Uh59hR6RqVKllUZ9jUOvh3/////7+/v// - //3//v7//vz+/v7+/////8emnZ1aRKZqVKZpVKVpVKBgSLaLe////8yroZtbQ6JoUaZnVKZoU6RnUaVm - UaNoU6VoUqVkT6JiS59iTKRqWL2UhunX1f////////3///////7+/r+XjJtdRKRpU6RnUqRnU6VnU6Vm - UaRnUqZnU6VnUqRnUaRmUqNmUqNmUp9eRtK4rv///////////////wAA/////v////////////////// - ////0fv/UcLRLGd0qbC1xMDDzM/S7e/w/////f////////////////////////////////////////// - /////f/+/f7+/v///f7//v7////+4Pj+i+78KKi3OmVwo6euubm+ys/R6e3t////9/z+yvH7hOz6S9Pl - JJ2tN4CNdJObrLK2x8XI1dHU39ze4uLj4/L2iun5JYiYQUJBYzcqkXRwuvj+OLXFMFVXZTkpimlirfD4 - LY+fSElFb0I2dk9EiFE8x6qk////1LWuomJKoWlSpmBKnmVQqKmmrPT8kc7Zt8nR4N7j5ujp9/r5//// - 8OvqqHJgqGlUq25ZqG1Zqm5boWNO3MrD+PTzs4d3nF9HpWVRqW1aqW1ap21ZqGxXpGZQo2VOpmhRp2xY - qGxYp21Yqm1aoWROo2dT4M7K//////7+/v///Pr6vpSIm15HqWxaqGxbpWxXp2xYqG1YpmhSpGZQpWhR - p2tXqG5Yp3BbpmlTsHpq+PT13MjBo2NPp21Yq25ao2JMyKWb/////////////f7///7+////////+PXz - sHlppmlTpm1WqG1ZqW1ao2JN0rSt////vZSFo2NNqG5aqG1Zp21YqGxYqWxZqG9aqW5Yqm5cqG1ap21Y - p2pUn2FLpWxW0rWs//7+/v/+/////fv8vY6Do2dSqm9bqW1ZqW1Yqm1Zp2xXpm5YpmxWqW1Zp2xYqG1Y - p2xXp2pUpGxW6uDe////////////////AAD////////////////+//7///////3z/v+h8/0nkKFYe4W6 - wMK/wsXX29z4+Pn+///+/////////////////////////////////////////////v/9//7///////7/ - //7////+/v7M9f1y4/Qdh5JYd362trq9vcHY2Nv19/j//////v/g9/ye7/ll5PU2xtgknqs8k55jmaKR - qbC1ur/DwsTR2+GV8PwmlKM/SUtmQTR3SjzEy8qK7vwdjJhHV1eEg4KJ5vEleYVQPTZwQTR9TTmUZVPx - 6+n////s396naVelbVeobFmkaVKmZVPhysL////////+///////////+///IpJqkZE6oblqnbVmnbFmn - aVSpc1/49PHl1dOgXkirblmlbFiob1qoa1ajZE6obly0hHi5kYWzg3OlaFWpalapblqoaleqbVqiZk6m - dGL16+v+///////exsGcX0iocFqqbVmma1apb1qkZ1GlblqygHC2hnavemmma1agYEqlZlCfXUXSt67/ - ///y7OyrdGKnaVSobVqlbFekalTXwrv+///////////////////////PsaigZE6nblmobVmobVmoa1ap - bVju4uD9///AloukZE6oblmoblmobVmncFumbVegYUudY0yiZk6naFSob1qoblqoblimalSeXkvTtrD/ - ///////9/P29j4KjZU+nbVmnbFmnbVeqblmhZVGkZlKkZ1OlaFOlaFSmaFSnaFSgYEy/m47+/v7///// - //////////8AAP/////////////////////////+/////+b9/3Db6hpwfoybo8TBxcPIy+Xn6f7+/f7/ - /////////////////////////////////////////////////////////////////v////L9/bz0/1DP - 3xxqeXuSmLe3vcXDyODj5Pr8+/////////L7/cHw+orq+WPi8jrM3iq1xiqms0Sqt1fDz3fi8F3e7yN9 - jU1GQ3BIO3tIN6B6bbnv9Fza7Ce80ULZ6SuuvT9xfZaGhIpsYYdbScuzrf////////v6+riLfaVjTqdu - WqZvWqZmVKFmU8OeleDNyujc1+vd2+TU0MKflaJnUqltWadtWKdtV6huWaJjTb2Wh/7///v5+LqQgqJh - S6VuWKNlTqZuWcakme7i3/78/f7///v5+d3IxKZwXKdpVKdsWKpqVqVuWZ9gSdOzq/////38+7eHeKVm - T6lvW6dsWKZsV6ZmULaIeOfa2Pr5+P36+fr39OTY1Mmmna95Z7OJfPj08/////7//7+WiaRkTqluWqdu - WaZqVaZmVMOYjd7Mx+rb2Ond2ObW08inoaZnVKRqVahrWapvWqltWaVmULmIeP7+/v7//8KYjKJkTalt - WahtV6drV6lsWKhyYMikms6vp8KajKhwYaFkTahuWKhsWKptWaZpUqNrWOzi3v////79/ryQhKJkT6ds - WahtWahqV6ZvW9CzruLKxuLMyOLLyOLMyeHMyODLyOPS0Pz49////////////////////wAA//////// - ///////////////////+///+/f7/vvj/PLjEMGl0rra6vsHEz9PX8PDz/v/+//////////////////// - //////////////////////////////////////////7//v7////+6/z9n+37Mq/BMmVwmqeut7m9yM3O - 7e3u/////v/////+///+7fn9ue73geb1WuP0QtrrKtTlHNToJM/jJqe2QF1fbkc+f1FBjVtHkVdBvra1 - qvX/PODwHLfJRZCbrbe91dXa3t/h5+Ph/Pz8/v////7/////0bavn2BMqm5aqWtYpnBapmtVpGVOo2hT - p21Xp21ZpGhWpGRPpm1YqG1XpmxYp25YqGxXo2NP28K8////////8+3tsYNynWBKuYd76NzZ//////// - /////f///v//////zKyioWJMpm1ZqG1Zpm5ZoGNOu5CC////7+Phpm1WpmhUqWxYpmxYpmlVpnBg8Orm - /////v///f//////////////9vDx9vT0/////f7+////3crDomNOp21XqW1Xp25Zp3BboWFMoWVRpmxY - p25ap2pVoGRPpmxXqG5bqG5aqG1YqW5aoWJN1bew//////7/wJeJo2RLqG1ZqG1Ypm1YnmNN0LGn//// - ////////8ennwJiKo2VQqG1Zp25apG1XoGBJzKad/////f7/vpGEo2VQp2xZp21YpmlVqHJh8erp//// - /////////////////////////////v/+////////////////AAD////////////////////////+///9 - ///////x/f+W8PslkJ1Xe4PCwsTAxMbW29/49vf///////////////////////////////////////// - ///////////////////+//79///9/////v7Y+P576/gnjJlOdXuwtbq7vMHY2dz4+fn////+//////// - //////7t+PvF8fef6PRd3+48zeBXusVncnF5TDuFU0KPXUmaY02eX0vexsL0//+97PS53eHc4eLq6Ort - 7+/6/P7////////8/v79/v/////y6OWobVipalembVumcFqnaleobFigYUyiXkmgX0ikZlCma1iob1qo - a1iobFmlblmoalOscmHy6+n///////7////08O/k09D8+Pj////+///+/v/+///9//7+///////dxb2f - ZEynbVmpbluoblmjZVC5hnf//f7gysWjZ1KmblmobFaqbVmiZk65joH////+///9/v/////+///9/v39 - /v/////////+///+//7////38O6rcWCmaFSla1arblmnb1uqbVilY02hX0qeYEijY0yqblqobFmpbVmm - bVimbVipbVemalbp3dv////+///CmIykZU6pbluobFenbVqlY07axLv////+///////////59vaygXOk - ZFKncFqpalqmZlKxfW78+vr9//++kYSmZ1GoblqnbVelalSrcF7x5OP///////////////////////// - ///+/v7+//////////////////8AAP////////////////////////7+//7+/////////+D5/3Pg7B12 - hIKUnMTExcHIyN/i4/z8/P////////7+/v////////////////////////////////////////////// - //7///7+//////r+/8L4/lnU4h1reYGVmrS4u8PHyebm5//+//7//v3+/f/+/////////v///v39/e71 - 9+bw9ejm5ZtpXI5XQ5diTp5lUaRnUqNrV+bb2f///////////////v39/f////7///////7+//z+//// - /v////3+/r2Pf6RkT6dwWqZvWqZrWKdxXb2Qg8GUiMGWirOGdaVqVadtWKdtWahtWadrWKZjTcCXiv// - //7///v//v///////////////////v7+//7+//7//v7//////////8SimKRkTKtsWKdvWahsWaNlT7mM - fv3//9S4sqRjTqhsWKdtWKluW6FkTcOZjP////3+//7//v7+//7//v3///////7///7+//3+/////v/+ - //7+/sehlqFiTKlvWqhsWKZrV6hwXLuQgsGWisCUibmKfKduWqZsV6dsWKdtWaZtV6NnUbmKfPz7+/// - /////8SZjaJkTqhtWadtWaduWqJjS9nAuf////3//////v7//////9O4sKJhTKptWahtWaZpVKhxX/Pt - 6////72PhKVlT6htWKdsWKZoU6pwXvHl4/////7///7///7///////////7////+/v7///////////// - /////wAA/////////////////////////v///v/////+/f///f//zvv/T8XUJmp4nqqxwMPEx83P6+rt - //7+/////////////////////////////////////////////////////f///f7+/v7//v7/////8v3+ - nvL+Lqi2Omdypq6zt7m+0dPW9fT1/v////7//v7+/v7+/v///v//////////////+vTzpnJimmVOpGpX - pGpXpmpUpG5Z6uDf/////f/+/f7+/////v///v7//v7////+/v7//f7+//7+/v7/////2MG7oGNNqW5Y - p21ZoWVOwJmL////////////697bpmtYpmpWqHFcp2xXqW5ZnWJN2sO9/////f7+/v/+/f///f3+/v7+ - /v///v///v7+/v/+////////////6NrXp29cpWtVp2pXqHBZqm5ZoGFLxJ2N////0bOtomJOp21XqG5Y - qG9bo2ROxJqO/////v///f7+/v///v7//f/////+/v/+/v7//v7+//7////+////383IoGRPqmpXqG9Z - pWVPt41//v/+////////8ejnqXJgpmlTp21Yp25ZqW1Zn2FL0LSt/////////v//xJqNomRNp21ZqG1Y - qW5YomNO2L+4/////v/////+/v7+////5NHLnmVOpmpXqG5ZpmpVpGhW6+Dd////u46DpGVPqW1YqGxY - pmlSq3Jf8ufm//////////////////////////7//v//////////////////////AAD///////////// - ///////////////////////+///////6/v+w9v84q7o8cHq3ub7CwsbR09jy8vL+///9//////////// - ///////////+/v7////////////////////////////////////////////X+P5t5PAee4hpgoq3uLu/ - wsbd4OT7/Pz////+/v7////////////////////////69fWweWqjaFOnbFinbVmma1Wob1vt4uD///// - ///+///////////////////////////////////////////w6OirdGCmalSobVmkaFG0g3T7+vr9//// - ///Zv7eiYkypb1qob1mpbVika1WpcmDv6Ob//////v/9///+//7+///+/v/+///+///////////////4 - 8/PYw7uocGCoaFOnbluna1iqb1qmbFigYEzYu7L////TtK2hZE+obViobVeobVqiZE3GnpP///////// - //7////////////////////////////+/v////7////39fSxe2unaFOmbFmkZlOtdWP07Oj////////f - y8OkZFCobFenbVmmbVqobFekalfv4eH////////////BmY2jY06obVmobFmoblijZk/Xu7P///////// - ///////////o2NShZVGna1eobFmnbFinalbu4N3///+8kIOkZE6pblqobFimaVOocFzt4uD///////// - //////////////////7///////////////////////8AAP////////////////////////////////// - //////////////P+/5Lx/CCPoVd5gr3Cw8HEyNna3fb19//////+//////////////////////////// - //////////////////////////////////////P8/rX0/zu+yyllbpuorLu4vMbMzvDu7v////7///// - //////////////////////r19LF7aqVpVKltWaltWqZqVatwXO7i4P////////////////////////// - //////////////////////7//////8GYiqFkTqhuWqdsVqdpVuXV0v/////+/ruMfKFjTKluW6dsWKpu - WqJjTr6ViP39/v/////////////+//z///3///////////Dn59nEvcqnm7J9baNiTaRmUaluV6ltV6ht - WqhuWqJlUKx2ZfXz8f///9G0rKBkT6htWKltWahuWqJjTMeelP///////////v////////////////// - //////7///7//////v7//////8ulmqJiTKduXKhtWKJjTt/Kxf///////8KfkqNiTKluWaltWKluWqRl - TrmKfP78/f///////////8GZjKNjTqhtWahtWqhuWaRlUNa6tP///////////////////+jW1KJlUalt - WKZuWaZsWKhrVu7h3f///7yQg6JjTaltWqhtWKltWKdqVreHfMiilcWckMSck8SflMennO7g3f////// - /////////////////////wAA////////////////////////////////////////////////////2/r/ - euLvHnuJcYyVx8TGxcjK3d/i+vn6//////////////////////////////////////////////////// - //////////////7+///+6fr/h+z4IoyYVnh/sba6ur7B2drc+fr7//////////////////////////// - +vb1sXtqo2hSqW1ZqW1apWlUrG9b7uLg//////////////////////////////////////////////// - /v//////3MjBomNNqW1aqW1ZoWFMz6+n////8ejmqHBbp2tVp2xYqGxYqW1ZpGRQ17+6/////v////// - /v///v/+////////6+Lew56Tq3JfomJOoWBMpWhQqG5apm1Yp21YqG1ZqW5cpmdRomZR4M3I//////// - 0rOtomRPqG1YqGxYqG1aomNMx56U///////////+/////////////////////////v///f7+/v7//v// - ////59bRo2RQp2xZqm9ao2FMw5mO////9/PxrnhnpmhTqG1ZqG1Zp25Yo2NL1bev/////////////v// - wZmMo2NOqG1ZqW1apm1YpGVQ1rq1////////////////////6NfUo2VRqG1Ypm5ZpWtXp2pW7uHe//// - vZGDomNMqGxZqG5Zp21ZqG1Zo2ZPomNOoGNNoGFMoWJKn2BGrXps9vPy//////////////////////// - AAD//////////////////////////////////////////////v///v3//v7T+v9c1OMcc4CQnKPHyMrF - yczh4uT7+/v//////////////////////////////////////////////////////////////v/////8 - //7H9/5Ty90fZ3SHmZ+0t7zFx8zr7Oz+//7////////////////////////69vWxe2ukaVKobViobFmm - alWrblvu4uD////////////////////////////////////////////+///9///////18e+sc2Kna1Sn - b1umZlG3g3X////bwLqiYk6pbVmoblenbVmmaFOsc2D27e3////+/////////v7////////XurSla1ei - YEulalSmbVeobVmocFqlblinbVmnbVimZ1KgYUmmcl7ey8T//////v/////StKyhZE6pbVipbVmoblqi - Y0zGn5T///////////7////////////////////////////+///9/v/+//7////59vewgHKkZ1CnbFmm - alWweGf8+/rk1c+jZlCrblqpbVmpbVmma1WmbFns4N3////////////+///AmIykY06nbFiobVmmbFej - ZE/VurT////////////////////o1tOjZVGobVimblmnbFeobFjt4N3///+9kIOjZE6pblqpblinbVqq - bVqoa1WmaVSna1WlaVaoZ1SlZk6iZ1Ly6uj///////////////////////8AAP////////////////// - /////////////////////////////////v/+/vz+/735/1LH1yZuepGhqMTEyMjMzeXl5/z8/P////// - //////////////////////////////////////////////////////7//////+b7/4vt/COXpURuda6x - trS6vtXY2fb4+P////////////////////////r19a95aaVqU6htWKhsWaZpVKptWu3h3/////////// - //////////////////////////////////7///7//////////8Gek6NjS6ZvWqdsV6RoVPLp58eilp9i - TKdtWqhtWahuWaNiS8CWiv///////v7//////////v///9bAt6BfSadqVKhuWqhuWaduWKhuW6dsWKdr - U6JhTKVkUa95Z8mmne/o5v////3///3//////9S0raFkT6hsWKhsWKhuWqJkTceflP///////////v// - //////////////////////////7+//3+//////7//////8qroqBjTaltWaZtWKNoU+fb2M2toqJjTaht - WadsWKhtWaNlT7aJev39/f////////////7+/8GYjKRkT6htWahtWqdsWKNlT9e7s/////////////// - /////+jX1KJlUaZsV6lvW6ZqV6ZrVu3g3f///72Qg6VlT6ltWaltWqltWKttV6ZoVaZuWKZvXKZuXKds - WKdzYdK4sP///////////////////////////wAA//////////////////////////////////////// - /////v///v////7////+9/3/sPT/QL/MJGx2o6euxcbJy8/Q5+nq/P39///////+/v/+//////////// - /v7+/////////////////////////f7+/f///////f7/v/j/Ss/eHGx1i5adtrS6w8bJ6Onr///////+ - ///+/v7+////////+vT0rnlopWpUqG5aqW5ap2lVqm5a7eHe/////v////////////////////////// - ////////////////////////////3szHoWNOqGxWqm1Zo2lUuo1/rnpnpWxUqG1aqW5aqW1ZoGFM2sbA - /////f7+/v//////////8ujnp25foWhRqGpXqm5YqG1Zq25ZpGVQoGBLrXdnyqKZ4M3H9O/v//////// - /v///f/+////////0rStoWVQqGtYp21ZqG5ao2NNx5+V/////v///v7+//////////////////////// - /////v///////////v//////6dnXp2lWqGtWp2xZpWlTt4p7sH1rpWtXp21XqW1Xp21YoGFL0bOr//// - /v///////////v//wZmNo2ROp21YqG1Yp25apGZQ17yz/////v////7////+////6NfUomVRpmxXp25Z - p2tXpmpX7eDd////vZGFpGZQqG5ZqG1YpmpVqHBd2cXC7ODf697d7ODd6uDd8ezs//////////////// - ////////////////AAD////////////////////////////////////////////+///+//7///////// - ///z/P+r9f8/tsQtcHmmsbXKyMrQ0dTp6uz+/v3////9/v7////////////+/v7///////////////// - ///////////9/v7+///////s/P+O7fsmm6tBanOqr7K2ub3W2dv7+vv////////////////////59fSu - eWimalOoblmnbVelalWobVnt4d////////////////////////////////////////////////////// - /v7+///38/Kve2ukZlKnbFmpblqkZVGkaFWqbluobVmqblmmaFOscmDz6+r////+///////////////Q - s6uiYEunb1mobVqnbVenb1ijZVCxfGzXv7f28O7////////////+///+/////v/+/v7////////RtKyh - ZE6na1ioblioblmjY0zHn5b////////9///+//7///////////////////////////////////////// - ///9+/y3hXelZU+pbVmobVilZ1OlalWpbVqobFaobleobFema1fv5OH//////v7////////+///BmY2j - ZE6obliobVmnbVikZVDYvLP////////9///+///////n09CkZVGqblqnb1mma1amalfs4Nz+//+9kIam - ZVCoblqobVikZ1Kwemr49fb///////////////////////////////////////////////////8AAP// - //////////////////////////////////////////7///7///3///7+///+/v///u37/qTx/TWtvDlv - eKmxtsfIy8zS1urq6/z9/f3///////////////////////////////////////////7///7+//7///// - //z+/sX1/k3S4R5odICUmra1ucXIyuvr7f////////////////////r3+LF8bqVoUqhuWahuWalpVKds - V+fc2v////////////////////////////////////////////////7//v7+//7+/v///8efk6JkTqdt - WqhtV6ltWahsWKhrWadsWKZtWaJkTcSXiv/+///////+/v////////78+7iMfqJpUahuWqZqV6duWKho - VLOCc/Pp6f/////////////+//3+/v7///7+//////7//////v///9S2rqRmT6dsV6ltWKhtWaJkTMSe - kf////7///7+/v/+/////////////////////////////////////////////////8+xqqBiS6htWaht - WapuWqdsWKhsV6dsVqlsWKNmULiGePz6+/////3//////////////8KajaRjTaluWahuWahtV6VnUdi8 - s////////v7+/v7+/v///93Fv6BmTahrWKhvWaZpVqttXPPr6f7//72RhqdlUKdtWaZsV6RnUbB7aPjy - 8v///////////////////////////////////////////////////wAA//////////////////////// - /////////////////////v///v///////v/////////////+8Pv+nvT+Nqy6M3B8q7C3yMnJytDR6evt - //7+/////////////////////////////////////////////v///////v//////6fr+g+r5H4+bU3V+ - rbG0tbu93dzf/Pz8/////////////////Pz8tIZ4pWdRqG5ZqW5aqGtWpWdS3s7I//////////////// - /////////////////////////////////v/////+//7/////5tPNpGZQqXBaqG1Zp25ZqG1Ypm1Zp21Y - qW1Zo2VQ2cG6/////v//////////////+/b1s4BwpGZSqnBapmxZqW1YpWVP2sTA//////39/v7///// - /v/+/v///f///f////7+/v/////+////2L+6pGVQqG1Xp21YqG5YpWVNvpGC/////////v/+/v7//v// - /////////////////////////////////////v//////7N7cpGlUpmtVp25aqGxYqG1Zp2xWqG5Zp2xY - oWFM07as/////v///v/+////////////wpqNo2NNp21YqG1YqGxXpGRP2L61/////v/+/v7+/v////// - wZyOoGNNpmpWqG5Zp2pUr3dp/Pn5//7/vZCEpGVQqG5Zp2tXpGhRsHtp+PLy//////////////////// - ////////////////////////////////AAD///////////////////////////////////////////// - ///9///+//////7////+///////////t+/6b8vwyrbsycHqqr7XMy8zO0dTn6er7/Pz///////////// - ///////////////////////+///+///+///+/v/////3/v+69P88uckvaHGYpaqztrnPz9Tz9PX///// - ///////////+///DoJOjZE2obViobFimblmgYUzXt6z////+//////////////////////////////// - /////////////v/+/v7+///////39fSwe2umalSpbFinblmobFmpb1uobFimaVSrc2D17+7////+/v7+ - /v7////////69vW0f3CnZFGpb1qoblqnbFehZlHeysX////+/v/9///9//////////////////////// - ///+/v/////l2NeiZlSpbFinbFiobVmlaVOxemr69/b////+/v////////7///////////////////// - ///////////////////////8+/u5iXykZVCmb1qpbViobFiobFipb1qmalWqbVvr393////////+/v// - ///////////Cmo2kZE6obVmobFima1alYk3cxbz////+///////////n2NSmbFqmaVana1eobVmiZU29 - mIz+///+/P69kYOlZU+pblqobVikZ1Kwe2r48/L///////////////////////////////////////// - //////////8AAP////////////////////////////////////////////////7///7///7+///+//7/ - /v7//v///////uv6/5rw/DGwvytxf6SrsM3Mzs/R0uXm5vn5+v////////7//v////7///7///////// - ///////+//3///7+//////7//tr8/2zb7BxygHmLlLW1usDFyurr7f////////////7//////9i/tqBg - TKhsWahuWahvWqNnUbF9bfXw8P////////////////////j29uLV1Pbx8P/////////////+//7+/v7/ - /v///////82nnp5jTKltWKdtWKdtWaluWalrWp9pULyShP/////////+/v////////////37+rWGe6Jl - T6hwW6psV6ZvWKRkUMGXivn6+f////////////////n4+Ord3vz6+v////////7+//////r3+K55aaRo - UqdsWKlsWKhuWaNkUNa7tf///////////////////////+zg3+nf4P////////////////3///////7/ - /////9G0rZ9hTKdsWKdtWqhtWahsV6hvWqVmUbaGeP/7/P////////7///7//////////8KajaJkTqhu - WqhsWadsV6NjT8+zrP////////v4+NvIwah2ZKZnU6hyXKhtVqVsVqFfS+LKxf////v7/LuRhaZlUKdu - WadsWqVnUq97avv4+P///////////////////////////////////////////////////wAA//////// - /////////////////////////////////////////////////////////v///v///v///f7+///+6vr/ - nvL+RbzMKXeDi5+kzcrMys/P3+Dj9/b4//3+/////////f7+/f39/v7+/////////////v7+//////7+ - ////6/3/juz6Jo2bWXmBsrS3ub/C4uTl/////////////v//////7+bmqG5do2hUqW1ZpW1YqG5ZpGlT - sYZ34MzI7+Tg7+Pi5NbTyKqhtH5woGJNwJiK/f7///////7/////////////////////5tbTpmlWqWtX - qW1ap21YqG1ZqGtZoWNM3MbA////////////////////////////yKujnmBJpW9aqGtYqGxYqG1Xo2dS - u4uA2Lq14MrD2cG7yqmgtINyomRPzq2l////////////////////yKeboGFKqm1bpGpWp21Zp2tWqW1b - y66m7N7c8Obi7ODc1728vJOIrHFdpW5e69/d/////v///v7//v/+/v////7/////8OXlpWxbqWxWqG5X - qG1aqG5ZqW1an2JL0bGn/////////v/////+/v///v///f//w5uOo2RPqG1ZqGxZqWxXqG1XqHJfvJGD - vJOGs4NwpWhTqGlUp25apmxZqXBcoV9KuY6C/fn6/v///Pz7vZGEomNOqW1Yp21Zp2pWqHFc2MC5693Y - 6NrT6NjV6NjV6NnV6NjU7uXg////////////////////////AAD///////////////////////////// - ///////////////////////////////////+///+//79/////v////7////1/f+w9v9Jydoieol7kJnH - yMrO0M/c3eHi8Pa26e/R4eX79fTw7fDv7/P5+vn+///////////////+/v7////3/f+s8/8zpbJAbHOo - sLO6vcHe3+H+/f3////////+/v7+//7////MraaeYUmqbVmobFmobVmqclqkZ1CiZVKnbVqmbFmiZlKh - Yk2lalKnaVSiZFHn2dX////+/v7////////////////////8+/uzgnGkZVCpblmpbFmnbFenZVGqc1/y - 6uj////////////////////////////r4d+jaVaoZ1KobVmobFinbViobFmhZk+iY02hZFCgY02eYUyl - Z1KhY0m4joH+///////+/v7////////u5+Wma1uraVOlb1qla1eobleoa1WhY02ma1enb1ymbFWlY1Ck - ZU+ka1WiYUrCnJD+/v/+///+/v/////+///8/v////////66jHyjZE6obVmobVupbFiobFelaFTt39v/ - /////v/+///+//79/////////v/Em46kZE2obVipbVmpbFinbFila1WhZk+fYk2laFKpa1aoalilbVio - blmiX0muemrv6uj////////9+/28kIOiZU+pbFipbVmmbVmqbFijZU+kZVKjZlGjZ1KkZ1KkaFKiZ1Gj - alXo2NT///////////////////8AAP////////////////////////////////////////////////// - //////////////7///7//////v7///3//////////vb9/bz2/mbV5iCHlWeLlcTBxNLO0s7i5Ynp8jar - tn+jrdDQ09/c3t/h5PDx8vz9/v////////7//////////r73/jmvvDdlcKStsry9wd7g4f3+/v////// - //7+/v/+//////n29baJfJ9fSKZsV6hrWqZuWaVvWahsWKdqVqdrVqxtWatwXKZuWadtW6NhTLyUh/// - /////////////////////////////8ytpaFiTKpvWadsWKhuWaNlTb2Xiv7+/v////7///////////// - ///////////+/8+yq59eSahsVqhuWqhtWahsWqduWqhuV6tsWqlsWaltWattWaNjTbyPf/////////// - /////////////9nCvZ5jT6hnUaptWqZsWahuWalvWaZsValrVqpsWKdtWahsV6huWKdrVaNoVOrc2v7/ - //7//v7+//7//v7//v7+/////9u/uqFiTqltWahuWKhuWaNmULeGd/v4+P////////////7///3//f// - //3+/8SYjKRjTqduWadtWaltWqdtWKdtWKlsWqpvWqhvWahwW6ZuWKVnUaJhTLWKfPDl4v////3+//// - //38/ruOgaVmT6luWqluWKhuV6htWqRuV6pvWqZsWKdtWKltWaltWahvWZ5gScaimP////////////// - /////wAA/////////////////////////////////////////////////////////////////////f7/ - /v///v/+/v///////f/+///+/v7+1Pf/e+TzLKa0PoWPlaarz8rLzd3khuTyLbLCQpSgprW41M3Q4drb - 5+jo8/T1/Pv8//7+//7++fz8uPX/NqKwQGt1rrS4xMPG5eXn/////////v///v7//v7+/v7/////8+3s - w5eNn2NLpGROqWhTqGtYpWxXpmxXp21XqG5ZqG9aqGpUomVOnWFJxKSZ/v///v/+//////////////// - ////////7+HfoWNOn2JMo2dTpmtVnWBK2MC8/////v7+/v/+/////////////////v/+////////z7Gm - nmZQoGBKp2hSpmtVq2xZqG1ap21YqW1YpWdSomVPmlpCyqmh/////////v7+////////////////2cS7 - p3BdoGFKoWdRp2pYqGxXp25ZqWxXp2xXpGxXqGxWo2lSn2BJrHZn7eLe/////f/+/f7//v////7+/v7+ - ////8ennpW5bnWBJpmhQp2pVn1xIz7Oq/////////v///v////////7+/f///v//x6SZmVlBpWVOo2ZQ - pGZRo2RPo2hRomNNoWVPo2NNoWFLpGhRtIV21722+/v6/////////f7+/v/+//7/yaadm1pCpmVRpWZS - pWdUpWZRpGVQo2ZRpGZRo2ZRo2VPpGZQomVQoGFLrnpq/Pr7////////////////AAD///////////// - ///////////////////////////////////////////////////////+/////v/+///////+/v///v// - //////////7k+f6e8fxLxtgnjJxplp25uLvLztKn3+tQ0+EwscNborCjuLvX0tLl3t/s5+jz7O3y6+zU - 8fh16fYlf4xviI+9wMHPz9Hy8fL////+///+/////v////7+/v7+///////9/f3hyMK8j4CpcF6jZVCj - ZU+iZE+hZU+iY02kZVGrdWS+mIzn1dD9/Pv////+///////////////////////////9/v3Vvbe6j4G1 - f3ClbFqsfm317+7////9//7+///////////////////+///+/v7////////q2dTCnJCud2ejaFKiZU6j - ZU+hZlGgZVCkZlSve2rKsKb49vX////////////////////+//7+//7////w5+PHpZmvfWqiaFWiZVCh - ZE+hZVCjZVCiZFGpbFi1hnfStK327uz////9///+/////v7+///+//7+/v////7+///dxsG7kISwf26m - blqreGft5eL////+/v/+/v7+/////////v/+//7////07OjFnJC2h3u3iXu4iXm4hnm5h3i5iHm5joLE - m5HUtq7p2dX59/f////////+/v///v////7+/v/////48/HEo5exf22zgm60gnCzgm+1gW+0gXC0gXC1 - gW+0gXC0gW+zgG2wfGrGopf9/fz///////////////8AAP////////////////////////////////// - //////////////////////////////////////////////////////////////////////////b9/771 - /mzg8SywwjeapoCkrLWzusTR1ZHf607R4iy4yl+7yoDDy6DJ0qDQ253f6Hzo+CyvwThwe7CzusvMzeHk - 5vz+/f////////////////////////////////////////7//+/l5N/KxNrAuda4stK3sNq/uOLMyPLt - 7P////////////////////////////////////////7///7///////////z4+Ozh4fTv7v////7+/v// - //////////////////////////////////////////////bx8OXSzd3EvdrAudi/udvDvOLPzfj19f// - //////////////////////////////7+/v////////////j19uPS0N3Dvda6s9Gzrte6tt3FwOra2f79 - /P////////////////////////////////////////////////////r49+7i4fLr6f////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////37+vv4+Pz4+Pz4+Pv39/z39/v29vz49/z39/v39vv29vv39v// - //7//////////////////wAA//////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////795fr/p/D8X9rqJr/PMJup - cY6Wvb2/xtbcoOHqbN7sRNPmMdHkPNfrIdbnKLbFTJagrbi91tTY4OLl9/j4//////////////////// - /////////////////v///v7//v///////////////////////////////////v///f///v////////// - /////////////////v///f7+//7+/v///////////////////v7//////////v////////////////// - /////////////////////v/////////////////////////////////////+/v////////////////// - /////////////////v7+/////////////////////////////////////////v///v////////////// - /////////////////////////////////////////////v/+//////////////////////////////// - /////////////////////////////v///////////////////////////////////////////v////// - /v///v///v///////////////////////////////////////////////v///v////////////////// - AAD///////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////v////7////f+f6Q7vw60eEWdoSVq7Di3d/v5uXu8/XZ - 8/i87/aa5/Nyz92VxMrZ29zp5ebr7e77+/v////////+/v7////////////////////////////+//7+ - /v7+/v///v/+///+//7////////+///+/////v/+//7////////////////////////////////////+ - /////v7////+///9///////+///+///////9/v7+//7///////////////////////////////////// - ///+///////+/////v/////////+///////////+///////////////////////////+/v7+/v7///// - ///+/v/+/v/+//7////////+///////////+///+///////////////////////////////////////+ - /v7////+/v///v/9//7+/v/+/f////////////////////////////////////////////////////// - ///////+///+///////////////+/v7////////////////////////////////+///+///////////+ - /v7////////////////////////////////9///9/v7///////////////8AAP////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////+//7+/////////v////z8/d73+8Lj6ODn6vf09v79/v///f/////////9/P/6+v/7+vv6 - +vr8/P////////7+/v////////////////////////////////////7///7///7+///+/v7//v3+//z+ - //7//v7///3///7///////////7+/v3///7+/v////////////////////////7///z+/v7///7+/v7/ - //////7+/v/+/v7+/v////////////////////////////////////////7///7///7+//////7+/v3/ - //7//v7+//7///7////////////////////////////////////////////////+///+//7//v////7+ - /v7+/v7//v///v/////////+//////////////////////////////////////////3//v7///7+//3+ - /v////////////////////////7+/v////////////////////////////////////7///7///////// - ///////////////////////////////+//////7///3///7///7///7///////////////////////// - ///////////+//////7//////////////////wAA//////////////////////////////////////// - //////////////////////////////////////////////////////////////////////7//f7+/v/+ - /v7//v/+///+/////////////v/+/v/////+/v/////+//7//////////////v///f/////+//////// - /////////////////////////////////////v///v///////////v///v7+/v///v////7///////// - /////v///////////////////////////////v///f///v7//v///v7+/////v7+/v///////v/+/v// - /////////////////////////////////////////////v7+/////////v///////v7+/////////v// - /////////////////////v///v7+/////////////////v7+/v7+/v///v///////v7+//////////// - /////////////////////////////////////////////f///P/+//7+/v///v////////////////// - /////////////////////////////////////////////////////////////v////////////////// - /////////v///////////////v///v///////////////////////////////////////v///v////// - ////////////////AAD///////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////8AAP// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////wAA//////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////AAD///////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////8AAP////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////wAA//////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////AAD///////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////8AAP////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////wAA//////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////AAD///////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////8AAP////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////wAA//////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - AAD///////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////8AAP////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////wAA//////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////AAA= - - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW - FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA - MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm - /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/ - zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm - ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM - /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz - mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM - MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz - MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM - AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA - mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ - MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/ - zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m - zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ - ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy - sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT - ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA - AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId - CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx - ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS - MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA - AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G - T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA - AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA//////// - AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H/// - AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w - AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D - AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA - - - \ No newline at end of file diff --git a/samples/CSharp/WinForms/App.ico b/samples/CSharp/WinForms/App.ico deleted file mode 100644 index 3a5525fd79..0000000000 Binary files a/samples/CSharp/WinForms/App.ico and /dev/null differ diff --git a/samples/CSharp/WinForms/AssemblyInfo.cs b/samples/CSharp/WinForms/AssemblyInfo.cs deleted file mode 100644 index 9f89a3282c..0000000000 --- a/samples/CSharp/WinForms/AssemblyInfo.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/samples/CSharp/WinForms/Form1.cs b/samples/CSharp/WinForms/Form1.cs deleted file mode 100644 index d3f6a169c4..0000000000 --- a/samples/CSharp/WinForms/Form1.cs +++ /dev/null @@ -1,1070 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; - -namespace IE_WinForms -{ - /// - /// Summary description for Form1. - /// - public class Form1 : System.Windows.Forms.Form - { - private System.Windows.Forms.MainMenu mainMenu1; - private System.Windows.Forms.MenuItem FileNew; - private System.Windows.Forms.MenuItem FileClose; - private System.Windows.Forms.MenuItem FileExport; - private System.Windows.Forms.MenuItem FileImport; - private System.Windows.Forms.MenuItem ImportBRep; - private System.Windows.Forms.MenuItem ExportImage; - private System.Windows.Forms.MenuItem File; - private System.Windows.Forms.MenuItem Window; - private System.Windows.Forms.ToolBarButton New; - private System.Windows.Forms.ImageList imageList1; - private System.Windows.Forms.ToolBarButton About; - private System.Windows.Forms.StatusBar myStatusBar; - private System.Windows.Forms.MenuItem ImportIges; - private System.Windows.Forms.MenuItem ImportStep; - private System.Windows.Forms.MenuItem ExportBRep; - private System.Windows.Forms.MenuItem ExportIges; - private System.Windows.Forms.MenuItem ExportStep; - private System.Windows.Forms.MenuItem ExportStl; - private System.Windows.Forms.MenuItem ExportVrml; - private System.ComponentModel.IContainer components; - private System.Windows.Forms.MenuItem menuItem1; - private System.Windows.Forms.MenuItem menuItem2; - private System.Windows.Forms.MenuItem menuItem3; - private System.Windows.Forms.MenuItem View; - private System.Windows.Forms.MenuItem Help; - private System.Windows.Forms.MenuItem HelpAbout; - private System.Windows.Forms.MenuItem ViewToolbar; - private System.Windows.Forms.MenuItem ViewStatusBar; - private System.Windows.Forms.MenuItem menuItem4; - private System.Windows.Forms.MenuItem WindowCascade; - private System.Windows.Forms.MenuItem WindowTile; - - protected IE_WinForms.ModelFormat myModelFormat; - private System.Windows.Forms.ToolBarButton wireframe; - private System.Windows.Forms.ToolBarButton shading; - private System.Windows.Forms.ToolBarButton toolBarButton1; - private System.Windows.Forms.ToolBarButton color; - private System.Windows.Forms.ToolBarButton transparency; - private System.Windows.Forms.ToolBarButton delete; - private System.Windows.Forms.ToolBarButton material; - private System.Windows.Forms.ToolBarButton ZoomAll; - private System.Windows.Forms.ToolBarButton ZoomWin; - private System.Windows.Forms.ToolBarButton ZoomProg; - private System.Windows.Forms.ToolBarButton Pan; - private System.Windows.Forms.ToolBarButton PanGlo; - private System.Windows.Forms.ToolBarButton Front; - private System.Windows.Forms.ToolBarButton Back; - private System.Windows.Forms.ToolBarButton TOP; - private System.Windows.Forms.ToolBarButton BOTTOM; - private System.Windows.Forms.ToolBarButton RIGHT; - private System.Windows.Forms.ToolBarButton LEFT; - private System.Windows.Forms.ToolBarButton Axo; - private System.Windows.Forms.ToolBarButton Rot; - private System.Windows.Forms.ToolBarButton Reset; - private System.Windows.Forms.ToolBarButton HlrOn; - private System.Windows.Forms.ToolBarButton HlrOff; - private System.Windows.Forms.ToolBar toolBarTool; - private System.Windows.Forms.ToolBar toolBarView; - protected static int myNbOfChildren; - - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - IE_WinForms.Form1.myNbOfChildren = 0; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader(); - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); - this.mainMenu1 = new System.Windows.Forms.MainMenu(); - this.File = new System.Windows.Forms.MenuItem(); - this.FileNew = new System.Windows.Forms.MenuItem(); - this.FileExport = new System.Windows.Forms.MenuItem(); - this.ImportBRep = new System.Windows.Forms.MenuItem(); - this.ImportIges = new System.Windows.Forms.MenuItem(); - this.ImportStep = new System.Windows.Forms.MenuItem(); - this.FileImport = new System.Windows.Forms.MenuItem(); - this.ExportBRep = new System.Windows.Forms.MenuItem(); - this.ExportIges = new System.Windows.Forms.MenuItem(); - this.ExportStep = new System.Windows.Forms.MenuItem(); - this.ExportStl = new System.Windows.Forms.MenuItem(); - this.ExportVrml = new System.Windows.Forms.MenuItem(); - this.menuItem3 = new System.Windows.Forms.MenuItem(); - this.ExportImage = new System.Windows.Forms.MenuItem(); - this.FileClose = new System.Windows.Forms.MenuItem(); - this.menuItem2 = new System.Windows.Forms.MenuItem(); - this.menuItem1 = new System.Windows.Forms.MenuItem(); - this.View = new System.Windows.Forms.MenuItem(); - this.ViewToolbar = new System.Windows.Forms.MenuItem(); - this.ViewStatusBar = new System.Windows.Forms.MenuItem(); - this.Window = new System.Windows.Forms.MenuItem(); - this.menuItem4 = new System.Windows.Forms.MenuItem(); - this.WindowCascade = new System.Windows.Forms.MenuItem(); - this.WindowTile = new System.Windows.Forms.MenuItem(); - this.Help = new System.Windows.Forms.MenuItem(); - this.HelpAbout = new System.Windows.Forms.MenuItem(); - this.toolBarTool = new System.Windows.Forms.ToolBar(); - this.New = new System.Windows.Forms.ToolBarButton(); - this.About = new System.Windows.Forms.ToolBarButton(); - this.toolBarButton1 = new System.Windows.Forms.ToolBarButton(); - this.wireframe = new System.Windows.Forms.ToolBarButton(); - this.shading = new System.Windows.Forms.ToolBarButton(); - this.color = new System.Windows.Forms.ToolBarButton(); - this.material = new System.Windows.Forms.ToolBarButton(); - this.transparency = new System.Windows.Forms.ToolBarButton(); - this.delete = new System.Windows.Forms.ToolBarButton(); - this.imageList1 = new System.Windows.Forms.ImageList(this.components); - this.myStatusBar = new System.Windows.Forms.StatusBar(); - this.toolBarView = new System.Windows.Forms.ToolBar(); - this.ZoomAll = new System.Windows.Forms.ToolBarButton(); - this.ZoomWin = new System.Windows.Forms.ToolBarButton(); - this.ZoomProg = new System.Windows.Forms.ToolBarButton(); - this.Pan = new System.Windows.Forms.ToolBarButton(); - this.PanGlo = new System.Windows.Forms.ToolBarButton(); - this.Front = new System.Windows.Forms.ToolBarButton(); - this.Back = new System.Windows.Forms.ToolBarButton(); - this.TOP = new System.Windows.Forms.ToolBarButton(); - this.BOTTOM = new System.Windows.Forms.ToolBarButton(); - this.LEFT = new System.Windows.Forms.ToolBarButton(); - this.RIGHT = new System.Windows.Forms.ToolBarButton(); - this.Axo = new System.Windows.Forms.ToolBarButton(); - this.Rot = new System.Windows.Forms.ToolBarButton(); - this.Reset = new System.Windows.Forms.ToolBarButton(); - this.HlrOn = new System.Windows.Forms.ToolBarButton(); - this.HlrOff = new System.Windows.Forms.ToolBarButton(); - this.SuspendLayout(); - // - // mainMenu1 - // - this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.File, - this.View, - this.Window, - this.Help}); - // - // File - // - this.File.Index = 0; - this.File.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.FileNew, - this.FileExport, - this.FileImport, - this.FileClose, - this.menuItem2, - this.menuItem1}); - this.File.Text = "&File"; - this.File.Popup += new System.EventHandler(this.File_Popup); - // - // FileNew - // - this.FileNew.Index = 0; - this.FileNew.Text = "&New"; - this.FileNew.Click += new System.EventHandler(this.menuItem2_Click); - // - // FileExport - // - this.FileExport.Index = 1; - this.FileExport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.ImportBRep, - this.ImportIges, - this.ImportStep}); - this.FileExport.Text = "&Import"; - this.FileExport.Visible = false; - // - // ImportBRep - // - this.ImportBRep.Index = 0; - this.ImportBRep.Text = "&BRep ..."; - this.ImportBRep.Click += new System.EventHandler(this.ImportBRep_Click); - // - // ImportIges - // - this.ImportIges.Index = 1; - this.ImportIges.Text = "&Iges ..."; - this.ImportIges.Click += new System.EventHandler(this.ImportIges_Click); - // - // ImportStep - // - this.ImportStep.Index = 2; - this.ImportStep.Text = "&Step ..."; - this.ImportStep.Click += new System.EventHandler(this.ImportStep_Click); - // - // FileImport - // - this.FileImport.Index = 2; - this.FileImport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.ExportBRep, - this.ExportIges, - this.ExportStep, - this.ExportStl, - this.ExportVrml, - this.menuItem3, - this.ExportImage}); - this.FileImport.Text = "&Export"; - this.FileImport.Visible = false; - this.FileImport.Popup += new System.EventHandler(this.FileImport_Popup); - // - // ExportBRep - // - this.ExportBRep.Enabled = false; - this.ExportBRep.Index = 0; - this.ExportBRep.Text = "&BRep ..."; - this.ExportBRep.Click += new System.EventHandler(this.ExportBRep_Click); - // - // ExportIges - // - this.ExportIges.Enabled = false; - this.ExportIges.Index = 1; - this.ExportIges.Text = "&Iges ..."; - this.ExportIges.Click += new System.EventHandler(this.ExportIges_Click); - // - // ExportStep - // - this.ExportStep.Enabled = false; - this.ExportStep.Index = 2; - this.ExportStep.Text = "&Step ..."; - this.ExportStep.Click += new System.EventHandler(this.ExportStep_Click); - // - // ExportStl - // - this.ExportStl.Enabled = false; - this.ExportStl.Index = 3; - this.ExportStl.Text = "&Stl ..."; - this.ExportStl.Click += new System.EventHandler(this.ExportStl_Click); - // - // ExportVrml - // - this.ExportVrml.Enabled = false; - this.ExportVrml.Index = 4; - this.ExportVrml.Text = "&Vrml ..."; - this.ExportVrml.Click += new System.EventHandler(this.ExportVrml_Click); - // - // menuItem3 - // - this.menuItem3.Index = 5; - this.menuItem3.Text = "-"; - // - // ExportImage - // - this.ExportImage.Index = 6; - this.ExportImage.Text = "Image ..."; - this.ExportImage.Click += new System.EventHandler(this.ExportImage_Click); - // - // FileClose - // - this.FileClose.Enabled = false; - this.FileClose.Index = 3; - this.FileClose.Text = "&Close"; - this.FileClose.Click += new System.EventHandler(this.menuItem3_Click); - // - // menuItem2 - // - this.menuItem2.Index = 4; - this.menuItem2.Text = "-"; - // - // menuItem1 - // - this.menuItem1.Index = 5; - this.menuItem1.Text = "&Quit"; - this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); - // - // View - // - this.View.Index = 1; - this.View.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.ViewToolbar, - this.ViewStatusBar}); - this.View.Text = "&View"; - // - // ViewToolbar - // - this.ViewToolbar.Checked = true; - this.ViewToolbar.Index = 0; - this.ViewToolbar.Text = "&Toolbar"; - this.ViewToolbar.Click += new System.EventHandler(this.ViewToolbar_Click); - // - // ViewStatusBar - // - this.ViewStatusBar.Checked = true; - this.ViewStatusBar.Index = 1; - this.ViewStatusBar.Text = "&Statusbar"; - this.ViewStatusBar.Click += new System.EventHandler(this.ViewStatusBar_Click); - // - // Window - // - this.Window.Index = 2; - this.Window.MdiList = true; - this.Window.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem4, - this.WindowCascade, - this.WindowTile}); - this.Window.Text = "&Window"; - this.Window.Visible = false; - // - // menuItem4 - // - this.menuItem4.Index = 0; - this.menuItem4.Text = "&New 3d View"; - this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click); - // - // WindowCascade - // - this.WindowCascade.Index = 1; - this.WindowCascade.Text = "&Cascade"; - this.WindowCascade.Click += new System.EventHandler(this.WindowCascade_Click); - // - // WindowTile - // - this.WindowTile.Index = 2; - this.WindowTile.Text = "&Tile"; - this.WindowTile.Click += new System.EventHandler(this.WindowTile_Click); - // - // Help - // - this.Help.Index = 3; - this.Help.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.HelpAbout}); - this.Help.Text = "&Help"; - // - // HelpAbout - // - this.HelpAbout.Index = 0; - this.HelpAbout.Shortcut = System.Windows.Forms.Shortcut.F1; - this.HelpAbout.Text = "&About"; - this.HelpAbout.Click += new System.EventHandler(this.HelpAbout_Click); - // - // toolBarTool - // - this.toolBarTool.AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar; - this.toolBarTool.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.New, - this.About, - this.toolBarButton1, - this.wireframe, - this.shading, - this.color, - this.material, - this.transparency, - this.delete}); - this.toolBarTool.DropDownArrows = true; - this.toolBarTool.ImageList = this.imageList1; - this.toolBarTool.Location = new System.Drawing.Point(0, 0); - this.toolBarTool.Name = "toolBarTool"; - this.toolBarTool.ShowToolTips = true; - this.toolBarTool.Size = new System.Drawing.Size(560, 28); - this.toolBarTool.TabIndex = 1; - this.toolBarTool.Enter += new System.EventHandler(this.menuItem3_Click); - this.toolBarTool.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick); - this.toolBarTool.MouseHover += new System.EventHandler(this.toolBar1_MouseHover); - this.toolBarTool.MouseLeave += new System.EventHandler(this.toolBar1_MouseLeave); - // - // New - // - this.New.ImageIndex = 0; - this.New.ToolTipText = "New"; - this.New.Visible = ((bool)(configurationAppSettings.GetValue("New.Visible", typeof(bool)))); - // - // About - // - this.About.ImageIndex = 1; - this.About.ToolTipText = "About(F1)"; - this.About.Visible = ((bool)(configurationAppSettings.GetValue("About.Visible", typeof(bool)))); - // - // toolBarButton1 - // - this.toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator; - // - // wireframe - // - this.wireframe.Enabled = ((bool)(configurationAppSettings.GetValue("wireframe.Enabled", typeof(bool)))); - this.wireframe.ImageIndex = 2; - this.wireframe.Pushed = ((bool)(configurationAppSettings.GetValue("wireframe.Pushed", typeof(bool)))); - this.wireframe.ToolTipText = "Wireframe"; - this.wireframe.Visible = ((bool)(configurationAppSettings.GetValue("wireframe.Visible", typeof(bool)))); - // - // shading - // - this.shading.Enabled = ((bool)(configurationAppSettings.GetValue("shading.Enabled", typeof(bool)))); - this.shading.ImageIndex = 3; - this.shading.Pushed = ((bool)(configurationAppSettings.GetValue("shading.Pushed", typeof(bool)))); - this.shading.ToolTipText = "Shading"; - this.shading.Visible = ((bool)(configurationAppSettings.GetValue("shading.Visible", typeof(bool)))); - // - // color - // - this.color.Enabled = ((bool)(configurationAppSettings.GetValue("color.Enabled", typeof(bool)))); - this.color.ImageIndex = 4; - this.color.ToolTipText = "Color"; - this.color.Visible = ((bool)(configurationAppSettings.GetValue("color.Visible", typeof(bool)))); - // - // material - // - this.material.Enabled = ((bool)(configurationAppSettings.GetValue("material.Enabled", typeof(bool)))); - this.material.ImageIndex = 5; - this.material.ToolTipText = "Material"; - this.material.Visible = ((bool)(configurationAppSettings.GetValue("material.Visible", typeof(bool)))); - // - // transparency - // - this.transparency.Enabled = ((bool)(configurationAppSettings.GetValue("transparency.Enabled", typeof(bool)))); - this.transparency.ImageIndex = 6; - this.transparency.ToolTipText = "Transparency"; - this.transparency.Visible = ((bool)(configurationAppSettings.GetValue("transparency.Visible", typeof(bool)))); - // - // delete - // - this.delete.Enabled = ((bool)(configurationAppSettings.GetValue("delete.Enabled", typeof(bool)))); - this.delete.ImageIndex = 7; - this.delete.ToolTipText = "Delete"; - this.delete.Visible = ((bool)(configurationAppSettings.GetValue("delete.Visible", typeof(bool)))); - // - // imageList1 - // - this.imageList1.ImageSize = new System.Drawing.Size(16, 16); - this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); - this.imageList1.TransparentColor = System.Drawing.Color.Transparent; - // - // myStatusBar - // - this.myStatusBar.AccessibleRole = System.Windows.Forms.AccessibleRole.StatusBar; - this.myStatusBar.Location = new System.Drawing.Point(0, 363); - this.myStatusBar.Name = "myStatusBar"; - this.myStatusBar.Size = new System.Drawing.Size(560, 22); - this.myStatusBar.TabIndex = 3; - // - // toolBarView - // - this.toolBarView.AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar; - this.toolBarView.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.ZoomAll, - this.ZoomWin, - this.ZoomProg, - this.Pan, - this.PanGlo, - this.Front, - this.Back, - this.TOP, - this.BOTTOM, - this.LEFT, - this.RIGHT, - this.Axo, - this.Rot, - this.Reset, - this.HlrOn, - this.HlrOff}); - this.toolBarView.DropDownArrows = true; - this.toolBarView.ImageList = this.imageList1; - this.toolBarView.Location = new System.Drawing.Point(0, 28); - this.toolBarView.Name = "toolBarView"; - this.toolBarView.ShowToolTips = true; - this.toolBarView.Size = new System.Drawing.Size(560, 28); - this.toolBarView.TabIndex = 5; - this.toolBarView.Visible = false; - this.toolBarView.Wrappable = false; - this.toolBarView.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBarView_ButtonClick); - this.toolBarView.MouseHover += new System.EventHandler(this.toolBarView_MouseHover); - this.toolBarView.MouseLeave += new System.EventHandler(this.toolBarView_MouseLeave); - // - // ZoomAll - // - this.ZoomAll.ImageIndex = 8; - this.ZoomAll.ToolTipText = "FitAll"; - // - // ZoomWin - // - this.ZoomWin.ImageIndex = 9; - this.ZoomWin.ToolTipText = "Zoom Window"; - // - // ZoomProg - // - this.ZoomProg.ImageIndex = 10; - this.ZoomProg.ToolTipText = "Dynamic Zooming"; - // - // Pan - // - this.Pan.ImageIndex = 11; - this.Pan.ToolTipText = "Dynamic Panning"; - // - // PanGlo - // - this.PanGlo.ImageIndex = 12; - this.PanGlo.ToolTipText = "GlobalPanning"; - // - // Front - // - this.Front.ImageIndex = 13; - this.Front.ToolTipText = "Front"; - // - // Back - // - this.Back.ImageIndex = 14; - this.Back.ToolTipText = "Back"; - // - // TOP - // - this.TOP.ImageIndex = 15; - this.TOP.ToolTipText = "Top"; - // - // BOTTOM - // - this.BOTTOM.ImageIndex = 16; - this.BOTTOM.ToolTipText = "Bottom"; - // - // LEFT - // - this.LEFT.ImageIndex = 17; - this.LEFT.ToolTipText = "Left"; - // - // RIGHT - // - this.RIGHT.ImageIndex = 18; - this.RIGHT.ToolTipText = "Right"; - // - // Axo - // - this.Axo.ImageIndex = 19; - this.Axo.ToolTipText = "Axo"; - // - // Rot - // - this.Rot.ImageIndex = 20; - this.Rot.ToolTipText = "Dynamic Rotation"; - // - // Reset - // - this.Reset.ImageIndex = 21; - this.Reset.ToolTipText = "Reset"; - // - // HlrOn - // - this.HlrOn.ImageIndex = 22; - this.HlrOn.Pushed = true; - this.HlrOn.ToolTipText = "Hidden On"; - // - // HlrOff - // - this.HlrOff.ImageIndex = 23; - this.HlrOff.ToolTipText = "Hidden Off"; - // - // Form1 - // - this.AccessibleRole = System.Windows.Forms.AccessibleRole.Application; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(560, 385); - this.Controls.Add(this.toolBarView); - this.Controls.Add(this.myStatusBar); - this.Controls.Add(this.toolBarTool); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.IsMdiContainer = true; - this.Menu = this.mainMenu1; - this.Name = "Form1"; - this.Text = "Sample Import / Export"; - this.Activated += new System.EventHandler(this.Form1_Activated); - this.ResumeLayout(false); - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.Run(new Form1()); - } - - private void menuItem2_Click(object sender, System.EventArgs e) - { - - this.Cursor = System.Windows.Forms.Cursors.WaitCursor; - this.OnNewFile(); - } - - private void menuItem3_Click(object sender, System.EventArgs e) - { - if (this.MdiChildren.Length > 0) - this.ActiveMdiChild.Close(); - - } - - private void ImportBRep_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = ModelFormat.BREP; - curForm.ImportModel(this.myModelFormat); - } - - private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - switch (toolBarTool.Buttons.IndexOf(e.Button)) - { - case 0: - this.Cursor = System.Windows.Forms.Cursors.WaitCursor; - this.OnNewFile(); - break; - case 1: - AboutDialog myDlg = new AboutDialog(); - myDlg.ShowDialog(this); - break; - - case 2: //just separator - break; - case 3: - if (curForm == null) - return; - curForm.SetDisplayMode(0); //wireframe - this.wireframe.Enabled = false; - this.shading.Enabled = true; - this.transparency.Enabled = false; - break; - case 4: - if (curForm == null) - return; - curForm.SetDisplayMode(1); //shading - this.shading.Enabled = false; - this.wireframe.Enabled = true; - this.transparency.Enabled = true; - break; - case 5: - if (curForm == null) - return; - curForm.ChangeColor(true); - break; - case 6: - if (curForm == null) - return; - MaterialDialog m = new MaterialDialog(); - m.View = curForm.View; - m.ShowDialog(curForm); - break; - case 7: - if (curForm == null) - return; - IE_WinForms.TransparencyDialog t = new TransparencyDialog(); - t.View = curForm.View; - t.ShowDialog(curForm); - break; - case 8: - if (curForm == null) - return; - curForm.DeleteObjects(); - break; - default: - break; - } - } - - private void toolBar1_MouseHover(object sender, System.EventArgs e) - { - this.myStatusBar.Text = "Document toolbar"; - } - - private void toolBar1_MouseLeave(object sender, System.EventArgs e) - { - this.myStatusBar.Text = ""; - } - - private void ImportIges_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.IGES; - curForm.ImportModel(this.myModelFormat); - } - - private void ImportStep_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.STEP; - curForm.ImportModel(this.myModelFormat); - } - - private void ExportBRep_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.BREP; - curForm.ExportModel(this.myModelFormat); - } - - private void ExportIges_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.IGES; - curForm.ExportModel(this.myModelFormat); - } - - private void ExportStep_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.STEP; - curForm.ExportModel(this.myModelFormat); - } - - private void ExportStl_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.STL; - curForm.ExportModel(this.myModelFormat); - } - - private void ExportVrml_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.VRML; - curForm.ExportModel(this.myModelFormat); - } - - private void ExportImage_Click(object sender, System.EventArgs e) - { - Form2 curForm = (Form2)this.ActiveMdiChild; - if (curForm == null) - return; - this.myModelFormat = IE_WinForms.ModelFormat.IMAGE; - curForm.ExportModel(this.myModelFormat); - } - - private void HelpAbout_Click(object sender, System.EventArgs e) - { - AboutDialog myDlg = new AboutDialog(); - myDlg.ShowDialog(this); - } - - private void ViewToolbar_Click(object sender, System.EventArgs e) - { - - if (this.ViewToolbar.Checked) - { - if (this.MdiChildren.Length > 0) - { - this.New.Visible = false; - this.About.Visible = false; - } - else - this.toolBarTool.Hide(); - this.ViewToolbar.Checked = false; - } - else - { - if (this.MdiChildren.Length > 0) - { - this.New.Visible = true; - this.About.Visible = true; - } - else - this.toolBarTool.Show(); - this.ViewToolbar.Checked = true; - } - - } - - private void ViewStatusBar_Click(object sender, System.EventArgs e) - { - if (this.ViewStatusBar.Checked) - { - this.myStatusBar.Hide(); - this.ViewStatusBar.Checked = false; - } - else - { - this.myStatusBar.Show(); - this.ViewStatusBar.Checked = true; - } - } - - public void OnNewFile() - { - Form2 newForm = new Form2(); - newForm.MdiParent = this; - IE_WinForms.Form1.myNbOfChildren = IE_WinForms.Form1.myNbOfChildren + 1; - newForm.SetIndex (IE_WinForms.Form1.myNbOfChildren, 1); - newForm.Show(); - newForm.InitView(); - newForm.InitV3D(); - this.FileExport.Visible = true; - this.FileImport.Visible = true; - this.Window.Visible = true; - this.wireframe.Visible = true; - this.shading.Visible = true; - this.color.Visible = true; - this.material.Visible = true; - this.transparency.Visible = true; - this.delete.Visible = true; - this.Cursor = System.Windows.Forms.Cursors.Default; - this.toolBarView.Visible = true; - } - - private void FileImport_Popup(object sender, System.EventArgs e) - { - IE_WinForms.Form2 curForm = (IE_WinForms.Form2)this.ActiveMdiChild; - if (curForm == null) - return; - if (curForm.View.IsObjectSelected()) - { - this.ExportBRep.Enabled = true; - this.ExportIges.Enabled = true; - this.ExportStep.Enabled = true; - this.ExportVrml.Enabled = true; - this.ExportStl.Enabled = true; - } - - } - - private void menuItem1_Click(object sender, System.EventArgs e) - { - this.Close(); - } - - private void File_Popup(object sender, System.EventArgs e) - { - if (this.MdiChildren.Length > 0) - this.FileClose.Enabled = true; - else - { - this.FileClose.Enabled = false; - this.FileExport.Visible = false; - this.FileImport.Visible = false; - } - } - - private void menuItem4_Click(object sender, System.EventArgs e) - { - IE_WinForms.Form2 curForm = (IE_WinForms.Form2)this.ActiveMdiChild; - IE_WinForms.Form2 newView = new Form2(); - newView.MdiParent = this; - newView.Show(); - newView.InitView(); - newView.SetContext(curForm.View); - newView.View.CreateNewView(newView.Handle); - newView.SetNextIndex(curForm); - } - - private void WindowCascade_Click(object sender, System.EventArgs e) - { - this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade); - } - - private void WindowTile_Click(object sender, System.EventArgs e) - { - this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical); - } - - public void SelectionChanged() - { - if (this.MdiChildren.Length == 0) - return; - IE_WinForms.Form2 curForm = (IE_WinForms.Form2)this.ActiveMdiChild; - if (curForm == null) - return; - switch (curForm.View.DisplayMode()) - { - case -1: - this.shading.Enabled = false; - this.wireframe.Enabled = false; - break; - case 0: - this.wireframe.Enabled = false; - this.shading.Enabled = true; - this.transparency.Enabled = false; - break; - case 1: - this.wireframe.Enabled = true; - this.shading.Enabled = false; - this.transparency.Enabled = true; - break; - case 10: - this.wireframe.Enabled = true; - this.shading.Enabled = true; - this.transparency.Enabled = true; - break; - default: - break; - } - bool IsSelected = curForm.View.IsObjectSelected(); - if (IsSelected) - { - this.color.Enabled = true; - this.material.Enabled = true; - this.delete.Enabled = true; - } - else - { - this.color.Enabled = false; - this.material.Enabled = false; - this.transparency.Enabled = false; - this.delete.Enabled = false; - } - if (curForm.DegenerateMode) - { - this.HlrOff.Pushed = false; - this.HlrOn.Pushed = true; - } - else - { - this.HlrOff.Pushed = true; - this.HlrOn.Pushed = false; - } - if (curForm.Mode == IE_WinForms.CurrentAction3d.CurAction3d_WindowZooming) - this.ZoomWin.Pushed = false; - - } - - public StatusBar StatusBar - { - get - { - return this.myStatusBar; - } - } - - public void OnFileClose() - { - if (this.MdiChildren.Length <= 1) - { - this.FileClose.Enabled = false; - this.Window.Visible = false; - this.wireframe.Visible = false; - this.shading.Visible = false; - this.color.Visible = false; - this.material.Visible = false; - this.transparency.Visible = false; - this.delete.Visible = false; - this.toolBarView.Visible = false; - } - } - - private void toolBarView_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) - { - IE_WinForms.Form2 curForm = (IE_WinForms.Form2)this.ActiveMdiChild; - if (curForm == null) - return; - switch (toolBarView.Buttons.IndexOf(e.Button)) - { - case 0: - curForm.View.ZoomAllView(); - break; - case 1: - curForm.Mode = CurrentAction3d.CurAction3d_WindowZooming; - this.ZoomWin.Pushed = true; - break; - case 2: - curForm.Mode = CurrentAction3d.CurAction3d_DynamicZooming; - break; - case 3: - curForm.Mode = CurrentAction3d.CurAction3d_DynamicPanning; - break; - case 4: - curForm.Zoom = curForm.View.Scale(); - curForm.Mode = CurrentAction3d.CurAction3d_GlobalPanning; - break; - case 5: - curForm.View.FrontView(); - break; - case 6: - curForm.View.BackView(); - break; - case 7: - curForm.View.TopView(); - break; - case 8: - curForm.View.BottomView(); - break; - case 9: - curForm.View.LeftView(); - break; - case 10: - curForm.View.RightView(); - break; - case 11: - curForm.View.AxoView(); - break; - case 12: - curForm.Mode = CurrentAction3d.CurAction3d_DynamicRotation; - break; - case 13: - curForm.View.Reset(); - break; - case 14: - curForm.View.SetDegenerateModeOn(); - curForm.DegenerateMode = true; - this.HlrOff.Pushed = false; - this.HlrOn.Pushed = true; - break; - case 15: - curForm.View.SetDegenerateModeOff(); - curForm.DegenerateMode = false; - this.HlrOn.Pushed = false; - this.HlrOff.Pushed = true; - break; - default: - break; - } - } - - private void Form1_Activated(object sender, System.EventArgs e) - { - if (this.toolBarView.Visible) - this.SelectionChanged(); - } - - private void toolBarView_MouseHover(object sender, System.EventArgs e) - { - this.myStatusBar.Text = "View toolbar"; - } - - private void toolBarView_MouseLeave(object sender, System.EventArgs e) - { - this.myStatusBar.Text = ""; - } - - } - -} \ No newline at end of file diff --git a/samples/CSharp/WinForms/Form1.resx b/samples/CSharp/WinForms/Form1.resx deleted file mode 100644 index 4a7e017a69..0000000000 --- a/samples/CSharp/WinForms/Form1.resx +++ /dev/null @@ -1,660 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - 17, 17 - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - 141, 18 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuNTAw - MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZT - eXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMA - AAB6GAAAAk1TRnQBSQFMAgEBGAEAAR0BAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQC - AAEoAwABQAMAAYADAAEBAQABCAYAASAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB - 3AHAAQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IB - AAM5AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8B - MwMAAWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYC - AAFmAZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMC - AAHMAWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQAB - ZgEAATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8B - AAEzAWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQAB - MwGZAWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQAB - MwLMAQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQAB - MwEAAWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMB - mQEAAWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQAB - ZgGZAWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYB - zAH/AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMB - mQEAAZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgAB - mQFmATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwB - AAKZAf8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB - /wEzAQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQAB - mQEAAcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYC - AAHMAWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYB - AAHMApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8C - AAHMAf8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQAB - mQEAAcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMB - AAHMAmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB - /wGZAcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC - /wEzAQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC - /wFmAQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gB - AAHwAfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8A/wD/ - AP8A/wAPAAH7PgAD+wHsPQAB+wIAAewIAAP7NAAC7AYAAvsBAAL7DQAB7CMABOwGAAL7AQAC+w4AAewb - AAL7AwAC7AIAAewBAAHsBQAC+wEAAvsPAAXsAQAC7BUAA/sB7AQAAuwFAAL7AQAC+w8AAeweAAHsAvsD - AAPsBQAD+xAAAeweAAHsAwAB+wEAAewBAAHsGAAB7B4AAewEAAHsAgAB7BgAAewfAAHsAwAB7AMAA/sw - AAP7AgAC7AEAAewBAALsAwAB+xUAAewdAAPsAgAC7BsAAewcAAHsAQAD7DwAAuw/AAHsQgAB+ywAA/sQ - AAH7CwABAQnsAwAJ7AEBCwAC+w4AAfsBAAH7AQAB+wkAAgEHAALsAgAB7AH+BwACAQgABPsKAAoBCAAB - AQEAAQEGAAHsAQAB7AEAAewBAAH+BgABAQEAAQEFAAL7DgAB7AEBAwAD+wEAAgEHAAEBAgABAQX+AewC - /gLsAgAG/gEAAv4BAQQAAfsPAAHsAQABAQMAAfsCAAHsAQABAQUAAfsBAQIAAQEFAAHsAgAC7AIAAf4F - AAEBAgABAQQAAfsCAAH+DAAB7AIACgEFAAEBAfsBAAEBBQAB7AIAAuwCAAH+BQABAQIAAfsDAAP7AQAB - +wH+CwAB7AIAAf4FAAHsAgAB7AIAA/sBAQL7AQEFAAHsAgAC7AIAAf4FAAEBAQAB+wEBBAAB+wIAAvsF - /gEAAv4DAAHsAgAB/gUAAewCAAHsBQABAQH7AQABAQUAAewCAALsAgAB/gUAAQEG+wYAAf4KAAHsAgAB - /gUAAewCAAHsBAAB+wEBAgABAQUAAewCAALsAgAB/gUAAQEBAAH7AQEJAAH+CgAB7AIAAf4FAAHsAgAB - 7AUAAQEC7AEBBuwCAArsAQECAAH7CQAB/goAAewCAAH+BQAB7AIAAewGAAEBAQABAQYAAewBAAHsAQAB - 7AEAAf4GAAEBAQABAQkAAf4KAArsAgAB7AcAAgEHAALsAgAB7AH+BwACARUAAewBAAH+BgAB7AEAAewI - AAEBCewDAAnsAQEJAAH+DAAB7AH+BwAC7CgAAf4NAArsOQAB+xkACuwGAArsCwAD+wgAAfsJAQYAAewB - /gcAAuwFAAHsAf4HAALsCQAB+wEAAfsBAAH7BwABAQH7BwABAQHsBQAB7AEAAf4GAAHsAQAB7AQAAewB - AAH+BgAB7AEAAewKAAH7CQABAQEAAfsGAAEBAQAB7AQAAewCAAoBAwAB7AIABv4B7AL+AewHAALsAfsB - AAPsBQABAQIAAfsBAAH7A/4BAQL+AewDAAHsAgABAQUAAewCAAEBAwAB7AIAAf4FAAHsAgAB7AQAAfsB - AAHsAgAB+wMAAewB+wQAAQEDAAL7AwABAQIAAewDAAHsAgABAQUAAewCAAEBAwAB7AIAAf4FAAHsAgAB - 7AMAAfsCAAHsBgAB7AEAAfsDAAEBAgAD+wMAAQECAAHsAwAB7AIAAQEFAAHsAgABAQMAAewCAAH+BQAB - 7AIAAewCAAb7BAAF+wIAAQECAAH+BQABAQIAAewDAAHsAgABAQUAAewCAAEBAwAB7AIAAf4FAAHsAgAB - 7AMAAfsCAAHsBgAB7AEAAfsDAAEBAgAB/gUAAQECAAHsAwAB7AIAAQEBAAT7AewCAAEBAwAB7AIAAf4F - AAHsAgAB7AQAAfsBAAHsAgAB+wMAAewB+wQAAQECAAH+BQABAQIAAewDAAPsAQEB7AL7A+wCAAEBAwAK - AQIAAewGAAPsAfsBAAPsBQAKAQIAAewEAAHsAQABAQEAAfsBAAH7AgAB7AEAAQEEAAEBAQAB/gYAAQEB - AAHsCQAB+woAAewBAAH+BgAB7AEAAewFAAHsAQEBAAH7AgAB+wIAAewBAQUAAQEB/gIAAfsEAAEBAewH - AAH7AQAB+wEAAfsJAAHsAf4HAALsBgAKAQYAAgED+wUBCAAD+wsACuwNAAH7CQAB+wEAAfsBAAH7DQAB - +yQAAfsKAAH7NQAB+wkAAfsIAAP7CgAD+w4AAfshAAL7DAAC+wIAAewDAAfsA/sB7BYAAfsIAAH7AewB - AwoAAfsBAAH7DgAB+xcAA/sJAAEDCQAB+xEAAewWAAH7AQAB+wEAAfskAAHsDwAB+wgAAfsPAAXsBQAB - 7AYABOwCAAHsBwAF7AIAA/sHAAH7DQAB7AYAAewEAAHsBAAB7AUAAewBAAHsBQAB7AYAAewCAAH7AwAB - +wkAAfsIAAHsBwAB7AMAAewEAAHsBgAC7AUAAewHAAHsBAAB+wsAAfsGAALsBwAC7AIAAewDAALsBgAC - 7AQAAuwHAAEDAewCAAX7BQAF+wUAAewJAAHsAgAB7AMAAewIAAHsBAAB7AQAA/sCAAHsAwAB+wsAAfsG - AAHsCQAB7AIAAewDAAHsCAAB7AQAAewCAAL7BQAB7AQAAfsEAAH7BAAB+wcAAuwHAALsAgAB7AMAAuwG - AALsBQAB7AcAAuwJAAH7CwAB+wEAAewHAAHsAwAB7AQAAewGAALsBQAB7AcAAewKAAH7CAAB+wEAAfsD - AAHsBQAB7AH7AQAB+wEAAfsFAAHsBAAB7AEAAewBAAP7AgAB7AUAAewJAAH7AQAB+wEAAfsGAAL7BQAF - 7AIABfsE7AEABuwIAAXsCwAD+wcAA/sKAAP7AQAB+yUAAfsfAAb4CAAG+A0AAgcC7AUADQoIAAH4BvsB - +AYAAfgGoAH4CAACCwLvAQcD7AYAAx4BAANrAQACNwFtCAABrgFYBvsBWAGuBAABrgGZBqABmQGuBQAC - CwKSAU8CBwHvAuwGAAMBAQADBgEAAvsB7AgAAVgBcwb7AXMBWAQAAewBHAagARwB7AUAAW0B7QEHAU8B - AgJPAQcC7AFtAQsEAAMBAQADBgEAAvsB7AcAAT8B+wFYBnMBRgH7BAAB7AGZBhwBmQHsBQAB7AEHAU8B - 7QECAe0BAgEHA+wFAAMLAQADDQEAAikBQwcAAfkBLAH7BkYB+QH7BAAB7AGgBpkBoAHsBAABbwHvAQcB - AgEHAXIBBwFyAQcD7AUAAwIBAAMEAQADBgMABGIC+QEsATIG+QH7BAAB7AigAewEAAHsAQcBcgECAXIB - BwJyAQcD7AUAA/oBAAP8AQAD/gMAB/kB+wb5AfsEAAHsCKAB7AQAAewBBwFyAQIBcgEHAgIBBwPsARQB - AQMAA/oBAAP8AQAD/gMABGIC+QEsATIG+QH7BAAB7AigAewEAAHsAgcDcgE1AXIBeQGSA+wEAAMtAQAD - hQEAA4EHAAH5ASwB+wZGAfkB+wQAAewBoAaZAaAB7AMAAUYBkgMHAk8BWAEHAVgBBwGSAuwEAAMeAQAD - KQEAA2EHAAE/AfsBWAZzAUYB+wQAAewBmQYcAZkB7AMAAewCBwLvAeoC7AQHAewB7QQAA/kBAAP7AQAD - /QgAAVgBcwb7AXMBWAQAAewBHAagARwB7AMAAewCBwLsAQAB7AHtAgcCmQHsAe8BCwMAA/kBAAP7AQAD - /QgAAa4BWAb7AVgBrgQAAa4BmQagAZkBrgMAAewB7wEHAuwBAAHsAgcBmQJYAm4EAAMgAQADNwEAA6UJ - AAH4BvsB+AYAAfgGoAH4BAACbgIHAewBDgMHAfsCbhsABvgIAAb4BwAC7AEHBew6AATsLQAG+woABuwp - AAFYBqcBWAgAAewG+wHsGwAC+woAAVgBhgYAAYYBWAYAAa4BWAb7AVgBrgcACf8KAAL7CgAB+wFYBgAB - WAH7BgAB7Aj7AewHAAn/FgAB+wGuBlEBrgH7BgAB7Aj7AewHAAn/CgAB+wsAAfsBAAauAQAB+wYAAewI - +wHsBwAJ/woAAfsLAAH7CAAB+wYAAewI+wHsBwAJ/woAAfsLAAH7CAAB+wYAAewI+wHsBwAJ/woAAvsK - AAH7CAAB+wYAAewI+wHsBwAJ/wsAAvsJAAH7AQAGrgEAAfsGAAHsAfsGWAH7AewHAAn/BwAB+wQAAvsI - AAH7Aa4GUQGuAfsGAAHsAVgGcwFYAewHAAb/CgAB+wUAAfsIAAH7AVgGAAFYAfsGAAHsAXMG+wFzAewH - AAb/AQAB/wgAAvsDAAL7CAABWAGGBgABhgFYBgABrgFYBvsBWAGuBwAG/wsABfsKAAFYBqcBWAgAAewG - +wHsKQAG+woABuxFAAFCAU0BPgcAAT4DAAEoAwABQAMAAYADAAEBAQABAQYAAQQWAAP//wACAAH9B/8B - +AF/Bv8B/QG/AccB/wHAAR8BwAEfAf8BnwGTAf8CzwHfAc8B/gEfAZMB/wLXAd8B1wE5AY8BkwH/AdgB - AwHfAdsBwwHPAZMB/wLbAd8B2wHxAscB+wLbAd8B2wH3AVcB/wHBAtsB3wHbAfcBtwH/AZsC2wHfAdsB - +wGoAf8BrwHAARsBwAEbARkBTgH/AbUC6wHvAesBwgE/Af8BuQLzAfcB8wHBAv8BEQH4AQMB+AEDAecC - /wG/BP8B9wf/Af4F/wHxAf8B/gH/AeABBwEAAT8B+QH/AfoBvwHnAfMBPwGfAeEB/wGAAR8B6wH1AV8B - rwGfAf8BnAFPAewBAAFgAQcBoAEPAa4B1wHNAfYBbwG3AacB5wGwAQMB5QH2AW8BtwEDAesBtwHbAQEB - 9gFvAacBoAEBAbcB2wHlAfYBbwGAAu0BtwHbAc0B9gFvAacC7QG3AdsB4AEGAQABNwLtAbcB2wH1AfoB - rwHXAu0BgAEbAfkB/AHPAecB4AENAdcB6wH8AQAB4AEHAvUB5wHzBP8C+QHwAQME/wH8AQEB/gP/AYAB - HwGAAR8B/AF/AYABHwGfAc8BnwHPAfoBvwGfAc8BrwHXAa8B1wH+Af8BrwHXAbABAwGwAQMB8AGPAbQB - AwG3AdsBtwHbAdYB5wG5AdsBtwHbAbcB2wG3AesBsQHbAbcB2wG3AdsBAwHBAbcB2wG3AdsBtwHbAbcB - 6wG3AdsBtAEbAbcB2wHWAecBtwHbAYABGwGAARsB8AGPAYABGwHVAWsB1wHrAf4B/wHXAesB5QGzAeYB - 8wH6Ab8B5wHzAfABAwHwAQMB/AF/AfABAwH/Ae8B+gG/Af4E/wH3Af4G/wH7Af4B/wEfAfgB/wH9BP8B - PwH8AdwBAAF/Af8B/gH/AR8B+gHPAf0BPwH/AfwBfwHPAfcB5wH9AZ8B/wH6Ab8B5wH/AfMB/QHPAf0B - /gH/AfIBDwG5AQ0B5AEYAf4B/wH5AfcBvAH1AfMB7QHfAfcC+wG9AfkC9wG/AfsB8wH5AbkB+QHnAfMB - BwHBAfcB/QG7Af0B7wEbAb8B+wH3Af0BuwH9AewB+wHeAfcB8wH5AbkB+QH3AfMB/gH/AesB+wG9AfkC - 9wH+Af8BXQHyAb4B9QEbAe8B+gG/AT4BDAIBAfwBHwH8AX8BHwH4Ab8D/wH+A/8B/gEHAfgBHwH8AQcB - gAEDAfwBAwHwAQ8B8AEHAYABAwH4AQEB4AEHAcABBwGAAQMB+AEBAeABBwHAAQMBgAEDAfABAQHgAQcB - wAEDAYABAwHwAQEB4AEHAYABAwGAAQMBAAEBAeABBwGAAQMBgAEDAQABAQHgAQcBgAEBAYABAwEAAQEB - 4AEHAYABAQGAAQMB8AEBAeABBwEAAQEBgAEDAfABAQHgAQcBAAEBAYABAwH4AQEB4AEHAQABAQGAAQMB - +AEBAeABBwEAAQMBgAEDAfwBAwHwAQ8BAAEPAYABAwH+AQcB+AEfAcABPwb/AfAF/wH4AR8B+AEfAv8B - /gE/AfABDwHwAQ8B4AEDAfwBHwLnAeABBwHgAQMB/AEfAucB4AEHAeABAwH+AX8B4AEHAeABBwHgAQMB - /AE/AegBFwHgAQcB4AEDAfwBPwHvAfcB4AEHAeABAwH8AT8B7wH3AeABBwHgAQMB/AEfAe8B9wHgAQcB - 4AEDAfIBDwHoARcB4AEHAeABAwHhAQcB4AEHAeABBwHgAQMB4QGHAucB4AEHAeABBwHgAQcC5wHgAQcB - 4AEPAfABDwHwAQ8B8AEPAeABHwH4AR8B+AEfAfgBHwj/Cw== - - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - Form1 - - - 80 - - - True - - - Private - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW - FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA - MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm - /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/ - zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm - ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM - /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz - mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM - MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz - MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM - AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA - mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ - MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/ - zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m - zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ - ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy - sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT - ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA - AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId - CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx - ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS - MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA - AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G - T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA - AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA//////// - AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H/// - AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w - AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D - AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA - - - \ No newline at end of file diff --git a/samples/CSharp/WinForms/Form2.cs b/samples/CSharp/WinForms/Form2.cs deleted file mode 100644 index 4c7b7920e4..0000000000 --- a/samples/CSharp/WinForms/Form2.cs +++ /dev/null @@ -1,945 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - - -namespace IE_WinForms -{ - public enum CurrentAction3d - { - CurAction3d_Nothing, - CurAction3d_DynamicZooming, - CurAction3d_WindowZooming, - CurAction3d_DynamicPanning, - CurAction3d_GlobalPanning, - CurAction3d_DynamicRotation - } - public enum CurrentPressedKey - { - CurPressedKey_Nothing, - CurPressedKey_Ctrl, - CurPressedKey_Shift - } - public enum ModelFormat - { - BREP, - STEP, - IGES, - VRML, - STL, - IMAGE - } - /// - /// Summary description for Form2. - /// - public class Form2 : System.Windows.Forms.Form - { - private System.ComponentModel.IContainer components; - - public Form2() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // Create OCCT proxy object - // - myOCCTProxy = new OCCTProxy(); - myCurrentMode = CurrentAction3d.CurAction3d_Nothing; - myCurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing; - myDegenerateModeIsOn = true; - IsRectVisible = false; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form2)); - this.imageList1 = new System.Windows.Forms.ImageList(this.components); - this.myPopup = new System.Windows.Forms.ContextMenu(); - this.menuItem1 = new System.Windows.Forms.MenuItem(); - this.myPopupObject = new System.Windows.Forms.ContextMenu(); - this.ContextWireframe = new System.Windows.Forms.MenuItem(); - this.ContextShading = new System.Windows.Forms.MenuItem(); - this.ContextColor = new System.Windows.Forms.MenuItem(); - this.ContextMaterial = new System.Windows.Forms.MenuItem(); - this.ContMatBrass = new System.Windows.Forms.MenuItem(); - this.ContMenBronze = new System.Windows.Forms.MenuItem(); - this.ContMenCopper = new System.Windows.Forms.MenuItem(); - this.ContMenGold = new System.Windows.Forms.MenuItem(); - this.ContMenPewt = new System.Windows.Forms.MenuItem(); - this.ContMenPlaster = new System.Windows.Forms.MenuItem(); - this.ContMenPlastic = new System.Windows.Forms.MenuItem(); - this.ContMenSilver = new System.Windows.Forms.MenuItem(); - this.ContMenTranc = new System.Windows.Forms.MenuItem(); - this.ContMenDelete = new System.Windows.Forms.MenuItem(); - // - // imageList1 - // - this.imageList1.ImageSize = new System.Drawing.Size(16, 16); - this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); - this.imageList1.TransparentColor = System.Drawing.Color.Transparent; - // - // myPopup - // - this.myPopup.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem1}); - // - // menuItem1 - // - this.menuItem1.Index = 0; - this.menuItem1.Text = "Change &Background"; - this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); - // - // myPopupObject - // - this.myPopupObject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.ContextWireframe, - this.ContextShading, - this.ContextColor, - this.ContextMaterial, - this.ContMenTranc, - this.ContMenDelete}); - this.myPopupObject.Popup += new System.EventHandler(this.myPopupObject_Popup); - // - // ContextWireframe - // - this.ContextWireframe.Index = 0; - this.ContextWireframe.Text = "Wireframe"; - this.ContextWireframe.Click += new System.EventHandler(this.ContextWireframe_Click); - // - // ContextShading - // - this.ContextShading.Index = 1; - this.ContextShading.Text = "Shading"; - this.ContextShading.Click += new System.EventHandler(this.ContextShading_Click); - // - // ContextColor - // - this.ContextColor.Index = 2; - this.ContextColor.Text = "Color"; - this.ContextColor.Click += new System.EventHandler(this.ContextColor_Click); - // - // ContextMaterial - // - this.ContextMaterial.Index = 3; - this.ContextMaterial.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.ContMatBrass, - this.ContMenBronze, - this.ContMenCopper, - this.ContMenGold, - this.ContMenPewt, - this.ContMenPlaster, - this.ContMenPlastic, - this.ContMenSilver}); - this.ContextMaterial.Text = "Material"; - // - // ContMatBrass - // - this.ContMatBrass.Index = 0; - this.ContMatBrass.Text = "&Brass"; - this.ContMatBrass.Click += new System.EventHandler(this.ContMatBrass_Click); - // - // ContMenBronze - // - this.ContMenBronze.Index = 1; - this.ContMenBronze.Text = "&Bronze"; - this.ContMenBronze.Click += new System.EventHandler(this.ContMenBronze_Click); - // - // ContMenCopper - // - this.ContMenCopper.Index = 2; - this.ContMenCopper.Text = "&Copper"; - this.ContMenCopper.Click += new System.EventHandler(this.ContMenCopper_Click); - // - // ContMenGold - // - this.ContMenGold.Index = 3; - this.ContMenGold.Text = "&Gold"; - this.ContMenGold.Click += new System.EventHandler(this.ContMenGold_Click); - // - // ContMenPewt - // - this.ContMenPewt.Index = 4; - this.ContMenPewt.Text = "&Pewter"; - this.ContMenPewt.Click += new System.EventHandler(this.ContMenPewt_Click); - // - // ContMenPlaster - // - this.ContMenPlaster.Index = 5; - this.ContMenPlaster.Text = "&Plaster"; - this.ContMenPlaster.Click += new System.EventHandler(this.ContMenPlaster_Click); - // - // ContMenPlastic - // - this.ContMenPlastic.Index = 6; - this.ContMenPlastic.Text = "&Plastic"; - this.ContMenPlastic.Click += new System.EventHandler(this.ContMenPlastic_Click); - // - // ContMenSilver - // - this.ContMenSilver.Index = 7; - this.ContMenSilver.Text = "&Silver"; - this.ContMenSilver.Click += new System.EventHandler(this.ContMenSilver_Click); - // - // ContMenTranc - // - this.ContMenTranc.Index = 4; - this.ContMenTranc.Text = "&Trancparency"; - this.ContMenTranc.Click += new System.EventHandler(this.ContMenTranc_Click); - // - // ContMenDelete - // - this.ContMenDelete.Index = 5; - this.ContMenDelete.Text = "&Delete"; - this.ContMenDelete.Click += new System.EventHandler(this.ContMenDelete_Click); - // - // Form2 - // - this.AccessibleRole = System.Windows.Forms.AccessibleRole.Window; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(320, 261); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.Name = "Form2"; - this.Text = "Document"; - this.WindowState = System.Windows.Forms.FormWindowState.Maximized; - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form2_KeyDown); - this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseDown); - this.SizeChanged += new System.EventHandler(this.Form2_SizeChanged); - this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseUp); - this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form2_KeyUp); - this.Closed += new System.EventHandler(this.Form2_Closed); - this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form2_Paint); - this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseMove); - } - #endregion - - private System.Windows.Forms.ImageList imageList1; - private System.Windows.Forms.ContextMenu myPopup; - private System.Windows.Forms.ContextMenu myPopupObject; - private System.Windows.Forms.MenuItem ContextWireframe; - private System.Windows.Forms.MenuItem ContextShading; - private System.Windows.Forms.MenuItem ContextColor; - private System.Windows.Forms.MenuItem ContextMaterial; - private System.Windows.Forms.MenuItem ContMatBrass; - private System.Windows.Forms.MenuItem ContMenBronze; - private System.Windows.Forms.MenuItem ContMenCopper; - private System.Windows.Forms.MenuItem ContMenGold; - private System.Windows.Forms.MenuItem ContMenPewt; - private System.Windows.Forms.MenuItem ContMenPlaster; - private System.Windows.Forms.MenuItem ContMenPlastic; - private System.Windows.Forms.MenuItem ContMenSilver; - private System.Windows.Forms.MenuItem ContMenTranc; - private System.Windows.Forms.MenuItem ContMenDelete; - private System.Windows.Forms.MenuItem menuItem1; - - private OCCTProxy myOCCTProxy; - private int myDocumentIndex, myViewIndex; - - public void InitV3D() - { - if (!myOCCTProxy.InitViewer(this.Handle)) - MessageBox.Show("Fatal Error during the graphic initialisation", "Error!", - MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - public bool ImportBRep(System.String filename) - { - return myOCCTProxy.ImportBrep(filename); - } - - private void Form2_SizeChanged(object sender, System.EventArgs e) - { - myOCCTProxy.UpdateView(); - } - - private void Form2_Paint(object sender, System.Windows.Forms.PaintEventArgs e) - { - myOCCTProxy.RedrawView(); - myOCCTProxy.UpdateView(); - } - - protected CurrentAction3d myCurrentMode; - protected CurrentPressedKey myCurrentPressedKey; - protected float myCurZoom; - protected bool myDegenerateModeIsOn; - protected int myXmin; - protected int myYmin; - protected int myXmax; - protected int myYmax; - protected int theButtonDownX; - protected int theButtonDownY; - // for erasing of rectangle - protected int theRectDownX; - protected int theRectDownY; - protected bool IsRectVisible; - - private void Form2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) - { - switch (e.Button) - { - case MouseButtons.Left: - myXmin = e.X; myYmin = e.Y; - myXmax = e.X; myYmax = e.Y; - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - // start the dynamic zooming.... - myCurrentMode = CurrentAction3d.CurAction3d_DynamicZooming; - else - { - switch (myCurrentMode) - { - case CurrentAction3d.CurAction3d_Nothing: - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift) - MultiDragEvent(myXmax, myYmax, -1); - else - DragEvent(myXmax, myYmax, -1); - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - if (!myDegenerateModeIsOn) - myOCCTProxy.SetDegenerateModeOn(); - //start the rotation - myOCCTProxy.StartRotation(e.X, e.Y); - break; - case IE_WinForms.CurrentAction3d.CurAction3d_WindowZooming: - this.Cursor = System.Windows.Forms.Cursors.Hand; - break; - default: - break; - } - } - break; - case MouseButtons.Right: - //MessageBox.Show("right mouse button is down"); - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - { - if (!myDegenerateModeIsOn) - myOCCTProxy.SetDegenerateModeOn(); - myOCCTProxy.StartRotation(e.X, e.Y); - } - else - Popup(e.X, e.Y); - break; - default: - break; - } - } - - private void Form2_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) - { - if (e.Shift) - myCurrentPressedKey = CurrentPressedKey.CurPressedKey_Shift; - else if (e.Control) - myCurrentPressedKey = CurrentPressedKey.CurPressedKey_Ctrl; - } - - private void Form2_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) - { - myCurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing; - } - - protected void MultiDragEvent(int x, int y, int theState) - { - if (theState == -1) - { - theButtonDownX = x; - theButtonDownY = y; - } - else if (theState == 1) - myOCCTProxy.ShiftSelect(Math.Min(theButtonDownX, x), Math.Min(theButtonDownY, y), - Math.Max(theButtonDownX, x), Math.Max(theButtonDownY, y)); - } - - protected void DragEvent(int x, int y, int theState) - { - if (theState == -1) //mouse is down - { - theButtonDownX = x; - theButtonDownY = y; - } - else if (theState == 1) //mouse is up - { - myOCCTProxy.Select(Math.Min(theButtonDownX, x), Math.Min(theButtonDownY, y), - Math.Max(theButtonDownX, x), Math.Max(theButtonDownY, y)); - } - } - - protected void Popup(int x, int y) - { - System.Drawing.Point p = new Point(x, y); - if (this.myOCCTProxy.IsObjectSelected()) - this.myPopupObject.Show(this, p); - else - this.myPopup.Show(this, p); - } - - private void Form2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) - { - switch (e.Button) - { - case MouseButtons.Left: - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - return; - switch (myCurrentMode) - { - case CurrentAction3d.CurAction3d_Nothing: - if (e.X == myXmin && e.Y == myYmin) - { - myXmax = e.X; myYmax = e.Y; - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift) - MultiInputEvent(myXmax, myYmax); - else - InputEvent(myXmax, myYmax); - } - else - { - myXmax = e.X; myYmax = e.Y; - DrawRectangle(false); - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift) - MultiDragEvent(myXmax, myYmax, 1); - else - DragEvent(myXmax, myYmax, 1); - } - break; - case CurrentAction3d.CurAction3d_DynamicZooming: - myCurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_WindowZooming: - myXmax = e.X; myYmax = e.Y; - DrawRectangle(false); - int ValZWMin = 1; - if (Math.Abs(myXmax - myXmin) > ValZWMin && Math.Abs(myXmax - myYmax) > ValZWMin) - myOCCTProxy.WindowFitAll(myXmin, myYmin, myXmax, myYmax); - this.Cursor = System.Windows.Forms.Cursors.Default; - IE_WinForms.Form1 f = (IE_WinForms.Form1)this.ParentForm; - f.SelectionChanged(); - myCurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_DynamicPanning: - myCurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_GlobalPanning: - myOCCTProxy.Place(e.X, e.Y, myCurZoom); - myCurrentMode = CurrentAction3d.CurAction3d_Nothing; - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - myCurrentMode = CurrentAction3d.CurAction3d_Nothing; - if (!myDegenerateModeIsOn) - { - myOCCTProxy.SetDegenerateModeOff(); - myDegenerateModeIsOn = false; - } - else - { - myOCCTProxy.SetDegenerateModeOn(); - myDegenerateModeIsOn = true; - } - break; - default: - break; - - } - break; - case MouseButtons.Right: - if (!myDegenerateModeIsOn) - { - myOCCTProxy.SetDegenerateModeOff(); - myDegenerateModeIsOn = false; - } - else - { - myOCCTProxy.SetDegenerateModeOn(); - myDegenerateModeIsOn = true; - } - break; - default: - break; - } - - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.SelectionChanged(); - } - - protected void MultiInputEvent(int x, int y) - { - myOCCTProxy.ShiftSelect(); - } - - protected void InputEvent(int x, int y) - { - myOCCTProxy.Select(); - } - - private void DrawRectangle(bool draw) - { - Graphics gr = Graphics.FromHwnd(this.Handle); - System.Drawing.Pen p = null; - if (this.IsRectVisible || (!draw))//erase the rect - { - int r = myOCCTProxy.GetBGColR(); - int g = myOCCTProxy.GetBGColG(); - int b = myOCCTProxy.GetBGColB(); - p = new Pen(System.Drawing.Color.FromArgb(r, g, b)); - this.IsRectVisible = false; - this.myOCCTProxy.UpdateView(); - } - else if (draw) - { - p = new Pen(System.Drawing.Color.White); - this.IsRectVisible = true; - } - if (p == null) - return; - int x = Math.Min(this.myXmin, this.myXmax); - int y = Math.Min(this.myYmin, this.myYmax); - gr.DrawRectangle(p, x, y, Math.Abs(myXmax - myXmin), Math.Abs(myYmax - myYmin)); - this.theRectDownX = Math.Max(this.myXmin, this.myXmax); - this.theRectDownY = Math.Max(this.myYmin, this.myYmax); - } - - private void Form2_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) //left button is pressed - { - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - { - myOCCTProxy.Zoom(myXmax, myYmax, e.X, e.Y); - myXmax = e.X; myYmax = e.Y; - } - else - { - switch (myCurrentMode) - { - case CurrentAction3d.CurAction3d_Nothing: - DrawRectangle(false); - myXmax = e.X; myYmax = e.Y; - DrawRectangle(true); - break; - case CurrentAction3d.CurAction3d_DynamicZooming: - myOCCTProxy.Zoom(myXmax, myYmax, e.X, e.Y); - myXmax = e.X; myYmax = e.Y; - break; - case CurrentAction3d.CurAction3d_WindowZooming: - DrawRectangle(false); - myXmax = e.X; myYmax = e.Y; - DrawRectangle(true);//add brush here - break; - case CurrentAction3d.CurAction3d_DynamicPanning: - myOCCTProxy.Pan(e.X - myXmax, myYmax - e.Y); - myXmax = e.X; myYmax = e.Y; - break; - case CurrentAction3d.CurAction3d_GlobalPanning: - break; - case CurrentAction3d.CurAction3d_DynamicRotation: - myOCCTProxy.Rotation(e.X, e.Y); - myOCCTProxy.RedrawView(); - break; - default: - break; - } - } - } // e.Button == MouseButtons.Left - else if (e.Button == MouseButtons.Middle) - { - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - { - myOCCTProxy.Pan(e.X - myXmax, myYmax - e.Y); - myXmax = e.X; myYmax = e.Y; - } - }//e.Button=MouseButtons.Middle - else if (e.Button == MouseButtons.Right) //right button is pressed - { - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) - myOCCTProxy.Rotation(e.X, e.Y); - } - else // no buttons are pressed - { - myXmax = e.X; myYmax = e.Y; - if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift) - MultiMoveEvent(e.X, e.Y); - else - MoveEvent(e.X, e.Y); - } - - - } - - protected void MultiMoveEvent(int x, int y) - { - myOCCTProxy.MoveTo(x, y); - } - - protected void MoveEvent(int x, int y) - { - myOCCTProxy.MoveTo(x, y); - } - - public void SetDisplayMode(int aMode) - { - myOCCTProxy.SetDisplayMode(aMode); - } - - public void ChangeColor(bool IsObjectColor) - { - int r, g, b; - if (IsObjectColor) - { - r = myOCCTProxy.GetObjColR(); - g = myOCCTProxy.GetObjColG(); - b = myOCCTProxy.GetObjColB(); - } - else - { - r = myOCCTProxy.GetBGColR(); - g = myOCCTProxy.GetBGColG(); - b = myOCCTProxy.GetBGColB(); - } - System.Windows.Forms.ColorDialog ColDlg = new ColorDialog(); - ColDlg.Color = System.Drawing.Color.FromArgb(r, g, b); - if (ColDlg.ShowDialog() == DialogResult.OK) - { - Color c = ColDlg.Color; - r = c.R; - g = c.G; - b = c.B; - if (IsObjectColor) - myOCCTProxy.SetColor(r, g, b); - else - myOCCTProxy.SetBackgroundColor(r, g, b); - } - this.myOCCTProxy.UpdateCurrentViewer(); - - } - - public void DeleteObjects() - { - myOCCTProxy.EraseObjects(); - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.SelectionChanged(); - } - public void ImportModel(IE_WinForms.ModelFormat format) - { - int theformat = 10; - System.Windows.Forms.OpenFileDialog openDialog = new OpenFileDialog(); - - string DataDir = Environment.GetEnvironmentVariable("CSF_OCCTDataPath"); - - string filter = ""; - - switch (format) - { - case ModelFormat.BREP: - openDialog.InitialDirectory = (DataDir + "\\occ"); - theformat = 0; - filter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; - break; - case IE_WinForms.ModelFormat.STEP: - openDialog.InitialDirectory = (DataDir + "\\step"); - theformat = 1; - filter = "STEP Files (*.stp *.step)|*.stp; *.step"; - break; - case IE_WinForms.ModelFormat.IGES: - openDialog.InitialDirectory = (DataDir + "\\iges"); - theformat = 2; - filter = "IGES Files (*.igs *.iges)|*.igs; *.iges"; - break; - default: - break; - } - openDialog.Filter = filter + "|All files (*.*)|*.*"; - if (openDialog.ShowDialog() == DialogResult.OK) - { - string filename = openDialog.FileName; - if (filename == "") - return; - this.Cursor = System.Windows.Forms.Cursors.WaitCursor; - if (!myOCCTProxy.TranslateModel(filename, theformat, true)) - MessageBox.Show("Can't read this file", "Error!", - MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = System.Windows.Forms.Cursors.Default; - } - this.myOCCTProxy.ZoomAllView(); - } - - public void ExportModel(ModelFormat format) - { - int theformat = 10; - System.Windows.Forms.SaveFileDialog saveDialog = new SaveFileDialog(); - string DataDir = Environment.GetEnvironmentVariable("CSF_OCCTDataPath"); - string filter = ""; - switch (format) - { - case IE_WinForms.ModelFormat.BREP: - saveDialog.InitialDirectory = (DataDir + "\\occ"); - theformat = 0; - filter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; - break; - case IE_WinForms.ModelFormat.STEP: - saveDialog.InitialDirectory = (DataDir + "\\step"); - theformat = 1; - filter = "STEP Files (*.stp *.step)|*.step; *.stp"; - break; - case IE_WinForms.ModelFormat.IGES: - saveDialog.InitialDirectory = (DataDir + "\\iges"); - theformat = 2; - filter = "IGES Files (*.igs *.iges)| *.iges; *.igs"; - break; - case IE_WinForms.ModelFormat.VRML: - saveDialog.InitialDirectory = (DataDir + "\\vrml"); - theformat = 3; - filter = "VRML Files (*.vrml)|*.vrml"; - break; - case IE_WinForms.ModelFormat.STL: - saveDialog.InitialDirectory = (DataDir + "\\stl"); - theformat = 4; - filter = "STL Files (*.stl)|*.stl"; - break; - case IE_WinForms.ModelFormat.IMAGE: - saveDialog.InitialDirectory = (DataDir + "\\images"); - theformat = 5; - filter = "Images Files (*.bmp *.gif)| *.bmp; *.gif"; - break; - default: - break; - } - saveDialog.Filter = filter; - if (saveDialog.ShowDialog() == DialogResult.OK) - { - string filename = saveDialog.FileName; - if (filename == "") - return; - this.Cursor = System.Windows.Forms.Cursors.WaitCursor; - if (!myOCCTProxy.TranslateModel(filename, theformat, false)) - MessageBox.Show("Can't write this file", "Error!", - MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = System.Windows.Forms.Cursors.Default; - } - } - - private void ContextColor_Click(object sender, System.EventArgs e) - { - this.ChangeColor(true); - } - - private void menuItem1_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.ChangeColor(false); - } - - private void ContextWireframe_Click(object sender, System.EventArgs e) - { - this.SetDisplayMode(0); - this.myOCCTProxy.UpdateCurrentViewer(); - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.SelectionChanged(); - } - - private void ContextShading_Click(object sender, System.EventArgs e) - { - this.SetDisplayMode(1); - this.myOCCTProxy.UpdateCurrentViewer(); - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.SelectionChanged(); - } - - private void ContMenTranc_Click(object sender, System.EventArgs e) - { - IE_WinForms.TransparencyDialog dlg = new TransparencyDialog(); - dlg.View = this.myOCCTProxy; - dlg.ShowDialog(this); - } - - private void ContMenDelete_Click(object sender, System.EventArgs e) - { - this.DeleteObjects(); - } - - private void ContMatBrass_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(0); - } - - private void ContMenBronze_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(1); - } - - private void ContMenCopper_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(2); - } - - private void ContMenGold_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(3); - } - - private void ContMenPewt_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(4); - } - - private void ContMenPlaster_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(5); - } - - private void ContMenPlastic_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(6); - } - - private void ContMenSilver_Click(object sender, System.EventArgs e) - { - this.myOCCTProxy.UpdateCurrentViewer(); - this.myOCCTProxy.SetMaterial(7); - } - - private void toolBar1_MouseHover(object sender, System.EventArgs e) - { - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.StatusBar.Text = "View toolbar"; - - } - - private void toolBar1_MouseLeave(object sender, System.EventArgs e) - { - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.StatusBar.Text = ""; - } - - private void myPopupObject_Popup(object sender, System.EventArgs e) - { - int mode = this.myOCCTProxy.DisplayMode(); - switch (mode) - { - case -1: - break; - case 0: - this.ContextWireframe.Enabled = false; - this.ContextShading.Enabled = true; - this.ContMenTranc.Enabled = false; - break; - case 1: - this.ContextShading.Enabled = false; - this.ContextWireframe.Enabled = true; - this.ContMenTranc.Enabled = true; - break; - case 10: - this.ContextShading.Enabled = true; ; - this.ContextWireframe.Enabled = true; - this.ContMenTranc.Enabled = true; - break; - default: - break; - - } - } - - public OCCTProxy View - { - get - { - return this.myOCCTProxy; - } - set - { - this.myOCCTProxy = value; - } - } - - public void InitView() - { - this.myOCCTProxy.InitOCCTProxy(); - } - - public void SetIndex(int documentIndex, int viewIndex) - { - this.myDocumentIndex = documentIndex; - this.myViewIndex = viewIndex; - this.Text = System.String.Format("Document {0}:{1}", documentIndex, viewIndex); - } - - public void SetNextIndex(Form2 other) - { - SetIndex(other.myDocumentIndex, other.myViewIndex + 1); - } - - public void SetContext(OCCTProxy View) - { - this.myOCCTProxy.SetAISContext(View); - } - - private void Form2_Closed(object sender, System.EventArgs e) - { - IE_WinForms.Form1 parent = (IE_WinForms.Form1)this.ParentForm; - parent.OnFileClose(); - } - - public CurrentAction3d Mode - { - get - { - return this.myCurrentMode; - } - set - { - this.myCurrentMode = value; - } - } - - public float Zoom - { - set - { - this.myCurZoom = value; - } - } - - public bool DegenerateMode - { - get - { - return this.myDegenerateModeIsOn; - } - set - { - this.myDegenerateModeIsOn = value; - } - } - - } - -} \ No newline at end of file diff --git a/samples/CSharp/WinForms/Form2.resx b/samples/CSharp/WinForms/Form2.resx deleted file mode 100644 index f93955ce43..0000000000 --- a/samples/CSharp/WinForms/Form2.resx +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - Private - - - 17, 17 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuNTAw - MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZT - eXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMA - AADoEgAAAk1TRnQBSQFMAgEBEAEAARMBAAEEAQABEAEAARABAAT/AQkBEAj/AUIBTQE2AQQGAAE2AQQC - AAEoAwABQAMAAVADAAEBAQABCAYAARQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB - 3AHAAQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IB - AAM5AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8B - MwMAAWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYC - AAFmAZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMC - AAHMAWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQAB - ZgEAATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8B - AAEzAWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQAB - MwGZAWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQAB - MwLMAQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQAB - MwEAAWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMB - mQEAAWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQAB - ZgGZAWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYB - zAH/AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMB - mQEAAZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgAB - mQFmATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwB - AAKZAf8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB - /wEzAQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQAB - mQEAAcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYC - AAHMAWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYB - AAHMApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8C - AAHMAf8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQAB - mQEAAcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMB - AAHMAmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB - /wGZAcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC - /wEzAQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC - /wFmAQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gB - AAHwAfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8ACwAB - +z4AA/sB7D0AAfsCAAHsCAAD+zQAAuwGAAL7AQAC+w0AAewjAATsBgAC+wEAAvsOAAHsGwAC+wMAAuwC - AAHsAQAB7AUAAvsBAAL7DwAF7AEAAuwVAAP7AewEAALsBQAC+wEAAvsPAAHsHgAB7AL7AwAD7AUAA/sQ - AAHsHgAB7AMAAfsBAAHsAQAB7BgAAeweAAHsBAAB7AIAAewYAAHsHwAB7AMAAewDAAP7MAAD+wIAAuwB - AAHsAQAC7AMAAfsVAAHsHQAD7AIAAuwbAAHsHAAB7AEAA+w8AALsPwAB7EIAAfs/AAH7CwABAQnsAwAJ - 7AEBCgAC7AGGDgAB+wEAAfsBAAH7CQACAQcAAuwCAAHsAf4HAAIBCQABhgH7AewCAAEKAQQGAAoBCAAB - AQEAAQEGAAHsAQAB7AEAAewBAAH+BgABAQEAAQEGAAHsA/sB7AEKAQABhQEAAYUFAAHsAQEDAAP7AQAC - AQcAAQECAAEBBf4B7AL+AuwCAAb+AQAC/gEBBAABhgFYAa4BhQEEAQoBhQEAAYUCXwGFBAAB7AEAAQED - AAH7AgAB7AEAAQEFAAH7AQECAAEBBQAB7AIAAuwCAAH+BQABAQIAAQEEAAGGAewBrgEAAYoDAAGFAV8B - AAEGAQQDAAHsAgAKAQUAAQEB+wEAAQEFAAHsAgAC7AIAAf4FAAEBAgAB+wQAAYYB7AIAAX0BrAIAAYUB - awHZAccBCgMAAewCAAH+BQAB7AIAAewCAAP7AQEC+wEBBQAB7AIAAuwCAAH+BQABAQEAAfsBAQQAAvsB - hgEAAfsBngHHAQABuAFfAgABCgMAAewCAAH+BQAB7AIAAewFAAEBAfsBAAEBBQAB7AIAAuwCAAH+BQAB - AQb7AQABhgGuBAABsgG4AQoBXwGhAQABCgMAAewCAAH+BQAB7AIAAewEAAH7AQECAAEBBQAB7AIAAuwC - AAH+BQABAQEAAfsBAQgAAaECXwEGAQABhQFfAQABCgMAAewCAAH+BQAB7AIAAewFAAEBAuwBAQbsAgAK - 7AEBAgAB+wgAAQoBhQGhAf4CAAGFAgoDAAHsAgAB/gUAAewCAAHsBgABAQEAAQEGAAHsAQAB7AEAAewB - AAH+BgABAQEAAQEIAAEKAgAB/gQAAQoDAArsAgAB7AcAAgEHAALsAgAB7AH+BwACAQgAAYUBXwGhAf4B - hQFfAQoGAAHsAQAB/gYAAewBAAHsCAABAQnsAwAJ7AEBCQABhQFfAQYBXwGFCAAB7AH+BwAC7CkAAoUL - AArsOQAB+xkACuwGAArsCwAD+wgAAfsJAQYAAewB/gcAAuwFAAHsAf4HAALsCQAB+wEAAfsBAAH7BwAB - AQH7BwABAQHsBQAB7AEAAf4GAAHsAQAB7AQAAewBAAH+BgAB7AEAAewKAAH7CQABAQEAAfsGAAEBAQAB - 7AQAAewCAAoBAwAB7AIABv4B7AL+AewHAALsAfsBAAPsBQABAQIAAfsBAAH7A/4BAQL+AewDAAHsAgAB - AQUAAewCAAEBAwAB7AIAAf4FAAHsAgAB7AQAAfsBAAHsAgAB+wMAAewB+wQAAQEDAAL7AwABAQIAAewD - AAHsAgABAQUAAewCAAEBAwAB7AIAAf4FAAHsAgAB7AMAAfsCAAHsBgAB7AEAAfsDAAEBAgAD+wMAAQEC - AAHsAwAB7AIAAQEFAAHsAgABAQMAAewCAAH+BQAB7AIAAewCAAb7BAAF+wIAAQECAAH+BQABAQIAAewD - AAHsAgABAQUAAewCAAEBAwAB7AIAAf4FAAHsAgAB7AMAAfsCAAHsBgAB7AEAAfsDAAEBAgAB/gUAAQEC - AAHsAwAB7AIAAQEBAAT7AewCAAEBAwAB7AIAAf4FAAHsAgAB7AQAAfsBAAHsAgAB+wMAAewB+wQAAQEC - AAH+BQABAQIAAewDAAPsAQEB7AL7A+wCAAEBAwAKAQIAAewGAAPsAfsBAAPsBQAKAQIAAewEAAHsAQAB - AQEAAfsBAAH7AgAB7AEAAQEEAAEBAQAB/gYAAQEBAAHsCQAB+woAAewBAAH+BgAB7AEAAewFAAHsAQEB - AAH7AgAB+wIAAewBAQUAAQEB/gIAAfsEAAEBAewHAAH7AQAB+wEAAfsJAAHsAf4HAALsBgAKAQYAAgED - +wUBCAAD+wsACuwNAAH7CQAB+wEAAfsBAAH7DQAB+yQAAfsKAAH7NQAB+wkAAfsIAAP7CgAD+w4AAfsh - AAL7DAAC+wIAAewDAAfsA/sB7BYAAfsIAAH7AewBAwoAAfsBAAH7DgAB+xcAA/sJAAEDCQAB+xEAAewW - AAH7AQAB+wEAAfskAAHsDwAB+wgAAfsPAAXsBQAB7AYABOwCAAHsBwAF7AIAA/sHAAH7DQAB7AYAAewE - AAHsBAAB7AUAAewBAAHsBQAB7AYAAewCAAH7AwAB+wkAAfsIAAHsBwAB7AMAAewEAAHsBgAC7AUAAewH - AAHsBAAB+wsAAfsGAALsBwAC7AIAAewDAALsBgAC7AQAAuwHAAEDAewCAAX7BQAF+wUAAewJAAHsAgAB - 7AMAAewIAAHsBAAB7AQAA/sCAAHsAwAB+wsAAfsGAAHsCQAB7AIAAewDAAHsCAAB7AQAAewCAAL7BQAB - 7AQAAfsEAAH7BAAB+wcAAuwHAALsAgAB7AMAAuwGAALsBQAB7AcAAuwJAAH7CwAB+wEAAewHAAHsAwAB - 7AQAAewGAALsBQAB7AcAAewKAAH7CAAB+wEAAfsDAAHsBQAB7AH7AQAB+wEAAfsFAAHsBAAB7AEAAewB - AAP7AgAB7AUAAewJAAH7AQAB+wEAAfsGAAL7BQAF7AIABfsE7AEABuwIAAXsCwAD+wcAA/sKAAP7AQAB - +yUAAfsIAAFCAU0BPgcAAT4DAAEoAwABQAMAAVADAAEBAQABAQUAAYABAhYAA/+BAAH9B/8B+AF/Bv8B - /QG/AccB/wHAAR8BwAEfAf8BnwGTAf8CzwHfAc8B/gEfAZMB/wLXAd8B1wE5AY8BkwH/AdgBAwHfAdsB - wwHPAZMB/wLbAd8B2wHxAscB+wLbAd8B2wH3AVcB/wHBAtsB3wHbAfcBtwH/AZsC2wHfAdsB+wGoAf8B - rwHAARsBwAEbARkBTgH/AbUC6wHvAesBwgE/Af8BuQLzAfcB8wHBAv8BEQH4AQMB+AEDAecC/wG/BP8B - 9wf/Af4H/wH+Af8B4AEHAQABPwHxAf8B+gG/AecB8wE/AZ8B8QGfAYABHwHrAfUBXwGvAcABDwGcAU8B - 7AEAAWABBwGAAYcBrgHXAc0B9gFvAbcBgwGTAbABAwHlAfYBbwG3AZEBgwG3AdsBAQH2AW8BpwGAAZsB - twHbAeUB9gFvAYABlgELAbcB2wHNAfYBbwGnAfABSwG3AdsB4AEGAQABNwHwAWMBtwHbAfUB+gGvAdcB - +wFzAYABGwH5AfwBzwHnAfgBDwHXAesB/AEAAeABBwH8AR8B5wHzBP8B/gF/AfABAwb/Af4D/wGAAR8B - gAEfAfwBfwGAAR8BnwHPAZ8BzwH6Ab8BnwHPAa8B1wGvAdcB/gH/Aa8B1wGwAQMBsAEDAfABjwG0AQMB - twHbAbcB2wHWAecBuQHbAbcB2wG3AdsBtwHrAbEB2wG3AdsBtwHbAQMBwQG3AdsBtwHbAbcB2wG3AesB - twHbAbQBGwG3AdsB1gHnAbcB2wGAARsBgAEbAfABjwGAARsB1QFrAdcB6wH+Af8B1wHrAeUBswHmAfMB - +gG/AecB8wHwAQMB8AEDAfwBfwHwAQMB/wHvAfoBvwH+BP8B9wH+Bv8B+wH+Af8BHwH4Af8B/QT/AT8B - /AHcAQABfwH/Af4B/wEfAfoBzwH9AT8B/wH8AX8BzwH3AecB/QGfAf8B+gG/AecB/wHzAf0BzwH9Af4B - /wHyAQ8BuQENAeQBGAH+Af8B+QH3AbwB9QHzAe0B3wH3AvsBvQH5AvcBvwH7AfMB+QG5AfkB5wHzAQcB - wQH3Af0BuwH9Ae8BGwG/AfsB9wH9AbsB/QHsAfsB3gH3AfMB+QG5AfkB9wHzAf4B/wHrAfsBvQH5AvcB - /gH/AV0B8gG+AfUBGwHvAfoBvwE+AQwCAQH8AR8B/AF/AR8B+AG/A/8B/gH/FgAL - - - - Private - - - 122, 17 - - - Private - - - Private - - - Private - - - Private - - - 220, 17 - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - Private - - - False - - - (Default) - - - False - - - Form2 - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - - AAABAAIAICAQAAAAAADoAgAAJgAAABAQEAAAAAAAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/ - AAAA//8A/wAAAP8A/wD//wAA////AAiIiIAAiIgAAAAAAAAAAAAAAACIgAAIiAAAAAAAAAAAD///AA// - 8AiIAAAAAAAAAA////////8ACIgAAAAAAAAP//////////AIgAAAAAAAD///////////AIgAAAAAAA// - //////////AIAAAAAAAP////////////CIAAAAAAD///+IiIiIiIiACIiIiAAA/////////////wAAAA - iAAP////////////////8AiAD/////////////////8AgA//////////////////8IAP//////////// - //////CID//////////////////wCA////iIiIiIiIiIiIiIiAgP//////////////////8ID/////// - ////////////CA///////////////////wgP//////////////////8ID///////////////////CA// - /////////////////wgP///4iIiIiIiIiIiIiIgID///////////////////CA////mZ//mf+Zn/mZ// - /wgP///5/5+f+fn///n///8ID///+f+fn/n5///5////CA////n/n5/5+f//+f///wgP///5mf/5n/mZ - /5n///8ID///////////////////CA///////////////////wgAAAAAAAAAAAAAAAAAAAAAgcP//wAA - //8AAD//AAAP/wAAB/8AAAP/AAAD/wAAAf8AAAAHAAAAAwAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAEoAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAA - AACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAd3B3AAAAAAAAdwAHcA - AAAP8A//AHAAAA//////AAZgD/d3d3cHd2AP/////wAHcA////////AAD/d3d3d3dwcP////////Bw// - //////8HD5n/+f/5nwcPn5+fn5//Bw+fn5+fn/8HD5n/+f/5nwcP////////BwAAAAAAAAAAif8AAAA/ - AAAAHwAAABkAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAA== - - - \ No newline at end of file diff --git a/samples/CSharp/WinForms/IE_WinForms.csproj b/samples/CSharp/WinForms/IE_WinForms.csproj deleted file mode 100644 index 7d232b571a..0000000000 --- a/samples/CSharp/WinForms/IE_WinForms.csproj +++ /dev/null @@ -1,233 +0,0 @@ - - - - Local - 9.0.30729 - 2.0 - {B9914BB3-B886-4B41-B48D-350EBEBEFD1F} - Debug - AnyCPU - App.ico - - - IE_WinForms - - - JScript - Grid - IE50 - false - WinExe - IE_WinForms - OnBuildSuccess - - - - - - - 3.5 - v4.8 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - Off - x86 - - - true - ..\win32\$(VCVER)\bind\ - DEBUG;TRACE - 285212672 - full - x86 - prompt - Off - - - ..\win32\$(VCVER)\bin\ - TRACE - 285212672 - true - - - x86 - Off - prompt - - - true - ..\win64\$(VCVER)\bind\ - DEBUG;TRACE - 285212672 - 4096 - full - x64 - prompt - - - ..\win64\$(VCVER)\bin\ - TRACE - 285212672 - true - 4096 - x64 - Off - prompt - - - - System - - - - System.Data - - - System.Drawing - - - - System.Windows.Forms - - - System.XML - - - - - Form - - - Code - - - Form - - - Form - - - Form - - - Form - - - AboutDialog.cs - Designer - - - Form1.cs - Designer - - - Form2.cs - Designer - - - MaterialDialog.cs - Designer - - - TransparencyDialog.cs - Designer - - - - - - - {969912D9-78E7-4AB8-B4FF-6B52B4F03991} - OCCTProxy - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - - - - - - \ No newline at end of file diff --git a/samples/CSharp/WinForms/MaterialDialog.cs b/samples/CSharp/WinForms/MaterialDialog.cs deleted file mode 100644 index 7afbe47e6f..0000000000 --- a/samples/CSharp/WinForms/MaterialDialog.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace IE_WinForms -{ - /// - /// Summary description for MaterialDialog. - /// - public class MaterialDialog : System.Windows.Forms.Form - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public MaterialDialog() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - this.myView = null; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MaterialDialog)); - this.BTN_PLASTER = new System.Windows.Forms.Button(); - this.BTN_BRASS = new System.Windows.Forms.Button(); - this.BTN_BRONZE = new System.Windows.Forms.Button(); - this.BTN_COPPER = new System.Windows.Forms.Button(); - this.BTN_GOLD = new System.Windows.Forms.Button(); - this.BTN_PEWTER = new System.Windows.Forms.Button(); - this.BTN_PLASTIC = new System.Windows.Forms.Button(); - this.BTN_SILVER = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // BTN_PLASTER - // - this.BTN_PLASTER.Location = new System.Drawing.Point(16, 8); - this.BTN_PLASTER.Name = "BTN_PLASTER"; - this.BTN_PLASTER.Size = new System.Drawing.Size(80, 24); - this.BTN_PLASTER.TabIndex = 0; - this.BTN_PLASTER.Text = "Plaster"; - this.BTN_PLASTER.Click += new System.EventHandler(this.button1_Click); - // - // BTN_BRASS - // - this.BTN_BRASS.Location = new System.Drawing.Point(16, 40); - this.BTN_BRASS.Name = "BTN_BRASS"; - this.BTN_BRASS.Size = new System.Drawing.Size(80, 24); - this.BTN_BRASS.TabIndex = 1; - this.BTN_BRASS.Text = "Brass"; - this.BTN_BRASS.Click += new System.EventHandler(this.BTN_BRASS_Click); - // - // BTN_BRONZE - // - this.BTN_BRONZE.Location = new System.Drawing.Point(16, 72); - this.BTN_BRONZE.Name = "BTN_BRONZE"; - this.BTN_BRONZE.Size = new System.Drawing.Size(80, 24); - this.BTN_BRONZE.TabIndex = 2; - this.BTN_BRONZE.Text = "Bronze"; - this.BTN_BRONZE.Click += new System.EventHandler(this.BTN_BRONZE_Click); - // - // BTN_COPPER - // - this.BTN_COPPER.Location = new System.Drawing.Point(16, 104); - this.BTN_COPPER.Name = "BTN_COPPER"; - this.BTN_COPPER.Size = new System.Drawing.Size(80, 24); - this.BTN_COPPER.TabIndex = 3; - this.BTN_COPPER.Text = "Copper"; - this.BTN_COPPER.Click += new System.EventHandler(this.BTN_COPPER_Click); - // - // BTN_GOLD - // - this.BTN_GOLD.Location = new System.Drawing.Point(16, 136); - this.BTN_GOLD.Name = "BTN_GOLD"; - this.BTN_GOLD.Size = new System.Drawing.Size(80, 24); - this.BTN_GOLD.TabIndex = 4; - this.BTN_GOLD.Text = "Gold"; - this.BTN_GOLD.Click += new System.EventHandler(this.BTN_GOLD_Click); - // - // BTN_PEWTER - // - this.BTN_PEWTER.Location = new System.Drawing.Point(16, 168); - this.BTN_PEWTER.Name = "BTN_PEWTER"; - this.BTN_PEWTER.Size = new System.Drawing.Size(80, 24); - this.BTN_PEWTER.TabIndex = 5; - this.BTN_PEWTER.Text = "Pewter"; - this.BTN_PEWTER.Click += new System.EventHandler(this.BTN_PEWTER_Click); - // - // BTN_PLASTIC - // - this.BTN_PLASTIC.Location = new System.Drawing.Point(16, 200); - this.BTN_PLASTIC.Name = "BTN_PLASTIC"; - this.BTN_PLASTIC.Size = new System.Drawing.Size(80, 24); - this.BTN_PLASTIC.TabIndex = 6; - this.BTN_PLASTIC.Text = "Plastic"; - this.BTN_PLASTIC.Click += new System.EventHandler(this.BTN_PLASTIC_Click); - // - // BTN_SILVER - // - this.BTN_SILVER.Location = new System.Drawing.Point(16, 232); - this.BTN_SILVER.Name = "BTN_SILVER"; - this.BTN_SILVER.Size = new System.Drawing.Size(80, 24); - this.BTN_SILVER.TabIndex = 7; - this.BTN_SILVER.Text = "Silver"; - this.BTN_SILVER.Click += new System.EventHandler(this.BTN_SILVER_Click); - // - // MaterialDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(112, 273); - this.Controls.Add(this.BTN_SILVER); - this.Controls.Add(this.BTN_PLASTIC); - this.Controls.Add(this.BTN_PEWTER); - this.Controls.Add(this.BTN_GOLD); - this.Controls.Add(this.BTN_COPPER); - this.Controls.Add(this.BTN_BRONZE); - this.Controls.Add(this.BTN_BRASS); - this.Controls.Add(this.BTN_PLASTER); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MaterialDialog"; - this.Text = "MaterialDialog"; - this.ResumeLayout(false); - - } - #endregion - - private System.Windows.Forms.Button BTN_PLASTER; - private System.Windows.Forms.Button BTN_BRASS; - private System.Windows.Forms.Button BTN_BRONZE; - private System.Windows.Forms.Button BTN_COPPER; - private System.Windows.Forms.Button BTN_GOLD; - private System.Windows.Forms.Button BTN_PEWTER; - private System.Windows.Forms.Button BTN_PLASTIC; - private System.Windows.Forms.Button BTN_SILVER; - - private int myMaterial; - private OCCTProxy myView; - - private void button1_Click(object sender, System.EventArgs e) - { - this.myMaterial = 5; - ChangeMaterial(); - } - - private void BTN_BRASS_Click(object sender, System.EventArgs e) - { - this.myMaterial = 0; - ChangeMaterial(); - } - - private void BTN_BRONZE_Click(object sender, System.EventArgs e) - { - this.myMaterial = 1; - ChangeMaterial(); - } - - private void BTN_COPPER_Click(object sender, System.EventArgs e) - { - this.myMaterial = 2; - ChangeMaterial(); - } - - private void BTN_GOLD_Click(object sender, System.EventArgs e) - { - this.myMaterial = 3; - ChangeMaterial(); - } - - private void BTN_PEWTER_Click(object sender, System.EventArgs e) - { - this.myMaterial = 4; - ChangeMaterial(); - } - - private void BTN_PLASTIC_Click(object sender, System.EventArgs e) - { - this.myMaterial = 6; - ChangeMaterial(); - } - - private void BTN_SILVER_Click(object sender, System.EventArgs e) - { - this.myMaterial = 7; - ChangeMaterial(); - } - - public int Material - { - get - { - return this.myMaterial; - } - set - { - this.myMaterial = value; - } - } - - public void ChangeMaterial() - { - if (myView == null) - return; - myView.SetMaterial(this.myMaterial); - - } - - public OCCTProxy View - { - set - { - this.myView = value; - } - } - - } -} diff --git a/samples/CSharp/WinForms/MaterialDialog.resx b/samples/CSharp/WinForms/MaterialDialog.resx deleted file mode 100644 index 8a9f5cf8f7..0000000000 --- a/samples/CSharp/WinForms/MaterialDialog.resx +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - MaterialDialog - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW - FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA - MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm - /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/ - zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm - ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM - /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz - mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM - MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz - MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM - AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA - mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ - MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/ - zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m - zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ - ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy - sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT - ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA - AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId - CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx - ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS - MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA - AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G - T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA - AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA//////// - AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H/// - AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w - AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D - AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA - - - \ No newline at end of file diff --git a/samples/CSharp/WinForms/TransparencyDialog.cs b/samples/CSharp/WinForms/TransparencyDialog.cs deleted file mode 100644 index 6a61ae64db..0000000000 --- a/samples/CSharp/WinForms/TransparencyDialog.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace IE_WinForms -{ - /// - /// Summary description for TransparencyDialog. - /// - public class TransparencyDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.NumericUpDown MyTransparency; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private OCCTProxy myView; - - public TransparencyDialog() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - myView = null; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog)); - this.MyTransparency = new System.Windows.Forms.NumericUpDown(); - ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit(); - this.SuspendLayout(); - // - // MyTransparency - // - this.MyTransparency.Location = new System.Drawing.Point(16, 16); - this.MyTransparency.Maximum = new System.Decimal(new int[] { - 10, - 0, - 0, - 0}); - this.MyTransparency.Name = "MyTransparency"; - this.MyTransparency.Size = new System.Drawing.Size(96, 20); - this.MyTransparency.TabIndex = 0; - this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged); - // - // TransparencyDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(128, 53); - this.Controls.Add(this.MyTransparency); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TransparencyDialog"; - this.Text = "TransparencyDialog"; - ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit(); - this.ResumeLayout(false); - - } - #endregion - - private void MyTransparency_ValueChanged(object sender, System.EventArgs e) - { - if (this.myView == null) - return; - int transp = (int)this.MyTransparency.Value; - this.myView.SetTransparency(transp); - } - - public OCCTProxy View - { - set - { - this.myView = value; - } - } - - } -} diff --git a/samples/CSharp/WinForms/TransparencyDialog.resx b/samples/CSharp/WinForms/TransparencyDialog.resx deleted file mode 100644 index 688fd72e80..0000000000 --- a/samples/CSharp/WinForms/TransparencyDialog.resx +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - TransparencyDialog - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW - FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA - MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm - /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/ - zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm - ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM - /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz - mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM - MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz - MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM - AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA - mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ - MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/ - zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m - zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ - ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy - sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT - ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA - AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId - CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx - ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS - MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA - AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G - T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA - AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA//////// - AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H/// - AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w - AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D - AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// - /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA - - - \ No newline at end of file diff --git a/samples/CSharp/WinForms/app.config b/samples/CSharp/WinForms/app.config deleted file mode 100644 index a7c484feaa..0000000000 --- a/samples/CSharp/WinForms/app.config +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/CSharp/env.bat b/samples/CSharp/env.bat deleted file mode 100644 index dafb10bd86..0000000000 --- a/samples/CSharp/env.bat +++ /dev/null @@ -1,11 +0,0 @@ -call "%~dp0..\..\env.bat" %1 %2 %3 - -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -set "LIB_DIR=win%ARCH%\%VCVER%\libd" - -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" - set "LIB_DIR=win%ARCH%\%VCVER%\lib" -) - -set "PATH=%~dp0%LIB_DIR%;%~dp0%BIN_DIR%;%PATH%" \ No newline at end of file diff --git a/samples/CSharp/images/samples_c__ie.png b/samples/CSharp/images/samples_c__ie.png deleted file mode 100644 index 3cfc12e82c..0000000000 Binary files a/samples/CSharp/images/samples_c__ie.png and /dev/null differ diff --git a/samples/CSharp/msvc.bat b/samples/CSharp/msvc.bat deleted file mode 100644 index 290a98109e..0000000000 --- a/samples/CSharp/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0\CSharp.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/CSharp/msvc_D3D.bat b/samples/CSharp/msvc_D3D.bat deleted file mode 100644 index 9384467d67..0000000000 --- a/samples/CSharp/msvc_D3D.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -if NOT DEFINED DXSDK_DIR ( - if /I "%VCVER%" == "vc9" ( - echo ERROR: DirectX SDK is required in order to build the sample but it is not found in your system. Please install DirectX SDK and retry. - exit /B - ) - if /I "%VCVER%" == "vc10" ( - echo ERROR: DirectX SDK is required in order to build the sample but it is not found in your system. Please install DirectX SDK and retry. - exit /B - ) -) - -rem Define path to project file -set "PRJFILE=%~dp0\CSharp_D3D.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/CSharp/run.bat b/samples/CSharp/run.bat deleted file mode 100644 index 25c48faa69..0000000000 --- a/samples/CSharp/run.bat +++ /dev/null @@ -1,40 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -if "%1" == "-h" ( - goto err_bat -) - -if not ["%4"] == [""] ( - set "SampleName=%4" - call "%~dp0env.bat" %1 %2 %3 -) else if not ["%1"] == [""] ( - set "SampleName=%1" - call "%~dp0env.bat" -) else ( - goto err_bat -) - -if not exist "%~dp0%BIN_DIR%\IE_%SampleName%.exe" goto err_exe - -"%~dp0%BIN_DIR%\IE_%SampleName%.exe" - -goto eof - -:err_bat -echo Possible names of samples: WinForms, WPF_D3D, WPF_WinForms -echo Launch selected sample as follows: -echo %~n0.bat [^vc10^|^vc11^|^vc12^|^vc14^] [^win32^|^win64^] [^Release^|^Debug^] [^SampleName^] -echo or -echo %~n0.bat [^SampleName^] -echo Run %~n0.bat -h to get this help -exit /B - -:err_exe -echo Executable %~dp0%BIN_DIR%\IE_%SampleName%.exe not found. -echo Check that OCCT and sample are built with the selected configuration: -echo compiler=%VCVER% platform=win%ARCH% %3 -exit /B - -:eof diff --git a/samples/CSharp/run_winforms.bat b/samples/CSharp/run_winforms.bat deleted file mode 100644 index 9ea30924b7..0000000000 --- a/samples/CSharp/run_winforms.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -call "%~dp0run.bat" WinForms diff --git a/samples/CSharp/run_wpf.bat b/samples/CSharp/run_wpf.bat deleted file mode 100644 index 7a09f13843..0000000000 --- a/samples/CSharp/run_wpf.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -call "%~dp0run.bat" WPF_WinForms diff --git a/samples/CSharp/run_wpf_D3D.bat b/samples/CSharp/run_wpf_D3D.bat deleted file mode 100644 index 9a4d882e0f..0000000000 --- a/samples/CSharp/run_wpf_D3D.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -call "%~dp0run.bat" WPF_D3D diff --git a/samples/glfw/CMakeLists.txt b/samples/glfw/CMakeLists.txt deleted file mode 100644 index f0328a9f61..0000000000 --- a/samples/glfw/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -cmake_minimum_required(VERSION 3.2) - -project(glfw-occt-demo) - -set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/adm/cmake" ${CMAKE_MODULE_PATH}) - -set(APP_VERSION_MAJOR 1) -set(APP_VERSION_MINOR 0) -set(APP_TARGET glfwocct) - -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) -file(GLOB SOURCES - *.h - *.cpp -) -source_group ("Headers" FILES - GlfwOcctView.h - GlfwOcctWindow.h) -source_group ("Sources" FILES - GlfwOcctView.cpp - GlfwOcctWindow.cpp - main.cpp) - -# OpenGL -find_package(OpenGL REQUIRED) - -# Open CASCADE Technology -find_package (OpenCASCADE REQUIRED) -if (NOT OpenCASCADE_FOUND) - message (FATAL_ERROR "could not find OpenCASCADE, please set OpenCASCADE_DIR variable" ) -else() - message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_INSTALL_PREFIX}\"" ) - message (STATUS "OpenCASCADE_INCLUDE_DIR=${OpenCASCADE_INCLUDE_DIR}") - message (STATUS "OpenCASCADE_LIBRARY_DIR=${OpenCASCADE_LIBRARY_DIR}") - INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR}) -endif() - -SET(OpenCASCADE_LIBS - TKernel - TKService - TKV3d - TKOpenGl - TKBRep - TKGeomBase - TKGeomAlgo - TKG3d - TKG2d - TKTopAlgo - TKPrim -) - -# glfw -find_package(glfw3 REQUIRED) -if (glfw3_FOUND) - message (STATUS "Using glfw3 ${glfw3_VERSION}" ) - INCLUDE_DIRECTORIES(${GLFW_INCLUDE_DIRS}) - LINK_DIRECTORIES(${GLFW_LIBRARY_DIRS}) -else() - message (STATUS "glfw3 is not found." ) -endif() - -add_executable(${APP_TARGET} ${SOURCES}) -target_link_libraries( - ${APP_TARGET} - ${OpenCASCADE_LIBS} - glfw - ${OPENGL_LIBRARIES} -) diff --git a/samples/glfw/GlfwOcctView.cpp b/samples/glfw/GlfwOcctView.cpp deleted file mode 100644 index 36108497bf..0000000000 --- a/samples/glfw/GlfwOcctView.cpp +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "GlfwOcctView.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -namespace -{ - //! Convert GLFW mouse button into Aspect_VKeyMouse. - static Aspect_VKeyMouse mouseButtonFromGlfw (int theButton) - { - switch (theButton) - { - case GLFW_MOUSE_BUTTON_LEFT: return Aspect_VKeyMouse_LeftButton; - case GLFW_MOUSE_BUTTON_RIGHT: return Aspect_VKeyMouse_RightButton; - case GLFW_MOUSE_BUTTON_MIDDLE: return Aspect_VKeyMouse_MiddleButton; - } - return Aspect_VKeyMouse_NONE; - } - - //! Convert GLFW key modifiers into Aspect_VKeyFlags. - static Aspect_VKeyFlags keyFlagsFromGlfw (int theFlags) - { - Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE; - if ((theFlags & GLFW_MOD_SHIFT) != 0) - { - aFlags |= Aspect_VKeyFlags_SHIFT; - } - if ((theFlags & GLFW_MOD_CONTROL) != 0) - { - aFlags |= Aspect_VKeyFlags_CTRL; - } - if ((theFlags & GLFW_MOD_ALT) != 0) - { - aFlags |= Aspect_VKeyFlags_ALT; - } - if ((theFlags & GLFW_MOD_SUPER) != 0) - { - aFlags |= Aspect_VKeyFlags_META; - } - return aFlags; - } -} - -// ================================================================ -// Function : GlfwOcctView -// Purpose : -// ================================================================ -GlfwOcctView::GlfwOcctView() -{ -} - -// ================================================================ -// Function : ~GlfwOcctView -// Purpose : -// ================================================================ -GlfwOcctView::~GlfwOcctView() -{ -} - -// ================================================================ -// Function : toView -// Purpose : -// ================================================================ -GlfwOcctView* GlfwOcctView::toView (GLFWwindow* theWin) -{ - return static_cast(glfwGetWindowUserPointer (theWin)); -} - -// ================================================================ -// Function : errorCallback -// Purpose : -// ================================================================ -void GlfwOcctView::errorCallback (int theError, const char* theDescription) -{ - Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error") + theError + ": " + theDescription, Message_Fail); -} - -// ================================================================ -// Function : run -// Purpose : -// ================================================================ -void GlfwOcctView::run() -{ - initWindow (800, 600, "glfw occt"); - initViewer(); - initDemoScene(); - if (myView.IsNull()) - { - return; - } - - myView->MustBeResized(); - myOcctWindow->Map(); - mainloop(); - cleanup(); -} - -// ================================================================ -// Function : initWindow -// Purpose : -// ================================================================ -void GlfwOcctView::initWindow (int theWidth, int theHeight, const char* theTitle) -{ - glfwSetErrorCallback (GlfwOcctView::errorCallback); - glfwInit(); - const bool toAskCoreProfile = true; - if (toAskCoreProfile) - { - glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 3); -#if defined (__APPLE__) - glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); -#endif - glfwWindowHint (GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - } - myOcctWindow = new GlfwOcctWindow (theWidth, theHeight, theTitle); - glfwSetWindowUserPointer (myOcctWindow->getGlfwWindow(), this); - // window callback - glfwSetWindowSizeCallback (myOcctWindow->getGlfwWindow(), GlfwOcctView::onResizeCallback); - glfwSetFramebufferSizeCallback (myOcctWindow->getGlfwWindow(), GlfwOcctView::onFBResizeCallback); - // mouse callback - glfwSetScrollCallback (myOcctWindow->getGlfwWindow(), GlfwOcctView::onMouseScrollCallback); - glfwSetMouseButtonCallback (myOcctWindow->getGlfwWindow(), GlfwOcctView::onMouseButtonCallback); - glfwSetCursorPosCallback (myOcctWindow->getGlfwWindow(), GlfwOcctView::onMouseMoveCallback); -} - -// ================================================================ -// Function : initViewer -// Purpose : -// ================================================================ -void GlfwOcctView::initViewer() -{ - if (myOcctWindow.IsNull() - || myOcctWindow->getGlfwWindow() == nullptr) - { - return; - } - - Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (myOcctWindow->GetDisplay(), false); - Handle(V3d_Viewer) aViewer = new V3d_Viewer (aGraphicDriver); - aViewer->SetDefaultLights(); - aViewer->SetLightOn(); - aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE); - aViewer->ActivateGrid (Aspect_GT_Rectangular, Aspect_GDM_Lines); - myView = aViewer->CreateView(); - myView->SetImmediateUpdate (false); - myView->SetWindow (myOcctWindow, myOcctWindow->NativeGlContext()); - myView->ChangeRenderingParams().ToShowStats = true; - myContext = new AIS_InteractiveContext (aViewer); -} - -// ================================================================ -// Function : initDemoScene -// Purpose : -// ================================================================ -void GlfwOcctView::initDemoScene() -{ - if (myContext.IsNull()) - { - return; - } - - myView->TriedronDisplay (Aspect_TOTP_LEFT_LOWER, Quantity_NOC_GOLD, 0.08, V3d_WIREFRAME); - - gp_Ax2 anAxis; - anAxis.SetLocation (gp_Pnt (0.0, 0.0, 0.0)); - Handle(AIS_Shape) aBox = new AIS_Shape (BRepPrimAPI_MakeBox (anAxis, 50, 50, 50).Shape()); - myContext->Display (aBox, AIS_Shaded, 0, false); - anAxis.SetLocation (gp_Pnt (25.0, 125.0, 0.0)); - Handle(AIS_Shape) aCone = new AIS_Shape (BRepPrimAPI_MakeCone (anAxis, 25, 0, 50).Shape()); - myContext->Display (aCone, AIS_Shaded, 0, false); - - TCollection_AsciiString aGlInfo; - { - TColStd_IndexedDataMapOfStringString aRendInfo; - myView->DiagnosticInformation (aRendInfo, Graphic3d_DiagnosticInfo_Basic); - for (TColStd_IndexedDataMapOfStringString::Iterator aValueIter (aRendInfo); aValueIter.More(); aValueIter.Next()) - { - if (!aGlInfo.IsEmpty()) { aGlInfo += "\n"; } - aGlInfo += TCollection_AsciiString(" ") + aValueIter.Key() + ": " + aValueIter.Value(); - } - } - Message::DefaultMessenger()->Send (TCollection_AsciiString("OpenGL info:\n") + aGlInfo, Message_Info); -} - -// ================================================================ -// Function : mainloop -// Purpose : -// ================================================================ -void GlfwOcctView::mainloop() -{ - while (!glfwWindowShouldClose (myOcctWindow->getGlfwWindow())) - { - // glfwPollEvents() for continuous rendering (immediate return if there are no new events) - // and glfwWaitEvents() for rendering on demand (something actually happened in the viewer) - //glfwPollEvents(); - glfwWaitEvents(); - if (!myView.IsNull()) - { - FlushViewEvents (myContext, myView, true); - } - } -} - -// ================================================================ -// Function : cleanup -// Purpose : -// ================================================================ -void GlfwOcctView::cleanup() -{ - if (!myView.IsNull()) - { - myView->Remove(); - } - if (!myOcctWindow.IsNull()) - { - myOcctWindow->Close(); - } - glfwTerminate(); -} - -// ================================================================ -// Function : onResize -// Purpose : -// ================================================================ -void GlfwOcctView::onResize (int theWidth, int theHeight) -{ - if (theWidth != 0 - && theHeight != 0 - && !myView.IsNull()) - { - myView->Window()->DoResize(); - myView->MustBeResized(); - myView->Invalidate(); - myView->Redraw(); - } -} - -// ================================================================ -// Function : onMouseScroll -// Purpose : -// ================================================================ -void GlfwOcctView::onMouseScroll (double theOffsetX, double theOffsetY) -{ - if (!myView.IsNull()) - { - UpdateZoom (Aspect_ScrollDelta (myOcctWindow->CursorPosition(), int(theOffsetY * 8.0))); - } -} - -// ================================================================ -// Function : onMouseButton -// Purpose : -// ================================================================ -void GlfwOcctView::onMouseButton (int theButton, int theAction, int theMods) -{ - if (myView.IsNull()) { return; } - - const Graphic3d_Vec2i aPos = myOcctWindow->CursorPosition(); - if (theAction == GLFW_PRESS) - { - PressMouseButton (aPos, mouseButtonFromGlfw (theButton), keyFlagsFromGlfw (theMods), false); - } - else - { - ReleaseMouseButton (aPos, mouseButtonFromGlfw (theButton), keyFlagsFromGlfw (theMods), false); - } -} - -// ================================================================ -// Function : onMouseMove -// Purpose : -// ================================================================ -void GlfwOcctView::onMouseMove (int thePosX, int thePosY) -{ - const Graphic3d_Vec2i aNewPos (thePosX, thePosY); - if (!myView.IsNull()) - { - UpdateMousePosition (aNewPos, PressedMouseButtons(), LastMouseFlags(), false); - } -} diff --git a/samples/glfw/GlfwOcctView.h b/samples/glfw/GlfwOcctView.h deleted file mode 100644 index 2cb292b157..0000000000 --- a/samples/glfw/GlfwOcctView.h +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _GlfwOcctView_Header -#define _GlfwOcctView_Header - -#include "GlfwOcctWindow.h" - -#include -#include -#include - -//! Sample class creating 3D Viewer within GLFW window. -class GlfwOcctView : protected AIS_ViewController -{ -public: - //! Default constructor. - GlfwOcctView(); - - //! Destructor. - ~GlfwOcctView(); - - //! Main application entry point. - void run(); - -private: - - //! Create GLFW window. - void initWindow (int theWidth, int theHeight, const char* theTitle); - - //! Create 3D Viewer. - void initViewer(); - - //! Fill 3D Viewer with a DEMO items. - void initDemoScene(); - - //! Application event loop. - void mainloop(); - - //! Clean up before . - void cleanup(); - -//! @name GLWF callbacks -private: - //! Window resize event. - void onResize (int theWidth, int theHeight); - - //! Mouse scroll event. - void onMouseScroll (double theOffsetX, double theOffsetY); - - //! Mouse click event. - void onMouseButton (int theButton, int theAction, int theMods); - - //! Mouse move event. - void onMouseMove (int thePosX, int thePosY); - -//! @name GLWF callbacks (static functions) -private: - - //! GLFW callback redirecting messages into Message::DefaultMessenger(). - static void errorCallback (int theError, const char* theDescription); - - //! Wrapper for glfwGetWindowUserPointer() returning this class instance. - static GlfwOcctView* toView (GLFWwindow* theWin); - - //! Window resize callback. - static void onResizeCallback (GLFWwindow* theWin, int theWidth, int theHeight) - { toView(theWin)->onResize (theWidth, theHeight); } - - //! Frame-buffer resize callback. - static void onFBResizeCallback (GLFWwindow* theWin, int theWidth, int theHeight) - { toView(theWin)->onResize (theWidth, theHeight); } - - //! Mouse scroll callback. - static void onMouseScrollCallback (GLFWwindow* theWin, double theOffsetX, double theOffsetY) - { toView(theWin)->onMouseScroll (theOffsetX, theOffsetY); } - - //! Mouse click callback. - static void onMouseButtonCallback (GLFWwindow* theWin, int theButton, int theAction, int theMods) - { toView(theWin)->onMouseButton (theButton, theAction, theMods); } - - //! Mouse move callback. - static void onMouseMoveCallback (GLFWwindow* theWin, double thePosX, double thePosY) - { toView(theWin)->onMouseMove ((int )thePosX, (int )thePosY); } - -private: - - Handle(GlfwOcctWindow) myOcctWindow; - Handle(V3d_View) myView; - Handle(AIS_InteractiveContext) myContext; - -}; - -#endif // _GlfwOcctView_Header diff --git a/samples/glfw/GlfwOcctWindow.cpp b/samples/glfw/GlfwOcctWindow.cpp deleted file mode 100644 index 8b34487b88..0000000000 --- a/samples/glfw/GlfwOcctWindow.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "GlfwOcctWindow.h" - -#if defined (__APPLE__) - #undef Handle // avoid name collisions in macOS headers - #define GLFW_EXPOSE_NATIVE_COCOA - #define GLFW_EXPOSE_NATIVE_NSGL -#elif defined (_WIN32) - #define GLFW_EXPOSE_NATIVE_WIN32 - #define GLFW_EXPOSE_NATIVE_WGL -#else - #define GLFW_EXPOSE_NATIVE_X11 - #define GLFW_EXPOSE_NATIVE_GLX -#endif -#include -#include - -// ================================================================ -// Function : GlfwOcctWindow -// Purpose : -// ================================================================ -GlfwOcctWindow::GlfwOcctWindow (int theWidth, int theHeight, const TCollection_AsciiString& theTitle) -: myGlfwWindow (glfwCreateWindow (theWidth, theHeight, theTitle.ToCString(), NULL, NULL)), - myXLeft (0), - myYTop (0), - myXRight (0), - myYBottom(0) -{ - if (myGlfwWindow != nullptr) - { - int aWidth = 0, aHeight = 0; - glfwGetWindowPos (myGlfwWindow, &myXLeft, &myYTop); - glfwGetWindowSize(myGlfwWindow, &aWidth, &aHeight); - myXRight = myXLeft + aWidth; - myYBottom = myYTop + aHeight; - - #if !defined(_WIN32) && !defined(__APPLE__) - myDisplay = new Aspect_DisplayConnection ((Aspect_XDisplay* )glfwGetX11Display()); - #endif - } -} - -// ================================================================ -// Function : Close -// Purpose : -// ================================================================ -void GlfwOcctWindow::Close() -{ - if (myGlfwWindow != nullptr) - { - glfwDestroyWindow (myGlfwWindow); - myGlfwWindow = nullptr; - } -} - -// ================================================================ -// Function : NativeHandle -// Purpose : -// ================================================================ -Aspect_Drawable GlfwOcctWindow::NativeHandle() const -{ -#if defined (__APPLE__) - return (Aspect_Drawable)glfwGetCocoaWindow (myGlfwWindow); -#elif defined (_WIN32) - return (Aspect_Drawable)glfwGetWin32Window (myGlfwWindow); -#else - return (Aspect_Drawable)glfwGetX11Window (myGlfwWindow); -#endif -} - -// ================================================================ -// Function : NativeGlContext -// Purpose : -// ================================================================ -Aspect_RenderingContext GlfwOcctWindow::NativeGlContext() const -{ -#if defined (__APPLE__) - return (NSOpenGLContext*)glfwGetNSGLContext (myGlfwWindow); -#elif defined (_WIN32) - return glfwGetWGLContext (myGlfwWindow); -#else - return glfwGetGLXContext (myGlfwWindow); -#endif -} - -// ================================================================ -// Function : IsMapped -// Purpose : -// ================================================================ -Standard_Boolean GlfwOcctWindow::IsMapped() const -{ - return glfwGetWindowAttrib (myGlfwWindow, GLFW_VISIBLE) != 0; -} - -// ================================================================ -// Function : Map -// Purpose : -// ================================================================ -void GlfwOcctWindow::Map() const -{ - glfwShowWindow (myGlfwWindow); -} - -// ================================================================ -// Function : Unmap -// Purpose : -// ================================================================ -void GlfwOcctWindow::Unmap() const -{ - glfwHideWindow (myGlfwWindow); -} - -// ================================================================ -// Function : DoResize -// Purpose : -// ================================================================ -Aspect_TypeOfResize GlfwOcctWindow::DoResize() -{ - if (glfwGetWindowAttrib (myGlfwWindow, GLFW_VISIBLE) == 1) - { - int anXPos = 0, anYPos = 0, aWidth = 0, aHeight = 0; - glfwGetWindowPos (myGlfwWindow, &anXPos, &anYPos); - glfwGetWindowSize(myGlfwWindow, &aWidth, &aHeight); - myXLeft = anXPos; - myXRight = anXPos + aWidth; - myYTop = anYPos; - myYBottom = anYPos + aHeight; - } - return Aspect_TOR_UNKNOWN; -} - -// ================================================================ -// Function : CursorPosition -// Purpose : -// ================================================================ -Graphic3d_Vec2i GlfwOcctWindow::CursorPosition() const -{ - Graphic3d_Vec2d aPos; - glfwGetCursorPos (myGlfwWindow, &aPos.x(), &aPos.y()); - return Graphic3d_Vec2i ((int )aPos.x(), (int )aPos.y()); -} diff --git a/samples/glfw/GlfwOcctWindow.h b/samples/glfw/GlfwOcctWindow.h deleted file mode 100644 index b7f1a620c0..0000000000 --- a/samples/glfw/GlfwOcctWindow.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _GlfwOcctWindow_Header -#define _GlfwOcctWindow_Header - -#include -#include -#include -#include -#include - -struct GLFWwindow; - -//! GLFWwindow wrapper implementing Aspect_Window interface. -class GlfwOcctWindow : public Aspect_Window -{ - DEFINE_STANDARD_RTTI_INLINE(GlfwOcctWindow, Aspect_Window) -public: - //! Main constructor. - GlfwOcctWindow (int theWidth, int theHeight, const TCollection_AsciiString& theTitle); - - //! Close the window. - virtual ~GlfwOcctWindow() { Close(); } - - //! Close the window. - void Close(); - - //! Return X Display connection. - const Handle(Aspect_DisplayConnection)& GetDisplay() const { return myDisplay; } - - //! Return GLFW window. - GLFWwindow* getGlfwWindow() { return myGlfwWindow; } - - //! Return native OpenGL context. - Aspect_RenderingContext NativeGlContext() const; - - //! Return cursor position. - Graphic3d_Vec2i CursorPosition() const; - -public: - - //! Returns native Window handle - virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE; - - //! Returns parent of native Window handle. - virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return 0; } - - //! Applies the resizing to the window - virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE; - - //! Returns True if the window is opened and False if the window is closed. - virtual Standard_Boolean IsMapped() const Standard_OVERRIDE; - - //! Apply the mapping change to the window and returns TRUE if the window is mapped at screen. - virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; } - - //! Opens the window . - virtual void Map() const Standard_OVERRIDE; - - //! Closes the window . - virtual void Unmap() const Standard_OVERRIDE; - - virtual void Position (Standard_Integer& theX1, Standard_Integer& theY1, - Standard_Integer& theX2, Standard_Integer& theY2) const Standard_OVERRIDE - { - theX1 = myXLeft; - theX2 = myXRight; - theY1 = myYTop; - theY2 = myYBottom; - } - - //! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions. - virtual Standard_Real Ratio() const Standard_OVERRIDE - { - return Standard_Real (myXRight - myXLeft) / Standard_Real (myYBottom - myYTop); - } - - //! Return window size. - virtual void Size (Standard_Integer& theWidth, Standard_Integer& theHeight) const Standard_OVERRIDE - { - theWidth = myXRight - myXLeft; - theHeight = myYBottom - myYTop; - } - - virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; } - -protected: - Handle(Aspect_DisplayConnection) myDisplay; - GLFWwindow* myGlfwWindow; - Standard_Integer myXLeft; - Standard_Integer myYTop; - Standard_Integer myXRight; - Standard_Integer myYBottom; -}; - -#endif // _GlfwOcctWindow_Header diff --git a/samples/glfw/adm/cmake/FindOpenCASCADE.cmake b/samples/glfw/adm/cmake/FindOpenCASCADE.cmake deleted file mode 100644 index 1cbf05227f..0000000000 --- a/samples/glfw/adm/cmake/FindOpenCASCADE.cmake +++ /dev/null @@ -1,157 +0,0 @@ -# This script finds OpenCASCADE Technology libraries. -# The script requires: -# OpenCASCADE_DIR - root OCCT folder or folder with CMake configuration files -# -# Script will define the following variables on success: -# OpenCASCADE_FOUND - package is successfully found -# OpenCASCADE_INCLUDE_DIR - directory with headers -# OpenCASCADE_LIBRARY_DIR - directory with libraries for linker -# OpenCASCADE_BINARY_DIR - directory with DLLs -include(FindPackageHandleStandardArgs) - -# MY_PLATFORM variable -math (EXPR MY_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)") -if (WIN32) - set (MY_PLATFORM "win${MY_BITNESS}") -elseif(APPLE) - set (MY_PLATFORM "mac") -else() - set (MY_PLATFORM "lin") -endif() - -# MY_PLATFORM_AND_COMPILER variable -if (MSVC) - if (MSVC90) - set (MY_COMPILER vc9) - elseif (MSVC10) - set (MY_COMPILER vc10) - elseif (MSVC11) - set (MY_COMPILER vc11) - elseif (MSVC12) - set (MY_COMPILER vc12) - elseif (MSVC14) - set (MY_COMPILER vc14) - else() - set (MY_COMPILER vc15) - message (WARNING "Unknown msvc version. $$MY_COMPILER is used") - endif() -elseif (DEFINED CMAKE_COMPILER_IS_GNUCC) - set (MY_COMPILER gcc) -elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX) - set (MY_COMPILER gcc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]") - set (MY_COMPILER clang) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]") - set (MY_COMPILER icc) -else() - set (MY_COMPILER ${CMAKE_GENERATOR}) - string (REGEX REPLACE " " "" COMPILER ${MY_COMPILER}) -endif() -set (MY_PLATFORM_AND_COMPILER "${MY_PLATFORM}/${MY_COMPILER}") - -set (OpenCASCADE_DIR "" CACHE PATH "Path to Open CASCADE libraries.") - -# default paths -set (OpenCASCADE_INCLUDE_DIR "${OpenCASCADE_DIR}/inc") -set (OpenCASCADE_LIBRARY_DIR "${OpenCASCADE_DIR}/${MY_PLATFORM_AND_COMPILER}/lib") -set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_DIR}/${MY_PLATFORM_AND_COMPILER}/bin") - -# complete list of OCCT Toolkits (copy-paste from adm/UDLIST, since installed OCCT does not include UDLIST) -set (OpenCASCADE_TKLIST "") -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKernel TKMath) # FoundationClasses -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKG2d TKG3d TKGeomBase TKBRep) # ModelingData -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing) # ModelingAlgorithms -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost) # Visualization -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF) # ApplicationFramework -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKXSBase TKXCAF TKDEIGES TKDESTEP TKDESTL TKDEVRML TKXmlXCAF TKBinXCAF TKRWMesh TKDEGLTF TKDEOBJ TKDEPLY) # DataExchange -set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKDraw TKViewerTest) # Draw - -# validate location of OCCT libraries and headers -set (OpenCASCADE_INCLUDE_DIR_FOUND) -set (OpenCASCADE_LIBRARY_DIR_FOUND) -set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND) -set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX}) -set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND) -set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND) -if (EXISTS "${OpenCASCADE_INCLUDE_DIR}/Standard.hxx") - set (OpenCASCADE_INCLUDE_DIR_FOUND ON) -endif() - -if (EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_STATIC_LIBRARY_SUFFIX}") - set (OpenCASCADE_LIBRARY_DIR_FOUND ON) -elseif (NOT WIN32 AND EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (OpenCASCADE_LIBRARY_DIR_FOUND ON) - set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) -endif() - -if (EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_STATIC_LIBRARY_SUFFIX}") - set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND ON) -elseif (NOT WIN32 AND EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND ON) - set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) -elseif (OpenCASCADE_LIBRARY_DIR_FOUND) - message (STATUS "Only release OpenCASCADE libraries have been found") -endif() - -if (NOT OpenCASCADE_LIBRARY_DIR_FOUND AND OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND) - set (OpenCASCADE_LIBRARY_DIR_FOUND ON) - message (WARNING "Only debug OpenCASCADE libraries have been found") -endif() - -if (WIN32) - if (EXISTS "${OpenCASCADE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND ON) - endif() - if (EXISTS "${OpenCASCADE_BINARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND ON) - endif() -else() - if (EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND ON) - endif() - if (EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND ON) - endif() -endif() - -if (OpenCASCADE_INCLUDE_DIR_FOUND AND OpenCASCADE_LIBRARY_DIR_FOUND) - set (OpenCASCADE_FOUND ON) - set (OpenCASCADE_INSTALL_PREFIX ${OpenCASCADE_DIR}) - - # Define OCCT toolkits so that CMake can put absolute paths to linker; - # the library existence is not checked here, since modules can be disabled. - foreach (aLibIter ${OpenCASCADE_TKLIST}) - add_library (${aLibIter} SHARED IMPORTED) - - set_property (TARGET ${aLibIter} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties (${aLibIter} PROPERTIES IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${OpenCASCADE_IMPLIB_SUFFIX}") - if (OpenCASCADE_SHAREDLIB_RELEASE_FOUND) - if (WIN32) - set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() - endif() - - if (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND) - set_property (TARGET ${aLibIter} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties (${aLibIter} PROPERTIES IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${OpenCASCADE_IMPLIB_SUFFIX}") - if (OpenCASCADE_SHAREDLIB_DEBUG_FOUND) - if (WIN32) - set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() - endif() - endif() - endforeach() -else() - # fallback searching for CMake configs - if (NOT "${OpenCASCADE_DIR}" STREQUAL "") - set (anOcctDirBak "${OpenCASCADE_DIR}") - find_package (OpenCASCADE CONFIG QUIET PATHS "${OpenCASCADE_DIR}" NO_DEFAULT_PATH) - set (OpenCASCADE_DIR "${anOcctDirBak}" CACHE PATH "Path to Open CASCADE libraries." FORCE) - else() - find_package (OpenCASCADE CONFIG QUIET) - endif() -endif() diff --git a/samples/glfw/main.cpp b/samples/glfw/main.cpp deleted file mode 100644 index 9632eab57e..0000000000 --- a/samples/glfw/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "GlfwOcctView.h" - -int main (int, char**) -{ - GlfwOcctView anApp; - try - { - anApp.run(); - } - catch (const std::runtime_error& theError) - { - std::cerr << theError.what() << std::endl; - return EXIT_FAILURE; - } - return 0; -} diff --git a/samples/glfw/readme.md b/samples/glfw/readme.md deleted file mode 100644 index bb656cd417..0000000000 --- a/samples/glfw/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -GLFW: 3D Viewer (C++|GLFW) {#occt_samples_glfw} -================== - -A sample demonstrating usage of OCCT 3D Viewer within a window created using GLFW. - -Use CMake to build the sample. - -Platforms: Windows, macOS, Linux - -Required: glfw diff --git a/samples/ios/UIKitSample/ReadMe.md b/samples/ios/UIKitSample/ReadMe.md deleted file mode 100644 index 7e4de5d60e..0000000000 --- a/samples/ios/UIKitSample/ReadMe.md +++ /dev/null @@ -1,21 +0,0 @@ -iOS: 3D Viewer (Objective-C++|UIKit) {#occt_samples_ios_uikit} -================== - -UIKitSample consists of the Open CASCADE 3D Viewer which provides import of STEP files and toolbar with three buttons. -The sample could be found within OCCT repository in folder `/samples/ios/UIKitSample/`. - -The first and second buttons serve for import hardcoded STEP files. The third button displays "About" dialog. - -The viewer supports zoom, pan and rotate actions. The viewer supports selection of solids as well. - -@figure{sample_ios_uikit.png} - -Installation and configuration: - 1. Make sure you are running Mac OS version 10.12.1 or above and properly installed XCode version 8.1 or above. - 2. Install Open CASCADE Technology (OCCT) and build static libraries for desired device or/and simulator on your workstation. - 3. Build or download Freetype2 static library for desired device or/and simulator. - 4. Open UIKitSample in XCode. - 5. Select the UIKitSample project and add the OCCT static libraries and Freetype2 static library. - 6. Select the UIKitSample and go to the "Build Settings" tab. After go to the section "Search Paths" and in the field "Header Search Paths" specify a path to the OCCT inc folder. Next in the field "Library Search Paths" specify a path/paths to the OCCT static libraries and Freetype2 static library folders. - 7. Connect device and build sample for device or choose simulator as a target and build for simulator. - 8. Run sample. diff --git a/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj b/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj deleted file mode 100644 index 78a9b18267..0000000000 --- a/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,548 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0A24B9FA1EB0A7CC00A5F490 /* linkrods.step in Resources */ = {isa = PBXBuildFile; fileRef = 0A24B9F91EB0A7CC00A5F490 /* linkrods.step */; }; - 0A7DEDD61E2D1D0F00267B9B /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDD41E2D1D0900267B9B /* libfreetype.a */; }; - 0A7DEDE71E2D28E300267B9B /* libTKBRep.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDDE1E2D28C500267B9B /* libTKBRep.a */; }; - 0A7DEDE81E2D28E300267B9B /* libTKernel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDDF1E2D28C800267B9B /* libTKernel.a */; }; - 0A7DEDE91E2D28E300267B9B /* libTKG2d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE01E2D28CB00267B9B /* libTKG2d.a */; }; - 0A7DEDEA1E2D28E300267B9B /* libTKG3d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE11E2D28CE00267B9B /* libTKG3d.a */; }; - 0A7DEDEB1E2D28E300267B9B /* libTKGeomAlgo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE21E2D28D200267B9B /* libTKGeomAlgo.a */; }; - 0A7DEDEC1E2D28E300267B9B /* libTKGeomBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE31E2D28D500267B9B /* libTKGeomBase.a */; }; - 0A7DEDED1E2D28E300267B9B /* libTKMath.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE41E2D28D800267B9B /* libTKMath.a */; }; - 0A7DEDEE1E2D28E300267B9B /* libTKShHealing.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE51E2D28DC00267B9B /* libTKShHealing.a */; }; - 0A7DEDEF1E2D28E300267B9B /* libTKTopAlgo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE61E2D28DF00267B9B /* libTKTopAlgo.a */; }; - 0A7DEDF21E2D297000267B9B /* libTKHLR.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF01E2D296900267B9B /* libTKHLR.a */; }; - 0A7DEDF31E2D297000267B9B /* libTKMesh.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF11E2D296C00267B9B /* libTKMesh.a */; }; - 0A7DEDF91E2D29FF00267B9B /* libTKCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF41E2D29EF00267B9B /* libTKCAF.a */; }; - 0A7DEDFA1E2D29FF00267B9B /* libTKCDF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF51E2D29F200267B9B /* libTKCDF.a */; }; - 0A7DEDFB1E2D29FF00267B9B /* libTKLCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF61E2D29F500267B9B /* libTKLCAF.a */; }; - 0A7DEDFC1E2D29FF00267B9B /* libTKV3d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF71E2D29F800267B9B /* libTKV3d.a */; }; - 0A7DEDFD1E2D29FF00267B9B /* libTKVCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF81E2D29FB00267B9B /* libTKVCAF.a */; }; - 0A7DEE2B1E2D2AE000267B9B /* libTKService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */; }; - 0A7DEE2E1E2D2AE000267B9B /* libTKDESTEP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0E1E2D2AA800267B9B /* libTKDESTEP.a */; }; - 0A7DEE351E2D2AE000267B9B /* libTKXCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */; }; - 0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE021E2D2A7F00267B9B /* libTKBO.a */; }; - 0A7DEE3F1E2D2BB000267B9B /* libTKOpenGles.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */; }; - 0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */; }; - 0AAE0DE61EAF816E00C1F65B /* screw.step in Resources */ = {isa = PBXBuildFile; fileRef = 0AAE0DE51EAF816D00C1F65B /* screw.step */; }; - 0AE286641EB0D29B00A9D719 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AE286631EB0D29A00A9D719 /* libz.tbd */; }; - 3405C9E01DE2F04E008BADB9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405C9DF1DE2F04E008BADB9 /* main.mm */; }; - 3405C9E31DE2F04E008BADB9 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405C9E21DE2F04E008BADB9 /* AppDelegate.mm */; }; - 3405C9EB1DE2F04E008BADB9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3405C9EA1DE2F04E008BADB9 /* Assets.xcassets */; }; - 3405C9EE1DE2F04E008BADB9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3405C9EC1DE2F04E008BADB9 /* LaunchScreen.storyboard */; }; - 3405CA781DE303DC008BADB9 /* OcctViewer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405CA771DE303DC008BADB9 /* OcctViewer.mm */; }; - 3405CA7B1DE31566008BADB9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3405CA7A1DE31566008BADB9 /* QuartzCore.framework */; }; - 3405CA7D1DE3156D008BADB9 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3405CA7C1DE3156D008BADB9 /* OpenGLES.framework */; }; - 3405CA821DE332AB008BADB9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3405CA811DE332AB008BADB9 /* UIKit.framework */; }; - 3405CA851DE3331D008BADB9 /* GLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405CA841DE3331D008BADB9 /* GLView.mm */; }; - 343FDCA61DE42F37009AEE51 /* GLViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 343FDCA51DE42F37009AEE51 /* GLViewController.mm */; }; - 34424E031DE70100008B56DA /* OcctDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34424E021DE70100008B56DA /* OcctDocument.mm */; }; - 34424E061DE72D2E008B56DA /* CafShapePrs.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34424E051DE72D2E008B56DA /* CafShapePrs.mm */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 0A24B9F91EB0A7CC00A5F490 /* linkrods.step */ = {isa = PBXFileReference; lastKnownFileType = text; name = linkrods.step; path = ../occt/data/step/linkrods.step; sourceTree = ""; }; - 0A7DED6E1E2D15B800267B9B /* dev */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dev; path = ..; sourceTree = ""; }; - 0A7DEDD41E2D1D0900267B9B /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../3rdparty/lib/libfreetype.a; sourceTree = ""; }; - 0A7DEDDE1E2D28C500267B9B /* libTKBRep.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBRep.a; path = ../occt/lib/libTKBRep.a; sourceTree = ""; }; - 0A7DEDDF1E2D28C800267B9B /* libTKernel.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKernel.a; path = ../occt/lib/libTKernel.a; sourceTree = ""; }; - 0A7DEDE01E2D28CB00267B9B /* libTKG2d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKG2d.a; path = ../occt/lib/libTKG2d.a; sourceTree = ""; }; - 0A7DEDE11E2D28CE00267B9B /* libTKG3d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKG3d.a; path = ../occt/lib/libTKG3d.a; sourceTree = ""; }; - 0A7DEDE21E2D28D200267B9B /* libTKGeomAlgo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKGeomAlgo.a; path = ../occt/lib/libTKGeomAlgo.a; sourceTree = ""; }; - 0A7DEDE31E2D28D500267B9B /* libTKGeomBase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKGeomBase.a; path = ../occt/lib/libTKGeomBase.a; sourceTree = ""; }; - 0A7DEDE41E2D28D800267B9B /* libTKMath.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMath.a; path = ../occt/lib/libTKMath.a; sourceTree = ""; }; - 0A7DEDE51E2D28DC00267B9B /* libTKShHealing.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKShHealing.a; path = ../occt/lib/libTKShHealing.a; sourceTree = ""; }; - 0A7DEDE61E2D28DF00267B9B /* libTKTopAlgo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKTopAlgo.a; path = ../occt/lib/libTKTopAlgo.a; sourceTree = ""; }; - 0A7DEDF01E2D296900267B9B /* libTKHLR.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKHLR.a; path = ../occt/lib/libTKHLR.a; sourceTree = ""; }; - 0A7DEDF11E2D296C00267B9B /* libTKMesh.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMesh.a; path = ../occt/lib/libTKMesh.a; sourceTree = ""; }; - 0A7DEDF41E2D29EF00267B9B /* libTKCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKCAF.a; path = ../occt/lib/libTKCAF.a; sourceTree = ""; }; - 0A7DEDF51E2D29F200267B9B /* libTKCDF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKCDF.a; path = ../occt/lib/libTKCDF.a; sourceTree = ""; }; - 0A7DEDF61E2D29F500267B9B /* libTKLCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKLCAF.a; path = ../occt/lib/libTKLCAF.a; sourceTree = ""; }; - 0A7DEDF71E2D29F800267B9B /* libTKV3d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKV3d.a; path = ../occt/lib/libTKV3d.a; sourceTree = ""; }; - 0A7DEDF81E2D29FB00267B9B /* libTKVCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKVCAF.a; path = ../occt/lib/libTKVCAF.a; sourceTree = ""; }; - 0A7DEDFE1E2D2A7200267B9B /* libTKBin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBin.a; path = ../occt/lib/libTKBin.a; sourceTree = ""; }; - 0A7DEDFF1E2D2A7600267B9B /* libTKBinL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBinL.a; path = ../occt/lib/libTKBinL.a; sourceTree = ""; }; - 0A7DEE001E2D2A7900267B9B /* libTKBinTObj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBinTObj.a; path = ../occt/lib/libTKBinTObj.a; sourceTree = ""; }; - 0A7DEE011E2D2A7C00267B9B /* libTKBinXCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBinXCAF.a; path = ../occt/lib/libTKBinXCAF.a; sourceTree = ""; }; - 0A7DEE021E2D2A7F00267B9B /* libTKBO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBO.a; path = ../occt/lib/libTKBO.a; sourceTree = ""; }; - 0A7DEE031E2D2A8200267B9B /* libTKBool.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBool.a; path = ../occt/lib/libTKBool.a; sourceTree = ""; }; - 0A7DEE041E2D2A8500267B9B /* libTKFeat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKFeat.a; path = ../occt/lib/libTKFeat.a; sourceTree = ""; }; - 0A7DEE051E2D2A8900267B9B /* libTKFillet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKFillet.a; path = ../occt/lib/libTKFillet.a; sourceTree = ""; }; - 0A7DEE061E2D2A8C00267B9B /* libTKDEIGES.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKDEIGES.a; path = ../occt/lib/libTKDEIGES.a; sourceTree = ""; }; - 0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMeshVS.a; path = ../occt/lib/libTKMeshVS.a; sourceTree = ""; }; - 0A7DEE081E2D2A9300267B9B /* libTKOffset.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOffset.a; path = ../occt/lib/libTKOffset.a; sourceTree = ""; }; - 0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOpenGles.a; path = ../occt/lib/libTKOpenGles.a; sourceTree = ""; }; - 0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKPrim.a; path = ../occt/lib/libTKPrim.a; sourceTree = ""; }; - 0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKService.a; path = ../occt/lib/libTKService.a; sourceTree = ""; }; - 0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKStd.a; path = ../occt/lib/libTKStd.a; sourceTree = ""; }; - 0A7DEE0D1E2D2AA400267B9B /* libTKStdL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKStdL.a; path = ../occt/lib/libTKStdL.a; sourceTree = ""; }; - 0A7DEE0E1E2D2AA800267B9B /* libTKDESTEP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKDESTEP.a; path = ../occt/lib/libTKDESTEP.a; sourceTree = ""; }; - 0A7DEE121E2D2AB500267B9B /* libTKDESTL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKDESTL.a; path = ../occt/lib/libTKDESTL.a; sourceTree = ""; }; - 0A7DEE131E2D2AB900267B9B /* libTKTObj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKTObj.a; path = ../occt/lib/libTKTObj.a; sourceTree = ""; }; - 0A7DEE141E2D2ABC00267B9B /* libTKDEVRML.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKDEVRML.a; path = ../occt/lib/libTKDEVRML.a; sourceTree = ""; }; - 0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXCAF.a; path = ../occt/lib/libTKXCAF.a; sourceTree = ""; }; - 0A7DEE181E2D2ACA00267B9B /* libTKXMesh.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXMesh.a; path = ../occt/lib/libTKXMesh.a; sourceTree = ""; }; - 0A7DEE191E2D2ACE00267B9B /* libTKXml.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXml.a; path = ../occt/lib/libTKXml.a; sourceTree = ""; }; - 0A7DEE1A1E2D2AD100267B9B /* libTKXmlL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXmlL.a; path = ../occt/lib/libTKXmlL.a; sourceTree = ""; }; - 0A7DEE1B1E2D2AD500267B9B /* libTKXmlTObj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXmlTObj.a; path = ../occt/lib/libTKXmlTObj.a; sourceTree = ""; }; - 0A7DEE1C1E2D2AD900267B9B /* libTKXmlXCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXmlXCAF.a; path = ../occt/lib/libTKXmlXCAF.a; sourceTree = ""; }; - 0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXSBase.a; path = ../occt/lib/libTKXSBase.a; sourceTree = ""; }; - 0AAE0DE51EAF816D00C1F65B /* screw.step */ = {isa = PBXFileReference; lastKnownFileType = text; name = screw.step; path = ../occt/data/step/screw.step; sourceTree = ""; }; - 0AE286631EB0D29A00A9D719 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 3405C9DB1DE2F04E008BADB9 /* UIKitSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIKitSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3405C9DF1DE2F04E008BADB9 /* main.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; - 3405C9E11DE2F04E008BADB9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 3405C9E21DE2F04E008BADB9 /* AppDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = ""; }; - 3405C9EA1DE2F04E008BADB9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 3405C9ED1DE2F04E008BADB9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 3405C9EF1DE2F04E008BADB9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3405CA761DE30380008BADB9 /* OcctViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcctViewer.h; sourceTree = ""; }; - 3405CA771DE303DC008BADB9 /* OcctViewer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OcctViewer.mm; sourceTree = ""; }; - 3405CA7A1DE31566008BADB9 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 3405CA7C1DE3156D008BADB9 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - 3405CA811DE332AB008BADB9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 3405CA831DE3331D008BADB9 /* GLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLView.h; sourceTree = ""; }; - 3405CA841DE3331D008BADB9 /* GLView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = GLView.mm; sourceTree = ""; }; - 343FDCA41DE42D12009AEE51 /* GLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLViewController.h; sourceTree = ""; }; - 343FDCA51DE42F37009AEE51 /* GLViewController.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = GLViewController.mm; sourceTree = ""; }; - 34424E011DE6FF05008B56DA /* OcctDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OcctDocument.h; sourceTree = ""; }; - 34424E021DE70100008B56DA /* OcctDocument.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = OcctDocument.mm; sourceTree = ""; }; - 34424E041DE72C23008B56DA /* CafShapePrs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CafShapePrs.h; sourceTree = ""; }; - 34424E051DE72D2E008B56DA /* CafShapePrs.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = CafShapePrs.mm; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3405C9D81DE2F04E008BADB9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 0AE286641EB0D29B00A9D719 /* libz.tbd in Frameworks */, - 0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */, - 0A7DEE3F1E2D2BB000267B9B /* libTKOpenGles.a in Frameworks */, - 0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */, - 0A7DEE2B1E2D2AE000267B9B /* libTKService.a in Frameworks */, - 0A7DEE2E1E2D2AE000267B9B /* libTKDESTEP.a in Frameworks */, - 0A7DEE351E2D2AE000267B9B /* libTKXCAF.a in Frameworks */, - 0A7DEE371E2D2AE000267B9B /* libTKXDESTEP.a in Frameworks */, - 0A7DEDE71E2D28E300267B9B /* libTKBRep.a in Frameworks */, - 0A7DEDF91E2D29FF00267B9B /* libTKCAF.a in Frameworks */, - 0A7DEDFA1E2D29FF00267B9B /* libTKCDF.a in Frameworks */, - 0A7DEDE81E2D28E300267B9B /* libTKernel.a in Frameworks */, - 0A7DEDE91E2D28E300267B9B /* libTKG2d.a in Frameworks */, - 0A7DEDEA1E2D28E300267B9B /* libTKG3d.a in Frameworks */, - 0A7DEDEB1E2D28E300267B9B /* libTKGeomAlgo.a in Frameworks */, - 0A7DEDEC1E2D28E300267B9B /* libTKGeomBase.a in Frameworks */, - 0A7DEDF21E2D297000267B9B /* libTKHLR.a in Frameworks */, - 0A7DEDFB1E2D29FF00267B9B /* libTKLCAF.a in Frameworks */, - 0A7DEDED1E2D28E300267B9B /* libTKMath.a in Frameworks */, - 0A7DEDF31E2D297000267B9B /* libTKMesh.a in Frameworks */, - 0A7DEDEE1E2D28E300267B9B /* libTKShHealing.a in Frameworks */, - 0A7DEDEF1E2D28E300267B9B /* libTKTopAlgo.a in Frameworks */, - 0A7DEDFC1E2D29FF00267B9B /* libTKV3d.a in Frameworks */, - 0A7DEDFD1E2D29FF00267B9B /* libTKVCAF.a in Frameworks */, - 0A7DEDD61E2D1D0F00267B9B /* libfreetype.a in Frameworks */, - 3405CA821DE332AB008BADB9 /* UIKit.framework in Frameworks */, - 3405CA7D1DE3156D008BADB9 /* OpenGLES.framework in Frameworks */, - 3405CA7B1DE31566008BADB9 /* QuartzCore.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3405C9D21DE2F04E008BADB9 = { - isa = PBXGroup; - children = ( - 0A24B9F91EB0A7CC00A5F490 /* linkrods.step */, - 0AAE0DE51EAF816D00C1F65B /* screw.step */, - 3405C9DD1DE2F04E008BADB9 /* UIKitSample */, - 3405C9DC1DE2F04E008BADB9 /* Products */, - 3405CA791DE31565008BADB9 /* Frameworks */, - ); - sourceTree = ""; - }; - 3405C9DC1DE2F04E008BADB9 /* Products */ = { - isa = PBXGroup; - children = ( - 3405C9DB1DE2F04E008BADB9 /* UIKitSample.app */, - ); - name = Products; - sourceTree = ""; - }; - 3405C9DD1DE2F04E008BADB9 /* UIKitSample */ = { - isa = PBXGroup; - children = ( - 34424E051DE72D2E008B56DA /* CafShapePrs.mm */, - 34424E041DE72C23008B56DA /* CafShapePrs.h */, - 34424E011DE6FF05008B56DA /* OcctDocument.h */, - 34424E021DE70100008B56DA /* OcctDocument.mm */, - 3405CA841DE3331D008BADB9 /* GLView.mm */, - 3405CA831DE3331D008BADB9 /* GLView.h */, - 343FDCA51DE42F37009AEE51 /* GLViewController.mm */, - 343FDCA41DE42D12009AEE51 /* GLViewController.h */, - 3405CA761DE30380008BADB9 /* OcctViewer.h */, - 3405CA771DE303DC008BADB9 /* OcctViewer.mm */, - 3405C9E11DE2F04E008BADB9 /* AppDelegate.h */, - 3405C9E21DE2F04E008BADB9 /* AppDelegate.mm */, - 3405C9EA1DE2F04E008BADB9 /* Assets.xcassets */, - 3405C9EC1DE2F04E008BADB9 /* LaunchScreen.storyboard */, - 3405C9EF1DE2F04E008BADB9 /* Info.plist */, - 3405C9DE1DE2F04E008BADB9 /* Supporting Files */, - ); - path = UIKitSample; - sourceTree = ""; - }; - 3405C9DE1DE2F04E008BADB9 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3405C9DF1DE2F04E008BADB9 /* main.mm */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 3405CA791DE31565008BADB9 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0AE286631EB0D29A00A9D719 /* libz.tbd */, - 0A7DEDFE1E2D2A7200267B9B /* libTKBin.a */, - 0A7DEDFF1E2D2A7600267B9B /* libTKBinL.a */, - 0A7DEE001E2D2A7900267B9B /* libTKBinTObj.a */, - 0A7DEE011E2D2A7C00267B9B /* libTKBinXCAF.a */, - 0A7DEE021E2D2A7F00267B9B /* libTKBO.a */, - 0A7DEE031E2D2A8200267B9B /* libTKBool.a */, - 0A7DEE041E2D2A8500267B9B /* libTKFeat.a */, - 0A7DEE051E2D2A8900267B9B /* libTKFillet.a */, - 0A7DEE061E2D2A8C00267B9B /* libTKDEIGES.a */, - 0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */, - 0A7DEE081E2D2A9300267B9B /* libTKOffset.a */, - 0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */, - 0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */, - 0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */, - 0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */, - 0A7DEE0D1E2D2AA400267B9B /* libTKStdL.a */, - 0A7DEE0E1E2D2AA800267B9B /* libTKDESTEP.a */, - 0A7DEE121E2D2AB500267B9B /* libTKDESTL.a */, - 0A7DEE131E2D2AB900267B9B /* libTKTObj.a */, - 0A7DEE141E2D2ABC00267B9B /* libTKDEVRML.a */, - 0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */, - 0A7DEE181E2D2ACA00267B9B /* libTKXMesh.a */, - 0A7DEE191E2D2ACE00267B9B /* libTKXml.a */, - 0A7DEE1A1E2D2AD100267B9B /* libTKXmlL.a */, - 0A7DEE1B1E2D2AD500267B9B /* libTKXmlTObj.a */, - 0A7DEE1C1E2D2AD900267B9B /* libTKXmlXCAF.a */, - 0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */, - 0A7DEDF41E2D29EF00267B9B /* libTKCAF.a */, - 0A7DEDF51E2D29F200267B9B /* libTKCDF.a */, - 0A7DEDF61E2D29F500267B9B /* libTKLCAF.a */, - 0A7DEDF71E2D29F800267B9B /* libTKV3d.a */, - 0A7DEDF81E2D29FB00267B9B /* libTKVCAF.a */, - 0A7DEDF01E2D296900267B9B /* libTKHLR.a */, - 0A7DEDF11E2D296C00267B9B /* libTKMesh.a */, - 0A7DEDDE1E2D28C500267B9B /* libTKBRep.a */, - 0A7DEDDF1E2D28C800267B9B /* libTKernel.a */, - 0A7DEDE01E2D28CB00267B9B /* libTKG2d.a */, - 0A7DEDE11E2D28CE00267B9B /* libTKG3d.a */, - 0A7DEDE21E2D28D200267B9B /* libTKGeomAlgo.a */, - 0A7DEDE31E2D28D500267B9B /* libTKGeomBase.a */, - 0A7DEDE41E2D28D800267B9B /* libTKMath.a */, - 0A7DEDE51E2D28DC00267B9B /* libTKShHealing.a */, - 0A7DEDE61E2D28DF00267B9B /* libTKTopAlgo.a */, - 0A7DEDD41E2D1D0900267B9B /* libfreetype.a */, - 0A7DED6E1E2D15B800267B9B /* dev */, - 3405CA811DE332AB008BADB9 /* UIKit.framework */, - 3405CA7C1DE3156D008BADB9 /* OpenGLES.framework */, - 3405CA7A1DE31566008BADB9 /* QuartzCore.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3405C9DA1DE2F04E008BADB9 /* UIKitSample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3405CA081DE2F04E008BADB9 /* Build configuration list for PBXNativeTarget "UIKitSample" */; - buildPhases = ( - 3405C9D71DE2F04E008BADB9 /* Sources */, - 3405C9D81DE2F04E008BADB9 /* Frameworks */, - 3405C9D91DE2F04E008BADB9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = UIKitSample; - productName = UIKitSample; - productReference = 3405C9DB1DE2F04E008BADB9 /* UIKitSample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3405C9D31DE2F04E008BADB9 /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = ""; - LastUpgradeCheck = 0810; - ORGANIZATIONNAME = "OPEN CASCADE"; - TargetAttributes = { - 3405C9DA1DE2F04E008BADB9 = { - CreatedOnToolsVersion = 8.1; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 3405C9D61DE2F04E008BADB9 /* Build configuration list for PBXProject "UIKitSample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 3405C9D21DE2F04E008BADB9; - productRefGroup = 3405C9DC1DE2F04E008BADB9 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3405C9DA1DE2F04E008BADB9 /* UIKitSample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 3405C9D91DE2F04E008BADB9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0A24B9FA1EB0A7CC00A5F490 /* linkrods.step in Resources */, - 0AAE0DE61EAF816E00C1F65B /* screw.step in Resources */, - 3405C9EE1DE2F04E008BADB9 /* LaunchScreen.storyboard in Resources */, - 3405C9EB1DE2F04E008BADB9 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3405C9D71DE2F04E008BADB9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3405C9E31DE2F04E008BADB9 /* AppDelegate.mm in Sources */, - 3405CA851DE3331D008BADB9 /* GLView.mm in Sources */, - 343FDCA61DE42F37009AEE51 /* GLViewController.mm in Sources */, - 34424E031DE70100008B56DA /* OcctDocument.mm in Sources */, - 3405CA781DE303DC008BADB9 /* OcctViewer.mm in Sources */, - 3405C9E01DE2F04E008BADB9 /* main.mm in Sources */, - 34424E061DE72D2E008B56DA /* CafShapePrs.mm in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 3405C9EC1DE2F04E008BADB9 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 3405C9ED1DE2F04E008BADB9 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 3405CA061DE2F04E008BADB9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; - LIBRARY_SEARCH_PATHS = ""; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - USE_HEADERMAP = YES; - VALID_ARCHS = "$(ARCHS_STANDARD)"; - }; - name = Debug; - }; - 3405CA071DE2F04E008BADB9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_BITCODE = NO; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; - LIBRARY_SEARCH_PATHS = ""; - MTL_ENABLE_DEBUG_INFO = NO; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - USE_HEADERMAP = YES; - VALIDATE_PRODUCT = YES; - VALID_ARCHS = "$(ARCHS_STANDARD)"; - }; - name = Release; - }; - 3405CA091DE2F04E008BADB9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_CXX_LIBRARY = "libc++"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; - HEADER_SEARCH_PATHS = ../occt/inc; - INFOPLIST_FILE = UIKitSample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - ../occt/lib, - ../3rdparty/lib, - ); - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = org.opencascade.ios.sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "$(ARCHS_STANDARD)"; - }; - name = Debug; - }; - 3405CA0A1DE2F04E008BADB9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_CXX_LIBRARY = "libc++"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; - HEADER_SEARCH_PATHS = ../occt/inc; - INFOPLIST_FILE = UIKitSample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - ../occt/lib, - ../3rdparty/lib, - ); - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = org.opencascade.ios.sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "$(ARCHS_STANDARD)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3405C9D61DE2F04E008BADB9 /* Build configuration list for PBXProject "UIKitSample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3405CA061DE2F04E008BADB9 /* Debug */, - 3405CA071DE2F04E008BADB9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3405CA081DE2F04E008BADB9 /* Build configuration list for PBXNativeTarget "UIKitSample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3405CA091DE2F04E008BADB9 /* Debug */, - 3405CA0A1DE2F04E008BADB9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3405C9D31DE2F04E008BADB9 /* Project object */; -} diff --git a/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 6a3ecc7e45..0000000000 --- a/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/ios/UIKitSample/UIKitSample/AppDelegate.h b/samples/ios/UIKitSample/UIKitSample/AppDelegate.h deleted file mode 100644 index b63c6a2952..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/AppDelegate.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import - -#import "GLView.h" - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/samples/ios/UIKitSample/UIKitSample/AppDelegate.mm b/samples/ios/UIKitSample/UIKitSample/AppDelegate.mm deleted file mode 100644 index 7e81296a0e..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/AppDelegate.mm +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -@synthesize window=_window; - -- (BOOL)application:(UIApplication *)theApplication didFinishLaunchingWithOptions:(NSDictionary *)theLaunchOptions { - // Override point for customization after application launch. - - CGRect screenBounds = [[UIScreen mainScreen] bounds]; - self.window = [[UIWindow alloc] initWithFrame: screenBounds]; - - GLViewController* aGLViewController = [[GLViewController alloc] init]; - UINavigationController *aNavController = - [[UINavigationController alloc] initWithRootViewController: aGLViewController]; - - self.window.rootViewController = aNavController; - [self.window makeKeyAndVisible]; - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)theApplication { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)theApplication { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)theApplication { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)theApplication { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)theApplication { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 536920e583..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "images" : [ - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Small-40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-Small-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-Small-40@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 57121a68a4..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png deleted file mode 100644 index 4fb3f91430..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png deleted file mode 100644 index 817ddecf1c..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png deleted file mode 100644 index d845c8008a..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png deleted file mode 100644 index 95dd562f8f..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index 911422e1f0..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index a060ff2ad6..0000000000 Binary files a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/samples/ios/UIKitSample/UIKitSample/Base.lproj/LaunchScreen.storyboard b/samples/ios/UIKitSample/UIKitSample/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index fdf3f97d1b..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/ios/UIKitSample/UIKitSample/CafShapePrs.h b/samples/ios/UIKitSample/UIKitSample/CafShapePrs.h deleted file mode 100644 index 1215533609..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/CafShapePrs.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef CafShapePrs_h -#define CafShapePrs_h - -#include -#include -#include - -typedef NCollection_DataMap CafDataMapOfShapeColor; -typedef NCollection_DataMap MapOfPrsForShapes; - -//! Interactive object for shape in DECAF document -class CafShapePrs : public XCAFPrs_AISObject -{ - DEFINE_STANDARD_RTTIEXT(CafShapePrs, XCAFPrs_AISObject) -public: - - //! Default constructor. - CafShapePrs (const TDF_Label& theLabel, - const XCAFPrs_Style& theStyle, - const Graphic3d_MaterialAspect& theMaterial); - - //! Search custom aspect for specified shape. - Standard_Boolean FindCustomAspects (const TopoDS_Shape& theShape, - Handle(AIS_ColoredDrawer)& theAspects) const - { - return myShapeColors.Find (theShape, theAspects); - } - - //! Access the styles map. - const CafDataMapOfShapeColor& ShapeColors() const { return myShapeColors; } - - //! Override default style. - virtual void DefaultStyle (XCAFPrs_Style& theStyle) const Standard_OVERRIDE - { - theStyle = myDefStyle; - } - -protected: - - XCAFPrs_Style myDefStyle; //!< default style - -}; - -#endif // CafShapePrs_h diff --git a/samples/ios/UIKitSample/UIKitSample/CafShapePrs.mm b/samples/ios/UIKitSample/UIKitSample/CafShapePrs.mm deleted file mode 100644 index a23e9f02a6..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/CafShapePrs.mm +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include "CafShapePrs.h" - -#import - -IMPLEMENT_STANDARD_RTTIEXT(CafShapePrs, XCAFPrs_AISObject) - -// ======================================================================= -// function : CafShapePrs -// purpose : -// ======================================================================= -CafShapePrs::CafShapePrs(const TDF_Label& theLabel, - const XCAFPrs_Style& theStyle, - const Graphic3d_MaterialAspect& theMaterial) -: XCAFPrs_AISObject (theLabel), - myDefStyle(theStyle) -{ - SetMaterial(theMaterial); -} diff --git a/samples/ios/UIKitSample/UIKitSample/GLView.h b/samples/ios/UIKitSample/UIKitSample/GLView.h deleted file mode 100644 index 0e90b2d02f..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/GLView.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef GLView_h -#define GLView_h - -#import -#import - -#include -#include - -#import "GLViewController.h" - -//! OpenGL view -@interface GLView : UIView { - -@public - GLViewController* myController; - - EAGLContext* myGLContext; - - int myBackingWidth; - int myBackingHeight; - GLuint myFrameBuffer; - GLuint myRenderBuffer; - GLuint myDepthBuffer; -} - -@end - -#endif // GLView_h diff --git a/samples/ios/UIKitSample/UIKitSample/GLView.mm b/samples/ios/UIKitSample/UIKitSample/GLView.mm deleted file mode 100644 index 3e61a002d3..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/GLView.mm +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import - -#import "GLView.h" -#import "GLViewController.h" - -@implementation GLView - -// ======================================================================= -// function : layerClass -// purpose : -// ======================================================================= -+ (Class)layerClass -{ - return [CAEAGLLayer class]; -} - -// ======================================================================= -// function : setupLayer -// purpose : -// ======================================================================= -- (void)setupLayer -{ - CAEAGLLayer* anEAGLLayer = (CAEAGLLayer*) self.layer; - anEAGLLayer.opaque = YES; - anEAGLLayer.contentsScale = [[UIScreen mainScreen] scale]; -} - -// ======================================================================= -// function : setupContext -// purpose : -// ======================================================================= -- (void)setupContext -{ - EAGLRenderingAPI aRendApi = kEAGLRenderingAPIOpenGLES2; - myGLContext = [[EAGLContext alloc] initWithAPI:aRendApi]; - if (!myGLContext) - { - NSLog(@"Failed to initialize OpenGL ES 2.0 context"); - } - - if (![EAGLContext setCurrentContext:myGLContext]) - { - NSLog(@"Failed to set current OpenGL ES context"); - } -} - -// ======================================================================= -// function : createBuffers -// purpose : -// ======================================================================= -- (void) createBuffers -{ - glGenFramebuffers(1, &myFrameBuffer); - glBindFramebuffer(GL_FRAMEBUFFER, myFrameBuffer); - glGenRenderbuffers(1, &myRenderBuffer); - glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer); - - [myGLContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)self.layer]; - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, myRenderBuffer); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &myBackingWidth); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &myBackingHeight); - - glGenRenderbuffers(1, &myDepthBuffer); - glBindRenderbuffer(GL_RENDERBUFFER, myDepthBuffer); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, myBackingWidth, myBackingHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, myDepthBuffer); -} - -// ======================================================================= -// function : destroyBuffers -// purpose : -// ======================================================================= -- (void) destroyBuffers -{ - glDeleteFramebuffers(1, &myFrameBuffer); - myFrameBuffer = 0; - glDeleteRenderbuffers(1, &myRenderBuffer); - myRenderBuffer = 0; - glDeleteRenderbuffers(1, &myDepthBuffer); - myDepthBuffer = 0; -} - -// ======================================================================= -// function : drawView -// purpose : -// ======================================================================= -- (void) drawView -{ - glBindFramebuffer(GL_FRAMEBUFFER, myFrameBuffer); - - [myController Draw]; - - glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer); - [myGLContext presentRenderbuffer:GL_RENDERBUFFER]; -} - -// ======================================================================= -// function : layoutSubviews -// purpose : -// ======================================================================= -- (void) layoutSubviews -{ - [EAGLContext setCurrentContext:myGLContext]; - - [self destroyBuffers]; - [self createBuffers]; - [self drawView]; - - glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer); - - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &myBackingWidth); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &myBackingHeight); - - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - { - NSLog(@"Failed to make complete framebuffer object %u", - glCheckFramebufferStatus(GL_FRAMEBUFFER)); - } - - glViewport(0, 0, myBackingWidth, myBackingHeight); - - [myController Setup]; -} - -// ======================================================================= -// function : init -// purpose : -// ======================================================================= -- (id) init -{ - self = [super init]; - - if (self) { - [self setupLayer]; - [self setupContext]; - - myController = NULL; - - myBackingWidth = 0; - myBackingHeight = 0; - myFrameBuffer = 0; - myRenderBuffer = 0; - myDepthBuffer = 0; - } - - return self; -} - -@end diff --git a/samples/ios/UIKitSample/UIKitSample/GLViewController.h b/samples/ios/UIKitSample/UIKitSample/GLViewController.h deleted file mode 100644 index 7f8f068221..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/GLViewController.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef GLViewController_h -#define GLViewController_h - -#import - -#import "OcctViewer.h" - -//! OpenGL view controller -@interface GLViewController : UIViewController { - OcctViewer* myOcctViewer; - CGPoint myFirstTouch[2]; -} - --(void) Draw; --(void) Setup; - -@end - -#endif // GLViewController_h diff --git a/samples/ios/UIKitSample/UIKitSample/GLViewController.mm b/samples/ios/UIKitSample/UIKitSample/GLViewController.mm deleted file mode 100644 index 6827f68352..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/GLViewController.mm +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import - -#import "GLViewController.h" -#import "GLView.h" - -@implementation GLViewController - -// ======================================================================= -// function : init -// purpose : -// ======================================================================= -- (id) init -{ - self = [super init]; - - if (self) { - myOcctViewer = new OcctViewer(); - } - - return self; -} - -// ======================================================================= -// function : Draw -// purpose : -// ======================================================================= -- (void) Draw -{ -} - -// ======================================================================= -// function : Setup -// purpose : -// ======================================================================= -- (void) Setup { - if (!myOcctViewer->InitViewer(self.view)) { - NSLog(@"Failed to init viewer"); - } - else { - [self importScrew:nullptr]; - } -} - -// ======================================================================= -// function : loadView -// purpose : -// ======================================================================= -- (void) loadView -{ - GLView* aGLView = [[GLView alloc] init]; - aGLView->myController = self; - self.view = aGLView; -} - -// ======================================================================= -// function : touchesBegan -// purpose : -// ======================================================================= -- (void)touchesBegan:(NSSet *)theTouches withEvent:(UIEvent *)theEvent -{ - [super touchesBegan:theTouches withEvent:theEvent]; - - UITouch *aTouch = [theTouches anyObject]; - if (aTouch != NULL) { - CGPoint aTouchPoint = [aTouch locationInView:self.view]; - myOcctViewer->StartRotation((int)aTouchPoint.x, (int)aTouchPoint.y); - } -} - -// ======================================================================= -// function : touchesMoved -// purpose : -// ======================================================================= -- (void)touchesMoved:(NSSet *)theTouches withEvent:(UIEvent *)theEvent -{ - [super touchesMoved:theTouches withEvent:theEvent]; - - UITouch *aTouch = [theTouches anyObject]; - if (aTouch != NULL) { - CGPoint aTouchPoint = [aTouch locationInView:self.view]; - myOcctViewer->Rotation((int)aTouchPoint.x, (int)aTouchPoint.y); - } - - return; -} - -// ======================================================================= -// function : viewDidLoad -// purpose : -// ======================================================================= --(void)viewDidLoad -{ - // add zoom recognizer - UIPinchGestureRecognizer *aZoomRecognizer = [[UIPinchGestureRecognizer alloc] - initWithTarget:self - action:@selector(zoomHandler:)]; - - [[self view] addGestureRecognizer:aZoomRecognizer]; - - // add pan recognizer - UIPanGestureRecognizer *aPanRecognizer = [[UIPanGestureRecognizer alloc] - initWithTarget:self - action:@selector(panHandler:)]; - - aPanRecognizer.maximumNumberOfTouches = 2; - aPanRecognizer.minimumNumberOfTouches = 2; - - [[self view] addGestureRecognizer:aPanRecognizer]; - - UITapGestureRecognizer *aTapRecognizer = [[UITapGestureRecognizer alloc] - initWithTarget:self - action:@selector(tapHandler:)]; - - [[self view] addGestureRecognizer:aTapRecognizer]; - - - // add import buttons - UIBarButtonItem *importScrewBtn = [[UIBarButtonItem alloc] - initWithTitle:@"Sample 1" - style:UIBarButtonItemStylePlain - target:self - action:@selector(importScrew:)]; - - UIBarButtonItem *importLinkrodsBtn = [[UIBarButtonItem alloc] - initWithTitle:@"Sample 2" - style:UIBarButtonItemStylePlain - target:self - action:@selector(importLinkrods:)]; - - UIBarButtonItem *displayAboutDlgBtn = [[UIBarButtonItem alloc] - initWithTitle:@"About" - style:UIBarButtonItemStylePlain - target:self - action:@selector(displayAboutDlg:)]; - - [self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:importScrewBtn, importLinkrodsBtn, nil]]; - [self.navigationItem setRightBarButtonItem: displayAboutDlgBtn]; -} - -// ======================================================================= -// function : zoomHandler -// purpose : -// ======================================================================= -- (void)zoomHandler:(UIPinchGestureRecognizer *)pinchRecognizer -{ - if ([pinchRecognizer numberOfTouches] > 1) - { - UIGestureRecognizerState aState = [pinchRecognizer state]; - if (aState == UIGestureRecognizerStateBegan) - { - myFirstTouch[0] = [pinchRecognizer locationOfTouch:0 inView:self.view]; - myFirstTouch[1] = [pinchRecognizer locationOfTouch:1 inView:self.view]; - } - else if (aState == UIGestureRecognizerStateChanged) { - CGPoint aLastTouch[2] = { - [pinchRecognizer locationOfTouch:0 inView:self.view], - [pinchRecognizer locationOfTouch:1 inView:self.view] - }; - - double aPinchCenterXStart = ( myFirstTouch[0].x + myFirstTouch[1].x ) / 2.0; - double aPinchCenterYStart = ( myFirstTouch[0].y + myFirstTouch[1].y ) / 2.0; - - double aStartDist = std::sqrt( ( myFirstTouch[0].x - myFirstTouch[1].x ) * ( myFirstTouch[0].x - myFirstTouch[1].x ) + - ( myFirstTouch[0].y - myFirstTouch[1].y ) * ( myFirstTouch[0].y - myFirstTouch[1].y ) ); - double anEndDist = std::sqrt( ( aLastTouch[0].x - aLastTouch[1].x ) * ( aLastTouch[0].x - aLastTouch[1].x ) + - ( aLastTouch[0].y - aLastTouch[1].y ) * ( aLastTouch[0].y - aLastTouch[1].y ) ); - - double aDeltaDist = anEndDist - aStartDist; - - myOcctViewer->Zoom(aPinchCenterXStart, aPinchCenterYStart, aDeltaDist); - - myFirstTouch[0] = aLastTouch[0]; - myFirstTouch[1] = aLastTouch[1]; - } - } -} - -// ======================================================================= -// function : panHandler -// purpose : -// ======================================================================= -- (void)panHandler:(UIPanGestureRecognizer *)panRecognizer -{ - if ([panRecognizer numberOfTouches] > 1) - { - UIGestureRecognizerState aState = [panRecognizer state]; - if (aState == UIGestureRecognizerStateBegan) - { - myFirstTouch[0] = [panRecognizer locationOfTouch:0 inView:self.view]; - myFirstTouch[1] = [panRecognizer locationOfTouch:1 inView:self.view]; - } - else if (aState == UIGestureRecognizerStateChanged) { - CGPoint aLastTouch[2] = { - [panRecognizer locationOfTouch:0 inView:self.view], - [panRecognizer locationOfTouch:1 inView:self.view] - }; - - double aPinchCenterXStart = ( myFirstTouch[0].x + myFirstTouch[1].x ) / 2.0; - double aPinchCenterYStart = ( myFirstTouch[0].y + myFirstTouch[1].y ) / 2.0; - - double aPinchCenterXEnd = ( aLastTouch[0].x + aLastTouch[1].x ) / 2.0; - double aPinchCenterYEnd = ( aLastTouch[0].y + aLastTouch[1].y ) / 2.0; - - double aPinchCenterXDev = aPinchCenterXEnd - aPinchCenterXStart; - double aPinchCenterYDev = aPinchCenterYEnd - aPinchCenterYStart; - - myOcctViewer->Pan((int)aPinchCenterXDev, (int)-aPinchCenterYDev); - } - } -} - -// ======================================================================= -// function : tapHandler -// purpose : -// ======================================================================= -- (void)tapHandler:(UITapGestureRecognizer *)tapRecognizer -{ - CGPoint aTapPoint = [tapRecognizer locationInView:self.view]; - myOcctViewer->Select(aTapPoint.x, aTapPoint.y); -} - -// ======================================================================= -// function : importScrew -// purpose : -// ======================================================================= -- (void)importScrew:(UIBarButtonItem *)theSender -{ - NSString* aNsPath = [[NSBundle mainBundle] pathForResource:@"screw" - ofType:@"step"]; - std::string aPath = std::string([aNsPath UTF8String]); - - myOcctViewer->ImportSTEP(aPath); - myOcctViewer->FitAll(); -} - -// ======================================================================= -// function : importLinkrods -// purpose : -// ======================================================================= -- (void)importLinkrods:(UIBarButtonItem *)theSender -{ - NSString* aNsPath = [[NSBundle mainBundle] pathForResource:@"linkrods" - ofType:@"step"]; - std::string aPath = std::string([aNsPath UTF8String]); - - myOcctViewer->ImportSTEP(aPath); - myOcctViewer->FitAll(); -} - -// ======================================================================= -// function : displayAboutDlg -// purpose : -// ======================================================================= -- (void)displayAboutDlg:(UIBarButtonItem *)theSender -{ - UIAlertController* anAbout = [UIAlertController alertControllerWithTitle:@"About" - message:@"UIKit based application for tutorial to Open CASCADE Technology.\n\n" - @"Copyright (c) 2017 OPEN CASCADE SAS" - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* aDefaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) {}]; - - [anAbout addAction:aDefaultAction]; - [self presentViewController:anAbout animated:YES completion:nil]; -} - -@end diff --git a/samples/ios/UIKitSample/UIKitSample/Info.plist b/samples/ios/UIKitSample/UIKitSample/Info.plist deleted file mode 100644 index 92faa7fb2e..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - OCCT Sample - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/samples/ios/UIKitSample/UIKitSample/OcctDocument.h b/samples/ios/UIKitSample/UIKitSample/OcctDocument.h deleted file mode 100644 index f85acf12dd..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/OcctDocument.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef OcctDocument_h -#define OcctDocument_h - -#include -#include - -//! The document -class OcctDocument : public Standard_Transient -{ - DEFINE_STANDARD_RTTIEXT(OcctDocument, Standard_Transient) - -public: - Standard_EXPORT OcctDocument(); - - Standard_EXPORT virtual ~OcctDocument(); - - Standard_EXPORT void InitDoc(); - - Handle(TDocStd_Document)& ChangeDocument() { return myOcafDoc; } - - const Handle(TDocStd_Document)& Document() const { return myOcafDoc; } - -private: - Handle(XCAFApp_Application) myApp; - Handle(TDocStd_Document) myOcafDoc; -}; - -#endif // OcctDocument_h diff --git a/samples/ios/UIKitSample/UIKitSample/OcctDocument.mm b/samples/ios/UIKitSample/UIKitSample/OcctDocument.mm deleted file mode 100644 index 6adfe78b7f..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/OcctDocument.mm +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import - -#include "OcctDocument.h" - -#include -#include -#include - -#include - -IMPLEMENT_STANDARD_RTTIEXT(OcctDocument, Standard_Transient) - -// ======================================================================= -// function : OcctViewer -// purpose : -// ======================================================================= -OcctDocument::OcctDocument() -{ - try - { - OCC_CATCH_SIGNALS - myApp = XCAFApp_Application::GetApplication(); - } - catch (const Standard_Failure& theFailure) - { - Message::SendFail (TCollection_AsciiString("Error in creating application") + theFailure.GetMessageString()); - } -} - -// ======================================================================= -// function : ~OcctDocument -// purpose : -// ======================================================================= -OcctDocument::~OcctDocument() -{ -} - -// ======================================================================= -// function : InitDoc -// purpose : -// ======================================================================= -void OcctDocument::InitDoc() -{ - // close old document - if (!myOcafDoc.IsNull()) - { - if (myOcafDoc->HasOpenCommand()) - { - myOcafDoc->AbortCommand(); - } - - myOcafDoc->Main().Root().ForgetAllAttributes(Standard_True); - myApp->Close(myOcafDoc); - myOcafDoc.Nullify(); - } - - // create a new document - myApp->NewDocument(TCollection_ExtendedString("BinXCAF"), myOcafDoc); - - // set maximum number of available "undo" actions - if (!myOcafDoc.IsNull()) - { - myOcafDoc->SetUndoLimit(10); - } -} diff --git a/samples/ios/UIKitSample/UIKitSample/OcctViewer.h b/samples/ios/UIKitSample/UIKitSample/OcctViewer.h deleted file mode 100644 index 57962aa15b..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/OcctViewer.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef OcctViewer_H -#define OcctViewer_H - -#include "OcctDocument.h" -#include "CafShapePrs.h" - -#include -#include -#include -#include -#include -#include -#include - -#import - -//! OCCT 3D Viewer holder. -class OcctViewer -{ -public: - - //! Empty constructor. - Standard_EXPORT OcctViewer(); - - //! Destructor. - Standard_EXPORT virtual ~OcctViewer(); - - //! Release the viewer. - Standard_EXPORT void release(); - -public: - - //! Return viewer instance. - const Handle(V3d_Viewer)& V3dViewer() const { return myViewer; } - - //! Return active view. - const Handle(V3d_View)& ActiveView() const { return myView; } - - //! Interactive context. - const Handle(AIS_InteractiveContext)& AisContext() const { return myContext; } - - //! Invalidate active viewer. - void Invalidate() - { - myView->Invalidate(); - } - -public: - - //! Perform OCCT Viewer (re)initialization. - Standard_EXPORT bool InitViewer (UIView* theWin); - - Standard_EXPORT void FitAll(); - - Standard_EXPORT void StartRotation(int theX, int theY); - Standard_EXPORT void Rotation(int theX, int theY); - Standard_EXPORT void Pan(int theX, int theY); - Standard_EXPORT void Zoom(int theX, int theY, double theDelta); - Standard_EXPORT void Select(int theX, int theY); - - Standard_EXPORT bool ImportSTEP(std::string theFilename); - -private: - void clearSession(const Handle(XSControl_WorkSession)& theSession); - - void displayWithChildren (XCAFDoc_ShapeTool& theShapeTool, - XCAFDoc_ColorTool& theColorTool, - const TDF_Label& theLabel, - const TopLoc_Location& theParentTrsf, - const XCAFPrs_Style& theParentStyle, - const TCollection_AsciiString& theParentId, - MapOfPrsForShapes& theMapOfShapes); - void clearContext(); - -protected: - - Handle(V3d_Viewer) myViewer; //!< main viewer - Handle(V3d_View) myView; //!< main view - Handle(AIS_InteractiveContext) myContext; //!< interactive context containing displayed objects - Handle(OcctDocument) myDoc; -}; - -#endif // OcctViewer_H diff --git a/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm b/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm deleted file mode 100644 index de4eff8c3a..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "OcctViewer.h" -#include "OcctDocument.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// ======================================================================= -// function : OcctViewer -// purpose : -// ======================================================================= -OcctViewer::OcctViewer() -{ - myDoc = new OcctDocument(); -} - -// ======================================================================= -// function : ~OcctViewer -// purpose : -// ======================================================================= -OcctViewer::~OcctViewer() -{ - // -} - -// ======================================================================= -// function : release -// purpose : -// ======================================================================= -void OcctViewer::release() -{ - myContext.Nullify(); - if (!myView.IsNull()) - { - myView->Remove(); - } - myView.Nullify(); - myViewer.Nullify(); - - myDoc.Nullify(); -} - -// ======================================================================= -// function : InitViewer -// purpose : -// ======================================================================= -bool OcctViewer::InitViewer (UIView* theWin) -{ - EAGLContext* aRendCtx = [EAGLContext currentContext]; - if (theWin == NULL || aRendCtx == NULL) - { - NSLog(@"Error: No active EAGL context!"); - release(); - return false; - } - if (!myView.IsNull()) - { - myView->MustBeResized(); - myView->Invalidate(); - return true; - } - - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); - Handle(Graphic3d_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (aDisplayConnection); - - // Create Viewer - myViewer = new V3d_Viewer (aGraphicDriver); - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - - // Create AIS context - myContext = new AIS_InteractiveContext (myViewer); - myContext->SetDisplayMode ((int )AIS_DisplayMode::AIS_Shaded, false); - - myView = myViewer->CreateView(); - myView->TriedronDisplay (Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.20, V3d_ZBUFFER); - - Handle(Cocoa_Window) aCocoaWindow = new Cocoa_Window (theWin); - myView->SetWindow (aCocoaWindow, aRendCtx); - if (!aCocoaWindow->IsMapped()) - { - aCocoaWindow->Map(); - } - - myView->Redraw(); - myView->MustBeResized(); - return true; -} - -// ======================================================================= -// function : FitAll -// purpose : -// ======================================================================= -void OcctViewer::FitAll() -{ - if (!myView.IsNull()) - { - myView->FitAll(); - myView->ZFitAll(); - } -} - -// ======================================================================= -// function : StartRotation -// purpose : -// ======================================================================= -void OcctViewer::StartRotation(int theX, int theY) -{ - if (!myView.IsNull()) - { - myView->StartRotation(theX, theY); - } -} - -// ======================================================================= -// function : Rotation -// purpose : -// ======================================================================= -void OcctViewer::Rotation(int theX, int theY) -{ - if (!myView.IsNull()) - { - myView->Rotation(theX, theY); - } -} - -// ======================================================================= -// function : Pan -// purpose : -// ======================================================================= -void OcctViewer::Pan(int theX, int theY) -{ - if (!myView.IsNull()) - { - myView->Pan(theX, theY, 1, Standard_False); - } -} - -// ======================================================================= -// function : Zoom -// purpose : -// ======================================================================= -void OcctViewer::Zoom(int theX, int theY, double theDelta) -{ - if (!myView.IsNull()) - { - if (theX >=0 && theY >=0) - { - myView->StartZoomAtPoint(theX, theY); - myView->ZoomAtPoint(0, 0, (int) theDelta, (int) theDelta); - } - else - { - double aCoeff = Abs(theDelta) / 100.0 + 1.0; - aCoeff = theDelta > 0.0 ? aCoeff : 1.0 / aCoeff; - myView->SetZoom(aCoeff, Standard_True); - } - } -} - -// ======================================================================= -// function : Select -// purpose : -// ======================================================================= -void OcctViewer::Select(int theX, int theY) -{ - if (!myContext.IsNull()) - { - myContext->ClearSelected(Standard_False); - myContext->MoveTo(theX, theY, myView, Standard_False); - myContext->Select(Standard_False); - } -} - -// ======================================================================= -// function : ImportSTEP -// purpose : -// ======================================================================= -bool OcctViewer::ImportSTEP(std::string theFilename) -{ - // create a new document - myDoc->InitDoc(); - - STEPCAFControl_Reader aReader; - Handle(XSControl_WorkSession) aSession = aReader.Reader().WS(); - - try - { - if (!aReader.ReadFile (theFilename.c_str())) - { - clearSession (aSession); - return false; - } - - if (!aReader.Transfer (myDoc->ChangeDocument())) - { - clearSession (aSession); - return false; - } - - clearSession(aSession); - } - catch (const Standard_Failure& theFailure) - { - Message::SendFail (TCollection_AsciiString ("Exception raised during STEP import\n[") - + theFailure.GetMessageString() + "]\n" + theFilename.c_str()); - return false; - } - - Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool (myDoc->Document()->Main()); - Handle(XCAFDoc_ColorTool) aColorTool = XCAFDoc_DocumentTool::ColorTool (myDoc->Document()->Main()); - - TDF_LabelSequence aLabels; - aShapeTool->GetFreeShapes (aLabels); - - // perform meshing explicitly - TopoDS_Compound aCompound; - BRep_Builder aBuildTool; - aBuildTool.MakeCompound (aCompound); - for (Standard_Integer aLabIter = 1; aLabIter <= aLabels.Length(); ++aLabIter) - { - TopoDS_Shape aShape; - const TDF_Label& aLabel = aLabels.Value (aLabIter); - if (XCAFDoc_ShapeTool::GetShape (aLabel, aShape)) - { - aBuildTool.Add (aCompound, aShape); - } - } - - Handle(Prs3d_Drawer) aDrawer = myContext->DefaultDrawer(); - Standard_Real aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection (aCompound, aDrawer); - if (!BRepTools::Triangulation (aCompound, aDeflection)) - { - BRepMesh_IncrementalMesh anAlgo; - anAlgo.ChangeParameters().Deflection = aDeflection; - anAlgo.ChangeParameters().Angle = aDrawer->DeviationAngle(); - anAlgo.ChangeParameters().InParallel = Standard_True; - anAlgo.SetShape (aCompound); - anAlgo.Perform(); - } - - // clear presentations - clearContext(); - - // create presentations - MapOfPrsForShapes aMapOfShapes; - XCAFPrs_Style aDefStyle; - aDefStyle.SetColorSurf (Quantity_NOC_GRAY65); - aDefStyle.SetColorCurv (Quantity_NOC_GRAY65); - for (Standard_Integer aLabIter = 1; aLabIter <= aLabels.Length(); ++aLabIter) - { - const TDF_Label& aLabel = aLabels.Value (aLabIter); - displayWithChildren (*aShapeTool, *aColorTool, aLabel, TopLoc_Location(), aDefStyle, "", aMapOfShapes); - } - - return true; -} - -// ======================================================================= -// function : displayWithChildren -// purpose : -// ======================================================================= -void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool& theShapeTool, - XCAFDoc_ColorTool& theColorTool, - const TDF_Label& theLabel, - const TopLoc_Location& theParentTrsf, - const XCAFPrs_Style& theParentStyle, - const TCollection_AsciiString& theParentId, - MapOfPrsForShapes& theMapOfShapes) -{ - TDF_Label aRefLabel = theLabel; - if (theShapeTool.IsReference (theLabel)) - { - theShapeTool.GetReferredShape (theLabel, aRefLabel); - } - - TCollection_AsciiString anEntry; - TDF_Tool::Entry (theLabel, anEntry); - if (!theParentId.IsEmpty()) - { - anEntry = theParentId + "\n" + anEntry; - } - anEntry += "."; - - if (!theShapeTool.IsAssembly (aRefLabel)) - { - Handle(AIS_InteractiveObject) anAis; - if (!theMapOfShapes.Find (aRefLabel, anAis)) - { - anAis = new CafShapePrs (aRefLabel, theParentStyle, Graphic3d_NameOfMaterial_ShinyPlastified); - theMapOfShapes.Bind (aRefLabel, anAis); - } - - Handle(TCollection_HAsciiString) anId = new TCollection_HAsciiString (anEntry); - Handle(AIS_ConnectedInteractive) aConnected = new AIS_ConnectedInteractive(); - aConnected->Connect (anAis, theParentTrsf.Transformation()); - aConnected->SetOwner (anId); - aConnected->SetLocalTransformation (theParentTrsf.Transformation()); - aConnected->SetHilightMode(1); - myContext->Display (aConnected, Standard_False); - return; - } - - XCAFPrs_Style aDefStyle = theParentStyle; - Quantity_Color aColor; - if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorGen, aColor)) - { - aDefStyle.SetColorCurv (aColor); - aDefStyle.SetColorSurf (aColor); - } - if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorSurf, aColor)) - { - aDefStyle.SetColorSurf (aColor); - } - if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorCurv, aColor)) - { - aDefStyle.SetColorCurv (aColor); - } - - for (TDF_ChildIterator childIter (aRefLabel); childIter.More(); childIter.Next()) - { - TDF_Label aLabel = childIter.Value(); - if (!aLabel.IsNull() - && (aLabel.HasAttribute() || aLabel.HasChild())) - { - TopLoc_Location aTrsf = theParentTrsf * theShapeTool.GetLocation (aLabel); - displayWithChildren (theShapeTool, theColorTool, aLabel, aTrsf, aDefStyle, anEntry, theMapOfShapes); - } - } -} - -// ======================================================================= -// function : clearSession -// purpose : -// ======================================================================= -void OcctViewer::clearSession (const Handle(XSControl_WorkSession)& theSession) -{ - if (theSession.IsNull()) - { - return; - } - - Handle(Transfer_TransientProcess) aMapReader = theSession->TransferReader()->TransientProcess(); - if (!aMapReader.IsNull()) - { - aMapReader->Clear(); - } - - Handle(XSControl_TransferReader) aTransferReader = theSession->TransferReader(); - if (!aTransferReader.IsNull()) - { - aTransferReader->Clear(1); - } -} - -// ======================================================================= -// function : clearContext -// purpose : -// ======================================================================= -void OcctViewer::clearContext() -{ - if (!myContext.IsNull()) - { - myContext->ClearSelected(Standard_False); - myContext->RemoveAll(Standard_False); - } -} diff --git a/samples/ios/UIKitSample/UIKitSample/ViewController.h b/samples/ios/UIKitSample/UIKitSample/ViewController.h deleted file mode 100644 index 004fc808ee..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/ViewController.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2016 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import - -@interface ViewController : UIViewController - -@end diff --git a/samples/ios/UIKitSample/UIKitSample/ViewController.m b/samples/ios/UIKitSample/UIKitSample/ViewController.m deleted file mode 100644 index e019f32f05..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/ViewController.m +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2016 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import "ViewController.h" - -#include "OcctViewer.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -@end diff --git a/samples/ios/UIKitSample/UIKitSample/main.mm b/samples/ios/UIKitSample/UIKitSample/main.mm deleted file mode 100644 index 7e27d76391..0000000000 --- a/samples/ios/UIKitSample/UIKitSample/main.mm +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2017 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#import - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool - { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/samples/ios/UIKitSample/images/sample_ios_uikit.png b/samples/ios/UIKitSample/images/sample_ios_uikit.png deleted file mode 100644 index 703e8e5e4f..0000000000 Binary files a/samples/ios/UIKitSample/images/sample_ios_uikit.png and /dev/null differ diff --git a/samples/java/jniviewer/.gitattributes b/samples/java/jniviewer/.gitattributes deleted file mode 100644 index c275dc2521..0000000000 --- a/samples/java/jniviewer/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.gradle eol=lf diff --git a/samples/java/jniviewer/.gitignore b/samples/java/jniviewer/.gitignore deleted file mode 100644 index 3328b0f384..0000000000 --- a/samples/java/jniviewer/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/.gradle -/.idea -/build -/gradle -gradlew -gradlew.bat -/app/.cxx -/app/build -gradle.properties -local.properties diff --git a/samples/java/jniviewer/ReadMe.md b/samples/java/jniviewer/ReadMe.md deleted file mode 100644 index d74dd7c4af..0000000000 --- a/samples/java/jniviewer/ReadMe.md +++ /dev/null @@ -1,45 +0,0 @@ -Android: 3D Viewer (Java|C++|Android SDK|JNI) {#samples_java_android_occt} -================== - -This sample demonstrates simple way of using OCCT libraries in Android application written using Java. -The sample could be found within OCCT repository in folder `/samples/java/jniviewer/`. - -The connection between Java and OCCT (C++) level is provided by proxy library, libTKJniSample.so, written in C++ with exported JNI methods of Java class OcctJniRenderer. -The proxy library contains single C++ class OcctJni_Viewer encapsulating OCCT viewer and providing functionality to manipulate this viewer -and to import OCCT shapes from several supported formats of CAD files (IGES, STEP, BREP). - -This sample demonstrates indirect method of wrapping C++ to Java using manually created proxy library. -Alternative method is available, wrapping individual OCCT classes to Java equivalents so that their full API is available to Java user -and the code can be programmed on Java level similarly to C++ one. -See description of OCCT Java Wrapper in Advanced Samples and Tools on OCCT web site at -https://www.opencascade.com/content/advanced-samples-and-tools - -@figure{samples_java_android_occt.jpg} - -Install Android Studio 4.0+ and install building tools (check Tools -> SDK Manager): -- Android SDK (API level 21 or higher). -- Android SDK build tools. -- Android NDK r16 or higher (coming with CMake toolchain). - Using NDK r18 or newer will require changing ANDROID_STL in project settings. -- CMake 3.10+. - -Specify this folder location in Android Studio for opening project. -You might need re-entering Android SDK explicitly in File -> Project Structure -> SDK Location settings (SDK, NDK, JDK locations). - -This sample expects OCCT to be already build - please refer to appropriate CMake building instructions in OCCT documentation. -The following variables should be added into file gradle.properties (see gradle.properties.template as template): -- `OCCT_ROOT` - path to OCCT installation folder. -- `FREETYPE_ROOT` - path to FreeType installation folder. - -FreeImage is optional and does not required for this sample, however you should include all extra libraries used for OCCT building -and load the explicitly from Java code within OcctJniActivity::loadNatives() method, including toolkits from OCCT itself in proper order: -~~~~ - if (!loadLibVerbose ("TKernel", aLoaded, aFailed) - || !loadLibVerbose ("TKMath", aLoaded, aFailed) - || !loadLibVerbose ("TKG2d", aLoaded, aFailed) -~~~~ -Note that C++ STL library is not part of Android system, and application must package this library as well as extra component ("gnustl_shared" by default - see also `ANDROID_STL`). - -After successful build via Build -> Rebuild Project, the application can be packaged to Android: -- Deploy and run application on connected device or emulator directly from Android Studio using adb interface by menu items "Run" and "Debug". This would sign package with debug certificate. -- Prepare signed end-user package using wizard Build -> Generate signed APK. diff --git a/samples/java/jniviewer/app/build.gradle b/samples/java/jniviewer/app/build.gradle deleted file mode 100644 index 10014ce9ac..0000000000 --- a/samples/java/jniviewer/app/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 21 - buildToolsVersion "30.0.0" - - defaultConfig { - applicationId "com.opencascade.jnisample" - minSdkVersion 21 - targetSdkVersion 26 - - ndk { - abiFilters "arm64-v8a" - } - - externalNativeBuild { - cmake { - arguments "-DOCCT_ROOT=" + OCCT_ROOT, - "-DFREETYPE_ROOT=" + FREETYPE_ROOT, - "-DANDROID_STL=gnustl_shared" - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - } - } - - sourceSets { - main { - manifest.srcFile 'src/main/AndroidManifest.xml' - assets.srcDirs = [OCCT_ROOT + "/src"] - } - } - - externalNativeBuild { - cmake { - path "src/main/jni/CMakeLists.txt" - } - } -} - -dependencies { - implementation fileTree(dir: 'java/com/opencascade/jnisample', include: ['*.jar']) -} diff --git a/samples/java/jniviewer/app/src/main/AndroidManifest.xml b/samples/java/jniviewer/app/src/main/AndroidManifest.xml deleted file mode 100644 index 4813d0a6d1..0000000000 --- a/samples/java/jniviewer/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniActivity.java b/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniActivity.java deleted file mode 100644 index d75708abfa..0000000000 --- a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniActivity.java +++ /dev/null @@ -1,861 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -package com.opencascade.jnisample; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.List; - -import android.app.Activity; -import android.content.Context; - -import android.content.Intent; -import android.content.res.AssetManager; -import android.content.res.Configuration; -import android.content.res.Resources; -import android.graphics.Point; -import android.graphics.drawable.Drawable; -import android.net.Uri; -import android.os.Bundle; -import android.os.Environment; - -import android.text.Html; -import android.text.Html.ImageGetter; -import android.text.Spanned; -import android.util.TypedValue; -import android.view.Display; -import android.view.Gravity; -import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.widget.ImageButton; -import android.widget.LinearLayout; -import android.view.ViewGroup.LayoutParams; -import android.widget.TextView; -import android.widget.Toast; - -//! Main activity -public class OcctJniActivity extends Activity implements OnClickListener -{ - - //! Auxiliary method to print temporary info messages - public static void printShortInfo (Activity theActivity, - CharSequence theInfo) - { - Context aCtx = theActivity.getApplicationContext(); - Toast aToast = Toast.makeText (aCtx, theInfo, Toast.LENGTH_LONG); - aToast.show(); - } - - //! Load single native library - private static boolean loadLibVerbose (String theLibName, - StringBuilder theLoadedInfo, - StringBuilder theFailedInfo) - { - try - { - System.loadLibrary (theLibName); - theLoadedInfo.append ("Info: native library \""); - theLoadedInfo.append (theLibName); - theLoadedInfo.append ("\" has been loaded\n"); - return true; - } - catch (java.lang.UnsatisfiedLinkError theError) - { - theFailedInfo.append ("Error: native library \""); - theFailedInfo.append (theLibName); - theFailedInfo.append ("\" is unavailable:\n " + theError.getMessage()); - return false; - } - catch (SecurityException theError) - { - theFailedInfo.append ("Error: native library \""); - theFailedInfo.append (theLibName); - theFailedInfo.append ("\" can not be loaded for security reasons:\n " + theError.getMessage()); - return false; - } - } - - public static boolean wasNativesLoadCalled = false; - public static boolean areNativeLoaded = false; - public static String nativeLoaded = ""; - public static String nativeFailed = ""; - - //! Auxiliary method to load native libraries - public boolean loadNatives() - { - if (wasNativesLoadCalled) - { - return areNativeLoaded; - } - wasNativesLoadCalled = true; - StringBuilder aLoaded = new StringBuilder(); - StringBuilder aFailed = new StringBuilder(); - - // copy OCCT resources - String aResFolder = getFilesDir().getAbsolutePath(); - copyAssetFolder (getAssets(), "src/SHMessage", aResFolder + "/SHMessage"); - copyAssetFolder (getAssets(), "src/XSMessage", aResFolder + "/XSMessage"); - - // C++ runtime - loadLibVerbose ("gnustl_shared", aLoaded, aFailed); - - // 3rd-parties - loadLibVerbose ("freetype", aLoaded, aFailed); - loadLibVerbose ("freeimage", aLoaded, aFailed); - - if (// OCCT modeling - !loadLibVerbose ("TKernel", aLoaded, aFailed) - || !loadLibVerbose ("TKMath", aLoaded, aFailed) - || !loadLibVerbose ("TKG2d", aLoaded, aFailed) - || !loadLibVerbose ("TKG3d", aLoaded, aFailed) - || !loadLibVerbose ("TKGeomBase", aLoaded, aFailed) - || !loadLibVerbose ("TKBRep", aLoaded, aFailed) - || !loadLibVerbose ("TKGeomAlgo", aLoaded, aFailed) - || !loadLibVerbose ("TKTopAlgo", aLoaded, aFailed) - || !loadLibVerbose ("TKShHealing", aLoaded, aFailed) - || !loadLibVerbose ("TKMesh", aLoaded, aFailed) - // exchange - || !loadLibVerbose ("TKPrim", aLoaded, aFailed) - || !loadLibVerbose ("TKBO", aLoaded, aFailed) - || !loadLibVerbose ("TKBool", aLoaded, aFailed) - || !loadLibVerbose ("TKFillet", aLoaded, aFailed) - || !loadLibVerbose ("TKOffset", aLoaded, aFailed) - || !loadLibVerbose ("TKXSBase", aLoaded, aFailed) - || !loadLibVerbose ("TKDEIGES", aLoaded, aFailed) - || !loadLibVerbose ("TKDESTEP", aLoaded, aFailed) - // OCCT Visualization - || !loadLibVerbose ("TKService", aLoaded, aFailed) - || !loadLibVerbose ("TKHLR", aLoaded, aFailed) - || !loadLibVerbose ("TKV3d", aLoaded, aFailed) - || !loadLibVerbose ("TKOpenGles", aLoaded, aFailed) - // application code - || !loadLibVerbose ("TKJniSample", aLoaded, aFailed)) - { - nativeLoaded = aLoaded.toString(); - nativeFailed = aFailed.toString(); - areNativeLoaded = false; - //exitWithError (theActivity, "Broken apk?\n" + theFailedInfo); - return false; - } - nativeLoaded = aLoaded.toString(); - areNativeLoaded = true; - return true; - } - - //! Create activity - @Override protected void onCreate (Bundle theBundle) - { - super.onCreate (theBundle); - - boolean isLoaded = loadNatives(); - if (!isLoaded) - { - printShortInfo (this, nativeFailed); - OcctJniLogger.postMessage (nativeLoaded + "\n" + nativeFailed); - } - - setContentView (R.layout.activity_main); - - myOcctView = (OcctJniView )findViewById (R.id.custom_view); - myMessageTextView = (TextView )findViewById (R.id.message_view); - OcctJniLogger.setTextView (myMessageTextView); - - createViewAndButtons (Configuration.ORIENTATION_LANDSCAPE); - - myButtonPreferSize = defineButtonSize ((LinearLayout )findViewById (R.id.panel_menu)); - ImageButton aScrollBtn = (ImageButton )findViewById (R.id.scroll_btn); - aScrollBtn.setY (myButtonPreferSize); - aScrollBtn.setOnTouchListener (new View.OnTouchListener() - { - @Override - public boolean onTouch (View theView, MotionEvent theEvent) - { - return onScrollBtnTouch (theView, theEvent); - } - }); - - onConfigurationChanged (getResources().getConfiguration()); - - Intent anIntent = getIntent(); - Uri aDataUrl = anIntent != null ? anIntent.getData() : null; - String aDataPath = aDataUrl != null ? aDataUrl.getPath() : ""; - myOcctView.open (aDataPath); - myLastPath = aDataPath; - - myContext = new android.content.ContextWrapper (this); - myContext.getExternalFilesDir (null); - } - - //! Handle scroll events - private boolean onScrollBtnTouch (View theView, - MotionEvent theEvent) - { - switch (theEvent.getAction()) - { - case MotionEvent.ACTION_DOWN: - { - LinearLayout aPanelMenu = (LinearLayout )findViewById (R.id.panel_menu); - boolean isLandscape = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE); - if (aPanelMenu.getVisibility() == View.VISIBLE) - { - aPanelMenu.setVisibility (View.GONE); - if (!isLandscape) - { - ((ImageButton )theView).setImageResource (R.drawable.open_p); - theView.setY (0); - } - else - { - ((ImageButton )theView).setImageResource (R.drawable.open_l); - theView.setX (0); - } - } - else - { - aPanelMenu.setVisibility (View.VISIBLE); - if (!isLandscape) - { - ((ImageButton )theView).setImageResource (R.drawable.close_p); - theView.setY (myButtonPreferSize); - } - else - { - ((ImageButton )theView).setImageResource (R.drawable.close_l); - theView.setX (myButtonPreferSize); - } - } - break; - } - } - return false; - } - - //! Initialize views and buttons - private void createViewAndButtons (int theOrientation) - { - // open button - ImageButton anOpenButton = (ImageButton )findViewById (R.id.open); - anOpenButton.setOnClickListener (this); - - // fit all - ImageButton aFitAllButton = (ImageButton )findViewById (R.id.fit); - aFitAllButton.setOnClickListener (this); - aFitAllButton.setOnTouchListener (new View.OnTouchListener() - { - @Override - public boolean onTouch (View theView, MotionEvent theEvent) - { - return onTouchButton (theView, theEvent); - } - }); - - // message - ImageButton aMessageButton = (ImageButton )findViewById (R.id.message); - aMessageButton.setOnClickListener (this); - - // info - ImageButton anInfoButton = (ImageButton )findViewById (R.id.info); - anInfoButton.setOnClickListener (this); - - // font for text view - TextView anInfoView = (TextView )findViewById (R.id.info_view); - anInfoView.setTextSize (TypedValue.COMPLEX_UNIT_SP, 18); - - // add submenu buttons - createSubmenuBtn (R.id.view, R.id.view_group, - Arrays.asList (R.id.proj_front, R.id.proj_top, R.id.proj_left, - R.id.proj_back, R.id.proj_bottom, R.id.proj_right), - Arrays.asList (R.drawable.proj_front, R.drawable.proj_top, R.drawable.proj_left, - R.drawable.proj_back, R.drawable.proj_bottom, R.drawable.proj_right), - 4); - } - - @Override protected void onNewIntent (Intent theIntent) - { - super.onNewIntent (theIntent); - setIntent (theIntent); - } - - @Override protected void onDestroy() - { - super.onDestroy(); - OcctJniLogger.setTextView (null); - } - - @Override protected void onPause() - { - super.onPause(); - myOcctView.onPause(); - } - - @Override protected void onResume() - { - super.onResume(); - myOcctView.onResume(); - - Intent anIntent = getIntent(); - Uri aDataUrl = anIntent != null ? anIntent.getData() : null; - String aDataPath = aDataUrl != null ? aDataUrl.getPath() : ""; - if (!aDataPath.equals (myLastPath)) - { - myOcctView.open (aDataPath); - myLastPath = aDataPath; - } - } - - //! Copy folder from assets - private boolean copyAssetFolder (AssetManager theAssetMgr, - String theAssetFolder, - String theFolderPathTo) - { - try - { - String[] aFiles = theAssetMgr.list (theAssetFolder); - File aFolder = new File (theFolderPathTo); - aFolder.mkdirs(); - boolean isOk = true; - for (String aFileIter : aFiles) - { - if (aFileIter.contains (".")) - { - isOk &= copyAsset (theAssetMgr, - theAssetFolder + "/" + aFileIter, - theFolderPathTo + "/" + aFileIter); - } - else - { - isOk &= copyAssetFolder (theAssetMgr, - theAssetFolder + "/" + aFileIter, - theFolderPathTo + "/" + aFileIter); - } - } - return isOk; - } - catch (Exception theError) - { - theError.printStackTrace(); - return false; - } - } - - //! Copy single file from assets - private boolean copyAsset (AssetManager theAssetMgr, - String thePathFrom, - String thePathTo) - { - try - { - InputStream aStreamIn = theAssetMgr.open (thePathFrom); - File aFileTo = new File (thePathTo); - aFileTo.createNewFile(); - OutputStream aStreamOut = new FileOutputStream (thePathTo); - copyStreamContent (aStreamIn, aStreamOut); - aStreamIn.close(); - aStreamIn = null; - aStreamOut.flush(); - aStreamOut.close(); - aStreamOut = null; - return true; - } - catch (Exception theError) - { - theError.printStackTrace(); - return false; - } - } - - //! Copy single file - private static void copyStreamContent (InputStream theIn, - OutputStream theOut) throws IOException - { - byte[] aBuffer = new byte[1024]; - int aNbReadBytes = 0; - while ((aNbReadBytes = theIn.read (aBuffer)) != -1) - { - theOut.write (aBuffer, 0, aNbReadBytes); - } - } - - //! Show/hide text view - private void switchTextView (TextView theTextView, - ImageButton theClickedBtn, - boolean theToSwitchOn) - { - if (theTextView != null - && theTextView.getVisibility() == View.GONE - && theToSwitchOn) - { - theTextView.setVisibility (View.VISIBLE); - theClickedBtn.setBackgroundColor (getResources().getColor(R.color.pressedBtnColor)); - setTextViewPosition (theTextView); - } - else - { - theTextView.setVisibility (View.GONE); - theClickedBtn.setBackgroundColor (getResources().getColor (R.color.btnColor)); - } - } - - //! Setup text view position - private void setTextViewPosition (TextView theTextView) - { - if (theTextView.getVisibility() != View.VISIBLE) - { - return; - } - - if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) - { - theTextView.setX (myButtonPreferSize); - theTextView.setY (0); - } - else - { - theTextView.setX (0); - theTextView.setY (myButtonPreferSize); - } - } - - @Override - public void onClick (View theButton) - { - ImageButton aClickedBtn = (ImageButton )theButton; - switch (aClickedBtn.getId()) - { - case R.id.message: - { - switchTextView ((TextView )findViewById (R.id.info_view), - (ImageButton )findViewById (R.id.info), false); - switchTextView (myMessageTextView, aClickedBtn, true); - return; - } - case R.id.info: - { - String aText = getString (R.string.info_html); - aText = String.format (aText, cppOcctMajorVersion(), cppOcctMinorVersion(), cppOcctMicroVersion()); - Spanned aSpanned = Html.fromHtml (aText, new ImageGetter() - { - @Override - public Drawable getDrawable (String theSource) - { - Resources aResources = getResources(); - int anId = aResources.getIdentifier (theSource, "drawable", getPackageName()); - Drawable aRes = aResources.getDrawable (anId); - aRes.setBounds (0, 0, aRes.getIntrinsicWidth(), aRes.getIntrinsicHeight()); - return aRes; - } - }, null); - - TextView anInfoView = (TextView )findViewById (R.id.info_view); - anInfoView.setText (aSpanned); - switchTextView (myMessageTextView, (ImageButton ) findViewById (R.id.message), false); - switchTextView (anInfoView, aClickedBtn, true); - return; - } - case R.id.fit: - { - myOcctView.fitAll(); - return; - } - case R.id.proj_front: - { - myOcctView.setProj (OcctJniRenderer.TypeOfOrientation.Xpos); - return; - } - case R.id.proj_left: - { - myOcctView.setProj (OcctJniRenderer.TypeOfOrientation.Yneg); - return; - } - case R.id.proj_top: - { - myOcctView.setProj (OcctJniRenderer.TypeOfOrientation.Zpos); - return; - } - case R.id.proj_back: - { - myOcctView.setProj (OcctJniRenderer.TypeOfOrientation.Xneg); - return; - } - case R.id.proj_right: - { - myOcctView.setProj (OcctJniRenderer.TypeOfOrientation.Ypos); - return; - } - case R.id.proj_bottom: - { - myOcctView.setProj (OcctJniRenderer.TypeOfOrientation.Zneg); - return; - } - case R.id.open: - { - File aPath = Environment.getExternalStorageDirectory(); - aClickedBtn.setBackgroundColor (getResources().getColor(R.color.pressedBtnColor)); - if (myFileOpenDialog == null) - { - // should be requested on runtime since API level 26 (Android 8) - askUserPermission (android.Manifest.permission.WRITE_EXTERNAL_STORAGE, null); // for accessing SD card - - myFileOpenDialog = new OcctJniFileDialog (this, aPath); - myFileOpenDialog.setFileEndsWith (".brep"); - myFileOpenDialog.setFileEndsWith (".rle"); - myFileOpenDialog.setFileEndsWith (".iges"); - myFileOpenDialog.setFileEndsWith (".igs"); - myFileOpenDialog.setFileEndsWith (".step"); - myFileOpenDialog.setFileEndsWith (".stp"); - myFileOpenDialog.addFileListener (new OcctJniFileDialog.FileSelectedListener() - { - public void fileSelected (File theFile) - { - if (theFile != null && myOcctView != null) - { - myOcctView.open (theFile.getPath()); - } - } - }); - myFileOpenDialog.addDialogDismissedListener (new OcctJniFileDialog.DialogDismissedListener() - { - @Override - public void dialogDismissed() - { - ImageButton openButton = (ImageButton )findViewById (R.id.open); - openButton.setBackgroundColor (getResources().getColor(R.color.btnColor)); - } - }); - } - myFileOpenDialog.showDialog(); - return; - } - } - } - - private void createSubmenuBtn (int theParentBtnId, - int theParentLayoutId, - final List theNewButtonIds, - final List theNewButtonImageIds, - int thePosition) - { - int aPosInList = 0; - final ImageButton aParentBtn = (ImageButton )findViewById (theParentBtnId); - - ViewGroup.LayoutParams aParams = null; - LinearLayout parentLayout = (LinearLayout ) findViewById (theParentLayoutId); - for (Integer newButtonId : theNewButtonIds) - { - ImageButton aNewButton = (ImageButton )findViewById (newButtonId); - if (aNewButton == null) - { - aNewButton = (ImageButton )new ImageButton (this); - aNewButton.setId (newButtonId); - aNewButton.setImageResource (theNewButtonImageIds.get (aPosInList)); - aNewButton.setLayoutParams (aParams); - parentLayout.addView (aNewButton); - } - - aNewButton.setOnClickListener (this); - aNewButton.setVisibility (View.GONE); - - aNewButton.setOnTouchListener (new View.OnTouchListener() - { - @Override - public boolean onTouch (View theView, MotionEvent theEvent) - { - return onTouchButton (theView, theEvent); - } - }); - ++aPosInList; - } - - if (aParentBtn != null) - { - aParentBtn.setOnTouchListener (null); - aParentBtn.setOnTouchListener (new View.OnTouchListener() - { - @Override - public boolean onTouch (View theView, MotionEvent theEvent) - { - if (theEvent.getAction () == MotionEvent.ACTION_DOWN) - { - Boolean isVisible = false; - for (Integer aNewButtonId : theNewButtonIds) - { - ImageButton anBtn = (ImageButton )findViewById (aNewButtonId); - if (anBtn != null) - { - if (anBtn.getVisibility() == View.GONE) - { - anBtn.setVisibility (View.VISIBLE); - isVisible = true; - } - else - { - anBtn.setVisibility (View.GONE); - } - } - } - aParentBtn.setBackgroundColor (!isVisible ? getResources().getColor(R.color.btnColor) : getResources().getColor(R.color.pressedBtnColor)); - } - return false; - } - }); - } - } - - //! Implements onTouch functionality - private boolean onTouchButton (View theView, - MotionEvent theEvent) - { - switch (theEvent.getAction()) - { - case MotionEvent.ACTION_DOWN: - ((ImageButton )theView).setBackgroundColor (getResources().getColor (R.color.pressedBtnColor)); - break; - case MotionEvent.ACTION_UP: - ((ImageButton )theView).setBackgroundColor (getResources().getColor (R.color.btnColor)); - break; - } - return false; - } - - //! Handle configuration change event - @Override - public void onConfigurationChanged (Configuration theNewConfig) - { - super.onConfigurationChanged (theNewConfig); - LinearLayout aLayoutPanelMenu = (LinearLayout )findViewById (R.id.panel_menu); - LayoutParams aPanelMenuLayoutParams = aLayoutPanelMenu.getLayoutParams(); - - LinearLayout aLayoutViewGroup = (LinearLayout )findViewById (R.id.view_group); - LayoutParams aViewGroupLayoutParams = aLayoutViewGroup.getLayoutParams(); - ImageButton aScrollBtn = (ImageButton )findViewById (R.id.scroll_btn); - LayoutParams aScrollBtnLayoutParams = aScrollBtn.getLayoutParams(); - - myButtonPreferSize = defineButtonSize ((LinearLayout )findViewById (R.id.panel_menu)); - defineButtonSize ((LinearLayout )findViewById (R.id.view_group)); - - switch (theNewConfig.orientation) - { - case Configuration.ORIENTATION_PORTRAIT: - { - setHorizontal (aLayoutPanelMenu, aPanelMenuLayoutParams); - setHorizontal (aLayoutViewGroup, aViewGroupLayoutParams); - aLayoutViewGroup.setGravity (Gravity.BOTTOM); - - aScrollBtnLayoutParams.height = LayoutParams.WRAP_CONTENT; - aScrollBtnLayoutParams.width = LayoutParams.MATCH_PARENT; - aScrollBtn.setLayoutParams (aScrollBtnLayoutParams); - if (aLayoutPanelMenu.getVisibility() == View.VISIBLE) - { - aScrollBtn.setImageResource (R.drawable.close_p); - aScrollBtn.setY (myButtonPreferSize); - aScrollBtn.setX (0); - } - else - { - aScrollBtn.setImageResource (R.drawable.open_p); - aScrollBtn.setY (0); - aScrollBtn.setX (0); - } - break; - } - case Configuration.ORIENTATION_LANDSCAPE: - { - setVertical (aLayoutPanelMenu, aPanelMenuLayoutParams); - setVertical (aLayoutViewGroup, aViewGroupLayoutParams); - aLayoutViewGroup.setGravity (Gravity.RIGHT); - - aScrollBtnLayoutParams.height = LayoutParams.MATCH_PARENT; - aScrollBtnLayoutParams.width = LayoutParams.WRAP_CONTENT; - aScrollBtn.setLayoutParams (aScrollBtnLayoutParams); - if (aLayoutPanelMenu.getVisibility() == View.VISIBLE) - { - aScrollBtn.setImageResource (R.drawable.close_l); - aScrollBtn.setX (myButtonPreferSize); - aScrollBtn.setY (0); - } - else - { - aScrollBtn.setImageResource (R.drawable.open_l); - aScrollBtn.setY (0); - aScrollBtn.setX (0); - } - break; - } - } - setTextViewPosition (myMessageTextView); - setTextViewPosition ((TextView )findViewById (R.id.info_view)); - } - - private void setHorizontal (LinearLayout theLayout, - LayoutParams theLayoutParams) - { - theLayout.setOrientation (LinearLayout.HORIZONTAL); - theLayoutParams.height = LayoutParams.WRAP_CONTENT; - theLayoutParams.width = LayoutParams.MATCH_PARENT; - theLayout.setLayoutParams (theLayoutParams); - } - - private void setVertical (LinearLayout theLayout, - LayoutParams theLayoutParams) - { - theLayout.setOrientation (LinearLayout.VERTICAL); - theLayoutParams.height = LayoutParams.MATCH_PARENT; - theLayoutParams.width = LayoutParams.WRAP_CONTENT; - theLayout.setLayoutParams (theLayoutParams); - } - - //! Define button size - private int defineButtonSize (LinearLayout theLayout) - { - boolean isLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; - Display aDisplay = getWindowManager().getDefaultDisplay(); - Point aDispPnt = new Point(); - aDisplay.getSize (aDispPnt); - - int aNbChildren = theLayout.getChildCount(); - int aHeight = aDispPnt.y / aNbChildren; - int aWidth = aDispPnt.x / aNbChildren; - int aResultSize = 0; - for (int aChildIter = 0; aChildIter < aNbChildren; ++aChildIter) - { - View aView = theLayout.getChildAt (aChildIter); - if (aView instanceof ImageButton) - { - ImageButton aButton = (ImageButton )aView; - if (isLandscape) - { - aButton.setMinimumWidth (aHeight); - } - else - { - aButton.setMinimumHeight (aWidth); - } - } - } - if (isLandscape) - { - aResultSize = aHeight; - } - else - { - aResultSize = aWidth; - } - return aResultSize; - } - - //! Request user permission. - private void askUserPermission (String thePermission, String theRationale) - { - // Dynamically load methods introduced by API level 23. - // On older system this permission is granted by user during application installation. - java.lang.reflect.Method aMetPtrCheckSelfPermission, aMetPtrRequestPermissions, aMetPtrShouldShowRequestPermissionRationale; - try - { - aMetPtrCheckSelfPermission = myContext.getClass().getMethod ("checkSelfPermission", String.class); - aMetPtrRequestPermissions = getClass().getMethod ("requestPermissions", String[].class, int.class); - aMetPtrShouldShowRequestPermissionRationale = getClass().getMethod ("shouldShowRequestPermissionRationale", String.class); - } - catch (SecurityException theError) - { - postMessage ("Unable to find permission methods:\n" + theError.getMessage(), Message_Trace); - return; - } - catch (NoSuchMethodException theError) - { - postMessage ("Unable to find permission methods:\n" + theError.getMessage(), Message_Trace); - return; - } - - try - { - int isAlreadyGranted = (Integer )aMetPtrCheckSelfPermission.invoke (myContext, thePermission); - if (isAlreadyGranted == android.content.pm.PackageManager.PERMISSION_GRANTED) - { - return; - } - - boolean toShowInfo = theRationale != null && (Boolean )aMetPtrShouldShowRequestPermissionRationale.invoke (this, thePermission); - if (toShowInfo) - { - postMessage (theRationale, Message_Info); - } - - // show dialog to user - aMetPtrRequestPermissions.invoke (this, new String[]{thePermission}, 0); - } - catch (IllegalArgumentException theError) - { - postMessage ("Internal error: Unable to call permission method:\n" + theError.getMessage(), Message_Fail); - return; - } - catch (IllegalAccessException theError) - { - postMessage ("Internal error: Unable to call permission method:\n" + theError.getMessage(), Message_Fail); - return; - } - catch (java.lang.reflect.InvocationTargetException theError) - { - postMessage ("Internal error: Unable to call permission method:\n" + theError.getMessage(), Message_Fail); - return; - } - } - - //! Message gravity. - private static final int Message_Trace = 0; - private static final int Message_Info = 1; - private static final int Message_Warning = 2; - private static final int Message_Alarm = 3; - private static final int Message_Fail = 4; - - //! Auxiliary method to show info message. - public void postMessage (String theMessage, int theGravity) - { - if (theGravity == Message_Trace) - { - return; - } - - final String aText = theMessage; - final Context aCtx = this; - this.runOnUiThread (new Runnable() { public void run() { - android.app.AlertDialog.Builder aBuilder = new android.app.AlertDialog.Builder (aCtx); - aBuilder.setMessage (aText).setNegativeButton ("OK", null); - android.app.AlertDialog aDialog = aBuilder.create(); - aDialog.show(); - }}); - } - - //! OCCT major version - private native long cppOcctMajorVersion(); - - //! OCCT minor version - private native long cppOcctMinorVersion(); - - //! OCCT micro version - private native long cppOcctMicroVersion(); - - private OcctJniView myOcctView; - private TextView myMessageTextView; - private String myLastPath; - private android.content.ContextWrapper myContext = null; - private OcctJniFileDialog myFileOpenDialog; - private int myButtonPreferSize = 65; - -} diff --git a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniFileDialog.java b/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniFileDialog.java deleted file mode 100644 index e12cc1aa2b..0000000000 --- a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniFileDialog.java +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -package com.opencascade.jnisample; - -import java.io.File; -import java.io.FilenameFilter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.opencascade.jnisample.ListenerList.FireHandler; - -import android.app.Activity; -import android.app.AlertDialog; -import android.app.Dialog; -import android.content.DialogInterface; -import android.graphics.Color; -import android.os.Environment; -import android.view.View; -import android.view.ViewGroup.LayoutParams; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.LinearLayout; -import android.widget.ListView; -import android.widget.Spinner; - -//! Simple open file dialog -public class OcctJniFileDialog -{ - - public enum DialogMode - { - FileOpen, FileExport, FileSave - } - - private static final String PARENT_DIR = ".."; - private String[] myFileList; - private File myCurrentPath; - private DialogMode myDialogMode = DialogMode.FileOpen; - - private ListenerList myFileListenerList = new ListenerList(); - private ListenerList myDialogDismissedList = new ListenerList(); - private final Activity myActivity; - private List myFileEndsWith; - private EditText myFileNameInput; - private Spinner myFileExtSpinner; - int myCurrentExtPositionInList = 0; - - public interface FileSelectedListener - { - void fileSelected (File theFile); - } - - public interface DialogDismissedListener - { - void dialogDismissed(); - } - - //! Main constructor. - public OcctJniFileDialog (Activity theActivity, - File thePath) - { - myActivity = theActivity; - if (!thePath.exists()) - { - thePath = Environment.getExternalStorageDirectory(); - } - loadFileList (thePath); - } - - //! Create new dialog - public Dialog createFileDialog() - { - final Object[] anObjWrapper = new Object[1]; - Dialog aDialog = null; - AlertDialog.Builder aBuilder = new AlertDialog.Builder (myActivity); - - aBuilder.setTitle (myCurrentPath.getPath()); - LinearLayout aTitleLayout = new LinearLayout (myActivity); - aTitleLayout.setLayoutParams (new LinearLayout.LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); - aTitleLayout.setOrientation (LinearLayout.VERTICAL); - - ListView list = new ListView (myActivity); - list.setScrollingCacheEnabled(false); - list.setBackgroundColor (Color.parseColor ("#33B5E5")); - - list.setAdapter (new ArrayAdapter (myActivity, android.R.layout.select_dialog_item, myFileList)); - list.setOnItemClickListener (new AdapterView.OnItemClickListener () - { - - public void onItemClick (AdapterView arg0, View view, int pos, long id) - { - String fileChosen = myFileList[pos]; - File aChosenFile = getChosenFile (fileChosen); - if (aChosenFile.isDirectory()) - { - loadFileList (aChosenFile); - ((Dialog )anObjWrapper[0]).cancel(); - ((Dialog )anObjWrapper[0]).dismiss(); - showDialog(); - } - else - { - if (myDialogMode == DialogMode.FileOpen) - { - ((Dialog )anObjWrapper[0]).cancel(); - ((Dialog )anObjWrapper[0]).dismiss(); - fireFileSelectedEvent (aChosenFile); - } - else - { - myFileNameInput.setText (aChosenFile.getName()); - } - } - } - }); - list.setLayoutParams (new LinearLayout.LayoutParams (LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 0.6f)); - aTitleLayout.addView (list); - - if (myDialogMode == DialogMode.FileSave - || myDialogMode == DialogMode.FileExport) - { - myFileNameInput = new EditText (myActivity); - myFileExtSpinner = new Spinner (myActivity); - ArrayAdapter adapter = null; - if (myDialogMode == DialogMode.FileExport) - { - adapter = ArrayAdapter.createFromResource (myActivity, R.array.ext_to_exp, - android.R.layout.simple_spinner_item); - } - else - { - adapter = ArrayAdapter.createFromResource (myActivity, R.array.ext_to_save, - android.R.layout.simple_spinner_item); - } - // Specify the layout to use when the list of choices appears - adapter.setDropDownViewResource (android.R.layout.simple_spinner_dropdown_item); - // Apply the adapter to the spinner - myFileExtSpinner.setAdapter (adapter); - myFileExtSpinner.setSelection (myCurrentExtPositionInList); - - myFileExtSpinner.setOnItemSelectedListener (new AdapterView.OnItemSelectedListener() - { - - @Override - public void onNothingSelected (AdapterView theParentView) - { - // your code here - } - - @Override - public void onItemSelected (AdapterView theParent, View theView, int thePosition, long theId) - { - if (myCurrentExtPositionInList != thePosition) - { - myCurrentExtPositionInList = thePosition; - setFileEndsWith (Arrays.asList (myFileExtSpinner.getSelectedItem().toString())); - loadFileList (myCurrentPath); - ((Dialog )anObjWrapper[0]).cancel(); - ((Dialog )anObjWrapper[0]).dismiss(); - showDialog(); - } - } - }); - - myFileExtSpinner.setLayoutParams (new LinearLayout.LayoutParams (LayoutParams.MATCH_PARENT, - LayoutParams.WRAP_CONTENT, 0.2f)); - // titleLayout.addView(fileExtSpinner); - myFileNameInput.setLayoutParams (new LinearLayout.LayoutParams (LayoutParams.MATCH_PARENT, - LayoutParams.WRAP_CONTENT, 0.2f)); - LinearLayout aControlsView = new LinearLayout (myActivity); - - aControlsView.addView (myFileNameInput); - aControlsView.addView (myFileExtSpinner); - - aTitleLayout.addView (aControlsView); - aBuilder.setView (aTitleLayout); - aBuilder.setPositiveButton ("OK", new DialogInterface.OnClickListener() - { - @Override - public void onClick (DialogInterface theDialog, int theWhich) - { - if (theWhich >= 0) - { - String aFileChosen = myFileList[theWhich]; - File aChosenFile = getChosenFile (aFileChosen); - fireFileSelectedEvent (aChosenFile); - } - } - }).setNegativeButton ("Cancel", null); - } - else - { - aBuilder.setNegativeButton ("Cancel", null); - } - - aBuilder.setView (aTitleLayout); - - aDialog = aBuilder.show(); - aDialog.setOnDismissListener (new DialogInterface.OnDismissListener() - { - @Override - public void onDismiss (DialogInterface theDialog) - { - fireDialogDismissedEvent(); - } - }); - anObjWrapper[0] = aDialog; - return aDialog; - } - - public void addFileListener (FileSelectedListener theListener) - { - myFileListenerList.add (theListener); - } - - public void addDialogDismissedListener (DialogDismissedListener theListener) - { - myDialogDismissedList.add (theListener); - } - - //! Show file dialog - public void showDialog() - { - createFileDialog().show(); - } - - private void fireFileSelectedEvent (final File theFile) - { - myFileListenerList.fireEvent (new FireHandler() - { - public void fireEvent (FileSelectedListener theListener) - { - theListener.fileSelected (theFile); - } - }); - } - - private void fireDialogDismissedEvent() - { - myDialogDismissedList.fireEvent (new FireHandler() - { - public void fireEvent (DialogDismissedListener theListener) - { - theListener.dialogDismissed(); - } - }); - } - - private void loadFileList (File thePath) - { - myCurrentPath = thePath; - List aList = new ArrayList(); - if (thePath.exists()) - { - if (thePath.getParentFile() != null) - { - aList.add (PARENT_DIR); - } - FilenameFilter aFilter = new FilenameFilter() - { - public boolean accept (File theDir, String theFilename) - { - File aSel = new File (theDir, theFilename); - if (!aSel.canRead()) - { - return false; - } - boolean isEndWith = false; - if (myFileEndsWith != null) - { - for (String aFileExtIter : myFileEndsWith) - { - if (theFilename.toLowerCase().endsWith (aFileExtIter)) - { - isEndWith = true; - break; - } - } - } - return isEndWith || aSel.isDirectory(); - } - }; - String[] aFileList1 = thePath.list (aFilter); - if (aFileList1 != null) - { - for (String aFileIter : aFileList1) - { - aList.add (aFileIter); - } - } - } - myFileList = (String[] )aList.toArray (new String[] {}); - } - - private File getChosenFile (String theFileChosen) - { - if (theFileChosen.equals (PARENT_DIR)) - return myCurrentPath.getParentFile(); - else - return new File (myCurrentPath, theFileChosen); - } - - public void setFileEndsWith (String fileEndsWith) - { - if (myFileEndsWith == null) - { - myFileEndsWith = new ArrayList(); - } - if (myFileEndsWith.indexOf (fileEndsWith) == -1) - { - myFileEndsWith.add (fileEndsWith); - } - } - - public void setFileEndsWith (List theFileEndsWith) - { - myFileEndsWith = theFileEndsWith; - } - - public DialogMode DialogMode() - { - return myDialogMode; - } - - public void DialogMode (DialogMode theMode) - { - myDialogMode = theMode; - } -} - -class ListenerList -{ - private List myListenerList = new ArrayList(); - - public interface FireHandler - { - void fireEvent (L theListener); - } - - public void add (L theListener) - { - myListenerList.add (theListener); - } - - public void fireEvent (FireHandler theFireHandler) - { - List aCopy = new ArrayList (myListenerList); - for (L anIter : aCopy) - { - theFireHandler.fireEvent (anIter); - } - } - - public void remove (L theListener) - { - myListenerList.remove (theListener); - } - - public List getListenerList() - { - return myListenerList; - } -} diff --git a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniLogger.java b/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniLogger.java deleted file mode 100644 index cc8b1e4942..0000000000 --- a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniLogger.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -package com.opencascade.jnisample; - -import java.util.concurrent.locks.ReentrantLock; - -import android.util.Log; -import android.widget.TextView; - -//! Auxiliary class for logging messages -public class OcctJniLogger -{ - - //! Setup text view - public static void setTextView (TextView theTextView) - { - if (myTextView != null) - { - myLog = myTextView.getText().toString(); - } - - myTextView = theTextView; - if (myTextView != null) - { - myTextView.setText (myLog); - myLog = ""; - } - } - - //! Interface implementation - public static void postMessage (String theText) - { - final String aCopy = new String (theText); - Log.e (myTag, theText); - - myMutex.lock(); - final TextView aView = myTextView; - if (aView == null) - { - myLog += aCopy; - myMutex.unlock(); - return; - } - - aView.post (new Runnable() - { - public void run() - { - aView.setText (aView.getText() + aCopy + "\n"); - } - }); - myMutex.unlock(); - } - - private static final String myTag = "occtJniViewer"; - private static final ReentrantLock myMutex = new ReentrantLock (true); - private static TextView myTextView = null; - private static String myLog = ""; - -} diff --git a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniRenderer.java b/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniRenderer.java deleted file mode 100644 index 66e6e82a0e..0000000000 --- a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniRenderer.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -package com.opencascade.jnisample; - -import javax.microedition.khronos.egl.EGLConfig; -import javax.microedition.khronos.opengles.GL10; - -import android.opengl.GLSurfaceView; - -//! Wrapper for C++ OCCT viewer. -public class OcctJniRenderer implements GLSurfaceView.Renderer -{ - - //! Wrapper for V3d_TypeOfOrientation - enum TypeOfOrientation - { - Xpos, // front - Ypos, // left - Zpos, // top - Xneg, // back - Yneg, // right - Zneg // bottom - }; - - //! Empty constructor. - OcctJniRenderer (GLSurfaceView theView, - float theScreenDensity) - { - myView = theView; // this makes cyclic dependency, but it is OK for JVM - if (OcctJniActivity.areNativeLoaded) - { - myCppViewer = cppCreate (theScreenDensity); - } - } - - //! Open file. - public void open (String thePath) - { - if (myCppViewer != 0) - { - cppOpen (myCppViewer, thePath); - } - } - - //! Update viewer. - public void onDrawFrame (GL10 theGl) - { - if (myCppViewer != 0) - { - if (cppRedraw (myCppViewer)) - { - myView.requestRender(); // this method is allowed from any thread - } - } - } - - //! (re)initialize viewer. - public void onSurfaceChanged (GL10 theGl, int theWidth, int theHeight) - { - if (myCppViewer != 0) - { - cppResize (myCppViewer, theWidth, theHeight); - } - } - - public void onSurfaceCreated (GL10 theGl, EGLConfig theEglConfig) - { - if (myCppViewer != 0) - { - cppInit (myCppViewer); - } - } - - //! Add touch point. - public void onAddTouchPoint (int theId, float theX, float theY) - { - if (myCppViewer != 0) - { - cppAddTouchPoint (myCppViewer, theId, theX, theY); - } - } - - //! Update touch point. - public void onUpdateTouchPoint (int theId, float theX, float theY) - { - if (myCppViewer != 0) - { - cppUpdateTouchPoint (myCppViewer, theId, theX, theY); - } - } - - //! Remove touch point. - public void onRemoveTouchPoint (int theId) - { - if (myCppViewer != 0) - { - cppRemoveTouchPoint (myCppViewer, theId); - } - } - - //! Select in 3D Viewer. - public void onSelectInViewer (float theX, float theY) - { - if (myCppViewer != 0) - { - cppSelectInViewer (myCppViewer, theX, theY); - } - } - - //! Fit All - public void fitAll() - { - if (myCppViewer != 0) - { - cppFitAll (myCppViewer); - } - } - - //! Move camera - public void setProj (TypeOfOrientation theProj) - { - if (myCppViewer == 0) - { - return; - } - - switch (theProj) - { - case Xpos: cppSetXposProj (myCppViewer); break; - case Ypos: cppSetYposProj (myCppViewer); break; - case Zpos: cppSetZposProj (myCppViewer); break; - case Xneg: cppSetXnegProj (myCppViewer); break; - case Yneg: cppSetYnegProj (myCppViewer); break; - case Zneg: cppSetZnegProj (myCppViewer); break; - } - } - - //! Post message to the text view. - public void postMessage (String theText) - { - OcctJniLogger.postMessage (theText); - } - - //! Create instance of C++ class - private native long cppCreate (float theDispDensity); - - //! Destroy instance of C++ class - private native void cppDestroy (long theCppPtr); - - //! Initialize OCCT viewer (steal OpenGL ES context bound to this thread) - private native void cppInit (long theCppPtr); - - //! Resize OCCT viewer - private native void cppResize (long theCppPtr, int theWidth, int theHeight); - - //! Open CAD file - private native void cppOpen (long theCppPtr, String thePath); - - //! Add touch point - private native void cppAddTouchPoint (long theCppPtr, int theId, float theX, float theY); - - //! Update touch point - private native void cppUpdateTouchPoint (long theCppPtr, int theId, float theX, float theY); - - //! Remove touch point - private native void cppRemoveTouchPoint (long theCppPtr, int theId); - - //! Select in 3D Viewer. - private native void cppSelectInViewer (long theCppPtr, float theX, float theY); - - //! Redraw OCCT viewer - //! Returns TRUE if more frames are requested. - private native boolean cppRedraw (long theCppPtr); - - //! Fit All - private native void cppFitAll (long theCppPtr); - - //! Move camera - private native void cppSetXposProj (long theCppPtr); - - //! Move camera - private native void cppSetYposProj (long theCppPtr); - - //! Move camera - private native void cppSetZposProj (long theCppPtr); - - //! Move camera - private native void cppSetXnegProj (long theCppPtr); - - //! Move camera - private native void cppSetYnegProj (long theCppPtr); - - //! Move camera - private native void cppSetZnegProj (long theCppPtr); - - private GLSurfaceView myView = null; //!< back reference to the View - private long myCppViewer = 0; //!< pointer to c++ class instance - -} diff --git a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniView.java b/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniView.java deleted file mode 100644 index 51e9b5dd1a..0000000000 --- a/samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniView.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -package com.opencascade.jnisample; - -import android.app.ActionBar.LayoutParams; -import android.content.Context; -import android.graphics.PointF; -import android.opengl.GLSurfaceView; -import android.util.AttributeSet; -import android.util.SparseArray; -import android.view.MotionEvent; -import android.widget.RelativeLayout; - -import javax.microedition.khronos.egl.EGL10; -import javax.microedition.khronos.egl.EGLConfig; -import javax.microedition.khronos.egl.EGLContext; -import javax.microedition.khronos.egl.EGLDisplay; - -//! OpenGL ES 2.0+ view. -//! Performs rendering in parallel thread. -class OcctJniView extends GLSurfaceView -{ - - // ! Default constructor. - public OcctJniView (Context theContext, - AttributeSet theAttrs) - { - super (theContext, theAttrs); - - android.util.DisplayMetrics aDispInfo = theContext.getResources().getDisplayMetrics(); - myScreenDensity = aDispInfo.density; - - setPreserveEGLContextOnPause (true); - setEGLContextFactory (new ContextFactory()); - setEGLConfigChooser (new ConfigChooser()); - - RelativeLayout.LayoutParams aLParams = new RelativeLayout.LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); - aLParams.addRule (RelativeLayout.ALIGN_TOP); - - myRenderer = new OcctJniRenderer (this, myScreenDensity); - setRenderer (myRenderer); - setRenderMode (GLSurfaceView.RENDERMODE_WHEN_DIRTY); // render on request to spare battery - } - - //! Open file. - public void open (String thePath) - { - final String aPath = thePath; - queueEvent (new Runnable() { public void run() { myRenderer.open (aPath); }}); - requestRender(); - } - - //! Create OpenGL ES 2.0+ context - private static class ContextFactory implements GLSurfaceView.EGLContextFactory - { - private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; - public EGLContext createContext (EGL10 theEgl, - EGLDisplay theEglDisplay, - EGLConfig theEglConfig) - { - if (theEglConfig == null) - { - return null; - } - - // reset EGL errors stack - int anError = EGL10.EGL_SUCCESS; - while ((anError = theEgl.eglGetError()) != EGL10.EGL_SUCCESS) {} - - int[] anAttribs = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; - EGLContext aEglContext = theEgl.eglCreateContext (theEglDisplay, theEglConfig, EGL10.EGL_NO_CONTEXT, anAttribs); - - while ((anError = theEgl.eglGetError()) != EGL10.EGL_SUCCESS) - { - OcctJniLogger.postMessage ("Error: eglCreateContext() " + String.format ("0x%x", anError)); - } - return aEglContext; - } - - public void destroyContext (EGL10 theEgl, - EGLDisplay theEglDisplay, - EGLContext theEglContext) - { - theEgl.eglDestroyContext (theEglDisplay, theEglContext); - } - } - - //! Search for RGB24 config with depth and stencil buffers - private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser - { - //! Reset EGL errors stack - private void popEglErrors (EGL10 theEgl) - { - int anError = EGL10.EGL_SUCCESS; - while ((anError = theEgl.eglGetError()) != EGL10.EGL_SUCCESS) - { - OcctJniLogger.postMessage ("EGL Error: " + String.format ("0x%x", anError)); - } - } - - //! Auxiliary method to dump EGL configuration - for debugging purposes - @SuppressWarnings("unused") - private void printConfig (EGL10 theEgl, - EGLDisplay theEglDisplay, - EGLConfig theEglConfig) - { - int[] THE_ATTRIBS = - { - EGL10.EGL_BUFFER_SIZE, EGL10.EGL_ALPHA_SIZE, EGL10.EGL_BLUE_SIZE, EGL10.EGL_GREEN_SIZE, EGL10.EGL_RED_SIZE, EGL10.EGL_DEPTH_SIZE, EGL10.EGL_STENCIL_SIZE, - EGL10.EGL_CONFIG_CAVEAT, - EGL10.EGL_CONFIG_ID, - EGL10.EGL_LEVEL, - EGL10.EGL_MAX_PBUFFER_HEIGHT, EGL10.EGL_MAX_PBUFFER_PIXELS, EGL10.EGL_MAX_PBUFFER_WIDTH, - EGL10.EGL_NATIVE_RENDERABLE, EGL10.EGL_NATIVE_VISUAL_ID, EGL10.EGL_NATIVE_VISUAL_TYPE, - 0x3030, // EGL10.EGL_PRESERVED_RESOURCES, - EGL10.EGL_SAMPLES, EGL10.EGL_SAMPLE_BUFFERS, - EGL10.EGL_SURFACE_TYPE, - EGL10.EGL_TRANSPARENT_TYPE, EGL10.EGL_TRANSPARENT_RED_VALUE, EGL10.EGL_TRANSPARENT_GREEN_VALUE, EGL10.EGL_TRANSPARENT_BLUE_VALUE, - 0x3039, 0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGB, EGL10.EGL_BIND_TO_TEXTURE_RGBA, - 0x303B, 0x303C, // EGL10.EGL_MIN_SWAP_INTERVAL, EGL10.EGL_MAX_SWAP_INTERVAL - EGL10.EGL_LUMINANCE_SIZE, EGL10.EGL_ALPHA_MASK_SIZE, - EGL10.EGL_COLOR_BUFFER_TYPE, EGL10.EGL_RENDERABLE_TYPE, - 0x3042 // EGL10.EGL_CONFORMANT - }; - String[] THE_NAMES = - { - "EGL_BUFFER_SIZE", "EGL_ALPHA_SIZE", "EGL_BLUE_SIZE", "EGL_GREEN_SIZE", "EGL_RED_SIZE", "EGL_DEPTH_SIZE", "EGL_STENCIL_SIZE", - "EGL_CONFIG_CAVEAT", - "EGL_CONFIG_ID", - "EGL_LEVEL", - "EGL_MAX_PBUFFER_HEIGHT", "EGL_MAX_PBUFFER_PIXELS", "EGL_MAX_PBUFFER_WIDTH", - "EGL_NATIVE_RENDERABLE", "EGL_NATIVE_VISUAL_ID", "EGL_NATIVE_VISUAL_TYPE", - "EGL_PRESERVED_RESOURCES", - "EGL_SAMPLES", "EGL_SAMPLE_BUFFERS", - "EGL_SURFACE_TYPE", - "EGL_TRANSPARENT_TYPE", "EGL_TRANSPARENT_RED_VALUE", "EGL_TRANSPARENT_GREEN_VALUE", "EGL_TRANSPARENT_BLUE_VALUE", - "EGL_BIND_TO_TEXTURE_RGB", "EGL_BIND_TO_TEXTURE_RGBA", - "EGL_MIN_SWAP_INTERVAL", "EGL_MAX_SWAP_INTERVAL", - "EGL_LUMINANCE_SIZE", "EGL_ALPHA_MASK_SIZE", - "EGL_COLOR_BUFFER_TYPE", "EGL_RENDERABLE_TYPE", - "EGL_CONFORMANT" - }; - int[] aValue = new int[1]; - for (int anAttrIter = 0; anAttrIter < THE_ATTRIBS.length; ++anAttrIter) - { - int anAttr = THE_ATTRIBS[anAttrIter]; - String aName = THE_NAMES [anAttrIter]; - if (theEgl.eglGetConfigAttrib (theEglDisplay, theEglConfig, anAttr, aValue)) - { - OcctJniLogger.postMessage (String.format (" %s: %d\n", aName, aValue[0])); - } - else - { - popEglErrors (theEgl); - } - } - } - - //! Interface implementation - public EGLConfig chooseConfig (EGL10 theEgl, - EGLDisplay theEglDisplay) - { - int EGL_OPENGL_ES2_BIT = 4; - int[] aCfgAttribs = - { - EGL10.EGL_RED_SIZE, 8, - EGL10.EGL_GREEN_SIZE, 8, - EGL10.EGL_BLUE_SIZE, 8, - EGL10.EGL_ALPHA_SIZE, 0, - EGL10.EGL_DEPTH_SIZE, 24, - EGL10.EGL_STENCIL_SIZE, 8, - EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL10.EGL_NONE - }; - - EGLConfig aConfigs[] = new EGLConfig[1]; - int[] aNbConfigs = new int[1]; - if (!theEgl.eglChooseConfig (theEglDisplay, aCfgAttribs, aConfigs, 1, aNbConfigs) - || aConfigs[0] == null) - { - aCfgAttribs[4 * 2 + 1] = 16; // try config with smaller depth buffer - popEglErrors (theEgl); - if (!theEgl.eglChooseConfig (theEglDisplay, aCfgAttribs, aConfigs, 1, aNbConfigs) - || aConfigs[0] == null) - { - OcctJniLogger.postMessage ("Error: eglChooseConfig() has failed!"); - return null; - } - } - - //printConfig (theEgl, theEglDisplay, aConfigs[0]); - return aConfigs[0]; - } - } - - //! Callback to handle touch events - @Override public boolean onTouchEvent (MotionEvent theEvent) - { - final int aMaskedAction = theEvent.getActionMasked(); - switch (aMaskedAction) - { - case MotionEvent.ACTION_DOWN: - case MotionEvent.ACTION_POINTER_DOWN: - { - final int aPointerIndex = theEvent.getActionIndex(); - final int aPointerId = theEvent.getPointerId (aPointerIndex); - final PointF aPnt = new PointF (theEvent.getX (aPointerIndex), theEvent.getY (aPointerIndex)); - - if (theEvent.getPointerCount() == 1) - { - mySelectPoint = aPnt; - } - else - { - mySelectPoint = null; - } - - queueEvent (new Runnable() { public void run() { myRenderer.onAddTouchPoint (aPointerId, aPnt.x, aPnt.y); }}); - break; - } - case MotionEvent.ACTION_MOVE: - { - for (int aNbPointers = theEvent.getPointerCount(), aPntIter = 0; aPntIter < aNbPointers; ++aPntIter) - { - final int aPointerId = theEvent.getPointerId (aPntIter); - final PointF aPnt = new PointF (theEvent.getX (aPntIter), theEvent.getY (aPntIter)); - queueEvent (new Runnable() { public void run() { myRenderer.onUpdateTouchPoint (aPointerId, aPnt.x, aPnt.y); }}); - } - if (mySelectPoint != null) - { - final float aTouchThreshold = 5.0f * myScreenDensity; - final int aPointerIndex = theEvent.getActionIndex(); - final PointF aDelta = new PointF (theEvent.getX (aPointerIndex) - mySelectPoint.x, theEvent.getY (aPointerIndex) - mySelectPoint.y); - if (Math.abs (aDelta.x) > aTouchThreshold || Math.abs (aDelta.y) > aTouchThreshold) - { - mySelectPoint = null; - } - } - break; - } - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_POINTER_UP: - case MotionEvent.ACTION_CANCEL: - { - if (mySelectPoint != null) - { - final float aSelX = mySelectPoint.x; - final float aSelY = mySelectPoint.y; - queueEvent (new Runnable() { public void run() { myRenderer.onSelectInViewer (aSelX, aSelY); }}); - mySelectPoint = null; - } - - final int aPointerIndex = theEvent.getActionIndex(); - final int aPointerId = theEvent.getPointerId (aPointerIndex); - final PointF aPnt = new PointF (theEvent.getX (aPointerIndex), theEvent.getY (aPointerIndex)); - queueEvent (new Runnable() { public void run() { myRenderer.onRemoveTouchPoint (aPointerId); }}); - } - } - requestRender(); - return true; - } - - //! Fit All - public void fitAll() - { - queueEvent (new Runnable() { public void run() { myRenderer.fitAll(); }}); - requestRender(); - } - - //! Move camera - public void setProj (final OcctJniRenderer.TypeOfOrientation theProj) - { - queueEvent (new Runnable() { public void run() { myRenderer.setProj (theProj); }}); - requestRender(); - } - - //! OCCT viewer - private OcctJniRenderer myRenderer = null; - private int mySelectId = -1; - private PointF mySelectPoint = null; - private float myScreenDensity = 1.0f; - -} diff --git a/samples/java/jniviewer/app/src/main/jni/CMakeLists.txt b/samples/java/jniviewer/app/src/main/jni/CMakeLists.txt deleted file mode 100644 index 4c854cfe90..0000000000 --- a/samples/java/jniviewer/app/src/main/jni/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -cmake_minimum_required(VERSION 3.4.1) - -set(HEADER_FILES OcctJni_MsgPrinter.hxx OcctJni_Viewer.hxx) -set(SOURCE_FILES OcctJni_MsgPrinter.cxx OcctJni_Viewer.cxx) - -set (anOcctLibs - TKernel TKMath TKG2d TKG3d TKGeomBase TKBRep TKGeomAlgo TKTopAlgo TKShHealing TKMesh - # exchange - TKPrim TKBO TKBool TKFillet TKOffset - TKXSBase - TKDEIGES - TKDESTEP - # OCCT Visualization - TKService TKHLR TKV3d TKOpenGles -) - -set(aLibDeps "") - -# OCCT libraries -include_directories(${OCCT_ROOT}/inc) -foreach(anOcctLib ${anOcctLibs}) - add_library(lib_${anOcctLib} SHARED IMPORTED) - set_target_properties(lib_${anOcctLib} PROPERTIES IMPORTED_LOCATION ${OCCT_ROOT}/libs/${ANDROID_ABI}/lib${anOcctLib}.so) - list(APPEND aLibDeps lib_${anOcctLib}) -endforeach() - -# FreeType -add_library(lib_FreeType SHARED IMPORTED) -set_target_properties(lib_FreeType PROPERTIES IMPORTED_LOCATION ${FREETYPE_ROOT}/libs/${ANDROID_ABI}/libfreetype.so) -list(APPEND aLibDeps lib_FreeType) - -# FreeImage - uncomment, if OCCT was built with FreeImage -#add_library(lib_FreeImage SHARED IMPORTED) -#set_target_properties(lib_FreeImage PROPERTIES IMPORTED_LOCATION ${FREETYPE_ROOT}/libs/${ANDROID_ABI}/libfreeimage.so) -#list(APPEND aLibDeps lib_FreeImage) - -# system libraries -list(APPEND aLibDeps EGL GLESv2 log android) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -frtti -fexceptions -fpermissive") - -add_library(TKJniSample SHARED ${SOURCE_FILES}) -target_link_libraries(TKJniSample ${aLibDeps}) diff --git a/samples/java/jniviewer/app/src/main/jni/OcctJni_MsgPrinter.cxx b/samples/java/jniviewer/app/src/main/jni/OcctJni_MsgPrinter.cxx deleted file mode 100644 index c47d9934cb..0000000000 --- a/samples/java/jniviewer/app/src/main/jni/OcctJni_MsgPrinter.cxx +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include "OcctJni_MsgPrinter.hxx" - -#include -#include - -#include - -IMPLEMENT_STANDARD_RTTIEXT(OcctJni_MsgPrinter, Message_Printer) - -// ======================================================================= -// function : OcctJni_MsgPrinter -// purpose : -// ======================================================================= -OcctJni_MsgPrinter::OcctJni_MsgPrinter (JNIEnv* theJEnv, - jobject theJObj) -: myJEnv (theJEnv), - myJObj (theJEnv->NewGlobalRef (theJObj)), - myJMet (NULL) -{ - jclass aJClass = theJEnv->GetObjectClass (theJObj); - myJMet = theJEnv->GetMethodID (aJClass, "postMessage", "(Ljava/lang/String;)V"); - if (myJMet == NULL) - { - __android_log_write (ANDROID_LOG_FATAL, "jniSample", "Broken initialization of OcctJni_MsgPrinter!"); - } -} - -// ======================================================================= -// function : ~OcctJni_MsgPrinter -// purpose : -// ======================================================================= -OcctJni_MsgPrinter::~OcctJni_MsgPrinter() -{ - //myJEnv->DeleteGlobalRef (myJObj); -} - -// ======================================================================= -// function : send -// purpose : -// ======================================================================= -void OcctJni_MsgPrinter::send (const TCollection_AsciiString& theString, - const Message_Gravity theGravity) const -{ - if (theGravity < myTraceLevel) - { - return; - } - - ///__android_log_write (ANDROID_LOG_DEBUG, "OcctJni_MsgPrinter", (TCollection_AsciiString(" @@ ") + theString).ToCString()); - if (myJMet == NULL) - { - return; - } - - jstring aJStr = myJEnv->NewStringUTF ((theString + "\n").ToCString()); - myJEnv->CallVoidMethod (myJObj, myJMet, aJStr); - myJEnv->DeleteLocalRef (aJStr); -} diff --git a/samples/java/jniviewer/app/src/main/jni/OcctJni_MsgPrinter.hxx b/samples/java/jniviewer/app/src/main/jni/OcctJni_MsgPrinter.hxx deleted file mode 100644 index 655725567b..0000000000 --- a/samples/java/jniviewer/app/src/main/jni/OcctJni_MsgPrinter.hxx +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef OcctJni_MsgPrinter_H -#define OcctJni_MsgPrinter_H - -#include - -#include - -// Class providing connection between messenger interfaces in C++ and Java layers. -class OcctJni_MsgPrinter : public Message_Printer -{ -public: - - //! Default constructor - OcctJni_MsgPrinter (JNIEnv* theJEnv, - jobject theJObj); - - //! Destructor. - ~OcctJni_MsgPrinter(); - -protected: - - //! Main printing method - virtual void send (const TCollection_AsciiString& theString, - const Message_Gravity theGravity) const override; - -private: - - JNIEnv* myJEnv; - jobject myJObj; - jmethodID myJMet; - -public: - - DEFINE_STANDARD_RTTIEXT(OcctJni_MsgPrinter,Message_Printer) - -}; - -DEFINE_STANDARD_HANDLE(OcctJni_MsgPrinter, Message_Printer) - -#endif // OcctJni_MsgPrinter_H diff --git a/samples/java/jniviewer/app/src/main/jni/OcctJni_Viewer.cxx b/samples/java/jniviewer/app/src/main/jni/OcctJni_Viewer.cxx deleted file mode 100644 index 14a05680ba..0000000000 --- a/samples/java/jniviewer/app/src/main/jni/OcctJni_Viewer.cxx +++ /dev/null @@ -1,834 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include "OcctJni_Viewer.hxx" -#include "OcctJni_MsgPrinter.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include - -#include -#include - -#include - -//! @return true if file exists -static bool isFileExist (const TCollection_AsciiString& thePath) -{ - struct stat64 aStatBuffer; - return stat64 (thePath.ToCString(), &aStatBuffer) == 0; -} - -//! Cut-off the last split character from the path and everything after it. -static TCollection_AsciiString getParentDir (const TCollection_AsciiString& thePath) -{ - TCollection_AsciiString aPath = thePath; - char* aSplitter = (char* )aPath.ToCString(); - for (char* anIter = aSplitter; *anIter != '\0'; ++anIter) - { - if (*anIter == '\\' - || *anIter == '/') - { - aSplitter = anIter; - } - } - *aSplitter = '\0'; // cut off file name or trailing folder - return TCollection_AsciiString (aPath.ToCString()); -} - -//! Set environment variable theVarName indicating location of resource -//! file theFile so as to correspond to actual location of this file. -//! -//! The resource file is searched in directory where Test.Draw.dll is located, -//! and if not found - also in subdirectory ../res from there. -//! If file is found, environment variable is set for C subsystem. -//! Otherwise, environment is not changed. -//! -//! If theToAddFileName is true, complete file name is set as value of the variable, -//! if theToAddFileName is false, only path is set. -Standard_Boolean setResourceEnv (const TCollection_AsciiString& theVarName, - const TCollection_AsciiString& theRoot, - const TCollection_AsciiString& theFile, - const Standard_Boolean theToAddFileName) -{ - // use location of current assembly to figure out possible location of resource - TCollection_AsciiString aBaseDir = theRoot; - - // check the same directory where binary is located - if (!isFileExist (aBaseDir + "/" + theFile)) - { - // check subdirectory ../res - aBaseDir = getParentDir (aBaseDir) + "/res"; - if (!isFileExist (aBaseDir + "/" + theFile)) - { - return Standard_False; - } - } - - // set C library environment - if (theToAddFileName) - { - aBaseDir = aBaseDir + "/" + theFile; - } - - OSD_Environment anEnv (theVarName, aBaseDir); - anEnv.Build(); - return Standard_True; -} - -// ======================================================================= -// function : OcctJni_Viewer -// purpose : -// ======================================================================= -OcctJni_Viewer::OcctJni_Viewer (float theDispDensity) -: myDevicePixelRatio (theDispDensity), - myIsJniMoreFrames (false) -{ - SetTouchToleranceScale (theDispDensity); -#ifndef NDEBUG - // Register printer for logging messages into global Android log. - // Should never be used in production (or specify higher gravity for logging only failures). - Handle(Message_Messenger) aMsgMgr = Message::DefaultMessenger(); - aMsgMgr->RemovePrinters (STANDARD_TYPE (Message_PrinterSystemLog)); - aMsgMgr->AddPrinter (new Message_PrinterSystemLog ("OcctJni_Viewer")); -#endif - - // prepare necessary environment - TCollection_AsciiString aResRoot = "/data/data/com.opencascade.jnisample/files"; - - setResourceEnv ("CSF_XSMessage", aResRoot + "/XSMessage", "XSTEP.us", Standard_False); - setResourceEnv ("CSF_SHMessage", aResRoot + "/XSMessage", "SHAPE.us", Standard_False); -} - -// ================================================================ -// Function : dumpGlInfo -// Purpose : -// ================================================================ -void OcctJni_Viewer::dumpGlInfo (bool theIsBasic) -{ - TColStd_IndexedDataMapOfStringString aGlCapsDict; - myView->DiagnosticInformation (aGlCapsDict, Graphic3d_DiagnosticInfo_Basic); //theIsBasic ? Graphic3d_DiagnosticInfo_Basic : Graphic3d_DiagnosticInfo_Complete); - if (theIsBasic) - { - TCollection_AsciiString aViewport; - aGlCapsDict.FindFromKey ("Viewport", aViewport); - aGlCapsDict.Clear(); - aGlCapsDict.Add ("Viewport", aViewport); - } - aGlCapsDict.Add ("Display scale", TCollection_AsciiString(myDevicePixelRatio)); - - // beautify output - { - TCollection_AsciiString* aGlVer = aGlCapsDict.ChangeSeek ("GLversion"); - TCollection_AsciiString* aGlslVer = aGlCapsDict.ChangeSeek ("GLSLversion"); - if (aGlVer != NULL - && aGlslVer != NULL) - { - *aGlVer = *aGlVer + " [GLSL: " + *aGlslVer + "]"; - aGlslVer->Clear(); - } - } - - TCollection_AsciiString anInfo; - for (TColStd_IndexedDataMapOfStringString::Iterator aValueIter (aGlCapsDict); aValueIter.More(); aValueIter.Next()) - { - if (!aValueIter.Value().IsEmpty()) - { - if (!anInfo.IsEmpty()) - { - anInfo += "\n"; - } - anInfo += aValueIter.Key() + ": " + aValueIter.Value(); - } - } - - Message::Send (anInfo, Message_Warning); -} - -// ======================================================================= -// function : init -// purpose : -// ======================================================================= -bool OcctJni_Viewer::init() -{ - EGLint aCfgId = 0; - int aWidth = 0, aHeight = 0; - EGLDisplay anEglDisplay = eglGetCurrentDisplay(); - EGLContext anEglContext = eglGetCurrentContext(); - EGLSurface anEglSurf = eglGetCurrentSurface (EGL_DRAW); - if (anEglDisplay == EGL_NO_DISPLAY - || anEglContext == EGL_NO_CONTEXT - || anEglSurf == EGL_NO_SURFACE) - { - Message::DefaultMessenger()->Send ("Error: No active EGL context!", Message_Fail); - release(); - return false; - } - - eglQuerySurface (anEglDisplay, anEglSurf, EGL_WIDTH, &aWidth); - eglQuerySurface (anEglDisplay, anEglSurf, EGL_HEIGHT, &aHeight); - eglQuerySurface (anEglDisplay, anEglSurf, EGL_CONFIG_ID, &aCfgId); - const EGLint aConfigAttribs[] = { EGL_CONFIG_ID, aCfgId, EGL_NONE }; - EGLint aNbConfigs = 0; - void* anEglConfig = NULL; - if (eglChooseConfig (anEglDisplay, aConfigAttribs, &anEglConfig, 1, &aNbConfigs) != EGL_TRUE) - { - Message::DefaultMessenger()->Send ("Error: EGL does not provide compatible configurations!", Message_Fail); - release(); - return false; - } - - if (!myViewer.IsNull()) - { - Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myViewer->Driver()); - Handle(Aspect_NeutralWindow) aWindow = Handle(Aspect_NeutralWindow)::DownCast (myView->Window()); - if (!aDriver->InitEglContext (anEglDisplay, anEglContext, anEglConfig)) - { - Message::DefaultMessenger()->Send ("Error: OpenGl_GraphicDriver can not be initialized!", Message_Fail); - release(); - return false; - } - - aWindow->SetSize (aWidth, aHeight); - myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); - dumpGlInfo (true); - return true; - } - - Handle(OpenGl_GraphicDriver) aDriver = new OpenGl_GraphicDriver (NULL, Standard_False); - aDriver->ChangeOptions().buffersNoSwap = Standard_True; -//aDriver->ChangeOptions().glslWarnings = Standard_True; /// for debug only! - if (!aDriver->InitEglContext (anEglDisplay, anEglContext, anEglConfig)) - { - Message::DefaultMessenger()->Send ("Error: OpenGl_GraphicDriver can not be initialized!", Message_Fail); - release(); - return false; - } - - myTextStyle = new Prs3d_TextAspect(); - myTextStyle->SetFont (Font_NOF_ASCII_MONO); - myTextStyle->SetHeight (12); - myTextStyle->Aspect()->SetColor (Quantity_NOC_GRAY95); - myTextStyle->Aspect()->SetColorSubTitle (Quantity_NOC_BLACK); - myTextStyle->Aspect()->SetDisplayType (Aspect_TODT_SHADOW); - myTextStyle->Aspect()->SetTextFontAspect (Font_FA_Bold); - myTextStyle->Aspect()->SetTextZoomable (false); - myTextStyle->SetHorizontalJustification (Graphic3d_HTA_LEFT); - myTextStyle->SetVerticalJustification (Graphic3d_VTA_BOTTOM); - - // create viewer - myViewer = new V3d_Viewer (aDriver); - myViewer->SetDefaultBackgroundColor (Quantity_NOC_BLACK); - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - - // create AIS context - myContext = new AIS_InteractiveContext (myViewer); - myContext->SetPixelTolerance (int(myDevicePixelRatio * 6.0)); // increase tolerance and adjust to hi-dpi screens - myContext->SetDisplayMode (AIS_Shaded, false); - - Handle(Aspect_NeutralWindow) aWindow = new Aspect_NeutralWindow(); - aWindow->SetSize (aWidth, aHeight); - myView = myViewer->CreateView(); - myView->SetImmediateUpdate (false); - myView->ChangeRenderingParams().Resolution = (unsigned int )(96.0 * myDevicePixelRatio + 0.5); - myView->ChangeRenderingParams().ToShowStats = true; - myView->ChangeRenderingParams().CollectedStats = (Graphic3d_RenderingParams::PerfCounters ) (Graphic3d_RenderingParams::PerfCounters_FrameRate | Graphic3d_RenderingParams::PerfCounters_Triangles); - myView->ChangeRenderingParams().StatsTextAspect = myTextStyle->Aspect(); - myView->ChangeRenderingParams().StatsTextHeight = (int )myTextStyle->Height(); - - myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); - dumpGlInfo (false); - //myView->TriedronDisplay (Aspect_TOTP_RIGHT_LOWER, Quantity_NOC_WHITE, 0.08 * myDevicePixelRatio, V3d_ZBUFFER); - - initContent(); - return true; -} - -// ======================================================================= -// function : release -// purpose : -// ======================================================================= -void OcctJni_Viewer::release() -{ - myContext.Nullify(); - myView.Nullify(); - myViewer.Nullify(); -} - -// ======================================================================= -// function : resize -// purpose : -// ======================================================================= -void OcctJni_Viewer::resize (int theWidth, - int theHeight) -{ - if (myContext.IsNull()) - { - Message::DefaultMessenger()->Send ("Resize failed - view is unavailable", Message_Fail); - return; - } - - Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myViewer->Driver()); - Handle(Aspect_NeutralWindow) aWindow = Handle(Aspect_NeutralWindow)::DownCast (myView->Window()); - aWindow->SetSize (theWidth, theHeight); - //myView->MustBeResized(); // can be used instead of SetWindow() when EGLsurface has not been changed - - EGLContext anEglContext = eglGetCurrentContext(); - myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); - dumpGlInfo (true); - //saveSnapshot ("/sdcard/Download/tt.png", theWidth, theHeight); -} - -// ======================================================================= -// function : initContent -// purpose : -// ======================================================================= -void OcctJni_Viewer::initContent() -{ - myContext->RemoveAll (Standard_False); - - if (myViewCube.IsNull()) - { - myViewCube = new AIS_ViewCube(); - { - // setup view cube size - static const double THE_CUBE_SIZE = 60.0; - myViewCube->SetSize (myDevicePixelRatio * THE_CUBE_SIZE, false); - myViewCube->SetBoxFacetExtension (myViewCube->Size() * 0.15); - myViewCube->SetAxesPadding (myViewCube->Size() * 0.10); - myViewCube->SetFontHeight (THE_CUBE_SIZE * 0.16); - } - // presentation parameters - myViewCube->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_TriedronPers, Aspect_TOTP_RIGHT_LOWER, Graphic3d_Vec2i (200, 200))); - myViewCube->Attributes()->SetDatumAspect (new Prs3d_DatumAspect()); - myViewCube->Attributes()->DatumAspect()->SetTextAspect (myTextStyle); - // animation parameters - myViewCube->SetViewAnimation (myViewAnimation); - myViewCube->SetFixedAnimationLoop (false); - myViewCube->SetAutoStartAnimation (true); - } - myContext->Display (myViewCube, false); - - OSD_Timer aTimer; - aTimer.Start(); - if (!myShape.IsNull()) - { - Handle(AIS_Shape) aShapePrs = new AIS_Shape (myShape); - myContext->Display (aShapePrs, Standard_False); - } - else - { - BRepPrimAPI_MakeBox aBuilder (1.0, 2.0, 3.0); - Handle(AIS_Shape) aShapePrs = new AIS_Shape (aBuilder.Shape()); - myContext->Display (aShapePrs, Standard_False); - } - myView->FitAll(); - - aTimer.Stop(); - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "Presentation computed in " + aTimer.ElapsedTime() + " seconds", Message_Info); -} - -//! Load shape from IGES file -static TopoDS_Shape loadIGES (const TCollection_AsciiString& thePath) -{ - TopoDS_Shape aShape; - IGESControl_Reader aReader; - IFSelect_ReturnStatus aReadStatus = IFSelect_RetFail; - try - { - aReadStatus = aReader.ReadFile (thePath.ToCString()); - } - catch (Standard_Failure) - { - Message::DefaultMessenger()->Send ("Error: IGES reader, computation error", Message_Fail); - return aShape; - } - - if (aReadStatus != IFSelect_RetDone) - { - Message::DefaultMessenger()->Send ("Error: IGES reader, bad file format", Message_Fail); - return aShape; - } - - // now perform the translation - aReader.TransferRoots(); - if (aReader.NbShapes() <= 0) - { - Handle(XSControl_WorkSession) aWorkSession = new XSControl_WorkSession(); - aWorkSession->SelectNorm ("IGES"); - aReader.SetWS (aWorkSession, Standard_True); - aReader.SetReadVisible (Standard_False); - aReader.TransferRoots(); - } - if (aReader.NbShapes() <= 0) - { - Message::DefaultMessenger()->Send ("Error: IGES reader, no shapes has been found", Message_Fail); - return aShape; - } - return aReader.OneShape(); - /*TopoDS_Shape anImportedShape = aReader.OneShape(); - - // apply sewing on the imported shape - BRepBuilderAPI_Sewing aTool (0.0); - aTool.SetNonManifoldMode (Standard_False); - aTool.SetFloatingEdgesMode(Standard_True); - aTool.Load (anImportedShape); - aTool.Perform(); - TopoDS_Shape aSewedShape = aTool.SewedShape(); - - if (aSewedShape.IsNull()) - { - Message::DefaultMessenger()->Send ("Error: Sewing result is empty", Message_Fail); - return aShape; - } - if (aSewedShape.IsSame(anImportedShape)) - { - aShape = anImportedShape; - } - else - { - // apply shape healing - ShapeFix_Shape aShapeFixer(aSewedShape); - aShapeFixer.FixSolidMode() = 1; - aShapeFixer.FixFreeShellMode() = 1; - aShapeFixer.FixFreeFaceMode() = 1; - aShapeFixer.FixFreeWireMode() = 0; - aShapeFixer.FixSameParameterMode() = 0; - aShapeFixer.FixVertexPositionMode() = 0; - aShape = aShapeFixer.Perform() ? aShapeFixer.Shape() : aSewedShape; - } - return aShape;*/ -} - -//! Load shape from STEP file -static TopoDS_Shape loadSTEP (const TCollection_AsciiString& thePath) -{ - STEPControl_Reader aReader; - IFSelect_ReturnStatus aReadStatus = IFSelect_RetFail; - try - { - aReadStatus = aReader.ReadFile (thePath.ToCString()); - } - catch (Standard_Failure) - { - Message::DefaultMessenger()->Send ("Error: STEP reader, computation error", Message_Fail); - return TopoDS_Shape(); - } - - if (aReadStatus != IFSelect_RetDone) - { - Message::DefaultMessenger()->Send ("Error: STEP reader, bad file format", Message_Fail); - return TopoDS_Shape(); - } - else if (aReader.NbRootsForTransfer() <= 0) - { - Message::DefaultMessenger()->Send ("Error: STEP reader, shape is empty", Message_Fail); - return TopoDS_Shape(); - } - - // now perform the translation - aReader.TransferRoots(); - return aReader.OneShape(); -} - -// ======================================================================= -// function : open -// purpose : -// ======================================================================= -bool OcctJni_Viewer::open (const TCollection_AsciiString& thePath) -{ - myShape.Nullify(); - if (!myContext.IsNull()) - { - myContext->RemoveAll (Standard_False); - if (!myViewCube.IsNull()) - { - myContext->Display (myViewCube, false); - } - } - if (thePath.IsEmpty()) - { - return false; - } - - OSD_Timer aTimer; - aTimer.Start(); - TCollection_AsciiString aFormatStr; - const Standard_Integer aLen = thePath.Length(); - if (aLen >= 5 - && thePath.Value (aLen - 4) == '.') - { - aFormatStr = thePath.SubString (aLen - 3, aLen); - } - else if (aLen >= 4 - && thePath.Value (aLen - 3) == '.') - { - aFormatStr = thePath.SubString (aLen - 2, aLen); - } - else if (aLen >= 3 - && thePath.Value (aLen - 2) == '.') - { - aFormatStr = thePath.SubString (aLen - 1, aLen); - } - aFormatStr.LowerCase(); - - TopoDS_Shape aShape; - if (aFormatStr == "stp" - || aFormatStr == "step") - { - aShape = loadSTEP (thePath); - } - else if (aFormatStr == "igs" - || aFormatStr == "iges") - { - aShape = loadIGES (thePath); - } - else - // if (aFormatStr == "brep" - // || aFormatStr == "rle") - { - BRep_Builder aBuilder; - if (!BRepTools::Read (aShape, thePath.ToCString(), aBuilder)) - { - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "Error: file '" + thePath + "' can not be opened!", Message_Info); - return false; - } - } - if (aShape.IsNull()) - { - return false; - } - aTimer.Stop(); - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "File '" + thePath + "' loaded in " + aTimer.ElapsedTime() + " seconds", Message_Info); - - myShape = aShape; - if (myContext.IsNull()) - { - return true; - } - - aTimer.Reset(); - aTimer.Start(); - - Handle(AIS_Shape) aShapePrs = new AIS_Shape (aShape); - myContext->Display (aShapePrs, Standard_False); - myView->FitAll(); - - aTimer.Stop(); - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "Presentation computed in " + aTimer.ElapsedTime() + " seconds", Message_Info); - return true; -} - -// ======================================================================= -// function : saveSnapshot -// purpose : -// ======================================================================= -bool OcctJni_Viewer::saveSnapshot (const TCollection_AsciiString& thePath, - int theWidth, - int theHeight) -{ - if (myContext.IsNull() - || thePath.IsEmpty()) - { - Message::DefaultMessenger()->Send ("Image dump failed - view is unavailable", Message_Fail); - return false; - } - - if (theWidth < 1 - || theHeight < 1) - { - myView->Window()->Size (theWidth, theHeight); - } - if (theWidth < 1 - || theHeight < 1) - { - Message::DefaultMessenger()->Send ("Image dump failed - view is unavailable", Message_Fail); - return false; - } - - Image_AlienPixMap anAlienImage; - if (!anAlienImage.InitTrash (Image_Format_BGRA, theWidth, theHeight)) - { - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "RGBA image " + theWidth + "x" + theHeight + " allocation failed", Message_Fail); - return false; - } - - // OpenGL ES does not support fetching data in BGRA format - // while FreeImage does not support RGBA format. - Image_PixMap anImage; - anImage.InitWrapper (Image_Format_RGBA, - anAlienImage.ChangeData(), - anAlienImage.SizeX(), - anAlienImage.SizeY(), - anAlienImage.SizeRowBytes()); - if (!myView->ToPixMap (anImage, theWidth, theHeight, Graphic3d_BT_RGBA)) - { - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "View dump to the image " + theWidth + "x" + theHeight + " failed", Message_Fail); - } - - for (Standard_Size aRow = 0; aRow < anAlienImage.SizeY(); ++aRow) - { - for (Standard_Size aCol = 0; aCol < anAlienImage.SizeX(); ++aCol) - { - Image_ColorRGBA& aPixel = anAlienImage.ChangeValue (aRow, aCol); - std::swap (aPixel.r(), aPixel.b()); - //aPixel.a() = 1.0; - } - } - - if (!anAlienImage.Save (thePath)) - { - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "Image saving to path '" + thePath + "' failed", Message_Fail); - return false; - } - Message::DefaultMessenger()->Send (TCollection_AsciiString() + "View " + theWidth + "x" + theHeight + " dumped to image '" + thePath + "'", Message_Info); - return true; -} - -// ================================================================ -// Function : handleViewRedraw -// Purpose : -// ================================================================ -void OcctJni_Viewer::handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) -{ - AIS_ViewController::handleViewRedraw (theCtx, theView); - myIsJniMoreFrames = myToAskNextFrame; -} - -// ======================================================================= -// function : redraw -// purpose : -// ======================================================================= -bool OcctJni_Viewer::redraw() -{ - if (myView.IsNull()) - { - return false; - } - - // handle user input - myIsJniMoreFrames = false; - myView->InvalidateImmediate(); - FlushViewEvents (myContext, myView, true); - return myIsJniMoreFrames; -} - -// ======================================================================= -// function : fitAll -// purpose : -// ======================================================================= -void OcctJni_Viewer::fitAll() -{ - if (myView.IsNull()) - { - return; - } - - myView->FitAll (0.01, Standard_False); - myView->Invalidate(); -} - -#define jexp extern "C" JNIEXPORT - -jexp jlong JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppCreate (JNIEnv* theEnv, - jobject theObj, - jfloat theDispDensity) -{ - return jlong(new OcctJni_Viewer (theDispDensity)); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppDestroy (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - delete (OcctJni_Viewer* )theCppPtr; - - Handle(Message_Messenger) aMsgMgr = Message::DefaultMessenger(); - aMsgMgr->RemovePrinters (STANDARD_TYPE (OcctJni_MsgPrinter)); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppRelease (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->release(); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppInit (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - Handle(Message_Messenger) aMsgMgr = Message::DefaultMessenger(); - aMsgMgr->RemovePrinters (STANDARD_TYPE (OcctJni_MsgPrinter)); - aMsgMgr->AddPrinter (new OcctJni_MsgPrinter (theEnv, theObj)); - ((OcctJni_Viewer* )theCppPtr)->init(); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppResize (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr, - jint theWidth, - jint theHeight) -{ - ((OcctJni_Viewer* )theCppPtr)->resize (theWidth, theHeight); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppOpen (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr, - jstring thePath) -{ - const char* aPathPtr = theEnv->GetStringUTFChars (thePath, 0); - const TCollection_AsciiString aPath (aPathPtr); - theEnv->ReleaseStringUTFChars (thePath, aPathPtr); - ((OcctJni_Viewer* )theCppPtr)->open (aPath); -} - -jexp jboolean JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppRedraw (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - return ((OcctJni_Viewer* )theCppPtr)->redraw() ? JNI_TRUE : JNI_FALSE; -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetAxoProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_XposYnegZpos); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetXposProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_Xpos); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetYposProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_Ypos); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetZposProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_Zpos); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetXnegProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_Xneg); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetYnegProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_Yneg); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSetZnegProj (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->setProj (V3d_Zneg); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppFitAll (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr) -{ - ((OcctJni_Viewer* )theCppPtr)->fitAll(); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppAddTouchPoint (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr, - jint theId, - jfloat theX, - jfloat theY) -{ - ((OcctJni_Viewer* )theCppPtr)->AddTouchPoint (theId, Graphic3d_Vec2d (theX, theY)); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppUpdateTouchPoint (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr, - jint theId, - jfloat theX, - jfloat theY) -{ - ((OcctJni_Viewer* )theCppPtr)->UpdateTouchPoint (theId, Graphic3d_Vec2d (theX, theY)); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppRemoveTouchPoint (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr, - jint theId) -{ - ((OcctJni_Viewer* )theCppPtr)->RemoveTouchPoint (theId); -} - -jexp void JNICALL Java_com_opencascade_jnisample_OcctJniRenderer_cppSelectInViewer (JNIEnv* theEnv, - jobject theObj, - jlong theCppPtr, - jfloat theX, - jfloat theY) -{ - ((OcctJni_Viewer* )theCppPtr)->SelectInViewer (Graphic3d_Vec2i ((int )theX, (int )theY)); -} - -jexp jlong JNICALL Java_com_opencascade_jnisample_OcctJniActivity_cppOcctMajorVersion (JNIEnv* theEnv, - jobject theObj) -{ - return OCC_VERSION_MAJOR; -} - -jexp jlong JNICALL Java_com_opencascade_jnisample_OcctJniActivity_cppOcctMinorVersion (JNIEnv* theEnv, - jobject theObj) -{ - return OCC_VERSION_MINOR; -} - -jexp jlong JNICALL Java_com_opencascade_jnisample_OcctJniActivity_cppOcctMicroVersion (JNIEnv* theEnv, - jobject theObj) -{ - return OCC_VERSION_MAINTENANCE; -} diff --git a/samples/java/jniviewer/app/src/main/jni/OcctJni_Viewer.hxx b/samples/java/jniviewer/app/src/main/jni/OcctJni_Viewer.hxx deleted file mode 100644 index f34e016edc..0000000000 --- a/samples/java/jniviewer/app/src/main/jni/OcctJni_Viewer.hxx +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include -#include -#include - -class AIS_ViewCube; - -//! Main C++ back-end for activity. -class OcctJni_Viewer : public AIS_ViewController -{ - -public: - - //! Empty constructor - OcctJni_Viewer (float theDispDensity); - - //! Initialize the viewer - bool init(); - - //! Release the viewer - void release(); - - //! Resize the viewer - void resize (int theWidth, - int theHeight); - - //! Open CAD file - bool open (const TCollection_AsciiString& thePath); - - //! Take snapshot - bool saveSnapshot (const TCollection_AsciiString& thePath, - int theWidth = 0, - int theHeight = 0); - - //! Viewer update. - //! Returns TRUE if more frames should be requested. - bool redraw(); - - //! Move camera - void setProj (V3d_TypeOfOrientation theProj) - { - if (myView.IsNull()) - { - return; - } - - myView->SetProj (theProj); - myView->Invalidate(); - } - - //! Fit All. - void fitAll(); - -protected: - - //! Reset viewer content. - void initContent(); - - //! Print information about OpenGL ES context. - void dumpGlInfo (bool theIsBasic); - - //! Handle redraw. - virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) override; - -protected: - - Handle(V3d_Viewer) myViewer; - Handle(V3d_View) myView; - Handle(AIS_InteractiveContext) myContext; - Handle(Prs3d_TextAspect) myTextStyle; //!< text style for OSD elements - Handle(AIS_ViewCube) myViewCube; //!< view cube object - TopoDS_Shape myShape; - float myDevicePixelRatio; //!< device pixel ratio for handling high DPI displays - bool myIsJniMoreFrames; //!< need more frame flag - -}; diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/close_l.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/close_l.png deleted file mode 100644 index 0125c4aaf8..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/close_l.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/close_p.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/close_p.png deleted file mode 100644 index b5ce8bdfd0..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/close_p.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/fit.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/fit.png deleted file mode 100644 index 70daee140c..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/fit.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/ic_launcher.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index d27ba82c09..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/info.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/info.png deleted file mode 100644 index 88d27c8e51..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/info.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/info_image.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/info_image.png deleted file mode 100644 index bac9bead0f..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/info_image.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/message.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/message.png deleted file mode 100644 index a3dc8cc209..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/message.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open.png deleted file mode 100644 index 68e52659f9..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open_l.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open_l.png deleted file mode 100644 index 6069ce3893..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open_l.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open_p.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open_p.png deleted file mode 100644 index c0898e6d6a..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/open_p.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_back.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_back.png deleted file mode 100644 index 77ab199ab5..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_back.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_bottom.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_bottom.png deleted file mode 100644 index b0bb012866..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_bottom.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_front.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_front.png deleted file mode 100644 index b93d4d3e09..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_front.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_left.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_left.png deleted file mode 100644 index bce95df901..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_left.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_right.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_right.png deleted file mode 100644 index 8cdb338b4c..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_right.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_top.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_top.png deleted file mode 100644 index 4ad098fc80..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/proj_top.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/view.png b/samples/java/jniviewer/app/src/main/res/drawable-hdpi/view.png deleted file mode 100644 index 76ce87949a..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-hdpi/view.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-mdpi/ic_launcher.png b/samples/java/jniviewer/app/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 4b86dbf5e9..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-xhdpi/ic_launcher.png b/samples/java/jniviewer/app/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index cd79bea162..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/samples/java/jniviewer/app/src/main/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index a34301f386..0000000000 Binary files a/samples/java/jniviewer/app/src/main/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/samples/java/jniviewer/app/src/main/res/layout/activity_main.xml b/samples/java/jniviewer/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index e7f3ebfd66..0000000000 --- a/samples/java/jniviewer/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/java/jniviewer/app/src/main/res/values/id.xml b/samples/java/jniviewer/app/src/main/res/values/id.xml deleted file mode 100644 index 56bde943a6..0000000000 --- a/samples/java/jniviewer/app/src/main/res/values/id.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/samples/java/jniviewer/app/src/main/res/values/strings.xml b/samples/java/jniviewer/app/src/main/res/values/strings.xml deleted file mode 100644 index 6f2a431604..0000000000 --- a/samples/java/jniviewer/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - OpenCASCADE JNI Java Sample - #484848 - #0099CC - #66252525 - - .png - .jpg - - - .brep - .rle - .iges - .igs - .step - .stp - - wireframe/shading - color - material - transparency - show/hide hidden lines - - OpenCASCADE JNI Java Sample

-

Simple viewer for BREP, STEP and IGES files.

-

Driven by Open CASCADE Technology %d.%d.%d.

-

Copyright 2014 OPEN CASCADE SAS.

-

-

http://www.opencascade.com

-

http://www.opencascade.org

- ]]> -
-
diff --git a/samples/java/jniviewer/build.gradle b/samples/java/jniviewer/build.gradle deleted file mode 100644 index da2f7cd34f..0000000000 --- a/samples/java/jniviewer/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' - } -} - -allprojects { - repositories { - jcenter() - google() - } -} diff --git a/samples/java/jniviewer/gradle.properties.template b/samples/java/jniviewer/gradle.properties.template deleted file mode 100644 index 2cf7323475..0000000000 --- a/samples/java/jniviewer/gradle.properties.template +++ /dev/null @@ -1,5 +0,0 @@ -# customized paths -OCCT_ROOT=c\:/android/occt-dev-android -FREETYPE_ROOT=c\:/android/freetype-2.7.1-android -# in case if OCCT was built with FreeImage -#FREEIMAGE_ROOT=c\:/android/freeimage-3.17-android diff --git a/samples/java/jniviewer/images/samples_java_android_occt.jpg b/samples/java/jniviewer/images/samples_java_android_occt.jpg deleted file mode 100644 index ecba47332b..0000000000 Binary files a/samples/java/jniviewer/images/samples_java_android_occt.jpg and /dev/null differ diff --git a/samples/java/jniviewer/settings.gradle b/samples/java/jniviewer/settings.gradle deleted file mode 100644 index e7b4def49c..0000000000 --- a/samples/java/jniviewer/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/samples/mfc/standard/01_Geometry/CMakeLists.txt b/samples/mfc/standard/01_Geometry/CMakeLists.txt deleted file mode 100644 index ec58896cc7..0000000000 --- a/samples/mfc/standard/01_Geometry/CMakeLists.txt +++ /dev/null @@ -1,96 +0,0 @@ -# Caution! Be careful, when increase minimal cmake version: -# using of newer version may leads (by default) to applying -# of some new policies. It may break compilation. -# For canceling of applying new policies use: -# cmake_policy(PUSH) before `cmake_minimum_required` -# and cmake_policy(POP) after. -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) - -project (Geometry) - -add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE) -set (CMAKE_MFC_FLAG 2) - -set (Geometry_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/01_Geometry/src) -set (Geometry_HEADER_FILES ${Geometry_SRC_DIR}/ChildFrm.h - ${Geometry_SRC_DIR}/ChildFrm2d.h - ${Geometry_SRC_DIR}/GeoAlgo_Sol.hxx - ${Geometry_SRC_DIR}/GeometryApp.h - ${Geometry_SRC_DIR}/GeometryDoc.h - ${Geometry_SRC_DIR}/GeometryView.h - ${Geometry_SRC_DIR}/GeometryView2D.h - ${Geometry_SRC_DIR}/GeomSources.h - ${Geometry_SRC_DIR}/MainFrm.h - ${Geometry_SRC_DIR}/StdAfx.h ) -set (Geometry_SOURCE_FILES ${Geometry_SRC_DIR}/ChildFrm.cpp - ${Geometry_SRC_DIR}/ChildFrm2d.cpp - ${Geometry_SRC_DIR}/GeoAlgo_Sol.cxx - ${Geometry_SRC_DIR}/GeometryApp.cpp - ${Geometry_SRC_DIR}/GeometryDoc.cpp - ${Geometry_SRC_DIR}/GeometryView.cpp - ${Geometry_SRC_DIR}/GeometryView2D.cpp - ${Geometry_SRC_DIR}/GeomSources.cpp - ${Geometry_SRC_DIR}/MainFrm.cpp - ${Geometry_SRC_DIR}/StdAfx.cpp ) - -set (Geometry_ISESSION2D_DIR ${Geometry_SRC_DIR}/ISession2D) -set (Geometry_ISESSION2D_HEADER_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.h - ${Geometry_ISESSION2D_DIR}/ISession_Direction.h - ${Geometry_ISESSION2D_DIR}/ISession_Point.h - ${Geometry_ISESSION2D_DIR}/ISession_Surface.h - ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.h) -set (Geometry_ISESSION2D_SOURCE_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.cpp - ${Geometry_ISESSION2D_DIR}/ISession_Direction.cpp - ${Geometry_ISESSION2D_DIR}/ISession_Point.cpp - ${Geometry_ISESSION2D_DIR}/ISession_Surface.cpp - ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.cpp) - -set (Geometry_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/01_Geometry/res) -set (Geometry_RESOURCE_HEADER ${Geometry_RESOURCE_DIR}/resource.h) -set (Geometry_RESOURCE_FILES ${Geometry_RESOURCE_DIR}/Geometry.rc - ${Geometry_RESOURCE_DIR}/Toolbar1.bmp - ${Geometry_RESOURCE_DIR}/Toolbar2.bmp) - -# groups in the VS solution -source_group ("Source Files" FILES ${Geometry_SOURCE_FILES} - ${COMMON_WINMAIN_FILE}) - -source_group ("Source Files\\ISession2d" FILES ${Geometry_ISESSION2D_SOURCE_FILES}) - -source_group ("Header Files" FILES ${Geometry_HEADER_FILES} - ${Geometry_ISESSION2D_HEADER_FILES} - ${Geometry_RESOURCE_HEADER}) - -source_group ("Resource Files" FILES ${Geometry_RESOURCE_FILES}) - -add_executable (Geometry WIN32 ${Geometry_SOURCE_FILES} - ${Geometry_HEADER_FILES} - ${COMMON_WINMAIN_FILE} - ${Geometry_ISESSION2D_SOURCE_FILES} - ${Geometry_ISESSION2D_HEADER_FILES} - ${Geometry_RESOURCE_FILES} - ${Geometry_RESOURCE_HEADER}) - -set_property(TARGET Geometry PROPERTY FOLDER "Samples/mfc") - -if (SINGLE_GENERATOR) - install (TARGETS Geometry DESTINATION "${INSTALL_DIR_BIN}") -else() - install (TARGETS Geometry - CONFIGURATIONS Release RelWithDebInfo - DESTINATION "${INSTALL_DIR_BIN}") - install (TARGETS Geometry - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR_BIN}d") -endif() - -include_directories (${CMAKE_BINARY_DIR}/inc - ${Geometry_SRC_DIR} - ${Geometry_ISESSION2D_DIR} - ${Geometry_RESOURCE_DIR} - ${MFC_STANDARD_SAMPLES_DIR}/Common) - -target_link_libraries (Geometry mfcsample) - -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) \ No newline at end of file diff --git a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj b/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj deleted file mode 100644 index 85cb5bbdda..0000000000 --- a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj +++ /dev/null @@ -1,584 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {31E8199C-C981-4B7F-9CC2-B8502565B581} - Geometry - MFCProj - - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../win32\$(VCFMT)\bin\ - .\win32\obj\ - false - ../../../../win64\$(VCFMT)\bin\ - .\win64\obj\ - false - ../../../../win32\$(VCFMT)\bind\ - .\win32\objd\ - true - ../../../../win64\$(VCFMT)\bind\ - .\win64\objd\ - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\obj/Geometry.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\src;.;..\..\..\..\Common;..\..\..\src\ISession2d;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win32\obj/Geometry.pch - .\win32\obj/ - .\win32\obj/ - .\win32\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKMesh.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bin/Geometry.exe - true - ..\..\..\..\win32\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - ../../../../win32\$(VCFMT)\bin/Geometry.pdb - Windows - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\obj/Geometry.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\src;.;..\..\..\..\Common;..\..\..\src\ISession2d;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win64\obj/Geometry.pch - .\win64\obj/ - .\win64\obj/ - .\win64\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKMesh.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bin/Geometry.exe - true - ..\..\..\..\win64\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - ../../../../win64\$(VCFMT)\bin/Geometry.pdb - Windows - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\objd/Geometry.tlb - - - - - Disabled - ..\..\..\src;.;..\..\..\..\Common;..\..\..\src\ISession2d;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win32\objd/Geometry.pch - .\win32\objd/ - .\win32\objd/ - .\win32\objd/ - true - Level4 - true - EditAndContinue - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKMesh.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bind/Geometry.exe - true - ..\..\..\..\win32\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - ../../../../win32\$(VCFMT)\bind/Geometry.pdb - Windows - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\objd/Geometry.tlb - - - - - Disabled - ..\..\..\src;.;..\..\..\..\Common;..\..\..\src\ISession2d;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win64\objd/Geometry.pch - .\win64\objd/ - .\win64\objd/ - .\win64\objd/ - true - Level4 - true - ProgramDatabase - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKMesh.lib;%(AdditionalDependencies) - ../../../..\win64\$(VCFMT)\bind/Geometry.exe - true - ..\..\..\..\win64\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - ../../../../win64\$(VCFMT)\bind/Geometry.pdb - Windows - MachineX64 - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - {2d6cbbe8-6965-4016-b503-0d715ae26691} - false - - - - - - \ No newline at end of file diff --git a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters b/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters deleted file mode 100644 index a56b5b8da7..0000000000 --- a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters +++ /dev/null @@ -1,133 +0,0 @@ - - - - - {1697fc5e-645f-497f-b0c8-368b443f127a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {de79fa58-5f9d-4222-b105-fe4f6d9091e5} - - - {189e159b-f494-4b64-93f1-90dbf154e82d} - h;hpp;hxx;hm;inl - - - {b576cf30-aabd-409d-be0a-47b5842f86a9} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files\ISession2d - - - Source Files\ISession2d - - - Source Files\ISession2d - - - Source Files\ISession2d - - - Source Files\ISession2d - - - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/samples/mfc/standard/01_Geometry/res/Geometry.rc b/samples/mfc/standard/01_Geometry/res/Geometry.rc deleted file mode 100755 index 911ea1c21d..0000000000 --- a/samples/mfc/standard/01_Geometry/res/Geometry.rc +++ /dev/null @@ -1,347 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -#include "..\..\Common\res\OCC_Resource.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "#include ""..\\..\\Common\\res\\OCC_Resource.h""\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDR_MAINFRAME BITMAP "Toolbar1.bmp" -IDR_MAINFRAME2 BITMAP "Toolbar2.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_MAINFRAME TOOLBAR 16, 15 -BEGIN - BUTTON ID_FILE_NEW - SEPARATOR - BUTTON ID_APP_ABOUT - SEPARATOR - BUTTON ID_BUTTON_Test_1 - BUTTON ID_BUTTON_Test_2 - BUTTON ID_BUTTON_Test_3 - BUTTON ID_BUTTON_Test_4 - BUTTON ID_BUTTON_Test_5 - BUTTON ID_BUTTON_Test_6 - BUTTON ID_BUTTON_Test_7 - BUTTON ID_BUTTON_Test_8 - BUTTON ID_BUTTON_Test_9 - BUTTON ID_BUTTON_Test_10 - BUTTON ID_BUTTON_Test_11 - BUTTON ID_BUTTON_Test_12 - BUTTON ID_BUTTON_Test_13 - BUTTON ID_BUTTON_Test_14 - BUTTON ID_BUTTON_Test_15 - BUTTON ID_BUTTON_Test_16 - BUTTON ID_BUTTON_Test_17 - BUTTON ID_BUTTON_Test_18 - BUTTON ID_BUTTON_Test_19 - BUTTON ID_BUTTON_Test_20 - BUTTON ID_BUTTON_Test_21 - BUTTON ID_BUTTON_Test_22 - BUTTON ID_BUTTON_Test_23 - BUTTON ID_BUTTON_Test_24 - SEPARATOR - BUTTON ID_Create_Sol -END - -IDR_MAINFRAME2 TOOLBAR 16, 15 -BEGIN - BUTTON ID_BUTTON_Test_25 - BUTTON ID_BUTTON_Test_26 - BUTTON ID_BUTTON_Test_27 - BUTTON ID_BUTTON_Test_28 - BUTTON ID_BUTTON_Test_29 - BUTTON ID_BUTTON_Test_30 - BUTTON ID_BUTTON_Test_31 - BUTTON ID_BUTTON_Test_32 - BUTTON ID_BUTTON_Test_33 - BUTTON ID_BUTTON_Test_34 - BUTTON ID_BUTTON_Test_35 - BUTTON ID_BUTTON_Test_36 - SEPARATOR - BUTTON ID_BUTTON_Test_37 - BUTTON ID_BUTTON_Test_38 - BUTTON ID_BUTTON_Test_39 - BUTTON ID_BUTTON_Test_40 - BUTTON ID_BUTTON_Test_41 - BUTTON ID_BUTTON_Test_42 - BUTTON ID_BUTTON_Test_43 - BUTTON ID_BUTTON_Test_44 - BUTTON ID_BUTTON_Test_45 - BUTTON ID_BUTTON_Test_46 - BUTTON ID_BUTTON_Test_47 - BUTTON ID_BUTTON_Test_48 - BUTTON ID_BUTTON_Test_49 - BUTTON ID_BUTTON_Test_50 - SEPARATOR - BUTTON ID_BUTTON_Simplify -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAINFRAME MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Help" - BEGIN - MENUITEM "&About Geometry...", ID_APP_ABOUT - END -END - -IDR_3DTYPE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM "&Close", ID_FILE_CLOSE - MENUITEM SEPARATOR - POPUP "Export" - BEGIN - MENUITEM "Image...", ID_FILE_EXPORT_IMAGE - END - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Window" - BEGIN - MENUITEM "&New Window 2D", ID_WINDOW_NEW2D - MENUITEM "&New Window 3D", ID_WINDOW_NEW - MENUITEM SEPARATOR - MENUITEM "&Cascade", ID_WINDOW_CASCADE - MENUITEM "&Tile", ID_WINDOW_TILE_HORZ - MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE - END - POPUP "&Help" - BEGIN - MENUITEM "&About Geometry...", ID_APP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "FileDescription", "Viewer MFC Application" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "Viewer" - VALUE "LegalCopyright", "Copyright (C) 1997" - VALUE "OriginalFilename", "Viewer.EXE" - VALUE "ProductName", "SampleGeometry Application" - VALUE "ProductVersion", "1, 0, 0, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDR_MAINFRAME "Geometry" - IDR_Samples2DTYPE "2D View \nArgOne\nArgTwo\nArgThree\nArgFour\n.Document\nArgSix " -END - -STRINGTABLE -BEGIN - IDR_TYPE "3D View\nGeometry\n\n\n\n.Document\n Document" -END - -STRINGTABLE -BEGIN - ID_BUTTON_Test_1 "Build a cartesian coordinate entity \nCartesian Coordinate Entity " - ID_BUTTON_Test_2 "Build geometric Points\nGeometric Points" - ID_BUTTON_Test_3 "Build a point with a triplet of coordinates\nGeometric point " - ID_BUTTON_Test_4 "Return the coordinates of a geometric point\nCoordinates of a point" - ID_BUTTON_Test_5 "Build the barycenter of two points\nBarycenter of two points" - ID_BUTTON_Test_6 "Build the barycenter of several points\nBarycenter of several points" - ID_BUTTON_Test_7 "Build a trimmed curve and a tangent vector\nTrimmed curve" - ID_BUTTON_Test_8 "Build a geometric circle and a tangent direction\nGeometric circle" - ID_BUTTON_Test_9 "Build a point from curve and a start point\nPoint from curve" - ID_BUTTON_Test_10 "Build points from a circle and uniform abscissa\nPoints from curve" - ID_BUTTON_Test_23 " Build a trimmed curve from an ellips\nBuild a trimmed curve" - ID_BUTTON_Test_22 " Build a curve from two points and energy\nBuild a fair curve" - ID_BUTTON_Test_32 " Build a trimmed ellipse\nTrimmed ellipse" - ID_BUTTON_Test_11 "Build a point from a sphere and u,v parameters\nPoint from sphere" - ID_BUTTON_Test_12 "Project a point on a curve\nProject a point on a curve" - ID_BUTTON_Test_13 "Project a point on a sphere\nProject a point on a sphere" -END - -STRINGTABLE -BEGIN - ID_BUTTON_Test_14 "Build points from an intersection\nBuild points from an intersection" - ID_BUTTON_Test_15 " Build a point from a transformation\nBuild a point from a transformation" - ID_BUTTON_Test_16 " Build vectors from points\nVectors" - ID_BUTTON_Test_17 " Calculate the angle between two directions\nAngle" - ID_BUTTON_Test_18 " Build a parabola from an axis\nParabola" - ID_BUTTON_Test_19 " Build right and left handed axis\nAxis" - ID_BUTTON_Test_20 " Build B-Spline curves\nB-Spline curves" - ID_BUTTON_Test_21 " Build a fair curve\nBuild a fair curve" - ID_BUTTON_Test_24 " Project a curve in a 2D one\nProjection" - ID_BUTTON_Test_25 " Interpolate a curve from points\nInterpolate a curve" - ID_BUTTON_Test_26 " Calculate the extreme points between curves\nExtreme points" - ID_BUTTON_Test_27 " Build offset curves\nOffset curves" - ID_BUTTON_Test_28 " Build a line passing through two points\nLine" - ID_BUTTON_Test_29 " Build a bisector\nBisector" - ID_BUTTON_Test_30 " Build a line passing through a point and tangent to a circle\nBuild a tangent line" - ID_BUTTON_Test_31 " Build tangent circles\nTangent circles" -END - -STRINGTABLE -BEGIN - ID_BUTTON_Test_33 " Build B-Spline curves\nB-Spline curves" - ID_BUTTON_Test_34 " Test the average shape of points\nTest points" - ID_BUTTON_Test_35 " Intersection between curve and surface\nIntersection between curve and surface" - ID_BUTTON_Test_36 " Build entities from geometric transformations\nGeometric transformations" - ID_BUTTON_Test_37 " Test the average shape of points\nTest points" - ID_BUTTON_Test_38 " Build surfaces by filling curves\nFill curves" - ID_BUTTON_Test_39 " Build a constrained surface from curves\nConstrained surface" - ID_BUTTON_Test_40 " Build pipe from basis entities\nPipe" - ID_BUTTON_Test_41 " Split a B-Spline surface\nSplit a B-Spline surface" - ID_BUTTON_Test_42 " Build Bezier surface\nBezier surface" - ID_BUTTON_Test_43 " Build offset surfaces\nOffset surfaces" - ID_BUTTON_Test_44 " Build a surface of linear extrusion\nLinear extrusion" - ID_BUTTON_Test_45 " Build a surface of revolution\nSurface of revolution" - ID_BUTTON_Test_46 " Build a surface extended by a length\nExtended surface" - ID_BUTTON_Test_47 " Calculate the extreme distances between surfaces\nExtreme distances" - ID_BUTTON_Test_48 " Build the bounding boxes of curves 2D\nBounding boxes 2D" -END - -STRINGTABLE -BEGIN - ID_BUTTON_Test_49 " Build the bounding boxes of curves 3D\nBounding boxes 3D" - ID_BUTTON_Test_50 " Build the bounding boxes of surface 3D\nBounding boxes 3D" - ID_BUTTON_Test_51 " " - ID_Create_Sol "Create a surface from a set of points\nSurface from points" - ID_BUTTON_Simplify "Simplification of shape\nSimplification" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/samples/mfc/standard/01_Geometry/res/Toolbar1.bmp b/samples/mfc/standard/01_Geometry/res/Toolbar1.bmp deleted file mode 100755 index 8ee4f4319d..0000000000 Binary files a/samples/mfc/standard/01_Geometry/res/Toolbar1.bmp and /dev/null differ diff --git a/samples/mfc/standard/01_Geometry/res/Toolbar2.bmp b/samples/mfc/standard/01_Geometry/res/Toolbar2.bmp deleted file mode 100755 index 7d6cac406f..0000000000 Binary files a/samples/mfc/standard/01_Geometry/res/Toolbar2.bmp and /dev/null differ diff --git a/samples/mfc/standard/01_Geometry/res/resource.h b/samples/mfc/standard/01_Geometry/res/resource.h deleted file mode 100755 index 47fbc8a31e..0000000000 --- a/samples/mfc/standard/01_Geometry/res/resource.h +++ /dev/null @@ -1,84 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Geometry.rc -// -#define IDOK2 3 -#define IDR_TYPE 18 -#define IDR_Samples2DTYPE 130 -#define IDR_Samples3DCollectorTYPE 133 -#define IDR_CHILD2D 139 -#define IDR_MAINFRAME2 141 -#define ID_BUTTON_Test_1 800 -#define ID_BUTTON_Test_2 801 -#define ID_BUTTON_Test_3 802 -#define ID_BUTTON_Test_4 803 -#define ID_BUTTON_Test_5 804 -#define ID_BUTTON_Test_6 805 -#define ID_BUTTON_Test_7 806 -#define ID_BUTTON_Test_8 807 -#define ID_BUTTON_Test_9 808 -#define ID_BUTTON_Test_10 809 -#define ID_BUTTON_Test_23 810 -#define ID_BUTTON_Test_22 811 -#define ID_BUTTON_Test_32 812 -#define ID_BUTTON_Test_11 813 -#define ID_BUTTON_Test_12 814 -#define ID_BUTTON_Test_13 815 -#define ID_BUTTON_Test_14 816 -#define ID_BUTTON_Test_15 817 -#define ID_BUTTON_Test_16 818 -#define ID_BUTTON_Test_17 819 -#define ID_BUTTON_Test_18 820 -#define ID_BUTTON_Test_19 821 -#define ID_BUTTON_Test_20 822 -#define ID_BUTTON_Test_21 823 -#define ID_BUTTON_Test_24 824 -#define ID_BUTTON_Test_25 825 -#define ID_BUTTON_Test_26 826 -#define ID_BUTTON_Test_27 827 -#define ID_BUTTON_Test_28 828 -#define ID_BUTTON_Test_29 829 -#define ID_BUTTON_Test_30 830 -#define ID_BUTTON_Test_31 831 -#define ID_BUTTON_Test_33 832 -#define ID_BUTTON_Test_34 833 -#define ID_BUTTON_Test_35 834 -#define ID_BUTTON_Test_36 835 -#define ID_BUTTON_Test_37 836 -#define ID_BUTTON_Test_38 837 -#define ID_BUTTON_Test_39 838 -#define ID_BUTTON_Test_40 839 -#define ID_BUTTON_Test_41 840 -#define ID_BUTTON_Test_42 841 -#define ID_BUTTON_Test_43 842 -#define ID_BUTTON_Test_44 843 -#define ID_BUTTON_Test_45 844 -#define ID_BUTTON_Test_46 845 -#define ID_BUTTON_Test_47 846 -#define ID_BUTTON_Test_48 847 -#define ID_BUTTON_Test_49 848 -#define ID_BUTTON_Test_50 849 -#define ID_BUTTON_Test_51 850 -#define ID_HI 853 -#define ID_Create_Sol 854 -#define ID_BUTTON855 855 -#define ID_BUTTON_Simplify 855 -#define ID_BUTTONGridRectLines 40030 -#define ID_BUTTONGridRectPoints 40031 -#define ID_BUTTONGridCircLines 40032 -#define ID_BUTTONGridCircPoints 40033 -#define ID_BUTTONGridValues 40034 -#define ID_BUTTONGridCancel 40035 -#define ID_WINDOW_NEW2D 40150 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 156 -#define _APS_NEXT_COMMAND_VALUE 856 -#define _APS_NEXT_CONTROL_VALUE 1003 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/samples/mfc/standard/01_Geometry/src/ChildFrm.cpp b/samples/mfc/standard/01_Geometry/src/ChildFrm.cpp deleted file mode 100755 index 237dbe561b..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ChildFrm.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// ChildFrm.cpp : implementation of the CChildFrame class -// - -#include "stdafx.h" -#include "GeometryApp.h" - -#include "ChildFrm.h" - -///////////////////////////////////////////////////////////////////////////// -// CChildFrame - -IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd) - -BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd) - //{{AFX_MSG_MAP(CChildFrame) - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CChildFrame construction/destruction - -CChildFrame::CChildFrame() -{ - // TODO: add member initialization code here - -} - -CChildFrame::~CChildFrame() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// CChildFrame diagnostics - -#ifdef _DEBUG -void CChildFrame::AssertValid() const -{ - CMDIChildWnd::AssertValid(); -} - -void CChildFrame::Dump(CDumpContext& dc) const -{ - CMDIChildWnd::Dump(dc); -} - -#endif //_DEBUG - -void CChildFrame::ActivateFrame(int nCmdShow) -{ - // TODO: Add your specialized code here and/or call the base class - - static BOOL first=true; - if(first){ - first=false; - CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED); - return; - } - /* - POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition(); - CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos); - POSITION p=DocT->GetFirstDocPosition(); - DocT->GetNextDoc(p); - if(p==NULL) - nCmdShow = SW_SHOWMAXIMIZED; - */ - CMDIChildWnd::ActivateFrame(nCmdShow); -} - -int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_3dCHILDFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); - - return 0; -} - -BOOL CChildFrame::DestroyWindow() -{ - // TODO: Add your specialized code here and/or call the base class - - return CMDIChildWnd::DestroyWindow(); -} diff --git a/samples/mfc/standard/01_Geometry/src/ChildFrm.h b/samples/mfc/standard/01_Geometry/src/ChildFrm.h deleted file mode 100755 index 85b38d511c..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ChildFrm.h +++ /dev/null @@ -1,40 +0,0 @@ -// ChildFrm.h : interface of the CChildFrame class -// -///////////////////////////////////////////////////////////////////////////// -#if !defined(AFX_ChildFrame_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_) -#define AFX_ChildFrame_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_ - -#include - -class CChildFrame : public OCC_BaseChildFrame -{ - DECLARE_DYNCREATE(CChildFrame) -public: - CChildFrame(); - - // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CChildFrame) -public: - virtual void ActivateFrame(int nCmdShow = -1); - virtual BOOL DestroyWindow(); - //}}AFX_VIRTUAL - - // Implementation -public: - virtual ~CChildFrame(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - - // Generated message map functions -protected: - //{{AFX_MSG(CChildFrame) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// -#endif// MainFrm.cpp : implementation of the CMainFrame class diff --git a/samples/mfc/standard/01_Geometry/src/ChildFrm2d.cpp b/samples/mfc/standard/01_Geometry/src/ChildFrm2d.cpp deleted file mode 100755 index a26eecba61..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ChildFrm2d.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// ChildFrm2D.cpp : implementation of the CChildFrame2D class/ - -#include "stdafx.h" -#include "ChildFrm2d.h" -#include "GeometryApp.h" - -IMPLEMENT_DYNCREATE(CChildFrame2D, CMDIChildWnd) - -BEGIN_MESSAGE_MAP(CChildFrame2D, CMDIChildWnd) - //{{AFX_MSG_MAP(CChildFrame2D) - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -static UINT indicators[] = -{ - ID_SEPARATOR, // status line indicator - ID_INDICATOR_CAPS, - ID_INDICATOR_NUM, - ID_INDICATOR_SCRL, -}; - - -///////////////////////////////////////////////////////////////////////////// -// CChildFrame2D construction/destruction - -CChildFrame2D::CChildFrame2D() -{ - // TODO: add member initialization code here - -} - -CChildFrame2D::~CChildFrame2D() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// CChildFrame2D diagnostics - -#ifdef _DEBUG -void CChildFrame2D::AssertValid() const -{ - CMDIChildWnd::AssertValid(); -} - -void CChildFrame2D::Dump(CDumpContext& dc) const -{ - CMDIChildWnd::Dump(dc); -} - -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CChildFrame2D message handlers - -int CChildFrame2D::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - - if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || - !m_wndToolBar.LoadToolBar(IDR_2dCHILDFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - // TODO: Remove this if you don't want tool tips or a resizeable toolbar - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | - CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - - // TODO: Delete these three lines if you don't want the toolbar to - // be dockable - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); - - return 0; - -} - - -void CChildFrame2D::ActivateFrame(int nCmdShow) -{ - // TODO: Add your specialized code here and/or call the base class - - CMDIChildWnd::ActivateFrame(nCmdShow); -} diff --git a/samples/mfc/standard/01_Geometry/src/ChildFrm2d.h b/samples/mfc/standard/01_Geometry/src/ChildFrm2d.h deleted file mode 100755 index 525912f9fc..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ChildFrm2d.h +++ /dev/null @@ -1,46 +0,0 @@ -// ChildFrm.h : interface of the CChildFrame2D class -// -///////////////////////////////////////////////////////////////////////////// -#if !defined(AFX_ChildFrame2D_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_) -#define AFX_ChildFrame2D_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_ - -#include - -class CChildFrame2D : public OCC_BaseChildFrame -{ - DECLARE_DYNCREATE(CChildFrame2D) -public: - CChildFrame2D(); - - // Attributes -public: - - // Operations -public: - - // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CChildFrame2D) -public: - virtual void ActivateFrame(int nCmdShow = -1); - //}}AFX_VIRTUAL - - // Implementation -public: - virtual ~CChildFrame2D(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - - // Generated message map functions -protected: - //CToolBar m_wndToolBar; - //{{AFX_MSG(CChildFrame2D) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// -#endif diff --git a/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.cxx b/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.cxx deleted file mode 100755 index bcbc40ee43..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.cxx +++ /dev/null @@ -1,171 +0,0 @@ -// File: GeoAlgo_Sol.cxx -// Created: Mon Dec 15 16:32:27 1997 -// Author: Cascade_Manager -// - -#include "stdafx.h" - -#include "GeoAlgo_Sol.hxx" - -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -#include - - - -//============================================================================= -// Empty constructor -//============================================================================= -GeoAlgo_Sol::GeoAlgo_Sol():myIsDone(Standard_False) -{ - -} - - - -//============================================================================= -// Constructor with a file name -//============================================================================= -GeoAlgo_Sol::GeoAlgo_Sol(const Standard_CString aGroundName) -{ - myGround = Read(aGroundName); - // if an error occurs in the construction the method IsDone - // returns False. -} - - - -//============================================================================= -// Build(File) -// Build method from an empty object -//============================================================================= -void GeoAlgo_Sol::Build(const Standard_CString aGroundName) -{ - myGround = Read(aGroundName); - // if an error occurs in the construction the method IsDone - // returns False. -} - -//============================================================================= -// Build(Sequence of Points) -// Build method from an empty object -// Called also from the Builde method from a file -//============================================================================= -void GeoAlgo_Sol::Build(const TColgp_SequenceOfXYZ& seqOfXYZ) -{ - // Build the surface: - // points are projected on plane z = 0 - // the projection vector for each point is computed - // These data give the input constraints loaded into plate algorithm - - myIsDone = Standard_True; - Standard_Integer nbPnt = seqOfXYZ.Length(); - Standard_Integer i; - - //Filling plate - Plate_Plate myPlate; - std::cout<<" * Number of points = "<< nbPnt << std::endl; - for (i=1; i<= nbPnt; i++) { - gp_Pnt ptProj(seqOfXYZ.Value(i).X(), seqOfXYZ.Value(i).Y(), 0. ); - gp_Vec aVec( ptProj, seqOfXYZ.Value(i)); - gp_XY pntXY(seqOfXYZ.Value(i).X(),seqOfXYZ.Value(i).Y()); - Plate_PinpointConstraint PCst( pntXY,aVec.XYZ() ); - myPlate.Load(PCst);// Load plate - } - myPlate.SolveTI(2, 1.);// resolution - if (!myPlate.IsDone()) { - std::cout<<" plate computation has failed"<< std::endl; - myIsDone=Standard_False; - } - -// Computation of plate surface - gp_Pnt Or(0,0,0.); - gp_Dir Norm(0., 0., 1.); - Handle(Geom_Plane) myPlane = - new Geom_Plane(Or, Norm);// Plane of normal Oz - Handle(GeomPlate_Surface) myPlateSurf = - new GeomPlate_Surface( myPlane, myPlate);//plate surface - - GeomPlate_MakeApprox aMKS(myPlateSurf, Precision::Approximation(), 4, 7, 0.001, 0);//bspline surface - myGround = aMKS.Surface(); - // if an error occurs in the construction the method IsDone - // returns False. -} - - -//============================================================================= -// Surface() -// Returns the resulting surface as a bspline surface -//============================================================================= -Handle(Geom_BSplineSurface) GeoAlgo_Sol::Surface() const -{ - return myGround; -} - - - -//============================================================================ -// IsDone() -// Checks the construction of the surface -//============================================================================ -Standard_Boolean GeoAlgo_Sol::IsDone() const -{ -// Returns True if the construction successes, False otherwise - return myIsDone; -} - - - -//============================================================================= -// Read(File) -// Private method called from constructor -//============================================================================= -Handle(Geom_BSplineSurface) GeoAlgo_Sol::Read(const Standard_CString aGroundName) -{ - // This methods read a file of points ans build a surface using plate algorithm - - myIsDone = Standard_True; - Standard_Integer nbPnt=0; - - // Read points from the file - std::filebuf fic; - std::istream in(&fic); - - if (!fic.open(aGroundName,std::ios::in)){ - std::cout << " impossible to open a file : "<> x && in >> y && in >> z){ - pntXYZ.SetX(x); - pntXYZ.SetY(y); - pntXYZ.SetZ(z); - nbPnt++; - seqOfXYZ.Append(pntXYZ); - } - } - fic.close(); - Build(seqOfXYZ); - return myGround; -} diff --git a/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx b/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx deleted file mode 100755 index 4fb5ee5fdb..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// File generated by CPPExt (Value) -// Copyright (C) 1991,1995 by -// -// MATRA DATAVISION, FRANCE -// -// This software is furnished in accordance with the terms and conditions -// of the contract and with the inclusion of the above copyright notice. -// This software or any other copy thereof may not be provided or otherwise -// be made available to any other person. No title to an ownership of the -// software is hereby transferred. -// -// At the termination of the contract, the software and all copies of this -// software must be deleted. - -#ifndef _GeoAlgo_Sol_HeaderFile -#define _GeoAlgo_Sol_HeaderFile - -#ifndef _Geom_BSplineSurface_HeaderFile -#include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -#ifndef _Standard_CString_HeaderFile -#include -#endif -#include - -class Geom_BSplineSurface; - - -#ifndef _Standard_Macro_HeaderFile -#include -#endif - -class GeoAlgo_Sol -{ - -public: - - // Methods PUBLIC - // - Standard_EXPORT GeoAlgo_Sol(); - Standard_EXPORT GeoAlgo_Sol(const Standard_CString aGroundName); - Standard_EXPORT void Build(const Standard_CString aGroundName) ; - Standard_EXPORT void Build(const TColgp_SequenceOfXYZ& aSeqofPoints) ; - Standard_EXPORT Handle(Geom_BSplineSurface) Surface() const; - Standard_EXPORT Standard_Boolean IsDone() const; - -private: - - // Methods PRIVATE - // -Standard_EXPORT Handle(Geom_BSplineSurface) Read(const Standard_CString aGroundName) ; - - // Fields PRIVATE - // -Handle(Geom_BSplineSurface) myGround; -Standard_Boolean myIsDone; - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/samples/mfc/standard/01_Geometry/src/GeomSources.cpp b/samples/mfc/standard/01_Geometry/src/GeomSources.cpp deleted file mode 100755 index eab054b3a9..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeomSources.cpp +++ /dev/null @@ -1,4178 +0,0 @@ -// GeomSources.cpp: implementation of the GeomSources class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "GeomSources.h" -#include "GeometryApp.h" -#include "MainFrm.h" -#include -#include - -GeomSources::GeomSources() -{ -} - -GeomSources::~GeomSources() -{ -} -void GeomSources::PreProcess(CGeometryDoc* aDoc,DisplayType aDisplayType) -{ - if (aDisplayType == No2D3D ) - { - aDoc->GetAISContext()->EraseAll (Standard_True); - aDoc->Put3DOnTop(); - } - - if (aDisplayType == a2DNo3D) - { - aDoc->GetISessionContext()->EraseAll (Standard_True); - aDoc->Put2DOnTop(); - } - - if (aDisplayType != No2D3D && aDisplayType != a2D3D) - { - aDoc->Minimize3D(); - } - - if (aDisplayType != a2DNo3D && aDisplayType != a2D3D) - { - aDoc->Minimize2D(); - } - - if (aDisplayType == a2D3D) - { - aDoc->GetAISContext()->EraseAll (Standard_True); - aDoc->GetISessionContext()->EraseAll (Standard_True); - aDoc->Put3DOnTop(false); - aDoc->Put2DOnTop(false); - - // both on top - // send the message Title Horizontally to the child of doc main frame - CGeometryApp* TheAppli = (CGeometryApp*)AfxGetApp(); - CMainFrame* TheMainFrame= (CMainFrame*)TheAppli->m_pMainWnd; - ::SendMessage(TheMainFrame->m_hWndMDIClient, WM_MDITILE, 0, 0); - } -} - -void GeomSources::PostProcess (CGeometryDoc* aDoc, UINT anID, DisplayType aDisplayType, - const TCollection_AsciiString& theString, Standard_Boolean UpdateViewer, Standard_Real Coef) -{ - Standard_CString aString = theString.ToCString(); - if (UpdateViewer) - { - if (aDisplayType == No2D3D || aDisplayType == a2D3D) - { - aDoc->Fit3DViews(Coef); - } - - if (aDisplayType == a2DNo3D || aDisplayType == a2D3D) - { - aDoc->Fit2DViews(); - } - } - - TCollection_AsciiString Message("Results are "); - - switch (aDisplayType) - { - case No2DNo3D: Message = "All results are in this box \n"; - break; - case No2D3D: Message += "only in 3D \n"; - break; - case a2DNo3D: Message += "only in 2d \n"; - break; - case a2D3D: Message += "in both 2D and 3D \n"; - break; - } - Message += "====================================\n"; - Message += aString; - - CString text(Message.ToCString()); - aDoc->myCResultDialog.SetText(text); - - CString s; - if (! s.LoadString( anID )) - AfxMessageBox (L"Error Loading String: "); - - CString Title = s.Left( s.Find( '\n' )); - - aDoc->myCResultDialog.SetTitle(Title); - aDoc->SetTitle(Title); -} - -void GeomSources::AddSeparator(CGeometryDoc* /*aDoc*/,TCollection_AsciiString& aMessage) -{ - aMessage+= "------------------------------------------------------------------------\n"; -} -void GeomSources::DisplayPoint (CGeometryDoc* theDoc, - const gp_Pnt2d& thePoint, - const char* theText, - Standard_Boolean theToUpdateViewer, - Standard_Real theXoffset, - Standard_Real theYoffset, - Standard_Real theTextScale) -{ - Handle(ISession_Point) aGraphicPoint = new ISession_Point (thePoint); - theDoc->GetISessionContext()->Display (aGraphicPoint, Standard_False); - - Handle(AIS_TextLabel) aLabel = new AIS_TextLabel(); - aLabel->SetText (theText); - aLabel->SetPosition (gp_Pnt (thePoint.X() + theXoffset, thePoint.Y() + theYoffset, 0.0)); - //aLabel->SetHeight (theTextScale); - (void )theTextScale; - theDoc->GetISessionContext()->Display (aLabel, theToUpdateViewer); -} - -void GeomSources::DisplayPoint (CGeometryDoc* theDoc, - const gp_Pnt& thePoint, - const char* theText, - Standard_Boolean theToUpdateViewer, - Standard_Real theXoffset, - Standard_Real theYoffset, - Standard_Real theZoffset, - Standard_Real theTextScale) -{ - Handle(ISession_Point) aGraphicPoint = new ISession_Point (thePoint); - theDoc->GetAISContext()->Display (aGraphicPoint, Standard_False); - - Handle(AIS_TextLabel) aLabel = new AIS_TextLabel(); - aLabel->SetText (theText); - aLabel->SetPosition (gp_Pnt (thePoint.X() + theXoffset, thePoint.Y() + theYoffset, thePoint.Z() + theZoffset)); - //aLabel->SetHeight (theTextScale); - (void )theTextScale; - theDoc->GetAISContext()->Display (aLabel, theToUpdateViewer); -} - -void GeomSources::DisplayCurve(CGeometryDoc* aDoc, - Handle(Geom2d_Curve) aCurve, - Standard_Integer aColorIndex, - Standard_Boolean UpdateViewer) -{ - Handle(ISession2D_Curve) aGraphicCurve = new ISession2D_Curve(aCurve); - aGraphicCurve->SetColorIndex(aColorIndex) ; - aDoc->GetISessionContext()->Display(aGraphicCurve,UpdateViewer); -} - -void GeomSources::DisplayCurveAndCurvature(CGeometryDoc* aDoc, - Handle(Geom2d_Curve) aCurve, - Standard_Integer aColorIndex, - Standard_Boolean UpdateViewer) -{ - Handle(ISession2D_Curve) aGraphicCurve = new ISession2D_Curve(aCurve); - aGraphicCurve->SetDisplayCurbure(Standard_True) ; - aGraphicCurve->SetDiscretisation(20); - aGraphicCurve->SetColorIndex(aColorIndex) ; - aDoc->GetISessionContext()->Display(aGraphicCurve,UpdateViewer); -} - -void GeomSources::DisplayCurve (CGeometryDoc* theDoc, - Handle(Geom_Curve) theCurve, - Quantity_NameOfColor theNameOfColor, - Standard_Boolean theToUpdateViewer) -{ - Handle(ISession_Curve) aGraphicCurve = new ISession_Curve (theCurve); - aGraphicCurve->Attributes()->SetLineAspect (new Prs3d_LineAspect (theNameOfColor, Aspect_TOL_SOLID, 1.0)); - theDoc->GetAISContext()->Display (aGraphicCurve, theToUpdateViewer); -} - -void GeomSources::DisplayCurve(CGeometryDoc* aDoc, - Handle(Geom_Curve) aCurve, - Standard_Boolean UpdateViewer) -{ - Handle(ISession_Curve) aGraphicCurve = new ISession_Curve(aCurve); - aDoc->GetAISContext()->Display(aGraphicCurve,UpdateViewer); -} - -void GeomSources::DisplaySurface (CGeometryDoc* theDoc, - Handle(Geom_Surface) theSurface, - Quantity_NameOfColor theNameOfColor, - Standard_Boolean theToUpdateViewer) -{ - const Handle(AIS_InteractiveContext)& aCtx = theDoc->GetAISContext(); - Handle(Prs3d_ShadingAspect) aShadeAspect = new Prs3d_ShadingAspect(); - Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect (theNameOfColor, Aspect_TOL_SOLID, 1.0); - Handle(Prs3d_IsoAspect) anIsoAspect = new Prs3d_IsoAspect (theNameOfColor, Aspect_TOL_SOLID, 1.0, - aCtx->DefaultDrawer()->UIsoAspect()->Number()); - aShadeAspect->SetColor (theNameOfColor); - - Handle(ISession_Surface) aGraphicalSurface = new ISession_Surface (theSurface); - const Handle(Prs3d_Drawer)& aDrawer = aGraphicalSurface->Attributes(); - aDrawer->SetShadingAspect (aShadeAspect); - aDrawer->SetLineAspect (aLineAspect); - aDrawer->SetFreeBoundaryAspect (aLineAspect); - aDrawer->SetUIsoAspect (anIsoAspect); - aDrawer->SetVIsoAspect (anIsoAspect); - aCtx->Display (aGraphicalSurface, theToUpdateViewer); -} - -void GeomSources::DisplaySurface(CGeometryDoc* aDoc, - Handle(Geom_Surface) aSurface, - Standard_Boolean UpdateViewer) -{ - Handle(ISession_Surface) aGraphicalSurface = new ISession_Surface(aSurface); - aDoc->GetAISContext()->Display(aGraphicalSurface,UpdateViewer); -} - -void GeomSources::ResetView(CGeometryDoc* aDoc) -{ - Handle(V3d_View) aView = aDoc->GetAISContext()->CurrentViewer()->ActiveViews().First(); - aView->Reset(); -} - -// Function name : GeomSources::gpTest1 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest1(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_XYZ A(1,2,3); - gp_XYZ B(2,2,2); - gp_XYZ C(3,2,3); - Standard_Real result = A.DotCross(B,C); - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ -gp_XYZ A(1,2,3); \n\ -gp_XYZ B(2,2,2); \n\ -gp_XYZ C(3,2,3); \n\ -Standard_Real result = A.DotCross(B,C); \n\ - \n"); - AddSeparator(aDoc,Message); -//-------------------------------------------------------------- - - DisplayPoint(aDoc,gp_Pnt(A),"A (1,2,3)",false,0.1); - DisplayPoint(aDoc,gp_Pnt(B),"B (2,2,2)",false,0.1); - DisplayPoint(aDoc,gp_Pnt(C),"C (3,2,3)",false,0.1); - -// to add a numeric value in a TCollectionAsciiString - TCollection_AsciiString Message2 (result); - - Message+= " result = "; - Message+= Message2; - PostProcess(aDoc,ID_BUTTON_Test_1,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest2 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest2(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_Pnt P1(1,2,3); - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ -gp_Pnt P1(1,2,3); \n\ - \n"); - AddSeparator(aDoc,Message); -//-------------------------------------------------------------- - DisplayPoint(aDoc,P1,"P1 (1,2,3)",false,30); - PostProcess(aDoc,ID_BUTTON_Test_2,TheDisplayType,Message,Standard_False); - ResetView(aDoc); -} - - -// Function name : GeomSources::gpTest3 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest3(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_XYZ A(1,2,3); - gp_Pnt P2(A); - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ -gp_XYZ A(1,2,3); \n\ -gp_Pnt P2(A); \n\ - \n"); - AddSeparator(aDoc,Message); -//-------------------------------------------------------------- - DisplayPoint(aDoc,P2,"P2 (1,2,3)",false,30); - PostProcess(aDoc,ID_BUTTON_Test_3,TheDisplayType,Message,Standard_False); - ResetView(aDoc); -} - - -// Function name : GeomSources::gpTest4 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest4(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_Pnt P3 = gp::Origin(); - Standard_Real TheX = P3.X(); - Standard_Real TheY = P3.Y(); - Standard_Real TheZ = P3.Z(); - - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ -gp_Pnt P3 = gp::Origin(); \n\ -Standard_Real TheX = P3.X(); \n\ -Standard_Real TheY = P3.Y(); \n\ -Standard_Real TheZ = P3.Z(); \n\ - \n"); - AddSeparator(aDoc,Message); -//-------------------------------------------------------------- - DisplayPoint(aDoc,P3,"P3 = gp::Origin()",false,30); - - TCollection_AsciiString Message2 (TheX); - TCollection_AsciiString Message3 (TheY); - TCollection_AsciiString Message4 (TheZ); - - Message += " TheX = "; - Message += Message2; - Message += " TheY = "; - Message += Message3; - Message += " TheZ = "; - Message4 = TheZ; - Message += Message4; - - PostProcess(aDoc,ID_BUTTON_Test_4,TheDisplayType,Message,Standard_False); - ResetView(aDoc); -} - - -// Function name : GeomSources::gpTest5 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest5(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_Pnt P1(1,2,3); - gp_Pnt P2(3,4,5); - gp_Pnt PB = P1; - Standard_Real alpha = 3; - Standard_Real beta = 7; - PB.BaryCenter(alpha,P2,beta); - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ -gp_Pnt P1(1,2,3); \n\ -gp_Pnt P2(3,4,5); \n\ -gp_Pnt PB = P1; \n\ -Standard_Real alpha = 3; \n\ -Standard_Real beta = 7; \n\ -PB.BaryCenter(alpha,P2,beta); \n\ - \n"); - - AddSeparator(aDoc,Message); -//-------------------------------------------------------------- - - DisplayPoint(aDoc,P1,"P1",false,0.2); - DisplayPoint(aDoc,P2,"P2",false,0.2); - DisplayPoint(aDoc,PB,"PB = barycenter ( 3 * P1 , 7 * P2) ",false,0.2); - - TCollection_AsciiString Message2 (PB.X()); - TCollection_AsciiString Message3 (PB.Y()); - TCollection_AsciiString Message4 (PB.Z()); - - Message += " PB ( "; - Message += Message2; - Message += " , "; - Message += Message3; - Message += " , "; - Message += Message4; - Message += " ); "; - PostProcess(aDoc,ID_BUTTON_Test_5,TheDisplayType,Message); -} - - -// Function name : GeomSources::gpTest6 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest6(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - -// Compute a 3d point P as BaryCenter of an array of point - gp_Pnt P1(0,0,5); - gp_Pnt P2(1,2,3); - gp_Pnt P3(2,3,-2); - gp_Pnt P4(4,3,5); - gp_Pnt P5(5,5,4); - TColgp_Array1OfPnt array (1,5); // sizing array - array.SetValue(1,P1); - array.SetValue(2,P2); - array.SetValue(3,P3); - array.SetValue(4,P4); - array.SetValue(5,P5); - - Standard_Real Tolerance = 8; // ajout de la tolerance - GProp_PEquation PE (array,Tolerance); - - gp_Pnt P; // P declaration - Standard_Boolean IsPoint; - - if (PE.IsPoint()) - { - IsPoint = true; - P = PE .Point(); - } - else - { - IsPoint = false; - } - - if (PE.IsLinear()){ /*... */ } - if (PE.IsPlanar()){ /*... */ } - if (PE.IsSpace()) { /*... */ } - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ - \n\ -// Compute a 3d point P as BaryCenter of an array of point \n\ -gp_Pnt P1(0,0,5); \n\ -gp_Pnt P2(1,2,3); \n\ -gp_Pnt P3(2,3,-2); \n\ -gp_Pnt P4(4,3,5); \n\ -gp_Pnt P5(5,5,4); \n\ -TColgp_Array1OfPnt array (1,5); // sizing array \n\ -array.SetValue(1,P1); \n\ -array.SetValue(2,P2); \n\ -array.SetValue(3,P3); \n\ -array.SetValue(4,P4); \n\ -array.SetValue(5,P5); \n\ - \n\ -Standard_Real Tolerance = 8; // ajout de la tolerance \n\ -GProp_PEquation PE (array,Tolerance); \n\ - \n\ -gp_Pnt P; // P declaration \n\ -Standard_Boolean IsPoint; \n\ -if (PE.IsPoint()){IsPoint = true; \n\ - P = PE .Point();} \n\ - else { IsPoint = false; } \n\ -if (PE.IsLinear()){ /*... */ } \n\ -if (PE.IsPlanar()){ /*... */ } \n\ -if (PE.IsSpace()) { /*... */ } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - TCollection_AsciiString PointName("P"); - - - for(Standard_Integer i= array.Lower();i <= array.Upper(); i++) - { - TCollection_AsciiString TheString (i); - TheString = PointName+ TheString; - DisplayPoint(aDoc,array(i),TheString.ToCString(),false,0.5); - } - - DisplayPoint(aDoc,P,"P",false,0.5); - TCollection_AsciiString Message2 (P.X()); - TCollection_AsciiString Message3 (P.Y()); - TCollection_AsciiString Message4 (P.Z()); - - Message += " IsPoint = "; - if (IsPoint) - { - Message += "True --> "; - Message += " P ( "; - - Message += Message2; Message += " , "; - Message += Message3; Message += " , "; - Message += Message4; Message += " ); \n"; - } - else - Message += "False\n"; - - Message += " IsLinear = "; - if (PE.IsLinear()) - Message += "True \n"; - else - Message += "False\n"; - - Message += " IsPlanar = "; - if (PE.IsPlanar()) - Message += "True \n"; - else - Message += "False\n"; - - Message += " IsSpace = "; - if - (PE.IsSpace()) - Message += "True \n"; - else - Message += "False\n"; - - PostProcess(aDoc,ID_BUTTON_Test_6,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest7 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest7(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_Pnt2d P1(0,5); - gp_Pnt2d P2(5.5,1); - gp_Pnt2d P3(-2,2); - - Handle(Geom2d_Curve) C = - GCE2d_MakeArcOfCircle (P1,P2,P3).Value(); - - Standard_Real FirstParameter = C->FirstParameter(); - Standard_Real LastParameter = C->LastParameter(); - Standard_Real MiddleParameter = (FirstParameter+LastParameter)/2; - Standard_Real param = MiddleParameter; //in radians - - gp_Pnt2d P; - gp_Vec2d V; - C->D1(param,P,V); -// we recover point P and the vector V - -//============================================================== - TCollection_AsciiString Message ("\ - \n\ - \n\ -gp_Pnt2d P1(0,5); \n\ -gp_Pnt2d P2(5.5,1); \n\ -gp_Pnt2d P3(-2,2); \n\ - \n\ -Handle(Geom2d_TrimmedCurve) C = \n\ - GCE2d_MakeArcOfCircle (P1,P2,P3).Value(); \n\ - \n\ -Standard_Real FirstParameter = C->FirstParameter(); \n\ -Standard_Real LastParameter = C->LastParameter(); \n\ -Standard_Real MiddleParameter = \n\ - (FirstParameter+LastParameter)/2; \n\ -Standard_Real param = MiddleParameter; //in radians \n\ - \n\ -gp_Pnt2d P; \n\ -gp_Vec2d V; \n\ -C->D1(param,P,V); \n\ -// we recover point P and the vector V \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayCurve(aDoc,C); - Handle(ISession_Direction) aDirection = new ISession_Direction(P,V); - aDoc->GetISessionContext()->Display(aDirection, Standard_False); - - DisplayPoint(aDoc,P,"P",false,0.5); - - PostProcess(aDoc,ID_BUTTON_Test_7,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest8 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest8(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - Standard_Real radius = 5; - Handle(Geom2d_Circle) C = - new Geom2d_Circle(gp::OX2d(),radius); - Standard_Real param = 1.2*M_PI; - Geom2dLProp_CLProps2d CLP - (C,param,2,Precision::PConfusion()); - gp_Dir2d D; - CLP.Tangent(D); -// D is the Tangent direction at parameter 1.2*PI - -//============================================================== - TCollection_AsciiString Message (" \ - \n\ -Standard_Real radius = 5; \n\ -Handle(Geom2d_Circle) C = \n\ - new Geom2d_Circle(gp::OX2d(),radius); \n\ -Standard_Real param = 1.2*PI; \n\ -Geom2dLProp_CLProps2d CLP \n\ - (C,param,2,Precision::PConfusion()); \n\ - gp_Dir2d D; \n\ -CLP.Tangent(D); \n\ -// D is the Tangent direction at parameter 1.2*PI \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C); - aDoc->GetISessionContext()->Display(aCurve,Standard_False); - Handle(ISession_Direction) aDirection = new ISession_Direction(gp_Pnt2d(0,0),D,2); - aDoc->GetISessionContext()->Display(aDirection,Standard_False); - - TCollection_AsciiString Message2 (D.X()); - TCollection_AsciiString Message3 (D.Y()); - - Message += " D ( "; - Message += Message2; Message += " , "; - Message += Message3; Message += " ); \n"; - - PostProcess(aDoc,ID_BUTTON_Test_8,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest9 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest9(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - Standard_Real radius = 5; - Handle(Geom2d_Circle) C = - new Geom2d_Circle(gp::OX2d(),radius); - Geom2dAdaptor_Curve GAC (C); - Standard_Real startparam = 10*M_PI/180; - Standard_Real abscissa = 45*M_PI/180; - gp_Pnt2d P1; - C->D0(startparam,P1); - // abscissa is the distance along the curve from startparam - GCPnts_AbscissaPoint AP (GAC, abscissa, startparam); - gp_Pnt2d P2; - if (AP.IsDone()){C->D0(AP.Parameter(),P2);} - // P is now correctly set - - //============================================================== - TCollection_AsciiString Message (" \n\ - \n\ - \n\ -Standard_Real radius = 5; \n\ -Handle(Geom2d_Circle) C = \n\ - new Geom2d_Circle(gp::OX2d(),radius); \n\ -Geom2dAdaptor_Curve GAC (C); \n\ -Standard_Real startparam = 10*PI180; \n\ -Standard_Real abscissa = 45*PI180; \n\ -gp_Pnt2d P1; \n\ -C->D0(startparam,P1); \n\ -// abscissa is the distance along the curve from startparam \n\ -GCPnts_AbscissaPoint AP (GAC, abscissa, startparam); \n\ -gp_Pnt2d P2; \n\ -if (AP.IsDone()){C->D0(AP.Parameter(),P2);} \n\ -// P is now correctly set \n\ - \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C); - aDoc->GetISessionContext()->Display(aCurve,Standard_False); - - DisplayPoint(aDoc,P1,"P1"); - if (AP.IsDone()) DisplayPoint(aDoc,P2,"P2"); - - TCollection_AsciiString Message2 (P1.X()); - TCollection_AsciiString Message3 (P1.Y()); - - TCollection_AsciiString Message4 (P2.X()); - TCollection_AsciiString Message5 (P2.Y()); - - Message += " P1 ( "; - Message += Message2; Message += " , "; - Message += Message3; Message += " ); \n"; - - Message += " P2 ( "; - Message += Message4; Message += " , "; - Message += Message5; Message += " ); \n"; - PostProcess(aDoc,ID_BUTTON_Test_9,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest10 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest10(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt2d P; - Standard_Real radius = 5; - Handle(Geom2d_Circle) C = - new Geom2d_Circle(gp::OX2d(),radius); - Geom2dAdaptor_Curve GAC (C); - Standard_Real abscissa = 3; - GCPnts_UniformAbscissa UA (GAC,abscissa); - TColgp_SequenceOfPnt2d aSequence; - if (UA.IsDone()) - { - Standard_Real N = UA.NbPoints(); - Standard_Integer count = 1; - for(;count<=N;count++) - { - C->D0(UA.Parameter(count),P); - //Standard_Real Parameter = UA.Parameter(count); - // append P in a Sequence - aSequence.Append(P); - } - } - Standard_Real Abscissa = UA.Abscissa(); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt2d P; \n\ -Standard_Real radius = 5; \n\ -Handle(Geom2d_Circle) C = \n\ - new Geom2d_Circle(gp::OX2d(),radius); \n\ -Geom2dAdaptor_Curve GAC (C); \n\ -Standard_Real abscissa = 3; \n\ -GCPnts_UniformAbscissa UA (GAC,abscissa); \n\ -TColgp_SequenceOfPnt2d aSequence; \n\ -if (UA.IsDone()) \n\ - { \n\ - Standard_Real N = UA.NbPoints(); \n\ - Standard_Integer count = 1; \n\ - for(;count<=N;count++) \n\ - { \n\ - C->D0(UA.Parameter(count),P); \n\ - Standard_Real Parameter = UA.Parameter(count); \n\ - // append P in a Sequence \n\ - aSequence.Append(P); \n\ - } \n\ -} \n\ -Standard_Real Abscissa = UA.Abscissa(); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C); - aDoc->GetISessionContext()->Display(aCurve,Standard_False); - - TCollection_AsciiString aString; - for (Standard_Integer i=1;i<= aSequence.Length();i++) - { - - TCollection_AsciiString Message2 (i); - TCollection_AsciiString Message3 (UA.Parameter(i)); - - aString = "P"; - aString += Message2; - aString +=": Parameter : "; - aString += Message3; - - // First and Last texts are displayed with an Y offset, point 4 is upper - Standard_Real YOffset = -0.3; - YOffset += 0.2 * ( i == 1 ); - YOffset += 0.4 * ( i == 4 ); - YOffset += -0.2 * ( i == aSequence.Length() ); - - DisplayPoint(aDoc,aSequence(i),aString.ToCString(),false,0.5,YOffset,0.04); - } - - TCollection_AsciiString Message3 (Abscissa); - - Message += "Abscissa = "; - Message += Message3; - Message += " \n"; - - PostProcess(aDoc,ID_BUTTON_Test_10,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest11 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest11(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - Standard_Real radius = 5; - Handle(Geom_SphericalSurface) SP = - new Geom_SphericalSurface(gp_Ax3(gp::XOY()),radius); - Standard_Real u = 2; - Standard_Real v = 3; - gp_Pnt P = SP->Value(u,v); - -//============================================================== - TCollection_AsciiString Message (" \ - \n\ -Standard_Real radius = 5; \n\ -Handle(Geom_SphericalSurface) SP = \n\ - new Geom_SphericalSurface(gp_Ax3(gp::XOY()),radius); \n\ -Standard_Real u = 2; \n\ -Standard_Real v = 3; \n\ -gp_Pnt P = SP->Value(u,v); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplaySurface(aDoc,SP); - DisplayPoint(aDoc,P,"P",false,0.5); - TCollection_AsciiString Message2 (P.X()); - TCollection_AsciiString Message3 (P.Y()); - - Message += " P ( "; - Message += Message2; - Message += " , "; - Message += Message3; - Message += " ); \n"; - - PostProcess(aDoc,ID_BUTTON_Test_11,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest12 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest12(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt N,Q,P(1,2,3); - Standard_Real distance, radius = 5; - Handle(Geom_Curve) C = new Geom_Circle(gp::XOY(),radius); - GeomAPI_ProjectPointOnCurve PPC (P,C); - N = PPC.NearestPoint(); - Standard_Integer NbResults = PPC.NbPoints(); - - if(NbResults>0) - { - for(Standard_Integer i = 1;i<=NbResults;i++) - { - Q = PPC.Point(i); - distance = PPC.Distance(i); - // do something with Q or distance here - } - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt N,Q,P(1,2,3); \n\ -Standard_Real distance, radius = 5; \n\ -Handle(Geom_Circle) C = new Geom_Circle(gp::XOY(),radius); \n\ -GeomAPI_ProjectPointOnCurve PPC (P,C); \n\ -N = PPC.NearestPoint(); \n\ -Standard_Integer NbResults = PPC.NbPoints(); \n\ - \n\ -if(NbResults>0){ \n\ - for(Standard_Integer i = 1;i<=NbResults;i++){ \n\ - Q = PPC.Point(i); \n\ - distance = PPC.Distance(i); \n\ - // do something with Q or distance here \n\ - } \n\ - } \n\ - \n"); - AddSeparator(aDoc,Message); -//-------------------------------------------------------------- - - TCollection_AsciiString aString; - - DisplayPoint(aDoc,P,"P",false,0.5); - - TCollection_AsciiString Message2 (PPC.LowerDistance()); - - aString = "N : at Distance : "; - aString += Message2; - - DisplayPoint(aDoc,N,aString.ToCString(),false,0.5,0,-0.5); - DisplayCurve(aDoc,C,Quantity_NOC_YELLOW,false); - - if(NbResults>0) - { - for(Standard_Integer i = 1;i<=NbResults;i++) - { - Q = PPC.Point(i); - distance = PPC.Distance(i); - TCollection_AsciiString Message3 (i); - TCollection_AsciiString Message4 (distance); - - aString = "Q"; - aString += Message3; - aString +=": at Distance : "; - aString += Message4; - DisplayPoint(aDoc,Q,aString.ToCString(),false,0.5); - } - } - - PostProcess(aDoc,ID_BUTTON_Test_12,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest13 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest13(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt N,Q,P(7,8,9); - Standard_Real distance, radius = 5; - Handle(Geom_SphericalSurface) SP = - new Geom_SphericalSurface(gp_Ax3(gp::XOY()),radius); - GeomAPI_ProjectPointOnSurf PPS(P,SP); - N = PPS.NearestPoint(); - Standard_Integer NbResults = PPS.NbPoints(); - if(NbResults>0) - { - for(Standard_Integer i = 1;i<=NbResults;i++) - { - Q = PPS.Point(i); - distance = PPS.Distance(i); - // do something with Q or distance here - } - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt N,Q,P(7,8,9); \n\ -Standard_Real distance, radius = 5; \n\ -Handle(Geom_SphericalSurface) SP = \n\ - new Geom_SphericalSurface(gp_Ax3(gp::XOY()),radius); \n\ -GeomAPI_ProjectPointOnSurf PPS(P,SP); \n\ -N = PPS.NearestPoint(); \n\ -Standard_Integer NbResults = PPS.NbPoints(); \n\ -if(NbResults>0){ \n\ - for(Standard_Integer i = 1;i<=NbResults;i++){ \n\ - Q = PPS.Point(i); \n\ - distance = PPS.Distance(i); \n\ - // do something with Q or distance here \n\ - } \n\ -} \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - TCollection_AsciiString aString; - - DisplayPoint(aDoc,P,"P",false,0.5); - TCollection_AsciiString Message2 (PPS.LowerDistance()); - - aString = "N : at Distance : "; aString += Message2; - DisplayPoint(aDoc,N,aString.ToCString(),false,0.5,0,-0.6); - - Handle(ISession_Surface) aSurface = new ISession_Surface(SP); - Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes(); - CurDrawer->SetOwnLineAspects(); - CurDrawer->UIsoAspect()->SetNumber(10); - CurDrawer->VIsoAspect()->SetNumber(10); - aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer, Standard_False); - aDoc->GetAISContext()->Display(aSurface, Standard_False); - - if(NbResults>0) - { - for(Standard_Integer i = 1;i<=NbResults;i++) - { - - Q = PPS.Point(i); - distance = PPS.Distance(i); - TCollection_AsciiString Message3 (i); - TCollection_AsciiString Message4 (distance); - - aString = "Q"; - aString += Message3; - aString +=": at Distance : "; - aString += Message4; - - DisplayPoint(aDoc,Q,aString.ToCString(),false,0.5); - } - } - PostProcess(aDoc,ID_BUTTON_Test_13,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest14 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest14(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt P; - gp_Ax3 theAxe(gp::XOY()); - gp_Pln PL(theAxe); - Standard_Real MinorRadius = 5; - Standard_Real MajorRadius = 8; - gp_Elips EL (gp::YOZ(),MajorRadius,MinorRadius); - IntAna_IntConicQuad ICQ - (EL,PL,Precision::Angular(),Precision::Confusion()); - if (ICQ.IsDone()){ - Standard_Integer NbResults = ICQ.NbPoints(); - if (NbResults>0){ - for(Standard_Integer i = 1;i<=NbResults;i++){ - P = ICQ.Point(i); - // do something with P here - } - } - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P; \n\ -gp_Pln PL (gp_Ax3(gp::XOY())); \n\ -Standard_Real MinorRadius = 5; \n\ -Standard_Real MajorRadius = 8; \n\ -gp_Elips EL (gp::YOZ(),MajorRadius,MinorRadius); \n\ -IntAna_IntConicQuad ICQ \n\ - (EL,PL,Precision::Angular(),Precision::Confusion()); \n\ -if (ICQ.IsDone()){ \n\ - Standard_Integer NbResults = ICQ.NbPoints(); \n\ - if (NbResults>0){ \n\ - for(Standard_Integer i = 1;i<=NbResults;i++){ \n\ - P = ICQ.Point(i); \n\ - // do something with P here \n\ - } \n\ - } \n\ -} \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - Handle(Geom_Plane) aPlane = GC_MakePlane(PL).Value(); - Handle(Geom_RectangularTrimmedSurface) aSurface= new Geom_RectangularTrimmedSurface(aPlane,-8.,8.,-12.,12.); - - DisplaySurface(aDoc,aSurface); - - Handle(Geom_Curve) anEllips = GC_MakeEllipse(EL).Value(); - DisplayCurve(aDoc,anEllips,Quantity_NOC_YELLOW,false); - - TCollection_AsciiString aString; - - if (ICQ.IsDone()) - { - Standard_Integer NbResults = ICQ.NbPoints(); - if (NbResults>0) - { - for(Standard_Integer i = 1;i<=NbResults;i++) - { - - TCollection_AsciiString Message2(i); - - P = ICQ.Point(i); - aString = "P";aString += Message2; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5); - } - } - } - - PostProcess(aDoc,ID_BUTTON_Test_14,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest15 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest15(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt P1(1,2,3); - gp_Pnt P1Copy = P1; - gp_Pnt P2(5,4,6); - gp_Trsf TRSF; - TRSF.SetMirror(P2); - P1Copy.Transform(TRSF); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P1(1,2,3); \n\ -gp_Pnt P1Copy = P1; \n\ -gp_Pnt P2(5,4,6); \n\ -gp_Trsf TRSF; \n\ -TRSF.SetMirror(P2); \n\ -P1Copy.Transform(TRSF); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayPoint(aDoc,P1Copy,"P1Copy",false,0.5); - DisplayPoint(aDoc,P1,"P1",false,0.5); - DisplayPoint(aDoc,P2,"P2",false,0.5); - - PostProcess(aDoc,ID_BUTTON_Test_15,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest16 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest16(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_Pnt P1(1,2,3); - gp_Pnt P2(5,4,6); - gp_Vec V1 (P1,P2); - - gp_Pnt P3(10,4,7); - gp_Pnt P4(2,0,1); - gp_Vec V2 (P3,P4); - - Standard_Boolean result = - V1.IsOpposite(V2,Precision::Angular()); - // result should be true - -//============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P1(1,2,3); \n\ -gp_Pnt P2(5,4,6); \n\ -gp_Vec V1 (P1,P2); \n\ - \n\ -gp_Pnt P3(10,4,7); \n\ -gp_Pnt P4(2,0,1); \n\ -gp_Vec V2 (P3,P4); \n\ - \n\ -Standard_Boolean result = \n\ -V1.IsOpposite(V2,Precision::Angular()); \n\ -// result should be true \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayPoint(aDoc,P1,"P1",false,0.5); - DisplayPoint(aDoc,P2,"P2",false,0.5); - DisplayPoint(aDoc,P3,"P3",false,0.5); - DisplayPoint(aDoc,P4,"P4",false,0.5); - - Handle(ISession_Direction) aDirection1 = new ISession_Direction(P1,V1); - aDoc->GetAISContext()->Display(aDirection1, Standard_False); - - Handle(ISession_Direction) aDirection2 = new ISession_Direction(P3,V2); - aDoc->GetAISContext()->Display(aDirection2, Standard_False); - - Message += "result = "; - if (result) Message += "True \n"; else Message += "False \n"; - - PostProcess(aDoc,ID_BUTTON_Test_16,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest17 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest17(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Dir D1(1,2,3); - gp_Dir D2(3,4,5); - Standard_Real ang = D1.Angle(D2); - // the result is in radians in the range [0,PI] - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Dir D1(1,2,3); \n\ -gp_Dir D2(3,4,5); \n\ -Standard_Real ang = D1.Angle(D2); \n\ -// the result is in radians in the range [0,PI] \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - Handle(ISession_Direction) aDirection1 = new ISession_Direction(gp_Pnt(0,0,0),D1,3); - aDoc->GetAISContext()->Display(aDirection1, Standard_False); - - Handle(ISession_Direction) aDirection2 = new ISession_Direction(gp_Pnt(0,0,0),D2,3); - aDoc->GetAISContext()->Display(aDirection2, Standard_False); - - std::cout<<" D1.Angle(D2) : "<GetISessionContext()->Display(aDirection,Standard_False); - Handle(Geom2d_Parabola) aParabola = GCE2d_MakeParabola(Para); - Handle(Geom2d_TrimmedCurve) aTrimmedCurve = new Geom2d_TrimmedCurve(aParabola,-100,100); - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aTrimmedCurve); - //aCurve->SetColorIndex(3); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - - Message += " The entity A of type gp_Ax22d is not displayable \n "; - Message += " The entity D of type gp_Dir2d is displayed as a vector \n ( mean with a length != 1 ) \n "; - PostProcess(aDoc,ID_BUTTON_Test_18,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest19 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest19(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt P1(2,3,4); - gp_Dir D(4,5,6); - gp_Ax3 A(P1,D); - Standard_Boolean IsDirectA = A.Direct(); - - gp_Dir AXDirection = A.XDirection() ; - gp_Dir AYDirection = A.YDirection() ; - - gp_Pnt P2(5,3,4); - gp_Ax3 A2(P2,D); - A2.YReverse(); - // axis3 is now left handed - Standard_Boolean IsDirectA2 = A2.Direct(); - - gp_Dir A2XDirection = A2.XDirection() ; - gp_Dir A2YDirection = A2.YDirection() ; - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P1(2,3,4); \n\ -gp_Dir D(4,5,6); \n\ -gp_Ax3 A(P,D); \n\ -Standard_Boolean IsDirectA = A.Direct(); \n\ - \n\ -gp_Dir AXDirection = A.XDirection() ; \n\ -gp_Dir AYDirection = A.YDirection() ; \n\ - \n\ -gp_Pnt P2(5,3,4); \n\ -gp_Ax3 A2(P2,D); \n\ -A2.YReverse(); \n\ -// axis3 is now left handed \n\ -Standard_Boolean IsDirectA2 = A2.Direct(); \n\ - \n\ -gp_Dir A2XDirection = A2.XDirection() ; \n\ -gp_Dir A2YDirection = A2.YDirection() ; \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - // Set style for vector lines - Handle(Prs3d_LineAspect) anAxesAspect = new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1.0); - - DisplayPoint(aDoc,P1,"P1",false,0.1); - Handle(ISession_Direction) aDirection = new ISession_Direction(P1,D,2); - aDoc->GetAISContext()->Display(aDirection, Standard_False); - - Handle(ISession_Direction) aDirection2 = new ISession_Direction(P1,AXDirection,2); - aDirection2->SetText("A.XDirection"); - aDirection2->SetLineAspect (anAxesAspect); - aDoc->GetAISContext()->Display(aDirection2, Standard_False); - Handle(ISession_Direction) aDirection3 = new ISession_Direction(P1,AYDirection,2); - aDirection3->SetText("A.YDirection"); - aDirection3->SetLineAspect (anAxesAspect); - aDoc->GetAISContext()->Display(aDirection3, Standard_False); - - DisplayPoint(aDoc,P2,"P2",false,0.1); - Handle(ISession_Direction) aDirection4 = new ISession_Direction(P2,D,2); - aDoc->GetAISContext()->Display(aDirection4, Standard_False); - - Handle(ISession_Direction) aDirection5 = new ISession_Direction(P2,A2XDirection,2); - aDirection5->SetText("A2 XDirection"); - aDirection5->SetLineAspect (anAxesAspect); - aDoc->GetAISContext()->Display(aDirection5, Standard_False); - Handle(ISession_Direction) aDirection6 = new ISession_Direction(P2,A2YDirection,2); - aDirection6->SetText("A2 YDirection"); - aDirection6->SetLineAspect (anAxesAspect); - aDoc->GetAISContext()->Display(aDirection6, Standard_False); - - Message += "IsDirectA = "; - if(IsDirectA) - Message += "True = Right Handed \n"; - else - Message += "False = Left Handed \n"; - - Message += "IsDirectA2 = "; - if(IsDirectA2) - Message += "True = Right Handed \n"; - else - Message += "False = Left Handed \n"; - - PostProcess(aDoc,ID_BUTTON_Test_19,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest20 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest20(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt2d array (1,5); // sizing array - array.SetValue(1,gp_Pnt2d (0,0)); - array.SetValue(2,gp_Pnt2d (1,2)); - array.SetValue(3,gp_Pnt2d (2,3)); - array.SetValue(4,gp_Pnt2d (4,3)); - array.SetValue(5,gp_Pnt2d (5,5)); - Handle(Geom2d_BSplineCurve) SPL1 = - Geom2dAPI_PointsToBSpline(array); - - Handle(TColgp_HArray1OfPnt2d) harray = - new TColgp_HArray1OfPnt2d (1,5); // sizing harray - harray->SetValue(1,gp_Pnt2d (7+ 0,0)); - harray->SetValue(2,gp_Pnt2d (7+ 1,2)); - harray->SetValue(3,gp_Pnt2d (7+ 2,3)); - harray->SetValue(4,gp_Pnt2d (7+ 4,3)); - harray->SetValue(5,gp_Pnt2d (7+ 5,5)); - Geom2dAPI_Interpolate anInterpolation(harray,Standard_False,0.01); - anInterpolation.Perform(); - Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve(); - - Handle(TColgp_HArray1OfPnt2d) harray2 = - new TColgp_HArray1OfPnt2d (1,5); // sizing harray - harray2->SetValue(1,gp_Pnt2d (11+ 0,0)); - harray2->SetValue(2,gp_Pnt2d (11+ 1,2)); - harray2->SetValue(3,gp_Pnt2d (11+ 2,3)); - harray2->SetValue(4,gp_Pnt2d (11+ 4,3)); - harray2->SetValue(5,gp_Pnt2d (11+ 5,5)); - Geom2dAPI_Interpolate anInterpolation2(harray2,Standard_True,0.01); - anInterpolation2.Perform(); - Handle(Geom2d_BSplineCurve) SPL3 = anInterpolation2.Curve(); - // redefined C++ operator allows these assignments - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt2d array (1,5); // sizing array \n\ -array.SetValue(1,gp_Pnt2d (0,0)); \n\ -array.SetValue(2,gp_Pnt2d (1,2)); \n\ -array.SetValue(3,gp_Pnt2d (2,3)); \n\ -array.SetValue(4,gp_Pnt2d (4,3)); \n\ -array.SetValue(5,gp_Pnt2d (5,5)); \n\ -Handle(Geom2d_BSplineCurve) SPL1 = \n\ - Geom2dAPI_PointsToBSpline(array); \n\ - \n\ -Handle(TColgp_HArray1OfPnt2d) harray = \n\ - new TColgp_HArray1OfPnt2d (1,5); // sizing harray \n\ -harray->SetValue(1,gp_Pnt2d (7+ 0,0)); \n\ -harray->SetValue(2,gp_Pnt2d (7+ 1,2)); \n\ -harray->SetValue(3,gp_Pnt2d (7+ 2,3)); \n\ -harray->SetValue(4,gp_Pnt2d (7+ 4,3)); \n\ -harray->SetValue(5,gp_Pnt2d (7+ 5,5)); \n\ -Geom2dAPI_Interpolate anInterpolation(harray,Standard_False,0.01); \n\ -anInterpolation.Perform(); \n\ -Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve(); \n\ - \n\ -Handle(TColgp_HArray1OfPnt2d) harray2 = \n\ - new TColgp_HArray1OfPnt2d (1,5); // sizing harray \n"); - Message += "\ -harray2->SetValue(1,gp_Pnt2d (11+ 0,0)); \n\ -harray2->SetValue(2,gp_Pnt2d (11+ 1,2)); \n\ -harray2->SetValue(3,gp_Pnt2d (11+ 2,3)); \n\ -harray2->SetValue(4,gp_Pnt2d (11+ 4,3)); \n\ -harray2->SetValue(5,gp_Pnt2d (11+ 5,5)); \n\ -Geom2dAPI_Interpolate anInterpolation2(harray2,Standard_True,0.01); \n\ -anInterpolation2.Perform(); \n\ -Handle(Geom2d_BSplineCurve) SPL3 = anInterpolation2.Curve(); \n\ -// redefined C++ operator allows these assignments \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - TCollection_AsciiString aString; - for(int i = array.Lower();i<=array.Upper();i++) - { - gp_Pnt2d P = array(i); - TCollection_AsciiString Message2 (i); - aString = "array ";aString += Message2; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5); - } - for( int i = harray->Lower();i<=harray->Upper();i++) - { - gp_Pnt2d P = harray->Value(i); - TCollection_AsciiString Message2 (i); - aString = "harray ";aString += Message2; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5); - } - for( int i = harray2->Lower();i<=harray2->Upper();i++) - { - gp_Pnt2d P = harray2->Value(i); - TCollection_AsciiString Message2 (i); - aString = "harray2 ";aString += Message2; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5); - } - - if (!SPL1.IsNull()) - { - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(SPL1); - aCurve->SetColorIndex(3); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - } - else - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"SPL1.IsNull()", L"CasCade Error", MB_ICONERROR); - - if (!SPL2.IsNull()) - { - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(SPL2); - aCurve2->SetColorIndex(5); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - } - else - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"SPL2.IsNull()", L"CasCade Error", MB_ICONERROR); - - if (!SPL3.IsNull()) - { - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(SPL3); - aCurve2->SetColorIndex(6); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - } - else - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"SPL3.IsNull()", L"CasCade Error", MB_ICONERROR); - - Message += " SPL1 is Red \n"; - Message += " SPL2 is Blue \n"; - Message += " SPL3 is Yellow \n"; - - PostProcess(aDoc,ID_BUTTON_Test_20,TheDisplayType,Message); -} - -void GeomSources::gpTest21(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt2d P1(-184, 101); - gp_Pnt2d P2(20 ,84); - Standard_Real aheight = 1; - FairCurve_Batten B (P1,P2,aheight); - B.SetAngle1(22*M_PI/180); - B.SetAngle2(44*M_PI/180); - FairCurve_AnalysisCode anAnalysisCode; - B.Compute(anAnalysisCode); - Handle(Geom2d_BSplineCurve) C = B.Curve(); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt2d P1(-184, 101); \n\ -gp_Pnt2d P2(20 ,84); \n\ -Standard_Real aheight = 1; \n\ -FairCurve_Batten B (P1,P2,aheight); \n\ -B.SetAngle1(22*PI180); \n\ -B.SetAngle2(44*PI180); \n\ -FairCurve_AnalysisCode anAnalysisCode; \n\ -B.Compute(anAnalysisCode); \n\ -Handle(Geom2d_BSplineCurve) C = B.Curve(); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayCurveAndCurvature(aDoc,C,6,Standard_False); - - PostProcess(aDoc,ID_BUTTON_Test_21,TheDisplayType,Message); -} - -void GeomSources::gpTest22(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt2d P1(-184, 41); - gp_Pnt2d P2(20 ,24); - Standard_Real aheight = 1; - FairCurve_MinimalVariation MV (P1,P2,aheight); - MV.SetAngle1(22*M_PI/180); - MV.SetAngle2(44*M_PI/180); - - FairCurve_AnalysisCode anAnalysisCode; - MV.Compute(anAnalysisCode); - - Handle(Geom2d_BSplineCurve) C = MV.Curve(); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt2d P1(-184, 41); \n\ -gp_Pnt2d P2(20 ,24); \n\ -Standard_Real aheight = 1; \n\ -FairCurve_MinimalVariation MV (P1,P2,aheight); \n\ -MV.SetAngle1(22*PI180); \n\ -MV.SetAngle2(44*PI180); \n\ - \n\ -FairCurve_AnalysisCode anAnalysisCode; \n\ -MV.Compute(anAnalysisCode); \n\ - \n\ -Handle(Geom2d_BSplineCurve) C = MV.Curve(); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayCurveAndCurvature(aDoc,C,7,Standard_False); - DisplayPoint(aDoc,P1,"P1",false,0.5); - DisplayPoint(aDoc,P2,"P2",false,0.5); - - PostProcess(aDoc,ID_BUTTON_Test_22,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest23 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest23(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - Standard_Real major = 12; - Standard_Real minor = 4; - gp_Ax2d axis = gp::OX2d(); - Handle(Geom2d_Ellipse) E = GCE2d_MakeEllipse (axis,major,minor); - Handle(Geom2d_TrimmedCurve) TC = new Geom2d_TrimmedCurve(E,-1,2); - - // The segment goes in the direction Vfrom P1 - // to the point projected on this line by P2 - // In the example (0,6). - Handle(Geom2d_BSplineCurve) SPL = - Geom2dConvert::CurveToBSplineCurve(TC); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -Standard_Real major = 12; \n\ -Standard_Real minor = 4; \n\ -gp_Ax2d axis = gp::OX2d(); \n\ -Handle(Geom2d_Ellipse) E = GCE2d_MakeEllipse (axis,major,minor); \n\ - \n\ -Handle(Geom2d_TrimmedCurve) TC = new Geom2d_TrimmedCurve(E,-1,2); \n\ - \n\ -// The segment goes in the direction Vfrom P1 \n\ -// to the point projected on this line by P2 \n\ -// In the example (0,6). \n\ -Handle(Geom2d_BSplineCurve) SPL = \n\ - Geom2dConvert::CurveToBSplineCurve(TC); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(E); - aCurve->SetColorIndex(3); // Red - aCurve->SetTypeOfLine(Aspect_TOL_DOTDASH); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(SPL); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - - PostProcess(aDoc,ID_BUTTON_Test_23,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest24 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest24(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - Standard_Real radius = 5; - gp_Ax2d ax2d(gp_Pnt2d(2,3),gp_Dir2d(1,0)); - - Handle(Geom2d_Circle) circ2d = - new Geom2d_Circle(ax2d,radius); - - gp_Ax2d circ2dXAxis = circ2d->XAxis(); - - // create a 3D curve in a given plane - Handle(Geom_Curve) C3D = - GeomAPI::To3d(circ2d,gp_Pln(gp_Ax3(gp::XOY()))); - Handle(Geom_Circle) C3DCircle = - Handle(Geom_Circle)::DownCast(C3D); - - gp_Ax1 C3DCircleXAxis = C3DCircle->XAxis(); - - // project it to a 2D curve in another plane - - gp_Pln ProjectionPlane(gp_Pnt(1,1,0),gp_Dir( 1,1,1 )); - - Handle(Geom2d_Curve) C2D = - GeomAPI::To2d(C3D,ProjectionPlane); - - Handle(Geom2d_Circle) C2DCircle = - Handle(Geom2d_Circle)::DownCast(C2D); - gp_Ax2d C2DCircleXAxis = C2DCircle->XAxis(); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -Standard_Real radius = 5; \n\ -gp_Ax2d ax2d(gp_Pnt2d(2,3),gp_Dir2d(1,0)); \n\ - \n\ -Handle(Geom2d_Circle) circ2d = \n\ - new Geom2d_Circle(ax2d,radius); \n\ - \n\ -gp_Ax2d circ2dXAxis = circ2d->XAxis(); \n\ - \n\ -// create a 3D curve in a given plane \n\ -Handle(Geom_Curve) C3D = \n\ - GeomAPI::To3d(circ2d,gp_Pln(gp_Ax3(gp::XOY()))); \n\ -Handle(Geom_Circle) C3DCircle = \n\ - Handle(Geom_Circle)::DownCast(C3D); \n\ - \n\ -gp_Ax1 C3DCircleXAxis = C3DCircle->XAxis(); \n\ - \n\ -// project it to a 2D curve in another plane \n\ - \n\ -gp_Pln ProjectionPlane(gp_Pnt(1,1,0),gp_Dir( 1,1,1 )); \n\ - \n\ -Handle(Geom2d_Curve) C2D = \n\ - GeomAPI::To2d(C3D,ProjectionPlane); \n\ - \n\ -Handle(Geom2d_Circle) C2DCircle = \n\ - Handle(Geom2d_Circle)::DownCast(C2D); \n\ -gp_Ax2d C2DCircleXAxis = C2DCircle->XAxis(); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - Handle(Geom_Plane) aPlane = GC_MakePlane(gp_Pln(gp_Ax3(gp::XOY()))).Value(); - Handle(Geom_RectangularTrimmedSurface) aSurface= new Geom_RectangularTrimmedSurface(aPlane,-8.,8.,-12.,12.); - DisplaySurface(aDoc,aSurface); - - Handle(Geom_Plane) aProjectionPlane = GC_MakePlane(ProjectionPlane).Value(); - Handle(Geom_RectangularTrimmedSurface) aProjectionPlaneSurface= - new Geom_RectangularTrimmedSurface(aProjectionPlane,-8.,8.,-12.,12.); - - DisplaySurface(aDoc,aProjectionPlaneSurface); - - Standard_CString aC3DEntityTypeName = C3D->DynamicType()->Name(); - Standard_CString aC2DEntityTypeName = C2D->DynamicType()->Name(); - - Message += " C3D->DynamicType()->Name() = "; - Message += aC3DEntityTypeName; Message += " \n"; - Message += " C2D->DynamicType()->Name() = "; - Message += aC2DEntityTypeName; Message += " \n"; - - DisplayCurve(aDoc,circ2d,4,false); - DisplayCurve(aDoc,C3D,Quantity_NOC_YELLOW,false); - DisplayCurve(aDoc,C2D,5,false); - - Handle(ISession_Direction) aC3DCircleXAxisDirection = new ISession_Direction(C3DCircleXAxis.Location(),C3DCircleXAxis.Direction(),5.2); - aDoc->GetAISContext()->Display(aC3DCircleXAxisDirection, Standard_False); - - Handle(ISession_Direction) acirc2dXAxisDirection = new ISession_Direction(circ2dXAxis.Location(),circ2dXAxis.Direction(),5.2); - aDoc->GetISessionContext()->Display(acirc2dXAxisDirection, Standard_False); - - Handle(ISession_Direction) aC2DCircleXAxisDirection = new ISession_Direction(C2DCircleXAxis.Location(),C2DCircleXAxis.Direction(),5.2); - aDoc->GetISessionContext()->Display(aC2DCircleXAxisDirection, Standard_False); - - PostProcess(aDoc,ID_BUTTON_Test_24,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest25 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest25(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - Handle(TColgp_HArray1OfPnt2d) harray = - new TColgp_HArray1OfPnt2d (1,5); // sizing harray - harray->SetValue(1,gp_Pnt2d (0,0)); - harray->SetValue(2,gp_Pnt2d (-3,1)); - harray->SetValue(3,gp_Pnt2d (-2,5)); - harray->SetValue(4,gp_Pnt2d (2,9)); - harray->SetValue(5,gp_Pnt2d (-4,14)); - -Geom2dAPI_Interpolate anInterpolation(harray,Standard_False,0.01); -anInterpolation.Perform(); -Handle(Geom2d_BSplineCurve) SPL = anInterpolation.Curve(); - -gp_Pnt2d P1(-1,-2); -gp_Pnt2d P2(0,15); -gp_Dir2d V1 = gp::DY2d(); -Handle(Geom2d_TrimmedCurve) TC1 = - GCE2d_MakeSegment(P1,V1,P2); - -Standard_Real tolerance = Precision::Confusion(); -Geom2dAPI_InterCurveCurve ICC (SPL,TC1,tolerance); -Standard_Integer NbPoints =ICC.NbPoints(); -gp_Pnt2d PK; - -for (Standard_Integer k = 1;k<=NbPoints;k++) -{ - PK = ICC.Point(k); - // do something with each intersection point -} - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -Handle(TColgp_HArray1OfPnt2d) harray = \n\ - new TColgp_HArray1OfPnt2d (1,5); // sizing harray \n\ -harray->SetValue(1,gp_Pnt2d (0,0)); \n\ -harray->SetValue(2,gp_Pnt2d (-3,1)); \n\ -harray->SetValue(3,gp_Pnt2d (-2,5)); \n\ -harray->SetValue(4,gp_Pnt2d (2,9)); \n\ -harray->SetValue(5,gp_Pnt2d (-4,14)); \n\ - \n\ -Geom2dAPI_Interpolate anInterpolation(harray,Standard_False,0.01); \n\ -anInterpolation.Perform(); \n\ -Handle(Geom2d_BSplineCurve) SPL = anInterpolation.Curve(); \n\ - \n\ -gp_Pnt2d P1(-1,-2); \n\ -gp_Pnt2d P2(0,15); \n\ -gp_Dir2d V1 = gp::DY2d(); \n\ -Handle(Geom2d_TrimmedCurve) TC1= \n\ - GCE2d_MakeSegment(P1,V1,P2); \n\ - \n\ -Standard_Real tolerance = Precision::Confusion(); \n\ -Geom2dAPI_InterCurveCurve ICC (SPL,TC1,tolerance); \n\ -Standard_Integer NbPoints =ICC.NbPoints(); \n\ -gp_Pnt2d PK; \n\ -for (Standard_Integer k = 1;k<=NbPoints;k++) \n\ - { \n\ - PK = ICC.Point(k); \n\ - // do something with each intersection point \n\ - } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - Handle(ISession2D_Curve) aCurve1 = new ISession2D_Curve(SPL); - aCurve1->SetDisplayPole(Standard_False); - aDoc->GetISessionContext()->Display(aCurve1, Standard_False); - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(TC1); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - - TCollection_AsciiString aString; - for (Standard_Integer i = 1;i<=NbPoints;i++) - { - PK = ICC.Point(i); - // do something with each intersection point - TCollection_AsciiString Message2 (i); - TCollection_AsciiString Message3 (PK.X()); - TCollection_AsciiString Message4 (PK.Y()); - aString = "PK_"; - aString += Message2; - - DisplayPoint(aDoc,PK,aString.ToCString(),false,0.5); - - Message += "PK_"; - Message += Message2; - Message += " ( "; - Message += Message3; - Message += " , "; - Message += Message4; - Message += " )\n"; - } - - PostProcess(aDoc,ID_BUTTON_Test_25,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest26 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest26(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - //----------- Build TC1 ----------------------- - gp_Pnt2d P1(0,0); gp_Pnt2d P2(2,6); - gp_Dir2d V1 = gp::DY2d(); - Handle(Geom2d_TrimmedCurve) TC1 = GCE2d_MakeSegment(P1,V1,P2); - Standard_Real FP1 = TC1->FirstParameter(); - Standard_Real LP1 = TC1->LastParameter(); - //----------- Build TC2 ----------------------- - gp_Pnt2d P3(-9,6.5); gp_Dir2d V2 = gp::DX2d(); - Handle(Geom2d_TrimmedCurve) TC2 = GCE2d_MakeSegment(P3,V2,P2); - Standard_Real FP2 = TC1->FirstParameter(); - Standard_Real LP2 = TC1->LastParameter(); - //----------- Extrema TC1 / TC2 --------------- - Geom2dAPI_ExtremaCurveCurve ECC (TC1,TC2, FP1,LP1, FP2,LP2); - Standard_Real shortestdistance =-1; - if (ECC.NbExtrema() != 0) shortestdistance = ECC.LowerDistance(); - //----------- Build SPL1 ---------------------- - TColgp_Array1OfPnt2d array (1,5); // sizing array - array.SetValue(1,gp_Pnt2d (-4,0)); array.SetValue(2,gp_Pnt2d (-7,2)); - array.SetValue(3,gp_Pnt2d (-6,3)); array.SetValue(4,gp_Pnt2d (-4,3)); - array.SetValue(5,gp_Pnt2d (-3,5)); - Handle(Geom2d_BSplineCurve) SPL1 = Geom2dAPI_PointsToBSpline(array); - Standard_Real FPSPL1 = SPL1->FirstParameter(); - Standard_Real LPSPL1 = SPL1->LastParameter(); - //----------- Extrema TC1 / SPL1 ------------- - Geom2dAPI_ExtremaCurveCurve ECC2 (TC1,SPL1, FP1,LP1, FPSPL1,LPSPL1); - Standard_Real SPL1shortestdistance =-1; - if (ECC2.NbExtrema()!=0) SPL1shortestdistance = ECC2.LowerDistance(); - Standard_Integer NbExtrema = ECC2.NbExtrema(); - TColgp_Array2OfPnt2d aSolutionArray(1,NbExtrema,1,2); - for(int i=1;i <= NbExtrema; i++) - { - gp_Pnt2d P1x,P2x; - ECC2.Points(i,P1x,P2x); - aSolutionArray(i,1) = P1x; - aSolutionArray(i,2) = P2x; - } - - //============================================================== - TCollection_AsciiString Message (" \ -//----------- Build TC1 ----------------------- \n\ -gp_Pnt2d P1(0,0); gp_Pnt2d P2(2,6); \n\ -gp_Dir2d V1 = gp::DY2d(); \n\ -Handle(Geom2d_TrimmedCurve) TC1 = GCE2d_MakeSegment(P1,V1,P2); \n\ -Standard_Real FP1 = TC1->FirstParameter(); \n\ -Standard_Real LP1 = TC1->LastParameter(); \n\ -//----------- Build TC2 ----------------------- \n\ -gp_Pnt2d P3(-9,6.5); gp_Dir2d V2 = gp::DX2d(); \n\ -Handle(Geom2d_TrimmedCurve) TC2 = GCE2d_MakeSegment(P3,V2,P2); \n\ -Standard_Real FP2 = TC1->FirstParameter(); \n\ -Standard_Real LP2 = TC1->LastParameter(); \n\ -//----------- Extrema TC1 / TC2 --------------- \n\ -Geom2dAPI_ExtremaCurveCurve ECC (TC1,TC2, FP1,LP1, FP2,LP2); \n\ -Standard_Real shortestdistance =-1; \n\ -if (ECC.NbExtrema() != 0) shortestdistance = ECC.LowerDistance(); \n\ -//----------- Build SPL1 ---------------------- \n\ -TColgp_Array1OfPnt2d array (1,5); // sizing array \n\ -array.SetValue(1,gp_Pnt2d (-4,0)); array.SetValue(2,gp_Pnt2d (-7,2)); \n\ -array.SetValue(3,gp_Pnt2d (-6,3)); array.SetValue(4,gp_Pnt2d (-4,3)); \n\ -array.SetValue(5,gp_Pnt2d (-3,5)); \n\ -Handle(Geom2d_BSplineCurve) SPL1 = Geom2dAPI_PointsToBSpline(array); \n\ -Standard_Real FPSPL1 = SPL1->FirstParameter(); \n"); -Message += "\ -Standard_Real LPSPL1 = SPL1->LastParameter(); \n\ -//----------- Extrema TC1 / SPL1 ------------- \n\ -Geom2dAPI_ExtremaCurveCurve ECC2 (TC1,SPL1, FP1,LP1, FPSPL1,LPSPL1); \n\ -Standard_Real SPL1shortestdistance =-1; \n\ -if (ECC2.NbExtrema()!=0) SPL1shortestdistance = ECC2.LowerDistance(); \n\ -Standard_Integer NbExtrema = ECC2.NbExtrema(); \n\ -TColgp_Array2OfPnt2d aSolutionArray(1,NbExtrema,1,2); \n\ -for(int i=1;i <= NbExtrema; i++) { \n\ - gp_Pnt2d P1,P2; \n\ - ECC2.Points(i,P1,P2); \n\ - aSolutionArray(i,1) = P1; aSolutionArray(i,2) = P2; } \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - TCollection_AsciiString aString; - for(int i = array.Lower();i<=array.Upper();i++) - { - TCollection_AsciiString Message2 (i); - gp_Pnt2d P = array(i); - aString = "array "; - aString += Message2; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5); - } - - if (!SPL1.IsNull()) - { - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(SPL1); - aCurve->SetDisplayPole(Standard_False); - aCurve->SetColorIndex(3); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - } - else - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"SPL1.IsNull()", L"CasCade Error", MB_ICONERROR); - - Handle(ISession2D_Curve) aCurve1 = new ISession2D_Curve(TC1); - aCurve1->SetColorIndex(6); - aDoc->GetISessionContext()->Display(aCurve1, Standard_False); - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(TC2); - aCurve2->SetColorIndex(5); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - - for(int i=1;i <= NbExtrema; i++) - { - gp_Pnt2d P1x =aSolutionArray(i,1); - - TCollection_AsciiString Message2 (i); - aString = "P1_"; - aString += Message2; - DisplayPoint(aDoc,P1x,aString.ToCString(),false,0.7*i); - - gp_Pnt2d P2x = aSolutionArray(i,2); - - Handle(Geom2d_TrimmedCurve) SolutionCurve = - GCE2d_MakeSegment(P1x,P2x); - Handle(ISession2D_Curve) aSolutionCurve = new ISession2D_Curve(SolutionCurve); - aDoc->GetISessionContext()->Display(aSolutionCurve, Standard_False); - } - - Message += "TC1 is Yellow ,TC2 is Blue ,SPL1 is Red \n"; - Message += "ECC.NbExtrema() = "; - Message += ECC.NbExtrema(); - Message += " shortestdistance = "; - Message+= shortestdistance; - Message += "\n"; - Message += "ECC2.NbExtrema() = "; - Message += NbExtrema; - Message += " SPL1shortestdistance = "; - Message+= SPL1shortestdistance; - Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_26,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest27 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest27(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt2d array (1,5); // sizing array - array.SetValue(1,gp_Pnt2d (-4,0)); array.SetValue(2,gp_Pnt2d (-7,2)); - array.SetValue(3,gp_Pnt2d (-6,3)); array.SetValue(4,gp_Pnt2d (-4,3)); - array.SetValue(5,gp_Pnt2d (-3,5)); - Handle(Geom2d_BSplineCurve) SPL1 = Geom2dAPI_PointsToBSpline(array); - - Standard_Real dist = 1; - Handle(Geom2d_OffsetCurve) OC = - new Geom2d_OffsetCurve(SPL1,dist); - Standard_Boolean result = OC->IsCN(2); - Standard_Real dist2 = 1.5; - Handle(Geom2d_OffsetCurve) OC2 = - new Geom2d_OffsetCurve(SPL1,dist2); - Standard_Boolean result2 = OC2->IsCN(2); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt2d array (1,5); // sizing array \n\ -array.SetValue(1,gp_Pnt2d (-4,0)); array.SetValue(2,gp_Pnt2d (-7,2)); \n\ -array.SetValue(3,gp_Pnt2d (-6,3)); array.SetValue(4,gp_Pnt2d (-4,3)); \n\ -array.SetValue(5,gp_Pnt2d (-3,5)); \n\ -Handle(Geom2d_BSplineCurve) SPL1 = Geom2dAPI_PointsToBSpline(array); \n\ - \n\ -Standard_Real dist = 1; \n\ -Handle(Geom2d_OffsetCurve) OC = \n\ - new Geom2d_OffsetCurve(SPL1,dist); \n\ -Standard_Boolean result = OC->IsCN(2); \n\ - \n\ -Standard_Real dist2 = 1.5; \n\ -Handle(Geom2d_OffsetCurve) OC2 = \n\ - new Geom2d_OffsetCurve(SPL1,dist2); \n\ -Standard_Boolean result2 = OC2->IsCN(2); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - Handle(ISession2D_Curve) aCurve1 = new ISession2D_Curve(SPL1); - aCurve1->SetColorIndex(6); - aDoc->GetISessionContext()->Display(aCurve1, Standard_False); - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(OC); - aCurve2->SetColorIndex(5); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - Handle(ISession2D_Curve) aCurve3 = new ISession2D_Curve(OC2); - aCurve3->SetColorIndex(3); - aDoc->GetISessionContext()->Display(aCurve3, Standard_False); - - - Message += "SPL1 is Yellow \n"; - Message += "OC is Blue \n"; - Message += "OC2 is Red \n\n"; - Message += " Warning, Continuity is not guaranteed : \n "; - if(result) - Message += " result = True \n"; - else - Message += " result = False \n"; - if(result2) - Message += " result2 = True \n"; - else - Message += " result2 = False \n"; - - PostProcess(aDoc,ID_BUTTON_Test_27,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest28 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest28(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt2d P1(1,2); - gp_Pnt2d P2(4,5); - gp_Lin2d L = gce_MakeLin2d(P1,P2); - // assignment by overloaded operator - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt2d P1(1,2); \n\ -gp_Pnt2d P2(4,5); \n\ -gp_Lin2d L = gce_MakeLin2d(P1,P2); \n\ -// assignment by overloaded operator \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayPoint(aDoc,P1,"P1",false,0.5); - DisplayPoint(aDoc,P2,"P2",false,0.5); - - Handle(Geom2d_TrimmedCurve) aLine = GCE2d_MakeSegment(L,-3,8); - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aLine); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - - PostProcess(aDoc,ID_BUTTON_Test_28,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest29 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest29(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt2d P1(1,2); - gp_Pnt2d P2(4,5); - gp_Lin2d L; - GccAna_Pnt2dBisec B(P1,P2); - if (B.IsDone()) - { - L = B.ThisSolution(); - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt2d P1(1,2); \n\ -gp_Pnt2d P2(4,5); \n\ -gp_Lin2d L; \n\ -GccAna_Pnt2dBisec B(P1,P2); \n\ -if (B.IsDone()) \n\ - { \n\ - L = B.ThisSolution(); \n\ - } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayPoint(aDoc,P1,"P1",false,0.5); - DisplayPoint(aDoc,P2,"P2",false,0.5); - - if (B.IsDone()) - { - Handle(Geom2d_TrimmedCurve) aLine = GCE2d_MakeSegment(L,-8,8); - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aLine); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - } - - if (B.IsDone()) Message += " \n B Is Done "; - else Message += " \n B Is not Done "; - PostProcess(aDoc,ID_BUTTON_Test_29,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest30 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest30(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType =a2DNo3D ; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt2d P1 (2,3); - gp_Pnt2d P2 (4,4); - gp_Pnt2d P3 (6,7); - gp_Pnt2d P4 (10,10); - gp_Circ2d C = gce_MakeCirc2d (P1,P2,P3); - GccEnt_QualifiedCirc QC = GccEnt::Outside(C); - GccAna_Lin2d2Tan LT (QC,P4,Precision::Confusion()); - if (LT.IsDone()) - { - Standard_Integer NbSol = LT.NbSolutions(); - for(Standard_Integer k=1; k<=NbSol; k++) - { - gp_Lin2d L = LT.ThisSolution(k); - // do something with L - } - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt2d P1 (2,3); \n\ -gp_Pnt2d P2 (4,4); \n\ -gp_Pnt2d P3 (6,7); \n\ -gp_Pnt2d P4 (10,10); \n\ -gp_Circ2d C = gce_MakeCirc2d (P1,P2,P3); \n\ -GccEnt_QualifiedCirc QC = GccEnt::Outside(C); \n\ -GccAna_Lin2d2Tan LT (QC,P4,Precision::Confusion()); \n\ -Standard_Integer NbSol; \n\ -if (LT.IsDone()) \n\ - { \n\ - NbSol = LT.NbSolutions(); \n\ - for(Standard_Integer k=1; k<=NbSol; k++) \n\ - { \n\ - gp_Lin2d L = LT.ThisSolution(k); \n\ - // do something with L \n\ - } \n\ - } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayPoint(aDoc,P1,"P1",false,0.5,-1,0.1); - DisplayPoint(aDoc,P2,"P2",false,0.5,-0.7,0.1); - DisplayPoint(aDoc,P3,"P3",false,0.5,-0.5,0.1); - DisplayPoint(aDoc,P4,"P4",false,0.5,0,0.1); - - Handle(Geom2d_Circle) aCircle = new Geom2d_Circle(C); - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aCircle); - aCurve->SetColorIndex(5); - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - - if (LT.IsDone()) - { - Standard_Integer NbSol = LT.NbSolutions(); - for(Standard_Integer k=1; k<=NbSol; k++) - { - gp_Lin2d L = LT.ThisSolution(k); - Handle(Geom2d_TrimmedCurve) aLine = GCE2d_MakeSegment(L,-10,20); - Handle(ISession2D_Curve) aCurveN = new ISession2D_Curve(aLine); - aDoc->GetISessionContext()->Display(aCurveN, Standard_False); - } - } - Message += " C is Blue \n\n"; - Message += "LT.IsDone() = "; - if (LT.IsDone()) Message += "True \n"; else Message += "False \n"; - TCollection_AsciiString Message2 (LT.NbSolutions()); - Message += "NbSol = "; Message += Message2 ; Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_30,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest31 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest31(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - -gp_Pnt2d P1 (9,6); -gp_Pnt2d P2 (10,4); -gp_Pnt2d P3 (6,7); -gp_Circ2d C = gce_MakeCirc2d (P1,P2,P3); -GccEnt_QualifiedCirc QC = GccEnt::Outside(C); -gp_Pnt2d P4 (-2,7); -gp_Pnt2d P5 (12,-3); -gp_Lin2d L = GccAna_Lin2d2Tan(P4,P5,Precision::Confusion()).ThisSolution(1); -GccEnt_QualifiedLin QL = GccEnt::Unqualified(L); -Standard_Real radius = 2; -GccAna_Circ2d2TanRad TR (QC,QL,radius,Precision::Confusion()); -Standard_Real parsol,pararg; -gp_Pnt2d tangentpoint1,tangentpoint2; -gp_Circ2d circ; -if (TR.IsDone()) -{ - Standard_Integer NbSol = TR.NbSolutions(); - for (Standard_Integer k=1; k<=NbSol; k++) - { - circ = TR.ThisSolution(k); - // find the solution circle - TR.Tangency1(k,parsol,pararg,tangentpoint1); - // find the first tangent point - TR.Tangency2(k,parsol,pararg,tangentpoint2); - // find the second tangent point - } -} - - //============================================================== - TCollection_AsciiString Message; - Message = "\ - \n\ -gp_Pnt2d P1 (9,6); \n\ -gp_Pnt2d P2 (10,4); \n\ -gp_Pnt2d P3 (6,7); \n\ -gp_Circ2d C = gce_MakeCirc2d (P1,P2,P3); \n\ -GccEnt_QualifiedCirc QC = GccEnt::Outside(C); \n\ -gp_Pnt2d P4 (-2,7); \n\ -gp_Pnt2d P5 (12,-3); \n\ -gp_Lin2d L = GccAna_Lin2d2Tan(P4,P5,Precision::Confusion()).ThisSolution(1); \n\ -GccEnt_QualifiedLin QL = GccEnt::Unqualified(L); \n\ -Standard_Real radius = 2; \n\ -GccAna_Circ2d2TanRad TR (QC,QL,radius,Precision::Confusion()); \n\ -Standard_Real parsol,pararg; \n\ -gp_Pnt2d tangentpoint1,tangentpoint2; \n\ -gp_Circ2d circ; \n\ -if (TR.IsDone()) \n\ - { \n\ - Standard_Integer NbSol = TR.NbSolutions(); \n\ - for (Standard_Integer k=1; k<=NbSol; k++) \n\ - { \n"; - Message += "\ - circ = TR.ThisSolution(k); \n\ - // find the solution circle \n\ - TR.Tangency1(k,parsol,pararg,tangentpoint1); \n\ - // find the first tangent point \n\ - TR.Tangency2(k,parsol,pararg,tangentpoint2); \n\ - // find the second tangent point \n\ - } \n\ - } \n\ - \n"; - AddSeparator(aDoc,Message); - - //-------------------------------------------------------------- - DisplayPoint(aDoc,P1,"P1",false,0.3); - DisplayPoint(aDoc,P2,"P2",false,0.3); - DisplayPoint(aDoc,P3,"P3",false,0.3); - DisplayPoint(aDoc,P4,"P4",false,0.3); - DisplayPoint(aDoc,P5,"P5",false,0.3); - - Handle(Geom2d_Circle) aCircle = new Geom2d_Circle(C); - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aCircle); - aCurve->SetColorIndex(3); - - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - Handle(Geom2d_TrimmedCurve) aLine = GCE2d_MakeSegment(L,-2,20); - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(aLine); - aCurve2->SetColorIndex(5); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - - if (TR.IsDone()) - { - Standard_Integer NbSol = TR.NbSolutions(); - for (Standard_Integer k=1; k<=NbSol; k++) - { - circ = TR.ThisSolution(k); - Handle(Geom2d_Circle) aCircleN = new Geom2d_Circle(circ); - Handle(ISession2D_Curve) aCurveN = new ISession2D_Curve(aCircleN); - aDoc->GetISessionContext()->Display(aCurveN, Standard_False); - - // find the solution circle - TR.Tangency1(k,parsol,pararg,tangentpoint1); - // find the first tangent point - TR.Tangency2(k,parsol,pararg,tangentpoint2); - // find the second tangent point - DisplayPoint(aDoc,tangentpoint1,"tangentpoint1",false,0.3); - DisplayPoint(aDoc,tangentpoint2,"tangentpoint2",false,0.3); - } - } - Message += "C is Red \n"; - Message += "L is Blue \n"; - PostProcess(aDoc,ID_BUTTON_Test_31,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest32 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest32(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - Standard_Real major = 12; - Standard_Real minor = 4; - gp_Ax2d axis = gp::OX2d(); - gp_Elips2d EE(axis,major,minor); - Handle(Geom2d_TrimmedCurve) arc = GCE2d_MakeArcOfEllipse(EE,0.0,M_PI/4); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -Standard_Real major = 12; \n\ -Standard_Real minor = 4; \n\ -gp_Ax2d axis = gp::OX2d(); \n\ -gp_Elips2d EE(axis,major,minor); \n\ -Handle(Geom2d_TrimmedCurve) arc = GCE2d_MakeArcOfEllipse(EE,0.0,PI/4); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - Handle(Geom2d_Ellipse) E = GCE2d_MakeEllipse(EE); - Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(E); - aCurve->SetColorIndex(3); - aCurve->SetTypeOfLine(Aspect_TOL_DOTDASH); - //SetWidthOfLine - aDoc->GetISessionContext()->Display(aCurve, Standard_False); - Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(arc); - aDoc->GetISessionContext()->Display(aCurve2, Standard_False); - TCollection_AsciiString Message2 (M_PI); - Message += " PI = ";Message+= Message2; - - PostProcess(aDoc,ID_BUTTON_Test_32,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest33 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest33(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt P1(0,0,1); - gp_Pnt P2(1,2,2); - gp_Pnt P3(2,3,3); - gp_Pnt P4(4,3,4); - gp_Pnt P5(5,5,5); - TColgp_Array1OfPnt array (1,5); // sizing array - array.SetValue(1,P1); - array.SetValue(2,P2); - array.SetValue(3,P3); - array.SetValue(4,P4); - array.SetValue(5,P5); - Handle(TColgp_HArray1OfPnt) harray = - new TColgp_HArray1OfPnt (1,5); // sizing harray - harray->SetValue(1,P1.Translated(gp_Vec(4,0,0))); - harray->SetValue(2,P2.Translated(gp_Vec(4,0,0))); - harray->SetValue(3,P3.Translated(gp_Vec(4,0,0))); - harray->SetValue(4,P4.Translated(gp_Vec(4,0,0))); - harray->SetValue(5,P5.Translated(gp_Vec(4,0,0))); - Handle(Geom_BSplineCurve) SPL1 = - GeomAPI_PointsToBSpline(array).Curve(); - - GeomAPI_Interpolate anInterpolation(harray,Standard_False,Precision::Approximation()); - anInterpolation.Perform(); - - Handle(Geom_BSplineCurve) SPL2; - if (anInterpolation.IsDone()) - SPL2 = anInterpolation.Curve(); - else - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"The Interpolation is Not done", L"CasCade Warning", MB_ICONWARNING); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P1(0,0,1); \n\ -gp_Pnt P2(1,2,2); \n\ -gp_Pnt P3(2,3,3); \n\ -gp_Pnt P4(4,3,4); \n\ -gp_Pnt P5(5,5,5); \n\ -TColgp_Array1OfPnt array (1,5); // sizing array \n\ -array.SetValue(1,P1); \n\ -array.SetValue(2,P2); \n\ -array.SetValue(3,P3); \n\ -array.SetValue(4,P4); \n\ -array.SetValue(5,P5); \n\ -Handle(TColgp_HArray1OfPnt) harray = \n\ - new TColgp_HArray1OfPnt (1,5); // sizing harray \n\ -harray->SetValue(1,P1.Translated(gp_Vec(4,0,0))); \n\ -harray->SetValue(2,P2.Translated(gp_Vec(4,0,0))); \n\ -harray->SetValue(3,P3.Translated(gp_Vec(4,0,0))); \n\ -harray->SetValue(4,P4.Translated(gp_Vec(4,0,0))); \n\ -harray->SetValue(5,P5.Translated(gp_Vec(4,0,0))); \n\ -Handle(Geom_BSplineCurve) SPL1 = \n\ - GeomAPI_PointsToBSpline(array).Curve(); \n"); - Message += "\ - \n\ -GeomAPI_Interpolate anInterpolation(harray,Standard_False,Precision::Approximation()); \n\ -anInterpolation.Perform(); \n\ - \n\ -Handle(Geom_BSplineCurve) SPL2; \n\ -if (anInterpolation.IsDone()) \n\ - SPL2 = anInterpolation.Curve(); \n\ -else \n\ - MessageBox(0,\"The Interpolation is Not done\",\"CasCade Warning\",MB_ICONWARNING); \n\ - \n"; - AddSeparator(aDoc,Message); - - //-------------------------------------------------------------- - - TCollection_AsciiString aString; - for(Standard_Integer i = array.Lower();i<=array.Upper();i++) - { - - TCollection_AsciiString Message2 (i); - gp_Pnt P = array(i); - - aString = "P"; - aString += Message2; - if (i == 1) aString += " (array) "; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5);\ - - aString = "P"; - aString += Message2; - if (i == 1) aString += " (harray) "; - DisplayPoint(aDoc,P.Translated(gp_Vec(4,0,0)),aString.ToCString(),false,0.5);\ - - } - - Handle(ISession_Curve) aCurve = new ISession_Curve(SPL1); - aDoc->GetAISContext()->SetDisplayMode(aCurve,1, Standard_False); - aDoc->GetAISContext()->Display(aCurve, Standard_False); - - if (anInterpolation.IsDone()) - { - Handle(ISession_Curve) aCurve2 = new ISession_Curve(SPL2); - aDoc->GetAISContext()->SetDisplayMode(aCurve2,1, Standard_False); - aDoc->GetAISContext()->Display(aCurve2, Standard_False); - } - - PostProcess(aDoc,ID_BUTTON_Test_33,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest34 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest34(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - TColgp_Array1OfPnt array (1,5); // sizing array - array.SetValue(1,gp_Pnt(0,0,1)); - array.SetValue(2,gp_Pnt(1,2,2)); - array.SetValue(3,gp_Pnt(2,3,3)); - array.SetValue(4,gp_Pnt(4,4,4)); - array.SetValue(5,gp_Pnt(5,5,5)); - - GProp_PEquation PE (array,1.5 ); - - if (PE.IsPoint()) - {/* ... */} - gp_Lin L; - if (PE.IsLinear()) - { - L = PE.Line(); - } - if (PE.IsPlanar()) - {/* ... */} - if (PE.IsSpace()) - {/* ... */} - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array (1,5); // sizing array \n\ -array.SetValue(1,gp_Pnt(0,0,1)); \n\ -array.SetValue(2,gp_Pnt(1,2,2)); \n\ -array.SetValue(3,gp_Pnt(2,3,3)); \n\ -array.SetValue(4,gp_Pnt(4,4,4)); \n\ -array.SetValue(5,gp_Pnt(5,5,5)); \n\ - \n\ -GProp_PEquation PE (array,1.5 ); \n\ - \n\ -if (PE.IsPoint()){ /* ... */ } \n\ -gp_Lin L; \n\ -if (PE.IsLinear()) { L = PE.Line(); } \n\ -if (PE.IsPlanar()){ /* ... */ } \n\ -if (PE.IsSpace()) { /* ... */ } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - TCollection_AsciiString aString; - for(Standard_Integer i = array.Lower();i<=array.Upper();i++) - { - TCollection_AsciiString Message2 (i); - gp_Pnt P = array(i); - - aString = "P"; - aString += Message2; - DisplayPoint(aDoc,P,aString.ToCString(),false,0.5); - } - - Message += " PE.IsPoint() = "; - if (PE.IsPoint()) - Message += "True \n"; - else - Message += "False\n"; - - if (PE.IsLinear()) { - Message += " PE.IsLinear() = True \n"; - L = PE.Line(); - Handle(Geom_Line) aLine = new Geom_Line(L); - Handle(Geom_TrimmedCurve) aTrimmedCurve = new Geom_TrimmedCurve(aLine,-10,10); - Handle(ISession_Curve) aCurve = new ISession_Curve(aTrimmedCurve); - aDoc->GetAISContext()->Display(aCurve, Standard_False); - } - else - Message += "PE.IsLinear() = False \n"; - - Message += " PE.IsPlanar() = "; - if (PE.IsPlanar()) - Message += "True \n"; - else - Message += "False\n"; - - Message += " PE.IsSpace() = "; - if (PE.IsSpace()) - Message += "True \n"; - else - Message += "False\n"; - - PostProcess(aDoc,ID_BUTTON_Test_34,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest35 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest35(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - gp_Pnt P1(-5,-5,0); - gp_Pnt P2(9,9,9); - Handle(Geom_Curve) aCurve = GC_MakeSegment(P1,P2).Value(); - gp_Pnt P3(3,0,0); - gp_Pnt P4(3,0,10); - Standard_Real radius1 = 3; - Standard_Real radius2 = 2; - Handle(Geom_Surface) aSurface = - GC_MakeConicalSurface(P3,P4,radius1,radius2).Value(); - GeomAPI_IntCS CS (aCurve,aSurface); - Handle(Geom_Curve) segment; - - Standard_Integer NbSeg = 0; - Standard_Integer NbPoints = 0; - if(CS.IsDone()) - { - NbSeg = CS.NbSegments(); - for (Standard_Integer k=1; k<=NbSeg; k++) - { - segment = CS.Segment(k); - // do something with the segment - } - - NbPoints = CS.NbPoints(); - for (int k=1; k<=NbPoints; k++) - { - gp_Pnt aPoint=CS.Point(k); - // do something with the point - } - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P1(-5,-5,0); \n\ -gp_Pnt P2(9,9,9); \n\ -Handle(Geom_Curve) aCurve = GC_MakeSegment(P1,P2).Value(); \n\ -gp_Pnt P3(3,0,0); \n\ -gp_Pnt P4(3,0,10); \n\ -Standard_Real radius1 = 3; \n\ -Standard_Real radius2 = 2; \n\ -Handle(Geom_Surface) aSurface = \n\ - GC_MakeConicalSurface(P3,P4,radius1,radius2).Value(); \n\ -GeomAPI_IntCS CS (aCurve,aSurface); \n\ -Handle(Geom_Curve) segment; \n\ - \n\ -Standard_Integer NbSeg; \n\ -Standard_Integer NbPoints; \n\ -if(CS.IsDone()) \n\ - { \n\ - NbSeg = CS.NbSegments(); \n\ - for (Standard_Integer k=1; k<=NbSeg; k++) \n\ - { \n\ - segment = CS.Segment(k); \n\ - // do something with the segment \n\ - } \n\ - \n\ - NbPoints = CS.NbPoints(); \n\ - for (k=1; k<=NbPoints; k++) \n\ - { \n\ - gp_Pnt aPoint=CS.Point(k); \n\ - // do something with the point \n\ - } \n\ - } \n\ - \n"); - AddSeparator(aDoc,Message); - - //-------------------------------------------------------------- - - Handle(ISession_Curve) aCurve2 = new ISession_Curve(aCurve); - aDoc->GetAISContext()->Display(aCurve2, Standard_False); - - Handle(Geom_RectangularTrimmedSurface) aTrimmedSurface= new Geom_RectangularTrimmedSurface(aSurface,-50.,50.,false); - - DisplaySurface(aDoc,aTrimmedSurface); - - TCollection_AsciiString aString; - Standard_Integer k; - if(CS.IsDone()) - { - NbSeg = CS.NbSegments(); - for (k=1; k<=NbSeg; k++) - { - TCollection_AsciiString Message2 (k); - segment = CS.Segment(k); - aString = "S_";aString += Message2; - Handle(ISession_Curve) aCurveN = new ISession_Curve(segment); - aDoc->GetAISContext()->Display(aCurveN, Standard_False); - } - - for ( k=1; k<=NbPoints; k++) - { - TCollection_AsciiString Message2 (k); - gp_Pnt aPoint=CS.Point(k); - aString = "P_";aString += Message2; - DisplayPoint(aDoc,aPoint,aString.ToCString(),false,0.5); - // do something with the point - } - } - TCollection_AsciiString Message2 (NbSeg); - TCollection_AsciiString Message3 (NbPoints); - - Message += "NbSeg = "; Message += Message2 ; Message += "\n"; - Message += "NbPoints = "; Message += Message3 ; Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_35,TheDisplayType,Message); -} - -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -// Function name : GeomSources::gpTest36 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest36(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); -//============================================================== - - gp_Pnt centre (5,5,0); gp_Pnt axispoint (9,9,0); - Standard_Real radius = 3; - Handle(Geom_Circle) circle = - GC_MakeCircle(centre,axispoint,radius); - - Handle(Geom_Geometry) aRotatedEntity = circle->Rotated(gp::OZ(),M_PI/4); - Standard_CString aRotatedEntityTypeName = aRotatedEntity->DynamicType()->Name(); - - Handle(Geom_Geometry) aMirroredEntity = aRotatedEntity->Mirrored(gp::ZOX()); - Standard_CString aMirroredEntityTypeName = aMirroredEntity->DynamicType()->Name(); - - gp_Pnt scalepoint (4,8,0); - Standard_Real scalefactor = 0.2; - Handle(Geom_Geometry) aScaledEntity = - aMirroredEntity->Scaled(scalepoint, scalefactor); - Standard_CString aScaledEntityTypeName = aScaledEntity->DynamicType()->Name(); - - Handle (Geom_Transformation) GT = GC_MakeTranslation (centre, scalepoint); - gp_Trsf TR = GT->Trsf(); - - gp_Vec aTranslationVector(TR.TranslationPart ()); - Handle(Geom_Geometry) aTranslatedEntity = - aScaledEntity->Translated( aTranslationVector ); - Standard_CString aTranslatedEntityTypeName = aTranslatedEntity->DynamicType()->Name(); - - gp_Mat matrix = TR.HVectorialPart(); - Standard_Real value = matrix.Determinant(); - -//============================================================== - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt centre (5,5,0); gp_Pnt axispoint (9,9,0); \n\ -Standard_Real radius = 3; \n\ -Handle(Geom_Circle) circle = \n\ - GC_MakeCircle(centre,axispoint,radius); \n\ - \n\ -Handle(Geom_Geometry) aRotatedEntity = circle->Rotated(gp::OZ(),PI/4); \n\ -Standard_CString aRotatedEntityTypeName = aRotatedEntity->DynamicType()->Name(); \n\ - \n\ -Handle(Geom_Geometry) aMirroredEntity = aRotatedEntity->Mirrored(gp::ZOX()); \n\ -Standard_CString aMirroredEntityTypeName = aMirroredEntity->DynamicType()->Name(); \n\ - \n\ -gp_Pnt scalepoint (4,8,0); \n\ -Standard_Real scalefactor = 0.2; \n\ -Handle(Geom_Geometry) aScaledEntity = \n\ - aMirroredEntity->Scaled(scalepoint, scalefactor); \n\ -Standard_CString aScaledEntityTypeName = aScaledEntity->DynamicType()->Name(); \n\ - \n\ -Handle (Geom_Transformation) GT = GC_MakeTranslation (centre, scalepoint); \n\ -gp_Trsf TR = GT->Trsf(); \n\ - \n"); - Message +="\ -gp_Vec aTranslationVector(TR.TranslationPart ()); \n\ -Handle(Geom_Geometry) aTranslatedEntity = \n\ - aScaledEntity->Translated( aTranslationVector ); \n\ -Standard_CString aTranslatedEntityTypeName = aTranslatedEntity->DynamicType()->Name(); \n\ - \n\ -gp_Mat matrix = TR.HVectorialPart(); \n\ -Standard_Real value = matrix.Determinant(); \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayPoint(aDoc,centre,"centre",false,0.5); - DisplayPoint(aDoc,axispoint,"axispoint",false,0.5); - DisplayPoint(aDoc,scalepoint,"scalepoint",false,0.5); - - DisplayCurve(aDoc,circle, Quantity_NOC_RED,false); - DisplayCurve(aDoc,Handle(Geom_Curve)::DownCast(aRotatedEntity),Quantity_NOC_PEACHPUFF, false); - DisplayCurve(aDoc,Handle(Geom_Curve)::DownCast(aMirroredEntity), Quantity_NOC_YELLOWGREEN,false); - DisplayCurve(aDoc,Handle(Geom_Curve)::DownCast(aScaledEntity), Quantity_NOC_GREEN,false); - DisplayCurve(aDoc,Handle(Geom_Curve)::DownCast(aTranslatedEntity),Quantity_NOC_WHITE,false); - - TCollection_AsciiString Message0 (M_PI); - Message += " PI = "; - Message+= Message0; - Message += "\n"; - Message += " circle is Red; aRotatedEntity is Peach; aMirroredEntity is Yellow Green\n"; - Message += " aScaleEntity is Green; aTranslatedEntity is White\n\n"; - - TCollection_AsciiString Message2 (aTranslationVector.X()); - TCollection_AsciiString Message3 (aTranslationVector.Y()); - TCollection_AsciiString Message4 (aTranslationVector.Z()); - Message += " aTranslationVector ( "; - Message += Message2; Message += " , "; - Message += Message3; Message += " , "; - Message += Message4; Message += " ); \n"; - - TCollection_AsciiString Message5 (value); - Message += " value = ";Message+= Message5; Message += "\n"; - - TCollection_AsciiString Message6 (aRotatedEntityTypeName); - TCollection_AsciiString Message7 (aMirroredEntityTypeName); - TCollection_AsciiString Message8 (aScaledEntityTypeName); - TCollection_AsciiString Message9 (aTranslatedEntityTypeName); - - Message += " aRotatedEntityTypeName = ";Message+= Message6; Message += "\n"; - Message += " aMirroredEntityTypeName = ";Message+= Message7; Message += "\n"; - Message += " aScaledEntityTypeName = ";Message+= Message8; Message += "\n"; - Message += " aTranslatedEntityTypeName = ";Message+= Message9; Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_36,TheDisplayType,Message); -} - -// Function name : GeomSources::gpTest37 -// Description : -// Return type : void -// Argument : CGeometryDoc* aDoc -void GeomSources::gpTest37(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt anArrayofPnt (1,5); // sizing array - anArrayofPnt.SetValue(1,gp_Pnt(0,0,1)); - anArrayofPnt.SetValue(2,gp_Pnt(1,2,2)); - anArrayofPnt.SetValue(3,gp_Pnt(2,3,3)); - anArrayofPnt.SetValue(4,gp_Pnt(4,3,4)); - anArrayofPnt.SetValue(5,gp_Pnt(5,5,5)); - - Standard_Real Tolerance = 1; - - gp_Pln P; - GProp_PEquation PE (anArrayofPnt,Tolerance); - if (PE.IsPlanar()) { P = PE.Plane();} - - if (PE.IsPoint()) { /* ... */ } - if (PE.IsLinear()) { /* ... */ } - if (PE.IsPlanar()) { P = PE.Plane();} - if (PE.IsSpace()) { /* ... */ } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt anArrayofPnt (1,5); // sizing array \n\ -anArrayofPnt.SetValue(1,gp_Pnt(0,0,1)); \n\ -anArrayofPnt.SetValue(2,gp_Pnt(1,2,2)); \n\ -anArrayofPnt.SetValue(3,gp_Pnt(2,3,3)); \n\ -anArrayofPnt.SetValue(4,gp_Pnt(4,3,4)); \n\ -anArrayofPnt.SetValue(5,gp_Pnt(5,5,5)); \n\ - \n\ -Standard_Real Tolerance = 1; \n\ - \n\ -gp_Pln P; \n\ -GProp_PEquation PE (anArrayofPnt,Tolerance); \n\ -if (PE.IsPlanar()) { P = PE.Plane();} \n\ - \n\ -if (PE.IsPoint()) { /* ... */ } \n\ -if (PE.IsLinear()) { /* ... */ } \n\ -if (PE.IsPlanar()) { P = PE.Plane();} \n\ -if (PE.IsSpace()) { /* ... */ } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - TCollection_AsciiString aString; - for(Standard_Integer i = anArrayofPnt.Lower();i<=anArrayofPnt.Upper();i++){ - TCollection_AsciiString Message2(i); - gp_Pnt aP = anArrayofPnt(i); - aString = "P"; - aString += Message2; - DisplayPoint(aDoc,aP,aString.ToCString(),false,0.5); - } - - Message += " PE.IsPoint() = "; if (PE.IsPoint()) Message += "True \n"; else Message += "False\n"; - Message += " PE.IsLinear() = "; if (PE.IsLinear()) Message += "True \n"; else Message += "False\n"; - - if (PE.IsPlanar()) { - Message += " PE.IsPlanar() = True \n"; - P = PE.Plane(); - Handle(Geom_Plane) aPlane = new Geom_Plane(P); - Handle(Geom_RectangularTrimmedSurface) aSurface= new Geom_RectangularTrimmedSurface(aPlane,-4.,4.,-4.,4.); - - DisplaySurface(aDoc,aSurface); - - } - else - Message += " PE.IsPlanar() = False \n"; - - Message += " PE.IsSpace() = "; if (PE.IsSpace() ) Message += "True \n"; else Message += "False\n"; - - PostProcess(aDoc,ID_BUTTON_Test_37,TheDisplayType,Message); -} - -void GeomSources::gpTest38(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); // sizing array - array1.SetValue(1,gp_Pnt (-4,0,2 )); array1.SetValue(2,gp_Pnt (-7,2,2 )); - array1.SetValue(3,gp_Pnt (-6,3,1 )); array1.SetValue(4,gp_Pnt (-4,3,-1)); - array1.SetValue(5,gp_Pnt (-3,5,-2)); - Handle(Geom_BSplineCurve) SPL1 = GeomAPI_PointsToBSpline(array1).Curve(); - - TColgp_Array1OfPnt array2 (1,5); // sizing array - array2.SetValue(1,gp_Pnt (-4,0, 2)); array2.SetValue(2,gp_Pnt (-2,2,0 )); - array2.SetValue(3,gp_Pnt (2 ,3,-1)); array2.SetValue(4,gp_Pnt (3 ,7,-2)); - array2.SetValue(5,gp_Pnt (4 ,9,-1)); - Handle(Geom_BSplineCurve) SPL2 = GeomAPI_PointsToBSpline(array2).Curve(); - - GeomFill_FillingStyle Type = GeomFill_StretchStyle; - GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); - Handle(Geom_BSplineSurface) aBSplineSurface1 = aGeomFill1.Surface(); - - Type = GeomFill_CoonsStyle; - GeomFill_BSplineCurves aGeomFill2( - Handle(Geom_BSplineCurve)::DownCast(SPL1->Translated(gp_Vec(10,0,0))), - Handle(Geom_BSplineCurve)::DownCast(SPL2->Translated(gp_Vec(10,0,0))),Type); - Handle(Geom_BSplineSurface) aBSplineSurface2 = aGeomFill2.Surface(); - Type = GeomFill_CurvedStyle; - GeomFill_BSplineCurves aGeomFill3( - Handle(Geom_BSplineCurve)::DownCast(SPL1->Translated(gp_Vec(20,0,0))), - Handle(Geom_BSplineCurve)::DownCast(SPL2->Translated(gp_Vec(20,0,0))),Type); - Handle(Geom_BSplineSurface) aBSplineSurface3 = aGeomFill3.Surface(); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array1 (1,5); // sizing array \n\ -array1.SetValue(1,gp_Pnt (-4,0,2 )); array1.SetValue(2,gp_Pnt (-7,2,2 )); \n\ -array1.SetValue(3,gp_Pnt (-6,3,1 )); array1.SetValue(4,gp_Pnt (-4,3,-1)); \n\ -array1.SetValue(5,gp_Pnt (-3,5,-2)); \n\ -Handle(Geom_BSplineCurve) SPL1 = GeomAPI_PointsToBSpline(array1).Curve(); \n\ - \n\ -TColgp_Array1OfPnt array2 (1,5); // sizing array \n\ -array2.SetValue(1,gp_Pnt (-4,0, 2)); array2.SetValue(2,gp_Pnt (-2,2,0 )); \n\ -array2.SetValue(3,gp_Pnt (2 ,3,-1)); array2.SetValue(4,gp_Pnt (3 ,7,-2)); \n\ -array2.SetValue(5,gp_Pnt (4 ,9,-1)); \n\ -Handle(Geom_BSplineCurve) SPL2 = GeomAPI_PointsToBSpline(array2).Curve(); \n\ - \n\ -GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\ -GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\ -Handle(Geom_BSplineSurface) aBSplineSurface1 = aGeomFill1.Surface(); \n\ - \n\ -Type = GeomFill_CoonsStyle; \n\ -GeomFill_BSplineCurves aGeomFill2( \n"); -Message += "\ - Handle(Geom_BSplineCurve)::DownCast(SPL1->Translated(gp_Vec(10,0,0))), \n\ - Handle(Geom_BSplineCurve)::DownCast(SPL2->Translated(gp_Vec(10,0,0))),Type); \n\ -Handle(Geom_BSplineSurface) aBSplineSurface2 = aGeomFill2.Surface(); \n\ -Type = GeomFill_CurvedStyle; \n\ -GeomFill_BSplineCurves aGeomFill3( \n\ - Handle(Geom_BSplineCurve)::DownCast(SPL1->Translated(gp_Vec(20,0,0))), \n\ - Handle(Geom_BSplineCurve)::DownCast(SPL2->Translated(gp_Vec(20,0,0))),Type); \n\ -Handle(Geom_BSplineSurface) aBSplineSurface3 = aGeomFill3.Surface(); \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - // Trace des frontieres. -> FreeBoundaryAspect - // Trace des isoparametriques. --> UIsoAspect() - - DisplaySurface(aDoc,aBSplineSurface1,Quantity_NOC_YELLOW); - DisplaySurface(aDoc,aBSplineSurface2,Quantity_NOC_SALMON); - DisplaySurface(aDoc,aBSplineSurface3,Quantity_NOC_HOTPINK); - - for (int i=0;i<=2;i++) - { - DisplayCurve(aDoc,Handle(Geom_BSplineCurve)::DownCast(SPL1->Translated(gp_Vec(i*10,0,0))), Quantity_NOC_RED,false); - DisplayCurve(aDoc,Handle(Geom_BSplineCurve)::DownCast(SPL2->Translated(gp_Vec(i*10,0,0))), Quantity_NOC_GREEN,false); - } - - Message += "SPL1 is Red; \n"; - Message += "SPL2 is Green; \n"; - Message += "aBSplineSurface1 is Yellow; ( GeomFill_StretchStyle )\n"; - Message += "aBSplineSurface2 is Salmon; ( GeomFill_CoonsStyle ) \n"; - Message += "aBSplineSurface3 is Hot pink; ( GeomFill_CurvedStyle ) \n"; - - PostProcess(aDoc,ID_BUTTON_Test_38,TheDisplayType,Message); -} -void GeomSources::gpTest39(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); // sizing array - array1.SetValue(1,gp_Pnt (-4,0,2 )); - array1.SetValue(2,gp_Pnt (-5,1,0 )); - array1.SetValue(3,gp_Pnt (-6,2,-2 )); - array1.SetValue(4,gp_Pnt (-5,4,-7)); - array1.SetValue(5,gp_Pnt (-3,5,-12)); - - TColgp_Array1OfPnt array2 (1,5); // sizing array - array2.SetValue(1,gp_Pnt (-4,0, 2)); - array2.SetValue(2,gp_Pnt (-3,2,1 )); - array2.SetValue(3,gp_Pnt (-1,5,0)); - array2.SetValue(4,gp_Pnt (2 ,7,-1)); - array2.SetValue(5,gp_Pnt (4 ,9,-1)); - - TColgp_Array1OfPnt array3 (1,4); // sizing array - array3.SetValue(1,gp_Pnt (-3,5, -12)); - array3.SetValue(2,gp_Pnt (-2,6,-7 )); - array3.SetValue(3,gp_Pnt (0 ,8,-3)); - array3.SetValue(4,gp_Pnt (4 ,9,-1)); - - Handle(Geom_BSplineCurve) SPL1 = GeomAPI_PointsToBSpline(array1).Curve(); - Handle(Geom_BSplineCurve) SPL2 = GeomAPI_PointsToBSpline(array2).Curve(); - Handle(Geom_BSplineCurve) SPL3 = GeomAPI_PointsToBSpline(array3).Curve(); - - Handle(GeomAdaptor_Curve) SPL1Adaptor = new GeomAdaptor_Curve(SPL1); - Handle(GeomFill_SimpleBound) B1 = - new GeomFill_SimpleBound(SPL1Adaptor,Precision::Approximation(),Precision::Angular()); - Handle(GeomAdaptor_Curve) SPL2Adaptor = new GeomAdaptor_Curve(SPL2); - Handle(GeomFill_SimpleBound) B2 = - new GeomFill_SimpleBound(SPL2Adaptor,Precision::Approximation(),Precision::Angular()); - Handle(GeomAdaptor_Curve) SPL3Adaptor = new GeomAdaptor_Curve(SPL3); - Handle(GeomFill_SimpleBound) B3 = - new GeomFill_SimpleBound(SPL3Adaptor,Precision::Approximation(),Precision::Angular()); - Standard_Boolean NoCheck= Standard_False; - - Standard_Integer MaxDeg = 8; - Standard_Integer MaxSeg = 2; - GeomFill_ConstrainedFilling aConstrainedFilling(MaxDeg, MaxSeg); - - aConstrainedFilling.Init(B1,B2,B3,NoCheck); - - Handle(Geom_BSplineSurface) aBSplineSurface = aConstrainedFilling.Surface(); - -//============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array1 (1,5); // sizing array \n\ -... \n\ -Handle(Geom_BSplineCurve) SPL1 = GeomAPI_PointsToBSpline(array1).Curve(); \n\ -Handle(Geom_BSplineCurve) SPL2 = GeomAPI_PointsToBSpline(array2).Curve(); \n\ -Handle(Geom_BSplineCurve) SPL3 = GeomAPI_PointsToBSpline(array3).Curve(); \n\ - \n\ -Handle(GeomAdaptor_Curve) SPL1Adaptor = new GeomAdaptor_Curve(SPL1); \n\ -Handle(GeomFill_SimpleBound) B1 = \n\ - new GeomFill_SimpleBound(SPL1Adaptor,Precision::Approximation(),Precision::Angular()); \n\ -Handle(GeomAdaptor_Curve) SPL2Adaptor = new GeomAdaptor_Curve(SPL2); \n\ -Handle(GeomFill_SimpleBound) B2 = \n\ - new GeomFill_SimpleBound(SPL2Adaptor,Precision::Approximation(),Precision::Angular()); \n\ -Handle(GeomAdaptor_Curve) SPL3Adaptor = new GeomAdaptor_Curve(SPL3); \n\ -Handle(GeomFill_SimpleBound) B3 = \n\ - new GeomFill_SimpleBound(SPL3Adaptor,Precision::Approximation(),Precision::Angular()); \n\ -Standard_Boolean NoCheck= Standard_False; \n\ - \n\ -Standard_Integer MaxDeg = 8; \n"); -Message += "\ -Standard_Integer MaxSeg = 2; \n\ -GeomFill_ConstrainedFilling aConstrainedFilling(MaxDeg, MaxSeg); \n\ - \n\ -aConstrainedFilling.Init(B1,B2,B3,NoCheck); \n\ - \n\ -Handle(Geom_BSplineSurface) aBSplineSurface = aConstrainedFilling.Surface(); \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - TCollection_AsciiString aString; - - DisplaySurface(aDoc,aBSplineSurface,Quantity_NOC_YELLOW); - DisplayCurve(aDoc,SPL1,Quantity_NOC_RED ,false); - DisplayCurve(aDoc,SPL2,Quantity_NOC_GREEN ,false); - DisplayCurve(aDoc,SPL3,Quantity_NOC_BLUE1 ,false); - - Message += "SPL1 is Red; \n"; - Message += "SPL2 is Green; \n"; - Message += "SPL3 is Blue; \n"; - - Message += "aBSplineSurface is Yellow; \n"; - - PostProcess(aDoc,ID_BUTTON_Test_39,TheDisplayType,Message); -} - -void GeomSources::gpTest40(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); // sizing array - array1.SetValue(1,gp_Pnt (-4,0,2 )); - array1.SetValue(2,gp_Pnt (-5,1,0 )); - array1.SetValue(3,gp_Pnt (-6,2,-2 )); - array1.SetValue(4,gp_Pnt (-5,4,-7)); - array1.SetValue(5,gp_Pnt (-3,5,-12)); - - Handle(Geom_Curve) SPL1 = - GeomAPI_PointsToBSpline(array1).Curve(); - - GeomFill_Pipe aPipe(SPL1,1); - aPipe.Perform(); - Handle(Geom_Surface) aSurface= aPipe.Surface(); - Standard_CString aSurfaceEntityTypeName="Not Computed"; - if (!aSurface.IsNull()) - aSurfaceEntityTypeName = aSurface->DynamicType()->Name(); - - Handle(Geom_Ellipse) E = GC_MakeEllipse( gp::XOY() ,3,1).Value(); - GeomFill_Pipe aPipe2(SPL1,E); - aPipe2.Perform(); - Handle(Geom_Surface) aSurface2= aPipe2.Surface(); - Standard_CString aSurfaceEntityTypeName2="Not Computed"; - if (!aSurface2.IsNull()) { - aSurfaceEntityTypeName2 = aSurface2->DynamicType()->Name(); - aSurface2->Translate(gp_Vec(5,0,0)); } - - Handle(Geom_TrimmedCurve) TC1 = - GC_MakeSegment(gp_Pnt(1,1,1),gp_Pnt(5,5,5)); - Handle(Geom_TrimmedCurve) TC2 = - GC_MakeSegment(gp_Pnt(1,1,0),gp_Pnt(4,5,6)); - GeomFill_Pipe aPipe3(SPL1,TC1,TC2); - aPipe3.Perform(); - Handle(Geom_Surface) aSurface3 = aPipe3.Surface(); - Standard_CString aSurfaceEntityTypeName3="Not Computed"; - if (!aSurface3.IsNull()) - { - aSurfaceEntityTypeName3 = aSurface3->DynamicType()->Name(); - aSurface3->Translate(gp_Vec(10,0,0)); - } - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ - \n\ -TColgp_Array1OfPnt array1 (1,5); // sizing array \n\ -array1.SetValue(1,gp_Pnt (-4,0,2 )); \n\ -array1.SetValue(2,gp_Pnt (-5,1,0 )); \n\ -array1.SetValue(3,gp_Pnt (-6,2,-2 )); \n\ -array1.SetValue(4,gp_Pnt (-5,4,-7)); \n\ -array1.SetValue(5,gp_Pnt (-3,5,-12)); \n\ - \n\ -Handle(Geom_BSplineCurve) SPL1 = \n\ - GeomAPI_PointsToBSpline(array1).Curve(); \n\ - \n\ -GeomFill_Pipe aPipe(SPL1,1); \n\ -aPipe.Perform(); \n\ -Handle(Geom_Surface) aSurface= aPipe.Surface(); \n\ -Standard_CString aSurfaceEntityTypeName=\"Not Computed\"; \n\ -if (!aSurface.IsNull()) \n\ - aSurfaceEntityTypeName = aSurface->DynamicType()->Name(); \n\ - \n\ -Handle(Geom_Ellipse) E = GC_MakeEllipse( gp::XOY() ,3,1).Value(); \n\ -GeomFill_Pipe aPipe2(SPL1,E); \n\ -aPipe2.Perform(); \n"); -Message += "\ -Handle(Geom_Surface) aSurface2= aPipe2.Surface(); \n\ -Standard_CString aSurfaceEntityTypeName2=\"Not Computed\"; \n\ -if (!aSurface2.IsNull()) { \n\ - aSurfaceEntityTypeName2 = aSurface2->DynamicType()->Name(); \n\ - aSurface2->Translate(gp_Vec(5,0,0)); } \n\ - \n\ -Handle(Geom_TrimmedCurve) TC1 = \n\ - GC_MakeSegment(gp_Pnt(1,1,1),gp_Pnt(5,5,5)); \n\ -Handle(Geom_TrimmedCurve) TC2 = \n\ - GC_MakeSegment(gp_Pnt(1,1,0),gp_Pnt(4,5,6)); \n\ -GeomFill_Pipe aPipe3(SPL1,TC1,TC2); \n\ -aPipe3.Perform(); \n\ -Handle(Geom_Surface) aSurface3 = aPipe3.Surface(); \n\ -Standard_CString aSurfaceEntityTypeName3=\"Not Computed\"; \n\ -if (!aSurface3.IsNull()) \n\ - { \n\ - aSurfaceEntityTypeName3 = aSurface3->DynamicType()->Name(); \n\ - aSurface3->Translate(gp_Vec(10,0,0)); \n\ - } \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - if (!aSurface.IsNull()) - { - DisplaySurface(aDoc,aSurface,Quantity_NOC_YELLOW); - } - if (!aSurface2.IsNull()) - { - DisplaySurface(aDoc,aSurface2,Quantity_NOC_YELLOW); - } - if (!aSurface3.IsNull()) - { - DisplaySurface(aDoc,aSurface3,Quantity_NOC_YELLOW); - } - - DisplayCurve(aDoc,SPL1,Quantity_NOC_RED ,false); - - Message += "SPL1 is Red; \n"; - - - TCollection_AsciiString Message2(aSurfaceEntityTypeName); - TCollection_AsciiString Message3(aSurfaceEntityTypeName2); - TCollection_AsciiString Message4(aSurfaceEntityTypeName3); - - Message += " aSurfaceEntityTypeName = ";Message+= Message2; Message += "\n"; - Message += " aSurfaceEntityTypeName2 = ";Message+= Message3; Message += "\n"; - Message += " aSurfaceEntityTypeName3 = ";Message+= Message4; Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_40,TheDisplayType,Message); -} - -void GeomSources::gpTest41(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); - array1.SetValue(1,gp_Pnt (-4,0,2 )); - array1.SetValue(2,gp_Pnt (-5,1,0 )); - array1.SetValue(3,gp_Pnt (-6,2,-2 )); - array1.SetValue(4,gp_Pnt (-5,4,-7)); - array1.SetValue(5,gp_Pnt (-3,5,-12)); - - Handle(Geom_BSplineCurve) SPL1 = - GeomAPI_PointsToBSpline(array1).Curve(); - Handle(Geom_Curve) FirstSect = - GC_MakeSegment(gp_Pnt(-4,0,2),gp_Pnt(-4,0,10)).Value(); - - GeomFill_Pipe aPipe(SPL1,FirstSect); - aPipe.Perform(); - - Handle(Geom_BSplineSurface) aPipeSurface = - Handle(Geom_BSplineSurface)::DownCast(aPipe.Surface()); - Handle(Geom_BSplineSurface) anotherBSplineSurface = - GeomConvert::SplitBSplineSurface(aPipeSurface,1,2,3,6); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array1 (1,5); \n\ -array1.SetValue(1,gp_Pnt (-4,0,2 )); \n\ -array1.SetValue(2,gp_Pnt (-5,1,0 )); \n\ -array1.SetValue(3,gp_Pnt (-6,2,-2 )); \n\ -array1.SetValue(4,gp_Pnt (-5,4,-7)); \n\ -array1.SetValue(5,gp_Pnt (-3,5,-12)); \n\ - \n\ -Handle(Geom_BSplineCurve) SPL1 = \n\ - GeomAPI_PointsToBSpline(array1).Curve(); \n\ -Handle(Geom_Curve) FirstSect = \n\ - GC_MakeSegment(gp_Pnt(-4,0,2),gp_Pnt(-4,0,10)).Value(); \n\ - \n\ -GeomFill_Pipe aPipe(SPL1,FirstSect); \n\ -aPipe.Perform(); \n\ - \n\ -Handle(Geom_BSplineSurface) aPipeSurface = \n\ - Handle(Geom_BSplineSurface)::DownCast(aPipe.Surface()); \n\ -Handle(Geom_BSplineSurface) anotherBSplineSurface = \n\ - GeomConvert::SplitBSplineSurface(aPipeSurface,1,2,3,6); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - if(!aPipeSurface.IsNull()) - { - DisplaySurface(aDoc,aPipeSurface,Quantity_NOC_YELLOW); - } - - if(!anotherBSplineSurface.IsNull()) - { - DisplaySurface(aDoc,anotherBSplineSurface,Quantity_NOC_HOTPINK); - } - - DisplayCurve(aDoc,SPL1,Quantity_NOC_RED ,false); - DisplayCurve(aDoc,FirstSect,Quantity_NOC_GREEN ,false); - - Message += "SPL1 is Red; \n"; - Message += "SPL2 is Green; \n"; - Message += "SPL3 is Blue; \n"; - Message += "aBSplineSurface is Yellow; \n"; - Message += "anotherBSplineSurface is Hot Pink; \n"; - - PostProcess(aDoc,ID_BUTTON_Test_41,TheDisplayType,Message); -} - - -void GeomSources::gpTest42(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - TColgp_Array2OfPnt array1(1,3,1,3); - TColgp_Array2OfPnt array2(1,3,1,3); - TColgp_Array2OfPnt array3(1,3,1,3); - TColgp_Array2OfPnt array4(1,3,1,3); - - array1.SetValue(1,1,gp_Pnt(1,1,1)); - array1.SetValue(1,2,gp_Pnt(2,1,2)); - array1.SetValue(1,3,gp_Pnt(3,1,1)); - array1.SetValue(2,1,gp_Pnt(1,2,1)); - array1.SetValue(2,2,gp_Pnt(2,2,2)); - array1.SetValue(2,3,gp_Pnt(3,2,0)); - array1.SetValue(3,1,gp_Pnt(1,3,2)); - array1.SetValue(3,2,gp_Pnt(2,3,1)); - array1.SetValue(3,3,gp_Pnt(3,3,0)); - - array2.SetValue(1,1,gp_Pnt(3,1,1)); - array2.SetValue(1,2,gp_Pnt(4,1,1)); - array2.SetValue(1,3,gp_Pnt(5,1,2)); - array2.SetValue(2,1,gp_Pnt(3,2,0)); - array2.SetValue(2,2,gp_Pnt(4,2,1)); - array2.SetValue(2,3,gp_Pnt(5,2,2)); - array2.SetValue(3,1,gp_Pnt(3,3,0)); - array2.SetValue(3,2,gp_Pnt(4,3,0)); - array2.SetValue(3,3,gp_Pnt(5,3,1)); - - array3.SetValue(1,1,gp_Pnt(1,3,2)); - array3.SetValue(1,2,gp_Pnt(2,3,1)); - array3.SetValue(1,3,gp_Pnt(3,3,0)); - array3.SetValue(2,1,gp_Pnt(1,4,1)); - array3.SetValue(2,2,gp_Pnt(2,4,0)); - array3.SetValue(2,3,gp_Pnt(3,4,1)); - array3.SetValue(3,1,gp_Pnt(1,5,1)); - array3.SetValue(3,2,gp_Pnt(2,5,1)); - array3.SetValue(3,3,gp_Pnt(3,5,2)); - - array4.SetValue(1,1,gp_Pnt(3,3,0)); - array4.SetValue(1,2,gp_Pnt(4,3,0)); - array4.SetValue(1,3,gp_Pnt(5,3,1)); - array4.SetValue(2,1,gp_Pnt(3,4,1)); - array4.SetValue(2,2,gp_Pnt(4,4,1)); - array4.SetValue(2,3,gp_Pnt(5,4,1)); - array4.SetValue(3,1,gp_Pnt(3,5,2)); - array4.SetValue(3,2,gp_Pnt(4,5,2)); - array4.SetValue(3,3,gp_Pnt(5,5,1)); - - Handle(Geom_BezierSurface) BZ1 = - new Geom_BezierSurface(array1); - Handle(Geom_BezierSurface) BZ2 = - new Geom_BezierSurface(array2); - Handle(Geom_BezierSurface) BZ3 = - new Geom_BezierSurface(array3); - Handle(Geom_BezierSurface) BZ4 = - new Geom_BezierSurface(array4); - - TColGeom_Array2OfBezierSurface bezierarray(1,2,1,2); - bezierarray.SetValue(1,1,BZ1); - bezierarray.SetValue(1,2,BZ2); - bezierarray.SetValue(2,1,BZ3); - bezierarray.SetValue(2,2,BZ4); - - GeomConvert_CompBezierSurfacesToBSplineSurface BB (bezierarray); - Handle(Geom_BSplineSurface) BSPLSURF ; - if (BB.IsDone()) - { - BSPLSURF = new Geom_BSplineSurface( - BB.Poles()->Array2(), - BB.UKnots()->Array1(), - BB.VKnots()->Array1(), - BB.UMultiplicities()->Array1(), - BB.VMultiplicities()->Array1(), - BB.UDegree(), - BB.VDegree() ); - BSPLSURF->Translate(gp_Vec(0,0,2)); - } - - //============================================================== - - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array2OfPnt array1(1,3,1,3); \n\ -TColgp_Array2OfPnt array2(1,3,1,3); \n\ -TColgp_Array2OfPnt array3(1,3,1,3); \n\ -TColgp_Array2OfPnt array4(1,3,1,3); \n\ - \n\ -// array1.SetValue( ... \n\ - \n\ -Handle(Geom_BezierSurface) BZ1 = \n\ - new Geom_BezierSurface(array1); \n\ -Handle(Geom_BezierSurface) BZ2 = \n\ - new Geom_BezierSurface(array2); \n\ -Handle(Geom_BezierSurface) BZ3 = \n\ - new Geom_BezierSurface(array3); \n\ -Handle(Geom_BezierSurface) BZ4 = \n\ - new Geom_BezierSurface(array4); \n\ - \n\ -TColGeom_Array2OfBezierSurface bezierarray(1,2,1,2); \n\ -bezierarray.SetValue(1,1,BZ1); \n\ -bezierarray.SetValue(1,2,BZ2); \n\ -bezierarray.SetValue(2,1,BZ3); \n\ -bezierarray.SetValue(2,2,BZ4); \n\ - \n\ -GeomConvert_CompBezierSurfacesToBSplineSurface BB (bezierarray); \n\ - Handle(Geom_BSplineSurface) BSPLSURF ; \n\ -if (BB.IsDone()){ \n\ - BSPLSURF = new Geom_BSplineSurface( \n\ - BB.Poles()->Array2(), \n\ - BB.UKnots()->Array1(), \n"); - Message += "\ - BB.VKnots()->Array1(), \n\ - BB.UMultiplicities()->Array1(), \n\ - BB.VMultiplicities()->Array1(), \n\ - BB.UDegree(), \n\ - BB.VDegree() ); \n\ - BSPLSURF->Translate(gp_Vec(0,0,2)); \n\ - } \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplaySurface(aDoc,BZ1,Quantity_NOC_RED); - DisplaySurface(aDoc,BZ2,Quantity_NOC_GREEN); - DisplaySurface(aDoc,BZ3,Quantity_NOC_BLUE1); - DisplaySurface(aDoc,BZ4,Quantity_NOC_BROWN); - - if (BB.IsDone()){ - DisplaySurface(aDoc,BSPLSURF,Quantity_NOC_HOTPINK); - } - - Message += "BZ1 is Red; \n"; - Message += "BZ2 is Green; \n"; - Message += "BZ3 is Blue; \n"; - Message += "BZ4 is Brown; \n"; - Message += "BSPLSURF is Hot Pink; \n"; - - PostProcess(aDoc,ID_BUTTON_Test_42,TheDisplayType,Message); -} - -void GeomSources::gpTest43(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); - array1.SetValue(1,gp_Pnt (-4,5,5 )); - array1.SetValue(2,gp_Pnt (-3,6,6 )); - array1.SetValue(3,gp_Pnt (-1,7,7 )); - array1.SetValue(4,gp_Pnt (0,8,8)); - array1.SetValue(5,gp_Pnt (2,9,9)); - Handle(Geom_BSplineCurve) SPL1 = - GeomAPI_PointsToBSpline(array1).Curve(); - - TColgp_Array1OfPnt array2 (1,5); - array2.SetValue(1,gp_Pnt (-4,5,2 )); - array2.SetValue(2,gp_Pnt (-3,6,3 )); - array2.SetValue(3,gp_Pnt (-1,7,4 )); - array2.SetValue(4,gp_Pnt (0,8,5)); - array2.SetValue(5,gp_Pnt (2,9,6)); - Handle(Geom_BSplineCurve) SPL2 = - GeomAPI_PointsToBSpline(array2).Curve(); - - GeomFill_FillingStyle Type = GeomFill_StretchStyle; - GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); - Handle(Geom_BSplineSurface) aGeomSurface = aGeomFill1.Surface(); - Standard_Real offset = 1; - Handle(Geom_OffsetSurface) GOS = new Geom_OffsetSurface(aGeomSurface, offset); - offset = 2; - Handle(Geom_OffsetSurface) GOS1 = new Geom_OffsetSurface(aGeomSurface, offset); - offset = 3; - Handle(Geom_OffsetSurface) GOS2 = new Geom_OffsetSurface(aGeomSurface, offset); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array1 (1,5); \n\ -//array1.SetValue( ... \n\ -Handle(Geom_BSplineCurve) SPL1 = \n\ - GeomAPI_PointsToBSpline(array1).Curve(); \n\ - \n\ -TColgp_Array1OfPnt array2 (1,5); \n\ -// array2.SetValue( ... \n\ - \n\ -Handle(Geom_BSplineCurve) SPL2 = \n\ - GeomAPI_PointsToBSpline(array2).Curve(); \n\ - \n\ -GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\ -GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\ -Handle(Geom_BSplineSurface) aGeomSurface = aGeomFill1.Surface(); \n\ -Standard_Real offset = 1; \n\ -Handle(Geom_OffsetSurface) GOS = new Geom_OffsetSurface(aGeomSurface, offset); \n\ - offset = 2; \n\ -Handle(Geom_OffsetSurface) GOS1 = new Geom_OffsetSurface(aGeomSurface, offset); \n\ -offset = 3; \n\ -Handle(Geom_OffsetSurface) GOS2 = new Geom_OffsetSurface(aGeomSurface, offset); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplaySurface(aDoc,aGeomSurface,Quantity_NOC_BLUE1); - DisplaySurface(aDoc,GOS,Quantity_NOC_GREEN); - DisplaySurface(aDoc,GOS1,Quantity_NOC_GREEN); - DisplaySurface(aDoc,GOS2,Quantity_NOC_GREEN); - - DisplayCurve(aDoc,SPL1,Quantity_NOC_RED ,false); - DisplayCurve(aDoc,SPL2,Quantity_NOC_HOTPINK ,false); - - Message += "aGeomSurface is Blue; \n"; - Message += "GOS are Green; \n"; - - PostProcess(aDoc,ID_BUTTON_Test_43,TheDisplayType,Message); -} - -void GeomSources::gpTest44(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - gp_Pnt P1(0,0,1); - gp_Pnt P2(1,2,2); - gp_Pnt P3(2,3,3); - gp_Pnt P4(4,3,4); - gp_Pnt P5(5,5,5); - TColgp_Array1OfPnt array (1,5); - array.SetValue(1,P1); - array.SetValue(2,P2); - array.SetValue(3,P3); - array.SetValue(4,P4); - array.SetValue(5,P5); - Handle(Geom_BSplineCurve) aCurve = - GeomAPI_PointsToBSpline(array).Curve(); - gp_Dir aDir(1,2,3); - Handle(Geom_SurfaceOfLinearExtrusion) SOLE = - new Geom_SurfaceOfLinearExtrusion(aCurve,aDir); - - Handle(Geom_RectangularTrimmedSurface) aTrimmedSurface = - new Geom_RectangularTrimmedSurface(SOLE,-10,10,false); - - Standard_CString SOLEEntityTypeName="Not Computed"; - if (!SOLE.IsNull()) - { - SOLEEntityTypeName = SOLE->DynamicType()->Name(); - } - - //============================================================== - - TCollection_AsciiString Message (" \ - \n\ -gp_Pnt P1(0,0,1); \n\ -gp_Pnt P2(1,2,2); \n\ -gp_Pnt P3(2,3,3); \n\ -gp_Pnt P4(4,3,4); \n\ -gp_Pnt P5(5,5,5); \n\ -TColgp_Array1OfPnt array (1,5); \n\ -array.SetValue(1,P1); \n\ -array.SetValue(2,P2); \n\ -array.SetValue(3,P3); \n\ -array.SetValue(4,P4); \n\ -array.SetValue(5,P5); \n\ -Handle(Geom_BSplineCurve) aCurve = \n\ - GeomAPI_PointsToBSpline(array).Curve(); \n\ -gp_Dir aDir(1,2,3); \n\ -Handle(Geom_SurfaceOfLinearExtrusion) SOLE = \n\ - new Geom_SurfaceOfLinearExtrusion(aCurve,aDir); \n\ - \n\ -Handle(Geom_RectangularTrimmedSurface) aTrimmedSurface = \n\ - new Geom_RectangularTrimmedSurface(SOLE,-10,10,false); \n\ - \n\ -Standard_CString SOLEEntityTypeName=\"Not Computed\"; \n\ -if (!SOLE.IsNull()) \n\ - { \n\ - SOLEEntityTypeName = SOLE->DynamicType()->Name(); \n\ - } \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplaySurface(aDoc,aTrimmedSurface,Quantity_NOC_GREEN); - DisplayCurve(aDoc,aCurve,Quantity_NOC_RED ,false); - - Message += "aCurve is Red; \n"; - Message += "aTrimmedSurface is Green; \n"; - - TCollection_AsciiString Message2 (SOLEEntityTypeName); - - Message += " SOLEEntityTypeName = ";Message+= Message2; Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_44,TheDisplayType,Message); -} - -void GeomSources::gpTest45(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - TColgp_Array1OfPnt array (1,5); - array.SetValue(1,gp_Pnt (0,0,1)); - array.SetValue(2,gp_Pnt (1,2,2)); - array.SetValue(3,gp_Pnt (2,3,3)); - array.SetValue(4,gp_Pnt (4,3,4)); - array.SetValue(5,gp_Pnt (5,5,5)); - Handle(Geom_BSplineCurve) aCurve = - GeomAPI_PointsToBSpline(array).Curve(); - Handle(Geom_SurfaceOfRevolution) SOR = - new Geom_SurfaceOfRevolution(aCurve,gp::OX()); - - Standard_CString SOREntityTypeName="Not Computed"; - if (!SOR.IsNull()) - SOREntityTypeName = SOR->DynamicType()->Name(); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array (1,5); \n\ -array.SetValue(1,gp_Pnt 0,0,1)); \n\ -array.SetValue(2,gp_Pnt (1,2,2)); \n\ -array.SetValue(3,gp_Pnt (2,3,3)); \n\ -array.SetValue(4,gp_Pnt (4,3,4)); \n\ -array.SetValue(5,gp_Pnt (5,5,5)); \n\ -Handle(Geom_BSplineCurve) aCurve = \n\ - GeomAPI_PointsToBSpline(array).Curve(); \n\ -Handle(Geom_SurfaceOfRevolution) SOR = \n\ - new Geom_SurfaceOfRevolution(aCurve,gp::OX()); \n\ - \n\ -Standard_CString SOREntityTypeName=\"Not Computed\"; \n\ -if (!SOR.IsNull()) \n\ - SOREntityTypeName = SOR->DynamicType()->Name(); \n\ - \n"); - AddSeparator(aDoc,Message); - - //-------------------------------------------------------------- - DisplaySurface(aDoc,SOR,Quantity_NOC_GREEN); - DisplayCurve(aDoc,aCurve,Quantity_NOC_RED ,false); - - Message += "aCurve is Red; \n"; - Message += "SOR is Green; \n"; - TCollection_AsciiString Message2 (SOREntityTypeName); - Message += " SOREntityTypeName = ";Message+= Message2; Message += "\n"; - - PostProcess(aDoc,ID_BUTTON_Test_45,TheDisplayType,Message); -} - -void GeomSources::gpTest46(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); - array1.SetValue(1,gp_Pnt (-4,5,5 )); - array1.SetValue(2,gp_Pnt (-3,6,6 )); - array1.SetValue(3,gp_Pnt (-1,6,7 )); - array1.SetValue(4,gp_Pnt (0,8,8)); - array1.SetValue(5,gp_Pnt (2,9,9)); - Handle(Geom_BSplineCurve) SPL1 = - GeomAPI_PointsToBSpline(array1).Curve(); - - TColgp_Array1OfPnt array2 (1,5); - array2.SetValue(1,gp_Pnt (-4,5,2 )); - array2.SetValue(2,gp_Pnt (-3,6,3 )); - array2.SetValue(3,gp_Pnt (-1,7,4 )); - array2.SetValue(4,gp_Pnt (0,8,5)); - array2.SetValue(5,gp_Pnt (2,9,6)); - Handle(Geom_BSplineCurve) SPL2 = - GeomAPI_PointsToBSpline(array2).Curve(); - - GeomFill_FillingStyle Type = GeomFill_StretchStyle; - GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); - Handle(Geom_BSplineSurface) aGeomSurface = aGeomFill1.Surface(); - - Handle(Geom_BoundedSurface) aTranslatedGeomSurface = - Handle(Geom_BoundedSurface)::DownCast(aGeomSurface->Copy()); - - Standard_Real extension = 3; - Standard_Integer continuity = 2; - Standard_Boolean Udirection = Standard_True; - Standard_Boolean after = Standard_True; - GeomLib::ExtendSurfByLength (aTranslatedGeomSurface, - extension,continuity,Udirection,after); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array1 (1,5); \n\ -// ... \n\ -Handle(Geom_BSplineCurve) SPL1 = \n\ - GeomAPI_PointsToBSpline(array1).Curve(); \n\ - \n\ -TColgp_Array1OfPnt array2 (1,5); \n\ -// ... \n\ -Handle(Geom_BSplineCurve) SPL2 = \n\ - GeomAPI_PointsToBSpline(array2).Curve(); \n\ - \n\ -GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\ -GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\ -Handle(Geom_BSplineSurface) aGeomSurface = aGeomFill1.Surface(); \n\ - \n\ -Handle(Geom_BoundedSurface) aTranslatedGeomSurface = \n\ - Handle(Geom_BoundedSurface)::DownCast(aGeomSurface->Copy()); \n\ - \n\ -Standard_Real extension = 3; \n\ -Standard_Integer continuity = 2; \n\ -Standard_Boolean Udirection = Standard_True; \n\ -Standard_Boolean after = Standard_True; \n\ -GeomLib::ExtendSurfByLength (aTranslatedGeomSurface, \n\ - extension,continuity,Udirection,after); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - if (!aGeomSurface.IsNull()) - { - DisplaySurface(aDoc,aGeomSurface,Quantity_NOC_HOTPINK); - } - - if (!aTranslatedGeomSurface.IsNull()) - { - DisplaySurface(aDoc,aTranslatedGeomSurface,Quantity_NOC_BLUE1); - } - - DisplayCurve(aDoc,SPL1,Quantity_NOC_RED ,false); - DisplayCurve(aDoc,SPL2,Quantity_NOC_GREEN ,false); - - Message += "aGeomSurface is Hot Pink; \n"; - Message += "aTranslatedGeomSurface is Blue; \n"; - Message += "SPL1 is Red; \n"; - Message += "SPL2 is Green; \n"; - - PostProcess(aDoc,ID_BUTTON_Test_46,TheDisplayType,Message); -} - -void GeomSources::gpTest47(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - - TColgp_Array1OfPnt array1 (1,5); - array1.SetValue(1,gp_Pnt (-5,1,2)); - array1.SetValue(2,gp_Pnt (-5,2,2)); - array1.SetValue(3,gp_Pnt (-5.3,3,1)); - array1.SetValue(4,gp_Pnt (-5,4,1)); - array1.SetValue(5,gp_Pnt (-5,5,2)); - Handle(Geom_BSplineCurve) SPL1 = - GeomAPI_PointsToBSpline(array1).Curve(); - - TColgp_Array1OfPnt array2 (1,5); - array2.SetValue(1,gp_Pnt (4,1,2)); - array2.SetValue(2,gp_Pnt (4,2,2)); - array2.SetValue(3,gp_Pnt (3.7,3,1)); - array2.SetValue(4,gp_Pnt (4,4,1)); - array2.SetValue(5,gp_Pnt (4,5,2)); - Handle(Geom_BSplineCurve) SPL2 = - GeomAPI_PointsToBSpline(array2).Curve(); - - GeomFill_FillingStyle Type = GeomFill_StretchStyle; - - GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); - Handle(Geom_BSplineSurface) aSurf1 = aGeomFill1.Surface(); - - TColgp_Array2OfPnt array3 (1,5,1,5); - array3.SetValue(1,1,gp_Pnt (-4,-4,5)); - array3.SetValue(1,2,gp_Pnt (-4,-2,5)); - array3.SetValue(1,3,gp_Pnt (-4,0,4)); - array3.SetValue(1,4,gp_Pnt (-4,2,5)); - array3.SetValue(1,5,gp_Pnt (-4,4,5)); - - array3.SetValue(2,1,gp_Pnt (-2,-4,4)); - array3.SetValue(2,2,gp_Pnt (-2,-2,4)); - array3.SetValue(2,3,gp_Pnt (-2,0,4)); - array3.SetValue(2,4,gp_Pnt (-2,2,4)); - array3.SetValue(2,5,gp_Pnt (-2,5,4)); - - array3.SetValue(3,1,gp_Pnt (0,-4,3.5)); - array3.SetValue(3,2,gp_Pnt (0,-2,3.5)); - array3.SetValue(3,3,gp_Pnt (0,0,3.5)); - array3.SetValue(3,4,gp_Pnt (0,2,3.5)); - array3.SetValue(3,5,gp_Pnt (0,5,3.5)); - - array3.SetValue(4,1,gp_Pnt (2,-4,4)); - array3.SetValue(4,2,gp_Pnt (2,-2,4)); - array3.SetValue(4,3,gp_Pnt (2,0,3.5)); - array3.SetValue(4,4,gp_Pnt (2,2,5)); - array3.SetValue(4,5,gp_Pnt (2,5,4)); - - array3.SetValue(5,1,gp_Pnt (4,-4,5)); - array3.SetValue(5,2,gp_Pnt (4,-2,5)); - array3.SetValue(5,3,gp_Pnt (4,0,5)); - array3.SetValue(5,4,gp_Pnt (4,2,6)); - array3.SetValue(5,5,gp_Pnt (4,5,5)); - - Handle(Geom_BSplineSurface) aSurf2 = - GeomAPI_PointsToBSplineSurface(array3).Surface(); - - GeomAPI_ExtremaSurfaceSurface ESS(aSurf1,aSurf2); - //Standard_Real dist = ESS.LowerDistance(); - gp_Pnt P1,P2; - ESS.NearestPoints(P1,P2); - - gp_Pnt P3,P4; - Handle(Geom_Curve) aCurve; - Standard_Integer NbExtrema = ESS.NbExtrema(); - for(Standard_Integer k=1;k<=NbExtrema;k++){ - ESS.Points(k,P3,P4); - aCurve= GC_MakeSegment(P3,P4).Value(); - DisplayCurve(aDoc,aCurve,Quantity_NOC_YELLOW3,false); -} - -//============================================================== - - TCollection_AsciiString Message (" \n\ -GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\ - \n\ -GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\ -Handle(Geom_BSplineSurface) aSurf1 = aGeomFill1.Surface(); \n\ - \n\ -Handle(Geom_BSplineSurface) aSurf2 = \n\ - GeomAPI_PointsToBSplineSurface(array3).Surface(); \n\ - \n\ -GeomAPI_ExtremaSurfaceSurface ESS(aSurf1,aSurf2); \n\ -Standard_Real dist = ESS.LowerDistance(); \n\ -gp_Pnt P1,P2; \n\ -ESS.NearestPoints(P1,P2); \n\ - \n"); - - AddSeparator(aDoc,Message); - Message += "aSurf1 is Green; \n"; - Message += "aSurf2 is Hot Pink; \n"; - Message += "Nearest points P1 and P2 are shown; \n"; - - //-------------------------------------------------------------- - -//mfa - - DisplaySurface(aDoc,aSurf1,Quantity_NOC_GREEN); - DisplaySurface(aDoc,aSurf2,Quantity_NOC_HOTPINK); - DisplayCurve(aDoc,SPL1,Quantity_NOC_RED ,false); - DisplayCurve(aDoc,SPL2,Quantity_NOC_AZURE ,false); - - DisplayPoint(aDoc,P1,Standard_CString("P1")); - DisplayPoint(aDoc,P2,Standard_CString("P2")); - - PostProcess(aDoc,ID_BUTTON_Test_47,TheDisplayType,Message); -} - -void GeomSources::gpTest48(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = a2DNo3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - Standard_Real radius = 3; - Handle(Geom2d_Circle) circle = - new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(-7,2),gp_Dir2d(1,0)),radius); - - Handle(Geom2d_TrimmedCurve) C = new Geom2d_TrimmedCurve(circle,1,5); - - Geom2dAdaptor_Curve GAC (C); - - - TColgp_Array1OfPnt2d array (1,5); // sizing array - array.SetValue(1,gp_Pnt2d (0,0)); - array.SetValue(2,gp_Pnt2d (1,2)); - array.SetValue(3,gp_Pnt2d (2,3)); - array.SetValue(4,gp_Pnt2d (4,3)); - array.SetValue(5,gp_Pnt2d (5,5)); - Handle(Geom2d_BSplineCurve) SPL1 = - Geom2dAPI_PointsToBSpline(array); - - - Handle(TColgp_HArray1OfPnt2d) harray = - new TColgp_HArray1OfPnt2d (1,5); // sizing harray - harray->SetValue(1,gp_Pnt2d (13+ 0,0)); - harray->SetValue(2,gp_Pnt2d (13+ 1,2)); - harray->SetValue(3,gp_Pnt2d (13+ 2,3)); - harray->SetValue(4,gp_Pnt2d (13+ 4,3)); - harray->SetValue(5,gp_Pnt2d (13+ 5,5)); - Geom2dAPI_Interpolate anInterpolation(harray,Standard_True,0.01); - anInterpolation.Perform(); - Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve(); - - Bnd_Box2d aCBox; - Geom2dAdaptor_Curve GACC (C); - BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox); - - Standard_Real aCXmin, aCYmin, aCXmax, aCYmax; - aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax); - - Bnd_Box2d aSPL1Box; - Geom2dAdaptor_Curve GAC1 (SPL1); - BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box); - - Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax; - aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax); - - Bnd_Box2d aSPL2Box; - Geom2dAdaptor_Curve GAC2 (SPL2); - BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box); - - Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax; - aSPL2Box.Get( aSPL2Xmin, aSPL2Ymin, aSPL2Xmax,aSPL2Ymax); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -Standard_Real radius = 3; \n\ -Handle(Geom2d_Circle) circle = \n\ - new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(-7,2),gp_Dir2d(1,0)),radius); \n\ - \n\ -Handle(Geom2d_TrimmedCurve) C = new Geom2d_TrimmedCurve(circle,1,5); \n\ -Geom2dAdaptor_Curve GAC (C); \n\ - \n\ -Handle(Geom2d_BSplineCurve) SPL1 ; // SPL1 = ... \n\ - \n\ -Handle(Geom2d_BSplineCurve) SPL2 ; // SPL2 = ... \n\ - \n\ -Bnd_Box2d aCBox; \n\ -Geom2dAdaptor_Curve GACC (C); \n\ -BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox); \n\ - \n\ -Standard_Real aCXmin, aCYmin, aCXmax, aCYmax; \n\ -aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax); \n\ - \n\ -Bnd_Box2d aSPL1Box; \n\ -Geom2dAdaptor_Curve GAC1 (SPL1); \n\ -BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box); \n\ - \n\ -Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax; \n\ -aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax); \n"); -Message += "\ - \n\ -Bnd_Box2d aSPL2Box; \n\ -Geom2dAdaptor_Curve GAC2 (SPL2); \n\ -BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box); \n\ - \n\ -Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax; \n\ -aSPL2Box.Get( aSPL2Xmin, aSPL2Ymin, aSPL2Xmax,aSPL2Ymax); \n\ - \n"; - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayCurve(aDoc,C ,5); - DisplayCurve(aDoc,SPL1,6 ); - DisplayCurve(aDoc,SPL2,7 ); - - DisplayPoint(aDoc,gp_Pnt2d(aCXmin,aCYmax),Standard_CString("aCXmin,aCYmax")); - DisplayPoint(aDoc,gp_Pnt2d(aCXmax,aCYmax),Standard_CString("aCXmax,aCYmax")); - DisplayPoint(aDoc,gp_Pnt2d(aCXmin,aCYmin),Standard_CString("aCXmin,aCYmin")); - DisplayPoint(aDoc,gp_Pnt2d(aCXmax,aCYmin),Standard_CString("aCXmax,aCYmin")); - - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aCXmin,aCYmax),gp_Pnt2d(aCXmax,aCYmax)).Value() ,4); // X,Ymax - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aCXmin,aCYmin),gp_Pnt2d(aCXmax,aCYmin)).Value() ,4); // X,Ymin - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aCXmin,aCYmin),gp_Pnt2d(aCXmin,aCYmax)).Value() ,4); // Xmin,Y - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aCXmax,aCYmin),gp_Pnt2d(aCXmax,aCYmax)).Value() ,4); // Xmax,Y - - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmin,aSPL1Ymax),Standard_CString("aSPL1Xmin,aSPL1Ymax")); - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmax,aSPL1Ymax),Standard_CString("aSPL1Xmax,aSPL1Ymax")); - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmin,aSPL1Ymin),Standard_CString("aSPL1Xmin,aSPL1Ymin")); - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmax,aSPL1Ymin),Standard_CString("aSPL1Xmax,aSPL1Ymin")); - - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL1Xmin,aSPL1Ymax),gp_Pnt2d(aSPL1Xmax,aSPL1Ymax)).Value() ,4); // X,Ymax - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL1Xmin,aSPL1Ymin),gp_Pnt2d(aSPL1Xmax,aSPL1Ymin)).Value() ,4); // X,Ymin - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL1Xmin,aSPL1Ymin),gp_Pnt2d(aSPL1Xmin,aSPL1Ymax)).Value() ,4); // Xmin,Y - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL1Xmax,aSPL1Ymin),gp_Pnt2d(aSPL1Xmax,aSPL1Ymax)).Value() ,4); // Xmax,Y - - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmin,aSPL1Ymax),Standard_CString("aSPL2Xmin,aSPL2Ymax")); - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmax,aSPL1Ymax),Standard_CString("aSPL2Xmax,aSPL2Ymax")); - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmin,aSPL1Ymin),Standard_CString("aSPL2Xmin,aSPL2Ymin")); - DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmax,aSPL1Ymin),Standard_CString("aSPL2Xmax,aSPL2Ymin")); - - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL2Xmin,aSPL2Ymax),gp_Pnt2d(aSPL2Xmax,aSPL2Ymax)).Value() ,4); // X,Ymax - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL2Xmin,aSPL2Ymin),gp_Pnt2d(aSPL2Xmax,aSPL2Ymin)).Value() ,4); // X,Ymin - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL2Xmin,aSPL2Ymin),gp_Pnt2d(aSPL2Xmin,aSPL2Ymax)).Value() ,4); // Xmin,Y - DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL2Xmax,aSPL2Ymin),gp_Pnt2d(aSPL2Xmax,aSPL2Ymax)).Value() ,4); // Xmax,Y - - PostProcess(aDoc,ID_BUTTON_Test_48,TheDisplayType,Message); -} - - -void GeomSources::gpTest49(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - - //============================================================== - - Bnd_Box aBox; - Standard_Real radius = 100; - gp_Ax2 anAxis(gp_Pnt(0,0,0),gp_Dir(1,2,-5)); - - Handle(Geom_Circle) C = - new Geom_Circle(anAxis,radius); - GeomAdaptor_Curve GAC (C); - BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox); - - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; - aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); - - //============================================================== - - TCollection_AsciiString Message (" \ - \n\ -Bnd_Box aBox; \n\ -Standard_Real radius = 100; \n\ -gp_Ax2 anAxis(gp_Pnt(0,0,0),gp_Dir(1,2,-5)); \n\ - \n\ -Handle(Geom_Circle) C = \n\ - new Geom_Circle(anAxis,radius); \n\ -GeomAdaptor_Curve GAC (C); \n\ -BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox); \n\ - \n\ -Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\ -aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - DisplayCurve(aDoc,C,Quantity_NOC_BLUE1 ,false); - - DisplayPoint(aDoc,gp_Pnt(aXmin,aYmax,aZmin),Standard_CString("aXmin,aYmax,aZmin")); - DisplayPoint(aDoc,gp_Pnt(aXmax,aYmax,aZmin),Standard_CString("aXmax,aYmax,aZmin")); - DisplayPoint(aDoc,gp_Pnt(aXmin,aYmin,aZmin),Standard_CString("aXmin,aYmin,aZmin")); - DisplayPoint(aDoc,gp_Pnt(aXmax,aYmin,aZmin),Standard_CString("aXmax,aYmin,aZmin")); - - DisplayPoint(aDoc,gp_Pnt(aXmin,aYmax,aZmax),Standard_CString("aXmin,aYmax,aZmax")); - DisplayPoint(aDoc,gp_Pnt(aXmax,aYmax,aZmax),Standard_CString("aXmax,aYmax,aZmax")); - DisplayPoint(aDoc,gp_Pnt(aXmin,aYmin,aZmax),Standard_CString("aXmin,aYmin,aZmax")); - DisplayPoint(aDoc,gp_Pnt(aXmax,aYmin,aZmax),Standard_CString("aXmax,aYmin,aZmax")); - - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmax,aZmin), - gp_Pnt(aXmax,aYmax,aZmin)).Value() ,Quantity_NOC_RED); // X,Ymax,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmin), - gp_Pnt(aXmax,aYmin,aZmin)).Value() ,Quantity_NOC_RED); // X,Ymin,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmin), - gp_Pnt(aXmin,aYmax,aZmin)).Value() ,Quantity_NOC_RED); // Xmin,Y,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmin,aZmin), - gp_Pnt(aXmax,aYmax,aZmin)).Value() ,Quantity_NOC_RED); // Xmax,Y,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmax,aZmax), - gp_Pnt(aXmax,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // X,Ymax,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmax), - gp_Pnt(aXmax,aYmin,aZmax)).Value() ,Quantity_NOC_RED); // X,Ymin,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmax), - gp_Pnt(aXmin,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmin,Y,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmin,aZmax), - gp_Pnt(aXmax,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmax,Y,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmin), - gp_Pnt(aXmin,aYmin,aZmax)).Value() ,Quantity_NOC_RED); // Xmin,Ymin,Z - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmin,aZmin), - gp_Pnt(aXmax,aYmin,aZmax)).Value() ,Quantity_NOC_RED); // Xmax,Ymin,Z - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmax,aZmin), - gp_Pnt(aXmin,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmin,Ymax,Z - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmax,aZmin), - gp_Pnt(aXmax,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmax,Ymax,Z - - PostProcess(aDoc,ID_BUTTON_Test_49,TheDisplayType,Message); -} - -void GeomSources::gpTest50(CGeometryDoc* aDoc) -{ - DisplayType TheDisplayType = No2D3D; - PreProcess(aDoc,TheDisplayType); - //============================================================== - - TColgp_Array1OfPnt array1 (1,5); - array1.SetValue(1,gp_Pnt (-40,00,20 )); - array1.SetValue(2,gp_Pnt (-70,20,20 )); - array1.SetValue(3,gp_Pnt (-60,30,10 )); - array1.SetValue(4,gp_Pnt (-40,30,-10)); - array1.SetValue(5,gp_Pnt (-30,50,-20)); - Handle(Geom_BSplineCurve) SPL1 = - GeomAPI_PointsToBSpline(array1).Curve(); - - TColgp_Array1OfPnt array2 (1,5); - array2.SetValue(1,gp_Pnt (-40,0, 20)); - array2.SetValue(2,gp_Pnt (-20,20,0 )); - array2.SetValue(3,gp_Pnt (20 ,30,-10)); - array2.SetValue(4,gp_Pnt (30 ,70,-20)); - array2.SetValue(5,gp_Pnt (40 ,90,-10)); - Handle(Geom_BSplineCurve) SPL2 = - GeomAPI_PointsToBSpline(array2).Curve(); - - GeomFill_FillingStyle Type = GeomFill_StretchStyle; - GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); - Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); - GeomAdaptor_Surface GAS (aSurf); - Bnd_Box aBox; - BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); - - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; - aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); - - //============================================================== - TCollection_AsciiString Message (" \ - \n\ -TColgp_Array1OfPnt array1 (1,5); \n\ -array1.SetValue(1,gp_Pnt (-40, 0, 20)); \n\ -array1.SetValue(2,gp_Pnt (-70, 20, 20)); \n\ -array1.SetValue(3,gp_Pnt (-60, 30, 10)); \n\ -array1.SetValue(4,gp_Pnt (-40, 30,-10)); \n\ -array1.SetValue(5,gp_Pnt (-30, 50,-20)); \n\ -Handle(Geom_BSplineCurve) SPL1 = \n\ - GeomAPI_PointsToBSpline(array1).Curve(); \n\ - \n\ -TColgp_Array1OfPnt array2 (1,5); \n\ -array2.SetValue(1,gp_Pnt (-40, 0, 20)); \n\ -array2.SetValue(2,gp_Pnt (-20, 20, 0)); \n\ -array2.SetValue(3,gp_Pnt ( 20, 30,-10)); \n\ -array2.SetValue(4,gp_Pnt ( 30, 70,-20)); \n\ -array2.SetValue(5,gp_Pnt ( 40, 90,-10)); \n\ -Handle(Geom_BSplineCurve) SPL2 = \n\ - GeomAPI_PointsToBSpline(array2).Curve(); \n\ - \n\ -GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\ -GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\ -Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); \n\ -GeomAdaptor_Surface GAS (aSurf); \n\ -Bnd_Box aBox; \n\ -BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); \n\ - \n\ -Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\ -aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\ - \n"); - AddSeparator(aDoc,Message); - //-------------------------------------------------------------- - - Quantity_NameOfColor aNameOfColor= Quantity_NOC_GREEN; - Handle(ISession_Surface) aGraphicalSurface = new ISession_Surface(aSurf); - aDoc->GetAISContext()->SetColor (aGraphicalSurface, aNameOfColor, Standard_False); - aGraphicalSurface->Attributes()->FreeBoundaryAspect()->SetColor(aNameOfColor); - aGraphicalSurface->Attributes()->UIsoAspect()->SetColor(aNameOfColor); - aGraphicalSurface->Attributes()->VIsoAspect()->SetColor(aNameOfColor); - - aDoc->GetAISContext()->SetDisplayMode (aGraphicalSurface, 1, Standard_False); - aDoc->GetAISContext()->Display(aGraphicalSurface,false); - // DisplaySurface(aDoc,aSurf,Quantity_NOC_GREEN); - - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmax,aZmin), - gp_Pnt(aXmax,aYmax,aZmin)).Value() ,Quantity_NOC_RED); // X,Ymax,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmin), - gp_Pnt(aXmax,aYmin,aZmin)).Value() ,Quantity_NOC_RED); // X,Ymin,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmin), - gp_Pnt(aXmin,aYmax,aZmin)).Value() ,Quantity_NOC_RED); // Xmin,Y,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmin,aZmin), - gp_Pnt(aXmax,aYmax,aZmin)).Value() ,Quantity_NOC_RED); // Xmax,Y,ZMin - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmax,aZmax), - gp_Pnt(aXmax,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // X,Ymax,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmax), - gp_Pnt(aXmax,aYmin,aZmax)).Value() ,Quantity_NOC_RED); // X,Ymin,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmax), - gp_Pnt(aXmin,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmin,Y,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmin,aZmax), - gp_Pnt(aXmax,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmax,Y,ZMax - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmin,aZmin), - gp_Pnt(aXmin,aYmin,aZmax)).Value() ,Quantity_NOC_RED); // Xmin,Ymin,Z - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmin,aZmin), - gp_Pnt(aXmax,aYmin,aZmax)).Value() ,Quantity_NOC_RED); // Xmax,Ymin,Z - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmin,aYmax,aZmin), - gp_Pnt(aXmin,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmin,Ymax,Z - DisplayCurve(aDoc,GC_MakeSegment(gp_Pnt(aXmax,aYmax,aZmin), - gp_Pnt(aXmax,aYmax,aZmax)).Value() ,Quantity_NOC_RED); // Xmax,Ymax,Z - - PostProcess(aDoc,ID_BUTTON_Test_50,TheDisplayType,Message); -} diff --git a/samples/mfc/standard/01_Geometry/src/GeomSources.h b/samples/mfc/standard/01_Geometry/src/GeomSources.h deleted file mode 100755 index 33b9836f46..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeomSources.h +++ /dev/null @@ -1,136 +0,0 @@ -// GeomSources.h: interface for the GeomSources class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX__H__FE726813_A2C6_11D1_8DA3_0800369C8A03__INCLUDED_) -#define AFX__H__FE726813_A2C6_11D1_8DA3_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "Standard_Macro.hxx" -#include "ResultDialog.h" -#include "GeometryDoc.h" - -class GeomSources -{ -public: - Standard_EXPORT static void gpTest1(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest2(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest3(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest4(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest5(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest6(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest7(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest8(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest9(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest10(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest11(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest12(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest13(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest14(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest15(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest16(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest17(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest18(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest19(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest20(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest21(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest22(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest23(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest24(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest25(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest26(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest27(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest28(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest29(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest30(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest31(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest32(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest33(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest34(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest35(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest36(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest37(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest38(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest39(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest40(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest41(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest42(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest43(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest44(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest45(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest46(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest47(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest48(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest49(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest50(CGeometryDoc* aDoc); - Standard_EXPORT static void gpTest51(CGeometryDoc* aDoc); - GeomSources(); - virtual ~GeomSources(); - -private: - - enum DisplayType{No2DNo3D, // 0 0 0 - No2D3D , // 0 0 1 - a2DNo3D , // 0 1 0 - a2D3D }; // 1 1 1 - static void PreProcess (CGeometryDoc* aDoc,DisplayType aDisplayType); - static void PostProcess(CGeometryDoc* aDoc, - UINT anID, - DisplayType aDisplayType, - const TCollection_AsciiString& aString, - Standard_Boolean UpdateViewer = Standard_True, - Standard_Real Coef = -1); - static void DisplayPoint(CGeometryDoc* aDoc, - const gp_Pnt2d& aPoint, - const char* aText, - Standard_Boolean UpdateViewer = Standard_False, - Standard_Real anXoffset =0, - Standard_Real anYoffset =0, - Standard_Real TextScale = 0.05); - static void DisplayPoint(CGeometryDoc* aDoc, - const gp_Pnt& aPoint, - const char* aText, - Standard_Boolean UpdateViewer = Standard_False, - Standard_Real anXoffset = 0, - Standard_Real anYoffset = 0, - Standard_Real aZoffset = 0, - Standard_Real TextScale = 0.05); - - static void DisplayCurve(CGeometryDoc* aDoc, - Handle(Geom2d_Curve) aCurve, - Standard_Integer aColorIndex = 4, - Standard_Boolean UpdateViewer = false); - static void DisplayCurveAndCurvature(CGeometryDoc* aDoc, - Handle(Geom2d_Curve) aCurve, - Standard_Integer aColorIndex = 4, - Standard_Boolean UpdateViewer = false); - - static void DisplayCurve(CGeometryDoc* aDoc, - Handle(Geom_Curve) aCurve, - Quantity_NameOfColor aNameOfColor, - Standard_Boolean UpdateViewer = false); - - static void DisplayCurve(CGeometryDoc* aDoc, - Handle(Geom_Curve) aCurve, - Standard_Boolean UpdateViewer = false); - - static void DisplaySurface (CGeometryDoc* aDoc, - Handle(Geom_Surface) aSurface, - Quantity_NameOfColor aNameOfColor, - Standard_Boolean UpdateViewer = false); - - static void DisplaySurface (CGeometryDoc* aDoc, - Handle(Geom_Surface) aSurface, - Standard_Boolean UpdateViewer = false); - - static void ResetView(CGeometryDoc* aDoc); - - static void AddSeparator(CGeometryDoc* aDoc,TCollection_AsciiString& aMessage); - - -}; - -#endif // !defined(AFX__H__FE726813_A2C6_11D1_8DA3_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/GeometryApp.cpp b/samples/mfc/standard/01_Geometry/src/GeometryApp.cpp deleted file mode 100755 index 70d75ceb3e..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryApp.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// GeometryApp.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" - -#include "GeometryApp.h" -#include "MainFrm.h" -#include "ChildFrm.h" -#include "GeometryDoc.h" -#include "GeometryView.h" -#include "GeometryView2d.h" -#include "ChildFrm2D.h" -#include "GeometryView2d.h" - -///////////////////////////////////////////////////////////////////////////// -// CGeometryApp construction - -CGeometryApp::CGeometryApp() : OCC_App() -{ - SampleName = "Geometry"; //for about dialog - SetSamplePath (L"..\\..\\01_Geometry"); -} - -CGeometryApp::~CGeometryApp() -{ - delete pDocTemplateForView2d; -} -///////////////////////////////////////////////////////////////////////////// -// The one and only CGeometryApp object - -CGeometryApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CGeometryApp initialization - -BOOL CGeometryApp::InitInstance() -{ - AfxInitRichEdit(); - AfxEnableControlContainer(); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - - // Change the registry key under which our settings are stored. - // You should modify this string to be something appropriate - // such as the name of your company or organization. - SetRegistryKey(_T("Local AppWizard-Generated Applications")); - - LoadStdProfileSettings(); // Load standard INI file options (including MRU) - - // Register the application's document templates. Document templates - // serve as the connection between documents, frame windows and views. - - pDocTemplateForView3d = new CMultiDocTemplate( - IDR_3DTYPE, - RUNTIME_CLASS(CGeometryDoc), - RUNTIME_CLASS(CChildFrame), // custom MDI child frame - RUNTIME_CLASS(CGeometryView)); - AddDocTemplate(pDocTemplateForView3d); - - pDocTemplateForView2d = new CMultiDocTemplate( - IDR_2DTYPE, - RUNTIME_CLASS(CGeometryDoc), - RUNTIME_CLASS(CChildFrame2D), // custom MDI child frame - RUNTIME_CLASS(CGeometryView2D)); - //AddDocTemplate(pDocTemplateForView2d); - - // create main MDI Frame window - CMainFrame* pMainFrame = new CMainFrame; - if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) - return FALSE; - m_pMainWnd = pMainFrame; - - // Parse command line for standard shell commands, DDE, file open - CCommandLineInfo cmdInfo; - ParseCommandLine(cmdInfo); - - // Dispatch commands specified on the command line - if (!ProcessShellCommand(cmdInfo)) - return FALSE; - - // The main window has been initialized, so show and update it. - pMainFrame->ShowWindow(m_nCmdShow); - pMainFrame->UpdateWindow(); - - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////// -// CGeometryApp commands - -//=================================================== - -CFrameWnd* CGeometryApp::CreateView2D(CGeometryDoc* pDoc ) -{ - ASSERT_VALID(pDoc); - ASSERT_VALID(pDocTemplateForView2d); - CRuntimeClass * pViewClass = RUNTIME_CLASS(CGeometryView2D); - ASSERT(pViewClass != (CRuntimeClass *)NULL ); - // Create a new frame window - CFrameWnd* pNewFrame = pDocTemplateForView2d->CreateNewFrame(pDoc, NULL); - pDocTemplateForView2d->InitialUpdateFrame(pNewFrame, pDoc); -return pNewFrame; -} - -BOOL CGeometryApp::IsViewExisting(CDocument * pDoc, CRuntimeClass * pViewClass, CView * & pView) -{ - ASSERT_VALID(pDoc); - ASSERT(pViewClass != (CRuntimeClass *)NULL ); - - POSITION position = pDoc->GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = pDoc->GetNextView(position); - ASSERT_VALID(pCurrentView); - if (pCurrentView->IsKindOf(pViewClass)) - { - pView = pCurrentView; - return TRUE; - } - } - return FALSE; -} - diff --git a/samples/mfc/standard/01_Geometry/src/GeometryApp.h b/samples/mfc/standard/01_Geometry/src/GeometryApp.h deleted file mode 100755 index eb98f40266..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryApp.h +++ /dev/null @@ -1,39 +0,0 @@ -// GeometryApp.h : main header file for the GEOMETRY application -// - -#if !defined(AFX_VIEWER_H__4EF39FB2_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) -#define AFX_VIEWER_H__4EF39FB2_4EBB_11D1_8D67_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include - -class CGeometryApp : public OCC_App -{ -public: - CGeometryApp(); - ~CGeometryApp(); - // ========================================= - CFrameWnd* CreateView2D(CGeometryDoc* pDoc); - // ========================================= - // ========================================= - - // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CGeometryApp) -public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL -private : - BOOL IsViewExisting(CDocument* pDoc,CRuntimeClass* pViewClass,CView*& pView); - CMultiDocTemplate* pDocTemplateForView3d; - CMultiDocTemplate* pDocTemplateForView2d; - -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_VIEWER_H__4EF39FB2_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp b/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp deleted file mode 100755 index 8ea5b4b6e0..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp +++ /dev/null @@ -1,1608 +0,0 @@ -// GeometryDoc.cpp : implementation of the CGeometryDoc class -// - -#include "stdafx.h" - -#include "GeometryDoc.h" -#include "GeoAlgo_Sol.hxx" -#include "GeometryApp.h" -#include "GeometryView2D.h" -#include "GeometryView.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif -#include "GeomSources.h" - -#define EOL "\r\n" - -#define WAIT_A_LITTLE WaitForInput(500) - -#define MAX_PARAM 1000 // if a surface parameter is infinite, it is assigned -// this value in order to display the "infinit" object in the viewer. - -///////////////////////////////////////////////////////////////////////////// -// CGeometryDoc - -IMPLEMENT_DYNCREATE(CGeometryDoc, OCC_3dBaseDoc) - -BEGIN_MESSAGE_MAP(CGeometryDoc, OCC_3dBaseDoc) - //{{AFX_MSG_MAP(CGeometryDoc) - ON_COMMAND(ID_WINDOW_NEW2D, OnWindowNew2d) - ON_COMMAND(ID_BUTTON_Test_1, OnBUTTONTest1) - ON_COMMAND(ID_BUTTON_Test_2, OnBUTTONTest2) - ON_COMMAND(ID_BUTTON_Test_3, OnBUTTONTest3) - ON_COMMAND(ID_BUTTON_Test_4, OnBUTTONTest4) - ON_COMMAND(ID_BUTTON_Test_5, OnBUTTONTest5) - ON_COMMAND(ID_BUTTON_Test_6, OnBUTTONTest6) - ON_COMMAND(ID_BUTTON_Test_7, OnBUTTONTest7) - ON_COMMAND(ID_BUTTON_Test_8, OnBUTTONTest8) - ON_COMMAND(ID_BUTTON_Test_9, OnBUTTONTest9) - ON_COMMAND(ID_BUTTON_Test_23, OnBUTTONTest23) - ON_COMMAND(ID_BUTTON_Test_22, OnBUTTONTest22) - ON_COMMAND(ID_BUTTON_Test_10, OnBUTTONTest10) - ON_COMMAND(ID_BUTTON_Test_11, OnBUTTONTest11) - ON_COMMAND(ID_BUTTON_Test_12, OnBUTTONTest12) - ON_COMMAND(ID_BUTTON_Test_13, OnBUTTONTest13) - ON_COMMAND(ID_BUTTON_Test_14, OnBUTTONTest14) - ON_COMMAND(ID_BUTTON_Test_15, OnBUTTONTest15) - ON_COMMAND(ID_BUTTON_Test_16, OnBUTTONTest16) - ON_COMMAND(ID_BUTTON_Test_17, OnBUTTONTest17) - ON_COMMAND(ID_BUTTON_Test_18, OnBUTTONTest18) - ON_COMMAND(ID_BUTTON_Test_19, OnBUTTONTest19) - ON_COMMAND(ID_BUTTON_Test_20, OnBUTTONTest20) - ON_COMMAND(ID_BUTTON_Test_21, OnBUTTONTest21) - ON_COMMAND(ID_BUTTON_Test_24, OnBUTTONTest24) - ON_COMMAND(ID_BUTTON_Test_25, OnBUTTONTest25) - ON_COMMAND(ID_BUTTON_Test_26, OnBUTTONTest26) - ON_COMMAND(ID_BUTTON_Test_27, OnBUTTONTest27) - ON_COMMAND(ID_BUTTON_Test_28, OnBUTTONTest28) - ON_COMMAND(ID_BUTTON_Test_29, OnBUTTONTest29) - ON_COMMAND(ID_BUTTON_Test_30, OnBUTTONTest30) - ON_COMMAND(ID_BUTTON_Test_31, OnBUTTONTest31) - ON_COMMAND(ID_BUTTON_Test_32, OnBUTTONTest32) - ON_COMMAND(ID_BUTTON_Test_33, OnBUTTONTest33) - ON_COMMAND(ID_BUTTON_Test_34, OnBUTTONTest34) - ON_COMMAND(ID_BUTTON_Test_35, OnBUTTONTest35) - ON_COMMAND(ID_BUTTON_Test_36, OnBUTTONTest36) - ON_COMMAND(ID_BUTTON_Test_37, OnBUTTONTest37) - ON_COMMAND(ID_BUTTON_Test_38, OnBUTTONTest38) - ON_COMMAND(ID_BUTTON_Test_39, OnBUTTONTest39) - ON_COMMAND(ID_BUTTON_Test_40, OnBUTTONTest40) - ON_COMMAND(ID_BUTTON_Test_41, OnBUTTONTest41) - ON_COMMAND(ID_BUTTON_Test_42, OnBUTTONTest42) - ON_COMMAND(ID_BUTTON_Test_43, OnBUTTONTest43) - ON_COMMAND(ID_BUTTON_Test_44, OnBUTTONTest44) - ON_COMMAND(ID_BUTTON_Test_45, OnBUTTONTest45) - ON_COMMAND(ID_BUTTON_Test_46, OnBUTTONTest46) - ON_COMMAND(ID_BUTTON_Test_47, OnBUTTONTest47) - ON_COMMAND(ID_BUTTON_Test_48, OnBUTTONTest48) - ON_COMMAND(ID_BUTTON_Test_49, OnBUTTONTest49) - ON_COMMAND(ID_BUTTON_Test_50, OnBUTTONTest50) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_1 , OnUpdateBUTTONTest1 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_2 , OnUpdateBUTTONTest2 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_3 , OnUpdateBUTTONTest3 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_4 , OnUpdateBUTTONTest4 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_5 , OnUpdateBUTTONTest5 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_6 , OnUpdateBUTTONTest6 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_7 , OnUpdateBUTTONTest7 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_8 , OnUpdateBUTTONTest8 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_9 , OnUpdateBUTTONTest9 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_10 , OnUpdateBUTTONTest10 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_11 , OnUpdateBUTTONTest11 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_12 , OnUpdateBUTTONTest12 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_13 , OnUpdateBUTTONTest13 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_14 , OnUpdateBUTTONTest14 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_15 , OnUpdateBUTTONTest15 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_16 , OnUpdateBUTTONTest16 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_17 , OnUpdateBUTTONTest17 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_18 , OnUpdateBUTTONTest18 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_19 , OnUpdateBUTTONTest19 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_20 , OnUpdateBUTTONTest20 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_21 , OnUpdateBUTTONTest21 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_22 , OnUpdateBUTTONTest22 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_23 , OnUpdateBUTTONTest23 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_24 , OnUpdateBUTTONTest24 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_25 , OnUpdateBUTTONTest25 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_26 , OnUpdateBUTTONTest26 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_27 , OnUpdateBUTTONTest27 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_28 , OnUpdateBUTTONTest28 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_29 , OnUpdateBUTTONTest29 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_30 , OnUpdateBUTTONTest30 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_31 , OnUpdateBUTTONTest31 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_32 , OnUpdateBUTTONTest32 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_33 , OnUpdateBUTTONTest33 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_34 , OnUpdateBUTTONTest34 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_35 , OnUpdateBUTTONTest35 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_36 , OnUpdateBUTTONTest36 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_37 , OnUpdateBUTTONTest37 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_38 , OnUpdateBUTTONTest38 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_39 , OnUpdateBUTTONTest39 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_40 , OnUpdateBUTTONTest40 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_41 , OnUpdateBUTTONTest41 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_42 , OnUpdateBUTTONTest42 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_43 , OnUpdateBUTTONTest43 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_44 , OnUpdateBUTTONTest44 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_45 , OnUpdateBUTTONTest45 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_46 , OnUpdateBUTTONTest46 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_47 , OnUpdateBUTTONTest47 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_48 , OnUpdateBUTTONTest48 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_49 , OnUpdateBUTTONTest49 ) - ON_UPDATE_COMMAND_UI(ID_BUTTON_Test_50 , OnUpdateBUTTONTest50 ) - ON_COMMAND(ID_Create_Sol, OnCreateSol) - ON_COMMAND(ID_BUTTON_Simplify, OnSimplify) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CGeometryDoc construction/destruction - -CGeometryDoc::CGeometryDoc() -: OCC_3dBaseDoc() -{ - FitMode = false; - AfxInitRichEdit(); - - myAISContext->DefaultDrawer()->UIsoAspect()->SetNumber(11); - myAISContext->DefaultDrawer()->VIsoAspect()->SetNumber(11); - - Handle(Graphic3d_GraphicDriver) aGraphicDriver = ((OCC_App*)AfxGetApp())->GetGraphicDriver(); - myViewer2D = new V3d_Viewer (aGraphicDriver); - myViewer2D->SetCircularGridValues(0,0,1,8,0); - myViewer2D->SetRectangularGridValues(0,0,1,1,0); - - // Set view projection - myViewer2D->SetDefaultViewProj(V3d_Zpos); - myAISContext2D = new AIS_InteractiveContext(myViewer2D); - myCResultDialog.Create(CResultDialog::IDD,NULL); - - RECT dlgrect; - myCResultDialog.GetWindowRect(&dlgrect); - LONG width = dlgrect.right-dlgrect.left; - LONG height = dlgrect.bottom-dlgrect.top; - RECT MainWndRect; - AfxGetApp()->m_pMainWnd->GetWindowRect(&MainWndRect); - LONG left = MainWndRect.left+3; - LONG top = MainWndRect.top + 138; - myCResultDialog.MoveWindow(left,top,width,height); - - ((CGeometryApp*)AfxGetApp())->CreateView2D(this); - Minimize2D(); - Put3DOnTop(); -} - -CGeometryDoc::~CGeometryDoc() -{ -} - -BOOL CGeometryDoc::OnNewDocument() -{ - if (!CDocument::OnNewDocument()) - return FALSE; - - // TODO: add reinitialization code here - // (SDI documents will reuse this document) - // compute a graphic device --> the same for all Views - - return TRUE; -} - -void CGeometryDoc::OnWindowNew2d() -{ - ((CGeometryApp*)AfxGetApp())->CreateView2D(this); -} - -///////////////////////////////////////////////////////////////////////////// -// CGeometryDoc serialization - -void CGeometryDoc::Serialize(CArchive& ar) -{ - if (ar.IsStoring()) - { - // TODO: add storing code here - } - else - { - // TODO: add loading code here - } -} - -///////////////////////////////////////////////////////////////////////////// -// CGeometryDoc diagnostics - -#ifdef _DEBUG -void CGeometryDoc::AssertValid() const -{ - CDocument::AssertValid(); -} - -void CGeometryDoc::Dump(CDumpContext& dc) const -{ - CDocument::Dump(dc); -} -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CGeometryDoc commands - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::DragEvent2D(const Standard_Integer /*x*/, - const Standard_Integer /*y*/, - const Standard_Integer /*TheState*/, - const Handle(V3d_View)& /*aView*/) -{ -} - - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::InputEvent2D(const Standard_Integer /*x*/, - const Standard_Integer /*y*/, - const Handle(V3d_View)& /*aView*/) -{ - myAISContext2D->SelectDetected(); - myAISContext2D->UpdateCurrentViewer(); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::MoveEvent2D(const Standard_Integer x, - const Standard_Integer y, - const Handle(V3d_View)& aView) -{ - if (aView->Viewer()->IsGridActive()) - { - Standard_Real aGridX=0,aGridY=0,aGridZ=0; - aView->ConvertToGrid(x,y,aGridX,aGridY,aGridZ); - //View is not updated automatically in ConvertToGrid - aView->Update(); - } - this->myAISContext2D->MoveTo (x, y, aView, Standard_True); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::ShiftMoveEvent2D(const Standard_Integer /*x*/, - const Standard_Integer /*y*/, - const Handle(V3d_View)& /*aView*/) -{ -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::ShiftDragEvent2D(const Standard_Integer /*x*/, - const Standard_Integer /*y*/, - const Standard_Integer /*TheState*/, - const Handle(V3d_View)& /*aView*/) -{ -} - - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::ShiftInputEvent2D(const Standard_Integer /*x*/, - const Standard_Integer /*y*/, - const Handle(V3d_View)& /*aView*/) -{ -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Popup2D(const Standard_Integer x, - const Standard_Integer y, - const Handle(V3d_View)& aView) -{ - CMenu menu; - VERIFY(menu.LoadMenu(IDR_Popup3D)); - CMenu* pPopup; - - pPopup = menu.GetSubMenu(0); - - ASSERT(pPopup != NULL); - - POINT winCoord = { x , y }; - Handle(WNT_Window) aWNTWindow= - Handle(WNT_Window)::DownCast(aView->Window()); - ClientToScreen ( (HWND)(aWNTWindow->HWindow()),&winCoord); - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , winCoord.x, winCoord.y , - AfxGetMainWnd()); -} - - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Popup (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) -{ - Standard_Integer PopupMenuNumber=0; - GetAISContext()->InitSelected(); - if (GetAISContext()->MoreSelected()) - { - PopupMenuNumber=1; - } - - CMenu menu; - VERIFY(menu.LoadMenu(IDR_Popup3D)); - CMenu* pPopup = menu.GetSubMenu(PopupMenuNumber); - ASSERT(pPopup != NULL); - - POINT winCoord = { theMouseX , theMouseY }; - Handle(WNT_Window) aWNTWindow = Handle(WNT_Window)::DownCast(theView->Window()); - ClientToScreen ( (HWND)(aWNTWindow->HWindow()), &winCoord ); - - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , - winCoord.x, winCoord.y , - AfxGetMainWnd()); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::InputEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) -{ - myAISContext->SelectDetected(); - myAISContext2D->UpdateCurrentViewer(); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Put2DOnTop(bool isMax) -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView2D ) ) ) - { - ASSERT_VALID(pCurrentView); - CFrameWnd* pParentFrm = pCurrentView->GetParentFrame(); - ASSERT(pParentFrm != (CFrameWnd *)NULL); - // simply make the frame window visible - if(isMax) - { - pParentFrm->ActivateFrame(SW_SHOWMAXIMIZED); - } - else - { - pParentFrm->ActivateFrame(SW_SHOW); - } - } - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Minimize2D() -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView2D ) ) ) - { - ASSERT_VALID(pCurrentView); - CFrameWnd* pParentFrm = pCurrentView->GetParentFrame(); - ASSERT(pParentFrm != (CFrameWnd *)NULL); - // simply make the frame window visible - pParentFrm->ActivateFrame(SW_HIDE); - } - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Fit2DViews() -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView2D ) ) ) - { - ASSERT_VALID(pCurrentView); - CGeometryView2D* aCGeometryView2D = (CGeometryView2D*)pCurrentView; - aCGeometryView2D->FitAll(); - } - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Put3DOnTop(bool isMax) -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView ) ) ) - { - ASSERT_VALID(pCurrentView); - CFrameWnd* pParentFrm = pCurrentView->GetParentFrame(); - ASSERT(pParentFrm != (CFrameWnd *)NULL); - // simply make the frame window visible - if(isMax) - { - pParentFrm->ActivateFrame(SW_SHOWMAXIMIZED); - } - else - { - pParentFrm->ActivateFrame(SW_SHOW); - } - } - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Minimize3D() -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView ) ) ) - { - ASSERT_VALID(pCurrentView); - CFrameWnd* pParentFrm = pCurrentView->GetParentFrame(); - ASSERT(pParentFrm != (CFrameWnd *)NULL); - // simply make the frame window visible - pParentFrm->ActivateFrame(SW_HIDE); - } - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Fit3DViews(Standard_Real Coef) -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView ) ) ) - { - ASSERT_VALID(pCurrentView); - CGeometryView* aCGeometryView = (CGeometryView*)pCurrentView; - aCGeometryView->FitAll(Coef); - } - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CGeometryDoc::Set3DViewsZoom(const Standard_Real& Coef) -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf( RUNTIME_CLASS( CGeometryView ) ) ) - { - ASSERT_VALID(pCurrentView); - CGeometryView* aCGeometryView = (CGeometryView*)pCurrentView; - aCGeometryView->SetZoom( Coef ); - } - } -} - -//----------------------------------------------------------------------------------------- -// Buttons event handlers -//----------------------------------------------------------------------------------------- -void CGeometryDoc::OnBUTTONTest1() -{ Current = 1; -GeomSources::gpTest1(this); } -void CGeometryDoc::OnBUTTONTest2() -{ Current = 2; -GeomSources::gpTest2(this); } -void CGeometryDoc::OnBUTTONTest3() -{ Current = 3; -GeomSources::gpTest3(this); } -void CGeometryDoc::OnBUTTONTest4() -{ Current = 4; -GeomSources::gpTest4(this); } -void CGeometryDoc::OnBUTTONTest5() -{ Current = 5; -GeomSources::gpTest5(this); } -void CGeometryDoc::OnBUTTONTest6() -{ Current = 6; -GeomSources::gpTest6(this); } -void CGeometryDoc::OnBUTTONTest7() -{ Current = 7; -GeomSources::gpTest7(this); } -void CGeometryDoc::OnBUTTONTest8() -{ Current = 8; -GeomSources::gpTest8(this); } -void CGeometryDoc::OnBUTTONTest9() -{ Current = 9; -GeomSources::gpTest9(this); } -void CGeometryDoc::OnBUTTONTest10() -{ Current = 10; -GeomSources::gpTest10(this); } -void CGeometryDoc::OnBUTTONTest11() -{ Current = 11; -GeomSources::gpTest11(this); } -void CGeometryDoc::OnBUTTONTest12() -{ Current = 12; -GeomSources::gpTest12(this); } -void CGeometryDoc::OnBUTTONTest13() -{ Current = 13; -GeomSources::gpTest13(this); } -void CGeometryDoc::OnBUTTONTest14() -{ Current = 14; -GeomSources::gpTest14(this); } -void CGeometryDoc::OnBUTTONTest15() -{ Current = 15; -GeomSources::gpTest15(this); } -void CGeometryDoc::OnBUTTONTest16() -{ Current = 16; -GeomSources::gpTest16(this); } -void CGeometryDoc::OnBUTTONTest17() -{ Current = 17; -GeomSources::gpTest17(this); } -void CGeometryDoc::OnBUTTONTest18() -{ Current = 18; -GeomSources::gpTest18(this); } -void CGeometryDoc::OnBUTTONTest19() -{ Current = 19; -GeomSources::gpTest19(this); } -void CGeometryDoc::OnBUTTONTest20() -{ Current = 20; -GeomSources::gpTest20(this); } -void CGeometryDoc::OnBUTTONTest21() -{ Current = 21; -GeomSources::gpTest21(this); } -void CGeometryDoc::OnBUTTONTest22() -{ Current = 22; -GeomSources::gpTest22(this); } -void CGeometryDoc::OnBUTTONTest23() -{ Current = 23; -GeomSources::gpTest23(this); } -void CGeometryDoc::OnBUTTONTest24() -{ Current = 24; -GeomSources::gpTest24(this); } -void CGeometryDoc::OnBUTTONTest25() -{ Current = 25; -GeomSources::gpTest25(this); } -void CGeometryDoc::OnBUTTONTest26() -{ Current = 26; -GeomSources::gpTest26(this); } -void CGeometryDoc::OnBUTTONTest27() -{ Current = 27; -GeomSources::gpTest27(this); } -void CGeometryDoc::OnBUTTONTest28() -{ Current = 28; -GeomSources::gpTest28(this); } -void CGeometryDoc::OnBUTTONTest29() -{ Current = 29; -GeomSources::gpTest29(this); } -void CGeometryDoc::OnBUTTONTest30() -{ Current = 30; -GeomSources::gpTest30(this); } -void CGeometryDoc::OnBUTTONTest31() -{ Current = 31; -GeomSources::gpTest31(this); } -void CGeometryDoc::OnBUTTONTest32() -{ Current = 32; -GeomSources::gpTest32(this); } -void CGeometryDoc::OnBUTTONTest33() -{ Current = 33; -GeomSources::gpTest33(this); } -void CGeometryDoc::OnBUTTONTest34() -{ Current = 34; -GeomSources::gpTest34(this); } -void CGeometryDoc::OnBUTTONTest35() -{ Current = 35; -GeomSources::gpTest35(this); } -void CGeometryDoc::OnBUTTONTest36() -{ Current = 36; -GeomSources::gpTest36(this); } - -void CGeometryDoc::OnBUTTONTest37() -{ Current = 37; -GeomSources::gpTest37(this); } -void CGeometryDoc::OnBUTTONTest38() -{ Current = 38; -GeomSources::gpTest38(this); } -void CGeometryDoc::OnBUTTONTest39() -{ Current = 39; -GeomSources::gpTest39(this); } -void CGeometryDoc::OnBUTTONTest40() -{ Current = 40; -GeomSources::gpTest40(this); } -void CGeometryDoc::OnBUTTONTest41() -{ Current = 41; -GeomSources::gpTest41(this); } -void CGeometryDoc::OnBUTTONTest42() -{ Current = 42; -GeomSources::gpTest42(this); } -void CGeometryDoc::OnBUTTONTest43() -{ Current = 43; -GeomSources::gpTest43(this); } -void CGeometryDoc::OnBUTTONTest44() -{ Current = 44; -GeomSources::gpTest44(this); } -void CGeometryDoc::OnBUTTONTest45() -{ Current = 45; -GeomSources::gpTest45(this); } -void CGeometryDoc::OnBUTTONTest46() -{ Current = 46; -GeomSources::gpTest46(this); } -void CGeometryDoc::OnBUTTONTest47() -{ Current = 47; -GeomSources::gpTest47(this); } -void CGeometryDoc::OnBUTTONTest48() -{ Current = 48; -GeomSources::gpTest48(this); } -void CGeometryDoc::OnBUTTONTest49() -{ Current = 49; -GeomSources::gpTest49(this); } -void CGeometryDoc::OnBUTTONTest50() -{ Current = 50; -GeomSources::gpTest50(this); } - -void CGeometryDoc::OnUpdateBUTTONTest1(CCmdUI* pCmdUI) -{ - if (Current == 1) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest2(CCmdUI* pCmdUI) -{ - if (Current == 2) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest3(CCmdUI* pCmdUI) -{ - if (Current == 3) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest4(CCmdUI* pCmdUI) -{ - if (Current == 4) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest5(CCmdUI* pCmdUI) -{ - if (Current == 5) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest6(CCmdUI* pCmdUI) -{ - if (Current == 6) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest7(CCmdUI* pCmdUI) -{ - if (Current == 7) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest8(CCmdUI* pCmdUI) -{ - if (Current == 8) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest9(CCmdUI* pCmdUI) -{ - if (Current == 9) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest10(CCmdUI* pCmdUI) -{ - if (Current == 10) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest11(CCmdUI* pCmdUI) -{ - if (Current == 11) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest12(CCmdUI* pCmdUI) -{ - if (Current == 12) - pCmdUI->SetCheck(true); - else pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest13(CCmdUI* pCmdUI) -{ - if (Current == 13) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest14(CCmdUI* pCmdUI) -{ - if (Current == 14) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest15(CCmdUI* pCmdUI) -{ - if(Current == 15) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest16(CCmdUI* pCmdUI) -{ - if (Current == 16) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest17(CCmdUI* pCmdUI) -{ - if (Current == 17) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest18(CCmdUI* pCmdUI) -{ - if (Current == 18) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest19(CCmdUI* pCmdUI) -{ - if (Current == 19) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest20(CCmdUI* pCmdUI) -{ - if (Current == 20) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest21(CCmdUI* pCmdUI) -{ - if (Current == 21) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest22(CCmdUI* pCmdUI) -{ - if (Current == 22) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest23(CCmdUI* pCmdUI) -{ - if (Current == 23) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest24(CCmdUI* pCmdUI) -{ - if (Current == 24) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest25(CCmdUI* pCmdUI) -{ - if (Current == 25) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest26(CCmdUI* pCmdUI) -{ - if (Current == 26) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest27(CCmdUI* pCmdUI) -{ - if (Current == 27) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest28(CCmdUI* pCmdUI) -{ - if (Current == 28) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest29(CCmdUI* pCmdUI) -{ - if (Current == 29) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest30(CCmdUI* pCmdUI) -{ - if (Current == 30) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest31(CCmdUI* pCmdUI) -{ - if (Current == 31) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest32(CCmdUI* pCmdUI) -{ - if (Current == 32) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest33(CCmdUI* pCmdUI) -{ - if (Current == 33) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest34(CCmdUI* pCmdUI) -{ - if (Current == 34) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest35(CCmdUI* pCmdUI) -{ - if (Current == 35) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest36(CCmdUI* pCmdUI) -{ - if (Current == 36) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest37(CCmdUI* pCmdUI) -{ - if (Current == 37) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest38(CCmdUI* pCmdUI) -{ - if (Current == 38) - pCmdUI->SetCheck(true); -else -pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest39(CCmdUI* pCmdUI) -{ - if (Current == 39) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest40(CCmdUI* pCmdUI) -{ - if (Current == 40) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest41(CCmdUI* pCmdUI) -{ - if (Current == 41) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest42(CCmdUI* pCmdUI) -{ - if (Current == 42) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest43(CCmdUI* pCmdUI) -{ - if (Current == 43) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest44(CCmdUI* pCmdUI) -{ - if (Current == 44) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest45(CCmdUI* pCmdUI) -{ - if (Current == 45) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest46(CCmdUI* pCmdUI) -{ - if (Current == 46) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest47(CCmdUI* pCmdUI) -{ - if (Current == 47) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest48(CCmdUI* pCmdUI) -{ - if (Current == 48) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest49(CCmdUI* pCmdUI) -{ - if (Current == 49) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnUpdateBUTTONTest50(CCmdUI* pCmdUI) -{ - if (Current == 50) - pCmdUI->SetCheck(true); - else - pCmdUI->SetCheck(false); -} - -void CGeometryDoc::OnCloseDocument() -{ - // TODO: Add your specialized code here and/or call the base class - CDocument::OnCloseDocument(); -} - -void CGeometryDoc::OnCreateSol() -{ - // TODO: Add your command handler code here - // Creation d'un sol - CFileDialog dlg (TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"Points Files (*.dat)|*.dat; |All Files (*.*)|*.*||", NULL); - - CString anOCCTDataPathValue; - anOCCTDataPathValue.GetEnvironmentVariable(L"CSF_OCCTDataPath"); - CString initdir = (anOCCTDataPathValue + L"\\occ\\SurfaceFromPoints"); - - dlg.m_ofn.lpstrInitialDir = initdir; - - if (dlg.DoModal() == IDOK) - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - CString filename = dlg.GetPathName(); - - std::filebuf fic; - std::istream in(&fic); - if (!fic.open (filename, std::ios::in)) - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Unable to open file", L"CasCade Error", MB_ICONERROR); - - TColgp_SequenceOfXYZ seqOfXYZ; - gp_XYZ pntXYZ; - Standard_Integer nbPnt=0; - Standard_Real x,y,z; - BRep_Builder B; - TopoDS_Compound C; - B.MakeCompound(C); - while (!in.fail()|| !in.eof()) - { - if (in >> x && in >> y && in >> z){ - pntXYZ.SetX(x); - pntXYZ.SetY(y); - pntXYZ.SetZ(z); - nbPnt++; - seqOfXYZ.Append(pntXYZ); - BRepBuilderAPI_MakeVertex V(gp_Pnt(x, y, z)); - B.Add(C,V.Vertex()); - } - } - fic.close(); - Handle(AIS_Shape) anAISCompound = new AIS_Shape(C); - myAISContext->Display(anAISCompound, Standard_False); - Fit(); - Sleep(1000); - GeoAlgo_Sol sol; - sol.Build(seqOfXYZ); - - if (sol.IsDone() == Standard_True) - { - Handle(Geom_BSplineSurface) GeomSol = sol.Surface(); - TopoDS_Face aface = BRepBuilderAPI_MakeFace(GeomSol, Precision::Confusion()); - if (!BRepAlgo::IsValid(aface)) - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate surface is not valid!", L"CasCade Error", MB_ICONERROR); - Handle(AIS_Shape) anAISShape=new AIS_Shape(aface); - myAISContext->Display(anAISShape, Standard_False); - Fit(); - } - else - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Computation has failed", L"CasCade Error", MB_ICONERROR); - } -} - -/********************************************************************************************* -********************** S I M P L I F Y ***************************************************** -*********************************************************************************************/ - -//================================================================ -// Function : fixParam -// Purpose : assigns a finite value to theParam if it's infinite -// (equal to +- Precision::Infinite()) -//================================================================ -static Standard_Boolean fixParam(Standard_Real& theParam) -{ - Standard_Boolean aResult = Standard_False; - if (Precision::IsNegativeInfinite(theParam)) - { - theParam = -MAX_PARAM; - aResult = Standard_True; - } - if (Precision::IsPositiveInfinite(theParam)) - { - theParam = MAX_PARAM; - aResult = Standard_True; - } - return aResult; -} - - -void CGeometryDoc::OnSimplify() -{ - CString anOCCTDataPathValue; - anOCCTDataPathValue.GetEnvironmentVariable(L"CSF_OCCTDataPath"); - CString initfile = (anOCCTDataPathValue + L"\\occ\\shell1.brep"); - - std::filebuf aFileBuf; - std::istream aStream (&aFileBuf); - if (!aFileBuf.open (initfile, std::ios::in)) - { - initfile += L" was not found. The sample can not be shown."; - myCResultDialog.SetText (initfile); - return; - } - - TopoDS_Shape aShape; - BRep_Builder aBld; - BRepTools::Read (aShape, aStream, aBld); - if (aShape.IsNull()) - { - initfile += L" is invalid file. The sample can not be shown."; - myCResultDialog.SetText(initfile); - return; - } - myAISContext->SetDisplayMode(AIS_Shaded, Standard_True); - simplify(aShape); -} - -void CGeometryDoc::simplify(const TopoDS_Shape& aShape) -{ - myCResultDialog.SetTitle("Simplify Face"); - myCResultDialog.SetText(" TopoDS_Shape aShape;\n" - "\n" - " // initialize aShape\n" - " //aShape = ...\n" - "\n" - " // define parameter triangulation\n" - " Standard_Real aDeflection = 0.1;\n" - " \n" - " // removes all the triangulations of the faces ,\n" - " //and all the polygons on the triangulations of the edges\n" - " BRepTools::Clean(aShape);\n" - " // adds a triangulation of the shape aShape with the deflection aDeflection\n" - " BRepMesh::Mesh(aShape,aDeflection);\n" - "\n" - " Standard_Integer aIndex = 1, nbNodes = 0;\n" - " \n" - " // define two sequence of points\n" - " TColgp_SequenceOfPnt aPoints, aPoints1;\n" - " \n" - " // triangulation\n" - " for(TopExp_Explorer aExpFace(aShape,TopAbs_FACE); aExpFace.More(); aExpFace.Next())\n" - " { \n" - " TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());\n" - " TopLoc_Location aLocation;\n" - "\n" - " // takes the triangulation of the face aFace\n" - " Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);\n" - "\n" - " if(!aTr.IsNull())\n" - " { \n" - " nbNodes = aTr->NbNodes();\n" - "\n" - " for( Standard_Integer i = 1; i <= nbNodes; i++)\n" - " {\n" - " // create seguence of node points in absolute coordinate system\n" - " gp_Pnt aPnt = aTr->Node (i).Transformed (aLocation);\n" - " aPoints.Append(aPnt);\n" - " \n" - " }\n" - " }\n" - " }\n" - " \n" - " // remove double points\n" - " nbNodes = aPoints.Length();\n" - " for( Standard_Integer i = 1; i <= nbNodes; i++)\n" - " {\n" - " gp_Pnt aPi = aPoints(i);\n" - " for( Standard_Integer j = i + 1; j < nbNodes; j++)\n" - " {\n" - " gp_Pnt aPj = aPoints(j);\n" - " if(!aPi.IsEqual(aPj,0.9))\n" - " aIndex++;\n" - " }\n" - " if(aIndex == j - 1)\n" - " aPoints1.Append(aPi);\n" - "\n" - " aIndex = i + 1;\n" - " }\n" - "\n" - " // find max point\n" - " aIndex = 0;\n" - " gp_Pnt aPntMax = aPoints1(1);\n" - " nbNodes = aPoints1.Length();\n" - " for(i = 2; i <= nbNodes; i++)\n" - " {\n" - " if(aPoints1(i).X() > aPntMax.X())\n" - " {\n" - " aIndex = i;\n" - " aPntMax = aPoints1(aIndex); \n" - " } \n" - " }\n" - "\n" - " // clear seguence\n" - " aPoints.Clear();\n" - "\n" - " Standard_Integer nbLeftNodes = nbNodes;\n" - "\n" - " // ascending sort - fill aPoints with ascending \n" - " // by X coordinate points from aPoints1\n" - " for(i = 1; i < nbNodes; i++)\n" - " {\n" - " Standard_Real aMin = aPntMax.X();\n" - " aIndex = 1;\n" - " for( Standard_Integer j = 1; j <= nbLeftNodes; j++)\n" - " {\n" - " if(aPoints1(j).X() < aMin)\n" - " {\n" - " aMin = aPoints1(j).X();\n" - " aIndex = j;\n" - " } \n" - " }\n" - " aPoints.Append(aPoints1(aIndex));\n" - " aPoints1.Remove(aIndex);\n" - " nbLeftNodes = aPoints1.Length();\n" - " }\n" - " aPoints.Append(aPntMax);\n" - "\n" - " // define parameters GeomPlate_BuildPlateSurface\n" - " Standard_Integer Degree = 3;\n" - " Standard_Integer NbPtsOnCur = 10;\n" - " Standard_Integer NbIter = 3;\n" - " Standard_Integer Order = 0;\n" - " Standard_Integer MaxSeg = 9;\n" - " Standard_Integer MaxDegree = 5;\n" - " Standard_Real dmax, anApproxTol = 0.001;\n" - " Standard_Real aConstrTol = Precision::Confusion();\n" - " \n" - " // define object BuildPlateSurface\n" - " GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);\n" - " \n" - " // add point constraints to GeomPlate_BuildPlateSurface object\n" - " nbNodes = aPoints.Length();\n" - " for (i = 1; i <= nbNodes; i++)\n" - " BPSurf.Add(new GeomPlate_PointConstraint(aPoints(i), Order, aConstrTol));\n" - "\n" - " BPSurf.Perform();\n" - "\n" - " // make PlateSurface\n" - " Handle(GeomPlate_Surface) PSurf;\n" - " Handle(Geom_Surface) aSurf;\n" - " \n" - " if (BPSurf.IsDone())\n" - " {\n" - " PSurf = BPSurf.Surface();\n" - "\n" - " // define parameter approximation\n" - " dmax = Max(0.01,10*BPSurf.G0Error());\n" - "\n" - " // make approximation\n" - " GeomPlate_MakeApprox Mapp(PSurf,anApproxTol, MaxSeg,MaxDegree,dmax);\n" - " aSurf = Mapp.Surface();\n" - " }\n" - " else \n" - " return;\n" - "\n" - " ShapeAnalysis_FreeBounds aFreeBounds(aShape, Standard_False, Standard_True);\n" - " TopoDS_Compound aClosedWires = aFreeBounds.GetClosedWires();\n" - " TopTools_IndexedMapOfShape aWires;\n" - " TopExp::MapShapes(aClosedWires, TopAbs_WIRE, aWires);\n" - " TopoDS_Wire aWire;\n" - " Standard_Integer nbWires = aWires.Extent();\n" - " if (nbWires) \n" - " aWire = TopoDS::Wire(aWires(1));\n" - " else \n" - " return;\n" - "\n" - " BRep_Builder B;\n" - " TopoDS_Face aFace;\n" - " B.MakeFace(aFace, aSurf, Precision::Confusion());\n" - " B.Add(aFace, aWire);\n" - " Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);\n" - " sfs->Perform();\n" - " TopoDS_Shape aFixedFace = sfs->Shape();\n" - " if (aFixedFace.IsNull()) \n" - " return;\n"); - - // define parameter triangulation - Standard_Real aDeflection = 0.1; - - // removes all the triangulations of the faces , - //and all the polygons on the triangulations of the edges - BRepTools::Clean(aShape); - // adds a triangulation of the shape aShape with the deflection aDeflection - BRepMesh_IncrementalMesh(aShape,aDeflection); - - Standard_Integer aIndex = 1, nbNodes = 0; - - // define two sequence of points - TColgp_SequenceOfPnt aPoints, aPoints1; - - // triangulation - for(TopExp_Explorer aExpFace(aShape,TopAbs_FACE); aExpFace.More(); aExpFace.Next()) - { - TopoDS_Face aFace = TopoDS::Face(aExpFace.Current()); - TopLoc_Location aLocation; - - // takes the triangulation of the face aFace - Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation); - - if(!aTr.IsNull()) - { - // takes the array of nodes for this triangulation - nbNodes = aTr->NbNodes(); - - for( Standard_Integer i = 1; i <= nbNodes; i++) - { - // create seguence of node points in absolute coordinate system - gp_Pnt aPnt = aTr->Node (i).Transformed (aLocation); - aPoints.Append(aPnt); - - } - } - } - - // remove double points - nbNodes = aPoints.Length(); - Standard_Integer i; - for( i = 1; i <= nbNodes; i++) - { - gp_Pnt aPi = aPoints(i); - Standard_Integer j; - for( j = i + 1; j < nbNodes; j++) - { - gp_Pnt aPj = aPoints(j); - if(!aPi.IsEqual(aPj,0.9)) - aIndex++; - } - if(aIndex == j - 1) - aPoints1.Append(aPi); - - aIndex = i + 1; - } - - // find max point - aIndex = 0; - gp_Pnt aPntMax = aPoints1(1); - nbNodes = aPoints1.Length(); - for(i = 2; i <= nbNodes; i++) - { - if(aPoints1(i).X() > aPntMax.X()) - { - aIndex = i; - aPntMax = aPoints1(aIndex); - } - } - - // clear seguence - aPoints.Clear(); - - Standard_Integer nbLeftNodes = nbNodes; - - // ascending sort - fill aPoints with ascending - // by X coordinate points from aPoints1 - for(i = 1; i < nbNodes; i++) - { - Standard_Real aMin = aPntMax.X(); - aIndex = 1; - for( Standard_Integer j = 1; j <= nbLeftNodes; j++) - { - if(aPoints1(j).X() < aMin) - { - aMin = aPoints1(j).X(); - aIndex = j; - } - } - aPoints.Append(aPoints1(aIndex)); - aPoints1.Remove(aIndex); - nbLeftNodes = aPoints1.Length(); - } - aPoints.Append(aPntMax); - - // define parameters GeomPlate_BuildPlateSurface - Standard_Integer Degree = 3; - Standard_Integer NbPtsOnCur = 10; - Standard_Integer NbIter = 3; - Standard_Integer Order = 0; - Standard_Integer MaxSeg = 9; - Standard_Integer MaxDegree = 5; - Standard_Real dmax, anApproxTol = 0.001; - Standard_Real aConstrTol = Precision::Confusion(); - - // define object BuildPlateSurface - GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter); - - // add point constraints to GeomPlate_BuildPlateSurface object - nbNodes = aPoints.Length(); - for (i = 1; i <= nbNodes; i++) - BPSurf.Add(new GeomPlate_PointConstraint(aPoints(i), Order, aConstrTol)); - - BPSurf.Perform(); - - // make PlateSurface - Handle(GeomPlate_Surface) PSurf; - Handle(Geom_Surface) aSurf; - - if (BPSurf.IsDone()) - { - PSurf = BPSurf.Surface(); - - // define parameter approximation - dmax = Max(0.01,10*BPSurf.G0Error()); - - // make approximation - GeomPlate_MakeApprox Mapp(PSurf,anApproxTol, MaxSeg,MaxDegree,dmax); - aSurf = Mapp.Surface(); - } - else - return; - - ShapeAnalysis_FreeBounds aFreeBounds(aShape, Standard_False, Standard_True); - TopoDS_Compound aClosedWires = aFreeBounds.GetClosedWires(); - TopTools_IndexedMapOfShape aWires; - TopExp::MapShapes(aClosedWires, TopAbs_WIRE, aWires); - TopoDS_Wire aWire; - Standard_Integer nbWires = aWires.Extent(); - if (nbWires) - aWire = TopoDS::Wire(aWires(1)); - else - return; - - BRep_Builder B; - TopoDS_Face aFace; - B.MakeFace(aFace, aSurf, Precision::Confusion()); - B.Add(aFace, aWire); - Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace); - sfs->Perform(); - TopoDS_Shape aFixedFace = sfs->Shape(); - if (aFixedFace.IsNull()) - return; - - // output surface, make it half transparent - Handle(AIS_InteractiveObject) aSurfIO = drawSurface( - aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False); - aSurfIO->SetTransparency(0.5); - myAISContext->Display(aSurfIO,Standard_False); - Fit(); - - if(WAIT_A_LITTLE) return; - - // output points - for(i = 1; i <= nbNodes; i++) - drawPoint(aPoints(i)); - - if(WAIT_A_LITTLE) return; - - // output resulting face - drawShape(aFixedFace); -} - -Handle(AIS_InteractiveObject) CGeometryDoc::drawSurface - (const Handle(Geom_Surface)& theSurface, - const Quantity_Color& theColor, - const Standard_Boolean toDisplay) -{ - Standard_Real u1, u2, v1, v2; - theSurface->Bounds(u1,u2,v1,v2); - fixParam(u1); - fixParam(u2); - fixParam(v1); - fixParam(v2); - - Handle(AIS_Shape) aGraphicSurface = - new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion())); - - myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NameOfMaterial_Plastified, toDisplay); - myAISContext->SetColor(aGraphicSurface, theColor, toDisplay); - if (toDisplay) - { - if (FitMode) - { - myAISContext->Display (aGraphicSurface, Standard_False); - Fit(); - } - else - myAISContext->Display (aGraphicSurface, Standard_True); - } - - return aGraphicSurface; -} - -Standard_Boolean CGeometryDoc::WaitForInput (unsigned long aMilliSeconds) -{ - //::WaitForSingleObject(::CreateEvent (NULL, FALSE, FALSE, NULL), aMilliSeconds); - if (::MsgWaitForMultipleObjects(0, NULL, FALSE, aMilliSeconds, - QS_KEY | QS_MOUSEBUTTON) != WAIT_TIMEOUT) - { - MSG msg; - if (::PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) - { - if (msg.message == WM_KEYUP) - { - ::PeekMessage (&msg, NULL, 0, 0, PM_REMOVE); - return WaitForInput (aMilliSeconds); - } - else - return Standard_True; - } - } - return Standard_False; -} - -Handle(AIS_Point) CGeometryDoc::drawPoint - (const gp_Pnt& aPnt, - const Quantity_Color& theColor, - const Standard_Boolean toDisplay) -{ - Handle(AIS_Point) aGraphicPoint = new AIS_Point (new Geom_CartesianPoint(aPnt)); - - myAISContext->SetColor (aGraphicPoint, theColor, toDisplay); - if (toDisplay) - { - myAISContext->Display (aGraphicPoint, Standard_True); - //COCCDemoDoc::Fit(); - } - - return aGraphicPoint; -} - -Handle(AIS_Shape) CGeometryDoc::drawShape - (const TopoDS_Shape& theShape, - const Graphic3d_NameOfMaterial theMaterial, - const Standard_Boolean toDisplay) -{ - Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape); - - myAISContext->SetMaterial(aGraphicShape, theMaterial, toDisplay); - if (toDisplay) - { - if (FitMode) - { - myAISContext->Display (aGraphicShape, Standard_False); - Fit(); - } - else - myAISContext->Display (aGraphicShape, Standard_True); - } - - return aGraphicShape; -} diff --git a/samples/mfc/standard/01_Geometry/src/GeometryDoc.h b/samples/mfc/standard/01_Geometry/src/GeometryDoc.h deleted file mode 100755 index 1c3ff8cc9f..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryDoc.h +++ /dev/null @@ -1,243 +0,0 @@ -// GeometryDoc.h : interface of the CGeometryDoc class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) -#define AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "OCC_3dBaseDoc.h" -#include "ResultDialog.h" - -#include - -class CGeometryDoc : public OCC_3dBaseDoc -{ -public: - void Put2DOnTop(bool isMax = true); - void Put3DOnTop(bool isMax = true); - void Fit2DViews(); - void Set3DViewsZoom(const Standard_Real& Coef ); - void Fit3DViews(Standard_Real Coef); - void simplify(const TopoDS_Shape& aShape); - - - //-------------------- 2D -------------------// - - void DragEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState, - const Handle(V3d_View)& aView ); - void InputEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - void MoveEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - void ShiftMoveEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - void ShiftDragEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState, - const Handle(V3d_View)& aView ); - void ShiftInputEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - void Popup2D (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - - //-------------------- 3D -------------------// - - virtual void Popup (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView); - - virtual void InputEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView); - - Handle(AIS_InteractiveObject) drawSurface - (const Handle(Geom_Surface)& theSurface, - const Quantity_Color& theColor, - const Standard_Boolean toDisplay); - - Standard_Boolean WaitForInput (unsigned long aMilliSeconds); - // Waits for a user input or a period of time has been elapsed - - Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt, - const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN), - const Standard_Boolean toDisplay = Standard_True); - // creates a presentation of the given point - // and displays it in the viewer if toDisplay = Standard_True - - Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape, - const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NameOfMaterial_Brass, - const Standard_Boolean toDisplay = Standard_True); - // creates a presentation of the given shape with the given material - // (color is default for a given material) - // and displays it in the viewer if toDisplay = Standard_True - -protected: // create from serialization only - CGeometryDoc(); - DECLARE_DYNCREATE(CGeometryDoc) - - // Attributes -public: - - // Operations -public: - - // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CGeometryDoc) -public: - virtual BOOL OnNewDocument(); - virtual void Serialize(CArchive& ar); - virtual void OnCloseDocument(); - //}}AFX_VIRTUAL - - // Implementation -public: - virtual ~CGeometryDoc(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: - - // Generated message map functions -protected: - //{{AFX_MSG(CGeometryDoc) - afx_msg void OnWindowNew2d(); - afx_msg void OnBUTTONTest1(); - afx_msg void OnBUTTONTest2(); - afx_msg void OnBUTTONTest3(); - afx_msg void OnBUTTONTest4(); - afx_msg void OnBUTTONTest5(); - afx_msg void OnBUTTONTest6(); - afx_msg void OnBUTTONTest7(); - afx_msg void OnBUTTONTest8(); - afx_msg void OnBUTTONTest9(); - afx_msg void OnBUTTONTest10(); - afx_msg void OnBUTTONTest11(); - afx_msg void OnBUTTONTest12(); - afx_msg void OnBUTTONTest13(); - afx_msg void OnBUTTONTest14(); - afx_msg void OnBUTTONTest15(); - afx_msg void OnBUTTONTest16(); - afx_msg void OnBUTTONTest17(); - afx_msg void OnBUTTONTest18(); - afx_msg void OnBUTTONTest19(); - afx_msg void OnBUTTONTest20(); - afx_msg void OnBUTTONTest21(); - afx_msg void OnBUTTONTest22(); - afx_msg void OnBUTTONTest23(); - afx_msg void OnBUTTONTest24(); - afx_msg void OnBUTTONTest25(); - afx_msg void OnBUTTONTest26(); - afx_msg void OnBUTTONTest27(); - afx_msg void OnBUTTONTest28(); - afx_msg void OnBUTTONTest29(); - afx_msg void OnBUTTONTest30(); - afx_msg void OnBUTTONTest31(); - afx_msg void OnBUTTONTest32(); - afx_msg void OnBUTTONTest33(); - afx_msg void OnBUTTONTest34(); - afx_msg void OnBUTTONTest35(); - afx_msg void OnBUTTONTest36(); - afx_msg void OnBUTTONTest37(); - afx_msg void OnBUTTONTest38(); - afx_msg void OnBUTTONTest39(); - afx_msg void OnBUTTONTest40(); - afx_msg void OnBUTTONTest41(); - afx_msg void OnBUTTONTest42(); - afx_msg void OnBUTTONTest43(); - afx_msg void OnBUTTONTest44(); - afx_msg void OnBUTTONTest45(); - afx_msg void OnBUTTONTest46(); - afx_msg void OnBUTTONTest47(); - afx_msg void OnBUTTONTest48(); - afx_msg void OnBUTTONTest49(); - afx_msg void OnBUTTONTest50(); - afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI); - afx_msg void OnCreateSol(); - afx_msg void OnSimplify(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -public: - int Current; - void Minimize3D(); - void Minimize2D(); - Handle(V3d_Viewer) GetViewer2D() { return myViewer2D; }; - Handle(AIS_InteractiveContext)& GetISessionContext() { return myAISContext2D; }; - BOOL FitMode; - -public: - CResultDialog myCResultDialog; - -private: - Handle(V3d_Viewer) myViewer2D; - Handle(AIS_InteractiveContext) myAISContext2D; - - -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/GeometryView.cpp b/samples/mfc/standard/01_Geometry/src/GeometryView.cpp deleted file mode 100755 index bbb4a29612..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryView.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// GeometryView.cpp : implementation of the CGeometryView class -// - -#include "stdafx.h" -#include "GeometryApp.h" - -#include -#include "GeometryDoc.h" -#include "GeometryView.h" - -#define ValZWMin 1 - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CGeometryView - -IMPLEMENT_DYNCREATE(CGeometryView, OCC_3dView) - -BEGIN_MESSAGE_MAP(CGeometryView, OCC_3dView) - //{{AFX_MSG_MAP(CGeometryView) - ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CGeometryView construction/destruction - -CGeometryView::CGeometryView() -{ -} - -CGeometryView::~CGeometryView() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// CGeometryView diagnostics - -#ifdef _DEBUG -void CGeometryView::AssertValid() const -{ - CView::AssertValid(); -} - -void CGeometryView::Dump(CDumpContext& dc) const -{ - CView::Dump(dc); -} - -CGeometryDoc* CGeometryView::GetDocument() // non-debug version is inline -{ - ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc))); - return (CGeometryDoc*)m_pDocument; -} -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CGeometryView message handlers - -void CGeometryView::OnFileExportImage() -{ - GetDocument()->ExportView (myView); -} diff --git a/samples/mfc/standard/01_Geometry/src/GeometryView.h b/samples/mfc/standard/01_Geometry/src/GeometryView.h deleted file mode 100755 index 15b94687e5..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryView.h +++ /dev/null @@ -1,68 +0,0 @@ -// GeometryView.h : interface of the CGeometryView class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) -#define AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include - -class CGeometryView : public OCC_3dView -{ -protected: // create from serialization only -public: - CGeometryView(); - DECLARE_DYNCREATE(CGeometryView) - - // Attributes -public: - CGeometryDoc* GetDocument(); - - // Operations -public: - - // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CGeometryView) -public: - //}}AFX_VIRTUAL - - // Implementation -public: - virtual ~CGeometryView(); - void FitAll(Standard_Real Coef) - { - if (Coef != -1) - myView->FitAll(Coef); - else myView->FitAll(); - myView->ZFitAll(); - }; - -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -// Generated message map functions -protected: - //{{AFX_MSG(CGeometryView) - afx_msg void OnFileExportImage(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#ifndef _DEBUG // debug version in GeometryView.cpp -inline CGeometryDoc* CGeometryView::GetDocument() - { return (CGeometryDoc*)m_pDocument; } -#endif - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp b/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp deleted file mode 100755 index debfcc1353..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// NSGViewBibliotheque.cpp : implementation of the CGeometryView2D class -// - -#include "stdafx.h" -#include "GeometryApp.h" -#include "GeometryDoc.h" -#include "GeometryView2D.h" -#include ".\Resource2d\RectangularGrid.h" -#include ".\Resource2d\CircularGrid.h" - -///////////////////////////////////////////////////////////////////////////// -// CNSGView - -IMPLEMENT_DYNCREATE(CGeometryView2D, OCC_2dView) -BEGIN_MESSAGE_MAP(CGeometryView2D, OCC_2dView) - //{{AFX_MSG_MAP(CGeometryView2D) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CNSGView construction/destruction - -CGeometryView2D::CGeometryView2D() -{ -} - -CGeometryView2D::~CGeometryView2D() -{ -} - -const Handle(AIS_InteractiveContext)& CGeometryView2D::GetAISContext() const -{ - return ((CGeometryDoc*)m_pDocument)->GetISessionContext(); -} - -///////////////////////////////////////////////////////////////////////////// -// CGeometryView2D diagnostics - -#ifdef _DEBUG -void CGeometryView2D::AssertValid() const -{ - CView::AssertValid(); -} - -void CGeometryView2D::Dump(CDumpContext& dc) const -{ - CView::Dump(dc); -} - -CGeometryDoc* CGeometryView2D::GetDocument() // non-debug version is inline -{ - ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc))); - return (CGeometryDoc*)m_pDocument; -} -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CNSGView message handlers - -//================================================================= -void CGeometryView2D::OnInitialUpdate() -{ - OCC_2dView::OnInitialUpdate(); - myView->SetBackgroundColor (Quantity_NOC_BLACK); -} diff --git a/samples/mfc/standard/01_Geometry/src/GeometryView2D.h b/samples/mfc/standard/01_Geometry/src/GeometryView2D.h deleted file mode 100755 index 42c8c26110..0000000000 --- a/samples/mfc/standard/01_Geometry/src/GeometryView2D.h +++ /dev/null @@ -1,57 +0,0 @@ -// NSGViewBib.h : interface of the CNSGView class -// - -#if !defined(AFX_NSGVIEWBIB_H__7BCE3513_40A8_11D1_8BEC_00C04FB657CF__INCLUDED_) -#define AFX_NSGVIEWBIB_H__7BCE3513_40A8_11D1_8BEC_00C04FB657CF__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - - -#include - -///////////////////////////////////////////////////////////////////////////// - -#define ValZWMin 1 - -class CGeometryView2D : public OCC_2dView -{ -protected: // create from serialization only - CGeometryView2D(); - DECLARE_DYNCREATE(CGeometryView2D) - - // Attributes -public: - CGeometryDoc* GetDocument(); -public: - // Overrides - // ClassWizard generated virtual function overrides -public: - virtual void OnInitialUpdate(); // called first time after construct - - // Implementation -public: - virtual ~CGeometryView2D(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - - //! Return interactive context for 2d presentations. - virtual const Handle(AIS_InteractiveContext)& GetAISContext() const Standard_OVERRIDE; - - // Generated message map functions -protected: - //{{AFX_MSG(CGeometryView2D) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#ifndef _DEBUG // debug version in NSGViewBibliotheque.cpp -inline CGeometryDoc* CGeometryView2D::GetDocument() - { return (CGeometryDoc*)m_pDocument; } -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_Curve.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_Curve.cpp deleted file mode 100755 index f93c03f9ea..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_Curve.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "stdafx.h" - -#include -#include "..\\GeometryApp.h" -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject) - -ISession2D_Curve::ISession2D_Curve(const Handle(Geom2d_Curve) aGeom2dCurve, - const Aspect_TypeOfLine aTypeOfLine, - const Aspect_WidthOfLine aWidthOfLine, - const Standard_Integer aColorIndex) -{ - myGeom2dCurve = aGeom2dCurve; - myTypeOfLine = aTypeOfLine ; - myWidthOfLine = aWidthOfLine; - myColorIndex = aColorIndex ; - myDisplayPole = Standard_True; - myDisplayCurbure = Standard_False; - myDiscretisation = 20; - myradiusmax = 10; - myradiusratio = 1; -} - -void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer ) -{ - Handle(Graphic3d_Group) aPrsGroup = thePrs->CurrentGroup(); - aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect()); - aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect()); - - Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve); - GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor,1.e-2); - if(anEdgeDistrib.IsDone()) - { - Handle(Graphic3d_ArrayOfPolylines) aCurve = - new Graphic3d_ArrayOfPolylines(anEdgeDistrib.NbPoints()); - for(Standard_Integer i=1;i<=anEdgeDistrib.NbPoints();++i) - aCurve->AddVertex(anEdgeDistrib.Value(i)); - - aPrsGroup->AddPrimitiveArray (aCurve); - } - - if (myDisplayPole) - { - if (anAdaptor.GetType() == GeomAbs_BezierCurve ) - { - Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier(); - Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles()); - for(int i=1;i<=aBezier->NbPoles();i++) - { - gp_Pnt2d CurrentPoint = aBezier->Pole(i); - anArrayOfVertex->AddVertex(CurrentPoint.X(),CurrentPoint.Y(),0.); - } - aPrsGroup->AddPrimitiveArray (anArrayOfVertex); - } - - if (anAdaptor.GetType() == GeomAbs_BSplineCurve ) - { - Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline(); - - Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = - new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles()); - - for(int i=1;i<=aBSpline->NbPoles();i++) - { - gp_Pnt2d CurrentPoint = aBSpline->Pole(i); - anArrayOfVertex->AddVertex(CurrentPoint.X(),CurrentPoint.Y(),0.); - } - aPrsGroup->AddPrimitiveArray (anArrayOfVertex); - } - } - - if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line)) - { - Standard_Integer ii; - Standard_Integer intrv, nbintv = anAdaptor.NbIntervals(GeomAbs_CN); - TColStd_Array1OfReal TI(1,nbintv+1); - anAdaptor.Intervals(TI,GeomAbs_CN); - Standard_Real Resolution = 1.0e-9, Curvature; - Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution); - gp_Pnt2d P1, P2; - - for (intrv = 1; intrv <= nbintv; intrv++) - { - Standard_Real t = TI(intrv); - Standard_Real step = (TI(intrv+1) - t) / GetDiscretisation(); - Standard_Real LRad, ratio; - for (ii = 1; ii <= myDiscretisation; ii++) - { - LProp.SetParameter(t); - if (LProp.IsTangentDefined()) - { - Curvature = Abs(LProp.Curvature()); - if ( Curvature > Resolution) - { - myGeom2dCurve->D0(t, P1); - LRad = 1./Curvature; - ratio = ( ( LRad > myradiusmax) ? myradiusmax/LRad : 1 ); - ratio *= myradiusratio; - LProp.CentreOfCurvature(P2); - gp_Vec2d V(P1, P2); - gp_Pnt2d P3 = P1.Translated(ratio*V); - Handle(Graphic3d_ArrayOfPolylines) aSegment = new Graphic3d_ArrayOfPolylines(2); - aSegment->AddVertex(P1.X(),P1.Y(),0.); - aSegment->AddVertex(P3.X(),P3.Y(),0.); - aPrsGroup->AddPrimitiveArray (aSegment); - } - } - t += step; - } - } - } -} diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_Curve.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_Curve.h deleted file mode 100755 index eccf083f87..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_Curve.h +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef _ISession2D_Curve_HeaderFile -#define _ISession2D_Curve_HeaderFile - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -class PrsMgr_PresentationManager2d; -class Graphic2d_GraphicObject; -class SelectMgr_Selection; - -#include "Geom2d_Curve.hxx" - -#include "AIS_InteractiveObject.hxx" -class ISession2D_Curve; -DEFINE_STANDARD_HANDLE(ISession2D_Curve,AIS_InteractiveObject) -class ISession2D_Curve : public AIS_InteractiveObject { - -public: - - // Methods PUBLIC - // - - ISession2D_Curve - (const Handle(Geom2d_Curve) aGeom2dCurve, - const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID, - const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM, - const Standard_Integer aColorIndex = 4); - - inline Standard_Integer NbPossibleSelection() const; - - inline Aspect_TypeOfLine GetTypeOfLine() const; - inline void SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine); - - inline Aspect_WidthOfLine GetWidthOfLine() const; - inline void SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine); - - inline Standard_Integer GetColorIndex() const; - inline void SetColorIndex(const Standard_Integer aNewColorIndex) ; - - inline Standard_Boolean GetDisplayPole() const; - inline void SetDisplayPole(const Standard_Boolean aNewDisplayPole) ; - - inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure() const; - inline void ISession2D_Curve::SetDisplayCurbure - (const Standard_Boolean aNewDisplayCurbure); - - inline Standard_Real GetDiscretisation() const; - inline void SetDiscretisation(const Standard_Real aNewDiscretisation) ; - - DEFINE_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject) - -private: - - // Methods PRIVATE - virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const { return theMode == 0; } - virtual void Compute(const Handle(PrsMgr_PresentationManager)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; - void ComputeSelection(const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {} - - // Fields PRIVATE - // - Handle(Geom2d_Curve) myGeom2dCurve; - Aspect_TypeOfLine myTypeOfLine; - Aspect_WidthOfLine myWidthOfLine; - Standard_Integer myColorIndex; - Standard_Boolean myDisplayPole; - Standard_Boolean myDisplayCurbure; - Standard_Real myDiscretisation; - Standard_Real myradiusmax ; - Standard_Real myradiusratio ; -}; - - - -// other inCurve functions and methods (like "C++: function call" methods) -// - -inline Standard_Integer ISession2D_Curve::NbPossibleSelection() const -{ - return 1; -} - -inline Aspect_TypeOfLine ISession2D_Curve::GetTypeOfLine() const -{ - return myTypeOfLine ; -} - -inline void ISession2D_Curve::SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine) -{ - myTypeOfLine = aNewTypeOfLine; -} - -inline Aspect_WidthOfLine ISession2D_Curve::GetWidthOfLine() const -{ - return myWidthOfLine ; -} - -inline void ISession2D_Curve::SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine) -{ - myWidthOfLine = aNewWidthOfLine; -} - -inline Standard_Integer ISession2D_Curve::GetColorIndex() const -{ - return myColorIndex ; -} - -inline void ISession2D_Curve::SetColorIndex(const Standard_Integer aNewColorIndex) -{ - myColorIndex = aNewColorIndex; -} - -inline Standard_Boolean ISession2D_Curve::GetDisplayPole -() const -{ - return myDisplayPole; -} -inline void ISession2D_Curve::SetDisplayPole -(const Standard_Boolean aNewDisplayPole) -{ - myDisplayPole = aNewDisplayPole; -} - -inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure -() const -{ - return myDisplayCurbure; -} -inline void ISession2D_Curve::SetDisplayCurbure -(const Standard_Boolean aNewDisplayCurbure) -{ - myDisplayCurbure = aNewDisplayCurbure; -} - - -inline Standard_Real ISession2D_Curve::GetDiscretisation -() const -{ - return myDiscretisation; -} -inline void ISession2D_Curve::SetDiscretisation -(const Standard_Real aNewDiscretisation) -{ - myDiscretisation = aNewDiscretisation; -} - - - -#endif - diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.cpp deleted file mode 100755 index b43c27bb0a..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// ISession_Curve.cpp: implementation of the ISession_Curve class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "..\\GeometryApp.h" -#include "ISession_Curve.h" -#include - -IMPLEMENT_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject) - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#endif - -void ISession_Curve::Compute (const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - GeomAdaptor_Curve anAdaptorCurve (myCurve); - switch (theMode) - { - case 1: - { - Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer(); - aPoleDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0)); - StdPrs_PoleCurve::Add (thePrs, anAdaptorCurve, aPoleDrawer); - } - case 0: - { - StdPrs_Curve::Add (thePrs, anAdaptorCurve, myDrawer); - break; - } - } -} diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h deleted file mode 100755 index 9688d79c6c..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h +++ /dev/null @@ -1,27 +0,0 @@ -// ISession_Curve.h: interface for the ISession_Curve class. -// -////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include -#include "AIS_InteractiveObject.hxx" - -class ISession_Curve : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject) -public: - ISession_Curve(const Handle(Geom_Curve)& theCurve) : myCurve (theCurve) {} - virtual ~ISession_Curve() {} - -private: - - Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; - virtual void ComputeSelection (const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {} - -private: - Handle(Geom_Curve) myCurve; -}; - -DEFINE_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject) diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp deleted file mode 100755 index fa7bea1218..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// ISession_Direction.cpp: implementation of the ISession_Direction class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "..\\GeometryApp.h" -#include "ISession_Direction.h" -#include -#include - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#endif - -IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject) - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -ISession_Direction::ISession_Direction() -{ - -} - -ISession_Direction::ISession_Direction (const gp_Pnt& aPnt, - const gp_Dir& aDir, - Standard_Real aLength, - Standard_Real anArrowLength) -: myPnt (aPnt), - myDir (aDir), - myLength (aLength), - myArrowLength (anArrowLength) -{} - -ISession_Direction::ISession_Direction (const gp_Pnt& aPnt, - const gp_Vec& aVec, - Standard_Real anArrowLength) -: myPnt (aPnt), - myDir (aVec), - myArrowLength (anArrowLength) -{ - myLength = aVec.Magnitude(); -} - -ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d, - const gp_Dir2d& aDir2d, - Standard_Real aLength) -: myPnt (gp_Pnt(aPnt2d.X(),aPnt2d.Y(),0.0)), - myDir (gp_Dir(aDir2d.X(),aDir2d.Y(),0.0)), - myLength (aLength) -{ - myArrowLength = 1.0; -} - -ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d, - const gp_Vec2d& aVec2d) -: myPnt (gp_Pnt (aPnt2d.X(), aPnt2d.Y(), 0.0)), - myDir (gp_Dir(aVec2d.X(), aVec2d.Y(), 0.0)) -{ - myLength = aVec2d.Magnitude(); - myArrowLength = 1.0; -} - - -ISession_Direction::~ISession_Direction() -{ - -} - -void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager)& /*aPresentationManager*/, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer /*aMode*/) -{ - // Set style for arrow - Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect(); - anArrowAspect->SetLength (myArrowLength); - - gp_Pnt aLastPoint = myPnt; - aLastPoint.Translate (myLength*gp_Vec(myDir)); - - // Draw Line - Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2); - aPrims->AddVertex (myPnt); - aPrims->AddVertex (aLastPoint); - aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); - aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims); - // Draw arrow - Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), - aLastPoint, - myDir, - anArrowAspect->Angle(), - anArrowAspect->Length()); - - // Draw text - if (myText.Length() != 0) - { - gp_Pnt aTextPosition = aLastPoint; - Prs3d_Text::Draw (aPresentation->CurrentGroup(), - myDrawer->TextAspect(), - myText, - aTextPosition); - } -} - -void ISession_Direction::ComputeSelection (const Handle(SelectMgr_Selection)& /*aSelection*/, - const Standard_Integer /*aMode*/) -{ -} - -void ISession_Direction::SetText (TCollection_ExtendedString & theText) -{ - myText = theText; -} - -void ISession_Direction::SetText (Standard_CString theText) -{ - myText = theText; -} - -void ISession_Direction::SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect) -{ - myDrawer->SetLineAspect (theAspect); -} diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h deleted file mode 100755 index 594e2985d2..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h +++ /dev/null @@ -1,44 +0,0 @@ -// ISession_Direction.h: interface for the ISession_Direction class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_) -#define AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -#include "gp_Dir2d.hxx" -class ISession_Direction; -DEFINE_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject) -class ISession_Direction : public AIS_InteractiveObject -{ -public: - TCollection_ExtendedString myText; - void SetText (TCollection_ExtendedString& aText); - void SetText (Standard_CString aText); - void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect); - ISession_Direction(); - ISession_Direction (const gp_Pnt& aPnt,const gp_Dir& aDir,Standard_Real aLength=1,Standard_Real anArrowLength=1); - ISession_Direction (const gp_Pnt& aPnt,const gp_Vec& aVec,Standard_Real anArrowLength=1); - - ISession_Direction (const gp_Pnt2d& aPnt2d,const gp_Dir2d& aDir2d,Standard_Real aLength=1); - ISession_Direction (const gp_Pnt2d& aPnt2d,const gp_Vec2d& aVec2d); - - virtual ~ISession_Direction(); - DEFINE_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject) - -private: - - void Compute (const Handle(PrsMgr_PresentationManager)& aPresentationManager, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer aMode); - void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ; - - gp_Pnt myPnt; - gp_Dir myDir; - Standard_Real myLength; - Standard_Real myArrowLength; -}; - -#endif // !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp deleted file mode 100755 index 5c119f932e..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// ISession_Point.cpp: implementation of the ISession_Point class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "..\\GeometryApp.h" -#include "ISession_Point.h" -#include - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -//#define new DEBUG_NEW -#endif - -IMPLEMENT_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject) - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// -ISession_Point::ISession_Point(Standard_Real X,Standard_Real Y ,Standard_Real Z) -:myPoint(gp_Pnt(X,Y,Z)) -{ - -} - -ISession_Point::ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation) -:myPoint(gp_Pnt(aPoint.X(),aPoint.Y(),Elevation)) -{ - -} - -ISession_Point::ISession_Point(const gp_Pnt& aPoint) -:myPoint(aPoint) -{ - -} - -ISession_Point::~ISession_Point() -{ - -} - -void ISession_Point::Compute(const Handle(PrsMgr_PresentationManager)& /*aPresentationManager*/, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer /*aMode*/) -{ - Handle(Geom_CartesianPoint) aGeomPoint = new Geom_CartesianPoint(myPoint); - - StdPrs_Point::Add(aPresentation,aGeomPoint,myDrawer); - } - -void ISession_Point::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, - const Standard_Integer /*unMode*/) -{ -} - diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h deleted file mode 100755 index e4124f0d01..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h +++ /dev/null @@ -1,40 +0,0 @@ -// ISession_Point.h: interface for the ISession_Point class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_ISESSION_POINT_H__A9B277C3_A69E_11D1_8DA4_0800369C8A03__INCLUDED_) -#define AFX_ISESSION_POINT_H__A9B277C3_A69E_11D1_8DA4_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include - -class ISession_Point; -DEFINE_STANDARD_HANDLE(ISession_Point,AIS_InteractiveObject) -class ISession_Point : public AIS_InteractiveObject -{ -public: - ISession_Point(); - ISession_Point(Standard_Real X,Standard_Real Y ,Standard_Real Z); - ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation = 0); - ISession_Point(const gp_Pnt& aPoint); - virtual ~ISession_Point(); - DEFINE_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject) - -private : - - void Compute (const Handle(PrsMgr_PresentationManager)& aPresentationManager, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer aMode); - - void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, - const Standard_Integer unMode); - - gp_Pnt myPoint; - -}; - -#endif // !defined(AFX_ISESSION_POINT_H__A9B277C3_A69E_11D1_8DA4_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.cpp deleted file mode 100755 index ecf15e5373..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// ISession_Surface.cpp: implementation of the ISession_Surface class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "..\\GeometryApp.h" -#include "ISession_Surface.h" -#include -#include -#include -#include - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -//#define new DEBUG_NEW -#endif - -IMPLEMENT_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject) - -void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - GeomAdaptor_Surface anAdaptorSurface (mySurface); - Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface); - - Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer(); - aPoleDrawer->SetOwnLineAspects(); - aPoleDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_YELLOW3, Aspect_TOL_SOLID, 1.0)); - switch (theMode) - { - case 2: - { - StdPrs_ShadedSurface::Add (thePrs, anAdaptorSurface, myDrawer); - break; - } - case 1: - { - StdPrs_WFPoleSurface::Add (thePrs, anAdaptorSurface, aPoleDrawer); - } - case 0: - { - StdPrs_WFSurface::Add (thePrs, anAdaptorHSurface, myDrawer); - break; - } - } -} diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h deleted file mode 100755 index bbfc9eb068..0000000000 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h +++ /dev/null @@ -1,29 +0,0 @@ -// ISession_Surface.h: interface for the ISession_Surface class. -// -////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include - -class ISession_Surface : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject) -public: - - ISession_Surface (const Handle(Geom_Surface)& theSurface) : mySurface (theSurface) {} - virtual ~ISession_Surface() {} - -private: - - Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0); - virtual void ComputeSelection (const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {} - -private: - - Handle(Geom_Surface) mySurface; - -}; - -DEFINE_STANDARD_HANDLE(ISession_Surface, AIS_InteractiveObject) diff --git a/samples/mfc/standard/01_Geometry/src/MainFrm.cpp b/samples/mfc/standard/01_Geometry/src/MainFrm.cpp deleted file mode 100755 index fe5757a1bf..0000000000 --- a/samples/mfc/standard/01_Geometry/src/MainFrm.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// MainFrm.cpp : implementation of the CMainFrame class -// - -#include "stdafx.h" -#include "GeometryApp.h" - -#include "MainFrm.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame - -IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd) - -BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd) - //{{AFX_MSG_MAP(CMainFrame) - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -static UINT indicators[] = -{ - ID_SEPARATOR, // status line indicator - ID_INDICATOR_CAPS, - ID_INDICATOR_NUM, - ID_INDICATOR_SCRL, -}; - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame construction/destruction - -CMainFrame::CMainFrame() -{ -} - -CMainFrame::~CMainFrame() -{ -} - -int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || - !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - if (!m_wndToolBar2.Create(this) || - !m_wndToolBar2.LoadToolBar(IDR_MAINFRAME2)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - if (!m_wndStatusBar.Create(this) || - !m_wndStatusBar.SetIndicators(indicators, - sizeof(indicators)/sizeof(UINT))) - { - TRACE0("Failed to create status bar\n"); - return -1; // fail to create - } - - // TODO: Remove this if you don't want tool tips or a resizeable toolbar - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | - CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - - // TODO: Delete these three lines if you don't want the toolbar to - // be dockable - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); - - // TODO: Remove this if you don't want tool tips or a resizeable toolbar - m_wndToolBar2.SetBarStyle(m_wndToolBar2.GetBarStyle() | - CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - - // TODO: Delete these three lines if you don't want the toolbar to - // be dockable - m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar2); - return 0; -} - -BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) -{ - // TODO: Modify the Window class or styles here by modifying - // the CREATESTRUCT cs - return CMDIFrameWnd::PreCreateWindow(cs); -} - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame diagnostics - -#ifdef _DEBUG -void CMainFrame::AssertValid() const -{ - CMDIFrameWnd::AssertValid(); -} - -void CMainFrame::Dump(CDumpContext& dc) const -{ - CMDIFrameWnd::Dump(dc); -} - -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CMainFrame message handlers - diff --git a/samples/mfc/standard/01_Geometry/src/MainFrm.h b/samples/mfc/standard/01_Geometry/src/MainFrm.h deleted file mode 100755 index de34ccb4ba..0000000000 --- a/samples/mfc/standard/01_Geometry/src/MainFrm.h +++ /dev/null @@ -1,54 +0,0 @@ -// MainFrm.h : interface of the CMainFrame class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_MAINFRM_H__4EF39FB6_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) -#define AFX_MAINFRM_H__4EF39FB6_4EBB_11D1_8D67_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -class CMainFrame : public CMDIFrameWnd -{ - DECLARE_DYNAMIC(CMainFrame) -public: - CMainFrame(); - - // Attributes -public: - - // Operations -public: - - // Overrides - // ClassWizard generated virtual function overrides - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - - // Implementation -public: - virtual ~CMainFrame(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: // control bar embedded members - CStatusBar m_wndStatusBar; - CToolBar m_wndToolBar; - CToolBar m_wndToolBar2; - - // Generated message map functions -protected: - //{{AFX_MSG(CMainFrame) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_MAINFRM_H__4EF39FB6_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/01_Geometry/src/StdAfx.cpp b/samples/mfc/standard/01_Geometry/src/StdAfx.cpp deleted file mode 100755 index c1fe47d451..0000000000 --- a/samples/mfc/standard/01_Geometry/src/StdAfx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// SampleGeometry.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - diff --git a/samples/mfc/standard/01_Geometry/src/StdAfx.h b/samples/mfc/standard/01_Geometry/src/StdAfx.h deleted file mode 100755 index 971fdc2cea..0000000000 --- a/samples/mfc/standard/01_Geometry/src/StdAfx.h +++ /dev/null @@ -1,283 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#ifndef NOMINMAX - #define NOMINMAX // Prevent Windows from defining min/max macros -#endif - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#pragma warning( disable : 4244 ) // Issue warning 4244 -#include "Standard_ShortReal.hxx" -#pragma warning( default : 4244 ) // Issue warning 4244 - -#include -/* -#ifndef Version15B -# ifndef Version15D -# ifndef Version20 -# define Version15B -# endif // Version20 -# endif // Version15D -#endif // Version15B - -#pragma message ("=============================") -#ifdef Version15B -# pragma message ("Set the libs for version 1.5B") -#endif // Version15B - -#ifdef Version15D -# pragma message ("Set the libs for version 1.5D") -#endif // Version15D - -#ifdef Version20 -# pragma message ("Set the libs for version 2.0 ") -#endif // Version20 -#pragma message ("=============================") - -#ifdef Version15B -# pragma comment (lib,"TKTop.lib") -# pragma comment (lib,"TShort.lib") -# pragma comment (lib,"TColQuantity.lib") -#endif - -#ifdef Version15D -# pragma comment (lib,"TKTop.lib") -#endif - -#ifdef Version20 -# pragma comment (lib,"TKTop1.lib") -# pragma comment (lib,"TKTop2.lib") -#endif - -#pragma message ("Set the specific libs for the application") -# pragma comment (lib,"TKPrs.lib") -# pragma comment (lib,"TKGeom.lib") -# pragma comment (lib,"TKGlt.lib") -# pragma comment (lib,"TKGraphic.lib") -# pragma comment (lib,"TKPrsMgr.lib") -# pragma comment (lib,"TKViewers.lib") -# pragma comment (lib,"TKSession.lib") -# pragma comment (lib,"Bnd.lib") -# pragma comment (lib,"gp.lib") -# pragma comment (lib,"TColgp.lib") -# pragma comment (lib,"TKernel.lib") -# pragma comment (lib,"TKXSBase.lib") -# pragma comment (lib,"TKXSIGES.lib") -# pragma comment (lib,"TKXS214.lib") -# pragma comment (lib,"UnitsAPI.lib") -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "ISession2D_Curve.h" -#include "ISession_Direction.h" -#include "ISession_Curve.h" -#include "ISession_Surface.h" -#include "ISession_Point.h" - -#include -#include "..\res\resource.h" - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - diff --git a/samples/mfc/standard/02_Modeling/CMakeLists.txt b/samples/mfc/standard/02_Modeling/CMakeLists.txt deleted file mode 100644 index 1b8f78019a..0000000000 --- a/samples/mfc/standard/02_Modeling/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -# Caution! Be careful, when increase minimal cmake version: -# using of newer version may leads (by default) to applying -# of some new policies. It may break compilation. -# For canceling of applying new policies use: -# cmake_policy(PUSH) before `cmake_minimum_required` -# and cmake_policy(POP) after. -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) - -project (Modeling) - -add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE) -set (CMAKE_MFC_FLAG 2) - -set (Modeling_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/02_Modeling/src) -set (Modeling_HEADER_FILES ${Modeling_SRC_DIR}/ISession_Direction.h - ${Modeling_SRC_DIR}/ModelingApp.h - ${Modeling_SRC_DIR}/ModelingDoc.h - ${Modeling_SRC_DIR}/StdAfx.h - ${Modeling_SRC_DIR}/State.h ) -set (Modeling_SOURCE_FILES ${Modeling_SRC_DIR}/ISession_Direction.cpp - ${Modeling_SRC_DIR}/ModelingApp.cpp - ${Modeling_SRC_DIR}/ModelingDoc.cpp - ${Modeling_SRC_DIR}/StdAfx.cpp ) - -set (Modeling_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/02_Modeling/res) -set (Modeling_RESOURCE_HEADER ${Modeling_RESOURCE_DIR}/resource.h) -set (Modeling_RESOURCE_FILES ${Modeling_RESOURCE_DIR}/fram2.bmp - ${Modeling_RESOURCE_DIR}/Toolbar.bmp - ${Modeling_RESOURCE_DIR}/Modeling.rc) - -# groups in the VS solution -source_group ("Source Files" FILES ${Modeling_SOURCE_FILES} - ${COMMON_WINMAIN_FILE}) - -source_group ("Header Files" FILES ${Modeling_HEADER_FILES} - ${Modeling_RESOURCE_HEADER}) - -source_group ("Resource Files" FILES ${Modeling_RESOURCE_FILES}) - -add_executable ( Modeling WIN32 ${Modeling_SOURCE_FILES} - ${Modeling_HEADER_FILES} - ${COMMON_WINMAIN_FILE} - ${Modeling_RESOURCE_HEADER} - ${Modeling_RESOURCE_FILES}) - -set_property (TARGET Modeling PROPERTY FOLDER "Samples/mfc") - -if (SINGLE_GENERATOR) - install (TARGETS Modeling DESTINATION "${INSTALL_DIR_BIN}") -else() - install (TARGETS Modeling - CONFIGURATIONS Release RelWithDebInfo - DESTINATION "${INSTALL_DIR_BIN}") - install (TARGETS Modeling - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR_BIN}d") -endif() - -include_directories (${CMAKE_BINARY_DIR}/inc - ${MFC_STANDARD_SAMPLES_DIR}/02_Modeling - ${Modeling_SRC_DIR} - ${MFC_STANDARD_SAMPLES_DIR}/Common) - -target_link_libraries (Modeling mfcsample TKDESTEP TKBO) - -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/samples/mfc/standard/02_Modeling/adm/win/vc10/Modeling.vcxproj b/samples/mfc/standard/02_Modeling/adm/win/vc10/Modeling.vcxproj deleted file mode 100644 index 4d74dd2eaa..0000000000 --- a/samples/mfc/standard/02_Modeling/adm/win/vc10/Modeling.vcxproj +++ /dev/null @@ -1,323 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3} - TopologyTransformations - MFCProj - - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../win32\$(VCFMT)\bind\ - .\win32\objd\ - true - ../../../../win64\$(VCFMT)\bind\ - .\win64\objd\ - true - ../../../../win32\$(VCFMT)\bin\ - .\win32\obj\ - false - ../../../../win64\$(VCFMT)\bin\ - .\win64\obj\ - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\objd/TopologyTransformations.tlb - - - - - Disabled - ..\..\..\..\Common;.;..\..\..\src;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win32\objd/TopologyTransformations.pch - .\win32\objd/ - .\win32\objd/ - .\win32\objd/ - Level4 - true - EditAndContinue - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBRep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKBO.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bind/Modeling.exe - true - ..\..\..\..\win32\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win32\$(VCFMT)\bind/Modeling.pdb - Windows - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\objd/TopologyTransformations.tlb - - - - - Disabled - ..\..\..\..\Common;.;..\..\..\src;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win64\objd/TopologyTransformations.pch - .\win64\objd/ - .\win64\objd/ - .\win64\objd/ - Level4 - true - ProgramDatabase - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBRep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKBO.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bind/Modeling.exe - true - ..\..\..\..\win64\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win64\$(VCFMT)\bind/Modeling.pdb - Windows - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\obj/TopologyTransformations.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\Common;.;..\..\..\src;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win32\obj/TopologyTransformations.pch - .\win32\obj/ - .\win32\obj/ - .\win32\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBRep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKBO.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bin/Modeling.exe - true - ..\..\..\..\win32\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win32\$(VCFMT)\bin/Modeling.pdb - Windows - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\obj/TopologyTransformations.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\Common;.;..\..\..\src;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win64\obj/TopologyTransformations.pch - .\win64\obj/ - .\win64\obj/ - .\win64\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBRep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;TKBO.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bin/Modeling.exe - true - ..\..\..\..\win64\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win64\$(VCFMT)\bin/Modeling.pdb - Windows - MachineX64 - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - - - - - - - - - - - - - - - - - - - - - {2d6cbbe8-6965-4016-b503-0d715ae26691} - false - - - - - - \ No newline at end of file diff --git a/samples/mfc/standard/02_Modeling/adm/win/vc10/Modeling.vcxproj.filters b/samples/mfc/standard/02_Modeling/adm/win/vc10/Modeling.vcxproj.filters deleted file mode 100644 index 447ee1d310..0000000000 --- a/samples/mfc/standard/02_Modeling/adm/win/vc10/Modeling.vcxproj.filters +++ /dev/null @@ -1,67 +0,0 @@ - - - - - {2f6dc6c3-bd86-4b9d-99ed-00caa1d19e9a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {e6868f3f-b442-46d7-a23c-531e056f4fb3} - h;hpp;hxx;hm;inl - - - {80146c9a-bf4e-4b6e-908c-e4c83f441747} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/samples/mfc/standard/02_Modeling/res/Modeling.rc b/samples/mfc/standard/02_Modeling/res/Modeling.rc deleted file mode 100755 index 904e3bfc00..0000000000 --- a/samples/mfc/standard/02_Modeling/res/Modeling.rc +++ /dev/null @@ -1,386 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -#include "..\..\Common\res\OCC_Resource.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "#include ""..\\..\\..\\Common\\res\\OCC_Resource.h""\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDR_MAINFRAME BITMAP "Toolbar.bmp" -IDR_FRAME2 BITMAP "fram2.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_MAINFRAME TOOLBAR 20, 20 -BEGIN - BUTTON ID_FILE_NEW - SEPARATOR - BUTTON ID_MIRROR - BUTTON ID_MIRRORAXIS - BUTTON ID_ROTATE - BUTTON ID_SCALE - BUTTON ID_TRANSLATION - BUTTON ID_DISPLACEMENT - BUTTON ID_DEFORM - SEPARATOR - BUTTON ID_BOX - BUTTON ID_Cylinder - BUTTON ID_CONE - BUTTON ID_SPHERE - BUTTON ID_TORUS - BUTTON ID_WEDGE - BUTTON ID_PRISM - BUTTON ID_REVOL - BUTTON ID_PIPE - BUTTON ID_THRU - BUTTON ID_EVOLVED - BUTTON ID_DRAFT - SEPARATOR - BUTTON ID_CUT - BUTTON ID_FUSE - BUTTON ID_COMMON - BUTTON ID_SECTION - BUTTON ID_PSECTION - BUTTON ID_BLEND - BUTTON ID_EVOLVEDBLEND - BUTTON ID_CHAMF - SEPARATOR - BUTTON ID_APP_ABOUT -END - -IDR_FRAME2 TOOLBAR 20, 20 -BEGIN - BUTTON ID_PRISM_LOCAL - BUTTON ID_DPRISM_LOCAL - BUTTON ID_REVOL_LOCAL - BUTTON ID_Pipe_LOCAL - BUTTON ID_LINEAR_LOCAL - BUTTON ID_GLUE_LOCAL - BUTTON ID_SPLIT_LOCAL - BUTTON ID_THICK_LOCAL - BUTTON ID_OFFSET_LOCAL - SEPARATOR - BUTTON ID_VERTEX - BUTTON ID_EDGE - BUTTON ID_WIRE - BUTTON ID_FACE - BUTTON ID_SHELL - BUTTON ID_COMPOUND - BUTTON ID_SEWING - BUTTON ID_BUILDER - BUTTON ID_GEOMETRIE - BUTTON ID_EXPLORER - SEPARATOR - BUTTON ID_VALID - BUTTON ID_LINEAR - BUTTON ID_SURFACE - BUTTON ID_VOLUME - SEPARATOR - BUTTON ID_FILLWITHTANG - BUTTON ID_BUTTON_FILL -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAINFRAME MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Help" - BEGIN - MENUITEM "&About TopologyTransformations...", ID_APP_ABOUT - END -END - -IDR_3DTYPE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM "&Close", ID_FILE_CLOSE - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Window" - BEGIN - MENUITEM "&New Window", ID_WINDOW_NEW - MENUITEM "&Cascade", ID_WINDOW_CASCADE - MENUITEM "&Tile", ID_WINDOW_TILE_HORZ - MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE - END - POPUP "&Help" - BEGIN - MENUITEM "&About TopologyTransformations...", ID_APP_ABOUT - END -END - -IDR_Popup3D MENU -BEGIN - POPUP "BackGround" - BEGIN - MENUITEM "Background Color...", ID_Modify_ChangeBackground - END - POPUP "Object(s)" - BEGIN - MENUITEM "Erase", ID_OBJECT_ERASE - MENUITEM "Shading", ID_OBJECT_SHADING - MENUITEM "Wireframe", ID_OBJECT_WIREFRAME - MENUITEM "Color...", ID_OBJECT_COLOR - MENUITEM "Material...", ID_OBJECT_MATERIAL - POPUP "Material" - BEGIN - MENUITEM "Aluminium", ID_OBJECT_MATERIAL_ALUMINIUM - MENUITEM "Brass", ID_OBJECT_MATERIAL_BRASS - MENUITEM "Bronze", ID_OBJECT_MATERIAL_BRONZE - MENUITEM "Chrome", ID_OBJECT_MATERIAL_CHROME - MENUITEM "Copper", ID_OBJECT_MATERIAL_COPPER - MENUITEM "Gold", ID_OBJECT_MATERIAL_GOLD - MENUITEM "Jade", ID_OBJECT_MATERIAL_JADE - MENUITEM "Metalized", ID_OBJECT_MATERIAL_METALIZED - MENUITEM "Neon GNC", ID_OBJECT_MATERIAL_NEON_GNC - MENUITEM "Neon PHC", ID_OBJECT_MATERIAL_NEON_PHC - MENUITEM "Obsidian", ID_OBJECT_MATERIAL_OBSIDIAN - MENUITEM "Pewter", ID_OBJECT_MATERIAL_PEWTER - MENUITEM "Plaster", ID_OBJECT_MATERIAL_PLASTER - MENUITEM "Plastic", ID_OBJECT_MATERIAL_PLASTIC - MENUITEM "Satin", ID_OBJECT_MATERIAL_SATIN - MENUITEM "Shiny plastic", ID_OBJECT_MATERIAL_SHINY_PLASTIC - MENUITEM "Silver", ID_OBJECT_MATERIAL_SILVER - MENUITEM "Steel", ID_OBJECT_MATERIAL_STEEL - MENUITEM "Stone", ID_OBJECT_MATERIAL_STONE - MENUITEM SEPARATOR - MENUITEM "Default", ID_OBJECT_MATERIAL_DEFAULT - END - MENUITEM "Transparency...", ID_OBJECT_TRANSPARENCY - END - POPUP "Stop" - BEGIN - MENUITEM "Stop", ID_STOP_STOP - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "FileDescription", "Viewer MFC Application" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "Viewer" - VALUE "LegalCopyright", "Copyright (C) 1997" - VALUE "OriginalFilename", "Viewer.EXE" - VALUE "ProductName", "SampleTopologyTransformations Application" - VALUE "ProductVersion", "1, 0, 0, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDR_MAINFRAME "TopologyTransformations" - IDR_3DTYPE "\nViewer\n\n\n\n.Document\n Document" -END - -STRINGTABLE -BEGIN - ID_BOX "Make a box\nBox" - ID_Cylinder "Make a cylinder\nCylinder" - ID_CONE "Make a cone\nCone" - ID_SPHERE "Make a sphere\nSphere" - ID_TORUS "Make a torus\nTorus" - ID_WEDGE "Make a wedge\nWedge" - ID_PRISM "Make a prism\nPrism" - ID_REVOL "Make a revolution\nRevol" - ID_PIPE "Make a pipe\nPipe" - ID_THRU "Make a shape thru sections\nThru Sections" - ID_EVOLVED "Make an evolutive shape\nEvolved" - ID_DRAFT "Make a tapered shape\nDraft angle" - ID_BUTTON815 "Mirror\nMirror" -END - -STRINGTABLE -BEGIN - ID_MIRROR "Transform a shape by a point Mirror\nMirror Point" - ID_MIRRORAXIS "Transform a shape by an axis Mirror\nMirror Axis" - ID_ROTATE "Transform a shape by a rotation\nRotate" - ID_SCALE "Apply a scale factor on a shape\nScale" - ID_TRANSLATION "Translate a shape\nTranslation" - ID_DISPLACEMENT "Transform a shape from an axis placement to anotherone\nDisplacement" - ID_DEFORM "Apply a geometric transformation\nDeform" -END - -STRINGTABLE -BEGIN - ID_CUT "Cut a solid by an other\nCut" - ID_FUSE "Fuse two solids\nFuse two solids" - ID_COMMON "Find the common surfaces\nCommon" - ID_SECTION "Compute the intersection between two solids\nSection" - ID_PSECTION "Compute a plane section\nPlane section" - ID_BLEND "Compute blend on edges\nBlend" - ID_EVOLVEDBLEND "Compute evolving blend on edges\nEvolved blend" - ID_CHAMF "Compute chamfers on edges and faces\nChamfer" - ID_PRISM_LOCAL "Make a local prism\nPrism" - ID_DPRISM_LOCAL "Make a local prism with draft angle\nDraft angle" -END - -STRINGTABLE -BEGIN - ID_REVOL_LOCAL "Make a local revolution shape\nRevol" - ID_Pipe_LOCAL "Make a local pipe\nPipe" - ID_LINEAR_LOCAL "Make a rib\nRib" - ID_GLUE_LOCAL "Glue two solids\nGlue" - ID_SPLIT_LOCAL "Split faces of a shape\nSplit" - ID_THICK_LOCAL "Make a thick solid from a shape\nThickSolid" - ID_OFFSET_LOCAL "Make an offset shape\nOffset" - ID_VERTEX "Make vertex from geometric point\nVertex" - ID_EDGE "Make edge\nEdge" - ID_WIRE "Make wire\nWire" - ID_FACE "Make face\nFace" - ID_SHELL "Make a shell from a geometric surface\nShell" - ID_COMPOUND "Make a compound\nCompound" - ID_SEWING "Sew contiguous faces\nSewing" - ID_BUILDER "Create a shape with a builder\nBuilder" -END - -STRINGTABLE -BEGIN - ID_GEOMETRIE "Tools to recover the geometry\nTools" - ID_EXPLORER "Explode a shape in faces\nExplorer" - ID_VALID "Check Validity\nCheck Validity" - ID_LINEAR "Compute Linear Properties\nLinear Properties" - ID_SURFACE "Compute Surface Properties\nSurface Properties" - ID_VOLUME "Compute Volume Properties\nVolume Properties" - ID_FILLWITHTANG "Create a tangent surface between 2 faces\nTangent surface" - ID_BUTTON_FILL "Fill a hole between patches\nFilling hole" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/samples/mfc/standard/02_Modeling/res/RCa04828 b/samples/mfc/standard/02_Modeling/res/RCa04828 deleted file mode 100755 index 98bbc3ed15..0000000000 Binary files a/samples/mfc/standard/02_Modeling/res/RCa04828 and /dev/null differ diff --git a/samples/mfc/standard/02_Modeling/res/Toolbar.bmp b/samples/mfc/standard/02_Modeling/res/Toolbar.bmp deleted file mode 100755 index 6397affd40..0000000000 Binary files a/samples/mfc/standard/02_Modeling/res/Toolbar.bmp and /dev/null differ diff --git a/samples/mfc/standard/02_Modeling/res/fram2.bmp b/samples/mfc/standard/02_Modeling/res/fram2.bmp deleted file mode 100755 index 75a2fe1fa6..0000000000 Binary files a/samples/mfc/standard/02_Modeling/res/fram2.bmp and /dev/null differ diff --git a/samples/mfc/standard/02_Modeling/res/resource.h b/samples/mfc/standard/02_Modeling/res/resource.h deleted file mode 100755 index 776e40ca0d..0000000000 --- a/samples/mfc/standard/02_Modeling/res/resource.h +++ /dev/null @@ -1,73 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Modeling.rc -// -#define IDR_MAINFRAME1 129 -#define IDR_FRAME2 130 -#define ID_BOX 802 -#define ID_Cylinder 803 -#define ID_CONE 804 -#define ID_SPHERE 805 -#define ID_TORUS 806 -#define ID_WEDGE 807 -#define ID_PRISM 808 -#define ID_REVOL 809 -#define ID_PIPE 810 -#define ID_THRU 811 -#define ID_EVOLVED 813 -#define ID_DRAFT 814 -#define ID_BUTTON815 815 -#define ID_MIRROR 816 -#define ID_MIRRORAXIS 818 -#define ID_ROTATE 820 -#define ID_SCALE 821 -#define ID_TRANSLATION 822 -#define ID_DISPLACEMENT 823 -#define ID_DEFORM 824 -#define ID_CUT 837 -#define ID_FUSE 838 -#define ID_COMMON 839 -#define ID_SECTION 840 -#define ID_PSECTION 841 -#define ID_BLEND 842 -#define ID_EVOLVEDBLEND 843 -#define ID_CHAMF 844 -#define ID_PRISM_LOCAL 846 -#define ID_DPRISM_LOCAL 847 -#define ID_REVOL_LOCAL 849 -#define ID_Pipe_LOCAL 850 -#define ID_LINEAR_LOCAL 851 -#define ID_GLUE_LOCAL 852 -#define ID_SPLIT_LOCAL 853 -#define ID_THICK_LOCAL 854 -#define ID_OFFSET_LOCAL 855 -#define ID_VERTEX 856 -#define ID_EDGE 857 -#define ID_WIRE 858 -#define ID_FACE 859 -#define ID_SHELL 860 -#define ID_COMPOUND 861 -#define ID_SEWING 862 -#define ID_BUILDER 863 -#define ID_GEOMETRIE 864 -#define ID_EXPLORER 865 -#define ID_VALID 866 -#define ID_LINEAR 867 -#define ID_SURFACE 868 -#define ID_VOLUME 869 -#define ID_FILLWITHTANG 870 -#define ID_BUTTON871 871 -#define ID_BUTTON_FILL 871 -#define ID_STOP_STOP 32901 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 133 -#define _APS_NEXT_COMMAND_VALUE 872 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp b/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp deleted file mode 100755 index dea846d7c6..0000000000 --- a/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// ISession_Direction.cpp: implementation of the ISession_Direction class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ISession_Direction.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#endif - -IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject) - -#include "DsgPrs_LengthPresentation.hxx" -#include "Prs3d_ArrowAspect.hxx" -#include "Prs3d_Drawer.hxx" -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - - -ISession_Direction::ISession_Direction(const gp_Pnt& aPnt,const gp_Pnt& aPnt2) -:myStartPnt(aPnt),myEndPnt(aPnt2) -{} - -ISession_Direction::ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec) -:myStartPnt(aPnt) -{ - myEndPnt = myStartPnt.Translated(aVec); -} - - -void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager)& /*aPresentationManager*/, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer /*aMode*/) -{ - // Set style for arrow - Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect(); - - // Draw Line - Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2); - aPrims->AddVertex (myStartPnt); - aPrims->AddVertex (myEndPnt); - aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); - aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims); - // Draw arrow - Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), - myEndPnt, - gp_Dir (gp_Vec(myStartPnt, myEndPnt)), - anArrowAspect->Angle(), - anArrowAspect->Length()); -} diff --git a/samples/mfc/standard/02_Modeling/src/ISession_Direction.h b/samples/mfc/standard/02_Modeling/src/ISession_Direction.h deleted file mode 100755 index a6fce68ae3..0000000000 --- a/samples/mfc/standard/02_Modeling/src/ISession_Direction.h +++ /dev/null @@ -1,43 +0,0 @@ -// ISession_Direction.h: interface for the ISession_Direction class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_) -#define AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include - -#include "gp_Dir.hxx" -#include "gp_Vec.hxx" -#include "AIS_InteractiveObject.hxx" -class ISession_Direction; -DEFINE_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject) -class ISession_Direction : public AIS_InteractiveObject -{ -public: - ISession_Direction(); - ISession_Direction(const gp_Pnt& aPnt,const gp_Pnt& aPnt2); - ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec); - - DEFINE_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject) - -private: - - void Compute (const Handle(PrsMgr_PresentationManager)& aPresentationManager, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer aMode); - - void ComputeSelection (const class Handle(SelectMgr_Selection) &,const int){}; - -private: - - gp_Pnt myStartPnt; - gp_Pnt myEndPnt; -}; - -#endif // !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/02_Modeling/src/ModelingApp.cpp b/samples/mfc/standard/02_Modeling/src/ModelingApp.cpp deleted file mode 100755 index d6b02f2552..0000000000 --- a/samples/mfc/standard/02_Modeling/src/ModelingApp.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// ModelingApp.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" - -#include "..\res\resource.h" - -#include "ModelingApp.h" - -#include "OCC_MainFrame.h" -#include "OCC_3dChildFrame.h" -#include "ModelingDoc.h" -#include "OCC_3dView.h" - -///////////////////////////////////////////////////////////////////////////// -// CModelingApp construction - -CModelingApp::CModelingApp() : OCC_App() -{ - SampleName = "Modeling"; //for about dialog - SetSamplePath (L"..\\..\\02_Modeling"); -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CModelingApp object - -CModelingApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CModelingApp initialization - -BOOL CModelingApp::InitInstance() -{ - AfxEnableControlContainer(); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - - // Change the registry key under which our settings are stored. - // You should modify this string to be something appropriate - // such as the name of your company or organization. - SetRegistryKey(_T("Local AppWizard-Generated Applications")); - - LoadStdProfileSettings(); // Load standard INI file options (including MRU) - - // Register the application's document templates. Document templates - // serve as the connection between documents, frame windows and views. - - CMultiDocTemplate* pDocTemplate; - pDocTemplate = new CMultiDocTemplate( - IDR_3DTYPE, - RUNTIME_CLASS(CModelingDoc), - RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame - RUNTIME_CLASS(OCC_3dView)); - AddDocTemplate(pDocTemplate); - - // create main MDI Frame window - OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB); - if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) - return FALSE; - m_pMainWnd = pMainFrame; - // Create additional toolbar - m_pToolBar2 = new CToolBar; - if ( !m_pToolBar2->Create(m_pMainWnd, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS) || - !m_pToolBar2->LoadToolBar(IDR_FRAME2)) - { - TRACE0("Failed to create toolbar\n"); - return FALSE; - } - - - // Parse command line for standard shell commands, DDE, file open - CCommandLineInfo cmdInfo; - ParseCommandLine(cmdInfo); - - // Dispatch commands specified on the command line - if (!ProcessShellCommand(cmdInfo)) - return FALSE; - - // The main window has been initialized, so show and update it. - pMainFrame->ShowWindow(m_nCmdShow); - pMainFrame->UpdateWindow(); - - return TRUE; -} - diff --git a/samples/mfc/standard/02_Modeling/src/ModelingApp.h b/samples/mfc/standard/02_Modeling/src/ModelingApp.h deleted file mode 100755 index 468a4ddce4..0000000000 --- a/samples/mfc/standard/02_Modeling/src/ModelingApp.h +++ /dev/null @@ -1,36 +0,0 @@ -// ModelingApp.h : main header file for the TOPOLOGYTRANSFORMATIONS application -// - -#if !defined(AFX_MODELINGAPP_H__30453388_3E75_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_MODELINGAPP_H__30453388_3E75_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include - -class CModelingApp : public OCC_App -{ -public: - - CModelingApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CModelingApp) - public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL - -private: - - CToolBar *m_pToolBar2; -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_MODELINGAPP_H__30453388_3E75_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/02_Modeling/src/ModelingDoc.cpp b/samples/mfc/standard/02_Modeling/src/ModelingDoc.cpp deleted file mode 100755 index 951a7971cf..0000000000 --- a/samples/mfc/standard/02_Modeling/src/ModelingDoc.cpp +++ /dev/null @@ -1,5077 +0,0 @@ -// ModelingDoc.cpp : implementation of the CModelingDoc class -// - -#include "stdafx.h" - -#include "ModelingDoc.h" - -#include "ModelingApp.h" -#include "ResultDialog.h" -#include "State.h" - -#include "ISession_Direction.h" -#include "..\res\resource.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static Handle(AIS_Shape) AIS1; -static TopoDS_Face THE_F1, THE_F2; -static TopoDS_Edge THE_E1, THE_E2; - -///////////////////////////////////////////////////////////////////////////// -// CModelingDoc - -IMPLEMENT_DYNCREATE(CModelingDoc, CDocument) - -BEGIN_MESSAGE_MAP(CModelingDoc, OCC_3dBaseDoc) - //{{AFX_MSG_MAP(CModelingDoc) - ON_COMMAND(ID_MIRROR, OnMirror) - ON_COMMAND(ID_MIRRORAXIS, OnMirroraxis) - ON_COMMAND(ID_ROTATE, OnRotate) - ON_COMMAND(ID_SCALE, OnScale) - ON_COMMAND(ID_TRANSLATION, OnTranslation) - ON_COMMAND(ID_DISPLACEMENT, OnDisplacement) - ON_COMMAND(ID_DEFORM, OnDeform) - ON_COMMAND(ID_BOX, OnBox) - ON_COMMAND(ID_Cylinder, OnCylinder) - ON_COMMAND(ID_CONE, OnCone) - ON_COMMAND(ID_SPHERE, OnSphere) - ON_COMMAND(ID_TORUS, OnTorus) - ON_COMMAND(ID_WEDGE, OnWedge) - ON_COMMAND(ID_PRISM, OnPrism) - ON_COMMAND(ID_REVOL, OnRevol) - ON_COMMAND(ID_PIPE, OnPipe) - ON_COMMAND(ID_THRU, OnThru) - ON_COMMAND(ID_EVOLVED, OnEvolved) - ON_COMMAND(ID_DRAFT, OnDraft) - ON_COMMAND(ID_CUT, OnCut) - ON_COMMAND(ID_FUSE, OnFuse) - ON_COMMAND(ID_SECTION, OnSection) - ON_COMMAND(ID_COMMON, OnCommon) - ON_COMMAND(ID_PSECTION, OnPsection) - ON_COMMAND(ID_BLEND, OnBlend) - ON_COMMAND(ID_CHAMF, OnChamf) - ON_COMMAND(ID_EVOLVEDBLEND, OnEvolvedblend) - ON_COMMAND(ID_PRISM_LOCAL, OnPrismLocal) - ON_COMMAND(ID_REVOL_LOCAL, OnRevolLocal) - ON_COMMAND(ID_GLUE_LOCAL, OnGlueLocal) - ON_COMMAND(ID_DPRISM_LOCAL, OnDprismLocal) - ON_COMMAND(ID_Pipe_LOCAL, OnPipeLocal) - ON_COMMAND(ID_LINEAR_LOCAL, OnLinearLocal) - ON_COMMAND(ID_SPLIT_LOCAL, OnSplitLocal) - ON_COMMAND(ID_THICK_LOCAL, OnThickLocal) - ON_COMMAND(ID_OFFSET_LOCAL, OnOffsetLocal) - ON_COMMAND(ID_VERTEX, OnVertex) - ON_COMMAND(ID_EDGE, OnEdge) - ON_COMMAND(ID_WIRE, OnWire) - ON_COMMAND(ID_FACE, OnFace) - ON_COMMAND(ID_SHELL, OnShell) - ON_COMMAND(ID_COMPOUND, OnCompound) - ON_COMMAND(ID_GEOMETRIE, OnGeometrie) - ON_COMMAND(ID_SEWING, OnSewing) - ON_COMMAND(ID_EXPLORER, OnExplorer) - ON_COMMAND(ID_BUILDER, OnBuilder) - ON_COMMAND(ID_VALID, OnValid) - ON_COMMAND(ID_LINEAR, OnLinear) - ON_COMMAND(ID_VOLUME, OnVolume) - ON_COMMAND(ID_SURFACE, OnSurface) - ON_COMMAND(ID_BUTTON_FILL, OnButtonFill) - ON_COMMAND(ID_STOP_STOP, OnStopStop) - ON_COMMAND(ID_FILLWITHTANG, OnFillwithtang) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CModelingDoc construction/destruction - -CModelingDoc::CModelingDoc() -{ - myAISContext->SetDisplayMode(AIS_Shaded,Standard_False); -} - -CModelingDoc::~CModelingDoc() -{ -} - -void CModelingDoc::OnMirror() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge (60.,100.,80.,20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - gp_Trsf theTransformation; - gp_Pnt PntCenterOfTheTransformation(110,60,60); - Handle(AIS_Point) aispnt = new AIS_Point(new Geom_CartesianPoint(PntCenterOfTheTransformation)); - myAISContext->Display(aispnt,Standard_False); - theTransformation.SetMirror(PntCenterOfTheTransformation); - BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation); - TopoDS_Shape S2 = myBRepTransformation.Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.); \n\ -gp_Trsf theTransformation; \n\ -gp_Pnt PntCenterOfTheTransformation(110,60,60); \n\ -theTransformation.SetMirror(PntCenterOfTheTransformation);\n\ -BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); \n"); - PocessTextInDialog("Transform a Shape with Mirror and One point.", Message); - -} - -void CModelingDoc::OnMirroraxis() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge(60.,100.,80.,20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - gp_Trsf theTransformation; - gp_Ax1 axe = gp_Ax1(gp_Pnt(110,60,60),gp_Dir(0.,1.,0.)); - Handle(Geom_Axis1Placement) Gax1 = new Geom_Axis1Placement(axe); - Handle (AIS_Axis) ax1 = new AIS_Axis(Gax1); - myAISContext->Display(ax1,Standard_False); - theTransformation.SetMirror(axe); - BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation); - TopoDS_Shape S2 = myBRepTransformation.Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.); \n\ -gp_Trsf theTransformation; \n\ -gp_Ax1 Axis = gp_Ax1(gp_Pnt(110,60,60),gp_Dir(0.,1.,0.)); \n\ -theTransformation.SetMirror(Axis);\n\ -BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); \n"); - - PocessTextInDialog("Transform a Shape with Mirror and One axis.", Message); - -} - - -void CModelingDoc::OnRotate() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge(60.,100.,80.,20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - gp_Trsf theTransformation; - gp_Ax1 axe = gp_Ax1(gp_Pnt(200,60,60),gp_Dir(0.,1.,0.)); - Handle(Geom_Axis1Placement) Gax1 = new Geom_Axis1Placement(axe); - Handle (AIS_Axis) ax1 = new AIS_Axis(Gax1); - myAISContext->Display(ax1,Standard_False); - theTransformation.SetRotation(axe,30*M_PI/180); - BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation); - TopoDS_Shape S2 = myBRepTransformation.Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.); \n\ -gp_Trsf theTransformation; \n\ -gp_Ax1 Axis = gp_Ax1(gp_Pnt(200,60,60),gp_Dir(0.,1.,0.)); \n\ -theTransformation.SetRotation(Axis,30*PI/180); // Rotation of 30 degrees \n\ -BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); \n"); - - PocessTextInDialog("Transform a Shape with Rotation.", Message); - -} - -void CModelingDoc::OnScale() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge(60.,100.,80.,20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - gp_Trsf theTransformation; - gp_Pnt theCenterOfScale(200,60,60); - Handle(AIS_Point) aispnt = new AIS_Point(new Geom_CartesianPoint(theCenterOfScale)); - - myAISContext->Display(aispnt,Standard_False); - theTransformation.SetScale(theCenterOfScale,0.5); - BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation); - TopoDS_Shape S2 = myBRepTransformation.Shape(); - - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.); \n\ -gp_Trsf theTransformation; \n\ -gp_Pnt theCenterOfScale(200,60,60); \n\ -theTransformation.SetScale(theCenterOfScale,0.5); // Scale : value = 0.5 \n\ -BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); \n"); - - PocessTextInDialog("Scale a Shape with One point.", Message); - - -} - - - -void CModelingDoc::OnTranslation() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge(6.,10.,8.,2.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - gp_Trsf theTransformation; - gp_Vec theVectorOfTranslation(-6,-6,6); - - Handle(ISession_Direction) aDirection1 = new ISession_Direction(gp_Pnt(0,0,0),theVectorOfTranslation); - myAISContext->Display(aDirection1,Standard_False); - - theTransformation.SetTranslation(theVectorOfTranslation); - BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation); - TopoDS_Shape S2 = myBRepTransformation.Shape(); - - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - - Fit(); - - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(6.,10.,8.,2.); \n\ -gp_Trsf theTransformation; \n\ -gp_Vec theVectorOfTranslation(6,6,6); \n\ -theTransformation.SetTranslation(theVectorOfTranslation); \n\ -BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); \n"); - - PocessTextInDialog("Translate a Shape with One vector.", Message); - -} - -void CModelingDoc::OnDisplacement() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge(60., 100., 80., 20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - gp_Trsf theTransformation; - - gp_Ax3 ax3_1(gp_Pnt(0,0,0),gp_Dir(0,0,1)); - gp_Ax3 ax3_2(gp_Pnt(60,60,60),gp_Dir(1,1,1)); - - theTransformation.SetDisplacement(ax3_1,ax3_2); - BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation); - TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(TransformedShape); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.); \n\ -gp_Trsf theTransformation; \n\ -gp_Ax3 ax3_1(gp_Pnt(0,0,0),gp_Dir(0,0,1)); \n\ -gp_Ax3 ax3_2(gp_Pnt(60,60,60),gp_Dir(1,1,1)); \n\ -theTransformation.SetDisplacement(ax3_1,ax3_2); \n\ -BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepTransformation.Shape(); \n"); - - PocessTextInDialog("Displace a Shape with Two coordinate systems.", Message); - - -} - - -void CModelingDoc::OnDeform() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeWedge(60., 100., 80., 20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - - gp_GTrsf theTransformation; - gp_Mat rot(1, 0, 0, 0, 0.5, 0, 0, 0, 1.5); - theTransformation.SetVectorialPart(rot); - theTransformation.SetTranslationPart(gp_XYZ(5,5,5)); - - BRepBuilderAPI_GTransform myBRepTransformation(S,theTransformation); - TopoDS_Shape S2 = myBRepTransformation.Shape(); - - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.); \n\ -gp_GTrsf theTransformation; \n\ -gp_Mat rot(1, 0, 0, 0, 0.5, 0, 0, 0, 1.5); // scaling : 100% on X ; 50% on Y ; 150% on Z . \n\ -theTransformation.SetVectorialPart(rot); \n\ -theTransformation.SetTranslationPart(gp_XYZ(5,5,5)); \n\ -BRepBuilderAPI_GTransform myBRepGTransformation(S,theTransformation);\n\ -TopoDS_Shape TransformedShape = myBRepGTransformation.Shape(); \n"); - - PocessTextInDialog("Deform a Shape with One matrix of deformation and One translation.", Message); -} - -/* ================================================================================= - ==================== P R I M I T I V E S ==================================== - ================================================================================= */ - -void CModelingDoc::OnBox() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape B1 = BRepPrimAPI_MakeBox(200., 150., 100.).Shape(); - Handle(AIS_Shape) aBox1 = new AIS_Shape(B1); - myAISContext->SetMaterial(aBox1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetColor(aBox1,Quantity_NOC_GREEN,Standard_False); - myAISContext->Display(aBox1,Standard_False); - TopoDS_Shape B2 = BRepPrimAPI_MakeBox (gp_Ax2(gp_Pnt(-200.,-80.,-70.), - gp_Dir(1.,2.,1.)), - 80., 90., 120.).Shape(); - Handle(AIS_Shape) aBox2 = new AIS_Shape(B2); - myAISContext->SetMaterial(aBox2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetColor(aBox2,Quantity_NOC_RED,Standard_False); - myAISContext->Display(aBox2,Standard_False); - Fit(); - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape B1 = BRepPrimAPI_MakeBox (200.,150.,100.); \n\ -TopoDS_Shape B2 = BRepPrimAPI_MakeBox (gp_Ax2(gp_Pnt(-200.,-80.,-70.), \n\ - gp_Dir(1.,2.,1.)), \n\ - 80.,90.,120.); \n\ - \n"); - PocessTextInDialog("Make a topological box", Message); -} - -void CModelingDoc::OnCylinder() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape C1 = BRepPrimAPI_MakeCylinder(50., 200.).Shape(); - Handle(AIS_Shape) aCyl1 = new AIS_Shape(C1); - myAISContext->SetMaterial(aCyl1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetColor(aCyl1,Quantity_NOC_RED,Standard_False); - myAISContext->Display(aCyl1,Standard_False); - TopoDS_Shape C2 = BRepPrimAPI_MakeCylinder (gp_Ax2(gp_Pnt(200.,200.,0.), - gp_Dir(0.,0.,1.)), - 40., 110., 210.*M_PI / 180).Shape(); - Handle(AIS_Shape) aCyl2 = new AIS_Shape(C2); - myAISContext->SetMaterial(aCyl2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetColor(aCyl2,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->Display(aCyl2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape C1 = BRepPrimAPI_MakeCylinder (50.,200.); \n\ -TopoDS_Shape C2 = BRepPrimAPI_MakeCylinder (gp_Ax2(gp_Pnt(200.,200.,0.), \n\ - gp_Dir(0.,0.,1.)), \n\ - 40.,110.,210.*PI180.); \n\ - \n"); - PocessTextInDialog("Make a cylinder", Message); -} - - -void CModelingDoc::OnCone() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape C1 = BRepPrimAPI_MakeCone(50., 25., 200.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(C1); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetColor(ais1,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->Display(ais1,Standard_False); - TopoDS_Shape C2 = BRepPrimAPI_MakeCone(gp_Ax2(gp_Pnt(100.,100.,0.), - gp_Dir(0.,0.,1.)), - 60., 0., 150., 210.*M_PI / 180).Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(C2); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetColor(ais2,Quantity_NOC_GREEN,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape C1 = BRepPrimAPI_MakeCone (50.,25.,200.); \n\ -TopoDS_Shape C2 = BRepPrimAPI_MakeCone(gp_Ax2(gp_Pnt(100.,100.,0.), \n\ - gp_Dir(0.,0.,1.)), \n\ - 605.,0.,150.,210.*PI180); \n\ - \n"); - PocessTextInDialog("Make a cone", Message); -} - -void CModelingDoc::OnSphere() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S1 = BRepPrimAPI_MakeSphere(gp_Pnt(-200., -250., 0.), 80.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S1); - myAISContext->SetColor(ais1,Quantity_NOC_AZURE,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - TopoDS_Shape S2 = BRepPrimAPI_MakeSphere(100., 120.*M_PI / 180).Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - TopoDS_Shape S3 = BRepPrimAPI_MakeSphere(gp_Pnt(200.,250.,0.),100., - -60.*M_PI / 180, 60.*M_PI / 180).Shape(); - Handle(AIS_Shape) ais3 = new AIS_Shape(S3); - myAISContext->SetColor(ais3,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(ais3,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais3,Standard_False); - TopoDS_Shape S4 = BRepPrimAPI_MakeSphere(gp_Pnt(0.,0.,-300.),150., - -45.*M_PI / 180, 45.*M_PI / 180, 45.*M_PI / 180).Shape(); - Handle(AIS_Shape) ais4 = new AIS_Shape(S4); - myAISContext->SetColor(ais4,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais4,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais4,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeSphere(gp_Pnt(-200.,-250.,0.),80.); \n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeSphere(100.,120.*PI180); \n\ -TopoDS_Shape S3 = BRepPrimAPI_MakeSphere(gp_Pnt(200.,250.,0.),100., \n\ - -60.*PI180, 60.*PI180); \n\ -TopoDS_Shape S4 = BRepPrimAPI_MakeSphere(gp_Pnt(0.,0.,-300.),150., \n\ - -45.*PI180, 45.*PI180, 45.*PI180); \n\ - \n"); - PocessTextInDialog("Make a sphere", Message); -} - -void CModelingDoc::OnTorus() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S1 = BRepPrimAPI_MakeTorus(60., 20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S1); - myAISContext->SetColor(ais1,Quantity_NOC_AZURE,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - TopoDS_Shape S2 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(1.,1.,1.)), - 50., 20., 210.*M_PI / 180).Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - TopoDS_Shape S3 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(-200.,-150.,-100),gp_Dir(0.,1.,0.)), - 60., 20., -45.*M_PI / 180, 45.*M_PI / 180, 90.*M_PI / 180).Shape(); - Handle(AIS_Shape) ais3= new AIS_Shape(S3); - myAISContext->SetColor(ais3,Quantity_NOC_CORAL,Standard_False); - myAISContext->SetMaterial(ais3,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais3,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeTorus(60.,20.); \n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(1.,1.,1.)), \n\ - 50.,20.,210.*PI180); \n\ -TopoDS_Shape S3 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(-200.,-150.,-100),gp_Dir(0.,1.,0.)), \n\ - 60.,20.,-45.*PI180,45.*PI180,90.*PI180); \n\ - \n"); - PocessTextInDialog("Make a torus", Message); -} - -void CModelingDoc::OnWedge() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S1 = BRepPrimAPI_MakeWedge(60., 100., 80., 20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S1); - myAISContext->SetColor(ais1,Quantity_NOC_AZURE,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - TopoDS_Shape S2 = BRepPrimAPI_MakeWedge(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(0.,0.,1.)), - 60., 50., 80., 25., -10., 40., 70.).Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_CORAL2,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeWedge(60.,100.,80.,20.); \n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeWedge(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(0.,0.,1.)), \n\ - 60.,50.,80.,25.,-10.,40.,70.); \n\ - \n"); - PocessTextInDialog("Make a wedge", Message); -} - -void CModelingDoc::OnPrism() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.)); - Handle(AIS_Shape) ais1 = new AIS_Shape(V1); - myAISContext->Display(ais1,Standard_False); - TopoDS_Shape S1 = BRepPrimAPI_MakePrism(V1,gp_Vec(0.,0.,100.)); - Handle(AIS_Shape) ais2 = new AIS_Shape(S1); - myAISContext->Display(ais2,Standard_False); - - TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-150.,-150,0.), gp_Pnt(-50.,-50,0.)); - Handle(AIS_Shape) ais3 = new AIS_Shape(E); - myAISContext->Display(ais3,Standard_False); - TopoDS_Shape S2 = BRepPrimAPI_MakePrism(E,gp_Vec(0.,0.,100.)); - Handle(AIS_Shape) ais4 = new AIS_Shape(S2); - myAISContext->SetColor(ais4,Quantity_NOC_CORAL2,Standard_False); - myAISContext->SetMaterial(ais4,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais4,Standard_False); - - TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.)); - TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.)); - TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.)); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3); - TopoDS_Shape S3 = BRepPrimAPI_MakePrism(W,gp_Vec(0.,0.,100.)); - Handle(AIS_Shape) ais5 = new AIS_Shape(W); - myAISContext->Display(ais5,Standard_False); - Handle(AIS_Shape) ais6 = new AIS_Shape(S3); - myAISContext->SetColor(ais6,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais6,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais6,Standard_False); - - gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.),gp_Dir(0.,0.,1.)), 80.); - TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c); - TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec); - TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::XOY()),Wc); - Handle(AIS_Shape) ais7 = new AIS_Shape(F); - myAISContext->Display(ais7,Standard_False); - TopoDS_Shape S4 = BRepPrimAPI_MakePrism(F,gp_Vec(0.,0.,100.)); - Handle(AIS_Shape) ais8 = new AIS_Shape(S4); - myAISContext->SetColor(ais8,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais8,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais8,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ---- Prism a vertex -> result is an edge --- \n\ -\n\ -TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.)); \n\ -TopoDS_Shape S1 = BRepBuilderAPI_MakePrism(V1,gp_Vec(0.,0.,100.)); \n\ -\n\ ---- Prism an edge -> result is a face --- \n\ -\n\ -TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-150.,-150,0.), gp_Pnt(-50.,-50,0.)); \n\ -TopoDS_Shape S2 = BRepPrimAPI_MakePrism(E,gp_Vec(0.,0.,100.)); \n\ -\n\ ---- Prism an wire -> result is a shell --- \n\ -\n\ -TopoDS_Edge E1 = BREpBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.)); \n\ -TopoDS_Edge E2 = BREpBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.)); \n\ -TopoDS_Edge E3 = BREpBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.)); \n\ -TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3); \n\ -TopoDS_Shape S3 = BRepPrimAPI_MakePrism(W,gp_Vec(0.,0.,100.)); \n\ -\n\ ---- Prism a face or a shell -> result is a solid --- \n\ -\n\ -gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.gp_Dir(0.,0.,1.)), 80.); \n\ -TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c); \n\ -TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec); \n\ -TopoDS_Face F = BRepBuilderAPI_MakeFace(gp::XOY(),Wc); \n\ -TopoDS_Shape S4 = BRepBuilderAPI_MakePrism(F,gp_Vec(0.,0.,100.)); \n\ - \n"); - PocessTextInDialog("Make a prism", Message); -} - -void CModelingDoc::OnRevol() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.)); - Handle(AIS_Shape) ais1 = new AIS_Shape(V1); - myAISContext->Display(ais1,Standard_False); - gp_Ax1 axe = gp_Ax1(gp_Pnt(-170.,-170.,0.),gp_Dir(0.,0.,1.)); - Handle(Geom_Axis1Placement) Gax1 = new Geom_Axis1Placement(axe); - Handle (AIS_Axis) ax1 = new AIS_Axis(Gax1); - myAISContext->Display(ax1,Standard_False); - TopoDS_Shape S1 = BRepPrimAPI_MakeRevol(V1,axe); - Handle(AIS_Shape) ais2 = new AIS_Shape(S1); - myAISContext->Display(ais2,Standard_False); - - TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-120.,-120,0.), gp_Pnt(-120.,-120,100.)); - Handle(AIS_Shape) ais3 = new AIS_Shape(E); - myAISContext->Display(ais3,Standard_False); - axe = gp_Ax1(gp_Pnt(-100.,-100.,0.),gp_Dir(0.,0.,1.)); - Handle(Geom_Axis1Placement) Gax2 = new Geom_Axis1Placement(axe); - Handle (AIS_Axis) ax2 = new AIS_Axis(Gax2); - myAISContext->Display(ax2,Standard_False); - TopoDS_Shape S2 = BRepPrimAPI_MakeRevol(E,axe); - Handle(AIS_Shape) ais4 = new AIS_Shape(S2); - myAISContext->SetColor(ais4,Quantity_NOC_YELLOW,Standard_False); - myAISContext->SetMaterial(ais4,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais4,Standard_False); - - TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.)); - TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.)); - TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.)); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3); - axe = gp_Ax1(gp_Pnt(0.,0.,30.),gp_Dir(0.,1.,0.)); - Handle(Geom_Axis1Placement) Gax3 = new Geom_Axis1Placement(axe); - Handle (AIS_Axis) ax3 = new AIS_Axis(Gax3); - myAISContext->Display(ax3,Standard_False); - TopoDS_Shape S3 = BRepPrimAPI_MakeRevol(W,axe, 210.*M_PI/180); - Handle(AIS_Shape) ais5 = new AIS_Shape(W); - myAISContext->Display(ais5,Standard_False); - Handle(AIS_Shape) ais6 = new AIS_Shape(S3); - myAISContext->SetColor(ais6,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais6,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais6,Standard_False); - - gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.),gp_Dir(0.,0.,1.)), 80.); - TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c); - TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec); - TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::XOY()),Wc); - axe = gp_Ax1(gp_Pnt(290,290.,0.),gp_Dir(0.,1,0.)); - Handle(Geom_Axis1Placement) Gax4 = new Geom_Axis1Placement(axe); - Handle (AIS_Axis) ax4 = new AIS_Axis(Gax4); - myAISContext->Display(ax4,Standard_False); - TopoDS_Shape S4 = BRepPrimAPI_MakeRevol(F,axe, 90.*M_PI/180); - Handle(AIS_Shape) ais8 = new AIS_Shape(S4); - myAISContext->SetColor(ais8,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais8,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais8,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ---- Revol of a vertex -> result is an edge --- \n\ -\n\ -TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.)); \n\ -gp_Ax1 axe = gp_Ax1(gp_Pnt(-170.,-170.,0.),gp_Dir(0.,0.,1.)); \n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeRevol(V1,axe); \n\ -\n\ ---- Revol of an edge -> result is a face --- \n\ -\n\ -TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-120.,-120,0.), gp_Pnt(-120.,-120,100.)); \n\ -axe = gp_Ax1(gp_Pnt(-100.,-100.,0.),gp_Dir(0.,0.,1.)); \n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeRevol(E,axe); \n\ -\n\ ---- Revol of a wire -> result is a shell --- \n\ -\n\ -TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.)); \n\ -TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.)); \n\ -TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.)); \n\ -TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3); \n\ -axe = gp_Ax1(gp_Pnt(0.,0.,30.),gp_Dir(0.,1.,0.)); \n\ -TopoDS_Shape S3 = BRepPrimAPI_MakeRevol(W,axe, 210.*PI180); \n\ -\n\ ---- Revol of a face -> result is a solid --- \n\ -\n\ -gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.),gp_Dir(0.,0.,1.)), 80.); \n\ -TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c); \n\ -TopoDS_Wire Wc = BRepBuilderPI_MakeWire(Ec); \n\ -TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::XOY()),Wc); \n\ -axe = gp_Ax1(gp_Pnt(290,290.,0.),gp_Dir(0.,1,0.)); \n\ -TopoDS_Shape S4 = BRepPrimAPI_MakeRevol(F,axe, 90.*PI180); \n\ - \n"); - PocessTextInDialog("Make a revol", Message); -} - -void CModelingDoc::OnPipe() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TColgp_Array1OfPnt CurvePoles(1,4); - gp_Pnt pt = gp_Pnt(0.,0.,0.); - CurvePoles(1) = pt; - pt = gp_Pnt(20.,50.,0.); - CurvePoles(2) = pt; - pt = gp_Pnt(60.,100.,0.); - CurvePoles(3) = pt; - pt = gp_Pnt(150.,0.,0.); - CurvePoles(4) = pt; - Handle(Geom_BezierCurve) curve = new Geom_BezierCurve(CurvePoles); - TopoDS_Edge E = BRepBuilderAPI_MakeEdge(curve); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E); - Handle(AIS_Shape) ais1 = new AIS_Shape(W); - myAISContext->Display(ais1,Standard_False); - Fit(); - Sleep(500); - gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(0.,0.,0.),gp_Dir(0.,1.,0.)),10.); - TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c); - TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec); - Handle(AIS_Shape) ais3 = new AIS_Shape(Wc); - myAISContext->Display(ais3,Standard_False); - TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::ZOX()),Wc); - TopoDS_Shape S = BRepOffsetAPI_MakePipe(W,F); - Handle(AIS_Shape) ais2 = new AIS_Shape(S); - myAISContext->SetColor(ais2,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TColgp_Array1OfPnt CurvePoles(1,6);\n\ -gp_Pnt pt = gp_Pnt(0.,0.,0.);\n\ -CurvePoles(1) = pt;\n\ -pt = gp_Pnt(20.,50.,0.);\n\ -CurvePoles(2) = pt;\n\ -pt = gp_Pnt(60.,100.,0.);\n\ -CurvePoles(3) = pt;\n\ -pt = gp_Pnt(150.,0.,0.);\n\ -CurvePoles(4) = pt;\n\ -Handle(Geom_BezierCurve) curve = new Geom_BezierCurve(CurvePoles);\n\ -TopoDS_Edge E = BRepBuilderAPI_MakeEdge(curve);\n\ -TopoDS_Wire W = BRepBuilderAPI_MakeWire(E);\n\ -gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(0.,0.,0.),gp_Dir(0.,1.,0.)),10.);\n\ -TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c);\n\ -TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec);\n\ -TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::ZOX()),Wc);\n\ -TopoDS_Shape S = BRepBuilderAPI_MakePipe(W,F);\n\ - \n"); - PocessTextInDialog("Make a pipe", Message); - -} - -void CModelingDoc::OnThru() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - gp_Circ c1 = gp_Circ(gp_Ax2(gp_Pnt(-100.,0.,-100.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(c1); - TopoDS_Wire W1 = BRepBuilderAPI_MakeWire(E1); - Handle(AIS_Shape) sec1 = new AIS_Shape(W1); - myAISContext->Display(sec1,Standard_False); - gp_Circ c2 = gp_Circ(gp_Ax2(gp_Pnt(-10.,0.,-0.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(c2); - TopoDS_Wire W2 = BRepBuilderAPI_MakeWire(E2); - Handle(AIS_Shape) sec2 = new AIS_Shape(W2); - myAISContext->Display(sec2,Standard_False); - gp_Circ c3 = gp_Circ(gp_Ax2(gp_Pnt(-75.,0.,100.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(c3); - TopoDS_Wire W3 = BRepBuilderAPI_MakeWire(E3); - Handle(AIS_Shape) sec3 = new AIS_Shape(W3); - myAISContext->Display(sec3,Standard_False); - gp_Circ c4= gp_Circ(gp_Ax2(gp_Pnt(0.,0.,200.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(c4); - TopoDS_Wire W4 = BRepBuilderAPI_MakeWire(E4); - Handle(AIS_Shape) sec4 = new AIS_Shape(W4); - myAISContext->Display(sec4,Standard_False); - BRepOffsetAPI_ThruSections generator(Standard_False,Standard_True); - generator.AddWire(W1); - generator.AddWire(W2); - generator.AddWire(W3); - generator.AddWire(W4); - generator.Build(); - TopoDS_Shape S1 = generator.Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S1); - myAISContext->SetColor(ais1,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - - gp_Circ c1b = gp_Circ(gp_Ax2(gp_Pnt(100.,0.,-100.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E1b = BRepBuilderAPI_MakeEdge(c1b); - TopoDS_Wire W1b = BRepBuilderAPI_MakeWire(E1b); - Handle(AIS_Shape) sec1b = new AIS_Shape(W1b); - myAISContext->Display(sec1b,Standard_False); - gp_Circ c2b = gp_Circ(gp_Ax2(gp_Pnt(210.,0.,-0.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E2b = BRepBuilderAPI_MakeEdge(c2b); - TopoDS_Wire W2b = BRepBuilderAPI_MakeWire(E2b); - Handle(AIS_Shape) sec2b = new AIS_Shape(W2b); - myAISContext->Display(sec2b,Standard_False); - gp_Circ c3b = gp_Circ(gp_Ax2(gp_Pnt(275.,0.,100.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E3b = BRepBuilderAPI_MakeEdge(c3b); - TopoDS_Wire W3b = BRepBuilderAPI_MakeWire(E3b); - Handle(AIS_Shape) sec3b = new AIS_Shape(W3b); - myAISContext->Display(sec3b,Standard_False); - gp_Circ c4b= gp_Circ(gp_Ax2(gp_Pnt(200.,0.,200.),gp_Dir(0.,0.,1.)),40.); - TopoDS_Edge E4b = BRepBuilderAPI_MakeEdge(c4b); - TopoDS_Wire W4b = BRepBuilderAPI_MakeWire(E4b); - Handle(AIS_Shape) sec4b = new AIS_Shape(W4b); - myAISContext->Display(sec4b,Standard_False); - BRepOffsetAPI_ThruSections generatorb(Standard_True,Standard_False); - generatorb.AddWire(W1b); - generatorb.AddWire(W2b); - generatorb.AddWire(W3b); - generatorb.AddWire(W4b); - generatorb.Build(); - TopoDS_Shape S2 = generatorb.Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - myAISContext->SetColor(ais2,Quantity_NOC_ALICEBLUE,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ----------- ruled -------------- \n\ -\n\ -gp_Circ c1 = gp_Circ(gp_Ax2(gp_Pnt(-100.,0.,-100.),gp_Dir(0.,0.,1.)),40.);\n\ -TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(c1);\n\ -TopoDS_Wire W1 = BRepBuilderAPI_MakeWire(E1);\n\ -gp_Circ c2 = gp_Circ(gp_Ax2(gp_Pnt(-10.,0.,-0.),gp_Dir(0.,0.,1.)),40.);\n\ -TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(c2);\n\ -TopoDS_Wire W2 = BRepBuilderAPI_MakeWire(E2);\n\ -gp_Circ c3 = gp_Circ(gp_Ax2(gp_Pnt(-75.,0.,100.),gp_Dir(0.,0.,1.)),40.);\n\ -TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(c3);\n\ -TopoDS_Wire W3 = BRepBuilderAPI_MakeWire(E3);\n\ -gp_Circ c4= gp_Circ(gp_Ax2(gp_Pnt(0.,0.,200.),gp_Dir(0.,0.,1.)),40.);\n\ -TopoDS_Edge E4 = BRep>BuilderAPI_MakeEdge(c4);\n\ -TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(c4);\n\ -TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(c4);\n\ -TopoDS_Wire W4 = BRepBuilderAPI_MakeWire(E4);\n\ -BRepOffsetAPI_ThruSections generator(Standard_False,Standard_True);\n\ -generator.AddWire(W1);\n\ -generator.AddWire(W2);\n\ -generator.AddWire(W3);\n\ -generator.AddWire(W4);\n\ -generator.Build();\n\ -TopoDS_Shape S1 = generator.Shape();\n\ -\n\ ----------- smooth -------------- \n\ -\n\ -gp_Circ c1b = gp_Circ(gp_Ax2(gp_Pnt(100.,0.,-100.),gp_Dir(0.,0.,1.)),40.); \n\ -TopoDS_Edge E1b = BRepBuilderAPI_MakeEdge(c1b); \n\ -TopoDS_Wire W1b = BRepBuilderAPI_MakeWire(E1b); \n\ -gp_Circ c2b = gp_Circ(gp_Ax2(gp_Pnt(210.,0.,-0.),gp_Dir(0.,0.,1.)),40.); \n\ -TopoDS_Edge E2b = BRepBuilderAPI_MakeEdge(c2b);\n\ -TopoDS_Wire W2b = BRepBuilderAPI_MakeWire(E2b); \n\ -gp_Circ c3b = gp_Circ(gp_Ax2(gp_Pnt(275.,0.,100.),gp_Dir(0.,0.,1.)),40.);\n\ -TopoDS_Edge E3b = BRepBuilderAPI_MakeEdge(c3b);\n\ -TopoDS_Wire W3b = BRepBuilderAPI_MakeWire(E3b);\n\ -gp_Circ c4b= gp_Circ(gp_Ax2(gp_Pnt(200.,0.,200.),gp_Dir(0.,0.,1.)),40.);\n\ -TopoDS_Edge E4b = BRepBuilderAPI_MakeEdge(c4b);\n\ -TopoDS_Wire W4b = BRepBuilderAPI_MakeWire(E4b);\n\ -BRepOffsetAPI_ThruSections generatorb(Standard_True,Standard_False);\n\ -generatorb.AddWire(W1b);\n\ -generatorb.AddWire(W2b);\n\ -generatorb.AddWire(W3b);\n\ -generatorb.AddWire(W4b);\n\ -generatorb.Build();\n\ -TopoDS_Shape S2 = generatorb.Shape();\n\ - \n"); - PocessTextInDialog("Make a Thru sections", Message); - -} - -void CModelingDoc::OnEvolved() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - BRepBuilderAPI_MakePolygon P; - P.Add(gp_Pnt(0.,0.,0.)); - P.Add(gp_Pnt(200.,0.,0.)); - P.Add(gp_Pnt(200.,200.,0.)); - P.Add(gp_Pnt(0.,200.,0.)); - P.Add(gp_Pnt(0.,0.,0.)); - TopoDS_Wire W = P.Wire(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(W); - myAISContext->Display(ais1,Standard_False); - - TopoDS_Wire wprof = BRepBuilderAPI_MakePolygon(gp_Pnt(0.,0.,0.),gp_Pnt(-60.,-60.,-200.)); - - Handle(AIS_Shape) ais3 = new AIS_Shape(wprof); - myAISContext->Display(ais3,Standard_False); - Fit(); - Sleep(500); - TopoDS_Shape S = BRepOffsetAPI_MakeEvolved(W,wprof,GeomAbs_Arc,Standard_True,Standard_False,Standard_True,0.0001); - - Handle(AIS_Shape) ais2 = new AIS_Shape(S); - myAISContext->SetColor(ais2,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ----------- Evolved shape -------------- \n\ -\n\ -BRepBuilderAPI_MakePolygon P;\n\ -P.Add(gp_Pnt(0.,0.,0.));\n\ -P.Add(gp_Pnt(200.,0.,0.));\n\ -P.Add(gp_Pnt(200.,200.,0.));\n\ -P.Add(gp_Pnt(0.,200.,0.));\n\ -P.Add(gp_Pnt(0.,0.,0.));\n\ -TopoDS_Wire W = P.Wire();\n\ -TopoDS_Wire wprof = BRepBuilderAPI_MakePolygon(gp_Pnt(0.,0.,0.),gp_Pnt(-60.,-60.,-200.));\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeEvolved(W,wprof,GeomAbs_Arc,Standard_True,Standard_False,Standard_True,0.0001);\n\ - \n"); - PocessTextInDialog("Make an evolved shape", Message); - -} - -void CModelingDoc::OnDraft() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S = BRepPrimAPI_MakeBox(200., 300., 150.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - Fit(); - Sleep(500); - BRepOffsetAPI_DraftAngle adraft(S); - TopExp_Explorer Ex; - for (Ex.Init(S,TopAbs_FACE); Ex.More(); Ex.Next()) { - TopoDS_Face F = TopoDS::Face(Ex.Current()); - Handle(Geom_Plane) surf = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(F)); - gp_Pln apln = surf->Pln(); - gp_Dir dirF = apln.Axis().Direction(); - if (dirF.IsNormal(gp_Dir(0.,0.,1.),Precision::Angular())) - adraft.Add(F, gp_Dir(0.,0.,1.), 15.*M_PI/180, gp_Pln(gp::XOY())); - } - ais1->Set(adraft.Shape()); - myAISContext->Redisplay(ais1,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ----------- Tapered shape -------------- \n\ -\n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(200.,300.,150.);\n\ -BRepOffsetAPI_DraftAngle adraft(S);\n\ -TopExp_Explorer Ex;\n\ -for (Ex.Init(S,TopAbs_FACE); Ex.More(); Ex.Next()) {\n\ - TopoDS_Face F = TopoDS::Face(Ex.Current());\n\ - Handle(Geom_Plane) surf = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(F));\n\ - gp_Pln apln = surf->Pln();\n\ - gp_Dir dirF = apln.Axis().Direction();\n\ - if (dirF.IsNormal(gp_Dir(0.,0.,1.),Precision::Angular()))\n\ - adraft.Add(F, gp_Dir(0.,0.,1.), 15.*PI180, gp_Pln(gp::XOY()));\n\ -}\n\ - \n"); - PocessTextInDialog("Make a tapered shape", Message); - -} - -/* ================================================================================= - ==================== O P E R A T I O N S ==================================== - ================================================================================= */ - -void CModelingDoc::OnCut() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200, 60, 60).Shape(); - -Handle (AIS_Shape) ais1 = new AIS_Shape(theBox); -myAISContext->SetDisplayMode(ais1,1,Standard_False); -myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); -myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais1,Standard_False); -const Handle(AIS_InteractiveObject)& anIO1 = ais1; -myAISContext->SetSelected (anIO1, Standard_False); -Fit(); -Sleep(1000); - - -TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100, 20, 20), 80).Shape(); -Handle (AIS_Shape) ais2 = new AIS_Shape(theSphere); -myAISContext->SetDisplayMode(ais2,1,Standard_False); -myAISContext->SetColor(ais2,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais2,Standard_False); -const Handle(AIS_InteractiveObject)& anIO2 = ais2; -myAISContext->SetSelected (anIO2, Standard_False); -Fit(); -Sleep(1000); - -TopoDS_Shape ShapeCut = BRepAlgoAPI_Cut(theSphere,theBox); - -myAISContext->Erase(ais1,Standard_False); -myAISContext->Erase(ais2,Standard_False); - -Handle (AIS_Shape) aSection = new AIS_Shape(ShapeCut); -myAISContext->SetDisplayMode(aSection,1,Standard_False); -myAISContext->SetColor(aSection,Quantity_NOC_RED,Standard_False); -myAISContext->SetMaterial(aSection,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(aSection,Standard_False); -const Handle(AIS_InteractiveObject)& anIOSection = aSection; -myAISContext->SetSelected (anIOSection, Standard_False); -Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,40,40); \n\ - \n\ -TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100,20,20),80); \n\ - \n\ -TopoDS_Shape ShapeCut = BRepAlgoAPI_Cut(theSphere,theBox); \n\ - \n"); - PocessTextInDialog("Cut the sphere with a box", Message); - - -} - - - - - - - - - - -void CModelingDoc::OnFuse() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - -gp_Pnt P(-5,5,-5); -TopoDS_Shape theBox1 = BRepPrimAPI_MakeBox(60, 200, 70).Shape(); -Handle (AIS_Shape) ais1 = new AIS_Shape(theBox1); -myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); -myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais1,Standard_False); -const Handle(AIS_InteractiveObject)& anIO1 = ais1; -myAISContext->SetSelected (anIO1, Standard_False); -Fit(); -Sleep(1000); - -TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(P, 20, 150, 110).Shape(); -Handle (AIS_Shape) ais2 = new AIS_Shape(theBox2); -myAISContext->SetColor(ais2,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais2,Standard_False); -const Handle(AIS_InteractiveObject)& anIO2 = ais2; -myAISContext->SetSelected (anIO2, Standard_False); -Fit(); -Sleep(1000); - -TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2); - -myAISContext->Erase(ais1,false); -myAISContext->Erase(ais2,false); - -Handle (AIS_Shape) aFusion = new AIS_Shape(FusedShape); -myAISContext->SetDisplayMode(aFusion,1,Standard_False); -myAISContext->SetColor(aFusion,Quantity_NOC_RED,Standard_False); -myAISContext->SetMaterial(aFusion,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(aFusion,Standard_False); -const Handle(AIS_InteractiveObject)& anIOFusion = aFusion; -myAISContext->SetSelected (anIOFusion, Standard_False); -myAISContext->UpdateCurrentViewer(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape theBox1 = BRepPrimAPI_MakeBox(50,200,70); \n\ - \n\ -TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(-30,150,70); \n\ - \n\ -TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2); \n"); - PocessTextInDialog("Fuse the boxes", Message); - -} - -void CModelingDoc::OnCommon() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - -gp_Ax2 axe(gp_Pnt(10,10,10),gp_Dir(1,2,1)); -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(axe, 60, 80, 100).Shape(); - -Handle(AIS_Shape) aboxshape=new AIS_Shape(theBox); -myAISContext->SetColor(aboxshape,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(aboxshape,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->SetTransparency(aboxshape,0.2,Standard_False); -myAISContext->Display(aboxshape, AIS_Shaded, 0, Standard_False); -const Handle(AIS_InteractiveObject)& anIOBoxShape = aboxshape; -myAISContext->SetSelected (anIOBoxShape, Standard_False); -Fit(); -Sleep(500); - -TopoDS_Shape theWedge = BRepPrimAPI_MakeWedge(60., 100., 80., 20.).Shape(); - -Handle(AIS_Shape) awedge = new AIS_Shape(theWedge); -myAISContext->SetColor(awedge,Quantity_NOC_RED,Standard_False); -myAISContext->SetMaterial(awedge,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->SetTransparency(awedge,0.0,Standard_False); -myAISContext->Display(awedge,Standard_False); -const Handle(AIS_InteractiveObject)& anIOWedge = awedge; -myAISContext->SetSelected (anIOWedge, Standard_False); -myAISContext->UpdateCurrentViewer(); -Sleep(500); - -TopoDS_Shape theCommonSurface = BRepAlgoAPI_Common(theBox,theWedge); - -myAISContext->Erase(aboxshape, false); -myAISContext->Erase(awedge, false); - -Handle(AIS_Shape) acommon = new AIS_Shape(theCommonSurface); -myAISContext->SetColor(acommon,Quantity_NOC_GREEN,Standard_False); -myAISContext->SetMaterial(acommon,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display (acommon, AIS_Shaded, 0,Standard_False); -const Handle(AIS_InteractiveObject)& anIOCommon = acommon; -myAISContext->SetSelected (anIOCommon, Standard_False); -myAISContext->UpdateCurrentViewer(); - - TCollection_AsciiString Message ("\ - \n\ -gp_Ax2 axe(gp_Pnt(10,10,10),gp_Dir(1,2,1)); \n\ - \n\ -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(axe,60,80,100); \n\ - \n\ -TopoDS_Shape theWedge = BRepPrimAPI_MakeWedge(60.,100.,80.,20.); \n\ - \n\ -TopoDS_Shape theCommonSurface = BRepAlgoAPI_Common(theBox,theWedge); \n\ - \n"); - - PocessTextInDialog("Compute the common surface ", Message); - -} - -void CModelingDoc::OnSection() -{ - - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape atorus = BRepPrimAPI_MakeTorus(120, 20).Shape(); - - Handle(AIS_Shape) ashape=new AIS_Shape(atorus); - myAISContext->SetColor(ashape,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(ashape,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetDisplayMode(ashape,1,Standard_False); - myAISContext->SetTransparency(ashape,0.1,Standard_False); - myAISContext->Display(ashape,Standard_False); - -gp_Vec V1(1,1,1); -Standard_Real radius = 120; -Standard_Integer i=-3; - -for(i;i<=3;i++) { - TopoDS_Shape asphere = BRepPrimAPI_MakeSphere(gp_Pnt(26 * 3 * i, 0, 0), radius).Shape(); - - Handle (AIS_Shape) theShape=new AIS_Shape (asphere); - myAISContext->SetTransparency(theShape,0.1,Standard_False); - myAISContext->SetColor(theShape,Quantity_NOC_WHITE,Standard_False); - myAISContext->SetDisplayMode(theShape,1,Standard_False); - myAISContext->Display(theShape,Standard_False); - Fit(); - - Standard_Boolean PerformNow=Standard_False; - - BRepAlgoAPI_Section section(atorus,asphere,PerformNow); - section.ComputePCurveOn1(Standard_True); - section.Approximation(TopOpeBRepTool_APPROX); - section.Build(); - - Handle(AIS_Shape) asection=new AIS_Shape(section.Shape()); - myAISContext->SetDisplayMode (asection, 0, Standard_False); - myAISContext->SetColor (asection, Quantity_NOC_WHITE, Standard_False); - myAISContext->Display (asection, Standard_False); - if(i<3) { - myAISContext->Remove (theShape, Standard_False); - } -} - myAISContext->UpdateCurrentViewer(); - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape atorus = BRepPrimAPI_MakeTorus(120,20); \n\ -gp_Vec V1(1,1,1); \n\ -Standard_Real radius = 120; \n\ -Standard_Integer i=-3; \n\ -for(i;i<=3;i++) { \n\ - TopoDS_Shape asphere = BRepPrimAPI_MakeSphere(gp_Pnt(78*i,0,0),radius); \n\ - Standard_Boolean PerformNow=Standard_False; \n\ - BRepAlgoAPI_Section section(atorus,asphere,PerformNow); \n\ - section.ComputePCurveOn1(Standard_True); \n\ - section.Approximation(TopOpeBRepTool_APPROX); \n\ - section.Build(); \n\ - \n"); - - PocessTextInDialog("Compute the sections ", Message); - -} - -void CModelingDoc::OnPsection() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - -TopoDS_Shape theTorus = BRepPrimAPI_MakeTorus(35, 8).Shape(); -Handle(AIS_Shape) atorus = new AIS_Shape(theTorus); -myAISContext->SetColor(atorus,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(atorus,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->SetTransparency(atorus,0.1,Standard_False); -myAISContext->Display(atorus,Standard_False); -const Handle(AIS_InteractiveObject)& anIOTorus = atorus; -myAISContext->SetSelected (anIOTorus, Standard_False); -Fit(); -Sleep(500); - -gp_Pln aplane(1,0.25,3,4); -Handle (Geom_Plane) thePlane = new Geom_Plane(aplane); -Handle (AIS_Plane) ais1 = new AIS_Plane(thePlane); -myAISContext->Display(ais1,Standard_False); -const Handle(AIS_InteractiveObject)& anIO1 = ais1; -myAISContext->SetSelected (anIO1, Standard_False); -Fit(); -Sleep(300); - -BRepAlgoAPI_Section section(theTorus,thePlane,Standard_False); -section.ComputePCurveOn1(Standard_True); -section.Approximation(TopOpeBRepTool_APPROX); -section.Build(); - -Handle(AIS_Shape) asection=new AIS_Shape(section.Shape()); -myAISContext->SetDisplayMode(asection ,0,Standard_False); -myAISContext->SetColor(asection,Quantity_NOC_WHITE,Standard_False); -myAISContext->Display(asection,Standard_False); -Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape theTorus = BRepPrimAPI_MakeTorus(60.,20.); \n\ - \n\ -gp_Pln P(1,2,1,-15); \n\ - \n\ -TopoDS_Shape Psection = BRepAlgoAPI_Section(theTorus,P); \n\ -\n"); - - PocessTextInDialog("Compute the plane section ", Message); - -} - -void CModelingDoc::OnBlend() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - -TopoDS_Shape Box = BRepPrimAPI_MakeBox(gp_Pnt(-400,0,0),200,230,180).Shape(); -Handle(AIS_Shape) ais1 = new AIS_Shape(Box); -myAISContext->SetColor(ais1,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais1,Standard_False); -const Handle(AIS_InteractiveObject)& anIO1 = ais1; -myAISContext->SetSelected (anIO1, Standard_False); -Fit(); -Sleep(500); - -BRepFilletAPI_MakeFillet fillet(Box); - -for (TopExp_Explorer ex(Box,TopAbs_EDGE); ex.More(); ex.Next()) { - TopoDS_Edge Edge =TopoDS::Edge(ex.Current()); - fillet.Add(20,Edge); -} - -myAISContext->Remove(ais1,Standard_False); - -TopoDS_Shape blendedBox = fillet.Shape(); -Handle(AIS_Shape) aBlendbox = new AIS_Shape(blendedBox); -myAISContext->SetColor(aBlendbox,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(aBlendbox,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(aBlendbox,Standard_False); -const Handle(AIS_InteractiveObject)& anIOBlendBox = aBlendbox; -myAISContext->SetSelected (anIOBlendBox, Standard_False); -Fit(); -Sleep(500); - - -gp_Pnt P1(250,150,75); -TopoDS_Shape S1 = BRepPrimAPI_MakeBox(300, 200, 200).Shape(); -TopoDS_Shape S2 = BRepPrimAPI_MakeBox(P1, 120, 180, 70).Shape(); - -TopoDS_Shape fusedShape = BRepAlgoAPI_Fuse(S1,S2); -Handle(AIS_Shape) ais2 = new AIS_Shape(fusedShape); -myAISContext->SetColor(ais2,Quantity_NOC_RED,Standard_False); -myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais2,Standard_False); -const Handle(AIS_InteractiveObject)& anIO2 = ais2; -myAISContext->SetSelected (anIO2, Standard_False); -Fit(); - -BRepFilletAPI_MakeFillet fill(fusedShape); - -for (TopExp_Explorer ex1(fusedShape,TopAbs_EDGE); ex1.More(); ex1.Next()) { - TopoDS_Edge E =TopoDS::Edge(ex1.Current()); - fill.Add(E); -} - -for (Standard_Integer i = 1;i<=fill.NbContours();i++) { - Standard_Real longueur(fill.Length(i)); - Standard_Real Rad(0.15*longueur); - fill.SetRadius(Rad,i, 1); -} - -TopoDS_Shape blendedFusedSolids = fill.Shape(); - -Handle(AIS_Shape) aBlend = new AIS_Shape(blendedFusedSolids); -myAISContext->SetColor(aBlend,Quantity_NOC_RED,Standard_False); -myAISContext->SetMaterial(aBlend,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(aBlend,Standard_False); - -myAISContext->Remove(ais2,Standard_False); -Fit(); - - - TCollection_AsciiString Message ("\ - \n\ -//THE YELLOW BOX\n\ -TopoDS_Shape Box = BRepPrimAPI_MakeBox(gp_Pnt(-400,0,0),200,230,180);\n\ -\n\ -BRepPrimAPI_MakeFillet fillet(Box);\n\ -\n\ -for (TopExp_Explorer ex(Box,TopAbs_EDGE); ex.More(); ex.Next()) {\n\ - TopoDS_Edge Edge =TopoDS::Edge(ex.Current());\n\ - fillet.Add(20,Edge);\n\ -}\n\ -TopoDS_Shape blendedBox = fillet.Shape();\n\ -\n\ -////////////////////////////////////////////////////////////////////////\n\ -\n\ -//THE RED SOLID\n\ - \n\ -//Warning : On the acute angles of the boxes a fillet is created. \n\ -On the angles of fusion a blend is created. \n\ -\n\ -gp_Pnt P1(150,150,75);\n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeBox(300,200,200);\n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeBox(P1,100,200,70);\n\ -\n\ -TopoDS_Shape fusedShape = BRepAlgoAPI_Fuse(S1,S2);\n\ -BRepPrimAPI_MakeFillet fill(fusedShape);\n\ -\n\ -for (TopExp_Explorer ex1(fusedShape,TopAbs_EDGE); ex1.More(); ex1.Next()) {\n\ - TopoDS_Edge E =TopoDS::Edge(ex1.Current());\n\ - fill.Add(E);\n\ -}\n\ -\n\ -for (Standard_Integer i = 1;i<=fill.NbContours();i++) {\n\ - Standard_Real longueur(fill.Length(i));\n\ - Standard_Real Rad(0.2*longueur);\n\ - fill.SetRadius(Rad,i);\n\ -}\n\ -\n\ -TopoDS_Shape blendedFusedSolids = fill.Shape(); \n"); - - PocessTextInDialog("Compute the blend on the edges ", Message); -} - -void CModelingDoc::OnEvolvedblend() -{ - - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200, 200, 200).Shape(); -Handle(AIS_Shape) ais1 = new AIS_Shape(theBox); -myAISContext->SetColor(ais1,Quantity_NOC_BROWN,Standard_False); -myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais1,Standard_False); -const Handle(AIS_InteractiveObject)& anIO1 = ais1; -myAISContext->SetSelected (anIO1, Standard_False); -Fit(); -Sleep(500); - -BRepFilletAPI_MakeFillet Rake(theBox); - -TopExp_Explorer ex(theBox,TopAbs_EDGE); -ex.Next(); -ex.Next(); -ex.Next(); -ex.Next(); -Rake.Add(8,50,TopoDS::Edge(ex.Current())); -Rake.Build(); -if (Rake.IsDone() ){ - TopoDS_Shape evolvedBox = Rake.Shape(); - ais1->Set(evolvedBox); - myAISContext->Redisplay(ais1,Standard_False); - myAISContext->SetSelected(anIO1, Standard_False); - Fit(); - Sleep(500); - -} - -TopoDS_Shape theCylinder = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-300, 0, 0), gp::DZ()), 100, 200).Shape(); -Handle(AIS_Shape) ais3 = new AIS_Shape(theCylinder); -myAISContext->SetColor(ais3,Quantity_NOC_GREEN,Standard_False); -myAISContext->SetMaterial(ais3,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais3,Standard_False); -const Handle(AIS_InteractiveObject)& anIO3 = ais3; -myAISContext->SetSelected (anIO3, Standard_False); -Fit(); -Sleep(500); - -BRepFilletAPI_MakeFillet fillet(theCylinder); - -TColgp_Array1OfPnt2d TabPoint2(1,20); - -for (Standard_Integer i=0; i<=19; i++) { - gp_Pnt2d Point2d(i*2*M_PI/19,60*cos(i*M_PI/19-M_PI/2)+10); - TabPoint2.SetValue(i+1,Point2d); -} - -TopExp_Explorer exp2(theCylinder,TopAbs_EDGE); -fillet.Add(TabPoint2,TopoDS::Edge(exp2.Current())); -fillet.Build(); -if (fillet.IsDone() ){ - TopoDS_Shape LawEvolvedCylinder = fillet.Shape(); - ais3->Set(LawEvolvedCylinder); - myAISContext->Redisplay(ais3,Standard_False); - myAISContext->SetSelected(anIO3,Standard_False); - Fit(); - Sleep(500); -} - -gp_Pnt P(350,0,0); -TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(P, 200, 200, 200).Shape(); -Handle(AIS_Shape) ais2 = new AIS_Shape(theBox2); -myAISContext->SetColor(ais2,Quantity_NOC_RED,Standard_False); -myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais2,Standard_False); -const Handle(AIS_InteractiveObject)& anIO2 = ais2; -myAISContext->SetSelected (anIO2, Standard_False); -Fit(); -Sleep(500); - - -BRepFilletAPI_MakeFillet afillet(theBox2); - -TColgp_Array1OfPnt2d TabPoint(1,6); - -gp_Pnt2d P1(0.,8.); -gp_Pnt2d P2(0.2,16.); -gp_Pnt2d P3(0.4,25.); -gp_Pnt2d P4(0.6,55.); -gp_Pnt2d P5(0.8,28.); -gp_Pnt2d P6(1.,20.); -TabPoint.SetValue(1,P1); -TabPoint.SetValue(2,P2); -TabPoint.SetValue(3,P3); -TabPoint.SetValue(4,P4); -TabPoint.SetValue(5,P5); -TabPoint.SetValue(6,P6); - -TopExp_Explorer exp(theBox2,TopAbs_EDGE); -exp.Next(); -exp.Next(); -exp.Next(); -exp.Next(); - -afillet.Add(TabPoint, TopoDS::Edge(exp.Current())); - -afillet.Build(); -if (afillet.IsDone() ){ - TopoDS_Shape LawevolvedBox = afillet.Shape(); - ais2->Set(LawevolvedBox); - myAISContext->Redisplay(ais2,Standard_False); - myAISContext->SetSelected(anIO2,Standard_False); - Fit(); - -} - - TCollection_AsciiString Message ("\ - \n\ -//THE BROWN BOX \n\ -\n\ -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,200,200); \n\ - \n\ -BRepPrimAPI_MakeFillet Rake(theBox); \n\ -ChFi3d_FilletShape FSh = ChFi3d_Rational; \n\ -Rake.SetFilletShape(FSh); \n\ - \n\ -TopExp_Explorer ex(theBox,TopAbs_EDGE); \n\ -ex.Next(); //in order to recover the front edge \n\ -ex.Next(); \n\ -ex.Next(); \n\ -ex.Next(); \n\ -Rake.Add(8,50,TopoDS::Edge(ex.Current())); \n\ - \n\ -Rake.Build(); \n\ -if (Rake.IsDone() ) \n\ - TopoDS_Shape theBrownBox = Rake.Shape(); \n\ - \n\ -////////////////////////////////////////////////////////// \n\ - \n\ -//THE GREEN CYLINDER \n\ - \n\ -TopoDS_Shape theCylinder = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-300,0,0),gp_Dir(0,0,1)),100,200); \n\ - \n\ -BRepPrimAPI_MakeFillet fillet(theCylinder); \n\ - \n\ -TColgp_Array1OfPnt2d TabPoint2(1,20); \n\ - \n\ -for (Standard_Integer i=0; i<=19; i++) { \n\ - gp_Pnt2d Point2d(i*2*PI/19,60*cos(i*PI/19-PI/2)+10); \n\ - TabPoint2.SetValue(i+1,Point2d); \n\ -} \n\ - \n\ -TopExp_Explorer exp2(theCylinder,TopAbs_EDGE); \n\ -fillet.Add(TabPoint2,TopoDS::Edge(exp2.Current())); \n\ - \n\ -fillet.Build(); \n\ -if (fillet.IsDone() ) \n\ - TopoDS_Shape LawEvolvedCylinder = fillet.Shape(); \n\ - \n\ -//////////////////////////////////////////////////////////// \n\ - \n\ - //THE RED BOX \n\ - \n\ -gp_Pnt P(350,0,0); \n\ -TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(P,200,200,200); \n\ - \n\ -BRepPrimAPI_MakeFillet fill(theBox2); \n\ - \n\ -TColgp_Array1OfPnt2d TabPoint(1,6); \n\ -gp_Pnt2d P1(0,8); \n\ -gp_Pnt2d P2(0.2,16); \n\ -gp_Pnt2d P3(0.4,25); \n\ -gp_Pnt2d P4(0.6,55); \n\ -gp_Pnt2d P5(0.8,28); \n\ -gp_Pnt2d P6(1,20); \n\ -TabPoint.SetValue(1,P1); \n\ -TabPoint.SetValue(2,P2); \n\ -TabPoint.SetValue(3,P3); \n\ -TabPoint.SetValue(4,P4); \n\ -TabPoint.SetValue(5,P5); \n\ -TabPoint.SetValue(6,P6); \n\ - \n\ -TopExp_Explorer exp(theBox2,TopAbs_EDGE); \n\ -exp.Next(); //in order to trcover the front edge \n\ -exp.Next(); \n\ -exp.Next(); \n\ -exp.Next(); \n\ -fill.Add(TabPoint,TopoDS::Edge(exp.Current())); \n\ - \n\ -fill.Build(); \n\ -if (fillet.IsDone() ) \n\ - TopoDS_Shape theRedBox = fill.Shape(); \n\ -\n"); - - PocessTextInDialog("Compute evolutiv blend on an edge ", Message); - -} - -void CModelingDoc::OnChamf() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(60,200,70).Shape(); -Handle(AIS_Shape) ais1 = new AIS_Shape(theBox); -myAISContext->SetColor(ais1,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(ais1,Standard_False); -const Handle(AIS_InteractiveObject)& anIO1 = ais1; -myAISContext->SetSelected (anIO1, Standard_False); -Fit(); -Sleep(500); - -BRepFilletAPI_MakeChamfer MC(theBox); -// add all the edges to chamfer -TopTools_IndexedDataMapOfShapeListOfShape M; -TopExp::MapShapesAndAncestors(theBox,TopAbs_EDGE,TopAbs_FACE,M); -for (Standard_Integer i = 1;i<=M.Extent();i++) { - TopoDS_Edge E = TopoDS::Edge(M.FindKey(i)); - TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First()); - MC.Add(5,5,E,F); - } - -TopoDS_Shape ChanfrenedBox = MC.Shape(); -Handle(AIS_Shape) aBlendedBox = new AIS_Shape(ChanfrenedBox); -myAISContext->SetColor(aBlendedBox,Quantity_NOC_YELLOW,Standard_False); -myAISContext->SetMaterial(aBlendedBox,Graphic3d_NOM_PLASTIC,Standard_False); -myAISContext->Display(aBlendedBox,Standard_False); -const Handle(AIS_InteractiveObject)& anIOBlendedBox = aBlendedBox; -myAISContext->SetSelected (anIOBlendedBox, Standard_False); -Fit(); -Sleep(500); - -myAISContext->Erase(ais1,Standard_True); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape theBox = BRepPrimAPI_MakeBox(130,200,170); \n\ -BRepFilletAPI_MakeChamfer MC(theBox); \n\ -TopTools_IndexedDataMapOfShapeListOfShape M; \n\ -TopExp::MapShapesAndAncestors(theBox,TopAbs_EDGE,TopAbs_FACE,M); \n\ -for (Standar1d_Integer i;iDisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeBox(400., 250., 300.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(500); - - TopExp_Explorer Ex; - Ex.Init(S,TopAbs_FACE); - Ex.Next(); - TopoDS_Face F = TopoDS::Face(Ex.Current()); - Handle(Geom_Surface) surf = BRep_Tool::Surface(F); - Handle(Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(surf); - gp_Dir D = Pl->Pln().Axis().Direction(); -// new in 2.0 ..use the trigonometric orientation to make the extrusion. - D.Reverse(); - gp_Pnt2d p1,p2; - Handle(Geom2d_Curve) aline; - BRepBuilderAPI_MakeWire MW; - p1 = gp_Pnt2d(200.,-100.); - p2 = gp_Pnt2d(100.,-100.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(100.,-200.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(200.,-200.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(200.,-100.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - BRepBuilderAPI_MakeFace MKF; - MKF.Init(surf,Standard_False, Precision::Confusion()); - MKF.Add(MW.Wire()); - TopoDS_Shape FP = MKF.Face(); - BRepLib::BuildCurves3d(FP); - BRepFeat_MakePrism MKP(S,FP,F,D,0,Standard_True); - MKP.Perform(200.); - TopoDS_Shape res1 = MKP.Shape(); - ais1->Set(res1); - - myAISContext->Redisplay(ais1,Standard_False); - myAISContext->SetSelected(anIO1,Standard_False); - Fit(); - Sleep(500); - - Ex.Next(); - TopoDS_Face F2 = TopoDS::Face(Ex.Current()); - surf = BRep_Tool::Surface(F2); - Pl = Handle(Geom_Plane)::DownCast(surf); - D = Pl->Pln().Axis().Direction(); - D.Reverse(); - BRepBuilderAPI_MakeWire MW2; - p1 = gp_Pnt2d(100.,100.); - p2 = gp_Pnt2d(200.,100.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(150.,200.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(100.,100.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - BRepBuilderAPI_MakeFace MKF2; - MKF2.Init(surf,Standard_False, Precision::Confusion()); - MKF2.Add(MW2.Wire()); - FP = MKF2.Face(); - BRepLib::BuildCurves3d(FP); - BRepFeat_MakePrism MKP2(res1,FP,F2,D,1,Standard_True); - MKP2.Perform(100.); - TopoDS_Shape res2 = MKP2.Shape(); - ais1->Set(res2); - - myAISContext->Redisplay (ais1, Standard_False); - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ---- Extrusion ---\n\ - \n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(400.,250.,300.);\n\ -TopExp_Explorer Ex;\n\ -Ex.Init(S,TopAbs_FACE);\n\ -Ex.Next();\n\ -TopoDS_Face F = TopoDS::Face(Ex.Current());\n\ -Handle(Geom_Surface) surf = BRep_Tool::Surface(F);\n\ -Handle(Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(surf);\n\ -gp_Dir D = Pl->Pln().Axis().Direction();\n\ -D.Reverse();\n\ -gp_Pnt2d p1,p2;\n\ -Handle(Geom2d_Curve) aline;\n\ -BRepBuilderAPI_MakeWire MW;\n\ -p1 = gp_Pnt2d(200.,-100.);\n\ -p2 = gp_Pnt2d(100.,-100.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(100.,-200.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(200.,-200.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(200.,-100.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -BRepBuilderAPI_MakeFace MKF;\n\ -MKF.Init(surf,Standard_False);\n\ -MKF.Add(MW.Wire());\n\ -TopoDS_Shape FP = MKF.Face();\n\ -BRepLib::BuildCurves3d(FP);\n\ -BRepFeat_MakePrism MKP(S,FP,F,D,0,Standard_True);\n\ -MKP.Perform(200);\n\ -TopoDS_Shape res1 = MKP.Shape();\n\ - \n"); - Message += "\n\ ---- Protrusion --- \n\ -\n\ -Ex.Next();\n\ -TopoDS_Face F2 = TopoDS::Face(Ex.Current());\n\ -surf = BRep_Tool::Surface(F2);\n\ -Pl = Handle(Geom_Plane)::DownCast(surf);\n\ -D = Pl->Pln().Axis().Direction();\n\ -D.Reverse();\n\ -BRepBuilderAPI_MakeWire MW2;\n\ -p1 = gp_Pnt2d(100.,100.);\n\ -p2 = gp_Pnt2d(200.,100.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(150.,200.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(100.,100.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -BRepBuilderAPI_MakeFace MKF2;\n\ -MKF2.Init(surf,Standard_False);\n\ -MKF2.Add(MW2.Wire());\n\ -FP = MKF2.Face();\n\ -BRepLib::BuildCurves3d(FP);\n\ -BRepFeat_MakePrism MKP2(res1,FP,F2,D,1,Standard_True);\n\ -MKP2.Perform(100.);\n\ -TopoDS_Shape res2 = MKP2.Shape();\n\ - \n"; - PocessTextInDialog("Make an extrusion or a protrusion", Message); -} - -// -// BRepFeat_MakeDPrism -// -void CModelingDoc::OnDprismLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S = BRepPrimAPI_MakeBox(400., 250., 300.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - - myAISContext->SetColor(ais1,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - - TopExp_Explorer Ex; - Ex.Init(S,TopAbs_FACE); - Ex.Next(); - Ex.Next(); - Ex.Next(); - Ex.Next(); - Ex.Next(); - TopoDS_Face F = TopoDS::Face(Ex.Current()); - Handle(Geom_Surface) surf = BRep_Tool::Surface(F); - gp_Circ2d c(gp_Ax2d(gp_Pnt2d(200.,130.),gp_Dir2d(1.,0.)),50.); - BRepBuilderAPI_MakeWire MW; - Handle(Geom2d_Curve) aline = new Geom2d_Circle(c); - MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,M_PI)); - MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,M_PI,2.*M_PI)); - BRepBuilderAPI_MakeFace MKF; - MKF.Init(surf,Standard_False, Precision::Confusion()); - MKF.Add(MW.Wire()); - TopoDS_Face FP = MKF.Face(); - BRepLib::BuildCurves3d(FP); - BRepFeat_MakeDPrism MKDP(S,FP,F,10*M_PI/180,1,Standard_True); - MKDP.Perform(200); - TopoDS_Shape res1 = MKDP.Shape(); - - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(500); - - ais1->Set(res1); - - myAISContext->Redisplay(ais1,Standard_False); - myAISContext->SetSelected(anIO1,Standard_False); - - Fit(); - - TCollection_AsciiString Message ("\ - \n\ ---- Protrusion with draft angle --- \n\ - \n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(400.,250.,300.);\n\ -TopExp_Explorer Ex;\n\ -Ex.Init(S,TopAbs_FACE);\n\ -Ex.Next();\n\ -Ex.Next();\n\ -Ex.Next();\n\ -Ex.Next();\n\ -Ex.Next();\n\ -TopoDS_Face F = TopoDS::Face(Ex.Current());\n\ -Handle(Geom_Surface) surf = BRep_Tool::Surface(F);\n\ -gp_Circ2d c(gp_Ax2d(gp_Pnt2d(200.,130.),gp_Dir2d(1.,0.)),50.);\n\ -BRepBuilderAPI_MakeWire MW;\n\ -Handle(Geom2d_Curve) aline = new Geom2d_Circle(c);\n\ -MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,PI));\n\ -MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,PI,2.*PI));\n\ -BRepBuilderAPI_MakeFace MKF;\n\ -MKF.Init(surf,Standard_False);\n\ -MKF.Add(MW.Wire());\n\ -TopoDS_Face FP = MKF.Face();\n\ -BRepLib::BuildCurves3d(FP);\n\ -BRepFeat_MakeDPrism MKDP(S,FP,F,10*PI180,1,Standard_True);\n\ -MKDP.Perform(200);\n\ -TopoDS_Shape res1 = MKDP.Shape();\n\ - \n"); - PocessTextInDialog("Make an extrusion or a protrusion with a draft angle", Message); -} - -void CModelingDoc::OnRevolLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeBox(400., 250., 300.).Shape(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - - myAISContext->SetColor(ais1,Quantity_NOC_CORAL,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(500); - - TopExp_Explorer Ex; - Ex.Init(S,TopAbs_FACE); - Ex.Next(); - Ex.Next(); - TopoDS_Face F1 = TopoDS::Face(Ex.Current()); - Handle(Geom_Surface) surf = BRep_Tool::Surface(F1); - Handle (Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(surf); - gp_Ax1 D = gp::OX(); - BRepBuilderAPI_MakeWire MW1; - gp_Pnt2d p1,p2; - p1 = gp_Pnt2d(100.,100.); - p2 = gp_Pnt2d(200.,100.); - Handle(Geom2d_Line) aline = GCE2d_MakeLine(p1,p2).Value(); - MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(150.,200.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(100.,100.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - BRepBuilderAPI_MakeFace MKF1; - MKF1.Init(surf,Standard_False, Precision::Confusion()); - MKF1.Add(MW1.Wire()); - TopoDS_Face FP = MKF1.Face(); - BRepLib::BuildCurves3d(FP); - BRepFeat_MakeRevol MKrev(S,FP,F1,D,1,Standard_True); - Ex.Next(); - Ex.Next(); - TopoDS_Face F2 = TopoDS::Face(Ex.Current()); - MKrev.Perform(F2); - TopoDS_Shape res1 = MKrev.Shape(); - - - myAISContext->Remove (ais1, Standard_False); - Handle(AIS_Shape) ais2 = new AIS_Shape(res1); - myAISContext->Display(ais2,Standard_False); - const Handle(AIS_InteractiveObject)& anIO2 = ais2; - myAISContext->SetSelected (anIO2, Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(400.,250.,300.);\n\ -TopExp_Explorer Ex;\n\ -Ex.Init(S,TopAbs_FACE);\n\ -Ex.Next();\n\ -Ex.Next();\n\ -TopoDS_Face F1 = TopoDS::Face(Ex.Current());\n\ -Handle(Geom_Surface) surf = BRep_Tool::Surface(F1);\n\ -Handle (Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(surf);\n\ -gp_Ax1 D = gp::OX();\n\ -BRepBuilderAPI_MakeWire MW1;\n\ -gp_Pnt2d p1,p2;\n\ -p1 = gp_Pnt2d(100.,100.);\n\ -p2 = gp_Pnt2d(200.,100.);\n\ -Handle(Geom2d_Line) aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(150.,200.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(100.,100.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -BRepBuilderAPI_MakeFace MKF1;\n\ -MKF1.Init(surf,Standard_False);\n\ -MKF1.Add(MW1.Wire());\n\ -TopoDS_Face FP = MKF1.Face();\n\ -BRepLib::BuildCurves3d(FP);\n\ -BRepFeat_MakeRevol MKrev(S,FP,F1,D,1,Standard_True);\n\ -Ex.Next();\n\ -TopoDS_Face F2 = TopoDS::Face(Ex.Current());\n\ -MKrev.Perform(F2);\n\ -TopoDS_Shape res1 = MKrev.Shape();\n\ - \n"); - PocessTextInDialog("Make a local revolution", Message); -} - -void CModelingDoc::OnGlueLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S1 = BRepPrimAPI_MakeBox(gp_Pnt(-500., -500., 0.), gp_Pnt(-100., -250., 300.)).Shape(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(S1); - myAISContext->SetColor(ais1,Quantity_NOC_ORANGE,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(1000); - - TopExp_Explorer Ex1; - Ex1.Init(S1,TopAbs_FACE); - Ex1.Next(); - Ex1.Next(); - Ex1.Next(); - Ex1.Next(); - Ex1.Next(); - TopoDS_Face F1 = TopoDS::Face(Ex1.Current()); - TopoDS_Shape S2 = BRepPrimAPI_MakeBox(gp_Pnt(-400., -400., 300.), gp_Pnt(-200., -300., 500.)).Shape(); - Handle(AIS_Shape) ais2 = new AIS_Shape(S2); - - myAISContext->SetColor(ais2,Quantity_NOC_AZURE,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais2,Standard_False); - const Handle(AIS_InteractiveObject)& anIO2 = ais2; - myAISContext->SetSelected (anIO2, Standard_False); - Fit(); - Sleep(1000); - - TopExp_Explorer Ex2; - Ex2.Init(S2,TopAbs_FACE); - Ex2.Next(); - Ex2.Next(); - Ex2.Next(); - Ex2.Next(); - TopoDS_Face F2 = TopoDS::Face(Ex2.Current()); - BRepFeat_Gluer glue(S2,S1); - glue.Bind(F2,F1); - TopoDS_Shape res1 = glue.Shape(); - myAISContext->Erase(ais2,Standard_False); - - ais1->Set(res1); - - myAISContext->Redisplay (ais1, Standard_False); - myAISContext->SetSelected(anIO1,Standard_False); - Fit(); - Sleep(1000); - - TopoDS_Shape S3 = BRepPrimAPI_MakeBox(500., 400., 300.).Shape(); - - Handle(AIS_Shape) ais3 = new AIS_Shape(S3); - myAISContext->SetColor(ais3,Quantity_NOC_ORANGE,Standard_False); - myAISContext->SetMaterial(ais3,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais3,Standard_False); - const Handle(AIS_InteractiveObject)& anIO3 = ais3; - myAISContext->SetSelected (anIO3, Standard_False); - Fit(); - Sleep(1000); - - TopExp_Explorer Ex3; - Ex3.Init(S3,TopAbs_FACE); - Ex3.Next(); - Ex3.Next(); - Ex3.Next(); - Ex3.Next(); - Ex3.Next(); - TopoDS_Face F3 = TopoDS::Face(Ex3.Current()); - TopoDS_Shape S4 = BRepPrimAPI_MakeBox(gp_Pnt(0., 0., 300.), gp_Pnt(200., 200., 500.)).Shape(); - - Handle(AIS_Shape) ais4 = new AIS_Shape(S4); - myAISContext->SetColor(ais4,Quantity_NOC_AZURE,Standard_False); - myAISContext->SetMaterial(ais4,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais4,Standard_False); - const Handle(AIS_InteractiveObject)& anIO4 = ais4; - myAISContext->SetSelected (anIO4, Standard_False); - Fit(); - Sleep(1000); - - TopExp_Explorer Ex4; - Ex4.Init(S4,TopAbs_FACE); - Ex4.Next(); - Ex4.Next(); - Ex4.Next(); - Ex4.Next(); - TopoDS_Face F4 = TopoDS::Face(Ex4.Current()); - BRepFeat_Gluer glue2(S4,S3); - glue2.Bind(F4,F3); - LocOpe_FindEdges CommonEdges(F4,F3); - for (CommonEdges.InitIterator(); CommonEdges.More(); CommonEdges.Next()) - glue2.Bind(CommonEdges.EdgeFrom(),CommonEdges.EdgeTo()); - TopoDS_Shape res2 = glue2.Shape(); - myAISContext->Erase(ais3,Standard_False); - - ais4->Set(res2); - - myAISContext->Redisplay(ais4,Standard_False); - myAISContext->SetSelected(anIO4,Standard_False); - Fit(); - Sleep(1000); - - TCollection_AsciiString Message ("\ - \n\ ---- Without common edges ---\n\ - \n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeBox(gp_Pnt(-500.,-500.,0.),gp_Pnt(-100.,-250.,300.));\n\ -TopExp_Explorer Ex1;\n\ -Ex1.Init(S1,TopAbs_FACE);\n\ -Ex1.Next();\n\ -Ex1.Next();\n\ -Ex1.Next();\n\ -Ex1.Next();\n\ -Ex1.Next();\n\ -TopoDS_Face F1 = TopoDS::Face(Ex1.Current());\n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeBox(gp_Pnt(-400.,-400.,300.),gp_Pnt(-200.,-300.,500.));\n\ -TopExp_Explorer Ex2;\n\ -Ex2.Init(S2,TopAbs_FACE);\n\ -Ex2.Next();\n\ -Ex2.Next();\n\ -Ex2.Next();\n\ -Ex2.Next();\n\ -TopoDS_Face F2 = TopoDS::Face(Ex2.Current());\n\ -BRepFeat_Gluer glue(S2,S1);\n\ -glue.Bind(F2,F1);\n\ -TopoDS_Shape res1 = glue.Shape();\n\ -\n\ ---- With common edges ---\n\ -\n\ -TopoDS_Shape S3 = BRepPrimAPI_MakeBox(500.,400.,300.);\n\ -TopExp_Explorer Ex3;\n\ -Ex3.Init(S3,TopAbs_FACE);\n\ -Ex3.Next();\n\ -Ex3.Next();\n\ -Ex3.Next();\n\ -Ex3.Next();\n\ -Ex3.Next();\n\ -TopoDS_Face F3 = TopoDS::Face(Ex3.Current());\n\ -TopoDS_Shape S4 = BRepPrimAPI_MakeBox(gp_Pnt(0.,0.,300.),gp_Pnt(200.,200.,500.));\n\ -TopExp_Explorer Ex4;\n\ -Ex4.Init(S4,TopAbs_FACE);\n\ -Ex4.Next();\n\ -Ex4.Next();\n\ -Ex4.Next();\n\ -Ex4.Next();\n\ -TopoDS_Face F4 = TopoDS::Face(Ex4.Current());\n\ -BRepFeat_Gluer glue2(S4,S3);\n\ -glue2.Bind(F4,F3);\n\ -LocOpe_FindEdges CommonEdges(F4,F3);\n\ -for (CommonEdges.InitIterator(); CommonEdges.More(); CommonEdges.Next()) \n\ - glue2.Bind(CommonEdges.EdgeFrom(),CommonEdges.EdgeTo());\n\ -TopoDS_Shape res2 = glue2.Shape();\n\ - \n"); - PocessTextInDialog("Glue two solids", Message); -} - - -void CModelingDoc::OnPipeLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - TopoDS_Shape S = BRepPrimAPI_MakeBox(400., 250., 300.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - - myAISContext->SetColor(ais1,Quantity_NOC_CORAL,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(500); - - TopExp_Explorer Ex; - Ex.Init(S,TopAbs_FACE); - Ex.Next(); - Ex.Next(); - TopoDS_Face F1 = TopoDS::Face(Ex.Current()); - Handle(Geom_Surface) surf = BRep_Tool::Surface(F1); - BRepBuilderAPI_MakeWire MW1; - gp_Pnt2d p1,p2; - p1 = gp_Pnt2d(100.,100.); - p2 = gp_Pnt2d(200.,100.); - Handle(Geom2d_Line) aline = GCE2d_MakeLine(p1,p2).Value(); - MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(150.,200.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - p1 = p2; - p2 = gp_Pnt2d(100.,100.); - aline = GCE2d_MakeLine(p1,p2).Value(); - MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2))); - BRepBuilderAPI_MakeFace MKF1; - MKF1.Init(surf,Standard_False, Precision::Confusion()); - MKF1.Add(MW1.Wire()); - TopoDS_Face FP = MKF1.Face(); - BRepLib::BuildCurves3d(FP); - TColgp_Array1OfPnt CurvePoles(1,3); - gp_Pnt pt = gp_Pnt(150.,0.,150.); - CurvePoles(1) = pt; - pt = gp_Pnt(200.,-100.,150.); - CurvePoles(2) = pt; - pt = gp_Pnt(150.,-200.,150.); - CurvePoles(3) = pt; - Handle(Geom_BezierCurve) curve = new Geom_BezierCurve(CurvePoles); - TopoDS_Edge E = BRepBuilderAPI_MakeEdge(curve); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E); - BRepFeat_MakePipe MKPipe(S,FP,F1,W,1,Standard_True); - MKPipe.Perform(); - TopoDS_Shape res1 = MKPipe.Shape(); - ais1->Set(res1); - - myAISContext->Redisplay(ais1,Standard_False); - myAISContext->SetSelected(anIO1,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(400.,250.,300.);\n\ -TopExp_Explorer Ex;\n\ -Ex.Init(S,TopAbs_FACE);\n\ -Ex.Next();\n\ -Ex.Next();\n\ -TopoDS_Face F1 = TopoDS::Face(Ex.Current());\n\ -Handle(Geom_Surface) surf = BRep_Tool::Surface(F1);\n\ -BRepBuilderAPI_MakeWire MW1;\n\ -gp_Pnt2d p1,p2;\n\ -p1 = gp_Pnt2d(100.,100.);\n\ -p2 = gp_Pnt2d(200.,100.);\n\ -Handle(Geom2d_Line) aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(150.,200.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -p1 = p2;\n\ -p2 = gp_Pnt2d(100.,100.);\n\ -aline = GCE2d_MakeLine(p1,p2).Value();\n\ -MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));\n\ -BRepBuilderAPI_MakeFace MKF1;\n\ -MKF1.Init(surf,Standard_False);\n\ -TopoDS_Face FP = MKF1.Face();\n\ -BRepLib::BuildCurves3d(FP);\n\ -TColgp_Array1OfPnt CurvePoles(1,3);\n\ -gp_Pnt pt = gp_Pnt(150.,0.,150.);\n\ -CurvePoles(1) = pt;\n\ -pt = gp_Pnt(200.,-100.,150.);\n\ -CurvePoles(2) = pt;\n\ -pt = gp_Pnt(150.,-200.,150.);\n\ -CurvePoles(3) = pt;\n\ -Handle(Geom_BezierCurve) curve = new Geom_BezierCurve(CurvePoles);\n\ -TopoDS_Edge E = BRepBuilderAPI_MakeEdge(curve);\n\ -TopoDS_Wire W = BRepBuilderAPI_MakeWire(E);\n\ -BRepFeat_MakePipe MKPipe(S,FP,F1,W,1,Standard_True);\n\ -MKPipe.Perform();\n\ -TopoDS_Shape res1 = MKPipe.Shape();\n\ - \n"); - PocessTextInDialog("Make a local pipe", Message); -} - - -void CModelingDoc::OnLinearLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - BRepBuilderAPI_MakeWire mkw; - gp_Pnt p1 = gp_Pnt(0.,0.,0.); - gp_Pnt p2 = gp_Pnt(200.,0.,0.); - mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2)); - p1 = p2; - p2 = gp_Pnt(200.,0.,50.); - mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2)); - p1 = p2; - p2 = gp_Pnt(50.,0.,50.); - mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2)); - p1 = p2; - p2 = gp_Pnt(50.,0.,200.); - mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2)); - p1 = p2; - p2 = gp_Pnt(0.,0.,200.); - mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2)); - p1 = p2; - mkw.Add(BRepBuilderAPI_MakeEdge(p2,gp_Pnt(0.,0.,0.))); - - TopoDS_Shape S = BRepPrimAPI_MakePrism(BRepBuilderAPI_MakeFace(mkw.Wire()), - gp_Vec(gp_Pnt(0.,0.,0.),gp_Pnt(0.,100.,0.))); - - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_CYAN2,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(500); - - TopoDS_Wire W = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(gp_Pnt(50.,45.,100.), - gp_Pnt(100.,45.,50.))); - Handle(Geom_Plane) aplane = new Geom_Plane(0.,1.,0.,-45.); - BRepFeat_MakeLinearForm aform(S, W, aplane, gp_Vec(0.,10.,0.), gp_Vec(0.,0.,0.), - 1, Standard_True); - aform.Perform(/*10.*/); // new in 2.0 - - TopoDS_Shape res = aform.Shape(); - ais1->Set(res); - myAISContext->Redisplay(ais1,Standard_False); - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -BRepBuilderAPI_MakeWire mkw;\n\ -gp_Pnt p1 = gp_Pnt(0.,0.,0.);\n\ -gp_Pnt p2 = gp_Pnt(200.,0.,0.);\n\ -mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2));\n\ -p1 = p2;\n\ -p2 = gp_Pnt(200.,0.,50.);\n\ -mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2));\n\ -p1 = p2;\n\ -p2 = gp_Pnt(50.,0.,50.);\n\ -mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2));\n\ -p1 = p2;\n\ -p2 = gp_Pnt(50.,0.,200.);\n\ -mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2));\n\ -p1 = p2;\n\ -p2 = gp_Pnt(0.,0.,200.);\n\ -mkw.Add(BRepBuilderAPI_MakeEdge(p1,p2));\n\ -p1 = p2;\n\ -mkw.Add(BRepBuilderAPI_MakeEdge(p2,gp_Pnt(0.,0.,0.)));\n\ -TopoDS_Shape S = BRepPrimAPI_MakePrism(BRepBuilderAPI_MakeFace(mkw.Wire()), \n\ - gp_Vec(gp_Pnt(0.,0.,0.),gp_Pnt(0.,100.,0.)));\n\ -TopoDS_Wire W = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(gp_Pnt(50.,45.,100.),\n\ - gp_Pnt(100.,45.,50.)));\n\ -Handle(Geom_Plane) aplane = new Geom_Plane(0.,1.,0.,-45.);\n\ -BRepFeat_MakeLinearForm aform(S, W, aplane, gp_Dir(0.,10.,0.), gp_Dir(0.,0.,0.),\n\ - 1, Standard_True);\n\ -aform.Perform(10.);\n\ -TopoDS_Shape res = aform.Shape();\n\ - \n"); - PocessTextInDialog("Make a rib", Message); -} - - -void CModelingDoc::OnSplitLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S = BRepPrimAPI_MakeBox(gp_Pnt(-100, -60, -80), 150, 200, 170).Shape(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(500); - - BRepAlgoAPI_Section asect(S, gp_Pln(1,2,1,-15),Standard_False); - asect.ComputePCurveOn1(Standard_True); - asect.Approximation(Standard_True); - asect.Build(); - TopoDS_Shape R = asect.Shape(); - - BRepFeat_SplitShape asplit(S); - - for (TopExp_Explorer Ex(R,TopAbs_EDGE); Ex.More(); Ex.Next()) { - TopoDS_Shape anEdge = Ex.Current(); - TopoDS_Shape aFace; - if (asect.HasAncestorFaceOn1(anEdge,aFace)) { - TopoDS_Face F = TopoDS::Face(aFace); - TopoDS_Edge E = TopoDS::Edge(anEdge); - asplit.Add(E,F); - } - } - - asplit.Build(); - - //Sleep(1000); - myAISContext->Erase(ais1,Standard_False); - //Fit(); - - TopoDS_Shape Result = asplit.Shape(); - - Handle(AIS_Shape) ais2 = new AIS_Shape(Result); - - myAISContext->SetColor(ais2,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetDisplayMode(ais2,1,Standard_False); - myAISContext->Display(ais2,Standard_False); - const Handle(AIS_InteractiveObject)& anIO2 = ais2; - myAISContext->SetSelected (anIO2, Standard_False); - Fit(); - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(gp_Pnt(-100,-60,-80),150,200,170); \n\ - \n\ -BRepBuilderAPI_Section asect(S, gp_Pln(1,2,1,-15),Standard_False); \n\ -asect.ComputePCurveOn1(Standard_True); \n\ -asect.Approximation(Standard_True); \n\ -asect.Build(); \n\ -TopoDS_Shape R = asect.Shape(); \n\ - \n\ -BRepFeat_SplitShape asplit(S); \n\ - \n\ -for (TopExp_Explorer Ex(R,TopAbs_EDGE); Ex.More(); Ex.Next()) { \n\ -TopoDS_Shape anEdge = Ex.Current(); \n\ - TopoDS_Shape aFace; \n\ - if (asect.HasAncestorFaceOn1(anEdge,aFace)) { \n\ - TopoDS_Face F = TopoDS::Face(aFace); \n\ - TopoDS_Edge E = TopoDS::Edge(anEdge); \n\ - asplit.Add(E,F); \n\ - } \n\ -} \n\ - \n\ -asplit.Build(); \n\ - \n\ -TopoDS_Shape Result = asplit.Shape(); \n\ - \n\ -\n"); - -PocessTextInDialog("Split a shape", Message); -} - - - -void CModelingDoc::OnThickLocal() -{ - AIS_ListOfInteractive L; - myAISContext->DisplayedObjects(L); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(L);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S1 = BRepPrimAPI_MakeBox(150, 200, 110).Shape(); - - Handle(AIS_Shape) abox1 = new AIS_Shape(S1); - myAISContext->SetColor (abox1, Quantity_NOC_WHITE, Standard_False); - myAISContext->SetMaterial(abox1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(abox1,Standard_False); - const Handle(AIS_InteractiveObject)& anIOBox1 = abox1; - myAISContext->SetSelected (anIOBox1, Standard_False); - Fit(); - Sleep(1000); - - TopTools_ListOfShape aList; - TopExp_Explorer Ex(S1,TopAbs_FACE); - Ex.Next(); //this is the front face - TopoDS_Shape aFace = Ex.Current(); - aList.Append(aFace); - - BRepOffsetAPI_MakeThickSolid aSolidMaker; - aSolidMaker.MakeThickSolidByJoin(S1,aList,10,0.01); - TopoDS_Shape aThickSolid = aSolidMaker.Shape(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(aThickSolid); - myAISContext->SetColor(ais1,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - const Handle(AIS_InteractiveObject)& anIO1 = ais1; - myAISContext->SetSelected (anIO1, Standard_False); - Fit(); - Sleep(1000); - - myAISContext->Erase(abox1,Standard_True); - Fit(); - - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepPrimAPI_MakeBox(150,200,110); \n\ - \n\ -TopTools_ListOfShape aList; \n\ -TopExp_Explorer Ex(S,TopAbs_FACE); \n\ -Ex.Next(); //in order to recover the front face \n\ -TopoDS_Shape aFace = Ex.Current(); \n\ -aList.Append(aFace); \n\ - \n\ -TopoDS_Shape aThickSolid = BRepPrimAPI_MakeThickSolid(S,aList,15,0.01); \n\ - \n\ -\n"); -PocessTextInDialog("Make a thick solid", Message); -} - -void CModelingDoc::OnOffsetLocal() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S1 = BRepPrimAPI_MakeBox(150, 200, 110).Shape(); - - Handle(AIS_Shape) aisBox1 = new AIS_Shape(S1); - myAISContext->SetColor(aisBox1,Quantity_NOC_BROWN,Standard_False); - myAISContext->SetMaterial(aisBox1,Graphic3d_NOM_GOLD,Standard_False); - myAISContext->Display(aisBox1,Standard_False); - Fit(); - Sleep(500); - - BRepOffsetAPI_MakeOffsetShape aShapeMaker1; - aShapeMaker1.PerformByJoin(S1,60,0.01); - TopoDS_Shape anOffsetShape1 = aShapeMaker1.Shape(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(anOffsetShape1); - myAISContext->SetColor(ais1,Quantity_NOC_MATRABLUE,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_GOLD,Standard_False); - myAISContext->SetTransparency(ais1,0.5,Standard_False); - myAISContext->Display(ais1,Standard_False); - Fit(); - Sleep(500); - - TopoDS_Shape S2 = BRepPrimAPI_MakeBox(gp_Pnt(500, 0, 0), 220, 140, 180).Shape(); - - Handle(AIS_Shape) aisBox2 = new AIS_Shape(S2); - myAISContext->SetColor(aisBox2,Quantity_NOC_WHITE,Standard_False); - myAISContext->SetMaterial(aisBox2,Graphic3d_NOM_GOLD,Standard_False); - myAISContext->SetTransparency(aisBox2,0.5,Standard_False); - myAISContext->Display(aisBox2,Standard_False); - Fit(); - Sleep(500); - - BRepOffsetAPI_MakeOffsetShape aShapeMaker2; - aShapeMaker2.PerformByJoin(S2,-40,0.01, - BRepOffset_Skin,Standard_False,Standard_False,GeomAbs_Arc); - TopoDS_Shape anOffsetShape2 = aShapeMaker2.Shape(); - - Handle(AIS_Shape) ais2 = new AIS_Shape(anOffsetShape2); - myAISContext->SetColor (ais2, Quantity_NOC_MATRABLUE, Standard_False); - myAISContext->SetMaterial(ais2,Graphic3d_NOM_GOLD,Standard_False); - myAISContext->Display (ais2, Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -\n\ -TopoDS_Shape S1 = BRepPrimAPI_MakeBox(150,200,110); \n\ -\n\ -TopoDS_Shape anOffsetShape1 = BRepPrimAPI_MakeOffsetShape(S1,60,0.01); \n\ -\n\ -//The white box \n\ - \n\ -TopoDS_Shape S2 = BRepPrimAPI_MakeBox(gp_Pnt(300,0,0),220,140,180); \n\ -\n\ -TopoDS_Shape anOffsetShape2 = BRepPrimAPI_MakeOffsetShape(S2,-20,0.01, \n\ - BRepOffset_Skin,Standard_False,Standard_False,GeomAbs_Arc); \n\ - \n\ -\n\ -\n"); -PocessTextInDialog("Make an offset shape", Message); - -} - -/* ================================================================================= - ==================== B U I L D I N G ======================================== - ================================================================================= */ - - -void CModelingDoc::OnVertex() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Vertex V1,V2,V3; - - V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0,0,0)); - V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10,7,25)); - - gp_Pnt P(-12,8,-4); - BRepBuilderAPI_MakeVertex MV(P); - V3 = MV.Vertex(); - - Handle(AIS_Shape) Point1 = new AIS_Shape(V1); - myAISContext->Display(Point1,Standard_False); - Handle(AIS_Shape) Point2 = new AIS_Shape(V2); - myAISContext->Display(Point2,Standard_False); - Handle(AIS_Shape) Point3 = new AIS_Shape(V3); - myAISContext->Display(Point3,Standard_False); - - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Vertex V1,V2,V3; \n\ - \n\ -V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0,0,0)); \n\ - \n\ -V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10,7,25)); \n\ - \n\ -gp_Pnt P(-12,8,-4); \n\ -BRepBuilderAPI_MakeVertex MV(P); \n\ -V3 = MV.Vertex(); \n\ - \n\ -\n"); - - PocessTextInDialog("Make vertex from point ", Message); - -} - -void CModelingDoc::OnEdge() -{ - - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - - TopoDS_Edge BlueEdge,YellowEdge,WhiteEdge,RedEdge,GreenEdge; - TopoDS_Vertex V1,V2,V3,V4; - -/////////////The blue edge - - BlueEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(-80,-50,-20),gp_Pnt(-30,-60,-60)); - -/////////////The yellow edge - - V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-20,10,-30)); - V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10,7,-25)); - YellowEdge = BRepBuilderAPI_MakeEdge(V1,V2); - -/////////////The white edge - - gp_Lin line(gp_Ax1(gp_Pnt(10,10,10),gp_Dir(1,0,0))); - WhiteEdge = BRepBuilderAPI_MakeEdge(line,-20,10); - -//////////////The red edge - - gp_Elips Elips(gp_Ax2(gp_Pnt(10,0,0),gp_Dir(1,1,1)),60,30); - RedEdge = BRepBuilderAPI_MakeEdge(Elips,0,M_PI/2); - -/////////////The green edge and the both extreme vertex - - gp_Pnt P1(-15,200,10); - gp_Pnt P2(5,204,0); - gp_Pnt P3(15,200,0); - gp_Pnt P4(-15,20,15); - gp_Pnt P5(-5,20,0); - gp_Pnt P6(15,20,0); - gp_Pnt P7(24,120,0); - gp_Pnt P8(-24,120,12.5); - TColgp_Array1OfPnt array(1,8); - array.SetValue(1,P1); - array.SetValue(2,P2); - array.SetValue(3,P3); - array.SetValue(4,P4); - array.SetValue(5,P5); - array.SetValue(6,P6); - array.SetValue(7,P7); - array.SetValue(8,P8); - Handle (Geom_BezierCurve) curve = new Geom_BezierCurve(array); - - BRepBuilderAPI_MakeEdge ME (curve); - GreenEdge = ME; - V3 = ME.Vertex1(); - V4 = ME.Vertex2(); - -//////////////Display -Handle(AIS_Shape) blue = new AIS_Shape(BlueEdge); -myAISContext->SetColor(blue,Quantity_NOC_MATRABLUE,Standard_False); -myAISContext->Display(blue,Standard_False); - -Handle(AIS_Shape) yellow = new AIS_Shape(YellowEdge); -myAISContext->SetColor(yellow,Quantity_NOC_YELLOW,Standard_False); -myAISContext->Display(yellow,Standard_False); - -Handle(AIS_Shape) white = new AIS_Shape(WhiteEdge); -myAISContext->SetColor(white,Quantity_NOC_WHITE,Standard_False); -myAISContext->Display(white,Standard_False); - -Handle(AIS_Shape) red = new AIS_Shape(RedEdge); -myAISContext->SetColor(red,Quantity_NOC_RED,Standard_False); -myAISContext->Display(red,Standard_False); - -Handle(AIS_Shape) green = new AIS_Shape(GreenEdge); -myAISContext->SetColor(green,Quantity_NOC_GREEN,Standard_False); -myAISContext->Display(green,Standard_False); - -Handle(AIS_Shape) Point1 = new AIS_Shape(V3); -myAISContext->Display(Point1,Standard_False); -Handle(AIS_Shape) Point2 = new AIS_Shape(V4); -myAISContext->Display(Point2,Standard_False); - -Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Edge BlueEdge, YellowEdge, WhiteEdge, RedEdge, GreenEdge; \n\ -TopoDS_Vertex V1,V2,V3,V4; \n\ - \n\ -/////////////The blue edge \n\ - \n\ -BlueEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(-80,-50,-20),gp_Pnt(-30,-60,-60)); \n\ - \n\ -/////////////The yellow edge \n\ - \n\ -V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-20,10,-30)); \n\ -V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10,7,-25)); \n\ -YellowEdge = BRepBuilderAPI_MakeEdge(V1,V2); \n\ - \n\ -/////////////The white edge \n\ - \n\ -gp_Lin line(gp_Ax1(gp_Pnt(10,10,10),gp_Dir(1,0,0))); \n\ -WhiteEdge = BRepBuilderAPI_MakeEdge(line,-20,10); \n\ - \n\ -//////////////The red edge \n\ - \n\ -gp_Elips Elips(gp_Ax2(gp_Pnt(10,0,0),gp_Dir(1,1,1)),60,30); \n\ -RedEdge = BRepBuilderAPI_MakeEdge(Elips,0,PI/2); \n\ - \n\ -/////////////The green edge and the both extreme vertex \n\ - \n\ -gp_Pnt P1(-15,200,10); \n\ -gp_Pnt P2(5,204,0); \n\ -gp_Pnt P3(15,200,0); \n\ -gp_Pnt P4(-15,20,15); \n\ -gp_Pnt P5(-5,20,0); \n\ -gp_Pnt P6(15,20,0); \n\ -gp_Pnt P7(24,120,0); \n\ -gp_Pnt P8(-24,120,12.5); \n\ -TColgp_Array1OfPnt array(1,8); \n\ -array.SetValue(1,P1); \n\ -array.SetValue(2,P2); \n\ -array.SetValue(3,P3); \n\ -array.SetValue(4,P4); \n\ -array.SetValue(5,P5); \n\ -array.SetValue(6,P6); \n\ -array.SetValue(7,P7); \n\ -array.SetValue(8,P8); \n\ -Handle (Geom_BezierCurve) curve = new Geom_BezierCurve(array); \n\ - \n\ -BRepBuilderAPI_MakeEdge ME (curve); \n\ -GreenEdge = ME; \n\ -V3 = ME.Vertex1(); \n\ -V4 = ME.Vertex2(); \n\ - \n\ -\n"); - - PocessTextInDialog("Make edge", Message); - -} - -void CModelingDoc::OnWire() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Wire RedWire,YellowWire,WhiteWire, - ExistingWire, ExistingWire2; - - TopoDS_Edge Edge1,Edge2,Edge3,Edge4,Edge5,Edge6,Edge7,LastEdge; - TopoDS_Vertex LastVertex; - -////////////The red wire is build from a single edge - - gp_Elips Elips(gp_Ax2(gp_Pnt(250,0,0),gp_Dir(1,1,1)),160,90); - Edge1 = BRepBuilderAPI_MakeEdge(Elips,0,M_PI/2); - - RedWire = BRepBuilderAPI_MakeWire(Edge1); - -///////////the yellow wire is build from an existing wire and an edge - - gp_Circ circle(gp_Ax2(gp_Pnt(-300,0,0),gp_Dir(1,0,0)),80); - Edge2 = BRepBuilderAPI_MakeEdge(circle,0,M_PI); - - ExistingWire = BRepBuilderAPI_MakeWire(Edge2); - - Edge3 = BRepBuilderAPI_MakeEdge(gp_Pnt(-300,0,-80),gp_Pnt(-90,20,-30)); - - BRepBuilderAPI_MakeWire MW1(ExistingWire,Edge3); - if (MW1.IsDone()) { - YellowWire = MW1; - } - - -//////////the white wire is built with an existing wire and 3 edges. -//////////we use the methods Add, Edge and Vertex from BRepBuilderAPI_MakeWire. - - gp_Circ circle2(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,1,0)),200); - Edge4 = BRepBuilderAPI_MakeEdge(circle2,0,M_PI); - - ExistingWire2 = BRepBuilderAPI_MakeWire(Edge4); - - gp_Pnt P1(0,0,-200); - gp_Pnt P2(5,204,0); - Edge5 = BRepBuilderAPI_MakeEdge(P1,P2); - - gp_Pnt P3(-15,20,15); - Edge6 = BRepBuilderAPI_MakeEdge(P2,P3); - gp_Pnt P4(15,20,0); - Edge7 = BRepBuilderAPI_MakeEdge(P3,P4); - - BRepBuilderAPI_MakeWire MW; - MW.Add(ExistingWire2); - MW.Add(Edge5); - MW.Add(Edge6); - MW.Add(Edge7); - - if (MW.IsDone()) { - WhiteWire = MW.Wire(); - LastEdge = MW.Edge(); - LastVertex = MW.Vertex(); - } - - -Handle(AIS_Shape) red = new AIS_Shape(RedWire); -myAISContext->SetColor(red,Quantity_NOC_RED,Standard_False); -myAISContext->Display(red,Standard_False); - -Handle(AIS_Shape) yellow = new AIS_Shape(YellowWire); -myAISContext->SetColor(yellow,Quantity_NOC_YELLOW,Standard_False); -myAISContext->Display(yellow,Standard_False); - -Handle(AIS_Shape) white = new AIS_Shape(WhiteWire); -myAISContext->SetColor(white,Quantity_NOC_WHITE,Standard_False); -myAISContext->Display(white,Standard_False); - -Handle(AIS_Shape) lastE = new AIS_Shape(LastEdge); -myAISContext->SetWidth(lastE,3,Standard_False); -myAISContext->SetColor(lastE,Quantity_NOC_RED,Standard_False); -myAISContext->Display(lastE,Standard_False); - -Handle(AIS_Shape) lastV = new AIS_Shape(LastVertex); -myAISContext->Display(lastV,Standard_False); - -Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Wire RedWire,YellowWire,WhiteWire, \n\ -ExistingWire, ExistingWire2; \n\ - \n\ -TopoDS_Edge Edge1,Edge2,Edge3,Edge4,Edge5,Edge6,Edge7,LastEdge; \n\ -TopoDS_Vertex LastVertex; \n\ - \n\ -////////////The red wire is build from a single edge \n\ - \n\ -gp_Elips Elips(gp_Ax2(gp_Pnt(10,0,0),gp_Dir(1,1,1)),160,90); \n\ -Edge1 = BRepBuilderAPI_MakeEdge(Elips,0,PI/2); \n\ - \n\ -RedWire = BRepBuilderAPI_MakeWire(Edge1); \n\ - \n\ -///////////the yellow wire is build from an existing wire and an edge \n\ - \n\ -gp_Circ circle(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(1,0,0)),80); \n\ -Edge2 = BRepBuilderAPI_MakeEdge(circle,0,PI); \n\ - \n\ -ExistingWire = BRepBuilderAPI_MakeWire(Edge2); \n\ - \n\ -Edge3 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,0,-80),gp_Pnt(90,20,30)); \n\ - \n\ -BRepBuilderAPI_MakeWire MW1(ExistingWire,Edge3); \n\ -if (MW1.IsDone()) { \n\ - YellowWire = MW1; \n\ -} \n\ - \n\ -///the white wire is built with an existing wire and 3 edges. \n\ -///we use the methods Add, Edge and Vertex from BRepBuilderAPI_MakeWire \n\ -///in order to display the last edge and the last vertices we \n\ -///add to the wire. \n\ - \n\ -gp_Circ circle2(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,1,0)),200); \n\ -Edge4 = BRepBuilderAPI_MakeEdge(circle2,0,PI); \n\ - \n\ -ExistingWire2 = BRepBuilderAPI_MakeWire(Edge4); \n\ - \n\ -gp_Pnt P1(0,0,-200); \n\ -gp_Pnt P2(5,204,0); \n\ -Edge5 = BRepBuilderAPI_MakeEdge(P1,P2); \n\ - \n\ -gp_Pnt P3(-15,20,15); \n\ -Edge6 = BRepBuilderAPI_MakeEdge(P2,P3); \n\ -gp_Pnt P4(15,20,0); \n\ -Edge7 = BRepBuilderAPI_MakeEdge(P3,P4); \n\ - \n\ -BRepBuilderAPI_MakeWire MW; \n\ -MW.Add(ExistingWire2); \n\ -MW.Add(Edge5); \n\ -MW.Add(Edge6); \n\ -MW.Add(Edge7); \n\ - \n\ -if (MW.IsDone()) { \n\ - WhiteWire = MW.Wire(); \n\ - LastEdge = MW.Edge(); \n\ - LastVertex = MW.Vertex(); \n\ -} \n\ - \n\ -\n"); - - PocessTextInDialog("Make wire ", Message); -} - -void CModelingDoc::OnFace() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - - - TopoDS_Face WhiteFace, BrownFace, RedFace, PinkFace; - TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Edge5, Edge6, Edge7; - TopoDS_Wire Wire1; - gp_Pnt P1, P2, P3, P4, P5, P6, P7; - - gp_Sphere sphere (gp_Ax3(gp_Pnt(0,0,0),gp_Dir(1,0,0)),150); - - WhiteFace = BRepBuilderAPI_MakeFace(sphere,0.1,0.7,0.2,0.9); - -////////////////////////////////// - - P1.SetCoord(-15,200,10); - P2.SetCoord(5,204,0); - P3.SetCoord(15,200,0); - P4.SetCoord(-15,20,15); - P5.SetCoord(-5,20,0); - P6.SetCoord(15,20,35); - TColgp_Array2OfPnt array(1,3,1,2); - array.SetValue(1,1,P1); - array.SetValue(2,1,P2); - array.SetValue(3,1,P3); - array.SetValue(1,2,P4); - array.SetValue(2,2,P5); - array.SetValue(3,2,P6); - Handle (Geom_BSplineSurface) curve = GeomAPI_PointsToBSplineSurface(array,3,8,GeomAbs_C2,0.001); - - RedFace = BRepBuilderAPI_MakeFace(curve, Precision::Confusion()); - -//////////////////// - - gp_Circ circle(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(1,0,0)),80); - Edge1 = BRepBuilderAPI_MakeEdge(circle,0,M_PI); - - Edge2 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,0,-80),gp_Pnt(0,-10,40)); - Edge3 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,-10,40),gp_Pnt(0,0,80)); - - TopoDS_Wire YellowWire; - BRepBuilderAPI_MakeWire MW1(Edge1,Edge2,Edge3); - if (MW1.IsDone()) { - YellowWire = MW1; - } - - BrownFace = BRepBuilderAPI_MakeFace(YellowWire); - - -///////////// - - P1.SetCoord(35,-200,40); - P2.SetCoord(50,-204,30); - P3.SetCoord(65,-200,30); - P4.SetCoord(35,-20,45); - P5.SetCoord(45,-20,30); - P6.SetCoord(65,-20,65); - TColgp_Array2OfPnt array2(1,3,1,2); - array2.SetValue(1,1,P1); - array2.SetValue(2,1,P2); - array2.SetValue(3,1,P3); - array2.SetValue(1,2,P4); - array2.SetValue(2,2,P5); - array2.SetValue(3,2,P6); - - Handle (Geom_BSplineSurface) BSplineSurf = GeomAPI_PointsToBSplineSurface(array2,3,8,GeomAbs_C2,0.001); - - TopoDS_Face aFace = BRepBuilderAPI_MakeFace(BSplineSurf, Precision::Confusion()); - - //2d lines - gp_Pnt2d P12d(0.9,0.1); - gp_Pnt2d P22d(0.2,0.7); - gp_Pnt2d P32d(0.02,0.1); - - Handle (Geom2d_Line) line1 = new Geom2d_Line(P12d,gp_Dir2d((0.2-0.9),(0.7-0.1))); - Handle (Geom2d_Line) line2 = new Geom2d_Line(P22d,gp_Dir2d((0.02-0.2),(0.1-0.7))); - Handle (Geom2d_Line) line3 = new Geom2d_Line(P32d,gp_Dir2d((0.9-0.02),(0.1-0.1))); - - - //Edges are on the BSpline surface - Edge1 = BRepBuilderAPI_MakeEdge(line1,BSplineSurf,0,P12d.Distance(P22d)); - Edge2 = BRepBuilderAPI_MakeEdge(line2,BSplineSurf,0,P22d.Distance(P32d)); - Edge3 = BRepBuilderAPI_MakeEdge(line3,BSplineSurf,0,P32d.Distance(P12d)); - - Wire1 = BRepBuilderAPI_MakeWire(Edge1,Edge2,Edge3); - Wire1.Reverse(); - PinkFace = BRepBuilderAPI_MakeFace(aFace,Wire1); - BRepLib::BuildCurves3d(PinkFace); - -/////////////Display - Handle(AIS_Shape) white = new AIS_Shape(WhiteFace); - myAISContext->SetColor(white,Quantity_NOC_WHITE,Standard_False); - myAISContext->SetMaterial(white,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(white,Standard_False); - - Handle(AIS_Shape) red = new AIS_Shape(RedFace); - myAISContext->SetColor(red,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(red,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(red,Standard_False); - - Handle(AIS_Shape) brown = new AIS_Shape(BrownFace); - myAISContext->SetColor(brown,Quantity_NOC_BROWN,Standard_False); - myAISContext->SetMaterial(brown,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(brown,Standard_False); - - Handle(AIS_Shape) pink = new AIS_Shape(PinkFace); - myAISContext->SetColor(pink,Quantity_NOC_HOTPINK,Standard_False); - myAISContext->SetMaterial(pink,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(pink,Standard_False); - - Fit(); - - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Face WhiteFace, BrownFace, RedFace, PinkFace; \n\ -TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Edge5, Edge6, Edge7; \n\ -TopoDS_Wire Wire1; \n\ -gp_Pnt P1, P2, P3, P4, P5, P6, P7; \n\ -\n\ -////////The white Face \n\ -\n\ -gp_Sphere sphere (gp_Ax3(gp_Pnt(0,0,0),gp_Dir(1,0,0)),150); \n\ -\n\ -WhiteFace = BRepBuilderAPI_MakeFace(sphere,0.1,0.7,0.2,0.9); \n\ -\n\ -////////The red face \n\ -\n\ -P1.SetCoord(-15,200,10); \n\ -P2.SetCoord(5,204,0); \n\ -P3.SetCoord(15,200,0); \n\ -P4.SetCoord(-15,20,15); \n\ -P5.SetCoord(-5,20,0); \n\ -P6.SetCoord(15,20,35); \n\ -TColgp_Array2OfPnt array(1,3,1,2); \n\ -array.SetValue(1,1,P1); \n\ -array.SetValue(2,1,P2); \n\ -array.SetValue(3,1,P3); \n\ -array.SetValue(1,2,P4); \n\ -array.SetValue(2,2,P5); \n\ -array.SetValue(3,2,P6); \n\ -Handle (Geom_BSplineSurface) curve = GeomAPI_PointsToBSplineSurface(array,3,8,GeomAbs_C2,0.001); \n\ -\n\ -RedFace = BRepBuilderAPI_MakeFace(curve); \n\ -\n\ -////////The brown face \n\ -\n\ -gp_Circ circle(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(1,0,0)),80); \n\ -Edge1 = BRepBuilderAPI_MakeEdge(circle,0,PI); \n\ -\n\ -Edge2 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,0,-80),gp_Pnt(0,-10,40)); \n\ -Edge3 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,-10,40),gp_Pnt(0,0,80)); \n\ -\n\ -TopoDS_Wire YellowWire; \n\ -BRepBuilderAPI_MakeWire MW1(Edge1,Edge2,Edge3); \n\ -if (MW1.IsDone()) { \n\ - YellowWire = MW1; \n\ -} \n\ -\n\ -BrownFace = BRepBuilderAPI_MakeFace(YellowWire); \n\ -\n"); -Message +=("\ -////////The pink face \n\ -\n\ -P1.SetCoord(35,-200,40); \n\ -P2.SetCoord(50,-204,30); \n\ -P3.SetCoord(65,-200,30); \n\ -P4.SetCoord(35,-20,45); \n\ -P5.SetCoord(45,-20,30); \n\ -P6.SetCoord(65,-20,65); \n\ -TColgp_Array2OfPnt array2(1,3,1,2); \n\ -array2.SetValue(1,1,P1); \n\ -array2.SetValue(2,1,P2); \n\ -array2.SetValue(3,1,P3); \n\ -array2.SetValue(1,2,P4); \n\ -array2.SetValue(2,2,P5); \n\ -array2.SetValue(3,2,P6); \n\ - \n\ -Handle (Geom_BSplineSurface) BSplineSurf = GeomAPI_PointsToBSplineSurface(array2,3,8,GeomAbs_C2,0.001); \n\ - \n\ -TopoDS_Face aFace = BRepBuilderAPI_MakeFace(BSplineSurf); \n\ -\n\ -//2d lines \n\ -gp_Pnt2d P12d(0.9,0.1); \n\ -gp_Pnt2d P22d(0.2,0.7); \n\ -gp_Pnt2d P32d(0.02,0.1); \n\ -\n\ -Handle (Geom2d_Line) line1= \n\ - new Geom2d_Line(P12d,gp_Dir2d((0.2-0.9),(0.7-0.1))); \n\ -Handle (Geom2d_Line) line2= \n\ - new Geom2d_Line(P22d,gp_Dir2d((0.02-0.2),(0.1-0.7))); \n\ -Handle (Geom2d_Line) line3= \n\ - new Geom2d_Line(P32d,gp_Dir2d((0.9-0.02),(0.1-0.1))); \n\ - \n\ -//Edges are on the BSpline surface \n\ -Edge1 = BRepBuilderAPI_MakeEdge(line1,BSplineSurf,0,P12d.Distance(P22d)); \n\ -Edge2 = BRepBuilderAPI_MakeEdge(line2,BSplineSurf,0,P22d.Distance(P32d)); \n\ -Edge3 = BRepBuilderAPI_MakeEdge(line3,BSplineSurf,0,P32d.Distance(P12d)); \n\ -\n\ -Wire1 = BRepBuilderAPI_MakeWire(Edge1,Edge2,Edge3); \n\ -Wire1.Reverse(); \n\ -PinkFace = BRepBuilderAPI_MakeFace(aFace,Wire1); \n\ -BRepLib::BuildCurves3d(PinkFace); \n\ -\n\ -\n"); - -PocessTextInDialog("Make face ", Message); -} - -void CModelingDoc::OnShell() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TColgp_Array2OfPnt Poles(1,2,1,4); - Poles.SetValue(1,1,gp_Pnt(0,0,0)); - Poles.SetValue(1,2,gp_Pnt(0,10,2)); - Poles.SetValue(1,3,gp_Pnt(0,20,10)); - Poles.SetValue(1,4,gp_Pnt(0,30,0)); - Poles.SetValue(2,1,gp_Pnt(10,0,5)); - Poles.SetValue(2,2,gp_Pnt(10,10,3)); - Poles.SetValue(2,3,gp_Pnt(10,20,20)); - Poles.SetValue(2,4,gp_Pnt(10,30,0)); - - TColStd_Array1OfReal UKnots(1,2); - UKnots.SetValue(1,0); - UKnots.SetValue(2,1); - - TColStd_Array1OfInteger UMults(1,2); - UMults.SetValue(1,2); - UMults.SetValue(2,2); - - TColStd_Array1OfReal VKnots(1,3); - VKnots.SetValue(1,0); - VKnots.SetValue(2,1); - VKnots.SetValue(3,2); - - TColStd_Array1OfInteger VMults(1,3); - VMults.SetValue(1,3); - VMults.SetValue(2,1); - VMults.SetValue(3,3); - - Standard_Integer UDegree(1); - Standard_Integer VDegree(2); - - Handle (Geom_BSplineSurface) BSpline = new Geom_BSplineSurface(Poles,UKnots,VKnots,UMults,VMults,UDegree,VDegree); - - TopoDS_Face WhiteFace = BRepBuilderAPI_MakeFace(BSpline, Precision::Confusion()); - - - Handle(AIS_Shape) white = new AIS_Shape(WhiteFace); - myAISContext->SetColor (white, Quantity_NOC_WHITE, Standard_False); - myAISContext->SetMaterial(white,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetTransparency (white, 0.7, Standard_False); - myAISContext->Display(white,Standard_False); - - - TopoDS_Shell aShell = BRepBuilderAPI_MakeShell(BSpline); - Handle(AIS_Shape) anAISShell = new AIS_Shape(aShell); - myAISContext->SetDisplayMode (anAISShell, 0, Standard_False); - myAISContext->Display(anAISShell,Standard_False); - //myAISContext->SetSelected(anAISShell); - - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TColgp_Array2OfPnt Poles(1,2,1,4); \n\ -Poles.SetValue(1,1,gp_Pnt(0,0,0)); \n\ -Poles.SetValue(1,2,gp_Pnt(0,10,2)); \n\ -Poles.SetValue(1,3,gp_Pnt(0,20,10)); \n\ -Poles.SetValue(1,4,gp_Pnt(0,30,0)); \n\ -Poles.SetValue(2,1,gp_Pnt(10,0,5)); \n\ -Poles.SetValue(2,2,gp_Pnt(10,10,3)); \n\ -Poles.SetValue(2,3,gp_Pnt(10,20,20)); \n\ -Poles.SetValue(2,4,gp_Pnt(10,30,0)); \n\ -\n\ -TColStd_Array1OfReal UKnots(1,2); \n\ -UKnots.SetValue(1,0); \n\ -UKnots.SetValue(2,1); \n\ -\n\ -TColStd_Array1OfInteger UMults(1,2); \n\ -UMults.SetValue(1,2); \n\ -UMults.SetValue(2,2); \n\ -\n\ -TColStd_Array1OfReal VKnots(1,3); \n\ -VKnots.SetValue(1,0); \n\ -VKnots.SetValue(2,1); \n\ -VKnots.SetValue(3,2); \n\ -\n\ -TColStd_Array1OfInteger VMults(1,3); \n\ -VMults.SetValue(1,3); \n\ -VMults.SetValue(2,1); \n\ -VMults.SetValue(3,3); \n\ -\n\ -Standard_Integer UDegree(1); \n\ -Standard_Integer VDegree(2); \n\ - \n\ -Handle (Geom_BSplineSurface) BSpline = new Geom_BSplineSurface(Poles,UKnots,VKnots,UMults,VMults,UDegree,VDegree); \n\ - \n\ -TopoDS_Shell aShell = BRepBuilderAPI_MakeShell(BSpline); \n\ -\n\ -\n"); - - PocessTextInDialog("Make shell", Message); - -} - -void CModelingDoc::OnCompound() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - BRep_Builder builder; - TopoDS_Compound Comp; - builder.MakeCompound(Comp); - - TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(gp_Pnt(-20,10,-30)); - builder.Add(Comp,aVertex); - - gp_Lin line(gp_Ax1(gp_Pnt(10,10,10),gp_Dir(1,0,0))); - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(line,-20,10); - builder.Add(Comp,anEdge); - - gp_Sphere sphere (gp_Ax3(gp_Pnt(-80,0,0),gp_Dir(1,0,0)),150); - TopoDS_Face aFace = BRepBuilderAPI_MakeFace(sphere,0.1,0.7,0.2,0.9); - builder.Add(Comp,aFace); - - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(gp_Pnt(-60, 0, 0), 30, 60, 40).Shape(); - builder.Add(Comp,aBox); - - Handle(AIS_Shape) white = new AIS_Shape(Comp); - myAISContext->SetDisplayMode (white, 0, Standard_False); - myAISContext->Display(white,Standard_False); - - Fit(); - - - TCollection_AsciiString Message ("\ - \n\ -BRep_Builder builder; \n\ -TopoDS_Compound Comp; \n\ -builder.MakeCompound(Comp); \n\ -\n\ -TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(gp_Pnt(-20,10,-30)); \n\ -builder.Add(Comp,aVertex); \n\ - \n\ -gp_Lin line(gp_Ax1(gp_Pnt(10,10,10),gp_Dir(1,0,0))); \n\ -TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(line,-20,10); \n\ -builder.Add(Comp,anEdge); \n\ - \n\ -gp_Sphere sphere (gp_Ax3(gp_Pnt(-80,0,0),gp_Dir(1,0,0)),150); \n\ -TopoDS_Face aFace = BRepBuilderAPI_MakeFace(sphere,0.1,0.7,0.2,0.9); \n\ -builder.Add(Comp,aFace); \n\ - \n\ -TopoDS_Shape aBox = BRepPrimAPI_MakeBox(gp_Pnt(-60,0,0),30,60,40); \n\ -builder.Add(Comp,aBox); \n\ - \n\ -\n"); - - PocessTextInDialog("Make compound ", Message); - -} - - - - - -void CModelingDoc::OnSewing() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - gp_Pnt P(0,0,0); - gp_Vec V(0,0,1); - Handle(Geom_Plane) Pi=new Geom_Plane(P,V); - Handle(Geom_RectangularTrimmedSurface) GeometricSurface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.); - TopoDS_Shape FirstShape = BRepBuilderAPI_MakeFace(GeometricSurface, Precision::Confusion()); - - Handle(AIS_Shape) white1 = new AIS_Shape(FirstShape); - - myAISContext->SetColor(white1,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(white1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetTransparency(white1,0.4,Standard_False); - myAISContext->Display(white1,Standard_False); - //Sleep(1000); - - gp_Pnt P1(0,0,0); - gp_Pnt P2(50,0,0); - gp_Pnt P3(100,0,0); - gp_Pnt P4(25,12,85); - gp_Pnt P5(100,0,80); - gp_Pnt P6(135,-12,85); - - TColgp_Array2OfPnt Array(1,3,1,2); - Array.SetValue(1,1,P1); - Array.SetValue(2,1,P2); - Array.SetValue(3,1,P3); - Array.SetValue(1,2,P4); - Array.SetValue(2,2,P5); - Array.SetValue(3,2,P6); - - Handle (Geom_BSplineSurface) aSurf = GeomAPI_PointsToBSplineSurface(Array,3,8,GeomAbs_C2,0.00001); - TopoDS_Shape SecondShape = BRepBuilderAPI_MakeFace(aSurf, Precision::Confusion()); - - Handle(AIS_Shape) white2 = new AIS_Shape(SecondShape); - - myAISContext->SetColor(white2,Quantity_NOC_YELLOW,Standard_False); - myAISContext->SetMaterial(white2,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->SetTransparency(white2,0.4,Standard_False); - myAISContext->Display(white2,Standard_False); - - //Sleep(1000); - - BRepOffsetAPI_Sewing aMethod; - aMethod.Add(FirstShape); - aMethod.Add(SecondShape); - - aMethod.Perform(); - - TopoDS_Shape sewedShape = aMethod.SewedShape(); - - Handle(AIS_Shape) result = new AIS_Shape(sewedShape); - myAISContext->SetDisplayMode(result,0,Standard_False); - myAISContext->Display(result,Standard_False); - - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -///////The first shape \n\ - \n\ -gp_Pnt P(0,0,0); \n\ -gp_Vec V(0,0,1); \n\ -Handle(Geom_Plane) Pi=new Geom_Plane(P,V); \n\ -Handle(Geom_RectangularTrimmedSurface) GeometricSurface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.); \n\ -TopoDS_Shape FirstShape = BRepBuilderAPI_MakeFace(GeometricSurface); \n\ - \n\ -///////The second shape \n\ - \n\ -gp_Pnt P1(0,0,0); \n\ -gp_Pnt P2(50,0,0); \n\ -gp_Pnt P3(100,0,0); \n\ -gp_Pnt P4(25,12,85); \n\ -gp_Pnt P5(100,0,80); \n\ -gp_Pnt P6(135,-12,85); \n\ -\n\ -TColgp_Array2OfPnt Array(1,3,1,2); \n\ -Array.SetValue(1,1,P1); \n\ -Array.SetValue(2,1,P2); \n\ -Array.SetValue(3,1,P3); \n\ -Array.SetValue(1,2,P4); \n\ -Array.SetValue(2,2,P5); \n\ -Array.SetValue(3,2,P6); \n\ -\n\ -Handle (Geom_BSplineSurface) aSurf = GeomAPI_PointsToBSplineSurface(Array,3,8,GeomAbs_C2,0.00001); \n\ -TopoDS_Shape SecondShape = BRepBuilderAPI_MakeFace(aSurf); \n\ - \n\ -BRepOffsetAPI_Sewing aMethod; \n\ -aMethod.Add(FirstShape); \n\ -aMethod.Add(SecondShape); \n\ -\n\ -aMethod.Perform(); \n\ -\n\ -TopoDS_Shape sewedShape = aMethod.SewedShape(); \n\ - \n\ -\n"); - - PocessTextInDialog("Sew faces ", Message); - -} - - - - - - - -void CModelingDoc::OnBuilder() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - //The tolerance is the tolerance of confusion - Standard_Real precision = Precision::Confusion(); - - //The builder - BRep_Builder B; - - //Build the vertices - TopoDS_Vertex V000, V001, V010, V011, V100, V101, V110, V111; - B.MakeVertex(V000,gp_Pnt(0,0,0),precision); - B.MakeVertex(V001,gp_Pnt(0,0,100),precision); - B.MakeVertex(V010,gp_Pnt(0,150,0),precision); - B.MakeVertex(V011,gp_Pnt(0,150,100),precision); - B.MakeVertex(V100,gp_Pnt(200,0,0),precision); - B.MakeVertex(V101,gp_Pnt(200,0,100),precision); - B.MakeVertex(V110,gp_Pnt(200,150,0),precision); - B.MakeVertex(V111,gp_Pnt(200,150,100),precision); - - //Build the edges - //the edges are oriented as the axis X,Y,Z - TopoDS_Edge EX00, EX01, EX10, EX11; - TopoDS_Edge EY00, EY01, EY10, EY11; - TopoDS_Edge EZ00, EZ01, EZ10, EZ11; - Handle (Geom_Line) L; - - //Edge X00 - L = new Geom_Line(gp_Pnt(0,0,0),gp_Dir(1,0,0)); - B.MakeEdge(EX00,L,precision); - V000.Orientation(TopAbs_FORWARD); - V100.Orientation(TopAbs_REVERSED); - B.Add(EX00,V000); - B.Add(EX00,V100); - //Parameters - B.UpdateVertex(V000,0,EX00,precision); - B.UpdateVertex(V100,200,EX00,precision); - - //Edge X10 - L = new Geom_Line(gp_Pnt(0,150,0),gp_Dir(1,0,0)); - B.MakeEdge(EX10,L,precision); - V010.Orientation(TopAbs_FORWARD); - V110.Orientation(TopAbs_REVERSED); - B.Add(EX10,V010); - B.Add(EX10,V110); - //Parameters - B.UpdateVertex(V010,0,EX10,precision); - B.UpdateVertex(V110,200,EX10,precision); - - //Edge Y00 - L = new Geom_Line(gp_Pnt(0,0,0),gp_Dir(0,1,0)); - B.MakeEdge(EY00,L,precision); - V000.Orientation(TopAbs_FORWARD); - V010.Orientation(TopAbs_REVERSED); - B.Add(EY00,V000); - B.Add(EY00,V010); - //Parameters - B.UpdateVertex(V000,0,EY00,precision); - B.UpdateVertex(V010,150,EY00,precision); - - //Edge Y10 - L = new Geom_Line(gp_Pnt(200,0,0),gp_Dir(0,1,0)); - B.MakeEdge(EY10,L,precision); - V100.Orientation(TopAbs_FORWARD); - V110.Orientation(TopAbs_REVERSED); - B.Add(EY10,V100); - B.Add(EY10,V110); - //Parameters - B.UpdateVertex(V100,0,EY10,precision); - B.UpdateVertex(V110,150,EY10,precision); - - //Edge Y01 - L = new Geom_Line(gp_Pnt(0,0,100),gp_Dir(0,1,0)); - B.MakeEdge(EY01,L,precision); - V001.Orientation(TopAbs_FORWARD); - V011.Orientation(TopAbs_REVERSED); - B.Add(EY01,V001); - B.Add(EY01,V011); - //Parameters - B.UpdateVertex(V001,0,EY01,precision); - B.UpdateVertex(V011,150,EY01,precision); - - //Edge Y11 - L = new Geom_Line(gp_Pnt(200,0,100),gp_Dir(0,1,0)); - B.MakeEdge(EY11,L,precision); - V101.Orientation(TopAbs_FORWARD); - V111.Orientation(TopAbs_REVERSED); - B.Add(EY11,V101); - B.Add(EY11,V111); - //Parameters - B.UpdateVertex(V101,0,EY11,precision); - B.UpdateVertex(V111,150,EY11,precision); - - //Edge Z00 - L = new Geom_Line(gp_Pnt(0,0,0),gp_Dir(0,0,1)); - B.MakeEdge(EZ00,L,precision); - V000.Orientation(TopAbs_FORWARD); - V001.Orientation(TopAbs_REVERSED); - B.Add(EZ00,V000); - B.Add(EZ00,V001); - //Parameters - B.UpdateVertex(V000,0,EZ00,precision); - B.UpdateVertex(V001,100,EZ00,precision); - - //Edge Z01 - L = new Geom_Line(gp_Pnt(0,150,0),gp_Dir(0,0,1)); - B.MakeEdge(EZ01,L,precision); - V010.Orientation(TopAbs_FORWARD); - V011.Orientation(TopAbs_REVERSED); - B.Add(EZ01,V010); - B.Add(EZ01,V011); - //Parameters - B.UpdateVertex(V010,0,EZ01,precision); - B.UpdateVertex(V011,100,EZ01,precision); - - //Edge Z10 - L = new Geom_Line(gp_Pnt(200,0,0),gp_Dir(0,0,1)); - B.MakeEdge(EZ10,L,precision); - V100.Orientation(TopAbs_FORWARD); - V101.Orientation(TopAbs_REVERSED); - B.Add(EZ10,V100); - B.Add(EZ10,V101); - //Parameters - B.UpdateVertex(V100,0,EZ10,precision); - B.UpdateVertex(V101,100,EZ10,precision); - - //Edge Z11 - L = new Geom_Line(gp_Pnt(200,150,0),gp_Dir(0,0,1)); - B.MakeEdge(EZ11,L,precision); - V110.Orientation(TopAbs_FORWARD); - V111.Orientation(TopAbs_REVERSED); - B.Add(EZ11,V110); - B.Add(EZ11,V111); - //Parameters - B.UpdateVertex(V110,0,EZ11,precision); - B.UpdateVertex(V111,100,EZ11,precision); - - - //Circular Edges - Handle (Geom_Circle) C; - //Standard_Real R = 100; - - //Edge EX01 - C = new Geom_Circle(gp_Ax2(gp_Pnt(100,0,100),gp_Dir(0,1,0),gp_Dir(-1,0,0)),100); - B.MakeEdge(EX01,C,precision); - V001.Orientation(TopAbs_FORWARD); - V101.Orientation(TopAbs_REVERSED); - B.Add(EX01,V001); - B.Add(EX01,V101); - //Parameters - B.UpdateVertex(V001,0,EX01,precision); - B.UpdateVertex(V101,M_PI,EX01,precision); - - //Edge EX11 - C = new Geom_Circle(gp_Ax2(gp_Pnt(100,150,100),gp_Dir(0,1,0),gp_Dir(-1,0,0)),100); - B.MakeEdge(EX11,C,precision); - V011.Orientation(TopAbs_FORWARD); - V111.Orientation(TopAbs_REVERSED); - B.Add(EX11,V011); - B.Add(EX11,V111); - //Parameters - B.UpdateVertex(V011,0,EX11,precision); - B.UpdateVertex(V111,M_PI,EX11,precision); - - //Build wire and faces - //Faces normals are along the axis X,Y,Z - TopoDS_Face FXMIN, FXMAX, FYMIN, FYMAX, FZMIN, FZMAX; - TopoDS_Wire W; - Handle (Geom_Plane) P; - Handle (Geom2d_Line) L2d; - Handle (Geom2d_Circle) C2d; - Handle (Geom_CylindricalSurface) S; - - //Face FXMAX - P = new Geom_Plane(gp_Ax2(gp_Pnt(200,0,0),gp_Dir(1,0,0),gp_Dir(0,1,0))); - B.MakeFace(FXMAX,P,precision); - //the wire and the edges - B.MakeWire (W); - - EY10.Orientation(TopAbs_FORWARD); - B.Add(W,EY10); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(1,0)); - B.UpdateEdge(EY10,L2d,FXMAX,precision); - - EZ11.Orientation(TopAbs_FORWARD); - B.Add(W,EZ11); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(150,0),gp_Dir2d(0,1)); - B.UpdateEdge(EZ11,L2d,FXMAX,precision); - - EY11.Orientation(TopAbs_REVERSED); - B.Add(W,EY11); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,100),gp_Dir2d(1,0)); - B.UpdateEdge(EY11,L2d,FXMAX,precision); - - EZ10.Orientation(TopAbs_REVERSED); - B.Add(W,EZ10); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); - B.UpdateEdge(EZ10,L2d,FXMAX,precision); - - B.Add(FXMAX,W); - - //Face FXMIN - P = new Geom_Plane(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(-1,0,0),gp_Dir(0,0,1))); - B.MakeFace(FXMIN,P,precision); - //the wire and the edges - B.MakeWire (W); - - EZ00.Orientation(TopAbs_FORWARD); - B.Add(W,EZ00); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(1,0)); - B.UpdateEdge(EZ00,L2d,FXMIN,precision); - - EY01.Orientation(TopAbs_FORWARD); - B.Add(W,EY01); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(100,0),gp_Dir2d(0,1)); - B.UpdateEdge(EY01,L2d,FXMIN,precision); - - EZ01.Orientation(TopAbs_REVERSED); - B.Add(W,EZ01); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,150),gp_Dir2d(1,0)); - B.UpdateEdge(EZ01,L2d,FXMIN,precision); - - EY00.Orientation(TopAbs_REVERSED); - B.Add(W,EY00); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); - B.UpdateEdge(EY00,L2d,FXMIN,precision); - - - B.Add(FXMIN,W); - - //Face FYMAX - - P = new Geom_Plane(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,1,0),gp_Dir(0,0,1))); - B.MakeFace(FYMAX,P,precision); - //the wire and the edges - B.MakeWire (W); - - EZ00.Orientation(TopAbs_FORWARD); - B.Add(W,EZ00); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(1,0)); - B.UpdateEdge(EZ00,L2d,FYMAX,precision); - - EX01.Orientation(TopAbs_FORWARD); - B.Add(W,EX01); - //pcurve - C2d = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(100,100),gp_Dir2d(0,-1)),100); - B.UpdateEdge(EX01,C2d,FYMAX,precision); - B.UpdateVertex(V001,0,EX01,FYMAX,precision); - B.UpdateVertex(V101,M_PI,EX01,FYMAX,precision); - - EZ10.Orientation(TopAbs_REVERSED); - B.Add(W,EZ10); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,200),gp_Dir2d(1,0)); - B.UpdateEdge(EZ10,L2d,FYMAX,precision); - - EX00.Orientation(TopAbs_REVERSED); - B.Add(W,EX00); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); - B.UpdateEdge(EX00,L2d,FYMAX,precision); - - - B.Add(FYMAX,W); - - - - //Face FYMIN - P = new Geom_Plane(gp_Ax2(gp_Pnt(0,150,0),gp_Dir(0,1,0),gp_Dir(0,0,1))); - B.MakeFace(FYMIN,P,precision); - //the wire and the edges - B.MakeWire (W); - - EZ01.Orientation(TopAbs_FORWARD); - B.Add(W,EZ01); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(1,0)); - B.UpdateEdge(EZ01,L2d,FYMIN,precision); - - EX11.Orientation(TopAbs_FORWARD); - B.Add(W,EX11); - //pcurve - C2d = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(100,100),gp_Dir2d(0,-1)),100); - B.UpdateEdge(EX11,C2d,FYMIN,precision); - B.UpdateVertex(V011,0,EX11,FYMIN,precision); - B.UpdateVertex(V111,M_PI,EX11,FYMIN,precision); - - EZ11.Orientation(TopAbs_REVERSED); - B.Add(W,EZ11); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,200),gp_Dir2d(1,0)); - B.UpdateEdge(EZ11,L2d,FYMIN,precision); - - EX10.Orientation(TopAbs_REVERSED); - B.Add(W,EX10); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); - B.UpdateEdge(EX10,L2d,FYMIN,precision); - - B.Add(FYMIN,W); - - //Face FZMAX - P = new Geom_Plane(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,0,-1),gp_Dir(0,1,0))); - B.MakeFace(FZMAX,P,precision); - //the wire and the edges - B.MakeWire (W); - - EY00.Orientation(TopAbs_FORWARD); - B.Add(W,EY00); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(1,0)); - B.UpdateEdge(EY00,L2d,FZMAX,precision); - - EX10.Orientation(TopAbs_FORWARD); - B.Add(W,EX10); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(150,0),gp_Dir2d(0,1)); - B.UpdateEdge(EX10,L2d,FZMAX,precision); - - EY10.Orientation(TopAbs_REVERSED); - B.Add(W,EY10); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,200),gp_Dir2d(1,0)); - B.UpdateEdge(EY10,L2d,FZMAX,precision); - - EX00.Orientation(TopAbs_REVERSED); - B.Add(W,EX00); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); - B.UpdateEdge(EX00,L2d,FZMAX,precision); - - - B.Add(FZMAX,W); - - //Face FZMIN - S = new Geom_CylindricalSurface(gp_Ax3(gp_Pnt(100,0,100),gp_Dir(0,1,0),gp_Dir(-1,0,0)),100); - B.MakeFace(FZMIN,S,precision); - - //the wire and the edges - B.MakeWire (W); - - EX01.Orientation(TopAbs_FORWARD); - B.Add(W,EX01); - //pcurve - L2d = new Geom2d_Line(gp_Ax2d(gp_Pnt2d(0,0),gp_Dir2d(1,0))); - B.UpdateEdge(EX01,L2d,FZMIN,precision); - B.UpdateVertex(V001,0,EX01,FZMIN,precision); - B.UpdateVertex(V101,M_PI,EX01,FZMIN,precision); - - EY11.Orientation(TopAbs_FORWARD); - B.Add(W,EY11); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(M_PI,0),gp_Dir2d(0,1)); - B.UpdateEdge(EY11,L2d,FZMIN,precision); - - EX11.Orientation(TopAbs_REVERSED); - B.Add(W,EX11); - //pcurve - L2d = new Geom2d_Line(gp_Ax2d(gp_Pnt2d(0,150),gp_Dir2d(1,0))); - B.UpdateEdge(EX11,L2d,FZMIN,precision); - B.UpdateVertex(V111,M_PI,EX11,FZMIN,precision); - B.UpdateVertex(V011,0,EX11,FZMIN,precision); - - EY01.Orientation(TopAbs_REVERSED); - B.Add(W,EY01); - //pcurve - L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); - B.UpdateEdge(EY01,L2d,FZMIN,precision); - - B.Add(FZMIN,W); - - FYMAX.Orientation(TopAbs_REVERSED); - - //Shell - TopoDS_Shell Sh; - B.MakeShell(Sh); - B.Add(Sh,FXMAX); - B.Add(Sh,FXMIN); - B.Add(Sh,FYMAX); - B.Add(Sh,FYMIN); - B.Add(Sh,FZMAX); - B.Add(Sh,FZMIN); - - // Solid - TopoDS_Solid Sol; - B.MakeSolid(Sol); - B.Add(Sol,Sh); - - Handle(AIS_Shape) borne = new AIS_Shape(Sol); - myAISContext->SetDisplayMode (borne, 1, Standard_False); - myAISContext->SetColor (borne, Quantity_NOC_RED, Standard_False); - myAISContext->SetMaterial(borne,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(borne,Standard_False); - - - Fit(); - TCollection_AsciiString Message ("\ - \n\ -//The tolerance is 0.01 \n\ -Standard_Real precision(0.01); \n\ -\n\ -//The builder \n\ -BRep_Builder B; \n\ -\n\ -//Build the vertices \n\ -TopoDS_Vertex V000, V001, V010, V011, V100, V101, V110, V111; \n\ -B.MakeVertex(V000,gp_Pnt(0,0,0),precision); \n\ -B.MakeVertex(V001,gp_Pnt(0,0,100),precision); \n\ -B.MakeVertex(V010,gp_Pnt(0,150,0),precision); \n\ -B.MakeVertex(V011,gp_Pnt(0,150,100),precision); \n\ -B.MakeVertex(V100,gp_Pnt(200,0,0),precision); \n\ -B.MakeVertex(V101,gp_Pnt(200,0,100),precision); \n\ -B.MakeVertex(V110,gp_Pnt(200,150,0),precision); \n\ -B.MakeVertex(V111,gp_Pnt(200,150,100),precision); \n\ -\n\ -//Build the edges \n\ -//the edges are oriented as the axis X,Y,Z \n\ -TopoDS_Edge EX00, EX01, EX10, EX11; \n\ -TopoDS_Edge EY00, EY01, EY10, EY11; \n\ -TopoDS_Edge EZ00, EZ01, EZ10, EZ11; \n\ -Handle (Geom_Line) L; \n\ -\n\ -//Edge X00 \n\ -L = new Geom_Line(gp_Pnt(0,0,0),gp_Dir(1,0,0)); \n\ -B.MakeEdge(EX00,L,precision); \n\ -V000.Orientation(TopAbs_FORWARD); \n\ -V100.Orientation(TopAbs_REVERSED); \n\ -B.Add(EX00,V000); \n\ -B.Add(EX00,V100); \n\ -//Parameters \n\ -B.UpdateVertex(V000,0,EX00,precision); \n\ -B.UpdateVertex(V100,200,EX00,precision); \n\ -\n\ -//Idem for all the linear edges... \n\ -\n\ -//Circular Edges \n\ -Handle (Geom_Circle) C; \n\ -Standard_Real R = 100; \n\ -\n\ -//Edge EX01 \n\ -C = new Geom_Circle(gp_Ax2(gp_Pnt(100,0,100),gp_Dir(0,1,0),gp_Dir(-1,0,0)),100); \n\ -B.MakeEdge(EX01,C,precision); \n\ -V001.Orientation(TopAbs_FORWARD); \n\ -V101.Orientation(TopAbs_REVERSED); \n\ -B.Add(EX01,V001); \n\ -B.Add(EX01,V101); \n\ -//Parameters \n\ -B.UpdateVertex(V001,0,EX01,precision); \n\ -B.UpdateVertex(V101,PI,EX01,precision); \n\ -\n\ -//Idem for EX11 \n\ -\n\ -//Build wire and faces \n\ -//Faces normals are along the axis X,Y,Z \n\ -TopoDS_Face FXMIN, FXMAX, FYMIN, FYMAX, FZMIN, FZMAX; \n\ -TopoDS_Wire W; \n\ -Handle (Geom_Plane) P; \n\ -Handle (Geom2d_Line) L2d; \n\ -Handle (Geom2d_Circle) C2d; \n\ -Handle (Geom_CylindricalSurface) S; \n\ -\n\ -//Face FXMAX \n\ -P = new Geom_Plane(gp_Ax2(gp_Pnt(200,0,0),gp_Dir(1,0,0),gp_Dir(0,1,0))); \n\ -B.MakeFace(FXMAX,P,precision); \n\ -//the wire and the edges \n\ -B.MakeWire (W); \n"); -Message += ("\ -\n\ -EY10.Orientation(TopAbs_FORWARD); \n\ -B.Add(W,EY10); \n\ -//pcurve \n\ -L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(1,0)); \n\ -B.UpdateEdge(EY10,L2d,FXMAX,precision); \n\ - \n\ -EZ11.Orientation(TopAbs_FORWARD); \n\ -B.Add(W,EZ11); \n\ -//pcurve \n\ -L2d = new Geom2d_Line(gp_Pnt2d(150,0),gp_Dir2d(0,1)); \n\ -B.UpdateEdge(EZ11,L2d,FXMAX,precision); \n\ - \n\ -EY11.Orientation(TopAbs_REVERSED); \n\ -B.Add(W,EY11); \n\ -//pcurve \n\ -L2d = new Geom2d_Line(gp_Pnt2d(0,100),gp_Dir2d(1,0)); \n\ -B.UpdateEdge(EY11,L2d,FXMAX,precision); \n\ - \n\ -EZ10.Orientation(TopAbs_REVERSED); \n\ -B.Add(W,EZ10); \n\ -//pcurve \n\ -L2d = new Geom2d_Line(gp_Pnt2d(0,0),gp_Dir2d(0,1)); \n\ -B.UpdateEdge(EZ10,L2d,FXMAX,precision); \n\ -\n\ -B.Add(FXMAX,W); \n\ -\n\ -//Idem for other faces... \n\ -\n\ -//Shell \n\ -TopoDS_Shell Sh; \n\ -B.MakeShell(Sh); \n\ -B.Add(Sh,FXMAX); \n\ -B.Add(Sh,FXMIN); \n\ -B.Add(Sh,FYMAX); \n\ -B.Add(Sh,FYMIN); \n\ -B.Add(Sh,FZMAX); \n\ -B.Add(Sh,FZMIN); \n\ -\n\ -// Solid \n\ -TopoDS_Solid Sol; \n\ -B.MakeSolid(Sol); \n\ -B.Add(Sol,Sh); \n\ -\n\ -\n"); - -PocessTextInDialog("Make a shape with a builder", Message); - -} - -void CModelingDoc::OnGeometrie() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - //geometry of a vertex - TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(gp_Pnt(0,120,70)); - gp_Pnt GeometricPoint = BRep_Tool::Pnt(aVertex); - - Handle(AIS_Shape) vert = new AIS_Shape(aVertex); - myAISContext->Display(vert,Standard_False); - Fit(); - Sleep (500); - - //geometry of an edge - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(100,50,250),gp_Pnt(-30,-100,-50)); - Handle(AIS_Shape) yellow = new AIS_Shape(anEdge); - myAISContext->SetWidth(yellow,2,Standard_False); - myAISContext->Display(yellow,Standard_False); - Fit(); - Sleep (500); - - TopLoc_Location location; - Standard_Real first, last; - Handle (Geom_Curve) aCurve = BRep_Tool::Curve(anEdge,location,first,last); - TopoDS_Edge anEdgeDS = BRepBuilderAPI_MakeEdge(aCurve); - - Handle (Geom_Line) aLine = Handle (Geom_Line)::DownCast(aCurve); - if (!aLine.IsNull()) { - Handle (AIS_Line) DispLine = new AIS_Line(aLine); - myAISContext->Display(DispLine,Standard_False); - Fit(); - Sleep (500); - } - - //geometry of a face - gp_Pnt P(-20,-20,-20); - gp_Vec V(0,0,1); - Handle(Geom_Plane) Pi=new Geom_Plane(P,V); - Handle(Geom_RectangularTrimmedSurface) Surface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.); - TopoDS_Face RedFace = BRepBuilderAPI_MakeFace(Surface, Precision::Confusion()); - - Handle(AIS_Shape) red = new AIS_Shape(RedFace); - myAISContext->SetColor(red,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(red,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(red,Standard_False); - Fit(); - Sleep (500); - - TopLoc_Location location2; - Handle (Geom_Surface) aGeometricSurface = BRep_Tool::Surface(RedFace,location2); - - Handle (Geom_Plane) aPlane = Handle (Geom_Plane)::DownCast(aGeometricSurface); - if (!aPlane.IsNull()) { - Handle (AIS_Plane) DispPlane = new AIS_Plane(aPlane); - myAISContext->Display(DispPlane,Standard_False); - - } - - - Fit(); - Sleep (500); - - - TCollection_AsciiString Message ("\ - \n\ -///////geometry of a vertex \n\ -TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(gp_Pnt(0,120,70)); \n\ -gp_Pnt GeometricPoint = BRep_Tool::Pnt(aVertex); \n\ -\n\ -///////geometry of an edge \n\ -TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(100,50,250),gp_Pnt(-30,-100,-50)); \n\ -\n\ -TopLoc_Location location; \n\ -Standard_Real first, last; \n\ -Handle (Geom_Curve) aCurve = BRep_Tool::Curve(anEdge,location,first,last); \n\ -TopoDS_Edge anEdgeDS = BRepBuilderAPI_MakeEdge(aCurve); \n\ -\n\ -Handle (Geom_Line) aLine = Handle (Geom_Line)::DownCast(aCurve); \n\ -if (!aLine.IsNull()) { \n\ - Handle (AIS_Line) DispLine = new AIS_Line(aLine); \n\ -} \n\ - \n\ -///////geometry of a face \n\ -gp_Pnt P(-20,-20,-20); \n\ -gp_Vec V(0,0,1); \n\ -Handle(Geom_Plane) Pi=new Geom_Plane(P,V); \n\ -Handle(Geom_RectangularTrimmedSurface) Surface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.); \n\ -TopoDS_Face RedFace = BRepBuilderAPI_MakeFace(Surface); \n\ -\n\ -TopLoc_Location location2; \n\ -Handle (Geom_Surface) aGeometricSurface = BRep_Tool::Surface(RedFace,location2); \n\ -\n\ -Handle (Geom_Plane) aPlane = Handle (Geom_Plane)::DownCast(aGeometricSurface); \n\ -if (!aPlane.IsNull()) { \n\ - Handle (AIS_Plane) DispPlane = new AIS_Plane(aPlane); \n\ -} \n\ -\n\ -\n"); - - PocessTextInDialog("Recover the geometry of vertex, edge and face ", Message); - - -} - -void CModelingDoc::OnExplorer() -{ - myAISContext->RemoveAll (false); - - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(100, 100, 100).Shape(); - Standard_Integer j(8); - Handle(AIS_ColoredShape) theBox = new AIS_ColoredShape(aBox); - myAISContext->SetColor(theBox,Quantity_NOC_RED,Standard_False); - myAISContext->SetMaterial(theBox,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(theBox, AIS_Shaded, 0,Standard_False); - Fit(); - Sleep(500); - - for (TopExp_Explorer exp (aBox,TopAbs_FACE);exp.More();exp.Next()) - { - TopoDS_Face aCurrentFace = TopoDS::Face(exp.Current()); - { - Handle(AIS_ColoredDrawer) aSubFaceAspects = theBox->CustomAspects (aCurrentFace); - aSubFaceAspects->SetShadingAspect (new Prs3d_ShadingAspect()); - *aSubFaceAspects->ShadingAspect()->Aspect() = *theBox->Attributes()->ShadingAspect()->Aspect(); - aSubFaceAspects->ShadingAspect()->Aspect()->ChangeFrontMaterial().SetTransparency (0.8f); - myAISContext->Redisplay (theBox, false); - } - - //test the orientation of the current face - TopAbs_Orientation orient = aCurrentFace.Orientation(); - - //Recover the geometric plane - TopLoc_Location location; - Handle (Geom_Surface) aGeometricSurface = BRep_Tool::Surface(aCurrentFace,location); - - Handle (Geom_Plane) aPlane = Handle (Geom_Plane)::DownCast(aGeometricSurface); - - //Build an AIS_Shape with a new color - Handle(AIS_Shape) theMovingFace = new AIS_Shape(aCurrentFace); - Quantity_NameOfColor aCurrentColor = (Quantity_NameOfColor)j; - myAISContext->SetColor(theMovingFace,aCurrentColor,Standard_False); - myAISContext->SetMaterial(theMovingFace,Graphic3d_NOM_PLASTIC,Standard_False); - //Find the normal vector of each face - gp_Pln agpPlane = aPlane->Pln(); - gp_Ax1 norm = agpPlane.Axis(); - gp_Dir dir = norm.Direction(); - gp_Vec move(dir); - - TopLoc_Location aLocation; - Handle (AIS_ConnectedInteractive) theTransformedDisplay = new AIS_ConnectedInteractive(); - theTransformedDisplay->Connect(theMovingFace, aLocation); - - Handle (Geom_Transformation) theMove = new Geom_Transformation(aLocation.Transformation()); - myAISContext->Display(theTransformedDisplay,Standard_False); - myAISContext->UpdateCurrentViewer(); - Sleep (500); - - for (Standard_Integer i=1;i<=30;i++) - { - theMove->SetTranslation(move*i); - if (orient==TopAbs_FORWARD) myAISContext->SetLocation(theTransformedDisplay,TopLoc_Location(theMove->Trsf())); - else myAISContext->SetLocation(theTransformedDisplay,TopLoc_Location(theMove->Inverted()->Trsf())); - - myAISContext->Redisplay(theTransformedDisplay,true); - } - j+=15; - } - - myAISContext->UpdateCurrentViewer(); - Sleep (500); - - TCollection_AsciiString Message ("\ -\n\ -TopoDS_Shape aBox = BRepPrimAPI_MakeBox(100,100,100); \n\ -\n\ -for (TopExp_Explorer exp (aBox,TopAbs_FACE);exp.More();exp.Next()) { \n\ - TopoDS_Face aCurrentFace = TopoDS::Face(exp.Current()); \n\ -\n\ - //Recover the geometric plane \n\ - TopLoc_Location location; \n\ - Handle (Geom_Surface) aGeometricSurface = BRep_Tool::Surface(aCurrentFace,location); \n\ -\n\ - Handle (Geom_Plane) aPlane = Handle (Geom_Plane)::DownCast(aGeometricSurface); \n\ - \n\ -\n"); - PocessTextInDialog("Explode a shape in faces ", Message); - -} - -/* ================================================================================= - ==================== A N A L Y S I S ======================================== - ================================================================================= */ - -void CModelingDoc::OnValid() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TopoDS_Shape S = BRepPrimAPI_MakeBox(200., 300., 150.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - Fit(); - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepPrimI_MakeBox(200.,300.,150.);\n\ -Standard_Boolean theShapeIsValid = BRepAlgo::IsValid(S);\n\ -if ( theShapeIsValid )\n\ -{\n\ - MessageBox(\"The Shape Is Valid !! \",\"Checking Shape\");\n\ -}\n\ -else\n\ -{\n\ - MessageBox(\"The Shape Is NOT Valid !! \",\"Checking Shape\");\n\ -}\n\ -\n"); - PocessTextInDialog("Check a shape", Message); - - Standard_Boolean theShapeIsValid = BRepAlgo::IsValid(S); - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, theShapeIsValid ? L"The Shape Is Valid !! " : L"The Shape Is NOT Valid !! ", L"Checking Shape", MB_OK); -} - - -void CModelingDoc::OnLinear() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - - TColgp_Array1OfPnt Points1(1,4); - Points1.SetValue(1,gp_Pnt(0,0,0)); - Points1.SetValue(2,gp_Pnt(2,1,0)); - Points1.SetValue(3,gp_Pnt(4,0,0)); - Points1.SetValue(4,gp_Pnt(6,2,0)); - GeomAPI_PointsToBSpline PTBS1(Points1); - Handle(Geom_BSplineCurve) BSC1 = PTBS1.Curve(); - TopoDS_Edge S = BRepBuilderAPI_MakeEdge(BSC1).Edge(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - Fit(); - - - GProp_GProps System; - BRepGProp::LinearProperties(S,System); - gp_Pnt G = System.CentreOfMass (); - Standard_Real Length = System.Mass(); - gp_Mat I = System.MatrixOfInertia(); - - TCollection_ExtendedString string("Length Of all the Edges ="); - TCollection_ExtendedString string1(Length); - - string += string1; - string += "\nCenterOfMass : \n X="; - string1 = G.X(); - string += string1; - string += " Y="; - string1 = G.Y(); - string += string1; - string += " Z="; - string1 = G.Z(); - string += string1; - string +="\n"; - - string += "Matrix of Inertia :\n "; - string1 = I(1,1); - string += string1; - string += " " ; - string1 = I(1,2); - string += string1; - string += " " ; - string1 = I(1,3); - string += string1; - string += "\n " ; - string1 = I(2,1); - string += string1; - string += " " ; - string1 = I(2,2); - string += string1; - string += " " ; - string1 = I(2,3); - string += string1; - string += "\n " ; - string1 = I(3,1); - string += string1; - string += " " ; - string1 = I(3,2); - string += string1; - string += " " ; - string1 = I(3,3); - string += string1; - string += "\n" ; - - TCollection_AsciiString Message ("\ - \n\ -TColgp_Array1OfPnt Points1(1,4);\n\ -Points1.SetValue(1,gp_Pnt(0,0,0));\n\ -Points1.SetValue(2,gp_Pnt(2,1,0));\n\ -Points1.SetValue(3,gp_Pnt(4,0,0));\n\ -Points1.SetValue(4,gp_Pnt(6,2,0));\n\ -GeomAPI_PointsToBSpline PTBS1(Points1);\n\ -Handle(Geom_BSplineCurve) BSC1 = PTBS1.Curve();\n\ -TopoDS_Shape S = BRepBuilderAPI_MakeEdge(BSC1).Edge();\n\ -GProp_GProps System;\n\ -BRepGProp::LinearProperties(S,System);\n\ -gp_Pnt G = System.CentreOfMass ();\n\ -Standard_Real Length = System.Mass();\n\ -gp_Mat I = System.MatrixOfInertia();\n\ -\n"); - PocessTextInDialog("Linear Properties", Message); - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, string.ToWideString(), L"Linear Properties", MB_OK); -} - -void CModelingDoc::OnSurface() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - TColgp_Array1OfPnt Pnts1(1,3); - TColgp_Array1OfPnt Pnts2(1,3); - TColgp_Array1OfPnt Pnts3(1,3); - TColgp_Array1OfPnt Pnts4(1,3); - - Pnts1(1) = gp_Pnt(0,0,0); - Pnts1(2) = gp_Pnt(5,0,0); - Pnts1(3) = gp_Pnt(10,10,0); - - Pnts2(1) = gp_Pnt(10,10,0); - Pnts2(2) = gp_Pnt(5,12,4); - Pnts2(3) = gp_Pnt(0,15,10); - - Pnts3(1) = gp_Pnt(0,15,10); - Pnts3(2) = gp_Pnt(-12,10,11); - Pnts3(3) = gp_Pnt(-10,5,13); - - Pnts4(1) = gp_Pnt(-10,5,13); - Pnts4(2) = gp_Pnt(-2,-2,2); - Pnts4(3) = gp_Pnt(0,0,0); - - GeomAPI_PointsToBSpline PTBS1(Pnts1); - GeomAPI_PointsToBSpline PTBS2(Pnts2); - GeomAPI_PointsToBSpline PTBS3(Pnts3); - GeomAPI_PointsToBSpline PTBS4(Pnts4); - Handle(Geom_BSplineCurve) C1 = PTBS1.Curve(); - Handle(Geom_BSplineCurve) C2 = PTBS2.Curve(); - Handle(Geom_BSplineCurve) C3 = PTBS3.Curve(); - Handle(Geom_BSplineCurve) C4 = PTBS4.Curve(); - - GeomFill_BSplineCurves fill; - fill.Init(C1,C2,C3,C4,GeomFill_CoonsStyle); - Handle(Geom_BSplineSurface) BSS = fill.Surface(); - - TopoDS_Shape S = BRepBuilderAPI_MakeFace(BSS, Precision::Confusion()).Face(); - - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - Fit(); - - - GProp_GProps System; - BRepGProp::SurfaceProperties(S,System); - gp_Pnt G = System.CentreOfMass (); - Standard_Real Area = System.Mass(); - gp_Mat I = System.MatrixOfInertia(); - - TCollection_ExtendedString string("Area Of the Face ="); - TCollection_ExtendedString string1(Area); - - string += string1; - string += "\nCenterOfMass : \n X="; - string1 = G.X(); - string += string1; - string += " Y="; - string1 = G.Y(); - string += string1; - string += " Z="; - string1 = G.Z(); - string += string1; - string +="\n"; - - string += "Matrix of Inertia :\n "; - string1 = I(1,1); - string += string1; - string += " " ; - string1 = I(1,2); - string += string1; - string += " " ; - string1 = I(1,3); - string += string1; - string += "\n " ; - string1 = I(2,1); - string += string1; - string += " " ; - string1 = I(2,2); - string += string1; - string += " " ; - string1 = I(2,3); - string += string1; - string += "\n " ; - string1 = I(3,1); - string += string1; - string += " " ; - string1 = I(3,2); - string += string1; - string += " " ; - string1 = I(3,3); - string += string1; - string += "\n" ; - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepBuilderAPI_MakeFace(BSplineSurf).Face();\n\ -GProp_GProps System;\n\ -BRepGProp::SurfaceProperties(S,System);\n\ -gp_Pnt G = System.CentreOfMass ();\n\ -Standard_Real Area = System.Mass();\n\ -gp_Mat I = System.MatrixOfInertia();\n\ -\n"); - PocessTextInDialog("Surface Properties", Message); - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, string.ToWideString(), L"Surface Properties", MB_OK); - -} - -void CModelingDoc::OnVolume() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - - TopoDS_Shape S = BRepPrimAPI_MakeWedge(60.,100.,80.,20.).Shape(); - Handle(AIS_Shape) ais1 = new AIS_Shape(S); - myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); - myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False); - myAISContext->Display(ais1,Standard_False); - Fit(); - - - GProp_GProps System; - BRepGProp::VolumeProperties(S,System); - gp_Pnt G = System.CentreOfMass (); - Standard_Real Volume = System.Mass(); - gp_Mat I = System.MatrixOfInertia(); - - TCollection_ExtendedString string("Volume Of all the Shape ="); - TCollection_ExtendedString string1(Volume); - - string += string1; - string += "\nCenterOfMass : \n X="; - string1 = G.X(); - string += string1; - string += " Y="; - string1 = G.Y(); - string += string1; - string += " Z="; - string1 = G.Z(); - string += string1; - string +="\n"; - - string += "Matrix of Inertia :\n "; - string1 = I(1,1); - string += string1; - string += " " ; - string1 = I(1,2); - string += string1; - string += " " ; - string1 = I(1,3); - string += string1; - string += "\n " ; - string1 = I(2,1); - string += string1; - string += " " ; - string1 = I(2,2); - string += string1; - string += " " ; - string1 = I(2,3); - string += string1; - string += "\n " ; - string1 = I(3,1); - string += string1; - string += " " ; - string1 = I(3,2); - string += string1; - string += " " ; - string1 = I(3,3); - string += string1; - string += "\n" ; - - TCollection_AsciiString Message ("\ - \n\ -TopoDS_Shape S = BRepBuilderAPI_MakeWedge(60.,100.,80.,20.);;\n\ -GProp_GProps System;\n\ -BRepGProp::VolumeProperties(S,System);\n\ -gp_Pnt G = System.CentreOfMass ();\n\ -Standard_Real Volume = System.Mass();\n\ -gp_Mat I = System.MatrixOfInertia();\n\ -\n"); - PocessTextInDialog("Volume Properties", Message); - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, string.ToWideString(), L"Volume Properties", MB_OK); -} - - -void CModelingDoc::OnButtonFill() -{ - // TODO: Add your command handler code here - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) { - AIS1 = Handle(AIS_Shape)::DownCast(myAISContext->SelectedInteractive()); - myAISContext->Unhilight (AIS1, Standard_True); - myAISContext->Activate(AIS1,2); - myState = SELECT_EDGE_PLATE; - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select hole contour edges and then press right mouse button"); } - else { - AIS_ListOfInteractive LI; - myAISContext->DisplayedObjects(LI); - if(LI.IsEmpty()){ - if(OnFileImportBrep_WithInitDir (L"HoleFilling") == 1) - return; - myAISContext->DisplayedObjects(LI); - myAISContext->SetSelected(LI.First(), Standard_True); - OnButtonFill(); - return; - } - AfxMessageBox (L"Select a shape before!"); - } -} - -void CModelingDoc::OnStopStop() -{ - // TODO: Add your command handler code here - // Stop selection - if (myState == SELECT_EDGE_PLATE ) { - Standard_Integer nbedges = 0; - for (myAISContext->InitSelected(); myAISContext->MoreSelected(); - myAISContext->NextSelected()) { - nbedges++; - - } - Handle(GeomPlate_HArray1OfHCurve) Fronts = - new GeomPlate_HArray1OfHCurve(1, nbedges); - Handle(TColStd_HArray1OfInteger) Tang = - new TColStd_HArray1OfInteger(1,nbedges); - Handle(TColStd_HArray1OfInteger) NbPtsCur = - new TColStd_HArray1OfInteger(1,nbedges); - Standard_Integer i = 0; - TopoDS_Shape S1 = AIS1->Shape(); - TopTools_IndexedDataMapOfShapeListOfShape M; - TopExp::MapShapesAndAncestors(S1, TopAbs_EDGE, TopAbs_FACE, M); - - for (myAISContext->InitSelected(); myAISContext->MoreSelected();myAISContext->NextSelected()) { - i++; - Tang->SetValue(i,1); - NbPtsCur->SetValue(i,10); - TopoDS_Edge E = TopoDS::Edge(myAISContext->SelectedShape()); - TopoDS_Face F = TopoDS::Face(M.FindFromKey(E).First()); - - BRepAdaptor_Surface S(F); - GeomAdaptor_Surface aGAS = S.Surface(); - Handle(GeomAdaptor_Surface) aHGAS = new GeomAdaptor_Surface(aGAS); - - Handle(BRepAdaptor_Curve2d) C = new BRepAdaptor_Curve2d(); - C->Initialize(E,F); - - Adaptor3d_CurveOnSurface ConS(C,aHGAS); - - Handle (Adaptor3d_CurveOnSurface) HConS = new Adaptor3d_CurveOnSurface(ConS); - Fronts->SetValue(i,HConS); - } - GeomPlate_BuildPlateSurface abuildplate(NbPtsCur,Fronts,Tang,3); - abuildplate.Perform(); - if (!abuildplate.IsDone()){ // New in 2.0 - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Build plate not valid!", L"CasCade Error", MB_ICONERROR); - return; - } - Handle(GeomPlate_Surface) aplate = abuildplate.Surface(); - - GeomPlate_MakeApprox aMKS(aplate, Precision::Approximation(), 4, 7, 0.001, 1); - Handle(Geom_BSplineSurface) support = aMKS.Surface(); - BRepBuilderAPI_MakeWire MW; - TopTools_Array1OfShape tab(1,nbedges); - for (i=1 ; i<=nbedges ; i++) { - if (abuildplate.Sense()->Value(abuildplate.Order()->Value(i))==1) { - BRepBuilderAPI_MakeEdge ME(abuildplate.Curves2d()->Value(abuildplate.Order()->Value(i)), - support, - Fronts->Value(abuildplate.Order()->Value(i))->LastParameter(), - Fronts->Value(abuildplate.Order()->Value(i))->FirstParameter()); - TopoDS_Edge E = ME.Edge(); - BRepLib::BuildCurves3d(E); - tab(abuildplate.Order()->Value(i)) = E; - //MW.Add(E); - } - else { - BRepBuilderAPI_MakeEdge ME(abuildplate.Curves2d()->Value(abuildplate.Order()->Value(i)), - support, - Fronts->Value(abuildplate.Order()->Value(i))->FirstParameter(), - Fronts->Value(abuildplate.Order()->Value(i))->LastParameter()); - TopoDS_Edge E = ME.Edge(); - BRepLib::BuildCurves3d(E); - tab(abuildplate.Order()->Value(i)) = E; - } - } - for (i=1 ; i<=nbedges ; i++) - MW.Add(TopoDS::Edge(tab(i))); - TopoDS_Wire W; - try{ - W=MW.Wire(); - } - - catch(StdFail_NotDone) - { - AfxMessageBox (L"Can't build wire!"); - return; - } - - if (!(W.Closed())){ - AfxMessageBox (L"Wire is not closed!"); - return; - //throw Standard_Failure("Wire is not closed"); - - } - BRepBuilderAPI_MakeFace MF(support,W,Standard_True); - TopoDS_Face aface; - aface = MF.Face(); - BRepTopAdaptor_FClass2d clas2d(aface,Precision::Confusion()); - if (clas2d.PerformInfinitePoint() == TopAbs_IN) { - W.Reverse(); - BRepBuilderAPI_MakeFace MF1(support,W,Standard_True); - aface = MF1.Face(); - } - if (!BRepAlgo::IsValid(aface)) - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate face is not valid!", L"CasCade Error", MB_ICONERROR); - myState = -1; - Handle(AIS_Shape) anAISShape = new AIS_Shape(aface); - myAISContext->SetColor (anAISShape,Quantity_NOC_AZURE, Standard_False); - myAISContext->SetMaterial (anAISShape, Graphic3d_NOM_SILVER, Standard_False); - myAISContext->SetDisplayMode (anAISShape, 1, Standard_False); - myAISContext->Display (anAISShape, Standard_True); - } -} - -void CModelingDoc::OnFillwithtang() -{ - static BOOL flag = 0; - if (flag == 1){ - flag = 0; - Handle(AIS_InteractiveObject) aObject; - myAISContext ->InitSelected(); - if(myAISContext->MoreSelected()) - aObject = myAISContext->SelectedInteractive(); - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select a file with second face"); - if(OnFileImportBrep_WithInitDir (L"TangentSurface") == 1){ - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage(""); - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - myAISContext->UpdateCurrentViewer(); - return; - } - myAISContext->SetSelected(aObject, Standard_True); - } - - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) { - Handle(AIS_Shape) ashape = Handle(AIS_Shape)::DownCast(myAISContext->SelectedInteractive()); - try { - THE_F1 = TopoDS::Face(ashape->Shape()); - } - catch(Standard_Failure){} - if (THE_F1.IsNull()) - { - AfxMessageBox (L"Current object is not a face!\n\ -Please, select a face to continue\nthe creation of a tangent surface."); - return; - } - myAISContext->Activate(ashape,2); - myState = SELECT_EDGE_PLATE_TGTES_1; - - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select an edge on the first face"); - } - else { - AIS_ListOfInteractive LI; - myAISContext->DisplayedObjects(LI); - if(LI.IsEmpty()){ - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select a file with first face"); - if(OnFileImportBrep_WithInitDir (L"TangentSurface") == 1){ - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage(""); - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove(aListIterator.Value(), Standard_False); - } - myAISContext->UpdateCurrentViewer(); - return; - } - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage(""); - myAISContext->DisplayedObjects(LI); - myAISContext->SetSelected (LI.First(), Standard_True); - Sleep(700); - flag = 1; - OnFillwithtang(); - return; - } - AfxMessageBox (L"Select a face before"); - } -} - -void CModelingDoc::InputEvent(const Standard_Integer /*x*/, - const Standard_Integer /*y*/, - const Handle(V3d_View)& /*aView*/) -{ - myAISContext->SelectDetected(); - myAISContext->UpdateCurrentViewer(); - - if (myState == SELECT_EDGE_PLATE_TGTES_1) { - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) { - THE_E1 = TopoDS::Edge(myAISContext->SelectedShape()); - myState = SELECT_EDGE_PLATE_TGTES_2; - - AIS_ListOfInteractive aLI; - myAISContext->DisplayedObjects(aLI); - if(aLI.Extent() == 2){ - myState = SELECT_EDGE_PLATE_TGTES_2; - if (myAISContext->IsSelected(aLI.First())) - myAISContext->SetSelected (aLI.Last(), Standard_True); - else - myAISContext->SetSelected (aLI.First(), Standard_True); - myAISContext->InitSelected(); - Handle(AIS_Shape) ashape = Handle(AIS_Shape)::DownCast(myAISContext->SelectedInteractive()); - THE_F2 = TopoDS::Face(ashape->Shape()); - myAISContext->Activate(ashape,2); - myState = SELECT_EDGE_PLATE_TGTES_3; - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select an edge on the second face"); - return; - } - - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select second face"); - AIS_ListOfInteractive LI; - myAISContext->DisplayedObjects(LI); - if(LI.Extent() == 1){ - if(OnFileImportBrep_WithInitDir (L"TangentSurface") == 1) - return; - } - } - else - AfxMessageBox (L"Select an edge on the face!"); - - } - else if (myState == SELECT_EDGE_PLATE_TGTES_2) { - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) { - Handle(AIS_Shape) ashape = Handle(AIS_Shape)::DownCast(myAISContext->SelectedInteractive()); - THE_F2 = TopoDS::Face(ashape->Shape()); - myAISContext->Activate(ashape,2); - myState = SELECT_EDGE_PLATE_TGTES_3; - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select an edge on the second face"); - } - else - AfxMessageBox (L"Select the second face!"); - } - else if (myState == SELECT_EDGE_PLATE_TGTES_3) { - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) { - THE_E2 = TopoDS::Edge(myAISContext->SelectedShape()); - - Standard_Integer i, nbPntsOnFaces=10; - Standard_Real u,First, Last, Delta, Tol=0.001, TolProj; - Plate_Plate aPlate; - gp_Vec V1,V2,W1,W2; - gp_Pnt2d P2d; - gp_Pnt P, PP; - - //get the pcurve, curve and surface - BRepAdaptor_Curve Curve3d1(THE_E1), Curve3d2(THE_E2); - BRepAdaptor_Curve2d Curve2d1(THE_E1,THE_F1), Curve2d2(THE_E2,THE_F2); - BRepAdaptor_Surface Surf1(THE_F1), Surf2(THE_F2); - - //compute the average plane : initial surface - Handle(TColgp_HArray1OfPnt) theTanPoints = new - TColgp_HArray1OfPnt (1,2*nbPntsOnFaces ); - - Delta = (Curve3d1.LastParameter()-Curve3d1.FirstParameter())/(nbPntsOnFaces-1); - for (u=Curve3d1.FirstParameter(),i=1;i<=nbPntsOnFaces; i++,u+=Delta) - theTanPoints->SetValue(i,Curve3d1.Value(u)); - - Delta = (Curve3d2.LastParameter()-Curve3d2.FirstParameter())/(nbPntsOnFaces-1); - for (u=Curve3d2.FirstParameter(),i=1;i<=nbPntsOnFaces; i++,u+=Delta) - theTanPoints->SetValue(nbPntsOnFaces+i,Curve3d2.Value(u)); - - //Building an initial plane - GeomPlate_BuildAveragePlane aMkPlane (theTanPoints,int(Tol),1,1,1); - Handle(Geom_Plane) aPlane = aMkPlane.Plane(); - gp_Pln aPln = aPlane->Pln(); - gp_XYZ aNormale = aPln.Axis().Direction().XYZ(); - gp_Trsf aTrsf; // to compute the U and V of the points - aTrsf.SetTransformation(aPln.Position()); - - aPlane->D1(0,0,P,W1,W2); // extract plane DU & DV - - // 1st surface tangencies constraints - Delta = (Curve3d1.LastParameter()-Curve3d1.FirstParameter())/(nbPntsOnFaces-1); - for (u=Curve3d1.FirstParameter(),i=1; i<=nbPntsOnFaces; i++,u+=Delta) { - P = Curve3d1.Value(u).Transformed(aTrsf); - gp_XY UV(P.X(),P.Y()); - aPlate.Load(Plate_PinpointConstraint(UV,aNormale*P.Z())); - Curve2d1.D0(u,P2d); - Surf1.D1(P2d.X(),P2d.Y(),P,V1,V2); // extract surface UV of the point - aPlate.Load(Plate_GtoCConstraint(UV, - Plate_D1(W1.XYZ(),W2.XYZ()), - Plate_D1(V1.XYZ(),V2.XYZ()))); - } - // 2nd surface - Delta = (Curve3d2.LastParameter()-Curve3d2.FirstParameter())/(nbPntsOnFaces-1); - for (u=Curve3d2.FirstParameter(),i=1; i<=nbPntsOnFaces; i++,u+=Delta) { - P = Curve3d2.Value(u).Transformed(aTrsf); - gp_XY UV(P.X(),P.Y()); - aPlate.Load(Plate_PinpointConstraint(UV,aNormale*P.Z())); - - Curve2d2.D0(u,P2d); - Surf2.D1(P2d.X(),P2d.Y(),P,V1,V2); - aPlate.Load(Plate_GtoCConstraint(UV, - Plate_D1(W1.XYZ(),W2.XYZ()), - Plate_D1(V1.XYZ()*-1,V2.XYZ()*-1))); - } - - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Select a file with passing points"); - //Some passing points - CFileDialog dlg(TRUE, - NULL, - NULL, - OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"Points Files (*.pass)|*.pass; |All Files (*.*)|*.*||", - NULL); - - CString initdir; - initdir.GetEnvironmentVariable (L"CSF_OCCTDataPath"); - initdir += L"\\occ"; - - dlg.m_ofn.lpstrInitialDir = initdir; - - if (dlg.DoModal() == IDOK) - { - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Building the tangent surface..."); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - CString filename = dlg.GetPathName(); - std::filebuf fic; - std::istream in(&fic); - if (!fic.open(filename, std::ios::in)) - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Unable to open file", L"CasCade Error", MB_ICONERROR); - Standard_Real x,y,z; - BRep_Builder B; - TopoDS_Compound C; - B.MakeCompound(C); - while (!in.fail()|| !in.eof()){ - if (in >> x && in >> y && in >> z){ - PP = gp_Pnt(x, y, z); - P = PP.Transformed(aTrsf); - aPlate.Load(Plate_PinpointConstraint(gp_XY(P.X(),P.Y()), - aNormale*P.Z())); - BRepBuilderAPI_MakeVertex V(PP); - B.Add(C,V.Vertex()); - } - } - fic.close(); - Handle(AIS_Shape) anAISCompound = new AIS_Shape(C); - myAISContext->Display(anAISCompound, Standard_False); - Fit(); - Sleep(500); - } - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Building the tangent surface..."); - //Solving ... - Standard_Integer Order = 3; // constraints continuity + 2 - aPlate.SolveTI(Order,1.); - if (!aPlate.IsDone()){ - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Build plate not valid!", L"CasCade Error", MB_ICONERROR); - return; - } - //Plate Surface creation - Handle(GeomPlate_Surface) aPlateSurface = new GeomPlate_Surface(aPlane,aPlate); - //BSplineSurface approximation - GeomPlate_MakeApprox aMkSurf(aPlateSurface,Tol,1,8,0.1,1); - Handle(Geom_Surface) theSurface =aMkSurf.Surface(); - - // Face building ... - Handle(Geom2d_Curve)C1,C2,C3,C4; - Handle(Geom_Curve)C; - C = BRep_Tool::Curve(THE_E1,First,Last); - TolProj = 0.01; - C1 = GeomProjLib::Curve2d(C,First,Last,theSurface,TolProj); - TopoDS_Edge Ed1 = BRepBuilderAPI_MakeEdge(C1,theSurface).Edge(); - - C = BRep_Tool::Curve(THE_E2,First,Last); - TolProj = 0.01; - C3 = GeomProjLib::Curve2d(C,First,Last,theSurface,TolProj); - TopoDS_Edge Ed3 = BRepBuilderAPI_MakeEdge(C3,theSurface).Edge(); - - C2 = GCE2d_MakeSegment(C1->Value(C1->FirstParameter()), - C3->Value(C3->FirstParameter())).Value(); - TopoDS_Edge Ed2 = BRepBuilderAPI_MakeEdge(C2,theSurface).Edge(); - C4 = GCE2d_MakeSegment(C1->Value(C1->LastParameter()), - C3->Value(C3->LastParameter())).Value(); - TopoDS_Edge Ed4 = BRepBuilderAPI_MakeEdge(C4,theSurface).Edge(); - Ed2.Reverse(); - Ed3.Reverse(); - TopoDS_Wire theWire = BRepBuilderAPI_MakeWire(Ed1,Ed2,Ed3,Ed4); - TopoDS_Face theFace = BRepBuilderAPI_MakeFace(theWire); - BRepLib::BuildCurves3d(theFace); - if (!BRepAlgo::IsValid(theFace)){ - C2 = GCE2d_MakeSegment(C1->Value(C1->LastParameter()), - C3->Value(C3->FirstParameter())).Value(); - Ed2 = BRepBuilderAPI_MakeEdge(C2,theSurface).Edge(); - C4 = GCE2d_MakeSegment(C3->Value(C3->LastParameter()), - C1->Value(C1->FirstParameter())).Value(); - Ed4 = BRepBuilderAPI_MakeEdge(C4,theSurface).Edge(); - Ed3.Reverse(); - theWire = BRepBuilderAPI_MakeWire(Ed1,Ed2,Ed3,Ed4); - theFace = BRepBuilderAPI_MakeFace(theWire); - BRepLib::BuildCurves3d(theFace); - if (!BRepAlgo::IsValid(theFace)) - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate surface is not valid!!!", L"CasCade Error", MB_ICONERROR); - } - - Handle(AIS_Shape) anAISShape=new AIS_Shape(theFace); - myAISContext->SetColor (anAISShape, Quantity_NOC_BLUE1, Standard_False); - myAISContext->SetMaterial (anAISShape, Graphic3d_NOM_SILVER, Standard_False); - myAISContext->SetDisplayMode (anAISShape, 1, Standard_False); - myAISContext->Display (anAISShape, Standard_False); - myState = -1; - } - else - AfxMessageBox (L"Select an edge on the second face!"); - ((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage(""); - - } -} - -void CModelingDoc::Popup(const Standard_Integer x, - const Standard_Integer y , - const Handle(V3d_View)& aView) -{ - Standard_Integer PopupMenuNumber=0; - myAISContext->InitSelected(); - if (myState == SELECT_EDGE_PLATE) - PopupMenuNumber=2; - else if (myAISContext->MoreSelected()) - PopupMenuNumber=1; - - CMenu menu; - VERIFY(menu.LoadMenu(IDR_Popup3D)); - CMenu* pPopup = menu.GetSubMenu(PopupMenuNumber); - ASSERT(pPopup != NULL); - - if (PopupMenuNumber == 1) // more than 1 object. - { - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - if(!OneOrMoreInShading) - pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); - } - - - POINT winCoord = { x , y }; - Handle(WNT_Window) aWNTWindow= - Handle(WNT_Window)::DownCast(aView->Window()); - ClientToScreen ( (HWND)(aWNTWindow->HWindow()),&winCoord); - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , winCoord.x, winCoord.y , - AfxGetMainWnd()); -} diff --git a/samples/mfc/standard/02_Modeling/src/ModelingDoc.h b/samples/mfc/standard/02_Modeling/src/ModelingDoc.h deleted file mode 100755 index e769ff2d13..0000000000 --- a/samples/mfc/standard/02_Modeling/src/ModelingDoc.h +++ /dev/null @@ -1,99 +0,0 @@ -// ModelingDoc.h : interface of the CModelingDoc class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_MODELINGDOC_H__30453389_3E75_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_MODELINGDOC_H__30453389_3E75_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include - -class CModelingDoc : public OCC_3dDoc -{ - -protected: // create from serialization only - CModelingDoc(); - DECLARE_DYNCREATE(CModelingDoc) - -public: - virtual ~CModelingDoc(); - - void InputEvent (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - void Popup (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - -// Generated message map functions -protected: - //{{AFX_MSG(CModelingDoc) - afx_msg void OnMirror(); - afx_msg void OnMirroraxis(); - afx_msg void OnRotate(); - afx_msg void OnScale(); - afx_msg void OnTranslation(); - afx_msg void OnDisplacement(); - afx_msg void OnDeform(); - afx_msg void OnBox(); - afx_msg void OnCylinder(); - afx_msg void OnCone(); - afx_msg void OnSphere(); - afx_msg void OnTorus(); - afx_msg void OnWedge(); - afx_msg void OnPrism(); - afx_msg void OnRevol(); - afx_msg void OnPipe(); - afx_msg void OnThru(); - afx_msg void OnEvolved(); - afx_msg void OnDraft(); - afx_msg void OnCut(); - afx_msg void OnFuse(); - afx_msg void OnSection(); - afx_msg void OnCommon(); - afx_msg void OnPsection(); - afx_msg void OnBlend(); - afx_msg void OnChamf(); - afx_msg void OnEvolvedblend(); - afx_msg void OnPrismLocal(); - afx_msg void OnRevolLocal(); - afx_msg void OnGlueLocal(); - afx_msg void OnDprismLocal(); - afx_msg void OnPipeLocal(); - afx_msg void OnLinearLocal(); - afx_msg void OnSplitLocal(); - afx_msg void OnThickLocal(); - afx_msg void OnOffsetLocal(); - afx_msg void OnVertex(); - afx_msg void OnEdge(); - afx_msg void OnWire(); - afx_msg void OnFace(); - afx_msg void OnShell(); - afx_msg void OnCompound(); - afx_msg void OnGeometrie(); - afx_msg void OnSewing(); - afx_msg void OnExplorer(); - afx_msg void OnBuilder(); - afx_msg void OnValid(); - afx_msg void OnLinear(); - afx_msg void OnVolume(); - afx_msg void OnSurface(); - afx_msg void OnFillwithtang(); - afx_msg void OnButtonFill(); - afx_msg void OnStopStop(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -public: - int myState; -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_MODELINGDOC_H__30453389_3E75_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/02_Modeling/src/State.h b/samples/mfc/standard/02_Modeling/src/State.h deleted file mode 100755 index f2aa745ad5..0000000000 --- a/samples/mfc/standard/02_Modeling/src/State.h +++ /dev/null @@ -1,6 +0,0 @@ -enum STATE { - SELECT_EDGE_PLATE, - SELECT_EDGE_PLATE_TGTES_1, - SELECT_EDGE_PLATE_TGTES_2, - SELECT_EDGE_PLATE_TGTES_3 -}; diff --git a/samples/mfc/standard/02_Modeling/src/StdAfx.cpp b/samples/mfc/standard/02_Modeling/src/StdAfx.cpp deleted file mode 100755 index 1e73c2182f..0000000000 --- a/samples/mfc/standard/02_Modeling/src/StdAfx.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// SampleTopologyTransformations.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - - -#include "stdafx.h" - diff --git a/samples/mfc/standard/02_Modeling/src/StdAfx.h b/samples/mfc/standard/02_Modeling/src/StdAfx.h deleted file mode 100755 index 679ce6dad5..0000000000 --- a/samples/mfc/standard/02_Modeling/src/StdAfx.h +++ /dev/null @@ -1,142 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#ifndef NOMINMAX - #define NOMINMAX // Prevent Windows from defining min/max macros -#endif - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#pragma warning( disable : 4244 ) // Issue warning 4244 -#include "Standard_ShortReal.hxx" -#pragma warning( default : 4244 ) // Issue warning 4244 - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ISession_Direction.h" - -#include -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - diff --git a/samples/mfc/standard/03_ImportExport/CMakeLists.txt b/samples/mfc/standard/03_ImportExport/CMakeLists.txt deleted file mode 100644 index a7dba8671b..0000000000 --- a/samples/mfc/standard/03_ImportExport/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Caution! Be careful, when increase minimal cmake version: -# using of newer version may leads (by default) to applying -# of some new policies. It may break compilation. -# For canceling of applying new policies use: -# cmake_policy(PUSH) before `cmake_minimum_required` -# and cmake_policy(POP) after. -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) - -project (ImportExport) - -add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE) -set (CMAKE_MFC_FLAG 2) - -set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/src) -set (ImportExport_HEADER_FILES ${ImportExport_SRC_DIR}/ColoredShapes.h - ${ImportExport_SRC_DIR}/ImportExportApp.h - ${ImportExport_SRC_DIR}/ImportExportDoc.h - ${ImportExport_SRC_DIR}/StdAfx.h ) -set (ImportExport_SOURCE_FILES ${ImportExport_SRC_DIR}/ColoredShapes.cpp - ${ImportExport_SRC_DIR}/ImportExportApp.cpp - ${ImportExport_SRC_DIR}/ImportExportDoc.cpp - ${ImportExport_SRC_DIR}/StdAfx.cpp) - -set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/res) -set (ImportExport_RESOURCE_HEADER ${ImportExport_RESOURCE_DIR}/resource.h) -set (ImportExport_RESOURCE_FILES ${ImportExport_RESOURCE_DIR}/Toolbar.bmp - ${ImportExport_RESOURCE_DIR}/ImportExport.rc) - -# groups in the VS solution -source_group ("Source Files" FILES ${ImportExport_SOURCE_FILES} - ${COMMON_WINMAIN_FILE}) - -source_group ("Header Files" FILES ${ImportExport_HEADER_FILES} - ${ImportExport_RESOURCE_HEADER}) - -source_group ("Resource Files" FILES ${ImportExport_RESOURCE_FILES}) - -add_executable (ImportExport WIN32 ${ImportExport_SOURCE_FILES} - ${ImportExport_HEADER_FILES} - ${COMMON_WINMAIN_FILE} - ${ImportExport_RESOURCE_HEADER} - ${ImportExport_RESOURCE_FILES}) - -set_property (TARGET ImportExport PROPERTY FOLDER "Samples/mfc") - -if (SINGLE_GENERATOR) - install (TARGETS ImportExport DESTINATION "${INSTALL_DIR_BIN}") -else() - install (TARGETS ImportExport - CONFIGURATIONS Release RelWithDebInfo - DESTINATION "${INSTALL_DIR_BIN}") - install (TARGETS ImportExport - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR_BIN}d") -endif() - -include_directories (${CMAKE_BINARY_DIR}/inc - ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport - ${ImportExport_SRC_DIR} - ${MFC_STANDARD_SAMPLES_DIR}/Common) - -target_link_libraries (ImportExport mfcsample) - -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) \ No newline at end of file diff --git a/samples/mfc/standard/03_ImportExport/adm/win/vc10/ImportExport.vcxproj b/samples/mfc/standard/03_ImportExport/adm/win/vc10/ImportExport.vcxproj deleted file mode 100644 index f56d8338be..0000000000 --- a/samples/mfc/standard/03_ImportExport/adm/win/vc10/ImportExport.vcxproj +++ /dev/null @@ -1,360 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C} - ImportExport - MFCProj - - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../win32\$(VCFMT)\bin\ - .\win32\obj\ - false - ../../../../win64\$(VCFMT)\bin\ - .\win64\objd\ - false - ../../../../win32\$(VCFMT)\bind\ - .\win32\objd\ - true - ../../../../win64\$(VCFMT)\bind\ - .\win64\objd\ - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\obj/ImportExport.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win32\obj/ImportExport.pch - .\win32\obj/ - .\win32\obj/ - .\win32\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bin/ImportExport.exe - true - ..\..\..\..\win32\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win32\$(VCFMT)\bin/ImportExport.pdb - Windows - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\obj/ImportExport.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win64\obj/ImportExport.pch - .\win64\obj/ - .\win64\obj/ - .\win64\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bin/ImportExport.exe - true - ..\..\..\..\win64\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win64\$(VCFMT)\bin/ImportExport.pdb - Windows - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\objd/ImportExport.tlb - - - - - Disabled - ..\..\..\;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win32\objd/ImportExport.pch - .\win32\objd/ - .\win32\objd/ - .\win32\objd/ - Level4 - true - EditAndContinue - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bind/ImportExport.exe - true - ..\..\..\..\win32\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win32\$(VCFMT)\bind/ImportExport.pdb - Windows - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\objd/ImportExport.tlb - - - - - Disabled - ..\..\..\;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win64\objd/ImportExport.pch - .\win64\objd/ - .\win64\objd/ - .\win64\objd/ - Level4 - true - ProgramDatabase - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bind/ImportExport.exe - true - ..\..\..\..\win64\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win64\$(VCFMT)\bind/ImportExport.pdb - Windows - MachineX64 - - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - {2d6cbbe8-6965-4016-b503-0d715ae26691} - false - - - - - - \ No newline at end of file diff --git a/samples/mfc/standard/03_ImportExport/adm/win/vc10/ImportExport.vcxproj.filters b/samples/mfc/standard/03_ImportExport/adm/win/vc10/ImportExport.vcxproj.filters deleted file mode 100644 index 9e69403a74..0000000000 --- a/samples/mfc/standard/03_ImportExport/adm/win/vc10/ImportExport.vcxproj.filters +++ /dev/null @@ -1,60 +0,0 @@ - - - - - {6fe93ff4-3fc7-4248-af1c-9d15b9b1904d} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {0387f39d-921d-4c19-9e7d-d397e90e235a} - h;hpp;hxx;hm;inl - - - {116ea642-b0c0-4973-bfbc-4814645fe955} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/samples/mfc/standard/03_ImportExport/res/ImportExport.rc b/samples/mfc/standard/03_ImportExport/res/ImportExport.rc deleted file mode 100644 index f7bada86ef..0000000000 --- a/samples/mfc/standard/03_ImportExport/res/ImportExport.rc +++ /dev/null @@ -1,286 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -#include "..\..\Common\res\OCC_Resource.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "#include ""..\\..\\Common\\res\\OCC_Resource.h""\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDR_MAINFRAME BITMAP "Toolbar.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_MAINFRAME TOOLBAR 20, 20 -BEGIN - BUTTON ID_FILE_NEW - SEPARATOR - BUTTON ID_BOX - BUTTON ID_Cylinder - SEPARATOR - BUTTON ID_FILE_IMPORT_BREP - BUTTON ID_FILE_IMPORT_IGES - BUTTON ID_FILE_IMPORT_STEP - SEPARATOR - BUTTON ID_FILE_EXPORT_BREP - BUTTON ID_FILE_EXPORT_IGES - BUTTON ID_FILE_EXPORT_STEP - BUTTON ID_FILE_EXPORT_STL - BUTTON ID_FILE_EXPORT_VRML - SEPARATOR - BUTTON ID_FILE_EXPORT_IMAGE - SEPARATOR - BUTTON ID_BUTTON_STEREO - SEPARATOR - BUTTON ID_APP_ABOUT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAINFRAME MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN - MENUITEM SEPARATOR - MENUITEM "Recent File", ID_FILE_MRU_FILE12 - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Help" - BEGIN - MENUITEM "&About ImportExport...", ID_APP_ABOUT - END -END - -IDR_3DTYPE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN - MENUITEM "&Close", ID_FILE_CLOSE - MENUITEM SEPARATOR - MENUITEM "&Save...\tCtrl+S", ID_FILE_SAVE - MENUITEM "Save As...", ID_FILE_SAVE_AS - MENUITEM SEPARATOR - POPUP "Import" - BEGIN - MENUITEM "BREP...", ID_FILE_IMPORT_BREP - MENUITEM "STEP...", ID_FILE_IMPORT_STEP - MENUITEM "IGES...", ID_FILE_IMPORT_IGES - END - POPUP "Export" - BEGIN - MENUITEM "BREP...", ID_FILE_EXPORT_BREP - MENUITEM "STEP...", ID_FILE_EXPORT_STEP - MENUITEM "IGES...", ID_FILE_EXPORT_IGES - MENUITEM "STL...", ID_FILE_EXPORT_STL - MENUITEM "VRML...", ID_FILE_EXPORT_VRML - MENUITEM SEPARATOR - MENUITEM "Image...", ID_FILE_EXPORT_IMAGE - END - MENUITEM SEPARATOR - MENUITEM "Recent File", ID_FILE_MRU_FILE1 - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Window" - BEGIN - MENUITEM "New Window", ID_WINDOW_NEW - MENUITEM "&Cascade", ID_WINDOW_CASCADE - MENUITEM "&Tile", ID_WINDOW_TILE_HORZ - MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE - END - POPUP "&Help" - BEGIN - MENUITEM "&About ImportExport...", ID_APP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "Matra Datavision" - VALUE "FileDescription", "SampleImportExport MFC Application" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "SampleImportExport" - VALUE "LegalCopyright", "Copyright (C) 1998" - VALUE "OriginalFilename", "SampleImportExport.EXE" - VALUE "ProductName", "SampleImportExport Application" - VALUE "ProductVersion", "1, 0, 0, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_FILESAVESTEP DIALOG 0, 0, 288, 165 -STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "",1119,7,7,274,126,NOT WS_VISIBLE - COMBOBOX IDC_FSaveSTEP_Type,80,138,127,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDR_MAINFRAME "ImportExport" - IDR_3DTYPE "\nImportExport\nImportExport\n\n\nImportExport.Document\nImportExport Document" -END - -STRINGTABLE -BEGIN - ID_BOX "Create a box\nBox" - ID_Cylinder "Create a cylinder\nCylinder" -END - -STRINGTABLE -BEGIN - ID_FILE_OPEN "Open file\nOpen" - ID_FILE_SAVE "Save File\nSave" - ID_FILE_SAVE_AS "Save file as...\nSave As" -END - -STRINGTABLE -BEGIN - ID_FILE_MRU_FILE1 "Open recent file\nRecent file" -END - -STRINGTABLE -BEGIN - ID_BUTTON_STEREO "Toggle stereographic mode on / off" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/samples/mfc/standard/03_ImportExport/res/Toolbar.bmp b/samples/mfc/standard/03_ImportExport/res/Toolbar.bmp deleted file mode 100644 index b521a8d2ef..0000000000 Binary files a/samples/mfc/standard/03_ImportExport/res/Toolbar.bmp and /dev/null differ diff --git a/samples/mfc/standard/03_ImportExport/res/resource.h b/samples/mfc/standard/03_ImportExport/res/resource.h deleted file mode 100644 index 59e19b5d1d..0000000000 --- a/samples/mfc/standard/03_ImportExport/res/resource.h +++ /dev/null @@ -1,25 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by ImportExport.rc -// -#define ID_FILE_OPEN32803 32803 -#define ID_BOX 32804 -#define ID_Cylinder 32806 -#define ID_FILE_OPEN32807 32807 -#define ID_FILE_SAVEAS 32808 -#define ID_FILE_SAVE32809 32809 -#define ID_FILE_RECENTFILE 32810 -#define ID_FILE_EXPORT_STL 32896 -#define ID_FILE_EXPORT_VRML 32897 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 178 -#define _APS_NEXT_COMMAND_VALUE 32811 -#define _APS_NEXT_CONTROL_VALUE 1505 -#define _APS_NEXT_SYMED_VALUE 170 -#endif -#endif diff --git a/samples/mfc/standard/03_ImportExport/src/ColoredShapes.cpp b/samples/mfc/standard/03_ImportExport/src/ColoredShapes.cpp deleted file mode 100644 index 71b0752cf5..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/ColoredShapes.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// ColoredShapes.cpp: implementation of the CColoredShape class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include - -#include "ColoredShapes.h" - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CColoredShapes::CColoredShapes() -{ -} - - -void CColoredShapes::Add(const Quantity_NameOfColor aColor, const TopoDS_Shape& aShape) -{ - m_shapeList.Append(aShape); - m_colorMap.Bind(aShape, aColor); -} - -void CColoredShapes::Remove(const TopoDS_Shape& aShape) -{ - m_colorMap.UnBind(aShape); - for ( TopoDS_ListIteratorOfListOfShape iter(m_shapeList); iter.More(); iter.Next() ) { - if(iter.Value() == aShape) { - m_shapeList.Remove(iter); - break; - } - } -} - -IMPLEMENT_SERIAL(CColoredShapes, CObject,1); - -#include - -// Tools to put Persistent Object in an archive - -void CColoredShapes::Display(Handle(AIS_InteractiveContext)& anAIScontext) -{ - for ( TopoDS_ListIteratorOfListOfShape iter(m_shapeList); iter.More(); iter.Next() ) - { - Handle(AIS_Shape) ais = new AIS_Shape(iter.Value()); - anAIScontext->SetColor(ais, (Quantity_NameOfColor)m_colorMap.Find(iter.Value()), Standard_False); - anAIScontext->SetMaterial(ais, Graphic3d_NameOfMaterial_Gold, Standard_False); - anAIScontext->Display(ais, Standard_False); - } - anAIScontext->UpdateCurrentViewer(); -} diff --git a/samples/mfc/standard/03_ImportExport/src/ColoredShapes.h b/samples/mfc/standard/03_ImportExport/src/ColoredShapes.h deleted file mode 100644 index 937816dc60..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/ColoredShapes.h +++ /dev/null @@ -1,33 +0,0 @@ -// ColoredShape.h: interface for the CColoredShape class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_COLOREDSHAPES_H__C6419AF3_A78A_11D1_8C93_00AA00D10994__INCLUDED_) -#define AFX_COLOREDSHAPES_H__C6419AF3_A78A_11D1_8C93_00AA00D10994__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -class CColoredShapes : public CObject -{ -public: - CColoredShapes(); - void Add(const Quantity_NameOfColor aColor, const TopoDS_Shape& aShape); - void Remove(const TopoDS_Shape& aShape); - - void Display( Handle(AIS_InteractiveContext)& anAIScontext); - - TopoDS_ListOfShape getShapes(); - Quantity_NameOfColor getShapeColor(TopoDS_Shape aShape); - -protected: - // Declare CArchive >> operator - DECLARE_SERIAL(CColoredShapes); - -private: - TopTools_DataMapOfShapeInteger m_colorMap; - TopoDS_ListOfShape m_shapeList; -}; - -#endif // !defined(AFX_COLOREDSHAPES_H__C6419AF3_A78A_11D1_8C93_00AA00D10994__INCLUDED_) diff --git a/samples/mfc/standard/03_ImportExport/src/ImportExportApp.cpp b/samples/mfc/standard/03_ImportExport/src/ImportExportApp.cpp deleted file mode 100644 index 733021c3b2..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/ImportExportApp.cpp +++ /dev/null @@ -1,158 +0,0 @@ -// ImportExportApp.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" - -#include "ImportExportApp.h" - -#include "OCC_MainFrame.h" -#include "OCC_3dChildFrame.h" -#include "ImportExportDoc.h" -#include -#include - -BEGIN_MESSAGE_MAP(CImportExportApp, OCC_App) - //{{AFX_MSG_MAP(CSerializeApp) - ON_COMMAND(ID_FILE_OPEN, OnFileOpen) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CImportExportApp construction - -CImportExportApp::CImportExportApp() : OCC_App() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CImportExportApp object - -CImportExportApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CImportExportApp initialization - -BOOL CImportExportApp::InitInstance() -{ - // Set the local system units - try - { - UnitsAPI::SetLocalSystem (UnitsAPI_MDTV); - } - catch (Standard_Failure) - { - AfxMessageBox (L"Fatal Error in units initialisation"); - } - - SampleName = "ImportExport"; //for about dialog - SetSamplePath (L"..\\..\\05_ImportExport"); - - AfxEnableControlContainer(); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - - // Change the registry key under which our settings are stored. - // You should modify this string to be something appropriate - // such as the name of your company or organization. - // Modified by CasCade : - SetRegistryKey(_T("Local CasCade Applications")); - - LoadStdProfileSettings(); // Load standard INI file options (including MRU) - - // Register the application's document templates. Document templates - // serve as the connection between documents, frame windows and views. - - CMultiDocTemplate* pDocTemplate; - pDocTemplate = new CMultiDocTemplate( - IDR_3DTYPE, - RUNTIME_CLASS(CImportExportDoc), - RUNTIME_CLASS(OCC_3dChildFrame), - RUNTIME_CLASS(OCC_3dView)); - AddDocTemplate(pDocTemplate); - - // create main MDI Frame window - OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB); - if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) - return FALSE; - m_pMainWnd = pMainFrame; - - // Parse command line for standard shell commands, DDE, file open - CCommandLineInfo cmdInfo; - ParseCommandLine(cmdInfo); - - // Dispatch commands specified on the command line - if (!ProcessShellCommand(cmdInfo)) - return FALSE; - - // The main window has been initialized, so show and update it. - pMainFrame->ShowWindow(m_nCmdShow); - pMainFrame->UpdateWindow(); - - return TRUE; -} - -CDocument* CImportExportApp::OpenDocumentFile(LPCTSTR lpszFileName) -{ - CFile cf; - - if (!cf.Open(lpszFileName,CFile::modeReadWrite)){ - AfxMessageBox (L"File not found!"); - return NULL; - } - cf.Close(); - return CWinApp::OpenDocumentFile(lpszFileName); -} - -void CImportExportApp::OnFileOpen() -{ - CFileDialog dlg(TRUE, - NULL, - NULL, - OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, - NULL, - NULL ); - - - CString initdir; - initdir.GetEnvironmentVariable (L"CSF_OCCTDataPath"); - - dlg.m_ofn.lpstrInitialDir = initdir; - - CString strFilter; - CString strDefault; - - POSITION pos = GetFirstDocTemplatePosition(); - - CDocTemplate* pTemplate = GetNextDocTemplate(pos); - CString strFilterExt, strFilterName; - if (pTemplate->GetDocString(strFilterExt, CDocTemplate::filterExt) && - !strFilterExt.IsEmpty() && - pTemplate->GetDocString(strFilterName, CDocTemplate::filterName) && - !strFilterName.IsEmpty()) { - // add to filter - strFilter += strFilterName; - ASSERT(!strFilter.IsEmpty()); // must have a file type name - strFilter += L'\0'; // next string please - strFilter += L'*'; - strFilter += strFilterExt; - strFilter += L'\0'; // next string please - dlg.m_ofn.nMaxCustFilter++; - } - // append the "*.*" all files filter - CString allFilter; - VERIFY(allFilter.LoadString(AFX_IDS_ALLFILTER)); - strFilter += allFilter; - strFilter += L'\0'; // next string please - strFilter += L"*.*"; - strFilter += L'\0'; // last string - dlg.m_ofn.nMaxCustFilter++; - dlg.m_ofn.lpstrFilter = strFilter; - - if (dlg.DoModal() == IDOK) - { - AfxGetApp()->OpenDocumentFile(dlg.GetPathName()); - } -} diff --git a/samples/mfc/standard/03_ImportExport/src/ImportExportApp.h b/samples/mfc/standard/03_ImportExport/src/ImportExportApp.h deleted file mode 100644 index e0233677fa..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/ImportExportApp.h +++ /dev/null @@ -1,38 +0,0 @@ -// ImportExportApp.h : main header file for the IMPORTEXPORT application -// - -#if !defined(AFX_IMPORTEXPORT_H__88A21474_3B23_11D2_8E1E_0800369C8A03__INCLUDED_) -#define AFX_IMPORTEXPORT_H__88A21474_3B23_11D2_8E1E_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include - -class CImportExportApp : public OCC_App -{ -public: - - CImportExportApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CImportExportApp) - public: - virtual BOOL InitInstance(); - virtual CDocument* OpenDocumentFile(LPCTSTR lpszFileName); - //}}AFX_VIRTUAL - -protected: - - //{{AFX_MSG(CSerializeApp) - afx_msg void OnFileOpen(); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_IMPORTEXPORT_H__88A21474_3B23_11D2_8E1E_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/03_ImportExport/src/ImportExportDoc.cpp b/samples/mfc/standard/03_ImportExport/src/ImportExportDoc.cpp deleted file mode 100644 index eaca832d19..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/ImportExportDoc.cpp +++ /dev/null @@ -1,288 +0,0 @@ -// ImportExportDoc.cpp : implementation of the CImportExportDoc class -// - - -#include "stdafx.h" -#include "ImportExportApp.h" - -#include "ImportExportDoc.h" - -#include - -#include -#include "res/resource.h" - - -#ifdef _DEBUG -//#define new DEBUG_NEW // by cascade -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CImportExportDoc - -IMPLEMENT_DYNCREATE(CImportExportDoc, OCC_3dDoc) - -BEGIN_MESSAGE_MAP(CImportExportDoc, OCC_3dDoc) - //{{AFX_MSG_MAP(CImportExportDoc) - ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep) - ON_COMMAND(ID_FILE_IMPORT_IGES, OnFileImportIges) - ON_COMMAND(ID_FILE_EXPORT_IGES, OnFileExportIges) - ON_COMMAND(ID_FILE_IMPORT_STEP, OnFileImportStep) - ON_COMMAND(ID_FILE_EXPORT_STEP, OnFileExportStep) - ON_COMMAND(ID_FILE_EXPORT_VRML, OnFileExportVrml) - ON_COMMAND(ID_FILE_EXPORT_STL, OnFileExportStl) - ON_COMMAND(ID_BOX, OnBox) - ON_COMMAND(ID_Cylinder, OnCylinder) - ON_COMMAND(ID_OBJECT_REMOVE, OnObjectRemove) - ON_COMMAND(ID_OBJECT_ERASE, OnObjectErase) - ON_COMMAND(ID_OBJECT_DISPLAYALL, OnObjectDisplayall) - //}}AFX_MSG_MAP - -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CImportExportDoc construction/destruction - -CImportExportDoc::CImportExportDoc() -: OCC_3dDoc (false) -{ -/* - // TRIHEDRON - Handle(AIS_Trihedron) aTrihedron; - Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY()); - aTrihedron=new AIS_Trihedron(aTrihedronAxis); - myAISContext->Display(aTrihedron); -*/ - - m_pcoloredshapeList = new CColoredShapes(); -} - -CImportExportDoc::~CImportExportDoc() -{ - if( m_pcoloredshapeList ) delete m_pcoloredshapeList; -} - - -///////////////////////////////////////////////////////////////////////////// -// CSerializeDoc serialization - -void CImportExportDoc::Serialize(CArchive& ar) -{ - if (ar.IsStoring()) - { - // Put the current CColoredShape in the archive - ar << m_pcoloredshapeList; - } - else - { - // Read from the archive the current CColoredShape - ar >> m_pcoloredshapeList; - - // Display the new object - m_pcoloredshapeList->Display(myAISContext); - } -} - - -/* -void CImportExportDoc::OnWindowNew3d() -{ - ((CImportExportApp*)AfxGetApp())->CreateView3D(this); -} -*/ - -// nCmdShow could be : ( default is SW_RESTORE ) -// SW_HIDE SW_SHOWNORMAL SW_NORMAL -// SW_SHOWMINIMIZED SW_SHOWMAXIMIZED -// SW_MAXIMIZE SW_SHOWNOACTIVATE -// SW_SHOW SW_MINIMIZE -// SW_SHOWMINNOACTIVE SW_SHOWNA -// SW_RESTORE SW_SHOWDEFAULT -// SW_MAX - -// use pViewClass = RUNTIME_CLASS( CImportExportView3D ) for 3D Views - -void CImportExportDoc::ActivateFrame(CRuntimeClass* pViewClass,int nCmdShow) -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf(pViewClass) ) - { - ASSERT_VALID(pCurrentView); - CFrameWnd* pParentFrm = pCurrentView->GetParentFrame(); - ASSERT(pParentFrm != (CFrameWnd *)NULL); - // simply make the frame window visible - pParentFrm->ActivateFrame(nCmdShow); - } - } - -} - -///////////////////////////////////////////////////////////////////////////// -// CImportExportDoc diagnostics - -#ifdef _DEBUG -void CImportExportDoc::AssertValid() const -{ - CDocument::AssertValid(); -} - -void CImportExportDoc::Dump(CDumpContext& dc) const -{ - CDocument::Dump(dc); -} -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CImportExportDoc commands - - -void CImportExportDoc::OnFileImportBrep() -{ - Handle(TopTools_HSequenceOfShape) aSeqOfShape = CImportExport::ReadBREP(); - for(int i=1;i<= aSeqOfShape->Length();i++) - { - m_pcoloredshapeList->Add(Quantity_NOC_YELLOW, aSeqOfShape->Value(i)); - m_pcoloredshapeList->Display(myAISContext); - } - Fit(); -} - -void CImportExportDoc::OnFileImportIges() -{ - Handle(TopTools_HSequenceOfShape) aSeqOfShape = CImportExport::ReadIGES(); - for(int i=1;i<= aSeqOfShape->Length();i++) - { - m_pcoloredshapeList->Add(Quantity_NOC_YELLOW, aSeqOfShape->Value(i)); - m_pcoloredshapeList->Display(myAISContext); - } - Fit(); -} -void CImportExportDoc::OnFileExportIges() -{ CImportExport::SaveIGES(myAISContext);} - -void CImportExportDoc::OnFileImportStep() -{ - Handle(TopTools_HSequenceOfShape) aSeqOfShape = CImportExport::ReadSTEP(); - for(int i=1;i<= aSeqOfShape->Length();i++) - { - m_pcoloredshapeList->Add(Quantity_NOC_YELLOW, aSeqOfShape->Value(i)); - m_pcoloredshapeList->Display(myAISContext); - } - Fit(); -} -void CImportExportDoc::OnFileExportStep() -{ CImportExport::SaveSTEP(myAISContext);} - - -void CImportExportDoc::OnFileExportVrml() -{ CImportExport::SaveVRML(myAISContext);} - -void CImportExportDoc::OnFileExportStl() -{ CImportExport::SaveSTL(myAISContext);} - -void CImportExportDoc::Popup(const Standard_Integer x, - const Standard_Integer y , - const Handle(V3d_View)& aView ) -{ - Standard_Integer PopupMenuNumber=0; - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) - PopupMenuNumber=1; - - CMenu menu; - VERIFY(menu.LoadMenu(IDR_Popup3D)); - CMenu* pPopup = menu.GetSubMenu(PopupMenuNumber); - - ASSERT(pPopup != NULL); - if (PopupMenuNumber == 1) // more than 1 object. - { - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - if(!OneOrMoreInShading) - pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); - } - - POINT winCoord = { x , y }; - Handle(WNT_Window) aWNTWindow= - Handle(WNT_Window)::DownCast(aView->Window()); - ClientToScreen ( (HWND)(aWNTWindow->HWindow()),&winCoord); - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , winCoord.x, winCoord.y , - AfxGetMainWnd()); - - -} - -void CImportExportDoc::OnBox() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - BRepPrimAPI_MakeBox B(200.,150.,100.); - - m_pcoloredshapeList->Add(Quantity_NOC_YELLOW, B.Shape()); - - m_pcoloredshapeList->Display(myAISContext); - Fit(); - - // document has been modified - SetModifiedFlag(TRUE); -} - -void CImportExportDoc::OnCylinder() -{ - AIS_ListOfInteractive aList; - myAISContext->DisplayedObjects(aList); - AIS_ListIteratorOfListOfInteractive aListIterator; - for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){ - myAISContext->Remove (aListIterator.Value(), Standard_False); - } - - BRepPrimAPI_MakeCylinder C(50.,200.); - - m_pcoloredshapeList->Add(Quantity_NOC_GREEN, C.Shape()); - - m_pcoloredshapeList->Display(myAISContext); - Fit(); - - // document has been modified - SetModifiedFlag(TRUE); -} -void CImportExportDoc::OnObjectRemove() - -{ - for(GetAISContext()->InitSelected();GetAISContext()->MoreSelected();GetAISContext()->NextSelected()) { - Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(GetAISContext()->SelectedInteractive()); - if(!aShape.IsNull()) { - m_pcoloredshapeList->Remove(aShape->Shape()); - } - } - OCC_3dBaseDoc::OnObjectRemove(); -} - -void CImportExportDoc::OnObjectErase() - -{ - for(GetAISContext()->InitSelected();GetAISContext()->MoreSelected();GetAISContext()->NextSelected()) { - Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(GetAISContext()->SelectedInteractive()); - if(!aShape.IsNull()) { - m_pcoloredshapeList->Remove(aShape->Shape()); - } - } - OCC_3dBaseDoc::OnObjectErase(); -} - -void CImportExportDoc::OnObjectDisplayall() - -{ - OCC_3dBaseDoc::OnObjectDisplayall(); -} \ No newline at end of file diff --git a/samples/mfc/standard/03_ImportExport/src/ImportExportDoc.h b/samples/mfc/standard/03_ImportExport/src/ImportExportDoc.h deleted file mode 100644 index 77659484c3..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/ImportExportDoc.h +++ /dev/null @@ -1,64 +0,0 @@ -// ImportExportDoc.h : interface of the CImportExportDoc class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_IMPORTEXPORTDOC_H__88A2147C_3B23_11D2_8E1E_0800369C8A03__INCLUDED_) -#define AFX_IMPORTEXPORTDOC_H__88A2147C_3B23_11D2_8E1E_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include - -class CImportExportDoc : public OCC_3dDoc -{ - DECLARE_DYNCREATE(CImportExportDoc) -public: - CImportExportDoc(); - virtual ~CImportExportDoc(); - virtual void Serialize(CArchive& ar); - - void ActivateFrame(CRuntimeClass* pViewClass, int nCmdShow = SW_RESTORE ); - virtual void Popup (const Standard_Integer x , - const Standard_Integer y , - const Handle(V3d_View)& aView ); - - -// Implementation -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -// Generated message map functions -protected: - //{{AFX_MSG(CImportExportDoc) - afx_msg void OnFileImportIges(); - afx_msg void OnFileExportIges(); - afx_msg void OnFileImportStep(); - afx_msg void OnFileExportStep(); - afx_msg void OnFileImportBrep(); -// afx_msg void OnWindowNew3d(); - afx_msg void OnFileExportVrml(); - afx_msg void OnFileExportStl(); - afx_msg void OnBox(); - afx_msg void OnCylinder(); - afx_msg void OnObjectRemove(); - afx_msg void OnObjectErase(); - afx_msg void OnObjectDisplayall(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -//Attributes -protected: - CColoredShapes* m_pcoloredshapeList; -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_IMPORTEXPORTDOC_H__88A2147C_3B23_11D2_8E1E_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/03_ImportExport/src/StdAfx.cpp b/samples/mfc/standard/03_ImportExport/src/StdAfx.cpp deleted file mode 100644 index 4db8d13070..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/StdAfx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// SampleImportExport.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - diff --git a/samples/mfc/standard/03_ImportExport/src/StdAfx.h b/samples/mfc/standard/03_ImportExport/src/StdAfx.h deleted file mode 100644 index df014d2419..0000000000 --- a/samples/mfc/standard/03_ImportExport/src/StdAfx.h +++ /dev/null @@ -1,165 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__88A21476_3B23_11D2_8E1E_0800369C8A03__INCLUDED_) -#define AFX_STDAFX_H__88A21476_3B23_11D2_8E1E_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#ifndef NOMINMAX - #define NOMINMAX // Prevent Windows from defining min/max macros -#endif - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#define DEFAULT_DEVIATIONCOEFFICIENT 0.001 -#define DEFAULT_DCBIG 0.005 -#define DEFAULT_DCVBIG 0.01 -#define DEFAULT_DCSMALL 0.0002 -#define DEFAULT_DCVSMALL 0.00004 -#define DEFAULT_COLOR Quantity_NOC_CYAN1 -#define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Plastered -#define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY -#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW - -#pragma warning( disable : 4244 ) // Issue warning 4244 -#include -#pragma warning( default : 4244 ) // Issue warning 4244 - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// specific STEP - -#include -#include -#include - - -// specific IGES -#include -#include - -#include -#include - -#include -#include -#include - -#include - -//#include - -// specific STL VRML -#include "StlAPI_Writer.hxx" -#include "VrmlAPI_Writer.hxx" - -//End CasCade - - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__88A21476_3B23_11D2_8E1E_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/04_HLR/CMakeLists.txt b/samples/mfc/standard/04_HLR/CMakeLists.txt deleted file mode 100644 index 1ccabc5b9e..0000000000 --- a/samples/mfc/standard/04_HLR/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -# Caution! Be careful, when increase minimal cmake version: -# using of newer version may leads (by default) to applying -# of some new policies. It may break compilation. -# For canceling of applying new policies use: -# cmake_policy(PUSH) before `cmake_minimum_required` -# and cmake_policy(POP) after. -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) - -project (HLR) - -add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE) -set (CMAKE_MFC_FLAG 2) - -set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/src) -set (HLR_HEADER_FILES ${HLR_SRC_DIR}/HLRApp.h - ${HLR_SRC_DIR}/HLRDoc.h - ${HLR_SRC_DIR}/HLRView2D.h - ${HLR_SRC_DIR}/SelectionDialog.h - ${HLR_SRC_DIR}/StdAfx.h ) -set (HLR_SOURCE_FILES ${HLR_SRC_DIR}/HLRApp.cpp - ${HLR_SRC_DIR}/HLRDoc.cpp - ${HLR_SRC_DIR}/HLRView2D.cpp - ${HLR_SRC_DIR}/SelectionDialog.cpp - ${HLR_SRC_DIR}/StdAfx.cpp ) - -set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/res) -set (HLR_RESOURCE_HEADER ${HLR_RESOURCE_DIR}/resource.h) -set (HLR_RESOURCE_FILES ${HLR_RESOURCE_DIR}/axoviewd.bmp - ${HLR_RESOURCE_DIR}/axoviewf.bmp - ${HLR_RESOURCE_DIR}/AXOVIEWU.bmp - ${HLR_RESOURCE_DIR}/BACKVIEWD.bmp - ${HLR_RESOURCE_DIR}/BACKVIEWF.bmp - ${HLR_RESOURCE_DIR}/BACKVIEWU.bmp - ${HLR_RESOURCE_DIR}/BOTTOMVIEWD.bmp - ${HLR_RESOURCE_DIR}/BOTTOMVIEWF.bmp - ${HLR_RESOURCE_DIR}/BOTTOMVIEWU.bmp - ${HLR_RESOURCE_DIR}/ChildFrame2D.bmp - ${HLR_RESOURCE_DIR}/ChildFrame3D.bmp - ${HLR_RESOURCE_DIR}/FRONTVIEWD.bmp - ${HLR_RESOURCE_DIR}/FRONTVIEWF.bmp - ${HLR_RESOURCE_DIR}/FRONTVIEWU.bmp - ${HLR_RESOURCE_DIR}/LEFTVIEWD.bmp - ${HLR_RESOURCE_DIR}/LEFTVIEWF.bmp - ${HLR_RESOURCE_DIR}/LEFTVIEWU.bmp - ${HLR_RESOURCE_DIR}/RIGHTVIEWD.bmp - ${HLR_RESOURCE_DIR}/RIGHTVIEWF.bmp - ${HLR_RESOURCE_DIR}/RIGHTVIEWU.bmp - ${HLR_RESOURCE_DIR}/Toolbar.bmp - ${HLR_RESOURCE_DIR}/ToolBarObjects.bmp - ${HLR_RESOURCE_DIR}/topviewd.bmp - ${HLR_RESOURCE_DIR}/topviewf.bmp - ${HLR_RESOURCE_DIR}/topviewu.bmp - ${HLR_RESOURCE_DIR}/HLR.rc) - -# groups in the VS solution -source_group ("Source Files" FILES ${HLR_SOURCE_FILES} - ${COMMON_WINMAIN_FILE}) - -source_group ("Header Files" FILES ${HLR_HEADER_FILES} - ${HLR_RESOURCE_HEADER}) - -source_group ("Resource Files" FILES ${HLR_RESOURCE_FILES}) - -add_executable (HLR WIN32 ${HLR_SOURCE_FILES} - ${HLR_HEADER_FILES} - ${COMMON_WINMAIN_FILE} - ${HLR_RESOURCE_HEADER} - ${HLR_RESOURCE_FILES} ) - -set_property (TARGET HLR PROPERTY FOLDER "Samples/mfc") - -if (SINGLE_GENERATOR) - install (TARGETS HLR DESTINATION "${INSTALL_DIR_BIN}") -else() - install (TARGETS HLR - CONFIGURATIONS Release RelWithDebInfo - DESTINATION "${INSTALL_DIR_BIN}") - install (TARGETS HLR - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR_BIN}d") -endif() - -include_directories (${CMAKE_BINARY_DIR}/inc - ${HLR_RESOURCE_DIR} - ${HLR_SRC_DIR} - ${MFC_STANDARD_SAMPLES_DIR}/Common) - -target_link_libraries (HLR mfcsample) - -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) \ No newline at end of file diff --git a/samples/mfc/standard/04_HLR/README.txt b/samples/mfc/standard/04_HLR/README.txt deleted file mode 100644 index 75e9190174..0000000000 --- a/samples/mfc/standard/04_HLR/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -HLR sample demonstrates hidden line removal algorithm. -It supports exact and polygonal HLR algorithms. - -To try HLR you need to follow some steps: -1) to import model, which will displayed in 3d view. -2) to choose "File->Process HLR" or press "HLR' button in the toolbar. - Dialog with options of HLR will be opened. -3) to press "Get shapes" button of the HLR dialog to - display results in the 2d view. - Optionally, this dialog allow to view chosen shapes - in his own view. Here you can choose needed direction - of view and press "Update 2d" button to update shapes HLR 2d view. diff --git a/samples/mfc/standard/04_HLR/adm/win/vc10/HLR.vcxproj b/samples/mfc/standard/04_HLR/adm/win/vc10/HLR.vcxproj deleted file mode 100644 index 23233ab233..0000000000 --- a/samples/mfc/standard/04_HLR/adm/win/vc10/HLR.vcxproj +++ /dev/null @@ -1,417 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {76045260-8DA6-4A3E-B220-F5B1B4ADE192} - HLR - MFCProj - - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - Application - Dynamic - Unicode - $(VCPlatformToolSet) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../win32\$(VCFMT)\bin\ - .\win32\obj\ - false - ../../../../win64\$(VCFMT)\bin\ - .\win64\obj\ - false - ../../../../win32\$(VCFMT)\bind\ - .\win32\objd\ - true - ../../../../win64\$(VCFMT)\bind\ - .\win64\objd\ - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\obj/HLR.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\;..\..\..\..\Common;$(CSF_OCCTIncludePath);..\..\..\src\ISession2D;..\..\..\res;.\src\Properties;..\..\..\src;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win32\obj/HLR.pch - .\win32\obj/ - .\win32\obj/ - .\win32\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bin/HLR.exe - true - ..\..\..\..\win32\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win32\$(VCFMT)\bin/HLR.pdb - Windows - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\obj/HLR.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\;..\..\..\..\Common;$(CSF_OCCTIncludePath);..\..\..\src\ISession2D;..\..\..\res;.\src\Properties;..\..\..\src;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win64\obj/HLR.pch - .\win64\obj/ - .\win64\obj/ - .\win64\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bin/HLR.exe - true - ..\..\..\..\win64\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win64\$(VCFMT)\bin/HLR.pdb - Windows - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\objd/HLR.tlb - - - - - Disabled - ..\..\..\;..\..\..\..\Common;$(CSF_OCCTIncludePath);..\..\..\src\ISession2D;..\..\..\res;.\src\Properties;..\..\..\src;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win32\objd/HLR.pch - .\win32\objd/ - .\win32\objd/ - .\win32\objd/ - Level4 - true - EditAndContinue - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bind/HLR.exe - true - ..\..\..\..\win32\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win32\$(VCFMT)\bind/HLR.pdb - Windows - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\objd/HLR.tlb - - - - - Disabled - ..\..\..\;..\..\..\..\Common;$(CSF_OCCTIncludePath);..\..\..\src\ISession2D;..\..\..\res;.\src\Properties;..\..\..\src;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win64\objd/HLR.pch - .\win64\objd/ - .\win64\objd/ - .\win64\objd/ - Level4 - true - ProgramDatabase - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bind/HLR.exe - true - ..\..\..\..\win64\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win64\$(VCFMT)\bind/HLR.pdb - Windows - MachineX64 - - - - - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - res;%(AdditionalIncludeDirectories) - - - - - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - Disabled - .\Properties;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {2d6cbbe8-6965-4016-b503-0d715ae26691} - false - - - - - - \ No newline at end of file diff --git a/samples/mfc/standard/04_HLR/adm/win/vc10/HLR.vcxproj.filters b/samples/mfc/standard/04_HLR/adm/win/vc10/HLR.vcxproj.filters deleted file mode 100644 index d8f08c9e32..0000000000 --- a/samples/mfc/standard/04_HLR/adm/win/vc10/HLR.vcxproj.filters +++ /dev/null @@ -1,142 +0,0 @@ - - - - - {71b03503-46e1-4a70-bf46-9d403d37b35a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {22270cbf-7f10-4c26-8fc6-7f68842b776d} - h;hpp;hxx;hm;inl - - - {f220deda-1476-43c2-af8d-81ff1947d33d} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/samples/mfc/standard/04_HLR/res/AXOVIEWU.bmp b/samples/mfc/standard/04_HLR/res/AXOVIEWU.bmp deleted file mode 100644 index 8e9ec566c8..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/AXOVIEWU.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/BACKVIEWD.bmp b/samples/mfc/standard/04_HLR/res/BACKVIEWD.bmp deleted file mode 100644 index 16994f9a58..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/BACKVIEWD.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/BACKVIEWF.bmp b/samples/mfc/standard/04_HLR/res/BACKVIEWF.bmp deleted file mode 100644 index 6ee8aa78c4..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/BACKVIEWF.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/BACKVIEWU.bmp b/samples/mfc/standard/04_HLR/res/BACKVIEWU.bmp deleted file mode 100644 index bee7ef9121..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/BACKVIEWU.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/BOTTOMVIEWD.bmp b/samples/mfc/standard/04_HLR/res/BOTTOMVIEWD.bmp deleted file mode 100644 index eaee70e75e..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/BOTTOMVIEWD.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/BOTTOMVIEWF.bmp b/samples/mfc/standard/04_HLR/res/BOTTOMVIEWF.bmp deleted file mode 100644 index 4ae4f435f5..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/BOTTOMVIEWF.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/BOTTOMVIEWU.bmp b/samples/mfc/standard/04_HLR/res/BOTTOMVIEWU.bmp deleted file mode 100644 index f26d1e4eae..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/BOTTOMVIEWU.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/ChildFrame2D.bmp b/samples/mfc/standard/04_HLR/res/ChildFrame2D.bmp deleted file mode 100644 index f46b327442..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/ChildFrame2D.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/ChildFrame3D.bmp b/samples/mfc/standard/04_HLR/res/ChildFrame3D.bmp deleted file mode 100644 index a987d78b29..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/ChildFrame3D.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/FRONTVIEWD.bmp b/samples/mfc/standard/04_HLR/res/FRONTVIEWD.bmp deleted file mode 100644 index f6250ddc72..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/FRONTVIEWD.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/FRONTVIEWF.bmp b/samples/mfc/standard/04_HLR/res/FRONTVIEWF.bmp deleted file mode 100644 index f3e7bb32b4..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/FRONTVIEWF.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/FRONTVIEWU.bmp b/samples/mfc/standard/04_HLR/res/FRONTVIEWU.bmp deleted file mode 100644 index fc573a3543..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/FRONTVIEWU.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/HLR.rc b/samples/mfc/standard/04_HLR/res/HLR.rc deleted file mode 100644 index 619fb55c4c..0000000000 --- a/samples/mfc/standard/04_HLR/res/HLR.rc +++ /dev/null @@ -1,475 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -#include "..\..\Common\res\OCC_Resource.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "#include ""..\\..\\Common\\res\\OCC_Resource.h""\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_MAINFRAME TOOLBAR 16, 15 -BEGIN - BUTTON ID_FILE_NEW - SEPARATOR - BUTTON ID_BUTTON_HLRDialog - SEPARATOR - BUTTON ID_APP_ABOUT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DIALOG_Color DIALOG 0, 0, 281, 186 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Color Map " -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Type Of The Color Map :",IDC_STATIC,20,10,87,10 - LTEXT "To be updated ...",IDC_ColorMap_STATIC_Type,110,10,69,10 - LTEXT "Size Of The Color Map :",IDC_STATIC,20,20,79,10 - CONTROL "Tab1",IDC_ColorMap_TAB,"SysTabControl32",TCS_BUTTONS,19,53,242,15 - LTEXT "To be updated ...",IDC_ColorMap_STATIC_Size,110,20,69,10 - GROUPBOX "Entries :",IDC_STATIC,10,40,264,50 - LTEXT "Color Name :",IDC_STATIC,20,75,50,10 - LTEXT "To be updated ...",IDC_ColorMap_STATIC_EntryColorName,204,75,69,10 - PUSHBUTTON "Add",IDC_ColorMap_BUTTON_AddNewEntry,110,145,55,15 - GROUPBOX "New Entry",IDC_STATIC,10,100,267,79 - PUSHBUTTON "Update Current",IDC_ColorMap_BUTTON_UpdateCurrentEntry,20,145,55,15 - LTEXT "Color Name :",IDC_ColorMap_STATIC_NewEntryColorNameStatic,20,120,55,10 - PUSHBUTTON "Edit...",IDC_ColorMap_BUTTON_NewEntry_EditColor,204,145,55,15 - LTEXT "999",IDC_ColorMap_STATIC_EntryColorRed,75,75,35,10 - LTEXT "999",IDC_ColorMap_STATIC_EntryColorGreen,120,75,35,10 - LTEXT "999",IDC_ColorMap_STATIC_EntryColorBlue,165,75,35,10 - EDITTEXT IDC_ColorMap_EDIT_NewEntryColorRed,75,120,35,12,ES_AUTOHSCROLL - EDITTEXT IDC_ColorMap_EDIT_NewEntryColorGreen,120,120,30,12,ES_AUTOHSCROLL - EDITTEXT IDC_ColorMap_EDIT_NewEntryColorBlue,165,120,35,12,ES_AUTOHSCROLL - COMBOBOX IDC_ColorMap_COMBO_NewEntryColorName,204,120,70,193,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "New Generic Color Map",IDC_ColorMap_BUTTON_NewGenericColorMap,179,4,95,13 - LTEXT "Not available for this type of Color map",IDC_ColorMap_STATIC_NewEntryNotavailable,70,130,160,10 - PUSHBUTTON "New Color Cube Color Map ",IDC_ColorMap_BUTTON_NewColorCubeColorMap,179,18,95,13 - PUSHBUTTON "New Color Ramp Color Map",IDC_ColorMap_BUTTON_NewColorRampColorMap,179,31,95,13 -END - -IDD_DIALOG_Font DIALOGEX 0, 0, 287, 210 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Font Map" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - LTEXT "Size Of The Font Map :",IDC_STATIC,20,10,80,10 - LTEXT "To be updated ...",IDC_FontMap_STATIC_Size,110,10,80,10 - GROUPBOX "Entries :",IDC_STATIC,10,28,270,97,0,WS_EX_TRANSPARENT - CONTROL "Tab1",IDC_FontMap_TAB,"SysTabControl32",TCS_BUTTONS,20,40,242,15 - GROUPBOX "New Entry",IDC_STATIC,10,130,270,73 - PUSHBUTTON "Update Current",IDC_FontMap_BUTTON_UpdateCurrent,158,181,55,15 - PUSHBUTTON "Add",IDC_FontMap_BUTTON_NewEntry,221,179,55,16 - LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntryValue,63,75,217,10 - LTEXT "Type :",IDC_STATIC,21,155,23,10 - LTEXT "Type :",IDC_STATIC,21,60,40,10 - LTEXT "To be updated ...",IDC_FontMap_STATIC_CurrentEntryType,63,60,80,10 - LTEXT "Size :",IDC_STATIC,21,174,42,10 - LTEXT "Slant :",IDC_STATIC,21,189,28,10 - EDITTEXT IDC_FontMap_EDIT_NewEntrySize,63,172,62,12,ES_AUTOHSCROLL | ES_WANTRETURN - EDITTEXT IDC_FontMap_EDIT_NewEntrySlant,63,187,62,12,ES_AUTOHSCROLL | ES_WANTRETURN - LTEXT "Size :",IDC_STATIC,21,90,30,10 - LTEXT "Slant :",IDC_STATIC,21,106,36,10 - LTEXT "Value :",IDC_STATIC,21,75,40,10 - LTEXT "Type :",IDC_STATIC,21,140,42,10 - COMBOBOX IDC_FontMap_COMBO_NewEntryType,63,138,113,77,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_FontMap_EDIT_NewEntryValue,63,153,209,12,ES_AUTOHSCROLL | ES_READONLY - LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntrySize,63,90,70,10 - LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntrySlant,63,106,80,10 - PUSHBUTTON "Edit...",IDC_FontMap_BUTTON_NewEntry_EditFont,191,138,55,12 -END - -IDD_DIALOG_Width DIALOG 0, 0, 281, 167 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Width Map " -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Size Of The Width Map :",IDC_STATIC,15,10,80,10 - CONTROL "Tab1",IDC_WidthMap_TAB,"SysTabControl32",TCS_BUTTONS,21,40,242,15 - LTEXT "To be updated ...",IDC_WidthMap_STATIC_Size,107,10,80,10 - GROUPBOX "Entries :",IDC_STATIC,10,30,264,57 - LTEXT "Type :",IDC_STATIC,15,60,80,10 - LTEXT "Width :",IDC_STATIC,15,75,80,10 - LTEXT "Type :",IDC_STATIC,15,115,49,10 - LTEXT "Width :",IDC_STATIC,15,130,49,10 - COMBOBOX IDC_WidthMap_COMBO_NewEntryType,70,113,113,77,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_WidthMap_EDIT_NewEntryWidth,70,128,62,12,ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN - LTEXT "To be updated ...",IDC_WidthMap_STATIC_EntryType,107,60,80,10 - LTEXT "To be updated ...",IDC_WidthMap_STATIC_EntryWidth,107,75,80,10 - PUSHBUTTON "Add",IDC_WidthMap_BUTTON_AddNewEntry,200,130,55,15 - GROUPBOX "New Entry",IDC_STATIC,7,101,267,51 - PUSHBUTTON "Update Current",IDC_WidthMap_BUTTON_UpdateCurrentEntry,200,110,55,15 -END - -IDD_DIALOG_NewColorCube DIALOG 0, 0, 207, 156 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "New Color Cube" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,150,10,50,13 - PUSHBUTTON "Cancel",IDCANCEL,150,30,50,14 - LTEXT "base_pixel",IDC_STATIC,20,10,50,10 - LTEXT "greenmax",IDC_STATIC,20,70,50,10 - LTEXT "greenmult",IDC_STATIC,20,90,50,10 - LTEXT "bluemax",IDC_STATIC,20,110,50,10 - LTEXT "bluemult",IDC_STATIC,20,130,50,10 - EDITTEXT IDC_NewColorCube_EDIT_bluemult,80,130,50,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_NewColorCube_EDIT_bluemax,80,110,50,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_NewColorCube_EDIT_grennmult,80,90,50,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_NewColorCube_EDIT_greenmax,80,70,50,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_NewColorCube_EDIT_base_pixel,80,10,50,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "redmax",IDC_STATIC,20,30,50,10 - EDITTEXT IDC_NewColorCube_EDIT_redmax,80,30,50,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "redmult",IDC_STATIC,20,50,50,10 - EDITTEXT IDC_NewColorCube_EDIT_redmult,80,50,50,12,ES_AUTOHSCROLL | ES_NUMBER -END - -IDD_DIALOG_NewColorRamp DIALOG 0, 0, 252, 121 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "New Color ramp" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,150,10,50,13 - PUSHBUTTON "Cancel",IDCANCEL,150,30,50,14 - LTEXT "base_pixel",-1,20,10,49,10 - EDITTEXT IDC_NewColorRamp_EDIT_base_pixel,80,10,40,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "dimension",-1,20,30,49,10 - EDITTEXT IDC_NewColorramp_EDIT_dimension,80,30,40,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Color Name :",IDC_ColorMap_STATIC_NewEntryColorNameStatic,20,50,49,10 - PUSHBUTTON "Edit...",IDC_NewColorMapRamp_BUTTON_EditColor,145,70,55,10 - EDITTEXT IDC_NewColorMapRamp_EDIT_ColorRed,28,70,35,12,ES_AUTOHSCROLL - EDITTEXT IDC_NewColorMapRamp_EDIT_ColorGreen,65,70,35,12,ES_AUTOHSCROLL - EDITTEXT IDC_NewColorMapRamp_EDIT_ColorBlue,103,70,35,12,ES_AUTOHSCROLL - COMBOBOX IDC_NewColorMap_COMBO_NewEntryColorName,80,50,70,193,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP -END - -IDD_DIALOG_Type DIALOGEX 0, 0, 287, 170 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Type Map" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - LTEXT "Size Of The Type Map :",-1,20,10,80,10 - LTEXT "To be updated ...",IDC_TypeMap_STATIC_Size,110,10,80,10 - GROUPBOX "Entries :",-1,10,28,270,62,0,WS_EX_TRANSPARENT - CONTROL "Tab1",IDC_TypeMap_TAB,"SysTabControl32",TCS_BUTTONS,20,40,242,15 - GROUPBOX "New Entry",-1,10,100,270,60 - PUSHBUTTON "Update Current",IDC_FontMap_BUTTON_UpdateCurrent,160,140,55,15 - PUSHBUTTON "Add",IDC_FontMap_BUTTON_NewEntry,220,140,55,15 - LTEXT "To be updated...",IDC_TypeMap_STATIC_CurrentEntryValue,63,75,217,10 - LTEXT "Value :",-1,21,126,42,10 - LTEXT "Style :",-1,21,60,40,10 - LTEXT "To be updated ...",IDC_TypeMap_STATIC_CurrentEntryStyle,63,60,80,10 - LTEXT "Value :",-1,21,75,40,10 - LTEXT "Style :",-1,21,111,42,10 - COMBOBOX IDC_TypeMap_COMBO_NewEntryStyle,63,108,113,77,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_TypeMap_EDIT_NewEntryValue,63,124,194,12,ES_AUTOHSCROLL | ES_READONLY -END - -IDD_DIALOG_Mark DIALOGEX 0, 0, 287, 201 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Mark Map" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - LTEXT "Size Of The Mark Map :",AFX_ID_PREVIEW_CLOSE,20,10,80,10 - LTEXT "To be updated ...",IDC_MarkMap_STATIC_Size,110,10,80,10 - GROUPBOX "Entries :",-1,10,28,270,92,0,WS_EX_TRANSPARENT - CONTROL "Tab1",IDC_MarkMap_TAB,"SysTabControl32",TCS_BUTTONS,20,40,242,15 - LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryXValue,63,75,217,9 - LTEXT "Style :",-1,21,60,40,10 - LTEXT "To be updated ...",IDC_MarkMap_STATIC_CurrentEntryStyle,63,60,80,10 - LTEXT "XValue :",-1,21,75,40,9 - LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryYValue,63,90,217,10 - LTEXT "YValue :",-1,21,90,40,10 - LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntrySValue,63,105,217,10 - LTEXT "SValue :",-1,21,105,40,10 - LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryValue,62,90,217,10 -END - -IDD_SelectionDialog DIALOGEX 0, 0, 232, 183 -STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION -CAPTION "Choose Shapes and Projector" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "2",IDC_HlrDlgView,"Button",BS_OWNERDRAW | WS_DISABLED | WS_TABSTOP,110,60,100,80,WS_EX_TRANSPARENT - CONTROL "Default",IDC_DisplayDefault,"Button",BS_AUTORADIOBUTTON | WS_GROUP,17,0,70,10 - CONTROL "sharp Edges",IDC_VsharpEdges,"Button",BS_AUTORADIOBUTTON,20,20,70,10 - CONTROL "smooth Edges",IDC_VsmoothEdges,"Button",BS_AUTORADIOBUTTON,20,30,70,10 - CONTROL "Sewing Edges",IDC_VSewingEdges,"Button",BS_AUTORADIOBUTTON,20,40,70,10 - CONTROL "Apparent Contour",IDC_VApparentContour,"Button",BS_AUTORADIOBUTTON,20,50,70,10 - CONTROL "Iso parametrics",IDC_VIsoParametrics,"Button",BS_AUTORADIOBUTTON,20,60,70,10 - CONTROL "sharp Edges",IDC_HsharpEdges,"Button",BS_AUTORADIOBUTTON,20,99,70,10 - CONTROL "smooth Edges",IDC_HsmoothEdges,"Button",BS_AUTORADIOBUTTON,20,109,70,10 - CONTROL "Sewing Edges",IDC_HSewingEdges,"Button",BS_AUTORADIOBUTTON,20,119,70,10 - CONTROL "Apparent Contour",IDC_HApparentContour,"Button",BS_AUTORADIOBUTTON,20,129,70,10 - CONTROL "Iso parametrics",IDC_HIsoParametrics,"Button",BS_AUTORADIOBUTTON,20,139,70,10 - CONTROL "Draw Hidden line",IDC_DrawHiddenLine,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,80,70,10 - CONTROL "Poly Algo",IDC_PolyAlgo,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,157,50,10 - CONTROL "Algo",IDC_Algo,"Button",BS_AUTORADIOBUTTON,10,167,50,10 - CONTROL "TOPVIEW",IDC_TopView,"Button",BS_OWNERDRAW | WS_TABSTOP,106,40,13,14 - CONTROL "BOTTOMVIEW",IDC_BottomView,"Button",BS_OWNERDRAW | WS_TABSTOP,121,40,13,14 - CONTROL "LEFTVIEW",IDC_LeftView,"Button",BS_OWNERDRAW | WS_TABSTOP,137,40,13,14 - CONTROL "RIGHTVIEW",IDC_RightView,"Button",BS_OWNERDRAW | WS_TABSTOP,153,40,13,14 - CONTROL "FRONTVIEW",IDC_FrontView,"Button",BS_OWNERDRAW | WS_TABSTOP,169,40,13,14 - CONTROL "BACKVIEW",IDC_BackView,"Button",BS_OWNERDRAW | WS_TABSTOP,185,40,13,14 - CONTROL "AXOVIEW",IDC_AxoView,"Button",BS_OWNERDRAW | WS_TABSTOP,201,40,13,14 - DEFPUSHBUTTON "Get Shapes",ID_GetShape,105,22,57,14 - PUSHBUTTON "Update 2D",ID_Update2D,165,22,50,14 - CONTROL "HLR Mode",IDC_HlrModeIsOn,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,143,51,10 - PUSHBUTTON "Close",IDOK,150,160,50,14 - EDITTEXT IDC_EDIT_NBIsos,100,167,30,12,ES_AUTOHSCROLL - GROUPBOX "Hidden",IDC_STATIC,10,89,82,65 - GROUPBOX "Visible ",IDC_STATIC,10,10,81,64 - GROUPBOX "Choose a projector",IDC_STATIC,97,10,123,145,0,WS_EX_TRANSPARENT - LTEXT "Nb Isos",IDC_STATIC_NbIsos,70,167,30,12 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDR_MAINFRAME BITMAP "Toolbar.bmp" -TOPVIEWD BITMAP "TOPVIEWD.BMP" -TOPVIEWF BITMAP "TOPVIEWF.BMP" -TOPVIEWU BITMAP "TopViewU.BMP" -BOTTOMVIEWU BITMAP "BOTTOMVIEWU.bmp" -BOTTOMVIEWF BITMAP "BOTTOMVIEWF.bmp" -BOTTOMVIEWD BITMAP "BOTTOMVIEWD.bmp" -LEFTVIEWU BITMAP "LEFTVIEWU.bmp" -LEFTVIEWF BITMAP "LEFTVIEWF.bmp" -LEFTVIEWD BITMAP "LEFTVIEWD.bmp" -RIGHTVIEWU BITMAP "RIGHTVIEWU.bmp" -RIGHTVIEWF BITMAP "RIGHTVIEWF.bmp" -RIGHTVIEWD BITMAP "RIGHTVIEWD.bmp" -FRONTVIEWU BITMAP "FRONTVIEWU.bmp" -FRONTVIEWF BITMAP "FRONTVIEWF.bmp" -FRONTVIEWD BITMAP "FRONTVIEWD.bmp" -BACKVIEWU BITMAP "BACKVIEWU.bmp" -BACKVIEWF BITMAP "BACKVIEWF.bmp" -BACKVIEWD BITMAP "BACKVIEWD.bmp" -AXOVIEWU BITMAP "AXOVIEWU.bmp" -AXOVIEWF BITMAP "AXOVIEWF.bmp" -AXOVIEWD BITMAP "AXOVIEWD.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAINFRAME MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Help" - BEGIN - MENUITEM "&About HLR...", ID_APP_ABOUT - END -END - -IDR_3DTYPE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW - MENUITEM "&Close", ID_FILE_CLOSE - MENUITEM SEPARATOR - MENUITEM "Process HLR", ID_FILE_HLR - POPUP "Import" - BEGIN - MENUITEM "BRep...", ID_FILE_IMPORT_BREP - END - POPUP "Export" - BEGIN - MENUITEM "BRep...", ID_FILE_EXPORT_BREP - MENUITEM "Image...", ID_FILE_EXPORT_IMAGE - END - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_APP_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Toolbar", ID_VIEW_TOOLBAR - MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR - END - POPUP "&Window" - BEGIN - MENUITEM "New Window &2D", ID_WINDOW_NEW2D - MENUITEM "New Window &3D", ID_WINDOW_NEW3D - MENUITEM "&Cascade", ID_WINDOW_CASCADE - MENUITEM "&Tile", ID_WINDOW_TILE_HORZ - MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE - END - POPUP "&Help" - BEGIN - MENUITEM "&About HLR...", ID_APP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "Matra Datavision" - VALUE "FileDescription", "SampleHLR MFC Application" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "SampleHLR" - VALUE "LegalCopyright", "Copyright (C) 1998" - VALUE "OriginalFilename", "SampleHLR.EXE" - VALUE "ProductName", "SampleHLR Application" - VALUE "ProductVersion", "1, 0, 0, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDR_MAINFRAME "HLR" - IDR_3DTYPE "\nHLR\nHLR\n\n\nHLR.Document\nHLR Document" -END - -STRINGTABLE -BEGIN - ID_WINDOW_NEW2D "Open another 2d window for the active document\nNew 2d Window" - ID_WINDOW_NEW3D "Open another 3d window for the active document\nNew 3d Window" -END - -STRINGTABLE -BEGIN - ID_OBJECT_DISPLAYALL "Display\nDisplay" -END - -STRINGTABLE -BEGIN - ID_BUTTON_Test_Shape "Test Shape\nTest Shape" -END - -STRINGTABLE -BEGIN - ID_BUTTON_HLRDialog "Open the HLR dialog \nHLR dialog" - ID_FILE_HLR "Open the HLR dialog \nHLR dialog" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/samples/mfc/standard/04_HLR/res/LEFTVIEWD.bmp b/samples/mfc/standard/04_HLR/res/LEFTVIEWD.bmp deleted file mode 100644 index de18453f29..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/LEFTVIEWD.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/LEFTVIEWF.bmp b/samples/mfc/standard/04_HLR/res/LEFTVIEWF.bmp deleted file mode 100644 index 0ff0673901..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/LEFTVIEWF.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/LEFTVIEWU.bmp b/samples/mfc/standard/04_HLR/res/LEFTVIEWU.bmp deleted file mode 100644 index 8edb9d789d..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/LEFTVIEWU.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/RIGHTVIEWD.bmp b/samples/mfc/standard/04_HLR/res/RIGHTVIEWD.bmp deleted file mode 100644 index 72491de3e9..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/RIGHTVIEWD.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/RIGHTVIEWF.bmp b/samples/mfc/standard/04_HLR/res/RIGHTVIEWF.bmp deleted file mode 100644 index 14b287641a..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/RIGHTVIEWF.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/RIGHTVIEWU.bmp b/samples/mfc/standard/04_HLR/res/RIGHTVIEWU.bmp deleted file mode 100644 index 559e866af7..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/RIGHTVIEWU.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/ToolBarObjects.bmp b/samples/mfc/standard/04_HLR/res/ToolBarObjects.bmp deleted file mode 100644 index 7cc5fe8063..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/ToolBarObjects.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/Toolbar.bmp b/samples/mfc/standard/04_HLR/res/Toolbar.bmp deleted file mode 100644 index 633f56cec3..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/Toolbar.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/axoviewd.bmp b/samples/mfc/standard/04_HLR/res/axoviewd.bmp deleted file mode 100644 index f8b478a31a..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/axoviewd.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/axoviewf.bmp b/samples/mfc/standard/04_HLR/res/axoviewf.bmp deleted file mode 100644 index c9146c491a..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/axoviewf.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/dummyd.bmp b/samples/mfc/standard/04_HLR/res/dummyd.bmp deleted file mode 100644 index f92113c447..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/dummyd.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/dummyf.bmp b/samples/mfc/standard/04_HLR/res/dummyf.bmp deleted file mode 100644 index 65e8f3f9d6..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/dummyf.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/dummyu.bmp b/samples/mfc/standard/04_HLR/res/dummyu.bmp deleted file mode 100644 index f92113c447..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/dummyu.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/resource.h b/samples/mfc/standard/04_HLR/res/resource.h deleted file mode 100644 index ed2c12f15b..0000000000 --- a/samples/mfc/standard/04_HLR/res/resource.h +++ /dev/null @@ -1,127 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by HLR.rc -// -#define ID_MENU_CASCADE_PROPERTIES 150 -#define IDD_DIALOG_Font 160 -#define IDD_DIALOG_Width 161 -#define IDD_DIALOG_Color 162 -#define IDD_DIALOG_NewColorCube 163 -#define IDD_DIALOG_NewColorRamp 164 -#define IDD_DIALOG_Type 165 -#define IDD_DIALOG_Mark 166 -#define IDD_SelectionDialog 170 -#define ID_BUTTON_Test_Shape 1049 -#define ID_WINDOW_NEW2D 1150 -#define ID_WINDOW_NEW3D 1151 -#define ID_OBJECT_DISPLAYALL 1201 -#define ID_Collector_Delete 1251 -#define IDC_ColorMap_STATIC_Type 1420 -#define IDC_ColorMap_STATIC_Size 1421 -#define IDC_ColorMap_TAB 1422 -#define IDC_ColorMap_STATIC_EntryColorGreen 1423 -#define IDC_ColorMap_STATIC_EntryColorRed 1424 -#define IDC_ColorMap_STATIC_EntryColorBlue 1425 -#define IDC_ColorMap_STATIC_EntryColorName 1426 -#define IDC_ColorMap_EDIT_NewEntryColorRed 1427 -#define IDC_ColorMap_EDIT_NewEntryColorGreen 1428 -#define IDC_ColorMap_EDIT_NewEntryColorBlue 1429 -#define IDC_ColorMap_COMBO_NewEntryColorName 1430 -#define IDC_ColorMap_BUTTON_NewEntry_EditColor 1431 -#define IDC_ColorMap_BUTTON_UpdateCurrentEntry 1432 -#define IDC_ColorMap_BUTTON_AddNewEntry 1433 -#define IDC_ColorMap_BUTTON_NewGenericColorMap 1434 -#define IDC_ColorMap_STATIC_NewEntryColorNameStatic 1435 -#define IDC_ColorMap_STATIC_NewEntryNotavailable 1436 -#define IDC_ColorMap_BUTTON_NewColorCubeColorMap 1437 -#define IDC_ColorMap_BUTTON_NewColorRampColorMap 1438 -#define IDC_NewColorMap_COMBO_NewEntryColorName 1439 -#define IDC_NewColorMapRamp_EDIT_ColorRed 1441 -#define IDC_NewColorMapRamp_EDIT_ColorGreen 1442 -#define IDC_NewColorMapRamp_EDIT_ColorBlue 1443 -#define IDC_NewColorMapRamp_BUTTON_EditColor 1444 -#define IDC_NewColorRamp_EDIT_base_pixel 1445 -#define IDC_NewColorramp_EDIT_dimension 1446 -#define IDC_NewColorCube_EDIT_bluemult 1447 -#define IDC_NewColorCube_EDIT_base_pixel 1448 -#define IDC_NewColorCube_EDIT_bluemax 1449 -#define IDC_NewColorCube_EDIT_grennmult 1450 -#define IDC_NewColorCube_EDIT_greenmax 1451 -#define IDC_NewColorCube_EDIT_redmax 1452 -#define IDC_NewColorCube_EDIT_redmult 1453 -#define IDC_WidthMap_STATIC_Size 1454 -#define IDC_WidthMap_TAB 1455 -#define IDC_WidthMap_STATIC_EntryType 1456 -#define IDC_WidthMap_STATIC_EntryWidth 1457 -#define IDC_WidthMap_COMBO_NewEntryType 1458 -#define IDC_WidthMap_EDIT_NewEntryWidth 1459 -#define IDC_WidthMap_BUTTON_AddNewEntry 1460 -#define IDC_WidthMap_BUTTON_UpdateCurrentEntry 1461 -#define IDC_FontMap_STATIC_Size 1462 -#define IDC_FontMap_TAB 1463 -#define IDC_FontMap_STATIC_CurrentEntryValue 1464 -#define IDC_FontMap_STATIC_CurrentEntryType 1465 -#define IDC_FontMap_STATIC_CurrentEntrySize 1466 -#define IDC_FontMap_STATIC_CurrentEntrySlant 1467 -#define IDC_FontMap_BUTTON_NewEntry 1468 -#define IDC_FontMap_BUTTON_UpdateCurrent 1469 -#define IDC_FontMap_COMBO_NewEntryType 1470 -#define IDC_FontMap_EDIT_NewEntryValue 1471 -#define IDC_FontMap_EDIT_NewEntrySize 1472 -#define IDC_FontMap_EDIT_NewEntrySlant 1473 -#define IDC_FontMap_BUTTON_NewEntry_EditFont 1474 -#define IDC_TypeMap_STATIC_Size 1475 -#define IDC_TypeMap_TAB 1476 -#define IDC_TypeMap_STATIC_CurrentEntryStyle 1477 -#define IDC_TypeMap_STATIC_CurrentEntryValue 1478 -#define IDC_TypeMap_COMBO_NewEntryStyle 1479 -#define IDC_TypeMap_EDIT_NewEntryValue 1480 -#define IDC_MarkMap_STATIC_Size 1481 -#define IDC_MarkMap_TAB 1482 -#define IDC_MarkMap_STATIC_CurrentEntryXValue 1483 -#define IDC_MarkMap_STATIC_CurrentEntryStyle 1484 -#define IDC_MarkMap_STATIC_CurrentEntryYValue 1485 -#define IDC_MarkMap_STATIC_CurrentEntrySValue 1486 -#define IDC_MarkMap_STATIC_CurrentEntryValue 1487 -#define IDC_PolyAlgo 1500 -#define IDC_Algo 1501 -#define IDC_VsharpEdges 1503 -#define IDC_HsharpEdges 1504 -#define IDC_VsmoothEdges 1505 -#define IDC_VSewingEdges 1506 -#define IDC_VApparentContour 1507 -#define IDC_VIsoParametrics 1508 -#define IDC_DisplayDefault 1509 -#define IDC_BoxView 1512 -#define IDC_HsmoothEdges 1513 -#define IDC_HSewingEdges 1514 -#define IDC_HApparentContour 1516 -#define IDC_HIsoParametrics 1517 -#define ID_GetShape 1518 -#define IDC_EDIT_NBIsos 1519 -#define IDC_STATIC_NbIsos 1520 -#define IDC_DrawHiddenLine 1521 -#define ID_Update2D 1522 -#define IDC_HlrModeIsOn 1523 -#define IDC_TopView 1529 -#define IDC_HlrDlgView 1530 -#define IDC_BottomView 1531 -#define IDC_LeftView 1532 -#define IDC_RightView 1533 -#define IDC_BackView 1534 -#define IDC_FrontView 1535 -#define IDC_AxoView 1536 -#define ID_BUTTON_HLRDialog 1537 -#define ID_FILE_HLR 1539 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 173 -#define _APS_NEXT_COMMAND_VALUE 32797 -#define _APS_NEXT_CONTROL_VALUE 1538 -#define _APS_NEXT_SYMED_VALUE 170 -#endif -#endif diff --git a/samples/mfc/standard/04_HLR/res/topviewd.bmp b/samples/mfc/standard/04_HLR/res/topviewd.bmp deleted file mode 100644 index 391a3260dc..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/topviewd.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/topviewf.bmp b/samples/mfc/standard/04_HLR/res/topviewf.bmp deleted file mode 100644 index 6142ec6a9b..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/topviewf.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/res/topviewu.bmp b/samples/mfc/standard/04_HLR/res/topviewu.bmp deleted file mode 100644 index 6c219424f1..0000000000 Binary files a/samples/mfc/standard/04_HLR/res/topviewu.bmp and /dev/null differ diff --git a/samples/mfc/standard/04_HLR/src/HLRApp.cpp b/samples/mfc/standard/04_HLR/src/HLRApp.cpp deleted file mode 100644 index ab960a9c12..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRApp.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// HLRApp.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" - -#include "HLRApp.h" - -#include -#include -#include "HLRDoc.h" -#include -#include "HLRView2D.h" -#include -// End CasCade - -#ifdef _DEBUG -// CasCade : -//#define new DEBUG_NEW -// End CasCade - -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CHLRApp construction - -CHLRApp::CHLRApp() : OCC_App() -{ - SampleName = "HLR"; //for about dialog - SetSamplePath (L"..\\..\\08_HLR"); -} - -CHLRApp::~CHLRApp() -{ - delete pDocTemplateForView2d; -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CHLRApp object - -CHLRApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CHLRApp initialization - -BOOL CHLRApp::InitInstance() -{ - AfxEnableControlContainer(); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - - // Change the registry key under which our settings are stored. - // You should modify this string to be something appropriate - // such as the name of your company or organization. - // Modified by CasCade : - SetRegistryKey(_T("Local CasCade Applications")); - - LoadStdProfileSettings(); // Load standard INI file options (including MRU) - - // Register the application's document templates. Document templates - // serve as the connection between documents, frame windows and views. - - // CasCade : - - - pDocTemplateForView2d = new CMultiDocTemplate( - IDR_2DTYPE, - RUNTIME_CLASS(CHLRDoc), - RUNTIME_CLASS(OCC_2dChildFrame), // custom MDI child frame - RUNTIME_CLASS(CHLRView2D)); - -// AddDocTemplate(pDocTemplateForView2d); - -// End CasCade - pDocTemplateForView3d = new CMultiDocTemplate( - IDR_3DTYPE, - RUNTIME_CLASS(CHLRDoc), - RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame - RUNTIME_CLASS(OCC_3dView)); - - AddDocTemplate(pDocTemplateForView3d); - - - // create main MDI Frame window - OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB); - if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) - return FALSE; - m_pMainWnd = pMainFrame; - - // Parse command line for standard shell commands, DDE, file open - CCommandLineInfo cmdInfo; - ParseCommandLine(cmdInfo); - - // Dispatch commands specified on the command line - if (!ProcessShellCommand(cmdInfo)) - return FALSE; - - // The main window has been initialized, so show and update it. - pMainFrame->MDITile(MDITILE_VERTICAL); - pMainFrame->ShowWindow(m_nCmdShow); - pMainFrame->UpdateWindow(); - - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////// -// CHLRApp commands - -//=================================================== - -CFrameWnd* CHLRApp::CreateView2D(CHLRDoc* pDoc ) -{ - ASSERT_VALID(pDoc); - ASSERT_VALID(pDocTemplateForView2d); - CRuntimeClass * pViewClass = RUNTIME_CLASS(OCC_2dView); - ASSERT(pViewClass != (CRuntimeClass *)NULL ); - // Create a new frame window - CFrameWnd* pNewFrame = pDocTemplateForView2d->CreateNewFrame(pDoc, NULL); - ASSERT_VALID(pDoc); - pDocTemplateForView2d->InitialUpdateFrame(pNewFrame, pDoc); - ASSERT_VALID(pDoc); -return pNewFrame; -} - -//=================================================== -CFrameWnd* CHLRApp::CreateView3D(CHLRDoc* pDoc ) -{ - ASSERT_VALID(pDoc); - ASSERT_VALID(pDocTemplateForView3d); - CRuntimeClass * pViewClass = RUNTIME_CLASS(OCC_3dView); - ASSERT(pViewClass != (CRuntimeClass *)NULL ); - // Create a new frame window - CFrameWnd* pNewFrame = pDocTemplateForView3d->CreateNewFrame(pDoc, NULL); - pDocTemplateForView3d->InitialUpdateFrame(pNewFrame, pDoc); -return pNewFrame; - -} - - -BOOL CHLRApp::IsViewExisting(CDocument * pDoc, CRuntimeClass * pViewClass, CView * & pView) -{ - ASSERT_VALID(pDoc); - ASSERT(pViewClass != (CRuntimeClass *)NULL ); - - POSITION position = pDoc->GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = pDoc->GetNextView(position); - ASSERT_VALID(pCurrentView); - if (pCurrentView->IsKindOf(pViewClass)) - { - pView = pCurrentView; - return TRUE; - } - } - return FALSE; -} - - - diff --git a/samples/mfc/standard/04_HLR/src/HLRApp.h b/samples/mfc/standard/04_HLR/src/HLRApp.h deleted file mode 100644 index 2645611926..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRApp.h +++ /dev/null @@ -1,36 +0,0 @@ -// HLRApp.h : main header file for the HLR application -// - -#if !defined(AFX_HLR_H__376C7004_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_) -#define AFX_HLR_H__376C7004_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include "HLRDoc.h" -//#include "CutAndPasteSession.h" - -class CHLRApp : public OCC_App -{ -public: - CHLRApp(); - ~CHLRApp(); - virtual BOOL InitInstance(); - - // ========================================= - CFrameWnd* CreateView2D(CHLRDoc* pDoc); - // ========================================= - CFrameWnd* CreateView3D(CHLRDoc* pDoc); - // ========================================= - -private : - BOOL IsViewExisting(CDocument* pDoc,CRuntimeClass* pViewClass,CView*& pView); - CMultiDocTemplate* pDocTemplateForView3d; - CMultiDocTemplate* pDocTemplateForView2d; -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_HLR_H__376C7004_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/04_HLR/src/HLRDoc.cpp b/samples/mfc/standard/04_HLR/src/HLRDoc.cpp deleted file mode 100644 index ed37fcc081..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRDoc.cpp +++ /dev/null @@ -1,205 +0,0 @@ -// HLRDoc.cpp : implementation of the CHLRDoc class -// - - -#include "stdafx.h" - -#include "HLRDoc.h" -#include "HLRApp.h" -#include -#include - - -#include -#include "AISDialogs.h" -#include - -#ifdef _DEBUG -//#define new DEBUG_NEW // by cascade -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CHLRDoc - -IMPLEMENT_DYNCREATE(CHLRDoc, CDocument) - - -BEGIN_MESSAGE_MAP(CHLRDoc, OCC_3dBaseDoc) - //{{AFX_MSG_MAP(CHLRDoc) - ON_COMMAND(ID_WINDOW_NEW3D, OnWindowNew3d) - ON_COMMAND(ID_WINDOW_NEW2D, OnWindowNew2d) - ON_COMMAND(ID_FILE_HLR, OnBUTTONHLRDialog) - ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep) - ON_COMMAND(ID_BUTTON_HLRDialog, OnBUTTONHLRDialog) - ON_COMMAND(ID_OBJECT_ERASE, OnObjectErase) - //}}AFX_MSG_MAP - - -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CHLRDoc construction/destruction - -CHLRDoc::CHLRDoc() -{ - // TODO: add one-time construction code here - Handle(Graphic3d_GraphicDriver) theGraphicDriver = - ((CHLRApp*)AfxGetApp())->GetGraphicDriver(); - - // VIEWER 3D - myViewer = new V3d_Viewer (theGraphicDriver); - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - - myAISContext =new AIS_InteractiveContext (myViewer); - - // 2D VIEWER: exploit V3d viewer for 2D visualization - my2DViewer = new V3d_Viewer (theGraphicDriver); - my2DViewer->SetCircularGridValues (0, 0, 10, 8, 0); - my2DViewer->SetRectangularGridValues (0, 0, 10, 10, 0); - - //Set projection mode for 2D visualization - my2DViewer->SetDefaultViewProj (V3d_Zpos); - - myInteractiveContext2D = new AIS_InteractiveContext (my2DViewer); - - CFrameWnd* pFrame2d = ((CHLRApp*)AfxGetApp())->CreateView2D (this); - pFrame2d->ShowWindow (SW_SHOWNORMAL); - myCSelectionDialogIsCreated = false; -} - -CHLRDoc::~CHLRDoc() -{ - if (myCSelectionDialogIsCreated) - { - myCSelectionDialog->ShowWindow(SW_ERASE); - delete myCSelectionDialog; - } -} - -void CHLRDoc::OnWindowNew2d() -{ - ((CHLRApp*)AfxGetApp())->CreateView2D(this); -} - -void CHLRDoc::OnWindowNew3d() -{ - ((CHLRApp*)AfxGetApp())->CreateView3D(this); -} - -// nCmdShow could be : ( default is SW_RESTORE ) -// SW_HIDE SW_SHOWNORMAL SW_NORMAL -// SW_SHOWMINIMIZED SW_SHOWMAXIMIZED -// SW_MAXIMIZE SW_SHOWNOACTIVATE -// SW_SHOW SW_MINIMIZE -// SW_SHOWMINNOACTIVE SW_SHOWNA -// SW_RESTORE SW_SHOWDEFAULT -// SW_MAX - -// use pViewClass = RUNTIME_CLASS( CHLRView3D ) for 3D Views -// use pViewClass = RUNTIME_CLASS( CHLRView2D ) for 2D Views - -void CHLRDoc::ActivateFrame(CRuntimeClass* pViewClass,int nCmdShow) -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf(pViewClass) ) - { - ASSERT_VALID(pCurrentView); - CFrameWnd* pParentFrm = pCurrentView->GetParentFrame(); - ASSERT(pParentFrm != (CFrameWnd *)NULL); - // simply make the frame window visible - pParentFrm->ActivateFrame(nCmdShow); - } - } -} - -void CHLRDoc::FitAll2DViews(Standard_Boolean UpdateViewer) -{ - if (UpdateViewer) my2DViewer->Update(); - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf(RUNTIME_CLASS(OCC_2dView)) ) - { - ASSERT_VALID(pCurrentView); - ((OCC_2dView*)pCurrentView)->FitAll(); - } - } -} - -///////////////////////////////////////////////////////////////////////////// -// CHLRDoc diagnostics - -#ifdef _DEBUG -void CHLRDoc::AssertValid() const -{ - CDocument::AssertValid(); -} - -void CHLRDoc::Dump(CDumpContext& dc) const -{ - CDocument::Dump(dc); -} -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CHLRDoc commands -void CHLRDoc::OnBUTTONHLRDialog() -{ - if (!myCSelectionDialogIsCreated) - { - myCSelectionDialog = new CSelectionDialog(this,AfxGetMainWnd()); - myCSelectionDialog->Create(CSelectionDialog::IDD, AfxGetMainWnd()); - myCSelectionDialogIsCreated = true; - } - myCSelectionDialog->ShowWindow(SW_RESTORE); - myCSelectionDialog->UpdateWindow(); -} - -void CHLRDoc::OnFileImportBrep() -{ CImportExport::ReadBREP(myAISContext); - Fit(); -} -void CHLRDoc::Fit() -{ - POSITION position = GetFirstViewPosition(); - while (position != (POSITION)NULL) - { - CView* pCurrentView = (CView*)GetNextView(position); - if(pCurrentView->IsKindOf(RUNTIME_CLASS(OCC_3dView)) ) - { - ((OCC_3dView *) pCurrentView)->FitAll(); - } - } -} - -void CHLRDoc::OnObjectErase() -{ - Standard_Boolean toUpdateDisplayable = Standard_False; - myAISContext->InitSelected(); - while (myAISContext->MoreSelected()) - { - if (myAISContext->SelectedInteractive()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated) - { - myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->SelectedInteractive())->Shape()); - toUpdateDisplayable = Standard_True; - } - - myAISContext->Erase (myAISContext->SelectedInteractive(), Standard_True); - myAISContext->InitSelected(); - } - - myAISContext->ClearSelected (Standard_True); - - if (toUpdateDisplayable) - { - // Update view in the HLR dialog if list of displayable shapes has been changed. - myCSelectionDialog->UpdateViews(); - } -} diff --git a/samples/mfc/standard/04_HLR/src/HLRDoc.h b/samples/mfc/standard/04_HLR/src/HLRDoc.h deleted file mode 100644 index ff8382f24e..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRDoc.h +++ /dev/null @@ -1,67 +0,0 @@ -// HLRDoc.h : interface of the CHLRDoc class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_HLRDOC_H__376C700E_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_) -#define AFX_HLRDOC_H__376C700E_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "SelectionDialog.h" -#include - -class CHLRDoc : public OCC_3dBaseDoc -{ -public: - -protected: // create from serialization only - CHLRDoc(); - DECLARE_DYNCREATE(CHLRDoc) - // Attributes -public: - - // Implementation -public: - virtual ~CHLRDoc(); - void Fit(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif -protected: - - // Generated message map functions -protected: - //{{AFX_MSG(CHLRDoc) - afx_msg void OnWindowNew3d(); - afx_msg void OnWindowNew2d(); - afx_msg void OnFileImportBrep(); - afx_msg void OnBUTTONHLRDialog(); - afx_msg void OnObjectErase(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -public : - void ActivateFrame(CRuntimeClass* pViewClass, int nCmdShow = SW_RESTORE ); - -private: - Handle(V3d_Viewer) my2DViewer; - Handle(AIS_InteractiveContext) myInteractiveContext2D; -public : - Handle(V3d_Viewer) GetViewer2D() { return my2DViewer; }; - Handle(AIS_InteractiveContext)& GetInteractiveContext2D(){ return myInteractiveContext2D; }; - void FitAll2DViews(Standard_Boolean UpdateViewer=Standard_False); - -public : - CSelectionDialog* myCSelectionDialog; - bool myCSelectionDialogIsCreated; -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_HLRDOC_H__376C700E_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/04_HLR/src/HLRView2D.cpp b/samples/mfc/standard/04_HLR/src/HLRView2D.cpp deleted file mode 100644 index 04af9531cd..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRView2D.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// HLRView.cpp : implementation of the CHLRView2D class -// - -#include "stdafx.h" -#include "HLRView2D.h" -#include "HLRApp.h" -#include "HLRDoc.h" -#include "resource2d\RectangularGrid.h" -#include "resource2d\CircularGrid.h" - -#ifdef _DEBUG -//#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CHLRView2D - -IMPLEMENT_DYNCREATE(CHLRView2D, OCC_2dView) - -BEGIN_MESSAGE_MAP(CHLRView2D, OCC_2dView) - //{{AFX_MSG_MAP(CHLRView2D) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CHLRView2D construction/destruction - -CHLRView2D::CHLRView2D() -{ - /// TODO - /// Override MouseMove event to exclude rectangle selection emulation as - /// no selection is supported in DragEvent2D for this view. -} - -CHLRView2D::~CHLRView2D() -{ -} - -const Handle(AIS_InteractiveContext)& CHLRView2D::GetAISContext() const -{ - return ((CHLRDoc*)m_pDocument)->GetInteractiveContext2D(); -} - -CHLRDoc* CHLRView2D::GetDocument() // non-debug version is inline -{ - //ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_2dDoc))); - return (CHLRDoc*)m_pDocument; -} - -#ifdef _DEBUG -void CHLRView2D::AssertValid() const -{ - OCC_2dView::AssertValid(); -} - -void CHLRView2D::Dump(CDumpContext& dc) const -{ - OCC_2dView::Dump(dc); -} - -#endif \ No newline at end of file diff --git a/samples/mfc/standard/04_HLR/src/HLRView2D.h b/samples/mfc/standard/04_HLR/src/HLRView2D.h deleted file mode 100644 index 83e1e7684a..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRView2D.h +++ /dev/null @@ -1,42 +0,0 @@ -// HLRView.h : interface of the CHLRView2D class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_HLRVIEW2D_H__376C7013_0B3D_11D2_8E0A_0800369C8A03_2D_INCLUDED_) -#define AFX_HLRVIEW2D_H__376C7013_0B3D_11D2_8E0A_0800369C8A03_2D_INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "HLRDoc.h" -#include -#include "Resource2d/RectangularGrid.h" -#include "Resource2d/CircularGrid.h" - - -class CHLRView2D : public OCC_2dView -{ -protected: // create from serialization only - CHLRView2D(); - DECLARE_DYNCREATE(CHLRView2D) - DECLARE_MESSAGE_MAP() - - //! Return interactive context for HLR presentations. - virtual const Handle(AIS_InteractiveContext)& GetAISContext() const Standard_OVERRIDE; - -// Implementation -public: - virtual ~CHLRView2D(); - CHLRDoc* GetDocument(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif -}; -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_HLRVIEW2D_H__376C7013_0B3D_11D2_8E0A_0800369C8A03_2D_INCLUDED_) diff --git a/samples/mfc/standard/04_HLR/src/HLRView3D.cpp b/samples/mfc/standard/04_HLR/src/HLRView3D.cpp deleted file mode 100644 index 026d6af97e..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRView3D.cpp +++ /dev/null @@ -1,399 +0,0 @@ -// HLRView.cpp : implementation of the CHLRView3D3D class -// - -#include "stdafx.h" -#include "HLRApp.h" - -#include "HLRDoc.h" -#include "HLRView3D.h" -#include "..\..\Common\res\OCC_Resource.h" - -#ifdef _DEBUG -//#define new DEBUG_NEW by CasCade -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -// for elastic bean selection -#define ValZWMin 1 - -// the key for multi selection : -#define MULTISELECTIONKEY MK_SHIFT - -// the key for shortcut ( use to activate dynamic rotation, panning ) -#define CASCADESHORTCUTKEY MK_CONTROL - -// define in which case you want to display the popup -#define POPUPONBUTTONDOWN - -///////////////////////////////////////////////////////////////////////////// -// CHLRView3D - -IMPLEMENT_DYNCREATE(CHLRView3D, OCC_3dView) - -BEGIN_MESSAGE_MAP(CHLRView3D, OCC_3dView) - //{{AFX_MSG_MAP(CHLRView3D) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG_MAP -// CasCade - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONUP() - ON_WM_MOUSEMOVE() - ON_WM_RBUTTONDOWN() -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CHLRView3D construction/destruction - -CHLRView3D::CHLRView3D() -{ -} - -CHLRView3D::~CHLRView3D() -{ -} - -void CHLRView3D::OnInitialUpdate() -{ - - // TODO: Add your specialized code here and/or call the base class - // TODO: Add your specialized code here and/or call the base class - myView = GetDocument()->GetViewer()->CreateView(); - - // store for restore state after rotation (which is in Degenerated mode) - myDegenerateModeIsOn = myView->DegenerateModeIsOn(); - - Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice = - ((CHLRApp*)AfxGetApp())->GetGraphicDevice(); - - Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ()); - myView->SetWindow(aWNTWindow); - if (!aWNTWindow->IsMapped()) aWNTWindow->Map(); - - Standard_Integer w=100 , h=100 ; /* Debug Matrox */ - aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */ - /* Resize is not supposed to be done on */ - /* Matrox */ - /* I suspect another problem elsewhere */ - ::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ; - - // store the mode ( nothing , dynamic zooming, dynamic ... ) - myCurrentMode = CurAction3d_Nothing; - -} - -///////////////////////////////////////////////////////////////////////////// -// CHLRView3D diagnostics - -#ifdef _DEBUG -void CHLRView3D::AssertValid() const -{ - CView::AssertValid(); -} - -void CHLRView3D::Dump(CDumpContext& dc) const -{ - CView::Dump(dc); -} - -CHLRDoc* CHLRView3D::GetDocument() // non-debug version is inline -{ - ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHLRDoc))); - return (CHLRDoc*)m_pDocument; -} -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// CHLRView3D message handlers - - -void CHLRView3D::OnLButtonDown(UINT nFlags, CPoint point) -{ - // save the current mouse coordinate in min - myXmin=point.x; myYmin=point.y; - myXmax=point.x; myYmax=point.y; - - if ( nFlags & CASCADESHORTCUTKEY ) - { - // Button MB1 down Control :start zomming - // SetCursor(AfxGetApp()->LoadStandardCursor()); - } - else // if ( Ctrl ) - { - switch (myCurrentMode) - { - case CurAction3d_Nothing : // start a drag - if (nFlags & MULTISELECTIONKEY) - MultiDragEvent(myXmax,myYmax,-1); - else - DragEvent(myXmax,myYmax,-1); - break; - break; - case CurAction3d_DynamicZooming : // noting - break; - case CurAction3d_WindowZooming : // noting - break; - case CurAction3d_DynamicPanning :// noting - break; - case CurAction3d_GlobalPanning :// noting - break; - case CurAction3d_DynamicRotation : - if (!myDegenerateModeIsOn) - myView->SetDegenerateModeOn(); - myView->StartRotation(point.x,point.y); - break; - default : - throw Standard_Failure(" incompatible Current Mode "); - break; - } - } -} - -void CHLRView3D::OnLButtonUp(UINT nFlags, CPoint point) -{ - if ( nFlags & CASCADESHORTCUTKEY ) - { - return; - } - else // if ( Ctrl ) - { - switch (myCurrentMode) - { - case CurAction3d_Nothing : - if (point.x == myXmin && point.y == myYmin) - { // no offset between down and up --> selectEvent - myXmax=point.x; - myYmax=point.y; - if (nFlags & MULTISELECTIONKEY ) - MultiInputEvent(point.x,point.y); - else - InputEvent (point.x,point.y); - } else - { - myXmax=point.x; myYmax=point.y; - DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False); - if (nFlags & MULTISELECTIONKEY) - MultiDragEvent(point.x,point.y,1); - else - DragEvent(point.x,point.y,1); - } - break; - case CurAction3d_DynamicZooming : - // SetCursor(AfxGetApp()->LoadStandardCursor()); - myCurrentMode = CurAction3d_Nothing; - break; - case CurAction3d_WindowZooming : - myXmax=point.x; myYmax=point.y; - DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash); - if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin)) - // Test if the zoom window is greater than a minimale window. - { - // Do the zoom window between Pmin and Pmax - myView->WindowFitAll(myXmin,myYmin,myXmax,myYmax); - } - myCurrentMode = CurAction3d_Nothing; - break; - case CurAction3d_DynamicPanning : - myCurrentMode = CurAction3d_Nothing; - break; - case CurAction3d_GlobalPanning : - myView->Place(point.x,point.y,myCurZoom); - myCurrentMode = CurAction3d_Nothing; - break; - case CurAction3d_DynamicRotation : - myCurrentMode = CurAction3d_Nothing; - break; - default : - throw Standard_Failure(" incompatible Current Mode "); - break; - } //switch (myCurrentMode) - } // else // if ( Ctrl ) -} - -void CHLRView3D::OnRButtonDown(UINT nFlags, CPoint point) -{ - if ( nFlags & CASCADESHORTCUTKEY ) - { - if (!myDegenerateModeIsOn) - myView->SetDegenerateModeOn(); - myView->StartRotation(point.x,point.y); - } - else // if ( CASCADESHORTCUTKEY ) - { -#ifdef POPUPONBUTTONDOWN - GetDocument()->Popup(point.x,point.y, myView); -#endif - } -} - -void CHLRView3D::OnMouseMove(UINT nFlags, CPoint point) -{ - // ============================ LEFT BUTTON ======================= - if ( nFlags & MK_LBUTTON) - { - if ( nFlags & CASCADESHORTCUTKEY ) - { - // move with MB1 and Control : on the dynamic zooming - // Do the zoom in function of mouse's coordinates - myView->Zoom(myXmax,myYmax,point.x,point.y); - // save the current mouse coordinate in min - myXmax = point.x; - myYmax = point.y; - } - else // if ( Ctrl ) - { - switch (myCurrentMode) - { - case CurAction3d_Nothing : - DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False); - myXmax = point.x; - myYmax = point.y; - if (nFlags & MULTISELECTIONKEY) - MultiDragEvent(myXmax,myYmax,0); - else - DragEvent(myXmax,myYmax,0); - DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True); - break; - case CurAction3d_DynamicZooming : - myView->Zoom(myXmax,myYmax,point.x,point.y); - // save the current mouse coordinate in min \n"; - myXmax=point.x; myYmax=point.y; - break; - case CurAction3d_WindowZooming : - myXmax = point.x; myYmax = point.y; - DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash); - DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash); - break; - case CurAction3d_DynamicPanning : - myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning - myXmax = point.x; myYmax = point.y; - break; - case CurAction3d_GlobalPanning : // nothing - break; - case CurAction3d_DynamicRotation : - myView->Rotation(point.x,point.y); - myView->Redraw(); - break; - default : - throw Standard_Failure(" incompatible Current Mode "); - break; - }// switch (myCurrentMode) - }// if ( nFlags & CASCADESHORTCUTKEY ) else - } else // if ( nFlags & MK_LBUTTON) - // ============================ MIDDLE BUTTON ======================= - if ( nFlags & MK_MBUTTON) - { - if ( nFlags & CASCADESHORTCUTKEY ) - { - myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning - myXmax = point.x; myYmax = point.y; - - } - } else // if ( nFlags & MK_MBUTTON) - // ============================ RIGHT BUTTON ======================= - if ( nFlags & MK_RBUTTON) - { - if ( nFlags & CASCADESHORTCUTKEY ) - { - myView->Rotation(point.x,point.y); - } - }else //if ( nFlags & MK_RBUTTON) - // ============================ NO BUTTON ======================= - { // No buttons - myXmax = point.x; myYmax = point.y; - if (nFlags & MULTISELECTIONKEY) - MultiMoveEvent(point.x,point.y); - else - MoveEvent(point.x,point.y); - } -} - -void CHLRView3D::DragEvent(const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState ) -{ - - // TheState == -1 button down - // TheState == 0 move - // TheState == 1 button up - - static Standard_Integer theButtonDownX=0; - static Standard_Integer theButtonDownY=0; - - if (TheState == -1) - { - theButtonDownX=x; - theButtonDownY=y; - } - - if (TheState == 0) - { - GetDocument()->GetAISContext()->SelectRectangle (Graphic3d_Vec2i (theButtonDownX,theButtonDownY), - Graphic3d_Vec2i (x,y), - myView); - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CHLRView3D::InputEvent(const Standard_Integer x , - const Standard_Integer y ) -{ - GetDocument()->GetAISContext()->SelectDetected(); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CHLRView3D::MoveEvent(const Standard_Integer x , - const Standard_Integer y ) -{ - GetDocument()->GetAISContext()->MoveTo(x,y,myView); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CHLRView3D::MultiMoveEvent(const Standard_Integer x , - const Standard_Integer y ) -{ - GetDocument()->GetAISContext()->MoveTo(x,y,myView); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CHLRView3D::MultiDragEvent(const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState ) -{ - static Standard_Integer theButtonDownX=0; - static Standard_Integer theButtonDownY=0; - - if (TheState == -1) - { - theButtonDownX=x; - theButtonDownY=y; - } - - if (TheState == 0) - { - GetDocument()->GetAISContext()->SelectRectangle (Graphic3d_Vec2i (theButtonDownX,theButtonDownY), - Graphic3d_Vec2i (x,y), - myView, - AIS_SelectionScheme_XOR); - } -} - - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void CHLRView3D::MultiInputEvent(const Standard_Integer x , - const Standard_Integer y ) -{ - GetDocument()->GetAISContext()->SelectDetected (AIS_SelectionScheme_XOR); -} - diff --git a/samples/mfc/standard/04_HLR/src/HLRView3D.h b/samples/mfc/standard/04_HLR/src/HLRView3D.h deleted file mode 100644 index a115e8476e..0000000000 --- a/samples/mfc/standard/04_HLR/src/HLRView3D.h +++ /dev/null @@ -1,85 +0,0 @@ -// HLRView.h : interface of the CHLRView3D class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_HLRVIEW3D_H__376C7010_0B3D_11D2_8E0A_0800369C8A03_3D_INCLUDED_) -#define AFX_HLRVIEW3D_H__376C7010_0B3D_11D2_8E0A_0800369C8A03_3D_INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include - -class CHLRView3D : public OCC_3dView -{ -protected: // create from serialization only - CHLRView3D(); - DECLARE_DYNCREATE(CHLRView3D) - -// Attributes -public: - CHLRDoc* GetDocument(); - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CHLRView3D) - public: - virtual void OnInitialUpdate(); // CasCade - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CHLRView3D(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: - -// Generated message map functions -protected: - //{{AFX_MSG(CHLRView3D) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! -// CasCade : - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - - void DragEvent (const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState); - void InputEvent (const Standard_Integer x , - const Standard_Integer y ); - void MoveEvent (const Standard_Integer x , - const Standard_Integer y ); - void MultiMoveEvent (const Standard_Integer x , - const Standard_Integer y ); - void MultiDragEvent (const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState); - void MultiInputEvent(const Standard_Integer x , - const Standard_Integer y ); - - -}; - -#ifndef _DEBUG // debug version in HLRView.cpp -inline CHLRDoc* CHLRView3D::GetDocument() - { return (CHLRDoc*)m_pDocument; } -#endif - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_HLRVIEW3D_H__376C7010_0B3D_11D2_8E0A_0800369C8A03_3D_INCLUDED_) diff --git a/samples/mfc/standard/04_HLR/src/SelectionDialog.cpp b/samples/mfc/standard/04_HLR/src/SelectionDialog.cpp deleted file mode 100644 index d7a44fc4ca..0000000000 --- a/samples/mfc/standard/04_HLR/src/SelectionDialog.cpp +++ /dev/null @@ -1,562 +0,0 @@ -// SelectionDialog.cpp : implementation file -// - -#include "stdafx.h" - -#include "SelectionDialog.h" - -#include "HLRApp.h" -#include "OCC_2dView.h" -#include - -#ifdef _DEBUG -//#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -// the key for shortcut ( use to activate dynamic rotation, panning ) -#define CASCADESHORTCUTKEY MK_CONTROL - -///////////////////////////////////////////////////////////////////////////// -// CSelectionDialog dialog - -CSelectionDialog::CSelectionDialog (CHLRDoc* aDoc,CWnd* pParent /*=NULL*/) -: CDialog(CSelectionDialog::IDD, pParent) -{ - myDoc = aDoc; - myIsDisplayed = false; - //{{AFX_DATA_INIT(CSelectionDialog) - m_Algo = 1; - m_DisplayMode = 0; - m_NbIsos = 2; - m_DrawHiddenLine = TRUE; - m_HlrModeIsOn = TRUE; - //}}AFX_DATA_INIT -} - -void CSelectionDialog::DoDataExchange (CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CSelectionDialog) - DDX_Radio(pDX, IDC_PolyAlgo, m_Algo); - DDX_Radio(pDX, IDC_DisplayDefault, m_DisplayMode); - DDX_Text(pDX, IDC_EDIT_NBIsos, m_NbIsos); - DDX_Check(pDX, IDC_DrawHiddenLine, m_DrawHiddenLine); - DDX_Check(pDX, IDC_HlrModeIsOn, m_HlrModeIsOn); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CSelectionDialog, CDialog) - //{{AFX_MSG_MAP(CSelectionDialog) - ON_BN_CLICKED(ID_GetShape, OnGetSelectedShapes) - ON_BN_CLICKED(IDC_DisplayDefault, OnDisplayDefault) - ON_BN_CLICKED(IDC_VIsoParametrics, OnVIsoParametrics) - ON_BN_CLICKED(IDC_VApparentContour, OnVApparentContour) - ON_BN_CLICKED(IDC_VSewingEdges, OnVSewingEdges) - ON_BN_CLICKED(IDC_VsharpEdges, OnVsharpEdges) - ON_BN_CLICKED(IDC_VsmoothEdges, OnVsmoothEdges) - ON_BN_CLICKED(IDC_HsharpEdges, OnHsharpEdges) - ON_BN_CLICKED(IDC_HsmoothEdges, OnHsmoothEdges) - ON_BN_CLICKED(IDC_HSewingEdges, OnHSewingEdges) - ON_BN_CLICKED(IDC_HIsoParametrics, OnHIsoParametrics) - ON_BN_CLICKED(IDC_HApparentContour, OnHApparentContour) - ON_EN_CHANGE(IDC_EDIT_NBIsos, OnChangeEDITNBIsos) - ON_BN_CLICKED(IDC_Algo, OnAlgo) - ON_BN_CLICKED(IDC_PolyAlgo, OnPolyAlgo) - ON_BN_CLICKED(ID_Update2D, OnUpdate2D) - ON_BN_CLICKED(IDC_TopView, OnTopView) - ON_BN_CLICKED(IDC_BottomView, OnBottomView) - ON_BN_CLICKED(IDC_LeftView, OnLeftView) - ON_BN_CLICKED(IDC_RightView, OnRightView) - ON_BN_CLICKED(IDC_FrontView, OnFrontView) - ON_BN_CLICKED(IDC_BackView, OnBackView) - ON_BN_CLICKED(IDC_AxoView, OnAxoView) - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONUP() - ON_WM_RBUTTONDOWN() - ON_WM_RBUTTONUP() - ON_WM_MOUSEMOVE() - ON_BN_CLICKED(IDC_DrawHiddenLine, OnDrawHiddenLine) - ON_BN_CLICKED(IDC_HlrModeIsOn, OnHlrMode) - ON_WM_DRAWITEM() - ON_WM_PAINT() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CSelectionDialog message handlers - -BOOL CSelectionDialog::OnInitDialog() -{ - CDialog::OnInitDialog(); - - VERIFY(TopView.AutoLoad (IDC_TopView, this)); - VERIFY(BottomView.AutoLoad (IDC_BottomView, this)) ; - VERIFY(LeftView .AutoLoad (IDC_LeftView , this)) ; - VERIFY(RightView .AutoLoad (IDC_RightView , this)) ; - VERIFY(FrontView .AutoLoad (IDC_FrontView , this)) ; - VERIFY(BackView .AutoLoad (IDC_BackView , this)) ; - VERIFY(AxoView .AutoLoad (IDC_AxoView , this)) ; - - // get the View Window position to managed mouse move - CRect BoxRect,ViewRect; - GetWindowRect (BoxRect); - CWnd * TheViewerWindow = GetDlgItem (IDC_HlrDlgView); - TheViewerWindow->GetWindowRect (ViewRect); - myPosMinX = ViewRect.TopLeft().x - BoxRect.TopLeft().x; - myPosMaxX = ViewRect.Width() + myPosMinX; - myPosMinY = ViewRect.TopLeft().y - BoxRect.TopLeft().y; - myPosMaxY = myPosMinY + ViewRect.Height(); - - ShowHideButton (Standard_False); - OnDisplay (true); - - // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE - return TRUE; -} - -void CSelectionDialog::OnDisplay (bool isFit) -{ - // GetDlgItem(IDC_HlrDlgView)->SetRedraw() wrapping of this method makes view blinking, - // but displaying of big models may be faster. - //GetDlgItem(IDC_HlrDlgView)->SetRedraw(true); - if (!myIsDisplayed) - { - Handle(Graphic3d_GraphicDriver) aGraphicDriver = - ((CHLRApp*)AfxGetApp())->GetGraphicDriver(); - - myActiveViewer = new V3d_Viewer (aGraphicDriver); - myActiveViewer->SetDefaultLights(); - myActiveViewer->SetLightOn(); - myActiveView = myActiveViewer->CreateView(); - - Handle(WNT_Window) aWNTWindow = new WNT_Window (GetDlgItem (IDC_HlrDlgView)->GetSafeHwnd(), - Quantity_NOC_GRAY); - myActiveView->SetComputedMode (m_HlrModeIsOn != 0); - myActiveView->SetWindow(aWNTWindow); - - myInteractiveContext = new AIS_InteractiveContext (myActiveViewer); - - // TRIHEDRON - Handle(Geom_Axis2Placement) aTrihedronAxis = new Geom_Axis2Placement (gp::XOY()); - myTrihedron = new AIS_Trihedron (aTrihedronAxis); - - myInteractiveContext->Display (myTrihedron, Standard_False); - myIsDisplayed = Standard_True; - } - if(isFit) - { - myActiveView->ZFitAll(); - myActiveView->FitAll(); - } - - myActiveView->Redraw(); - //GetDlgItem (IDC_HlrDlgView)->SetRedraw (false); -} - - -void CSelectionDialog::SetTitle (const CString & aTitle) -{ - SetWindowText (aTitle); -} - -void CSelectionDialog::UpdateViews() -{ - // Clear HLR dialog view - myInteractiveContext->RemoveAll (Standard_False); - myInteractiveContext->Display (myTrihedron, Standard_False); - - UpdateProjector(); - - // Display chosen shapes in the HLR dialog view. - Standard_Boolean OneOrMoreFound = Standard_False; - for (myDoc->GetAISContext()->InitSelected(); - myDoc->GetAISContext()->MoreSelected(); - myDoc->GetAISContext()->NextSelected()) - { - Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->SelectedInteractive()); - if (!anAISShape.IsNull()) - { - OneOrMoreFound = Standard_True; - myInteractiveContext->Display (anAISShape, Standard_False); - } - } - myInteractiveContext->UpdateCurrentViewer(); - // Apply HLR to chosen shapes and display result into the 2d view. - Apply(); - // Update viewer - myDoc->FitAll2DViews (Standard_False); - // Check the selection: if no object : disable all possibility. - ShowHideButton (OneOrMoreFound); - OnDisplay (true); -} - -void CSelectionDialog::OnGetSelectedShapes() -{ - // Create new displayable shape. - myDisplayableShape = new ISession2D_Shape(); - UpdateProjector(); - myDisplayableShape->SetNbIsos (m_NbIsos); - - // Clear HLR dialog view - myInteractiveContext->RemoveAll (Standard_False); - myInteractiveContext->Display (myTrihedron, Standard_False); - - Standard_Boolean OneOrMoreFound = Standard_False; - for (myDoc->GetAISContext()->InitSelected(); - myDoc->GetAISContext()->MoreSelected(); - myDoc->GetAISContext()->NextSelected()) - { - Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->SelectedInteractive()); - - if (!anAISShape.IsNull()) - { - OneOrMoreFound = Standard_True; - TopoDS_Shape aShape = anAISShape->Shape(); - myDisplayableShape->Add (aShape); - Handle(AIS_Shape) aSelectedShape = new AIS_Shape (aShape); - myInteractiveContext->Display (aSelectedShape, Standard_False); - } - } - myInteractiveContext->UpdateCurrentViewer(); - // Apply HLR to chosen shapes and display result into the 2d view. - Apply(); - // Update viewer - myDoc->FitAll2DViews (Standard_False); - - // Check the selection: if no object : disable all possibility. - ShowHideButton (OneOrMoreFound); - OnDisplay (true); -} - -void CSelectionDialog::Apply() -{ - SetCursor(AfxGetApp()->LoadStandardCursor (IDC_WAIT)); - myDoc->GetInteractiveContext2D()->RemoveAll (Standard_False); - UpdateData (true); - - Standard_Integer aDisplayMode = m_DisplayMode; - - if (m_Algo == 1) - { - aDisplayMode += 100; - } - - if (!m_DrawHiddenLine) - { - aDisplayMode += 1000; - } - - myDoc->GetInteractiveContext2D()->Display (myDisplayableShape, // object - aDisplayMode, - aDisplayMode, - Standard_True); // Redraw - - SetCursor(AfxGetApp()->LoadStandardCursor (IDC_ARROW)); -} - -void CSelectionDialog::UpdateProjector() -{ - const Handle(Graphic3d_Camera)& aCam = myActiveView->Camera(); - gp_Dir aBackDir = -aCam->Direction(); - gp_Dir aXpers = aCam->Up().Crossed (aBackDir); - gp_Ax3 anAx3 (aCam->Center(), aBackDir, aXpers); - gp_Trsf aTrsf; - aTrsf.SetTransformation (anAx3); - HLRAlgo_Projector aProjector (aTrsf, !aCam->IsOrthographic(), aCam->Scale()); - - OnDisplay(false); - - if (myDisplayableShape.IsNull()) return; - myDisplayableShape->SetProjector(aProjector); -} - -void CSelectionDialog::ShowHideButton(Standard_Boolean EnableButton) -{ - UpdateData(true); - - GetDlgItem(ID_Update2D )->EnableWindow(EnableButton); - GetDlgItem(IDC_DisplayDefault )->EnableWindow(EnableButton); - GetDlgItem(IDC_PolyAlgo )->EnableWindow(EnableButton); - GetDlgItem(IDC_Algo )->EnableWindow(EnableButton); - - GetDlgItem(IDC_VsharpEdges )->EnableWindow(EnableButton); - GetDlgItem(IDC_VsmoothEdges )->EnableWindow(EnableButton); - GetDlgItem(IDC_VSewingEdges )->EnableWindow(EnableButton); - GetDlgItem(IDC_VApparentContour )->EnableWindow(EnableButton); - GetDlgItem(IDC_VIsoParametrics )->EnableWindow(EnableButton); - - GetDlgItem(IDC_DrawHiddenLine )->EnableWindow(EnableButton); - - GetDlgItem(IDC_HsmoothEdges )->EnableWindow(EnableButton && m_DrawHiddenLine); - GetDlgItem(IDC_HSewingEdges )->EnableWindow(EnableButton && m_DrawHiddenLine); - GetDlgItem(IDC_HApparentContour )->EnableWindow(EnableButton && m_DrawHiddenLine); - GetDlgItem(IDC_HsharpEdges )->EnableWindow(EnableButton && m_DrawHiddenLine); - GetDlgItem(IDC_HIsoParametrics )->EnableWindow(EnableButton && m_DrawHiddenLine); - - GetDlgItem(IDC_EDIT_NBIsos )->EnableWindow(EnableButton); - GetDlgItem(IDC_STATIC_NbIsos )->EnableWindow(EnableButton); - - if(m_Algo == 0) - { - if (m_DisplayMode == 5 || m_DisplayMode == 10) - { - m_DisplayMode=0; - } - - GetDlgItem(IDC_VIsoParametrics)->EnableWindow(false); - GetDlgItem(IDC_HIsoParametrics)->EnableWindow(false); - GetDlgItem(IDC_STATIC_NbIsos) ->EnableWindow(false); - GetDlgItem(IDC_EDIT_NBIsos) ->EnableWindow(false); - } - else - { - GetDlgItem(IDC_VIsoParametrics)->EnableWindow(true); - GetDlgItem(IDC_HIsoParametrics)->EnableWindow(m_DrawHiddenLine); - GetDlgItem(IDC_STATIC_NbIsos) ->EnableWindow(true); - GetDlgItem(IDC_EDIT_NBIsos) ->EnableWindow(true); - } - UpdateData(false); -} - -void CSelectionDialog::OnDisplayDefault() -{ Apply(); } -void CSelectionDialog::OnVIsoParametrics() -{ Apply(); } -void CSelectionDialog::OnVApparentContour() -{ Apply(); } -void CSelectionDialog::OnVSewingEdges() -{ Apply(); } -void CSelectionDialog::OnVsharpEdges() -{ Apply(); } -void CSelectionDialog::OnVsmoothEdges() -{ Apply(); } -void CSelectionDialog::OnHsharpEdges() -{ Apply(); } -void CSelectionDialog::OnHsmoothEdges() -{ Apply(); } -void CSelectionDialog::OnHSewingEdges() -{ Apply(); } -void CSelectionDialog::OnHIsoParametrics() -{ Apply(); } -void CSelectionDialog::OnHApparentContour() -{ Apply(); } - -void CSelectionDialog::OnChangeEDITNBIsos() -{ - UpdateData(true); - myDisplayableShape->SetNbIsos(m_NbIsos); - Apply(); -} -void CSelectionDialog::OnAlgo() -{ - ShowHideButton(); - Apply(); -} - -void CSelectionDialog::OnPolyAlgo() -{ - ShowHideButton(); - Apply(); -} - -void CSelectionDialog::OnDrawHiddenLine() -{ - UpdateData(true); - if(m_DisplayMode >=6 ) - { - m_DisplayMode=0; - UpdateData(false); - } - ShowHideButton(); - Apply(); -} - -void CSelectionDialog::OnUpdate2D() -{ - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - myDoc->ActivateFrame(RUNTIME_CLASS(OCC_2dView),SW_NORMAL); - UpdateProjector(); - Apply(); - myDoc->FitAll2DViews(Standard_False); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); -} - -void CSelectionDialog::OnTopView() -{ - myActiveView->SetProj(V3d_Zpos); - OnDisplay(true); -} - -void CSelectionDialog::OnBottomView() -{ - myActiveView->SetProj(V3d_Zneg); - OnDisplay(true); -} - -void CSelectionDialog::OnLeftView() -{ - myActiveView->SetProj(V3d_Xneg); - OnDisplay(true); -} - -void CSelectionDialog::OnRightView() -{ - myActiveView->SetProj(V3d_Xpos); - OnDisplay(true); -} - -void CSelectionDialog::OnFrontView() -{ - myActiveView->SetProj(V3d_Yneg); - OnDisplay(true); -} - -void CSelectionDialog::OnBackView() -{ - myActiveView->SetProj(V3d_Ypos); - OnDisplay(true); -} - -void CSelectionDialog::OnAxoView() -{ - myActiveView->SetProj(V3d_XposYnegZpos); - OnDisplay(true); -} - -void CSelectionDialog::OnHlrMode() -{ - UpdateData(true); - - if (!m_HlrModeIsOn) - { - myActiveView->SetComputedMode (m_HlrModeIsOn != 0); - myActiveView->Redraw(); - } - else - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - myActiveView->SetComputedMode (m_HlrModeIsOn != 0); - myActiveView->Redraw(); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - OnDisplay(false); -} - -void CSelectionDialog::OnLButtonDown(UINT nFlags, CPoint point) -{ - CDialog::OnLButtonDown(nFlags, point); - - if ((myPosMinX > point.x)||(myPosMaxX < point.x) || - (myPosMinY > point.y) ||(myPosMaxY < point.y)) - return; - - // save the current mouse coordinate - myXmax=point.x; myYmax=point.y; -} - -void CSelectionDialog::OnLButtonUp(UINT nFlags, CPoint point) -{ - CDialog::OnLButtonUp(nFlags, point); - - if ((myPosMinX > point.x)||(myPosMaxX < point.x) || - (myPosMinY > point.y) ||(myPosMaxY < point.y)) - return; -} - -void CSelectionDialog::OnRButtonDown(UINT nFlags, CPoint point) -{ - CDialog::OnRButtonDown(nFlags, point); - - if ((myPosMinX > point.x) || (myPosMaxX < point.x) || - (myPosMinY > point.y) || (myPosMaxY < point.y)) - { - return; - } - - if ( nFlags & CASCADESHORTCUTKEY ) - { - if (m_HlrModeIsOn) - { - myActiveView->SetComputedMode (Standard_False); - } - myActiveView->StartRotation (point.x, point.y); - OnDisplay (false); - } -} - -void CSelectionDialog::OnRButtonUp(UINT nFlags, CPoint point) -{ - CDialog::OnRButtonUp(nFlags, point); - - if ((myPosMinX > point.x) || (myPosMaxX < point.x) || - (myPosMinY > point.y) || (myPosMaxY < point.y)) - { - return; - } - - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - // reset the good HLR mode according to the stored one - // --> dynamic rotation may have change it - if (m_HlrModeIsOn != 0) - { - myActiveView->SetComputedMode (true); - myActiveView->Redraw(); - } - OnDisplay(false); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); -} - -void CSelectionDialog::OnMouseMove(UINT nFlags, CPoint point) -{ - CDialog::OnMouseMove(nFlags, point); - - if ((myPosMinX > point.x)||(myPosMaxX < point.x) || - (myPosMinY > point.y) ||(myPosMaxY < point.y)) - return; - - if ( nFlags & MK_LBUTTON) - {//left button - if ( nFlags & CASCADESHORTCUTKEY ) - { - // move with MB1 and Control : on the dynamic zooming - // Do the zoom in function of mouse's coordinates - myActiveView->Zoom(myXmax,myYmax,point.x,point.y); - // save the current mouse coordinate - myXmax = point.x; myYmax = point.y; - }// if ( nFlags & CASCADESHORTCUTKEY ) else - } - else if ( nFlags & MK_MBUTTON) - { - if ( nFlags & CASCADESHORTCUTKEY ) - { - myActiveView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning - myXmax = point.x; myYmax = point.y; - } - } - else if ( nFlags & MK_RBUTTON) - {//right button - if ( nFlags & CASCADESHORTCUTKEY ) - { - myActiveView->Rotation(point.x,point.y); - } - } - else - {// No buttons - myXmax = point.x; myYmax = point.y; - } - OnDisplay(false); -} - -void CSelectionDialog::OnOK() -{ - CDialog::OnOK(); -} - -void CSelectionDialog::OnPaint() -{ - OnDisplay(false); -} diff --git a/samples/mfc/standard/04_HLR/src/SelectionDialog.h b/samples/mfc/standard/04_HLR/src/SelectionDialog.h deleted file mode 100644 index 7aa6eeb057..0000000000 --- a/samples/mfc/standard/04_HLR/src/SelectionDialog.h +++ /dev/null @@ -1,127 +0,0 @@ -#if !defined(AFX_SelectionDialog_H__0307BDF3_AF53_11D1_8DAE_0800369C8A03__INCLUDED_) -#define AFX_SelectionDialog_H__0307BDF3_AF53_11D1_8DAE_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// SelectionDialog.h : header file -// -#include "resource.h" -#include -#include "SelectionDialog.h" - -class CHLRDoc; -///////////////////////////////////////////////////////////////////////////// -// CSelectionDialog dialog - -class CSelectionDialog : public CDialog -{ - // Construction -public: - // standard constructor - CSelectionDialog (CHLRDoc* aDoc,CWnd* pParent = NULL); - - void SetTitle (const CString& aTitle); - - void OnDisplay (bool isFit); - - const Handle(ISession2D_Shape) DiplayableShape() { return myDisplayableShape; } - - // Updates in dialog view and main 2d and 3d views shapes for which HLR presentations are going to be displayed in 2d view. - void UpdateViews(); - - // Dialog Data - //{{AFX_DATA(CSelectionDialog) - enum { IDD = IDD_SelectionDialog }; - int m_Algo; - int m_DisplayMode; - int m_NbIsos; - BOOL m_DrawHiddenLine; - BOOL m_HlrModeIsOn; - //}}AFX_DATA - - // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CSelectionDialog) -protected: - virtual void DoDataExchange(CDataExchange* pDX); - //}}AFX_VIRTUAL - - // Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CSelectionDialog) - virtual BOOL OnInitDialog(); - afx_msg void OnGetSelectedShapes(); - afx_msg void OnDisplayDefault(); - afx_msg void OnVIsoParametrics(); - afx_msg void OnVApparentContour(); - afx_msg void OnVSewingEdges(); - afx_msg void OnVsharpEdges(); - afx_msg void OnVsmoothEdges(); - afx_msg void OnHsharpEdges(); - afx_msg void OnHsmoothEdges(); - afx_msg void OnHSewingEdges(); - afx_msg void OnHIsoParametrics(); - afx_msg void OnHApparentContour(); - afx_msg void OnChangeEDITNBIsos(); - afx_msg void OnAlgo(); - afx_msg void OnPolyAlgo(); - afx_msg void OnUpdate2D(); - afx_msg void OnTopView(); - afx_msg void OnBottomView(); - afx_msg void OnLeftView(); - afx_msg void OnRightView(); - afx_msg void OnFrontView(); - afx_msg void OnBackView(); - afx_msg void OnAxoView(); - virtual void OnOK(); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnRButtonUp(UINT nFlags, CPoint point); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnDrawHiddenLine(); - afx_msg void OnHlrMode(); - afx_msg void OnPaint(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -private : - void UpdateProjector(); - void ShowHideButton(Standard_Boolean EnableButton=Standard_True); - void Apply(); - CHLRDoc* myDoc; - - Handle(AIS_InteractiveContext) myInteractiveContext; - Handle(V3d_Viewer) myActiveViewer; - Handle(V3d_View) myActiveView; - Handle(AIS_Trihedron) myTrihedron; - Handle(ISession2D_Shape) myDisplayableShape; - - Standard_Integer myPosMaxX; - Standard_Integer myPosMinX; - Standard_Integer myBoxX; - - Standard_Integer myPosMinY; - Standard_Integer myPosMaxY; - Standard_Integer myBoxY; - - Standard_Integer myXmax; - Standard_Integer myYmax; - -protected: - CBitmapButton TopView; - CBitmapButton BottomView; - CBitmapButton LeftView; - CBitmapButton RightView; - CBitmapButton FrontView; - CBitmapButton BackView; - CBitmapButton AxoView; - bool myIsDisplayed; -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_SelectionDialog_H__0307BDF3_AF53_11D1_8DAE_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/04_HLR/src/StdAfx.cpp b/samples/mfc/standard/04_HLR/src/StdAfx.cpp deleted file mode 100644 index da90289b62..0000000000 --- a/samples/mfc/standard/04_HLR/src/StdAfx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// SampleHLR.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - diff --git a/samples/mfc/standard/04_HLR/src/StdAfx.h b/samples/mfc/standard/04_HLR/src/StdAfx.h deleted file mode 100644 index b936aa11c6..0000000000 --- a/samples/mfc/standard/04_HLR/src/StdAfx.h +++ /dev/null @@ -1,209 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__376C7006_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_) -#define AFX_STDAFX_H__376C7006_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#ifndef NOMINMAX - #define NOMINMAX // Prevent Windows from defining min/max macros -#endif - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - - - -// CasCade : - -#define DEFAULT_DEVIATIONCOEFFICIENT 0.001 -#define DEFAULT_DCBIG 0.005 -#define DEFAULT_DCVBIG 0.01 -#define DEFAULT_DCSMALL 0.0002 -#define DEFAULT_DCVSMALL 0.00004 -#define DEFAULT_COLOR Quantity_NOC_CYAN1 -#define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Plastered -#define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY -#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW - -#pragma warning( disable : 4244 ) // Issue warning 4244 -#include -#pragma warning( default : 4244 ) // Issue warning 4244 - -#include -/* -#ifndef Version15B -# ifndef Version15D -# ifndef Version20 -# define Version15B -# endif // Version20 -# endif // Version15D -#endif // Version15B - -#pragma message ("=============================") -#ifdef Version15B -# pragma message ("Set the libs for version 1.5B") -#endif // Version15B - -#ifdef Version15D -# pragma message ("Set the libs for version 1.5D") -#endif // Version15D - -#ifdef Version20 -# pragma message ("Set the libs for version 2.0 ") -#endif // Version20 -#pragma message ("=============================") - -#ifdef Version15B -# pragma comment (lib,"TKTop.lib") -# pragma comment (lib,"TShort.lib") -# pragma comment (lib,"TColQuantity.lib") -#endif - -#ifdef Version15D -# pragma comment (lib,"TKTop.lib") -#endif - -#ifdef Version20 -# pragma comment (lib,"TKTop1.lib") -# pragma comment (lib,"TKTop2.lib") -#endif - -#pragma message ("Set the specific libs for the application") -# pragma comment (lib,"TKPrs.lib") -# pragma comment (lib,"TKGeom.lib") -# pragma comment (lib,"TKGlt.lib") -# pragma comment (lib,"TKGraphic.lib") -# pragma comment (lib,"TKPrsMgr.lib") -# pragma comment (lib,"TKViewers.lib") -# pragma comment (lib,"TKSession.lib") -# pragma comment (lib,"gp.lib") -# pragma comment (lib,"TKernel.lib") -# pragma comment (lib,"UnitsAPI.lib") -# pragma comment (lib,"PTColStd.lib") -# pragma comment (lib,"TKMgtShape.lib") -# pragma comment (lib,"TKPShape.lib") -# pragma comment (lib,"ShapeSchema.lib") -# pragma comment (lib,"FSD.lib") -# pragma comment (lib,"OSDriver.lib") -# pragma comment (lib,"ObjMgt.lib") -# pragma comment (lib,"TKXSBase.lib") -# pragma comment (lib,"TKXSIGES.lib") -# pragma comment (lib,"TKXS214.lib") -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "..\res\resource.h" - -//End CasCade - - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__376C7006_0B3D_11D2_8E0A_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/All-vc10.sln b/samples/mfc/standard/All-vc10.sln deleted file mode 100644 index 882e279641..0000000000 --- a/samples/mfc/standard/All-vc10.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Geometry", "01_Geometry\adm\win\vc10\Geometry.vcxproj", "{31E8199C-C981-4B7F-9CC2-B8502565B581}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeling", "02_Modeling\adm\win\vc10\Modeling.vcxproj", "{B10FC678-B9AF-4B05-B3DC-8F790C610CC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportExport", "03_ImportExport\adm\win\vc10\ImportExport.vcxproj", "{1C9A05AE-AF5A-4ACE-9A72-83436D77504C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "04_HLR\adm\win\vc10\HLR.vcxproj", "{76045260-8DA6-4A3E-B220-F5B1B4ADE192}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfcsample", "mfcsample\adm\win\vc10\mfcsample.vcxproj", "{2D6CBBE8-6965-4016-B503-0D715AE26691}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.ActiveCfg = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.Build.0 = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.ActiveCfg = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.Build.0 = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.ActiveCfg = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.Build.0 = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.ActiveCfg = Release|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.Build.0 = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.Build.0 = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.ActiveCfg = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.Build.0 = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.ActiveCfg = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.Build.0 = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.ActiveCfg = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.Build.0 = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.Build.0 = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.ActiveCfg = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.Build.0 = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.ActiveCfg = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.Build.0 = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.ActiveCfg = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.Build.0 = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.ActiveCfg = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.Build.0 = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.ActiveCfg = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.Build.0 = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.ActiveCfg = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.Build.0 = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.ActiveCfg = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.Build.0 = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.Build.0 = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.ActiveCfg = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.Build.0 = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.ActiveCfg = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.Build.0 = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.ActiveCfg = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/mfc/standard/All-vc11.sln b/samples/mfc/standard/All-vc11.sln deleted file mode 100644 index 08aac37cc4..0000000000 --- a/samples/mfc/standard/All-vc11.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Geometry", "01_Geometry\adm\win\vc10\Geometry.vcxproj", "{31E8199C-C981-4B7F-9CC2-B8502565B581}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeling", "02_Modeling\adm\win\vc10\Modeling.vcxproj", "{B10FC678-B9AF-4B05-B3DC-8F790C610CC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportExport", "03_ImportExport\adm\win\vc10\ImportExport.vcxproj", "{1C9A05AE-AF5A-4ACE-9A72-83436D77504C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "04_HLR\adm\win\vc10\HLR.vcxproj", "{76045260-8DA6-4A3E-B220-F5B1B4ADE192}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfcsample", "mfcsample\adm\win\vc10\mfcsample.vcxproj", "{2D6CBBE8-6965-4016-B503-0D715AE26691}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.ActiveCfg = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.Build.0 = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.ActiveCfg = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.Build.0 = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.ActiveCfg = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.Build.0 = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.ActiveCfg = Release|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.Build.0 = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.Build.0 = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.ActiveCfg = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.Build.0 = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.ActiveCfg = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.Build.0 = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.ActiveCfg = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.Build.0 = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.Build.0 = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.ActiveCfg = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.Build.0 = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.ActiveCfg = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.Build.0 = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.ActiveCfg = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.Build.0 = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.ActiveCfg = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.Build.0 = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.ActiveCfg = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.Build.0 = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.ActiveCfg = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.Build.0 = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.ActiveCfg = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.Build.0 = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.Build.0 = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.ActiveCfg = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.Build.0 = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.ActiveCfg = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.Build.0 = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.ActiveCfg = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/mfc/standard/All-vc12.sln b/samples/mfc/standard/All-vc12.sln deleted file mode 100644 index cc84cf8abb..0000000000 --- a/samples/mfc/standard/All-vc12.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 13.00 -# Visual Studio 2013 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Geometry", "01_Geometry\adm\win\vc10\Geometry.vcxproj", "{31E8199C-C981-4B7F-9CC2-B8502565B581}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeling", "02_Modeling\adm\win\vc10\Modeling.vcxproj", "{B10FC678-B9AF-4B05-B3DC-8F790C610CC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportExport", "03_ImportExport\adm\win\vc10\ImportExport.vcxproj", "{1C9A05AE-AF5A-4ACE-9A72-83436D77504C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "04_HLR\adm\win\vc10\HLR.vcxproj", "{76045260-8DA6-4A3E-B220-F5B1B4ADE192}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfcsample", "mfcsample\adm\win\vc10\mfcsample.vcxproj", "{2D6CBBE8-6965-4016-B503-0D715AE26691}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.ActiveCfg = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.Build.0 = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.ActiveCfg = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.Build.0 = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.ActiveCfg = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.Build.0 = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.ActiveCfg = Release|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.Build.0 = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.Build.0 = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.ActiveCfg = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.Build.0 = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.ActiveCfg = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.Build.0 = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.ActiveCfg = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.Build.0 = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.Build.0 = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.ActiveCfg = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.Build.0 = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.ActiveCfg = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.Build.0 = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.ActiveCfg = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.Build.0 = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.ActiveCfg = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.Build.0 = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.ActiveCfg = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.Build.0 = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.ActiveCfg = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.Build.0 = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.ActiveCfg = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.Build.0 = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.Build.0 = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.ActiveCfg = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.Build.0 = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.ActiveCfg = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.Build.0 = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.ActiveCfg = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/mfc/standard/All-vc14.sln b/samples/mfc/standard/All-vc14.sln deleted file mode 100644 index 40128526cc..0000000000 --- a/samples/mfc/standard/All-vc14.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Geometry", "01_Geometry\adm\win\vc10\Geometry.vcxproj", "{31E8199C-C981-4B7F-9CC2-B8502565B581}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeling", "02_Modeling\adm\win\vc10\Modeling.vcxproj", "{B10FC678-B9AF-4B05-B3DC-8F790C610CC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportExport", "03_ImportExport\adm\win\vc10\ImportExport.vcxproj", "{1C9A05AE-AF5A-4ACE-9A72-83436D77504C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "04_HLR\adm\win\vc10\HLR.vcxproj", "{76045260-8DA6-4A3E-B220-F5B1B4ADE192}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfcsample", "mfcsample\adm\win\vc10\mfcsample.vcxproj", "{2D6CBBE8-6965-4016-B503-0D715AE26691}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.ActiveCfg = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.Build.0 = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.ActiveCfg = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.Build.0 = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.ActiveCfg = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.Build.0 = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.ActiveCfg = Release|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.Build.0 = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.Build.0 = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.ActiveCfg = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.Build.0 = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.ActiveCfg = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.Build.0 = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.ActiveCfg = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.Build.0 = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.Build.0 = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.ActiveCfg = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.Build.0 = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.ActiveCfg = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.Build.0 = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.ActiveCfg = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.Build.0 = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.ActiveCfg = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.Build.0 = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.ActiveCfg = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.Build.0 = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.ActiveCfg = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.Build.0 = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.ActiveCfg = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.Build.0 = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.Build.0 = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.ActiveCfg = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.Build.0 = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.ActiveCfg = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.Build.0 = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.ActiveCfg = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/mfc/standard/All-vc141.sln b/samples/mfc/standard/All-vc141.sln deleted file mode 100644 index 627eea28c0..0000000000 --- a/samples/mfc/standard/All-vc141.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Geometry", "01_Geometry\adm\win\vc10\Geometry.vcxproj", "{31E8199C-C981-4B7F-9CC2-B8502565B581}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeling", "02_Modeling\adm\win\vc10\Modeling.vcxproj", "{B10FC678-B9AF-4B05-B3DC-8F790C610CC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportExport", "03_ImportExport\adm\win\vc10\ImportExport.vcxproj", "{1C9A05AE-AF5A-4ACE-9A72-83436D77504C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "04_HLR\adm\win\vc10\HLR.vcxproj", "{76045260-8DA6-4A3E-B220-F5B1B4ADE192}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfcsample", "mfcsample\adm\win\vc10\mfcsample.vcxproj", "{2D6CBBE8-6965-4016-B503-0D715AE26691}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.ActiveCfg = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.Build.0 = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.ActiveCfg = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.Build.0 = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.ActiveCfg = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.Build.0 = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.ActiveCfg = Release|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.Build.0 = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.Build.0 = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.ActiveCfg = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.Build.0 = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.ActiveCfg = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.Build.0 = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.ActiveCfg = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.Build.0 = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.Build.0 = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.ActiveCfg = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.Build.0 = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.ActiveCfg = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.Build.0 = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.ActiveCfg = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.Build.0 = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.ActiveCfg = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.Build.0 = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.ActiveCfg = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.Build.0 = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.ActiveCfg = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.Build.0 = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.ActiveCfg = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.Build.0 = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.Build.0 = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.ActiveCfg = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.Build.0 = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.ActiveCfg = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.Build.0 = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.ActiveCfg = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/mfc/standard/All-vc142.sln b/samples/mfc/standard/All-vc142.sln deleted file mode 100644 index d4ef1b6938..0000000000 --- a/samples/mfc/standard/All-vc142.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 16 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Geometry", "01_Geometry\adm\win\vc10\Geometry.vcxproj", "{31E8199C-C981-4B7F-9CC2-B8502565B581}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modeling", "02_Modeling\adm\win\vc10\Modeling.vcxproj", "{B10FC678-B9AF-4B05-B3DC-8F790C610CC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportExport", "03_ImportExport\adm\win\vc10\ImportExport.vcxproj", "{1C9A05AE-AF5A-4ACE-9A72-83436D77504C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HLR", "04_HLR\adm\win\vc10\HLR.vcxproj", "{76045260-8DA6-4A3E-B220-F5B1B4ADE192}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfcsample", "mfcsample\adm\win\vc10\mfcsample.vcxproj", "{2D6CBBE8-6965-4016-B503-0D715AE26691}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.ActiveCfg = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|Win32.Build.0 = Debug|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.ActiveCfg = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Debug|x64.Build.0 = Debug|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.ActiveCfg = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|Win32.Build.0 = Release|Win32 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.ActiveCfg = Release|x64 - {31E8199C-C981-4B7F-9CC2-B8502565B581}.Release|x64.Build.0 = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|Win32.Build.0 = Debug|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.ActiveCfg = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Debug|x64.Build.0 = Debug|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.ActiveCfg = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|Win32.Build.0 = Release|Win32 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.ActiveCfg = Release|x64 - {B10FC678-B9AF-4B05-B3DC-8F790C610CC3}.Release|x64.Build.0 = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|Win32.Build.0 = Debug|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.ActiveCfg = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Debug|x64.Build.0 = Debug|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.ActiveCfg = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|Win32.Build.0 = Release|Win32 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.ActiveCfg = Release|x64 - {1C9A05AE-AF5A-4ACE-9A72-83436D77504C}.Release|x64.Build.0 = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.ActiveCfg = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|Win32.Build.0 = Debug|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.ActiveCfg = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Debug|x64.Build.0 = Debug|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.ActiveCfg = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|Win32.Build.0 = Release|Win32 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.ActiveCfg = Release|x64 - {76045260-8DA6-4A3E-B220-F5B1B4ADE192}.Release|x64.Build.0 = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|Win32.Build.0 = Debug|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.ActiveCfg = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Debug|x64.Build.0 = Debug|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.ActiveCfg = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|Win32.Build.0 = Release|Win32 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.ActiveCfg = Release|x64 - {2D6CBBE8-6965-4016-B503-0D715AE26691}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/mfc/standard/Common/AISDialogs.cpp b/samples/mfc/standard/Common/AISDialogs.cpp deleted file mode 100755 index a00fc6db50..0000000000 --- a/samples/mfc/standard/Common/AISDialogs.cpp +++ /dev/null @@ -1,448 +0,0 @@ -// AISDialogs.cpp : implementation file -// - -#include "stdafx.h" - -#include "AISDialogs.h" - -#define DEFAULT_DEVIATIONCOEFFICIENT 0.001 -#define DEFAULT_DCBIG 0.005 -#define DEFAULT_DCVBIG 0.01 -#define DEFAULT_DCSMALL 0.0002 -#define DEFAULT_DCVSMALL 0.00004 -#define DEFAULT_COLOR Quantity_NOC_CYAN1 -#define DEFAULT_MATERIAL Graphic3d_NOM_PLASTER -#define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY -#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW - - -///////////////////////////////////////////////////////////////////////////// -// CAISNbrIsosDialog dialog - -//CAISNbrIsosDialog::CAISNbrIsosDialog(Handle(AIS_InteractiveContext) CurrentIC, -// CWnd* pParent /*=NULL*/) -// : CDialog(CAISNbrIsosDialog::IDD, pParent) -/* -{ - //{{AFX_DATA_INIT(CAISNbrIsosDialog) - m_Isosu = 0; - m_Isosv = 0; - //}}AFX_DATA_INIT - - myCurrentIC = CurrentIC; - Handle (Prs3d_Drawer) ICDrawer = myCurrentIC->DefaultDrawer(); - m_Isosu = ICDrawer->UIsoAspect()->Number(); - m_Isosv = ICDrawer->VIsoAspect()->Number(); - -} - - -void CAISNbrIsosDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAISNbrIsosDialog) - DDX_Text(pDX, IDC_EDITAISISOSU, m_Isosu); - DDX_Text(pDX, IDC_EDITAISISOSV, m_Isosv); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CAISNbrIsosDialog, CDialog) - //{{AFX_MSG_MAP(CAISNbrIsosDialog) - ON_NOTIFY(UDN_DELTAPOS, IDC_SPINAISISOSU, OnDeltaposSpinaisisosu) - ON_NOTIFY(UDN_DELTAPOS, IDC_SPINAISISOSV, OnDeltaposSpinaisisosv) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CAISNbrIsosDialog message handlers - -void CAISNbrIsosDialog::OnDeltaposSpinaisisosu(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR; - // TODO: Add your control notification handler code here - - if ((pNMUpDown->iDelta < 0)) - m_Isosu = m_Isosu + 1; - if ((pNMUpDown->iDelta > 0) && (m_Isosu > 0)) - m_Isosu = m_Isosu - 1; - - UpdateIsos (); - - *pResult = 0; -} - -void CAISNbrIsosDialog::OnDeltaposSpinaisisosv(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR; - // TODO: Add your control notification handler code here - - if ((pNMUpDown->iDelta < 0)) - m_Isosv = m_Isosv + 1; - if ((pNMUpDown->iDelta > 0) && (m_Isosu > 0)) - m_Isosv = m_Isosv - 1; - - UpdateIsos (); - - *pResult = 0; -} - - -#include -#include - -void CAISNbrIsosDialog::UpdateIsos () -{ - UpdateData (false); - - for (myCurrentIC->InitCurrent(); - myCurrentIC->MoreCurrent (); - myCurrentIC->NextSelected ()) - { - Handle(AIS_InteractiveObject) CurObject; - Handle(Prs3d_Drawer) CurDrawer; - - - CurObject = myCurrentIC->Current(); - CurDrawer = CurObject->Attributes(); - - CurDrawer->UIsoAspect()->SetNumber(m_Isosu); - CurDrawer->VIsoAspect()->SetNumber(m_Isosv); - - myCurrentIC->SetLocalAttributes(CurObject, CurDrawer); - - myCurrentIC->Redisplay(CurObject); - } - -} -*/ -///////////////////////////////////////////////////////////////////////////// -// CDevCoeffDialog dialog - - -//CDevCoeffDialog::CDevCoeffDialog(Handle(AIS_InteractiveContext) CurrentIC, -// CWnd* pParent /*=NULL*/) -// : CDialog(CDevCoeffDialog::IDD, pParent) -/* -{ - //{{AFX_DATA_INIT(CDevCoeffDialog) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - myCurrentIC = CurrentIC; -} - - -void CDevCoeffDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CDevCoeffDialog) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CDevCoeffDialog, CDialog) - //{{AFX_MSG_MAP(CDevCoeffDialog) - ON_BN_CLICKED(IDC_DC_BIG, OnDcBig) - ON_BN_CLICKED(IDC_DC_DEFAULT, OnDcDefault) - ON_BN_CLICKED(IDC_DC_SMALL, OnDcSmall) - ON_BN_DOUBLECLICKED(IDC_DC_BIG, OnDoubleclickedDcBig) - ON_BN_DOUBLECLICKED(IDC_DC_DEFAULT, OnDoubleclickedDcDefault) - ON_BN_DOUBLECLICKED(IDC_DC_SMALL, OnDoubleclickedDcSmall) - ON_BN_CLICKED(IDC_DC_VBIG, OnDcVbig) - ON_BN_DOUBLECLICKED(IDC_DC_VBIG, OnDoubleclickedDcVbig) - ON_BN_CLICKED(IDC_DC_VSMALL, OnDcVsmall) - ON_BN_DOUBLECLICKED(IDC_DC_VSMALL, OnDoubleclickedDcVsmall) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CDevCoeffDialog message handlers - - - -void CDevCoeffDialog::OnDcDefault() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DEVIATIONCOEFFICIENT); -} - -void CDevCoeffDialog::OnDcSmall() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCSMALL); -} - -void CDevCoeffDialog::OnDcVsmall() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCVSMALL); -} - - -void CDevCoeffDialog::OnDcBig() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCBIG); -} - -void CDevCoeffDialog::OnDcVbig() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCVBIG); -} - - - -void CDevCoeffDialog::OnDoubleclickedDcDefault() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DEVIATIONCOEFFICIENT); - RedisplaySelected(); -} - -void CDevCoeffDialog::OnDoubleclickedDcSmall() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCSMALL); - RedisplaySelected(); -} - -void CDevCoeffDialog::OnDoubleclickedDcVsmall() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCVSMALL); - RedisplaySelected(); -} - -void CDevCoeffDialog::OnDoubleclickedDcBig() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCBIG); - RedisplaySelected(); -} - -void CDevCoeffDialog::OnDoubleclickedDcVbig() -{ - // TODO: Add your control notification handler code here - myCurrentIC->SetDeviationCoefficient (DEFAULT_DCVBIG); - RedisplaySelected(); -} - - - -void CDevCoeffDialog::RedisplaySelected () -{ - for (myCurrentIC->InitCurrent(); - myCurrentIC->MoreCurrent (); - myCurrentIC->NextSelected ()) - { - myCurrentIC->Redisplay(myCurrentIC->Current()); - } -} - -*/ - -///////////////////////////////////////////////////////////////////////////// -// CDialogMaterial dialog - - -CDialogMaterial::CDialogMaterial(Handle(AIS_InteractiveContext) CurrentIC, - CWnd* pParent /*=NULL*/) - : CDialog(CDialogMaterial::IDD, pParent) -{ - //{{AFX_DATA_INIT(CDialogMaterial) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - myCurrentIC = CurrentIC; -/* - for (myCurrentIC->InitCurrent();myCurrentIC->MoreCurrent ();myCurrentIC->NextCurrent ()){ - for(int i = ID_OBJECT_MATERIAL_BRASS; i <= ID_OBJECT_MATERIAL_DEFAULT; i++){ - if (myCurrentIC->Current()->Material() - (i - ID_OBJECT_MATERIAL_BRASS) == 0) - //GotoDlgCtrl(GetDlgItem(i)); - } - } -*/ - -} - - -void CDialogMaterial::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CDialogMaterial) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CDialogMaterial, CDialog) - //{{AFX_MSG_MAP(CDialogMaterial) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_ALUMINIUM, OnObjectMaterialAluminium) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_BRASS, OnObjectMaterialBrass) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_BRONZE, OnObjectMaterialBronze) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_CHROME, OnObjectMaterialChrome) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_COPPER, OnObjectMaterialCopper) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_GOLD, OnObjectMaterialGold) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_JADE, OnObjectMaterialJade) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_METALIZED, OnObjectMaterialMetalized) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_NEON_GNC, OnObjectMaterialNeonGNC) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_NEON_PHC, OnObjectMaterialNeonPHC) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_OBSIDIAN, OnObjectMaterialObsidian) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_PEWTER, OnObjectMaterialPewter) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_PLASTER, OnObjectMaterialPlaster) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_PLASTIC, OnObjectMaterialPlastic) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_SATIN, OnObjectMaterialSatin) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_SHINY_PLASTIC, OnObjectMaterialShinyPlastic) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_SILVER, OnObjectMaterialSilver) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_STEEL, OnObjectMaterialSteel) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_STONE, OnObjectMaterialStone) - ON_BN_CLICKED(ID_OBJECT_MATERIAL_DEFAULT, OnObjectMaterialDefault) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CDialogMaterial message handlers -/* -void CDialogMaterial::OnMaterial(UINT nID) -{ - SetMaterial ((Graphic3d_NameOfMaterial)(nID-ID_OBJECT_MATERIAL_BRASS)); -} -*/ -void CDialogMaterial::SetMaterial(Graphic3d_NameOfMaterial Material) -{ - Standard_Real aTransparency; - for (myCurrentIC->InitSelected();myCurrentIC->MoreSelected ();myCurrentIC->NextSelected ()){ - aTransparency = myCurrentIC->SelectedInteractive()->Transparency(); - myCurrentIC->SetMaterial (myCurrentIC->SelectedInteractive(), (Graphic3d_NameOfMaterial)(Material), Standard_False); - myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), aTransparency, Standard_False); - } - myCurrentIC->UpdateCurrentViewer(); -} - -void CDialogMaterial::OnObjectMaterialAluminium () { SetMaterial ( Graphic3d_NOM_ALUMINIUM ) ; } -void CDialogMaterial::OnObjectMaterialBrass () { SetMaterial ( Graphic3d_NOM_BRASS ) ; } -void CDialogMaterial::OnObjectMaterialBronze () { SetMaterial ( Graphic3d_NOM_BRONZE ) ; } -void CDialogMaterial::OnObjectMaterialChrome () { SetMaterial ( Graphic3d_NOM_CHROME ) ; } -void CDialogMaterial::OnObjectMaterialCopper () { SetMaterial ( Graphic3d_NOM_COPPER ) ; } -void CDialogMaterial::OnObjectMaterialGold () { SetMaterial ( Graphic3d_NOM_GOLD ) ; } -void CDialogMaterial::OnObjectMaterialJade () { SetMaterial ( Graphic3d_NOM_JADE ) ; } -void CDialogMaterial::OnObjectMaterialMetalized () { SetMaterial ( Graphic3d_NOM_METALIZED ) ; } -void CDialogMaterial::OnObjectMaterialNeonGNC () { SetMaterial ( Graphic3d_NOM_NEON_GNC ) ; } -void CDialogMaterial::OnObjectMaterialNeonPHC () { SetMaterial ( Graphic3d_NOM_NEON_PHC ) ; } -void CDialogMaterial::OnObjectMaterialObsidian () { SetMaterial ( Graphic3d_NOM_OBSIDIAN ) ; } -void CDialogMaterial::OnObjectMaterialPewter () { SetMaterial ( Graphic3d_NOM_PEWTER ) ; } -void CDialogMaterial::OnObjectMaterialPlaster () { SetMaterial ( Graphic3d_NOM_PLASTER ) ; } -void CDialogMaterial::OnObjectMaterialPlastic () { SetMaterial ( Graphic3d_NOM_PLASTIC ) ; } -void CDialogMaterial::OnObjectMaterialSatin () { SetMaterial ( Graphic3d_NOM_SATIN ) ; } -void CDialogMaterial::OnObjectMaterialShinyPlastic () { SetMaterial ( Graphic3d_NOM_SHINY_PLASTIC ) ; } -void CDialogMaterial::OnObjectMaterialSilver () { SetMaterial ( Graphic3d_NOM_SILVER ) ; } -void CDialogMaterial::OnObjectMaterialSteel () { SetMaterial ( Graphic3d_NOM_STEEL ) ; } -void CDialogMaterial::OnObjectMaterialStone () { SetMaterial ( Graphic3d_NOM_STONE ) ; } -void CDialogMaterial::OnObjectMaterialDefault () { SetMaterial ( Graphic3d_NOM_DEFAULT ) ; } - - -///////////////////////////////////////////////////////////////////////////// -// CDialogTransparency dialog - -CDialogTransparency::CDialogTransparency(Handle(AIS_InteractiveContext) CurrentIC, - CWnd* pParent /*=NULL*/) - : CDialog(CDialogTransparency::IDD, pParent) -{ - - //{{AFX_DATA_INIT(CDialogTransparency) - m_TransValue = 0; - //}}AFX_DATA_INIT - - myCurrentIC = CurrentIC; - - Standard_Real temp = 10; - Standard_Real t; - - for (myCurrentIC->InitSelected(); - myCurrentIC->MoreSelected (); - myCurrentIC->NextSelected ()) - { - t = CurrentIC->SelectedInteractive()->Transparency(); - if (temp > t) - temp = t; - //myCurrentIC->SetTransparency (myCurrentIC->Current(), m_TransValue); - } - - m_TransValue = int (temp * 10); - if (Abs(m_TransValue - temp * 10) > 0.01) - m_TransValue = int (temp * 10) + 1; - - for (myCurrentIC->InitSelected(); - myCurrentIC->MoreSelected (); - myCurrentIC->NextSelected ()) - { - myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), temp, Standard_False); - } - - myCurrentIC->UpdateCurrentViewer(); -} - - -void CDialogTransparency::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CDialogTransparency) - DDX_Text(pDX, IDC_EDITAISTRANSP, m_TransValue); - DDV_MinMaxInt(pDX, m_TransValue, 0, 10); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CDialogTransparency, CDialog) - //{{AFX_MSG_MAP(CDialogTransparency) - ON_NOTIFY(UDN_DELTAPOS, IDC_SPINAISTRANSP, OnDeltaposSpinaistransp) - ON_EN_CHANGE(IDC_EDITAISTRANSP, OnChangeEditaistransp) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CDialogTransparency message handlers - -void CDialogTransparency::OnDeltaposSpinaistransp(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR; - // TODO: Add your control notification handler code here - if ((pNMUpDown->iDelta < 0) && (m_TransValue < 10)) - m_TransValue = m_TransValue + 1; - if ((pNMUpDown->iDelta > 0) && (m_TransValue > 0)) - m_TransValue = m_TransValue - 1; - - UpdateData (false); - - for (myCurrentIC->InitSelected(); - myCurrentIC->MoreSelected (); - myCurrentIC->NextSelected()) - { - myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), m_TransValue/10.0, Standard_False); - } - myCurrentIC->UpdateCurrentViewer(); - *pResult = 0; - -} - - -void CDialogTransparency::OnChangeEditaistransp() -{ - // TODO: Add your control notification handler code here - int temp = m_TransValue; - if (UpdateData (true)){ - for (myCurrentIC->InitSelected(); - myCurrentIC->MoreSelected (); - myCurrentIC->NextSelected()) - { - myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), m_TransValue/10.0, Standard_False); - } - myCurrentIC->UpdateCurrentViewer(); - } - else{ - m_TransValue = temp; - UpdateData (false); - } - -} diff --git a/samples/mfc/standard/Common/AISDialogs.h b/samples/mfc/standard/Common/AISDialogs.h deleted file mode 100755 index 4487f03698..0000000000 --- a/samples/mfc/standard/Common/AISDialogs.h +++ /dev/null @@ -1,207 +0,0 @@ -// AISDialogs.h : header file -// - -#if !defined(AFX_AISNBRISOSDIALOG_H__AAD52722_6A63_11D1_8C62_00AA00D10994__INCLUDED_) -#define AFX_AISNBRISOSDIALOG_H__AAD52722_6A63_11D1_8C62_00AA00D10994__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -///////////////////////////////////////////////////////////////////////////// -// CAISNbrIsosDialog dialog - -#include -#include "res\OCC_Resource.h" -#include - -/* -class CAISNbrIsosDialog : public CDialog -{ -// Construction -public: - CAISNbrIsosDialog(Handle(AIS_InteractiveContext) CurrentIC, - CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CAISNbrIsosDialog) - enum { IDD = IDD_AISNBRISOS }; - int m_Isosu; - int m_Isosv; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAISNbrIsosDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CAISNbrIsosDialog) - afx_msg void OnDeltaposSpinaisisosu(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnDeltaposSpinaisisosv(NMHDR* pNMHDR, LRESULT* pResult); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -private: - void UpdateIsos (); - - Handle(AIS_InteractiveContext) myCurrentIC; - -}; - - -///////////////////////////////////////////////////////////////////////////// -// CDevCoeffDialog dialog - -#include - -class CDevCoeffDialog : public CDialog -{ -// Construction -public: - CDevCoeffDialog(Handle(AIS_InteractiveContext) CurrentIC, - CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CDevCoeffDialog) - enum { IDD = IDD_AISDC }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CDevCoeffDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CDevCoeffDialog) - afx_msg void OnDcBig(); - afx_msg void OnDcDefault(); - afx_msg void OnDcSmall(); - afx_msg void OnDoubleclickedDcBig(); - afx_msg void OnDoubleclickedDcDefault(); - afx_msg void OnDoubleclickedDcSmall(); - afx_msg void OnDcVbig(); - afx_msg void OnDoubleclickedDcVbig(); - afx_msg void OnDcVsmall(); - afx_msg void OnDoubleclickedDcVsmall(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -private: - void RedisplaySelected (); - - Handle(AIS_InteractiveContext) myCurrentIC; -}; - -*/ -class Standard_EXPORT CDialogMaterial : public CDialog -{ -// Construction -public: - CDialogMaterial(Handle(AIS_InteractiveContext) CurrentIC, - CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CDialogMaterial) - enum { IDD = IDD_AISMATERIAL }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CDialogMaterial) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CDialogMaterial) - //afx_msg void OnMaterial(UINT nID); - afx_msg void OnObjectMaterialAluminium(); - afx_msg void OnObjectMaterialBrass(); - afx_msg void OnObjectMaterialBronze(); - afx_msg void OnObjectMaterialChrome(); - afx_msg void OnObjectMaterialCopper(); - afx_msg void OnObjectMaterialGold(); - afx_msg void OnObjectMaterialJade(); - afx_msg void OnObjectMaterialMetalized(); - afx_msg void OnObjectMaterialNeonGNC(); - afx_msg void OnObjectMaterialNeonPHC(); - afx_msg void OnObjectMaterialObsidian(); - afx_msg void OnObjectMaterialPewter(); - afx_msg void OnObjectMaterialPlastic(); - afx_msg void OnObjectMaterialPlaster(); - afx_msg void OnObjectMaterialSatin(); - afx_msg void OnObjectMaterialShinyPlastic(); - afx_msg void OnObjectMaterialSilver(); - afx_msg void OnObjectMaterialSteel(); - afx_msg void OnObjectMaterialStone(); - afx_msg void OnObjectMaterialDefault(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -private: - void SetMaterial (Graphic3d_NameOfMaterial Material); - - Handle(AIS_InteractiveContext) myCurrentIC; - -}; - -class Standard_EXPORT CDialogTransparency : public CDialog -{ -// Construction -public: - CDialogTransparency(Handle(AIS_InteractiveContext) CurrentIC, - CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CDialogTransparency) - enum { IDD = IDD_AISTRANSPARENCY }; - int m_TransValue; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CDialogTransparency) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CDialogTransparency) - afx_msg void OnDeltaposSpinaistransp(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnChangeEditaistransp(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -private: - Handle(AIS_InteractiveContext) myCurrentIC; - -}; - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_AISNBRISOSDIALOG_H__AAD52722_6A63_11D1_8C62_00AA00D10994__INCLUDED_) diff --git a/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp b/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp deleted file mode 100644 index cb39df9c7c..0000000000 --- a/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// AngleParamsVerticesPage.cpp : implementation file -// - -#include "stdafx.h" -#include "AngleParamsVerticesPage.h" -#include "DimensionDlg.h" - -#include -#include -#include -#include -#include - -// CAngleParamsVerticesPage dialog - -IMPLEMENT_DYNAMIC(CAngleParamsVerticesPage, CDialog) - -//======================================================================= -//function : CAngleParamsVerticesPage -//purpose : -//======================================================================= - -CAngleParamsVerticesPage::CAngleParamsVerticesPage (Handle(AIS_InteractiveContext) theAISContext, - CWnd* pParent /*=NULL*/) -: CDialog(CAngleParamsVerticesPage::IDD, pParent) -{ - myAISContext = theAISContext; -} - -//======================================================================= -//function : ~CAngleParamsVerticesPage -//purpose : -//======================================================================= - -CAngleParamsVerticesPage::~CAngleParamsVerticesPage() -{ -} - -//======================================================================= -//function : DoDataExchange -//purpose : -//======================================================================= - -void CAngleParamsVerticesPage::DoDataExchange (CDataExchange* pDX) -{ - CDialog::DoDataExchange (pDX); -} - - -BEGIN_MESSAGE_MAP(CAngleParamsVerticesPage, CDialog) - ON_BN_CLICKED(IDC_BUTTON1, &CAngleParamsVerticesPage::OnBnClickedVertex1Btn) - ON_BN_CLICKED(IDC_BUTTON3, &CAngleParamsVerticesPage::OnBnClickedVertex2Btn) - ON_BN_CLICKED(IDC_BUTTON4, &CAngleParamsVerticesPage::OnBnClickedVertex3Btn) -END_MESSAGE_MAP() - - -//======================================================================= -//function : OnBnClickedVertex1Btn -//purpose : -//======================================================================= - -void CAngleParamsVerticesPage::OnBnClickedVertex1Btn() -{ - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX)); - - // Now it's ok, edge selection mode is activated - // Check if some vertex is selected - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX) - { - AfxMessageBox (_T ("Choose the vertex and press the button again"), - MB_ICONINFORMATION | MB_OK); - return; - } - - myFirstVertex = TopoDS::Vertex (myAISContext->SelectedShape()); - myAISContext->ClearSelected (Standard_True); -} - -//======================================================================= -//function : OnBnClickedVertex2Btn -//purpose : -//======================================================================= - -void CAngleParamsVerticesPage::OnBnClickedVertex2Btn() -{ - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX) - { - AfxMessageBox ( _T("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK); - return; - } - - mySecondVertex = TopoDS::Vertex (myAISContext->SelectedShape()); - - myAISContext->ClearSelected (Standard_True); -} - -//======================================================================= -//function : OnBnClickedVertex3Btn -//purpose : -//======================================================================= - -void CAngleParamsVerticesPage::OnBnClickedVertex3Btn() -{ - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected()) - { - AfxMessageBox (_T ("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK); - return; - } - - myThirdVertex = TopoDS::Vertex (myAISContext->SelectedShape()); - myAISContext->ClearSelected (Standard_False); - - //Build dimension here - TopoDS_Edge anEdge12 = BRepBuilderAPI_MakeEdge (myFirstVertex, mySecondVertex); - TopoDS_Edge anEdge23 = BRepBuilderAPI_MakeEdge (mySecondVertex, myThirdVertex); - - CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner()); - - gp_Pnt aP1 = BRep_Tool::Pnt (myFirstVertex), - aP2 = BRep_Tool::Pnt (mySecondVertex), - aP3 = BRep_Tool::Pnt (myThirdVertex); - GC_MakePlane aPlaneBuilder (aP1,aP2,aP3); - - Handle(Geom_Plane) aPlane = aPlaneBuilder.Value(); - Handle(PrsDim_AngleDimension) anAngleDim = new PrsDim_AngleDimension (aP1,aP2,aP3); - Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); - anAspect->MakeArrows3d (Standard_False); - anAspect->MakeText3d (aDimDlg->GetTextType()); - anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight()); - anAspect->MakeTextShaded (aDimDlg->IsText3dShaded()); - anAspect->SetCommonColor (aDimDlg->GetDimensionColor()); - anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (aDimDlg->IsUnitsDisplayed()) - { - anAngleDim->SetDisplayUnits (aDimDlg->GetUnits()); - if ((anAngleDim->GetDisplayUnits().IsEqual (TCollection_AsciiString ("deg")))) - { - // No units - for degree is special symbol that is enabled by default - anAspect->MakeUnitsDisplayed (Standard_False); - } - else // radians - no special symbol - { - anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No); - } - } - anAngleDim->SetDimensionAspect (anAspect); - myAISContext->Display (anAngleDim, Standard_True); - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX)); -} diff --git a/samples/mfc/standard/Common/AngleParamsVerticesPage.h b/samples/mfc/standard/Common/AngleParamsVerticesPage.h deleted file mode 100755 index 88edc13f6b..0000000000 --- a/samples/mfc/standard/Common/AngleParamsVerticesPage.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "res\OCC_Resource.h" - -// CAngleParamsVerticesPage dialog - -class CAngleParamsVerticesPage : public CDialog -{ - DECLARE_DYNAMIC(CAngleParamsVerticesPage) -private: - Handle(AIS_InteractiveContext) myAISContext; - TopoDS_Vertex myFirstVertex; - TopoDS_Vertex mySecondVertex; - TopoDS_Vertex myThirdVertex; -public: - CAngleParamsVerticesPage(Handle (AIS_InteractiveContext) theAISContext, - CWnd* pParent = NULL); // standard constructor - virtual ~CAngleParamsVerticesPage(); - -// Dialog Data - enum { IDD = IDD_AngleParamsVerticesPage }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedVertex1Btn(); - afx_msg void OnBnClickedVertex2Btn(); - afx_msg void OnBnClickedVertex3Btn(); -}; diff --git a/samples/mfc/standard/Common/ColoredMeshDlg.cpp b/samples/mfc/standard/Common/ColoredMeshDlg.cpp deleted file mode 100755 index 225b178923..0000000000 --- a/samples/mfc/standard/Common/ColoredMeshDlg.cpp +++ /dev/null @@ -1,219 +0,0 @@ -// ColoredMeshDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "ColoredMeshDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CColoredMeshDlg dialog - - -CColoredMeshDlg::CColoredMeshDlg(CWnd* pParent /*=NULL*/) - : CDialog(CColoredMeshDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CColoredMeshDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CColoredMeshDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CColoredMeshDlg) - DDX_Check(pDX, IDC_RADIO1, m_Rad1OnOff); - DDX_Check(pDX, IDC_RADIO2, m_Rad2OnOff); - DDX_Check(pDX, IDC_RADIO3, m_Rad3OnOff); - DDX_Check(pDX, IDC_CHECK_X1, m_CheckX1OnOff); - DDX_Check(pDX, IDC_CHECK_XBlue, m_CheckXBlueOnOff); - DDX_Check(pDX, IDC_CHECK_XGreen, m_CheckXGreenOnOff); - DDX_Check(pDX, IDC_CHECK_XRed, m_CheckXRedOnOff); - DDX_Check(pDX, IDC_CHECK_Y1, m_CheckY1OnOff); - DDX_Check(pDX, IDC_CHECK_YBlue, m_CheckYBlueOnOff); - DDX_Check(pDX, IDC_CHECK_YGreen, m_CheckYGreenOnOff); - DDX_Check(pDX, IDC_CHECK_YRed, m_CheckYRedOnOff); - DDX_Check(pDX, IDC_CHECK_Z1, m_CheckZ1OnOff); - DDX_Check(pDX, IDC_CHECK_ZBlue, m_CheckZBlueOnOff); - DDX_Check(pDX, IDC_CHECK_ZGreen, m_CheckZGreenOnOff); - DDX_Check(pDX, IDC_CHECK_ZRed, m_CheckZRedOnOff); - - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CColoredMeshDlg, CDialog) - //{{AFX_MSG_MAP(CColoredMeshDlg) - ON_BN_CLICKED(IDC_RADIO1, OnRadio1) - ON_BN_CLICKED(IDC_RADIO2, OnRadio2) - ON_BN_CLICKED(IDC_RADIO3, OnRadio3) - ON_BN_CLICKED(IDC_CHECK_X1, OnCheckX1) - ON_BN_CLICKED(IDC_CHECK_XBlue, OnCHECKXBlue) - ON_BN_CLICKED(IDC_CHECK_XGreen, OnCHECKXGreen) - ON_BN_CLICKED(IDC_CHECK_XRed, OnCHECKXRed) - ON_BN_CLICKED(IDC_CHECK_Y1, OnCheckY1) - ON_BN_CLICKED(IDC_CHECK_YBlue, OnCHECKYBlue) - ON_BN_CLICKED(IDC_CHECK_YGreen, OnCHECKYGreen) - ON_BN_CLICKED(IDC_CHECK_YRed, OnCHECKYRed) - ON_BN_CLICKED(IDC_CHECK_Z1, OnCheckZ1) - ON_BN_CLICKED(IDC_CHECK_ZBlue, OnCHECKZBlue) - ON_BN_CLICKED(IDC_CHECK_ZGreen, OnCHECKZGreen) - ON_BN_CLICKED(IDC_CHECK_ZRed, OnCHECKZRed) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CColoredMeshDlg message handlers -void CColoredMeshDlg::OnCancel() -{ - OK = Standard_False; - CDialog::OnCancel(); -} - -void CColoredMeshDlg::OnOK() -{ - OK = Standard_True; - CDialog::OnOK(); -} - -BOOL CColoredMeshDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - UpdateData (TRUE); - m_Rad3OnOff = Standard_True; - m_CheckXRedOnOff = Standard_True; - m_CheckXGreenOnOff = Standard_False; - m_CheckXBlueOnOff = Standard_False; - m_CheckYRedOnOff = Standard_False; - m_CheckYGreenOnOff = Standard_True; - m_CheckYBlueOnOff = Standard_False; - m_CheckZRedOnOff = Standard_False; - m_CheckZGreenOnOff = Standard_False; - m_CheckZBlueOnOff = Standard_True; - - Colorization = 2; - - UpdateData (FALSE); - - // TODO: Add extra initialization here - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CColoredMeshDlg::OnRadio1() -{ - Colorization = 0; -} - -void CColoredMeshDlg::OnRadio2() -{ - Colorization = 1; -} - -void CColoredMeshDlg::OnRadio3() -{ - Colorization = 2; - -} - -void CColoredMeshDlg::OnCheckX1() -{ - X1OnOff = m_CheckX1OnOff != 0; -} - -void CColoredMeshDlg::OnCHECKXBlue() -{ - UpdateData (TRUE); - m_CheckXRedOnOff = Standard_False; - m_CheckXGreenOnOff = Standard_False; - m_CheckXBlueOnOff = Standard_True; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCHECKXGreen() -{ - UpdateData (TRUE); - m_CheckXRedOnOff = Standard_False; - m_CheckXGreenOnOff = Standard_True; - m_CheckXBlueOnOff = Standard_False; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCHECKXRed() -{ - UpdateData (TRUE); - m_CheckXRedOnOff = Standard_True; - m_CheckXGreenOnOff = Standard_False; - m_CheckXBlueOnOff = Standard_False; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCheckY1() -{ - Y1OnOff = m_CheckY1OnOff != 0; -} - -void CColoredMeshDlg::OnCHECKYBlue() -{ - UpdateData (TRUE); - m_CheckYRedOnOff = Standard_False; - m_CheckYGreenOnOff = Standard_False; - m_CheckYBlueOnOff = Standard_True; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCHECKYGreen() -{ - UpdateData (TRUE); - m_CheckYRedOnOff = Standard_False; - m_CheckYGreenOnOff = Standard_True; - m_CheckYBlueOnOff = Standard_False; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCHECKYRed() -{ - UpdateData (TRUE); - m_CheckYRedOnOff = Standard_True; - m_CheckYGreenOnOff = Standard_False; - m_CheckYBlueOnOff = Standard_False; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCheckZ1() -{ - Z1OnOff = m_CheckZ1OnOff != 0; -} - -void CColoredMeshDlg::OnCHECKZBlue() -{ - UpdateData (TRUE); - m_CheckZRedOnOff = Standard_False; - m_CheckZGreenOnOff = Standard_False; - m_CheckZBlueOnOff = Standard_True; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCHECKZGreen() -{ - UpdateData (TRUE); - m_CheckZRedOnOff = Standard_False; - m_CheckZGreenOnOff = Standard_True; - m_CheckZBlueOnOff = Standard_False; - UpdateData (FALSE); -} - -void CColoredMeshDlg::OnCHECKZRed() -{ - UpdateData (TRUE); - m_CheckZRedOnOff = Standard_True; - m_CheckZGreenOnOff = Standard_False; - m_CheckZBlueOnOff = Standard_False; - UpdateData (FALSE); -} diff --git a/samples/mfc/standard/Common/ColoredMeshDlg.h b/samples/mfc/standard/Common/ColoredMeshDlg.h deleted file mode 100755 index 7d11939e4e..0000000000 --- a/samples/mfc/standard/Common/ColoredMeshDlg.h +++ /dev/null @@ -1,103 +0,0 @@ -#if !defined(AFX_OLOREDMESH_H__7CB26B1F_55EC_11D6_BD10_00A0C982B46F__INCLUDED_) -#define AFX_OLOREDMESH_H__7CB26B1F_55EC_11D6_BD10_00A0C982B46F__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// ColoredMeshDlg.h : header file -// -#include - -///////////////////////////////////////////////////////////////////////////// -// CColoredMeshDlg dialog - - - -class CColoredMeshDlg : public CDialog -{ -// Construction -public: - CColoredMeshDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CColoredMeshDlg) - enum {IDD = IDD_COLORMESH }; - BOOL OK; - - BOOL m_Rad1OnOff; - BOOL m_Rad2OnOff; - BOOL m_Rad3OnOff; - BOOL m_CheckX1OnOff; - BOOL m_CheckXBlueOnOff; - BOOL m_CheckXGreenOnOff; - BOOL m_CheckXRedOnOff; - BOOL m_CheckY1OnOff; - BOOL m_CheckYBlueOnOff; - BOOL m_CheckYGreenOnOff; - BOOL m_CheckYRedOnOff; - BOOL m_CheckZ1OnOff; - BOOL m_CheckZBlueOnOff; - BOOL m_CheckZGreenOnOff; - BOOL m_CheckZRedOnOff; - - - - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CColoredMeshDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CColoredMeshDlg) - afx_msg void OnRadio1(); - afx_msg void OnRadio2(); - afx_msg void OnRadio3(); - afx_msg void OnCheckX1(); - afx_msg void OnCHECKXBlue(); - afx_msg void OnCHECKXGreen(); - afx_msg void OnCHECKXRed(); - afx_msg void OnCheckY1(); - afx_msg void OnCHECKYBlue(); - afx_msg void OnCHECKYGreen(); - afx_msg void OnCHECKYRed(); - afx_msg void OnCheckZ1(); - afx_msg void OnCHECKZBlue(); - afx_msg void OnCHECKZGreen(); - afx_msg void OnCHECKZRed(); - virtual void OnCancel(); - virtual void OnOK(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - - -public: - Standard_Boolean Custom; -int Colorization; -Standard_Boolean X1OnOff; -Standard_Boolean XBlueOnOff; -Standard_Boolean XGreenOnOff; -Standard_Boolean XRedOnOff; -Standard_Boolean Y1OnOff; -Standard_Boolean YBlueOnOff; -Standard_Boolean YGreenOnOff; -Standard_Boolean YRedOnOff; -Standard_Boolean Z1OnOff; -Standard_Boolean ZBlueOnOff; -Standard_Boolean ZGreenOnOff; -Standard_Boolean ZRedOnOff; - -}; -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_OLOREDMESH_H__7CB26B1F_55EC_11D6_BD10_00A0C982B46F__INCLUDED_) diff --git a/samples/mfc/standard/Common/DimensionDlg.cpp b/samples/mfc/standard/Common/DimensionDlg.cpp deleted file mode 100644 index dbfdf45c75..0000000000 --- a/samples/mfc/standard/Common/DimensionDlg.cpp +++ /dev/null @@ -1,731 +0,0 @@ -// CDimensionDlg.cpp : implementation file -// - -#include "stdafx.h" - -#include "DimensionDlg.h" -#include "LengthParamsEdgePage.h" -#include "LengthParamsVerticesPage.h" -#include "LengthParamsEdgesPage.h" -#include "AngleParamsVerticesPage.h" -#include "RadiusParamsPage.h" -#include "ParamsFacesPage.h" -#include -#include -#include -#include - -BEGIN_MESSAGE_MAP(CDimensionDlg, CDialog) - ON_BN_CLICKED(IDOK, &CDimensionDlg::OnBnClickedOk) - ON_BN_CLICKED(IDC_DimLength, &CDimensionDlg::OnBnClickedDimLength) - ON_BN_CLICKED(IDC_DimAngle, &CDimensionDlg::OnBnClickedDimAngle) - ON_BN_CLICKED(IDC_DimRadius, &CDimensionDlg::OnBnClickedDimRadius) - ON_NOTIFY(TCN_SELCHANGE, IDC_LengthTab, &CDimensionDlg::OnTcnSelChangeLengthTab) - ON_NOTIFY(TCN_SELCHANGING, IDC_LengthTab, &CDimensionDlg::OnTcnSelChangingLengthTab) - ON_WM_DESTROY() - ON_NOTIFY(TCN_SELCHANGE, IDC_AngleTab, &CDimensionDlg::OnTcnSelChangeAngleTab) - ON_NOTIFY(TCN_SELCHANGING, IDC_AngleTab, &CDimensionDlg::OnTcnSelChangingAngleTab) - ON_BN_CLICKED(IDC_DimDiameter, &CDimensionDlg::OnBnClickedDimDiameter) - ON_BN_CLICKED(IDC_2DText, &CDimensionDlg::OnBnClicked2dText) - ON_BN_CLICKED(IDC_3DText, &CDimensionDlg::OnBnClicked3dText) - ON_BN_CLICKED(IDC_DimensionColor, &CDimensionDlg::OnBnClickedDimensionColor) - ON_WM_CLOSE() -END_MESSAGE_MAP() - -//======================================================================= -//function : CDimensionDlg -//purpose : -//======================================================================= - -CDimensionDlg::CDimensionDlg(CWnd* pParent /*=NULL*/) - : CDialog(CDimensionDlg::IDD, pParent), - mySelectedDimType(0), - myFontSize (10), - myDimensionColor (Quantity_NOC_LAWNGREEN) -{ -} - -//======================================================================= -//function : CDimensionDlg -//purpose : -//======================================================================= - -CDimensionDlg::CDimensionDlg (Handle(AIS_InteractiveContext) &theAISContext, - CWnd* pParent) -: CDialog(CDimensionDlg::IDD, pParent), - mySelectedDimType(0), - myFontSize (10), - myDimensionColor (Quantity_NOC_LAWNGREEN) -{ - myAISContext = theAISContext; -} - -//======================================================================= -//function : ~CDimensionDlg -//purpose : -//======================================================================= - -CDimensionDlg::~CDimensionDlg() -{ -} - -//======================================================================= -//function : SetContext -//purpose : -//======================================================================= - -void CDimensionDlg::SetContext (const Handle(AIS_InteractiveContext) theContext) -{ - myAISContext = theContext; -} - -//======================================================================= -//function : OnInitDialog -//purpose : Initialization of dialog fields and parameters -//======================================================================= - -BOOL CDimensionDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - myLengthParams = (CTabCtrl*) GetDlgItem (IDC_LengthTab); - myAngleParams = (CTabCtrl*) GetDlgItem (IDC_AngleTab); - myRadiusParams = (CTabCtrl*) GetDlgItem (IDC_RadiusTab); - myDiameterParams = (CTabCtrl*) GetDlgItem (IDC_DiameterTab); - - CreateLengthParamsTab(); - CreateAngleParamsTab(); - CreateRadiusParamsTab(); - CreateDiameterParamsTab( ); - - myLengthParams->ShowWindow (SW_SHOW); - myAngleParams->ShowWindow (SW_HIDE); - myRadiusParams->ShowWindow (SW_HIDE); - myDiameterParams->ShowWindow (SW_HIDE); - - // Setting default values - ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetRange (-30,30,true); - ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (15); - UpdateUnitsListForLength (); - ((CComboBox*)GetDlgItem (IDC_DisplayUnits))->SetCurSel (1); - CheckRadioButton (IDC_2DText, IDC_3DText, IDC_2DText); - SetTextModeControlsVisible (false); - CComboBox* aCombo =(CComboBox* )GetDlgItem (IDC_FontSize); - aCombo->SelectString (0, L"10"); - - UpdateData (FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -//======================================================================= -//function : DoDataExchange -//purpose : Updating of dialog data if it's needed -//======================================================================= - -void CDimensionDlg::DoDataExchange (CDataExchange* pDX) -{ - CDialog::DoDataExchange (pDX); - - DDX_Radio (pDX, IDC_DimLength, mySelectedDimType); -} - -//======================================================================= -//function : OnBnClickedOk -//purpose : Reset all local contexts and close the dimension dialog -//======================================================================= - -void CDimensionDlg::OnBnClickedOk() -{ - OnOK(); -} - -//======================================================================= -//function : GetFlyout -//purpose : Only for length dimensions! Gets flyout value -//======================================================================= - -const Standard_Real CDimensionDlg::GetFlyout() const -{ - return ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->GetPos(); -} - -//======================================================================= -//function : CreateLengthParamsTab -//purpose : Fill tab control for length dimensions -//======================================================================= - -void CDimensionDlg::CreateLengthParamsTab() -{ - TC_ITEM aTabItem; - aTabItem.mask = TCIF_TEXT; - aTabItem.pszText = L"Edge"; - myLengthParams->InsertItem (0, &aTabItem); - aTabItem.pszText = L"Vertices"; - myLengthParams->InsertItem (1, &aTabItem); - aTabItem.pszText = L"Parallel edges"; - myLengthParams->InsertItem (2, &aTabItem); - aTabItem.pszText = L"Parallel faces"; - myLengthParams->InsertItem (3, &aTabItem); - - CLengthParamsEdgePage *aPage1 = new CLengthParamsEdgePage (myAISContext); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage1; - myLengthParams->SetItem (0, &aTabItem); - VERIFY (aPage1->Create (CLengthParamsEdgePage::IDD,myLengthParams)); - aPage1->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage1->ShowWindow (SW_SHOW); - - CLengthParamsVerticesPage *aPage2 = new CLengthParamsVerticesPage (myAISContext); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage2; - myLengthParams->SetItem (1, &aTabItem); - VERIFY (aPage2->Create (CLengthParamsVerticesPage::IDD,myLengthParams)); - aPage2->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage2->ShowWindow (SW_HIDE); - - CLengthParamsEdgesPage *aPage3 = new CLengthParamsEdgesPage (myAISContext); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage3; - myLengthParams->SetItem (2, &aTabItem); - VERIFY (aPage3->Create (CLengthParamsEdgesPage::IDD,myLengthParams)); - aPage3->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage3->ShowWindow (SW_HIDE); - - CParamsFacesPage *aPage4 = new CParamsFacesPage (myAISContext); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage4; - myLengthParams->SetItem (3, &aTabItem); - VERIFY (aPage4->Create (CParamsFacesPage::IDD,myLengthParams)); - aPage4->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage4->ShowWindow (SW_HIDE); -} - -//======================================================================= -//function : CreateAngleParamsTab -//purpose : Fill tab control for angle dimensions -//======================================================================= - -void CDimensionDlg::CreateAngleParamsTab() -{ - TC_ITEM aTabItem; - aTabItem.mask = TCIF_TEXT; - aTabItem.pszText = L"Two edges"; - myAngleParams->InsertItem (0, &aTabItem); - aTabItem.pszText = L"Three vertices"; - myAngleParams->InsertItem (1, &aTabItem); - aTabItem.pszText = L"Two faces"; - myAngleParams->InsertItem (2, &aTabItem); - - CLengthParamsEdgesPage *aPage1 = new CLengthParamsEdgesPage (myAISContext, true); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage1; - myAngleParams->SetItem (0, &aTabItem); - VERIFY (aPage1->Create (CLengthParamsEdgesPage::IDD,myAngleParams)); - aPage1->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage1->ShowWindow (SW_SHOW); - - CAngleParamsVerticesPage *aPage2 = new CAngleParamsVerticesPage (myAISContext); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage2; - myAngleParams->SetItem (1, &aTabItem); - VERIFY (aPage2->Create (CAngleParamsVerticesPage::IDD,myAngleParams)); - aPage2->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage2->ShowWindow (SW_HIDE); - - CParamsFacesPage *aPage3 = new CParamsFacesPage (myAISContext, true); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage3; - myAngleParams->SetItem (2, &aTabItem); - VERIFY (aPage3->Create (CParamsFacesPage::IDD,myAngleParams)); - aPage3->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage3->ShowWindow (SW_HIDE); -} - -//======================================================================= -//function : CreateRadiusParamsTab -//purpose : Fill tab control for radius dimensions -//======================================================================= - -void CDimensionDlg::CreateRadiusParamsTab() -{ - TC_ITEM aTabItem; - aTabItem.mask = TCIF_TEXT; - aTabItem.pszText = L"Circle or arc"; - myRadiusParams->InsertItem (0, &aTabItem); - CRadiusParamsPage *aPage1 = new CRadiusParamsPage (myAISContext); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage1; - myRadiusParams->SetItem (0, &aTabItem); - VERIFY (aPage1->Create (CRadiusParamsPage::IDD,myRadiusParams)); - aPage1->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage1->ShowWindow (SW_SHOW); -} - -//======================================================================= -//function : CreateDiameterParamsTab -//purpose : Fill tab control for diameter dimensions -//======================================================================= - -void CDimensionDlg::CreateDiameterParamsTab() -{ - TC_ITEM aTabItem; - aTabItem.mask = TCIF_TEXT; - aTabItem.pszText = L"Circle or arc"; - myDiameterParams->InsertItem (0, &aTabItem); - CRadiusParamsPage *aPage1 = new CRadiusParamsPage (myAISContext,Standard_True); - aTabItem.mask = TCIF_PARAM; - aTabItem.lParam = (LPARAM)aPage1; - myRadiusParams->SetItem (0, &aTabItem); - VERIFY (aPage1->Create (CRadiusParamsPage::IDD,myDiameterParams)); - aPage1->SetWindowPos (NULL,10,30,0,0,SWP_NOSIZE | SWP_NOZORDER); - aPage1->ShowWindow (SW_SHOW); -} - -//======================================================================= -//function : UpdateStandardModeForAngle -//purpose : -//======================================================================= - -void CDimensionDlg::UpdateStandardModeForAngle() -{ - int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetCurSel(); - TopAbs_ShapeEnum aMode; - - if (aTabNum == 1) - { - aMode = TopAbs_VERTEX; - } - else if (aTabNum == 2) - { - aMode = TopAbs_FACE; - } - else - { - aMode = TopAbs_EDGE; - } - - myAISContext->Activate (AIS_Shape::SelectionMode (aMode)); -} - -//======================================================================= -//function : UpdateStandardModeForLength -//purpose : -//======================================================================= - -void CDimensionDlg::UpdateStandardModeForLength() -{ - int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetCurSel(); - - TopAbs_ShapeEnum aMode; - - if (aTabNum == 1) - { - aMode = TopAbs_VERTEX; - } - else if (aTabNum == 3) - { - aMode = TopAbs_FACE; - } - else - { - aMode = TopAbs_EDGE; - } - myAISContext->Activate (AIS_Shape::SelectionMode (aMode)); -} - -//======================================================================= -//function : UpdateStandardModeForLength -//purpose : -//======================================================================= - -void CDimensionDlg::UpdateStandardMode() -{ - int aCurIndex = GetCheckedRadioButton (IDC_DimLength, IDC_DimDiameter); - switch (aCurIndex) - { - case IDC_DimLength: - UpdateStandardModeForLength(); - break; - case IDC_DimAngle: - UpdateStandardModeForAngle(); - break; - case IDC_DimRadius: - case IDC_DimDiameter: - { - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); - } - break; - } -} - -//======================================================================= -//function : OnBnClickedDimLength -//purpose : it is called when radio button is chosen -//======================================================================= - -void CDimensionDlg::OnBnClickedDimLength() -{ - // Update parameters - UpdateStandardModeForLength (); - GetDlgItem (IDC_LengthTab)->ShowWindow (SW_SHOW); - GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE); - - UpdateUnitsListForLength (); - ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (15); -} - -//======================================================================= -//function : OnBnClickedDimAngle -//purpose : it is called when radio button is chosen -//======================================================================= - -void CDimensionDlg::OnBnClickedDimAngle() -{ - // Update parameters - UpdateStandardModeForAngle(); - GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_AngleTab)->ShowWindow (SW_SHOW); - GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE); - - UpdateUnitsListForAngle(); - ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (15); -} - -//======================================================================= -//function : OnBnClickedDimDiameter -//purpose : it is called when radio button is chosen -//======================================================================= - -void CDimensionDlg::OnBnClickedDimDiameter() -{ - // Update parameters - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); - - GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_SHOW); - - UpdateUnitsListForLength(); - ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (0); -} - -//======================================================================= -//function : OnBnClickedDimRadius -//purpose : it is called when radio button is chosen -//======================================================================= - -void CDimensionDlg::OnBnClickedDimRadius() -{ - // Update parameters - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); - GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE); - GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_SHOW); - GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE); - - UpdateUnitsListForLength(); - ((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (0); -} - -//======================================================================= -//function : OnTcnSelChangeLengthTab -//purpose : it is called when in Length tab control current tab was changed -//======================================================================= - -void CDimensionDlg::OnTcnSelChangeLengthTab (NMHDR * /*pNMHDR*/, LRESULT *pResult) -{ - // Show this chosen tab page - int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetCurSel(); - TC_ITEM anItem; - anItem.mask = TCIF_PARAM; - ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetItem (aTabNum, &anItem); - ASSERT(anItem.lParam); - CWnd *aWnd = (CWnd*)anItem.lParam; - aWnd->ShowWindow (SW_SHOW); - UpdateStandardModeForLength(); - *pResult = 0; -} - -//======================================================================= -//function : OnTcnSelChangingLengthTab -//purpose : it is called when in Length tab control current tab -// is changing -// It is used to hide the current tab here to prevent collisions. -//======================================================================= - -void CDimensionDlg::OnTcnSelChangingLengthTab (NMHDR * /*pNMHDR*/, LRESULT *pResult) -{ - // Hide current tab page - int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetCurSel(); - TC_ITEM anItem; - anItem.mask = TCIF_PARAM; - ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetItem (aTabNum, &anItem); - ASSERT (anItem.lParam); - CWnd *aWnd = (CWnd*)anItem.lParam; - aWnd->ShowWindow (SW_HIDE); - *pResult = 0; -} - -//======================================================================= -//function : OnTcnSelChangeAngleTab -//purpose : it is called when in Angle tab control current tab was changed -//======================================================================= - -void CDimensionDlg::OnTcnSelChangeAngleTab (NMHDR * /*pNMHDR*/, LRESULT *pResult) -{ - int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetCurSel(); - TC_ITEM anItem; - anItem.mask = TCIF_PARAM; - ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetItem (aTabNum, &anItem); - ASSERT (anItem.lParam); - CWnd *aWnd = (CWnd*)anItem.lParam; - aWnd->ShowWindow (SW_SHOW); - UpdateStandardModeForAngle(); - *pResult = 0; -} - -//======================================================================= -//function : OnTcnSelChangingAngleTab -//purpose : it is called when in Angle tab control current tab -// is changing -// It is used to hide the current tab here to prevent collisions. -//======================================================================= - -void CDimensionDlg::OnTcnSelChangingAngleTab (NMHDR * /*pNMHDR*/, LRESULT *pResult) -{ - int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetCurSel(); - TC_ITEM anItem; - anItem.mask = TCIF_PARAM; - ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetItem (aTabNum, &anItem); - ASSERT (anItem.lParam); - CWnd *aWnd = (CWnd*)anItem.lParam; - aWnd->ShowWindow (SW_HIDE); - *pResult = 0; -} - -//======================================================================= -//function : DeactivateAllStandardModes -//purpose : -//======================================================================= - -void CDimensionDlg::DeactivateAllStandardModes() -{ - myAISContext->Deactivate(); -} - -//======================================================================= -//function : OnDestroy -//purpose : -//======================================================================= - -void CDimensionDlg::OnDestroy() -{ - CWnd *aWnd; - TC_ITEM anItem; - anItem.mask = TCIF_PARAM; - - // Destroy length tab - for (int i = 3; i >= 0; --i) - { - ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetItem (i, &anItem); - ASSERT (anItem.lParam); - aWnd = (CWnd*) anItem.lParam; - aWnd->DestroyWindow(); - delete aWnd; - } - // Destroy angle tab - for (int i = 2; i >= 0; --i) - { - ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetItem (i, &anItem); - ASSERT(anItem.lParam); - aWnd = (CWnd*) anItem.lParam; - aWnd->DestroyWindow(); - delete aWnd; - } - - // Destroy radius tab - ((CTabCtrl*) GetDlgItem (IDC_RadiusTab))->GetItem (0, &anItem); - ASSERT(anItem.lParam); - aWnd = (CWnd*) anItem.lParam; - aWnd->DestroyWindow(); - delete aWnd; - - // Destroy diameter tab - ((CTabCtrl*) GetDlgItem (IDC_DiameterTab))->GetItem (0, &anItem); - ASSERT(anItem.lParam); - aWnd = (CWnd*) anItem.lParam; - aWnd->DestroyWindow(); - delete aWnd; - - CDialog::OnDestroy(); -} - -//======================================================================= -//function : GetTextType -//purpose : Returns true if 3d text is to be used -// and false in the case of 2d text. -//======================================================================= - -const Standard_Boolean CDimensionDlg::GetTextType() const -{ - CButton* a3DButton = (CButton*)GetDlgItem (IDC_3DText); - return a3DButton->GetCheck() != 0; -} - -//======================================================================= -//function : GetFontHeight -//purpose : Returns font height -//======================================================================= - -const Standard_Real CDimensionDlg::GetFontHeight() const -{ - CComboBox *aComboBox = (CComboBox*)GetDlgItem (IDC_FontSize); - CString aStr; - aComboBox->GetWindowText (aStr); - return _wtof (aStr); -} - -//======================================================================= -//function : IsText3dShaded -//purpose : Only for 3d text; returns true if shaded 3d text is to be used -//======================================================================= - -const Standard_Boolean CDimensionDlg::IsText3dShaded() const -{ - CComboBox *aComboBox = (CComboBox*)GetDlgItem (IDC_TextDisplayMode); - int aCurIndex = aComboBox->GetCurSel(); - return aCurIndex == 0 ? Standard_False : Standard_True; -} - -//======================================================================= -//function : SetTextModeControlsVisible -//purpose : for the dialog updating -//======================================================================= - -void CDimensionDlg::SetTextModeControlsVisible (bool isVisible) -{ - GetDlgItem (IDC_TextDisplayMode)->ShowWindow (isVisible ? SW_SHOW : SW_HIDE); - GetDlgItem (IDC_TextDisplayModeStatic)->ShowWindow (isVisible ? SW_SHOW : SW_HIDE); -} - -//======================================================================= -//function : OnBnClicked2dText -//purpose : for the dialog updating when 2d text radio button was chosen -//======================================================================= - -void CDimensionDlg::OnBnClicked2dText() -{ - SetTextModeControlsVisible (false); -} - -//======================================================================= -//function : OnBnClicked3dText -//purpose : for the dialog updating when 3d text radio button was chosen -//======================================================================= - -void CDimensionDlg::OnBnClicked3dText() -{ - SetTextModeControlsVisible (true); -} - -//======================================================================= -//function : UpdateUnitsListForLength -//purpose : for the dialog updating when 3d text radio button was chosen -//======================================================================= - -void CDimensionDlg::UpdateUnitsListForLength() -{ - CComboBox *aCombo = (CComboBox*)GetDlgItem (IDC_DisplayUnits); - aCombo->ResetContent(); - aCombo->AddString (L"No"); - aCombo->AddString (L"m"); - aCombo->AddString (L"mm"); - aCombo->AddString (L"in"); - aCombo->SetCurSel (1); -} - -//======================================================================= -//function : UpdateUnitsListForAngle -//purpose : for the dialog updating when 3d text radio button was chosen -//======================================================================= - -void CDimensionDlg::UpdateUnitsListForAngle() -{ - CComboBox *aCombo = (CComboBox*)GetDlgItem (IDC_DisplayUnits); - aCombo->ResetContent(); - aCombo->AddString (L"No"); - aCombo->AddString (L"deg"); - aCombo->AddString (L"rad"); - aCombo->SetCurSel (1); -} - -//======================================================================= -//function : IsUnitsDisplayed -//purpose : returns true if the units is to be displayed -//======================================================================= - -const Standard_Boolean CDimensionDlg::IsUnitsDisplayed() const -{ - CString aStr; - GetDlgItem (IDC_DisplayUnits)->GetWindowText (aStr); - return !aStr.IsEmpty() && aStr != "No"; -} - -//======================================================================= -//function : GetUnits -//purpose : returns display quantity units for current dimension -//======================================================================= - -const TCollection_AsciiString CDimensionDlg::GetUnits() const -{ - if (!IsUnitsDisplayed()) - return TCollection_AsciiString(); - CString aStr; - GetDlgItem (IDC_DisplayUnits)->GetWindowText (aStr); - return TCollection_AsciiString ((const wchar_t* )aStr); -} - -//======================================================================= -//function : OnBnClickedDimensionColor -//purpose : returns display quantity units for current dimension -//======================================================================= - -void CDimensionDlg::OnBnClickedDimensionColor() -{ - Standard_Real aR; - Standard_Real aG; - Standard_Real aB; - myDimensionColor.Values (aR,aG,aB, Quantity_TOC_RGB); - COLORREF aColor = RGB (aR*255, aG*255, aB*255); - - CColorDialog aDlgColor (aColor); - if (aDlgColor.DoModal() == IDOK) - { - aColor = aDlgColor.GetColor(); - aR = GetRValue(aColor) / 255.0; - aG = GetGValue(aColor) / 255.0; - aB = GetBValue(aColor) / 255.0; - myDimensionColor = Quantity_Color (aR, aG, aB, Quantity_TOC_RGB); - } -} - -//======================================================================= -//function : GetDimensionColor -//purpose : returns current dimension color -//======================================================================= - -const Quantity_Color CDimensionDlg::GetDimensionColor() const -{ - return myDimensionColor; -} - -void CDimensionDlg::OnClose() -{ - CDialog::OnClose(); -} diff --git a/samples/mfc/standard/Common/DimensionDlg.h b/samples/mfc/standard/Common/DimensionDlg.h deleted file mode 100755 index b2b9bf547d..0000000000 --- a/samples/mfc/standard/Common/DimensionDlg.h +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once - -// DimensionDlg dialog - -#include - -#include "res\OCC_Resource.h" -#include -#include -#include -#include - -class CDimensionDlg : public CDialog -{ -public: - /// Construction & termination - CDimensionDlg (CWnd* pParent = NULL); // standard constructor - CDimensionDlg (Handle(AIS_InteractiveContext) &theAISContext, - CWnd* pParent = NULL); - virtual ~CDimensionDlg(); - - // Methods for data operation - void SetContext (const Handle(AIS_InteractiveContext) theContext); - void SetTextModeControlsVisible (bool isVisible); - void UpdateUnitsListForLength(); - void UpdateUnitsListForAngle(); - void Empty(); - void DeactivateAllStandardModes(); - void UpdateStandardModeForAngle (); - void UpdateStandardModeForLength (); - void UpdateStandardMode (); - const Standard_Real GetFlyout () const; - const Standard_Boolean GetTextType() const; - const Standard_Real GetFontHeight() const; - const Standard_Boolean IsText3dShaded() const; - const Standard_Boolean IsUnitsDisplayed() const; - const TCollection_AsciiString GetUnits() const; - const Quantity_Color GetDimensionColor() const; - -public: - // Dialog Data - enum { IDD = IDD_Dimension }; - // Initialization of dialog -protected: - virtual BOOL OnInitDialog(); - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() - - //Attributes -private: - Handle (AIS_InteractiveContext) myAISContext; - int mySelectedDimType; - int myFontSize; - Quantity_Color myDimensionColor; - CTabCtrl *myLengthParams; - CTabCtrl *myAngleParams; - CTabCtrl *myRadiusParams; - CTabCtrl *myDiameterParams; - - void CreateLengthParamsTab(); - void CreateAngleParamsTab(); - void CreateRadiusParamsTab(); - void CreateDiameterParamsTab(); - -public: - afx_msg void OnBnClickedOk(); - afx_msg void OnBnClickedDimLength(); - afx_msg void OnBnClickedDimAngle(); - afx_msg void OnBnClickedDimRadius(); - afx_msg void OnTcnSelChangeLengthTab(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnTcnSelChangingLengthTab(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnDestroy(); - afx_msg void OnTcnSelChangeAngleTab(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnTcnSelChangingAngleTab(NMHDR *pNMHDR, LRESULT *pResult); - afx_msg void OnBnClickedDimDiameter(); - afx_msg void OnBnClicked2dText(); - afx_msg void OnBnClicked3dText(); - afx_msg void OnBnClickedDimensionColor(); - afx_msg void OnClose(); -}; diff --git a/samples/mfc/standard/Common/ISession2D/ISession2D_Shape.cpp b/samples/mfc/standard/Common/ISession2D/ISession2D_Shape.cpp deleted file mode 100755 index 73a0d97c9b..0000000000 --- a/samples/mfc/standard/Common/ISession2D/ISession2D_Shape.cpp +++ /dev/null @@ -1,325 +0,0 @@ -#include "stdafx.h" - -#include "ISession2D_Shape.h" -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Shape,AIS_InteractiveObject) - -ISession2D_Shape::ISession2D_Shape () - :AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependent) -{} - -void ISession2D_Shape::Add(const TopoDS_Shape& aShape) -{ - myListOfShape.Append(aShape); - myAlgo.Nullify(); - myPolyAlgo.Nullify(); - SetToUpdate(); - UpdatePresentations(); -} - -void ISession2D_Shape::Remove (const TopoDS_Shape& theShape) -{ - if (myListOfShape.Size() == 0) - { - return; - } - - for (NCollection_List::Iterator anIt (myListOfShape); anIt.More(); anIt.Next()) - { - if (anIt.Value() == theShape) - { - myListOfShape.Remove (anIt); - return; - } - } -} - -void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector) -{ - myProjector= aProjector; - myAlgo.Nullify(); - myPolyAlgo.Nullify(); - SetToUpdate(); - UpdatePresentations(); -}; - - -void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos) -{ - myNbIsos= aNbIsos; - myAlgo.Nullify(); - SetToUpdate(); - UpdatePresentations(); -}; - -void ISession2D_Shape::BuildAlgo() -{ - myAlgo = new HLRBRep_Algo(); - NCollection_List::Iterator anIterator(myListOfShape); - for (;anIterator.More();anIterator.Next()) myAlgo->Add(anIterator.Value(),myNbIsos); - myAlgo->Projector(myProjector); - myAlgo->Update(); - myAlgo->Hide(); - -} -void ISession2D_Shape::BuildPolyAlgo() -{ - myPolyAlgo = new HLRBRep_PolyAlgo(); - NCollection_List::Iterator anIterator(myListOfShape); - for (;anIterator.More();anIterator.Next()) myPolyAlgo->Load(anIterator.Value()); - myPolyAlgo->Projector(myProjector); - myPolyAlgo->Update(); -} - -void ISession2D_Shape::Compute(const Handle(PrsMgr_PresentationManager)& /*thePresentationManager*/, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) -{ - - Standard_Integer aMode = theMode; - Standard_Boolean DrawHiddenLine= Standard_True; - thePresentation->Clear(); - if (aMode >= 1000) - { - DrawHiddenLine = Standard_False; - aMode -= 1000; - } - - Standard_Boolean UsePolyAlgo= Standard_True; - if (aMode >= 100) - { - UsePolyAlgo = Standard_False; - aMode -= 100; - } - TopoDS_Shape VCompound; - TopoDS_Shape Rg1LineVCompound; - TopoDS_Shape RgNLineVCompound; - TopoDS_Shape OutLineVCompound; - TopoDS_Shape IsoLineVCompound; // only for Exact algo - TopoDS_Shape HCompound; - TopoDS_Shape Rg1LineHCompound; - TopoDS_Shape RgNLineHCompound; - TopoDS_Shape OutLineHCompound; - TopoDS_Shape IsoLineHCompound; // only for Exact algo - - if (UsePolyAlgo) - { - if (myPolyAlgo.IsNull()) BuildPolyAlgo(); - HLRBRep_PolyHLRToShape aPolyHLRToShape; - aPolyHLRToShape.Update(myPolyAlgo); - - VCompound = aPolyHLRToShape.VCompound(); - Rg1LineVCompound = aPolyHLRToShape.Rg1LineVCompound(); - RgNLineVCompound = aPolyHLRToShape.RgNLineVCompound(); - OutLineVCompound = aPolyHLRToShape.OutLineVCompound(); - HCompound = aPolyHLRToShape.HCompound(); - Rg1LineHCompound = aPolyHLRToShape.Rg1LineHCompound(); - RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound(); - OutLineHCompound = aPolyHLRToShape.OutLineHCompound(); - } - else - { - if (myAlgo.IsNull()) BuildAlgo(); - HLRBRep_HLRToShape aHLRToShape(myAlgo); - - VCompound = aHLRToShape.VCompound(); - Rg1LineVCompound = aHLRToShape.Rg1LineVCompound(); - RgNLineVCompound = aHLRToShape.RgNLineVCompound(); - OutLineVCompound = aHLRToShape.OutLineVCompound(); - IsoLineVCompound = aHLRToShape.IsoLineVCompound(); - HCompound = aHLRToShape.HCompound(); - Rg1LineHCompound = aHLRToShape.Rg1LineHCompound(); - RgNLineHCompound = aHLRToShape.RgNLineHCompound(); - OutLineHCompound = aHLRToShape.OutLineHCompound(); - IsoLineHCompound = aHLRToShape.IsoLineHCompound(); - } - - if (UsePolyAlgo) - { - Handle(Prs3d_LineAspect) aLineAspectHighlighted = new Prs3d_LineAspect(Quantity_NOC_ALICEBLUE, - Aspect_TOL_DOTDASH,1); - Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(Quantity_NOC_WHITE, - Aspect_TOL_SOLID,1); - - - switch(aMode) - { - case (1): - { - DrawCompound(thePresentation, VCompound, aLineAspectHighlighted); - break; - } - case (2): - { - DrawCompound(thePresentation, Rg1LineVCompound, aLineAspectHighlighted); - break; - } - case (3): - { - DrawCompound(thePresentation, RgNLineVCompound, aLineAspectHighlighted); - break; - } - case (4): - { - DrawCompound(thePresentation, OutLineVCompound, aLineAspectHighlighted); - break; - } - default: - { - DrawCompound(thePresentation,VCompound, aLineAspect); - DrawCompound(thePresentation,Rg1LineVCompound, aLineAspect); - DrawCompound(thePresentation,RgNLineVCompound, aLineAspect); - DrawCompound(thePresentation,OutLineVCompound, aLineAspect); - } - } - - if (DrawHiddenLine) - { - Handle(Prs3d_LineAspect) aLineAspectHighlightedHLR = new Prs3d_LineAspect(Quantity_NOC_RED, - Aspect_TOL_DOTDASH,2); - Handle(Prs3d_LineAspect) aLineAspectHLR = new Prs3d_LineAspect(Quantity_NOC_BLUE1, - Aspect_TOL_DOTDASH,1); - - switch(aMode) - { - case (6): - { - DrawCompound(thePresentation, HCompound, aLineAspectHighlightedHLR); - break; - } - case (7): - { - DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHighlightedHLR); - break; - } - case (8): - { - DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHighlightedHLR); - break; - } - case (9): - { - DrawCompound(thePresentation, OutLineHCompound, aLineAspectHighlightedHLR); - break; - } - default: - { - DrawCompound(thePresentation, HCompound, aLineAspectHLR); - DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHLR); - DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHLR); - DrawCompound(thePresentation, OutLineHCompound, aLineAspectHLR); - } - } - } - } - else - { - Handle(Prs3d_LineAspect) aLineAspectHighlighted = new Prs3d_LineAspect(Quantity_NOC_RED, - Aspect_TOL_SOLID,2); - Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(Quantity_NOC_WHITE, - Aspect_TOL_SOLID,1); - - switch (aMode) - { - case (1): - { - DrawCompound(thePresentation, VCompound, aLineAspectHighlighted); - break; - } - case (2): - { - DrawCompound(thePresentation, Rg1LineVCompound, aLineAspectHighlighted); - break; - } - case (3): - { - DrawCompound(thePresentation, RgNLineVCompound, aLineAspectHighlighted); - break; - } - case (4): - { - DrawCompound(thePresentation, OutLineVCompound, aLineAspectHighlighted); - break; - } - case (5): - { - DrawCompound(thePresentation, IsoLineVCompound, aLineAspectHighlighted); - break; - } - default: - { - DrawCompound(thePresentation, VCompound, aLineAspect); - DrawCompound(thePresentation, Rg1LineVCompound, aLineAspect); - DrawCompound(thePresentation, RgNLineVCompound, aLineAspect); - DrawCompound(thePresentation, OutLineVCompound, aLineAspect); - DrawCompound(thePresentation, IsoLineVCompound , aLineAspect); - } - } - - if (DrawHiddenLine) - { - Handle(Prs3d_LineAspect) aLineAspectHighlightedHLR = new Prs3d_LineAspect(Quantity_NOC_RED, - Aspect_TOL_DOT,2); - - switch (aMode) - { - case (6): - { - DrawCompound(thePresentation, HCompound, aLineAspectHighlightedHLR); - break; - } - case (7): - { - DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHighlightedHLR); - break; - } - case (8): - { - DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHighlightedHLR); - break; - } - case (9): - { - DrawCompound(thePresentation, OutLineHCompound, aLineAspectHighlightedHLR); - break; - } - case (10): - { - DrawCompound(thePresentation, IsoLineHCompound, aLineAspectHighlightedHLR); - break; - } - default: - { - Handle(Prs3d_LineAspect) aLineAspectHLR = - new Prs3d_LineAspect(Quantity_NOC_ALICEBLUE, Aspect_TOL_DOT, 1); - DrawCompound(thePresentation, HCompound, aLineAspectHLR); - DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHLR); - DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHLR); - DrawCompound(thePresentation, OutLineHCompound, aLineAspectHLR); - DrawCompound(thePresentation, IsoLineHCompound, aLineAspectHLR); - } - } - } - } -} - -void ISession2D_Shape::DrawCompound(const Handle(Prs3d_Presentation)& thePresentation, - const TopoDS_Shape& theCompound, - const Handle(Prs3d_LineAspect) theAspect) -{ - if (theCompound.IsNull()) - return; - myDrawer->SetWireAspect(theAspect); - StdPrs_WFShape::Add(thePresentation,TopoDS_Shape(theCompound),myDrawer); -} - -void ISession2D_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, - const Standard_Integer /*aMode*/) -{ - -} - diff --git a/samples/mfc/standard/Common/ISession2D/ISession2D_Shape.h b/samples/mfc/standard/Common/ISession2D/ISession2D_Shape.h deleted file mode 100755 index 658c6bb127..0000000000 --- a/samples/mfc/standard/Common/ISession2D/ISession2D_Shape.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef _ISession2D_Shape_HeaderFile -#define _ISession2D_Shape_HeaderFile - -#include "AIS_InteractiveObject.hxx" -#include "Graphic3d_ArrayOfPolylines.hxx" -#include -#include -#include -#include -#include "SelectMgr_SelectableObject.hxx" -#include -#include -#include "TopoDS_Shape.hxx" -class ISession2D_Shape; -DEFINE_STANDARD_HANDLE(ISession2D_Shape,AIS_InteractiveObject) - -class ISession2D_Shape : public AIS_InteractiveObject -{ -public: - Standard_EXPORT ISession2D_Shape (); - - // Adds shape to the list of topological shapes - void Standard_EXPORT Add (const TopoDS_Shape& aShape); - - // Removes shape from the list of shapes. - // It is used in case of shapes erasing. - void Standard_EXPORT Remove (const TopoDS_Shape& theShape); - // Returns myProjector - HLRAlgo_Projector& Projector() { return myProjector;}; - - Standard_EXPORT void SetProjector (HLRAlgo_Projector& aProjector); - - - Standard_Integer& NbIsos() { return myNbIsos;}; - - Standard_EXPORT void SetNbIsos (Standard_Integer& aNbIsos); - - Standard_Boolean AcceptShapeDecomposition() {return Standard_True;} - - virtual Standard_Boolean AcceptSelectionMode (const Standard_Integer /*aMode*/) const - { return Standard_True; } - -public: - DEFINE_STANDARD_RTTIEXT(ISession2D_Shape,AIS_InteractiveObject) - -private: - void BuildAlgo(); - void BuildPolyAlgo(); - - void DrawCompound (const Handle(Prs3d_Presentation)& thePresentation, - const TopoDS_Shape& theCompound, - const Handle(Prs3d_LineAspect) theAspect); - - Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode = 0); - - virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, - const Standard_Integer aMode); - -private: - - Standard_Integer myNbIsos; - NCollection_List myListOfShape; - HLRAlgo_Projector myProjector; - Handle(HLRBRep_Algo) myAlgo; - Handle(HLRBRep_PolyAlgo) myPolyAlgo; -}; -// other inCurve functions and methods (like "C++: function call" methods) -// - - - -#endif diff --git a/samples/mfc/standard/Common/ImportExport/ImportExport.cpp b/samples/mfc/standard/Common/ImportExport/ImportExport.cpp deleted file mode 100755 index cd260c910c..0000000000 --- a/samples/mfc/standard/Common/ImportExport/ImportExport.cpp +++ /dev/null @@ -1,850 +0,0 @@ -// ImportExport.cpp: implementation of the CImportExport class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "ImportExport.h" -#include - -#include "SaveSTEPDlg.h" - -#include "TColStd_SequenceOfAsciiString.hxx" -#include "TColStd_SequenceOfExtendedString.hxx" -#include "OSD_Timer.hxx" - -#include "IGESControl_Reader.hxx" -#include "STEPControl_Controller.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -//#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -Handle(TopTools_HSequenceOfShape) CImportExport::BuildSequenceFromContext(const Handle(AIS_InteractiveContext)& anInteractiveContext, - Handle(Quantity_HArray1OfColor)& anArrayOfColors, - Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies) -{ - Handle(TopTools_HSequenceOfShape) aSequence; - Standard_Integer nb = anInteractiveContext->NbSelected(), i = 1; - if (!nb) - return aSequence; - - aSequence = new TopTools_HSequenceOfShape(); - anArrayOfColors = new Quantity_HArray1OfColor(1, nb); - anArrayOfTransparencies = new TColStd_HArray1OfReal (1, nb); - - Handle(AIS_InteractiveObject) picked; - for (anInteractiveContext->InitSelected(); anInteractiveContext->MoreSelected(); anInteractiveContext->NextSelected()) - { - picked = anInteractiveContext->SelectedInteractive(); - if (picked->IsKind (STANDARD_TYPE (AIS_Shape))) - { - Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(picked); - TopoDS_Shape aShape = aisShape->Shape(); - aSequence->Append(aShape); - - Quantity_Color color; - aisShape->Color(color); - anArrayOfColors->SetValue(i, color); - - Standard_Real transparency = aisShape->Transparency(); - anArrayOfTransparencies->SetValue(i, transparency); - - i++; - } - } - return aSequence; -} - -//====================================================================== -//= = -//= BREP = -//= = -//====================================================================== - -int CImportExport::ReadBREP (const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - Handle(TopTools_HSequenceOfShape) aSequence = CImportExport::ReadBREP(); - if(aSequence->IsEmpty()) - return 1; - Handle(AIS_Shape) aShape; - for(int i=1;i<= aSequence->Length();i++){ - aShape = new AIS_Shape(aSequence->Value(i)); - anInteractiveContext->SetDisplayMode(aShape, 1, Standard_False); - anInteractiveContext->Display(aShape, Standard_False); - const Handle(AIS_InteractiveObject)& aPrs = aShape; // A small trick to avoid compiler error (C2668). - anInteractiveContext->SetSelected (aPrs, Standard_False); - } - return 0; -} - -Handle(TopTools_HSequenceOfShape) CImportExport::ReadBREP() -{ - CFileDialog dlg(TRUE, - NULL, - NULL, - OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"BREP Files (*.brep , *.rle)|*.brep; *.BREP; *.rle; *.RLE; |All Files (*.*)|*.*||", - NULL ); - - CString SHAREPATHValue; - SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); - CString initdir = (SHAREPATHValue + "\\occ"); - - dlg.m_ofn.lpstrInitialDir = initdir; - - Handle(TopTools_HSequenceOfShape) aSequence= new TopTools_HSequenceOfShape(); - - if (dlg.DoModal() == IDOK) - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - CString filename = dlg.GetPathName(); - TopoDS_Shape aShape; - Standard_Boolean result = ReadBREP (filename, aShape); - if (result) - { - if (!BRepAlgo::IsValid(aShape)) - MessageBoxW (AfxGetMainWnd()->m_hWnd, L"Warning: The shape is not valid!", L"Cascade Warning", MB_ICONWARNING); - - aSequence->Append(aShape); - } - else - MessageBoxW (AfxGetMainWnd()->m_hWnd, L"Error: The file was not read", L"Cascade Error", MB_ICONERROR); - - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - - return aSequence; -} -//---------------------------------------------------------------------- - -Standard_Boolean CImportExport::ReadBREP(CString aFileName, - TopoDS_Shape& aShape) -{ - aShape.Nullify(); - - std::filebuf aFileBuf; - std::istream aStream (&aFileBuf); - if (!aFileBuf.open (aFileName, std::ios::in)) - { - return Standard_False; - } - - BRep_Builder aBuilder; - BRepTools::Read (aShape, aStream, aBuilder); - return !aShape.IsNull(); -} - -void CImportExport::SaveBREP(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - anInteractiveContext->InitSelected(); - if (anInteractiveContext->NbSelected() == 0){ - AfxMessageBox (L"No shape selected for export!"); - return; - } - Handle(TopTools_HSequenceOfShape) aHSequenceOfShape; - Handle(Quantity_HArray1OfColor) anArrayOfColors; - Handle(TColStd_HArray1OfReal) anArrayOfTransparencies; - aHSequenceOfShape = BuildSequenceFromContext(anInteractiveContext, anArrayOfColors, anArrayOfTransparencies); - int aLength = aHSequenceOfShape->Length(); - if (aLength == 1){ - TopoDS_Shape RES = aHSequenceOfShape->Value(1); - CImportExport::SaveBREP(RES); - } else { - TopoDS_Compound RES; - BRep_Builder MKCP; - MKCP.MakeCompound(RES); - for (Standard_Integer i=1;i<=aLength;i++) - { - TopoDS_Shape aShape= aHSequenceOfShape->Value(i); - if ( aShape.IsNull() ) - { - continue; - } - MKCP.Add(RES, aShape); - } - CImportExport::SaveBREP(RES); - } -} - -Standard_Boolean CImportExport::SaveBREP(const TopoDS_Shape& aShape) -{ - CFileDialog dlg (FALSE, L"*.brep",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"BREP Files (*.brep)|*.brep;|BREP Files (*.BREP)|*.BREP;||", NULL); - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\occ"); - -dlg.m_ofn.lpstrInitialDir = initdir; - - Standard_Boolean result = Standard_False; - if (dlg.DoModal() == IDOK) - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - CString filename = dlg.GetPathName(); - result = SaveBREP (filename, aShape); - if (!result) - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, - L"Error : The shape or shapes were not saved.", - L"CasCade Error", MB_ICONERROR); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return result; -} - -//---------------------------------------------------------------------------------------- -Standard_Boolean CImportExport::SaveBREP (CString aFileName, - const TopoDS_Shape& aShape) -{ - std::filebuf aFileBuf; - std::ostream aStream (&aFileBuf); - if (!aFileBuf.open (aFileName, std::ios::out)) - { - return Standard_False; - } - - BRepTools::Write (aShape, aStream); - return Standard_True; -} - -//====================================================================== -//= = -//= IGES = -//= = -//====================================================================== - - - -void CImportExport::ReadIGES(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - Handle(TopTools_HSequenceOfShape) aSequence = CImportExport::ReadIGES(); - for(int i=1;i<= aSequence->Length();i++) - anInteractiveContext->Display (new AIS_Shape (aSequence->Value (i)), Standard_False); - anInteractiveContext->UpdateCurrentViewer(); -} - -Handle(TopTools_HSequenceOfShape) CImportExport::ReadIGES()// not by reference --> the sequence is created here !! -{ - CFileDialog dlg(TRUE, - NULL, - NULL, - OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"IGES Files (*.iges , *.igs)|*.iges; *.igs|All Files (*.*)|*.*||", - NULL ); - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\iges"); - -dlg.m_ofn.lpstrInitialDir = initdir; - - Handle(TopTools_HSequenceOfShape) aSequence = new TopTools_HSequenceOfShape(); - if (dlg.DoModal() == IDOK) - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - TCollection_AsciiString aFileName ((const wchar_t* )dlg.GetPathName()); - Standard_Integer status = ReadIGES (aFileName.ToCString(), aSequence); - if (status != IFSelect_RetDone) - { - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The file is not read", L"CasCade Error", MB_ICONERROR); - } - - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return aSequence; -} -//---------------------------------------------------------------------- - -Standard_Integer CImportExport::ReadIGES(const Standard_CString& aFileName, - Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - - IGESControl_Reader Reader; - - Standard_Integer status = Reader.ReadFile(aFileName); - - if (status != IFSelect_RetDone) return status; - Reader.TransferRoots(); - TopoDS_Shape aShape = Reader.OneShape(); - aHSequenceOfShape->Append(aShape); - - return status; -} -//---------------------------------------------------------------------- - -void CImportExport::SaveIGES(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - anInteractiveContext->InitSelected(); - if (anInteractiveContext->NbSelected() == 0){ - AfxMessageBox (L"No shape selected for export!"); - return; - } - Handle(Quantity_HArray1OfColor) anArrayOfColors; - Handle(TColStd_HArray1OfReal) anArrayOfTransparencies; - CImportExport::SaveIGES(BuildSequenceFromContext(anInteractiveContext, anArrayOfColors, anArrayOfTransparencies)); -} - -Standard_Boolean CImportExport::SaveIGES(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - if (aHSequenceOfShape->Length() == 0) - { - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"No Shape in the HSequence!!", L"CasCade Warning", MB_ICONWARNING); - return Standard_False; - } - - CFileDialog dlg(FALSE, L"*.iges",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"IGES Files (*.iges )|*.iges;|IGES Files (*.igs )| *.igs;||", NULL); - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\iges"); - -dlg.m_ofn.lpstrInitialDir = initdir; - - Standard_Boolean result=Standard_False; - if (dlg.DoModal() == IDOK) - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - - TCollection_AsciiString aFileName ((const wchar_t* )dlg.GetPathName()); - - result = SaveIGES (aFileName.ToCString(), aHSequenceOfShape); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return result; -} -//---------------------------------------------------------------------- - -Standard_Boolean CImportExport::SaveIGES(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - - IGESControl_Controller::Init(); - IGESControl_Writer ICW (Interface_Static::CVal("XSTEP.iges.unit"), - Interface_Static::IVal("XSTEP.iges.writebrep.mode")); - - for (Standard_Integer i=1;i<=aHSequenceOfShape->Length();i++) - ICW.AddShape (aHSequenceOfShape->Value(i)); - - ICW.ComputeModel(); - Standard_Boolean result = ICW.Write(aFileName ); - return result; -} - -//====================================================================== - -//====================================================================== -//= = -//= STEP = -//= = -//====================================================================== - -void CImportExport::ReadSTEP(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - Handle(TopTools_HSequenceOfShape) aSequence = CImportExport::ReadSTEP(); - if (!aSequence.IsNull()) { - for(int i=1;i<= aSequence->Length();i++) - anInteractiveContext->Display(new AIS_Shape(aSequence->Value(i)), Standard_False); - } -} - -Handle(TopTools_HSequenceOfShape) CImportExport::ReadSTEP()// not by reference --> the sequence is created here !! -{ - CFileDialog dlg(TRUE, - NULL, - NULL, - OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"STEP Files (*.stp;*.step)|*.stp; *.step|All Files (*.*)|*.*||", - NULL ); - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\step"); - -dlg.m_ofn.lpstrInitialDir = initdir; - - Handle(TopTools_HSequenceOfShape) aSequence= new TopTools_HSequenceOfShape(); - if (dlg.DoModal() == IDOK) - { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - TCollection_AsciiString aFileName ((const wchar_t* )dlg.GetPathName()); - IFSelect_ReturnStatus ReturnStatus = ReadSTEP (aFileName.ToCString(), aSequence); - switch (ReturnStatus) - { - case IFSelect_RetError : - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Not a valid Step file", L"ERROR", MB_ICONWARNING); - break; - case IFSelect_RetFail : - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Reading has failed", L"ERROR", MB_ICONWARNING); - break; - case IFSelect_RetVoid : - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Nothing to transfer", L"ERROR", MB_ICONWARNING); - break; - } - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return aSequence; -} - -IFSelect_ReturnStatus CImportExport::ReadSTEP(const Standard_CString& aFileName, - Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - aHSequenceOfShape->Clear(); - - // create additional log file - STEPControl_Reader aReader; - IFSelect_ReturnStatus status = aReader.ReadFile(aFileName); - if (status != IFSelect_RetDone) - return status; - - aReader.WS()->TransferReader()->TransientProcess()->SetTraceLevel(2); // increase default trace level - - Standard_Boolean failsonly = Standard_False; - aReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity); - - // Root transfers - Standard_Integer nbr = aReader.NbRootsForTransfer(); - aReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity); - for ( Standard_Integer n = 1; n<=nbr; n++) { - /*Standard_Boolean ok =*/ aReader.TransferRoot(n); - } - - // Collecting resulting entities - Standard_Integer nbs = aReader.NbShapes(); - if (nbs == 0) { - return IFSelect_RetVoid; - } - for (Standard_Integer i=1; i<=nbs; i++) { - aHSequenceOfShape->Append(aReader.Shape(i)); - } - - return status; -} - - -//---------------------------------------------------------------------- -void CImportExport::SaveSTEP(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - anInteractiveContext->InitSelected(); - if (anInteractiveContext->NbSelected() == 0){ - AfxMessageBox (L"No shape selected for export!"); - return; - } - Handle(Quantity_HArray1OfColor) anArrayOfColors; - Handle(TColStd_HArray1OfReal) anArrayOfTransparencies; - CImportExport::SaveSTEP(BuildSequenceFromContext(anInteractiveContext, anArrayOfColors, anArrayOfTransparencies)); -} - -// Return True if no error -Standard_Boolean TestFacetedBrep(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - Standard_Boolean OneErrorFound = Standard_False; - for (Standard_Integer i=1;i<=aHSequenceOfShape->Length();i++) - { - TopoDS_Shape aShape= aHSequenceOfShape->Value(i); - - TopExp_Explorer Ex(aShape,TopAbs_FACE); - while (Ex.More() && !OneErrorFound) - { - // Get the Geom_Surface outside the TopoDS_Face - Handle(Geom_Surface) aSurface = BRep_Tool::Surface(TopoDS::Face(Ex.Current())); - // check if it is a plane. - if (!aSurface->IsKind(STANDARD_TYPE(Geom_Plane))) - OneErrorFound=Standard_True; - Ex.Next(); - } - TopExp_Explorer Ex2(aShape,TopAbs_EDGE); - while (Ex2.More() && !OneErrorFound) - { - // Get the Geom_Curve outside the TopoDS_Face - Standard_Real FirstDummy,LastDummy; - Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(Ex2.Current()),FirstDummy,LastDummy); - // check if it is a line. - if (!aCurve->IsKind(STANDARD_TYPE(Geom_Line))) - OneErrorFound=Standard_True; - Ex2.Next(); - } - } - return !OneErrorFound; -} - -IFSelect_ReturnStatus CImportExport::SaveSTEP(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - if (aHSequenceOfShape->Length() == 0) - { - MessageBox (AfxGetApp()->m_pMainWnd->m_hWnd, L"No Shape in the HSequence!!", L"CasCade Warning", MB_ICONWARNING); - return IFSelect_RetError; - } - - IFSelect_ReturnStatus status = IFSelect_RetVoid; - - CFileSaveSTEPDialog aDlg(NULL); - - aDlg.m_Cc1ModelType = STEPControl_AsIs; - - if (aDlg.DoModal() == IDOK) { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - TCollection_AsciiString aFileName ((const wchar_t* )aDlg.GetPathName()); - - STEPControl_StepModelType selection = aDlg.m_Cc1ModelType; - - if(selection == STEPControl_FacetedBrep) - - if (!TestFacetedBrep(aHSequenceOfShape)) - { - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"At least one shape doesn't contain facetes", L"CasCade Warning", MB_ICONWARNING); - return IFSelect_RetError; - } - - - status = SaveSTEP (aFileName.ToCString(), aHSequenceOfShape, selection); - switch (status) - { - case IFSelect_RetError: - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Incorrect Data", L"ERROR", MB_ICONWARNING); - break; - case IFSelect_RetFail: - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Writing has failed", L"ERROR", MB_ICONWARNING); - break; - case IFSelect_RetVoid: - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Nothing to transfer", L"ERROR", MB_ICONWARNING); - break; - } - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return status; -} -//---------------------------------------------------------------------------------------- -IFSelect_ReturnStatus CImportExport::SaveSTEP(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - -const STEPControl_StepModelType aValue /* =TopoDSToCc1Act_ManifoldSolidBrep */ ) - -{ - // CREATE THE WRITER - - STEPControl_Writer aWriter; - - IFSelect_ReturnStatus status; - for (Standard_Integer i=1;i<=aHSequenceOfShape->Length();i++) - { - status = aWriter.Transfer(aHSequenceOfShape->Value(i), aValue); - if ( status != IFSelect_RetDone ) return status; - } - status = aWriter.Write(aFileName); - return status; -} - - - -//====================================================================== -//= = -//= STL = -//= = -//====================================================================== - -void CImportExport::SaveSTL(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - anInteractiveContext->InitSelected(); - if (anInteractiveContext->NbSelected() == 0){ - AfxMessageBox (L"No shape selected for export!"); - return; - } - Handle(Quantity_HArray1OfColor) anArrayOfColors; - Handle(TColStd_HArray1OfReal) anArrayOfTransparencies; - CImportExport::SaveSTL(BuildSequenceFromContext(anInteractiveContext, anArrayOfColors, anArrayOfTransparencies)); -} - -Standard_Boolean CImportExport::SaveSTL(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) -{ - CFileDialog dlg(FALSE, L"*.stl", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"stl Files (*.stl)|*.stl;|STL Files (*.STL)|*.STL;||", NULL); - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\stl"); - -dlg.m_ofn.lpstrInitialDir = initdir; - - Standard_Boolean result = Standard_False; - - if (dlg.DoModal() == IDOK) { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - TCollection_AsciiString aFileName ((const wchar_t* )dlg.GetPathName()); - TCollection_AsciiString Message; - result = SaveSTL (aFileName.ToCString(), aHSequenceOfShape, Message); - CString aMsg (TCollection_ExtendedString (Message).ToWideString()); - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, aMsg, result ? L"CasCade" : L"CasCade Error", result ? MB_OK : MB_ICONERROR); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return result; -} - -Standard_Boolean CImportExport::SaveSTL(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - TCollection_AsciiString& ReturnMessage) -{ - Standard_Boolean ReturnValue = Standard_True; - if (aHSequenceOfShape->Length() == 0) - { - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"No Shape in the HSequence!!", L"CasCade Warning", MB_ICONWARNING); - return Standard_False; - } - - ReturnMessage += "The Object have be saved in the file "; - ReturnMessage += aFileName; - ReturnMessage += "\n with the names : "; - - TopoDS_Compound RES; - BRep_Builder MKCP; - MKCP.MakeCompound(RES); - - for (Standard_Integer i=1;i<=aHSequenceOfShape->Length();i++) - { - TopoDS_Shape aShape= aHSequenceOfShape->Value(i); - TCollection_AsciiString anObjectName("anObjectName_"); - anObjectName += i; - ReturnMessage += anObjectName; - ReturnMessage += " \n"; - - if ( aShape.IsNull() ) - { - ReturnMessage += " Error : Invalid shape \n"; - ReturnValue = Standard_False; - continue; - } - - MKCP.Add(RES, aShape); - } - - StlAPI_Writer myStlWriter; - myStlWriter.Write(RES, aFileName); - - return ReturnValue; -} - - -//====================================================================== -//= = -//= VRML = -//= = -//====================================================================== - -void CImportExport::SaveVRML(const Handle(AIS_InteractiveContext)& anInteractiveContext) -{ - anInteractiveContext->InitSelected(); - if (anInteractiveContext->NbSelected() == 0){ - AfxMessageBox (L"No shape selected for export!"); - return; - } - Handle(Quantity_HArray1OfColor) anArrayOfColors; - Handle(TColStd_HArray1OfReal) anArrayOfTransparencies; - CImportExport::SaveVRML(BuildSequenceFromContext(anInteractiveContext, anArrayOfColors, anArrayOfTransparencies), - anArrayOfColors, anArrayOfTransparencies); -} - -Standard_Boolean CImportExport::SaveVRML(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - const Handle(Quantity_HArray1OfColor)& anArrayOfColors, - const Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies) -{ - CFileDialog dlg(FALSE, L"*.vrml", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - L"vrml Files (*.vrml)|*.vrml;|vrm Files (*.vrm)|*.vrm;||", NULL); - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\vrml"); - -dlg.m_ofn.lpstrInitialDir = initdir; - - Standard_Boolean result = Standard_False; - - if (dlg.DoModal() == IDOK) { - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - TCollection_AsciiString aFileName ((const wchar_t* )dlg.GetPathName()); - TCollection_AsciiString Message; - result = SaveVRML (aFileName.ToCString(), aHSequenceOfShape, anArrayOfColors, anArrayOfTransparencies, Message); - CString aMsg (TCollection_ExtendedString(Message).ToWideString()); - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, aMsg, result ? L"CasCade" : L"CasCade Error", result ? MB_OK : MB_ICONERROR); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } - return result; -} - -Standard_Boolean CImportExport::SaveVRML(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - const Handle(Quantity_HArray1OfColor)& anArrayOfColors, - const Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies, - TCollection_AsciiString& ReturnMessage) -{ - Standard_Boolean ReturnValue = Standard_True; - if (aHSequenceOfShape->Length() == 0) - { - MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"No Shape in the HSequence!!", L"CasCade Warning", MB_ICONWARNING); - return Standard_False; - } - - ReturnMessage += "The Object has been saved in the file "; - ReturnMessage += aFileName; - ReturnMessage += "\n with the names : "; - - // VRML scene. - VrmlData_Scene scene; - VrmlData_ShapeConvert converter(scene/*, 0.001*/); // from mm to meters - Standard_Integer iShape = 1; // Counter of shapes - - for (int i = 1; i <= aHSequenceOfShape->Length(); i++) - { - // Shape - TopoDS_Shape shape = aHSequenceOfShape->Value(i); - if (shape.IsNull()) - { - ReturnMessage += " Error : Invalid shape \n"; - ReturnValue = Standard_False; - continue; - } - - // Color - Quantity_Color color; // yellow - if (!anArrayOfColors.IsNull()) - color = anArrayOfColors->Value(i); - - // Transparency - Standard_Real transparency = 0.0; - if (!anArrayOfTransparencies.IsNull()) - transparency = anArrayOfTransparencies->Value(i); - - // Give a name to the shape. - TCollection_AsciiString name("Shape"); - name += TCollection_AsciiString(iShape++); - converter.AddShape(shape, name.ToCString()); - ReturnMessage += name; - ReturnMessage += '\n'; - - // Check presence of faces in the shape. - TopExp_Explorer expl(shape, TopAbs_FACE); - if (expl.More()) - converter.Convert(true, false, 0.01); // faces only - else - converter.Convert(false, true, 0.01); // edges only - - // Name of the color & transparency. - // It will be uniquely saved in VRML file. - TCollection_AsciiString cname = Quantity_Color::StringName(color.Name()); - cname += transparency; - - // Make the appearance (VRML attribute) - Handle(VrmlData_Appearance) appearance = Handle(VrmlData_Appearance)::DownCast(scene.FindNode(cname.ToCString())); - if (appearance.IsNull()) - { - // Not found ... create a new one. - Handle(VrmlData_Material) material = new VrmlData_Material(scene, cname.ToCString(), 0.2, 0.2, transparency); - material->SetDiffuseColor(color); - material->SetEmissiveColor(color); - material->SetSpecularColor(color); - scene.AddNode(material, false); - appearance = new VrmlData_Appearance(scene, cname.ToCString()); - appearance->SetMaterial(material); - scene.AddNode(appearance, false); - } - - // Apply the material to the shape of entity. - Handle(VrmlData_Group) group = Handle(VrmlData_Group)::DownCast(scene.FindNode(name.ToCString())); - if (!group.IsNull()) - { - VrmlData_ListOfNode::Iterator itr = group->NodeIterator(); - for (; itr.More(); itr.Next()) - { - Handle(VrmlData_Node) node = itr.Value(); - if (node->DynamicType() == STANDARD_TYPE(VrmlData_ShapeNode)) - { - Handle(VrmlData_ShapeNode) aShape = Handle(VrmlData_ShapeNode)::DownCast(node); - aShape->SetAppearance(appearance); - } - else if (itr.Value()->DynamicType() == STANDARD_TYPE(VrmlData_Group)) - { - Handle(VrmlData_Group) groupc = Handle(VrmlData_Group)::DownCast(itr.Value()); - VrmlData_ListOfNode::Iterator itrc = groupc->NodeIterator(); - for (; itrc.More(); itrc.Next()) - { - Handle(VrmlData_Node) nodec = itrc.Value(); - if (nodec->DynamicType() == STANDARD_TYPE(VrmlData_ShapeNode)) - { - Handle(VrmlData_ShapeNode) shapec = Handle(VrmlData_ShapeNode)::DownCast(nodec); - shapec->SetAppearance(appearance); - } - } // for of group nodes... - } // if (it is a shape node... - } // for of group nodes... - } // if (!group.IsNull... - } // iterator of shapes - - // Call VRML writer - std::ofstream writer(aFileName); - writer<Length();i++) - { - TopoDS_Shape aShape= aHSequenceOfShape->Value(i); - TCollection_AsciiString anObjectName("anObjectName_"); - anObjectName += i; - ReturnMessage += anObjectName; - ReturnMessage += " \n"; - - if ( aShape.IsNull() ) - { - ReturnMessage += " Error : Invalid shape \n"; - ReturnValue = Standard_False; - continue; - } - - MKCP.Add(RES, aShape); - } - - VrmlAPI_Writer myVrmlWriter; - myVrmlWriter.Write(RES, aFileName); - */ - - return ReturnValue; -} - - - - diff --git a/samples/mfc/standard/Common/ImportExport/ImportExport.h b/samples/mfc/standard/Common/ImportExport/ImportExport.h deleted file mode 100755 index 92f35c3a7e..0000000000 --- a/samples/mfc/standard/Common/ImportExport/ImportExport.h +++ /dev/null @@ -1,97 +0,0 @@ -// ImportExport.h: interface for the CImportExport class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_IMPORTEXPORT_H__BAA02E6B_A948_11D1_8DA6_0800369C8A03__INCLUDED_) -#define AFX_IMPORTEXPORT_H__BAA02E6B_A948_11D1_8DA6_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include -#include -#include -#include - -#include - -class Standard_EXPORT CImportExport -{ -public: - - CImportExport() {}; - virtual ~CImportExport(){}; - -private : - static Handle(TopTools_HSequenceOfShape) - BuildSequenceFromContext(const Handle(AIS_InteractiveContext)& anInteractiveContext, - Handle(Quantity_HArray1OfColor)& anArrayOfColors, - Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies); - -public : - - //====================================================================== - // return is HSequence to be able to select a set of files - static int ReadBREP(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static Handle(TopTools_HSequenceOfShape) ReadBREP(); - static Standard_Boolean ReadBREP(CString aFileName, - TopoDS_Shape& aShape); - - //---------------------------------------------------------------------- - static void SaveBREP(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static Standard_Boolean SaveBREP(const TopoDS_Shape& aShape); - static Standard_Boolean SaveBREP(CString aFileName, - const TopoDS_Shape& aShape); - - //====================================================================== - - static void ReadIGES(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static Handle(TopTools_HSequenceOfShape) ReadIGES(); // not by reference --> the sequence is created here !! - static Standard_Integer ReadIGES(const Standard_CString& aFileName, - Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - //---------------------------------------------------------------------- - static void SaveIGES(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static Standard_Boolean SaveIGES(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - static Standard_Boolean SaveIGES(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - - //====================================================================== - - static void ReadSTEP(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static Handle(TopTools_HSequenceOfShape) ReadSTEP(); // not by reference --> the sequence is created here !! - static IFSelect_ReturnStatus ReadSTEP(const Standard_CString& aFileName, - Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - //---------------------------------------------------------------------- - static void SaveSTEP(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static IFSelect_ReturnStatus SaveSTEP(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - static IFSelect_ReturnStatus SaveSTEP(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - - const STEPControl_StepModelType aValue = STEPControl_AsIs); - - static void ReadSAT(const Handle(AIS_InteractiveContext)& anInteractiveContext); - static Handle(TopTools_HSequenceOfShape) ReadSAT(); // not by reference --> the sequence is created here !! - static IFSelect_ReturnStatus ReadSAT(const Standard_CString& aFileName, - Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - //---------------------------------------------------------------------- - static Standard_Boolean SaveSTL(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - TCollection_AsciiString& ReturnMessage); - static Standard_Boolean SaveSTL(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape); - static void SaveSTL(const Handle(AIS_InteractiveContext)& anInteractiveContext); - //---------------------------------------------------------------------- - static Standard_Boolean SaveVRML(const Standard_CString& aFileName, - const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - const Handle(Quantity_HArray1OfColor)& anArrayOfColors, - const Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies, - TCollection_AsciiString& ReturnMessage); - static Standard_Boolean SaveVRML(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape, - const Handle(Quantity_HArray1OfColor)& anArrayOfColors, - const Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies); - static void SaveVRML(const Handle(AIS_InteractiveContext)& anInteractiveContext); - -}; - -#endif // !defined(AFX_IMPORTEXPORT_H__BAA02E6B_A948_11D1_8DA6_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.cpp b/samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.cpp deleted file mode 100755 index af26513a94..0000000000 --- a/samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// FileSaveStepDialog.cpp : implementation file -// - -#include "stdafx.h" - -#include "SaveSTEPDlg.h" - -///////////////////////////////////////////////////////////////////////////// -// CFileSaveSTEPDialog dialog - - -CFileSaveSTEPDialog::CFileSaveSTEPDialog(CWnd* pParent /*=NULL*/) - : CFileDialog(FALSE,_T("*.STEP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - _T("STEP Files (*.step)|*.step;|STEP Files (*.stp)|*.stp;||"), - pParent -#if (_MSC_VER < 1500) - ) -#else - ,0,0) -#endif - - -//dlg.m_ofn.lpstrInitialDir = initdir; - -{ - //{{AFX_DATA_INIT(CFileSaveSTEPDialog) - m_Cc1ModelType = STEPControl_AsIs; - //}}AFX_DATA_INIT - -CString SHAREPATHValue; -SHAREPATHValue.GetEnvironmentVariable (L"CSF_OCCTDataPath"); -CString initdir = (SHAREPATHValue + "\\step"); - - m_ofn.lpstrInitialDir = initdir; - m_ofn.Flags |= OFN_ENABLETEMPLATE; - m_ofn.lpTemplateName = MAKEINTRESOURCE(CFileSaveSTEPDialog::IDD); - m_ofn.lpstrTitle = _T("Save as STEP File"); -} - -void CFileSaveSTEPDialog::DoDataExchange(CDataExchange* pDX) -{ - CFileDialog::DoDataExchange(pDX); - if (!pDX->m_bSaveAndValidate) - { - m_DialogType = m_Cc1ModelType; - } - - //{{AFX_DATA_MAP(CFileSaveSTEPDialog) - DDX_Control(pDX, IDC_FSaveSTEP_Type, m_SaveTypeCombo); - DDX_CBIndex(pDX, IDC_FSaveSTEP_Type, m_DialogType ); - //}}AFX_DATA_MAP - - if (pDX->m_bSaveAndValidate) - { - m_Cc1ModelType = (STEPControl_StepModelType)m_DialogType; - } -} - -BEGIN_MESSAGE_MAP(CFileSaveSTEPDialog, CFileDialog) - //{{AFX_MSG_MAP(CFileSaveSTEPDialog) - ON_WM_CLOSE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CFileSaveSTEPDialog message handlers - -BOOL CFileSaveSTEPDialog::OnInitDialog() -{ - BOOL bRet = CFileDialog::OnInitDialog(); - - m_SaveTypeCombo.InsertString(-1, L"As Is"); - m_SaveTypeCombo.InsertString(-1, L"Manifold Solid BRep"); - m_SaveTypeCombo.InsertString(-1, L"BRep With Voids"); - m_SaveTypeCombo.InsertString(-1, L"Faceted BRep"); - m_SaveTypeCombo.InsertString(-1, L"Faceted BRep With Voids"); - m_SaveTypeCombo.InsertString(-1, L"Shell Based Surface Model"); - m_SaveTypeCombo.InsertString(-1, L"Geometric Curve Set"); - m_SaveTypeCombo.SetCurSel(m_DialogType); - - return bRet; -} - -BOOL CFileSaveSTEPDialog::OnFileNameOK() -{ - ASSERT_VALID(this); - UpdateData(TRUE); - - // Do not call Default() if you override - return FALSE; -} diff --git a/samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.h b/samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.h deleted file mode 100755 index 2174e5ac7d..0000000000 --- a/samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.h +++ /dev/null @@ -1,56 +0,0 @@ -#if !defined(AFX_FILESAVESTEPDIALOG_H__B7D13C78_AB88_11D1_B97B_444553540000__INCLUDED_) -#define AFX_FILESAVESTEPDIALOG_H__B7D13C78_AB88_11D1_B97B_444553540000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// FileSaveIgesDialog.h : header file -// - -#include "STEPControl_StepModelType.hxx" - -#include - -#include - -///////////////////////////////////////////////////////////////////////////// -// CFileSaveSTEPDialog dialog - -class Standard_EXPORT CFileSaveSTEPDialog : public CFileDialog -{ -// Construction -public: - CFileSaveSTEPDialog(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CFileSaveSTEPDialog) - enum { IDD = IDD_FILESAVESTEP }; - CComboBox m_SaveTypeCombo; - - STEPControl_StepModelType m_Cc1ModelType; - - int m_DialogType; - //}}AFX_DATA - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CFileSaveSTEPDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnFileNameOK(); - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CFileSaveSTEPDialog) - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_FILESAVESTEPDIALOG_H__B7D13C78_AB88_11D1_B97B_444553540000__INCLUDED_) diff --git a/samples/mfc/standard/Common/LengthParamsEdgePage.cpp b/samples/mfc/standard/Common/LengthParamsEdgePage.cpp deleted file mode 100644 index 89c90ce6eb..0000000000 --- a/samples/mfc/standard/Common/LengthParamsEdgePage.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// LengthParamsEdgePage.cpp : implementation file -// - -#include "stdafx.h" -#include "LengthParamsEdgePage.h" -#include "DimensionDlg.h" - -#include -#include -#include -#include -#include - -// CLengthParamsEdgePage dialog - -IMPLEMENT_DYNAMIC(CLengthParamsEdgePage, CDialog) - -//======================================================================= -//function : CLengthParamsEdgePage -//purpose : -//======================================================================= - -CLengthParamsEdgePage::CLengthParamsEdgePage (Handle(AIS_InteractiveContext) theContext,CWnd* pParent /*=NULL*/) -: CDialog (CLengthParamsEdgePage::IDD, pParent) -{ - myAISContext = theContext; -} - -//======================================================================= -//function : ~CLengthParamsEdgePage -//purpose : -//======================================================================= - -CLengthParamsEdgePage::~CLengthParamsEdgePage() -{ -} - -//======================================================================= -//function : DoDataExchange -//purpose : -//======================================================================= - -void CLengthParamsEdgePage::DoDataExchange (CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); -} - -BEGIN_MESSAGE_MAP (CLengthParamsEdgePage, CDialog) - ON_BN_CLICKED (IDC_ChooseEdgeBtn, &CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn) -END_MESSAGE_MAP() - -//======================================================================= -//function : GetButton -//purpose : -//======================================================================= - -CButton* CLengthParamsEdgePage::GetButton() -{ - return (CButton*)GetDlgItem (IDC_ChooseEdgeBtn); -} - -//======================================================================= -//function : OnBnClickedChooseEdgeBtn -//purpose : -//======================================================================= - -void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn() -{ - myAISContext->InitSelected(); - - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE) - { - AfxMessageBox ( _T("Choose the edge and press the button again"), MB_ICONINFORMATION | MB_OK); - return; - } - - TopoDS_Shape aSelShape = myAISContext->SelectedShape(); - const TopoDS_Edge& anEdge = TopoDS::Edge (aSelShape); - - myAISContext->ClearSelected (Standard_False); - TopoDS_Vertex aFirstVertex, aSecondVertex; - TopExp::Vertices (TopoDS::Edge (anEdge), aFirstVertex, aSecondVertex); - - gp_Pnt aP1 = BRep_Tool::Pnt (aFirstVertex); - gp_Pnt aP2 = BRep_Tool::Pnt (aSecondVertex); - gp_Pnt aP3 (aP2.X() + 10, aP2.Y() + 10, aP2.Z() + 10); - - GC_MakePlane aMkPlane (aP1,aP2,aP3); - Handle(Geom_Plane) aPlane = aMkPlane.Value(); - - CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner()); - - Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (TopoDS::Edge (anEdge), aPlane->Pln()); - Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); - anAspect->MakeArrows3d (Standard_False); - anAspect->MakeText3d (aDimDlg->GetTextType()); - anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight()); - anAspect->MakeTextShaded (aDimDlg->IsText3dShaded()); - anAspect->SetCommonColor (aDimDlg->GetDimensionColor()); - anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (aDimDlg->IsUnitsDisplayed()) - { - aLenDim->SetDisplayUnits (aDimDlg->GetUnits()); - } - - aLenDim->SetDimensionAspect (anAspect); - aLenDim->SetFlyout (aDimDlg->GetFlyout()); - - myAISContext->Display (aLenDim, Standard_True); - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); -} diff --git a/samples/mfc/standard/Common/LengthParamsEdgePage.h b/samples/mfc/standard/Common/LengthParamsEdgePage.h deleted file mode 100755 index 1594ba5452..0000000000 --- a/samples/mfc/standard/Common/LengthParamsEdgePage.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "res\OCC_Resource.h" -#include -#include - -// CLengthParamsEdgePage dialog - -class CLengthParamsEdgePage : public CDialog -{ - DECLARE_DYNAMIC(CLengthParamsEdgePage) - -public: - CLengthParamsEdgePage(Handle(AIS_InteractiveContext) theAISContext,CWnd* pParent = NULL); // standard constructor - virtual ~CLengthParamsEdgePage(); - CButton* GetButton(); - -// Dialog Data - enum { IDD = IDD_LengthParamsEdgePage }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -private: - Handle(AIS_InteractiveContext) myAISContext; -public: - afx_msg void OnBnClickedChooseEdgeBtn(); -}; diff --git a/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp b/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp deleted file mode 100644 index 6a2814888f..0000000000 --- a/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// LenghtParamsEdgesPage.cpp : implementation file -// - -#include "stdafx.h" -#include "LengthParamsEdgesPage.h" -#include "DimensionDlg.h" -#include -#include -#include -#include -// CLengthParamsEdgesPage dialog - -//======================================================================= -//function : CLengthParamsEdgesPage -//purpose : -//======================================================================= - -CLengthParamsEdgesPage::CLengthParamsEdgesPage (Handle(AIS_InteractiveContext) theAISContext, - bool isAngleDimension /*= false*/, - CWnd* pParent /*=NULL*/) -: CDialog(CLengthParamsEdgesPage::IDD, pParent) -{ - myAISContext = theAISContext; - myIsAngleDimension = isAngleDimension; -} - -//======================================================================= -//function : ~CLengthParamsEdgesPage -//purpose : -//======================================================================= - -CLengthParamsEdgesPage::~CLengthParamsEdgesPage() -{ -} - -//======================================================================= -//function : DoDataExchange -//purpose : -//======================================================================= - -void CLengthParamsEdgesPage::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); -} - - -BEGIN_MESSAGE_MAP(CLengthParamsEdgesPage, CDialog) - ON_BN_CLICKED(IDC_BUTTON1, &CLengthParamsEdgesPage::OnBnClickedEdge1Btn) - ON_BN_CLICKED(IDC_BUTTON3, &CLengthParamsEdgesPage::OnBnClickedEdge2Btn) -END_MESSAGE_MAP() - - -//======================================================================= -//function : OnBnClickedEdge1Btn -//purpose : -//======================================================================= - -void CLengthParamsEdgesPage::OnBnClickedEdge1Btn() -{ - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); - - // Now it's ok, edge selection mode is activated - // Check if some edge is selected - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE) - { - AfxMessageBox(_T("Choose the edge and press the button again"), - MB_ICONINFORMATION | MB_OK); - return; - } - - myFirstEdge = TopoDS::Edge (myAISContext->SelectedShape()); - - myAISContext->ClearSelected (Standard_True); -} - -//======================================================================= -//function : OnBnClickedEdge2Btn -//purpose : -//======================================================================= - -void CLengthParamsEdgesPage::OnBnClickedEdge2Btn() -{ - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE) - { - AfxMessageBox (_T("Choose the edge and press the button again"), - MB_ICONINFORMATION | MB_OK); - return; - } - - mySecondEdge = TopoDS::Edge (myAISContext->SelectedShape()); - - myAISContext->ClearSelected (Standard_True); - - // Build plane through three points - BRepAdaptor_Curve aCurve1 (myFirstEdge); - BRepAdaptor_Curve aCurve2 (mySecondEdge); - - gp_Pnt aP1=aCurve1.Value (0.1); - gp_Pnt aP2=aCurve1.Value (0.9); - gp_Pnt aP3=aCurve2.Value (0.5); - - GC_MakePlane aMkPlane (aP1,aP2,aP3); - - Handle(Geom_Plane) aPlane = aMkPlane.Value(); - - CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner()); - - Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); - anAspect->MakeArrows3d (Standard_False); - anAspect->MakeText3d (aDimDlg->GetTextType()); - anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight()); - anAspect->MakeTextShaded (aDimDlg->IsText3dShaded()); - anAspect->SetCommonColor (aDimDlg->GetDimensionColor()); - anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (myIsAngleDimension) - { - // Build an angle dimension between two non-parallel edges - Handle(PrsDim_AngleDimension) anAngleDim = new PrsDim_AngleDimension (myFirstEdge, mySecondEdge); - anAngleDim->SetDimensionAspect (anAspect); - anAngleDim->DimensionAspect()->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (aDimDlg->IsUnitsDisplayed()) - { - anAngleDim->SetDisplayUnits (aDimDlg->GetUnits ()); - if ((anAngleDim->GetDisplayUnits().IsEqual (TCollection_AsciiString ("deg")))) - { - anAngleDim->DimensionAspect()->MakeUnitsDisplayed (Standard_False); - } - else - { - anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No); - } - } - - anAngleDim->SetFlyout (aDimDlg->GetFlyout()); - myAISContext->Display (anAngleDim, Standard_True); - } - else - { - Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (myFirstEdge, mySecondEdge, aPlane->Pln()); - aLenDim->SetDimensionAspect (anAspect); - aLenDim->SetFlyout (aDimDlg->GetFlyout()); - if (aDimDlg->IsUnitsDisplayed()) - { - aLenDim->SetDisplayUnits (aDimDlg->GetUnits()); - } - - myAISContext->Display (aLenDim, Standard_True); - } - - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); -} diff --git a/samples/mfc/standard/Common/LengthParamsEdgesPage.h b/samples/mfc/standard/Common/LengthParamsEdgesPage.h deleted file mode 100755 index aa9b37b91b..0000000000 --- a/samples/mfc/standard/Common/LengthParamsEdgesPage.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include "res\OCC_Resource.h" - -// CLenghtParamsEdgesPage dialog - -class CLengthParamsEdgesPage : public CDialog -{ -private: - Handle(AIS_InteractiveContext) myAISContext; - bool myIsAngleDimension; - TopoDS_Edge myFirstEdge; - TopoDS_Edge mySecondEdge; -public: - CLengthParamsEdgesPage (Handle(AIS_InteractiveContext) theAISContext, - bool isAngleDimension = false, - CWnd* pParent = NULL); // standard constructor - virtual ~CLengthParamsEdgesPage(); - -// Dialog Data - enum { IDD = IDD_LengthParamsEdgesPage }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedEdge1Btn(); - afx_msg void OnBnClickedEdge2Btn(); -}; diff --git a/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp b/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp deleted file mode 100644 index 6b00519e24..0000000000 --- a/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// LengthParamsVerticesPage.cpp : implementation file -// - -#include "stdafx.h" -#include "LengthParamsVerticesPage.h" -#include "DimensionDlg.h" -#include -#include -#include -#include - - -// CLengthParamsVerticesPage dialog - -IMPLEMENT_DYNAMIC(CLengthParamsVerticesPage, CDialog) - -//======================================================================= -//function : CLengthParamsVerticesPage -//purpose : -//======================================================================= - -CLengthParamsVerticesPage::CLengthParamsVerticesPage (Handle(AIS_InteractiveContext) theAISContext, CWnd* pParent /*=NULL*/) -: CDialog (CLengthParamsVerticesPage::IDD, pParent) -{ - myAISContext = theAISContext; -} - -//======================================================================= -//function : ~CLengthParamsVerticesPage -//purpose : -//======================================================================= - -CLengthParamsVerticesPage::~CLengthParamsVerticesPage() -{ -} - -//======================================================================= -//function : DoDataExchange -//purpose : -//======================================================================= - -void CLengthParamsVerticesPage::DoDataExchange (CDataExchange* pDX) -{ - CDialog::DoDataExchange (pDX); -} - - -BEGIN_MESSAGE_MAP(CLengthParamsVerticesPage, CDialog) - ON_BN_CLICKED(IDC_BUTTON1, &CLengthParamsVerticesPage::OnBnClickedVertex1Btn) - ON_BN_CLICKED(IDC_BUTTON2, &CLengthParamsVerticesPage::OnBnClickedVertex2Btn) -END_MESSAGE_MAP() - - -//======================================================================= -//function : OnBnClickedVertex1Btn -//purpose : -//======================================================================= - -void CLengthParamsVerticesPage::OnBnClickedVertex1Btn() -{ - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX)); - - // Now it's ok, edge selection mode is activated - // Check if some edge is selected - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX) - { - AfxMessageBox (_T ("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK); - return; - } - - myFirstVertex = TopoDS::Vertex (myAISContext->SelectedShape()); - - myAISContext->ClearSelected (Standard_True); -} - -//======================================================================= -//function : OnBnClickedVertex2Btn -//purpose : -//======================================================================= - -void CLengthParamsVerticesPage::OnBnClickedVertex2Btn() -{ - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX) - { - AfxMessageBox (_T ("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK); - return; - } - - mySecondVertex = TopoDS::Vertex (myAISContext->SelectedShape()); - myAISContext->ClearSelected (Standard_False); - - //Build dimension here - gp_Pnt aP1=BRep_Tool::Pnt (myFirstVertex); - gp_Pnt aP2=BRep_Tool::Pnt (mySecondVertex); - gp_Pnt aP3 (aP2.X() + 10, aP2.Y() + 10, aP2.Z() + 10); - - GC_MakePlane aMkPlane (aP1,aP2,aP3); - Handle(Geom_Plane) aPlane = aMkPlane.Value(); - - CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner()); - - Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (aP1, aP2, aPlane->Pln()); - - Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); - anAspect->MakeArrows3d (Standard_False); - anAspect->MakeText3d (aDimDlg->GetTextType()); - anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight()); - anAspect->MakeTextShaded (aDimDlg->IsText3dShaded()); - anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (aDimDlg->IsUnitsDisplayed()) - { - aLenDim->SetDisplayUnits (aDimDlg->GetUnits ()); - } - - aLenDim->SetDimensionAspect (anAspect); - aLenDim->SetFlyout (aDimDlg->GetFlyout()); - - myAISContext->Display (aLenDim, Standard_True); - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX)); -} - -//======================================================================= -//function : getFirstVertex -//purpose : -//======================================================================= - -const TopoDS_Vertex& CLengthParamsVerticesPage::getFirstVertex() const -{ - return myFirstVertex; -} - -//======================================================================= -//function : getSecondVertex -//purpose : -//======================================================================= - -const TopoDS_Vertex& CLengthParamsVerticesPage::getSecondVertex() const -{ - return mySecondVertex; -} diff --git a/samples/mfc/standard/Common/LengthParamsVerticesPage.h b/samples/mfc/standard/Common/LengthParamsVerticesPage.h deleted file mode 100755 index 315dc323ff..0000000000 --- a/samples/mfc/standard/Common/LengthParamsVerticesPage.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "res\OCC_Resource.h" - -// CLengthParamsVerticesPage dialog - -class CLengthParamsVerticesPage : public CDialog -{ - DECLARE_DYNAMIC(CLengthParamsVerticesPage) - -public: - CLengthParamsVerticesPage(Handle(AIS_InteractiveContext) theAISContext,CWnd* pParent = NULL); // standard constructor - virtual ~CLengthParamsVerticesPage(); - const TopoDS_Vertex& getFirstVertex() const; - const TopoDS_Vertex& getSecondVertex() const; -// Dialog Data - enum { IDD = IDD_LengthParamsVerticesPage }; -private: - Handle(AIS_InteractiveContext) myAISContext; - TopoDS_Vertex myFirstVertex; - TopoDS_Vertex mySecondVertex; -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedVertex1Btn(); - afx_msg void OnBnClickedVertex2Btn(); -}; diff --git a/samples/mfc/standard/Common/OCC_2dChildFrame.cpp b/samples/mfc/standard/Common/OCC_2dChildFrame.cpp deleted file mode 100755 index 48a19223dc..0000000000 --- a/samples/mfc/standard/Common/OCC_2dChildFrame.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// OCC_2dChildFrame.cpp: implementation of the OCC_2dChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "OCC_2dChildFrame.h" - -#include "res\OCC_Resource.h" - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -IMPLEMENT_DYNCREATE (OCC_2dChildFrame, CMDIChildWnd) - -BEGIN_MESSAGE_MAP(OCC_2dChildFrame, CMDIChildWnd) - //{{AFX_MSG_MAP(OCC_2dChildFrame) - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -OCC_2dChildFrame::OCC_2dChildFrame() -{ - -} - -OCC_2dChildFrame::~OCC_2dChildFrame() -{ - -} - -int OCC_2dChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_2dCHILDFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); - - return 0; -} - -BOOL OCC_2dChildFrame::PreCreateWindow(CREATESTRUCT& cs) -{ - // TODO: Add your specialized code here and/or call the base class - - return CMDIChildWnd::PreCreateWindow(cs); -} diff --git a/samples/mfc/standard/Common/OCC_2dChildFrame.h b/samples/mfc/standard/Common/OCC_2dChildFrame.h deleted file mode 100755 index cec6bf57d5..0000000000 --- a/samples/mfc/standard/Common/OCC_2dChildFrame.h +++ /dev/null @@ -1,37 +0,0 @@ -// OCC_2dChildFrame.h: interface for the OCC_2dChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_2DCHILDFRAME_H__84879CFB_7EE3_11D7_8632_0060B0EE281E__INCLUDED_) -#define AFX_OCC_2DCHILDFRAME_H__84879CFB_7EE3_11D7_8632_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_BaseChildFrame.h" - -class Standard_EXPORT OCC_2dChildFrame : public OCC_BaseChildFrame -{ - DECLARE_DYNCREATE(OCC_2dChildFrame) -public: - OCC_2dChildFrame(); - virtual ~OCC_2dChildFrame(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(OCC_2dChildFrame) - protected: - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - //}}AFX_VIRTUAL - -// Generated message map functions - //{{AFX_MSG(OCC_2dChildFrame) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() - -}; - -#endif // !defined(AFX_OCC_2DCHILDFRAME_H__84879CFB_7EE3_11D7_8632_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_2dDoc.cpp b/samples/mfc/standard/Common/OCC_2dDoc.cpp deleted file mode 100755 index 6899cb9a81..0000000000 --- a/samples/mfc/standard/Common/OCC_2dDoc.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// OCC_2dDoc.cpp: implementation of the OCC_2dDoc class. -// -////////////////////////////////////////////////////////////////////// - -#include - -#include "OCC_2dDoc.h" - -#include "OCC_App.h" -#include "OCC_2dView.h" - -IMPLEMENT_DYNCREATE(OCC_2dDoc, CDocument) - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -OCC_2dDoc::OCC_2dDoc() : OCC_BaseDoc() -{ - // Get the Graphic Driver from the application - Handle(Graphic3d_GraphicDriver) aGraphicDriver = ((OCC_App*)AfxGetApp())->GetGraphicDriver(); - - // create the Viewer - myViewer = new V3d_Viewer (aGraphicDriver); - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - myViewer->SetDefaultViewProj (V3d_Zpos); - - // set default values for grids - myViewer->SetCircularGridValues (0, 0, 10, 8, 0); - myViewer->SetRectangularGridValues (0, 0, 10, 10, 0); - - myAISContext = new AIS_InteractiveContext (myViewer); - - AfxInitRichEdit(); -} - -OCC_2dDoc::~OCC_2dDoc() -{ -} - -void OCC_2dDoc::FitAll2DViews(Standard_Boolean theUpdateViewer) -{ - if (theUpdateViewer) - { - myViewer->Update(); - } - - POSITION aPosition = GetFirstViewPosition(); - while (aPosition != (POSITION)NULL) - { - OCC_2dView* aCurrentView = (OCC_2dView*)GetNextView (aPosition); - ASSERT_VALID (aCurrentView); - aCurrentView->GetView()->FitAll(); - } -} - -void OCC_2dDoc::Popup (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) -{ - // load the 'normal' popup - CMenu aMenu; - VERIFY(aMenu.LoadMenu(IDR_Popup2D)); - // activate the sub menu '0' - CMenu* aPopup = aMenu.GetSubMenu(0); - ASSERT(aPopup != NULL); - - // display the popup - POINT aWinCoord = { theMouseX, theMouseY }; - ClientToScreen ((HWND )theView->Window()->NativeHandle(), &aWinCoord); - aPopup->TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON, aWinCoord.x, aWinCoord.y, AfxGetMainWnd()); -} diff --git a/samples/mfc/standard/Common/OCC_2dDoc.h b/samples/mfc/standard/Common/OCC_2dDoc.h deleted file mode 100755 index 59a14761d0..0000000000 --- a/samples/mfc/standard/Common/OCC_2dDoc.h +++ /dev/null @@ -1,38 +0,0 @@ -// OCC_2dDoc.h: interface for the OCC_2dDoc class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_2dDOC_H__2E048CC7_38F9_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_2dDOC_H__2E048CC7_38F9_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_BaseDoc.h" -#include "ResultDialog.h" -#include - -// Mouse and clipboard event tracker for OCC_2dView -// NO 3D operation are supported (like rotation) -class Standard_EXPORT OCC_2dDoc : public OCC_BaseDoc -{ - DECLARE_DYNCREATE(OCC_2dDoc) - -public: - - OCC_2dDoc(); - ~OCC_2dDoc(); - -public: // New operations - - void FitAll2DViews(Standard_Boolean theUpdateViewer = Standard_False); - -public: // Operations to override - - virtual void Popup (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) Standard_OVERRIDE; -}; - -#endif // !defined(AFX_OCC_2dDOC_H__2E048CC7_38F9_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_2dView.cpp b/samples/mfc/standard/Common/OCC_2dView.cpp deleted file mode 100755 index f127c5b510..0000000000 --- a/samples/mfc/standard/Common/OCC_2dView.cpp +++ /dev/null @@ -1,299 +0,0 @@ -// OCC_2dView.cpp: implementation of the OCC_2dView class. -// -////////////////////////////////////////////////////////////////////// -#include "stdafx.h" - -#include "OCC_2dView.h" - -#include "OCC_App.h" -#include "OCC_2dDoc.h" -#include "resource2d\RectangularGrid.h" -#include "resource2d\CircularGrid.h" - -#include "Quantity_Color.hxx" -#include "Quantity_NameOfColor.hxx" - -///////////////////////////////////////////////////////////////////////////// -// OCC_2dView - -IMPLEMENT_DYNCREATE(OCC_2dView, OCC_BaseView) - -BEGIN_MESSAGE_MAP(OCC_2dView, OCC_BaseView) - //{{AFX_MSG_MAP(OCC_2dView) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage) - ON_COMMAND(ID_BUTTON2DGridRectLines, OnBUTTONGridRectLines) - ON_COMMAND(ID_BUTTON2DGridRectPoints, OnBUTTONGridRectPoints) - ON_COMMAND(ID_BUTTON2DGridCircLines, OnBUTTONGridCircLines) - ON_COMMAND(ID_BUTTON2DGridCircPoints, OnBUTTONGridCircPoints) - ON_COMMAND(ID_BUTTON2DGridValues, OnBUTTONGridValues) - ON_UPDATE_COMMAND_UI(ID_BUTTON2DGridValues, OnUpdateBUTTONGridValues) - ON_COMMAND(ID_BUTTON2DGridCancel, OnBUTTONGridCancel) - ON_UPDATE_COMMAND_UI(ID_BUTTON2DGridCancel, OnUpdateBUTTONGridCancel) - ON_WM_SIZE() - ON_COMMAND(ID_BUTTON2DFitAll, OnBUTTONFitAll) - ON_COMMAND(ID_BUTTON2DGlobPanning, OnBUTTONGlobPanning) - ON_COMMAND(ID_BUTTON2DPanning, OnBUTTONPanning) - ON_COMMAND(ID_BUTTON2DZoomProg, OnBUTTONZoomProg) - ON_COMMAND(ID_BUTTON2DZoomWin, OnBUTTONZoomWin) - ON_UPDATE_COMMAND_UI(ID_BUTTON2DGlobPanning, OnUpdateBUTTON2DGlobPanning) - ON_UPDATE_COMMAND_UI(ID_BUTTON2DPanning, OnUpdateBUTTON2DPanning) - ON_UPDATE_COMMAND_UI(ID_BUTTON2DZoomProg, OnUpdateBUTTON2DZoomProg) - ON_UPDATE_COMMAND_UI(ID_BUTTON2DZoomWin, OnUpdateBUTTON2DZoomWin) - ON_COMMAND(ID_Modify_ChangeBackground ,OnChangeBackground) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// OCC_2dView construction/destruction - -OCC_2dView::OCC_2dView() -{ - myToAllowRotation = false; - myDefaultGestures.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_SelectRectangle); - myMouseGestureMap = myDefaultGestures; -} - -OCC_2dView::~OCC_2dView() -{ - // -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_2dView drawing - -void OCC_2dView::OnInitialUpdate() -{ - OCC_BaseView::OnInitialUpdate(); - - // initialize the grids dialogs - TheRectangularGridDialog.Create(CRectangularGrid::IDD, NULL); - TheCircularGridDialog.Create(CCircularGrid::IDD, NULL); - TheRectangularGridDialog.SetViewer (myView->Viewer()); - TheCircularGridDialog.SetViewer (myView->Viewer()); -} - -void OCC_2dView::OnFileExportImage() -{ - GetDocument()->ExportView (myView); -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_2dView diagnostics - -#ifdef _DEBUG -void OCC_2dView::AssertValid() const -{ - CView::AssertValid(); -} - -void OCC_2dView::Dump(CDumpContext& dc) const -{ - CView::Dump(dc); -} - -OCC_2dDoc* OCC_2dView::GetDocument() // non-debug version is inline -{ - //ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_2dDoc))); - return (OCC_2dDoc*)m_pDocument; -} -#endif //_DEBUG -void OCC_2dView::OnBUTTONGridRectLines() -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2); - aViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth=0, aHeight=0, anOffset=0; - myView->Window()->Size(aWidth,aHeight); - aViewer->SetRectangularGridGraphicValues(aWidth,aHeight,anOffset); - aViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Lines); - FitAll(); - - if (TheCircularGridDialog.IsWindowVisible()) - { - TheCircularGridDialog.ShowWindow(SW_HIDE); - TheRectangularGridDialog.UpdateValues(); - TheRectangularGridDialog.ShowWindow(SW_SHOW); - } -} - -void OCC_2dView::OnBUTTONGridRectPoints() -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2); - aViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth=0, aHeight=0, anOffset=0; - myView->Window()->Size(aWidth,aHeight); - aViewer->SetRectangularGridGraphicValues(aWidth,aHeight,anOffset); - aViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Points); - FitAll(); - - if (TheCircularGridDialog.IsWindowVisible()) - { - TheCircularGridDialog.ShowWindow(SW_HIDE); - TheRectangularGridDialog.UpdateValues(); - TheRectangularGridDialog.ShowWindow(SW_SHOW); - } -} - -void OCC_2dView::OnBUTTONGridCircLines() -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2); - aViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth=0, aHeight=0, anOffset=0; - myView->Window()->Size(aWidth,aHeight); - aViewer->SetCircularGridGraphicValues(aWidth>aHeight?aWidth:aHeight,anOffset); - aViewer->ActivateGrid(Aspect_GT_Circular, Aspect_GDM_Lines); - FitAll(); - - - if (TheRectangularGridDialog.IsWindowVisible()) - { - TheRectangularGridDialog.ShowWindow(SW_HIDE); - TheCircularGridDialog.UpdateValues(); - TheCircularGridDialog.ShowWindow(SW_SHOW); - } -} - -void OCC_2dView::OnBUTTONGridCircPoints() -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2); - aViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth=0, aHeight=0, anOffset=0; - myView->Window()->Size(aWidth,aHeight); - aViewer->SetCircularGridGraphicValues(aWidth>aHeight?aWidth:aHeight,anOffset); - aViewer->ActivateGrid(Aspect_GT_Circular, Aspect_GDM_Points); - FitAll(); - if (TheRectangularGridDialog.IsWindowVisible()) - { - TheRectangularGridDialog.ShowWindow(SW_HIDE); - TheCircularGridDialog.UpdateValues(); - TheCircularGridDialog.ShowWindow(SW_SHOW); - } -} - -void OCC_2dView::OnBUTTONGridValues() -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - Aspect_GridType TheGridtype = aViewer->GridType(); - - switch( TheGridtype ) - { - case Aspect_GT_Rectangular: - TheRectangularGridDialog.UpdateValues(); - TheRectangularGridDialog.ShowWindow(SW_SHOW); - break; - case Aspect_GT_Circular: - TheCircularGridDialog.UpdateValues(); - TheCircularGridDialog.ShowWindow(SW_SHOW); - break; - default : - throw Standard_Failure("invalid Aspect_GridType"); - } -} -void OCC_2dView::OnUpdateBUTTONGridValues(CCmdUI* pCmdUI) -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - pCmdUI-> Enable( aViewer->IsGridActive() ); -} - -void OCC_2dView::OnBUTTONGridCancel() -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - aViewer->DeactivateGrid(); - TheRectangularGridDialog.ShowWindow(SW_HIDE); - TheCircularGridDialog.ShowWindow(SW_HIDE); - aViewer->Update(); -} -void OCC_2dView::OnUpdateBUTTONGridCancel(CCmdUI* pCmdUI) -{ - Handle(V3d_Viewer) aViewer = myView->Viewer(); - pCmdUI-> Enable( aViewer->IsGridActive() ); -} - -void OCC_2dView::OnSize(UINT nType, int cx, int cy) -{ - OCC_BaseView::OnSize (nType, cx, cy); - // Take care : This function is called before OnInitialUpdate - if (!myView.IsNull()) - myView->MustBeResized(); -} - -void OCC_2dView::OnBUTTONFitAll() -{ - myView->FitAll(); -} - -void OCC_2dView::OnBUTTONGlobPanning() -{ - //save the current zoom value - myCurZoom = myView->Scale(); - - // Do a Global Zoom - myView->FitAll(); - - // Set the mode - setCurrentAction (CurAction3d_GlobalPanning); -} -void OCC_2dView::OnBUTTONPanning() -{ - setCurrentAction (CurAction3d_DynamicPanning); -} -void OCC_2dView::OnBUTTONZoomProg() -{ - setCurrentAction (CurAction3d_DynamicZooming); -} -void OCC_2dView::OnBUTTONZoomWin() -{ - setCurrentAction (CurAction3d_WindowZooming); -} -void OCC_2dView::OnChangeBackground() -{ - Standard_Real R1, G1, B1; - Handle(Aspect_Window) aWindow = myView->Window(); - Aspect_Background ABack = aWindow->Background(); - Quantity_Color aColor = ABack.Color(); - aColor.Values(R1,G1,B1,Quantity_TOC_RGB); - COLORREF m_clr ; - m_clr = RGB(R1*255,G1*255,B1*255); - - CColorDialog dlgColor(m_clr); - if (dlgColor.DoModal() == IDOK) - { - m_clr = dlgColor.GetColor(); - R1 = GetRValue(m_clr)/255.; - G1 = GetGValue(m_clr)/255.; - B1 = GetBValue(m_clr)/255.; - aColor.SetValues(R1,G1,B1,Quantity_TOC_RGB); - myView->SetBackgroundColor(aColor); - myView->Update(); - } -} - - -void OCC_2dView::OnUpdateBUTTON2DGlobPanning(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_GlobalPanning); - pCmdUI->Enable (getCurrentAction() != CurAction3d_GlobalPanning); -} - -void OCC_2dView::OnUpdateBUTTON2DPanning(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_DynamicPanning); - pCmdUI->Enable (getCurrentAction() != CurAction3d_DynamicPanning); -} - -void OCC_2dView::OnUpdateBUTTON2DZoomProg(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_DynamicZooming); - pCmdUI->Enable (getCurrentAction() != CurAction3d_DynamicZooming); -} - -void OCC_2dView::OnUpdateBUTTON2DZoomWin(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_WindowZooming); - pCmdUI->Enable (getCurrentAction() != CurAction3d_WindowZooming); -} diff --git a/samples/mfc/standard/Common/OCC_2dView.h b/samples/mfc/standard/Common/OCC_2dView.h deleted file mode 100755 index 24cdb6bcb6..0000000000 --- a/samples/mfc/standard/Common/OCC_2dView.h +++ /dev/null @@ -1,81 +0,0 @@ -// OCC_2dView.h: interface for the OCC_2dView class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_2dVIEW_H__2E048CC9_38F9_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_2dVIEW_H__2E048CC9_38F9_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_BaseView.h" -#include "OCC_2dDoc.h" -#include "Resource2d/RectangularGrid.h" -#include "Resource2d/CircularGrid.h" - -class Standard_EXPORT OCC_2dView : public OCC_BaseView -{ - DECLARE_DYNCREATE(OCC_2dView) - -public: - - OCC_2dView(); - - virtual ~OCC_2dView(); - - OCC_2dDoc* GetDocument(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(OCC_2dView) -protected: - virtual void OnInitialUpdate(); // called first time after construct - //}}AFX_VIRTUAL - -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: - -// Generated message map functions -protected: - //{{AFX_MSG(OCC_2dView) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - afx_msg void OnFileExportImage(); - afx_msg void OnBUTTONGridRectLines(); - afx_msg void OnBUTTONGridRectPoints(); - afx_msg void OnBUTTONGridCircLines(); - afx_msg void OnBUTTONGridCircPoints(); - afx_msg void OnBUTTONGridValues(); - afx_msg void OnUpdateBUTTONGridValues(CCmdUI* pCmdUI); - afx_msg void OnBUTTONGridCancel(); - afx_msg void OnUpdateBUTTONGridCancel(CCmdUI* pCmdUI); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnBUTTONFitAll(); - afx_msg void OnBUTTONGlobPanning(); - afx_msg void OnBUTTONPanning(); - afx_msg void OnBUTTONZoomProg(); - afx_msg void OnBUTTONZoomWin(); - afx_msg void OnUpdateBUTTON2DGlobPanning(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTON2DPanning(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTON2DZoomProg(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTON2DZoomWin(CCmdUI* pCmdUI); - afx_msg void OnChangeBackground(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -protected: - CRectangularGrid TheRectangularGridDialog; - CCircularGrid TheCircularGridDialog; -}; - -#ifndef _DEBUG // debug version in 2DDisplayView.cpp -inline OCC_2dDoc* OCC_2dView::GetDocument() - { return (OCC_2dDoc*)m_pDocument; } -#endif - -#endif // !defined(AFX_OCC_2dVIEW_H__2E048CC9_38F9_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_2dViewRD.cpp b/samples/mfc/standard/Common/OCC_2dViewRD.cpp deleted file mode 100755 index 41feaa65e6..0000000000 --- a/samples/mfc/standard/Common/OCC_2dViewRD.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// OCC_2dViewRDRD.cpp: implementation of the OCC_2dViewRDRD class. -// -////////////////////////////////////////////////////////////////////// - -#include -#include -#include "OCC_2dViewRD.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -BEGIN_MESSAGE_MAP(OCC_2dViewRD, CView) - //{{AFX_MSG_MAP(OCC_2dViewRD) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage) - ON_COMMAND(ID_BUTTON2DGridRectLines, OnBUTTONGridRectLines) - ON_COMMAND(ID_BUTTON2DGridRectPoints, OnBUTTONGridRectPoints) - ON_COMMAND(ID_BUTTON2DGridCircLines, OnBUTTONGridCircLines) - ON_COMMAND(ID_BUTTON2DGridCircPoints, OnBUTTONGridCircPoints) - ON_COMMAND(ID_BUTTON2DGridValues, OnBUTTONGridValues) - ON_COMMAND(ID_BUTTON2DGridCancel, OnBUTTONGridCancel) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -void OCC_2dViewRD::OnFileExportImage() -{ - OCC_2dViewRD::OnFileExportImage(); - // Update Get information to update Result dialog - - UINT anID=ID_FILE_EXPORT_IMAGE; - TCollection_AsciiString Message(" \ - CFileDialog dlg(FALSE,_T(\"*.BMP\"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, \n\ - _T(\"BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | XWD Files (*.XWD)|*.xwd||\"), \n\ - NULL ); \n\ - \n\ - if (dlg.DoModal() == IDOK) \n\ - { \n\ - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); \n\ - CString filename = dlg.GetPathName(); \n\ - Handle(WNT_Window) aWNTWindow= \n\ - Handle(WNT_Window)::DownCast(myV2dView->Driver()->Window()); \n\ - CString ext = dlg.GetFileExt(); \n\ - if (ext == \"bmp\") aWNTWindow->SetOutputFormat ( WNT_TOI_BMP ); \n\ - if (ext == \"gif\") aWNTWindow->SetOutputFormat ( WNT_TOI_GIF ); \n\ - if (ext == \"xwd\") aWNTWindow->SetOutputFormat ( WNT_TOI_XWD ); \n\ - aWNTWindow->Dump ((Standard_CString)(LPCTSTR)filename); \n\ - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); \n\ - } \n"); - - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); -} - - -void OCC_2dViewRD::OnBUTTONGridRectLines() -{ - OCC_2dViewRD::OnBUTTONGridRectLines(); - // Update Get information to update Result dialog - - UINT anID=ID_BUTTON2DGridRectLines; - TCollection_AsciiString Message; - Message += "\ - Handle(V2d_Viewer) aViewer = myV2dView->Viewer(); \n\ - aViewer->SetGridColor(Quantity_Color(Quantity_NOC_WHITE), Quantity_Color(Quantity_NOC_WHITE)); \n\ - aViewer->ActivateGrid(Aspect_GT_Rectangular, \n\ - Aspect_GDM_Lines); \n\ - if (TheCircularGridDialog.IsWindowVisible()) \n\ - { \n\ - TheCircularGridDialog.ShowWindow(SW_HIDE); \n\ - TheRectangularGridDialog.UpdateValues(); \n\ - TheRectangularGridDialog.ShowWindow(SW_SHOW); \n\ - } \n\ - \n"; - - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); - -} - -void OCC_2dViewRD::OnBUTTONGridRectPoints() -{ - OCC_2dViewRD::OnBUTTONGridRectPoints(); - // Update Get information to update Result dialog - - UINT anID=ID_BUTTON2DGridRectPoints; - TCollection_AsciiString Message; -Message = "\ - Handle(V2d_Viewer) aViewer = myV2dView->Viewer(); \n\ - aViewer->SetGridColor(Quantity_Color(Quantity_NOC_WHITE), Quantity_Color(Quantity_NOC_WHITE)); \n\ - aViewer->ActivateGrid(Aspect_GT_Rectangular, \n\ - Aspect_GDM_Points); \n\ - if (TheCircularGridDialog.IsWindowVisible()) \n\ - { \n\ - TheCircularGridDialog.ShowWindow(SW_HIDE); \n\ - TheRectangularGridDialog.UpdateValues(); \n\ - TheRectangularGridDialog.ShowWindow(SW_SHOW); \n\ - } \n\ -"; - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); - - -} - -void OCC_2dViewRD::OnBUTTONGridCircLines() -{ - OCC_2dViewRD::OnBUTTONGridCircLines(); - // Update Get information to update Result dialog - - UINT anID=ID_BUTTON2DGridCircLines; - TCollection_AsciiString Message("\ - Handle(V2d_Viewer) aViewer = myV2dView->Viewer(); \n\ - aViewer->SetGridColor(Quantity_Color(Quantity_NOC_WHITE), Quantity_Color(Quantity_NOC_WHITE)); \n\ - aViewer->ActivateGrid(Aspect_GT_Circular, \n\ - Aspect_GDM_Lines); \n\ - if (TheRectangularGridDialog.IsWindowVisible()) \n\ - { \n\ - TheRectangularGridDialog.ShowWindow(SW_HIDE); \n\ - TheCircularGridDialog.UpdateValues(); \n\ - TheCircularGridDialog.ShowWindow(SW_SHOW); \n\ - } \n"); - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); - -} - -void OCC_2dViewRD::OnBUTTONGridCircPoints() -{ - OCC_2dViewRD::OnBUTTONGridCircPoints(); - // Update Get information to update Result dialog - - UINT anID=ID_BUTTON2DGridCircPoints; - TCollection_AsciiString Message("\ - Handle(V2d_Viewer) aViewer = myV2dView->Viewer(); \n\ - aViewer->SetGridColor(Quantity_Color(Quantity_NOC_WHITE), Quantity_Color(Quantity_NOC_WHITE)); \n\ - aViewer->ActivateGrid(Aspect_GT_Circular, \n\ - Aspect_GDM_Points); \n\ - if (TheRectangularGridDialog.IsWindowVisible()) \n\ - { \n\ - TheRectangularGridDialog.ShowWindow(SW_HIDE); \n\ - TheCircularGridDialog.UpdateValues(); \n\ - TheCircularGridDialog.ShowWindow(SW_SHOW); \n\ - } \n\ - \n"); - - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); - -} - -void OCC_2dViewRD::OnBUTTONGridValues() -{ - OCC_2dViewRD::OnBUTTONGridValues(); - // Update Get information to update Result dialog - - UINT anID=ID_BUTTON2DGridValues; - TCollection_AsciiString Message("\ - Handle(V2d_Viewer) aViewer = myV2dView->Viewer(); \n\ - Aspect_GridType TheGridtype = aViewer->GridType(); \n\ - \n\ - switch( TheGridtype ) \n\ - { \n\ - case Aspect_GT_Rectangular: \n\ - TheRectangularGridDialog.UpdateValues(); \n\ - TheRectangularGridDialog.ShowWindow(SW_SHOW); \n\ - break; \n\ - case Aspect_GT_Circular: \n\ - TheCircularGridDialog.UpdateValues(); \n\ - TheCircularGridDialog.ShowWindow(SW_SHOW); \n\ - break; \n\ - default : \n\ - throw Standard_Failure(\"invalid Aspect_GridType\"); \n\ - } \n\ -\n"); - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); - -} - -void OCC_2dViewRD::OnBUTTONGridCancel() -{ - OCC_2dViewRD::OnBUTTONGridCancel(); - // Update Get information to update Result dialog - - UINT anID=ID_BUTTON2DGridCancel; - TCollection_AsciiString Message("\ - Handle(V2d_Viewer) aViewer = myV2dView->Viewer(); \n\ - aViewer->DeactivateGrid(); \n\ - TheRectangularGridDialog.ShowWindow(SW_HIDE); \n\ - TheCircularGridDialog.ShowWindow(SW_HIDE); \n\ - aViewer->Update(); \n\ - \n"); - - // Update The Result Dialog - GetDocument()->UpdateResultDialog(anID,Message); - -} - - -OCC_2dViewRD::OCC_2dViewRD() -{ - -} - -OCC_2dViewRD::~OCC_2dViewRD() -{ -} - - -OCC_2dDoc* OCC_2dViewRD::GetDocument() -{ - return (OCC_2dDoc*)m_pDocument; -} diff --git a/samples/mfc/standard/Common/OCC_2dViewRD.h b/samples/mfc/standard/Common/OCC_2dViewRD.h deleted file mode 100755 index 314f7b1674..0000000000 --- a/samples/mfc/standard/Common/OCC_2dViewRD.h +++ /dev/null @@ -1,40 +0,0 @@ -// OCC_2dViewRD.h: interface for the OCC_2dViewRD class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_2DVIEWRD_H__AD650F81_8D03_11D7_8637_0060B0EE281E__INCLUDED_) -#define AFX_OCC_2DVIEWRD_H__AD650F81_8D03_11D7_8637_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_2dView.h" - -class OCC_2dViewRD : public OCC_2dView -{ -public: - OCC_2dDoc* GetDocument(); - OCC_2dViewRD(); - virtual ~OCC_2dViewRD(); - - - -// Generated message map functions -protected: - //{{AFX_MSG(OCC_2dView) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - afx_msg void OnFileExportImage(); - afx_msg void OnBUTTONGridRectLines(); - afx_msg void OnBUTTONGridRectPoints(); - afx_msg void OnBUTTONGridCircLines(); - afx_msg void OnBUTTONGridCircPoints(); - afx_msg void OnBUTTONGridValues(); - afx_msg void OnBUTTONGridCancel(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; - -#endif // !defined(AFX_OCC_2DVIEWRD_H__AD650F81_8D03_11D7_8637_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp b/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp deleted file mode 100755 index 271176a173..0000000000 --- a/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp +++ /dev/null @@ -1,504 +0,0 @@ -// OCC_3dBaseDoc.cpp: implementation of the OCC_3dBaseDoc class. -// -////////////////////////////////////////////////////////////////////// - -#include - -#include "OCC_3dBaseDoc.h" - -#include "OCC_3dView.h" -#include "OCC_App.h" -#include -#include "ImportExport/ImportExport.h" -#include "AISDialogs.h" -#include -#include -#include -#include -#include - -BEGIN_MESSAGE_MAP(OCC_3dBaseDoc, OCC_BaseDoc) - //{{AFX_MSG_MAP(OCC_3dBaseDoc) - ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep) - ON_COMMAND(ID_FILE_EXPORT_BREP, OnFileExportBrep) - ON_COMMAND(ID_OBJECT_ERASE, OnObjectErase) - ON_UPDATE_COMMAND_UI(ID_OBJECT_ERASE, OnUpdateObjectErase) - ON_COMMAND(ID_OBJECT_COLOR, OnObjectColor) - ON_UPDATE_COMMAND_UI(ID_OBJECT_COLOR, OnUpdateObjectColor) - ON_COMMAND(ID_OBJECT_SHADING, OnObjectShading) - ON_UPDATE_COMMAND_UI(ID_OBJECT_SHADING, OnUpdateObjectShading) - ON_COMMAND(ID_OBJECT_WIREFRAME, OnObjectWireframe) - ON_UPDATE_COMMAND_UI(ID_OBJECT_WIREFRAME, OnUpdateObjectWireframe) - ON_COMMAND(ID_OBJECT_TRANSPARENCY, OnObjectTransparency) - ON_UPDATE_COMMAND_UI(ID_OBJECT_TRANSPARENCY, OnUpdateObjectTransparency) - ON_COMMAND(ID_OBJECT_MATERIAL, OnObjectMaterial) - ON_UPDATE_COMMAND_UI(ID_OBJECT_MATERIAL, OnUpdateObjectMaterial) - ON_COMMAND(ID_OBJECT_DISPLAYALL, OnObjectDisplayall) - ON_UPDATE_COMMAND_UI(ID_OBJECT_DISPLAYALL, OnUpdateObjectDisplayall) - ON_COMMAND(ID_OBJECT_REMOVE, OnObjectRemove) - ON_UPDATE_COMMAND_UI(ID_OBJECT_REMOVE, OnUpdateObjectRemove) - - //}}AFX_MSG_MAP - ON_COMMAND_EX_RANGE(ID_OBJECT_MATERIAL_BRASS,ID_OBJECT_MATERIAL_DEFAULT, OnObjectMaterialRange) - ON_UPDATE_COMMAND_UI_RANGE(ID_OBJECT_MATERIAL_BRASS,ID_OBJECT_MATERIAL_DEFAULT, OnUpdateObjectMaterialRange) - - //RayTracing - ON_COMMAND(ID_OBJECT_RAY_TRACING,OnObjectRayTracing) - ON_COMMAND(ID_OBJECT_SHADOWS,OnObjectShadows) - ON_COMMAND(ID_OBJECT_REFLECTIONS,OnObjectReflections) - ON_COMMAND(ID_OBJECT_ANTI_ALIASING,OnObjectAntiAliasing) - - ON_UPDATE_COMMAND_UI(ID_OBJECT_RAY_TRACING, OnUpdateV3dButtons) - ON_UPDATE_COMMAND_UI(ID_OBJECT_SHADOWS, OnUpdateV3dButtons) - ON_UPDATE_COMMAND_UI(ID_OBJECT_REFLECTIONS, OnUpdateV3dButtons) - ON_UPDATE_COMMAND_UI(ID_OBJECT_ANTI_ALIASING, OnUpdateV3dButtons) -END_MESSAGE_MAP() - - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -OCC_3dBaseDoc::OCC_3dBaseDoc() -:myPopupMenuNumber(0) -{ - AfxInitRichEdit(); - - Handle(Graphic3d_GraphicDriver) aGraphicDriver = ((OCC_App*)AfxGetApp())->GetGraphicDriver(); - - myViewer = new V3d_Viewer (aGraphicDriver); - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - myAISContext = new AIS_InteractiveContext (myViewer); - - myRayTracingIsOn = false; - myRaytracedShadowsIsOn = true; - myRaytracedReflectionsIsOn = false; - myRaytracedAntialiasingIsOn = false; -} - -OCC_3dBaseDoc::~OCC_3dBaseDoc() -{ -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::DragEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Standard_Integer theState, - const Handle(V3d_View)& theView) -{ - // TheState == -1 button down - // TheState == 0 move - // TheState == 1 button up - - static Standard_Integer aStartDragX = 0; - static Standard_Integer aStartDragY = 0; - - switch (theState) - { - case -1: - { - aStartDragX = theMouseX; - aStartDragY = theMouseY; - break; - } - case 0: - { - myAISContext->UpdateCurrentViewer(); - break; - } - case 1: - { - myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY), - Graphic3d_Vec2i (theMouseX, theMouseY), - theView); - myAISContext->UpdateCurrentViewer(); - break; - } - }; -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::InputEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) -{ - myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_False); - myAISContext->SelectDetected(); - myAISContext->UpdateCurrentViewer(); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::MoveEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) -{ - myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_True); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::ShiftMoveEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) -{ - myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_True); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::ShiftDragEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Standard_Integer theState, - const Handle(V3d_View)& theView) -{ - // TheState == -1 button down - // TheState == 0 move - // TheState == 1 button up - - static Standard_Integer aStartDragX = 0; - static Standard_Integer aStartDragY = 0; - - if (theState == -1) - { - // button down - aStartDragX = theMouseX; - aStartDragY = theMouseY; - } - - if (theState == 0) - { - // button up - myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY), - Graphic3d_Vec2i (theMouseX, theMouseY), - theView, AIS_SelectionScheme_XOR); - myAISContext->UpdateCurrentViewer(); - } -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::ShiftInputEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) -{ - myAISContext->SelectDetected (AIS_SelectionScheme_XOR); - myAISContext->UpdateCurrentViewer(); -} - -//----------------------------------------------------------------------------------------- -// -//----------------------------------------------------------------------------------------- -void OCC_3dBaseDoc::Popup (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) -{ - // Base check which context menu to call - if (!myPopupMenuNumber) - { - myAISContext->InitSelected(); - if (myAISContext->MoreSelected()) - myPopupMenuNumber=1; - } - - CMenu menu; - VERIFY(menu.LoadMenu(IDR_Popup3D)); - CMenu* pPopup = menu.GetSubMenu(myPopupMenuNumber); - - ASSERT(pPopup != NULL); - if (myPopupMenuNumber == 1) // more than 1 object. - { - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - if(!OneOrMoreInShading) - pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); - } - - POINT winCoord = { theMouseX , theMouseY }; - ClientToScreen ((HWND )theView->Window()->NativeHandle(), &winCoord); - pPopup->TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON, - winCoord.x, - winCoord.y, - AfxGetMainWnd()); -} - -void OCC_3dBaseDoc::Fit() -{ - CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; - CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); - OCC_3dView *pView = (OCC_3dView *) pChild->GetActiveView(); - pView->FitAll(); -} - -int OCC_3dBaseDoc::OnFileImportBrep_WithInitDir (const wchar_t* ) -{ - if (CImportExport::ReadBREP (myAISContext) == 1) - return 1; - Fit(); - return 0; -} - -void OCC_3dBaseDoc::OnFileImportBrep() -{ - OnFileImportBrep_WithInitDir (NULL); -} - -void OCC_3dBaseDoc::OnFileExportBrep() -{ CImportExport::SaveBREP(myAISContext);} - -void OCC_3dBaseDoc::OnObjectColor() -{ - Handle(AIS_InteractiveObject) Current ; - COLORREF MSColor ; - - myAISContext->InitSelected(); - Current = myAISContext->SelectedInteractive(); - if ( Current->HasColor () ) { - Quantity_Color CSFColor; - myAISContext->Color (Current, CSFColor); - MSColor = RGB (CSFColor.Red()*255.,CSFColor.Green()*255.,CSFColor.Blue()*255.); - } - else { - MSColor = RGB (255,255,255) ; - } - - CColorDialog dlgColor(MSColor); - if (dlgColor.DoModal() == IDOK) - { - MSColor = dlgColor.GetColor(); - Quantity_Color CSFColor (GetRValue(MSColor)/255., GetGValue(MSColor)/255., GetBValue(MSColor)/255., Quantity_TOC_RGB); - for (;myAISContext->MoreSelected ();myAISContext->NextSelected ()) - myAISContext->SetColor (myAISContext->SelectedInteractive(), CSFColor, Standard_False); - myAISContext->UpdateCurrentViewer(); - } -} -void OCC_3dBaseDoc::OnUpdateObjectColor(CCmdUI* pCmdUI) -{ - bool OneOrMoreIsShadingOrWireframe = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),0) - ||myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) - OneOrMoreIsShadingOrWireframe=true; - pCmdUI->Enable (OneOrMoreIsShadingOrWireframe); -} - -void OCC_3dBaseDoc::OnObjectErase() -{ - myAISContext->EraseSelected (Standard_True); -} -void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI) -{ - bool OneOrMoreIsDisplayed = false; - for (myAISContext->InitSelected(); myAISContext->MoreSelected(); myAISContext->NextSelected()) - { - if (myAISContext->IsDisplayed (myAISContext->SelectedInteractive())) - OneOrMoreIsDisplayed = true; - } - pCmdUI->Enable (OneOrMoreIsDisplayed); -} - -void OCC_3dBaseDoc::OnObjectWireframe() -{ - for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->NextSelected()) - myAISContext->SetDisplayMode (myAISContext->SelectedInteractive(), 0, Standard_False); - myAISContext->UpdateCurrentViewer(); -} -void OCC_3dBaseDoc::OnUpdateObjectWireframe(CCmdUI* pCmdUI) -{ - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - pCmdUI->Enable (OneOrMoreInShading); -} - -void OCC_3dBaseDoc::OnObjectShading() -{ - for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->NextSelected()) - myAISContext->SetDisplayMode (myAISContext->SelectedInteractive(), 1, Standard_False); - myAISContext->UpdateCurrentViewer(); -} - -void OCC_3dBaseDoc::OnUpdateObjectShading(CCmdUI* pCmdUI) -{ - bool OneOrMoreInWireframe = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),0)) OneOrMoreInWireframe=true; - pCmdUI->Enable (OneOrMoreInWireframe); -} - -void OCC_3dBaseDoc::OnObjectMaterial() -{ - CDialogMaterial DialBox(myAISContext); - DialBox.DoModal(); - //CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; - //CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); - //OCC_3dView *pView = (OCC_3dView *) pChild->GetActiveView(); -} - -void OCC_3dBaseDoc::OnUpdateObjectMaterial(CCmdUI* pCmdUI) -{ - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - pCmdUI->Enable (OneOrMoreInShading); -} - -BOOL OCC_3dBaseDoc::OnObjectMaterialRange(UINT nID) -{ - // the range ID_OBJECT_MATERIAL_BRASS to ID_OBJECT_MATERIAL_SILVER is - // continue with the same values as enumeration Type Of Material - Standard_Real aTransparency; - - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()){ - aTransparency = myAISContext->SelectedInteractive()->Transparency(); - myAISContext->SetMaterial (myAISContext->SelectedInteractive(),(Graphic3d_NameOfMaterial)(nID-ID_OBJECT_MATERIAL_BRASS), Standard_False); - myAISContext->SetTransparency (myAISContext->SelectedInteractive(),aTransparency, Standard_False); - } - myAISContext->UpdateCurrentViewer(); - return true; - -} - -void OCC_3dBaseDoc::OnUpdateObjectMaterialRange(CCmdUI* pCmdUI) -{ - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - pCmdUI->Enable (OneOrMoreInShading); - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->SelectedInteractive()->Material() - (pCmdUI->m_nID - ID_OBJECT_MATERIAL_BRASS) == 0) - pCmdUI->SetCheck(1); -} - - -void OCC_3dBaseDoc::OnObjectTransparency() -{ - CDialogTransparency DialBox(myAISContext); - DialBox.DoModal(); - //CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; - //CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); - //OCC_3dView *pView = (OCC_3dView *) pChild->GetActiveView(); -// pView->Redraw(); -} - -void OCC_3dBaseDoc::OnUpdateObjectTransparency(CCmdUI* pCmdUI) -{ - bool OneOrMoreInShading = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true; - pCmdUI->Enable (OneOrMoreInShading); -} - - -void OCC_3dBaseDoc::OnObjectDisplayall() -{ - myAISContext->DisplayAll (Standard_True); -} - -void OCC_3dBaseDoc::OnUpdateObjectDisplayall(CCmdUI* pCmdUI) -{ - AIS_ListOfInteractive aList; - myAISContext->ObjectsInside (aList); - for (AIS_ListIteratorOfListOfInteractive aLI (aList);aLI.More();aLI.Next()) - { - if (!myAISContext->IsDisplayed (aLI.Value())) - { - pCmdUI->Enable (true); - return; - } - } - pCmdUI->Enable (false); -} - -void OCC_3dBaseDoc::OnObjectRemove() -{ - for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->InitSelected()) - myAISContext->Remove(myAISContext->SelectedInteractive(),Standard_True); -} - -void OCC_3dBaseDoc::OnUpdateObjectRemove(CCmdUI* pCmdUI) -{ - bool OneOrMoreIsDisplayed = false; - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive())) OneOrMoreIsDisplayed=true; - pCmdUI->Enable (OneOrMoreIsDisplayed); -} - -void OCC_3dBaseDoc::SetMaterial(Graphic3d_NameOfMaterial Material) -{ - for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()) - myAISContext->SetMaterial (myAISContext->SelectedInteractive(), - (Graphic3d_NameOfMaterial)(Material), Standard_False); - myAISContext->UpdateCurrentViewer(); -} - - -// RayTracing -void OCC_3dBaseDoc::OnObjectRayTracing() -{ - myRayTracingIsOn = !myRayTracingIsOn; - if(!myRayTracingIsOn) - { - myRaytracedShadowsIsOn = false; - myRaytracedReflectionsIsOn = false; - myRaytracedAntialiasingIsOn = false; - } - OnObjectRayTracingAction(); -} -// Shadows -void OCC_3dBaseDoc::OnObjectShadows() -{ - myRaytracedShadowsIsOn = !myRaytracedShadowsIsOn; - OnObjectRayTracingAction(); -} -// Reflections -void OCC_3dBaseDoc::OnObjectReflections() -{ - myRaytracedReflectionsIsOn = !myRaytracedReflectionsIsOn; - OnObjectRayTracingAction(); -} -// Anti-aliasing -void OCC_3dBaseDoc::OnObjectAntiAliasing() -{ - myRaytracedAntialiasingIsOn = !myRaytracedAntialiasingIsOn; - OnObjectRayTracingAction(); -} -void OCC_3dBaseDoc::OnUpdateV3dButtons (CCmdUI* pCmdUI) -{ - if (pCmdUI->m_nID == ID_OBJECT_RAY_TRACING) - { - pCmdUI->SetCheck(myRayTracingIsOn); - } else { - pCmdUI->Enable(myRayTracingIsOn); - if (pCmdUI->m_nID == ID_OBJECT_SHADOWS) - pCmdUI->SetCheck(myRaytracedShadowsIsOn); - if (pCmdUI->m_nID == ID_OBJECT_REFLECTIONS) - pCmdUI->SetCheck(myRaytracedReflectionsIsOn); - if (pCmdUI->m_nID == ID_OBJECT_ANTI_ALIASING) - pCmdUI->SetCheck(myRaytracedAntialiasingIsOn); - } -} -// Common function to change raytracing params and redraw view -void OCC_3dBaseDoc::OnObjectRayTracingAction() -{ - Handle(V3d_View) aView = myAISContext->CurrentViewer()->ActiveViews().First(); - Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams(); - if (myRayTracingIsOn) - aParams.Method = Graphic3d_RM_RAYTRACING; - else - aParams.Method = Graphic3d_RM_RASTERIZATION; - aParams.IsShadowEnabled = myRaytracedShadowsIsOn; - aParams.IsReflectionEnabled = myRaytracedReflectionsIsOn; - aParams.IsAntialiasingEnabled = myRaytracedAntialiasingIsOn; - myAISContext->UpdateCurrentViewer(); -} diff --git a/samples/mfc/standard/Common/OCC_3dBaseDoc.h b/samples/mfc/standard/Common/OCC_3dBaseDoc.h deleted file mode 100755 index cf69c29708..0000000000 --- a/samples/mfc/standard/Common/OCC_3dBaseDoc.h +++ /dev/null @@ -1,103 +0,0 @@ -// OCC_3dBaseDoc.h: interface for the OCC_3dBaseDoc class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_3DBASEDOC_H__02CE7BD9_39BE_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_3DBASEDOC_H__02CE7BD9_39BE_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_BaseDoc.h" -#include "DimensionDlg.h" -#include - -class Standard_EXPORT OCC_3dBaseDoc : public OCC_BaseDoc -{ -public: - - OCC_3dBaseDoc(); - ~OCC_3dBaseDoc(); - - void SetMaterial(Graphic3d_NameOfMaterial Material); - - - virtual void DragEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Standard_Integer theState, - const Handle(V3d_View)& theView); - - virtual void InputEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView); - - virtual void MoveEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView); - - virtual void ShiftMoveEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView); - - virtual void ShiftDragEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Standard_Integer theState, - const Handle(V3d_View)& theView); - - virtual void ShiftInputEvent (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView); - - virtual void Popup (const Standard_Integer theMouseX, - const Standard_Integer theMouseY, - const Handle(V3d_View)& theView) Standard_OVERRIDE; - - static void Fit(); - - int OnFileImportBrep_WithInitDir (const wchar_t* InitialDir); - - void OnObjectRayTracingAction(); - - // Generated message map functions -protected: - //{{AFX_MSG(OCC_3dBaseDoc) - afx_msg void OnFileImportBrep(); - afx_msg void OnFileExportBrep(); - afx_msg void OnObjectErase(); - afx_msg void OnUpdateObjectErase(CCmdUI* pCmdUI); - afx_msg void OnObjectColor(); - afx_msg void OnUpdateObjectColor(CCmdUI* pCmdUI); - afx_msg void OnObjectShading(); - afx_msg void OnUpdateObjectShading(CCmdUI* pCmdUI); - afx_msg void OnObjectWireframe(); - afx_msg void OnUpdateObjectWireframe(CCmdUI* pCmdUI); - afx_msg void OnObjectTransparency(); - afx_msg void OnUpdateObjectTransparency(CCmdUI* pCmdUI) ; - afx_msg void OnObjectMaterial(); - afx_msg void OnUpdateObjectMaterial(CCmdUI* pCmdUI); - afx_msg BOOL OnObjectMaterialRange(UINT nID); - afx_msg void OnUpdateObjectMaterialRange(CCmdUI* pCmdUI); - afx_msg void OnObjectDisplayall(); - afx_msg void OnUpdateObjectDisplayall(CCmdUI* pCmdUI); - afx_msg void OnObjectRemove(); - afx_msg void OnUpdateObjectRemove(CCmdUI* pCmdUI); - - afx_msg void OnUpdateV3dButtons(CCmdUI* pCmdUI); - afx_msg void OnObjectRayTracing(); - afx_msg void OnObjectShadows(); - afx_msg void OnObjectReflections(); - afx_msg void OnObjectAntiAliasing(); - - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -protected: - bool myRayTracingIsOn; - bool myRaytracedShadowsIsOn; - bool myRaytracedReflectionsIsOn; - bool myRaytracedAntialiasingIsOn; - int myPopupMenuNumber; -}; - -#endif // !defined(AFX_OCC_3dBaseDoc_H__02CE7BD9_39BE_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_3dChildFrame.cpp b/samples/mfc/standard/Common/OCC_3dChildFrame.cpp deleted file mode 100755 index c4d3409584..0000000000 --- a/samples/mfc/standard/Common/OCC_3dChildFrame.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// OCC_3dChildFrame.cpp: implementation of the OCC_3dChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "OCC_3dChildFrame.h" - -#include "res\OCC_Resource.h" - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - - -IMPLEMENT_DYNCREATE (OCC_3dChildFrame, OCC_BaseChildFrame) - -BEGIN_MESSAGE_MAP(OCC_3dChildFrame, OCC_BaseChildFrame) - //{{AFX_MSG_MAP(OCC_3dChildFrame) - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -OCC_3dChildFrame::OCC_3dChildFrame() -{ - -} - -OCC_3dChildFrame::~OCC_3dChildFrame() -{ - -} - -int OCC_3dChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_3dCHILDFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); - - // Create toolbar for RayTracing functionality - if (!m_RTToolBar.Create(this) || !m_RTToolBar.LoadToolBar(IDR_RAY_TRACING)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - m_RTToolBar.SetBarStyle(m_RTToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_RTToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_RTToolBar); - - return 0; -} \ No newline at end of file diff --git a/samples/mfc/standard/Common/OCC_3dChildFrame.h b/samples/mfc/standard/Common/OCC_3dChildFrame.h deleted file mode 100755 index 7b024b1e30..0000000000 --- a/samples/mfc/standard/Common/OCC_3dChildFrame.h +++ /dev/null @@ -1,39 +0,0 @@ -// OCC_3dChildFrame.h: interface for the OCC_3dChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_3DCHILDFRAME_H__84879CFC_7EE3_11D7_8632_0060B0EE281E__INCLUDED_) -#define AFX_OCC_3DCHILDFRAME_H__84879CFC_7EE3_11D7_8632_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_BaseChildFrame.h" -#include - -class Standard_EXPORT OCC_3dChildFrame : public OCC_BaseChildFrame -{ - DECLARE_DYNCREATE(OCC_3dChildFrame) -public: - OCC_3dChildFrame(); - virtual ~OCC_3dChildFrame(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(OCC_3dChildFrame) - //}}AFX_VIRTUAL - -// Generated message map functions - //{{AFX_MSG(OCC_3dChildFrame) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() - -//Attributes -protected: - CToolBar m_RTToolBar; -}; - -#endif // !defined(AFX_OCC_3DCHILDFRAME_H__84879CFC_7EE3_11D7_8632_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_3dDoc.cpp b/samples/mfc/standard/Common/OCC_3dDoc.cpp deleted file mode 100755 index b5eb41f5d8..0000000000 --- a/samples/mfc/standard/Common/OCC_3dDoc.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// OCC_3dDoc.cpp: implementation of the OCC_3dDoc class. -// -////////////////////////////////////////////////////////////////////// - -#include -#include "OCC_3dDoc.h" - -BEGIN_MESSAGE_MAP(OCC_3dDoc, OCC_3dBaseDoc) - ON_COMMAND(ID_OBJECT_DIM, OnObjectAddDimensions) -END_MESSAGE_MAP() - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -OCC_3dDoc::OCC_3dDoc (bool theIsResultDialog) -: myDimensionDlg() -{ - if (theIsResultDialog) - { - myCResultDialog.Create(CResultDialog::IDD,NULL); - - RECT dlgrect; - myCResultDialog.GetWindowRect(&dlgrect); - LONG width = dlgrect.right-dlgrect.left; - LONG height = dlgrect.bottom-dlgrect.top; - - RECT MainWndRect; - AfxGetApp()->m_pMainWnd->GetWindowRect(&MainWndRect); - LONG left = MainWndRect.left+3; - LONG top = MainWndRect.top + 112; - - myCResultDialog.MoveWindow(left,top,width,height); - } - - myDimensionDlg.SetContext (myAISContext); - myDimensionDlg.Create(CDimensionDlg::IDD, NULL); -} - -OCC_3dDoc::~OCC_3dDoc() -{ - -} - -void OCC_3dDoc::PocessTextInDialog (CString theTitle, - CString theMessage) -{ - myCResultDialog.SetTitle (theTitle); - myCResultDialog.SetText (theMessage); - SetTitle (theTitle); -} - -void OCC_3dDoc::ClearDialog() -{ - myCResultDialog.Empty(); -} - -void OCC_3dDoc::AddTextInDialog(TCollection_AsciiString& aMessage) -{ - CString TextToAdd(aMessage.ToCString()); - CString CurrentText; - myCResultDialog.GetText(CurrentText); - - CString Text; - Text = TextToAdd + CurrentText; - - myCResultDialog.SetText(Text); - -} - -CString OCC_3dDoc::GetDialogText() -{ - CString CurrentText; - myCResultDialog.GetText(CurrentText); - - return CurrentText; - -} - -void OCC_3dDoc::SetDialogTitle(TCollection_AsciiString theTitle) -{ - myCResultDialog.SetTitle(theTitle.ToCString()); -} - -void OCC_3dDoc::OnObjectAddDimensions() -{ - //Add dimensions dialog is opened here - myDimensionDlg.ShowWindow(SW_SHOW); - myDimensionDlg.UpdateStandardMode (); -} diff --git a/samples/mfc/standard/Common/OCC_3dDoc.h b/samples/mfc/standard/Common/OCC_3dDoc.h deleted file mode 100755 index 9df82db329..0000000000 --- a/samples/mfc/standard/Common/OCC_3dDoc.h +++ /dev/null @@ -1,51 +0,0 @@ -// OCC_3dDoc.h: interface for the OCC_3dDoc class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_3DDOC_H__1F4065AD_39C4_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_3DDOC_H__1F4065AD_39C4_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_3dBaseDoc.h" -#include "ResultDialog.h" -#include - -// Event tracker for 3D views with support of advanced message dialog operations -// and dimensions dialog -class Standard_EXPORT OCC_3dDoc : public OCC_3dBaseDoc -{ -public: - - OCC_3dDoc (bool theIsResultDialog = true); - virtual ~OCC_3dDoc(); - -public: // Dialog operations - - void SetDialogTitle(TCollection_AsciiString theTitle); - CString GetDialogText(); - - void PocessTextInDialog (CString theTitle, CString theMessage); - void PocessTextInDialog (CString theTitle, const TCollection_AsciiString& theMessage) - { - CString aMessage (theMessage.ToCString()); - PocessTextInDialog (theTitle, aMessage); - } - - void ClearDialog(); - void AddTextInDialog(TCollection_AsciiString& aMessage); - -protected: - - afx_msg void OnObjectAddDimensions(); - DECLARE_MESSAGE_MAP() - -protected: - - CResultDialog myCResultDialog; - CDimensionDlg myDimensionDlg; -}; - -#endif // !defined(AFX_OCC_3DDOC_H__1F4065AD_39C4_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_3dView.cpp b/samples/mfc/standard/Common/OCC_3dView.cpp deleted file mode 100755 index bb768ff405..0000000000 --- a/samples/mfc/standard/Common/OCC_3dView.cpp +++ /dev/null @@ -1,297 +0,0 @@ -// OCC_3dView.cpp: implementation of the OCC_3dView class. -// - -#include "stdafx.h" - -#include "OCC_3dView.h" -#include "OCC_App.h" -#include "OCC_3dBaseDoc.h" -#include - -#include - -#include - -IMPLEMENT_DYNCREATE(OCC_3dView, OCC_BaseView) - -BEGIN_MESSAGE_MAP(OCC_3dView, OCC_BaseView) - //{{AFX_MSG_MAP(OCC_3dView) - ON_COMMAND(ID_BUTTONAxo, OnBUTTONAxo) - ON_COMMAND(ID_BUTTONBack, OnBUTTONBack) - ON_COMMAND(ID_BUTTONBottom, OnBUTTONBottom) - ON_COMMAND(ID_BUTTONFront, OnBUTTONFront) - ON_COMMAND(ID_BUTTONHlrOff, OnBUTTONHlrOff) - ON_COMMAND(ID_BUTTONHlrOn, OnBUTTONHlrOn) - ON_COMMAND(ID_BUTTONLeft, OnBUTTONLeft) - ON_COMMAND(ID_BUTTONPan, OnBUTTONPan) - ON_COMMAND(ID_BUTTONPanGlo, OnBUTTONPanGlo) - ON_COMMAND(ID_BUTTONReset, OnBUTTONReset) - ON_COMMAND(ID_BUTTONRight, OnBUTTONRight) - ON_COMMAND(ID_BUTTONRot, OnBUTTONRot) - ON_COMMAND(ID_BUTTONTop, OnBUTTONTop) - ON_COMMAND(ID_BUTTONZoomAll, OnBUTTONZoomAll) - ON_COMMAND(ID_BUTTON_STEREOCONFIG, OnStereoConfigButton) - ON_WM_SIZE() - ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage) - ON_COMMAND(ID_BUTTONZoomProg, OnBUTTONZoomProg) - ON_COMMAND(ID_BUTTONZoomWin, OnBUTTONZoomWin) - ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOff, OnUpdateBUTTONHlrOff) - ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOn, OnUpdateBUTTONHlrOn) - ON_UPDATE_COMMAND_UI(ID_BUTTONPanGlo, OnUpdateBUTTONPanGlo) - ON_UPDATE_COMMAND_UI(ID_BUTTONPan, OnUpdateBUTTONPan) - ON_UPDATE_COMMAND_UI(ID_BUTTONZoomProg, OnUpdateBUTTONZoomProg) - ON_UPDATE_COMMAND_UI(ID_BUTTONZoomWin, OnUpdateBUTTONZoomWin) - ON_UPDATE_COMMAND_UI(ID_BUTTONRot, OnUpdateBUTTONRot) - ON_UPDATE_COMMAND_UI(ID_BUTTON_STEREOCONFIG, OnUpdateStereoConfigButton) - ON_COMMAND(ID_Modify_ChangeBackground , OnModifyChangeBackground) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// OCC_3dView construction/destruction - -OCC_3dView::OCC_3dView() -{ - // TODO: add construction code here -} - -OCC_3dView::~OCC_3dView() -{ - delete m_pStereoDlg; -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_3dView drawing -void OCC_3dView::OnInitialUpdate() -{ - OCC_BaseView::OnInitialUpdate(); - m_pStereoDlg = new OCC_StereoConfigDlg (this); - m_pStereoDlg->SetView (myView); - m_pStereoDlg->Create (IDD_DIALOG_STEREO, this); -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_3dView diagnostics - -#ifdef _DEBUG -void OCC_3dView::AssertValid() const -{ - CView::AssertValid(); -} - -void OCC_3dView::Dump(CDumpContext& dc) const -{ - CView::Dump(dc); -} - -OCC_3dDoc* OCC_3dView::GetDocument() // non-debug version is inline -{ -// ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_3dBaseDoc))); - return (OCC_3dDoc*)m_pDocument; -} - -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// OCC_3dView message handlers -void OCC_3dView::OnFileExportImage() -{ - GetDocument()->ExportView (myView); -} - -// See the back View -void OCC_3dView::OnBUTTONBack() -{ - myView->SetProj(V3d_Ypos); - myView->Redraw(); -} - -// See the front View -void OCC_3dView::OnBUTTONFront() -{ - myView->SetProj(V3d_Yneg); - myView->Redraw(); -} - -// See the bottom View -void OCC_3dView::OnBUTTONBottom() -{ - myView->SetProj(V3d_Zneg); - myView->Redraw(); -} - -// See the top View -void OCC_3dView::OnBUTTONTop() -{ - myView->SetProj(V3d_Zpos); - myView->Redraw(); -} - -// See the left View -void OCC_3dView::OnBUTTONLeft() -{ - myView->SetProj(V3d_Xneg); - myView->Redraw(); -} - -// See the right View -void OCC_3dView::OnBUTTONRight() -{ - myView->SetProj(V3d_Xpos); - myView->Redraw(); -} - -// See the axonometric View -void OCC_3dView::OnBUTTONAxo() -{ - myView->SetProj(V3d_XposYnegZpos); - myView->Redraw(); -} - -void OCC_3dView::OnBUTTONHlrOff() -{ - myView->SetComputedMode (Standard_False); - myView->Redraw(); -} - -void OCC_3dView::OnBUTTONHlrOn() -{ - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - myView->SetComputedMode (Standard_True); - myView->Redraw(); - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); -} - -void OCC_3dView::OnBUTTONPan() -{ - setCurrentAction (CurAction3d_DynamicPanning); -} - -void OCC_3dView::OnBUTTONPanGlo() -{ - // save the current zoom value - myCurZoom = myView->Scale(); - // Do a Global Zoom - myView->FitAll(); - // Set the mode - setCurrentAction (CurAction3d_GlobalPanning); -} - -void OCC_3dView::OnBUTTONReset() -{ - myView->Reset(); -} - -void OCC_3dView::OnBUTTONRot() -{ - setCurrentAction (CurAction3d_DynamicRotation); -} - -void OCC_3dView::OnBUTTONZoomAll() -{ - myView->FitAll(); - myView->ZFitAll(); -} - -void OCC_3dView::OnBUTTONZoomProg() -{ - setCurrentAction (CurAction3d_DynamicZooming); -} - -void OCC_3dView::OnBUTTONZoomWin() -{ - setCurrentAction (CurAction3d_WindowZooming); -} - -void OCC_3dView::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (!myView->ComputedMode()); - pCmdUI->Enable (myView->ComputedMode()); -} - -void OCC_3dView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (myView->ComputedMode()); - pCmdUI->Enable (!myView->ComputedMode()); -} - -void OCC_3dView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_GlobalPanning); - pCmdUI->Enable (getCurrentAction() != CurAction3d_GlobalPanning); -} - -void OCC_3dView::OnUpdateBUTTONPan(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_DynamicPanning); - pCmdUI->Enable (getCurrentAction() != CurAction3d_DynamicPanning ); -} - -void OCC_3dView::OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_DynamicZooming ); - pCmdUI->Enable (getCurrentAction() != CurAction3d_DynamicZooming); -} - -void OCC_3dView::OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_WindowZooming); - pCmdUI->Enable (getCurrentAction() != CurAction3d_WindowZooming); -} - -void OCC_3dView::OnUpdateBUTTONRot(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck (getCurrentAction() == CurAction3d_DynamicRotation); - pCmdUI->Enable (getCurrentAction() != CurAction3d_DynamicRotation); -} - -void OCC_3dView::OnModifyChangeBackground() -{ - Standard_Real R1; - Standard_Real G1; - Standard_Real B1; - myView->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1); - COLORREF m_clr ; - m_clr = RGB(R1*255,G1*255,B1*255); - - CColorDialog dlgColor(m_clr); - if (dlgColor.DoModal() == IDOK) - { - m_clr = dlgColor.GetColor(); - R1 = GetRValue(m_clr)/255.; - G1 = GetGValue(m_clr)/255.; - B1 = GetBValue(m_clr)/255.; - myView->SetBackgroundColor(Quantity_TOC_RGB,R1,G1,B1); - } - myView->Redraw(); -} - -//============================================================================= -// function: OnStereoConfigButton -// purpose: Open stereographic configuration dialog -//============================================================================= -void OCC_3dView::OnStereoConfigButton() -{ - m_pStereoDlg->ShowWindow (SW_SHOW); -} - -//============================================================================= -// function: OnUpdateStereoConfigButton -// purpose: Enable / disable state of stereo configuration button -//============================================================================= -void OCC_3dView::OnUpdateStereoConfigButton (CCmdUI* theCmdUI) -{ - // get camera - Handle(Graphic3d_Camera) aCamera = myView->Camera(); - - // check that button is enabled - Standard_Boolean isEnabled = !aCamera.IsNull() && aCamera->IsStereo(); - - // update toggle state - theCmdUI->Enable (isEnabled); - - if (!isEnabled) - { - m_pStereoDlg->ShowWindow (SW_HIDE); - } -} diff --git a/samples/mfc/standard/Common/OCC_3dView.h b/samples/mfc/standard/Common/OCC_3dView.h deleted file mode 100755 index 7dbf706395..0000000000 --- a/samples/mfc/standard/Common/OCC_3dView.h +++ /dev/null @@ -1,82 +0,0 @@ -// OCC_3dView.h: interface for the OCC_3dView class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_3DVIEW_H__1F4065AE_39C4_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_3DVIEW_H__1F4065AE_39C4_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "OCC_BaseView.h" -#include "OCC_3dDoc.h" -#include "OCC_StereoConfigDlg.h" -#include - -class Standard_EXPORT OCC_3dView : public OCC_BaseView -{ - DECLARE_DYNCREATE(OCC_3dView) -public: - OCC_3dView(); - virtual ~OCC_3dView(); - - OCC_3dDoc* GetDocument(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(OCC_3dView) -public: - virtual void OnInitialUpdate(); - //}}AFX_VIRTUAL - -// Generated message map functions -protected: - //{{AFX_MSG(OCC_3dView) - afx_msg void OnBUTTONAxo(); - afx_msg void OnBUTTONBack(); - afx_msg void OnBUTTONBottom(); - afx_msg void OnBUTTONFront(); - afx_msg void OnBUTTONHlrOff(); - afx_msg void OnBUTTONHlrOn(); - afx_msg void OnBUTTONLeft(); - afx_msg void OnBUTTONPan(); - afx_msg void OnBUTTONPanGlo(); - afx_msg void OnBUTTONReset(); - afx_msg void OnBUTTONRight(); - afx_msg void OnBUTTONRot(); - afx_msg void OnBUTTONTop(); - afx_msg void OnBUTTONZoomAll(); - afx_msg void OnFileExportImage(); - afx_msg void OnBUTTONZoomProg(); - afx_msg void OnBUTTONZoomWin(); - afx_msg void OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI); - afx_msg void OnModifyChangeBackground(); - afx_msg void OnStereoConfigButton(); - afx_msg void OnUpdateStereoConfigButton (CCmdUI* theCmdUI); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -private: - - //! Persistent non blocking stereo configuration dialog - OCC_StereoConfigDlg* m_pStereoDlg; -}; - -#ifndef _DEBUG // debug version in OCC_3dView.cpp -inline OCC_3dDoc* OCC_3dView::GetDocument() - { return (OCC_3dDoc*)m_pDocument; } -#endif - -#endif // !defined(AFX_OCC_3DVIEW_H__1F4065AE_39C4_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_App.cpp b/samples/mfc/standard/Common/OCC_App.cpp deleted file mode 100644 index 653459aea0..0000000000 --- a/samples/mfc/standard/Common/OCC_App.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// OCC_App.cpp: implementation of the OCC_App class. -// -////////////////////////////////////////////////////////////////////// - -#include - -#include "OCC_App.h" -#include "OCC_BaseDoc.h" -#include - -#include -#include -#include - -#include "afxwin.h" - -///////////////////////////////////////////////////////////////////////////// -// OCC_App - -BEGIN_MESSAGE_MAP(OCC_App, CWinApp) - //{{AFX_MSG_MAP(OCC_App) - ON_COMMAND(ID_APP_ABOUT, OnAppAbout) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG_MAP - // Standard file based document commands - ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) - ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) - ON_COMMAND(ID_BUTTON_STEREO, &OCC_App::OnStereo) - ON_UPDATE_COMMAND_UI(ID_BUTTON_STEREO, &OCC_App::OnUpdateStereo) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// OCC_App construction - -BOOL OCC_App::InitApplication() -{ - OSD::SetSignal (false); - SampleName = ""; - SetSamplePath (NULL); - try - { - Handle(Aspect_DisplayConnection) aDisplayConnection; - myGraphicDriver = new OpenGl_GraphicDriver (aDisplayConnection); - } - catch(Standard_Failure) - { - AfxMessageBox (L"Fatal error during graphic initialization", MB_ICONSTOP); - ExitProcess (1); - } - - return TRUE; -} - -void OCC_App::SetSamplePath(LPCTSTR aPath) -{ - wchar_t anAbsoluteExecutableFileName[MAX_PATH + 1]; - HMODULE hModule = GetModuleHandleW (NULL); - GetModuleFileNameW (hModule, anAbsoluteExecutableFileName, MAX_PATH); - - SamplePath = CString (anAbsoluteExecutableFileName); - int index = SamplePath.ReverseFind('\\'); - SamplePath.Delete(index+1, SamplePath.GetLength() - index - 1); - if (aPath == NULL) - SamplePath += ".."; - else{ - CString aCInitialDir(aPath); - //SamplePath += "..\\" + aCInitialDir; - } -} -///////////////////////////////////////////////////////////////////////////// -// CAboutDlgStd dialog used for App About - -class CAboutDlgStd : public CDialog -{ -public: - CAboutDlgStd(); - BOOL OnInitDialog(); - - // Dialog Data - //{{AFX_DATA(CAboutDlgStd) - enum { IDD = IDD_OCC_ABOUTBOX }; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDlgStd) -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - - -// Implementation -protected: - //{{AFX_MSG(CAboutDlgStd) - // No message handlers - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -public: - CString ReadmeText; -}; - -CAboutDlgStd::CAboutDlgStd() : CDialog(CAboutDlgStd::IDD) -, ReadmeText(_T("")) -{ - //{{AFX_DATA_INIT(CAboutDlgStd) - //}}AFX_DATA_INIT -} - -void CAboutDlgStd::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDlgStd) - //}}AFX_DATA_MAP - DDX_Text(pDX, IDC_README, ReadmeText); -} - -BEGIN_MESSAGE_MAP(CAboutDlgStd, CDialog) - //{{AFX_MSG_MAP(CAboutDlgStd) - // No message handlers - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -BOOL CAboutDlgStd::OnInitDialog(){ - CWnd* Title = GetDlgItem(IDC_ABOUTBOX_TITLE); - - CString About = "About "; - CString Sample = "Sample "; - CString SampleName = ((OCC_App*)AfxGetApp())->GetSampleName(); - CString Cascade = ", Open CASCADE Technology "; - CString Version = OCC_VERSION_STRING; - - CString strTitle = Sample + SampleName + Cascade + Version; - CString dlgTitle = About + SampleName; - - Title->SetWindowText(strTitle); - SetWindowText(dlgTitle); - - CWnd* aReadmeEdit = GetDlgItem(IDC_README); - CFile aFile; - CString aHelpFilePath = CString (((OCC_App*)AfxGetApp())->GetInitDataDir()) + L"\\README.txt"; - if(aFile.Open (aHelpFilePath, CFile::modeRead)) - { - aReadmeEdit->ShowWindow(TRUE); - UINT aFileLength = (UINT)aFile.GetLength(); - char* buffer = new char[aFileLength]; - aFile.Read(buffer,aFileLength); - ReadmeText = buffer; - delete[] buffer; - ReadmeText.Replace (L"\n", L"\r\n"); - UpdateData (FALSE); - } - else - { - aReadmeEdit->ShowWindow(FALSE); - } - - CenterWindow(); - return TRUE; -} - -// App command to run the dialog -void OCC_App::OnAppAbout() -{ - CAboutDlgStd aboutDlg; - aboutDlg.DoModal(); -} - -const wchar_t* OCC_App::GetSampleName() const -{ - return (const wchar_t* )SampleName; -} - -const wchar_t* OCC_App::GetInitDataDir() const -{ - return (const wchar_t* )SamplePath; -} - -void OCC_App::SetSampleName (const wchar_t* theName) -{ - SampleName = theName; -} - -//============================================================================= -// function: OnStereo -// purpose: -//============================================================================= -void OCC_App::OnStereo() -{ - Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myGraphicDriver); - - int anAnswer = MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, - L"It is required to switch OpenGl context to turn on / off hardware stereo support. " - L"The document views need to be re-created to change \"GL\" context pixel format. " - L"This will close all current views and open new one (the model will be kept).\n" - L"Do you want to continue?", L"Enable/disable hardware stereo support", MB_OKCANCEL | MB_ICONQUESTION); - if (anAnswer != IDOK) - { - return; - } - - Standard_Boolean& aStereoMode = aDriver->ChangeOptions().contextStereo; - - aStereoMode = !aStereoMode; - - // reset document views - POSITION aTemplateIt = GetFirstDocTemplatePosition(); - - while (aTemplateIt != NULL) - { - CDocTemplate* aTemplate = (CDocTemplate*)GetNextDocTemplate (aTemplateIt); - - POSITION aDocumentIt = aTemplate->GetFirstDocPosition(); - - while (aDocumentIt != NULL) - { - OCC_BaseDoc* aDocument = dynamic_cast (aTemplate->GetNextDoc (aDocumentIt)); - if (aDocument == NULL) - continue; - - aDocument->ResetDocumentViews (aTemplate); - } - } -} - -//============================================================================= -// function: OnUpdateStereo -// purpose: -//============================================================================= -void OCC_App::OnUpdateStereo (CCmdUI* theCmdUI) -{ - Handle(OpenGl_GraphicDriver) aDriver = - Handle(OpenGl_GraphicDriver)::DownCast (myGraphicDriver); - - theCmdUI->SetCheck (!aDriver.IsNull() && aDriver->Options().contextStereo); -} diff --git a/samples/mfc/standard/Common/OCC_App.h b/samples/mfc/standard/Common/OCC_App.h deleted file mode 100755 index 5e9447d949..0000000000 --- a/samples/mfc/standard/Common/OCC_App.h +++ /dev/null @@ -1,47 +0,0 @@ -// OCC_BaseApp.h: interface for the OCC_BaseApp class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_APP_H__425A6447_38ED_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_APP_H__425A6447_38ED_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "res\OCC_Resource.h" -#include -#include - -class Standard_EXPORT OCC_App : public CWinApp -{ -public: - void SetSampleName (const wchar_t* theName); - virtual const wchar_t* GetSampleName() const; - const wchar_t* GetInitDataDir() const; - void SetSamplePath (const wchar_t* thePath); - - virtual BOOL InitApplication (); - - Handle(Graphic3d_GraphicDriver) GetGraphicDriver() const - { - return myGraphicDriver; - } - -// Implementation - //{{AFX_MSG(OCC_BaseApp) - afx_msg void OnAppAbout(); - afx_msg void OnStereo(); - afx_msg void OnUpdateStereo (CCmdUI* theCmdUI); - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -protected: - Handle(Graphic3d_GraphicDriver) myGraphicDriver; -public: - CString SampleName; - CString SamplePath; -}; - -#endif // !defined(AFX_OCC_BASEAPP_H__425A6447_38ED_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_BaseChildFrame.cpp b/samples/mfc/standard/Common/OCC_BaseChildFrame.cpp deleted file mode 100755 index b9f11cec4a..0000000000 --- a/samples/mfc/standard/Common/OCC_BaseChildFrame.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// OCC_BaseChildFrame.cpp: implementation of the OCC_BaseChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "OCC_BaseChildFrame.h" - -#include - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame - -IMPLEMENT_DYNCREATE (OCC_BaseChildFrame, CMDIChildWnd) - -BEGIN_MESSAGE_MAP(OCC_BaseChildFrame, CMDIChildWnd) - //{{AFX_MSG_MAP(OCC_BaseChildFrame) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame construction/destruction - -OCC_BaseChildFrame::OCC_BaseChildFrame() -{ -} - -OCC_BaseChildFrame::~OCC_BaseChildFrame() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame diagnostics - -#ifdef _DEBUG -void OCC_BaseChildFrame::AssertValid() const -{ - CMDIChildWnd::AssertValid(); -} - -void OCC_BaseChildFrame::Dump(CDumpContext& dc) const -{ - CMDIChildWnd::Dump(dc); -} - -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame message handlers - -void OCC_BaseChildFrame::ActivateFrame(int nCmdShow) -{ - POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition(); - CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos); - - POSITION FirstDocPosition =DocT->GetFirstDocPosition(); - POSITION p = FirstDocPosition; - - CDocument* doc; - doc = NULL; - - if(FirstDocPosition!=NULL) - { - doc = DocT->GetNextDoc(p); - if(AfxIsValidAddress(doc, sizeof(CDocument)) && p == NULL) - { - ASSERT_VALID(doc); - POSITION position = doc->GetFirstViewPosition(); - if(position != NULL) - doc ->GetNextView(position); - if (position == NULL) - nCmdShow = SW_SHOWMAXIMIZED; - } - } - - CMDIChildWnd::ActivateFrame(nCmdShow); -} - diff --git a/samples/mfc/standard/Common/OCC_BaseChildFrame.h b/samples/mfc/standard/Common/OCC_BaseChildFrame.h deleted file mode 100755 index 22b7405780..0000000000 --- a/samples/mfc/standard/Common/OCC_BaseChildFrame.h +++ /dev/null @@ -1,42 +0,0 @@ -// OCC_BaseChildFrame.h: interface for the OCC_BaseChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_BaseChildFrame_H__230F9547_3905_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_BaseChildFrame_H__230F9547_3905_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class Standard_EXPORT OCC_BaseChildFrame : public CMDIChildWnd -{ - DECLARE_DYNCREATE(OCC_BaseChildFrame) -public: - OCC_BaseChildFrame(); - virtual ~OCC_BaseChildFrame(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(OCC_BaseChildFrame) - public: - virtual void ActivateFrame(int nCmdShow = -1); - //}}AFX_VIRTUAL - - -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -//Attributes -protected: - CToolBar m_wndToolBar; - - DECLARE_MESSAGE_MAP() - -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_OCC_BaseChildFrame_H__230F9547_3905_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_BaseDoc.cpp b/samples/mfc/standard/Common/OCC_BaseDoc.cpp deleted file mode 100755 index 8545b3ae7e..0000000000 --- a/samples/mfc/standard/Common/OCC_BaseDoc.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// OCC_BaseDoc.cpp: implementation of the OCC_BaseDoc class. -// -////////////////////////////////////////////////////////////////////// - -#include -#include "OCC_BaseDoc.h" - -const CString OCC_BaseDoc::SupportedImageFormats() const -{ - return ("BMP Files (*.BMP)|*.bmp|GIF Files (*.GIF)|*.gif|TIFF Files (*.TIFF)|*.tiff|" - "PPM Files (*.PPM)|*.ppm|JPEG Files(*.JPEG)|*.jpeg|PNG Files (*.PNG)|*.png|" - "EXR Files (*.EXR)|*.exr|TGA Files (*.TGA)|*.tga"); -} - -void OCC_BaseDoc::ExportView (const Handle(V3d_View)& theView) const -{ - CFileDialog anExportDlg (FALSE,_T("*.BMP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - SupportedImageFormats() + "||", NULL ); - - if (anExportDlg.DoModal() == IDOK) - { - // Set waiting cursor - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); - - CString aFileExt = anExportDlg.GetFileExt(); - TCollection_AsciiString aFileName ((const wchar_t* )anExportDlg.GetPathName()); - - // For pixel formats use V3d_View:Dump() method - theView->Dump (aFileName.ToCString()); - - // Restore cursor - SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); - } -} - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -OCC_BaseDoc::OCC_BaseDoc() -{ - -} - -OCC_BaseDoc::~OCC_BaseDoc() -{ - -} - -//============================================================================= -// function: ResetDocumentViews -// purpose: -//============================================================================= -void OCC_BaseDoc::ResetDocumentViews (CDocTemplate* theTemplate) -{ - // do not delete document if no views - BOOL isAutoDelete = m_bAutoDelete; - m_bAutoDelete = FALSE; - - // close all opened views - POSITION aViewIt = GetFirstViewPosition(); - while (aViewIt) - { - CView* aView = GetNextView (aViewIt); - if (aView == NULL) - { - continue; - } - - RemoveView (aView); - - aView->GetParentFrame()->SendMessage (WM_CLOSE); - } - - // create new view frame - CFrameWnd* aNewFrame = theTemplate->CreateNewFrame (this, NULL); - m_bAutoDelete = isAutoDelete; - - // init frame - theTemplate->InitialUpdateFrame(aNewFrame, this); -} diff --git a/samples/mfc/standard/Common/OCC_BaseDoc.h b/samples/mfc/standard/Common/OCC_BaseDoc.h deleted file mode 100755 index 1a8d8be604..0000000000 --- a/samples/mfc/standard/Common/OCC_BaseDoc.h +++ /dev/null @@ -1,85 +0,0 @@ -// OCC_BaseDoc.h: interface for the OCC_BaseDoc class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include -#include - -// Base class for all documents in the sample. -// Declares base functionlaity and interface for the sample documents. -// Common properties: -// - interactive context -// - 3d viewer -// Common methods: -// - base events -// - export into one of supported export formats. -class Standard_EXPORT OCC_BaseDoc : public CDocument -{ -public: - - OCC_BaseDoc(); - - virtual ~OCC_BaseDoc(); - - const Handle(AIS_InteractiveContext)& GetAISContext() const { return myAISContext; } - const Handle(AIS_InteractiveContext)& GetInteractiveContext() const { return myAISContext; }; - - const Handle(V3d_Viewer)& GetViewer() const { return myViewer; } - - // Returns string with supported export pixel and vector images formats. - const CString SupportedImageFormats() const; - - // Exports the given view into of the supported formats. - void ExportView (const Handle(V3d_View)& theView) const; - - //Events - virtual void DragEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Standard_Integer /*theState*/, - const Handle(V3d_View)& /*theView*/) {} - - virtual void InputEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) {} - - virtual void MoveEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) {} - - virtual void ShiftMoveEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) {} - - virtual void ShiftDragEvent (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Standard_Integer /*theState*/, - const Handle(V3d_View)& /*theView*/) {} - - virtual void ShiftInputEvent(const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) {} - - virtual void Popup (const Standard_Integer /*theMouseX*/, - const Standard_Integer /*theMouseY*/, - const Handle(V3d_View)& /*theView*/) {} - - //! Callback called by handleMoveTo() on Selection in 3D Viewer. - virtual void OnSelectionChanged (const Handle(AIS_InteractiveContext)& , - const Handle(V3d_View)& ) {} - - void ResetDocumentViews (CDocTemplate* theTemplate); - -protected: - - Handle(V3d_Viewer) myViewer; - Handle(AIS_InteractiveContext) myAISContext; -}; - -#endif // !defined(AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_BaseView.cpp b/samples/mfc/standard/Common/OCC_BaseView.cpp deleted file mode 100755 index a8531b7291..0000000000 --- a/samples/mfc/standard/Common/OCC_BaseView.cpp +++ /dev/null @@ -1,378 +0,0 @@ -// OCC_BaseView.cpp: implementation of the OCC_BaseView class. -// -////////////////////////////////////////////////////////////////////// - -#include -#include "OCC_BaseView.h" - -BEGIN_MESSAGE_MAP(OCC_BaseView, CView) - ON_WM_SIZE() - ON_WM_MOUSEMOVE() - ON_WM_MOUSEWHEEL() - ON_WM_MOUSELEAVE() - ON_WM_NCMOUSEMOVE() - ON_WM_LBUTTONDOWN() - ON_WM_LBUTTONUP() - ON_WM_MBUTTONDOWN() - ON_WM_MBUTTONUP() - ON_WM_RBUTTONDOWN() - ON_WM_RBUTTONUP() -END_MESSAGE_MAP() - -//======================================================================= -//function : Constructor -//purpose : -//======================================================================= -OCC_BaseView::OCC_BaseView() -: myUpdateRequests (0), - myCurZoom (0.0), - myCurrentMode (CurAction3d_Nothing) -{ - myDefaultGestures = myMouseGestureMap; -} - -//======================================================================= -//function : Destructor -//purpose : -//======================================================================= -OCC_BaseView::~OCC_BaseView() -{ - // -} - -//======================================================================= -//function : GetDocument -//purpose : -//======================================================================= -OCC_BaseDoc* OCC_BaseView::GetDocument() // non-debug version is inline -{ - return (OCC_BaseDoc*)m_pDocument; -} - -// ======================================================================= -// function : PostNcDestroy -// purpose : -// ======================================================================= -void OCC_BaseView::PostNcDestroy() -{ - if (!myView.IsNull()) - { - myView->Remove(); - myView.Nullify(); - } - CView::PostNcDestroy(); -} - -// ======================================================================= -// function : PreCreateWindow -// purpose : -// ======================================================================= -BOOL OCC_BaseView::PreCreateWindow (CREATESTRUCT& cs) -{ - cs.lpszClass = ::AfxRegisterWndClass (CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC, ::LoadCursor(NULL, IDC_ARROW), NULL, NULL); - return CView::PreCreateWindow (cs); -} - -// ======================================================================= -// function : OnInitialUpdate -// purpose : -// ======================================================================= -void OCC_BaseView::OnInitialUpdate() -{ - myCurrentMode = CurAction3d_Nothing; - CView::OnInitialUpdate(); - if (!myView.IsNull()) - { - return; - } - - myView = GetAISContext()->CurrentViewer()->CreateView(); - myView->SetImmediateUpdate (false); - myView->SetComputedMode (Standard_False); - - Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myView->Viewer()->Driver()); - myView->Camera()->SetProjectionType (aDriver->Options().contextStereo - ? Graphic3d_Camera::Projection_Stereo - : Graphic3d_Camera::Projection_Orthographic); - - Handle(WNT_Window) aWNTWindow = new WNT_Window (GetSafeHwnd()); - myView->SetWindow (aWNTWindow); - if (!aWNTWindow->IsMapped()) aWNTWindow->Map(); - - myView->Redraw(); - myView->Invalidate(); -} - -// ================================================================ -// Function : GetAISContext -// Purpose : -// ================================================================ -const Handle(AIS_InteractiveContext)& OCC_BaseView::GetAISContext() const -{ - return ((OCC_BaseDoc*)m_pDocument)->GetInteractiveContext(); -} - -// ================================================================ -// Function : update3dView -// Purpose : -// ================================================================ -void OCC_BaseView::update3dView() -{ - if (!myView.IsNull()) - { - if (++myUpdateRequests == 1) - { - Invalidate (FALSE); - UpdateWindow(); - } - } -} - -// ================================================================ -// Function : redraw3dView -// Purpose : -// ================================================================ -void OCC_BaseView::redraw3dView() -{ - if (!myView.IsNull()) - { - FlushViewEvents (GetAISContext(), myView, true); - } -} - -// ================================================================ -// Function : handleViewRedraw -// Purpose : -// ================================================================ -void OCC_BaseView::handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) -{ - myUpdateRequests = 0; - AIS_ViewController::handleViewRedraw (theCtx, theView); -} - -// ================================================================ -// Function : OnSelectionChanged -// Purpose : -// ================================================================ -void OCC_BaseView::OnSelectionChanged (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) -{ - AIS_ViewController::OnSelectionChanged (theCtx, theView); - GetDocument()->OnSelectionChanged (theCtx, theView); -} - -// ======================================================================= -// function : OnDraw -// purpose : -// ======================================================================= -void OCC_BaseView::OnDraw (CDC* ) -{ - // always redraw immediate layer (dynamic highlighting) on Paint event, - // and redraw entire view content only when it is explicitly invalidated (V3d_View::Invalidate()) - myView->InvalidateImmediate(); - FlushViewEvents (GetAISContext(), myView, true); -} - -// ======================================================================= -// function : defineMouseGestures -// purpose : -// ======================================================================= -void OCC_BaseView::defineMouseGestures() -{ - myMouseGestureMap.Clear(); - AIS_MouseGesture aRot = AIS_MouseGesture_RotateOrbit; - switch (myCurrentMode) - { - case CurAction3d_Nothing: - { - myMouseGestureMap = myDefaultGestures; - break; - } - case CurAction3d_DynamicZooming: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Zoom); - break; - } - case CurAction3d_GlobalPanning: - { - break; - } - case CurAction3d_WindowZooming: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_ZoomWindow); - break; - } - case CurAction3d_DynamicPanning: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Pan); - break; - } - case CurAction3d_DynamicRotation: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, aRot); - break; - } - } -} - -// ======================================================================= -// function : OnMouseMove -// purpose : -// ======================================================================= -void OCC_BaseView::OnMouseMove (UINT theFlags, CPoint thePoint) -{ - TRACKMOUSEEVENT aMouseEvent; // for WM_MOUSELEAVE - aMouseEvent.cbSize = sizeof(aMouseEvent); - aMouseEvent.dwFlags = TME_LEAVE; - aMouseEvent.hwndTrack = m_hWnd; - aMouseEvent.dwHoverTime = HOVER_DEFAULT; - if (!::_TrackMouseEvent (&aMouseEvent)) { TRACE("Track ERROR!\n"); } - - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - if (UpdateMousePosition (Graphic3d_Vec2i (thePoint.x, thePoint.y), PressedMouseButtons(), aFlags, false)) - { - update3dView(); - } -} - -// ======================================================================= -// function : OnLButtonDown -// purpose : -// ======================================================================= -void OCC_BaseView::OnLButtonDown (UINT theFlags, CPoint thePoint) -{ - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - PressMouseButton (Graphic3d_Vec2i (thePoint.x, thePoint.y), Aspect_VKeyMouse_LeftButton, aFlags, false); - update3dView(); -} - -// ======================================================================= -// function : OnLButtonUp -// purpose : -// ======================================================================= -void OCC_BaseView::OnLButtonUp (UINT theFlags, CPoint thePoint) -{ - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - ReleaseMouseButton (Graphic3d_Vec2i (thePoint.x, thePoint.y), Aspect_VKeyMouse_LeftButton, aFlags, false); - if (myCurrentMode == CurAction3d_GlobalPanning) - { - myView->Place (thePoint.x, thePoint.y, myCurZoom); - myView->Invalidate(); - } - if (myCurrentMode != CurAction3d_Nothing) - { - setCurrentAction (CurAction3d_Nothing); - } - update3dView(); -} - -// ======================================================================= -// function : OnMButtonDown -// purpose : -// ======================================================================= -void OCC_BaseView::OnMButtonDown (UINT theFlags, CPoint thePoint) -{ - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - PressMouseButton (Graphic3d_Vec2i (thePoint.x, thePoint.y), Aspect_VKeyMouse_MiddleButton, aFlags, false); - update3dView(); -} - -// ======================================================================= -// function : OnMButtonUp -// purpose : -// ======================================================================= -void OCC_BaseView::OnMButtonUp (UINT theFlags, CPoint thePoint) -{ - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - ReleaseMouseButton (Graphic3d_Vec2i (thePoint.x, thePoint.y), Aspect_VKeyMouse_MiddleButton, aFlags, false); - update3dView(); - if (myCurrentMode != CurAction3d_Nothing) - { - setCurrentAction (CurAction3d_Nothing); - } -} - -// ======================================================================= -// function : OnRButtonDown -// purpose : -// ======================================================================= -void OCC_BaseView::OnRButtonDown (UINT theFlags, CPoint thePoint) -{ - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - PressMouseButton (Graphic3d_Vec2i (thePoint.x, thePoint.y), Aspect_VKeyMouse_RightButton, aFlags, false); - update3dView(); - myClickPos.SetValues (thePoint.x, thePoint.y); -} - -// ======================================================================= -// function : OnRButtonUp -// purpose : -// ======================================================================= -void OCC_BaseView::OnRButtonUp (UINT theFlags, CPoint thePoint) -{ - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - ReleaseMouseButton (Graphic3d_Vec2i (thePoint.x, thePoint.y), Aspect_VKeyMouse_RightButton, aFlags, false); - update3dView(); - if (myCurrentMode != CurAction3d_Nothing) - { - setCurrentAction (CurAction3d_Nothing); - } - if (aFlags == Aspect_VKeyFlags_NONE - && (myClickPos - Graphic3d_Vec2i (thePoint.x, thePoint.y)).cwiseAbs().maxComp() <= 4) - { - GetDocument()->Popup (thePoint.x, thePoint.y, myView); - } -} - -// ======================================================================= -// function : OnMouseWheel -// purpose : -// ======================================================================= -BOOL OCC_BaseView::OnMouseWheel (UINT theFlags, short theDelta, CPoint thePoint) -{ - const Standard_Real aDeltaF = Standard_Real(theDelta) / Standard_Real(WHEEL_DELTA); - CPoint aCursorPnt = thePoint; - ScreenToClient (&aCursorPnt); - const Graphic3d_Vec2i aPos (aCursorPnt.x, aCursorPnt.y); - const Aspect_VKeyFlags aFlags = WNT_Window::MouseKeyFlagsFromEvent (theFlags); - if (UpdateMouseScroll (Aspect_ScrollDelta (aPos, aDeltaF, aFlags))) - { - update3dView(); - } - return true; -} - -// ======================================================================= -// function : OnSize -// purpose : -// ======================================================================= -void OCC_BaseView::OnSize (UINT nType, int cx, int cy) -{ - CView::OnSize (nType, cx, cy); - if (cx != 0 - && cy != 0 - && !myView.IsNull()) - { - myView->Window()->DoResize(); - myView->MustBeResized(); - myView->Invalidate(); - update3dView(); - } -} - -// ======================================================================= -// function : OnMouseLeave -// purpose : -// ======================================================================= -void OCC_BaseView::OnMouseLeave() -{ - CPoint aCursorPos; - if (GetCursorPos (&aCursorPos)) - { - ReleaseMouseButton (Graphic3d_Vec2i (aCursorPos.x, aCursorPos.y), - PressedMouseButtons(), - Aspect_VKeyMouse_NONE, - false); - } -} diff --git a/samples/mfc/standard/Common/OCC_BaseView.h b/samples/mfc/standard/Common/OCC_BaseView.h deleted file mode 100755 index ce80c81386..0000000000 --- a/samples/mfc/standard/Common/OCC_BaseView.h +++ /dev/null @@ -1,115 +0,0 @@ -// OCC_BaseView.h: interface for the OCC_BaseView class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_BASEVIEW_H__2E048CCA_38F9_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_BASEVIEW_H__2E048CCA_38F9_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include - -#include "OCC_BaseDoc.h" -#include "AIS_ViewController.hxx" - -enum CurAction3d -{ - CurAction3d_Nothing, - CurAction3d_DynamicZooming, - CurAction3d_WindowZooming, - CurAction3d_DynamicPanning, - CurAction3d_GlobalPanning, - CurAction3d_DynamicRotation -}; - -class Standard_EXPORT OCC_BaseView : public CView, public AIS_ViewController -{ - -public: - - OCC_BaseView(); - virtual ~OCC_BaseView(); - - //! Return the view. - const Handle(V3d_View)& GetView() const { return myView; } - - void FitAll() { if ( !myView.IsNull() ) myView->FitAll(); myView->ZFitAll(); }; - void Redraw() { if ( !myView.IsNull() ) myView->Redraw(); }; - - void SetZoom ( const Standard_Real& Coef ) { myView->SetZoom ( Coef ); }; - - //! Return the document. - OCC_BaseDoc* GetDocument(); - - //! Request view redrawing. - void update3dView(); - - //! Flush events and redraw view. - void redraw3dView(); - -protected: - - //! Handle view redraw. - virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) Standard_OVERRIDE; - - //! Callback called by handleMoveTo() on Selection in 3D Viewer. - virtual void OnSelectionChanged (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) Standard_OVERRIDE; - - //! Return interactive context. - virtual const Handle(AIS_InteractiveContext)& GetAISContext() const; - -protected: - - //! Setup mouse gestures. - void defineMouseGestures(); - - //! Get current action. - CurAction3d getCurrentAction() const { return myCurrentMode; } - - //! Set current action. - void setCurrentAction (CurAction3d theAction) - { - myCurrentMode = theAction; - defineMouseGestures(); - } - -public: - - virtual BOOL PreCreateWindow (CREATESTRUCT& cs) Standard_OVERRIDE; - virtual void PostNcDestroy() Standard_OVERRIDE; - -protected: - - Handle(V3d_View) myView; - AIS_MouseGestureMap myDefaultGestures; - Graphic3d_Vec2i myClickPos; - Standard_Real myCurZoom; - unsigned int myUpdateRequests; //!< counter for unhandled update requests - -private: - - CurAction3d myCurrentMode; - -// message map functions -protected: - DECLARE_MESSAGE_MAP() -public: - virtual void OnInitialUpdate() Standard_OVERRIDE; - virtual void OnDraw (CDC* /*pDC*/) Standard_OVERRIDE; - afx_msg void OnSize (UINT nType, int cx, int cy); - afx_msg BOOL OnMouseWheel (UINT theFlags, short theDelta, CPoint thePoint); - afx_msg void OnMouseMove (UINT theFlags, CPoint thePoint); - afx_msg void OnMouseLeave(); - afx_msg void OnLButtonDown (UINT theFlags, CPoint thePoint); - afx_msg void OnLButtonUp (UINT theFlags, CPoint thePoint); - afx_msg void OnMButtonDown (UINT theFlags, CPoint thePoint); - afx_msg void OnMButtonUp (UINT theFlags, CPoint thePoint); - afx_msg void OnRButtonDown (UINT theFlags, CPoint thePoint); - afx_msg void OnRButtonUp (UINT theFlags, CPoint thePoint); -}; - -#endif // !defined(AFX_OCC_BASEVIEW_H__2E048CCA_38F9_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_ChildFrame.cpp b/samples/mfc/standard/Common/OCC_ChildFrame.cpp deleted file mode 100755 index d7bcca2a51..0000000000 --- a/samples/mfc/standard/Common/OCC_ChildFrame.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// OCC_BaseChildFrame.cpp: implementation of the OCC_BaseChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "OCC_BaseChildFrame.h" - -#include - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame - -IMPLEMENT_DYNCREATE (OCC_BaseChildFrame, CMDIChildWnd) - -BEGIN_MESSAGE_MAP(OCC_BaseChildFrame, CMDIChildWnd) - //{{AFX_MSG_MAP(OCC_BaseChildFrame) - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame construction/destruction - -OCC_BaseChildFrame::OCC_BaseChildFrame() -{ -} - -OCC_BaseChildFrame::~OCC_BaseChildFrame() -{ -} - -BOOL OCC_BaseChildFrame::PreCreateWindow(CREATESTRUCT& cs) -{ - // TODO: Modify the Window class or styles here by modifying - // the CREATESTRUCT cs - - return CMDIChildWnd::PreCreateWindow(cs); -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame diagnostics - -#ifdef _DEBUG -void OCC_BaseChildFrame::AssertValid() const -{ - CMDIChildWnd::AssertValid(); -} - -void OCC_BaseChildFrame::Dump(CDumpContext& dc) const -{ - CMDIChildWnd::Dump(dc); -} - -#endif //_DEBUG - -///////////////////////////////////////////////////////////////////////////// -// OCC_BaseChildFrame message handlers - -int OCC_BaseChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_CHILDFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); - - return 0; -} - - -void OCC_BaseChildFrame::ActivateFrame(int nCmdShow) -{ - POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition(); - CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos); - POSITION p=DocT->GetFirstDocPosition(); - DocT->GetNextDoc(p); - if(p==NULL) - nCmdShow = SW_SHOWMAXIMIZED; - CMDIChildWnd::ActivateFrame(nCmdShow); -} diff --git a/samples/mfc/standard/Common/OCC_ChildFrame.h b/samples/mfc/standard/Common/OCC_ChildFrame.h deleted file mode 100755 index f2f5e91f81..0000000000 --- a/samples/mfc/standard/Common/OCC_ChildFrame.h +++ /dev/null @@ -1,47 +0,0 @@ -// OCC_BaseChildFrame.h: interface for the OCC_BaseChildFrame class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_BaseChildFrame_H__230F9547_3905_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_BaseChildFrame_H__230F9547_3905_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class OCC_BaseChildFrame : public CMDIChildWnd -{ - DECLARE_DYNCREATE(OCC_BaseChildFrame) -public: - OCC_BaseChildFrame(); - virtual ~OCC_BaseChildFrame(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(OCC_BaseChildFrame) - public: - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - virtual void ActivateFrame(int nCmdShow = -1); - //}}AFX_VIRTUAL - -// Generated message map functions - //{{AFX_MSG(OCC_BaseChildFrame) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -//Attributes -protected: - CToolBar m_wndToolBar; - - DECLARE_MESSAGE_MAP() - -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_OCC_BaseChildFrame_H__230F9547_3905_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_MainFrame.cpp b/samples/mfc/standard/Common/OCC_MainFrame.cpp deleted file mode 100755 index 82f760a5b4..0000000000 --- a/samples/mfc/standard/Common/OCC_MainFrame.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// OCC_MainFrame.cpp: implementation of the OCC_MainFrame class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "OCC_MainFrame.h" - -#include - -///////////////////////////////////////////////////////////////////////////// -// OCC_MainFrame - -IMPLEMENT_DYNAMIC(OCC_MainFrame, CMDIFrameWnd) - -BEGIN_MESSAGE_MAP(OCC_MainFrame, CMDIFrameWnd) - //{{AFX_MSG_MAP(OCC_MainFrame) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code ! - ON_WM_CREATE() - //}}AFX_MSG_MAP - ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder) -END_MESSAGE_MAP() - -static UINT indicators[] = -{ - ID_SEPARATOR, // status line indicator - ID_INDICATOR_CAPS, - ID_INDICATOR_NUM, - ID_INDICATOR_SCRL, -}; - -///////////////////////////////////////////////////////////////////////////// -// OCC_MainFrame construction/destruction - -OCC_MainFrame::OCC_MainFrame(BOOL withAISToolBar /*=false*/) -{ - m_withAISToolBar=withAISToolBar; - if(withAISToolBar){ - m_AISToolBar = new CToolBar; - } - else - m_AISToolBar = NULL; -} - -OCC_MainFrame::~OCC_MainFrame() -{ - if (m_AISToolBar) delete m_AISToolBar; -} - -int OCC_MainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - if (!m_wndToolBar.Create(this) || - !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - if (m_withAISToolBar){ - if (!m_AISToolBar->Create(this) || - !m_AISToolBar->LoadToolBar(IDR_TB_AIS)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - } - - if (!m_wndStatusBar.Create(this) || - !m_wndStatusBar.SetIndicators(indicators, - sizeof(indicators)/sizeof(UINT))) - { - TRACE0("Failed to create status bar\n"); - return -1; // fail to create - } - - // TODO: Remove this if you don't want tool tips or a resizeable toolbar - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | - CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - - // TODO: Delete these three lines if you don't want the toolbar to - // be dockable - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP); - if (m_withAISToolBar){ - m_AISToolBar->SetBarStyle(m_AISToolBar->GetBarStyle() | - CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - m_AISToolBar->EnableDocking(CBRS_ALIGN_ANY); - DockControlBarLeftOf(m_AISToolBar,&m_wndToolBar); - } - return 0; -} - -///////////////////////////////////////////////////////////////////////////// -// OCC_MainFrame diagnostics - -#ifdef _DEBUG -void OCC_MainFrame::AssertValid() const -{ - CMDIFrameWnd::AssertValid(); -} - -void OCC_MainFrame::Dump(CDumpContext& dc) const -{ - CMDIFrameWnd::Dump(dc); -} - -#endif //_DEBUG - -void OCC_MainFrame::SetStatusMessage(const CString & message) -{ - m_wndStatusBar.SetWindowText(message); -} - - -BOOL OCC_MainFrame::PreCreateWindow(CREATESTRUCT& cs) -{ - // TODO: Modify the Window class or styles here by modifying - // the CREATESTRUCT cs - return CMDIFrameWnd::PreCreateWindow(cs); -} - -void OCC_MainFrame::DockControlBarLeftOf(CToolBar* Bar,CToolBar* LeftOf) -{ - CRect rect; - DWORD dw; - UINT n; - - // get MFC to adjust the dimensions of all docked ToolBars - // so that GetWindowRect will be accurate - RecalcLayout(); - LeftOf->GetWindowRect(&rect); - rect.OffsetRect(1,0); - dw=LeftOf->GetBarStyle(); - n = 0; - n = (dw&CBRS_ALIGN_TOP) ? AFX_IDW_DOCKBAR_TOP : n; - n = (dw&CBRS_ALIGN_BOTTOM && n==0) ? AFX_IDW_DOCKBAR_BOTTOM : n; - n = (dw&CBRS_ALIGN_LEFT && n==0) ? AFX_IDW_DOCKBAR_LEFT : n; - n = (dw&CBRS_ALIGN_RIGHT && n==0) ? AFX_IDW_DOCKBAR_RIGHT : n; - - // When we take the default parameters on rect, DockControlBar will dock each Toolbar on a separate line. - // By calculating a rectangle, we in effect are simulating a Toolbar being dragged to that location and docked. - DockControlBar(Bar,n,&rect); -} diff --git a/samples/mfc/standard/Common/OCC_MainFrame.h b/samples/mfc/standard/Common/OCC_MainFrame.h deleted file mode 100755 index edfa0c1963..0000000000 --- a/samples/mfc/standard/Common/OCC_MainFrame.h +++ /dev/null @@ -1,68 +0,0 @@ -// OCC_MainFrame.h: interface for the OCC_MainFrame class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_OCC_MAINFRAME_H__B7D6F369_38DA_11D7_8611_0060B0EE281E__INCLUDED_) -#define AFX_OCC_MAINFRAME_H__B7D6F369_38DA_11D7_8611_0060B0EE281E__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include - -enum OCC_MainFrm{ - without_AIS_TB, - with_AIS_TB -}; - -class Standard_EXPORT OCC_MainFrame : public CMDIFrameWnd -{ - DECLARE_DYNAMIC(OCC_MainFrame) -public: - OCC_MainFrame(BOOL withAISToolBar = false); - virtual ~OCC_MainFrame(); - - void SetStatusMessage(const CString & message); - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CCommonMainFrame) - virtual BOOL PreCreateWindow(CREATESTRUCT& cs); - //}}AFX_VIRTUAL - - -// Implementation - -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: - void DockControlBarLeftOf(CToolBar* Bar,CToolBar* LeftOf); - - - -// Attributes -protected: // control bar embedded members - CStatusBar m_wndStatusBar; - CToolBar m_wndToolBar; - CToolBar* m_AISToolBar; - BOOL m_withAISToolBar; - - -// Generated message map functions -protected: - //{{AFX_MSG(OCC_MainFrame) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#endif // !defined(AFX_OCC_MAINFRAME_H__B7D6F369_38DA_11D7_8611_0060B0EE281E__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_StereoConfigDlg.cpp b/samples/mfc/standard/Common/OCC_StereoConfigDlg.cpp deleted file mode 100644 index 4a73d16a59..0000000000 --- a/samples/mfc/standard/Common/OCC_StereoConfigDlg.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// OCC_StereoConfigDlg.cpp : source file -/////////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "OCC_StereoConfigDlg.h" -#include - -BEGIN_MESSAGE_MAP (OCC_StereoConfigDlg, CDialog) - - ON_WM_HSCROLL() - ON_NOTIFY (UDN_DELTAPOS, IDC_SPIN_FOCUS, OnSpinFocus) - ON_NOTIFY (UDN_DELTAPOS, IDC_SPIN_IOD, OnSpinIOD) - ON_BN_CLICKED (IDC_CHECK_FOCUS_RELATIVE, OnCheckFocus) - ON_BN_CLICKED (IDC_CHECK_IOD_RELATIVE, OnCheckIOD) - ON_EN_CHANGE (IDC_EDIT_FOCUS, OnChangeFocus) - ON_EN_CHANGE (IDC_EDIT_IOD, OnChangeIOD) - -END_MESSAGE_MAP() - -// round up value macro -#define ROUND_UP(X) X = (Round(X * 10000.0) / 10000.0) - -// slider tick conversion -#define TO_SLIDER(X) (Standard_Integer)Round(X * 10) - -// back conversion from slider ticks -#define FROM_SLIDER(X) X / 10.0 - -// ============================================================================ -// function: SetView -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::SetView (const Handle(V3d_View)& theView) -{ - myView = theView; - - // access initial values - myIOD = myView->Camera()->IOD(); - myFocus = myView->Camera()->ZFocus(); - mySliderFocus = TO_SLIDER(myFocus); - myIsRelativeIOD = (myView->Camera()->GetIODType() == Graphic3d_Camera::IODType_Relative); - myIsRelativeFocus = (myView->Camera()->ZFocusType() == Graphic3d_Camera::FocusType_Relative); -} - -// ============================================================================ -// function: DoDataExchange -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::DoDataExchange(CDataExchange* theDX) -{ - CDialog::DoDataExchange(theDX); - - DDX_Text (theDX, IDC_EDIT_IOD, myIOD); - DDV_MinMaxDouble (theDX, myIOD, -DBL_MAX, DBL_MAX); - - if (myIsRelativeFocus) - { - // do slider data exchange - DDX_Slider (theDX, IDC_SLIDER_FOCUS, (int&)mySliderFocus); - DDV_MinMaxSlider (theDX, mySliderFocus, TO_SLIDER(0.1), TO_SLIDER(10)); - - // show up value in edit field - Standard_Real aEditValue = FROM_SLIDER (mySliderFocus); - DDX_Text (theDX, IDC_EDIT_FOCUS, aEditValue); - - // update focus value correspondingly - myFocus = FROM_SLIDER (mySliderFocus); - } - else - { - DDX_Text (theDX, IDC_EDIT_FOCUS, myFocus); - DDV_MinMaxDouble (theDX, myFocus, 50, DBL_MAX); - - mySliderFocus = TO_SLIDER(1.0); - DDX_Slider (theDX, IDC_SLIDER_FOCUS, (int&)mySliderFocus); - } - - DDX_Check (theDX, IDC_CHECK_FOCUS_RELATIVE, (int&)myIsRelativeFocus); - DDX_Check (theDX, IDC_CHECK_IOD_RELATIVE, (int&)myIsRelativeIOD); - - CEdit* aFocusEdit = (CEdit*) GetDlgItem (IDC_EDIT_FOCUS); - aFocusEdit->EnableWindow (myIsRelativeFocus != Standard_True); - - CSliderCtrl* aSlider = (CSliderCtrl*) GetDlgItem (IDC_SLIDER_FOCUS); - aSlider->EnableWindow (myIsRelativeFocus == Standard_True); -} - -// ============================================================================ -// function: OnHScroll -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnHScroll(UINT theSBCode, UINT thePos, CScrollBar* theScrollBar) -{ - UpdateData (true); - UpdateData (false); - UpdateCamera(); - CWnd::OnHScroll(theSBCode, thePos, theScrollBar); -} - -// ============================================================================ -// function: UpdateCamera -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::UpdateCamera() -{ - // update camera properties and redraw view - const Handle(Graphic3d_Camera)& aCamera = myView->Camera(); - if (aCamera.IsNull()) - { - return; - } - - // change IOD - Graphic3d_Camera::IODType aIODType = - myIsRelativeIOD ? Graphic3d_Camera::IODType_Relative : - Graphic3d_Camera::IODType_Absolute; - - aCamera->SetIOD (aIODType, myIOD); - - // change Focus - Graphic3d_Camera::FocusType aFocusType = - myIsRelativeFocus ? Graphic3d_Camera::FocusType_Relative : - Graphic3d_Camera::FocusType_Absolute; - - aCamera->SetZFocus (aFocusType, myFocus); - - // redraw view - myView->Redraw(); -} - -// ============================================================================ -// function: OnCheckFocus -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnCheckFocus() -{ - UpdateData (true); - - // change focus to some predefined values - if (myIsRelativeFocus) - myFocus = 1.0; - else - myFocus = 100.0; - - UpdateData (false); - UpdateCamera(); -} - -// ============================================================================ -// function: OnCheckIOD -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnCheckIOD() -{ - UpdateData (true); - UpdateCamera(); -} - -// ============================================================================ -// function: OnChangeFocus -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnChangeFocus() -{ - // keep previous value - Standard_Real aPrevFocus = myFocus; - - // read data from ui controls - if (UpdateData (true)) - { - UpdateCamera(); - } - else - { - // revert back - myFocus = aPrevFocus; - UpdateData (false); - } -} - -// ============================================================================ -// function: OnChangeIOD -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnChangeIOD() -{ - // keep previous value - Standard_Real aPrevIOD = myIOD; - - // read data from ui controls - if (UpdateData (true)) - { - UpdateCamera(); - } - else - { - // revert back - myIOD = aPrevIOD; - UpdateData (false); - } -} - -// ============================================================================ -// function: OnSpinFocus -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnSpinFocus (NMHDR* theNMHDR, LRESULT* theResult) -{ - NM_UPDOWN* aNMUpDown = (NM_UPDOWN*)theNMHDR; - - const double aStep = 0.1; // use small incremental step - const double aDelta = aNMUpDown->iDelta * aStep; // get delta - - // changes value - myFocus -= (Standard_Real)aDelta; - - // round up value - ROUND_UP (myFocus); - - // actualize view & ui controls - UpdateData (false); - UpdateCamera(); - - *theResult = 0; -} - -// ============================================================================ -// function: OnSpinIOD -// purpose: -// ============================================================================ -void OCC_StereoConfigDlg::OnSpinIOD (NMHDR* theNMHDR, LRESULT* theResult) -{ - NM_UPDOWN* aNMUpDown = (NM_UPDOWN*)theNMHDR; - - const double aStep = 0.01; // use small incremental step - const double aDelta = aNMUpDown->iDelta * aStep; // get delta - - // changes value - myIOD -= (Standard_Real)aDelta; - - // round up value - ROUND_UP (myIOD); - - // actualize view & ui controls - UpdateData (false); - UpdateCamera(); - - *theResult = 0; -} diff --git a/samples/mfc/standard/Common/OCC_StereoConfigDlg.h b/samples/mfc/standard/Common/OCC_StereoConfigDlg.h deleted file mode 100644 index 84e04f7e89..0000000000 --- a/samples/mfc/standard/Common/OCC_StereoConfigDlg.h +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// OCC_StereoConfigDlg.h : header file -/////////////////////////////////////////////////////////////////////////////// - -#ifndef OCC_StereoConfigDlg_Header -#define OCC_StereoConfigDlg_Header - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "res\OCC_Resource.h" -#include - -// Dialog to dynamically configure 3D Viewer stereo -// projection properties. -class Standard_EXPORT OCC_StereoConfigDlg : public CDialog -{ -public: - - OCC_StereoConfigDlg (CWnd* theParent = NULL) - : CDialog (IDD_DIALOG_STEREO, theParent) {} - - void SetView (const Handle(V3d_View)& theView); - -protected: - - virtual void DoDataExchange (CDataExchange* theDX); - - void UpdateCamera(); - -// Implementation -protected: - - afx_msg void OnCheckFocus(); - afx_msg void OnCheckIOD(); - afx_msg void OnChangeFocus(); - afx_msg void OnChangeIOD(); - afx_msg void OnSpinFocus (NMHDR* theNMHDR, LRESULT* theResult); - afx_msg void OnSpinIOD (NMHDR* theNMHDR, LRESULT* theResult); - afx_msg void OnHScroll(UINT theSBCode, UINT thePos, CScrollBar* theScrollBar); - - DECLARE_MESSAGE_MAP() - -private: - - Standard_Real myIOD; - Standard_Real myFocus; - Standard_Integer mySliderFocus; - Standard_Boolean myIsRelativeIOD; - Standard_Boolean myIsRelativeFocus; - Handle(V3d_View) myView; -}; - -#endif diff --git a/samples/mfc/standard/Common/ParamsFacesPage.cpp b/samples/mfc/standard/Common/ParamsFacesPage.cpp deleted file mode 100644 index 99d17479e4..0000000000 --- a/samples/mfc/standard/Common/ParamsFacesPage.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// ParamsFacesPage.cpp : implementation file -// - -#include "stdafx.h" -#include "ParamsFacesPage.h" -#include "DimensionDlg.h" -#include -#include -#include - -// CParamsFacesPage dialog - -IMPLEMENT_DYNAMIC(CParamsFacesPage, CDialog) - -CParamsFacesPage::CParamsFacesPage (Handle(AIS_InteractiveContext) theAISContext, - bool isAngleDimension /*= false*/, - CWnd* pParent /*=NULL*/) - : CDialog(CParamsFacesPage::IDD, pParent), - myAISContext (theAISContext), - myIsAngleDimension (isAngleDimension) -{ -} - -CParamsFacesPage::~CParamsFacesPage() -{ -} - -void CParamsFacesPage::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); -} - - -BEGIN_MESSAGE_MAP(CParamsFacesPage, CDialog) - ON_BN_CLICKED(IDC_FacesBtn1, &CParamsFacesPage::OnBnClickedFacesbtn1) - ON_BN_CLICKED(IDC_FacesBtn2, &CParamsFacesPage::OnBnClickedFacesbtn2) -END_MESSAGE_MAP() - - -// CParamsFacesPage message handlers - -void CParamsFacesPage::OnBnClickedFacesbtn1() -{ - // Check if face is selected - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_FACE) - { - AfxMessageBox(_T("Choose the face and press the button again"), - MB_ICONINFORMATION | MB_OK); - return; - } - - myFirstFace = TopoDS::Face (myAISContext->SelectedShape()); - - myAISContext->ClearSelected (Standard_True); -} - -void CParamsFacesPage::OnBnClickedFacesbtn2() -{ - const Standard_Integer aSelectionMode = AIS_Shape::SelectionMode (TopAbs_FACE); - - // Check if face is selected - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_FACE) - { - AfxMessageBox(_T("Choose the face and press the button again"), - MB_ICONINFORMATION | MB_OK); - return; - } - - mySecondFace = TopoDS::Face (myAISContext->SelectedShape()); - myAISContext->ClearSelected (Standard_False); - - CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner()); - - myAISContext->Deactivate (aSelectionMode); - - Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); - anAspect->MakeArrows3d (Standard_False); - anAspect->MakeText3d (aDimDlg->GetTextType()); - anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight()); - anAspect->MakeTextShaded (aDimDlg->IsText3dShaded()); - anAspect->SetCommonColor (aDimDlg->GetDimensionColor()); - anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (myIsAngleDimension) - { - // Build an angle dimension between two non-parallel edges - Handle(PrsDim_AngleDimension) anAngleDim = new PrsDim_AngleDimension (myFirstFace, mySecondFace); - anAngleDim->SetDimensionAspect (anAspect); - - if (aDimDlg->IsUnitsDisplayed()) - { - anAngleDim->SetDisplayUnits (aDimDlg->GetUnits ()); - if ((anAngleDim->GetDisplayUnits().IsEqual (TCollection_AsciiString ("deg")))) - { - anAngleDim->DimensionAspect()->MakeUnitsDisplayed (Standard_False); - } - else - { - anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No); - } - } - - anAngleDim->SetFlyout (aDimDlg->GetFlyout()); - myAISContext->Display (anAngleDim, Standard_True); - } - else - { - Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (myFirstFace, mySecondFace); - aLenDim->SetDimensionAspect (anAspect); - - if (aLenDim->DimensionAspect()->IsUnitsDisplayed()) - { - aLenDim->SetFlyout (aDimDlg->GetFlyout()); - aLenDim->SetDisplayUnits (aDimDlg->GetUnits()); - } - - myAISContext->Display (aLenDim, Standard_True); - } - - myAISContext->Activate (aSelectionMode); -} diff --git a/samples/mfc/standard/Common/ParamsFacesPage.h b/samples/mfc/standard/Common/ParamsFacesPage.h deleted file mode 100644 index 0ce2282ed8..0000000000 --- a/samples/mfc/standard/Common/ParamsFacesPage.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "res\OCC_Resource.h" -// CParamsFacesPage dialog - -class CParamsFacesPage : public CDialog -{ - DECLARE_DYNAMIC(CParamsFacesPage) -private: - Handle(AIS_InteractiveContext) myAISContext; - bool myIsAngleDimension; - TopoDS_Face myFirstFace; - TopoDS_Face mySecondFace; -public: - CParamsFacesPage (Handle(AIS_InteractiveContext) theAISContext, - bool isAngleDimension = false, - CWnd* pParent = NULL); // standard constructor - - virtual ~CParamsFacesPage(); - - // Dialog Data - enum { IDD = IDD_ParamsFacesPage }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedFacesbtn1(); - afx_msg void OnBnClickedFacesbtn2(); -}; diff --git a/samples/mfc/standard/Common/RadiusParamsPage.cpp b/samples/mfc/standard/Common/RadiusParamsPage.cpp deleted file mode 100644 index f2275d1a04..0000000000 --- a/samples/mfc/standard/Common/RadiusParamsPage.cpp +++ /dev/null @@ -1,129 +0,0 @@ - -#include "stdafx.h" -#include "RadiusParamsPage.h" -#include "DimensionDlg.h" - -#include -#include -#include -#include -#include - -IMPLEMENT_DYNAMIC(CRadiusParamsPage, CDialog) - -//======================================================================= -//function : CRadiusParamsPage -//purpose : -//======================================================================= - -CRadiusParamsPage::CRadiusParamsPage (const Handle(AIS_InteractiveContext)& theAISContext, - const Standard_Boolean isDiameterDimension /* =Standard_False*/, - CWnd* pParent /*=NULL*/) - : CDialog (CRadiusParamsPage::IDD, pParent) -{ - myAISContext = theAISContext; - myIsDiameterDimension = isDiameterDimension; -} - -//======================================================================= -//function : ~CRadiusParamsPage -//purpose : -//======================================================================= - -CRadiusParamsPage::~CRadiusParamsPage() -{ -} - -//======================================================================= -//function : DoDataExchange -//purpose : -//======================================================================= - -void CRadiusParamsPage::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); -} - - -BEGIN_MESSAGE_MAP(CRadiusParamsPage, CDialog) - ON_BN_CLICKED(IDC_BUTTON1, &CRadiusParamsPage::OnBnClickedObjectBtn) -END_MESSAGE_MAP() - -//======================================================================= -//function : OnBnClickedObjectBtn -//purpose : -//======================================================================= - -void CRadiusParamsPage::OnBnClickedObjectBtn() -{ - //Build dimension here - myAISContext->InitSelected(); - if (!myAISContext->MoreSelected() || - myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE) - { - AfxMessageBox (_T ("Choose the edge and press the button again"), MB_ICONINFORMATION | MB_OK); - return; - } - - gp_Circ aCircle; - Standard_Boolean isAttachPoint = Standard_False; - Standard_Real aFirstPar = 0, aLastPar = 0; - - TopoDS_Shape aSelShape = myAISContext->SelectedShape(); - - if (aSelShape.ShapeType() != TopAbs_EDGE && - aSelShape.ShapeType() != TopAbs_FACE && - aSelShape.ShapeType() != TopAbs_WIRE) - return; - - if (aSelShape.ShapeType() == TopAbs_EDGE) - { - BRepAdaptor_Curve aCurve (TopoDS::Edge (aSelShape)); - if (aCurve.GetType() != GeomAbs_Circle) - { - return; - } - - aCircle = aCurve.Circle(); - if (aCurve.FirstParameter() != 0 && aCurve.LastParameter() != M_PI * 2) - { - isAttachPoint = Standard_True; - aFirstPar = aCurve.FirstParameter(); - aLastPar = aCurve.LastParameter(); - } - } - - myAISContext->ClearSelected (Standard_False); - CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner()); - // Try to create dimension if it is possible - Handle(PrsDim_Dimension) aDim; - if (myIsDiameterDimension) - { - aDim = new PrsDim_DiameterDimension (aCircle); - Handle(PrsDim_DiameterDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); - } - else - { - aDim = new PrsDim_RadiusDimension (aCircle); - Handle(PrsDim_RadiusDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); - } - - Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); - anAspect->MakeArrows3d (Standard_False); - anAspect->MakeText3d (aDimDlg->GetTextType()); - anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight()); - anAspect->MakeTextShaded (aDimDlg->IsText3dShaded()); - anAspect->SetCommonColor (aDimDlg->GetDimensionColor()); - anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); - if (aDimDlg->IsUnitsDisplayed()) - { - aDim->SetDisplayUnits (aDimDlg->GetUnits()); - } - - aDim->SetDimensionAspect (anAspect); - - // Display dimension in the neutral point - - myAISContext->Display (aDim, Standard_True); - myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE)); -} diff --git a/samples/mfc/standard/Common/RadiusParamsPage.h b/samples/mfc/standard/Common/RadiusParamsPage.h deleted file mode 100755 index 0c28f4275d..0000000000 --- a/samples/mfc/standard/Common/RadiusParamsPage.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "res\OCC_Resource.h" -// CRadiusParamsPage dialog - -class CRadiusParamsPage : public CDialog -{ - DECLARE_DYNAMIC(CRadiusParamsPage) -private: - Handle(AIS_InteractiveContext) myAISContext; - Standard_Boolean myIsDiameterDimension; -public: - CRadiusParamsPage(const Handle(AIS_InteractiveContext)& theAISContext, - const Standard_Boolean isDiameterDimension = Standard_False, - CWnd* pParent = NULL); // standard constructor - virtual ~CRadiusParamsPage(); - -// Dialog Data - enum { IDD = IDD_RadiusParamsPage }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedObjectBtn(); -}; diff --git a/samples/mfc/standard/Common/Resource2D/CircularGrid.cpp b/samples/mfc/standard/Common/Resource2D/CircularGrid.cpp deleted file mode 100755 index aa811c92c6..0000000000 --- a/samples/mfc/standard/Common/Resource2D/CircularGrid.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// CircularGrid.cpp : implementation file -// - -#include "stdafx.h" - -#include "CircularGrid.h" - -///////////////////////////////////////////////////////////////////////////// -// CCircularGrid dialog - - -CCircularGrid::CCircularGrid(CWnd* pParent /*=NULL*/) - : CDialog(CCircularGrid::IDD, pParent) -{ - //{{AFX_DATA_INIT(CCircularGrid) - m_RotationAngle = 0.0; - m_XOrigin = 0.0; - m_YOrigin = 0.0; - m_RadiusStep = 0.0; - m_DivisionNumber = 0; - //}}AFX_DATA_INIT -} - - -void CCircularGrid::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CCircularGrid) - DDX_Text(pDX, IDC_CircGrid_RotationAngle, m_RotationAngle); - DDX_Text(pDX, IDC_CircGrid_XOrigin, m_XOrigin); - DDX_Text(pDX, IDC_CircGrid_Yorigin, m_YOrigin); - DDX_Text(pDX, IDC_CirctGrid_RadiusStep, m_RadiusStep); - DDX_Text(pDX, IDC_CircGrid_DivNumber, m_DivisionNumber); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CCircularGrid, CDialog) - //{{AFX_MSG_MAP(CCircularGrid) - ON_EN_UPDATE(IDC_CircGrid_DivNumber, OnUpdateCircGridDivNumber) - ON_EN_UPDATE(IDC_CircGrid_RotationAngle, OnUpdateCircGridRotationAngle) - ON_EN_UPDATE(IDC_CircGrid_XOrigin, OnUpdateCircGridXOrigin) - ON_EN_UPDATE(IDC_CircGrid_Yorigin, OnUpdateCircGridYorigin) - ON_EN_UPDATE(IDC_CirctGrid_RadiusStep, OnUpdateCirctGridRadiusStep) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CCircularGrid message handlers - -void CCircularGrid::OnCancel() -{ - myViewer->SetCircularGridValues(SavedXOrigin , SavedYOrigin, - SavedRadiusStep, SavedDivisionNumber, - SavedRotationAngle ); - CDialog::OnCancel(); -} - -void CCircularGrid::UpdateDialogData() -{ - UpdateData(TRUE); - ASSERT(!myViewer.IsNull()); - Standard_Real XOrigin,YOrigin,RadiusStep; - Standard_Integer DivisionNumber; - Standard_Real RotationAngle; - - XOrigin = m_XOrigin ; - YOrigin = m_YOrigin ; - RadiusStep = m_RadiusStep ; - DivisionNumber = m_DivisionNumber ; - RotationAngle = m_RotationAngle*M_PI/180 ; - myViewer->SetCircularGridValues(XOrigin, YOrigin, RadiusStep, DivisionNumber, RotationAngle ); - -} - - -void CCircularGrid::OnUpdateCircGridDivNumber() -{ - UpdateDialogData(); -} - -void CCircularGrid::OnUpdateCircGridRotationAngle() -{ - UpdateDialogData(); -} - -void CCircularGrid::OnUpdateCircGridXOrigin() -{ - UpdateDialogData(); -} - -void CCircularGrid::OnUpdateCircGridYorigin() -{ - UpdateDialogData(); -} - -void CCircularGrid::OnUpdateCirctGridRadiusStep() -{ - UpdateDialogData(); -} - -void CCircularGrid::UpdateValues() -{ - Standard_Real XOrigin,YOrigin,RadiusStep; - Standard_Integer DivisionNumber; - Standard_Real RotationAngle; - myViewer->CircularGridValues(XOrigin, YOrigin, RadiusStep, DivisionNumber, RotationAngle ); - m_XOrigin = SavedXOrigin = XOrigin; - m_YOrigin = SavedYOrigin = YOrigin; - m_RadiusStep = SavedRadiusStep = RadiusStep; - m_DivisionNumber = SavedDivisionNumber = DivisionNumber; - m_RotationAngle = SavedRotationAngle = RotationAngle; - UpdateData(FALSE); -} diff --git a/samples/mfc/standard/Common/Resource2D/CircularGrid.h b/samples/mfc/standard/Common/Resource2D/CircularGrid.h deleted file mode 100755 index 8c6f96b9d3..0000000000 --- a/samples/mfc/standard/Common/Resource2D/CircularGrid.h +++ /dev/null @@ -1,69 +0,0 @@ -// CircularGrid.h : header file -// - -#if !defined(AFX_CIRCULARGRID_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_) -#define AFX_CIRCULARGRID_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include - -///////////////////////////////////////////////////////////////////////////// -// CCircularGrid dialog - -class Standard_EXPORT CCircularGrid : public CDialog -{ -// Construction -public: - CCircularGrid(CWnd* pParent = NULL); // standard constructor - void SetViewer(Handle(V3d_Viewer) aViewer) { myViewer = aViewer; } ; - void UpdateValues(); -// Dialog Data - //{{AFX_DATA(CCircularGrid) - enum { IDD = IDD_GrilleCirculaire }; - double m_RotationAngle; - double m_XOrigin; - double m_YOrigin; - double m_RadiusStep; - int m_DivisionNumber; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CCircularGrid) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CCircularGrid) - virtual void OnCancel(); - afx_msg void OnUpdateCircGridDivNumber(); - afx_msg void OnUpdateCircGridRotationAngle(); - afx_msg void OnUpdateCircGridXOrigin(); - afx_msg void OnUpdateCircGridYorigin(); - afx_msg void OnUpdateCirctGridRadiusStep(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - void UpdateDialogData(); - -private : - Handle(V3d_Viewer) myViewer; - - Standard_Real SavedXOrigin,SavedYOrigin,SavedRadiusStep; - Standard_Integer SavedDivisionNumber; - Standard_Real SavedRotationAngle; - -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_CIRCULARGRID_H__338883C5_510A_11D1_A4A8_00C04FB15CA3__INCLUDED_) diff --git a/samples/mfc/standard/Common/Resource2D/RectangularGrid.cpp b/samples/mfc/standard/Common/Resource2D/RectangularGrid.cpp deleted file mode 100755 index b121c23c88..0000000000 --- a/samples/mfc/standard/Common/Resource2D/RectangularGrid.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// RectangularGrid.cpp : implementation file -// - -#include "stdafx.h" - -#include "RectangularGrid.h" - -///////////////////////////////////////////////////////////////////////////// -// CRectangularGrid dialog - - -CRectangularGrid::CRectangularGrid(CWnd* pParent /*=NULL*/) - : CDialog(CRectangularGrid::IDD, pParent) -{ - //{{AFX_DATA_INIT(CRectangularGrid) - m_XOrigin = 0.0; - m_YOrigin = 0.0; - m_XStep = 0.0; - m_YStep = 0.0; - m_RotationAngle = 0.0; - //}}AFX_DATA_INIT -} - - -void CRectangularGrid::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CRectangularGrid) - DDX_Text(pDX, IDC_RectGrid_XOrigin, m_XOrigin); - DDX_Text(pDX, IDC_RectGrid_Yorigin, m_YOrigin); - DDX_Text(pDX, IDC_RectGrid_XStep, m_XStep); - DDX_Text(pDX, IDC_RectGrid_YStep, m_YStep); - DDX_Text(pDX, IDC_RectGrid_Rotationangle, m_RotationAngle); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CRectangularGrid, CDialog) - //{{AFX_MSG_MAP(CRectangularGrid) - ON_EN_UPDATE(IDC_RectGrid_Rotationangle, OnUpdateRectGridRotationangle) - ON_EN_UPDATE(IDC_RectGrid_XOrigin, OnUpdateRectGridXOrigin) - ON_EN_UPDATE(IDC_RectGrid_XStep, OnUpdateRectGridXStep) - ON_EN_UPDATE(IDC_RectGrid_Yorigin, OnUpdateRectGridYorigin) - ON_EN_UPDATE(IDC_RectGrid_YStep, OnUpdateRectGridYStep) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CRectangularGrid message handlers - -void CRectangularGrid::UpdateDialogData() -{ - UpdateData(TRUE); - ASSERT(!myViewer.IsNull()); - Standard_Real XOrigin,YOrigin , XStep, YStep; - Standard_Real RotationAngle; - XOrigin = m_XOrigin ; - YOrigin = m_YOrigin ; - XStep = m_XStep ; - YStep = m_YStep ; - RotationAngle= m_RotationAngle*M_PI/180 ; - myViewer->SetRectangularGridValues(XOrigin, YOrigin, XStep, YStep, RotationAngle ); -} - -void CRectangularGrid::OnUpdateRectGridRotationangle() -{ - UpdateDialogData(); -} - -void CRectangularGrid::OnUpdateRectGridXOrigin() -{ - UpdateDialogData(); -} - -void CRectangularGrid::OnUpdateRectGridXStep() -{ - UpdateDialogData(); -} - -void CRectangularGrid::OnUpdateRectGridYorigin() -{ - UpdateDialogData(); -} - -void CRectangularGrid::OnUpdateRectGridYStep() -{ - UpdateDialogData(); -} - -void CRectangularGrid::OnCancel() -{ - myViewer->SetRectangularGridValues(SavedXOrigin, SavedYOrigin, - SavedXStep, SavedYStep, - SavedRotationAngle ); - CDialog::OnCancel(); -} - -void CRectangularGrid::UpdateValues() -{ - Standard_Real XOrigin, YOrigin, XStep, YStep; - Standard_Real RotationAngle; - myViewer->RectangularGridValues(XOrigin, YOrigin, XStep, YStep, RotationAngle ); - m_XOrigin = SavedXOrigin = XOrigin; - m_YOrigin = SavedYOrigin = YOrigin; - m_XStep = SavedXStep = XStep; - m_YStep = SavedYStep = YStep; - m_RotationAngle = SavedRotationAngle= RotationAngle; - UpdateData(FALSE); -} diff --git a/samples/mfc/standard/Common/Resource2D/RectangularGrid.h b/samples/mfc/standard/Common/Resource2D/RectangularGrid.h deleted file mode 100755 index c88dc05e15..0000000000 --- a/samples/mfc/standard/Common/Resource2D/RectangularGrid.h +++ /dev/null @@ -1,68 +0,0 @@ -// RectangularGrid.h : header file -// - -#if !defined(AFX_RECTANGULARGRID_H__8FB85997_50FE_11D1_A4A8_00C04FB15CA3__INCLUDED_) -#define AFX_RECTANGULARGRID_H__8FB85997_50FE_11D1_A4A8_00C04FB15CA3__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include -#include - -///////////////////////////////////////////////////////////////////////////// -// CRectangularGrid dialog - -class Standard_EXPORT CRectangularGrid : public CDialog -{ -// Construction -public: - CRectangularGrid(CWnd* pParent = NULL); // standard constructor - void SetViewer(Handle(V3d_Viewer) aViewer) { myViewer = aViewer; } ; - void UpdateValues(); - -// Dialog Data - //{{AFX_DATA(CRectangularGrid) - enum { IDD = IDD_GrilleRectangulaire }; - double m_XOrigin; - double m_YOrigin; - double m_XStep; - double m_YStep; - double m_RotationAngle; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CRectangularGrid) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CRectangularGrid) - afx_msg void OnUpdateRectGridRotationangle(); - afx_msg void OnUpdateRectGridXOrigin(); - afx_msg void OnUpdateRectGridXStep(); - afx_msg void OnUpdateRectGridYorigin(); - afx_msg void OnUpdateRectGridYStep(); - virtual void OnCancel(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - void UpdateDialogData(); - -private : - Handle(V3d_Viewer) myViewer; - - Standard_Real SavedXOrigin, SavedYOrigin, SavedXStep, SavedYStep; - Standard_Real SavedRotationAngle; -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_RECTANGULARGRID_H__8FB85997_50FE_11D1_A4A8_00C04FB15CA3__INCLUDED_) diff --git a/samples/mfc/standard/Common/ResultDialog.cpp b/samples/mfc/standard/Common/ResultDialog.cpp deleted file mode 100755 index 3a7ebca863..0000000000 --- a/samples/mfc/standard/Common/ResultDialog.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// ResultDialog.cpp : implementation file -// - -#include - -#include "ResultDialog.h" - -///////////////////////////////////////////////////////////////////////////// -// CResultDialog dialog - - -CResultDialog::CResultDialog(CWnd* pParent /*=NULL*/) - : CDialog(CResultDialog::IDD, pParent) -{ - -} - - -void CResultDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CResultDialog) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CResultDialog, CDialog) - //{{AFX_MSG_MAP(CResultDialog) - ON_BN_CLICKED(IDC_CopySelectionToClipboard, OnCopySelectionToClipboard) - ON_BN_CLICKED(IDC_CopyAllToClipboard, OnCopyAllToClipboard) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CResultDialog message handlers - -void CResultDialog::Empty() -{ - pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog); - //pEd->Clear(); - pEd->SetWindowText (L""); -} - -void CResultDialog::SetText(const CString & aText) -{ - pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog); - pEd->SetWindowText(aText); -} - -void CResultDialog::GetText(CString & aText) -{ - pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog); - pEd->GetWindowText(aText); -} - -BOOL CResultDialog::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // TODO: Add extra initialization here - pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -void CResultDialog::SetTitle(const CString & aTitle) -{ - SetWindowText(aTitle); -} - -void CResultDialog::OnCopySelectionToClipboard() -{ - // TODO: Add your control notification handler code here - pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog); - pEd->Copy( ); -} - -void CResultDialog::OnCopyAllToClipboard() -{ - // TODO: Add your control notification handler code here - pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog); - CHARRANGE CurrentSel; - pEd->GetSel( CurrentSel ); - - pEd->SetSel(0,-1 ); - pEd->Copy( ); - - pEd->SetSel( CurrentSel ); -} - - - diff --git a/samples/mfc/standard/Common/ResultDialog.h b/samples/mfc/standard/Common/ResultDialog.h deleted file mode 100755 index 31c07a7289..0000000000 --- a/samples/mfc/standard/Common/ResultDialog.h +++ /dev/null @@ -1,61 +0,0 @@ -// ResultDialog.h : header file -// - -#if !defined(AFX_RESULTDIALOG_H__0307BDF3_AF53_11D1_8DAE_0800369C8A03__INCLUDED_) -#define AFX_RESULTDIALOG_H__0307BDF3_AF53_11D1_8DAE_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include - -#include "res\OCC_Resource.h" -#include - -///////////////////////////////////////////////////////////////////////////// -// CResultDialog dialog - -class Standard_EXPORT CResultDialog : public CDialog -{ - -public: - CResultDialog(CWnd* pParent = NULL); - void SetTitle(const CString& aTitle); - void SetText(const CString& aText); - void GetText(CString& aText); - void Empty(); - -// Dialog Data - //{{AFX_DATA(CResultDialog) - enum { IDD = IDD_ResultDialog }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CResultDialog) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CResultDialog) - virtual BOOL OnInitDialog(); - afx_msg void OnCopySelectionToClipboard(); - afx_msg void OnCopyAllToClipboard(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -//Attributes -private: - CRichEditCtrl * pEd; -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_RESULTDIALOG_H__0307BDF3_AF53_11D1_8DAE_0800369C8A03__INCLUDED_) diff --git a/samples/mfc/standard/Common/StdAfx.h b/samples/mfc/standard/Common/StdAfx.h deleted file mode 100755 index 80f1b06ba9..0000000000 --- a/samples/mfc/standard/Common/StdAfx.h +++ /dev/null @@ -1,118 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#ifndef NOMINMAX - #define NOMINMAX // Prevent Windows from defining min/max macros -#endif - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#pragma warning( disable : 4244 ) // Issue warning 4244 -#include "Standard_ShortReal.hxx" -#pragma warning( default : 4244 ) // Issue warning 4244 - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "TopExp.hxx" -#include -#include -#include -#include -#include -#include -#include -#include "TopoDS_Edge.hxx" -#include "TopoDS_Vertex.hxx" -#include -#include - -#include -#include -#include - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - diff --git a/samples/mfc/standard/Common/Winmain.cpp b/samples/mfc/standard/Common/Winmain.cpp deleted file mode 100755 index 09479a3b0d..0000000000 --- a/samples/mfc/standard/Common/Winmain.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// This is a part of the Microsoft Foundation Classes C++ library. -// Copyright (C) 1992-1995 Microsoft Corporation -// All rights reserved. -// -// This source code is only intended as a supplement to the -// Microsoft Foundation Classes Reference and related -// electronic documentation provided with the library. -// See these sources for detailed information regarding the -// Microsoft Foundation Classes product. - -#include "stdafx.h" - -#include -#include -#include -#include -#include -#include - -#ifdef AFX_CORE1_SEG -#pragma code_seg(AFX_CORE1_SEG) -#endif - -///////////////////////////////////////////////////////////////////////////// -// Standard WinMain implementation -// Can be replaced as long as 'AfxWinInit' is called first - -// for cout redefinition : -#include // for _open_osfhandle -#include // for _O_TEXT - -#ifdef _DEBUG -#define DISPLAYCONSOLE 1 -#endif - -int AFXAPI AfxWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, int nCmdShow) -{ -#ifdef DISPLAYCONSOLE - - // Redirection of standard output to console - int hCrt; BOOL rep; FILE *hf; - _SYSTEM_INFO lps; - GetSystemInfo(&lps); - rep = AllocConsole(); - hCrt = _open_osfhandle((intptr_t) GetStdHandle(STD_OUTPUT_HANDLE),_O_TEXT); - hf = _fdopen( hCrt, "w" ); - *stdout = *hf; - // stop the buffer on stdout -// int i = setvbuf( stdout, NULL, _IONBF, 0 ); -// filebuf ff(hCrt); -// cout = &ff; - std::cout<<"This Debug Window is defined in WinMain.cpp and will disappear in release mode"<AddPrinter (new Message_PrinterOStream ("OCCSampleRun.log", Standard_False)); - - ASSERT(hPrevInstance == NULL); - - int nReturnCode = -1; - CWinApp* pApp = AfxGetApp(); - -// new in 2.0 CAS.CADE uses the standard C++ exception mechanism -/*#ifdef _DEBUG // By Matra - // _Function declaratiob here because you can jump to InitFailure - Standard_ErrorHandler _Function; -#endif // _DEBUG // By Matra -*/ - // AFX internal initialization - if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow)) - goto InitFailure; - - // App global initializations (rare) - ASSERT_VALID(pApp); - if (!pApp->InitApplication()) - goto InitFailure; - ASSERT_VALID(pApp); - - // Perform specific initializations - if (!pApp->InitInstance()) - { - if (pApp->m_pMainWnd != NULL) - { - TRACE0("Warning: Destroying non-NULL m_pMainWnd\n"); - pApp->m_pMainWnd->DestroyWindow(); - } - nReturnCode = pApp->ExitInstance(); - goto InitFailure; - } - ASSERT_VALID(pApp); - - -#ifdef _DEBUG // By Matra -Application: - -// new in 2.0 CAS.CADE uses the standard C++ exception mechanism - - // if(DoesNotAbort(_Function)) - try - { - nReturnCode = pApp->Run(); - } -// if(_Function.Catches(STANDARD_TYPE(Standard_Failure))) - catch(Standard_Failure const& anException) - { - Standard_SStream ostr; - ostr<Run(); -#endif // _DEBUG // By Matra - - - ASSERT_VALID(pApp); - -InitFailure: -#ifdef _DEBUG - // Check for missing AfxLockTempMap calls - if (AfxGetModuleThreadState()->m_nTempMapLock != 0) - { - TRACE1("Warning: Temp map lock count non-zero (%ld).\n", - AfxGetModuleThreadState()->m_nTempMapLock); - } - - AfxLockTempMaps(); - AfxUnlockTempMaps(); -#endif - - AfxWinTerm(); - -#ifdef DISPLAYCONSOLE // By Matra - // ferme la console pour le cout - fclose( stdout ); - //hCrt = _fcloseall(); :-) - rep = FreeConsole(); -#endif // DISPLAYCONSOLE // By Matra - - - return nReturnCode; -} - -///////////////////////////////////////////////////////////////////////////// diff --git a/samples/mfc/standard/Common/res/2dChildFrameTB.bmp b/samples/mfc/standard/Common/res/2dChildFrameTB.bmp deleted file mode 100755 index f46b327442..0000000000 Binary files a/samples/mfc/standard/Common/res/2dChildFrameTB.bmp and /dev/null differ diff --git a/samples/mfc/standard/Common/res/2dType.ico b/samples/mfc/standard/Common/res/2dType.ico deleted file mode 100755 index 73960be966..0000000000 Binary files a/samples/mfc/standard/Common/res/2dType.ico and /dev/null differ diff --git a/samples/mfc/standard/Common/res/3dChildFrameTB.bmp b/samples/mfc/standard/Common/res/3dChildFrameTB.bmp deleted file mode 100755 index 0b010372f7..0000000000 Binary files a/samples/mfc/standard/Common/res/3dChildFrameTB.bmp and /dev/null differ diff --git a/samples/mfc/standard/Common/res/3dType.ico b/samples/mfc/standard/Common/res/3dType.ico deleted file mode 100755 index 76f83783a1..0000000000 Binary files a/samples/mfc/standard/Common/res/3dType.ico and /dev/null differ diff --git a/samples/mfc/standard/Common/res/AIS_TB.bmp b/samples/mfc/standard/Common/res/AIS_TB.bmp deleted file mode 100755 index edb1f3728e..0000000000 Binary files a/samples/mfc/standard/Common/res/AIS_TB.bmp and /dev/null differ diff --git a/samples/mfc/standard/Common/res/MainFrame.ico b/samples/mfc/standard/Common/res/MainFrame.ico deleted file mode 100755 index 99dbceb637..0000000000 Binary files a/samples/mfc/standard/Common/res/MainFrame.ico and /dev/null differ diff --git a/samples/mfc/standard/Common/res/OCC_Resource.h b/samples/mfc/standard/Common/res/OCC_Resource.h deleted file mode 100755 index d6991dac47..0000000000 --- a/samples/mfc/standard/Common/res/OCC_Resource.h +++ /dev/null @@ -1,199 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by OCC_Resource.rc -// -#define IDD_ParamsFacesPage 101 -#define IDR_POPUP 116 -#define IDD_Dimension 119 -#define IDD_DIALOG_STEREO 120 -#define IDD_LengthParamsEdgePage 122 -#define IDD_LengthParamsVerticesPage 123 -#define IDD_LengthParamsEdgesPage 125 -#define IDD_AngleParamsVerticesPage 126 -#define IDR_MAINFRAME 128 -#define IDD_RadiusParamsPage 128 -#define IDR_2DTYPE 129 -#define IDR_3DTYPE 131 -#define ID_FILE_EXPORT_IMAGE 132 -#define IDR_Popup2D 136 -#define IDR_2dCHILDFRAME 137 -#define IDR_3dCHILDFRAME 138 -#define IDD_ResultDialog 143 -#define IDD_FILESAVESTEP 145 -#define IDR_Popup3D 146 -#define IDR_TB_AIS 149 -#define IDD_GrilleRectangulaire 150 -#define IDD_GrilleCirculaire 151 -#define IDR_RAY_TRACING 182 -#define IDD_COLORMESH 552 -#define IDB_coloredmesh 554 -#define IDC_RICHEDIT_ResultDialog 1001 -#define IDC_ResultNameEdit 1003 -#define IDC_README 1004 -#define IDC_DimensionGroupbox 1005 -#define IDD_DIMENSIONDLG 1006 -#define IDC_TextParamGroupbox 1007 -#define IDC_DimensionParametersGroupbox 1010 -#define IDC_TAB1 1011 -#define IDC_LengthTab 1014 -#define IDC_AngleTab 1015 -#define IDC_BUTTON1 1016 -#define IDC_XPOS 1017 -#define IDC_BUTTON2 1018 -#define IDC_BUTTON3 1019 -#define IDC_YPOS 1020 -#define IDC_BUTTON4 1021 -#define IDC_RadiusTab 1022 -#define IDC_ZPOS 1023 -#define IDC_ChooseEdgeBtn 1025 -#define IDC_ChooseEdgeEdit 1026 -#define IDC_Flyout 1028 -#define IDC_DiameterTab 1031 -#define IDC_DimLength 1032 -#define IDC_DimAngle 1033 -#define IDC_DimRadius 1034 -#define IDC_DimDiameter 1035 -#define IDC_2DText 1036 -#define IDC_3DText 1037 -#define IDC_FontSize 1038 -#define IDC_FontSizeStatic 1039 -#define IDC_FlyoutStatic 1044 -#define IDC_DisplayUnits 1045 -#define IDC_DisplayUnitsStatic 1046 -#define IDC_TextDisplayMode 1047 -#define IDC_TextDisplayModeStatic 1048 -#define IDC_DimensionColor 1049 -#define IDC_EDIT_IOD 1050 -#define IDC_SPIN_IOD 1051 -#define IDC_CHECK_IOD_RELATIVE 1052 -#define IDC_CHECK_FOCUS_RELATIVE 1053 -#define IDC_SLIDER_FOCUS 1054 -#define IDC_EDIT_FOCUS 1055 -#define IDC_SPIN_FOCUS 1056 -#define IDC_FacesSt1 1057 -#define IDC_FacesSt2 1058 -#define IDC_FacesBtn1 1059 -#define IDC_FacesBtn2 1060 -#define ID_WINDOW_NEW3D 1151 -#define ID_OBJECT_DISPLAYALL 1201 -#define ID_OBJECT_MATERIAL 1205 -#define ID_OBJECT_TRANSPARENCY 1214 -#define IDB_OCC_LOGO 1300 -#define IDC_RectGrid_XOrigin 1400 -#define IDC_RectGrid_Yorigin 1401 -#define IDC_RectGrid_XStep 1402 -#define IDC_RectGrid_YStep 1403 -#define IDC_RectGrid_Rotationangle 1404 -#define IDC_CircGrid_XOrigin 1405 -#define IDC_CircGrid_Yorigin 1406 -#define IDC_CirctGrid_RadiusStep 1407 -#define IDC_CircGrid_DivNumber 1408 -#define IDC_CircGrid_RotationAngle 1409 -#define IDC_CopySelectionToClipboard 1502 -#define IDC_CopyAllToClipboard 1503 -#define IDC_CHECK_XRed 1761 -#define IDC_CHECK_XGreen 1762 -#define IDC_CHECK_YRed 1763 -#define IDC_CHECK_YGreen 1764 -#define IDC_CHECK_YBlue 1765 -#define IDC_CHECK_ZRed 1766 -#define IDC_RADIO1 1767 -#define IDC_RADIO2 1768 -#define IDC_RADIO3 1769 -#define IDC_CHECK_ZGreen 1770 -#define IDC_CHECK_ZBlue 1771 -#define IDC_CHECK_XBlue 1772 -#define IDC_CHECK_X1 1773 -#define IDC_CHECK_Y1 1774 -#define IDC_CHECK_Z1 1775 -#define IDC_FSaveSTEP_Type 3002 -#define IDD_AISMATERIAL 7544 -#define IDD_AISMATERIAL1 7545 -#define IDD_AISTRANSPARENCY 7546 -#define IDD_OCC_ABOUTBOX 10000 -#define IDC_ABOUTBOX_TITLE 10001 -#define IDD_AISMATERIAL2 10001 -#define ID_BUTTON2DFitAll 32770 -#define ID_BUTTON2DZoomWin 32771 -#define ID_BUTTON2DZoomProg 32772 -#define ID_BUTTON2DPanning 32773 -#define ID_BUTTON2DGlobPanning 32774 -#define ID_BUTTON2DGridValues 32775 -#define ID_BUTTON2DGridCircPoints 32776 -#define ID_BUTTON2DGridCancel 32777 -#define ID_BUTTON2DGridRectLines 32778 -#define ID_BUTTON2DGridRectPoints 32779 -#define ID_BUTTON2DGridCircLines 32780 -#define ID_OBJECT_REMOVE 32796 -#define ID_OBJECT_RAY_TRACING 32898 -#define ID_OBJECT_SHADOWS 32899 -#define ID_OBJECT_REFLECTIONS 32900 -#define ID_OBJECT_ANTI_ALIASING 32902 -#define ID_BUTTONZoomAll 40000 -#define ID_OBJECT_ERASE 40001 -#define ID_BUTTONZoomWin 40002 -#define ID_BUTTONZoomProg 40003 -#define ID_BUTTONPan 40004 -#define ID_BUTTONPanGlo 40005 -#define ID_BUTTONFront 40006 -#define ID_BUTTONLeft 40007 -#define ID_BUTTONBack 40008 -#define ID_BUTTONRight 40009 -#define ID_BUTTONBottom 40010 -#define ID_BUTTONRot 40011 -#define ID_BUTTONReset 40012 -#define ID_BUTTONHlrOff 40013 -#define ID_BUTTONHlrOn 40014 -#define ID_BUTTONAxo 40015 -#define ID_BUTTONTop 40016 -#define ID_BUTTON40017 40017 -#define ID_BUTTON40033 40033 -#define ID_OBJECT_DIMENSIONS 40035 -#define ID_OBJECT_DIM 40036 -#define ID_LOCALCONTEXT_ADDDIMENSION 40037 -#define ID_BUTTON_STEREOSETTINGS 40038 -#define ID_BUTTON_STEREO 40039 -#define ID_BUTTON_STEREOCONFIG 40040 -#define ID_FILE_IMPORT_BREP 40101 -#define ID_FILE_IMPORT_STEP 40102 -#define ID_FILE_IMPORT_IGES 40103 -#define ID_FILE_EXPORT_BREP 40105 -#define ID_FILE_EXPORT_STEP 40106 -#define ID_FILE_EXPORT_IGES 40107 -#define ID_OBJECT_COLOR 40201 -#define ID_OBJECT_SHADING 40202 -#define ID_OBJECT_WIREFRAME 40203 -#define ID_OBJECT_MATERIAL_BRASS 40210 -#define ID_OBJECT_MATERIAL_BRONZE 40211 -#define ID_OBJECT_MATERIAL_COPPER 40212 -#define ID_OBJECT_MATERIAL_GOLD 40213 -#define ID_OBJECT_MATERIAL_PEWTER 40214 -#define ID_OBJECT_MATERIAL_PLASTER 40215 -#define ID_OBJECT_MATERIAL_PLASTIC 40216 -#define ID_OBJECT_MATERIAL_SILVER 40217 -#define ID_OBJECT_MATERIAL_STEEL 40218 -#define ID_OBJECT_MATERIAL_STONE 40219 -#define ID_OBJECT_MATERIAL_SHINY_PLASTIC 40220 -#define ID_OBJECT_MATERIAL_SATIN 40221 -#define ID_OBJECT_MATERIAL_METALIZED 40222 -#define ID_OBJECT_MATERIAL_NEON_GNC 40223 -#define ID_OBJECT_MATERIAL_CHROME 40224 -#define ID_OBJECT_MATERIAL_ALUMINIUM 40225 -#define ID_OBJECT_MATERIAL_OBSIDIAN 40226 -#define ID_OBJECT_MATERIAL_NEON_PHC 40227 -#define ID_OBJECT_MATERIAL_JADE 40228 -#define ID_OBJECT_MATERIAL_DEFAULT 40229 -#define ID_Modify_ChangeBackground 40230 -#define IDC_EDITAISTRANSP 40309 -#define IDC_SPINAISTRANSP 40310 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 40041 -#define _APS_NEXT_CONTROL_VALUE 1061 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/samples/mfc/standard/Common/res/OCC_Resource.rc b/samples/mfc/standard/Common/res/OCC_Resource.rc deleted file mode 100755 index 38898aac7a..0000000000 --- a/samples/mfc/standard/Common/res/OCC_Resource.rc +++ /dev/null @@ -1,729 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "OCC_Resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -#include "OCC_Resource.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "OCC_Resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "#include ""OCC_Resource.h""\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_OCC_LOGO BITMAP "occ_logo.bmp" -IDR_2dCHILDFRAME BITMAP "2dChildFrameTB.bmp" -IDR_3dCHILDFRAME BITMAP "3dChildFrameTB.bmp" -IDR_TB_AIS BITMAP "AIS_TB.bmp" -IDB_coloredmesh BITMAP "coloredm.bmp" -IDR_RAY_TRACING BITMAP "ToolbarRayTracing.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_RadiusParamsPage DIALOGEX 0, 0, 121, 46 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Click to set up selected circle or arc",IDC_BUTTON1,26,10,70,25,BS_MULTILINE -END - -IDD_AngleParamsVerticesPage DIALOGEX 0, 0, 126, 69 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Set up selected vertex",IDC_BUTTON1,39,7,83,18,BS_MULTILINE - LTEXT "Vertex1",IDC_STATIC,10,12,26,8 - PUSHBUTTON "Set up selected vertex",IDC_BUTTON3,39,26,83,17 - LTEXT "Vertex2",IDC_STATIC,9,30,26,8 - PUSHBUTTON "Set up selected vertex",IDC_BUTTON4,39,44,83,18 - LTEXT "Vertex3",IDC_STATIC,9,47,26,8 -END - -IDD_LengthParamsEdgePage DIALOGEX 0, 0, 70, 35 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Click to set up selected edge",IDC_ChooseEdgeBtn,1,1,66,30,BS_MULTILINE -END - -IDD_LengthParamsVerticesPage DIALOGEX 0, 0, 135, 55 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Vertex1",IDC_STATIC,7,11,26,8 - LTEXT "Vertex2",IDC_STATIC,7,35,26,8 - PUSHBUTTON "Click to set up selected vertex",IDC_BUTTON1,39,4,74,21,BS_MULTILINE - PUSHBUTTON "Click to set up selected vertex",IDC_BUTTON2,39,31,74,20,BS_MULTILINE -END - -IDD_LengthParamsEdgesPage DIALOGEX 0, 0, 128, 60 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Click to set up selected edge",IDC_BUTTON1,33,1,82,26,BS_MULTILINE - PUSHBUTTON "Click to set up selected edge",IDC_BUTTON3,34,30,81,26,BS_MULTILINE - LTEXT "Edge1",IDC_STATIC,6,12,21,8 - LTEXT "Edge2",IDC_STATIC,6,33,21,8 -END - -IDD_OCC_ABOUTBOX DIALOGEX 34, 22, 284, 257 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CTEXT "Sample SampleName, Open CASCADE Technology OCC_Version",IDC_ABOUTBOX_TITLE,32,9,227,8 - CTEXT "Copyright (C) 2001-2013, Open CASCADE S.A.S",IDC_STATIC,53,99,165,8,SS_CENTERIMAGE - DEFPUSHBUTTON "OK",IDOK,101,233,88,14,WS_GROUP - CTEXT "http://www.opencascade.com",IDC_STATIC,92,116,98,8,SS_CENTERIMAGE - CONTROL 1300,IDC_STATIC,"Static",SS_BITMAP,73,28,132,64,WS_EX_CLIENTEDGE - EDITTEXT IDC_README,7,131,270,94,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL -END - -IDD_ResultDialog DIALOG 0, 0, 212, 202 -STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "",IDC_RICHEDIT_ResultDialog,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,2,9,207,162 - PUSHBUTTON "Copy selection to clipboard",IDC_CopySelectionToClipboard,5,176,100,15 - PUSHBUTTON "Copy all to clipboard",IDC_CopyAllToClipboard,107,176,100,15 -END - -IDD_GrilleRectangulaire DIALOG 0, 0, 124, 145 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Rectangular Grid" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,38,107,50,14 - PUSHBUTTON "Cancel",IDCANCEL,38,124,50,14 - EDITTEXT IDC_RectGrid_XOrigin,73,5,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_RectGrid_Yorigin,73,25,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_RectGrid_XStep,73,45,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_RectGrid_YStep,73,65,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_RectGrid_Rotationangle,73,85,45,15,ES_AUTOHSCROLL - LTEXT "X Origin",IDC_STATIC,14,7,45,15 - LTEXT "Y Origin",IDC_STATIC,14,27,45,15 - LTEXT "X Step",IDC_STATIC,14,47,45,15 - LTEXT "Y Step ",IDC_STATIC,14,67,45,15 - LTEXT "Rotation angle ",IDC_STATIC,14,87,51,15 -END - -IDD_GrilleCirculaire DIALOG 0, 0, 124, 145 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Circular Grid" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,38,107,50,14 - PUSHBUTTON "Cancel",IDCANCEL,38,124,50,14 - EDITTEXT IDC_CircGrid_XOrigin,73,5,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_CircGrid_Yorigin,73,25,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_CirctGrid_RadiusStep,73,45,45,15,ES_AUTOHSCROLL - EDITTEXT IDC_CircGrid_DivNumber,73,65,45,15,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_CircGrid_RotationAngle,73,85,45,15,ES_AUTOHSCROLL - LTEXT "X Origin",IDC_STATIC,0,7,55,15 - LTEXT "Y Origin",IDC_STATIC,0,27,55,15 - LTEXT "RadiusStep",IDC_STATIC,0,47,55,15 - LTEXT "Division number",IDC_STATIC,0,67,55,15 - LTEXT "Rotation angle ",IDC_STATIC,0,87,55,15 -END - -IDD_AISTRANSPARENCY DIALOG 0, 0, 68, 28 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Transparency" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_EDITAISTRANSP,15,6,27,12,ES_AUTOHSCROLL | ES_NUMBER | WS_GROUP - CONTROL "Spin1",IDC_SPINAISTRANSP,"msctls_updown32",UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP,41,6,11,12 -END - -IDD_AISMATERIAL DIALOG 0, 0, 71, 221 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Material" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "",IDC_STATIC,15,211,8,8 - CONTROL "Copper",ID_OBJECT_MATERIAL_COPPER,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,43,56,10 - CONTROL "Aluminium",ID_OBJECT_MATERIAL_ALUMINIUM,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,3,56,10 - CONTROL "Chrome",ID_OBJECT_MATERIAL_CHROME,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,33,56,10 - CONTROL "Bronze",ID_OBJECT_MATERIAL_BRONZE,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,23,56,10 - CONTROL "Metilized",ID_OBJECT_MATERIAL_METALIZED,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,73,56,10 - CONTROL "Brass",ID_OBJECT_MATERIAL_BRASS,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,13,56,10 - CONTROL "Gold",ID_OBJECT_MATERIAL_GOLD,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,53,56,10 - CONTROL "Pewter",ID_OBJECT_MATERIAL_PEWTER,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,112,56,10 - CONTROL "Silver",ID_OBJECT_MATERIAL_SILVER,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,162,56,10 - CONTROL "Steel",ID_OBJECT_MATERIAL_STEEL,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,172,56,10 - CONTROL "Neon PHC",ID_OBJECT_MATERIAL_NEON_PHC,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,93,56,10 - CONTROL "Stone",ID_OBJECT_MATERIAL_STONE,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,182,56,10 - CONTROL "Obsidian",ID_OBJECT_MATERIAL_OBSIDIAN,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,103,56,10 - CONTROL "Jade",ID_OBJECT_MATERIAL_JADE,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,63,56,10 - CONTROL "Plastic",ID_OBJECT_MATERIAL_PLASTIC,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,122,56,10 - CONTROL "Plaster",ID_OBJECT_MATERIAL_PLASTER,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,132,56,10 - CONTROL "Shiny Plastic",ID_OBJECT_MATERIAL_SHINY_PLASTIC,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,152,56,10 - CONTROL "Satin",ID_OBJECT_MATERIAL_SATIN,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,142,56,10 - CONTROL "Neon GNC",ID_OBJECT_MATERIAL_NEON_GNC,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,83,56,10 - CONTROL "Default",ID_OBJECT_MATERIAL_DEFAULT,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE,5,201,56,10 -END - -IDD_COLORMESH DIALOG 0, 0, 167, 194 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "Colored mesh" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,58,171,50,14 - GROUPBOX "Altitude",IDC_STATIC,7,7,153,58 - CONTROL "green to brown",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,19,22,132,16 - CONTROL "blue to white",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,19,42,132,16 - CONTROL "Custom :",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,20,70,39,16 - LTEXT "Red",IDC_STATIC,53,95,16,10 - LTEXT "Green",IDC_STATIC,71,95,21,10 - LTEXT "Blue",IDC_STATIC,96,95,17,10 - LTEXT "X",IDC_STATIC,26,115,10,10 - LTEXT "Y",IDC_STATIC,26,130,10,10 - LTEXT "Z",IDC_STATIC,26,145,10,10 - CONTROL "",IDC_CHECK_XRed,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,115,10,8 - CONTROL "",IDC_CHECK_XGreen,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,115,10,8 - CONTROL "",IDC_CHECK_YRed,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,130,10,8 - CONTROL "",IDC_CHECK_YGreen,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,130,10,8 - CONTROL "",IDC_CHECK_YBlue,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,130,10,8 - CONTROL "",IDC_CHECK_ZRed,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,145,10,8 - CONTROL "",IDC_CHECK_ZGreen,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,145,10,8 - CONTROL "",IDC_CHECK_ZBlue,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,145,10,8 - CONTROL "",IDC_CHECK_XBlue,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,115,10,8 - LTEXT "-1",IDC_STATIC,128,95,10,10,NOT WS_VISIBLE - CONTROL "",IDC_CHECK_X1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,128,115,10,8 - CONTROL "",IDC_CHECK_Y1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,128,130,10,8 - CONTROL "",IDC_CHECK_Z1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,128,145,10,8 - GROUPBOX "",IDC_STATIC,21,104,120,9 - GROUPBOX "",IDC_STATIC,40,86,8,73 - GROUPBOX "",IDC_STATIC,115,86,8,73 -END - -IDD_Dimension DIALOGEX 0, 0, 236, 337 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add dimension" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,97,311,50,14 - GROUPBOX "Dimension",IDC_DimensionGroupbox,8,9,64,85 - CONTROL "",IDC_LengthTab,"SysTabControl32",0x0,11,205,194,95 - CONTROL "",IDC_AngleTab,"SysTabControl32",NOT WS_VISIBLE,10,205,193,94 - CONTROL "",IDC_RadiusTab,"SysTabControl32",0x0,10,205,193,93 - GROUPBOX "Dimension parameters",IDC_DimensionParametersGroupbox,9,103,209,84,WS_GROUP - CONTROL "",IDC_DiameterTab,"SysTabControl32",0x0,10,205,194,92 - CONTROL "Length",IDC_DimLength,"Button",BS_AUTORADIOBUTTON | WS_GROUP,20,26,38,10 - CONTROL "Angle",IDC_DimAngle,"Button",BS_AUTORADIOBUTTON,20,38,34,10 - CONTROL "Radius",IDC_DimRadius,"Button",BS_AUTORADIOBUTTON,20,50,37,10 - CONTROL "Diameter",IDC_DimDiameter,"Button",BS_AUTORADIOBUTTON,20,63,45,10 - GROUPBOX "Text parameters",IDC_TextParamGroupbox,80,9,139,84 - CONTROL "2D Text",IDC_2DText,"Button",BS_AUTORADIOBUTTON | WS_GROUP,162,20,41,10 - CONTROL "3D Text",IDC_3DText,"Button",BS_AUTORADIOBUTTON,162,33,41,10 - LTEXT "Text type:",IDC_STATIC,86,22,47,8 - LTEXT "Font Size:",IDC_FontSizeStatic,87,51,33,8 - COMBOBOX IDC_FontSize,157,51,48,57,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Flyout value",IDC_FlyoutStatic,25,117,40,8 - LTEXT "Display units",IDC_DisplayUnitsStatic,25,138,41,8 - COMBOBOX IDC_DisplayUnits,105,138,64,59,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Text display mode:",IDC_TextDisplayModeStatic,86,74,62,8 - COMBOBOX IDC_TextDisplayMode,157,71,48,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Change dimension color",IDC_DimensionColor,105,156,63,24,BS_MULTILINE - CONTROL "",IDC_Flyout,"msctls_trackbar32",TBS_TOP | TBS_TOOLTIPS | WS_TABSTOP,73,112,100,20 -END - -IDD_DIALOG_STEREO DIALOGEX 0, 0, 166, 177 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Configure stereo" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - EDITTEXT IDC_EDIT_IOD,88,42,41,12,ES_AUTOHSCROLL | WS_GROUP - CONTROL "",IDC_SPIN_IOD,"msctls_updown32",UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP,130,42,11,12 - GROUPBOX "Stereo focus properties:",IDC_STATIC,7,72,149,96 - GROUPBOX "Eye separation properties:",IDC_STATIC,6,6,150,60 - LTEXT "Intraocular distance:",IDC_STATIC,18,43,68,8 - CONTROL "",IDC_CHECK_IOD_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,24,16,10 - LTEXT "Relative to focal length:",IDC_STATIC,18,24,78,8 - CONTROL "",IDC_CHECK_FOCUS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,90,16,10 - LTEXT "Relative to focal length:",IDC_STATIC,18,90,78,8 - CONTROL "",IDC_SLIDER_FOCUS,"msctls_trackbar32",TBS_TOP | WS_TABSTOP,18,108,126,24 - LTEXT "Fixed value:",IDC_STATIC,18,146,40,8 - EDITTEXT IDC_EDIT_FOCUS,67,144,41,12,ES_AUTOHSCROLL | WS_GROUP - CONTROL "",IDC_SPIN_FOCUS,"msctls_updown32",UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP,108,144,11,12 -END - -IDD_ParamsFacesPage DIALOGEX 0, 0, 134, 73 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - LTEXT "Face1",IDC_FacesSt1,18,14,20,8 - LTEXT "Face2",IDC_FacesSt2,18,35,20,8 - PUSHBUTTON "Click to set up selected face",IDC_FacesBtn1,63,7,52,24,BS_MULTILINE - PUSHBUTTON "Click to set up selected face",IDC_FacesBtn2,64,39,51,24,BS_MULTILINE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "MainFrame.ico" -IDR_2DTYPE ICON "2dType.ico" -IDR_3DTYPE ICON "3dType.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_2dCHILDFRAME TOOLBAR 20, 20 -BEGIN - BUTTON ID_BUTTON2DFitAll - BUTTON ID_BUTTON2DZoomWin - BUTTON ID_BUTTON2DZoomProg - SEPARATOR - BUTTON ID_BUTTON2DPanning - BUTTON ID_BUTTON2DGlobPanning - SEPARATOR - BUTTON ID_BUTTON2DGridRectLines - BUTTON ID_BUTTON2DGridRectPoints - BUTTON ID_BUTTON2DGridCircLines - BUTTON ID_BUTTON2DGridCircPoints - BUTTON ID_BUTTON2DGridValues - BUTTON ID_BUTTON2DGridCancel -END - -IDR_3dCHILDFRAME TOOLBAR 20, 20 -BEGIN - BUTTON ID_BUTTONZoomAll - BUTTON ID_BUTTONZoomWin - BUTTON ID_BUTTONZoomProg - SEPARATOR - BUTTON ID_BUTTONPan - BUTTON ID_BUTTONPanGlo - SEPARATOR - BUTTON ID_BUTTONFront - BUTTON ID_BUTTONTop - BUTTON ID_BUTTONLeft - BUTTON ID_BUTTONBack - BUTTON ID_BUTTONRight - BUTTON ID_BUTTONBottom - BUTTON ID_BUTTONAxo - SEPARATOR - BUTTON ID_BUTTONRot - BUTTON ID_BUTTONReset - SEPARATOR - BUTTON ID_BUTTON_STEREOCONFIG - SEPARATOR - BUTTON ID_BUTTONHlrOff - BUTTON ID_BUTTONHlrOn -END - -IDR_TB_AIS TOOLBAR 20, 20 -BEGIN - BUTTON ID_OBJECT_WIREFRAME - BUTTON ID_OBJECT_SHADING - SEPARATOR - BUTTON ID_OBJECT_COLOR - BUTTON ID_OBJECT_MATERIAL - BUTTON ID_OBJECT_TRANSPARENCY - SEPARATOR - BUTTON ID_OBJECT_ERASE - BUTTON ID_OBJECT_DISPLAYALL - SEPARATOR - BUTTON ID_OBJECT_REMOVE - BUTTON ID_OBJECT_DIM -END - -IDR_RAY_TRACING TOOLBAR 20, 20 -BEGIN - BUTTON ID_OBJECT_RAY_TRACING - BUTTON ID_OBJECT_SHADOWS - BUTTON ID_OBJECT_REFLECTIONS - BUTTON ID_OBJECT_ANTI_ALIASING -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_Popup2D MENU -BEGIN - POPUP "Entry1" - BEGIN - MENUITEM "Background Color...", ID_Modify_ChangeBackground - END -END - -IDR_Popup3D MENU -BEGIN - POPUP "Background" - BEGIN - MENUITEM "Background Color...", ID_Modify_ChangeBackground - END - POPUP "Object(s)" - BEGIN - MENUITEM "Erase", ID_OBJECT_ERASE - MENUITEM "Shading", ID_OBJECT_SHADING - MENUITEM "Wireframe", ID_OBJECT_WIREFRAME - MENUITEM "Color...", ID_OBJECT_COLOR - MENUITEM "Material...", ID_OBJECT_MATERIAL - POPUP "Material" - BEGIN - MENUITEM "Aluminium", ID_OBJECT_MATERIAL_ALUMINIUM - MENUITEM "Brass", ID_OBJECT_MATERIAL_BRASS - MENUITEM "Bronze", ID_OBJECT_MATERIAL_BRONZE - MENUITEM "Chrome", ID_OBJECT_MATERIAL_CHROME - MENUITEM "Copper", ID_OBJECT_MATERIAL_COPPER - MENUITEM "Gold", ID_OBJECT_MATERIAL_GOLD - MENUITEM "Jade", ID_OBJECT_MATERIAL_JADE - MENUITEM "Metalized", ID_OBJECT_MATERIAL_METALIZED - MENUITEM "Neon GNC", ID_OBJECT_MATERIAL_NEON_GNC - MENUITEM "Neon PHC", ID_OBJECT_MATERIAL_NEON_PHC - MENUITEM "Obsidian", ID_OBJECT_MATERIAL_OBSIDIAN - MENUITEM "Pewter", ID_OBJECT_MATERIAL_PEWTER - MENUITEM "Plaster", ID_OBJECT_MATERIAL_PLASTER - MENUITEM "Plastic", ID_OBJECT_MATERIAL_PLASTIC - MENUITEM "Satin", ID_OBJECT_MATERIAL_SATIN - MENUITEM "Shiny plastic", ID_OBJECT_MATERIAL_SHINY_PLASTIC - MENUITEM "Silver", ID_OBJECT_MATERIAL_SILVER - MENUITEM "Steel", ID_OBJECT_MATERIAL_STEEL - MENUITEM "Stone", ID_OBJECT_MATERIAL_STONE - MENUITEM SEPARATOR - MENUITEM "Default", ID_OBJECT_MATERIAL_DEFAULT - END - MENUITEM "Transparency...", ID_OBJECT_TRANSPARENCY - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_MAINFRAME ACCELERATORS -BEGIN - "N", ID_FILE_NEW, VIRTKEY, CONTROL, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_RadiusParamsPage, DIALOG - BEGIN - RIGHTMARGIN, 120 - BOTTOMMARGIN, 45 - END - - IDD_AngleParamsVerticesPage, DIALOG - BEGIN - RIGHTMARGIN, 80 - BOTTOMMARGIN, 66 - END - - IDD_LengthParamsVerticesPage, DIALOG - BEGIN - BOTTOMMARGIN, 51 - END - - IDD_LengthParamsEdgesPage, DIALOG - BEGIN - RIGHTMARGIN, 115 - BOTTOMMARGIN, 58 - END - - IDD_OCC_ABOUTBOX, DIALOG - BEGIN - BOTTOMMARGIN, 256 - END - - IDD_ResultDialog, DIALOG - BEGIN - BOTTOMMARGIN, 201 - END - - IDD_AISMATERIAL, DIALOG - BEGIN - RIGHTMARGIN, 67 - BOTTOMMARGIN, 219 - END - - IDD_Dimension, DIALOG - BEGIN - RIGHTMARGIN, 235 - BOTTOMMARGIN, 336 - HORZGUIDE, 336 - END - - IDD_DIALOG_STEREO, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 159 - TOPMARGIN, 7 - BOTTOMMARGIN, 170 - END - - IDD_ParamsFacesPage, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 127 - TOPMARGIN, 7 - BOTTOMMARGIN, 66 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_Dimension DLGINIT -BEGIN - IDC_FontSize, 0x403, 2, 0 -0x0037, - IDC_FontSize, 0x403, 2, 0 -0x0038, - IDC_FontSize, 0x403, 2, 0 -0x0039, - IDC_FontSize, 0x403, 3, 0 -0x3031, "\000" - IDC_FontSize, 0x403, 3, 0 -0x3131, "\000" - IDC_FontSize, 0x403, 3, 0 -0x3231, "\000" - IDC_FontSize, 0x403, 3, 0 -0x3331, "\000" - IDC_FontSize, 0x403, 3, 0 -0x3431, "\000" - IDC_TextDisplayMode, 0x403, 10, 0 -0x6957, 0x6572, 0x7266, 0x6d61, 0x0065, - IDC_TextDisplayMode, 0x403, 9, 0 -0x5320, 0x6168, 0x6964, 0x676e, "\000" - 0 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - ID_FILE_NEW "Create a new document\nNew" - ID_FILE_CLOSE "Close the active document\nClose" -END - -STRINGTABLE -BEGIN - ID_FILE_EXPORT_IMAGE "Export image \n Export image" -END - -STRINGTABLE -BEGIN - ID_APP_ABOUT "Display program information\nAbout" - ID_APP_EXIT "Quit the application\nExit" -END - -STRINGTABLE -BEGIN - ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar" - ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar" -END - -STRINGTABLE -BEGIN - ID_WINDOW_NEW "Open another window for the active document\nNew Window" - ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons" - ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows" - ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows" -END - -STRINGTABLE -BEGIN - ID_BUTTON2DFitAll "Press to zoom the application objects in the view\nFitAll" - ID_BUTTON2DZoomWin "Press and drag MB1 to select a zoom window\nZoom Window" - ID_BUTTON2DZoomProg "Press and drag MB1 to zoom\nDynamic Zooming" - ID_BUTTON2DPanning "Press and drag MB1 to pan\nDynamic Panning" - ID_BUTTON2DGlobPanning "Press and select a new view center\nGlobal Panning" - ID_BUTTON2DGridValues "Press to edit the grid value\nEdit" - ID_BUTTON2DGridCircPoints - "Press to activate circular grid with points\nCircular grid with points" - ID_BUTTON2DGridCancel "Press to erase the grid\nErase" - ID_BUTTON2DGridRectLines - "Press to activate rectangular grid with lines\nRectangular Grid with lines" - ID_BUTTON2DGridRectPoints - "Press to activate rectangular grid with points\nRectangular Grid with points" - ID_BUTTON2DGridCircLines - "Press to activate circular grid with lines\nCircular grid with lines" -END - -STRINGTABLE -BEGIN - AFX_IDS_SCSIZE "Change the window size" - AFX_IDS_SCMOVE "Change the window position" - AFX_IDS_SCMINIMIZE "Reduce the window to an icon" - AFX_IDS_SCMAXIMIZE "Enlarge the window to full size" - AFX_IDS_SCCLOSE "Close the active window" -END - -STRINGTABLE -BEGIN - AFX_IDS_SCRESTORE "Restore the window to normal size" -END - -STRINGTABLE -BEGIN - ID_INDICATOR_EXT "EXT" - ID_INDICATOR_CAPS "CAP" - ID_INDICATOR_NUM "NUM" - ID_INDICATOR_SCRL "SCRL" - ID_INDICATOR_OVR "OVR" - ID_INDICATOR_REC "REC" -END - -STRINGTABLE -BEGIN - ID_BUTTONZoomAll "Press to zoom the application objects in the view\nFitAll" - ID_OBJECT_ERASE "Erase selected shape\nErase" - ID_BUTTONZoomWin "Press and drag MB1 to select a zoom window\nZoom Window" - ID_BUTTONZoomProg "Press and drag MB1 to zoom\nDynamic Zooming" - ID_BUTTONPan "Press and drag MB1 to pan\nDynamic Panning" - ID_BUTTONPanGlo "Press and select a new view center\nGlobal Panning" - ID_BUTTONFront "Press to select a front View\nFront " - ID_BUTTONLeft "Press to select a left View\nLeft" - ID_BUTTONBack "Press to select a back View\nBack" - ID_BUTTONRight "Press to select a right View\nRight" - ID_BUTTONBottom "Press to select a bottom View\nBottom" - ID_BUTTONRot "Press and drag MB1 to rotate\nDynamic Rotation" - ID_BUTTONReset "Press to reset view\nReset" - ID_BUTTONHlrOff "Press to switch hidden lines mode off\nHidden off" - ID_BUTTONHlrOn "Press to switch hidden lines mode on\nHidden On" - ID_BUTTONAxo "Press to select axonometric View\nAxo" -END - -STRINGTABLE -BEGIN - ID_BUTTONTop "Press to select a top View\nTop" -END - -STRINGTABLE -BEGIN - ID_OBJECT_REMOVE "Remove selected shape\nRemove" -END - -STRINGTABLE -BEGIN - ID_OBJECT_DISPLAYALL "Display all erased shapes\nDisplay" - ID_OBJECT_MATERIAL "Change object material\nMaterial..." - ID_OBJECT_TRANSPARENCY "Change object transparency\nTransparency..." -END - -STRINGTABLE -BEGIN - ID_OBJECT_COLOR "Change object color\nColor..." - ID_OBJECT_SHADING "Put selection in shading\nShading" - ID_OBJECT_WIREFRAME "Put selection in wireframe\nWireframe" -END - -STRINGTABLE -BEGIN - ID_OBJECT_DIMENSIONS "Add dimensions" - ID_LOCALCONTEXT_ADDDIMENSION "Add new dimension for selected objects" -END - -STRINGTABLE -BEGIN - ID_BUTTON_STEREOSETTINGS "Configure stereo properties" - ID_BUTTON_STEREO "Toggle stereographic mode on / off" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/samples/mfc/standard/Common/res/ToolbarRayTracing.bmp b/samples/mfc/standard/Common/res/ToolbarRayTracing.bmp deleted file mode 100644 index 809af47b95..0000000000 Binary files a/samples/mfc/standard/Common/res/ToolbarRayTracing.bmp and /dev/null differ diff --git a/samples/mfc/standard/Common/res/coloredm.bmp b/samples/mfc/standard/Common/res/coloredm.bmp deleted file mode 100755 index 93937ae64f..0000000000 Binary files a/samples/mfc/standard/Common/res/coloredm.bmp and /dev/null differ diff --git a/samples/mfc/standard/Common/res/occ_logo.bmp b/samples/mfc/standard/Common/res/occ_logo.bmp deleted file mode 100755 index 443a7de612..0000000000 Binary files a/samples/mfc/standard/Common/res/occ_logo.bmp and /dev/null differ diff --git a/samples/mfc/standard/ReadMe.md b/samples/mfc/standard/ReadMe.md deleted file mode 100644 index 2b2b9a19aa..0000000000 --- a/samples/mfc/standard/ReadMe.md +++ /dev/null @@ -1,58 +0,0 @@ -MFC: OCCT Samples (C++|MFC) {#samples_mfc_standard} -========== - -Visual C++ programming samples for Windows platform containing illustrating how to use a particular module or functionality, including the following MFC samples: - - * Geometry - * Modeling - * ImportExport - * HLR - -@figure{samples_mvc.png} - -1. Contents ------------------------ - -The directory samples/mfc/standard contains the following packages and files: - -* Numbered packages: **01_Geometry**, **02_Modeling**, etc. provide projects and sources of samples; -* Files **All-vc(number).sln** are auxiliary utility projects depending on all other sample -projects. When such project is rebuilt, all samples and *mfcsample* library are also rebuilt. -* **Common** directory provides common source and header files for samples and dynamic-link library *mfcsample.dll.* -* **Data** directory stores data files. -* **mfcsample** directory contains project for *mfcsample.dll* library providing basic functionality used by all OCC samples. -* File **env.bat** is called from *msvc.bat.* - - -2. Launching Open CASCADE Technology samples: ---------------------------------- - -To run the Open CASCADE Technology samples, use command: - -~~~~ -execute run.bat [vc10|vc11|vc12|vc14] [win32|win64] [Release|Debug] [SampleName] -~~~~ - -To run the **Geometry** sample, use command: - -~~~~ -execute run.bat vc10 win64 Debug Geometry -~~~~ - - -3. Modifying and rebuilding samples: --------------------------------------------- - -You can modify, compile and launch all sample projects in MS Visual C++ at once with command: - -~~~~ -execute msvc.bat [vc10|vc11|vc12|vc14] [win32|win64] [Release|Debug] -~~~~ - -To run all sample projects in MS Visual C++ at once, use command: - -~~~~ -execute msvc.bat vc10 win64 Debug -~~~~ - -Note: make sure that your *PATH* environment variable contains a directory, where *msdev.exe* is located. diff --git a/samples/mfc/standard/env.bat b/samples/mfc/standard/env.bat deleted file mode 100644 index f743985757..0000000000 --- a/samples/mfc/standard/env.bat +++ /dev/null @@ -1,11 +0,0 @@ -call "%~dp0..\..\..\env.bat" %1 %2 %3 - -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -set "LIB_DIR=win%ARCH%\%VCVER%\libd" - -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" - set "LIB_DIR=win%ARCH%\%VCVER%\lib" -) - -set "PATH=%~dp0%LIB_DIR%;%~dp0%BIN_DIR%;%PATH%" \ No newline at end of file diff --git a/samples/mfc/standard/images/samples_mvc.png b/samples/mfc/standard/images/samples_mvc.png deleted file mode 100644 index f4104834e6..0000000000 Binary files a/samples/mfc/standard/images/samples_mvc.png and /dev/null differ diff --git a/samples/mfc/standard/mfcsample/CMakeLists.txt b/samples/mfc/standard/mfcsample/CMakeLists.txt deleted file mode 100644 index 67b2f55e63..0000000000 --- a/samples/mfc/standard/mfcsample/CMakeLists.txt +++ /dev/null @@ -1,192 +0,0 @@ -# Caution! Be careful, when increase minimal cmake version: -# using of newer version may leads (by default) to applying -# of some new policies. It may break compilation. -# For canceling of applying new policies use: -# cmake_policy(PUSH) before `cmake_minimum_required` -# and cmake_policy(POP) after. -cmake_minimum_required (VERSION 3.1 FATAL_ERROR) - -project (mfcsample) - -add_definitions(-DWINVER=0x0501 -D_AFXEXT -DUNICODE -D_UNICODE) - -if (NOT BUILD_SHARED_LIBS AND WIN32) - add_definitions ("-DOCCT_STATIC_BUILD") -endif() - -set (CMAKE_MFC_FLAG 2) - -# mfcsample -set (mfcsample_SOURCE_FILES ${MFC_STANDARD_SAMPLES_DIR}/mfcsample/src/mfcsample.cpp - ${MFC_STANDARD_SAMPLES_DIR}/mfcsample/src/StdAfx.cpp ) - -SET (MFC_STANDARD_COMMON_SAMPLES_DIR "${MFC_STANDARD_SAMPLES_DIR}/Common") -set (COMMON_SOURCE_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dDoc.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dChildFrame.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dView.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dBaseDoc.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_App.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dDoc.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dChildFrame.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dView.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseDoc.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseChildFrame.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseView.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_MainFrame.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/RadiusParamsPage.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgesPage.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.cpp - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AngleParamsVerticesPage.cpp) - -# Common ImportExport -set (COMMON_IE_DIR ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ImportExport) -set (COMMON_IE_HEADER_FILES ${COMMON_IE_DIR}/ImportExport.h - ${COMMON_IE_DIR}/SaveSTEPDlg.h ) -set (COMMON_IE_SOURCE_FILES ${COMMON_IE_DIR}/ImportExport.cpp - ${COMMON_IE_DIR}/SaveSTEPDlg.cpp ) - -# Common ISession2D -set (COMMON_ISESSION2D_DIR ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ISession2D) -set (COMMON_ISESSION2D_HEADER_FILES ${COMMON_ISESSION2D_DIR}/ISession2D_Shape.h ) -set (COMMON_ISESSION2D_SOURCE_FILES ${COMMON_ISESSION2D_DIR}/ISession2D_Shape.cpp ) - -# Common Resource2D -set (COMMON_RESOURCE2D_DIR ${MFC_STANDARD_COMMON_SAMPLES_DIR}/Resource2D) -set (COMMON_RESOURCE2D_HEADER_FILES ${COMMON_RESOURCE2D_DIR}/CircularGrid.h - ${COMMON_RESOURCE2D_DIR}/RectangularGrid.h ) -set (COMMON_RESOURCE2D_SOURCE_FILES ${COMMON_RESOURCE2D_DIR}/CircularGrid.cpp - ${COMMON_RESOURCE2D_DIR}/RectangularGrid.cpp ) - -# Common headers -set (COMMON_HEADER_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dDoc.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dChildFrame.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_2dView.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dBaseDoc.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_App.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dDoc.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dChildFrame.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_3dView.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseDoc.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseChildFrame.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_BaseView.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_MainFrame.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/RadiusParamsPage.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgesPage.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsVerticesPage.h - ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AngleParamsVerticesPage.h) - - -# Common resources -set (COMMON_RESOURCE_DIR ${MFC_STANDARD_COMMON_SAMPLES_DIR}/res) -set (COMMON_RESOURCE_FILES ${COMMON_RESOURCE_DIR}/2dChildFrameTB.bmp - ${COMMON_RESOURCE_DIR}/2dType.ico - ${COMMON_RESOURCE_DIR}/3dChildFrameTB.bmp - ${COMMON_RESOURCE_DIR}/3dType.ico - ${COMMON_RESOURCE_DIR}/AIS_TB.bmp - ${COMMON_RESOURCE_DIR}/coloredm.bmp - ${COMMON_RESOURCE_DIR}/MainFrame.ico - ${COMMON_RESOURCE_DIR}/occ_logo.bmp - ${COMMON_RESOURCE_DIR}/OCC_Resource.rc) - -# groups in the VS solution -source_group ( "Header Files" FILES ${COMMON_HEADER_FILES} - ${COMMON_IE_HEADER_FILES} - ${COMMON_RESOURCE2D_HEADER_FILES} - ${COMMON_ISESSION2D_HEADER_FILES}) - -source_group ("Source Files" FILES ${mfcsample_SOURCE_FILES} - ${COMMON_SOURCE_FILES} - ${COMMON_IE_SOURCE_FILES} - ${COMMON_RESOURCE2D_SOURCE_FILES} - ${COMMON_ISESSION2D_SOURCE_FILES}) - -source_group ( "Resource Files" FILES ${COMMON_RESOURCE_FILES}) - -# mfcsample library -add_library ( mfcsample ${mfcsample_SOURCE_FILES} - ${COMMON_HEADER_FILES} - ${COMMON_SOURCE_FILES} - ${COMMON_IE_HEADER_FILES} - ${COMMON_IE_SOURCE_FILES} - ${COMMON_RESOURCE2D_HEADER_FILES} - ${COMMON_RESOURCE2D_SOURCE_FILES} - ${COMMON_ISESSION2D_HEADER_FILES} - ${COMMON_ISESSION2D_SOURCE_FILES} - ${COMMON_RESOURCE_FILES}) - -set_property (TARGET mfcsample PROPERTY FOLDER "Samples/mfc") - -if (SINGLE_GENERATOR) - install (TARGETS mfcsample - RUNTIME DESTINATION "${INSTALL_DIR_BIN}" - ARCHIVE DESTINATION "${INSTALL_DIR_LIB}" - LIBRARY DESTINATION "${INSTALL_DIR_LIB}") -else() - install (TARGETS mfcsample - CONFIGURATIONS Release RelWithDebInfo - RUNTIME DESTINATION "${INSTALL_DIR_BIN}" - ARCHIVE DESTINATION "${INSTALL_DIR_LIB}" - LIBRARY DESTINATION "${INSTALL_DIR_LIB}") - install (TARGETS mfcsample - CONFIGURATIONS Debug - RUNTIME DESTINATION "${INSTALL_DIR_BIN}d" - ARCHIVE DESTINATION "${INSTALL_DIR_LIB}d" - LIBRARY DESTINATION "${INSTALL_DIR_LIB}d") -endif() - -include_directories( ${CMAKE_BINARY_DIR}/inc - ${MFC_STANDARD_COMMON_SAMPLES_DIR} - ${COMMON_IE_DIR} - ${COMMON_ISESSION2D_DIR} - ${COMMON_RESOURCE2D_DIR}) - -# OCCT libraries for using -set (mfcsample_USED_LIBS TKDEVRML - TKDESTL - TKBRep - TKDEIGES - TKShHealing - TKDESTEP - TKXSBase - TKBool - TKBO - TKCAF - TKCDF - TKernel - TKFeat - TKFillet - TKG2d - TKG3d - TKGeomAlgo - TKGeomBase - TKHLR - TKMath - TKOffset - TKOpenGl - TKPrim - TKService - TKTopAlgo - TKMesh - TKV3d - ${CSF_OpenGlLibs}) - -target_link_libraries (mfcsample ${mfcsample_USED_LIBS}) - -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/samples/mfc/standard/mfcsample/adm/win/vc10/mfcsample.vcxproj b/samples/mfc/standard/mfcsample/adm/win/vc10/mfcsample.vcxproj deleted file mode 100644 index 27538d9360..0000000000 --- a/samples/mfc/standard/mfcsample/adm/win/vc10/mfcsample.vcxproj +++ /dev/null @@ -1,706 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2D6CBBE8-6965-4016-B503-0D715AE26691} - mfcsample - MFCProj - - - - DynamicLibrary - Dynamic - Unicode - $(VCPlatformToolSet) - - - DynamicLibrary - Dynamic - Unicode - $(VCPlatformToolSet) - - - DynamicLibrary - Dynamic - Unicode - $(VCPlatformToolSet) - - - DynamicLibrary - Dynamic - Unicode - $(VCPlatformToolSet) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../win32\$(VCFMT)\bind\ - .\win32\objd\ - true - ../../../../win64\$(VCFMT)\bind\ - .\win64\objd\ - true - ../../../../win32\$(VCFMT)\bin\ - .\win32\obj\ - false - ../../../../win64\$(VCFMT)\bin\ - .\win64\obj\ - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\objd/mfcsample.tlb - - - - - Disabled - $(CSF_OCCTIncludePath);..\..\..\..\Common;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_AFXEXT;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win32\objd/mfcsample.pch - .\win32\objd/ - .\win32\objd/ - .\win32\objd/ - Level4 - true - EditAndContinue - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bind/mfcsample.dll - true - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win32\$(VCFMT)\bind/mfcsample.pdb - Windows - ../../../../win32\$(VCFMT)\libd/mfcsample.lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\objd/mfcsample.tlb - - - - - Disabled - $(CSF_OCCTIncludePath);..\..\..\..\Common;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_AFXEXT;WINVER=0x0501;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - stdafx.h - .\win64\objd/mfcsample.pch - .\win64\objd/ - .\win64\objd/ - .\win64\objd/ - Level4 - true - ProgramDatabase - Default - stdcpp17 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bind/mfcsample.dll - true - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - true - ../../../../win64\$(VCFMT)\bind/mfcsample.pdb - Windows - ../../../../win64\$(VCFMT)\libd/mfcsample.lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\win32\obj/mfcsample.tlb - - - - - MaxSpeed - OnlyExplicitInline - $(CSF_OCCTIncludePath);..\..\..\..\Common;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_AFXEXT;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win32\obj/mfcsample.pch - .\win32\obj/ - .\win32\obj/ - .\win32\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;%(AdditionalDependencies) - ../../../../win32\$(VCFMT)\bin/mfcsample.dll - true - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win32\$(VCFMT)\bin/mfcsample.pdb - Windows - ../../../../win32\$(VCFMT)\lib/mfcsample.lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\win64\obj/mfcsample.tlb - - - - - MaxSpeed - OnlyExplicitInline - $(CSF_OCCTIncludePath);..\..\..\..\Common;..\..\..\..\..\..\Common;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_AFXEXT;WINVER=0x0501;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - stdafx.h - .\win64\obj/mfcsample.pch - .\win64\obj/ - .\win64\obj/ - .\win64\obj/ - Level4 - true - Default - stdcpp17 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(IntDir)%(Filename).res - - - TKVCAF.lib;TKDEVRML.lib;TKDESTL.lib;TKBrep.lib;TKDEIGES.lib;TKShHealing.lib;TKDESTEP.lib;TKXSBase.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;TKLCAF.lib;%(AdditionalDependencies) - ../../../../win64\$(VCFMT)\bin/mfcsample.dll - true - $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) - ../../../../win64\$(VCFMT)\bin/mfcsample.pdb - Windows - ../../../../win64\$(VCFMT)\lib/mfcsample.lib - MachineX64 - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - ..\Common\stdafx.h - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Create - ..\Common\stdafx.h - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - ..\Common\stdafx.h - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - Create - ..\Common\stdafx.h - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - %(PreprocessorDefinitions) - \mfc\Common\res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \mfc\Common\res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \mfc\Common\res;%(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - \mfc\Common\res;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/mfc/standard/mfcsample/adm/win/vc10/mfcsample.vcxproj.filters b/samples/mfc/standard/mfcsample/adm/win/vc10/mfcsample.vcxproj.filters deleted file mode 100644 index 712ec1084b..0000000000 --- a/samples/mfc/standard/mfcsample/adm/win/vc10/mfcsample.vcxproj.filters +++ /dev/null @@ -1,249 +0,0 @@ - - - - - {23255ff5-fb8f-4ffd-bf15-b4aab2f5a773} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {c0619ee9-00d5-4587-ac1c-7f8e97f7d314} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {5cef5b98-dbfe-4dc1-9030-6333f582b9e6} - - - {2d59ab2b-935c-4f19-a01a-cf228ab78490} - h;hpp;hxx;hm;inl - - - {da6f5036-6fe5-479c-9407-d4c6bb3bc83f} - h;hpp;hxx;hm;inl - - - {cad0c56e-8d9f-4728-9d66-f7188c6080d7} - - - {7d971500-8ead-4c2b-851d-31395a5fb01c} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files\Resource2D-src - - - Source Files\Resource2D-src - - - Source Files\Resource2D-src - - - Source Files\ISession2D-src - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files\Resource2D-headers - - - Header Files\Resource2D-headers - - - Header Files\Resource2D-headers - - - Header Files\ISession2D-headers - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/samples/mfc/standard/mfcsample/src/StdAfx.cpp b/samples/mfc/standard/mfcsample/src/StdAfx.cpp deleted file mode 100755 index 019481a5f4..0000000000 --- a/samples/mfc/standard/mfcsample/src/StdAfx.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "..\Common\stdafx.h" - diff --git a/samples/mfc/standard/mfcsample/src/mfcsample.cpp b/samples/mfc/standard/mfcsample/src/mfcsample.cpp deleted file mode 100755 index cfce175a9a..0000000000 --- a/samples/mfc/standard/mfcsample/src/mfcsample.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// mfcsample.cpp : Defines the initialization routines for the DLL. -// - -#include "stdafx.h" -#include - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - - -static AFX_EXTENSION_MODULE mfcsampleDLL = { NULL, NULL }; - -extern "C" int APIENTRY -DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) -{ - // Remove this if you use lpReserved - UNREFERENCED_PARAMETER(lpReserved); - - if (dwReason == DLL_PROCESS_ATTACH) - { - TRACE0("MFCSAMPLEDLL.DLL Initializing!\n"); - - // Extension DLL one-time initialization - if (!AfxInitExtensionModule(mfcsampleDLL, hInstance)) - return 0; - - // Insert this DLL into the resource chain - // NOTE: If this Extension DLL is being implicitly linked to by - // an MFC Regular DLL (such as an ActiveX Control) - // instead of an MFC application, then you will want to - // remove this line from DllMain and put it in a separate - // function exported from this Extension DLL. The Regular DLL - // that uses this Extension DLL should then explicitly call that - // function to initialize this Extension DLL. Otherwise, - // the CDynLinkLibrary object will not be attached to the - // Regular DLL's resource chain, and serious problems will - // result. - - new CDynLinkLibrary(mfcsampleDLL); - } - else if (dwReason == DLL_PROCESS_DETACH) - { - TRACE0("MFCSAMPLEDLL.DLL Terminating!\n"); - // Terminate the library before destructors are called - AfxTermExtensionModule(mfcsampleDLL); - } - return 1; // ok -} \ No newline at end of file diff --git a/samples/mfc/standard/msvc.bat b/samples/mfc/standard/msvc.bat deleted file mode 100644 index 19d0f0b964..0000000000 --- a/samples/mfc/standard/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0All-%VCFMT%.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCFMT%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/mfc/standard/run.bat b/samples/mfc/standard/run.bat deleted file mode 100644 index 9d49105b8e..0000000000 --- a/samples/mfc/standard/run.bat +++ /dev/null @@ -1,38 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -if "%1" == "-h" ( - goto err_bat -) - -if not ["%4"] == [""] ( - set "SampleName=%4" - call "%~dp0env.bat" %1 %2 %3 -) else if not ["%1"] == [""] ( - set "SampleName=%1" - call "%~dp0env.bat" -) else ( - goto err_bat -) - -if not exist "%~dp0%BIN_DIR%\%SampleName%.exe" goto err_exe - -"%~dp0%BIN_DIR%\%SampleName%.exe" - -goto eof - -:err_bat -echo Launch selected sample as follows: -echo %~n0.bat [^vc10^|^vc11^|^vc12^|^vc14^] [^win32^|^win64^] [^Release^|^Debug^] [^SampleName^] -echo or -echo %~n0.bat [^SampleName^] -echo Run %~n0.bat -h to get this help -exit /B - -:err_exe -echo Executable %~dp0%BIN_DIR%\%SampleName%.exe not found. -echo Probably you didn't compile the application. -exit /B - -:eof diff --git a/samples/ocafsamples/TDataStd_Sample.cxx b/samples/ocafsamples/TDataStd_Sample.cxx deleted file mode 100644 index f92f1037b8..0000000000 --- a/samples/ocafsamples/TDataStd_Sample.cxx +++ /dev/null @@ -1,431 +0,0 @@ -// Created on: 1999-12-28 -// Created by: Sergey RUIN -// Copyright (c) 1999-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and / or modify it -// under the terms of the GNU Lesser General Public version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// ==================================================================================== -// This sample contains templates for typical actions with standard OCAF attributes -// ==================================================================================== - -#ifdef DEB - -static void Sample() -{ - // Starting with data framework - Handle(TDF_Data) DF = new TDF_Data(); - TDF_Label aLabel = DF->Root(); - - //------------------------- TDataStd_Integer (Real) --------------------------------- - //----------------------------------------------------------------------------------- - - // Setting TDataStd_Integer attribute to a label (work with TDataStd_Real is the same) - - Standard_Integer i = 10; - - Handle(TDataStd_Integer) I = TDataStd_Integer::Set(aLabel, i); - - // Getting the value stored in TDataStd_Integer attribute - - Standard_Integer aValue; - - aValue = I->Get(); - - // Setting the new value in the attribute - - I->Set( 25 ); - - //------------------------- TDataStd_RealArray (IntegerArray is analogical) -------------- - //---------------------------------------------------------------------------------------- - - // Setting TDataStd_RealArray attribute to a label - - Standard_Integer lower = 1, upper = 20; - - Handle(TDataStd_RealArray) realarray = TDataStd_RealArray::Set(aLabel, lower, upper); - - // Filling array - - for(Standard_Integer j = realarray->Lower(); j<= realarray->Upper(); j++) { - realarray->SetValue(j, M_PI * j); - } - - // Retrieving value by index - - Standard_Real value = realarray->Value(3); - - // Getting handle to an underlying array TColStd_HArray1OfReal - - Handle(TColStd_HArray1OfReal) array = realarray->Array(); - - //------------------------- TDataStd_Comment -------------- - //--------------------------------------------------------- - - // Setting TDataStd_Comment attribute to a label - - Handle(TDataStd_Comment) comment = TDataStd_Comment::Set(aLabel); - - // Setting comment string in to the attribute - - TCollection_ExtendedString message = "This is a remark"; - - comment->Set(message); - - // Getting comment string stored in the attribute - - TCollection_ExtendedString string = comment->Get(); - - //------------------------- TDataStd_Name ----------------- - //--------------------------------------------------------- - - // Setting TDataStd_Name attribute to a label - -// Handle(TDataStd_Name) name = TDataStd_Name::Set(aLabel); - - - // Checking if the label has a name (TDataStd_Name attribute with not empty name field) - - // Standard_Boolean isempty = name->IsEmpty(); - - // Getting the name of the label - - //if( !isempty ) TCollection_ExtendedString thename = name->Get(); - - // Erasing the name of the label in TDataStd_Name attribute - - // name->SetEmpty(); - - // Setting a new name string in the attribute - - TCollection_ExtendedString aname = "Name of the label"; - Handle(TDataStd_Name) name = TDataStd_Name::Set(aLabel,aname); - - name->Set(aname); - - // Getting comment string stored in the attribute - - TCollection_ExtendedString namestring = name->Get(); - - // Getting the first father label which has TDataStd_Name attribute - - //Handle(TDataStd_Name) father; - - //Standard_Boolean hasfather = name->Father(father); - - // Find if there exists label with full path "Assembly1:Part3:Prism7" - - // Converting string to list of names - - //TCollection_ExtendedString fullpath = "Assembly_1:Part_3:Prism_7"; - //TDataStd_ListOfExtendedString listofstring; - - //TDataStd_Name::MakePath(fullpath, listofstring); - - //Handle(TDataStd_Name) nameattribute; - - //Standard_Boolean found = TDataStd_Name::Find(DF, listofstring, nameattribute); - - //if( found ) { - // Getting the fullpath of the nameattribute (fullpath consists of list of TDataStd_Name attributes situated on - // father labels from label where nameattribute is situated to root label - //TDF_AttributeList list; - - //nameattribute->FullPath(list); - //} - - //TDF_Label currentLabel; - - // ... Finding currentLabel... - - // Search under a label which fits with the given name - - //Handle(TDataStd_Name) givenname; - - //found = TDataStd_Name::Find(currentLabel, "Sketch_11", givenname); - - //if( found ) { - - // Getting all named child labels of the label where givenname attribute situated - //TDF_AttributeList listOfChildren;name to the - //Standard_Boolean isAtLeastOneFound = givenname->ChildNames(listOfChildren); - //} - - - //------------------------- TDataStd_UAttribute ----------- - //--------------------------------------------------------- - - // Setting TDataStd_UAttribute to a label - - Standard_GUID guid("01010101-0101-0101-1010-010101010101"); - - Handle(TDataStd_UAttribute) uattribute = TDataStd_UAttribute::Set(aLabel, guid); - - // Finding a TDataStd_UAttribute on the label using standard mechanism - - Handle(TDataStd_UAttribute) theUA; - if (aLabel.FindAttribute(guid,theUA)) { - // do something - } - - // Checking that a TDataStd_UAttribute exist on a given label using standard mechanism - - if (aLabel.IsAttribute(guid)) { - // do something - } - - //------------------------- TDF_Reference ----------- - //--------------------------------------------------------- - - TDF_Label referencedlabel; - - // ... Finding referencedlabel ... - - - // Setting TDF_Reference attribute to a label - - Handle(TDF_Reference) reference = TDF_Reference::Set(aLabel, referencedlabel); - - // Getting a label to TDF_Reference attribute refers to - - TDF_Label refLabel = reference->Get(); - - - //------------------------- TDataXtd_Point ---------------- - //--------------------------------------------------------- - gp_Pnt Pnt; - - // ... Defining point ... - - // Setting TDataXtd_Point attribute to a label - - Handle(TDataXtd_Point) P = TDataXtd_Point::Set(aLabel, Pnt); - - //Retrieve gp_Pnt associated with attribute - - gp_Pnt aPnt; - TDataXtd_Geometry::Point(aLabel, aPnt); - - //------------------------- TDataXtd_Plane ---------------- - //--------------------------------------------------------- - gp_Pln Plane; - - // ... Defining plane ... - - // Setting TDataXtd_Plane attribute to a label - - Handle(TDataXtd_Plane) Pl = TDataXtd_Plane::Set(aLabel, Plane); - - //Retrieve gp_Plane associated with attribute - - gp_Pln aPlane; - TDataXtd_Geometry::Plane(aLabel, aPlane); - - //------------------------- TDataXtd_Axis ---------------- - //--------------------------------------------------------- - - gp_Lin Axis; - - // ... Defining axis ... - - // Setting TDataXtd_Axis attribute to a label - - Handle(TDataXtd_Axis) axis = TDataXtd_Axis::Set(aLabel, Axis); - - //Retrieve gp_Ax1 associated with attribute - - gp_Ax1 anAxis; - TDataXtd_Geometry::Axis(aLabel, anAxis); - - - //------------------------- TDataXtd_Geometry ---------------- - //--------------------------------------------------------- - - Handle(TNaming_NamedShape) NS; - - // ... Constructing NS which contains cylinder... - - // Setting TDataXtd_Geometry attribute to the label where is situated - - TDF_Label NSLabel = NS->Label(); - - Handle(TDataXtd_Geometry) geom = TDataXtd_Geometry::Set(NSLabel); - - // Setting a type of geometry - - geom->SetType(TDataXtd_CYLINDER); - - // Retrieving gp_Cylinder stored in associated NamedShape - - // Checking the type of geometry - - if( geom->GetType() == TDataXtd_CYLINDER ) { - - gp_Cylinder Cylinder; - - TDataXtd_Geometry::Cylinder(geom->Label(), Cylinder); - - } - - //------------------------- TDataXtd_Constraint ------------- - //----------------------------------------------------------- - - // Setting TDataXtd_Constraint to a label - - Handle(TDataXtd_Constraint) constraint = TDataXtd_Constraint::Set(aLabel); - - Handle(TNaming_NamedShape) NS1, NS2; - Handle(TDataStd_Real) aDistance; - - // ... Constructing NS1 and NS2 which contain lines and calculating the distance between them ... - - // Setting DISTANCE Dimension between NS1 and NS2 - - constraint->Set(TDataXtd_DISTANCE, NS1, NS2); - - constraint->SetValue(aDistance); // should contain the calucalated distance - - // Checking if is a Dimension rather than a Constraint - - Standard_Boolean isdimension = constraint->IsDimension(); - - if(isdimension) { - - // Getting the distance between NS1 and NS2 - - Handle(TDataStd_Real) valOfdistance = constraint->GetValue(); - - } - - // Setting PARALLEL constraint between NS1 and NS2 - - constraint->Set(TDataXtd_PARALLEL, NS1, NS2); - - // Getting number of geometries which define a constraint - - Standard_Integer number = constraint->NbGeometries(); - - // Checking if a constraint is verified - - Standard_Boolean isverified = constraint->Verified(); - if( !isverified ) { - std::cout << "Constraint is not valid" << std::endl; - } - - - //------------------------- TDataStd_Directory -------------- - //----------------------------------------------------------- - - // Setting TDataStd_Directory to a label - - Handle(TDataStd_Directory) directory = TDataStd_Directory::New(aLabel); - - // Creating a new sub directory of the given directory - - Handle(TDataStd_Directory) newdirectory = TDataStd_Directory::AddDirectory(directory); - - // Creating a new label in directory - - TDF_Label newlabel = TDataStd_Directory::MakeObjectLabel(newdirectory); - - - //------------------------- TDataStd_TreeNode --------------- - //----------------------------------------------------------- - - // Let's create a tree: - - // Root - // | - // --- FirstChild - // | - // --- SecondChild - // | - // --- FirstChildOfSecondChild - - - - // Setting a TDataStd_TreeNode attribute to a label. - // It becomes a root because it hasn't a father: - - Handle(TDataStd_TreeNode) Root = TDataStd_TreeNode::Set(aLabel); - - // Create a child TreeNode: - - Handle(TDataStd_TreeNode) FirstChild = TDataStd_TreeNode::Set(aLabel.FindChild(1)); - Root->Append(FirstChild); - - // Let's add a second child node to the Root: - - Handle(TDataStd_TreeNode) SecondChild = TDataStd_TreeNode::Set(aLabel.FindChild(2)); - Root->Append(SecondChild); - - // Now, it's time to create the a child for the SecondChild node - FirstChildOfSecondChild: - - Handle(TDataStd_TreeNode) FirstChildOfSecondChild = TDataStd_TreeNode::Set(aLabel.FindChild(3)); - SecondChild->Append(FirstChildOfSecondChild); - - // Let's redesign the tree: - - // Root - // | - // --- SecondChild - // | - // --- FirstChild - // | - // --- FirstChildOfSecondChild - - // Removing of the FirstChild from our tree: - - FirstChild->Remove(); - - // Setting the FirstChild node as a first child of the SecondChild node: - - SecondChild->Prepend(FirstChild); -} - -#endif diff --git a/samples/ocafsamples/TDocStd_Sample.cxx b/samples/ocafsamples/TDocStd_Sample.cxx deleted file mode 100644 index d7f7f70c92..0000000000 --- a/samples/ocafsamples/TDocStd_Sample.cxx +++ /dev/null @@ -1,106 +0,0 @@ -// Created on: 1999-12-28 -// Created by: Sergey RUIN -// Copyright (c) 1999-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and / or modify it -// under the terms of the GNU Lesser General Public version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include -#include -#include - -// ==================================================================================== -// This sample contains template for typical actions with OCAF document at application -// level (store / retrieve) -// ==================================================================================== - -#ifdef DEB -static void Sample() -{ - - - //...Creating application - - Handle(TDocStd_Application) app = new TDocStd_Application; - - //...Creating the new document (document contains a framework) - - Handle(TDocStd_Document) doc; - app->NewDocument("Standard", doc); - - //...Getting application to which the document belongs - - app = Handle(TDocStd_Application)::DownCast(doc->Application()); - - - //...Getting application to which the document belongs - - app = Handle(TDocStd_Application)::DownCast(doc->Application()); - - - //...Getting data framework from document - - Handle(TDF_Data) framework = doc->GetData(); - - //...Retrieving the document from a label of its framework - - TDF_Label label; - doc = TDocStd_Document::Get(label); - - //... Filling document with data - - //Saving document in the file "/tmp/example.std" give the full path - - app->SaveAs(doc, "/tmp/example.std"); - - //Closing document - - app->Close(doc); - - //Opening document stored in file - - app->Open("/tmp/example.std", doc); - - - - - //Coping content of a document to another document with possibility update copy in future - - Handle(TDocStd_Document) doc1; - Handle(TDocStd_Document) doc2; - - - TDF_Label source = doc1->GetData()->Root(); - TDF_Label target = doc2->GetData()->Root(); - TDocStd_XLinkTool XLinkTool; - - //Coping content of a document to another document with possibility update copy in future - - XLinkTool.CopyWithLink(target,source); //Now target document has a copy of source document , the copy also has - //a link to have possibility update content of the copy if original changed - - //...Something is changed in source document - - //Updating copy in target document - - XLinkTool.UpdateLink(target); - - //Cping content of a document to another document - - XLinkTool.Copy(target, source); //Now target document has a copy of source document, there is no link between - //the copy and original - - -} -#endif diff --git a/samples/ocafsamples/TNaming_Sample.cxx b/samples/ocafsamples/TNaming_Sample.cxx deleted file mode 100644 index 1a6320be9d..0000000000 --- a/samples/ocafsamples/TNaming_Sample.cxx +++ /dev/null @@ -1,410 +0,0 @@ -// Created on: 1999-12-29 -// Created by: Sergey RUIN -// Copyright (c) 1999-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and / or modify it -// under the terms of the GNU Lesser General Public version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -// ======================================================================================= -// This sample contains template for typical actions with OCAF Topologigal Naming services -// ======================================================================================= - -#ifdef DEB - -#define Box1POS 1 -#define Box2POS 2 -#define SelectedEdgesPOS 3 -#define FilletPOS 4 -#define CutPOS 5 - -void Sample() -{ - // Starting with data framework - Handle(TDF_Data) DF = new TDF_Data(); - TDF_Label aLabel = DF->Root(); - - TopoDS_Shape Shape, Context; - - // ====================================================== - // Creating NamedShapes with different type of Evolution - // Scenario: - // 1.Create Box1 and push it as PRIMITIVE in DF - // 2.Create Box2 and push it as PRIMITIVE in DF - // 3.Move Box2 (applying a transformation) - // 4.Push a selected edges of top face of Box1 in DF, - // create Fillet (using selected edges) and push result as modification of Box1 - // 5.Create a Cut (Box1, Box2) as modification of Box1 and push it in DF - // 6.Recover result from DF - // ====================================================== - - // ===================================== - // 1.Box1, TNaming_Evolution == PRIMITIVE - // ===================================== - BRepPrimAPI_MakeBox MKBOX1( 100, 100, 100); // creating Box1 - - //Load the faces of the box in DF - TDF_Label Box1Label = aLabel.FindChild(Box1POS); - TDF_Label Top1 = Box1Label.FindChild(1); - TDF_Label Bottom1 = Box1Label.FindChild(2); - TDF_Label Right1 = Box1Label.FindChild(3); - TDF_Label Left1 = Box1Label.FindChild(4); - TDF_Label Front1 = Box1Label.FindChild(5); - TDF_Label Back1 = Box1Label.FindChild(6); - - TNaming_Builder Box1Ins (Box1Label); - Box1Ins.Generated (MKBOX1.Shape()); - - TNaming_Builder Top1FaceIns (Top1); - TopoDS_Face Top1Face = MKBOX1.TopFace (); - Top1FaceIns.Generated (Top1Face); - - TopoDS_Face Bottom1Face = MKBOX1.BottomFace (); - TNaming_Builder Bottom1FaceIns (Bottom1); - Bottom1FaceIns.Generated (Bottom1Face); - - TopoDS_Face Right1Face = MKBOX1.RightFace (); - TNaming_Builder Right1FaceIns (Right1); - Right1FaceIns.Generated (Right1Face); - - TopoDS_Face Left1Face = MKBOX1.LeftFace (); - TNaming_Builder Left1FaceIns (Left1); - Left1FaceIns.Generated (Left1Face); - - TopoDS_Face Front1Face = MKBOX1.FrontFace (); - TNaming_Builder Front1FaceIns (Front1); - Front1FaceIns.Generated (Front1Face); - - TopoDS_Face Back1Face = MKBOX1.BackFace (); - TNaming_Builder Back1FaceIns (Back1); - Back1FaceIns.Generated (Back1Face); - - // ===================================== - // 2.Box2, TNaming_Evolution == PRIMITIVE - // ===================================== - BRepPrimAPI_MakeBox MKBOX2( 150, 150, 150); // creating Box2 - - //Load the faces of the box2 in DF - TDF_Label Box2Label = aLabel.FindChild(Box2POS); - TDF_Label Top2 = Box2Label.FindChild(1); - TDF_Label Bottom2 = Box2Label.FindChild(2); - TDF_Label Right2 = Box2Label.FindChild(3); - TDF_Label Left2 = Box2Label.FindChild(4); - TDF_Label Front2 = Box2Label.FindChild(5); - TDF_Label Back2 = Box2Label.FindChild(6); - - TNaming_Builder Box2Ins (Box2Label); - Box2Ins.Generated (MKBOX2.Shape()); - - TNaming_Builder Top2FaceIns (Top2); - TopoDS_Face Top2Face = MKBOX2.TopFace (); - Top2FaceIns.Generated (Top2Face); - - TopoDS_Face Bottom2Face = MKBOX2.BottomFace (); - TNaming_Builder Bottom2FaceIns (Bottom2); - Bottom2FaceIns.Generated (Bottom2Face); - - TopoDS_Face Right2Face = MKBOX2.RightFace (); - TNaming_Builder Right2FaceIns (Right2); - Right2FaceIns.Generated (Right2Face); - - TopoDS_Face Left2Face = MKBOX2.LeftFace (); - TNaming_Builder Left2FaceIns (Left2); - Left2FaceIns.Generated (Left2Face); - - TopoDS_Face Front2Face = MKBOX2.FrontFace (); - TNaming_Builder Front2FaceIns (Front2); - Front2FaceIns.Generated (Front2Face); - - TopoDS_Face Back2Face = MKBOX2.BackFace (); - TNaming_Builder Back2FaceIns (Back2); - Back2FaceIns.Generated (Back2Face); - - // ==================================== - // 3.Applying a transformation to Box2 - // ==================================== - gp_Vec vec1(gp_Pnt(0.,0.,0.),gp_Pnt(50.,50.,20.)); - gp_Trsf TRSF; - TRSF.SetTranslation(vec1); - TopLoc_Location loc(TRSF); - TDF_LabelMap scope; - TDF_ChildIterator itchild; - for (itchild.Initialize(Box2Label,Standard_True); itchild.More();itchild.Next()) { - if (itchild.Value().IsAttribute(TNaming_NamedShape::GetID())) scope.Add(itchild.Value()); - } - if (Box2Label.IsAttribute(TNaming_NamedShape::GetID())) scope.Add(Box2Label); - TDF_MapIteratorOfLabelMap it(scope); - for (;it.More();it.Next()) - TNaming::Displace(it.Key(), loc, Standard_True);//with oldshapes - - - //============================================================================ - // 4.Push a selected edges of top face of Box1 in DF, - // create Fillet (using selected edges) and push result as modification of Box1 - //============================================================================= - Handle(TNaming_NamedShape) B1NS; - Box1Label.FindAttribute(TNaming_NamedShape::GetID(), B1NS); - const TopoDS_Shape& box1 = TNaming_Tool::GetShape(B1NS); - Handle(TNaming_NamedShape) Top1NS; - Top1.FindAttribute(TNaming_NamedShape::GetID(), Top1NS); - const TopoDS_Shape& top1face = TNaming_Tool::GetShape(Top1NS); - - BRepFilletAPI_MakeFillet MKFILLET(box1);// fillet's algo - TDF_Label SelectedEdgesLabel = aLabel.FindChild(SelectedEdgesPOS); //Label for selected edges - TopExp_Explorer exp(top1face, TopAbs_EDGE); - Standard_Integer i=1; - for(;exp.More();exp.Next(),i++) { - const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); - const TDF_Label& SelEdge = SelectedEdgesLabel.FindChild(i); - // Creating TNaming_Selector on label - TNaming_Selector Selector(SelEdge); - - // Inserting shape into data framework, we need the context to find neighbourhood of shape - // For example the context for a lateral face of cone is cone itself - // If a shape is standalone the context will be the shape itself - - // Selector.Select(Shape, Context); - // TNaming_Evolution == SELECTED - Selector.Select(E, box1); - // Recover selected edge from DF, only for example - const TopoDS_Edge& FE = TopoDS::Edge(Selector.NamedShape()->Get()); - MKFILLET.Add(5., FE); - } - - MKFILLET.Build(); - if(!MKFILLET.IsDone()) return; //Algorithm failed - - // ...put fillet in the DataFramework as modification of Box1 - TDF_Label FilletLabel = aLabel.FindChild(FilletPOS); - TDF_Label DeletedFaces = FilletLabel.FindChild(i++); - TDF_Label ModifiedFaces = FilletLabel.FindChild(i++); - TDF_Label FacesFromEdges = FilletLabel.FindChild(i++); - TDF_Label FacesFromVertices = FilletLabel.FindChild(i); - - // TNaming_Evolution == MODIFY - TNaming_Builder bFillet(FilletLabel); - bFillet.Modify(box1, MKFILLET.Shape()); - - //New faces generated from edges - TopTools_MapOfShape View; - TNaming_Builder FaceFromEdgeBuilder(FacesFromEdges); - TopExp_Explorer ShapeExplorer (box1, TopAbs_EDGE); - for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { - const TopoDS_Shape& Root = ShapeExplorer.Current (); - if (!View.Add(Root)) continue; - const TopTools_ListOfShape& Shapes = MKFILLET.Generated (Root); - TopTools_ListIteratorOfListOfShape ShapesIterator (Shapes); - for (;ShapesIterator.More (); ShapesIterator.Next ()) { - const TopoDS_Shape& newShape = ShapesIterator.Value (); - // TNaming_Evolution == GENERATED - if (!Root.IsSame (newShape)) FaceFromEdgeBuilder.Generated (Root,newShape ); - } - } - - //Faces of the initial shape modified by MKFILLET - View.Clear(); - TNaming_Builder ModFacesBuilder(ModifiedFaces); - ShapeExplorer.Init(box1,TopAbs_FACE); - for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { - const TopoDS_Shape& Root = ShapeExplorer.Current (); - if (!View.Add(Root)) continue; - const TopTools_ListOfShape& Shapes = MKFILLET.Modified (Root); - TopTools_ListIteratorOfListOfShape ShapesIterator (Shapes); - for (;ShapesIterator.More (); ShapesIterator.Next ()) { - const TopoDS_Shape& newShape = ShapesIterator.Value (); - // TNaming_Evolution == MODIFY - if (!Root.IsSame (newShape)) ModFacesBuilder.Modify (Root,newShape ); - } - } - - //Deleted faces of the initial shape - View.Clear(); - TNaming_Builder DelFacesBuilder(DeletedFaces); - ShapeExplorer.Init(box1, TopAbs_FACE); - for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { - const TopoDS_Shape& Root = ShapeExplorer.Current (); - if (!View.Add(Root)) continue; - // TNaming_Evolution == DELETE - if (MKFILLET.IsDeleted (Root)) DelFacesBuilder.Delete (Root); - } - - //New faces generated from vertices - View.Clear(); - TNaming_Builder FaceFromVertexBuilder(FacesFromVertices); - ShapeExplorer.Init(box1, TopAbs_VERTEX); - for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { - const TopoDS_Shape& Root = ShapeExplorer.Current (); - if (!View.Add(Root)) continue; - const TopTools_ListOfShape& Shapes = MKFILLET.Generated (Root); - TopTools_ListIteratorOfListOfShape ShapesIterator (Shapes); - for (;ShapesIterator.More (); ShapesIterator.Next ()) { - const TopoDS_Shape& newShape = ShapesIterator.Value (); - // TNaming_Evolution == GENERATED - if (!Root.IsSame (newShape)) FaceFromVertexBuilder.Generated (Root,newShape ); - } - } - // ===================================================================== - // 5.Create a Cut (Box1, Box2) as modification of Box1 and push it in DF - // Boolean operation - CUT Object=Box1, Tool=Box2 - // ===================================================================== - - TDF_Label CutLabel = aLabel.FindChild(CutPOS); - - // recover Object - Handle(TNaming_NamedShape) ObjectNS; - FilletLabel.FindAttribute(TNaming_NamedShape::GetID(), ObjectNS); - TopoDS_Shape OBJECT = ObjectNS->Get(); - - // Select Tool - TDF_Label ToolLabel = CutLabel.FindChild(1); - TNaming_Selector ToolSelector(ToolLabel); - Handle(TNaming_NamedShape) ToolNS; - Box2Label.FindAttribute(TNaming_NamedShape::GetID(), ToolNS); - const TopoDS_Shape& Tool = ToolNS->Get(); - //TNaming_Evolution == SELECTED - ToolSelector.Select(Tool, Tool); - const TopoDS_Shape& TOOL = ToolSelector.NamedShape()->Get(); - - BRepAlgoAPI_Cut mkCUT (OBJECT, TOOL); - - if (!mkCUT.IsDone()) { - std::cout << "CUT: Algorithm failed" << std::endl; - return; - } else - { - TopTools_ListOfShape Larg; - Larg.Append(OBJECT); - Larg.Append(TOOL); - - if (!BRepAlgo::IsValid(Larg, mkCUT.Shape(), Standard_True, Standard_False)) { - - std::cout << "CUT: Result is not valid" << std::endl; - return; - } else - { - // push CUT results in DF as modification of Box1 - TDF_Label Modified = CutLabel.FindChild(2); - TDF_Label Deleted = CutLabel.FindChild(3); - TDF_Label Intersections = CutLabel.FindChild(4); - TDF_Label NewFaces = CutLabel.FindChild(5); - - TopoDS_Shape newS1 = mkCUT.Shape(); - const TopoDS_Shape& ObjSh = mkCUT.Shape1(); - - //push in the DF result of CUT - TNaming_Builder CutBuilder (CutLabel); - // TNaming_Evolution == MODIFY - CutBuilder.Modify (ObjSh, newS1); - - //push in the DF modified faces - View.Clear(); - TNaming_Builder ModBuilder(Modified); - ShapeExplorer.Init(ObjSh, TopAbs_FACE); - for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { - const TopoDS_Shape& Root = ShapeExplorer.Current (); - if (!View.Add(Root)) continue; - const TopTools_ListOfShape& Shapes = mkCUT.Modified (Root); - TopTools_ListIteratorOfListOfShape ShapesIterator (Shapes); - for (;ShapesIterator.More (); ShapesIterator.Next ()) { - const TopoDS_Shape& newShape = ShapesIterator.Value (); - // TNaming_Evolution == MODIFY - if (!Root.IsSame (newShape)) ModBuilder.Modify (Root,newShape ); - } - } - - //push in the DF deleted faces - View.Clear(); - TNaming_Builder DelBuilder(Deleted); - ShapeExplorer.Init (ObjSh,TopAbs_FACE); - for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { - const TopoDS_Shape& Root = ShapeExplorer.Current (); - if (!View.Add(Root)) continue; - // TNaming_Evolution == DELETE - if (mkCUT.IsDeleted (Root)) DelBuilder.Delete (Root); - } - - // push in the DF section edges - TNaming_Builder IntersBuilder(Intersections); - TopTools_ListIteratorOfListOfShape its(mkCUT.SectionEdges()); - for (; its.More(); its.Next()) { - // TNaming_Evolution == SELECTED - IntersBuilder.Select(its.Value(),its.Value()); - } - - // push in the DF new faces added to the object: - const TopoDS_Shape& ToolSh = mkCUT.Shape2(); - TNaming_Builder newBuilder (NewFaces); - ShapeExplorer.Init(ToolSh, TopAbs_FACE); - for (; ShapeExplorer.More(); ShapeExplorer.Next()) { - const TopoDS_Shape& F = ShapeExplorer.Current(); - const TopTools_ListOfShape& modified = mkCUT.Modified(F); - if (!modified.IsEmpty()) { - TopTools_ListIteratorOfListOfShape itr(modified); - for (; itr.More (); itr.Next ()) { - const TopoDS_Shape& newShape = itr.Value(); - Handle(TNaming_NamedShape) NS = TNaming_Tool::NamedShape(newShape, NewFaces); - if (NS.IsNull() || NS->Evolution() != TNaming_MODIFY) { - // TNaming_Evolution == GENERATED - newBuilder.Generated(F, newShape); - } - } - } - } - } - } - // end of CUT - - // ================================================= - // 6.Recover result from DF - // get final result - Box1 shape after CUT operation - // ================================================= - Handle(TNaming_NamedShape) ResultNS; - CutLabel.FindAttribute(TNaming_NamedShape::GetID(), ResultNS); - const TopoDS_Shape& Result_1 = ResultNS->Get(); // here is result of cut operation - ResultNS.Nullify(); - Box1Label.FindAttribute(TNaming_NamedShape::GetID(), ResultNS); - const TopoDS_Shape& Result_2 = TNaming_Tool::CurrentShape(ResultNS);//here is also result of cut operation - - // - //Result_1 and Result_2 are the same shapes - //========================================= -} -#endif diff --git a/samples/ocafsamples/TPrsStd_Sample.cxx b/samples/ocafsamples/TPrsStd_Sample.cxx deleted file mode 100644 index 8c597e1921..0000000000 --- a/samples/ocafsamples/TPrsStd_Sample.cxx +++ /dev/null @@ -1,217 +0,0 @@ -// Created on: 1999-12-27 -// Created by: Sergey RUIN -// Copyright (c) 1999-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and / or modify it -// under the terms of the GNU Lesser General Public version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// ==================================================================================== -// This sample contains template for typical actions with OCAF visualization attributes -// ==================================================================================== - -#ifdef DEB -static void Sample() -{ - // Starting with data framework - Handle(TDF_Data) DF = new TDF_Data(); - TDF_Label aLabel = DF->Root(); - - //----------------------------------- TPrsStd_AISViewer ---------------------------------------- - //============================================================================================== - - // Setting the TPrsStd_AISViewer in the framework - - Handle(V3d_Viewer) aViewer; - - //... Initialization of aViewer - - //Creating the new AIS_InteractiveContext - Handle(AIS_InteractiveContext) ctx = new AIS_InteractiveContext(aViewer); - - //Creating the new TPrsStd_AISViewer attribute initialized with AIS_InteractiveContext - Handle(TPrsStd_AISViewer) aisviewer; - - if( !TPrsStd_AISViewer::Has(aLabel) ) { //Check if there has already been set TPrsStd_AISViewer in the framework - aisviewer = TPrsStd_AISViewer::New(aLabel, ctx); - } - - //Finding TPrsStd_AISViewer attribute in the DataFramework - if( TPrsStd_AISViewer::Find(aLabel, aisviewer) ) { - aisviewer->Update(); //Update the viewer associated with this attribute - } - - //Getting AIS_InteractiveContext from TPrsStd_AISViewer may be done in two ways: - - //1. If we have already gotten TPrsStd_AISViewer attribute (stored in a variable ) - Handle(AIS_InteractiveContext) context1 = aisviewer->GetInteractiveContext(); - - //2. Getting AIS_InteractiveContext directly - Handle(AIS_InteractiveContext) context2; - if( TPrsStd_AISViewer::Find(aLabel, context2) ) { - //do something... - } - - //----------------------------------- TPrsStd_Driver and TPrsStd_DriverTable ------------------- - //============================================================================================== - - // All work for building AIS_InteractiveObject to be presented by TPrsStd_AISPresentation is done - // by drivers which are descendants of deferred class TPrsStd_Driver - - // There is a map of drivers with Standard_GUID as a key. - - // Adding driver to the map of drivers - - Handle(TPrsStd_NamedShapeDriver) NSDriver = new TPrsStd_NamedShapeDriver(); - - Handle(TPrsStd_DriverTable) table = TPrsStd_DriverTable::Get(); - - Standard_GUID guid = TNaming_NamedShape::GetID(); - - table->AddDriver(guid, NSDriver); - - // When the first time called TPrsStd_DriverTable loads standard drivers defined in TPrsStd package - - // Getting driver from the map of drivers - - Standard_GUID driverguid = TNaming_NamedShape::GetID(); - - Handle(TPrsStd_NamedShapeDriver) driver; - - if( table->FindDriver(driverguid, driver) ) - std::cout << "Driver was found " << std::endl; - else - std::cout << "Driver wasn't found" << std::endl; - - // Driver can be used to build AIS_InteractiveObject for presenting the given label - - Handle(TPrsStd_PlaneDriver) planedriver; - - if( table->FindDriver(TDataXtd_Plane::GetID(), planedriver) ) { - - TDF_Label planelabel; - - // Finding planelabel ... - - Handle(AIS_InteractiveObject) aisobject; - - planedriver->Update(planelabel, aisobject); - - if( !aisobject.IsNull() ) { - - // Do something with aisobject ... - - } - } - - //----------------------------------- TPrsStd_AISPresentation ---------------------------------- - //============================================================================================== - - - TDF_Label ShapeLabel; - - // ... Setting TNaming_NamedShape to - - // Setting the new TPrsStd_AISPresentation to - // It can be done in two different ways: - - Handle(TPrsStd_AISPresentation) Presentation; - // 1. By giving to TPrsStd_AISPresentation attribute Standard_GUID of an attribute to be displayed: - // This GUID will be used to find driver for building AIS_InteractiveObject in the map of drivers - - Presentation = TPrsStd_AISPresentation::Set( ShapeLabel, TNaming_NamedShape::GetID() ); - - // 2. Or by giving the attribute itself to TPrsStd_AISPresentation attribute: - // An ID of attribute will be used to find driver for building AIS_InteractiveObject in the map of drivers - - Handle(TNaming_NamedShape) NS; - if( ShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), NS) ) { - Presentation = TPrsStd_AISPresentation::Set( NS ); - } - - - // Displaying (recomputation of presentation of attribute is done only if presentation is null) - - Handle(TPrsStd_AISPresentation) PRS; - - if( ShapeLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), PRS) ) PRS->Display(); - //After call of the method PRS->Display() the presentation of the attribute is marked as displayed in - //AIS_InteractiveContext but not in viewer, in order to draw the object in viewer last has to be updated - - TPrsStd_AISViewer::Update(ShapeLabel); //Update presentation of the attribute in a viewer's window - - // Erasing - - if( ShapeLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), PRS) ) PRS->Erase(); - // The method Erase() marks presentation of attribute as erased in AIS_InteractiveContext; - // in order to make changes visible in a viewer's window viewer has to be updated - TPrsStd_AISViewer::Update(ShapeLabel); //Update viewer to erase presentation of the attribute in a viewer's window - //Presentation of the attribute is erased from viewer but - // stays in AIS_InteractiveContext - - if( ShapeLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), PRS) ) PRS->Erase(Standard_True); - TPrsStd_AISViewer::Update(ShapeLabel); - //Presentation of the attribute is erased - //from viewer and removed from AIS_InteractiveContext - - Handle(TPrsStd_AISPresentation) P; - if( ShapeLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), P) ) { - - // Updating and displaying presentation of the attribute to be displayed - - P->Display(Standard_True); - TPrsStd_AISViewer::Update(ShapeLabel); //Update presentation of the attribute in a viewer's window - - //Getting Standard_GUID of attribute with which TPrsStd_AISPresentation attribute is associated - - Standard_GUID guid = P->GetDriverGUID(); - - //Setting a color to the displayed attribute - - P->SetColor(Quantity_NOC_RED); - TPrsStd_AISViewer::Update(ShapeLabel); //Update viewer to make changes visible to user - - //Getting transparency the displayed attribute - - Standard_Real transparency = P->Transparency(); - - //Getting AIS_InteractiveObject built and stored in the AIS_Presentation attribute - - Handle(AIS_InteractiveObject) AISObject = P->GetAIS(); - } - - // ... Attribute is modified - - - //Updating presentation of the attribute in viewer - - if( ShapeLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), PRS) ) - PRS->Update(); //Updates presentation of attribute in AIS_InteractiveContext - TPrsStd_AISViewer::Update(ShapeLabel); //Updates presentation in viewer - - return; -} - -#endif diff --git a/samples/ocafsamples/readme.txt b/samples/ocafsamples/readme.txt deleted file mode 100644 index dd9fbef293..0000000000 --- a/samples/ocafsamples/readme.txt +++ /dev/null @@ -1,11 +0,0 @@ -======================================================================== - Open CasCade Application Framework samples -======================================================================== - - -The provided in this directory set of samples dedicated to get initial -knowledge about typical actions with OCAF services. -All samples are compilable, but the method 'Sample()' of each file is not -dedicated for execution 'as is'. Rather it can be considered as set of -logical actions using some OCAF service. It may be useful for newcomers. - diff --git a/samples/qt/AndroidQt/.gitignore b/samples/qt/AndroidQt/.gitignore deleted file mode 100644 index 2c0f0cc01a..0000000000 --- a/samples/qt/AndroidQt/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -3rdparty -occt \ No newline at end of file diff --git a/samples/qt/AndroidQt/AndroidQt.pro b/samples/qt/AndroidQt/AndroidQt.pro deleted file mode 100644 index 0b1527fc51..0000000000 --- a/samples/qt/AndroidQt/AndroidQt.pro +++ /dev/null @@ -1,34 +0,0 @@ -TEMPLATE = app - -QT += qml quick widgets - -SOURCES += src/Main.cxx \ - src/AndroidQt.cxx \ - src/AndroidQt_Window.cxx \ - src/AndroidQt_TouchParameters.cxx - -RESOURCES += ./src/AndroidQt.qrc - -# Additional import path used to resolve QML modules in Qt Creator's code model -QML_IMPORT_PATH = - -# OCCT -include(OCCT.pri) - -# Default rules for deployment. -include(Deployment.pri) - -HEADERS += \ - src/AndroidQt.h \ - src/AndroidQt_Window.h \ - src/AndroidQt_TouchParameters.h \ - src/AndroidQt_UserInteractionParameters.h - -INCLUDEPATH += $$_PRO_FILE_PWD_/src -DEPENDPATH += $$_PRO_FILE_PWD_/src - -OTHER_FILES += \ - android/src/org/qtproject/example/AndroidQt/AndroidQt.java \ - android/AndroidManifest.xml - -ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android diff --git a/samples/qt/AndroidQt/AndroidQt0.pro b/samples/qt/AndroidQt/AndroidQt0.pro deleted file mode 100644 index 26610ecf4f..0000000000 --- a/samples/qt/AndroidQt/AndroidQt0.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE=subdirs - -SUBDIRS=AndroidQt0 - -AndroidQt0.file=AndroidQt.pro diff --git a/samples/qt/AndroidQt/CMakeLists.txt b/samples/qt/AndroidQt/CMakeLists.txt deleted file mode 100644 index ba43a22a39..0000000000 --- a/samples/qt/AndroidQt/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -project(AndroidQt) - -# Sample configuration -set (EXECUTABLE_PROJECT ON) -set (USE_QT ON) -set (RELATIVE_DIR "samples/qt") -set (TARGET_FOLDER "Samples") - -include_directories("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/${RELATIVE_DIR}") - -OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) - -# Target-specific definitions -target_compile_definitions(AndroidQt PRIVATE -DNO_Common_EXPORTS) - - diff --git a/samples/qt/AndroidQt/Deployment.pri b/samples/qt/AndroidQt/Deployment.pri deleted file mode 100644 index 5441b63dc8..0000000000 --- a/samples/qt/AndroidQt/Deployment.pri +++ /dev/null @@ -1,27 +0,0 @@ -android-no-sdk { - target.path = /data/user/qt - export(target.path) - INSTALLS += target -} else:android { - x86 { - target.path = /libs/x86 - } else: armeabi-v7a { - target.path = /libs/armeabi-v7a - } else { - target.path = /libs/armeabi - } - export(target.path) - INSTALLS += target -} else:unix { - isEmpty(target.path) { - qnx { - target.path = /tmp/$${TARGET}/bin - } else { - target.path = /opt/$${TARGET}/bin - } - export(target.path) - } - INSTALLS += target -} - -export(INSTALLS) diff --git a/samples/qt/AndroidQt/EXTERNLIB.cmake b/samples/qt/AndroidQt/EXTERNLIB.cmake deleted file mode 100644 index e69a75f041..0000000000 --- a/samples/qt/AndroidQt/EXTERNLIB.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# External dependencies for AndroidQt sample -set(OCCT_AndroidQt_EXTERNAL_LIBS - TKernel - TKMath - TKG2d - TKG3d - TKGeomBase - TKBRep - TKGeomAlgo - TKTopAlgo - TKShHealing - TKService - TKMesh - TKHLR - TKV3d - TKOpenGl - CSF_FreeImagePlus - CSF_FREETYPE - CSF_OpenGlLibs -) \ No newline at end of file diff --git a/samples/qt/AndroidQt/FILES.cmake b/samples/qt/AndroidQt/FILES.cmake deleted file mode 100644 index 71d1823196..0000000000 --- a/samples/qt/AndroidQt/FILES.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# Source files for AndroidQt sample -set(OCCT_AndroidQt_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") - -set(OCCT_AndroidQt_FILES - src/AndroidQt.cxx - src/AndroidQt.h - src/AndroidQt.qrc - src/AndroidQt_TouchParameters.cxx - src/AndroidQt_TouchParameters.h - src/AndroidQt_UserInteractionParameters.h - src/AndroidQt_Window.cxx - src/AndroidQt_Window.h - src/Main.cxx -) \ No newline at end of file diff --git a/samples/qt/AndroidQt/OCCT.pri b/samples/qt/AndroidQt/OCCT.pri deleted file mode 100644 index 5e4976798a..0000000000 --- a/samples/qt/AndroidQt/OCCT.pri +++ /dev/null @@ -1,60 +0,0 @@ -# -INCLUDEPATH += $$_PRO_FILE_PWD_/occt/inc $$_PRO_FILE_PWD_/3rdparty/include -DEPENDPATH += $$_PRO_FILE_PWD_/occt/inc $$_PRO_FILE_PWD_/3rdparty/include - -DEFINES += OCC_CONVERT_SIGNALS - -CONFIG(debug,debug|release) { - DEFINES += DEB -} - -occt_lib_subpath = libs/armeabi-v7a - -occt_lib_path = $$_PRO_FILE_PWD_/occt/$$occt_lib_subpath -3rdparty_lib_path = $$_PRO_FILE_PWD_/3rdparty/$$occt_lib_subpath - -android { - QMAKE_CFLAGS += -fexceptions -Wno-ignored-qualifiers - QMAKE_CXXFLAGS += -fexceptions -Wno-ignored-qualifiers -std=c++17 - LIBS += -L$$occt_lib_path -lEGL -} -win32 { - QMAKE_CXXFLAGS_WARN_ON += -W4 - QMAKE_CXXFLAGS += /std:c++17 - INCLUDEPATH += $$(CSF_OCCTIncludePath) - LIBS += -L$(CSF_OCCTLibPath);$(CSF_PRODLibPath) - LIBS += -lopengl32 -} - -LIBS += -lTKernel \ - -lTKMath \ - -lTKG2d \ - -lTKG3d \ - -lTKGeomBase \ - -lTKBRep \ - -lTKGeomAlgo \ - -lTKTopAlgo \ - -lTKShHealing \ - -lTKService \ - -lTKMesh \ - -lTKHLR \ - -lTKV3d \ - -lTKOpenGles - -# IMPORTANT. load libraries in a proper order -ANDROID_EXTRA_LIBS = $$3rdparty_lib_path/libfreeimage.so \ - $$3rdparty_lib_path/libfreetype.so \ - $$occt_lib_path/libTKernel.so \ - $$occt_lib_path/libTKMath.so \ - $$occt_lib_path/libTKG2d.so \ - $$occt_lib_path/libTKG3d.so \ - $$occt_lib_path/libTKGeomBase.so \ - $$occt_lib_path/libTKBRep.so \ - $$occt_lib_path/libTKGeomAlgo.so \ - $$occt_lib_path/libTKTopAlgo.so \ - $$occt_lib_path/libTKShHealing.so \ - $$occt_lib_path/libTKService.so \ - $$occt_lib_path/libTKMesh.so \ - $$occt_lib_path/libTKHLR.so \ - $$occt_lib_path/libTKV3d.so \ - $$occt_lib_path/libTKOpenGles.so diff --git a/samples/qt/AndroidQt/PACKAGES.cmake b/samples/qt/AndroidQt/PACKAGES.cmake deleted file mode 100644 index 68a4cffcbe..0000000000 --- a/samples/qt/AndroidQt/PACKAGES.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Packages for AndroidQt sample -set(OCCT_AndroidQt_LIST_OF_PACKAGES - AndroidQt -) \ No newline at end of file diff --git a/samples/qt/AndroidQt/ReadMe.md b/samples/qt/AndroidQt/ReadMe.md deleted file mode 100644 index 5257119863..0000000000 --- a/samples/qt/AndroidQt/ReadMe.md +++ /dev/null @@ -1,91 +0,0 @@ -Qt: 3D Viewer (C++|QtQuick|QML) {#samples_qml_android_occt} -================== - -This sample demonstrates a simple way of using OCCT libraries in Android application written using Qt/Qml. -The sample could be found within OCCT repository in folder `/samples/qt/AndroidQt/`. - -The connection between Qt/Qml and OCCT (C++) level is provided by proxy library, libAndroidQt.so, written in C++. -The proxy library contains single C++ class AndroidQt encapsulating OCCT viewer and providing functionality to manipulate this viewer -and to import OCCT shapes from supported format of CAD file (BREP). - -@figure{samples_qml_android_occt.jpg} - -Requirements for building sample: -* Java Development Kit 1.7 or higher -* Qt 5.3 or higher -* Android SDK from 2014.07.02 or newer -* Android NDK r9d or newer -* Apache Ant 1.9.4 or higher -* OCCT compiled under Android platform and placed in directories: - * occt/libs/armeabi-v7a/\*.so and occt/inc/\*.hxx (libraries and include files of OCCT install) - * android/assets/opencascade/shared/Shaders/\* (Shaders folder of OCCT install: /share/opencascade/resources/Shaders) - * 3rdparty/include/freetype2/\*, 3rdparty/include/FreeImage.h and 3rdparty/libs/armeabi-v7a/libFreeImage.so and 3rdparty/libs/armeabi-v7a/libfreetype.so - -It is also possible to to correct OCCT.pri file an get resources from another tree of directories. - -When AndroidQt will be started, it may be helpful to have some default data files(BRep) on Device for opening in AndroidQt. -Copy these files into "android\assets\opencascade\shared" and it will be installed to device during compilation procedure. - -Having prepared all these products, configure AndroidQt project for building sample: - -In QtCreator, open AndroidQt.pro project-file: -~~~~ - File -> Open file or Project... -~~~~ - -Specify Android configurations: -~~~~ -Tools->Options->Android -~~~~ -* In JDK location specify path to Java Development Kit -* In Android SDK location specify path to Android SDK -* In Android NDK location specify path to Android NDK -(During this location definition, warning is possible and OK: - "Qt version for architecture mips is missing. To add the Qt version, select Options > Build & Run > Qt Versions.") -* In Ant executable specify path to ant.bat file located in Apache Ant bin directory - -Make sure that "Android for armeabi-v7a" kit has been detected (present in the list). -~~~~ -Tools->Options->Build & Run -~~~~ - -also or it can be checked or corrected in: -~~~~ -Projects->Android for armeabi-v7a option should be checked -~~~~ - -Switch On device, connect it to PC and define it in Qt Creator: -~~~~ -Projects->Manage Kits...->Devices->Device: Run on Android -~~~~ -Check that "Current state" is "Ready to use" on this page. - -~~~~ -Projects->Build Settings->General: Shadow build is switched OFF -~~~~ - -Start configuration: - -~~~~ -Call Build -> Run qmake -~~~~ -Check content of "Compile Output" view. - -In order to perform qmake correctly, for example if you have the following error: -~~~~ -Running steps for project AndroidQt... -Could not start process "\android_armv7\bin\qmake.exe" \samples\qt\AndroidQt\AndroidQt.pro -r -spec android-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug" -Error while building/deploying project AndroidQt (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.3.2)) -When executing step "qmake" -~~~~ - -~~~~ -Projects->Build Settings->General: switch OFF Shadow build -Build->Build Project "Android Qt" -Build->Run -~~~~ - -Dialog to "Select Android Device" is shown. Select Compatible Device, Ok. -In case of any error, see log in "Application Output" view. - -After successful build the application can be deployed to device or emulator. diff --git a/samples/qt/AndroidQt/android/AndroidManifest.xml b/samples/qt/AndroidQt/android/AndroidManifest.xml deleted file mode 100644 index 4d5be71a28..0000000000 --- a/samples/qt/AndroidQt/android/AndroidManifest.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/qt/AndroidQt/android/assets/opencascade/shared/.gitignore b/samples/qt/AndroidQt/android/assets/opencascade/shared/.gitignore deleted file mode 100644 index 51e1556e0c..0000000000 --- a/samples/qt/AndroidQt/android/assets/opencascade/shared/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Shaders diff --git a/samples/qt/AndroidQt/android/res/drawable-hdpi/ic_launcher.png b/samples/qt/AndroidQt/android/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index d27ba82c09..0000000000 Binary files a/samples/qt/AndroidQt/android/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/samples/qt/AndroidQt/android/res/drawable-mdpi/ic_launcher.png b/samples/qt/AndroidQt/android/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 4b86dbf5e9..0000000000 Binary files a/samples/qt/AndroidQt/android/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/samples/qt/AndroidQt/android/res/drawable-xhdpi/ic_launcher.png b/samples/qt/AndroidQt/android/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index cd79bea162..0000000000 Binary files a/samples/qt/AndroidQt/android/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/samples/qt/AndroidQt/android/res/drawable-xxhdpi/ic_launcher.png b/samples/qt/AndroidQt/android/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index a34301f386..0000000000 Binary files a/samples/qt/AndroidQt/android/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/samples/qt/AndroidQt/android/res/values/strings.xml b/samples/qt/AndroidQt/android/res/values/strings.xml deleted file mode 100644 index 4f59f34eb2..0000000000 --- a/samples/qt/AndroidQt/android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - AndroidQt - diff --git a/samples/qt/AndroidQt/android/src/org/qtproject/example/AndroidQt/AndroidQt.java b/samples/qt/AndroidQt/android/src/org/qtproject/example/AndroidQt/AndroidQt.java deleted file mode 100644 index d67d8fd091..0000000000 --- a/samples/qt/AndroidQt/android/src/org/qtproject/example/AndroidQt/AndroidQt.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.qtproject.example.AndroidQt; - -import android.content.Intent; -import android.content.res.AssetManager; -import android.os.Bundle; - -import java.util.List; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -public class AndroidQt extends org.qtproject.qt5.android.bindings.QtActivity -{ - @Override public void onCreate(Bundle theBundle) - { - super.onCreate(theBundle); - - // copy OCCT resources - String aResFolder = getFilesDir().getAbsolutePath(); - copyAssetFolder (getAssets(), "opencascade", aResFolder + "/opencascade"); - - } - - //! Copy folder from assets - private boolean copyAssetFolder (AssetManager theAssetMgr, - String theAssetFolder, - String theFolderPathTo) - { - try - { - String[] aFiles = theAssetMgr.list (theAssetFolder); - File aFolder = new File (theFolderPathTo); - aFolder.mkdirs(); - boolean isOk = true; - for (String aFileIter : aFiles) - { - if (aFileIter.contains (".")) - { - isOk &= copyAsset (theAssetMgr, - theAssetFolder + "/" + aFileIter, - theFolderPathTo + "/" + aFileIter); - } - else - { - isOk &= copyAssetFolder (theAssetMgr, - theAssetFolder + "/" + aFileIter, - theFolderPathTo + "/" + aFileIter); - } - } - return isOk; - } - catch (Exception theError) - { - theError.printStackTrace(); - return false; - } - } - - //! Copy single file from assets - private boolean copyAsset (AssetManager theAssetMgr, - String thePathFrom, - String thePathTo) - { - try - { - InputStream aStreamIn = theAssetMgr.open (thePathFrom); - File aFileTo = new File (thePathTo); - aFileTo.createNewFile(); - OutputStream aStreamOut = new FileOutputStream (thePathTo); - copyStreamContent (aStreamIn, aStreamOut); - aStreamIn.close(); - aStreamIn = null; - aStreamOut.flush(); - aStreamOut.close(); - aStreamOut = null; - return true; - } - catch (Exception theError) - { - theError.printStackTrace(); - return false; - } - } - - //! Copy single file - private static void copyStreamContent (InputStream theIn, - OutputStream theOut) throws IOException - { - byte[] aBuffer = new byte[1024]; - int aNbReadBytes = 0; - while ((aNbReadBytes = theIn.read (aBuffer)) != -1) - { - theOut.write (aBuffer, 0, aNbReadBytes); - } - } -} diff --git a/samples/qt/AndroidQt/custom.bat b/samples/qt/AndroidQt/custom.bat deleted file mode 100644 index b5eea5240f..0000000000 --- a/samples/qt/AndroidQt/custom.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -rem Define QTDIR variable - -set "QTDIR=" diff --git a/samples/qt/AndroidQt/env.bat b/samples/qt/AndroidQt/env.bat deleted file mode 100644 index ab5d45ee45..0000000000 --- a/samples/qt/AndroidQt/env.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off - -call "%~dp0..\..\..\env.bat" %1 %2 %3 - -call "custom.bat" %1 %2 %3 - -set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res" -set "CSF_ResourcesDefaults=%RES_DIR%" - -set "PATH=%QTDIR%/bin;%PATH%" diff --git a/samples/qt/AndroidQt/genproj.bat b/samples/qt/AndroidQt/genproj.bat deleted file mode 100644 index d1abb731ea..0000000000 --- a/samples/qt/AndroidQt/genproj.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -REM Generation of vcproj files with qmake utilite -REM Variable QTDIR and PATH to qmake executable must be defined without fail - -REM Use first argument to specify version of Visual Studio (vc10, vc11, vc12 or vc14), -REM second argument specifies architecture) (win32 or win64) -REM third argument specifies Debug or Release mode - -call "%~dp0env.bat" %1 %2 %3 -call "%VCVARS%" %VCARCH% -qmake -tp vc -r -o AndroidQt.sln AndroidQt0.pro diff --git a/samples/qt/AndroidQt/images/samples_qml_android_occt.jpg b/samples/qt/AndroidQt/images/samples_qml_android_occt.jpg deleted file mode 100644 index 3fbdbd34a3..0000000000 Binary files a/samples/qt/AndroidQt/images/samples_qml_android_occt.jpg and /dev/null differ diff --git a/samples/qt/AndroidQt/msvc.bat b/samples/qt/AndroidQt/msvc.bat deleted file mode 100644 index 79ccc412c8..0000000000 --- a/samples/qt/AndroidQt/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0AndroidQt.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/qt/AndroidQt/res/icons/ic_action_collection.png b/samples/qt/AndroidQt/res/icons/ic_action_collection.png deleted file mode 100644 index c41ca8c8b2..0000000000 Binary files a/samples/qt/AndroidQt/res/icons/ic_action_collection.png and /dev/null differ diff --git a/samples/qt/AndroidQt/res/qml/main.qml b/samples/qt/AndroidQt/res/qml/main.qml deleted file mode 100644 index f933cccdac..0000000000 --- a/samples/qt/AndroidQt/res/qml/main.qml +++ /dev/null @@ -1,85 +0,0 @@ -// Created: 2014-08-28 -// -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of commercial software by OPEN CASCADE SAS. -// -// This software is furnished in accordance with the terms and conditions -// of the contract and with the inclusion of this copyright notice. -// This software or any other copy thereof may not be provided or otherwise -// be made available to any third party. -// No ownership title to the software is transferred hereby. -// -// OPEN CASCADE SAS makes no representation or warranties with respect to the -// performance of this software, and specifically disclaims any responsibility -// for any damages, special or consequential, connected with its use. - -import QtQuick 2.2 -import QtQuick.Window 2.1 - -import QtQuick.Dialogs 1.2 - -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 - -import AndroidQt 1.0 - -Window { - id: root_window - visible: true - - width: (Qt.platform.os == "android" || Qt.platform.os == "ios") ? Screen.width : 600 - height: (Qt.platform.os == "android" || Qt.platform.os == "ios") ? Screen.height : 400 - - Item { - id: root_item - anchors.fill: parent - - AndroidQt { - id: viewer - } - - MouseArea { - anchors.fill: parent - - onPressed: viewer.InitTouch(mouseX, mouseY) - onPositionChanged: viewer.UpdateTouch (mouseX, mouseY) - } - - // open button - Rectangle { - id: open_button - - // align - anchors.top: parent.top - anchors.left: parent.left - - // size - width: (Qt.platform.os == "android" || Qt.platform.os == "ios") ? 200 : 150 - height: (Qt.platform.os == "android" || Qt.platform.os == "ios") ? 200 : 150 - - color: "white" - - // image - Image { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - - source: "qrc:/ic_action_collection.png" - } - - MouseArea { - anchors.fill: parent - onClicked: file_dialog.open() - } - } - } - - FileDialog { - id: file_dialog - title: "Please choose a file" - selectMultiple: false - nameFilters: [ "BRep files (*.brep)", "All files (*)" ] - onAccepted: viewer.ReadShapeFromFile(file_dialog.fileUrl) - } -} diff --git a/samples/qt/AndroidQt/src/AndroidQt.cxx b/samples/qt/AndroidQt/src/AndroidQt.cxx deleted file mode 100644 index c73d00a5ef..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt.cxx +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#if defined(_WIN32) - #include -#endif - -#include "AndroidQt.h" -#include "AndroidQt_UserInteractionParameters.h" -#include "AndroidQt_Window.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -// ======================================================================= -// function : AndroidQt -// purpose : -// ======================================================================= -AndroidQt::AndroidQt() -: myFitAllAction (false) -{ - connect (this, SIGNAL (windowChanged (QQuickWindow*)), this, SLOT (handleWindowChanged (QQuickWindow*))); - - // set shaders location variable - QByteArray aDataRoot = "/data/data/org.qtproject.example.AndroidQt/files/opencascade/shared"; - qputenv ("CSF_ShadersDirectory", aDataRoot + "/Shaders"); -} - -// ======================================================================= -// function : ReadShapeFromFile -// purpose : -// ======================================================================= -bool AndroidQt::ReadShapeFromFile (QString theFilePath) -{ - QUrl aFileUrl (theFilePath); - QString aFilePath = theFilePath; - if (aFileUrl.isLocalFile()) - { - aFilePath = QUrl (theFilePath).toLocalFile(); - } - - if (!QFile (aFilePath).exists()) - { - return false; - } - - TopoDS_Shape aShape; - BRep_Builder aBuildTool; - try - { - OCC_CATCH_SIGNALS - - if (!BRepTools::Read (aShape, aFilePath.toStdString().c_str(), aBuildTool)) - { - return false; - } - - if (!myContext.IsNull()) - { - myContext->EraseAll (Standard_False); - - Handle(AIS_Shape) aShapePrs = new AIS_Shape (aShape); - aShapePrs->SetColor (Quantity_Color(1.0, 0.73, 0.2, Quantity_TOC_RGB)); - - myContext->Display (aShapePrs, Standard_False); - myContext->SetDisplayMode (aShapePrs, AIS_Shaded, Standard_False); - } - - myMutex.lock(); - myFitAllAction = true; - myMutex.unlock(); - - if (window()) - { - window()->update(); - } - } - catch (Standard_Failure) - { - return false; - } - - return true; -} - -// ======================================================================= -// function : InitTouch -// purpose : -// ======================================================================= -void AndroidQt::InitTouch (const double theX, - const double theY) -{ - myMutex.lock(); - myTouchPoint.SetStarts (theX, theY); - myMutex.unlock(); -} - -// ======================================================================= -// function : UpdateTouch -// purpose : -// ======================================================================= -void AndroidQt::UpdateTouch (const double theX, - const double theY) -{ - myMutex.lock(); - myTouchPoint.SetEnds (theX, theY); - myMutex.unlock(); - - if (window()) - window()->update(); -} - -// ======================================================================= -// function : handleWindowChanged -// purpose : -// ======================================================================= -void AndroidQt::handleWindowChanged (QQuickWindow* theWin) -{ - if (theWin == NULL) - { - return; - } - - connect (theWin, SIGNAL (beforeSynchronizing()), this, SLOT (sync()), Qt::DirectConnection); - - theWin->setClearBeforeRendering (false); -} - -// ======================================================================= -// function : sync -// purpose : -// ======================================================================= -void AndroidQt::sync() -{ - myViewportSize = window()->size() * window()->devicePixelRatio(); - - Graphic3d_Vec2i aWinTopLeft (window()->x(), window()->y()); - Graphic3d_Vec2i aWinSize (myViewportSize.width(), myViewportSize.height()); - const bool isChangedLeft = (myWinTopLeft.x() != aWinTopLeft.x()); - const bool isChangedTop = (myWinTopLeft.y() != aWinTopLeft.y()); - myWinTopLeft = aWinTopLeft; - - if (myViewer.IsNull()) - { - initViewer (Aspect_Drawable (window()->winId())); - connect (window(), SIGNAL (beforeRendering()), this, SLOT (paint()), Qt::DirectConnection); - } - else - { - Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myViewer->Driver()); - #ifdef __ANDROID__ - if (aDriver->getRawGlContext() != eglGetCurrentContext()) - { - initViewer (Aspect_Drawable (window()->winId())); - } - else - #endif - { - #ifdef __ANDROID__ - Handle(AndroidQt_Window) aWindow = Handle(AndroidQt_Window)::DownCast(myView->Window()); - aWindow->SetSize (myViewportSize.width(), myViewportSize.height()); - //myView->MustBeResized(); // can be used instead of SetWindow() when EGLsurface has not been changed - - EGLContext anEglContext = eglGetCurrentContext(); - myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); - #else - if (aWinSize.x() != myWinSize.x() - || aWinSize.y() != myWinSize.y()) - { - myView->MustBeResized(); - myView->Invalidate(); - } - else if (isChangedTop) - { - myView->MustBeResized(); - } - else if (isChangedLeft) - { - myView->MustBeResized(); - } - #endif - } - } - myWinSize = aWinSize; -} - -// ======================================================================= -// function : paint -// purpose : -// ======================================================================= -void AndroidQt::paint() -{ - myMutex.lock(); - - if (Abs (myTouchPoint.DevX()) + Abs (myTouchPoint.DevY()) > 1) - { - myView->StartRotation ((Standard_Integer)myTouchPoint.X().first, (Standard_Integer)myTouchPoint.Y().first); - myView->Rotation ((Standard_Integer)myTouchPoint.X().second, (Standard_Integer)myTouchPoint.Y().second); - - myTouchPoint.ClearDev(); - } - - if (myFitAllAction) - { - myView->FitAll(); - myFitAllAction = false; - } - - myMutex.unlock(); - - myView->Redraw(); -} - -// ======================================================================= -// function : initViewer -// purpose : -// ======================================================================= -bool AndroidQt::initViewer (Aspect_Drawable theWin) -{ - int aWidth = 0, aHeight = 0; - Handle(Aspect_DisplayConnection) aDisplayConnection; -#ifdef __ANDROID__ - EGLint aCfgId = 0; - EGLDisplay anEglDisplay = eglGetCurrentDisplay(); - EGLContext anEglContext = eglGetCurrentContext(); - EGLSurface anEglSurf = eglGetCurrentSurface (EGL_DRAW); - - if (anEglDisplay == EGL_NO_DISPLAY - || anEglContext == EGL_NO_CONTEXT - || anEglSurf == EGL_NO_SURFACE) - { - release(); - return false; - } - - eglQuerySurface (anEglDisplay, anEglSurf, EGL_WIDTH, &aWidth); - eglQuerySurface (anEglDisplay, anEglSurf, EGL_HEIGHT, &aHeight); - eglQuerySurface (anEglDisplay, anEglSurf, EGL_CONFIG_ID, &aCfgId); - - const EGLint aConfigAttribs[] = { EGL_CONFIG_ID, aCfgId, EGL_NONE }; - EGLint aNbConfigs = 0; - void* anEglConfig = NULL; - - if (eglChooseConfig (anEglDisplay, aConfigAttribs, &anEglConfig, 1, &aNbConfigs) != EGL_TRUE) - { - Message::DefaultMessenger()->Send ("Error: EGL does not provide compatible configurations", Message_Fail); - release(); - return false; - } - - if (!myViewer.IsNull()) - { - Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myViewer->Driver()); - Handle(AndroidQt_Window) aWindow = Handle(AndroidQt_Window)::DownCast (myView->Window()); - if (!aDriver->InitEglContext (anEglDisplay, anEglContext, anEglConfig)) - { - Message::DefaultMessenger()->Send ("Error: OpenGl_GraphicDriver can not be initialized", Message_Fail); - release(); - return false; - } - - aWindow->SetSize (aWidth, aHeight); - myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); - } - - Handle(OpenGl_GraphicDriver) aDriver = new OpenGl_GraphicDriver (NULL, Standard_False); -#elif defined(_WIN32) - HWND aWinHandle = (HWND)theWin; - HDC aWindowDC = wglGetCurrentDC(); - HGLRC aRendCtx = wglGetCurrentContext(); - if (aWinHandle == NULL - || aWindowDC == NULL - || aRendCtx == NULL) - { - Message::DefaultMessenger()->Send ("Error: No active WGL context!", Message_Fail); - release(); - return false; - } - - RECT aRect; - ::GetClientRect (aWinHandle, &aRect); - aWidth = aRect.right - aRect.left; - aHeight = aRect.bottom - aRect.top; - myWinSize.x() = aWidth; - myWinSize.y() = aHeight; - if (!myViewer.IsNull()) - { - Handle(WNT_Window) aWindow = new WNT_Window (aWinHandle); - myView->SetWindow (aWindow, (Aspect_RenderingContext)aRendCtx); - return true; - } - Handle(OpenGl_GraphicDriver) aDriver = new OpenGl_GraphicDriver (aDisplayConnection, Standard_False); -#endif - - aDriver->ChangeOptions().buffersNoSwap = Standard_True; - //aDriver->ChangeOptions().glslWarnings = Standard_True; // for GLSL shaders debug - -#ifdef __ANDROID__ - if (!aDriver->InitEglContext (anEglDisplay, anEglContext, anEglConfig)) - { - Message::DefaultMessenger()->Send ("Error: OpenGl_GraphicDriver can not be initialized", Message_Fail); - release(); - return false; - } -#endif - - // create viewer - myViewer = new V3d_Viewer (aDriver); - myViewer->SetDefaultBackgroundColor (AndroidQt_UserInteractionParameters::BgColor.Name()); - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - - // create AIS context - myContext = new AIS_InteractiveContext (myViewer); - myContext->SetDisplayMode (AIS_Shaded, false); - -#ifdef __ANDROID__ - Handle(AndroidQt_Window) aWindow = new AndroidQt_Window (aWidth, aHeight); -#elif defined(_WIN32) - Handle(WNT_Window) aWindow = new WNT_Window (aWinHandle); -#endif - - myView = myViewer->CreateView(); - myView->SetImmediateUpdate (Standard_False); - -#ifdef __ANDROID__ - myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); -#else - myView->SetWindow (aWindow, (Aspect_RenderingContext )aRendCtx); -#endif - myView->TriedronDisplay (Aspect_TOTP_RIGHT_LOWER, Quantity_NOC_WHITE, 0.08, V3d_ZBUFFER); - - return true; -} - -// ======================================================================= -// function : release -// purpose : -// ======================================================================= -void AndroidQt::release() -{ - myContext.Nullify(); - myView.Nullify(); - myViewer.Nullify(); -} diff --git a/samples/qt/AndroidQt/src/AndroidQt.h b/samples/qt/AndroidQt/src/AndroidQt.h deleted file mode 100644 index 4b6059fc24..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt.h +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef ANDROIDQT_H -#define ANDROIDQT_H - -#include - -#include -// workaround broken definitions in Qt -#define GLdouble GLdouble - -#include -#include -#include - -#undef GLdouble -#include - -#include -#include - -#include "AndroidQt_TouchParameters.h" - -//! QML item with embedded OCCT viewer. -class AndroidQt : public QQuickItem -{ - Q_OBJECT - -public: - //! Default constructor. - AndroidQt(); - - //! Display shape from file. - Q_INVOKABLE bool ReadShapeFromFile (QString theFilePath); - - //! Handle touch event. - Q_INVOKABLE void InitTouch (const double theX, - const double theY); - - //! Handle touch event. - Q_INVOKABLE void UpdateTouch (const double theX, - const double theY); - -public slots: - - //! Handle OpenGL context creation and window resize events. - void sync(); - - //! Redraw OCCT viewer and handle pending viewer events in rendering thread. - void paint(); - -private slots: - - //! Handle window change event. - void handleWindowChanged (QQuickWindow* theWin); - -private: - - //! (Re-)initialize viewer on OpenGL context change. - //! \param theWin handle to GUI window - bool initViewer (Aspect_Drawable theWin); - - //! Close viewer - void release(); - -private: - - Handle(V3d_Viewer) myViewer; //!< 3D viewer - Handle(V3d_View) myView; //!< 3D view - Handle(AIS_InteractiveContext) myContext; //!< interactive context - Graphic3d_Vec2i myWinTopLeft; //!< cached window position (top-left) - Graphic3d_Vec2i myWinSize; //!< cached window width-height - - QMutex myMutex; //!< mutex for interconnection with rendering thread - QSize myViewportSize; //!< QML item size - AndroidQt_TouchParameters myTouchPoint; //!< cached state of touch event - bool myFitAllAction; //!< queued viewer FitALL event - -}; - -#endif // ANDROIDQT_H diff --git a/samples/qt/AndroidQt/src/AndroidQt.qrc b/samples/qt/AndroidQt/src/AndroidQt.qrc deleted file mode 100644 index fbc4b4a719..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - ../res/qml/main.qml - - - ../res/icons/ic_action_collection.png - - diff --git a/samples/qt/AndroidQt/src/AndroidQt_TouchParameters.cxx b/samples/qt/AndroidQt/src/AndroidQt_TouchParameters.cxx deleted file mode 100644 index 4e8cd0e4af..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt_TouchParameters.cxx +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include "AndroidQt_TouchParameters.h" - -// ======================================================================= -// function : AndroidQt_TouchParameters -// purpose : -// ======================================================================= -AndroidQt_TouchParameters::AndroidQt_TouchParameters() -: myXStart (0.0), - myXEnd (0.0), - myYStart (0.0), - myYEnd (0.0) -{ -} - -// ======================================================================= -// function : AndroidQt_TouchParameters -// purpose : -// ======================================================================= -AndroidQt_TouchParameters::AndroidQt_TouchParameters (const double theX, - const double theY) -: myXStart (theX), - myXEnd (theX), - myYStart (theY), - myYEnd (theY) -{ -} - -// ======================================================================= -// function : X -// purpose : -// ======================================================================= -QPair AndroidQt_TouchParameters::X() const -{ - return qMakePair(myXStart, myXEnd); -} - -// ======================================================================= -// function : DevX -// purpose : -// ======================================================================= -double AndroidQt_TouchParameters::DevX() const -{ - return myXEnd - myXStart; -} - -// ======================================================================= -// function : Y -// purpose : -// ======================================================================= -QPair AndroidQt_TouchParameters::Y() const -{ - return qMakePair(myYStart, myYEnd); -} - -// ======================================================================= -// function : DevY -// purpose : -// ======================================================================= -double AndroidQt_TouchParameters::DevY() const -{ - return myYEnd - myYStart; -} - -// ======================================================================= -// function : SetStarts -// purpose : -// ======================================================================= -void AndroidQt_TouchParameters::SetStarts (const double theXStart, - const double theYStart) -{ - myXStart = theXStart; - myYStart = theYStart; -} - -// ======================================================================= -// function : SetEnds -// purpose : -// ======================================================================= -void AndroidQt_TouchParameters::SetEnds (const double theXEnd, - const double theYEnd) -{ - myXEnd = theXEnd; - myYEnd = theYEnd; -} - -// ======================================================================= -// function : ClearDev -// purpose : -// ======================================================================= -void AndroidQt_TouchParameters::ClearDev() -{ - myXStart = myXEnd; - myYStart = myYEnd; -} diff --git a/samples/qt/AndroidQt/src/AndroidQt_TouchParameters.h b/samples/qt/AndroidQt/src/AndroidQt_TouchParameters.h deleted file mode 100644 index bd62f63646..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt_TouchParameters.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef ANDROIDQT_TOUCHPARAMETERS_H -#define ANDROIDQT_TOUCHPARAMETERS_H - -#include -#include -#include - -//! Class holding touch event state. -class AndroidQt_TouchParameters -{ - -public: - - //! Empty constructor. - AndroidQt_TouchParameters(); - - //! Default constructor. - AndroidQt_TouchParameters (const double theX, - const double theY); - - //! x coord - QPair X() const; - double DevX() const; - - //! y coord - QPair Y() const; - double DevY() const; - - //! Start coords - void SetStarts (const double theXStart, - const double theYStart); - - //! End coords - void SetEnds (const double theXEnd, - const double theYEnd); - - void ClearDev(); - -private: - - double myXStart; - double myXEnd; - - double myYStart; - double myYEnd; - -}; - -#endif // ANDROIDQT_TOUCHPARAMETERS_H diff --git a/samples/qt/AndroidQt/src/AndroidQt_UserInteractionParameters.h b/samples/qt/AndroidQt/src/AndroidQt_UserInteractionParameters.h deleted file mode 100644 index 2010046397..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt_UserInteractionParameters.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef ANDROIDQT_USERINTERACTIONPARAMETERS_H -#define ANDROIDQT_USERINTERACTIONPARAMETERS_H - -#include - -namespace AndroidQt_UserInteractionParameters -{ - const double RotationThreshold = 2; // [pixel] - const double PanThreshold = 4; // [pixel] - const double ZoomThreshold = 6; // [pixel] - const double ZoomRatio = 0.13; // distance ratio - const Quantity_Color BgColor = Quantity_Color(0.145, 0.145, 0.145, Quantity_TOC_RGB); // color of viewer's background -} - -#endif // USERINTERACTIONPARAMETERS_H diff --git a/samples/qt/AndroidQt/src/AndroidQt_Window.cxx b/samples/qt/AndroidQt/src/AndroidQt_Window.cxx deleted file mode 100644 index 9dc603a552..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt_Window.cxx +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include "AndroidQt_Window.h" - -IMPLEMENT_STANDARD_RTTIEXT(AndroidQt_Window, Aspect_Window) - -// ======================================================================= -// function : AndroidQt_Window -// purpose : -// ======================================================================= -AndroidQt_Window::AndroidQt_Window (const int theWidth, const int theHeight, - const int theX1, const int theX2, - const int theY1, const int theY2) -: myWidth (theWidth), myHeight(theHeight), - myX1 (theX1), myX2 (theX2), - myY1 (theY1), myY2 (theY2) -{ - if (myX1 == -1) myX1 = 0; - if (myX2 == -1) myX2 = myWidth; - - if (myY1 == -1) myY1 = 0; - if (myY2 == -1) myY2 = myHeight; -} - -// ======================================================================= -// function : Position -// purpose : -// ======================================================================= -void AndroidQt_Window::Position (Standard_Integer& theX1, - Standard_Integer& theY1, - Standard_Integer& theX2, - Standard_Integer& theY2) const -{ - theX1 = myX1; - theX2 = myX2; - theY1 = myY1; - theY2 = myY2; -} - -// ======================================================================= -// function : SetPosition -// purpose : -// ======================================================================= -void AndroidQt_Window::SetPosition (const Standard_Integer theX1, - const Standard_Integer theY1, - const Standard_Integer theX2, - const Standard_Integer theY2) -{ - myX1 = theX1; - myX2 = theX2; - myY1 = theY1; - myY2 = theY2; -} - -// ======================================================================= -// function : Size -// purpose : -// ======================================================================= -void AndroidQt_Window::Size (Standard_Integer& theWidth, - Standard_Integer& theHeight) const -{ - theWidth = myWidth; - theHeight = myHeight; -} - -// ======================================================================= -// function : SetSize -// purpose : -// ======================================================================= -void AndroidQt_Window::SetSize (const Standard_Integer theWidth, - const Standard_Integer theHeight) -{ - myWidth = theWidth; - myHeight = theHeight; -} diff --git a/samples/qt/AndroidQt/src/AndroidQt_Window.h b/samples/qt/AndroidQt/src/AndroidQt_Window.h deleted file mode 100644 index b465c32778..0000000000 --- a/samples/qt/AndroidQt/src/AndroidQt_Window.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef ANDROIDQT_WINDOW_H -#define ANDROIDQT_WINDOW_H - -#include - -//! This class defines dummy window. -//! The main functionality is viewport dimensions. -class AndroidQt_Window : public Aspect_Window -{ - DEFINE_STANDARD_RTTIEXT(AndroidQt_Window, Aspect_Window) -public: - - //! Creates a wrapper over existing Window handle - AndroidQt_Window(const int theWidth, const int theHeight, - const int theX1 = -1, const int theX2 = -1, - const int theY1 = -1, const int theY2 = -1); - - //! Returns native Window handle - virtual Aspect_Drawable NativeHandle() const { return 0; } - - //! Returns parent of native Window handle. - virtual Aspect_Drawable NativeParentHandle() const { return 0; } - - //! Returns native Window FB config (GLXFBConfig on Xlib) - virtual Aspect_FBConfig NativeFBConfig() const { return 0; } - - //! Opens the window - virtual void Map() const {} - - //! Closes the window - virtual void Unmap() const {} - - //! Applies the resizing to the window - virtual Aspect_TypeOfResize DoResize() { return Aspect_TOR_UNKNOWN; } - - //! Apply the mapping change to the window - virtual Standard_Boolean DoMapping() const { return Standard_True; } - - //! Returns True if the window is opened - virtual Standard_Boolean IsMapped() const { return Standard_True; } - - //! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions - virtual Standard_Real Ratio() const { return 1.0; } - - //! Returns The Window POSITION in PIXEL - virtual void Position (Standard_Integer& theX1, - Standard_Integer& theY1, - Standard_Integer& theX2, - Standard_Integer& theY2) const; - - //! Set The Window POSITION in PIXEL - virtual void SetPosition (const Standard_Integer theX1, - const Standard_Integer theY1, - const Standard_Integer theX2, - const Standard_Integer theY2); - - //! Returns The Window SIZE in PIXEL - virtual void Size (Standard_Integer& theWidth, - Standard_Integer& theHeight) const; - - //! Set The Window SIZE in PIXEL - virtual void SetSize (const Standard_Integer theWidth, - const Standard_Integer theHeight); - -private: - - int myWidth; - int myHeight; - - int myX1; - int myX2; - int myY1; - int myY2; - -}; - -#endif // ANDROIDQT_WINDOW_H diff --git a/samples/qt/AndroidQt/src/Main.cxx b/samples/qt/AndroidQt/src/Main.cxx deleted file mode 100644 index 89160d1e7c..0000000000 --- a/samples/qt/AndroidQt/src/Main.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include -#include - -#include "AndroidQt.h" - -#include - -int main(int argc, char *argv[]) -{ -#if defined(_WIN32) && (QT_VERSION > 0x050000) - TCollection_AsciiString aPlugindsDirName = OSD_Environment ("QTDIR").Value(); - if (!aPlugindsDirName.IsEmpty()) - QApplication::addLibraryPath (QString (aPlugindsDirName.ToCString()) + "/plugins"); -#endif - - QApplication app(argc, argv); - - qmlRegisterType("AndroidQt", 1, 0, "AndroidQt"); - - QQmlApplicationEngine engine; - engine.load (QUrl (QStringLiteral ("qrc:/main.qml"))); - - return app.exec(); -} diff --git a/samples/qt/Common/res/antialiasing.png b/samples/qt/Common/res/antialiasing.png deleted file mode 100644 index da8e5047a4..0000000000 Binary files a/samples/qt/Common/res/antialiasing.png and /dev/null differ diff --git a/samples/qt/Common/res/cascade.png b/samples/qt/Common/res/cascade.png deleted file mode 100755 index 9cd171538d..0000000000 Binary files a/samples/qt/Common/res/cascade.png and /dev/null differ diff --git a/samples/qt/Common/res/close.png b/samples/qt/Common/res/close.png deleted file mode 100755 index b7126e002d..0000000000 Binary files a/samples/qt/Common/res/close.png and /dev/null differ diff --git a/samples/qt/Common/res/cursor_rotate.png b/samples/qt/Common/res/cursor_rotate.png deleted file mode 100755 index a3cb0c1ecc..0000000000 Binary files a/samples/qt/Common/res/cursor_rotate.png and /dev/null differ diff --git a/samples/qt/Common/res/cursor_zoom.png b/samples/qt/Common/res/cursor_zoom.png deleted file mode 100755 index 0020fea39f..0000000000 Binary files a/samples/qt/Common/res/cursor_zoom.png and /dev/null differ diff --git a/samples/qt/Common/res/document.png b/samples/qt/Common/res/document.png deleted file mode 100755 index 1ba28fff33..0000000000 Binary files a/samples/qt/Common/res/document.png and /dev/null differ diff --git a/samples/qt/Common/res/help.png b/samples/qt/Common/res/help.png deleted file mode 100755 index e57336285e..0000000000 Binary files a/samples/qt/Common/res/help.png and /dev/null differ diff --git a/samples/qt/Common/res/lamp.png b/samples/qt/Common/res/lamp.png deleted file mode 100755 index a5a6775c33..0000000000 Binary files a/samples/qt/Common/res/lamp.png and /dev/null differ diff --git a/samples/qt/Common/res/new.png b/samples/qt/Common/res/new.png deleted file mode 100755 index 953757a62f..0000000000 Binary files a/samples/qt/Common/res/new.png and /dev/null differ diff --git a/samples/qt/Common/res/raytracing.png b/samples/qt/Common/res/raytracing.png deleted file mode 100644 index 211e697237..0000000000 Binary files a/samples/qt/Common/res/raytracing.png and /dev/null differ diff --git a/samples/qt/Common/res/reflections.png b/samples/qt/Common/res/reflections.png deleted file mode 100644 index ad48a95615..0000000000 Binary files a/samples/qt/Common/res/reflections.png and /dev/null differ diff --git a/samples/qt/Common/res/shadows.png b/samples/qt/Common/res/shadows.png deleted file mode 100644 index 7562c12918..0000000000 Binary files a/samples/qt/Common/res/shadows.png and /dev/null differ diff --git a/samples/qt/Common/res/tile.png b/samples/qt/Common/res/tile.png deleted file mode 100755 index b3e6d7b5a3..0000000000 Binary files a/samples/qt/Common/res/tile.png and /dev/null differ diff --git a/samples/qt/Common/res/tool-shading.png b/samples/qt/Common/res/tool-shading.png deleted file mode 100755 index 6bb9dc46de..0000000000 Binary files a/samples/qt/Common/res/tool-shading.png and /dev/null differ diff --git a/samples/qt/Common/res/tool_color.png b/samples/qt/Common/res/tool_color.png deleted file mode 100755 index 0daa160caf..0000000000 Binary files a/samples/qt/Common/res/tool_color.png and /dev/null differ diff --git a/samples/qt/Common/res/tool_delete.png b/samples/qt/Common/res/tool_delete.png deleted file mode 100755 index 3886af51d8..0000000000 Binary files a/samples/qt/Common/res/tool_delete.png and /dev/null differ diff --git a/samples/qt/Common/res/tool_material.png b/samples/qt/Common/res/tool_material.png deleted file mode 100755 index f846a56371..0000000000 Binary files a/samples/qt/Common/res/tool_material.png and /dev/null differ diff --git a/samples/qt/Common/res/tool_shading.png b/samples/qt/Common/res/tool_shading.png deleted file mode 100755 index 6bb9dc46de..0000000000 Binary files a/samples/qt/Common/res/tool_shading.png and /dev/null differ diff --git a/samples/qt/Common/res/tool_transparency.png b/samples/qt/Common/res/tool_transparency.png deleted file mode 100755 index 786803a5cf..0000000000 Binary files a/samples/qt/Common/res/tool_transparency.png and /dev/null differ diff --git a/samples/qt/Common/res/tool_wireframe.png b/samples/qt/Common/res/tool_wireframe.png deleted file mode 100755 index 32ad5248ae..0000000000 Binary files a/samples/qt/Common/res/tool_wireframe.png and /dev/null differ diff --git a/samples/qt/Common/res/view_axo.png b/samples/qt/Common/res/view_axo.png deleted file mode 100755 index 4801ab4592..0000000000 Binary files a/samples/qt/Common/res/view_axo.png and /dev/null differ diff --git a/samples/qt/Common/res/view_back.png b/samples/qt/Common/res/view_back.png deleted file mode 100755 index 0798f52938..0000000000 Binary files a/samples/qt/Common/res/view_back.png and /dev/null differ diff --git a/samples/qt/Common/res/view_bottom.png b/samples/qt/Common/res/view_bottom.png deleted file mode 100755 index c7cfdc208a..0000000000 Binary files a/samples/qt/Common/res/view_bottom.png and /dev/null differ diff --git a/samples/qt/Common/res/view_comp_off.png b/samples/qt/Common/res/view_comp_off.png deleted file mode 100755 index c900b196f0..0000000000 Binary files a/samples/qt/Common/res/view_comp_off.png and /dev/null differ diff --git a/samples/qt/Common/res/view_comp_on.png b/samples/qt/Common/res/view_comp_on.png deleted file mode 100755 index 73ca4c83d0..0000000000 Binary files a/samples/qt/Common/res/view_comp_on.png and /dev/null differ diff --git a/samples/qt/Common/res/view_fitall.png b/samples/qt/Common/res/view_fitall.png deleted file mode 100755 index 21d2f423ef..0000000000 Binary files a/samples/qt/Common/res/view_fitall.png and /dev/null differ diff --git a/samples/qt/Common/res/view_fitarea.png b/samples/qt/Common/res/view_fitarea.png deleted file mode 100755 index f20f5c0554..0000000000 Binary files a/samples/qt/Common/res/view_fitarea.png and /dev/null differ diff --git a/samples/qt/Common/res/view_front.png b/samples/qt/Common/res/view_front.png deleted file mode 100755 index a9e99c59b6..0000000000 Binary files a/samples/qt/Common/res/view_front.png and /dev/null differ diff --git a/samples/qt/Common/res/view_glpan.png b/samples/qt/Common/res/view_glpan.png deleted file mode 100755 index 02a9c1cb8d..0000000000 Binary files a/samples/qt/Common/res/view_glpan.png and /dev/null differ diff --git a/samples/qt/Common/res/view_left.png b/samples/qt/Common/res/view_left.png deleted file mode 100755 index 7d25b6ab2f..0000000000 Binary files a/samples/qt/Common/res/view_left.png and /dev/null differ diff --git a/samples/qt/Common/res/view_pan.png b/samples/qt/Common/res/view_pan.png deleted file mode 100755 index 0e9a6a5a03..0000000000 Binary files a/samples/qt/Common/res/view_pan.png and /dev/null differ diff --git a/samples/qt/Common/res/view_reset.png b/samples/qt/Common/res/view_reset.png deleted file mode 100755 index 38849fd694..0000000000 Binary files a/samples/qt/Common/res/view_reset.png and /dev/null differ diff --git a/samples/qt/Common/res/view_right.png b/samples/qt/Common/res/view_right.png deleted file mode 100755 index 5540220cfa..0000000000 Binary files a/samples/qt/Common/res/view_right.png and /dev/null differ diff --git a/samples/qt/Common/res/view_rotate.png b/samples/qt/Common/res/view_rotate.png deleted file mode 100755 index 7e5d013b9f..0000000000 Binary files a/samples/qt/Common/res/view_rotate.png and /dev/null differ diff --git a/samples/qt/Common/res/view_top.png b/samples/qt/Common/res/view_top.png deleted file mode 100755 index b788de36fb..0000000000 Binary files a/samples/qt/Common/res/view_top.png and /dev/null differ diff --git a/samples/qt/Common/res/view_zoom.png b/samples/qt/Common/res/view_zoom.png deleted file mode 100755 index 1b50a37bc8..0000000000 Binary files a/samples/qt/Common/res/view_zoom.png and /dev/null differ diff --git a/samples/qt/Common/src/ApplicationCommon.cxx b/samples/qt/Common/src/ApplicationCommon.cxx deleted file mode 100755 index 2dfc5ed3e1..0000000000 --- a/samples/qt/Common/src/ApplicationCommon.cxx +++ /dev/null @@ -1,620 +0,0 @@ -#include "ApplicationCommon.h" - -#include "DocumentCommon.h" -#include "View.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -static ApplicationCommonWindow* stApp = 0; -static QMdiArea* stWs = 0; - -ApplicationCommonWindow::ApplicationCommonWindow() -: QMainWindow( 0 ), -myNbDocuments( 0 ), -myIsDocuments(false), -myStdToolBar( 0 ), -myCasCadeBar( 0 ), -myFilePopup( 0 ), -myWindowPopup( 0 ), -myFileSeparator(NULL) -{ - stApp = this; - - // create and define the central widget - QFrame* vb = new QFrame( this ); - - QVBoxLayout *layout = new QVBoxLayout( vb ); - layout->setMargin( 0 ); - - vb->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - stWs = new QMdiArea( vb ); - layout->addWidget( stWs ); - setCentralWidget( vb ); - - createStandardOperations(); - createCasCadeOperations(); - - statusBar()->showMessage( QObject::tr("INF_READY"), 5000 ); - resize( 1000, 700 ); -} - -ApplicationCommonWindow::~ApplicationCommonWindow() -{ -} - -void ApplicationCommonWindow::createStandardOperations() -{ - QPixmap newIcon, helpIcon, closeIcon; - - QString dir = getResourceDir() + QString( "/" ); - - newIcon = QPixmap( dir + QObject::tr("ICON_NEW") ); - helpIcon = QPixmap( dir + QObject::tr("ICON_HELP") ); - closeIcon = QPixmap( dir + QObject::tr("ICON_CLOSE") ); - - QAction * fileNewAction, * fileCloseAction, * filePrefUseVBOAction, - * fileQuitAction, * viewToolAction, * viewStatusAction, * helpAboutAction; - - fileNewAction = new QAction( newIcon, QObject::tr("MNU_NEW"), this ); - fileNewAction->setToolTip( QObject::tr("TBR_NEW") ); - fileNewAction->setStatusTip( QObject::tr("TBR_NEW") ); - fileNewAction->setShortcut( QObject::tr("CTRL+N") ); - connect( fileNewAction, SIGNAL( triggered() ) , this, SLOT( onNewDoc() ) ); - myStdActions.insert( FileNewId, fileNewAction ); - - fileCloseAction = new QAction( closeIcon, QObject::tr("MNU_CLOSE"), this ); - fileCloseAction->setToolTip( QObject::tr("TBR_CLOSE") ); - fileCloseAction->setStatusTip( QObject::tr("TBR_CLOSE") ); - fileCloseAction->setShortcut( QObject::tr("CTRL+W") ); - connect( fileCloseAction, SIGNAL( triggered() ) , this, SLOT( onCloseWindow() ) ); - myStdActions.insert( FileCloseId, fileCloseAction ); - - filePrefUseVBOAction = new QAction( QObject::tr("MNU_USE_VBO"), this ); - filePrefUseVBOAction->setToolTip( QObject::tr("TBR_USE_VBO") ); - filePrefUseVBOAction->setStatusTip( QObject::tr("TBR_USE_VBO") ); - filePrefUseVBOAction->setCheckable( true ); - filePrefUseVBOAction->setChecked( true ); - connect( filePrefUseVBOAction, SIGNAL( triggered() ) , this, SLOT( onUseVBO() ) ); - myStdActions.insert( FilePrefUseVBOId, filePrefUseVBOAction ); - - fileQuitAction = new QAction( QObject::tr("MNU_QUIT"), this ); - fileQuitAction->setToolTip( QObject::tr("TBR_QUIT") ); - fileQuitAction->setStatusTip( QObject::tr("TBR_QUIT") ); - fileQuitAction->setShortcut( QObject::tr("CTRL+Q") ); - connect( fileQuitAction, SIGNAL( triggered() ) , qApp, SLOT( closeAllWindows() ) ); - myStdActions.insert( FileQuitId, fileQuitAction ); - - viewToolAction = new QAction( QObject::tr("MNU_TOOL_BAR"), this ); - viewToolAction->setToolTip( QObject::tr("TBR_TOOL_BAR") ); - viewToolAction->setStatusTip( QObject::tr("TBR_TOOL_BAR") ); - connect( viewToolAction, SIGNAL( triggered() ) , this, SLOT( onViewToolBar() )); - viewToolAction->setCheckable( true ); - viewToolAction->setChecked( true ); - myStdActions.insert( ViewToolId, viewToolAction ); - - viewStatusAction = new QAction( QObject::tr("MNU_STATUS_BAR"), this ); - viewStatusAction->setToolTip( QObject::tr("TBR_STATUS_BAR") ); - viewStatusAction->setStatusTip( QObject::tr("TBR_STATUS_BAR") ); - connect( viewStatusAction, SIGNAL( triggered() ), this, SLOT( onViewStatusBar() )); - viewStatusAction->setCheckable( true ); - viewStatusAction->setChecked( true ); - myStdActions.insert( ViewStatusId, viewStatusAction ); - - helpAboutAction = new QAction( helpIcon, QObject::tr("MNU_ABOUT"), this ); - helpAboutAction->setToolTip( QObject::tr( "TBR_ABOUT" ) ); - helpAboutAction->setStatusTip( QObject::tr( "TBR_ABOUT" ) ); - helpAboutAction->setShortcut( QObject::tr( "F1" ) ); - connect( helpAboutAction, SIGNAL( triggered() ) , this, SLOT( onAbout() ) ); - myStdActions.insert( HelpAboutId, helpAboutAction ); - - // create preferences menu - QMenu* aPrefMenu = new QMenu( QObject::tr("MNU_PREFERENCES") ); - aPrefMenu->addAction( filePrefUseVBOAction ); - - // populate a menu with all actions - myFilePopup = new QMenu( this ); - myFilePopup = menuBar()->addMenu( QObject::tr("MNU_FILE") ); - myFilePopup->addAction( fileNewAction ); - myFilePopup->addAction( fileCloseAction ); - myFileSeparator = myFilePopup->addSeparator(); - myFilePopup->addMenu( aPrefMenu ); - myFileSeparator = myFilePopup->addSeparator(); - myFilePopup->addAction( fileQuitAction ); - - // add a view menu - QMenu * view = new QMenu( this ); - - view = menuBar()->addMenu( QObject::tr("MNU_VIEW") ); - view->addAction( viewToolAction ); - view->addAction( viewStatusAction ); - - // add a help menu - QMenu * help = new QMenu( this ); - menuBar()->addSeparator(); - help = menuBar()->addMenu( QObject::tr("MNU_HELP") ); - help->addAction( helpAboutAction ); - - // populate a tool bar with some actions - myStdToolBar = addToolBar( tr( "File Operations" ) ); - myStdToolBar->addAction( fileNewAction ); - myStdToolBar->addAction( helpAboutAction ); - - myStdActions.at(FileCloseId)->setEnabled(myDocuments.count() > 0); - - myStdActions.at(FilePrefUseVBOId)->setEnabled( true ); -} - -void ApplicationCommonWindow::createCasCadeOperations() -{ - createWindowPopup(); - - // populate a tool bar with some actions - myCasCadeBar = addToolBar( tr( "Shape Operations" ) ); - - QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" ); - QAction* a; - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_WIRE") ), QObject::tr("MNU_TOOL_WIRE"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_WIRE") ); - a->setStatusTip( QObject::tr("TBR_TOOL_WIRE") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) ); - myToolActions.insert( ToolWireframeId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_SHAD") ), QObject::tr("MNU_TOOL_SHAD"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_SHAD") ); - a->setStatusTip( QObject::tr("TBR_TOOL_SHAD") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) ); - myToolActions.insert( ToolShadingId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_COLOR") ), QObject::tr("MNU_TOOL_COLOR"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_COLOR") ); - a->setStatusTip( QObject::tr("TBR_TOOL_COLOR") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) ); - myToolActions.insert( ToolColorId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_MATER") ), QObject::tr("MNU_TOOL_MATER"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_MATER") ); - a->setStatusTip( QObject::tr("TBR_TOOL_MATER") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) ); - myToolActions.insert( ToolMaterialId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_TRANS") ), QObject::tr("MNU_TOOL_TRANS"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_TRANS") ); - a->setStatusTip( QObject::tr("TBR_TOOL_TRANS") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) ); - myToolActions.insert( ToolTransparencyId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_DEL") ), QObject::tr("MNU_TOOL_DEL"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_DEL") ); - a->setStatusTip( QObject::tr("TBR_TOOL_DEL") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) ); - myToolActions.insert( ToolDeleteId, a ); - - QSignalMapper* sm = new QSignalMapper( this ); - connect( sm, SIGNAL( mapped( int ) ), this, SLOT( onSetMaterial( int ) ) ); - - a = new QAction( QObject::tr("MNU_BRASS"), this ); - a->setToolTip( QObject::tr("TBR_BRASS") ); - a->setStatusTip( QObject::tr("TBR_BRASS") ); - sm->setMapping( a,(int)Graphic3d_NOM_BRASS ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_BRASS, a ); - - a = new QAction( QObject::tr("MNU_BRONZE"), this ); - a->setToolTip( QObject::tr("TBR_BRONZE") ); - a->setStatusTip( QObject::tr("TBR_BRONZE") ); - sm->setMapping( a, ( int )Graphic3d_NOM_BRONZE ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_BRONZE, a ); - - a = new QAction( QObject::tr("MNU_COPPER"), this ); - a->setToolTip( QObject::tr("TBR_COPPER") ); - a->setStatusTip( QObject::tr("TBR_COPER") ); - sm->setMapping( a, ( int )Graphic3d_NOM_COPPER ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_COPPER, a ); - - a = new QAction( QObject::tr("MNU_GOLD"), this ); - a->setToolTip( QObject::tr("TBR_GOLD") ); - a->setStatusTip( QObject::tr("TBR_GOLD") ); - sm->setMapping( a, ( int )Graphic3d_NOM_GOLD ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_GOLD, a ); - - a = new QAction( QObject::tr("MNU_PEWTER"), this ); - a->setToolTip( QObject::tr("TBR_PEWTER") ); - a->setStatusTip( QObject::tr("TBR_PEWTER") ); - sm->setMapping( a, ( int )Graphic3d_NOM_PEWTER ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_PEWTER, a ); - - a = new QAction( QObject::tr("MNU_PLASTER"), this ); - a->setToolTip( QObject::tr("TBR_PLASTER") ); - a->setStatusTip( QObject::tr("TBR_PLASTER") ); - sm->setMapping( a, ( int )Graphic3d_NOM_PLASTER ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_PLASTER, a ); - - a = new QAction( QObject::tr("MNU_PLASTIC"), this ); - a->setToolTip( QObject::tr("TBR_PLASTIC") ); - a->setStatusTip( QObject::tr("TBR_PLASTIC") ); - sm->setMapping( a, ( int )Graphic3d_NOM_PLASTIC ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_PLASTIC, a ); - - a = new QAction( QObject::tr("MNU_SILVER"), this ); - a->setToolTip( QObject::tr("TBR_SILVER") ); - a->setStatusTip( QObject::tr("TBR_SILVER") ); - sm->setMapping( a, ( int )Graphic3d_NOM_SILVER ); - connect( a, SIGNAL( triggered() ), sm, SLOT( map() ) ); - myMaterialActions.insert( Graphic3d_NOM_SILVER, a ); - - for ( int i = 0; i < myToolActions.size(); i++ ) - myCasCadeBar->addAction( myToolActions.at( i ) ); - myCasCadeBar->hide(); -} - -QList* ApplicationCommonWindow::getToolActions() -{ - return &myToolActions; -} - -QList* ApplicationCommonWindow::getMaterialActions() -{ - return &myMaterialActions; -} - -void ApplicationCommonWindow::createWindowPopup() -{ - if ( !myWindowPopup ) - { - myWindowPopup = new QMenu( QObject::tr( "MNU_WINDOW" ), this ); - connect( myWindowPopup, SIGNAL( aboutToShow() ), - this, SLOT( windowsMenuAboutToShow() ) ); - } -} - -void ApplicationCommonWindow::windowsMenuAboutToShow() -{ - myWindowPopup->clear(); - QAction* a; - - QString dir = getResourceDir() + QString( "/" ); - - a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_NEW3D" ) ), QObject::tr( "MNU_WINDOW_NEW3D" ), this ); - a->setToolTip( QObject::tr( "TBR_WINDOW_NEW3D" ) ); - a->setStatusTip( QObject::tr( "TBR_WINDOW_NEW3D" ) ); - connect( a, SIGNAL( triggered() ), this, SLOT( onCreateNewView() ) ); - myWindowPopup->addAction( a ); - - a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_CASCADE" ) ), QObject::tr( "MNU_WINDOW_CASCADE" ), this ); - a->setToolTip( QObject::tr( "TBR_WINDOW_CASCADE" ) ); - a->setStatusTip( QObject::tr( "TBR_WINDOW_CASCADE" ) ); - connect( a, SIGNAL( triggered() ), stWs, SLOT( cascade() ) ); - myWindowPopup->addAction( a ); - - a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_TILE" ) ), QObject::tr( "MNU_WINDOW_TILE" ), this ); - a->setToolTip( QObject::tr( "TBR_WINDOW_TILE" ) ); - a->setStatusTip( QObject::tr( "TBR_WINDOW_TILE" ) ); - connect( a, SIGNAL( triggered() ), stWs, SLOT( tile() ) ); - myWindowPopup->addAction( a ); - - myWindowPopup->addSeparator(); - QList windows = stWs->subWindowList(); - for (int i = 0; i < windows.count(); ++i) - { - QAction* aAction = new QAction( windows.at(i)->windowTitle(), this ); - aAction->setCheckable( true ); - aAction->setData( i ); - myWindowPopup->addAction( aAction ); - connect( aAction, SIGNAL( toggled( bool ) ), this, SLOT( windowsMenuActivated( bool ) ) ); - aAction->setChecked( stWs->activeSubWindow() == windows.at(i) ); - } -} - -void ApplicationCommonWindow::windowsMenuActivated( bool checked ) -{ - QAction* aSender = qobject_cast( sender() ); - if ( !aSender ) - return; - QWidget * w = stWs->subWindowList().at( aSender->data().toInt() ); - if ( w && checked ) - w->setFocus(); -} - -QMdiArea * ApplicationCommonWindow::getWorkspace() -{ - return stWs; -} - -ApplicationCommonWindow* ApplicationCommonWindow::getApplication() -{ - return stApp; -} - -void ApplicationCommonWindow::updateFileActions() -{ - if (!myDocuments.isEmpty()) - { - return; - } - - if ( !myIsDocuments ) - { - QAction* fileQuitAction = NULL; - QAction* windowAction = NULL; - QList aListActions = myFilePopup->actions(); - for ( int i = 0; i < aListActions.size(); i++ ) - { - if( aListActions.at( i )->text() == QObject::tr("MNU_QUIT") ) - { - fileQuitAction = aListActions.at( i ); - break; - } - } - - if( !fileQuitAction ) - return; - - myIsDocuments = true; - myCasCadeBar->show(); - - QList aListMenuActions = menuBar()->actions(); - for ( int i = 0; i < aListMenuActions.size(); i++ ) - { - if( aListMenuActions.at( i )->text() == QObject::tr("MNU_HELP") ) - { - windowAction= aListMenuActions.at( i ); - break; - } - } - - if( !windowAction ) - return; - - menuBar()->insertMenu( windowAction, myWindowPopup ); - } - else - { - myIsDocuments = false; - myCasCadeBar->hide(); - menuBar()->removeAction( myWindowPopup->menuAction() ); - } -} - -DocumentCommon* ApplicationCommonWindow::createNewDocument() -{ - return new DocumentCommon( ++myNbDocuments, this ); -} - -int& ApplicationCommonWindow::getNbDocument() -{ - return myNbDocuments; -} - -DocumentCommon* ApplicationCommonWindow::onNewDoc() -{ - updateFileActions(); - - DocumentCommon* aDoc = createNewDocument(); - aDoc->onCreateNewView(); - onSelectionChanged(); - - connect (aDoc, SIGNAL (sendCloseDocument (DocumentCommon*) ), - this, SLOT (onCloseDocument (DocumentCommon*))); - connect (stWs, SIGNAL (windowActivated (QWidget*)), - this, SLOT (onWindowActivated (QWidget*))); - connect (aDoc, SIGNAL (selectionChanged()), - this, SLOT (onSelectionChanged())); - - myDocuments.append (aDoc); - myStdActions.at (FileCloseId)->setEnabled (myDocuments.count() > 0); - - return aDoc; -} - -void ApplicationCommonWindow::onCloseWindow() -{ - stWs->activeSubWindow()->close(); -} - -void ApplicationCommonWindow::onUseVBO() -{ - MDIWindow* aWindow = qobject_cast (stWs->activeSubWindow()->widget()); - - if (NULL == aWindow) - return; - - Handle(AIS_InteractiveContext) aContextAIS = aWindow->getDocument()->getContext(); - - if (aContextAIS.IsNull()) - return; - - Handle(OpenGl_GraphicDriver) aDriver = - Handle(OpenGl_GraphicDriver)::DownCast (aContextAIS->CurrentViewer()->Driver()); - - if (!aDriver.IsNull()) - { - aDriver->ChangeOptions().vboDisable = Standard_True; - } -} - -void ApplicationCommonWindow::onCloseDocument(DocumentCommon* theDoc) -{ - myDocuments.removeAll( theDoc ); - theDoc->removeViews(); - delete theDoc; - updateFileActions(); - myStdActions.at(FileCloseId)->setEnabled(myDocuments.count() > 0); -} - -void ApplicationCommonWindow::onViewToolBar() -{ - bool show = myStdActions.at( ViewToolId )->isChecked(); - if ( show == myStdToolBar->isVisible() ) - return; - if ( show ) - myStdToolBar->show(); - else - myStdToolBar->hide(); -} - -void ApplicationCommonWindow::onViewStatusBar() -{ - bool show = myStdActions.at( ViewStatusId )->isChecked(); - if ( show == statusBar()->isVisible() ) - return; - if ( show ) - statusBar()->show(); - else - statusBar()->hide(); -} - -void ApplicationCommonWindow::onAbout() -{ - QMessageBox::information( this, QObject::tr( "TIT_ABOUT" ), QObject::tr( "INF_ABOUT" ), QObject::tr("BTN_OK" ), - QString::null, QString::null, 0, 0 ); -} - -void ApplicationCommonWindow::onCreateNewView() -{ - MDIWindow* window = qobject_cast< MDIWindow* >( stWs->activeSubWindow()->widget() ); - window->getDocument()->onCreateNewView(); -} - -void ApplicationCommonWindow::onWindowActivated ( QWidget * w ) -{ - if (w == NULL) - { - return; - } - - MDIWindow* window = qobject_cast< MDIWindow* >(w); - - window->onWindowActivated(); -} - -void ApplicationCommonWindow::onToolAction() -{ - QAction* sentBy = (QAction*) sender(); - QMdiArea* ws = ApplicationCommonWindow::getWorkspace(); - DocumentCommon* doc = qobject_cast( ws->activeSubWindow()->widget() )->getDocument(); - - if( sentBy == myToolActions.at( ToolWireframeId ) ) - doc->onWireframe(); - - if( sentBy == myToolActions.at( ToolShadingId ) ) - doc->onShading(); - - if( sentBy == myToolActions.at( ToolColorId ) ) - doc->onColor(); - - if( sentBy == myToolActions.at( ToolMaterialId ) ) - doc->onMaterial(); - - if( sentBy == myToolActions.at( ToolTransparencyId ) ) - doc->onTransparency(); - - if( sentBy == myToolActions.at( ToolDeleteId ) ) - doc->onDelete(); -} - -void ApplicationCommonWindow::onSelectionChanged() -{ - QMdiArea* ws = ApplicationCommonWindow::getWorkspace(); - DocumentCommon* doc; - - if( !qobject_cast( ws->activeSubWindow()->widget() ) ) - return; - - doc = ( qobject_cast( ws->activeSubWindow()->widget() ) )->getDocument(); - Handle(AIS_InteractiveContext) context = doc->getContext(); - - bool OneOrMoreInShading = false; - bool OneOrMoreInWireframe = false; - int numSel = context->NbSelected(); - if ( numSel ) - { - for ( context->InitSelected(); context->MoreSelected(); context->NextSelected() ) - { - if ( context->IsDisplayed( context->SelectedInteractive(), 1 ) ) - OneOrMoreInShading = true; - if ( context->IsDisplayed( context->SelectedInteractive(), 0 ) ) - OneOrMoreInWireframe = true; - } - myToolActions.at( ToolWireframeId )->setEnabled( OneOrMoreInShading ); - myToolActions.at( ToolShadingId )->setEnabled( OneOrMoreInWireframe ); - myToolActions.at( ToolColorId )->setEnabled( true ); - myToolActions.at( ToolMaterialId )->setEnabled( true ); - myToolActions.at( ToolTransparencyId )->setEnabled( OneOrMoreInShading ); - myToolActions.at( ToolDeleteId )->setEnabled( true ); - } - else - { - myToolActions.at( ToolWireframeId )->setEnabled( false ); - myToolActions.at( ToolShadingId )->setEnabled( false ); - myToolActions.at( ToolColorId )->setEnabled( false ); - myToolActions.at( ToolMaterialId )->setEnabled( false ); - myToolActions.at( ToolTransparencyId )->setEnabled( false ); - myToolActions.at( ToolDeleteId )->setEnabled( false ); - } -} - -void ApplicationCommonWindow::onSetMaterial( int theMaterial ) -{ - QMdiArea* ws = getWorkspace(); - DocumentCommon* doc = qobject_cast( ws->activeSubWindow()->widget() )->getDocument(); - doc->onMaterial( theMaterial ); -} - -QString ApplicationCommonWindow::getResourceDir() -{ - static QString aResourceDir = - QString (OSD_Environment ("CSF_ResourcesDefaults").Value().ToCString()); - if (aResourceDir.isEmpty()) - aResourceDir = QString (OSD_Environment ("CSF_OCCTResourcePath").Value().ToCString()) + "/samples"; - - return aResourceDir; -} - -void ApplicationCommonWindow::resizeEvent( QResizeEvent* e ) -{ - QMainWindow::resizeEvent( e ); - statusBar()->setSizeGripEnabled( !isMaximized() ); -} - -bool ApplicationCommonWindow::isDocument() -{ - return myIsDocuments; -} - -QMenu* ApplicationCommonWindow::getFilePopup() -{ - return myFilePopup; -} - -QAction* ApplicationCommonWindow::getFileSeparator() -{ - return myFileSeparator; -} - -QToolBar* ApplicationCommonWindow::getCasCadeBar() -{ - return myCasCadeBar; -} diff --git a/samples/qt/Common/src/ApplicationCommon.h b/samples/qt/Common/src/ApplicationCommon.h deleted file mode 100755 index a0d7e4ea31..0000000000 --- a/samples/qt/Common/src/ApplicationCommon.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef APPLICATIONCOMMON_H -#define APPLICATIONCOMMON_H - -#include "DocumentCommon.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -class COMMONSAMPLE_EXPORT ApplicationCommonWindow: public QMainWindow -{ - Q_OBJECT - -public: - enum { FileNewId, FilePrefUseVBOId, FileCloseId, FilePreferencesId, FileQuitId, ViewToolId, ViewStatusId, HelpAboutId }; - enum { ToolWireframeId, ToolShadingId, ToolColorId, ToolMaterialId, ToolTransparencyId, ToolDeleteId }; - - ApplicationCommonWindow(); - ~ApplicationCommonWindow(); - - static QMdiArea* getWorkspace(); - static ApplicationCommonWindow* getApplication(); - static QString getResourceDir(); - - virtual void updateFileActions(); - QList* getToolActions(); - QList* getMaterialActions(); - -protected: - virtual DocumentCommon* createNewDocument(); - int& getNbDocument(); - -public slots: - - DocumentCommon* onNewDoc(); - void onCloseWindow(); - void onUseVBO(); - virtual void onCloseDocument( DocumentCommon* theDoc ); - virtual void onSelectionChanged(); - virtual void onAbout(); - void onViewToolBar(); - void onViewStatusBar(); - void onToolAction(); - void onCreateNewView(); - void onWindowActivated ( QWidget * w ); - void windowsMenuAboutToShow(); - void windowsMenuActivated( bool checked/*int id*/ ); - void onSetMaterial( int theMaterial ); - -protected: - virtual void resizeEvent( QResizeEvent* ); - bool isDocument(); - QMenu* getFilePopup(); - QAction* getFileSeparator(); - QToolBar* getCasCadeBar(); - -private: - void createStandardOperations(); - void createCasCadeOperations(); - void createWindowPopup(); - -private: - int myNbDocuments; - bool myIsDocuments; - - QList myStdActions; - QList myToolActions; - QList myMaterialActions; - //QList myDocuments; - - QToolBar* myStdToolBar; - QToolBar* myCasCadeBar; - QMenu* myFilePopup; - QMenu* myWindowPopup; - QAction* myFileSeparator; - -protected: - QList myDocuments; -}; - -#endif - - diff --git a/samples/qt/Common/src/Common-icon.ts b/samples/qt/Common/src/Common-icon.ts deleted file mode 100755 index 972e6d450d..0000000000 --- a/samples/qt/Common/src/Common-icon.ts +++ /dev/null @@ -1,146 +0,0 @@ - - - - QObject - - ICON_VIEW_PAN - view_pan.png - - - ICON_VIEW_TOP - view_top.png - - - ICON_VIEW_AXO - view_axo.png - - - ICON_CURSOR_ZOOM - cursor_zoom.png - - - ICON_WINDOW_TILE - tile.png - - - ICON_VIEW_ZOOM - view_zoom.png - - - ICON_VIEW_BACK - view_back.png - - - ICON_VIEW_LEFT - view_left.png - - - ICON_VIEW_GLOBALPAN - view_glpan.png - - - ICON_CLOSE - close.png - - - ICON_HELP - help.png - - - ICON_TOOL_TRANS - tool_transparency.png - - - ICON_TOOL_COLOR - tool_color.png - - - ICON_TOOL_MATER - tool_material.png - - - ICON_WINDOW_CASCADE - cascade.png - - - ICON_VIEW_BOTTOM - view_bottom.png - - - ICON_VIEW_HLROFF - view_comp_off.png - - - ICON_VIEW_FITALL - view_fitall.png - - - ICON_CURSOR_ROTATE - cursor_rotate.png - - - ICON_DOC - document.png - - - ICON_NEW - new.png - - - ICON_VIEW_RIGHT - view_right.png - - - ICON_VIEW_RESET - view_reset.png - - - ICON_VIEW_HLRON - view_comp_on.png - - - ICON_VIEW_FRONT - view_front.png - - - ICON_VIEW_ROTATION - view_rotate.png - - - ICON_TOOL_SHAD - tool_shading.png - - - ICON_TOOL_WIRE - tool_wireframe.png - - - ICON_VIEW_FITAREA - view_fitarea.png - - - ICON_TOOL_DEL - tool_delete.png - - - ICON_SAMPLE - lamp.png - - - ICON_TOOL_RAYTRACING - raytracing.png - - - ICON_TOOL_SHADOWS - shadows.png - - - ICON_TOOL_REFLECTIONS - reflections.png - - - ICON_TOOL_ANTIALIASING - antialiasing.png - - - diff --git a/samples/qt/Common/src/Common-string.ts b/samples/qt/Common/src/Common-string.ts deleted file mode 100755 index b44f44efaa..0000000000 --- a/samples/qt/Common/src/Common-string.ts +++ /dev/null @@ -1,458 +0,0 @@ - - - - QObject - - TBR_ROTATION - Dynamic Rotation - - - MNU_GLOBALPAN - &Global Panning - - - MNU_ROTATION - &Dynamic Rotation - - - MNU_AXO - &Axo - - - MNU_NEW - &New - - - MNU_PAN - &Dynamic Panning - - - MNU_TOP - &Top - - - MNU_TOOL_SHAD - &Shading - - - MNU_TOOL_WIRE - &Wireframe - - - TBR_BOTTOM - Bottom - - - MNU_BOTTOM - &Bottom - - - BTN_BRONZE - Bronze - - - MNU_BRONZE - &Bronze - - - TBR_BRONZE - Bronze - - - BTN_COPPER - Copper - - - MNU_COPPER - &Copper - - - TBR_COPPER - Copper - - - MNU_TOOL_COLOR - &Color - - - MNU_TOOL_MATER - &Material - - - TBR_FITALL - FitAll - - - MNU_FITALL - &FilAll - - - MNU_BACK - &Back - - - MNU_FILE - &File - - - MNU_PREFERENCES - &Preferences - - - MNU_USE_VBO - &Use VBO - - - MNU_GOLD - &Gold - - - MNU_HELP - &Help - - - MNU_LEFT - &Left - - - MNU_QUIT - &Quit - - - MNU_VIEW - &View - - - MNU_ZOOM - &Dynamic Zooming - - - MNU_HLROFF - &Hidden Off - - - TBR_HLROFF - Hidden Off - - - MNU_TOOL_TRANS - &Transpatency - - - MNU_TOOL_SHADOWS - &Shadows - - - MNU_TOOL_RAYTRACING - &Ray-tracing - - - MNU_TOOL_REFLECTIONS - &Reflections - - - MNU_TOOL_ANTIALIASING - &Anti-aliasing - - - BTN_BRASS - Brass - - - BTN_PEWTER - Pewter - - - TBR_PEWTER - Pewter - - - MNU_PEWTER - &Pewter - - - MNU_SILVER - &Silver - - - BTN_OK - Ok - - - TBR_SILVER - Silver - - - BTN_SILVER - Silver - - - INF_NULL_SHAPE - Select the shape to export. - - - MNU_WINDOW - &Window - - - TBR_WINDOW - Window - - - BTN_PLASTIC - Plastic - - - BTN_PLASTER - Plaster - - - MNU_PLASTIC - &Plastic - - - MNU_PLASTER - &Plaster - - - TBR_PLASTIC - Plastic - - - TBR_PLASTER - Plaster - - - MNU_TOOL_BAR - &Toolbar - - - MNU_TOOL_DEL - &Delete - - - TBR_BACK - Back - - - TBR_GOLD - Gold - - - TBR_LEFT - Left - - - TBR_QUIT - Quit - - - TBR_VIEW - View - - - TBR_ZOOM - Dynamic Zooming - - - MNU_CH_BACK - &Change Background - - - MNU_CH_ENV_MAP - &Environment Map - - - TBR_CH_BACK - Change Background - - - TBR_TOOL_COLOR - Color - - - TBR_TOOL_MATER - Material - - - TBR_TOOL_RAYTRACING - Enable Ray-tracing - - - TBR_TOOL_SHADOWS - Enable Shadows - - - TBR_TOOL_REFLECTIONS - Enable Reflections - - - TBR_TOOL_ANTIALIASING - Enable Anti-aliasing - - - TBR_TOOL_BAR - Toolbar - - - TBR_TOOL_DEL - Delete - - - TBR_TOOL_TRANS - Transparency - - - TBR_ABOUT - About - - - TBR_BRASS - Brass - - - TBR_CLOSE - Close - - - TBR_FRONT - Front - - - TBR_HLRON - Hidden On - - - TBR_MATER - Material - - - TBR_RIGHT - Right - - - TBR_RESET - Reset - - - TBR_AXO - Axo - - - TBR_NEW - New - - - TBR_PAN - Dynamic Panning - - - TBR_TOP - Top - - - TIT_INF - Info - - - BTN_GOLD - Gold - - - TBR_WINDOW_NEW3D - New 3D View - - - MNU_WINDOW_NEW3D - New 3D View - - - MNU_STATUS_BAR - &Statusbar - - - TIT_ERROR - Error - - - TBR_FITAREA - Zoom Window - - - MNU_FITAREA - &Zoom Window - - - TBR_GLOBALPAN - Global Panning - - - MNU_ABOUT - &About - - - MNU_BRASS - &Brass - - - MNU_CLOSE - &Close - - - MNU_FRONT - &Front - - - MNU_HLRON - &Hidden On - - - MNU_MATER - &Material - - - MNU_RIGHT - &Right - - - MNU_RESET - &Reset - - - INF_ABOUT - Qt based application for tutorial to Open CASCADE Technology - - - INF_READY - Ready - - - TBR_TOOL_SHAD - Shading - - - TBR_TOOL_WIRE - Wireframe - - - TBR_WINDOW_TILE - Tile - - - TBR_STATUS_BAR - Statusbar - - - MNU_WINDOW_CASCADE - Cascade - - - TBR_WINDOW_CASCADE - &Cascade - - - MNU_WINDOW_TILE - &Tile - - - diff --git a/samples/qt/Common/src/CommonSample.h b/samples/qt/Common/src/CommonSample.h deleted file mode 100755 index 4806bf2b11..0000000000 --- a/samples/qt/Common/src/CommonSample.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef COMMONSAMPLE_H -#define COMMONSAMPLE_H - -#ifndef NO_COMMONSAMPLE_EXPORTS -#ifdef COMMONSAMPLE_EXPORTS -#ifdef _WIN32 -#define COMMONSAMPLE_EXPORT __declspec( dllexport ) -#else -#define COMMONSAMPLE_EXPORT -#endif -#else -#ifdef _WIN32 -#define COMMONSAMPLE_EXPORT __declspec( dllimport ) -#else -#define COMMONSAMPLE_EXPORT -#endif -#endif -#else -#define COMMONSAMPLE_EXPORT -#endif - -#endif diff --git a/samples/qt/Common/src/DocumentCommon.cxx b/samples/qt/Common/src/DocumentCommon.cxx deleted file mode 100755 index e4903bb69c..0000000000 --- a/samples/qt/Common/src/DocumentCommon.cxx +++ /dev/null @@ -1,244 +0,0 @@ -#include "DocumentCommon.h" - -#include "ApplicationCommon.h" -#include "Transparency.h" -#include "Material.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) -#include -#endif -#include - -// ======================================================================= -// function : Viewer -// purpose : -// ======================================================================= -Handle(V3d_Viewer) DocumentCommon::Viewer (const Standard_ExtString , - const Standard_CString , - const Standard_Real theViewSize, - const V3d_TypeOfOrientation theViewProj, - const Standard_Boolean theComputedMode, - const Standard_Boolean theDefaultComputedMode ) -{ - static Handle(OpenGl_GraphicDriver) aGraphicDriver; - - if (aGraphicDriver.IsNull()) - { - Handle(Aspect_DisplayConnection) aDisplayConnection; -#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) - aDisplayConnection = new Aspect_DisplayConnection (OSD_Environment ("DISPLAY").Value()); -#endif - aGraphicDriver = new OpenGl_GraphicDriver (aDisplayConnection); - } - - Handle(V3d_Viewer) aViewer = new V3d_Viewer (aGraphicDriver); - aViewer->SetDefaultViewSize (theViewSize); - aViewer->SetDefaultViewProj (theViewProj); - aViewer->SetComputedMode (theComputedMode); - aViewer->SetDefaultComputedMode (theDefaultComputedMode); - return aViewer; -} - -DocumentCommon::DocumentCommon( const int theIndex, ApplicationCommonWindow* app ) -: QObject( app ), -myApp( app ), -myIndex( theIndex ), -myNbViews( 0 ) -{ - TCollection_ExtendedString a3DName ("Visu3D"); - - myViewer = Viewer (a3DName.ToExtString(), "", 1000.0, V3d_XposYnegZpos, Standard_True, Standard_True); - - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - - myContext = new AIS_InteractiveContext (myViewer); -} - -DocumentCommon::~DocumentCommon() -{ -} - -ApplicationCommonWindow* DocumentCommon::getApplication() -{ - return myApp; -} - -MDIWindow* DocumentCommon::createNewMDIWindow() -{ - QMdiArea* ws = myApp->getWorkspace(); - return new MDIWindow (this, ws, 0); -} - -void DocumentCommon::onCreateNewView() -{ - QMdiArea* ws = myApp->getWorkspace(); - MDIWindow* w = createNewMDIWindow(); - - if (!w) - return; - - ws->addSubWindow (w); - myViews.append (w); - - connect( w, SIGNAL( selectionChanged() ), - this, SIGNAL( selectionChanged() ) ); - connect( w, SIGNAL( message( const QString&, int ) ), - myApp->statusBar(), SLOT( showMessage( const QString&, int ) ) ); - connect( w, SIGNAL( sendCloseView( MDIWindow* ) ), - this, SLOT( onCloseView( MDIWindow* ) ) ); - - QString aName; - w->setWindowTitle( aName.sprintf( "Document %d:%d", myIndex, ++myNbViews ) ); - QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" ); - - w->setWindowIcon( QPixmap( dir + QObject::tr("ICON_DOC") ) ); - - if ( ws->subWindowList().isEmpty() ) - { - // Due to strange Qt4.2.3 feature the child window icon is not drawn - // in the main menu if showMaximized() is called for a non-visible child window - // Therefore calling show() first... - w->show(); - w->showMaximized(); - } - else - w->show(); - - w->setFocus(); - - getApplication()->onSelectionChanged(); -} - -void DocumentCommon::onCloseView(MDIWindow* theView) -{ - removeView(theView); - if( countOfWindow() == 0 ) - emit sendCloseDocument( this ); -} - -void DocumentCommon::removeView(MDIWindow* theView) -{ - if ( myViews.count( theView ) ) - { - myViews.removeAll(theView); - delete theView; - } -} -void DocumentCommon::removeViews() -{ - while( myViews.count() ) - { - removeView( myViews.first() ); - } -} - -int DocumentCommon::countOfWindow() -{ - return myViews.count(); -} - -Handle(AIS_InteractiveContext) DocumentCommon::getContext() -{ - return myContext; -} - -void DocumentCommon::fitAll() -{ - QList::iterator i; - for ( i = myViews.begin(); i != myViews.end(); i++ ) - (*i)->fitAll(); -} - -void DocumentCommon::onWireframe() -{ - QApplication::setOverrideCursor( Qt::WaitCursor ); - for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() ) - myContext->SetDisplayMode( myContext->SelectedInteractive(), 0, false ); - myContext->UpdateCurrentViewer(); - getApplication()->onSelectionChanged(); - QApplication::restoreOverrideCursor(); -} - -void DocumentCommon::onShading() -{ - QApplication::setOverrideCursor( Qt::WaitCursor ); - for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() ) - myContext->SetDisplayMode( myContext->SelectedInteractive(), 1, false ); - myContext->UpdateCurrentViewer(); - getApplication()->onSelectionChanged(); - QApplication::restoreOverrideCursor(); -} - -void DocumentCommon::onColor() -{ - QColor aColor ; - myContext->InitSelected(); - Handle(AIS_InteractiveObject) Current = myContext->SelectedInteractive() ; - if ( Current->HasColor () ) - { - Quantity_Color aShapeColor; - myContext->Color( Current, aShapeColor ); - aColor.setRgb( (Standard_Integer)(aShapeColor.Red() * 255), (Standard_Integer)(aShapeColor.Green() * 255), - (Standard_Integer)(aShapeColor.Blue() * 255)); - } - else - aColor.setRgb( 255, 255, 255 ); - - QColor aRetColor = QColorDialog::getColor( aColor ); - if ( aRetColor.isValid() ) - { - Quantity_Color color( aRetColor.red() / 255., aRetColor.green() / 255., - aRetColor.blue() / 255., Quantity_TOC_RGB ); - for (; myContext->MoreSelected(); myContext->NextSelected() ) - myContext->SetColor( myContext->SelectedInteractive(), color, Standard_False); - myContext->UpdateCurrentViewer(); - } -} - -void DocumentCommon::onMaterial( int theMaterial ) -{ - for ( myContext->InitSelected(); myContext->MoreSelected (); myContext->NextSelected () ) - myContext->SetMaterial( myContext->SelectedInteractive(), (Graphic3d_NameOfMaterial)theMaterial, Standard_False); - myContext->UpdateCurrentViewer(); -} - -void DocumentCommon::onMaterial() -{ - DialogMaterial* m = new DialogMaterial(); - connect( m, SIGNAL( sendMaterialChanged( int ) ), this, SLOT( onMaterial( int ) ) ); - m->exec(); -} - -void DocumentCommon::onTransparency( int theTrans ) -{ - for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() ) - myContext->SetTransparency (myContext->SelectedInteractive(), ((Standard_Real)theTrans) / 10.0, Standard_False); - myContext->UpdateCurrentViewer(); -} - -void DocumentCommon::onTransparency() -{ - DialogTransparency* aDialog = new DialogTransparency(); - connect( aDialog, SIGNAL( sendTransparencyChanged( int ) ), this, SLOT( onTransparency( int ) ) ); - aDialog->exec(); -} - -void DocumentCommon::onDelete() -{ - myContext->EraseSelected (Standard_False); - myContext->ClearSelected (Standard_False); - myContext->UpdateCurrentViewer(); - getApplication()->onSelectionChanged(); -} diff --git a/samples/qt/Common/src/DocumentCommon.h b/samples/qt/Common/src/DocumentCommon.h deleted file mode 100755 index 120cb2f9d5..0000000000 --- a/samples/qt/Common/src/DocumentCommon.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef DOCUMENTCOMMON_H -#define DOCUMENTCOMMON_H - -#include "MDIWindow.h" -//#include "IESample.h" - -#include -#include -#include -#include - -#include -#include - -class ApplicationCommonWindow; - -class COMMONSAMPLE_EXPORT DocumentCommon : public QObject -{ - Q_OBJECT - -public: - DocumentCommon( const int, ApplicationCommonWindow* ); - ~DocumentCommon(); - - ApplicationCommonWindow* getApplication(); - Handle(AIS_InteractiveContext) getContext(); - void removeView( MDIWindow* ); - void removeViews(); - int countOfWindow(); - void fitAll(); - -protected: - virtual MDIWindow* createNewMDIWindow(); - -signals: - void selectionChanged(); - void sendCloseDocument( DocumentCommon* ); - -public slots: - virtual void onCloseView( MDIWindow* ); - virtual void onCreateNewView(); - virtual void onMaterial(); - virtual void onMaterial( int ); - virtual void onDelete(); - - void onWireframe(); - void onShading(); - void onColor(); - void onTransparency(); - void onTransparency( int ); - -private: - Handle(V3d_Viewer) Viewer (const Standard_ExtString theName, - const Standard_CString theDomain, - const Standard_Real theViewSize, - const V3d_TypeOfOrientation theViewProj, - const Standard_Boolean theComputedMode, - const Standard_Boolean theDefaultComputedMode ); - -protected: - ApplicationCommonWindow* myApp; - QList myViews; - Handle(V3d_Viewer) myViewer; - Handle(AIS_InteractiveContext) myContext; - int myIndex; - int myNbViews; -}; - -#endif - - diff --git a/samples/qt/Common/src/MDIWindow.cxx b/samples/qt/Common/src/MDIWindow.cxx deleted file mode 100755 index 87498eab00..0000000000 --- a/samples/qt/Common/src/MDIWindow.cxx +++ /dev/null @@ -1,155 +0,0 @@ -#include "MDIWindow.h" - -#include "View.h" -#include "DocumentCommon.h" -#include "ApplicationCommon.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MDIWindow::MDIWindow(View* aView, - DocumentCommon* aDocument, - QWidget* parent, - Qt::WindowFlags wflags ) -: QMainWindow( parent, wflags ) -{ - myView = aView; - myDocument = aDocument; -} - -MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags) -: QMainWindow( parent, wflags ) -{ - QFrame *vb = new QFrame( this ); - - QVBoxLayout *layout = new QVBoxLayout( vb ); - layout->setMargin( 0 ); - - vb->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - - setCentralWidget( vb ); - - myDocument = aDocument; - myView = new View (myDocument->getContext(), vb); - layout->addWidget (myView); - - connect( myView, SIGNAL( selectionChanged() ), - this, SIGNAL( selectionChanged() ) ); - - createViewActions(); - createRaytraceActions(); - - resize( sizeHint() ); - - setFocusPolicy( Qt::StrongFocus ); -} - -MDIWindow::~MDIWindow() -{ -} - -DocumentCommon* MDIWindow::getDocument() -{ - return myDocument; -} - -void MDIWindow::closeEvent(QCloseEvent* ) -{ - emit sendCloseView(this); -} - -void MDIWindow::fitAll() -{ - myView->fitAll(); -} - -void MDIWindow::createViewActions() -{ - // populate a tool bar with some actions - QToolBar* aToolBar = addToolBar( tr( "View Operations" ) ); - - QList* aList = myView->getViewActions(); - aToolBar->addActions( *aList ); - - aToolBar->toggleViewAction()->setVisible(false); - aList->at(View::ViewHlrOffId)->setChecked( true ); -} - -void MDIWindow::createRaytraceActions() -{ - // populate a tool bar with some actions - QToolBar* aToolBar = addToolBar( tr( "Ray-tracing Options" ) ); - - QList* aList = myView->getRaytraceActions(); - aToolBar->addActions( *aList ); - - aToolBar->toggleViewAction()->setVisible (true); - aList->at (View::ToolRaytracingId)->setChecked (false); - aList->at (View::ToolShadowsId)->setChecked (true); - aList->at (View::ToolReflectionsId)->setChecked (false); - aList->at (View::ToolAntialiasingId)->setChecked (false); -} - -void MDIWindow::onWindowActivated () -{ - getDocument()->getApplication()->onSelectionChanged(); -} - -void MDIWindow::dump() -{ - QString filter = "Images Files (*.bmp *.ppm *.png *.jpg *.tiff *.tga *.gif *.exr)"; - QFileDialog fd ( 0 ); - fd.setModal( true ); - fd.setNameFilter ( filter ); - fd.setWindowTitle( QObject::tr("INF_APP_EXPORT") ); - fd.setFileMode( QFileDialog::AnyFile ); - int ret = fd.exec(); - - /* update the desktop after the dialog is closed */ - qApp->processEvents(); - - QStringList fileNames; - fileNames = fd.selectedFiles(); - - QString file ( (ret == QDialog::Accepted && !fileNames.isEmpty() )? fileNames[0] : QString::null); - if ( !file.isNull() ) - { - QApplication::setOverrideCursor( Qt::WaitCursor ); - if ( !QFileInfo( file ).completeSuffix().length() ) - file += QString( ".bmp" ); - - const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - - bool res = myView->dump( anUtf8Path.ToCString() ); - QApplication::restoreOverrideCursor(); - if ( !res ) - { - QWidgetList list = qApp->allWidgets(); - QWidget* mainWidget = NULL; - for( int i = 0; i < list.size(); ++i ) - { - if( qobject_cast( list.at( i ) ) ) - mainWidget = qobject_cast( list.at( i ) ); - } - - QMessageBox::information ( mainWidget, QObject::tr("TIT_ERROR"), QObject::tr("INF_ERROR"), QObject::tr("BTN_OK"), - QString::null, QString::null, 0, 0 ); - qApp->processEvents(); - } - } -} - -QSize MDIWindow::sizeHint() const -{ - return QSize( 450, 300 ); -} diff --git a/samples/qt/Common/src/MDIWindow.h b/samples/qt/Common/src/MDIWindow.h deleted file mode 100755 index 06f75501bb..0000000000 --- a/samples/qt/Common/src/MDIWindow.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef MDIWINDOW_H -#define MDIWINDOW_H - -#include -#include -#include - -#include "CommonSample.h" - -class DocumentCommon; -class View; - -class COMMONSAMPLE_EXPORT MDIWindow: public QMainWindow -{ - Q_OBJECT - -public: - MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags ); - MDIWindow( View* aView, DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags ); - ~MDIWindow(); - - DocumentCommon* getDocument(); - void fitAll(); - virtual QSize sizeHint() const; - -signals: - void selectionChanged(); - void message(const QString&, int ); - void sendCloseView(MDIWindow* theView); - -public slots: - void closeEvent(QCloseEvent* e); - void onWindowActivated (); - void dump(); - -protected: - void createViewActions(); - void createRaytraceActions(); - -protected: - DocumentCommon* myDocument; - View* myView; -}; - -#endif \ No newline at end of file diff --git a/samples/qt/Common/src/Material.cxx b/samples/qt/Common/src/Material.cxx deleted file mode 100755 index 650174d457..0000000000 --- a/samples/qt/Common/src/Material.cxx +++ /dev/null @@ -1,110 +0,0 @@ -#include "Material.h" - -#include -#include -#include -#include -#include - -#include - -DialogMaterial::DialogMaterial(QWidget * parent, - bool modal, Qt::WindowFlags f ) -: QDialog(parent, f) -{ - setModal( modal ); - QPushButton* b; - QVBoxLayout* vbl = new QVBoxLayout( this ); - vbl->setMargin( 8 ); - - QSignalMapper *sm = new QSignalMapper( this ); - connect( sm, SIGNAL( mapped( int ) ), this, SIGNAL( sendMaterialChanged( int ) ) ); - - b = new QPushButton( QObject::tr("BTN_PLASTER"), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_PLASTER ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_BRASS" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_BRASS ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_BRONZE" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_BRONZE ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_COPPER" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_COPPER ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_GOLD" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_GOLD ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_PEWTER" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_PEWTER ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_PLASTIC" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_PLASTIC ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); - - b = new QPushButton( QObject::tr( "BTN_SILVER" ), this ); - sm->setMapping( b, ( int )Graphic3d_NOM_SILVER ); - connect( b, SIGNAL( clicked() ), sm, SLOT( map() ) ); - b->setCheckable( true ); - connect( b, SIGNAL( toggled( bool ) ), this, SLOT( updateButtons( bool ) ) ); - myButtons.append( b ); - vbl->addWidget( b ); -} - -DialogMaterial::~DialogMaterial() -{ -} - -void DialogMaterial::updateButtons( bool isOn ) -{ - if( !isOn ) - return; - - QPushButton*sentBy = ( QPushButton* )sender(); - - for ( int i = 0; i < myButtons.size(); i++ ) - { - QPushButton* b = myButtons.at( i ); - if( b != sentBy ) { - b->setEnabled( true ); - b->setChecked( false ); - } else { - b->setEnabled( false ); - } - } -} - diff --git a/samples/qt/Common/src/Material.h b/samples/qt/Common/src/Material.h deleted file mode 100755 index ab8fcf68e7..0000000000 --- a/samples/qt/Common/src/Material.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef MATERIAL_H -#define MATERIAL_H - -#include -#include -#include -#include -#include - -#include - -class DialogMaterial : public QDialog -{ - Q_OBJECT -public: - DialogMaterial (QWidget * parent=0, bool modal=true, Qt::WindowFlags f=0 ); - ~DialogMaterial(); - -signals: - void sendMaterialChanged(int); - -public slots: - void updateButtons(bool isOn); - -private: - QList myButtons; -}; - -#endif diff --git a/samples/qt/Common/src/OcctWindow.cxx b/samples/qt/Common/src/OcctWindow.cxx deleted file mode 100644 index 0af47c1beb..0000000000 --- a/samples/qt/Common/src/OcctWindow.cxx +++ /dev/null @@ -1,170 +0,0 @@ -#include - -IMPLEMENT_STANDARD_RTTIEXT(OcctWindow,Aspect_Window) - -// ======================================================================= -// function : OcctWindow -// purpose : -// ======================================================================= -OcctWindow::OcctWindow ( QWidget* theWidget, const Quantity_NameOfColor theBackColor ) -: Aspect_Window(), - myWidget( theWidget ) -{ - SetBackground (theBackColor); - myXLeft = myWidget->rect().left(); - myYTop = myWidget->rect().top(); - myXRight = myWidget->rect().right(); - myYBottom = myWidget->rect().bottom(); -} - -// ======================================================================= -// function : Destroy -// purpose : -// ======================================================================= -void OcctWindow::Destroy() -{ - myWidget = NULL; -} - -// ======================================================================= -// function : NativeParentHandle -// purpose : -// ======================================================================= -Aspect_Drawable OcctWindow::NativeParentHandle() const -{ - QWidget* aParentWidget = myWidget->parentWidget(); - if ( aParentWidget != NULL ) - return (Aspect_Drawable)aParentWidget->winId(); - else - return 0; -} - -// ======================================================================= -// function : NativeHandle -// purpose : -// ======================================================================= -Aspect_Drawable OcctWindow::NativeHandle() const -{ - return (Aspect_Drawable)myWidget->winId(); -} - -// ======================================================================= -// function : IsMapped -// purpose : -// ======================================================================= -Standard_Boolean OcctWindow::IsMapped() const -{ - return !( myWidget->isMinimized() || myWidget->isHidden() ); -} - -// ======================================================================= -// function : Map -// purpose : -// ======================================================================= -void OcctWindow::Map() const -{ - myWidget->show(); - myWidget->update(); -} - -// ======================================================================= -// function : Unmap -// purpose : -// ======================================================================= -void OcctWindow::Unmap() const -{ - myWidget->hide(); - myWidget->update(); -} - -// ======================================================================= -// function : DoResize -// purpose : -// ======================================================================= -Aspect_TypeOfResize OcctWindow::DoResize() -{ - int aMask = 0; - Aspect_TypeOfResize aMode = Aspect_TOR_UNKNOWN; - - if ( !myWidget->isMinimized() ) - { - if ( Abs ( myWidget->rect().left() - myXLeft ) > 2 ) aMask |= 1; - if ( Abs ( myWidget->rect().right() - myXRight ) > 2 ) aMask |= 2; - if ( Abs ( myWidget->rect().top() - myYTop ) > 2 ) aMask |= 4; - if ( Abs ( myWidget->rect().bottom() - myYBottom ) > 2 ) aMask |= 8; - - switch ( aMask ) - { - case 0: - aMode = Aspect_TOR_NO_BORDER; - break; - case 1: - aMode = Aspect_TOR_LEFT_BORDER; - break; - case 2: - aMode = Aspect_TOR_RIGHT_BORDER; - break; - case 4: - aMode = Aspect_TOR_TOP_BORDER; - break; - case 5: - aMode = Aspect_TOR_LEFT_AND_TOP_BORDER; - break; - case 6: - aMode = Aspect_TOR_TOP_AND_RIGHT_BORDER; - break; - case 8: - aMode = Aspect_TOR_BOTTOM_BORDER; - break; - case 9: - aMode = Aspect_TOR_BOTTOM_AND_LEFT_BORDER; - break; - case 10: - aMode = Aspect_TOR_RIGHT_AND_BOTTOM_BORDER; - break; - default: - break; - } // end switch - - myXLeft = myWidget->rect().left(); - myXRight = myWidget->rect().right(); - myYTop = myWidget->rect().top(); - myYBottom = myWidget->rect().bottom(); - } - - return aMode; -} - -// ======================================================================= -// function : Ratio -// purpose : -// ======================================================================= -Standard_Real OcctWindow::Ratio() const -{ - QRect aRect = myWidget->rect(); - return Standard_Real( aRect.right() - aRect.left() ) / Standard_Real( aRect.bottom() - aRect.top() ); -} - -// ======================================================================= -// function : Size -// purpose : -// ======================================================================= -void OcctWindow::Size ( Standard_Integer& theWidth, Standard_Integer& theHeight ) const -{ - QRect aRect = myWidget->rect(); - theWidth = aRect.width(); - theHeight = aRect.height(); -} - -// ======================================================================= -// function : Position -// purpose : -// ======================================================================= -void OcctWindow::Position ( Standard_Integer& theX1, Standard_Integer& theY1, - Standard_Integer& theX2, Standard_Integer& theY2 ) const -{ - theX1 = myWidget->rect().left(); - theX2 = myWidget->rect().right(); - theY1 = myWidget->rect().top(); - theY2 = myWidget->rect().bottom(); -} \ No newline at end of file diff --git a/samples/qt/Common/src/OcctWindow.h b/samples/qt/Common/src/OcctWindow.h deleted file mode 100644 index 2943dc4131..0000000000 --- a/samples/qt/Common/src/OcctWindow.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef OcctWindow_H -#define OcctWindow_H - -#include - -#include -#include -#include - -class OcctWindow; - -/* - OcctWindow class implements Aspect_Window interface using Qt API - as a platform-independent source of window geometry information. - A similar class should be used instead of platform-specific OCCT - classes (WNT_Window, Xw_Window) in any Qt 5 application using OCCT - 3D visualization. - - With Qt 5, the requirement for a Qt-based application to rely fully - on Qt public API and stop using platform-specific APIs looks mandatory. - An example of this is changed QWidget event sequence: when a widget is - first shown on the screen, a resize event is generated before the - underlying native window is resized correctly, however the QWidget instance - already holds correct size information at that moment. The OCCT classes - acting as a source of window geometry for V3d_View class (WNT_Window, Xw_Window) - are no longer compatible with changed Qt behavior because they rely on - platform-specific API that cannot return correct window geometry information - in some cases. A reasonable solution is to provide a Qt-based implementation - of Aspect_Window interface at application level. -*/ - -class OcctWindow : public Aspect_Window -{ -public: - - //! Constructor - OcctWindow( QWidget* theWidget, const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY ); - - virtual void Destroy(); - - //! Destructor - ~OcctWindow() - { - Destroy(); - } - - //! Returns native Window handle - virtual Aspect_Drawable NativeHandle() const; - - //! Returns parent of native Window handle. - virtual Aspect_Drawable NativeParentHandle() const; - - //! Applies the resizing to the window - virtual Aspect_TypeOfResize DoResize(); - - //! Returns True if the window is opened - //! and False if the window is closed. - virtual Standard_Boolean IsMapped() const; - - //! Apply the mapping change to the window - //! and returns TRUE if the window is mapped at screen. - virtual Standard_Boolean DoMapping() const { return Standard_True; } - - //! Opens the window . - virtual void Map() const; - - //! Closes the window . - virtual void Unmap() const; - - virtual void Position( Standard_Integer& theX1, Standard_Integer& theY1, - Standard_Integer& theX2, Standard_Integer& theY2 ) const; - - //! Returns The Window RATIO equal to the physical - //! WIDTH/HEIGHT dimensions. - virtual Standard_Real Ratio() const; - - virtual void Size( Standard_Integer& theWidth, Standard_Integer& theHeight ) const; - - virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; } - - DEFINE_STANDARD_RTTIEXT(OcctWindow,Aspect_Window) - -protected: - Standard_Integer myXLeft; - Standard_Integer myYTop; - Standard_Integer myXRight; - Standard_Integer myYBottom; - QWidget* myWidget; -}; - - -#endif // OcctWindow_H \ No newline at end of file diff --git a/samples/qt/Common/src/Transparency.cxx b/samples/qt/Common/src/Transparency.cxx deleted file mode 100755 index 192198bcfe..0000000000 --- a/samples/qt/Common/src/Transparency.cxx +++ /dev/null @@ -1,24 +0,0 @@ -#include "Transparency.h" - -#include -#include -#include -#include - -DialogTransparency::DialogTransparency( QWidget* parent, Qt::WindowFlags f, bool modal ) -: QDialog( parent, f ) -{ - setModal( modal ); - QHBoxLayout* base = new QHBoxLayout( this ); - base->setMargin( 3 ); - base->setSpacing( 3 ); - QSpinBox* aSpin = new QSpinBox( this ); - aSpin->setRange( 0, 10 ); - aSpin->setSingleStep( 1 ); - base->addWidget( aSpin ); - connect( aSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( sendTransparencyChanged( int ) ) ); -} - -DialogTransparency::~DialogTransparency() -{ -} diff --git a/samples/qt/Common/src/Transparency.h b/samples/qt/Common/src/Transparency.h deleted file mode 100755 index a8948c4340..0000000000 --- a/samples/qt/Common/src/Transparency.h +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include - -#include - -class DialogTransparency : public QDialog -{ - Q_OBJECT -public: - DialogTransparency ( QWidget * parent=0, Qt::WindowFlags f=0, bool modal=true ); - ~DialogTransparency(); -signals: - void sendTransparencyChanged(int value); -}; diff --git a/samples/qt/Common/src/View.cxx b/samples/qt/Common/src/View.cxx deleted file mode 100755 index ec4ab702e9..0000000000 --- a/samples/qt/Common/src/View.cxx +++ /dev/null @@ -1,866 +0,0 @@ -#if !defined _WIN32 - #define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */ -#endif - -#include "View.h" -#include "ApplicationCommon.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && QT_VERSION < 0x050000 - #include -#endif -#include - -#include -#include - -#include -#include - -namespace -{ -//! Map Qt buttons bitmask to virtual keys. -Aspect_VKeyMouse qtMouseButtons2VKeys(Qt::MouseButtons theButtons) -{ - Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE; - if ((theButtons & Qt::LeftButton) != 0) - { - aButtons |= Aspect_VKeyMouse_LeftButton; - } - if ((theButtons & Qt::MiddleButton) != 0) - { - aButtons |= Aspect_VKeyMouse_MiddleButton; - } - if ((theButtons & Qt::RightButton) != 0) - { - aButtons |= Aspect_VKeyMouse_RightButton; - } - return aButtons; -} - -//! Map Qt mouse modifiers bitmask to virtual keys. -Aspect_VKeyFlags qtMouseModifiers2VKeys(Qt::KeyboardModifiers theModifiers) -{ - Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE; - if ((theModifiers & Qt::ShiftModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_SHIFT; - } - if ((theModifiers & Qt::ControlModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_CTRL; - } - if ((theModifiers & Qt::AltModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_ALT; - } - return aFlags; -} -} // namespace - -static QCursor* defCursor = NULL; -static QCursor* handCursor = NULL; -static QCursor* panCursor = NULL; -static QCursor* globPanCursor = NULL; -static QCursor* zoomCursor = NULL; -static QCursor* rotCursor = NULL; - -View::View(Handle(AIS_InteractiveContext) theContext, QWidget* parent) - : QWidget(parent), - myIsRaytracing(false), - myIsShadowsEnabled(true), - myIsReflectionsEnabled(false), - myIsAntialiasingEnabled(false), - myViewActions(0), - myRaytraceActions(0), - myBackMenu(NULL) -{ -#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && QT_VERSION < 0x050000 - XSynchronize(x11Info().display(), true); -#endif - myContext = theContext; - - myCurZoom = 0; - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - setAttribute(Qt::WA_NativeWindow); - - myDefaultGestures = myMouseGestureMap; - myCurrentMode = CurAction3d_Nothing; - setMouseTracking(true); - - initViewActions(); - initCursors(); - - setBackgroundRole(QPalette::NoRole); // NoBackground ); - // set focus policy to threat QContextMenuEvent from keyboard - setFocusPolicy(Qt::StrongFocus); - init(); -} - -View::~View() -{ - delete myBackMenu; -} - -void View::init() -{ - if (myView.IsNull()) - myView = myContext->CurrentViewer()->CreateView(); - - Handle(OcctWindow) hWnd = new OcctWindow(this); - myView->SetWindow(hWnd); - if (!hWnd->IsMapped()) - { - hWnd->Map(); - } - myView->SetBackgroundColor(Quantity_NOC_BLACK); - myView->MustBeResized(); - - if (myIsRaytracing) - myView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING; -} - -void View::paintEvent(QPaintEvent*) -{ - // QApplication::syncX(); - myView->InvalidateImmediate(); - FlushViewEvents(myContext, myView, true); -} - -void View::resizeEvent(QResizeEvent*) -{ - // QApplication::syncX(); - if (!myView.IsNull()) - { - myView->MustBeResized(); - } -} - -void View::OnSelectionChanged(const Handle(AIS_InteractiveContext)&, const Handle(V3d_View)&) -{ - ApplicationCommonWindow::getApplication()->onSelectionChanged(); -} - -void View::fitAll() -{ - myView->FitAll(); - myView->ZFitAll(); - myView->Redraw(); -} - -void View::fitArea() -{ - setCurrentAction(CurAction3d_WindowZooming); -} - -void View::zoom() -{ - setCurrentAction(CurAction3d_DynamicZooming); -} - -void View::pan() -{ - setCurrentAction(CurAction3d_DynamicPanning); -} - -void View::rotation() -{ - setCurrentAction(CurAction3d_DynamicRotation); -} - -void View::globalPan() -{ - // save the current zoom value - myCurZoom = myView->Scale(); - // Do a Global Zoom - myView->FitAll(); - // Set the mode - setCurrentAction(CurAction3d_GlobalPanning); -} - -void View::front() -{ - myView->SetProj(V3d_Yneg); -} - -void View::back() -{ - myView->SetProj(V3d_Ypos); -} - -void View::top() -{ - myView->SetProj(V3d_Zpos); -} - -void View::bottom() -{ - myView->SetProj(V3d_Zneg); -} - -void View::left() -{ - myView->SetProj(V3d_Xneg); -} - -void View::right() -{ - myView->SetProj(V3d_Xpos); -} - -void View::axo() -{ - myView->SetProj(V3d_XposYnegZpos); -} - -void View::reset() -{ - myView->Reset(); -} - -void View::hlrOff() -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - myView->SetComputedMode(false); - myView->Redraw(); - QApplication::restoreOverrideCursor(); -} - -void View::hlrOn() -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - myView->SetComputedMode(true); - myView->Redraw(); - QApplication::restoreOverrideCursor(); -} - -void View::SetRaytracedShadows(bool theState) -{ - myView->ChangeRenderingParams().IsShadowEnabled = theState; - - myIsShadowsEnabled = theState; - - myContext->UpdateCurrentViewer(); -} - -void View::SetRaytracedReflections(bool theState) -{ - myView->ChangeRenderingParams().IsReflectionEnabled = theState; - - myIsReflectionsEnabled = theState; - - myContext->UpdateCurrentViewer(); -} - -void View::onRaytraceAction() -{ - QAction* aSentBy = (QAction*)sender(); - - if (aSentBy == myRaytraceActions->at(ToolRaytracingId)) - { - bool aState = myRaytraceActions->at(ToolRaytracingId)->isChecked(); - - QApplication::setOverrideCursor(Qt::WaitCursor); - if (aState) - EnableRaytracing(); - else - DisableRaytracing(); - QApplication::restoreOverrideCursor(); - } - - if (aSentBy == myRaytraceActions->at(ToolShadowsId)) - { - bool aState = myRaytraceActions->at(ToolShadowsId)->isChecked(); - SetRaytracedShadows(aState); - } - - if (aSentBy == myRaytraceActions->at(ToolReflectionsId)) - { - bool aState = myRaytraceActions->at(ToolReflectionsId)->isChecked(); - SetRaytracedReflections(aState); - } - - if (aSentBy == myRaytraceActions->at(ToolAntialiasingId)) - { - bool aState = myRaytraceActions->at(ToolAntialiasingId)->isChecked(); - SetRaytracedAntialiasing(aState); - } -} - -void View::SetRaytracedAntialiasing(bool theState) -{ - myView->ChangeRenderingParams().IsAntialiasingEnabled = theState; - - myIsAntialiasingEnabled = theState; - - myContext->UpdateCurrentViewer(); -} - -void View::EnableRaytracing() -{ - if (!myIsRaytracing) - myView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING; - - myIsRaytracing = true; - - myContext->UpdateCurrentViewer(); -} - -void View::DisableRaytracing() -{ - if (myIsRaytracing) - myView->ChangeRenderingParams().Method = Graphic3d_RM_RASTERIZATION; - - myIsRaytracing = false; - - myContext->UpdateCurrentViewer(); -} - -void View::updateToggled(bool isOn) -{ - QAction* sentBy = (QAction*)sender(); - - if (!isOn) - return; - - for (int i = ViewFitAllId; i < ViewHlrOffId; i++) - { - QAction* anAction = myViewActions->at(i); - - if ((anAction == myViewActions->at(ViewFitAreaId)) - || (anAction == myViewActions->at(ViewZoomId)) || (anAction == myViewActions->at(ViewPanId)) - || (anAction == myViewActions->at(ViewGlobalPanId)) - || (anAction == myViewActions->at(ViewRotationId))) - { - if (anAction && (anAction != sentBy)) - { - anAction->setCheckable(true); - anAction->setChecked(false); - } - else - { - if (sentBy == myViewActions->at(ViewFitAreaId)) - setCursor(*handCursor); - else if (sentBy == myViewActions->at(ViewZoomId)) - setCursor(*zoomCursor); - else if (sentBy == myViewActions->at(ViewPanId)) - setCursor(*panCursor); - else if (sentBy == myViewActions->at(ViewGlobalPanId)) - setCursor(*globPanCursor); - else if (sentBy == myViewActions->at(ViewRotationId)) - setCursor(*rotCursor); - else - setCursor(*defCursor); - - sentBy->setCheckable(false); - } - } - } -} - -void View::initCursors() -{ - if (!defCursor) - defCursor = new QCursor(Qt::ArrowCursor); - if (!handCursor) - handCursor = new QCursor(Qt::PointingHandCursor); - if (!panCursor) - panCursor = new QCursor(Qt::SizeAllCursor); - if (!globPanCursor) - globPanCursor = new QCursor(Qt::CrossCursor); - if (!zoomCursor) - zoomCursor = new QCursor(QPixmap(ApplicationCommonWindow::getResourceDir() + QString("/") - + QObject::tr("ICON_CURSOR_ZOOM"))); - if (!rotCursor) - rotCursor = new QCursor(QPixmap(ApplicationCommonWindow::getResourceDir() + QString("/") - + QObject::tr("ICON_CURSOR_ROTATE"))); -} - -QList* View::getViewActions() -{ - initViewActions(); - return myViewActions; -} - -QList* View::getRaytraceActions() -{ - initRaytraceActions(); - return myRaytraceActions; -} - -/*! - Get paint engine for the OpenGL viewer. [ virtual public ] -*/ -QPaintEngine* View::paintEngine() const -{ - return 0; -} - -void View::initViewActions() -{ - if (myViewActions) - return; - - myViewActions = new QList(); - QString dir = ApplicationCommonWindow::getResourceDir() + QString("/"); - QAction* a; - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_FITALL")), QObject::tr("MNU_FITALL"), this); - a->setToolTip(QObject::tr("TBR_FITALL")); - a->setStatusTip(QObject::tr("TBR_FITALL")); - connect(a, SIGNAL(triggered()), this, SLOT(fitAll())); - myViewActions->insert(ViewFitAllId, a); - - a = - new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_FITAREA")), QObject::tr("MNU_FITAREA"), this); - a->setToolTip(QObject::tr("TBR_FITAREA")); - a->setStatusTip(QObject::tr("TBR_FITAREA")); - connect(a, SIGNAL(triggered()), this, SLOT(fitArea())); - - a->setCheckable(true); - connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); - myViewActions->insert(ViewFitAreaId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_ZOOM")), QObject::tr("MNU_ZOOM"), this); - a->setToolTip(QObject::tr("TBR_ZOOM")); - a->setStatusTip(QObject::tr("TBR_ZOOM")); - connect(a, SIGNAL(triggered()), this, SLOT(zoom())); - - a->setCheckable(true); - connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); - myViewActions->insert(ViewZoomId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_PAN")), QObject::tr("MNU_PAN"), this); - a->setToolTip(QObject::tr("TBR_PAN")); - a->setStatusTip(QObject::tr("TBR_PAN")); - connect(a, SIGNAL(triggered()), this, SLOT(pan())); - - a->setCheckable(true); - connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); - myViewActions->insert(ViewPanId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_GLOBALPAN")), - QObject::tr("MNU_GLOBALPAN"), - this); - a->setToolTip(QObject::tr("TBR_GLOBALPAN")); - a->setStatusTip(QObject::tr("TBR_GLOBALPAN")); - connect(a, SIGNAL(triggered()), this, SLOT(globalPan())); - - a->setCheckable(true); - connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); - myViewActions->insert(ViewGlobalPanId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_FRONT")), QObject::tr("MNU_FRONT"), this); - a->setToolTip(QObject::tr("TBR_FRONT")); - a->setStatusTip(QObject::tr("TBR_FRONT")); - connect(a, SIGNAL(triggered()), this, SLOT(front())); - myViewActions->insert(ViewFrontId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_BACK")), QObject::tr("MNU_BACK"), this); - a->setToolTip(QObject::tr("TBR_BACK")); - a->setStatusTip(QObject::tr("TBR_BACK")); - connect(a, SIGNAL(triggered()), this, SLOT(back())); - myViewActions->insert(ViewBackId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_TOP")), QObject::tr("MNU_TOP"), this); - a->setToolTip(QObject::tr("TBR_TOP")); - a->setStatusTip(QObject::tr("TBR_TOP")); - connect(a, SIGNAL(triggered()), this, SLOT(top())); - myViewActions->insert(ViewTopId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_BOTTOM")), QObject::tr("MNU_BOTTOM"), this); - a->setToolTip(QObject::tr("TBR_BOTTOM")); - a->setStatusTip(QObject::tr("TBR_BOTTOM")); - connect(a, SIGNAL(triggered()), this, SLOT(bottom())); - myViewActions->insert(ViewBottomId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_LEFT")), QObject::tr("MNU_LEFT"), this); - a->setToolTip(QObject::tr("TBR_LEFT")); - a->setStatusTip(QObject::tr("TBR_LEFT")); - connect(a, SIGNAL(triggered()), this, SLOT(left())); - myViewActions->insert(ViewLeftId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_RIGHT")), QObject::tr("MNU_RIGHT"), this); - a->setToolTip(QObject::tr("TBR_RIGHT")); - a->setStatusTip(QObject::tr("TBR_RIGHT")); - connect(a, SIGNAL(triggered()), this, SLOT(right())); - myViewActions->insert(ViewRightId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_AXO")), QObject::tr("MNU_AXO"), this); - a->setToolTip(QObject::tr("TBR_AXO")); - a->setStatusTip(QObject::tr("TBR_AXO")); - connect(a, SIGNAL(triggered()), this, SLOT(axo())); - myViewActions->insert(ViewAxoId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_ROTATION")), - QObject::tr("MNU_ROTATION"), - this); - a->setToolTip(QObject::tr("TBR_ROTATION")); - a->setStatusTip(QObject::tr("TBR_ROTATION")); - connect(a, SIGNAL(triggered()), this, SLOT(rotation())); - a->setCheckable(true); - connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); - myViewActions->insert(ViewRotationId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_RESET")), QObject::tr("MNU_RESET"), this); - a->setToolTip(QObject::tr("TBR_RESET")); - a->setStatusTip(QObject::tr("TBR_RESET")); - connect(a, SIGNAL(triggered()), this, SLOT(reset())); - myViewActions->insert(ViewResetId, a); - - QActionGroup* ag = new QActionGroup(this); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_HLROFF")), QObject::tr("MNU_HLROFF"), this); - a->setToolTip(QObject::tr("TBR_HLROFF")); - a->setStatusTip(QObject::tr("TBR_HLROFF")); - connect(a, SIGNAL(triggered()), this, SLOT(hlrOff())); - a->setCheckable(true); - ag->addAction(a); - myViewActions->insert(ViewHlrOffId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_HLRON")), QObject::tr("MNU_HLRON"), this); - a->setToolTip(QObject::tr("TBR_HLRON")); - a->setStatusTip(QObject::tr("TBR_HLRON")); - connect(a, SIGNAL(triggered()), this, SLOT(hlrOn())); - - a->setCheckable(true); - ag->addAction(a); - myViewActions->insert(ViewHlrOnId, a); -} - -void View::initRaytraceActions() -{ - if (myRaytraceActions) - return; - - myRaytraceActions = new QList(); - QString dir = ApplicationCommonWindow::getResourceDir() + QString("/"); - QAction* a; - - a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_RAYTRACING")), - QObject::tr("MNU_TOOL_RAYTRACING"), - this); - a->setToolTip(QObject::tr("TBR_TOOL_RAYTRACING")); - a->setStatusTip(QObject::tr("TBR_TOOL_RAYTRACING")); - a->setCheckable(true); - a->setChecked(false); - connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions->insert(ToolRaytracingId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_SHADOWS")), - QObject::tr("MNU_TOOL_SHADOWS"), - this); - a->setToolTip(QObject::tr("TBR_TOOL_SHADOWS")); - a->setStatusTip(QObject::tr("TBR_TOOL_SHADOWS")); - a->setCheckable(true); - a->setChecked(true); - connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions->insert(ToolShadowsId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_REFLECTIONS")), - QObject::tr("MNU_TOOL_REFLECTIONS"), - this); - a->setToolTip(QObject::tr("TBR_TOOL_REFLECTIONS")); - a->setStatusTip(QObject::tr("TBR_TOOL_REFLECTIONS")); - a->setCheckable(true); - a->setChecked(false); - connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions->insert(ToolReflectionsId, a); - - a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_ANTIALIASING")), - QObject::tr("MNU_TOOL_ANTIALIASING"), - this); - a->setToolTip(QObject::tr("TBR_TOOL_ANTIALIASING")); - a->setStatusTip(QObject::tr("TBR_TOOL_ANTIALIASING")); - a->setCheckable(true); - a->setChecked(false); - connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions->insert(ToolAntialiasingId, a); -} - -void View::activateCursor(const CurrentAction3d mode) -{ - switch (mode) - { - case CurAction3d_DynamicPanning: - setCursor(*panCursor); - break; - case CurAction3d_DynamicZooming: - setCursor(*zoomCursor); - break; - case CurAction3d_DynamicRotation: - setCursor(*rotCursor); - break; - case CurAction3d_GlobalPanning: - setCursor(*globPanCursor); - break; - case CurAction3d_WindowZooming: - setCursor(*handCursor); - break; - case CurAction3d_Nothing: - default: - setCursor(*defCursor); - break; - } -} - -void View::mousePressEvent(QMouseEvent* theEvent) -{ - const Graphic3d_Vec2i aPnt(theEvent->pos().x(), theEvent->pos().y()); - const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys(theEvent->modifiers()); - if (!myView.IsNull() - && UpdateMouseButtons(aPnt, qtMouseButtons2VKeys(theEvent->buttons()), aFlags, false)) - { - updateView(); - } - myClickPos = aPnt; -} - -void View::mouseReleaseEvent(QMouseEvent* theEvent) -{ - const Graphic3d_Vec2i aPnt(theEvent->pos().x(), theEvent->pos().y()); - const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys(theEvent->modifiers()); - if (!myView.IsNull() - && UpdateMouseButtons(aPnt, qtMouseButtons2VKeys(theEvent->buttons()), aFlags, false)) - { - updateView(); - } - - if (myCurrentMode == CurAction3d_GlobalPanning) - { - myView->Place(aPnt.x(), aPnt.y(), myCurZoom); - } - if (myCurrentMode != CurAction3d_Nothing) - { - setCurrentAction(CurAction3d_Nothing); - } - if (theEvent->button() == Qt::RightButton && (aFlags & Aspect_VKeyFlags_CTRL) == 0 - && (myClickPos - aPnt).cwiseAbs().maxComp() <= 4) - { - Popup(aPnt.x(), aPnt.y()); - } -} - -void View::mouseMoveEvent(QMouseEvent* theEvent) -{ - const Graphic3d_Vec2i aNewPos(theEvent->pos().x(), theEvent->pos().y()); - if (!myView.IsNull() - && UpdateMousePosition(aNewPos, - qtMouseButtons2VKeys(theEvent->buttons()), - qtMouseModifiers2VKeys(theEvent->modifiers()), - false)) - { - updateView(); - } -} - -//============================================================================== -// function : wheelEvent -// purpose : -//============================================================================== -void View::wheelEvent(QWheelEvent* theEvent) -{ - const Graphic3d_Vec2i aPos(theEvent->pos().x(), theEvent->pos().y()); - if (!myView.IsNull() && UpdateZoom(Aspect_ScrollDelta(aPos, theEvent->delta() / 8))) - { - updateView(); - } -} - -// ======================================================================= -// function : updateView -// purpose : -// ======================================================================= -void View::updateView() -{ - update(); -} - -void View::defineMouseGestures() -{ - myMouseGestureMap.Clear(); - AIS_MouseGesture aRot = AIS_MouseGesture_RotateOrbit; - activateCursor(myCurrentMode); - switch (myCurrentMode) - { - case CurAction3d_Nothing: { - noActiveActions(); - myMouseGestureMap = myDefaultGestures; - break; - } - case CurAction3d_DynamicZooming: { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Zoom); - break; - } - case CurAction3d_GlobalPanning: { - break; - } - case CurAction3d_WindowZooming: { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_ZoomWindow); - break; - } - case CurAction3d_DynamicPanning: { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Pan); - break; - } - case CurAction3d_DynamicRotation: { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, aRot); - break; - } - } -} - -void View::Popup(const int /*x*/, const int /*y*/) -{ - ApplicationCommonWindow* stApp = ApplicationCommonWindow::getApplication(); - QMdiArea* ws = ApplicationCommonWindow::getWorkspace(); - QMdiSubWindow* w = ws->activeSubWindow(); - if (myContext->NbSelected()) - { - QList* aList = stApp->getToolActions(); - QMenu* myToolMenu = new QMenu(0); - myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolWireframeId)); - myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolShadingId)); - myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolColorId)); - - QMenu* myMaterMenu = new QMenu(myToolMenu); - - QList* aMeterActions = - ApplicationCommonWindow::getApplication()->getMaterialActions(); - - QString dir = ApplicationCommonWindow::getResourceDir() + QString("/"); - myMaterMenu = - myToolMenu->addMenu(QPixmap(dir + QObject::tr("ICON_TOOL_MATER")), QObject::tr("MNU_MATER")); - for (int i = 0; i < aMeterActions->size(); i++) - myMaterMenu->addAction(aMeterActions->at(i)); - - myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolTransparencyId)); - myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolDeleteId)); - addItemInPopup(myToolMenu); - myToolMenu->exec(QCursor::pos()); - delete myToolMenu; - } - else - { - if (!myBackMenu) - { - myBackMenu = new QMenu(0); - - QAction* a = new QAction(QObject::tr("MNU_CH_BACK"), this); - a->setToolTip(QObject::tr("TBR_CH_BACK")); - connect(a, SIGNAL(triggered()), this, SLOT(onBackground())); - myBackMenu->addAction(a); - addItemInPopup(myBackMenu); - - a = new QAction(QObject::tr("MNU_CH_ENV_MAP"), this); - a->setToolTip(QObject::tr("TBR_CH_ENV_MAP")); - connect(a, SIGNAL(triggered()), this, SLOT(onEnvironmentMap())); - a->setCheckable(true); - a->setChecked(false); - myBackMenu->addAction(a); - addItemInPopup(myBackMenu); - } - - myBackMenu->exec(QCursor::pos()); - } - if (w) - w->setFocus(); -} - -void View::addItemInPopup(QMenu* /*theMenu*/) {} - -void View::noActiveActions() -{ - for (int i = ViewFitAllId; i < ViewHlrOffId; i++) - { - QAction* anAction = myViewActions->at(i); - if ((anAction == myViewActions->at(ViewFitAreaId)) - || (anAction == myViewActions->at(ViewZoomId)) || (anAction == myViewActions->at(ViewPanId)) - || (anAction == myViewActions->at(ViewGlobalPanId)) - || (anAction == myViewActions->at(ViewRotationId))) - { - setCursor(*defCursor); - anAction->setCheckable(true); - anAction->setChecked(false); - } - } -} - -void View::onBackground() -{ - QColor aColor; - Standard_Real R1; - Standard_Real G1; - Standard_Real B1; - myView->BackgroundColor(Quantity_TOC_RGB, R1, G1, B1); - aColor.setRgb((Standard_Integer)(R1 * 255), - (Standard_Integer)(G1 * 255), - (Standard_Integer)(B1 * 255)); - - QColor aRetColor = QColorDialog::getColor(aColor); - - if (aRetColor.isValid()) - { - R1 = aRetColor.red() / 255.; - G1 = aRetColor.green() / 255.; - B1 = aRetColor.blue() / 255.; - myView->SetBackgroundColor(Quantity_TOC_RGB, R1, G1, B1); - } - myView->Redraw(); -} - -void View::onEnvironmentMap() -{ - if (myBackMenu->actions().at(1)->isChecked()) - { - QString fileName = - QFileDialog::getOpenFileName(this, - tr("Open File"), - "", - tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)")); - - const TCollection_AsciiString anUtf8Path(fileName.toUtf8().data()); - - Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv(anUtf8Path); - - myView->SetTextureEnv(aTexture); - } - else - { - myView->SetTextureEnv(Handle(Graphic3d_TextureEnv)()); - } - - myView->Redraw(); -} - -bool View::dump(Standard_CString theFile) -{ - return myView->Dump(theFile); -} - -Handle(V3d_View)& View::getView() -{ - return myView; -} - -Handle(AIS_InteractiveContext)& View::getContext() -{ - return myContext; -} - -View::CurrentAction3d View::getCurrentMode() -{ - return myCurrentMode; -} diff --git a/samples/qt/Common/src/View.h b/samples/qt/Common/src/View.h deleted file mode 100755 index 4268d5eff5..0000000000 --- a/samples/qt/Common/src/View.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef VIEW_H -#define VIEW_H - -#include -#include -#include -#include -#include - -#include -#include -#include - -class TopoDS_Shape; -class QRubberBand; - -//class COMMONSAMPLE_EXPORT View: public QWidget -class View: public QWidget, protected AIS_ViewController -{ - Q_OBJECT -protected: - enum CurrentAction3d { CurAction3d_Nothing, CurAction3d_DynamicZooming, - CurAction3d_WindowZooming, CurAction3d_DynamicPanning, - CurAction3d_GlobalPanning, CurAction3d_DynamicRotation }; - -public: - enum ViewAction { ViewFitAllId, ViewFitAreaId, ViewZoomId, ViewPanId, ViewGlobalPanId, - ViewFrontId, ViewBackId, ViewTopId, ViewBottomId, ViewLeftId, ViewRightId, - ViewAxoId, ViewRotationId, ViewResetId, ViewHlrOffId, ViewHlrOnId }; - enum RaytraceAction { ToolRaytracingId, ToolShadowsId, ToolReflectionsId, ToolAntialiasingId }; - - View( Handle(AIS_InteractiveContext) theContext, QWidget* parent ); - - ~View(); - - virtual void init(); - bool dump( Standard_CString theFile ); - QList* getViewActions(); - QList* getRaytraceActions(); - void noActiveActions(); - bool isShadingMode(); - - void EnableRaytracing(); - void DisableRaytracing(); - - void SetRaytracedShadows (bool theState); - void SetRaytracedReflections (bool theState); - void SetRaytracedAntialiasing (bool theState); - - bool IsRaytracingMode() const { return myIsRaytracing; } - bool IsShadowsEnabled() const { return myIsShadowsEnabled; } - bool IsReflectionsEnabled() const { return myIsReflectionsEnabled; } - bool IsAntialiasingEnabled() const { return myIsAntialiasingEnabled; } - - static QString GetMessages( int type,TopAbs_ShapeEnum aSubShapeType, - TopAbs_ShapeEnum aShapeType ); - static QString GetShapeType( TopAbs_ShapeEnum aShapeType ); - - Standard_EXPORT static void OnButtonuseraction( int ExerciceSTEP, - Handle(AIS_InteractiveContext)& ); - Standard_EXPORT static void DoSelection( int Id, - Handle(AIS_InteractiveContext)& ); - Standard_EXPORT static void OnSetSelectionMode( Handle(AIS_InteractiveContext)&, - Standard_Integer&, - TopAbs_ShapeEnum& SelectionMode, - Standard_Boolean& ); - virtual QPaintEngine* paintEngine() const; -signals: - void selectionChanged(); - -public slots: - void fitAll(); - void fitArea(); - void zoom(); - void pan(); - void globalPan(); - void front(); - void back(); - void top(); - void bottom(); - void left(); - void right(); - void axo(); - void rotation(); - void reset(); - void hlrOn(); - void hlrOff(); - void updateToggled( bool ); - void onBackground(); - void onEnvironmentMap(); - void onRaytraceAction(); - -protected: - virtual void paintEvent( QPaintEvent* ); - virtual void resizeEvent( QResizeEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void mouseReleaseEvent(QMouseEvent* ); - virtual void mouseMoveEvent( QMouseEvent* ); - virtual void wheelEvent (QWheelEvent* ); - - virtual void addItemInPopup( QMenu* ); - - Handle(V3d_View)& getView(); - Handle(AIS_InteractiveContext)& getContext(); - void activateCursor( const CurrentAction3d ); - void Popup( const int x, const int y ); - CurrentAction3d getCurrentMode(); - void updateView(); - - //! Setup mouse gestures. - void defineMouseGestures(); - - //! Set current action. - void setCurrentAction (CurrentAction3d theAction) - { - myCurrentMode = theAction; - defineMouseGestures(); - } - - //! Handle selection changed event. - void OnSelectionChanged (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) Standard_OVERRIDE; - -private: - void initCursors(); - void initViewActions(); - void initRaytraceActions(); -private: - bool myIsRaytracing; - bool myIsShadowsEnabled; - bool myIsReflectionsEnabled; - bool myIsAntialiasingEnabled; - - Handle(V3d_View) myView; - Handle(AIS_InteractiveContext) myContext; - AIS_MouseGestureMap myDefaultGestures; - Graphic3d_Vec2i myClickPos; - CurrentAction3d myCurrentMode; - Standard_Real myCurZoom; - QList* myViewActions; - QList* myRaytraceActions; - QMenu* myBackMenu; -}; - -#endif - - diff --git a/samples/qt/FuncDemo/CMakeLists.txt b/samples/qt/FuncDemo/CMakeLists.txt deleted file mode 100644 index afa0ec7fea..0000000000 --- a/samples/qt/FuncDemo/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -project(FuncDemo) - -# Sample configuration -set (EXECUTABLE_PROJECT ON) -set (USE_QT ON) -set (RELATIVE_DIR "samples/qt") -set (TARGET_FOLDER "Samples") - -include_directories("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/${RELATIVE_DIR}") - -OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) - -if (BUILD_Inspector) - target_link_libraries (FuncDemo TKTInspector) -endif() diff --git a/samples/qt/FuncDemo/EXTERNLIB.cmake b/samples/qt/FuncDemo/EXTERNLIB.cmake deleted file mode 100644 index d34ba941be..0000000000 --- a/samples/qt/FuncDemo/EXTERNLIB.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# External dependencies for FuncDemo sample -set(OCCT_FuncDemo_EXTERNAL_LIBS - TKBO - TKBRep - TKCAF - TKCDF - TKG2d - TKG3d - TKGeomAlgo - TKGeomBase - TKernel - TKLCAF - TKMath - TKMesh - TKPrim - TKTopAlgo -) \ No newline at end of file diff --git a/samples/qt/FuncDemo/FILES.cmake b/samples/qt/FuncDemo/FILES.cmake deleted file mode 100644 index ed56eb76c0..0000000000 --- a/samples/qt/FuncDemo/FILES.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Source files for FuncDemo sample -set(OCCT_FuncDemo_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") - -set(OCCT_FuncDemo_FILES - src/BaseDriver.cpp - src/BaseDriver.h - src/CircleDriver.cpp - src/CircleDriver.h - src/ConeDriver.cpp - src/ConeDriver.h - src/CylinderDriver.cpp - src/CylinderDriver.h - src/edge.cpp - src/edge.h - src/FThread.cpp - src/FThread.h - src/FuncDemo.qrc - src/graphwidget.cpp - src/graphwidget.h - src/main.cpp - src/mainwindow.cpp - src/mainwindow.h - src/node.cpp - src/node.h - src/PointDriver.cpp - src/PointDriver.h - src/PrismDriver.cpp - src/PrismDriver.h - src/ShapeSaverDriver.cpp - src/ShapeSaverDriver.h - src/SimpleDriver.cpp - src/SimpleDriver.h -) \ No newline at end of file diff --git a/samples/qt/FuncDemo/FuncDemo.pro b/samples/qt/FuncDemo/FuncDemo.pro deleted file mode 100644 index dea4752c49..0000000000 --- a/samples/qt/FuncDemo/FuncDemo.pro +++ /dev/null @@ -1,87 +0,0 @@ -TEMPLATE = app -CONFIG += debug_and_release qt - -TARGET = FuncDemo - -isEmpty(CSF_OCCTSamplesPath) { - SAMPLESROOT = $$PWD/.. -} else { - SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt) -} - -HEADERS = src/*.h -SOURCES = src/*.cpp - -INCLUDEPATH += $$quote($$(CSF_OCCTIncludePath)) - -OCCT_DEFINES = $$(CSF_DEFINES) - -DEFINES = $$split(OCCT_DEFINES, ;) - -RESOURCES += ./src/FuncDemo.qrc - -unix { - UNAME = $$system(uname -s) - LIBLIST = $$(LD_LIBRARY_PATH) - LIBPATHS = $$split(LIBLIST,":") - for(lib, LIBPATHS):LIBS += -L$${lib} - - CONFIG(debug, debug|release) { - DESTDIR = ./$$UNAME/bind - OBJECTS_DIR = ./$$UNAME/objd - MOC_DIR = ./src - } else { - DESTDIR = ./$$UNAME/bin - OBJECTS_DIR = ./$$UNAME/obj - MOC_DIR = ./src - } - - MACOSX_USE_GLX = $$(MACOSX_USE_GLX) - - !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD - equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX - DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL - !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD - QMAKE_CXXFLAGS += -std=c++17 -} - -win32 { - CONFIG(debug, debug|release) { - DEFINES += _DEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bind - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/objd - MOC_DIR = ./src - } else { - DEFINES += NDEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bin - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj - MOC_DIR = ./src - } - QMAKE_CXXFLAGS += /std:c++17 - LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath) -} - -LIBS += -lTKernel -lTKMath -lTKBRep -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \ - -lTKTopAlgo -lTKMesh -lTKPrim -lTKCDF -lTKLCAF -lTKCAF -lTKBO - -lrelease.name = LRELEASE ${QMAKE_FILE_IN} -lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm -lrelease.output = ${QMAKE_FILE_BASE}.qm -lrelease.input = TS_FILES -lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm -lrelease.CONFIG += no_link target_predeps -QMAKE_EXTRA_COMPILERS += lrelease - -copy_res.name = Copy resource ${QMAKE_FILE_IN} -copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -copy_res.input = RES_FILES -copy_res.CONFIG += no_link target_predeps -win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR} -QMAKE_EXTRA_COMPILERS += copy_res -QMAKE_EXTRA_COMPILERS += copy_res - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} diff --git a/samples/qt/FuncDemo/FuncDemo0.pro b/samples/qt/FuncDemo/FuncDemo0.pro deleted file mode 100644 index 09937f3e87..0000000000 --- a/samples/qt/FuncDemo/FuncDemo0.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE=subdirs - -SUBDIRS=FuncDemo0 - -FuncDemo0.file=FuncDemo.pro diff --git a/samples/qt/FuncDemo/PACKAGES.cmake b/samples/qt/FuncDemo/PACKAGES.cmake deleted file mode 100644 index 310092e7a4..0000000000 --- a/samples/qt/FuncDemo/PACKAGES.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Packages for FuncDemo sample -set(OCCT_FuncDemo_LIST_OF_PACKAGES - FuncDemo -) \ No newline at end of file diff --git a/samples/qt/FuncDemo/ReadMe.md b/samples/qt/FuncDemo/ReadMe.md deleted file mode 100644 index 9090437d9e..0000000000 --- a/samples/qt/FuncDemo/ReadMe.md +++ /dev/null @@ -1,30 +0,0 @@ -Advanced Function Mechanism sample application -============================================== - -This sample demonstrates a simple way of using an advanced function mechanism of Ocaf. - -Description -=========== -The sample application represents a window demontsrating calculation of two simple models by the advanced function mechanism. The models are displayed as a graph (colored circles connected to each other). The links between circles define the dependences of the sample functions. Having pressed the button "Compute" the user may see how the function mechanism calculates the functions - the calculated circles change the color to yellow (indicating the process of calculation) and then, to blue - the function is computed. It is possible to define the number of threads to be used by the function mechanism (up to 4, just a limitation of this sample application). Having chosen 4 threads, for example, the user may see how the functions are calculated by 4 at once. - -Compilation -=========== -Run genproj.bat in a command-line to generate Visual Studio projects. For example, for Visual Studio 2010 call this line: ->genproj vc10 win32 debug -It generates VCPROJ (or VCXPROJ) files. Then, call the Visual Studio: -msvc vc10 win32 debug - -Usage -===== -There are 4 menu-items: -Model \ Model1 - chooses the 1st test model. The application clears the previously selected model and displays a set of connected green circles (functions). You may move the circles by mouse for more convenient view. -Model \ Model2 - chooses the 2nd test model. It behaves the same as the Model1 described above. -Model \ Compute - runs the calculation of the chosen model in multi-threaded mode. -Model \ Number of threads - defines the number of threads (up to 4, for this sample application) to be used for calculation of a chosen model. - -Implementation -============== -The models (Model1 and Model2) are hard-coded in MainWindow.cpp in the methods createDefaultModel1() and createDefaultModel2(). -The Model1 represents a set of dependent "simple" functions. By "simple" I mean the function without a meaning. In other words, it doesn't matter what the function do, it is important how it depends on other functions and how it is being calculated by the function mechanism. -The Model2 has more meaning. It represents a process of creation of a shape. A Circle depends on a Point, A Prism is built on a Circle, ... - diff --git a/samples/qt/FuncDemo/custom.bat b/samples/qt/FuncDemo/custom.bat deleted file mode 100644 index 38728c3ad6..0000000000 --- a/samples/qt/FuncDemo/custom.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -rem Define QTDIR variable -set QTDIR=%PRODUCTS_PATH%/qt486-vc10-32 diff --git a/samples/qt/FuncDemo/custom.sh b/samples/qt/FuncDemo/custom.sh deleted file mode 100644 index 708bb7faae..0000000000 --- a/samples/qt/FuncDemo/custom.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -#Define QTDIR variables in order to generate Makefile files by qmake -export QTDIR= diff --git a/samples/qt/FuncDemo/env.bat b/samples/qt/FuncDemo/env.bat deleted file mode 100644 index 78c73fc58a..0000000000 --- a/samples/qt/FuncDemo/env.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -call "%~dp0..\..\..\env.bat" %1 %2 %3 - -call "custom.bat" %1 %2 %3 - -set "PATH=%QTDIR%/bin;%PATH%" \ No newline at end of file diff --git a/samples/qt/FuncDemo/env.sh b/samples/qt/FuncDemo/env.sh deleted file mode 100644 index 616847c074..0000000000 --- a/samples/qt/FuncDemo/env.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "custom.sh" ]; then - source "custom.sh" $*; -fi - -if [ -e "${aSamplePath}/../../../env.sh" ]; then - source "${aSamplePath}/../../../env.sh" $*; -fi - -if [ "${QTDIR}" != "" ]; then - export PATH=${QTDIR}/bin:${PATH} -else - aQMakePath=`which qmake` - echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script." - if [ -x "$aQMakePath" ]; then - echo "qmake from PATH will be used instead." - else - exit 1 - fi -fi - -host=`uname -s` -export STATION=$host diff --git a/samples/qt/FuncDemo/genproj.bat b/samples/qt/FuncDemo/genproj.bat deleted file mode 100644 index 6cb5e35e2d..0000000000 --- a/samples/qt/FuncDemo/genproj.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -REM Generation of vcproj files with qmake utilite -REM Variable QTDIR and PATH to qmake executable must be defined without fail - -REM Use first argument to specify version of Visual Studio (vc10, vc11, vc12 or vc14), -REM second argument specifies architecture) (win32 or win64) -REM third argument specifies Debug or Release mode - -call "%~dp0env.bat" %1 %2 %3 - -call "%VCVARS%" %VCARCH% - -qmake -tp vc -r -o FuncDemo.sln FuncDemo0.pro diff --git a/samples/qt/FuncDemo/images/new.png b/samples/qt/FuncDemo/images/new.png deleted file mode 100644 index 12131b0100..0000000000 Binary files a/samples/qt/FuncDemo/images/new.png and /dev/null differ diff --git a/samples/qt/FuncDemo/images/open.png b/samples/qt/FuncDemo/images/open.png deleted file mode 100644 index 45fa2883a7..0000000000 Binary files a/samples/qt/FuncDemo/images/open.png and /dev/null differ diff --git a/samples/qt/FuncDemo/images/save.png b/samples/qt/FuncDemo/images/save.png deleted file mode 100644 index daba865faf..0000000000 Binary files a/samples/qt/FuncDemo/images/save.png and /dev/null differ diff --git a/samples/qt/FuncDemo/make.sh b/samples/qt/FuncDemo/make.sh deleted file mode 100644 index 1b771ffbe0..0000000000 --- a/samples/qt/FuncDemo/make.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath -qmake FuncDemo.pro -if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then - aNbJobs="$(getconf _NPROCESSORS_ONLN)" - if [ "${CASDEB}" == "d" ]; then - make -j $aNbJobs debug - else - make -j $aNbJobs release - fi -fi diff --git a/samples/qt/FuncDemo/msvc.bat b/samples/qt/FuncDemo/msvc.bat deleted file mode 100644 index f6dce4a2ac..0000000000 --- a/samples/qt/FuncDemo/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0FuncDemo.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/qt/FuncDemo/run.bat b/samples/qt/FuncDemo/run.bat deleted file mode 100644 index fbf18f8a84..0000000000 --- a/samples/qt/FuncDemo/run.bat +++ /dev/null @@ -1,23 +0,0 @@ -Setlocal EnableDelayedExpansion - -call "%~dp0env.bat" %1 %2 %3 - -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" -) - -if not exist "%~dp0%BIN_DIR%\FuncDemo.exe" goto ERR_EXE - -echo Starting Demo ..... -"%~dp0%BIN_DIR%\FuncDemo.exe" - -goto END - -:ERR_EXE -echo Executable %~dp0%BIN_DIR%\FuncDemo.exe not found. -echo Probably you didn't compile the application. -pause -goto END - -:END \ No newline at end of file diff --git a/samples/qt/FuncDemo/run.sh b/samples/qt/FuncDemo/run.sh deleted file mode 100644 index 9e12027359..0000000000 --- a/samples/qt/FuncDemo/run.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath - -aSystem=`uname -s` -if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - if [ "${CASDEB}" == "d" ]; then - BIN_DIR="${aSamplePath}/build/Debug/FuncDemo.app/Contents/MacOS" - else - BIN_DIR="${aSamplePath}/build/Release/FuncDemo.app/Contents/MacOS" - fi -else - BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}" -fi - -PATH="${BIN_DIR}:${PATH}" -export PATH - -if test ! -r "${BIN_DIR}/FuncDemo"; then - echo "Executable \"${BIN_DIR}/FuncDemo\" not found." - if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - echo "Probably you don't compile the application. Build it with Xcode." - else - echo "Probably you don't compile the application. Execute \"make\"." - fi - exit 1 -fi - -${BIN_DIR}/FuncDemo diff --git a/samples/qt/FuncDemo/src/BaseDriver.cpp b/samples/qt/FuncDemo/src/BaseDriver.cpp deleted file mode 100644 index 2d34a6973a..0000000000 --- a/samples/qt/FuncDemo/src/BaseDriver.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// BaseDriver.cpp: implementation of the BaseDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "BaseDriver.h" - -#include -#include - -#define SLOW -#ifdef SLOW -#include -#include -#include -#endif - -IMPLEMENT_STANDARD_HANDLE(BaseDriver,TFunction_Driver) -IMPLEMENT_STANDARD_RTTIEXT(BaseDriver,TFunction_Driver) - -// Constructor -BaseDriver::BaseDriver() -{ - -} - -// Returns the arguments of the function -void BaseDriver::Arguments(TDF_LabelList& args) const -{ - // Append all arguments. - TDF_ChildIterator itr(Label().FindChild(1), false); - for (; itr.More(); itr.Next()) - { - Handle(TDF_Reference) ref; - if (itr.Value().FindAttribute(TDF_Reference::GetID(), ref)) - args.Append(ref->Get()); - } -} - -// Returns the results of the function -void BaseDriver::Results(TDF_LabelList& res) const -{ - // Append all results - TDF_ChildIterator itr(Label().FindChild(2), false); - for (; itr.More(); itr.Next()) - { - Handle(TDF_Reference) ref; - if (itr.Value().FindAttribute(TDF_Reference::GetID(), ref)) - res.Append(ref->Get()); - } -} - -// Sets a mutex for execution of the driver. -void BaseDriver::SetMutex(Standard_Mutex* pmutex) -{ - myMutex = pmutex; -} - -// Execution. -Standard_Integer BaseDriver::Execute(Handle(TFunction_Logbook)& ) const -{ -#ifdef SLOW - // Make a boolean operation to slow down the function - TopoDS_Shape S1 = BRepPrimAPI_MakeSphere(100.0, 2.0 * M_PI / 3.0); - TopoDS_Shape S2 = BRepPrimAPI_MakeSphere(gp_Pnt(10, 10, 10), 100.0, 2.0 * M_PI / 3.0); - BRepAlgoAPI_Fuse fuser(S1, S2); - fuser.Build(); -#endif - - // Empty... should be implemented in descendent classes - return 0; -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/BaseDriver.h b/samples/qt/FuncDemo/src/BaseDriver.h deleted file mode 100644 index c5c669c42c..0000000000 --- a/samples/qt/FuncDemo/src/BaseDriver.h +++ /dev/null @@ -1,42 +0,0 @@ -// BaseDriver.h: interface for the Base function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_BASEDRIVER_H_) -#define _BASEDRIVER_H_ - -#include -#include -#include -#include -#include - -DEFINE_STANDARD_HANDLE(BaseDriver, TFunction_Driver) - -// A base function driver. -class BaseDriver : public TFunction_Driver -{ -public: - - // Constructor - BaseDriver(); - - // Returns the arguments of the function - virtual void Arguments(TDF_LabelList& args) const; - - // Returns the results of the function - virtual void Results(TDF_LabelList& res) const; - - // Sets a mutex for execution of the driver. - void SetMutex(Standard_Mutex* pmutex); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(BaseDriver, TFunction_Driver) - -protected: - Standard_Mutex* myMutex; -}; - -#endif // !defined(_BASEDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/CircleDriver.cpp b/samples/qt/FuncDemo/src/CircleDriver.cpp deleted file mode 100644 index 3fbf7328f4..0000000000 --- a/samples/qt/FuncDemo/src/CircleDriver.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// CircleDriver.cpp: implementation of the CircleDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "CircleDriver.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(CircleDriver,BaseDriver) -IMPLEMENT_STANDARD_RTTIEXT(CircleDriver,BaseDriver) - -// ID of the function driver -const Standard_GUID& CircleDriver::GetID() -{ - static const Standard_GUID id("D10515D5-7C4E-4fe3-A7E2-DE2E01859B4D"); - return id; -} - -// Constructor -CircleDriver::CircleDriver() -{ - -} - -// Execution. -Standard_Integer CircleDriver::Execute(Handle(TFunction_Logbook)& log) const -{ - // Usual check... - if (Label().IsNull()) - return 1; - - // Take the arguments (radius) - Handle(TDataStd_Real) r; - if (!Label().FindAttribute(TDataStd_Real::GetID(), r)) - return 2; - double radius = r->Get(); - if (radius < Precision::Confusion()) - return 3; - - // Take the arguments (center point) - Handle(TDF_Reference) ref; - TDF_Label Lpoint = Label().FindChild(1).FindChild(1); - if (!Lpoint.FindAttribute(TDF_Reference::GetID(), ref)) - return 4; - Handle(TNaming_NamedShape) n; - if (!ref->Get().FindAttribute(TNaming_NamedShape::GetID(), n) || n->IsEmpty()) - return 5; - TopoDS_Vertex V = TopoDS::Vertex(n->Get()); - - // Make the result - gp_Circ C(gp_Ax2(BRep_Tool::Pnt(V), gp::DZ()), radius); - TopoDS_Edge E = BRepBuilderAPI_MakeEdge(C); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E); - TopoDS_Face F = BRepBuilderAPI_MakeFace(W); - - // Set the result - TNaming_Builder B(Label()); - B.Generated(F); - - return BaseDriver::Execute(log); -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/CircleDriver.h b/samples/qt/FuncDemo/src/CircleDriver.h deleted file mode 100644 index eb2c385650..0000000000 --- a/samples/qt/FuncDemo/src/CircleDriver.h +++ /dev/null @@ -1,32 +0,0 @@ -// CircleDriver.h: interface for the Circle function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_CIRCLEDRIVER_H_) -#define _CIRCLEDRIVER_H_ - -#include "BaseDriver.h" - -#include -#include - -DEFINE_STANDARD_HANDLE(CircleDriver, BaseDriver) - -// A Circle function driver. -class CircleDriver : public BaseDriver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - CircleDriver(); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(CircleDriver, BaseDriver) -}; - -#endif // !defined(_CIRCLEDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/ConeDriver.cpp b/samples/qt/FuncDemo/src/ConeDriver.cpp deleted file mode 100644 index c1fe28b5ea..0000000000 --- a/samples/qt/FuncDemo/src/ConeDriver.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// ConeDriver.cpp: implementation of the ConeDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "ConeDriver.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(ConeDriver,BaseDriver) -IMPLEMENT_STANDARD_RTTIEXT(ConeDriver,BaseDriver) - -// ID of the function driver -const Standard_GUID& ConeDriver::GetID() -{ - static const Standard_GUID id("73C5C048-59EC-404a-850B-08363D75E63C"); - return id; -} - -// Constructor -ConeDriver::ConeDriver() -{ - -} - -// Execution. -Standard_Integer ConeDriver::Execute(Handle(TFunction_Logbook)& log) const -{ - // Usual check... - if (Label().IsNull()) - return 1; - - // Take the arguments (height) - Handle(TDataStd_Real) h; - if (!Label().FindAttribute(TDataStd_Real::GetID(), h)) - return 2; - double height = h->Get(); - if (height < Precision::Confusion()) - return 3; - - // Take the arguments (top faces) - Handle(TDF_Reference) ref1, ref2, ref3, ref4; - if (!Label().FindChild(1).FindChild(1).FindAttribute(TDF_Reference::GetID(), ref1)) - return 4; - if (!Label().FindChild(1).FindChild(2).FindAttribute(TDF_Reference::GetID(), ref2)) - return 5; - if (!Label().FindChild(1).FindChild(3).FindAttribute(TDF_Reference::GetID(), ref3)) - return 6; - if (!Label().FindChild(1).FindChild(4).FindAttribute(TDF_Reference::GetID(), ref4)) - return 7; - Handle(TNaming_NamedShape) n1, n2, n3, n4; - if (!ref1->Get().FindAttribute(TNaming_NamedShape::GetID(), n1) || n1->IsEmpty()) - return 8; - if (!ref2->Get().FindAttribute(TNaming_NamedShape::GetID(), n2) || n2->IsEmpty()) - return 9; - if (!ref3->Get().FindAttribute(TNaming_NamedShape::GetID(), n3) || n3->IsEmpty()) - return 10; - if (!ref4->Get().FindAttribute(TNaming_NamedShape::GetID(), n4) || n4->IsEmpty()) - return 11; - TopoDS_Face F1 = TopoDS::Face(n1->Get()); - TopoDS_Face F2 = TopoDS::Face(n2->Get()); - TopoDS_Face F3 = TopoDS::Face(n3->Get()); - TopoDS_Face F4 = TopoDS::Face(n4->Get()); - - // Compute central points - gp_Pnt p1, p2, p3, p4; - TopoDS_Edge E1, E2, E3, E4; - TopExp_Explorer expl(F1, TopAbs_EDGE); - if (!expl.More()) - return 12; - E1 = TopoDS::Edge(expl.Current()); - expl.Init(F2, TopAbs_EDGE); - if (!expl.More()) - return 13; - E2 = TopoDS::Edge(expl.Current()); - expl.Init(F3, TopAbs_EDGE); - if (!expl.More()) - return 14; - E3 = TopoDS::Edge(expl.Current()); - expl.Init(F4, TopAbs_EDGE); - if (!expl.More()) - return 15; - E4 = TopoDS::Edge(expl.Current()); - BRepAdaptor_Curve A(E1); - gp_Circ C1 = A.Circle(); - p1 = C1.Location(); - A.Initialize(E2); - gp_Circ C2 = A.Circle(); - p2 = C2.Location(); - A.Initialize(E3); - gp_Circ C3 = A.Circle(); - p3 = C3.Location(); - A.Initialize(E4); - gp_Circ C4 = A.Circle(); - p4 = C4.Location(); - - // Center of cone - gp_Pnt p(0.25*(p1.X()+p2.X()+p3.X()+p4.X()), - 0.25*(p1.Y()+p2.Y()+p3.Y()+p4.Y()), - 0.25*(p1.Z()+p2.Z()+p3.Z()+p4.Z())); - - // Bottom radius (max distance to points from center) - double bRadius = 0.0; - if (p1.Distance(p) > bRadius) - bRadius = p1.Distance(p); - if (p2.Distance(p) > bRadius) - bRadius = p2.Distance(p); - if (p3.Distance(p) > bRadius) - bRadius = p3.Distance(p); - if (p4.Distance(p) > bRadius) - bRadius = p4.Distance(p); - bRadius *= 1.5; - - // Top radius - double tRadius = bRadius / 2.0; - - // Make the result - BRepPrimAPI_MakeCone mkCone(gp_Ax2(p, gp::DZ()), bRadius, tRadius, height); - mkCone.Build(); - if (!mkCone.IsDone()) - return 16; - TopoDS_Shape C = mkCone.Shape(); - - // Make another result: a circle for next functions (many cylinders) - p.Translate(height * gp::DZ()); - gp_Circ TC(gp_Ax2(p, gp::DZ()), 0.8 * tRadius); - TopoDS_Edge E = BRepBuilderAPI_MakeEdge(TC); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E); - TopoDS_Face F = BRepBuilderAPI_MakeFace(W); - - // Set the result - TNaming_Builder B(Label()); - B.Generated(C); - TNaming_Builder B2(Label().FindChild(3)); - B2.Generated(F); - - return BaseDriver::Execute(log); -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/ConeDriver.h b/samples/qt/FuncDemo/src/ConeDriver.h deleted file mode 100644 index be225b1e15..0000000000 --- a/samples/qt/FuncDemo/src/ConeDriver.h +++ /dev/null @@ -1,32 +0,0 @@ -// ConeDriver.h: interface for the Cone function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_CONEDRIVER_H_) -#define _CONEDRIVER_H_ - -#include "BaseDriver.h" - -#include -#include - -DEFINE_STANDARD_HANDLE(ConeDriver, BaseDriver) - -// A Cone function driver. -class ConeDriver : public BaseDriver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - ConeDriver(); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(ConeDriver, BaseDriver) -}; - -#endif // !defined(_CONEDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/CylinderDriver.cpp b/samples/qt/FuncDemo/src/CylinderDriver.cpp deleted file mode 100644 index fa9d5d335c..0000000000 --- a/samples/qt/FuncDemo/src/CylinderDriver.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// CylinderDriver.cpp: implementation of the CylinderDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "CylinderDriver.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(CylinderDriver,BaseDriver) -IMPLEMENT_STANDARD_RTTIEXT(CylinderDriver,BaseDriver) - -// ID of the function driver -const Standard_GUID& CylinderDriver::GetID() -{ - static const Standard_GUID id("9CE1FCDA-C8EA-4b09-B1C4-021FCD44F3F3"); - return id; -} - -// Constructor -CylinderDriver::CylinderDriver() -{ - -} - -// Execution. -Standard_Integer CylinderDriver::Execute(Handle(TFunction_Logbook)& log) const -{ - // Usual check... - if (Label().IsNull()) - return 1; - - // Take the arguments (radius, angle, height) - Handle(TDataStd_RealArray) arr; - if (!Label().FindAttribute(TDataStd_RealArray::GetID(), arr)) - return 2; - double radius = arr->Value(1); - double angle = arr->Value(2); - double height = arr->Value(3); - if (radius < Precision::Confusion() || height < Precision::Confusion()) - return 3; - - // Take the arguments (top face) - Handle(TDF_Reference) ref; - if (!Label().FindChild(1).FindChild(1).FindAttribute(TDF_Reference::GetID(), ref)) - return 4; - Handle(TNaming_NamedShape) n; - if (!ref->Get().FindAttribute(TNaming_NamedShape::GetID(), n) || n->IsEmpty()) - return 5; - TopoDS_Face F = TopoDS::Face(n->Get()); - - // Take the circle - TopExp_Explorer expl(F, TopAbs_EDGE); - if (!expl.More()) - return 6; - TopoDS_Edge E = TopoDS::Edge(expl.Current()); - BRepAdaptor_Curve A(E); - gp_Circ C = A.Circle(); - - // Center of the cylinder - gp_Pnt p = ElCLib::Value(angle * M_PI / 180.0, C); - gp_Vec v(p, C.Location()); - v.Normalize(); - p.Translate(radius * v); - - // Make the result - BRepPrimAPI_MakeCylinder mkCylinder(gp_Ax2(p, gp::DZ()), radius, height); - mkCylinder.Build(); - if (!mkCylinder.IsDone()) - return 7; - TopoDS_Shape Cyl = mkCylinder.Shape(); - - // Make the top face of the cylinder for next functions - gp_Circ Ctop(gp_Ax2(p.Translated(height * gp::DZ()), gp::DZ()), radius); - TopoDS_Edge Etop = BRepBuilderAPI_MakeEdge(Ctop); - TopoDS_Wire Wtop = BRepBuilderAPI_MakeWire(Etop); - TopoDS_Face Ftop = BRepBuilderAPI_MakeFace(Wtop); - - // Set the result - TNaming_Builder B(Label()); - B.Generated(Cyl); - TNaming_Builder B2(Label().FindChild(3)); - B2.Generated(Ftop); - - return BaseDriver::Execute(log); -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/CylinderDriver.h b/samples/qt/FuncDemo/src/CylinderDriver.h deleted file mode 100644 index 287ce87a90..0000000000 --- a/samples/qt/FuncDemo/src/CylinderDriver.h +++ /dev/null @@ -1,32 +0,0 @@ -// CylinderDriver.h: interface for the Cylinder function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_CYLINDERDRIVER_H_) -#define _CYLINDERDRIVER_H_ - -#include "BaseDriver.h" - -#include -#include - -DEFINE_STANDARD_HANDLE(CylinderDriver, BaseDriver) - -// A Cylinder function driver. -class CylinderDriver : public BaseDriver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - CylinderDriver(); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(CylinderDriver, BaseDriver) -}; - -#endif // !defined(_CYLINDERDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/FThread.cpp b/samples/qt/FuncDemo/src/FThread.cpp deleted file mode 100644 index e3a4b66dd2..0000000000 --- a/samples/qt/FuncDemo/src/FThread.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "FThread.h" -#include "graphwidget.h" -#include "BaseDriver.h" - -#include -#include -#include -#include - -#include -#include - -FThread::FThread(QObject* parent):QThread(parent),thread_index(0) -{ - -} - -FThread::~FThread() -{ - -} - -void FThread::setIterator(const TFunction_Iterator& theItr) -{ - this->itr = theItr; -} - -void FThread::setLogbook(const Handle(TFunction_Logbook)& theLog) -{ - this->log = theLog; -} - -void FThread::setGraph(GraphWidget* theGraph) -{ - this->graph = theGraph; -} - -void FThread::setThreadIndex(const int theIndex) -{ - this->thread_index = theIndex; -} - -void FThread::setMutex(Standard_Mutex* pmutex) -{ - this->pmutex = pmutex; -} - -// Returns any free (not executed yet) function -TDF_Label FThread::getFreeFunction() -{ - TDF_Label L; - TDF_ListIteratorOfLabelList itrl(itr.Current()); - for (; itrl.More(); itrl.Next()) - { - if (itr.GetStatus(itrl.Value()) == TFunction_ES_NotExecuted) - { - L = itrl.Value(); - itr.SetStatus(L, TFunction_ES_Executing); - break; - } - } - return L; -} - -void FThread::run() -{ - while (itr.More()) - { - // Take current function, - // choose one and set its status to "executing". - TDF_Label L; - for (; itr.More(); itr.Next()) - { - L = getFreeFunction(); - if (L.IsNull()) - #ifdef __GNUC__ - sleep(0.001); - #else - ::Sleep(100); - #endif - else - break; - } - - // Nothing to compute? Finish. - if (L.IsNull()) - { - graph->setFinished(); - return; - } - - // Check a Tick attribute - a marker of skipped for execution functions. - // It is used only for visual presentation of skipped (not modified) functions. - Handle(TDataStd_Tick) tick; - if (L.FindAttribute(TDataStd_Tick::GetID(), tick)) - L.ForgetAttribute(tick); - - // Execute the function - Handle(TFunction_Driver) D = TFunction_IFunction(L).GetDriver(thread_index); - const bool must = D->MustExecute(log); - if (must) - { - // Usage of mutex for execution of Open CASCADE code. - // It makes the execution more reliable... - if (!Handle(BaseDriver)::DownCast(D).IsNull()) - Handle(BaseDriver)::DownCast(D)->SetMutex(pmutex); - - // Execute the driver. - const int ret = D->Execute(log); - if (ret == 0) - { - // Successfully executed! - itr.SetStatus(L, TFunction_ES_Succeeded); - - TDF_LabelList res; - D->Results(res); - TDF_ListIteratorOfLabelList itrr(res); - for (; itrr.More(); itrr.Next()) - { - log->SetImpacted(itrr.Value()); - } - } - else - { - // Failed... - itr.SetStatus(L, TFunction_ES_Failed); - graph->setFinished(); - return; - } - } - else if (itr.GetStatus(L) == TFunction_ES_Executing) - { - itr.SetStatus(L, TFunction_ES_Succeeded); - TDataStd_Tick::Set(L); - } - - }// while (More()) - - graph->setFinished(); -} diff --git a/samples/qt/FuncDemo/src/FThread.h b/samples/qt/FuncDemo/src/FThread.h deleted file mode 100644 index e494b797c0..0000000000 --- a/samples/qt/FuncDemo/src/FThread.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _FTHREAD_H_ -#define _FTHREAD_H_ - -#include -#include -#include - -#include -#include -#include -#include - -class GraphWidget; // shows graphically execution of functions - -class FThread : public QThread -{ - - Q_OBJECT - -public: - - FThread(QObject* parent = 0); - ~FThread(); - - void setIterator(const TFunction_Iterator& ); // to iterate and call functions - void setLogbook(const Handle(TFunction_Logbook)& ); // to set logbook with modifications - void setGraph(GraphWidget* ); // to change color of a graph circle - void setThreadIndex(const int ); // to set the index of the thread - void setMutex(Standard_Mutex* ); - -protected: - - void run(); - virtual TDF_Label getFreeFunction(); // Returns any free (not executed yet) function - -private: - - TFunction_Iterator itr; - Handle(TFunction_Logbook) log; - Standard_Mutex* pmutex; - int thread_index; - - GraphWidget* graph; -}; - -#endif // _FTHREAD_H_ \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/FuncDemo.qrc b/samples/qt/FuncDemo/src/FuncDemo.qrc deleted file mode 100644 index 57e284ec48..0000000000 --- a/samples/qt/FuncDemo/src/FuncDemo.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - ../images/new.png - ../images/open.png - ../images/save.png - - diff --git a/samples/qt/FuncDemo/src/PointDriver.cpp b/samples/qt/FuncDemo/src/PointDriver.cpp deleted file mode 100644 index 03aa733ce8..0000000000 --- a/samples/qt/FuncDemo/src/PointDriver.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// PointDriver.cpp: implementation of the PointDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "PointDriver.h" - -#include -#include -#include -#include - -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(PointDriver,BaseDriver) -IMPLEMENT_STANDARD_RTTIEXT(PointDriver,BaseDriver) - -// ID of the function driver -const Standard_GUID& PointDriver::GetID() -{ - static const Standard_GUID id("E9467D43-B11D-42d3-AF10-E91B74D2A3D9"); - return id; -} - -// Constructor -PointDriver::PointDriver() -{ - -} - -// Execution. -Standard_Integer PointDriver::Execute(Handle(TFunction_Logbook)& log) const -{ - // Usual check... - if (Label().IsNull()) - return 1; - - // Take the arguments (x, y, z) - Handle(TDataStd_RealArray) arr; - if (!Label().FindAttribute(TDataStd_RealArray::GetID(), arr)) - return 2; - double x = arr->Value(1); - double y = arr->Value(2); - double z = arr->Value(3); - - // Make the result - TopoDS_Vertex V = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, z)); - - if (myMutex) - myMutex->Lock(); - - // Set the result - TNaming_Builder B(Label()); - B.Generated(V); - - if (myMutex) - myMutex->Unlock(); - - return BaseDriver::Execute(log); -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/PointDriver.h b/samples/qt/FuncDemo/src/PointDriver.h deleted file mode 100644 index 4d6cd1ccba..0000000000 --- a/samples/qt/FuncDemo/src/PointDriver.h +++ /dev/null @@ -1,32 +0,0 @@ -// PointDriver.h: interface for the Point function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_PointDRIVER_H_) -#define _PointDRIVER_H_ - -#include "BaseDriver.h" - -#include -#include - -DEFINE_STANDARD_HANDLE(PointDriver, BaseDriver) - -// A Point function driver. -class PointDriver : public BaseDriver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - PointDriver(); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(PointDriver, BaseDriver) -}; - -#endif // !defined(_PointDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/PrismDriver.cpp b/samples/qt/FuncDemo/src/PrismDriver.cpp deleted file mode 100644 index 8f9955109e..0000000000 --- a/samples/qt/FuncDemo/src/PrismDriver.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// PrismDriver.cpp: implementation of the PrismDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "PrismDriver.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(PrismDriver,BaseDriver) -IMPLEMENT_STANDARD_RTTIEXT(PrismDriver,BaseDriver) - -// ID of the function driver -const Standard_GUID& PrismDriver::GetID() -{ - static const Standard_GUID id("D017489C-EFCE-4e57-8FE9-FA3DEF7DACA9"); - return id; -} - -// Constructor -PrismDriver::PrismDriver() -{ - -} - -// Execution. -Standard_Integer PrismDriver::Execute(Handle(TFunction_Logbook)& log) const -{ - // Usual check... - if (Label().IsNull()) - return 1; - - // Take the arguments (height) - Handle(TDataStd_Real) h; - if (!Label().FindAttribute(TDataStd_Real::GetID(), h)) - return 2; - double height = h->Get(); - if (height < Precision::Confusion()) - return 3; - - // Take the arguments (circular face) - Handle(TDF_Reference) ref; - TDF_Label Lcircle = Label().FindChild(1).FindChild(1); - if (!Lcircle.FindAttribute(TDF_Reference::GetID(), ref)) - return 4; - Handle(TNaming_NamedShape) n; - if (!ref->Get().FindAttribute(TNaming_NamedShape::GetID(), n) || n->IsEmpty()) - return 5; - TopoDS_Face F = TopoDS::Face(n->Get()); - - // Make the result - BRepPrimAPI_MakePrism mkPrism(F, gp_Vec(height * gp::DZ())); - if (!mkPrism.IsDone()) - return 6; - TopoDS_Shape P = mkPrism.Shape(); - TopoDS_Shape Top = mkPrism.LastShape(); - - // Set the result - TNaming_Builder B(Label()); - B.Generated(P); - TNaming_Builder B2(Label().FindChild(3)); - B2.Generated(Top); - - return BaseDriver::Execute(log); -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/PrismDriver.h b/samples/qt/FuncDemo/src/PrismDriver.h deleted file mode 100644 index 4c2894e5e5..0000000000 --- a/samples/qt/FuncDemo/src/PrismDriver.h +++ /dev/null @@ -1,32 +0,0 @@ -// PrismDriver.h: interface for the Prism function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_PRISMDRIVER_H_) -#define _PRISMDRIVER_H_ - -#include "BaseDriver.h" - -#include -#include - -DEFINE_STANDARD_HANDLE(PrismDriver, BaseDriver) - -// A Prism function driver. -class PrismDriver : public BaseDriver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - PrismDriver(); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(PrismDriver, BaseDriver) -}; - -#endif // !defined(_PRISMDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/ShapeSaverDriver.cpp b/samples/qt/FuncDemo/src/ShapeSaverDriver.cpp deleted file mode 100644 index 15a39f9279..0000000000 --- a/samples/qt/FuncDemo/src/ShapeSaverDriver.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// ShapeSaverDriver.cpp: implementation of the ShapeSaverDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "ShapeSaverDriver.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(ShapeSaverDriver,BaseDriver) -IMPLEMENT_STANDARD_RTTIEXT(ShapeSaverDriver,BaseDriver) - -// ID of the function driver -const Standard_GUID& ShapeSaverDriver::GetID() -{ - static const Standard_GUID id("6B77A40E-E074-4fe1-AB9B-ECECA506717A"); - return id; -} - -// Constructor -ShapeSaverDriver::ShapeSaverDriver() -{ - -} - -// Execution. -Standard_Integer ShapeSaverDriver::Execute(Handle(TFunction_Logbook)& log) const -{ - // Usual check... - if (Label().IsNull()) - return 1; - - // A compound of results of all functions - TopoDS_Compound C; - BRep_Builder B; - B.MakeCompound(C); - - // Take results of all functions - TDF_ChildIterator itr(Label().FindChild(1), false); - for (; itr.More(); itr.Next()) - { - Handle(TDF_Reference) ref; - if (itr.Value().FindAttribute(TDF_Reference::GetID(), ref)) - { - Handle(TNaming_NamedShape) n; - if (ref->Get().FindAttribute(TNaming_NamedShape::GetID(), n) && !n->IsEmpty()) - { - B.Add(C, n->Get()); - } - } - } - - if (myMutex) - myMutex->Lock(); - - TNaming_Builder Bui(Label()); - Bui.Generated(C); - - if (myMutex) - myMutex->Unlock(); - - return BaseDriver::Execute(log); -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/ShapeSaverDriver.h b/samples/qt/FuncDemo/src/ShapeSaverDriver.h deleted file mode 100644 index ddc6b1338d..0000000000 --- a/samples/qt/FuncDemo/src/ShapeSaverDriver.h +++ /dev/null @@ -1,32 +0,0 @@ -// ShapeSaverDriver.h: interface for the ShapeSaver function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_SHAPESAVERDRIVER_H_) -#define _SHAPESAVERDRIVER_H_ - -#include "BaseDriver.h" - -#include -#include - -DEFINE_STANDARD_HANDLE(ShapeSaverDriver, BaseDriver) - -// A ShapeSaver function driver. -class ShapeSaverDriver : public BaseDriver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - ShapeSaverDriver(); - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(ShapeSaverDriver, BaseDriver) -}; - -#endif // !defined(_SHAPESAVERDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/SimpleDriver.cpp b/samples/qt/FuncDemo/src/SimpleDriver.cpp deleted file mode 100644 index 46b425bee4..0000000000 --- a/samples/qt/FuncDemo/src/SimpleDriver.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// SimpleDriver.cpp: implementation of the SimpleDriver class. -// -////////////////////////////////////////////////////////////////////// - -#include "SimpleDriver.h" - -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_HANDLE(SimpleDriver, TFunction_Driver) -IMPLEMENT_STANDARD_RTTIEXT(SimpleDriver, TFunction_Driver) - -// ID of the function driver -const Standard_GUID& SimpleDriver::GetID() -{ - static const Standard_GUID id("4534840D-6DCD-440f-9F0E-BDEF1C50D434"); - return id; -} - -// Constructor -SimpleDriver::SimpleDriver() -{ - -} - -// Returns the arguments of the function -void SimpleDriver::Arguments(TDF_LabelList& args) const -{ - // A double - relative time of execution - args.Append(Label()); - - // References to other functions through TDF_Reference - TDF_ChildIterator itr(Label().FindChild(1), false); - for (; itr.More(); itr.Next()) - { - Handle(TDF_Reference) ref; - if (itr.Value().FindAttribute(TDF_Reference::GetID(), ref)) - args.Append(ref->Get()); - } -} - - -// Returns the results of the function -void SimpleDriver::Results(TDF_LabelList& res) const -{ - // References to other functions through TDF_Reference - res.Append(Label()); - TDF_ChildIterator itr(Label().FindChild(2), false); - for (; itr.More(); itr.Next()) - { - Handle(TDF_Reference) ref; - if (itr.Value().FindAttribute(TDF_Reference::GetID(), ref)) - res.Append(ref->Get()); - } -} - -// Execution. -Standard_Integer SimpleDriver::Execute(Handle(TFunction_Logbook)& ) const -{ - // Check initialization - if (Label().IsNull()) - return 1; - - // Take the double argument - Handle(TDataStd_Real) time_keeper; - if (!Label().FindAttribute(TDataStd_Real::GetID(), time_keeper)) - return 2; - double times = time_keeper->Get(); - - // Make a sphere 10000 * "times" times (it takes about a second on a simple computer). - int i = 0; - while (++i < 10000 * times) - { - // Call any functions taking much time. - // It is necessary to "see" the execution of a function in real time. - BRepPrimAPI_MakeSphere mkSphere(100.0); - mkSphere.Build(); - } - - return 0; -} \ No newline at end of file diff --git a/samples/qt/FuncDemo/src/SimpleDriver.h b/samples/qt/FuncDemo/src/SimpleDriver.h deleted file mode 100644 index 92b646a049..0000000000 --- a/samples/qt/FuncDemo/src/SimpleDriver.h +++ /dev/null @@ -1,38 +0,0 @@ -// SimpleDriver.h: interface for the Simple function driver. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(_SIMPLEDRIVER_H_) -#define _SIMPLEDRIVER_H_ - -#include -#include -#include -#include - -DEFINE_STANDARD_HANDLE(SimpleDriver, TFunction_Driver) - -// A function driver for a Simple function. -class SimpleDriver : public TFunction_Driver -{ -public: - - // ID of the function driver - static const Standard_GUID& GetID(); - - // Constructor - SimpleDriver(); - - // Returns the arguments of the function - virtual void Arguments(TDF_LabelList& args) const; - - // Returns the results of the function - virtual void Results(TDF_LabelList& res) const; - - // Execution. - virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; - - DEFINE_STANDARD_RTTIEXT(SimpleDriver, TFunction_Driver) -}; - -#endif // !defined(_SIMPLEDRIVER_H_) diff --git a/samples/qt/FuncDemo/src/edge.cpp b/samples/qt/FuncDemo/src/edge.cpp deleted file mode 100644 index 93a3b029ad..0000000000 --- a/samples/qt/FuncDemo/src/edge.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#include "edge.h" -#include "node.h" - -#include - -static const double Pi = 3.14159265358979323846264338327950288419717; -static double TwoPi = 2.0 * Pi; - -//! [0] -Edge::Edge(Node *sourceNode, Node *destNode) - : arrowSize(10) -{ - setAcceptedMouseButtons(0); - source = sourceNode; - dest = destNode; - source->addEdge(this); - dest->addEdge(this); - adjust(); -} -//! [0] - -//! [1] -Node *Edge::sourceNode() const -{ - return source; -} - -Node *Edge::destNode() const -{ - return dest; -} -//! [1] - -//! [2] -void Edge::adjust() -{ - if (!source || !dest) - return; - - QLineF line(mapFromItem(source, 0, 0), mapFromItem(dest, 0, 0)); - qreal length = line.length(); - - prepareGeometryChange(); - - if (length > qreal(20.)) { - QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length); - sourcePoint = line.p1() + edgeOffset; - destPoint = line.p2() - edgeOffset; - } else { - sourcePoint = destPoint = line.p1(); - } -} -//! [2] - -//! [3] -QRectF Edge::boundingRect() const -{ - if (!source || !dest) - return QRectF(); - - qreal penWidth = 1; - qreal extra = (penWidth + arrowSize) / 2.0; - - return QRectF(sourcePoint, QSizeF(destPoint.x() - sourcePoint.x(), - destPoint.y() - sourcePoint.y())) - .normalized() - .adjusted(-extra, -extra, extra, extra); -} -//! [3] - -//! [4] -void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) -{ - if (!source || !dest) - return; - - QLineF line(sourcePoint, destPoint); - if (qFuzzyCompare(line.length(), qreal(0.))) - return; -//! [4] - -//! [5] - // Draw the line itself - painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter->drawLine(line); -//! [5] - -//! [6] - // Draw the arrows - double angle = ::acos(line.dx() / line.length()); - if (line.dy() >= 0) - angle = TwoPi - angle; - - QPointF sourceArrowP1 = sourcePoint + QPointF(sin(angle + Pi / 3) * arrowSize, - cos(angle + Pi / 3) * arrowSize); - QPointF sourceArrowP2 = sourcePoint + QPointF(sin(angle + Pi - Pi / 3) * arrowSize, - cos(angle + Pi - Pi / 3) * arrowSize); - QPointF destArrowP1 = destPoint + QPointF(sin(angle - Pi / 3) * arrowSize, - cos(angle - Pi / 3) * arrowSize); - QPointF destArrowP2 = destPoint + QPointF(sin(angle - Pi + Pi / 3) * arrowSize, - cos(angle - Pi + Pi / 3) * arrowSize); - - painter->setBrush(Qt::black); - painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2); - painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2); -} -//! [6] diff --git a/samples/qt/FuncDemo/src/edge.h b/samples/qt/FuncDemo/src/edge.h deleted file mode 100644 index 21bdec02ea..0000000000 --- a/samples/qt/FuncDemo/src/edge.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef EDGE_H -#define EDGE_H - -#include -#include -#include - -class Node; - -//! [0] -class Edge : public QGraphicsItem -{ -public: - Edge(Node *sourceNode, Node *destNode); - - Node *sourceNode() const; - Node *destNode() const; - - void adjust(); - - enum { Type = UserType + 2 }; - int type() const { return Type; } - -protected: - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - -private: - Node *source, *dest; - - QPointF sourcePoint; - QPointF destPoint; - qreal arrowSize; -}; -//! [0] - -#endif diff --git a/samples/qt/FuncDemo/src/graphwidget.cpp b/samples/qt/FuncDemo/src/graphwidget.cpp deleted file mode 100644 index 5c6992f22d..0000000000 --- a/samples/qt/FuncDemo/src/graphwidget.cpp +++ /dev/null @@ -1,578 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "graphwidget.h" -#include "edge.h" -#include "node.h" - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "SimpleDriver.h" -#include "PointDriver.h" -#include "CircleDriver.h" -#include "PrismDriver.h" -#include "ConeDriver.h" -#include "CylinderDriver.h" -#include "ShapeSaverDriver.h" -#include "SimpleDriver.h" - -//! [0] -GraphWidget::GraphWidget(QWidget *parent) - : QGraphicsView(parent), timerId(0), - myThread1(0),myThread2(0),myThread3(0),myThread4(0) -{ - QGraphicsScene *scene = new QGraphicsScene(this); - scene->setItemIndexMethod(QGraphicsScene::NoIndex); - scene->setSceneRect(-200, -200, 400, 400); - setScene(scene); - setCacheMode(CacheBackground); - setViewportUpdateMode(BoundingRectViewportUpdate); - setRenderHint(QPainter::Antialiasing); - setTransformationAnchor(AnchorUnderMouse); - - scale(qreal(0.8), qreal(0.8)); - setMinimumSize(400, 400); - setWindowTitle(tr("Function Mechanism")); - -//! [0] - -//! [1] -/* - Node *node1 = new Node(this); - Node *node2 = new Node(this); - Node *node3 = new Node(this); - Node *node4 = new Node(this); - centerNode = new Node(this); - Node *node6 = new Node(this); - Node *node7 = new Node(this); - Node *node8 = new Node(this); - Node *node9 = new Node(this); - scene->addItem(node1); - scene->addItem(node2); - scene->addItem(node3); - scene->addItem(node4); - scene->addItem(centerNode); - scene->addItem(node6); - scene->addItem(node7); - scene->addItem(node8); - scene->addItem(node9); - scene->addItem(new Edge(node1, node2)); - scene->addItem(new Edge(node2, node3)); - scene->addItem(new Edge(node2, centerNode)); - scene->addItem(new Edge(node3, node6)); - scene->addItem(new Edge(node4, node1)); - scene->addItem(new Edge(node4, centerNode)); - scene->addItem(new Edge(centerNode, node6)); - scene->addItem(new Edge(centerNode, node8)); - scene->addItem(new Edge(node6, node9)); - scene->addItem(new Edge(node7, node4)); - scene->addItem(new Edge(node8, node7)); - scene->addItem(new Edge(node9, node8)); - - node1->setPos(-50, -50); - node2->setPos(0, -50); - node3->setPos(50, -50); - node4->setPos(-50, 0); - centerNode->setPos(0, 0); - node6->setPos(50, 0); - node7->setPos(-50, 50); - node8->setPos(0, 50); - node9->setPos(50, 50); -*/ - - setNbThreads(4); -} -//! [1] - -GraphWidget::~GraphWidget() -{ - if (myThread1) - { - myThread1->wait(); - myThread1->deleteLater(); - } - if (myThread2) - { - myThread2->wait(); - myThread2->deleteLater(); - } - if (myThread3) - { - myThread3->wait(); - myThread3->deleteLater(); - } - if (myThread4) - { - myThread4->wait(); - myThread4->deleteLater(); - } -} - -bool GraphWidget::createModel(const Handle(TDocStd_Document)& doc) -{ - myDocument = doc; - - TFunction_Iterator fIterator(myDocument->Main()); - fIterator.SetUsageOfExecutionStatus(false); - Handle(TFunction_Scope) scope = TFunction_Scope::Set(myDocument->Main()); - - // Find out the size of the grid: number of functions in X and Y directions - int nbx = 0, nby = 0; - while (!fIterator.Current().IsEmpty()) - { - const TDF_LabelList& funcs = fIterator.Current(); - if (funcs.Extent() > nbx) - nbx = funcs.Extent(); - nby++; - fIterator.Next(); - } - if (!nbx || !nby) - return false; - - // Grid of functions - int dx = width() / nbx / 2, dy = height() / nby; - int x0 = int(-double(width()) / 1.5) + dx, y0 = int(-double(height()) / 1.5) + dy; // start position - - // Draw functions - double x = x0, y = y0; - fIterator.Init(myDocument->Main()); - while (!fIterator.Current().IsEmpty()) - { - const TDF_LabelList& funcs = fIterator.Current(); - TDF_ListIteratorOfLabelList itrl(funcs); - for (; itrl.More(); itrl.Next()) - { - TDF_Label L = itrl.Value(); - Node *node = new Node(this); - node->setFunction(L); - scene()->addItem(node); - node->setPos(x, y); - x += dx; - if (x > width()) - x = x0; - } - y += dy; - if (y > height()) - y = y0; - fIterator.Next(); - x = x0 + dx; - } - - // Draw dependencies - fIterator.Init(myDocument->Main()); - while (!fIterator.Current().IsEmpty()) - { - const TDF_LabelList& funcs = fIterator.Current(); - TDF_ListIteratorOfLabelList itrl(funcs); - for (; itrl.More(); itrl.Next()) - { - TDF_Label L = itrl.Value(); - Node* node = findNode(L); - if (!node) - continue; - - // Find backward dependencies of the function - TFunction_IFunction iFunc(L); - Handle(TFunction_GraphNode) graphNode = iFunc.GetGraphNode(); - const TColStd_MapOfInteger& prev = graphNode->GetPrevious(); - TColStd_MapIteratorOfMapOfInteger itrm(prev); - for (; itrm.More(); itrm.Next()) - { - const int argID = itrm.Key(); - const TDF_Label& argL = scope->GetFunction(argID); - Node* n = findNode(argL); - if (!n) - continue; - scene()->addItem(new Edge(n, node)); - } - } - fIterator.Next(); - } - - return !myDocument.IsNull(); -} - -//! [2] -void GraphWidget::itemMoved() -{ - if (!timerId) - timerId = startTimer(1000 / 25); -} -//! [2] - -//! [3] -void GraphWidget::keyPressEvent(QKeyEvent *event) -{ - switch (event->key()) { - case Qt::Key_Up: - centerNode->moveBy(0, -20); - break; - case Qt::Key_Down: - centerNode->moveBy(0, 20); - break; - case Qt::Key_Left: - centerNode->moveBy(-20, 0); - break; - case Qt::Key_Right: - centerNode->moveBy(20, 0); - break; - case Qt::Key_Plus: - zoomIn(); - break; - case Qt::Key_Minus: - zoomOut(); - break; - case Qt::Key_Space: - case Qt::Key_Enter: - shuffle(); - break; - default: - QGraphicsView::keyPressEvent(event); - } -} -//! [3] - -//! [4] -void GraphWidget::timerEvent(QTimerEvent *event) -{ - Q_UNUSED(event); - - QList nodes; - foreach (QGraphicsItem *item, scene()->items()) { - if (Node *node = qgraphicsitem_cast(item)) - nodes << node; - } - - foreach (Node *node, nodes) - node->calculateForces(); - - bool itemsMoved = false; - foreach (Node *node, nodes) { - if (node->advance()) - itemsMoved = true; - } - - if (!itemsMoved) { - killTimer(timerId); - timerId = 0; - } -} -//! [4] - -//! [5] -void GraphWidget::wheelEvent(QWheelEvent *event) -{ - scaleView(pow((double)2, -event->delta() / 240.0)); -} -//! [5] - -//! [6] -void GraphWidget::drawBackground(QPainter* painter, const QRectF &rect) -{ - Q_UNUSED(rect); - Q_UNUSED(painter); - -// // Shadow -// QRectF sceneRect = this->sceneRect(); -// QRectF rightShadow(sceneRect.right(), sceneRect.top() + 5, 5, sceneRect.height()); -// QRectF bottomShadow(sceneRect.left() + 5, sceneRect.bottom(), sceneRect.width(), 5); -// if (rightShadow.intersects(rect) || rightShadow.contains(rect)) -// painter->fillRect(rightShadow, Qt::darkGray); -// if (bottomShadow.intersects(rect) || bottomShadow.contains(rect)) -// painter->fillRect(bottomShadow, Qt::darkGray); -// -// // Fill -// QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight()); -// gradient.setColorAt(0, Qt::white); -// gradient.setColorAt(1, Qt::lightGray); -// painter->fillRect(rect.intersect(sceneRect), gradient); -// painter->setBrush(Qt::NoBrush); -// painter->drawRect(sceneRect); -// -//#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) -// // Text -// QRectF textRect(sceneRect.left() + 4, sceneRect.top() + 4, -// sceneRect.width() - 4, sceneRect.height() - 4); -// QString message(tr("Click and drag the nodes around, and zoom with the mouse " -// "wheel or the '+' and '-' keys")); -// -// QFont font = painter->font(); -// font.setBold(true); -// font.setPointSize(14); -// painter->setFont(font); -// painter->setPen(Qt::lightGray); -// painter->drawText(textRect.translated(2, 2), message); -// painter->setPen(Qt::black); -// painter->drawText(textRect, message); -//#endif -} -//! [6] - -//! [7] -void GraphWidget::scaleView(qreal scaleFactor) -{ - qreal factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width(); - if (factor < 0.07 || factor > 100) - return; - - scale(scaleFactor, scaleFactor); -} -//! [7] - -void GraphWidget::shuffle() -{ - foreach (QGraphicsItem *item, scene()->items()) { - if (qgraphicsitem_cast(item)) - item->setPos(-150 + qrand() % 300, -150 + qrand() % 300); - } -} - -void GraphWidget::zoomIn() -{ - scaleView(qreal(1.2)); -} - -void GraphWidget::zoomOut() -{ - scaleView(1 / qreal(1.2)); -} - - -// Find node of the function -Node* GraphWidget::findNode(const TDF_Label& L) -{ - Node* node = 0; - for (int i = 0; i < scene()->items().size(); i++) - { - Node* n = qgraphicsitem_cast(scene()->items().at(i)); - if (n && n->getFunction() == L) - { - node = n; - break; - } - } - return node; -} - -void GraphWidget::compute() -{ - myNbFinishedThreads = 0; - - TFunction_Iterator fIterator(myDocument->Main()); - fIterator.SetUsageOfExecutionStatus(true); - - myThread1 = new FThread(); - if (myNbThreads > 1) - myThread2 = new FThread(); - if (myNbThreads > 2) - myThread3 = new FThread(); - if (myNbThreads > 3) - myThread4 = new FThread(); - - // Logbook - Handle(TFunction_Logbook) log = TFunction_Scope::Set(myDocument->Main())->GetLogbook(); - myThread1->setLogbook(log); - if (myNbThreads > 1) - myThread2->setLogbook(log); - if (myNbThreads > 2) - myThread3->setLogbook(log); - if (myNbThreads > 3) - myThread4->setLogbook(log); - - myThread1->setIterator(fIterator); - if (myNbThreads > 1) - myThread2->setIterator(fIterator); - if (myNbThreads > 2) - myThread3->setIterator(fIterator); - if (myNbThreads > 3) - myThread4->setIterator(fIterator); - - myThread1->setGraph(this); - if (myNbThreads > 1) - myThread2->setGraph(this); - if (myNbThreads > 2) - myThread3->setGraph(this); - if (myNbThreads > 3) - myThread4->setGraph(this); - - myThread1->setThreadIndex(1); - if (myNbThreads > 1) - myThread2->setThreadIndex(2); - if (myNbThreads > 2) - myThread3->setThreadIndex(3); - if (myNbThreads > 3) - myThread4->setThreadIndex(4); - - myThread1->setMutex(&myMutex); - if (myNbThreads > 1) - myThread2->setMutex(&myMutex); - if (myNbThreads > 2) - myThread3->setMutex(&myMutex); - if (myNbThreads > 3) - myThread4->setMutex(&myMutex); - - QThread::Priority priority = QThread::LowestPriority; - if (!myThread1->isRunning()) - myThread1->start(priority); - if (myNbThreads > 1 && !myThread2->isRunning()) - myThread2->start(priority); - if (myNbThreads > 2 && !myThread3->isRunning()) - myThread3->start(priority); - if (myNbThreads > 3 && !myThread4->isRunning()) - myThread4->start(priority); -} - -void GraphWidget::setNbThreads(const int nb) -{ - myNbThreads = nb; - if (myNbThreads < 4 && myThread4) - { - myThread4->wait(); - myThread4->deleteLater(); - myThread4 = 0; - } - if (myNbThreads < 3 && myThread3) - { - myThread3->wait(); - myThread3->deleteLater(); - myThread3 = 0; - } - if (myNbThreads < 2 && myThread2) - { - myThread2->wait(); - myThread2->deleteLater(); - myThread2 = 0; - } - - for (int i = 1; i <= myNbThreads; i++) - { - TFunction_DriverTable::Get()->AddDriver(PointDriver::GetID(), new PointDriver(), i); - TFunction_DriverTable::Get()->AddDriver(CircleDriver::GetID(), new CircleDriver(), i); - TFunction_DriverTable::Get()->AddDriver(PrismDriver::GetID(), new PrismDriver(), i); - TFunction_DriverTable::Get()->AddDriver(ConeDriver::GetID(), new ConeDriver(), i); - TFunction_DriverTable::Get()->AddDriver(CylinderDriver::GetID(), new CylinderDriver(), i); - TFunction_DriverTable::Get()->AddDriver(ShapeSaverDriver::GetID(), new ShapeSaverDriver(), i); - TFunction_DriverTable::Get()->AddDriver(SimpleDriver::GetID(), new SimpleDriver(), i); - } -} - -int GraphWidget::getNbThreads() -{ - return myNbThreads; -} - -void GraphWidget::setFinished() -{ - myNbFinishedThreads++; -} - -bool GraphWidget::isFinished() -{ - return myNbThreads == myNbFinishedThreads ; -} - -void GraphWidget::accelerateThread(const int thread_index) -{ - bool all_slow = true; - if (myThread1 && myThread1->priority() != QThread::LowPriority) - all_slow = false; - if (all_slow && myThread2 && myThread2->priority() != QThread::LowPriority) - all_slow = false; - if (all_slow && myThread3 && myThread3->priority() != QThread::LowPriority) - all_slow = false; - if (all_slow && myThread4 && myThread4->priority() != QThread::LowPriority) - all_slow = false; - if (!all_slow) - return; - - QThread::Priority priority = QThread::NormalPriority; - switch (thread_index) - { - case 1: - myThread1->setPriority(priority); - break; - case 2: - myThread2->setPriority(priority); - break; - case 3: - myThread3->setPriority(priority); - break; - case 4: - myThread4->setPriority(priority); - break; - } -} - -void GraphWidget::slowDownThread(const int thread_index) -{ - QThread::Priority priority = QThread::LowPriority; - switch (thread_index) - { - case 1: - myThread1->setPriority(priority); - break; - case 2: - myThread2->setPriority(priority); - break; - case 3: - myThread3->setPriority(priority); - break; - case 4: - myThread4->setPriority(priority); - break; - } -} diff --git a/samples/qt/FuncDemo/src/graphwidget.h b/samples/qt/FuncDemo/src/graphwidget.h deleted file mode 100644 index 7459b337fd..0000000000 --- a/samples/qt/FuncDemo/src/graphwidget.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GRAPHWIDGET_H -#define GRAPHWIDGET_H - -#include -#include -#include - -#include "FThread.h" - -#include -#include - -class Node; - -//! [0] -class GraphWidget : public QGraphicsView -{ - Q_OBJECT - -public: - GraphWidget(QWidget *parent = 0); - ~GraphWidget(); - - void itemMoved(); - - bool createModel(const Handle(TDocStd_Document)& doc); - Handle(TDocStd_Document) getDocument() { return myDocument; } - - Node* findNode(const TDF_Label& ); - void setNbThreads(const int nb); - int getNbThreads(); - void accelerateThread(const int thread_index); - void slowDownThread(const int thread_index); - void compute(); - - void setFinished(); - bool isFinished(); - -public slots: - void shuffle(); - void zoomIn(); - void zoomOut(); - -protected: - void keyPressEvent(QKeyEvent *event); - void timerEvent(QTimerEvent *event); - void wheelEvent(QWheelEvent *event); - void drawBackground(QPainter *painter, const QRectF &rect); - - void scaleView(qreal scaleFactor); - -private: - int timerId; - Node *centerNode; - -private: - Standard_Mutex myMutex; - Handle(TDocStd_Document) myDocument; - int myNbThreads; - FThread* myThread1; - FThread* myThread2; - FThread* myThread3; - FThread* myThread4; - int myNbFinishedThreads; -}; -//! [0] - -#endif diff --git a/samples/qt/FuncDemo/src/main.cpp b/samples/qt/FuncDemo/src/main.cpp deleted file mode 100644 index 4fad9cf43f..0000000000 --- a/samples/qt/FuncDemo/src/main.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include "mainwindow.h" - -#include - -int main(int argc, char *argv[]) -{ -#if QT_VERSION > 0x050000 - TCollection_AsciiString aPlugindsDirName = OSD_Environment ("QTDIR").Value(); - if (!aPlugindsDirName.IsEmpty()) - QApplication::addLibraryPath (QString (aPlugindsDirName.ToCString()) + "/plugins"); -#endif - QApplication app(argc, argv); - MainWindow mainWin; - mainWin.show(); - return app.exec(); -} diff --git a/samples/qt/FuncDemo/src/mainwindow.cpp b/samples/qt/FuncDemo/src/mainwindow.cpp deleted file mode 100644 index c86003ad8e..0000000000 --- a/samples/qt/FuncDemo/src/mainwindow.cpp +++ /dev/null @@ -1,737 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "graphwidget.h" -#include "node.h" -#include "edge.h" - -#include "SimpleDriver.h" -#include "PointDriver.h" -#include "CircleDriver.h" -#include "PrismDriver.h" -#include "ConeDriver.h" -#include "CylinderDriver.h" -#include "ShapeSaverDriver.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) -#include -#endif -#include - -#ifdef __GNUC__ -#include -#endif - -#ifdef HAVE_Inspector -#include -static TInspector_Communicator* MyTCommunicator; -#endif - -MainWindow::MainWindow() -{ - graph = new GraphWidget(this); - setCentralWidget(graph); - - createActions(); - createMenus(); - createToolBars(); - createStatusBar(); - - // Create a new document - createDefaultModel1(); - graph->setNbThreads(4); -} - -Handle(AppStd_Application) MainWindow::getApplication() -{ - if (gApplication.IsNull()) - gApplication = new AppStd_Application(); - return gApplication; -} - -void MainWindow::closeEvent(QCloseEvent *event) -{ - event->accept(); -} - -void MainWindow::model1() -{ - // Clean the view - if (!graph->getDocument().IsNull()) - { - QList items = graph->scene()->items(); - for (int i = 0; i < items.size(); i++) - { - QGraphicsItem* item = items.at(i); - graph->scene()->removeItem(item); - } - - // Close the document - getApplication()->Close(graph->getDocument()); - } - - // Create a new document - createDefaultModel1(); -} - -void MainWindow::model2() -{ - // Clean the view - if (!graph->getDocument().IsNull()) - { - QList items = graph->scene()->items(); - for (int i = 0; i < items.size(); i++) - { - QGraphicsItem* item = items.at(i); - graph->scene()->removeItem(item); - } - - // Close the document - getApplication()->Close(graph->getDocument()); - } - - // Create a new document - createDefaultModel2(); -} - -static void prepareFunctions(GraphWidget* graph) -{ - if (!graph->getDocument().IsNull()) - { - TDF_Label L = graph->getDocument()->Main().Root(); - TDF_ChildIterator itr(L, true); - for (; itr.More(); itr.Next()) - { - Handle(TFunction_GraphNode) G; - if (itr.Value().FindAttribute(TFunction_GraphNode::GetID(), G)) - { - G->SetStatus(TFunction_ES_NotExecuted); - } - } - } -} - -// Redraw the nodes (change their colour). -void MainWindow::redrawGraph() -{ - QList items = graph->scene()->items(); - for (int i = 0; i < items.size(); i++) - { - QGraphicsItem* item = items.at(i); - item->update(); - } -} - -void MainWindow::compute() -{ - OSD_Timer aTimer; - double seconds, CPUTime; - int hours, minutes; - aTimer.Start(); - - int i = 0, nb = 1; // number of repetitions (for test-purpose). - - // Run computation - while (i++ < nb) - { - prepareFunctions(graph); - graph->compute(); - - while (!graph->isFinished()) - { - // Redraw the nodes (change their colour). - redrawGraph(); - - // Process user-events. - qApp->processEvents(); - #ifdef __GNUC__ - sleep(0.001); - #else - ::Sleep(100); - #endif - } - } - - aTimer.Show(seconds, minutes, hours, CPUTime); - std::cout << "Execution of "<getNbThreads()<< " threads took " << hours << " hours, " << minutes << " minutes, " << seconds << " seconds" << std::endl; - - // Redraw the nodes (change their colour). - redrawGraph(); -} - -void MainWindow::nbThreads() -{ - bool ok; - int nb = QInputDialog::getInt(this, tr("Number of threads"), tr("(1 - 4): "), - graph->getNbThreads(), 1, 4, 1, &ok); - if (ok) - graph->setNbThreads(nb); -} - -#ifdef HAVE_Inspector -void MainWindow::startDFBrowser() -{ - Handle(AppStd_Application) anApplication = getApplication(); - if (!anApplication.IsNull()) - { - if (!MyTCommunicator) - { - MyTCommunicator = new TInspector_Communicator(); - - NCollection_List aParameters; - aParameters.Append(anApplication); - - MyTCommunicator->RegisterPlugin("TKDFBrowser"); - - MyTCommunicator->Init(aParameters); - MyTCommunicator->Activate("TKDFBrowser"); - - } - MyTCommunicator->SetVisible(true); - } -} -#endif - -void MainWindow::about() -{ - QMessageBox::about(this, tr("Test-application of the advanced Function Mechanism"), - tr("The Application runs different models " - "in single and multi-threaded modes. " - "It shows graphically the result of computation.")); -} - -void MainWindow::createActions() -{ - model1Act = new QAction(QIcon("images/open.png"), tr("Model 1"), this); - model1Act->setStatusTip(tr("Model 1")); - connect(model1Act, SIGNAL(triggered()), this, SLOT(model1())); - - model2Act = new QAction(QIcon("images/open.png"), tr("Model 2"), this); - model2Act->setStatusTip(tr("Model 2")); - connect(model2Act, SIGNAL(triggered()), this, SLOT(model2())); - - computeAct = new QAction(QIcon("images/new.png"), tr("Compute"), this); - computeAct->setStatusTip(tr("Compute")); - connect(computeAct, SIGNAL(triggered()), this, SLOT(compute())); - - nbThreadsAct = new QAction(tr("Number of threads"), this); - nbThreadsAct->setStatusTip(tr("Number of threads")); - connect(nbThreadsAct, SIGNAL(triggered()), this, SLOT(nbThreads())); - -#ifdef HAVE_Inspector - dfBrowserAct = new QAction(tr("DFBrowser"), this); - dfBrowserAct->setStatusTip(tr("OCAF structure presentation")); - connect(dfBrowserAct, SIGNAL(triggered()), this, SLOT(startDFBrowser())); -#endif - - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcut(tr("Ctrl+Q")); - exitAct->setStatusTip(tr("Exit the application")); - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); - - aboutAct = new QAction(tr("&About"), this); - aboutAct->setStatusTip(tr("Show the application's About box")); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); -} - -void MainWindow::createMenus() -{ - computeMenu = menuBar()->addMenu(tr("&Model")); - computeMenu->addAction(model1Act); - computeMenu->addAction(model2Act); - computeMenu->addSeparator(); - computeMenu->addAction(computeAct); - computeMenu->addAction(nbThreadsAct); - computeMenu->addSeparator(); -#ifdef HAVE_Inspector - computeMenu->addAction(dfBrowserAct); - computeMenu->addSeparator(); -#endif - computeMenu->addAction(exitAct); - - menuBar()->addSeparator(); - - helpMenu = menuBar()->addMenu(tr("&Help")); - helpMenu->addAction(aboutAct); -} - -void MainWindow::createToolBars() -{ - computeToolBar = addToolBar(tr("Model")); - computeToolBar->addAction(model1Act); - computeToolBar->addAction(model2Act); - computeToolBar->addAction(computeAct); -} - -void MainWindow::createStatusBar() -{ - statusBar()->showMessage(tr("Ready")); -} - -void MainWindow::createDefaultModel1() -{ - Handle(AppStd_Application) app = MainWindow::getApplication(); - Handle(TDocStd_Document) doc; - app->NewDocument("XmlOcaf", doc); - TDF_Label mainLabel = doc->Main(); - mainLabel.ForgetAllAttributes(true); - - // Initialize function drivers - TFunction_DriverTable::Get()->AddDriver(SimpleDriver::GetID(), new SimpleDriver()); - - // Set a logbook. - Handle(TFunction_Logbook) logbook = TFunction_Logbook::Set(mainLabel); - - // Create a tree of functions - TDF_Label L1 = mainLabel.FindChild(1); - TDF_Label L2 = mainLabel.FindChild(2); - TDF_Label L3 = mainLabel.FindChild(3); - TDF_Label L4 = mainLabel.FindChild(4); - TDF_Label L5 = mainLabel.FindChild(5); - TDF_Label L6 = mainLabel.FindChild(6); - TDF_Label L7 = mainLabel.FindChild(7); - double time = 2; - // 1: - TFunction_IFunction::NewFunction(L1, SimpleDriver::GetID()); - TDataStd_Name::Set(L1, "1"); - TDataStd_Real::Set(L1, time); // Argument - TDF_Reference::Set(L1.FindChild(2).FindChild(1), L1); // Result - TFunction_IFunction iFunc1(L1); - iFunc1.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - // 2: - TFunction_IFunction::NewFunction(L2, SimpleDriver::GetID()); - TDataStd_Name::Set(L2, "2"); - TDataStd_Real::Set(L2, time); // Argument - TDF_Reference::Set(L2.FindChild(2).FindChild(1), L2); // Result - TFunction_IFunction iFunc2(L2); - iFunc2.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - // 3: - TFunction_IFunction::NewFunction(L3, SimpleDriver::GetID()); - TDataStd_Name::Set(L3, "3"); - TDataStd_Real::Set(L3, time); // Argument - TDF_Reference::Set(L3.FindChild(1).FindChild(1), L1); // Argument: F3 -> F1 - TDF_Reference::Set(L3.FindChild(2).FindChild(1), L3); // Result - TFunction_IFunction iFunc3(L3); - iFunc3.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - // 4: - TFunction_IFunction::NewFunction(L4, SimpleDriver::GetID()); - TDataStd_Name::Set(L4, "4"); - TDataStd_Real::Set(L4, time); // Argument - TDF_Reference::Set(L4.FindChild(1).FindChild(1), L2); // Argument F4 -> F2 - TDF_Reference::Set(L4.FindChild(1).FindChild(2), L3); // Argument F4 -> F3 - TDF_Reference::Set(L4.FindChild(2).FindChild(1), L4); // Result - TFunction_IFunction iFunc4(L4); - iFunc4.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - // 5: - TFunction_IFunction::NewFunction(L5, SimpleDriver::GetID()); - TDataStd_Name::Set(L5, "5"); - TDataStd_Real::Set(L5, time); // Argument - TDF_Reference::Set(L5.FindChild(1).FindChild(1), L4); // Argument F5 -> F4 - TDF_Reference::Set(L5.FindChild(2).FindChild(1), L5); // Result - TFunction_IFunction iFunc5(L5); - iFunc5.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - // 6: - TFunction_IFunction::NewFunction(L6, SimpleDriver::GetID()); - TDataStd_Name::Set(L6, "6"); - TDataStd_Real::Set(L6, time); // Argument - TDF_Reference::Set(L6.FindChild(1).FindChild(1), L4); // Argument F6 ->F4 - TDF_Reference::Set(L6.FindChild(2).FindChild(1), L6); // Result - TFunction_IFunction iFunc6(L6); - iFunc6.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - // 7: - TFunction_IFunction::NewFunction(L7, SimpleDriver::GetID()); - TDataStd_Name::Set(L7, "7"); - TDataStd_Real::Set(L7, time); // Argument - TDF_Reference::Set(L7.FindChild(1).FindChild(1), L4); // Argument F7 -> F4 - TDF_Reference::Set(L7.FindChild(2).FindChild(1), L7); // Result - TFunction_IFunction iFunc7(L7); - iFunc7.GetGraphNode()->SetStatus(TFunction_ES_NotExecuted); - - // Construct the dependencies between functions. - TFunction_IFunction::UpdateDependencies(mainLabel); - - // Set the functions 1 and 2 modified - iFunc1.GetLogbook()->SetTouched(L1); - iFunc2.GetLogbook()->SetTouched(L2); - - // Draw the model - graph->createModel(doc); -} - -void MainWindow::createDefaultModel2() -{ - Handle(AppStd_Application) app = MainWindow::getApplication(); - Handle(TDocStd_Document) doc; - app->NewDocument("BinOcaf", doc); - TDF_Label mainLabel = doc->Main(); - mainLabel.ForgetAllAttributes(true); - - // Initialize function drivers - TFunction_DriverTable::Get()->AddDriver(PointDriver::GetID(), new PointDriver()); - TFunction_DriverTable::Get()->AddDriver(CircleDriver::GetID(), new CircleDriver()); - TFunction_DriverTable::Get()->AddDriver(PrismDriver::GetID(), new PrismDriver()); - TFunction_DriverTable::Get()->AddDriver(ConeDriver::GetID(), new ConeDriver()); - TFunction_DriverTable::Get()->AddDriver(CylinderDriver::GetID(), new CylinderDriver()); - TFunction_DriverTable::Get()->AddDriver(ShapeSaverDriver::GetID(), new ShapeSaverDriver()); - - // Create a tree of functions - TDF_Label Lpoint1 = mainLabel.FindChild(1); - TDF_Label Lpoint2 = mainLabel.FindChild(2); - TDF_Label Lpoint3 = mainLabel.FindChild(3); - TDF_Label Lpoint4 = mainLabel.FindChild(4); - TDF_Label Lcircle1 = mainLabel.FindChild(5); - TDF_Label Lcircle2 = mainLabel.FindChild(6); - TDF_Label Lcircle3 = mainLabel.FindChild(7); - TDF_Label Lcircle4 = mainLabel.FindChild(8); - TDF_Label Lprism1 = mainLabel.FindChild(9); - TDF_Label Lprism2 = mainLabel.FindChild(10); - TDF_Label Lprism3 = mainLabel.FindChild(11); - TDF_Label Lprism4 = mainLabel.FindChild(12); - TDF_Label Lcone1 = mainLabel.FindChild(13); - TDF_Label Lcyl1 = mainLabel.FindChild(14); - TDF_Label Lcyl2 = mainLabel.FindChild(15); - TDF_Label Lcyl3 = mainLabel.FindChild(16); - TDF_Label Lcyl4 = mainLabel.FindChild(17); - TDF_Label Lcyl5 = mainLabel.FindChild(18); - TDF_Label Lcyl6 = mainLabel.FindChild(19); - TDF_Label Lcyl7 = mainLabel.FindChild(20); - TDF_Label Lcyl8 = mainLabel.FindChild(21); - TDF_Label Lcone2 = mainLabel.FindChild(22); - TDF_Label Lshape1 = mainLabel.FindChild(23); - - // Set a logbook. - Handle(TFunction_Logbook) logbook = TFunction_Logbook::Set(mainLabel); - - // Points: - // Point 1: - TFunction_IFunction::NewFunction(Lpoint1, PointDriver::GetID()); - TDataStd_Name::Set(Lpoint1, "P1"); - Handle(TDataStd_RealArray) arr1 = TDataStd_RealArray::Set(Lpoint1, 1, 3); - arr1->SetValue(1, -50); - arr1->SetValue(2, -50); - arr1->SetValue(3, 0); - TDF_Reference::Set(Lpoint1.FindChild(1).FindChild(1), Lpoint1); // Argument - TDF_Reference::Set(Lpoint1.FindChild(2).FindChild(1), Lpoint1); // Result - TFunction_IFunction iFuncPoint1(Lpoint1); - iFuncPoint1.SetStatus(TFunction_ES_NotExecuted); - // Point 2: - TFunction_IFunction::NewFunction(Lpoint2, PointDriver::GetID()); - TDataStd_Name::Set(Lpoint2, "P2"); - Handle(TDataStd_RealArray) arr2 = TDataStd_RealArray::Set(Lpoint2, 1, 3); - arr2->SetValue(1, 50); - arr2->SetValue(2, -50); - arr2->SetValue(3, 0); - TDF_Reference::Set(Lpoint2.FindChild(1).FindChild(1), Lpoint2); // Argument - TDF_Reference::Set(Lpoint2.FindChild(2).FindChild(1), Lpoint2); // Result - TFunction_IFunction iFuncPoint2(Lpoint2); - iFuncPoint2.SetStatus(TFunction_ES_NotExecuted); - // Point 3: - TFunction_IFunction::NewFunction(Lpoint3, PointDriver::GetID()); - TDataStd_Name::Set(Lpoint3, "P3"); - Handle(TDataStd_RealArray) arr3 = TDataStd_RealArray::Set(Lpoint3, 1, 3); - arr3->SetValue(1, 50); - arr3->SetValue(2, 50); - arr3->SetValue(3, 0); - TDF_Reference::Set(Lpoint3.FindChild(1).FindChild(1), Lpoint3); // Argument - TDF_Reference::Set(Lpoint3.FindChild(2).FindChild(1), Lpoint3); // Result - TFunction_IFunction iFuncPoint3(Lpoint3); - iFuncPoint3.SetStatus(TFunction_ES_NotExecuted); - // Point 4: - TFunction_IFunction::NewFunction(Lpoint4, PointDriver::GetID()); - TDataStd_Name::Set(Lpoint4, "P4"); - Handle(TDataStd_RealArray) arr4 = TDataStd_RealArray::Set(Lpoint4, 1, 3); - arr4->SetValue(1, -50); - arr4->SetValue(2, 50); - arr4->SetValue(3, 0); - TDF_Reference::Set(Lpoint4.FindChild(1).FindChild(1), Lpoint4); // Argument - TDF_Reference::Set(Lpoint4.FindChild(2).FindChild(1), Lpoint4); // Result - TFunction_IFunction iFuncPoint4(Lpoint4); - iFuncPoint4.SetStatus(TFunction_ES_NotExecuted); - // Circles: - // Circle 1: - TFunction_IFunction::NewFunction(Lcircle1, CircleDriver::GetID()); - TDataStd_Name::Set(Lcircle1, "C1"); - TDataStd_Real::Set(Lcircle1, 10); - TDF_Reference::Set(Lcircle1.FindChild(1).FindChild(1), Lpoint1); // Argument: point - TDF_Reference::Set(Lcircle1.FindChild(2).FindChild(1), Lcircle1); // Result - TFunction_IFunction iFuncCircle1(Lcircle1); - iFuncCircle1.SetStatus(TFunction_ES_NotExecuted); - // Circle 2: - TFunction_IFunction::NewFunction(Lcircle2, CircleDriver::GetID()); - TDataStd_Name::Set(Lcircle2, "C2"); - TDataStd_Real::Set(Lcircle2, 20); - TDF_Reference::Set(Lcircle2.FindChild(1).FindChild(1), Lpoint2); // Argument: point - TDF_Reference::Set(Lcircle2.FindChild(2).FindChild(1), Lcircle2); // Result - TFunction_IFunction iFuncCircle2(Lcircle2); - iFuncCircle2.SetStatus(TFunction_ES_NotExecuted); - // Circle 3: - TFunction_IFunction::NewFunction(Lcircle3, CircleDriver::GetID()); - TDataStd_Name::Set(Lcircle3, "C3"); - TDataStd_Real::Set(Lcircle3, 30); - TDF_Reference::Set(Lcircle3.FindChild(1).FindChild(1), Lpoint3); // Argument: point - TDF_Reference::Set(Lcircle3.FindChild(2).FindChild(1), Lcircle3); // Result - TFunction_IFunction iFuncCircle3(Lcircle3); - iFuncCircle3.SetStatus(TFunction_ES_NotExecuted); - // Circle 4: - TFunction_IFunction::NewFunction(Lcircle4, CircleDriver::GetID()); - TDataStd_Name::Set(Lcircle4, "C4"); - TDataStd_Real::Set(Lcircle4, 40); - TDF_Reference::Set(Lcircle4.FindChild(1).FindChild(1), Lpoint4); // Argument: point - TDF_Reference::Set(Lcircle4.FindChild(2).FindChild(1), Lcircle4); // Result - TFunction_IFunction iFuncCircle4(Lcircle4); - iFuncCircle4.SetStatus(TFunction_ES_NotExecuted); - // Prisms: - // Prism 1: - TFunction_IFunction::NewFunction(Lprism1, PrismDriver::GetID()); - TDataStd_Name::Set(Lprism1, "Pr1"); - TDataStd_Real::Set(Lprism1, 30); - TDF_Reference::Set(Lprism1.FindChild(1).FindChild(1), Lcircle1); // Argument: point - TDF_Reference::Set(Lprism1.FindChild(2).FindChild(1), Lprism1); // Result - TDF_Reference::Set(Lprism1.FindChild(2).FindChild(2), Lprism1.FindChild(3)); // Result (top) - TFunction_IFunction iFuncPrism1(Lprism1); - iFuncPrism1.SetStatus(TFunction_ES_NotExecuted); - // Prism 2: - TFunction_IFunction::NewFunction(Lprism2, PrismDriver::GetID()); - TDataStd_Name::Set(Lprism2, "Pr2"); - TDataStd_Real::Set(Lprism2, 30); - TDF_Reference::Set(Lprism2.FindChild(1).FindChild(1), Lcircle2); // Argument: point - TDF_Reference::Set(Lprism2.FindChild(2).FindChild(1), Lprism2); // Result - TDF_Reference::Set(Lprism2.FindChild(2).FindChild(2), Lprism2.FindChild(3)); // Result (top) - TFunction_IFunction iFuncPrism2(Lprism2); - iFuncPrism2.SetStatus(TFunction_ES_NotExecuted); - // Prism 3: - TFunction_IFunction::NewFunction(Lprism3, PrismDriver::GetID()); - TDataStd_Name::Set(Lprism3, "Pr3"); - TDataStd_Real::Set(Lprism3, 30); - TDF_Reference::Set(Lprism3.FindChild(1).FindChild(1), Lcircle3); // Argument: point - TDF_Reference::Set(Lprism3.FindChild(2).FindChild(1), Lprism3); // Result - TDF_Reference::Set(Lprism3.FindChild(2).FindChild(2), Lprism3.FindChild(3)); // Result (top) - TFunction_IFunction iFuncPrism3(Lprism3); - iFuncPrism3.SetStatus(TFunction_ES_NotExecuted); - // Prism 4: - TFunction_IFunction::NewFunction(Lprism4, PrismDriver::GetID()); - TDataStd_Name::Set(Lprism4, "Pr4"); - TDataStd_Real::Set(Lprism4, 30); - TDF_Reference::Set(Lprism4.FindChild(1).FindChild(1), Lcircle4); // Argument: point - TDF_Reference::Set(Lprism4.FindChild(2).FindChild(1), Lprism4); // Result - TDF_Reference::Set(Lprism4.FindChild(2).FindChild(2), Lprism4.FindChild(3)); // Result (top) - TFunction_IFunction iFuncPrism4(Lprism4); - iFuncPrism4.SetStatus(TFunction_ES_NotExecuted); - // Cone 1: - TFunction_IFunction::NewFunction(Lcone1, ConeDriver::GetID()); - TDataStd_Name::Set(Lcone1, "Co1"); - TDataStd_Real::Set(Lcone1, 20); - TDF_Reference::Set(Lcone1.FindChild(1).FindChild(1), Lprism1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone1.FindChild(1).FindChild(2), Lprism2.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone1.FindChild(1).FindChild(3), Lprism3.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone1.FindChild(1).FindChild(4), Lprism4.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone1.FindChild(2).FindChild(1), Lcone1); // Result - TDF_Reference::Set(Lcone1.FindChild(2).FindChild(2), Lcone1.FindChild(3)); // Result - TFunction_IFunction iFuncCone1(Lcone1); - iFuncCone1.SetStatus(TFunction_ES_NotExecuted); - // Cylinders: - // Cylinder 1: - TFunction_IFunction::NewFunction(Lcyl1, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl1, "Cyl1"); - Handle(TDataStd_RealArray) carr1 = TDataStd_RealArray::Set(Lcyl1, 1, 3); - carr1->SetValue(1, 10.0); - carr1->SetValue(2, 45.0); - carr1->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl1.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl1.FindChild(2).FindChild(1), Lcyl1); // Result - TDF_Reference::Set(Lcyl1.FindChild(2).FindChild(2), Lcyl1.FindChild(3)); // Result - TFunction_IFunction iFuncCyl1(Lcyl1); - iFuncCyl1.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 2: - TFunction_IFunction::NewFunction(Lcyl2, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl2, "Cyl2"); - Handle(TDataStd_RealArray) carr2 = TDataStd_RealArray::Set(Lcyl2, 1, 3); - carr2->SetValue(1, 10.0); - carr2->SetValue(2, 90.0); - carr2->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl2.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl2.FindChild(2).FindChild(1), Lcyl2); // Result - TDF_Reference::Set(Lcyl2.FindChild(2).FindChild(2), Lcyl2.FindChild(3)); // Result - TFunction_IFunction iFuncCyl2(Lcyl2); - iFuncCyl2.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 3: - TFunction_IFunction::NewFunction(Lcyl3, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl3, "Cyl3"); - Handle(TDataStd_RealArray) carr3 = TDataStd_RealArray::Set(Lcyl3, 1, 3); - carr3->SetValue(1, 10.0); - carr3->SetValue(2, 135.0); - carr3->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl3.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl3.FindChild(2).FindChild(1), Lcyl3); // Result - TDF_Reference::Set(Lcyl3.FindChild(2).FindChild(2), Lcyl3.FindChild(3)); // Result - TFunction_IFunction iFuncCyl3(Lcyl3); - iFuncCyl3.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 4: - TFunction_IFunction::NewFunction(Lcyl4, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl4, "Cyl4"); - Handle(TDataStd_RealArray) carr4 = TDataStd_RealArray::Set(Lcyl4, 1, 3); - carr4->SetValue(1, 10.0); - carr4->SetValue(2, 180.0); - carr4->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl4.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl4.FindChild(2).FindChild(1), Lcyl4); // Result - TDF_Reference::Set(Lcyl4.FindChild(2).FindChild(2), Lcyl4.FindChild(3)); // Result - TFunction_IFunction iFuncCyl4(Lcyl4); - iFuncCyl4.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 5: - TFunction_IFunction::NewFunction(Lcyl5, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl5, "Cyl5"); - Handle(TDataStd_RealArray) carr5 = TDataStd_RealArray::Set(Lcyl5, 1, 3); - carr5->SetValue(1, 10.0); - carr5->SetValue(2, 225.0); - carr5->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl5.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl5.FindChild(2).FindChild(1), Lcyl5); // Result - TDF_Reference::Set(Lcyl5.FindChild(2).FindChild(2), Lcyl5.FindChild(3)); // Result - TFunction_IFunction iFuncCyl5(Lcyl5); - iFuncCyl5.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 6: - TFunction_IFunction::NewFunction(Lcyl6, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl6, "Cyl6"); - Handle(TDataStd_RealArray) carr6 = TDataStd_RealArray::Set(Lcyl6, 1, 3); - carr6->SetValue(1, 10.0); - carr6->SetValue(2, 270.0); - carr6->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl6.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl6.FindChild(2).FindChild(1), Lcyl6); // Result - TDF_Reference::Set(Lcyl6.FindChild(2).FindChild(2), Lcyl6.FindChild(3)); // Result - TFunction_IFunction iFuncCyl6(Lcyl6); - iFuncCyl6.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 7: - TFunction_IFunction::NewFunction(Lcyl7, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl7, "Cyl7"); - Handle(TDataStd_RealArray) carr7 = TDataStd_RealArray::Set(Lcyl7, 1, 3); - carr7->SetValue(1, 10.0); - carr7->SetValue(2, 315.0); - carr7->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl7.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl7.FindChild(2).FindChild(1), Lcyl7); // Result - TDF_Reference::Set(Lcyl7.FindChild(2).FindChild(2), Lcyl7.FindChild(3)); // Result - TFunction_IFunction iFuncCyl7(Lcyl7); - iFuncCyl7.SetStatus(TFunction_ES_NotExecuted); - // Cylinder 8: - TFunction_IFunction::NewFunction(Lcyl8, CylinderDriver::GetID()); - TDataStd_Name::Set(Lcyl8, "Cyl8"); - Handle(TDataStd_RealArray) carr8 = TDataStd_RealArray::Set(Lcyl8, 1, 3); - carr8->SetValue(1, 10.0); - carr8->SetValue(2, 0.0); - carr8->SetValue(3, 20.0); - TDF_Reference::Set(Lcyl8.FindChild(1).FindChild(1), Lcone1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcyl8.FindChild(2).FindChild(1), Lcyl8); // Result - TDF_Reference::Set(Lcyl8.FindChild(2).FindChild(2), Lcyl8.FindChild(3)); // Result - TFunction_IFunction iFuncCyl8(Lcyl8); - iFuncCyl8.SetStatus(TFunction_ES_NotExecuted); - // Cone 2: - TFunction_IFunction::NewFunction(Lcone2, ConeDriver::GetID()); - TDataStd_Name::Set(Lcone2, "Co2"); - TDataStd_Real::Set(Lcone2, 30); - TDF_Reference::Set(Lcone2.FindChild(1).FindChild(1), Lcyl1.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone2.FindChild(1).FindChild(2), Lcyl3.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone2.FindChild(1).FindChild(3), Lcyl5.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone2.FindChild(1).FindChild(4), Lcyl7.FindChild(3)); // Argument: top - TDF_Reference::Set(Lcone2.FindChild(2).FindChild(1), Lcone2); // Result - TDF_Reference::Set(Lcone2.FindChild(2).FindChild(2), Lcone2.FindChild(3)); // Result - TFunction_IFunction iFuncCone2(Lcone2); - iFuncCone2.SetStatus(TFunction_ES_NotExecuted); - // Shape saver 1: - TFunction_IFunction::NewFunction(Lshape1, ShapeSaverDriver::GetID()); - TDataStd_Name::Set(Lshape1, "Sh"); - TFunction_IFunction iFuncShape1(Lshape1); - iFuncShape1.SetStatus(TFunction_ES_NotExecuted); - // Arguments of this functions - results of all functions - int iTag = 1; - const TFunction_DoubleMapOfIntegerLabel& all = iFuncShape1.GetAllFunctions(); - TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel itrm(all); - for (; itrm.More(); itrm.Next()) - { - TFunction_IFunction iFunc(itrm.Key2()); - TDF_LabelList res; - iFunc.Results(res); - TDF_ListIteratorOfLabelList itrl(res); - for (; itrl.More(); itrl.Next(), iTag++) - { - TDF_Reference::Set(Lshape1.FindChild(1).FindChild(iTag), itrl.Value()); - } - } - - // Construct the dependencies between functions. - TFunction_IFunction::UpdateDependencies(mainLabel); - - // Set the functions 1 .. 4 modified - TFunction_IFunction(mainLabel).GetLogbook()->SetTouched(Lpoint1); - TFunction_IFunction(mainLabel).GetLogbook()->SetTouched(Lpoint2); - TFunction_IFunction(mainLabel).GetLogbook()->SetTouched(Lpoint3); - TFunction_IFunction(mainLabel).GetLogbook()->SetTouched(Lpoint4); - - // Draw the model - graph->createModel(doc); - - //app->SaveAs(doc, "W:\\TestFM\\model2.cbf"); -} diff --git a/samples/qt/FuncDemo/src/mainwindow.h b/samples/qt/FuncDemo/src/mainwindow.h deleted file mode 100644 index 2bf4b88585..0000000000 --- a/samples/qt/FuncDemo/src/mainwindow.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include - -#include - -class QAction; -class QMenu; -class GraphWidget; - -static Handle(AppStd_Application) gApplication; - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - - static Handle(AppStd_Application) getApplication(); - -protected: - void closeEvent(QCloseEvent *event); - -private slots: - void model1(); - void model2(); - void compute(); - void nbThreads(); -#ifdef HAVE_Inspector - void startDFBrowser(); -#endif - void about(); - -private: - void createActions(); - void createMenus(); - void createToolBars(); - void createStatusBar(); - - GraphWidget* graph; - - QMenu *computeMenu; - QMenu *helpMenu; - QToolBar *computeToolBar; - QAction *model1Act; - QAction *model2Act; - QAction *computeAct; - QAction *nbThreadsAct; -#ifdef HAVE_Inspector - QAction *dfBrowserAct; -#endif - QAction *exitAct; - QAction *aboutAct; - - // Default models. - // The Model 1 consists of a set of simple functions - // of the same type. - // These functions have a double parameter: relative time of execution, and - // a "forced" parameter: another function. - // Actually, the functions are independent, - // but we "force" a dependency between them to test the Function Mechanism using simple functions. - // So, a function uses a double parameter and produces nothing. - // I use a TDF_Reference to refer from a function to another function. - // This way I define a dependency. - void createDefaultModel1(); - - // Another default model, topological. - void createDefaultModel2(); - - // Redraw the nodes (change their colour). - void redrawGraph(); -}; - -#endif diff --git a/samples/qt/FuncDemo/src/node.cpp b/samples/qt/FuncDemo/src/node.cpp deleted file mode 100644 index 5afd1f022f..0000000000 --- a/samples/qt/FuncDemo/src/node.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "edge.h" -#include "node.h" -#include "graphwidget.h" - -#include -#include -#include -#include - -//! [0] -Node::Node(GraphWidget *graphWidget) - : graph(graphWidget) -{ - setFlag(ItemIsMovable); - setFlag(ItemSendsGeometryChanges); - setCacheMode(DeviceCoordinateCache); - setZValue(-1); -} -//! [0] - -void Node::setFunction(const TDF_Label& func) -{ - myFunction = func; -} - -const TDF_Label& Node::getFunction() const -{ - return myFunction; -} - -//! [1] -void Node::addEdge(Edge *edge) -{ - edgeList << edge; - edge->adjust(); -} - -QList Node::edges() const -{ - return edgeList; -} -//! [1] - -//! [2] -void Node::calculateForces() -{ - if (!scene() || scene()->mouseGrabberItem() == this) { - newPos = pos(); - return; - } -//! [2] - -//! [3] - // Sum up all forces pushing this item away - qreal xvel = 0; - qreal yvel = 0; - foreach (QGraphicsItem *item, scene()->items()) { - Node *node = qgraphicsitem_cast(item); - if (!node) - continue; - - QPointF vec = mapToItem(node, 0, 0); - qreal dx = vec.x(); - qreal dy = vec.y(); - double l = 2.0 * (dx * dx + dy * dy); - if (l > 0) { - xvel += (dx * 150.0) / l; - yvel += (dy * 150.0) / l; - } - } -//! [3] - -//! [4] - // Now subtract all forces pulling items together - double weight = (edgeList.size() + 1) * 10; - foreach (Edge *edge, edgeList) { - QPointF vec; - if (edge->sourceNode() == this) - vec = mapToItem(edge->destNode(), 0, 0); - else - vec = mapToItem(edge->sourceNode(), 0, 0); - xvel -= vec.x() / weight; - yvel -= vec.y() / weight; - } -//! [4] - -//! [5] - if (qAbs(xvel) < 0.1 && qAbs(yvel) < 0.1) - xvel = yvel = 0; -//! [5] - -//! [6] - QRectF sceneRect = scene()->sceneRect(); - newPos = pos() + QPointF(xvel, yvel); - newPos.setX(qMin(qMax(newPos.x(), sceneRect.left() + 10), sceneRect.right() - 10)); - newPos.setY(qMin(qMax(newPos.y(), sceneRect.top() + 10), sceneRect.bottom() - 10)); -} -//! [6] - -//! [7] -bool Node::advance() -{ - if (newPos == pos()) - return false; - - setPos(newPos); - return true; -} -//! [7] - -//! [8] -QRectF Node::boundingRect() const -{ -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) - // Add some extra space around the circle for easier touching with finger - qreal adjust = 30; - return QRectF( -10 - adjust, -10 - adjust, - 20 + adjust * 2, 20 + adjust * 2); -#else - qreal adjust = 2; - return QRectF( -10 - adjust, -10 - adjust, - 23 + adjust, 23 + adjust); -#endif -} -//! [8] - -//! [9] -QPainterPath Node::shape() const -{ - QPainterPath path; -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) - // Add some extra space around the circle for easier touching with finger - path.addEllipse( -40, -40, 80, 80); -#else - path.addEllipse(-10, -10, 20, 20); -#endif - return path; -} -//! [9] - -//! [10] -void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) -{ - painter->setPen(Qt::NoPen); - painter->setBrush(Qt::darkGray); - painter->drawEllipse(-7, -7, 20, 20); - - QColor light_color(Qt::yellow); - TFunction_IFunction iFunc(myFunction); - Handle(TFunction_GraphNode) graphNode = iFunc.GetGraphNode(); - TFunction_ExecutionStatus status = graphNode->GetStatus(); - switch (status) - { - case TFunction_ES_WrongDefinition: - case TFunction_ES_Failed: - light_color = Qt::red; - break; - case TFunction_ES_NotExecuted: - light_color = Qt::green; - break; - case TFunction_ES_Executing: - light_color = Qt::yellow; - break; - case TFunction_ES_Succeeded: - light_color = Qt::blue; - break; - } - if (myFunction.IsAttribute(TDataStd_Tick::GetID())) - light_color = Qt::white; - QColor dark_color = light_color.dark(150); - - QRadialGradient gradient(-3, -3, 10); - if (option->state & QStyle::State_Sunken) { - gradient.setCenter(3, 3); - gradient.setFocalPoint(3, 3); - gradient.setColorAt(1, light_color.light(120)); - gradient.setColorAt(0, dark_color.light(120)); - } else { - gradient.setColorAt(0, light_color); - gradient.setColorAt(1, dark_color); - } - painter->setBrush(gradient); - - painter->setPen(QPen(Qt::black, 0)); - painter->drawEllipse(-10, -10, 20, 20); - - QString s; - Handle(TDataStd_Name) n; - if (myFunction.FindAttribute(TDataStd_Name::GetID(), n)) - s = TCollection_AsciiString(n->Get()).ToCString(); - painter->drawText(-7, 3, s); -} -//! [10] - -//! [11] -QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value) -{ - switch (change) { - case ItemPositionHasChanged: - foreach (Edge *edge, edgeList) - edge->adjust(); - //graph->itemMoved(); - break; - default: - break; - }; - - return QGraphicsItem::itemChange(change, value); -} -//! [11] - -//! [12] -void Node::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - update(); - QGraphicsItem::mousePressEvent(event); -} - -void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - update(); - QGraphicsItem::mouseReleaseEvent(event); -} -//! [12] diff --git a/samples/qt/FuncDemo/src/node.h b/samples/qt/FuncDemo/src/node.h deleted file mode 100644 index ab56201e6b..0000000000 --- a/samples/qt/FuncDemo/src/node.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef NODE_H -#define NODE_H - -#include -#include -#include -#include - -#include - -class Edge; -class GraphWidget; -QT_BEGIN_NAMESPACE -class QGraphicsSceneMouseEvent; -QT_END_NAMESPACE - -//! [0] -class Node : public QGraphicsItem -{ -public: - Node(GraphWidget *graphWidget); - - void setFunction(const TDF_Label& func); - const TDF_Label& getFunction() const; - - void addEdge(Edge *edge); - QList edges() const; - - enum { Type = UserType + 1 }; - int type() const { return Type; } - - void calculateForces(); - bool advance(); - - QRectF boundingRect() const; - QPainterPath shape() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - -protected: - QVariant itemChange(GraphicsItemChange change, const QVariant &value); - - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - -private: - QList edgeList; - QPointF newPos; - GraphWidget *graph; - TDF_Label myFunction; -}; -//! [0] - -#endif diff --git a/samples/qt/IESample/.gitignore b/samples/qt/IESample/.gitignore deleted file mode 100644 index 7ac6e6bc69..0000000000 --- a/samples/qt/IESample/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/debug -/release -*.sln -*.vcxproj* -.qmake.stash -/custom.bat -/custom.sh diff --git a/samples/qt/IESample/CMakeLists.txt b/samples/qt/IESample/CMakeLists.txt deleted file mode 100644 index 395352abcd..0000000000 --- a/samples/qt/IESample/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -project(IESample) - -# Sample configuration -set (EXECUTABLE_PROJECT ON) -set (USE_QT ON) -set (RELATIVE_DIR "samples/qt") -set (TARGET_FOLDER "Samples") - -include_directories("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/${RELATIVE_DIR}") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/Interface/src") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/Common/src") - -OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) - -# Target-specific definitions -target_compile_definitions(IESample PRIVATE -DNO_COMMONSAMPLE_EXPORTS -DNO_IESAMPLE_EXPORTS) - - diff --git a/samples/qt/IESample/EXTERNLIB.cmake b/samples/qt/IESample/EXTERNLIB.cmake deleted file mode 100644 index 6751415686..0000000000 --- a/samples/qt/IESample/EXTERNLIB.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# External dependencies for IESample sample -set(OCCT_IESample_EXTERNAL_LIBS - TKBRep - TKBool - TKBO - TKCDF - TKFillet - TKG2d - TKG3d - TKGeomAlgo - TKGeomBase - TKHLR - TKDEIGES - TKernel - TKMath - TKMesh - TKOffset - TKOpenGl - TKPrim - TKShHealing - TKService - TKDESTEP - TKDESTL - TKTopAlgo - TKV3d - TKDEVRML - TKXSBase -) \ No newline at end of file diff --git a/samples/qt/IESample/FILES.cmake b/samples/qt/IESample/FILES.cmake deleted file mode 100644 index fb6b460229..0000000000 --- a/samples/qt/IESample/FILES.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Source files for IESample sample -set(OCCT_IESample_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") - -set(OCCT_IESample_FILES - src/Main.cxx - ../Common/src/ApplicationCommon.cxx - ../Common/src/ApplicationCommon.h - ../Common/src/Common-icon.ts - ../Common/src/Common-string.ts - ../Common/src/CommonSample.h - ../Common/src/DocumentCommon.cxx - ../Common/src/DocumentCommon.h - ../Common/src/Material.cxx - ../Common/src/Material.h - ../Common/src/MDIWindow.cxx - ../Common/src/MDIWindow.h - ../Common/src/OcctWindow.cxx - ../Common/src/OcctWindow.h - ../Common/src/Transparency.cxx - ../Common/src/Transparency.h - ../Common/src/View.cxx - ../Common/src/View.h - ../Interface/src/Application.cxx - ../Interface/src/Application.h - ../Interface/src/IESample.h - ../Interface/src/Interface-string.ts - ../Interface/src/Translate.cxx - ../Interface/src/Translate.h -) \ No newline at end of file diff --git a/samples/qt/IESample/IESample.pro b/samples/qt/IESample/IESample.pro deleted file mode 100755 index fe619bb658..0000000000 --- a/samples/qt/IESample/IESample.pro +++ /dev/null @@ -1,113 +0,0 @@ -TEMPLATE = app -CONFIG += debug_and_release qt - -TARGET = IESample - -isEmpty(CSF_OCCTSamplesPath) { - SAMPLESROOT = $$PWD/.. -} else { - SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt) -} - -HEADERS = $${SAMPLESROOT}/Common/src/*.h \ - $${SAMPLESROOT}/Interface/src/*.h - -SOURCES = src/*.cxx \ - $${SAMPLESROOT}/Common/src/*.cxx \ - $${SAMPLESROOT}/Interface/src/*.cxx - -TS_FILES = $${SAMPLESROOT}/Common/src/Common-icon.ts \ - $${SAMPLESROOT}/Common/src/Common-string.ts \ - $${SAMPLESROOT}/Interface/src/Interface-string.ts - -RES_FILES = $${SAMPLESROOT}/Common/res/* - -RES_DIR = $$quote($$(RES_DIR)) - -INCLUDEPATH += $$quote($${SAMPLESROOT}/Common/src) -INCLUDEPATH += $$quote($${SAMPLESROOT}/Interface/src) -INCLUDEPATH += $$quote($$(CSF_OCCTIncludePath)) - -OCCT_DEFINES = $$(CSF_DEFINES) - -DEFINES = $$split(OCCT_DEFINES, ;) - -unix { - UNAME = $$system(uname -s) - LIBLIST = $$(LD_LIBRARY_PATH) - LIBPATHS = $$split(LIBLIST,":") - for(lib, LIBPATHS):LIBS += -L$${lib} - - CONFIG(debug, debug|release) { - DESTDIR = ./$$UNAME/bind - OBJECTS_DIR = ./$$UNAME/objd - MOC_DIR = ./$$UNAME/mocd - } else { - DESTDIR = ./$$UNAME/bin - OBJECTS_DIR = ./$$UNAME/obj - MOC_DIR = ./$$UNAME/moc - } - - MACOSX_USE_GLX = $$(MACOSX_USE_GLX) - - !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD - equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX - DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL - !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD - LIBS += -lfreeimageplus - LIBS += -ltbb -ltbbmalloc - QMAKE_CXXFLAGS += -std=c++17 -} - -win32 { - CONFIG(debug, debug|release) { - DEFINES += _DEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bind - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/objd - MOC_DIR = ./win$$(ARCH)/$$(VCVER)/mocd - } else { - DEFINES += NDEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bin - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj - MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc - } - QMAKE_CXXFLAGS += /std:c++17 - LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath) - DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS -} - -LIBS += -lTKernel -lTKMath -lTKService -lTKV3d -lTKOpenGl \ - -lTKBRep -lTKDEIGES -lTKDESTL -lTKDEVRML -lTKDESTEP \ - -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \ - -lTKXSBase -lTKShHealing -lTKHLR -lTKTopAlgo -lTKMesh -lTKPrim \ - -lTKCDF -lTKBool -lTKBO -lTKFillet -lTKOffset -lTKLCAF \ - -!exists($${RES_DIR}) { - win32 { - system(mkdir $${RES_DIR}) - } else { - system(mkdir -p $${RES_DIR}) - } -} - -lrelease.name = LRELEASE ${QMAKE_FILE_IN} -lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm -lrelease.output = ${QMAKE_FILE_BASE}.qm -lrelease.input = TS_FILES -lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm -lrelease.CONFIG += no_link target_predeps -QMAKE_EXTRA_COMPILERS += lrelease - -copy_res.name = Copy resource ${QMAKE_FILE_IN} -copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -copy_res.input = RES_FILES -copy_res.CONFIG += no_link target_predeps -win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR} -QMAKE_EXTRA_COMPILERS += copy_res -#QMAKE_CXXFLAGS += /wd4996 - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} diff --git a/samples/qt/IESample/IESample0.pro b/samples/qt/IESample/IESample0.pro deleted file mode 100644 index 6f3d05bc1c..0000000000 --- a/samples/qt/IESample/IESample0.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE=subdirs - -SUBDIRS=IESample0 - -IESample0.file=IESample.pro diff --git a/samples/qt/IESample/PACKAGES.cmake b/samples/qt/IESample/PACKAGES.cmake deleted file mode 100644 index 812f8bb892..0000000000 --- a/samples/qt/IESample/PACKAGES.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Packages for IESample sample -set(OCCT_IESample_LIST_OF_PACKAGES - IESample -) \ No newline at end of file diff --git a/samples/qt/IESample/ReadMe.md b/samples/qt/IESample/ReadMe.md deleted file mode 100644 index 214050fb4b..0000000000 --- a/samples/qt/IESample/ReadMe.md +++ /dev/null @@ -1,10 +0,0 @@ -Qt: Import/Export (C++|Qt Widgets) {#samples_qt_iesample} -========== - -OCCT includes several samples based on Qt application framework. -These samples are available on all supported desktop platforms. - -This Import Export programming sample contains 3D Viewer and Import / Export functionality. -The sample could be found within OCCT repository in folder `/samples/qt/IESample/`. - -@figure{samples_qt.png} diff --git a/samples/qt/IESample/custom.bat.template b/samples/qt/IESample/custom.bat.template deleted file mode 100644 index dda84faa21..0000000000 --- a/samples/qt/IESample/custom.bat.template +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -rem Rename this file to custom.bat, -rem and define QTDIR variable. - -set "QTDIR=" diff --git a/samples/qt/IESample/custom.sh.template b/samples/qt/IESample/custom.sh.template deleted file mode 100644 index 52571f097b..0000000000 --- a/samples/qt/IESample/custom.sh.template +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Rename this file to custom.sh, -# and define QTDIR variable. - -export QTDIR="" diff --git a/samples/qt/IESample/env.bat b/samples/qt/IESample/env.bat deleted file mode 100755 index 3e090cff49..0000000000 --- a/samples/qt/IESample/env.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off - -if exist "%~dp0custom.bat" ( - call "%~dp0custom.bat" %1 %2 %3 -) - -call "%~dp0..\..\..\env.bat" %1 %2 %3 - -set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res" -set "CSF_ResourcesDefaults=%RES_DIR%" -set "CSF_IEResourcesDefaults=%RES_DIR%" - -set "PATH=%QTDIR%/bin;%PATH%" diff --git a/samples/qt/IESample/env.sh b/samples/qt/IESample/env.sh deleted file mode 100755 index 66610d7150..0000000000 --- a/samples/qt/IESample/env.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "custom.sh" ]; then - source "custom.sh" $*; -fi - -if [ -e "${aSamplePath}/../../../env.sh" ]; then - source "${aSamplePath}/../../../env.sh" $*; -fi - -if [ "${QTDIR}" != "" ]; then - export PATH=${QTDIR}/bin:${PATH} -else - aQMakePath=`which qmake` - echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script." - if [ -x "$aQMakePath" ]; then - echo "qmake from PATH will be used instead." - else - exit 1 - fi -fi - -host=`uname -s` -export STATION=$host -export RES_DIR=${aSamplePath}/${STATION}/res diff --git a/samples/qt/IESample/genproj.bat b/samples/qt/IESample/genproj.bat deleted file mode 100644 index f53dcd2df3..0000000000 --- a/samples/qt/IESample/genproj.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -REM Generation of vcproj files with qmake utilite -REM Variable QTDIR and PATH to qmake executable must be defined without fail - -REM Use first argument to specify version of Visual Studio (vc10, vc11, vc12 or vc14), -REM second argument specifies architecture) (win32 or win64) -REM third argument specifies Debug or Release mode - -call "%~dp0env.bat" %1 %2 %3 - -call "%VCVARS%" %VCARCH% - -qmake -tp vc -r -o IESample.sln IESample0.pro diff --git a/samples/qt/IESample/images/samples_qt.png b/samples/qt/IESample/images/samples_qt.png deleted file mode 100644 index e4c688585c..0000000000 Binary files a/samples/qt/IESample/images/samples_qt.png and /dev/null differ diff --git a/samples/qt/IESample/make.sh b/samples/qt/IESample/make.sh deleted file mode 100755 index b6528143f2..0000000000 --- a/samples/qt/IESample/make.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath -qmake IESample.pro -if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then - aNbJobs="$(getconf _NPROCESSORS_ONLN)" - if [ "${CASDEB}" == "d" ]; then - make -j $aNbJobs debug - else - make -j $aNbJobs release - fi -fi diff --git a/samples/qt/IESample/msvc.bat b/samples/qt/IESample/msvc.bat deleted file mode 100644 index 467a900d72..0000000000 --- a/samples/qt/IESample/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0IESample.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/qt/IESample/run.bat b/samples/qt/IESample/run.bat deleted file mode 100644 index f28bcb89ea..0000000000 --- a/samples/qt/IESample/run.bat +++ /dev/null @@ -1,23 +0,0 @@ -Setlocal EnableDelayedExpansion - -call "%~dp0env.bat" %1 %2 %3 - -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" -) - -if not exist "%~dp0%BIN_DIR%\IESample.exe" goto ERR_EXE - -echo Starting IESample ..... -"%~dp0%BIN_DIR%\IESample.exe" - -goto END - -:ERR_EXE -echo Executable %~dp0%BIN_DIR%\IESample.exe not found. -echo Probably you didn't compile the application. -pause -goto END - -:END \ No newline at end of file diff --git a/samples/qt/IESample/run.sh b/samples/qt/IESample/run.sh deleted file mode 100755 index 29c300b166..0000000000 --- a/samples/qt/IESample/run.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath - -aSystem=`uname -s` -if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - if [ "${CASDEB}" == "d" ]; then - BIN_DIR="${aSamplePath}/build/Debug/IESample.app/Contents/MacOS" - else - BIN_DIR="${aSamplePath}/build/Release/IESample.app/Contents/MacOS" - fi -else - BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}" -fi - -CSF_ResourcesDefaults="${RES_DIR}" -CSF_IEResourcesDefaults="${RES_DIR}" - -PATH="${BIN_DIR}:${PATH}" - -export CSF_IEResourcesDefaults CSF_ResourcesDefaults -export PATH - -if test ! -r "${BIN_DIR}/IESample"; then - echo "Executable \"${BIN_DIR}/IESample\" not found." - if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - echo "Probably you don't compile the application. Build it with Xcode." - else - echo "Probably you don't compile the application. Execute \"make\"." - fi - exit 1 -fi - -${BIN_DIR}/IESample diff --git a/samples/qt/IESample/src/Main.cxx b/samples/qt/IESample/src/Main.cxx deleted file mode 100755 index 45561b5502..0000000000 --- a/samples/qt/IESample/src/Main.cxx +++ /dev/null @@ -1,49 +0,0 @@ -#include "Application.h" - -#include - -#include -#include -#include -#include -#include -#include - - -int main ( int argc, char* argv[] ) -{ -#if QT_VERSION > 0x050000 - TCollection_AsciiString aPlugindsDirName = OSD_Environment ("QTDIR").Value(); - if (!aPlugindsDirName.IsEmpty()) - QApplication::addLibraryPath (QString (aPlugindsDirName.ToCString()) + "/plugins"); -#endif - QApplication a( argc, argv ); - - QString resDir = ApplicationCommonWindow::getResourceDir(); - QString resIEDir = ApplicationWindow::getIEResourceDir(); - - QTranslator strTrans( 0 ); - Standard_Boolean isOK = strTrans.load( "Common-string", resDir ); - if( isOK ) - a.installTranslator( &strTrans ); - - QTranslator iconTrans( 0 ); - isOK = iconTrans.load( "Common-icon", resDir ); - if( isOK ) - a.installTranslator( &iconTrans ); - - QTranslator strIETrans( 0 ); - isOK = strIETrans.load( "Interface-string", resIEDir ); - if( isOK ) - a.installTranslator( &strIETrans ); - - QObject::connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); - - ApplicationWindow* mw = new ApplicationWindow(); - mw->setWindowTitle( QObject::tr( "TIT_SAMPLE" ) ); - mw->setWindowIcon( QPixmap( resDir + QString( "/" ) + QObject::tr( "ICON_SAMPLE" ) ) ); - mw->show(); - - return a.exec(); -} - diff --git a/samples/qt/Interface/src/Application.cxx b/samples/qt/Interface/src/Application.cxx deleted file mode 100755 index 2048ef73db..0000000000 --- a/samples/qt/Interface/src/Application.cxx +++ /dev/null @@ -1,232 +0,0 @@ -#include "Application.h" - -#include "Translate.h" - -#include -#include -#include -#include - -#include - -#include - -ApplicationWindow::ApplicationWindow() - : ApplicationCommonWindow( ), - myImportPopup( 0 ), - myExportPopup( 0 ) -{ - createTranslatePopups(); -} - -ApplicationWindow::~ApplicationWindow() -{ -} - -void ApplicationWindow::createTranslatePopups() -{ - if ( !myImportPopup ) - myImportPopup = new QMenu( QObject::tr("MNU_FILE_IMPORT"), this ); - - if ( !myExportPopup ) - myExportPopup = new QMenu( QObject::tr("MNU_FILE_EXPORT"), this ); - - QAction* a; - a = new QAction( QObject::tr("MNU_IMPORT_BREP"), this ); - a->setStatusTip( QObject::tr("TBR_IMPORT_BREP") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onImport() ) ); - myCasCadeTranslateActions.insert( FileImportBREPId, a ); - myImportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_EXPORT_BREP"), this ); - a->setStatusTip( QObject::tr("TBR_EXPORT_BREP") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onExport() ) ); - myCasCadeTranslateActions.insert( FileExportBREPId, a ); - myExportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_IMPORT_IGES"), this ); - a->setStatusTip( QObject::tr("TBR_IMPORT_IGES") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onImport() ) ); - myCasCadeTranslateActions.insert( FileImportIGESId, a ); - myImportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_EXPORT_IGES"), this ); - a->setStatusTip( QObject::tr("TBR_EXPORT_IGES") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onExport() ) ); - myCasCadeTranslateActions.insert( FileExportIGESId, a ); - myExportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_IMPORT_STEP"), this ); - a->setStatusTip( QObject::tr("TBR_IMPORT_STEP") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onImport() ) ); - myCasCadeTranslateActions.insert( FileImportSTEPId, a ); - myImportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_EXPORT_STEP"), this ); - a->setStatusTip( QObject::tr("TBR_EXPORT_STEP") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onExport() ) ); - myCasCadeTranslateActions.insert( FileExportSTEPId, a ); - myExportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_EXPORT_STL"), this ); - a->setStatusTip( QObject::tr("TBR_EXPORT_STL") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onExport() ) ); - myCasCadeTranslateActions.insert( FileExportSTLId, a ); - myExportPopup->addAction( a ); - - a = new QAction( QObject::tr("MNU_EXPORT_VRML"), this ); - a->setStatusTip( QObject::tr("TBR_EXPORT_VRML") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onExport() ) ); - myCasCadeTranslateActions.insert( FileExportVRMLId, a ); - myExportPopup->addAction( a ); - - myExportPopup->addSeparator(); - - a = new QAction( QObject::tr("MNU_EXPORT_IMAGE"), this ); - a->setStatusTip( QObject::tr("TBR_EXPORT_IMAGE") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onExportImage() ) ); - myExportPopup->addAction( a ); -} - -void ApplicationWindow::updateFileActions() -{ - if ( myDocuments.isEmpty() ) - { - if ( !isDocument() ) - { - getFilePopup()->insertMenu( getFileSeparator(), myExportPopup ); - getFilePopup()->insertMenu( myExportPopup->menuAction(), myImportPopup ); - mySeparator = getFilePopup()->insertSeparator( myImportPopup->menuAction() ); - } - else - { - getFilePopup()->removeAction( myImportPopup->menuAction() ); - getFilePopup()->removeAction( myExportPopup->menuAction() ); - getFilePopup()->removeAction( mySeparator ); - } - } - ApplicationCommonWindow::updateFileActions(); -} - -void ApplicationWindow::onImport() -{ - QAction* a = (QAction*)sender(); - int type = translationFormat( a ); - if ( type < 0 ) - return; - - bool stat = translate( type, true ); - if ( stat ) - { - DocumentCommon* doc = qobject_cast( getWorkspace()->activeSubWindow()->widget() )->getDocument(); - doc->fitAll(); - } -} - -void ApplicationWindow::onExport() -{ - QAction* a = (QAction*)sender(); - int type = translationFormat( a ); - if ( type < 0 ) - return; - - translate( type, false ); -} - -int ApplicationWindow::translationFormat( const QAction* a ) -{ - int type = -1; - for ( int i = FileImportBREPId; i <= FileExportVRMLId; i++ ) - { - if ( myCasCadeTranslateActions.at( i ) == a ) - { - type = i; - break; - } - } - switch ( type ) - { - case FileImportBREPId: - case FileExportBREPId: - type = Translate::FormatBREP; - break; - case FileImportIGESId: - case FileExportIGESId: - type = Translate::FormatIGES; - break; - case FileImportSTEPId: - case FileExportSTEPId: - type = Translate::FormatSTEP; - break; - case FileExportSTLId: - type = Translate::FormatSTL; - break; - case FileExportVRMLId: - type = Translate::FormatVRML; - break; - } - return type; -} - -bool ApplicationWindow::translate( const int format, const bool import ) -{ - static Translate* anTrans = createTranslator(); - DocumentCommon* doc = qobject_cast( getWorkspace()->activeSubWindow()->widget() )->getDocument(); - Handle(AIS_InteractiveContext) context = doc->getContext(); - bool status; - if ( import ) - status = anTrans->importModel( format, context ); - else - status = anTrans->exportModel( format, context ); - - if ( !status ) - { - QString msg = QObject::tr( "INF_TRANSLATE_ERROR" ); - if ( !anTrans->info().isEmpty() ) - msg += QString( "\n" ) + anTrans->info(); - QMessageBox::critical( this, QObject::tr( "TIT_ERROR" ), msg, QObject::tr( "BTN_OK" ), QString::null, QString::null, 0, 0 ); - } - - return status; -} - -Translate* ApplicationWindow::createTranslator() -{ - Translate* anTrans = new Translate( this/*, "Translator"*/ ); - return anTrans; -} - -void ApplicationWindow::onSelectionChanged() -{ - ApplicationCommonWindow::onSelectionChanged(); - - QMdiArea* ws = getWorkspace(); - DocumentCommon* doc = qobject_cast( ws->activeSubWindow()->widget() )->getDocument(); - Handle(AIS_InteractiveContext) context = doc->getContext(); - bool anEnabled = (context->NbSelected() > 0); - - myCasCadeTranslateActions.at( FileExportBREPId )->setEnabled( anEnabled ); - myCasCadeTranslateActions.at( FileExportIGESId )->setEnabled( anEnabled ); - myCasCadeTranslateActions.at( FileExportSTEPId )->setEnabled( anEnabled ); - myCasCadeTranslateActions.at( FileExportSTLId )->setEnabled( anEnabled ); - myCasCadeTranslateActions.at( FileExportVRMLId )->setEnabled( anEnabled ); -} - -QString ApplicationWindow::getIEResourceDir() -{ - static QString aResourceDir = - QString (OSD_Environment ("CSF_IEResourcesDefaults").Value().ToCString()); - if (aResourceDir.isEmpty()) - aResourceDir = QString (OSD_Environment ("CSF_OCCTResourcePath").Value().ToCString()) + "/samples"; - - return aResourceDir; -} - -void ApplicationWindow::onExportImage() -{ - MDIWindow* w = qobject_cast( getWorkspace()->activeSubWindow()->widget() ); - if ( w ) - w->dump(); -} - - diff --git a/samples/qt/Interface/src/Application.h b/samples/qt/Interface/src/Application.h deleted file mode 100755 index 952135da67..0000000000 --- a/samples/qt/Interface/src/Application.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef APPLICATION_H -#define APPLICATION_H - -#include "ApplicationCommon.h" -#include "IESample.h" - -class Translate; - -class IESAMPLE_EXPORT ApplicationWindow: public ApplicationCommonWindow -{ - Q_OBJECT - -public: - - enum { FileImportBREPId=0, FileExportBREPId=1, FileImportIGESId=2, - FileExportIGESId=3, FileImportSTEPId=4, FileExportSTEPId=5, - FileExportSTLId=6, FileExportVRMLId=7, FileUserId }; - - ApplicationWindow(); - ~ApplicationWindow(); - - static QString getIEResourceDir(); - - virtual void updateFileActions(); - -public slots: - void onImport(); - void onExport(); - void onExportImage(); - virtual void onSelectionChanged(); - -protected: - virtual int translationFormat( const QAction* ); - virtual Translate* createTranslator(); - -private: - void createTranslatePopups(); - bool translate( const int, const bool ); - -protected: - QList myCasCadeTranslateActions; - QMenu* myImportPopup; - QMenu* myExportPopup; - QAction* mySeparator; -}; - -#endif - - diff --git a/samples/qt/Interface/src/IESample.h b/samples/qt/Interface/src/IESample.h deleted file mode 100755 index 6eb8465707..0000000000 --- a/samples/qt/Interface/src/IESample.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef IESAMPLE_H -#define IESAMPLE_H - -#ifndef NO_IESAMPLE_EXPORTS -#ifdef IESAMPLE_EXPORTS -#ifdef _WIN32 -#define IESAMPLE_EXPORT __declspec( dllexport ) -#else -#define IESAMPLE_EXPORT -#endif -#else -#ifdef _WIN32 -#define IESAMPLE_EXPORT __declspec( dllimport ) -#else -#define IESAMPLE_EXPORT -#endif -#endif -#else -#define IESAMPLE_EXPORT -#endif - -#endif diff --git a/samples/qt/Interface/src/Interface-string.ts b/samples/qt/Interface/src/Interface-string.ts deleted file mode 100755 index 478dc788fd..0000000000 --- a/samples/qt/Interface/src/Interface-string.ts +++ /dev/null @@ -1,206 +0,0 @@ - - - - QObject - - INF_ABOUT - Qt based application for Import / Export CASCADE operations. - - - INF_NOTHING_ERROR - Nothing to transfer. - - - INF_APP_IMPORT - Import file - - - INF_APP_EXPORT - Export file - - - TBR_EXPORT_STL - Stl ... - - - TIT_SAMPLE - Sample Import / Export - - - INF_DATA_ERROR - Incorrect Data. - - - INF_FACET_ERROR - At least one shape doesn't contain facetes. - - - INF_TRANSLATE_FILENOTFOUND - File "%1" not found. - - - INF_TRANSLATE_ERROR - The translation is not done. - - - INF_TRANSLATE_ERROR_CANTSAVEDATA - Can't store persistent data. - - - INF_TRANSLATE_ERROR_CANTSAVEFILE - Can't save file "%1". - - - MNU_EXPORT_STL - &Stl ... - - - MNU_FILE_EXPORT - &Export - - - MNU_FILE_IMPORT - &Import - - - TIT_ABOUT - Sample ImportExport. - - - MNU_EXPORT_IMAGE - &Image - - - TBR_EXPORT_IMAGE - Image - - - INF_TRANSLATE_ERROR_INVALIDSHAPE - Some shapes are invalid. - - - MNU_EXPORT_IGES - &Iges ... - - - MNU_EXPORT_BREP - &Brep ... - - - MNU_IMPORT_STEP - &Step ... - - - MNU_IMPORT_BREP - &Brep ... - - - MNU_IMPORT_IGES - &Iges ... - - - MNU_EXPORT_STEP - &Step ... - - - MNU_EXPORT_VRML - &Vrml ... - - - TBR_EXPORT_IGES - Iges ... - - - TBR_EXPORT_BREP - Brep ... - - - TBR_IMPORT_STEP - Step ... - - - TBR_IMPORT_BREP - Brep ... - - - TBR_IMPORT_IGES - Iges ... - - - TBR_EXPORT_STEP - Step ... - - - TBR_EXPORT_VRML - Vrml ... - - - INF_TRIANGLES_NO - Export Without Triangles - - - INF_BREP_MOIFOLD - Manifold Solid Brep - - - INF_PATH_0 - /../data/occ - - - INF_PATH_1 - /../data/iges - - - INF_PATH_2 - /../data/step - - - INF_PATH_4 - /../data/vrml - - - INF_PATH_5 - /../data/stl - - - INF_FILTER_FORMAT_ALL - All Files (*.*) - - - INF_BREP_SHELL - Shell Based Surface Model - - - INF_BREP_CURVE - Geometric Curve Set - - - INF_BREP_FACETED - Faceted Brep - - - INF_TRIANGLES_YES - Export With Triangles - - - INF_FILTER_FORMAT_0 - BREP Files (*.brep *.rle) - - - INF_FILTER_FORMAT_1 - IGES Files (*.igs *.iges) - - - INF_FILTER_FORMAT_2 - STEP Files (*.stp *.step) - - - INF_FILTER_FORMAT_3 - VRML Files (*.vrml) - - - INF_FILTER_FORMAT_4 - STL Files (*.stl) - - - diff --git a/samples/qt/Interface/src/Translate.cxx b/samples/qt/Interface/src/Translate.cxx deleted file mode 100755 index 88d424ad4a..0000000000 --- a/samples/qt/Interface/src/Translate.cxx +++ /dev/null @@ -1,608 +0,0 @@ -#include "Translate.h" - -#include "Application.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -//#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -#include -#include - -// ---------------------------- TranslateDlg ----------------------------------------- - -class TranslateDlg : public QFileDialog -{ -public: - TranslateDlg( QWidget* = 0, Qt::WindowFlags flags = 0, bool = true ); - ~TranslateDlg(); - int getMode() const; - void setMode( const int ); - void addMode( const int, const QString& ); - void clear(); - -protected: - void showEvent ( QShowEvent* event ); - -private: - QListView* findListView( const QObjectList& ); - -private: - QComboBox* myBox; - QList myList; -}; - -TranslateDlg::TranslateDlg( QWidget* parent, Qt::WindowFlags flags, bool modal ) -: QFileDialog( parent, flags ) -{ - setOption( QFileDialog::DontUseNativeDialog ); - setModal( modal ); - - QGridLayout* grid = ::qobject_cast( layout() ); - - if( grid ) - { - QVBoxLayout *vbox = new QVBoxLayout; - - QWidget* paramGroup = new QWidget( this ); - paramGroup->setLayout( vbox ); - - myBox = new QComboBox( paramGroup ); - vbox->addWidget( myBox ); - - int row = grid->rowCount(); - grid->addWidget( paramGroup, row, 1, 1, 3 ); // make combobox occupy 1 row and 3 columns starting from 1 - } -} - -TranslateDlg::~TranslateDlg() -{ -} - -int TranslateDlg::getMode() const -{ - if ( myBox->currentIndex() < 0 || myBox->currentIndex() > (int)myList.count() - 1 ) - return -1; - else - return myList.at( myBox->currentIndex() ); -} - -void TranslateDlg::setMode( const int mode ) -{ - int idx = myList.indexOf( mode ); - if ( idx >= 0 ) - myBox->setCurrentIndex( idx ); -} - -void TranslateDlg::addMode( const int mode, const QString& name ) -{ - myBox->show(); - myBox->addItem( name ); - myList.append( mode ); - myBox->updateGeometry(); - updateGeometry(); -} - -void TranslateDlg::clear() -{ - myList.clear(); - myBox->clear(); - myBox->hide(); - myBox->updateGeometry(); - updateGeometry(); -} - -QListView* TranslateDlg::findListView( const QObjectList & childList ) -{ - QListView* listView = 0; - for ( int i = 0, n = childList.count(); i < n && !listView; i++ ) - { - listView = qobject_cast( childList.at( i ) ); - if ( !listView && childList.at( i ) ) - { - listView = findListView( childList.at( i )->children() ); - } - } - return listView; -} - -void TranslateDlg::showEvent ( QShowEvent* event ) -{ - QFileDialog::showEvent ( event ); - QListView* aListView = findListView( children() ); - aListView->setViewMode( QListView::ListMode ); -} - - -// ---------------------------- Translate ----------------------------------------- - -Translate::Translate( QObject* parent ) -: QObject( parent ), -myDlg( 0 ) -{ -} - -Translate::~Translate() -{ - if ( myDlg ) - delete myDlg; -} - -QString Translate::info() const -{ - return myInfo; -} - -bool Translate::importModel( const int format, const Handle(AIS_InteractiveContext)& ic ) -{ - myInfo = QString(); - QString fileName = selectFileName( format, true ); - if ( fileName.isEmpty() ) - return true; - - if ( !QFileInfo( fileName ).exists() ) - { - myInfo = QObject::tr( "INF_TRANSLATE_FILENOTFOUND" ).arg( fileName ); - return false; - } - - QApplication::setOverrideCursor( Qt::WaitCursor ); - Handle(TopTools_HSequenceOfShape) shapes = importModel( format, fileName ); - QApplication::restoreOverrideCursor(); - - return displayShSequence(ic, shapes); -} - -bool Translate::displayShSequence(const Handle(AIS_InteractiveContext)& ic, - const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - if ( shapes.IsNull() || !shapes->Length() ) - return false; - - for ( int i = 1; i <= shapes->Length(); i++ ) - ic->Display( new AIS_Shape( shapes->Value( i ) ), false ); - ic->UpdateCurrentViewer(); - return true; -} - -Handle(TopTools_HSequenceOfShape) Translate::importModel( const int format, const QString& file ) -{ - Handle(TopTools_HSequenceOfShape) shapes; - try { - switch ( format ) - { - case FormatBREP: - shapes = importBREP( file ); - break; - case FormatIGES: - shapes = importIGES( file ); - break; - case FormatSTEP: - shapes = importSTEP( file ); - break; - } - } catch ( const Standard_Failure& ) { - shapes.Nullify(); - } - return shapes; -} - -bool Translate::exportModel( const int format, const Handle(AIS_InteractiveContext)& ic ) -{ - myInfo = QString(); - QString fileName = selectFileName( format, false ); - if ( fileName.isEmpty() ) - return true; - - Handle(TopTools_HSequenceOfShape) shapes = getShapes( ic ); - if ( shapes.IsNull() || !shapes->Length() ) - return false; - - QApplication::setOverrideCursor( Qt::WaitCursor ); - bool stat = exportModel( format, fileName, shapes ); - QApplication::restoreOverrideCursor(); - - return stat; -} - -bool Translate::exportModel( const int format, const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - try { - switch ( format ) - { - case FormatBREP: return exportBREP( file, shapes ); - case FormatIGES: return exportIGES( file, shapes ); - case FormatSTEP: return exportSTEP( file, shapes ); - case FormatSTL: return exportSTL ( file, shapes ); - case FormatVRML: return exportVRML( file, shapes ); - } - } catch ( const Standard_Failure& ) { - // - } - return false; -} - -Handle(TopTools_HSequenceOfShape) Translate::getShapes( const Handle(AIS_InteractiveContext)& ic ) -{ - Handle(TopTools_HSequenceOfShape) aSequence; - Handle(AIS_InteractiveObject) picked; - for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() ) - { - Handle(AIS_InteractiveObject) obj = ic->SelectedInteractive(); - if ( obj->IsKind( STANDARD_TYPE( AIS_Shape ) ) ) - { - TopoDS_Shape shape = Handle(AIS_Shape)::DownCast(obj)->Shape(); - if ( aSequence.IsNull() ) - aSequence = new TopTools_HSequenceOfShape(); - aSequence->Append( shape ); - } - } - return aSequence; -} - -/*! - Selects a file from standard dialog according to selection 'filter' -*/ -QString Translate::selectFileName( const int format, const bool import ) -{ - TranslateDlg* theDlg = getDialog( format, import ); - - int ret = theDlg->exec(); - - qApp->processEvents(); - - QString file; - QStringList fileNames; - if ( ret != QDialog::Accepted ) - return file; - - fileNames = theDlg->selectedFiles(); - if (!fileNames.isEmpty()) - file = fileNames[0]; - - if ( !QFileInfo( file ).completeSuffix().length() ) - { - QString selFilter = theDlg->selectedNameFilter(); - int idx = selFilter.indexOf( "(*." ); - if ( idx != -1 ) - { - QString tail = selFilter.mid( idx + 3 ); - idx = tail.indexOf( " " ); - if ( idx == -1 ) - idx = tail.indexOf( ")" ); - QString ext = tail.left( idx ); - if ( ext.length() ) - file += QString( "." ) + ext; - } - } - - return file; -} - -TranslateDlg* Translate::getDialog( const int format, const bool import ) -{ - if ( !myDlg ) - myDlg = new TranslateDlg( 0, 0, true ); - - if ( format < 0 ) - return myDlg; - - QString formatFilter = QObject::tr( QString( "INF_FILTER_FORMAT_%1" ).arg( format ).toLatin1().constData() ); - QString allFilter = QObject::tr( "INF_FILTER_FORMAT_ALL" ); - - QString filter; - filter.append( formatFilter ); - filter.append( "\t" ); - - if ( import ) - { - filter.append( allFilter ); - filter.append( "\t" ); - } - - std::cout << filter.toLatin1().constData() << std::endl; - QStringList filters = filter.split( "\t" ); - myDlg->setNameFilters ( filters ); - - if ( import ) - { - myDlg->setWindowTitle( QObject::tr( "INF_APP_IMPORT" ) ); - ((QFileDialog*)myDlg)->setFileMode( QFileDialog::ExistingFile ); - } - else - { - myDlg->setWindowTitle( QObject::tr( "INF_APP_EXPORT" ) ); - ((QFileDialog*)myDlg)->setFileMode( QFileDialog::AnyFile ); - } - - myDlg->clear(); - - if ( !import ) - { - switch ( format ) - { - case FormatSTEP: - myDlg->addMode( STEPControl_ManifoldSolidBrep, QObject::tr( "INF_BREP_MOIFOLD" ) ); - myDlg->addMode( STEPControl_FacetedBrep, QObject::tr( "INF_BREP_FACETED" ) ); - myDlg->addMode( STEPControl_ShellBasedSurfaceModel, QObject::tr( "INF_BREP_SHELL" ) ); - myDlg->addMode( STEPControl_GeometricCurveSet, QObject::tr( "INF_BREP_CURVE" ) ); - break; - } - } - - return myDlg; -} - -// ----------------------------- Import functionality ----------------------------- - -Handle(TopTools_HSequenceOfShape) Translate::importBREP( const QString& file ) -{ - Handle(TopTools_HSequenceOfShape) aSequence; - TopoDS_Shape aShape; - BRep_Builder aBuilder; - TCollection_AsciiString aFilePath = file.toUtf8().data(); - Standard_Boolean result = BRepTools::Read( aShape, aFilePath.ToCString(), aBuilder ); - if ( result ) - { - aSequence = new TopTools_HSequenceOfShape(); - aSequence->Append( aShape ); - } - return aSequence; -} - -Handle(TopTools_HSequenceOfShape) Translate::importIGES( const QString& file ) -{ - Handle(TopTools_HSequenceOfShape) aSequence; - TCollection_AsciiString aFilePath = file.toUtf8().data(); - - IGESControl_Reader Reader; - int status = Reader.ReadFile(aFilePath.ToCString() ); - - if ( status == IFSelect_RetDone ) - { - aSequence = new TopTools_HSequenceOfShape(); - Reader.TransferRoots(); - TopoDS_Shape aShape = Reader.OneShape(); - aSequence->Append( aShape ); - } - return aSequence; -} - -Handle(TopTools_HSequenceOfShape) Translate::importSTEP( const QString& file ) -{ - Handle(TopTools_HSequenceOfShape) aSequence = new TopTools_HSequenceOfShape; - TCollection_AsciiString aFilePath = file.toUtf8().data(); - STEPControl_Reader aReader; - IFSelect_ReturnStatus status = aReader.ReadFile( aFilePath.ToCString() ); - if ( status != IFSelect_RetDone ) - { - return aSequence; - } - - //Interface_TraceFile::SetDefault(); - bool failsonly = false; - aReader.PrintCheckLoad( failsonly, IFSelect_ItemsByEntity ); - - int nbr = aReader.NbRootsForTransfer(); - aReader.PrintCheckTransfer( failsonly, IFSelect_ItemsByEntity ); - for ( Standard_Integer n = 1; n <= nbr; n++ ) - { - aReader.TransferRoot( n ); - } - - int nbs = aReader.NbShapes(); - if ( nbs > 0 ) - { - for ( int i = 1; i <= nbs; i++ ) - { - TopoDS_Shape shape = aReader.Shape( i ); - aSequence->Append( shape ); - } - } - - return aSequence; -} - -// ----------------------------- Export functionality ----------------------------- - -bool Translate::exportBREP( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - if ( shapes.IsNull() || shapes->IsEmpty() ) - return false; - - TopoDS_Shape shape = shapes->Value( 1 ); - - const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - - return BRepTools::Write( shape, anUtf8Path.ToCString() ); -} - -bool Translate::exportIGES( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - if ( shapes.IsNull() || shapes->IsEmpty() ) - return false; - - IGESControl_Controller::Init(); - IGESControl_Writer writer( Interface_Static::CVal( "XSTEP.iges.unit" ), - Interface_Static::IVal( "XSTEP.iges.writebrep.mode" ) ); - - for ( int i = 1; i <= shapes->Length(); i++ ) - writer.AddShape ( shapes->Value( i ) ); - writer.ComputeModel(); - - const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - - return writer.Write( anUtf8Path.ToCString() ); -} - -bool Translate::exportSTEP( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - if ( shapes.IsNull() || shapes->IsEmpty() ) - return false; - - TranslateDlg* theDlg = getDialog( -1, false ); - STEPControl_StepModelType type = (STEPControl_StepModelType)theDlg->getMode(); - if ( type < 0 ) - return false; - - IFSelect_ReturnStatus status; - - if ( type == STEPControl_FacetedBrep && !checkFacetedBrep( shapes ) ) - { - myInfo = QObject::tr( "INF_FACET_ERROR" ); - return false; - } - - STEPControl_Writer writer; - for ( int i = 1; i <= shapes->Length(); i++ ) - { - status = writer.Transfer( shapes->Value( i ), type ); - if ( status != IFSelect_RetDone ) - return false; - } - - const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - - status = writer.Write( anUtf8Path.ToCString() ); - - switch ( status ) - { - case IFSelect_RetError: - myInfo = QObject::tr( "INF_DATA_ERROR" ); - break; - case IFSelect_RetFail: - myInfo = QObject::tr( "INF_WRITING_ERROR" ); - break; - case IFSelect_RetVoid: - myInfo = QObject::tr( "INF_NOTHING_ERROR" ); - break; - case IFSelect_RetStop: - case IFSelect_RetDone: - break; - } - return status == IFSelect_RetDone; -} - -bool Translate::exportSTL( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - if ( shapes.IsNull() || shapes->IsEmpty() ) - return false; - - TopoDS_Compound res; - BRep_Builder builder; - builder.MakeCompound( res ); - - for ( int i = 1; i <= shapes->Length(); i++ ) - { - TopoDS_Shape shape = shapes->Value( i ); - if ( shape.IsNull() ) - { - myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" ); - return false; - } - builder.Add( res, shape ); - } - - StlAPI_Writer writer; - - const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - - writer.Write( res, anUtf8Path.ToCString() ); - - return true; -} - -bool Translate::exportVRML( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - if ( shapes.IsNull() || shapes->IsEmpty() ) - return false; - - TopoDS_Compound res; - BRep_Builder builder; - builder.MakeCompound( res ); - - for ( int i = 1; i <= shapes->Length(); i++ ) - { - TopoDS_Shape shape = shapes->Value( i ); - if ( shape.IsNull() ) - { - myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" ); - return false; - } - builder.Add( res, shape ); - } - - VrmlAPI_Writer writer; - - const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - - writer.Write( res, anUtf8Path.ToCString() ); - - return true; -} - -bool Translate::checkFacetedBrep( const Handle(TopTools_HSequenceOfShape)& shapes ) -{ - bool err = false; - for ( int i = 1; i <= shapes->Length(); i++ ) - { - TopoDS_Shape shape = shapes->Value( i ); - for ( TopExp_Explorer fexp( shape, TopAbs_FACE ); fexp.More() && !err; fexp.Next() ) - { - Handle(Geom_Surface) surface = BRep_Tool::Surface( TopoDS::Face( fexp.Current() ) ); - if ( !surface->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) - err = true; - } - for ( TopExp_Explorer eexp( shape, TopAbs_EDGE ); eexp.More() && !err; eexp.Next() ) - { - Standard_Real fd, ld; - Handle(Geom_Curve) curve = BRep_Tool::Curve( TopoDS::Edge( eexp.Current() ), fd, ld ); - if ( !curve->IsKind( STANDARD_TYPE( Geom_Line ) ) ) - err = true; - } - } - return !err; -} - - - diff --git a/samples/qt/Interface/src/Translate.h b/samples/qt/Interface/src/Translate.h deleted file mode 100755 index a19d5f9bf2..0000000000 --- a/samples/qt/Interface/src/Translate.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef TRANSLATE_H -#define TRANSLATE_H -#include "IESample.h" - -#include -#include -#include - -#include -#include - -class TranslateDlg; - -class IESAMPLE_EXPORT Translate: public QObject -{ - Q_OBJECT - -public: - enum { FormatBREP, FormatIGES, FormatSTEP, FormatVRML, FormatSTL }; - - Translate( QObject* ); - ~Translate(); - - bool importModel( const int, const Handle(AIS_InteractiveContext)& ); - bool exportModel( const int, const Handle(AIS_InteractiveContext)& ); - - QString info() const; - -protected: - virtual Handle(TopTools_HSequenceOfShape) importModel( const int, const QString& ); - virtual bool exportModel( const int, const QString&, - const Handle(TopTools_HSequenceOfShape)& ); - virtual bool displayShSequence(const Handle(AIS_InteractiveContext)&, - const Handle(TopTools_HSequenceOfShape)& ); - QString selectFileName( const int, const bool ); - -private: - TranslateDlg* getDialog( const int, const bool ); - Handle(TopTools_HSequenceOfShape) getShapes( const Handle(AIS_InteractiveContext)& ); - - Handle(TopTools_HSequenceOfShape) importBREP( const QString& ); - Handle(TopTools_HSequenceOfShape) importIGES( const QString& ); - Handle(TopTools_HSequenceOfShape) importSTEP( const QString& ); - - bool exportBREP( const QString&, const Handle(TopTools_HSequenceOfShape)& ); - bool exportIGES( const QString&, const Handle(TopTools_HSequenceOfShape)& ); - bool exportSTEP( const QString&, const Handle(TopTools_HSequenceOfShape)& ); - bool exportSTL( const QString&, const Handle(TopTools_HSequenceOfShape)& ); - bool exportVRML( const QString&, const Handle(TopTools_HSequenceOfShape)& ); - - bool checkFacetedBrep( const Handle(TopTools_HSequenceOfShape)& ); - -protected: - TranslateDlg* myDlg; - QString myInfo; -}; - -#endif - diff --git a/samples/qt/OCCTOverview/.DS_Store b/samples/qt/OCCTOverview/.DS_Store deleted file mode 100644 index 0d4b91b9ba..0000000000 Binary files a/samples/qt/OCCTOverview/.DS_Store and /dev/null differ diff --git a/samples/qt/OCCTOverview/.gitignore b/samples/qt/OCCTOverview/.gitignore deleted file mode 100644 index 7ac6e6bc69..0000000000 --- a/samples/qt/OCCTOverview/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/debug -/release -*.sln -*.vcxproj* -.qmake.stash -/custom.bat -/custom.sh diff --git a/samples/qt/OCCTOverview/CMakeLists.txt b/samples/qt/OCCTOverview/CMakeLists.txt deleted file mode 100644 index 684d14eba7..0000000000 --- a/samples/qt/OCCTOverview/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -project(OCCTOverview) - -# Sample configuration -set (EXECUTABLE_PROJECT ON) -set (USE_QT ON) -set (RELATIVE_DIR "samples/qt") -set (TARGET_FOLDER "Samples") - -include_directories("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/${RELATIVE_DIR}") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/Common/src") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/Interface/src") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/OCCTOverview/src") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/OCCTOverview/code") - -OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) - -# Target-specific definitions -target_compile_definitions(OCCTOverview PRIVATE -DNO_COMMONSAMPLE_EXPORTS -DNO_IESAMPLE_EXPORTS) diff --git a/samples/qt/OCCTOverview/EXTERNLIB.cmake b/samples/qt/OCCTOverview/EXTERNLIB.cmake deleted file mode 100644 index abc4786b0a..0000000000 --- a/samples/qt/OCCTOverview/EXTERNLIB.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# External dependencies for OCCTOverview sample -set(OCCT_OCCTOverview_EXTERNAL_LIBS - TKBRep - TKBin - TKBool - TKBO - TKCDF - TKFillet - TKG2d - TKG3d - TKGeomAlgo - TKGeomBase - TKernel - TKHLR - TKDEIGES - TKMath - TKMesh - TKOffset - TKOpenGl - TKPrim - TKService - TKShHealing - TKDESTEP - TKDESTL - TKTopAlgo - TKV3d - TKDEVRML - TKXSBase - TKLCAF - TKCAF - TKVCAF - TKXml -) \ No newline at end of file diff --git a/samples/qt/OCCTOverview/FILES.cmake b/samples/qt/OCCTOverview/FILES.cmake deleted file mode 100644 index b705149010..0000000000 --- a/samples/qt/OCCTOverview/FILES.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# Source files for OCCTOverview sample -set(OCCT_OCCTOverview_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") - -set(OCCT_OCCTOverview_FILES - src/ApplicationCommon.cxx - src/ApplicationCommon.h - src/CommonSample.h - src/DocumentCommon.cxx - src/DocumentCommon.h - src/GeomWidget.cxx - src/GeomWidget.h - src/Main.cxx - src/OcctHighlighter.cxx - src/OcctHighlighter.h - src/OcctWindow.cxx - src/OcctWindow.h - src/OCCTOverview.qrc - src/TranslateDialog.h - src/TranslateDialog.cxx - src/Transparency.cxx - src/Transparency.h - src/View.cxx - src/View.h - code/AdaptorCurve2d_AIS.cxx - code/AdaptorCurve2d_AIS.h - code/AdaptorCurve_AIS.cxx - code/AdaptorCurve_AIS.h - code/AdaptorPnt2d_AIS.cxx - code/AdaptorPnt2d_AIS.h - code/AdaptorVec_AIS.cxx - code/AdaptorVec_AIS.h - code/BaseSample.cxx - code/BaseSample.h - code/DataExchange.xml - code/DataExchangeSamples.cxx - code/DataExchangeSamples.h - code/Geometry.xml - code/GeometrySamples.cxx - code/GeometrySamples.h - code/MakeBottle.cxx - code/MakeBottle.h - code/Ocaf.xml - code/OcafSamples.cxx - code/OcafSamples.h - code/Sample2D_Face.cxx - code/Sample2D_Face.h - code/Sample2D_Image.cxx - code/Sample2D_Image.h - code/Sample2D_Markers.cxx - code/Sample2D_Markers.h - code/Samples.qrc - code/TOcafFunction_BoxDriver.cxx - code/TOcafFunction_BoxDriver.h - code/TOcafFunction_CutDriver.cxx - code/TOcafFunction_CutDriver.h - code/TOcafFunction_CylDriver.cxx - code/TOcafFunction_CylDriver.h - code/TOcaf_Application.cxx - code/TOcaf_Application.h - code/Topology.xml - code/TopologySamples.cxx - code/TopologySamples.h - code/Triangulation.xml - code/TriangulationSamples.cxx - code/TriangulationSamples.h - code/Viewer2d.xml - code/Viewer2dSamples.cxx - code/Viewer2dSamples.h - code/Viewer3d.xml - code/Viewer3dSamples.cxx - code/Viewer3dSamples.h -) diff --git a/samples/qt/OCCTOverview/OCCTOverview.pro b/samples/qt/OCCTOverview/OCCTOverview.pro deleted file mode 100644 index c3587324a6..0000000000 --- a/samples/qt/OCCTOverview/OCCTOverview.pro +++ /dev/null @@ -1,95 +0,0 @@ -TEMPLATE = app -CONFIG += debug_and_release qt -CONFIG += lrelease -CONFIG += embed_translations -QT += xml -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} - -TARGET = OCCTOverview - -isEmpty(CSF_OCCTSamplesPath) { - SAMPLESROOT = $$PWD/.. -} else { - SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt) -} - - -HEADERS = ./src/*.h \ - ./code/*.h - -SOURCES = ./src/*.cxx \ - ./code/*.cxx - -RESOURCES += ./code/Samples.qrc -RESOURCES += ./src/OCCTOverview.qrc - -RES_DIR = $$quote($$(RES_DIR)) - -INCLUDEPATH += $$quote($$(CSF_SampleSources)) -INCLUDEPATH += $$quote($$(CSF_OCCTIncludePath)) \ - $${SAMPLESROOT}/qt/OCCTOverview/code - - -OCCT_DEFINES = $$(CSF_DEFINES) - -DEFINES = $$split(OCCT_DEFINES, ;) - -unix { - UNAME = $$system(uname -s) - LIBLIST = $$(LD_LIBRARY_PATH) - LIBPATHS = $$split(LIBLIST,":") - for(lib, LIBPATHS):LIBS += -L$${lib} - - CONFIG(debug, debug|release) { - DESTDIR = ./$$UNAME/bind - OBJECTS_DIR = ./$$UNAME/objd - MOC_DIR = ./$$UNAME/mocd - } else { - DESTDIR = ./$$UNAME/bin - OBJECTS_DIR = ./$$UNAME/obj - MOC_DIR = ./$$UNAME/moc - } - - MACOSX_USE_GLX = $$(MACOSX_USE_GLX) - - !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD - equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX - DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL - !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD - - QMAKE_CXXFLAGS += -std=c++17 -} - -win32 { - CONFIG(debug, debug|release) { - DEFINES += _DEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bind - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/objd - MOC_DIR = ./win$$(ARCH)/$$(VCVER)/mocd - } else { - DEFINES += NDEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bin - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj - MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc - } - QMAKE_CXXFLAGS += /std:c++17 - LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath) - DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS -} - -LIBS += -lTKernel -lTKMath -lTKService -lTKV3d -lTKOpenGl \ - -lTKBRep -lTKDEIGES -lTKDESTL -lTKDEVRML -lTKDESTEP \ - -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \ - -lTKXSBase -lTKShHealing -lTKHLR -lTKTopAlgo -lTKMesh -lTKPrim \ - -lTKCDF -lTKBool -lTKBO -lTKFillet -lTKOffset -lTKLCAF -lTKCAF -lTKVCAF \ - -lTKBin -lTKXml - -!exists($${RES_DIR}) { - win32 { - system(mkdir $${RES_DIR}) - } else { - system(mkdir -p $${RES_DIR}) - } -} diff --git a/samples/qt/OCCTOverview/OCCTOverview0.pro b/samples/qt/OCCTOverview/OCCTOverview0.pro deleted file mode 100644 index ec2948b973..0000000000 --- a/samples/qt/OCCTOverview/OCCTOverview0.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE=subdirs - -SUBDIRS=OCCTOverview0 - -OCCTOverview0.file=OCCTOverview.pro diff --git a/samples/qt/OCCTOverview/PACKAGES.cmake b/samples/qt/OCCTOverview/PACKAGES.cmake deleted file mode 100644 index 9771c42ac5..0000000000 --- a/samples/qt/OCCTOverview/PACKAGES.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Packages for OCCTOverview sample -set(OCCT_OCCTOverview_LIST_OF_PACKAGES - OCCTOverview -) \ No newline at end of file diff --git a/samples/qt/OCCTOverview/ReadMe.md b/samples/qt/OCCTOverview/ReadMe.md deleted file mode 100644 index faa5fb5a8e..0000000000 --- a/samples/qt/OCCTOverview/ReadMe.md +++ /dev/null @@ -1,74 +0,0 @@ -Qt: OCCT Overview (C++|Qt Widgets) {#samples_qt_overview} -========== - -The Overview Qt application provides code snippets for basic usage of C++ API of various OCCT functionality. -The samples are organized in several categories according to relevant module of OCCT: - - * Geometry - * Topology - * Triangulation - * DataExchange - * OCAF - * Viewer 2d - * Viewer 3d - -Each sample presents geometry view, C++ code fragment and sample output window. -This sample is described in the @ref samples__novice_guide "Novice guide" for new users. - -@figure{sample_overview_qt.png} - -1. Contents ------------------------ - -The directory samples/qt/OCCTOverview contains the folders and files of the Qt OCCT Overview application: - -* Files **OCCTOverview.pro** and **OCCTOverview0.pro** are Qt project files. -* File **genproj.bat** to denerate MS Visual Studio project. -* File **msvc.bat** to run MS Visual Studio project. -* File **make.sh** to build of the application on Linux. -* Files **run.bat** and **run.sh** to run the application. -* Files **env.bat** and **custom.bat** are called from *genproj.bat*, *msvc.bat*, *run.bat*. - File *custom.bat* should be defined by user to provide paths to QT directory and OCCT installation directory (see *custom.bat.template*). -* **src** and **res** directories provide source and resources files. - -The directory samples/OCCTOverview/code contains the source code of samples. - -2. How to build Qt OCCT Overview application ---------------------------------- - -* Edit custom.bat file. It is necessary to define following variables: - * **QTDIR** path to where Qt is installed - * **CASROOT** path to where Open CASCADE binaries are installed. - -* Build the application: - - * On Windows: - * Generate project files: `> genproj.bat vc141 win64 Debug` - * Launch MS Visual Studio: `> msvc.bat vc141 win64 Debug` - * Build the application using MS Visual Studio. - - * On Linux: Launch building of the application by make.sh script - -3. Running the application --------------------------- - -* On Windows: -~~~~ - > run.bat vc141 win64 Debug -~~~~ - -* On Linux: -~~~~ - > run.sh -~~~~ - -4. How to use the OCCT Overview application: ---------------------------------- - -* To select a samples category use the *Category* menu. -* To run concrete sample using the menu to the right of the category menu. -* See the source code in the *Sample code* window. Сopy the code if needed. -* See the sample output in the *Output* window if it exist. -* Zoom, pan and rotate a geometry in the mail window using the mouse. - -See hints how to use the mouse in down hints panel. diff --git a/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx b/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx deleted file mode 100644 index 488bf10c89..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "AdaptorCurve2d_AIS.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -AdaptorCurve2d_AIS::AdaptorCurve2d_AIS(const Handle(Geom2d_Curve)& theGeom2dCurve, - const Aspect_TypeOfLine theTypeOfLine, - const Aspect_WidthOfLine theWidthOfLine) - : myGeom2dCurve(theGeom2dCurve), - myTypeOfLine(theTypeOfLine), - myWidthOfLine(theWidthOfLine), - myDisplayPole(Standard_True), - myDisplayCurbure(Standard_False), - myDiscretisation(20), - myradiusmax(10), - myradiusratio(1) -{ - // -} - -void AdaptorCurve2d_AIS::Compute(const Handle(PrsMgr_PresentationManager)&, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - if (theMode != 0) - { - return; - } - - Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve); - GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor, 1.e-2); - if (anEdgeDistrib.IsDone()) - { - Handle(Graphic3d_ArrayOfPolylines) aCurve = - new Graphic3d_ArrayOfPolylines(anEdgeDistrib.NbPoints()); - for (Standard_Integer i = 1; i <= anEdgeDistrib.NbPoints(); ++i) - { - aCurve->AddVertex(anEdgeDistrib.Value(i)); - } - - Handle(Graphic3d_Group) aPrsGroup = thePrs->NewGroup(); - aPrsGroup->SetGroupPrimitivesAspect(myDrawer->LineAspect()->Aspect()); - aPrsGroup->AddPrimitiveArray(aCurve); - } - - if (myDisplayPole) - { - if (anAdaptor.GetType() == GeomAbs_BezierCurve) - { - Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier(); - Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = - new Graphic3d_ArrayOfPolylines(aBezier->NbPoles()); - for (int i = 1; i <= aBezier->NbPoles(); i++) - { - gp_Pnt2d CurrentPoint = aBezier->Pole(i); - anArrayOfVertex->AddVertex(CurrentPoint.X(), CurrentPoint.Y(), 0.); - } - - Handle(Graphic3d_Group) aPrsGroup = thePrs->NewGroup(); - aPrsGroup->SetGroupPrimitivesAspect(myDrawer->LineAspect()->Aspect()); - aPrsGroup->AddPrimitiveArray(anArrayOfVertex); - } - - if (anAdaptor.GetType() == GeomAbs_BSplineCurve) - { - Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline(); - Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = - new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles()); - for (int i = 1; i <= aBSpline->NbPoles(); i++) - { - gp_Pnt2d CurrentPoint = aBSpline->Pole(i); - anArrayOfVertex->AddVertex(CurrentPoint.X(), CurrentPoint.Y(), 0.); - } - - Handle(Graphic3d_Group) aPrsGroup = thePrs->NewGroup(); - aPrsGroup->SetGroupPrimitivesAspect(myDrawer->LineAspect()->Aspect()); - aPrsGroup->AddPrimitiveArray(anArrayOfVertex); - } - } - - if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line)) - { - const Standard_Integer nbintv = anAdaptor.NbIntervals(GeomAbs_CN); - TColStd_Array1OfReal TI(1, nbintv + 1); - anAdaptor.Intervals(TI, GeomAbs_CN); - Standard_Real Resolution = 1.0e-9, Curvature; - Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution); - gp_Pnt2d P1, P2; - - Handle(Graphic3d_Group) aPrsGroup = thePrs->NewGroup(); - aPrsGroup->SetGroupPrimitivesAspect(myDrawer->LineAspect()->Aspect()); - for (Standard_Integer intrv = 1; intrv <= nbintv; intrv++) - { - Standard_Real t = TI(intrv); - Standard_Real step = (TI(intrv + 1) - t) / GetDiscretisation(); - Standard_Real LRad, ratio; - for (Standard_Integer ii = 1; ii <= myDiscretisation; ii++) - { - LProp.SetParameter(t); - if (LProp.IsTangentDefined()) - { - Curvature = std::abs(LProp.Curvature()); - if (Curvature > Resolution) - { - myGeom2dCurve->D0(t, P1); - LRad = 1. / Curvature; - ratio = ((LRad > myradiusmax) ? myradiusmax / LRad : 1); - ratio *= myradiusratio; - LProp.CentreOfCurvature(P2); - gp_Vec2d V(P1, P2); - gp_Pnt2d P3 = P1.Translated(ratio * V); - Handle(Graphic3d_ArrayOfPolylines) aSegment = new Graphic3d_ArrayOfPolylines(2); - aSegment->AddVertex(P1.X(), P1.Y(), 0.); - aSegment->AddVertex(P3.X(), P3.Y(), 0.); - aPrsGroup->AddPrimitiveArray(aSegment); - } - } - t += step; - } - } - } -} diff --git a/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.h b/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.h deleted file mode 100644 index ad66bb4d13..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef ADAPTOR_CURVE2D_AIS_H -#define ADAPTOR_CURVE2D_AIS_H - -#include -#include -#include -#include - -//! AIS interactive Object for Geom2d_Curve -class AdaptorCurve2d_AIS : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTI_INLINE(AdaptorCurve2d_AIS, AIS_InteractiveObject) -public: - AdaptorCurve2d_AIS(const Handle(Geom2d_Curve)& theGeom2dCurve, - const Aspect_TypeOfLine theTypeOfline = Aspect_TOL_SOLID, - const Aspect_WidthOfLine theWidthOfLine = Aspect_WOL_MEDIUM); - - Standard_Integer NbPossibleSelection() const { return 1; } - Aspect_TypeOfLine GetTypeOfLine() const { return myTypeOfLine; } - void SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine) { myTypeOfLine = aNewTypeOfLine; } - Aspect_WidthOfLine GetWidthOfLine() const { return myWidthOfLine; } - void SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine) { myWidthOfLine = aNewWidthOfLine; } - Standard_Boolean GetDisplayPole() const { return myDisplayPole; } - void SetDisplayPole(const Standard_Boolean aNewDisplayPole) { myDisplayPole = aNewDisplayPole; } - Standard_Boolean GetDisplayCurbure() const { return myDisplayCurbure; } - void SetDisplayCurbure(const Standard_Boolean aNewDisplayCurbure) { myDisplayCurbure = aNewDisplayCurbure; } - Standard_Real GetDiscretisation() const { return myDiscretisation; } - void SetDiscretisation(const Standard_Real aNewDiscretisation) { myDiscretisation = aNewDiscretisation; } - -private: - //! Return TRUE for supported display modes (only 0 mode is supported). - virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; } - - //! Compute presentation. - virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) Standard_OVERRIDE; - - //! Compute selection (not implemented). - virtual void ComputeSelection (const Handle(SelectMgr_Selection)&, - const Standard_Integer) Standard_OVERRIDE {} - -private: - - Handle(Geom2d_Curve) myGeom2dCurve; - Aspect_TypeOfLine myTypeOfLine; - Aspect_WidthOfLine myWidthOfLine; - Standard_Boolean myDisplayPole; - Standard_Boolean myDisplayCurbure; - Standard_Real myDiscretisation; - Standard_Real myradiusmax; - Standard_Real myradiusratio; - -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/AdaptorCurve_AIS.cxx b/samples/qt/OCCTOverview/code/AdaptorCurve_AIS.cxx deleted file mode 100644 index 18ef438ba3..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorCurve_AIS.cxx +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "AdaptorCurve_AIS.h" - -#include -#include -#include -#include - -void AdaptorCurve_AIS::Compute (const Handle(PrsMgr_PresentationManager)&, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - GeomAdaptor_Curve anAdaptorCurve(myCurve); - switch (theMode) - { - case 1: - { - Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer(); - aPoleDrawer->SetLineAspect(new Prs3d_LineAspect(Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0)); - StdPrs_PoleCurve::Add(thePrs, anAdaptorCurve, aPoleDrawer); - } - Standard_FALLTHROUGH - case 0: - { - StdPrs_Curve::Add(thePrs, anAdaptorCurve, myDrawer); - break; - } - } -} diff --git a/samples/qt/OCCTOverview/code/AdaptorCurve_AIS.h b/samples/qt/OCCTOverview/code/AdaptorCurve_AIS.h deleted file mode 100644 index f4f377c5b8..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorCurve_AIS.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef ADAPTOR_CURVE_AIS_H -#define ADAPTOR_CURVE_AIS_H - -#include -#include - -//! AIS interactive Object for Geom_Curve -class AdaptorCurve_AIS : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTI_INLINE(AdaptorCurve_AIS, AIS_InteractiveObject) -public: - AdaptorCurve_AIS (const Handle(Geom_Curve)& theCurve) : myCurve(theCurve) {} -private: - - //! Return TRUE for supported display modes (modes 0 and 1 are supported). - virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0 || theMode == 1; } - - //! Compute presentation. - Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) Standard_OVERRIDE; - - //! Compute selection (not implemented). - virtual void ComputeSelection (const Handle(SelectMgr_Selection)&, - const Standard_Integer) Standard_OVERRIDE {} - -private: - Handle(Geom_Curve) myCurve; -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/AdaptorPnt2d_AIS.cxx b/samples/qt/OCCTOverview/code/AdaptorPnt2d_AIS.cxx deleted file mode 100644 index 5159a34545..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorPnt2d_AIS.cxx +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "AdaptorPnt2d_AIS.h" - -#include -#include - -void AdaptorPnt2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - if (theMode != 0) - { - return; - } - - Handle(Geom_CartesianPoint) aGeomPoint = new Geom_CartesianPoint(myPoint); - StdPrs_Point::Add (thePrs, aGeomPoint, myDrawer); -} diff --git a/samples/qt/OCCTOverview/code/AdaptorPnt2d_AIS.h b/samples/qt/OCCTOverview/code/AdaptorPnt2d_AIS.h deleted file mode 100644 index e37a2bd672..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorPnt2d_AIS.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef ADAPTOR_PNT2D_AIS_H -#define ADAPTOR_PNT2D_AIS_H - -#include -#include - -//! AIS interactive Object for Geom2d_Point -class AdaptorPnt2d_AIS : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTI_INLINE(AdaptorPnt2d_AIS, AIS_InteractiveObject) -public: - AdaptorPnt2d_AIS (const Handle(Geom2d_Point)& thePoint, - Standard_Real theElevation = 0) - : myPoint(thePoint->X(), thePoint->Y(), theElevation) {} - -private: - - //! Return TRUE for supported display modes (only mode 0 is supported). - virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; } - - //! Compute presentation. - virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) Standard_OVERRIDE; - - //! Compute selection (not implemented). - virtual void ComputeSelection (const Handle(SelectMgr_Selection)&, - const Standard_Integer) Standard_OVERRIDE {} - -private: - - gp_Pnt myPoint; - -}; - -#endif // ADAPTOR_PNT2D_AIS_H diff --git a/samples/qt/OCCTOverview/code/AdaptorVec_AIS.cxx b/samples/qt/OCCTOverview/code/AdaptorVec_AIS.cxx deleted file mode 100644 index 725e2a53ea..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorVec_AIS.cxx +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "AdaptorVec_AIS.h" - -#include -#include -#include -#include -#include - -AdaptorVec_AIS::AdaptorVec_AIS (const gp_Pnt2d& thePnt1, - const gp_Pnt2d& thePnt2, - Standard_Real theArrowLength) -: myPnt (gp_Pnt (thePnt1.X(), thePnt1.Y(), 0.0)), - myLength (0.0), - myArrowLength (theArrowLength) -{ - gp_Vec aVec (thePnt2.X() - thePnt1.X(), thePnt2.Y() - thePnt1.Y(), 0.0); - myDir = gp_Dir(aVec); - myLength = aVec.Magnitude(); -} - -void AdaptorVec_AIS::Compute (const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - if (theMode != 0) - { - return; - } - - // Set style for arrow - Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect(); - anArrowAspect->SetLength(myArrowLength); - - gp_Pnt aLastPoint = myPnt; - aLastPoint.Translate(myLength*gp_Vec(myDir)); - - // Draw Line - { - Handle(Graphic3d_Group) aLineGroup = thePrs->NewGroup(); - aLineGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect()); - Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2); - aPrims->AddVertex(myPnt); - aPrims->AddVertex(aLastPoint); - aLineGroup->AddPrimitiveArray(aPrims); - - // Draw arrow - Prs3d_Arrow::Draw (aLineGroup, aLastPoint, myDir, anArrowAspect->Angle(), anArrowAspect->Length()); - } - - // Draw text - if (!myText.IsEmpty()) - { - gp_Pnt aTextPosition = aLastPoint; - Prs3d_Text::Draw (thePrs->NewGroup(), myDrawer->TextAspect(), myText, aTextPosition); - } -} diff --git a/samples/qt/OCCTOverview/code/AdaptorVec_AIS.h b/samples/qt/OCCTOverview/code/AdaptorVec_AIS.h deleted file mode 100644 index e04711c11b..0000000000 --- a/samples/qt/OCCTOverview/code/AdaptorVec_AIS.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef ADAPTOR_VEC_AIS_H -#define ADAPTOR_VEC_AIS_H - -#include - -//! AIS interactive Object for vector with arrow and text -class AdaptorVec_AIS : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTI_INLINE(AdaptorVec_AIS, AIS_InteractiveObject) -public: - - AdaptorVec_AIS() - : myLength (1.0), - myArrowLength (1.0) - {} - - AdaptorVec_AIS (const gp_Pnt& thePnt, - const gp_Dir& theDir, - Standard_Real theLength = 1, - Standard_Real theArrowLength = 1) - : myPnt (thePnt), - myDir (theDir), - myLength (theLength), - myArrowLength (theArrowLength) - { - // - } - - AdaptorVec_AIS (const gp_Pnt& thePnt, - const gp_Vec& theVec, - Standard_Real theArrowLength = 1) - : myPnt (thePnt), - myDir (theVec), - myLength (theVec.Magnitude()), - myArrowLength (theArrowLength) - { - // - } - - AdaptorVec_AIS (const gp_Pnt2d& thePnt2d, - const gp_Dir2d& theDir2d, - Standard_Real theLength = 1, - Standard_Real theArrowLength = 1) - : myPnt (gp_Pnt(thePnt2d.X(), thePnt2d.Y(), 0.0)), - myDir (gp_Dir(theDir2d.X(), theDir2d.Y(), 0.0)), - myLength (theLength), - myArrowLength (theArrowLength) - { - // - } - - AdaptorVec_AIS (const gp_Pnt2d& thePnt2d, - const gp_Vec2d& theVec2d, - Standard_Real theArrowLength = 1) - : myPnt (gp_Pnt(thePnt2d.X(), thePnt2d.Y(), 0.0)), - myDir (gp_Dir(theVec2d.X(), theVec2d.Y(), 0.0)), - myLength (theVec2d.Magnitude()), - myArrowLength (theArrowLength) - { - // - } - - AdaptorVec_AIS (const gp_Pnt2d& thePnt1, - const gp_Pnt2d& thePnt2, - Standard_Real theArrowLength = 1); - - void SetText (const TCollection_AsciiString& theText) - { - myText = theText; - } - - void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect) - { - myDrawer->SetLineAspect(theAspect); - } - -private: - - //! Return TRUE for supported display modes (only mode 0 is supported). - virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; } - - //! Compute presentation. - virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) Standard_OVERRIDE; - - //! Compute selection (not implemented). - virtual void ComputeSelection (const Handle(SelectMgr_Selection)&, - const Standard_Integer) Standard_OVERRIDE {} - -private: - - gp_Pnt myPnt; - gp_Dir myDir; - Standard_Real myLength; - Standard_Real myArrowLength; - TCollection_AsciiString myText; -}; - -#endif // ADAPTOR_VEC2D_AIS_H diff --git a/samples/qt/OCCTOverview/code/BaseSample.cxx b/samples/qt/OCCTOverview/code/BaseSample.cxx deleted file mode 100644 index b0aa8d2ce5..0000000000 --- a/samples/qt/OCCTOverview/code/BaseSample.cxx +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "BaseSample.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -const TCollection_AsciiString BaseSample::FILE_EXTENSION = "cxx"; - -void BaseSample::Clear() -{ - myObject3d.Clear(); - myObject2d.Clear(); - myCode.Clear(); - myResult.str(""); -} - -TCollection_AsciiString BaseSample::GetResult() -{ - TCollection_AsciiString aResult(myResult.str().c_str()); - myResult.str(""); - return aResult; -} - -void BaseSample::AppendCube() -{ - Handle(AIS_ViewCube) aViewCube = new AIS_ViewCube(); - myObject3d.Append(aViewCube); -} - -void BaseSample::Process (const TCollection_AsciiString& theSampleName) -{ - myObject3d.Clear(); - myObject2d.Clear(); - myCode.Clear(); - myIsProcessed = Standard_False; - try - { - ExecuteSample(theSampleName); - if (!myObject3d.IsEmpty()) - { - Handle(AIS_ViewCube) aViewCube = new AIS_ViewCube(); - myObject3d.Append(aViewCube); - } - } - catch (...) - { - TraceError(TCollection_AsciiString("Error in sample: ") + theSampleName); - } -} - -void BaseSample::TraceError (const TCollection_AsciiString& theErrorMessage) -{ - Message::SendFail() << "\nERROR: " << theErrorMessage.ToCString() << std::endl; - myResult << "\nERROR: " << theErrorMessage << std::endl; -} - -void BaseSample::FindSourceCode (const TCollection_AsciiString& theSampleName) -{ - TCollection_AsciiString aClassName = DynamicType()->Name(); - char aSeparator = QDir::separator().toLatin1(); - TCollection_AsciiString aCxxFilePach = myCodePath + aSeparator + aClassName + '.' + FILE_EXTENSION; - OSD_File aCxxFile(aCxxFilePach); - try - { - const Standard_Integer aFileBufferSize = 100 * 1024; - TCollection_AsciiString aReadedText(aFileBufferSize); - aCxxFile.Open(OSD_ReadOnly, OSD_Protection()); - aCxxFile.Read(aReadedText, aFileBufferSize); - TCollection_AsciiString aRegexpTemplate = aClassName + "::" + theSampleName + "[\\n\\s]*\\([\\n\\s]*\\)[\\n\\s]*\\{"; - Standard_Integer aOpeningBracketPosition = findEndOfPhrase (aReadedText, aRegexpTemplate); - Standard_Integer aClosingBracketPosition = findClosingBracket (aReadedText, aOpeningBracketPosition, '}'); - myCode = aReadedText.SubString(aOpeningBracketPosition + 1, aClosingBracketPosition - 1); - } - catch (...) - { - TraceError(TCollection_AsciiString("Cannot open file: ") + aCxxFilePach); - } -} - -Standard_Integer BaseSample::findEndOfPhrase (const TCollection_AsciiString& theText, - const TCollection_AsciiString& theRegexpTemplate) -{ - Standard_Integer aIndexOfLastFoundSymbol = -1; - std::string aStdText = theText.ToCString(); - std::string aRegexpTemplate = theRegexpTemplate.ToCString(); - - try - { - std::regex aRegex(theRegexpTemplate.ToCString()); - - std::sregex_iterator aDetectIterator = std::sregex_iterator(aStdText.begin(), aStdText.end(), aRegex); - if (aDetectIterator != std::sregex_iterator()) - { - std::smatch aMatch = *aDetectIterator; - std::string aFoundString = aMatch.str(); - aIndexOfLastFoundSymbol = static_cast(aStdText.find(aFoundString) + aFoundString.length()); - } - else - { - TraceError(TCollection_AsciiString("No code found for template: ") + theRegexpTemplate); - } - } - catch (const std::regex_error& aRegError) - { - TraceError(TCollection_AsciiString("regex_error: ") + aRegError.what()); - } - catch (const std::exception& aEx) - { - TraceError(TCollection_AsciiString("common error: ") + aEx.what()); - } - catch (...) - { - TraceError("unknown error!"); - } - return aIndexOfLastFoundSymbol; -} - -Standard_Integer BaseSample::findClosingBracket (const TCollection_AsciiString& theText, - const Standard_Integer theOpeningBracketIndex, - Standard_Character theClosingBracketSymbol) -{ - // TODO this function not implemented at least 2 cases: - // - brackets in strings & chars - // - brackets in comments - Standard_Integer aClosingBracketIndex = -1; - Standard_Character anOpeningBracketSymbol = theText.Value(theOpeningBracketIndex); - TCollection_AsciiString aBracketsSet(theClosingBracketSymbol); - aBracketsSet += anOpeningBracketSymbol; - Standard_Integer aBracketDepth = 1; - Standard_Integer aStartFindIndex = theOpeningBracketIndex + 1; - //Standard_Character aStartFindChar = theText.Value(aStartFindIndex-1); - while (aBracketDepth) - { - aStartFindIndex = theText.FirstLocationInSet(aBracketsSet, aStartFindIndex, theText.Length()); - if (!aStartFindIndex) - { - TraceError("No closing bracket found!"); - break; - } - TCollection_AsciiString aRSubstr = theText.SubString(aStartFindIndex, theText.Length()); - if (theText.Value(aStartFindIndex) == anOpeningBracketSymbol) - aBracketDepth++; - else if (theText.Value(aStartFindIndex) == theClosingBracketSymbol) - aBracketDepth--; - if (!aBracketDepth) - { - aClosingBracketIndex = aStartFindIndex; - break; - } - aStartFindIndex++; - } - return aClosingBracketIndex; -} diff --git a/samples/qt/OCCTOverview/code/BaseSample.h b/samples/qt/OCCTOverview/code/BaseSample.h deleted file mode 100644 index 20c2470af6..0000000000 --- a/samples/qt/OCCTOverview/code/BaseSample.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef BASESAMPLE_H -#define BASESAMPLE_H - -#include - -#include -#include -#include - -//! Base class for specified category classes -class BaseSample: public Standard_Transient -{ - DEFINE_STANDARD_RTTI_INLINE(BaseSample, Standard_Transient) -public: - BaseSample (const TCollection_AsciiString& theSampleSourcePath, - const Handle(AIS_InteractiveContext)& theContext) - : myCodePath (theSampleSourcePath), - myContext (theContext) - { - // - } - - void Clear(); - void AppendCube(); - - Standard_Boolean IsProcessed() const { return myIsProcessed; } - - const NCollection_Vector& Get2dObjects() const { return myObject2d; } - - const NCollection_Vector& Get3dObjects() const { return myObject3d; } - - TCollection_AsciiString GetResult(); - - TCollection_AsciiString GetCode() const { return myCode; } - - virtual void Process (const TCollection_AsciiString& theSampleName); - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) = 0; - - void FindSourceCode (const TCollection_AsciiString& theSampleName); - void TraceError (const TCollection_AsciiString& theErrorMessage); - -protected: - - Standard_Boolean myIsProcessed; - NCollection_Vector myObject2d; - NCollection_Vector myObject3d; - - std::ostringstream myResult; - TCollection_AsciiString myCode; - TCollection_AsciiString myCodePath; - Handle(AIS_InteractiveContext) myContext; - -protected: - static const TCollection_AsciiString FILE_EXTENSION; - -private: - Standard_Integer findEndOfPhrase (const TCollection_AsciiString& theText, - const TCollection_AsciiString& theRegexpTemplate); - Standard_Integer findClosingBracket (const TCollection_AsciiString& theText, - Standard_Integer theOpeningBracketIndex, - Standard_Character theClosingBracketSymbol); -}; - -#endif //BASESAMPLE_H diff --git a/samples/qt/OCCTOverview/code/DataExchange.xml b/samples/qt/OCCTOverview/code/DataExchange.xml deleted file mode 100644 index a664a7a3f7..0000000000 --- a/samples/qt/OCCTOverview/code/DataExchange.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/qt/OCCTOverview/code/DataExchangeSamples.cxx b/samples/qt/OCCTOverview/code/DataExchangeSamples.cxx deleted file mode 100644 index 81abc8aad7..0000000000 --- a/samples/qt/OCCTOverview/code/DataExchangeSamples.cxx +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "DataExchangeSamples.h" - -#include "MakeBottle.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void DataExchangeSamples::Process (const TCollection_AsciiString& theSampleName) -{ - if (IsImportSample(theSampleName)) - { - myObject3d.Clear(); - } - myObject2d.Clear(); - myCode.Clear(); - myIsProcessed = Standard_False; - try - { - ExecuteSample(theSampleName); - } - catch (...) - { - TraceError(TCollection_AsciiString("Error in sample: ") + theSampleName); - } -} - -void DataExchangeSamples::AppendBottle() -{ - TopoDS_Shape aBottle = MakeBottle(50, 70, 30); - Handle(AIS_InteractiveObject) aShape = new AIS_Shape(aBottle); - myObject3d.Append(aShape); - Handle(AIS_ViewCube) aViewCube = new AIS_ViewCube(); - myObject3d.Append(aViewCube); - myResult << "A bottle shape was created." << std::endl; -} - -void DataExchangeSamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "BrepExportSample") - { - BrepExportSample(); - } - else if (theSampleName == "StepExportSample") - { - StepExportSample(); - } - else if (theSampleName == "IgesExportSample") - { - IgesExportSample(); - } - else if (theSampleName == "StlExportSample") - { - StlExportSample(); - } - else if (theSampleName == "VrmlExportSample") - { - VrmlExportSample(); - } - else if (theSampleName == "ImageExportSample") - { - ImageExportSample(); - } - else if (theSampleName == "BrepImportSample") - { - BrepImportSample(); - } - else if (theSampleName == "StepImportSample") - { - StepImportSample(); - } - else if (theSampleName == "IgesImportSample") - { - IgesImportSample(); - } - else - { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -void DataExchangeSamples::BrepExportSample() -{ - Standard_Boolean anIsShapeExist = Standard_False; - for(NCollection_Vector::Iterator anIter(myObject3d); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject)) - { - anIsShapeExist = Standard_True; - if (BRepTools::Write(aShape->Shape(), myFileName.ToCString())) - { - myResult << "A shape was successfully written" << std::endl; - } - else - { - myResult << "A shape was not written" << std::endl; - } - break; // write only one shape - } - } - if (!anIsShapeExist) - { - myResult << "A shape does not exist" << std::endl; - } -} - -void DataExchangeSamples::StepExportSample() -{ - if (myStepType < 0) - { - myResult << "Unknown step type" << std::endl; - return; - } - - IFSelect_ReturnStatus aStatus; - - if (myStepType == STEPControl_FacetedBrep && !CheckFacetedBrep()) - { - myResult << "At least one shape doesn't contain facets" << std::endl; - return; - } - - STEPControl_Writer aStepWriter; - for(NCollection_Vector::Iterator anIter(myObject3d); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject)) - { - aStatus = aStepWriter.Transfer(aShape->Shape(), myStepType); - if (aStatus != IFSelect_RetDone) - { - myResult << "A shape was not transferred successfully" << std::endl; - return; - } - } - } - aStatus = aStepWriter.Write(myFileName.ToCString()); - - switch (aStatus) - { - case IFSelect_RetError: - myResult << "Incorrect Data." << std::endl; - break; - case IFSelect_RetFail: - myResult << "Writing error" << std::endl; - break; - case IFSelect_RetVoid: - myResult << "Nothing to transfer." << std::endl; - break; - case IFSelect_RetStop: - case IFSelect_RetDone: - myResult << "A STEP file was successfully written" << std::endl; - break; - } - -} - -void DataExchangeSamples::IgesExportSample() -{ - IGESControl_Controller::Init(); - IGESControl_Writer anIgesWriter(Interface_Static::CVal("XSTEP.iges.unit"), - Interface_Static::IVal("XSTEP.iges.writebrep.mode")); - - Standard_Boolean anIsShapeExist = Standard_False; - for(NCollection_Vector::Iterator anIter(myObject3d); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject)) - { - anIsShapeExist = Standard_True; - anIgesWriter.AddShape(aShape->Shape()); - } - } - if (anIsShapeExist) - { - anIgesWriter.ComputeModel(); - if (anIgesWriter.Write(myFileName.ToCString())) - { - myResult << "A STEP file was successfully written" << std::endl; - } - else - { - myResult << "A STEP file was not written" << std::endl; - } - } - else - { - myResult << "Shapes do not exist" << std::endl; - } -} - -void DataExchangeSamples::StlExportSample() -{ - TopoDS_Compound aTopoCompound; - BRep_Builder aBuilder; - aBuilder.MakeCompound(aTopoCompound); - - Standard_Boolean anIsShapeExist = Standard_False; - for(NCollection_Vector::Iterator anIter(myObject3d); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject)) - { - anIsShapeExist = Standard_True; - aBuilder.Add(aTopoCompound, aShape->Shape()); - } - } - if (anIsShapeExist) - { - StlAPI_Writer aStlWriter; - if (aStlWriter.Write(aTopoCompound, myFileName.ToCString())) - { - myResult << "A STL file was successfully written" << std::endl; - } - else - { - myResult << "A STL file was not written" << std::endl; - } - } - else - { - myResult << "Shapes do not exist" << std::endl; - } -} - -void DataExchangeSamples::VrmlExportSample() -{ - TopoDS_Compound aTopoCompound; - BRep_Builder aBrepBuilder; - aBrepBuilder.MakeCompound(aTopoCompound); - - Standard_Boolean anIsShapeExist = Standard_False; - for(NCollection_Vector::Iterator anIter(myObject3d); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject)) - { - anIsShapeExist = Standard_True; - aBrepBuilder.Add(aTopoCompound, aShape->Shape()); - } - } - if (anIsShapeExist) - { - VrmlAPI_Writer aVrmlWriter; - if (aVrmlWriter.Write(aTopoCompound, myFileName.ToCString())) - { - myResult << "A VRML file was successfully written" << std::endl; - } - else - { - myResult << "A VRML file was not written" << std::endl; - } - } - else - { - myResult << "Shapes do not exist" << std::endl; - } -} - -void DataExchangeSamples::ImageExportSample() -{ - if (myView) - { - Standard_Boolean aResult = myView->Dump(myFileName.ToCString()); - if (aResult) - { - myResult << "An image file was successfully written" << std::endl; - } - else - { - myResult << "An image file was not written" << std::endl; - } - } -} - -void DataExchangeSamples::BrepImportSample() -{ - TopoDS_Shape aTopoShape; - BRep_Builder aBuilder; - Standard_Boolean aResult = BRepTools::Read(aTopoShape, myFileName.ToCString(), aBuilder); - if (aResult) - { - Handle(AIS_Shape) anAisShape = new AIS_Shape(aTopoShape); - myObject3d.Append(anAisShape); - myResult << "A BREP file was read successfully" << std::endl; - } - else - { - myResult << "A BREP file was not read successfully" << std::endl; - } -} - -void DataExchangeSamples::StepImportSample() -{ - Handle(TopTools_HSequenceOfShape) aSequence = new TopTools_HSequenceOfShape(); - STEPControl_Reader aReader; - const IFSelect_ReturnStatus aStatus = aReader.ReadFile(myFileName.ToCString()); - if (aStatus != IFSelect_RetDone) - { - myResult << "A BREP file was not read successfully" << std::endl; - return; - } - - bool anIsFailsOnly = false; - aReader.PrintCheckLoad(anIsFailsOnly, IFSelect_ItemsByEntity); - - int aRootsNumber = aReader.NbRootsForTransfer(); - aReader.PrintCheckTransfer(anIsFailsOnly, IFSelect_ItemsByEntity); - for (Standard_Integer i = 1; i <= aRootsNumber; i++) - { - aReader.TransferRoot(i); - } - - int aShapesNumber = aReader.NbShapes(); - for (int i = 1; i <= aShapesNumber; i++) - { - TopoDS_Shape aTopoShape = aReader.Shape(i); - Handle(AIS_Shape) anAisShape = new AIS_Shape(aTopoShape); - myObject3d.Append(anAisShape); - } - myResult << "A STEP file was read successfully" << std::endl; -} - -void DataExchangeSamples::IgesImportSample() -{ - IGESControl_Reader aReader; - int status = aReader.ReadFile (myFileName.ToCString()); - if (status != IFSelect_RetDone) - { - myResult << "A IGES file was not read successfully" << std::endl; - return; - } - aReader.TransferRoots(); - TopoDS_Shape aTopoShape = aReader.OneShape(); - Handle(AIS_Shape) anAisShape = new AIS_Shape (aTopoShape); - myObject3d.Append(anAisShape); - myResult << "A IGES file was read successfully" << std::endl; -} - -Standard_Boolean DataExchangeSamples::CheckFacetedBrep() -{ - Standard_Boolean anError = Standard_False; - for(NCollection_Vector::Iterator anIter (myObject3d); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anObject)) - { - const TopoDS_Shape aTopoShape = aShape->Shape(); - for (TopExp_Explorer aFaceExplorer(aTopoShape, TopAbs_FACE); aFaceExplorer.More() && !anError; aFaceExplorer.Next()) - { - Handle(Geom_Surface) aSurface = BRep_Tool::Surface(TopoDS::Face(aFaceExplorer.Current())); - if (!aSurface->IsKind(STANDARD_TYPE(Geom_Plane))) - { - anError = Standard_True; - } - } - for (TopExp_Explorer anEdgeExplorer(aTopoShape, TopAbs_EDGE); anEdgeExplorer.More() && !anError; anEdgeExplorer.Next()) - { - Standard_Real fd, ld; - Handle(Geom_Curve) curve = BRep_Tool::Curve(TopoDS::Edge(anEdgeExplorer.Current()), fd, ld); - if (!curve->IsKind(STANDARD_TYPE(Geom_Line))) - { - anError = Standard_True; - } - } - } - } - return !anError; -} diff --git a/samples/qt/OCCTOverview/code/DataExchangeSamples.h b/samples/qt/OCCTOverview/code/DataExchangeSamples.h deleted file mode 100644 index 5925065717..0000000000 --- a/samples/qt/OCCTOverview/code/DataExchangeSamples.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef DATAEXCHANGESAMPLES_H -#define DATAEXCHANGESAMPLES_H - -#include "BaseSample.h" - -#include -#include - -//! Implements Data Exchange samples -class DataExchangeSamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(DataExchangeSamples, BaseSample) -public: - - DataExchangeSamples (const TCollection_AsciiString& theSampleSourcePath, - const Handle(V3d_View)& theView, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample (theSampleSourcePath, theContext), - myStepType (STEPControl_AsIs), - myView (theView) - { - // - } - - virtual void Process (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - - void AppendBottle(); - void SetFileName(TCollection_AsciiString theFileName) { myFileName = theFileName; }; - void SetStepType(STEPControl_StepModelType theStepType) { myStepType = theStepType; }; - - static Standard_Boolean IsExportSample(const TCollection_AsciiString& theSampleName) { return theSampleName == "BrepExportSample" - || theSampleName == "StepExportSample" - || theSampleName == "IgesExportSample" - || theSampleName == "StlExportSample" - || theSampleName == "VrmlExportSample" - || theSampleName == "ImageExportSample"; } - static Standard_Boolean IsImportSample(const TCollection_AsciiString& theSampleName) { return theSampleName == "BrepImportSample" - || theSampleName == "StepImportSample" - || theSampleName == "IgesImportSample"; } - static Standard_Boolean IsBrepSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "BrepExportSample" || theSampleName == "BrepImportSample"; } - static Standard_Boolean IsStepSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "StepExportSample" || theSampleName == "StepImportSample"; } - static Standard_Boolean IsIgesSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "IgesExportSample" || theSampleName == "IgesImportSample"; } - static Standard_Boolean IsStlSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "StlExportSample"; } - static Standard_Boolean IsVrmlSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "VrmlExportSample"; } - static Standard_Boolean IsImageSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "ImageExportSample"; } - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - TCollection_AsciiString myFileName; - STEPControl_StepModelType myStepType; - Handle(V3d_View) myView; - -private: - Standard_Boolean CheckFacetedBrep(); - // One function for every sample - void BrepExportSample(); - void StepExportSample(); - void IgesExportSample(); - void StlExportSample(); - void VrmlExportSample(); - void ImageExportSample(); - void BrepImportSample(); - void StepImportSample(); - void IgesImportSample(); -}; - -#endif //DATAEXCHANGESAMPLES_H diff --git a/samples/qt/OCCTOverview/code/Geometry.xml b/samples/qt/OCCTOverview/code/Geometry.xml deleted file mode 100644 index 75133644bb..0000000000 --- a/samples/qt/OCCTOverview/code/Geometry.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/qt/OCCTOverview/code/GeometrySamples.cxx b/samples/qt/OCCTOverview/code/GeometrySamples.cxx deleted file mode 100644 index 278e5e1089..0000000000 --- a/samples/qt/OCCTOverview/code/GeometrySamples.cxx +++ /dev/null @@ -1,2027 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "GeometrySamples.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "AdaptorPnt2d_AIS.h" -#include "AdaptorVec_AIS.h" -#include "AdaptorCurve_AIS.h" -#include "AdaptorCurve2d_AIS.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -void GeometrySamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "ZeroDimensionObjects3dSample") - ZeroDimensionObjects3dSample(); - else if (theSampleName == "Vectors3dSample") - Vectors3dSample(); - else if (theSampleName == "InfinityLines3dSample") - InfinityLines3dSample(); - else if (theSampleName == "SecondOrderCurves3dSample") - SecondOrderCurves3dSample(); - else if (theSampleName == "PlaneSurfaces3dSample") - PlaneSurfaces3dSample(); - else if (theSampleName == "SecondOrderSurfaces3dSample") - SecondOrderSurfaces3dSample(); - else if (theSampleName == "ZeroDimensionObjects2dSample") - ZeroDimensionObjects2dSample(); - else if (theSampleName == "Vectors2dSample") - Vectors2dSample(); - else if (theSampleName == "InfinityLines2dSample") - InfinityLines2dSample(); - else if (theSampleName == "SecondOrderCurves2dSample") - SecondOrderCurves2dSample(); - else if (theSampleName == "BarycenterPoint3dSample") - BarycenterPoint3dSample(); - else if (theSampleName == "RotatedVector3dSample") - RotatedVector3dSample(); - else if (theSampleName == "MirroredLine3dSample") - MirroredLine3dSample(); - else if (theSampleName == "ScaledEllipse3dSample") - ScaledEllipse3dSample(); - else if (theSampleName == "TransformedCylinder3dSample") - TransformedCylinder3dSample(); - else if (theSampleName == "TranslatedTorus3dSample") - TranslatedTorus3dSample(); - else if (theSampleName == "ConjugateObjects3dSample") - ConjugateObjects3dSample(); - else if (theSampleName == "ProjectionOfPoint3dSample") - ProjectionOfPoint3dSample(); - else if (theSampleName == "MinimalDistance3dSample") - MinimalDistance3dSample(); - else if (theSampleName == "MirroredAxis2dSample") - MirroredAxis2dSample(); - else if (theSampleName == "TransformedEllipse2dSample") - TransformedEllipse2dSample(); - else if (theSampleName == "ConjugateObjects2dSample") - ConjugateObjects2dSample(); - else if (theSampleName == "Intersection3dSample") - Intersection3dSample(); - else if (theSampleName == "TranslatedPoint2dSample") - TranslatedPoint2dSample(); - else if (theSampleName == "RotatedDirection2dSample") - RotatedDirection2dSample(); - else if (theSampleName == "Tangent2dSample") - Tangent2dSample(); - else if (theSampleName == "ProjectionOfPoint2dSample") - ProjectionOfPoint2dSample(); - else if (theSampleName == "MinimalDistance2dSample") - MinimalDistance2dSample(); - else if (theSampleName == "Intersection2dSample") - Intersection2dSample(); - else if (theSampleName == "PointInfo3dSample") - PointInfo3dSample(); - else if (theSampleName == "EllipseInfo3dSample") - EllipseInfo3dSample(); - else if (theSampleName == "PointInfo2dSample") - PointInfo2dSample(); - else if (theSampleName == "CircleInfo2dSample") - CircleInfo2dSample(); - else if (theSampleName == "SecondOrderCurves3dSample") - SecondOrderCurves3dSample(); - else if (theSampleName == "FreeStyleCurves3dSample") - FreeStyleCurves3dSample(); - else if (theSampleName == "AnalyticalSurfaces3dSample") - AnalyticalSurfaces3dSample(); - else if (theSampleName == "FreeStyleSurfaces3dSample") - FreeStyleSurfaces3dSample(); - else if (theSampleName == "SecondOrderCurves2dSample") - SecondOrderCurves2dSample(); - else if (theSampleName == "FreeStyleCurves2dSample") - FreeStyleCurves2dSample(); - else if (theSampleName == "TrimmedCurve3dSample") - TrimmedCurve3dSample(); - else if (theSampleName == "OffsetCurve3dSample") - OffsetCurve3dSample(); - else if (theSampleName == "BSplineFromCircle3dSample") - BSplineFromCircle3dSample(); - else if (theSampleName == "TrimmedSurface3dSample") - TrimmedSurface3dSample(); - else if (theSampleName == "OffsetSurface3dSample") - OffsetSurface3dSample(); - else if (theSampleName == "ExtrusionSurface3dSample") - ExtrusionSurface3dSample(); - else if (theSampleName == "RevolutionSurface3dSample") - RevolutionSurface3dSample(); - else if (theSampleName == "TrimmedCurve2dSample") - TrimmedCurve2dSample(); - else if (theSampleName == "OffsetCurve2dSample") - OffsetCurve2dSample(); - else if (theSampleName == "BoundingBoxOfSurface3dSample") - BoundingBoxOfSurface3dSample(); - else if (theSampleName == "BoundingBoxOfCurves3dSample") - BoundingBoxOfCurves3dSample(); - else if (theSampleName == "BoundingBoxOfCurves2dSample") - BoundingBoxOfCurves2dSample(); - else if (theSampleName == "DumpCircleInfoSample") - DumpCircleInfoSample(); - else if (theSampleName == "DumpBSplineCurveInfoSample") - DumpBSplineCurveInfoSample(); - else - { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -void GeometrySamples::DisplayPnt (const gp_Pnt2d& thePnt2d, const TCollection_AsciiString& theText, - Aspect_TypeOfMarker theMarker, Standard_Real theDistance) -{ - gp_Pnt aPnt(thePnt2d.X(), thePnt2d.Y(), 0.0); - Handle(Geom_CartesianPoint) aGeomPoint = new Geom_CartesianPoint(aPnt); - Handle(AIS_Point) anAisPoint = new AIS_Point(aGeomPoint); - anAisPoint->SetMarker(theMarker); - myObject2d.Append(anAisPoint); - Handle(AIS_TextLabel) aPntLabel = new AIS_TextLabel(); - aPntLabel->SetText(theText); - aPntLabel->SetPosition(gp_Pnt(aPnt.X(), aPnt.Y() + theDistance, aPnt.Z())); - myObject2d.Append(aPntLabel); -} -void GeometrySamples::DisplayPnt (const gp_Pnt& thePnt, const TCollection_AsciiString& theText, - Aspect_TypeOfMarker theMarker, Standard_Real theDistance) -{ - Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(thePnt); - Handle(AIS_Point) anAisPoint = new AIS_Point(aPoint); - anAisPoint->SetMarker(theMarker); - myObject3d.Append(anAisPoint); - Handle(AIS_TextLabel) aPntLabel = new AIS_TextLabel(); - aPntLabel->SetText(theText); - aPntLabel->SetPosition(gp_Pnt(thePnt.X(), thePnt.Y(), thePnt.Z() + theDistance)); - myObject3d.Append(aPntLabel); -} - -void GeometrySamples::ZeroDimensionObjects3dSample() -{ - // gp_Pnt describes a point in 3D space. A Geom_CartesianPoint is defined by - // a gp_Pnt point, with its three Cartesian coordinates X, Y and Z. - gp_Pnt aCoordPnt(10.0, 20.0, 30.0); - Handle(Geom_CartesianPoint) aCoordGeomPoint = new Geom_CartesianPoint(aCoordPnt); - Handle(AIS_Point) aCoordAisPoint = new AIS_Point(aCoordGeomPoint); - myObject3d.Append(aCoordAisPoint); - - Handle(AIS_TextLabel) aPntLabel = new AIS_TextLabel(); - aPntLabel->SetText(" gp_Pnt"); - aPntLabel->SetPosition(gp_Pnt(aCoordPnt.X(), aCoordPnt.Y(), aCoordPnt.Z() + 5.0)); - myObject3d.Append(aPntLabel); - myResult << "gp_Pnt was created" << std::endl; - - // gp_XYZ class describes a Cartesian coordinate entity in 3D space (X,Y,Z). - // This entity is used for algebraic calculation. - // This entity can be transformed with a "Trsf" or a "GTrsf" from package "gp". - // It is used in vectorial computations or for holding this type of information - // in data structures. - gp_XYZ aXyz1(10.0, 20.0, 30.0); - gp_XYZ aXyz2(20.0, 10.0, 30.0); - gp_XYZ aXyzSum = aXyz1 + aXyz2; - gp_Pnt aSumPnt(aXyzSum); - Handle(Geom_CartesianPoint) aXyzGeomPoint = new Geom_CartesianPoint(aSumPnt); - Handle(AIS_Point) aSumAisPoint = new AIS_Point(aXyzGeomPoint); - myObject3d.Append(aSumAisPoint); - - Handle(AIS_TextLabel) aXyzLabel = new AIS_TextLabel(); - aXyzLabel->SetText(" gp_XYZ"); - aXyzLabel->SetPosition(gp_Pnt(aXyzSum.X(), aXyzSum.Y(), aXyzSum.Z() + 5.0)); - myObject3d.Append(aXyzLabel); - myResult << "gp_XYZ was created" << std::endl; -} - -void GeometrySamples::Vectors3dSample() -{ - gp_Pnt aPnt1(0.0, 0.0, 0.0); - gp_Pnt aPnt2(5.0, 0.0, 0.0); - - // gp_Vec defines a non-persistent vector in 3D space. - gp_Vec aVec(aPnt1, aPnt2); - Handle(AdaptorVec_AIS) aVecAIS = new AdaptorVec_AIS(aPnt1, aVec, 0.5); - aVecAIS->SetText(" gp_Vec"); - myObject3d.Append(aVecAIS); - myResult << "gp_Vec magnitude: " << aVec.Magnitude() << std::endl; - - // Describes a unit vector in 3D space. - // This unit vector is also called "Direction". - // See Also gce_MakeDir which provides functions for more complex unit vector - // constructions Geom_Direction which provides additional functions - // for constructing unit vectors and works, in particular, - // with the parametric equations of unit vectors. - gp_Dir aDir(aVec); - Handle(AdaptorVec_AIS) aDirAIS = new AdaptorVec_AIS(gp_Pnt(0.0, 0.0, 10.0), aDir, 1.0, 0.5); - aDirAIS->SetText(" gp_Dir"); - myObject3d.Append(aDirAIS); - myResult << "gp_Dir coordinates: X: " << aDir.X() << ", Y: " << aDir.Y() << ", Z: " << aDir.Z() << std::endl; -} - -void GeometrySamples::InfinityLines3dSample() -{ - gp_Pnt aBasePoint(0.0, 0.0, 0.0); - gp_Dir aX_Direction(1.0, 0.0, 0.0); - gp_Dir anY_Direction(0.0, 1.0, 0.0); - gp_Dir aZ_Direction(0.0, 0.0, 1.0); - - // Describes an axis in 3D space. - gp_Ax1 anAxis1(aBasePoint, aZ_Direction); - Handle(AdaptorVec_AIS) anAx1Ais = new AdaptorVec_AIS(anAxis1.Location(), anAxis1.Direction(), 1.0, 0.3); - anAx1Ais->SetText(" gp_Ax1"); - myObject3d.Append(anAx1Ais); - myResult << "gp_Ax1 was created" << std::endl << std::endl; - - // Describes a right - handed coordinate system in 3D space. - aBasePoint.SetCoord(0.0, 0.0, 3.0); - gp_Ax2 anAxis2(aBasePoint, aZ_Direction); - Handle(AdaptorVec_AIS) aAx2AisZ = new AdaptorVec_AIS(anAxis2.Location(), anAxis2.Direction(), 1.0, 0.3); - aAx2AisZ->SetText(" gp_Ax2 Z"); - myObject3d.Append(aAx2AisZ); - Handle(AdaptorVec_AIS) aAx2AisX = new AdaptorVec_AIS(anAxis2.Location(), anAxis2.XDirection(), 1.0, 0.3); - aAx2AisX->SetText(" gp_Ax2 X"); - myObject3d.Append(aAx2AisX); - Handle(AdaptorVec_AIS) aAx2AisY = new AdaptorVec_AIS(anAxis2.Location(), anAxis2.YDirection(), 1.0, 0.3); - aAx2AisY->SetText(" gp_Ax2 Y"); - myObject3d.Append(aAx2AisY); - myResult << "gp_Ax2 was created" << std::endl; - - // Describes a coordinate system in 3D space.Unlike a gp_Ax2 coordinate system, - // a gp_Ax3 can be right - handed("direct sense") or left - handed("indirect sense"). - gp_Ax3 anAxis3(gp_XYZ(0.0, 0.0, 6.0), aZ_Direction, aX_Direction); - anAxis3.YReverse(); - Handle(AdaptorVec_AIS) anAx3AisZ = new AdaptorVec_AIS(anAxis3.Location(), anAxis3.Direction(), 1.0, 0.3); - anAx3AisZ->SetText(" gp_Ax3 Z"); - myObject3d.Append(anAx3AisZ); - Handle(AdaptorVec_AIS) anAx3AisX = new AdaptorVec_AIS(anAxis3.Location(), anAxis3.XDirection(), 1.0, 0.3); - anAx3AisX->SetText(" gp_Ax3 X"); - myObject3d.Append(anAx3AisX); - Handle(AdaptorVec_AIS) anAx3AisY = new AdaptorVec_AIS(anAxis3.Location(), anAxis3.YDirection(), 1.0, 0.3); - anAx3AisY->SetText(" gp_Ax3 Y"); - myObject3d.Append(anAx3AisY); - - myResult << "gp_Ax3 was created" << std::endl; - const gp_Dir& anAxis3_xDir = anAxis3.XDirection(); - const gp_Dir& anAxis3_yDir = anAxis3.YDirection(); - myResult << "gp_Ax3 X direction: " << anAxis3_xDir.X() << " " << anAxis3_xDir.Y() << " " << anAxis3_xDir.Z() << std::endl; - myResult << "gp_Ax3 Y direction: " << anAxis3_yDir.X() << " " << anAxis3_yDir.Y() << " " << anAxis3_yDir.Z() << std::endl; - TCollection_AsciiString aDirectionDescription; - if (anAxis3.Direct()) - { - aDirectionDescription = "anAxis3 is a right-handed axis system"; - } - else - { - aDirectionDescription = "anAxis3 is a left-handed axis system"; - } - myResult << aDirectionDescription << std::endl << std::endl; - - // Describes a line in 3D space. A line is positioned in space with an axis - // (a gp_Ax1 object) which gives it an origin and a unit vector. - gp_Lin aLine(gp_Pnt(5.0, 0.0, 0.0), gp_Dir(0.0, 1.0, 0.0)); - Handle(AdaptorVec_AIS) anLineAis = new AdaptorVec_AIS(aLine.Location(), aLine.Direction(), 8.0); - anLineAis->SetText(" gp_Lin"); - myObject3d.Append(anLineAis); - myResult << "gp_Lin was created" << std::endl << std::endl; -} - -void GeometrySamples::SecondOrderCurves3dSample() -{ - gp_Ax2 anAxis2(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0)); - gp_Circ aCirc(anAxis2, 10.0); - Handle(Geom_Circle) aGeomCircle = new Geom_Circle(aCirc); - Handle(AIS_Circle) anAisCircle = new AIS_Circle(aGeomCircle); - myObject3d.Append(anAisCircle); - - // Describes an ellipse in 3D space. An ellipse is defined by its major and minor - // radii and positioned in space with a coordinate system (a gp_Ax2 object) - gp_Elips anElips(anAxis2.Translated(gp_Vec(0.0, 0.0, 10.0)), 20.0, 10.0); - Handle(Geom_Ellipse) aGeomEllipse = new Geom_Ellipse(anElips); - Handle(AdaptorCurve_AIS) anAisEllipce = new AdaptorCurve_AIS(aGeomEllipse); - myObject3d.Append(anAisEllipce); - - // Describes a parabola in 3D space. A parabola is defined by its focal length - // (that is, the distance between its focus and apex) and positioned in space with - // a coordinate system (a gp_Ax2 object) - gp_Parab aParab(anAxis2.Translated(gp_Vec(0.0, 0.0, 20.0)), 2.0); - Handle(Geom_Parabola) aGeomParabola = new Geom_Parabola(aParab); - Handle(Geom_TrimmedCurve) aTrimmedParabola = new Geom_TrimmedCurve(aGeomParabola, 20.0, -20.0); - Handle(AdaptorCurve_AIS) anAisParabola = new AdaptorCurve_AIS(aTrimmedParabola); - myObject3d.Append(anAisParabola); - - // Describes a branch of a hyperbola in 3D space. A hyperbola is defined by its major - // and minor radii and positioned in space with a coordinate system (a gp_Ax2 object) - gp_Hypr aHypr(anAxis2.Translated(gp_Vec(0.0, 0.0, 30.0)), 20.0, 10.0); - Handle(Geom_Hyperbola) aGeomHyperbola = new Geom_Hyperbola(aHypr); - Handle(Geom_TrimmedCurve) aTrimmedHyperbola = new Geom_TrimmedCurve(aGeomHyperbola, 2.0, -2.0); - Handle(AdaptorCurve_AIS) anAisHyperbola = new AdaptorCurve_AIS(aTrimmedHyperbola); - myObject3d.Append(anAisHyperbola); -} - -void GeometrySamples::PlaneSurfaces3dSample() -{ - // Describes a plane.A plane is positioned in space with a coordinate system(a gp_Ax3 object), - // such that the plane is defined by the origin, "X Direction" and "Y Direction" of this - // coordinate system, which is the "local coordinate system" of the plane.The "main Direction" - // of the coordinate system is a vector normal to the plane. - gp_Pln aPln(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0)); - Handle(Geom_Plane) aPlane = new Geom_Plane(aPln); - Handle(AIS_Plane) anAisPlane = new AIS_Plane(aPlane, aPln.Location(), - gp_Pnt(10.0, 10.0, 0.0), - gp_Pnt(-10.0, -10.0, 0.0), - Standard_False); - myObject3d.Append(anAisPlane); - - // Describes an infinite cylindrical surface.A cylinder is defined by its radius and positioned - // in space with a coordinate system(a gp_Ax3 object), the "main Axis" of which is the axis of - // the cylinder.This coordinate system is the "local coordinate system" of the cylinder. - gp_Cylinder aCylinder(gp_Ax3(gp_Pnt(0.0, 0.0, 10.0), gp_Dir(0.0, 0.0, 1.0)), 10.0); - Handle(Geom_CylindricalSurface) aCylindricalSurface = new Geom_CylindricalSurface(aCylinder); - Handle(AIS_Shape) anAisCylinder = new AIS_Shape(BRepBuilderAPI_MakeFace( - aCylindricalSurface, 0.0, 2.0*M_PI, 0.0, 10.0, Precision::Confusion()).Shape()); - myObject3d.Append(anAisCylinder); - - // Defines an infinite conical surface. A cone is defined by its half-angle (can be negative) at - // the apex and positioned in space with a coordinate system (a gp_Ax3 object) and a "reference radius" - gp_Cone aCone(gp_Ax3(gp_Pnt(0.0, 0.0, 30.0), gp_Dir(0.0, 0.0, 1.0)), 0.25*M_PI, 0.0); - Handle(Geom_ConicalSurface) aConicalSurface = new Geom_ConicalSurface(aCone); - Handle(AIS_Shape) anAisCone = new AIS_Shape(BRepBuilderAPI_MakeFace( - aConicalSurface, 0.0, 2.0*M_PI, 0.0, 20.0, Precision::Confusion()).Shape()); - myObject3d.Append(anAisCone); -} - -void GeometrySamples::SecondOrderSurfaces3dSample() -{ - gp_Sphere aSphere(gp_Ax3(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0)), 10.0); - Handle(Geom_SphericalSurface) aSphericalSurface = new Geom_SphericalSurface(aSphere); - Handle(AIS_Shape) anAisSphere = new AIS_Shape(BRepBuilderAPI_MakeFace( - aSphericalSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisSphere); - - gp_Torus aTorus(gp_Ax3(gp_Pnt(0.0, 0.0, 20.0), gp_Dir(0.0, 0.0, 1.0)), 40.0, 10.0); - Handle(Geom_ToroidalSurface) aToroidalSurface = new Geom_ToroidalSurface(aTorus); - Handle(AIS_Shape) anAisTorus = new AIS_Shape(BRepBuilderAPI_MakeFace( - aToroidalSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisTorus); -} - -void GeometrySamples::ZeroDimensionObjects2dSample() -{ - // Defines a non-persistent 2D Cartesian point. - gp_Pnt2d aCoordPnt(10.0, 20.0); - Handle(Geom2d_CartesianPoint) aCoordGeomPoint = new Geom2d_CartesianPoint(aCoordPnt); - Handle(AdaptorPnt2d_AIS) aCoordAisPoint = new AdaptorPnt2d_AIS(aCoordGeomPoint); - myObject2d.Append(aCoordAisPoint); - - Handle(AIS_TextLabel) aPntLabel = new AIS_TextLabel(); - aPntLabel->SetText("gp_Pnt2d"); - aPntLabel->SetPosition(gp_Pnt(aCoordPnt.X(), aCoordPnt.Y() + 0.5, 0.0)); - myObject2d.Append(aPntLabel); - myResult << "gp_Pnt was created" << std::endl; - - // This class describes a Cartesian coordinate entity in 2D space{ X,Y }. - // This class is non persistent.This entity used for algebraic calculation. - // An XY can be transformed with a Trsf2d or a GTrsf2d from package gp. - // It is used in vectorial computations or for holding this type of information in data structures. - gp_XY aXy(20.0, 10.0); - Handle(Geom2d_CartesianPoint) aXyGeomPoint = new Geom2d_CartesianPoint(aXy); - Handle(AdaptorPnt2d_AIS) aXyAisPoint = new AdaptorPnt2d_AIS(aXyGeomPoint); - myObject2d.Append(aXyAisPoint); - - Handle(AIS_TextLabel) aXyLabel = new AIS_TextLabel(); - aXyLabel->SetText(" gp_XY"); - aXyLabel->SetPosition(gp_Pnt(aXy.X(), aXy.Y() + 0.5, 0.0)); - myObject2d.Append(aXyLabel); - myResult << "gp_XY was created" << std::endl; -} - -void GeometrySamples::Vectors2dSample() -{ - // Describes a unit vector in the plane (2D space). - // This unit vector is also called "Direction". - gp_Dir2d aDir(3.0, 4.0); - Handle(AdaptorVec_AIS) anAisDir = new AdaptorVec_AIS(gp_Pnt2d(0.0, 0.0), aDir, 1.0, 0.3); - anAisDir->SetText(" gp_Dir2d"); - myObject2d.Append(anAisDir); - myResult << "gp_Dir2d coordinates: X: " << aDir.X() << ", Y: " << aDir.Y() << std::endl; - - // Defines a non-persistent vector in 2D space. - gp_Vec2d aVec(aDir); - aVec = aVec * 2; - Handle(AdaptorVec_AIS) anAisVec = new AdaptorVec_AIS(gp_Pnt2d(0.0, 5.0), aVec, 0.3); - anAisVec->SetText(" gp_Vec2d"); - myObject2d.Append(anAisVec); - myResult << "gp_Vec2d magnitude: " << aVec.Magnitude() << std::endl; -} - -void GeometrySamples::InfinityLines2dSample() -{ - // Describes an axis in the plane (2D space) - gp_Ax2d anAx2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(1.0, 0.0)); - Handle(AdaptorVec_AIS) anAisAx2d = new AdaptorVec_AIS(anAx2d.Location(), anAx2d.Direction(), 1.0, 0.3); - anAisAx2d->SetText(" gp_Ax2d"); - myObject2d.Append(anAisAx2d); - - // Describes a coordinate system in a plane (2D space). - gp_Ax22d anAx22d(gp_Pnt2d(0.0, 2.0), gp_Dir2d(1.0, 1.0), Standard_False); - Handle(AdaptorVec_AIS) anAisAx2d_X = new AdaptorVec_AIS(anAx22d.Location(), anAx22d.XDirection(), 1.0, 0.3); - anAisAx2d_X->SetText(" gp_Ax2d X"); - myObject2d.Append(anAisAx2d_X); - Handle(AdaptorVec_AIS) anAisAx2d_Y = new AdaptorVec_AIS(anAx22d.Location(), anAx22d.YDirection(), 1.0, 0.3); - anAisAx2d_Y->SetText(" gp_Ax2d Y"); - myObject2d.Append(anAisAx2d_Y); - - // Describes a line in 2D space. A line is positioned in the plane with an axis (a gp_Ax2d object) which gives - // the line its origin and unit vector. A line and an axis are similar objects, thus, - // we can convert one into the other. A line provides direct access to the majority of the edit and query - // functions available on its positioning axis. - gp_Lin2d aLin2d(gp_Pnt2d(2.0, 4.0), gp_Dir2d(0.0, -1.0)); - Handle(AdaptorVec_AIS) anAisLin = new AdaptorVec_AIS(aLin2d.Location(), aLin2d.Direction(), 1.0, 0.3); - anAisLin->SetText(" gp_Lin2d"); - myObject2d.Append(anAisLin); -} - -void GeometrySamples::SecondOrderCurves2dSample() -{ - // Describes a circle in the plane (2D space). A circle is defined by its radius - // and positioned in the plane with a coordinate system (a gp_Ax22d object) - gp_Circ2d aCirc2d; - aCirc2d.SetLocation(gp_Pnt2d(0.0, 0.0)); - aCirc2d.SetRadius(10.0); - Handle(Geom2d_Circle) aGeomCircle = new Geom2d_Circle(aCirc2d); - Handle(AdaptorCurve2d_AIS) anAisCirc = new AdaptorCurve2d_AIS(aGeomCircle, Aspect_TOL_SOLID); - myObject2d.Append(anAisCirc); - - // Describes an ellipse in the plane (2D space). An ellipse is defined by its major - // and minor radii and positioned in the plane with a coordinate system (a gp_Ax22d object) - gp_Elips2d anElips(gp_Ax2d(gp_Pnt2d(0.0, 30.0), gp_Dir2d(1.0, 0.0)), 20.0, 10.0); - Handle(Geom2d_Ellipse) aGeomEllipse = new Geom2d_Ellipse(anElips); - Handle(AdaptorCurve2d_AIS) anAisEllipse = new AdaptorCurve2d_AIS(aGeomEllipse, Aspect_TOL_DASH); - myObject2d.Append(anAisEllipse); - - // Describes a parabola in the plane (2D space). A parabola is defined by its focal length - // (that is, the distance between its focus and apex) and positioned in the plane with - // a coordinate system (a gp_Ax22d object) - gp_Parab2d aParab2d(gp_Ax2d(gp_Pnt2d(20.0, 0.0), gp_Dir2d(1.0, 0.0)), 10.0); - Handle(Geom2d_Parabola) aGeomParabola = new Geom2d_Parabola(aParab2d); - Handle(Geom2d_TrimmedCurve) aTrimmedParabola = new Geom2d_TrimmedCurve(aGeomParabola, 40.0, -40.0); - Handle(AdaptorCurve2d_AIS) anAisParabola = new AdaptorCurve2d_AIS(aTrimmedParabola, Aspect_TOL_DOT); - myObject2d.Append(anAisParabola); - - // Describes a branch of a hyperbola in the plane (2D space). A hyperbola is defined by its major and - // minor radii, and positioned in the plane with a coordinate system (a gp_Ax22d object) - gp_Hypr2d aHypr2d(gp_Ax2d(gp_Pnt2d(20.0, 0.0), gp_Dir2d(1.0, 0.0)), 20.0, 10.0); - Handle(Geom2d_Hyperbola) aGeomHyperbola = new Geom2d_Hyperbola(aHypr2d); - Handle(Geom2d_TrimmedCurve) aTrimmedHyperbola = new Geom2d_TrimmedCurve(aGeomHyperbola, 2.0, -2.0); - Handle(AdaptorCurve2d_AIS) anAisHyperbola = new AdaptorCurve2d_AIS(aTrimmedHyperbola, Aspect_TOL_DOTDASH); - myObject2d.Append(anAisHyperbola); -} - -void GeometrySamples::BarycenterPoint3dSample() -{ - // Barycenter of 2 points - gp_Pnt aPnt1(11, 2, 3); - gp_Pnt aPnt2(13, 4, 5); - gp_Pnt aBarycenterPnt2 = aPnt1; - Standard_Real anAlpha = 3; - Standard_Real anBeta = 7; - // Assigns the result of the following expression to this point: - // (Alpha*this + Beta*P) / (Alpha + Beta) - aBarycenterPnt2.BaryCenter(anAlpha, aPnt2, anBeta); - DisplayPnt(aPnt1, "Pnt1", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt2, "Pnt2", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aBarycenterPnt2, "Barycenter Pnt", Aspect_TOM_O_PLUS, 0.5); - - // BaryCenter of an array of point - gp_Pnt aP1(0, 0, 5); - gp_Pnt aP2(1, 2, 3); - gp_Pnt aP3(2, 3, -2); - gp_Pnt aP4(4, 3, 5); - gp_Pnt aP5(5, 5, 4); - TColgp_Array1OfPnt aPntArray(1, 5); - aPntArray.SetValue(1, aP1); - aPntArray.SetValue(2, aP2); - aPntArray.SetValue(3, aP3); - aPntArray.SetValue(4, aP4); - aPntArray.SetValue(5, aP5); - - Standard_Real Tolerance = 8; - GProp_PEquation aPEquation(aPntArray, Tolerance); - - gp_Pnt aBarycenterPnt5; // P declaration - bool isPoint = false; - if (aPEquation.IsPoint()) - { - isPoint = true; - aBarycenterPnt5 = aPEquation.Point(); - myResult << "GProp_PEquation is a point" << std::endl; - } - else - { - isPoint = false; - myResult << "GProp_PEquation is not a point" << std::endl; - } - - if (aPEquation.IsLinear()) - { - /*... */ - } - if (aPEquation.IsPlanar()) - { - /*... */ - } - if (aPEquation.IsSpace()) - { - /*... */ - } - - const TCollection_AsciiString aPointName("P"); - for (Standard_Integer i = aPntArray.Lower(); i <= aPntArray.Upper(); i++) - { - TCollection_AsciiString aString(i); - aString = aPointName + aString; - DisplayPnt(aPntArray(i), aString, Aspect_TOM_STAR, 0.5); - } - - DisplayPnt(aBarycenterPnt5, "Barycenter of 5 points", Aspect_TOM_O_STAR, 0.5); - myResult << " IsPoint = "; - if (isPoint) - { - myResult << "True --> " << " P ( " << aBarycenterPnt5.X() << aBarycenterPnt5.Y() << aBarycenterPnt5.Z() << " );" << std::endl; - } - else - { - myResult << "False"; - } - myResult << std::endl << " IsLinear = " << (aPEquation.IsLinear() ? "True" : "False"); - myResult << std::endl << " IsPlanar = " << (aPEquation.IsPlanar() ? "True" : "False"); - myResult << std::endl << " IsSpace = " << (aPEquation.IsSpace() ? "True" : "False"); -} - -void GeometrySamples::RotatedVector3dSample() -{ - gp_Vec aBaseVec(0.0, 0.0, 10.0); - gp_Pnt aZeroPnt(0.0, 0.0, 0.0); - gp_Vec aRotatedVec = aBaseVec.Rotated(gp_Ax1(aZeroPnt, gp_Dir(1.0, 0.0, 0.0)), M_PI_4); - - Handle(AdaptorVec_AIS) aBaseVecAIS = new AdaptorVec_AIS(aZeroPnt, aBaseVec); - aBaseVecAIS->SetText(" Base vector"); - myObject3d.Append(aBaseVecAIS); - Handle(AdaptorVec_AIS) aRotatedVecAIS = new AdaptorVec_AIS(aZeroPnt, aRotatedVec); - aRotatedVecAIS->SetText(" Rotated vector"); - myObject3d.Append(aRotatedVecAIS); - Standard_Real anAdgle = aBaseVec.Angle(aRotatedVec)*180.0 / M_PI; - myResult << "An angle between vectors = " << anAdgle << std::endl; -} - -void GeometrySamples::MirroredLine3dSample() -{ - gp_Lin aBaseLin(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(1.0, 1.0, 1.0)); - gp_Ax2 aXyzAxis; - gp_Lin aMirroredLin = aBaseLin.Mirrored(aXyzAxis); - - Handle(AdaptorVec_AIS) aBaseLineAis = new AdaptorVec_AIS(aBaseLin.Location(), aBaseLin.Direction(), 8.0); - aBaseLineAis->SetText(" Base Line"); - myObject3d.Append(aBaseLineAis); - Handle(AdaptorVec_AIS) aMirroredLineAis = new AdaptorVec_AIS(aMirroredLin.Location(), aMirroredLin.Direction(), 8.0); - aMirroredLineAis->SetText(" Mirrored Line"); - myObject3d.Append(aMirroredLineAis); - Handle(AIS_Plane) anAisPlane = new AIS_Plane (new Geom_Plane(gp_Ax3(aXyzAxis)), aXyzAxis.Location(), - gp_Pnt(10.0, 10.0, 0.0), gp_Pnt(-10.0, -10.0, 0.0), Standard_False); - myObject3d.Append(anAisPlane); - Standard_Real anAdgle = aBaseLin.Angle(aMirroredLin)*180.0 / M_PI; - myResult << "An angle between lines = " << anAdgle << std::endl; -} - -void GeometrySamples::ScaledEllipse3dSample() -{ - gp_Ax2 anAxis2(gp_Pnt(), gp_Dir(0.0, 0.0, 1.0)); - gp_Elips anBaseElips(anAxis2, 20.0, 10.0); - gp_Elips anScaledElips = anBaseElips.Scaled(gp_Pnt(), 2.5); - - Handle(Geom_Ellipse) aBaseGeomEllipse = new Geom_Ellipse(anBaseElips); - Handle(AdaptorCurve_AIS) anAisBaseEllipce = new AdaptorCurve_AIS(aBaseGeomEllipse); - myObject3d.Append(anAisBaseEllipce); - - Handle(Geom_Ellipse) aScaledGeomEllipse = new Geom_Ellipse(anScaledElips); - Handle(AdaptorCurve_AIS) anAisScaledEllipce = new AdaptorCurve_AIS(aScaledGeomEllipse); - myObject3d.Append(anAisScaledEllipce); -} - -void GeometrySamples::TransformedCylinder3dSample() -{ - gp_Cylinder aBaseCylinder(gp_Ax3(), 10.0); - gp_Trsf aRotTrsf; - aRotTrsf.SetRotation(gp_Ax1(gp_Pnt(), gp_Dir(1.0, 0.0, 0.0)), M_PI_2); - gp_Trsf aScaleTrsf; - aScaleTrsf.SetScale(gp_Pnt(), 1.5); - gp_Trsf aTranslTrsf; - aTranslTrsf.SetTranslation(gp_Vec(30.0, 0.0, 0.0)); - gp_Trsf aComplexTrsf = aRotTrsf * aScaleTrsf * aTranslTrsf; - gp_Cylinder aTransfCylinder = aBaseCylinder.Transformed(aComplexTrsf); - - Handle(Geom_CylindricalSurface) aBaseCylinderSurface = new Geom_CylindricalSurface(aBaseCylinder); - Handle(AIS_Shape) anAisBaseCylinder = new AIS_Shape(BRepBuilderAPI_MakeFace( - aBaseCylinderSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisBaseCylinder); - Handle(Geom_CylindricalSurface) aTransfCylinderSurface = new Geom_CylindricalSurface(aTransfCylinder); - Handle(AIS_Shape) anAisTransfCylinder = new AIS_Shape(BRepBuilderAPI_MakeFace( - aTransfCylinderSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisTransfCylinder); -} - -void GeometrySamples::TranslatedTorus3dSample() -{ - gp_Torus aBaseTorus(gp_Ax3(gp_Pnt(), gp_Dir(0.0, 0.0, 1.0)), 40.0, 10.0); - gp_Torus aTranslatedTorus = aBaseTorus.Translated(gp_Vec(70.0, 70.0, 70.0)); - - Handle(Geom_ToroidalSurface) aBaseSurface = new Geom_ToroidalSurface(aBaseTorus); - Handle(AIS_Shape) anAisBaseShape = new AIS_Shape(BRepBuilderAPI_MakeFace( - aBaseSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisBaseShape); - Handle(Geom_ToroidalSurface) aTranslSurface = new Geom_ToroidalSurface(aTranslatedTorus); - Handle(AIS_Shape) anAisTranslShape = new AIS_Shape(BRepBuilderAPI_MakeFace( - aTranslSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisTranslShape); -} - -void GeometrySamples::ConjugateObjects3dSample() -{ - gp_Hypr aHypr(gp_Ax2(), 20.0, 10.0); - gp_Ax1 anAsymptote1 = aHypr.Asymptote1(); - gp_Ax1 anAsymptote2 = aHypr.Asymptote2(); - gp_Ax1 aDirectrix1 = aHypr.Directrix1(); - gp_Ax1 aDirectrix2 = aHypr.Directrix2(); - gp_Pnt aFocus1 = aHypr.Focus1(); - gp_Pnt aFocus2 = aHypr.Focus2(); - gp_Pnt aLocation = aHypr.Location(); - - Handle(AdaptorVec_AIS) anAsy1AIS = new AdaptorVec_AIS(anAsymptote1.Location(), gp_Vec(anAsymptote1.Direction())*10.0); - anAsy1AIS->SetText(" Asymptote 1"); - myObject3d.Append(anAsy1AIS); - Handle(AdaptorVec_AIS) anAsy2AIS = new AdaptorVec_AIS(anAsymptote2.Location(), gp_Vec(anAsymptote2.Direction())*10.0); - anAsy2AIS->SetText(" Asymptote 2"); - myObject3d.Append(anAsy2AIS); - Handle(AdaptorVec_AIS) anDir1AIS = new AdaptorVec_AIS(aDirectrix1.Location(), gp_Vec(aDirectrix1.Direction())*10.0); - anDir1AIS->SetText(" Directrix 1"); - myObject3d.Append(anDir1AIS); - Handle(AdaptorVec_AIS) anDir2AIS = new AdaptorVec_AIS(aDirectrix2.Location(), gp_Vec(aDirectrix2.Direction())*10.0); - anDir2AIS->SetText(" Directrix 2"); - myObject3d.Append(anDir2AIS); - - DisplayPnt(aFocus1, "Focus 1", Aspect_TOM_PLUS, 2.0); - DisplayPnt(aFocus2, "Focus 2", Aspect_TOM_PLUS, 2.0); - DisplayPnt(aLocation, "Location", Aspect_TOM_O_STAR, 2.0); - - Handle(Geom_Hyperbola) aGeomHyperbola = new Geom_Hyperbola(aHypr); - Handle(Geom_TrimmedCurve) aTrimmedHyperbola = new Geom_TrimmedCurve(aGeomHyperbola, 2.0, -2.0); - Handle(AdaptorCurve_AIS) anAisHyperbola = new AdaptorCurve_AIS(aTrimmedHyperbola); - myObject3d.Append(anAisHyperbola); -} - -void GeometrySamples::ProjectionOfPoint3dSample() -{ - gp_Sphere aSphere(gp_Ax3(), 10.0); - gp_Pnt aBasePnt(20.0, 20.0, 20.0); - // A projection point in surface coordinate - gp_Pnt2d aPrjPnt2d = ProjLib::Project(aSphere, aBasePnt); - gp_Pnt aPrjPnt = ElSLib::Value(aPrjPnt2d.X(), aPrjPnt2d.Y(), aSphere); - - DisplayPnt(aBasePnt, "Base point", Aspect_TOM_PLUS, 2.0); - DisplayPnt(aPrjPnt, "Projection point", Aspect_TOM_O_STAR, 2.0); - Handle(Geom_SphericalSurface) aSphericalSurface = new Geom_SphericalSurface(aSphere); - Handle(AIS_Shape) anAisSphere = new AIS_Shape(BRepBuilderAPI_MakeFace( - aSphericalSurface, 0.0, 2.0*M_PI, 0.0, 2.0*M_PI, Precision::Confusion()).Shape()); - myObject3d.Append(anAisSphere); -} - -void GeometrySamples::MinimalDistance3dSample() -{ - gp_Cylinder aCylinder(gp_Ax3(gp_Pnt(), gp_Dir(0.0, 0.0, 1.0)), 10.0); - gp_Lin aLine(gp_Pnt(20.0, 0.0, 5.0), gp_Dir(0.0, 1.0, 0.0)); - Extrema_ExtElCS anExtrema_ExtElCS(aLine, aCylinder); - - if (anExtrema_ExtElCS.IsDone()) - { - NCollection_Array1 aVecArray(1, anExtrema_ExtElCS.NbExt()); - NCollection_Array1 aPntArray(1, anExtrema_ExtElCS.NbExt()); - for (Standard_Integer i = 1; i <= anExtrema_ExtElCS.NbExt(); i++) - { - Extrema_POnCurv aCurvPoint; - Extrema_POnSurf aSurfPoint; - anExtrema_ExtElCS.Points(i, aCurvPoint, aSurfPoint); - gp_Pnt aCurvPnt = aCurvPoint.Value(); - gp_Pnt aSurfPnt = aSurfPoint.Value(); - - DisplayPnt(aCurvPnt, TCollection_AsciiString(i), Aspect_TOM_O_PLUS, 2.0); - DisplayPnt(aSurfPnt, TCollection_AsciiString(i), Aspect_TOM_O_STAR, 2.0); - gp_Vec aVec(aCurvPnt, aSurfPnt); - aVecArray.SetValue(i, aVec); - aPntArray.SetValue(i, aCurvPnt); - } - Standard_Integer aMinDistIndex(0); - Standard_Real aMinDistance = std::numeric_limits::max(); - for (Standard_Integer i = 1; i <= anExtrema_ExtElCS.NbExt(); i++) - { - if (aMinDistance > aVecArray(i).Magnitude()) - { - aMinDistIndex = i; - aMinDistance = aVecArray(i).Magnitude(); - } - } - Handle(AdaptorVec_AIS) anMinDistanceAis = - new AdaptorVec_AIS(aPntArray(aMinDistIndex), aVecArray(aMinDistIndex)); - anMinDistanceAis->SetText(" Min distance"); - myObject3d.Append(anMinDistanceAis); - } - Handle(Geom_CylindricalSurface) aCylindricalSurface = new Geom_CylindricalSurface(aCylinder); - Handle(AIS_Shape) anAisCylinder = new AIS_Shape(BRepBuilderAPI_MakeFace( - aCylindricalSurface, 0.0, 2.0*M_PI, 0.0, 10.0, Precision::Confusion()).Shape()); - myObject3d.Append(anAisCylinder); - Handle(AdaptorVec_AIS) anLineAis = new AdaptorVec_AIS(aLine.Location(), aLine.Direction(), 8.0); - anLineAis->SetText(" gp_Lin"); - myObject3d.Append(anLineAis); -} - -void GeometrySamples::Intersection3dSample() -{ - gp_Lin aLine(gp_Pnt(0.0, 0.0, 10.0), gp_Dir(0.0, 1.0, 0.0)); - gp_Cone aCone(gp_Ax3(gp_Pnt(), gp_Dir(0.0, 0.0, 1.0)), 0.25*M_PI, 0.0); - IntAna_Quadric anIntAna_Quadric(aCone); - IntAna_IntConicQuad anIntAna_IntConicQuad(aLine, anIntAna_Quadric); - if (anIntAna_IntConicQuad.IsDone()) - { - for (int i = 1; i <= anIntAna_IntConicQuad.NbPoints(); i++) - { - const gp_Pnt& aIntersectionPnt = anIntAna_IntConicQuad.Point(i); - DisplayPnt(aIntersectionPnt, TCollection_AsciiString(i)); - } - } - Handle(AdaptorVec_AIS) aLineVecAIS = new AdaptorVec_AIS(aLine.Location(), gp_Vec(aLine.Direction())*5.0); - aLineVecAIS->SetText(" Base vector"); - myObject3d.Append(aLineVecAIS); - Handle(Geom_ConicalSurface) aConicalSurface = new Geom_ConicalSurface(aCone); - Handle(AIS_Shape) anAisCone = new AIS_Shape(BRepBuilderAPI_MakeFace( - aConicalSurface, 0.0, 2.0*M_PI, 0.0, 20.0, Precision::Confusion()).Shape()); - myObject3d.Append(anAisCone); -} - -void GeometrySamples::TranslatedPoint2dSample() -{ - gp_Pnt2d aPnt1; - gp_Pnt2d aPnt2 = aPnt1.Translated(gp_Vec2d(10.0, 10.0)); - DisplayPnt(aPnt1, "1", Aspect_TOM_PLUS, 1.0); - DisplayPnt(aPnt2, "2", Aspect_TOM_PLUS, 1.0); - gp_Vec2d aTranslationVec(aPnt1, aPnt2); - Handle(AdaptorVec_AIS) aVecAIS = new AdaptorVec_AIS(aPnt1, aTranslationVec); - aVecAIS->SetText(" Translation"); - myObject2d.Append(aVecAIS); -} - -void GeometrySamples::RotatedDirection2dSample() -{ - gp_Dir2d aBaseDir(1.0, 1.0); - gp_Dir2d aRotatedDir = aBaseDir.Rotated(M_PI_4); - - myResult << "An angle between directions: " << aBaseDir.Angle(aRotatedDir)*180.0 / M_PI << " grad"; - Handle(AdaptorVec_AIS) aBaseAIS = new AdaptorVec_AIS(gp_Pnt2d(), aBaseDir, 5.0); - aBaseAIS->SetText(" Base"); - myObject2d.Append(aBaseAIS); - Handle(AdaptorVec_AIS) aRotatedAIS = new AdaptorVec_AIS(gp_Pnt2d(), aRotatedDir, 5.0); - aRotatedAIS->SetText(" Rotated"); - myObject2d.Append(aRotatedAIS); -} - -void GeometrySamples::MirroredAxis2dSample() -{ - gp_Ax22d aBaseAx(gp_Pnt2d(10.0, 0.0), gp_Dir2d(1.0, 0.0), Standard_True); - gp_Ax22d aMirrorAx = aBaseAx.Mirrored(gp_Pnt2d()); - - DisplayPnt(gp_Pnt2d(), "Mirror point", Aspect_TOM_PLUS, 1.0); - Handle(AdaptorVec_AIS) aBaseX_AIS = new AdaptorVec_AIS(aBaseAx.Location(), aBaseAx.XDirection(), 5.0); - aBaseX_AIS->SetText(" X (Base)"); - myObject2d.Append(aBaseX_AIS); - Handle(AdaptorVec_AIS) aBaseY_AIS = new AdaptorVec_AIS(aBaseAx.Location(), aBaseAx.YDirection(), 5.0); - aBaseY_AIS->SetText("Y (Base)"); - myObject2d.Append(aBaseY_AIS); - Handle(AdaptorVec_AIS) aMirrorX_AIS = new AdaptorVec_AIS(aMirrorAx.Location(), aMirrorAx.XDirection(), 5.0); - aMirrorX_AIS->SetText("X (Mirror)"); - myObject2d.Append(aMirrorX_AIS); - Handle(AdaptorVec_AIS) aMirrorY_AIS = new AdaptorVec_AIS(aMirrorAx.Location(), aMirrorAx.YDirection(), 5.0); - aMirrorY_AIS->SetText(" Y (Mirror)"); - myObject2d.Append(aMirrorY_AIS); -} - -void GeometrySamples::TransformedEllipse2dSample() -{ - // Creates an ellipse with the major axis, the major and the minor radius. - // The location of the MajorAxis is the center of the ellipse.The sense of - // parametrization is given by Sense.Warnings : It is possible to create - // an ellipse with MajorRadius = MinorRadius.Raises - // ConstructionError if MajorRadius < MinorRadius or MinorRadius < 0.0. - gp_Elips2d aBaseEllips(gp_Ax2d(gp_Pnt2d(), gp_Dir2d(1.0, 0.0)), 20.0, 10.0); - gp_Trsf2d aRotTrsf; - aRotTrsf.SetRotation(gp_Pnt2d(), M_PI_4); - gp_Trsf2d aScaleTrsf; - aScaleTrsf.SetScale(gp_Pnt2d(), 1.5); - gp_Trsf2d aTranslTrsf; - aTranslTrsf.SetTranslation(gp_Vec2d(30.0, 0.0)); - gp_Trsf2d aComplexTrsf = aRotTrsf * aScaleTrsf * aTranslTrsf; - gp_Elips2d aTransfEllips = aBaseEllips.Transformed(aComplexTrsf); - - Handle(Geom2d_Ellipse) aBaseEllipse = new Geom2d_Ellipse(aBaseEllips); - Handle(AdaptorCurve2d_AIS) anAisBaseEllipse = new AdaptorCurve2d_AIS(aBaseEllipse, Aspect_TOL_DASH); - myObject2d.Append(anAisBaseEllipse); - Handle(Geom2d_Ellipse) aTransfEllipse = new Geom2d_Ellipse(aTransfEllips); - Handle(AdaptorCurve2d_AIS) anAisTransfEllipse = new AdaptorCurve2d_AIS(aTransfEllipse, Aspect_TOL_DASH); - myObject2d.Append(anAisTransfEllipse); -} - -void GeometrySamples::ConjugateObjects2dSample() -{ - gp_Parab2d aParab(gp_Ax2d(), 20.0); - gp_Ax2d aDirectrix = aParab.Directrix(); - gp_Pnt2d aFocus = aParab.Focus(); - gp_Pnt2d aLocation = aParab.Location(); - gp_Ax2d aMirror = aParab.MirrorAxis(); - - Handle(AdaptorVec_AIS) aDirectAIS = new AdaptorVec_AIS(aDirectrix.Location(), gp_Vec2d(aDirectrix.Direction())*10.0); - aDirectAIS->SetText(" Directrix"); - myObject2d.Append(aDirectAIS); - Handle(AdaptorVec_AIS) aMirrorAIS = new AdaptorVec_AIS(aMirror.Location(), gp_Vec2d(aMirror.Direction())*10.0); - aMirrorAIS->SetText(" Mirror Axis"); - myObject2d.Append(aMirrorAIS); - - DisplayPnt(aFocus, "Focus", Aspect_TOM_PLUS, -3.0); - DisplayPnt(aLocation, " Location", Aspect_TOM_O_STAR, 3.0); - Handle(Geom2d_Parabola) aGeomParabola = new Geom2d_Parabola(aParab); - Handle(Geom2d_TrimmedCurve) aTrimmedParabola = new Geom2d_TrimmedCurve(aGeomParabola, 40.0, -40.0); - Handle(AdaptorCurve2d_AIS) anAisParabola = new AdaptorCurve2d_AIS(aTrimmedParabola, Aspect_TOL_DOT); - myObject2d.Append(anAisParabola); -} - -void GeometrySamples::Tangent2dSample() -{ - gp_Circ2d aCirc1(gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Vec2d(1.0, 0.0)), 10.0); - gp_Circ2d aCirc2 = aCirc1.Translated(gp_Vec2d(50.0, 0.0)); - aCirc2.SetRadius(20.0); - - GccEnt_QualifiedCirc aQaCirc1(aCirc1, GccEnt_outside); - GccEnt_QualifiedCirc aQaCirc2(aCirc2, GccEnt_outside); - - GccAna_Lin2d2Tan aLin2d2Tan(aQaCirc1, aQaCirc2, 1E-6); - if (aLin2d2Tan.IsDone()) - { - for (int i = 1; i <= aLin2d2Tan.NbSolutions(); i++) - { - const gp_Lin2d& aTangentLin = aLin2d2Tan.ThisSolution(i); - Handle(AdaptorVec_AIS) anAisLin = new AdaptorVec_AIS(aTangentLin.Location(), aTangentLin.Direction(), 20.0); - myObject2d.Append(anAisLin); - } - } - - Handle(Geom2d_Circle) aCircle1 = new Geom2d_Circle(aCirc1); - Handle(AdaptorCurve2d_AIS) anAisCirc1 = new AdaptorCurve2d_AIS(aCircle1, Aspect_TOL_SOLID); - myObject2d.Append(anAisCirc1); - Handle(Geom2d_Circle) aCircle2 = new Geom2d_Circle(aCirc2); - Handle(AdaptorCurve2d_AIS) anAisCirc2 = new AdaptorCurve2d_AIS(aCircle2, Aspect_TOL_SOLID); - myObject2d.Append(anAisCirc2); -} - -void GeometrySamples::ProjectionOfPoint2dSample() -{ - gp_Pnt2d aPntToProject(40.0, 40.0); - gp_Circ2d aCirc(gp_Ax2d(), 20.0); - Handle(Geom2d_Circle) aGeom_Circle = new Geom2d_Circle(aCirc); - Geom2dAPI_ProjectPointOnCurve aProjector(aPntToProject, aGeom_Circle); - gp_Pnt2d aProjectionPnt = aProjector.NearestPoint(); - - Handle(AdaptorCurve2d_AIS) anAisCirc = new AdaptorCurve2d_AIS(aGeom_Circle, Aspect_TOL_SOLID); - myObject2d.Append(anAisCirc); - DisplayPnt(aPntToProject, "Pnt to project"); - DisplayPnt(aProjectionPnt, "Projection Pnt", Aspect_TOM_O_STAR); -} - -void GeometrySamples::MinimalDistance2dSample() -{ - gp_Lin2d aLin(gp_Pnt2d(-40.0, 0.0), gp_Dir2d(1.0, 1.0)); - Handle(Geom2d_Line) aGeom_Line = new Geom2d_Line(aLin); - gp_Circ2d aCirc(gp_Ax2d(), 20.0); - Handle(Geom2d_Circle) aGeom_Circle = new Geom2d_Circle(aCirc); - - Geom2dAPI_ExtremaCurveCurve anExtremaFinder(aGeom_Line, aGeom_Circle, - std::numeric_limits::min(), - std::numeric_limits::max(), 0.0, M_PI*2.0); - if (anExtremaFinder.NbExtrema()) - { - gp_Pnt2d aPnt1, aPnt2; - anExtremaFinder.NearestPoints(aPnt1, aPnt2); - myResult << "Extrema found: " << anExtremaFinder.NbExtrema() << std::endl; - myResult << "Minimal distance: " << anExtremaFinder.LowerDistance() << std::endl; - DisplayPnt(aPnt1, "1"); - DisplayPnt(aPnt2, "2"); - } - else - { - myResult << "No Extrema found" << std::endl; - } - - Handle(AdaptorCurve2d_AIS) anAisCirc = new AdaptorCurve2d_AIS(aGeom_Circle, Aspect_TOL_SOLID); - myObject2d.Append(anAisCirc); - Handle(AdaptorVec_AIS) anAisLin = new AdaptorVec_AIS(aLin.Location(), aLin.Direction(), 60.0); - anAisLin->SetText(" gp_Lin2d"); - myObject2d.Append(anAisLin); -} - -void GeometrySamples::Intersection2dSample() -{ - gp_Lin2d aLin(gp_Pnt2d(-20.0, 20.0), gp_Dir2d(1.0, -1.5)); - Handle(Geom2d_Line) aGeom_Line = new Geom2d_Line(aLin); - gp_Parab2d aParab(gp_Ax2d(), 20.0); - Handle(Geom2d_Parabola) aGeom_Parabola = new Geom2d_Parabola(aParab); - - Geom2dAPI_InterCurveCurve anIntersectFinder(aGeom_Line, aGeom_Parabola); - for (Standard_Integer i = 1; i <= anIntersectFinder.NbPoints(); i++) - { - gp_Pnt2d aPnt = anIntersectFinder.Point(i); - DisplayPnt(aPnt, i); - } - - myResult << "Number of intersections : " << anIntersectFinder.NbPoints() << std::endl; - - Handle(Geom2d_Parabola) aGeomParabola = new Geom2d_Parabola(aParab); - Handle(Geom2d_TrimmedCurve) aTrimmedParabola = new Geom2d_TrimmedCurve(aGeomParabola, 60.0, -60.0); - Handle(AdaptorCurve2d_AIS) anAisParabola = new AdaptorCurve2d_AIS(aTrimmedParabola, Aspect_TOL_DOT); - myObject2d.Append(anAisParabola); - Handle(AdaptorVec_AIS) anAisLin = new AdaptorVec_AIS(aLin.Location(), aLin.Direction(), 90.0); - anAisLin->SetText(" gp_Lin2d"); - myObject2d.Append(anAisLin); -} - -void GeometrySamples::PointInfo3dSample() -{ - gp_Pnt aPnt1; - gp_Pnt aPnt2(10.0, 10.0, 10.0); - gp_Pnt aPnt3(10.0, -10.0, 0.0); - gp_Pnt aPnt4(10.0, 10.0, 10.0); - Standard_Boolean anIsEqual2_3 = aPnt2.IsEqual(aPnt3, 1E-6); - Standard_Boolean anIsEqual2_4 = aPnt2.IsEqual(aPnt4, 1E-6); - Standard_Real aDistance1_2 = aPnt1.Distance(aPnt2); - Standard_Real aDistance2_4 = aPnt2.Distance(aPnt4); - Standard_Real aSquareDistance1_2 = aPnt1.SquareDistance(aPnt2); - Standard_Real aSquareDistance2_4 = aPnt2.SquareDistance(aPnt4); - - myResult << "A coordinate of a point 1: X: " << aPnt1.X() << " Y: " << aPnt1.Y() << " Z: " << aPnt1.Z() << std::endl; - myResult << "A coordinate of a point 2: X: " << aPnt2.X() << " Y: " << aPnt2.Y() << " Z: " << aPnt2.Z() << std::endl; - myResult << "A coordinate of a point 3: X: " << aPnt3.X() << " Y: " << aPnt3.Y() << " Z: " << aPnt3.Z() << std::endl; - myResult << "A coordinate of a point 4: X: " << aPnt4.X() << " Y: " << aPnt4.Y() << " Z: " << aPnt4.Z() << std::endl; - - if (anIsEqual2_3) - { - myResult << "A point 2 is equal to a point 3" << std::endl; - } - else - { - myResult << "A point 2 is different from a point 3" << std::endl; - } - if (anIsEqual2_4) - { - myResult << "A point 2 is equal to a point 4" << std::endl; - } - else - { - myResult << "A point 2 is different from a point 4" << std::endl; - } - myResult << "A distance from a point 1 to a point 2 is: " << aDistance1_2 << std::endl; - myResult << "A distance from a point 2 to a point 4 is: " << aDistance2_4 << std::endl; - - myResult << "A square distance from a point 1 to a point 2 is: " << aSquareDistance1_2 << std::endl; - myResult << "A square distance from a point 2 to a point 4 is: " << aSquareDistance2_4 << std::endl; - - DisplayPnt(aPnt1, "1", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt2, "2 & 4", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt3, "3", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt4, "", Aspect_TOM_PLUS, 0.5); -} - -void GeometrySamples::EllipseInfo3dSample() -{ - gp_Elips anElips(gp_Ax2(gp_Pnt(), gp_Dir(1.0, 0.0, 0.0)), 20.0, 10.0); - Standard_Real anArea = anElips.Area(); - // Returns the eccentricity of the ellipse between 0.0 and 1.0 - // If f is the distance between the center of the ellipse and the Focus1 then - // the eccentricity e = f / MajorRadius. Returns 0 if MajorRadius = 0. - Standard_Real anEccentricity = anElips.Eccentricity(); - // Returns the distance between the center of the ellipse and focus1 or focus2. - Standard_Real aFocal = anElips.Focal(); - // Returns p = (1 - e * e) * MajorRadius where e is the eccentricity - // of the ellipse. Returns 0 if MajorRadius = 0. - Standard_Real aParameter = anElips.Parameter(); - - myResult << "Ellipse area = " << anArea << " square units" << std::endl; - myResult << "Eccentricity = " << anEccentricity; - myResult << "Focal distance = " << aFocal; - myResult << "Ellipse parameter = " << aParameter; - - gp_Pnt aCenter = anElips.Location(); - gp_Pnt aFocus1 = anElips.Focus1(); - gp_Pnt aFocus2 = anElips.Focus2(); - DisplayPnt(aCenter, "Center", Aspect_TOM_PLUS, 2.0); - DisplayPnt(aFocus1, "focus 1", Aspect_TOM_PLUS, 2.0); - DisplayPnt(aFocus2, "focus 2", Aspect_TOM_PLUS, 2.0); - - Handle(Geom_Ellipse) aGeomEllipse = new Geom_Ellipse(anElips); - Handle(AdaptorCurve_AIS) anAisEllipce = new AdaptorCurve_AIS(aGeomEllipse); - myObject3d.Append(anAisEllipce); -} - -void GeometrySamples::PointInfo2dSample() -{ - gp_Pnt2d aPnt1; - gp_Pnt2d aPnt2(10.0, 10.0); - gp_Pnt2d aPnt3(10.0, -10.0); - gp_Pnt2d aPnt4(10.0, 10.0); - Standard_Boolean anIsEqual2_3 = aPnt2.IsEqual(aPnt3, 1E-6); - Standard_Boolean anIsEqual2_4 = aPnt2.IsEqual(aPnt4, 1E-6); - Standard_Real aDistance1_2 = aPnt1.Distance(aPnt2); - Standard_Real aDistance2_4 = aPnt2.Distance(aPnt4); - Standard_Real aSquareDistance1_2 = aPnt1.SquareDistance(aPnt2); - Standard_Real aSquareDistance2_4 = aPnt2.SquareDistance(aPnt4); - - myResult << "A coordinate of a point 1: X: " << aPnt1.X() << " Y: " << aPnt1.Y() << std::endl; - myResult << "A coordinate of a point 2: X: " << aPnt2.X() << " Y: " << aPnt2.Y() << std::endl; - myResult << "A coordinate of a point 3: X: " << aPnt3.X() << " Y: " << aPnt3.Y() << std::endl; - myResult << "A coordinate of a point 4: X: " << aPnt4.X() << " Y: " << aPnt4.Y() << std::endl; - if (anIsEqual2_3) - { - myResult << "A point 2 is equal to a point 3" << std::endl; - } - else - { - myResult << "A point 2 is different from a point 3" << std::endl; - } - if (anIsEqual2_4) - { - myResult << "A point 2 is equal to a point 4" << std::endl; - } - else - { - myResult << "A point 2 is different from a point 4" << std::endl; - } - - myResult << "A distance from a point 1 to a point 2 is: " << aDistance1_2 << std::endl; - myResult << "A distance from a point 2 to a point 4 is: " << aDistance2_4 << std::endl; - - myResult << "A square distance from a point 1 to a point 2 is: " << aSquareDistance1_2 << std::endl; - myResult << "A square distance from a point 2 to a point 4 is: " << aSquareDistance2_4 << std::endl; - - DisplayPnt(aPnt1, "1", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt2, "2 & 4", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt3, "3", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt4, ""); -} - -void GeometrySamples::CircleInfo2dSample() -{ - gp_Circ2d aCirc(gp_Ax22d(gp_Pnt2d(10.0, 10.0), gp_Vec2d(1.0, 0.0)), 10.0); - gp_Pnt2d aPnt1(0.0, 10.0); - gp_Pnt2d aPnt2(10.0, 0.0); - gp_Pnt2d aPnt3(20.0, 20.0); - - if (aCirc.Contains(aPnt1, 1E-6)) - { - DisplayPnt(aPnt1, "1", Aspect_TOM_STAR, 3.0); - myResult << "A circle contains a point 1" << std::endl; - } - else - { - DisplayPnt(aPnt1, "1", Aspect_TOM_PLUS, 1.0); - myResult << "A circle does contain a point 1" << std::endl; - } - if (aCirc.Contains(aPnt2, 1E-6)) - { - DisplayPnt(aPnt2, "2", Aspect_TOM_STAR, 1.0); - myResult << "A circle contains a point 2" << std::endl; - } - else - { - DisplayPnt(aPnt2, "2", Aspect_TOM_PLUS, 1.0); - myResult << "A circle does contain a point 2" << std::endl; - } - if (aCirc.Contains(aPnt3, 1E-6)) - { - DisplayPnt(aPnt3, "3", Aspect_TOM_STAR, 1.0); - myResult << "A circle contains a point 3" << std::endl; - } - else - { - DisplayPnt(aPnt3, "3", Aspect_TOM_PLUS, 1.0); - myResult << "A circle does contain a point 3" << std::endl; - } - myResult << "Circle area = " << aCirc.Area() << "square units" << std::endl; - Handle(Geom2d_Circle) aGeomCircle = new Geom2d_Circle(aCirc); - Handle(AdaptorCurve2d_AIS) anAisCirc = new AdaptorCurve2d_AIS(aGeomCircle); - myObject2d.Append(anAisCirc); -} - -void GeometrySamples::FreeStyleCurves3dSample() -{ - // Define points. - gp_Pnt aPnt1(0.0, 0.0, 0.0); - gp_Pnt aPnt2(5.0, 5.0, 0.0); - gp_Pnt aPnt3(10.0, 5.0, 0.0); - gp_Pnt aPnt4(15.0, 0.0, 0.0); - - // Add points to the curve poles array. - TColgp_Array1OfPnt aPoles(1, 4); - aPoles.SetValue(1, aPnt1); - aPoles.SetValue(2, aPnt2); - aPoles.SetValue(3, aPnt3); - aPoles.SetValue(4, aPnt4); - - // Define BSpline weights. - TColStd_Array1OfReal aBSplineWeights(1, 4); - aBSplineWeights.SetValue(1, 1.0); - aBSplineWeights.SetValue(2, 0.5); - aBSplineWeights.SetValue(3, 0.5); - aBSplineWeights.SetValue(4, 1.0); - - // Define knots. - TColStd_Array1OfReal aKnots(1, 2); - aKnots.SetValue(1, 0.0); - aKnots.SetValue(2, 1.0); - - // Define multiplicities. - TColStd_Array1OfInteger aMults(1, 2); - aMults.SetValue(1, 4); - aMults.SetValue(2, 4); - - // Define BSpline degree and periodicity. - Standard_Integer aDegree = 3; - Standard_Boolean aPeriodic = Standard_False; - - // Create a BSpline curve. - Handle(Geom_BSplineCurve) aBSplineCurve = new Geom_BSplineCurve( - aPoles, aBSplineWeights, aKnots, aMults, aDegree, aPeriodic); - myResult << "Geom_BSplineCurve was created in red" << std::endl; - - // Define Bezier weights. - TColStd_Array1OfReal aBezierWeights(1, 4); - aBezierWeights.SetValue(1, 0.5); - aBezierWeights.SetValue(2, 1.5); - aBezierWeights.SetValue(3, 1.5); - aBezierWeights.SetValue(4, 0.5); - - // Create Bezier curve. - Handle(Geom_BezierCurve) aBezierCurve = new Geom_BezierCurve(aPoles, aBezierWeights); - myResult << "Geom_BezierCurve was created in green" << std::endl; - - Handle(AIS_ColoredShape) anAisBSplineCurve = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aBSplineCurve).Shape()); - Handle(AIS_ColoredShape) anAisBezierCurve = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aBezierCurve).Shape()); - anAisBSplineCurve->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisBezierCurve->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisBSplineCurve); - myObject3d.Append(anAisBezierCurve); - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(aPnt1))); - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(aPnt2))); - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(aPnt3))); - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(aPnt4))); -} - -void GeometrySamples::AnalyticalSurfaces3dSample() -{ - // Define a XY plane. - gp_Pln aPln(gp::Origin(), gp::DZ()); - // Create plane geometry. - Handle(Geom_Plane) aPlaneSurf = new Geom_Plane(aPln); - myResult << "Geom_Plane was created in red" << std::endl; - - // Define a cylinder. - gp_Cylinder aCyl(gp::XOY(), 2.5); - // Create cylindrical surface. - Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aCyl); - myResult << "Geom_CylindricalSurface was created in green" << std::endl; - - // Define a cone. - gp_Cone aCone(gp::XOY(), M_PI_4, 2.5); - // Create conical surface. - Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aCone); - myResult << "Geom_ConicalSurface was created in blue" << std::endl; - - // Define a sphere. - gp_Pnt aSphereCenter(15.0, 15.0, 15.0); - gp_Sphere aSphere(gp_Ax3(aSphereCenter, gp::DZ()), 8.0); - // Create conical surface. - Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aSphere); - myResult << "Geom_SphericalSurface was created in cyan" << std::endl; - - // Define a sphere. - gp_Pnt aTorusCenter(-15.0, -15.0, 25.0); - gp_Torus aTorus(gp_Ax3(aTorusCenter, gp::DZ()), 15.0, 5.0); - // Create toroidal surface. - Handle(Geom_ToroidalSurface) aTorusSurf = new Geom_ToroidalSurface(aTorus); - myResult << "Geom_ToroidalSurface was created in yellow" << std::endl; - - Handle(AIS_ColoredShape) anAisPlane = new AIS_ColoredShape(BRepBuilderAPI_MakeFace( - aPlaneSurf, 0.0, 20.0, 0.0, 20.0, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisCylinder = new AIS_ColoredShape(BRepBuilderAPI_MakeFace( - aCylSurf, 0.0, 2.0 * M_PI, 5.0, 15.0, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisCone = new AIS_ColoredShape(BRepBuilderAPI_MakeFace( - aConeSurf, 0.0, 2.0 * M_PI, 0.0, 15.0, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisSphere = new AIS_ColoredShape(BRepBuilderAPI_MakeFace( - aSphereSurf, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisTorus = new AIS_ColoredShape(BRepBuilderAPI_MakeFace( - aTorusSurf, Precision::Confusion()).Shape()); - anAisPlane->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisCylinder->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisCone->SetColor(Quantity_Color(Quantity_NOC_BLUE1)); - anAisSphere->SetColor(Quantity_Color(Quantity_NOC_CYAN1)); - anAisTorus->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisPlane); - myObject3d.Append(anAisCylinder); - myObject3d.Append(anAisCone); - myObject3d.Append(anAisSphere); - myObject3d.Append(anAisTorus); -} - -void GeometrySamples::FreeStyleSurfaces3dSample() -{ - // Define a 4x4 grid of points for BSpline surface. - TColgp_Array2OfPnt aBSplinePnts(1, 4, 1, 4); - for (Standard_Integer i = 1; i <= 4; ++i) - { - gp_Pnt aPnt; - aPnt.SetX(5.0 * i); - for (Standard_Integer j = 1; j <= 4; ++j) - { - aPnt.SetY(5.0 * j); - if (1 < i && i < 4 && 1 < j && j < 4) - { - aPnt.SetZ(5.0); - } - else - { - aPnt.SetZ(0.0); - } - aBSplinePnts.SetValue(i, j, aPnt); - } - } - - // Define a 4x4 grid of points for Bezier surface. - TColgp_Array2OfPnt aBezierPnts(1, 4, 1, 4); - for (Standard_Integer i = 1; i <= 4; ++i) - { - gp_Pnt aPnt; - aPnt.SetX(20.0 + 5.0 * i); - for (Standard_Integer j = 1; j <= 4; ++j) - { - aPnt.SetY(20.0 + 5.0 * j); - if (1 < i && i < 4 && 1 < j && j < 4) - { - aPnt.SetZ(5.0); - } - else - { - aPnt.SetZ(0.0); - } - aBezierPnts.SetValue(i, j, aPnt); - } - } - - // Define BSpline weights. - TColStd_Array2OfReal aBSplineWeights(1, 4, 1, 4); - for (Standard_Integer i = 1; i <= 4; ++i) - { - for (Standard_Integer j = 1; j <= 4; ++j) - { - if (1 < i && i < 4 && 1 < j && j < 4) - { - aBSplineWeights.SetValue(i, j, 0.5); - } - else - { - aBSplineWeights.SetValue(i, j, 1.0); - } - } - } - - // Define knots. - TColStd_Array1OfReal aUKnots(1, 2), aVKnots(1, 2); - aUKnots.SetValue(1, 0.0); - aUKnots.SetValue(2, 1.0); - aVKnots.SetValue(1, 0.0); - aVKnots.SetValue(2, 1.0); - - // Define multiplicities. - TColStd_Array1OfInteger aUMults(1, 2), aVMults(1, 2); - aUMults.SetValue(1, 4); - aUMults.SetValue(2, 4); - aVMults.SetValue(1, 4); - aVMults.SetValue(2, 4); - - // Define BSpline degree and periodicity. - Standard_Integer aUDegree = 3; - Standard_Integer aVDegree = 3; - Standard_Boolean aUPeriodic = Standard_False; - Standard_Boolean aVPeriodic = Standard_False; - - // Create a BSpline surface. - Handle(Geom_BSplineSurface) aBSplineSurf = new Geom_BSplineSurface( - aBSplinePnts, aBSplineWeights, aUKnots, aVKnots, - aUMults, aVMults, aUDegree, aVDegree, aUPeriodic, aVPeriodic); - myResult << "Geom_BSplineSurface was created in red" << std::endl; - - // Define BSpline weights. - TColStd_Array2OfReal aBezierWeights(1, 4, 1, 4); - for (Standard_Integer i = 1; i <= 4; ++i) - { - for (Standard_Integer j = 1; j <= 4; ++j) - { - if (1 < i && i < 4 && 1 < j && j < 4) - { - aBezierWeights.SetValue(i, j, 1.5); - } - else - { - aBezierWeights.SetValue(i, j, 0.5); - } - } - } - - // Create a Bezier surface. - Handle(Geom_BezierSurface) aBezierSurf = new Geom_BezierSurface(aBezierPnts, aBezierWeights); - myResult << "Geom_BezierSurface was created in green" << std::endl; - - Handle(AIS_ColoredShape) anAisBSplineSurf = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aBSplineSurf, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisBezierSurf = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aBezierSurf, Precision::Confusion()).Shape()); - anAisBSplineSurf->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisBezierSurf->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisBSplineSurf); - myObject3d.Append(anAisBezierSurf); - for (TColgp_Array2OfPnt::Iterator anIt(aBSplinePnts); anIt.More(); anIt.Next()) - { - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(anIt.Value()))); - } - for (TColgp_Array2OfPnt::Iterator anIt(aBezierPnts); anIt.More(); anIt.Next()) - { - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(anIt.Value()))); - } -} - -void GeometrySamples::FreeStyleCurves2dSample() -{ - - // Define points. - gp_Pnt2d aPnt1(0.0, 0.0); - gp_Pnt2d aPnt2(5.0, 5.0); - gp_Pnt2d aPnt3(10.0, 5.0); - gp_Pnt2d aPnt4(15.0, 0.0); - - // Add points to the curve poles array. - TColgp_Array1OfPnt2d aBSplinePoles(1, 4); - aBSplinePoles.SetValue(1, aPnt1); - aBSplinePoles.SetValue(2, aPnt2); - aBSplinePoles.SetValue(3, aPnt3); - aBSplinePoles.SetValue(4, aPnt4); - - // Define BSpline weights. - TColStd_Array1OfReal aBSplineWeights(1, 4); - aBSplineWeights.SetValue(1, 1.0); - aBSplineWeights.SetValue(2, 0.5); - aBSplineWeights.SetValue(3, 0.5); - aBSplineWeights.SetValue(4, 1.0); - - // Define knots. - TColStd_Array1OfReal aKnots(1, 2); - aKnots.SetValue(1, 0.0); - aKnots.SetValue(2, 1.0); - - // Define multiplicities. - TColStd_Array1OfInteger aMults(1, 2); - aMults.SetValue(1, 4); - aMults.SetValue(2, 4); - - // Define BSpline degree and periodicity. - Standard_Integer aDegree = 3; - Standard_Boolean aPeriodic = Standard_False; - - // Create a BSpline curve. - Handle(Geom2d_BSplineCurve) aBSplineCurve = - new Geom2d_BSplineCurve(aBSplinePoles, aBSplineWeights, aKnots, aMults, aDegree, aPeriodic); - - - TColgp_Array1OfPnt2d aBezierPoles(1, 4); - gp_Vec2d anUp10Vec(0.0, 10.0); - aBezierPoles.SetValue(1, aPnt1.Translated(anUp10Vec)); - aBezierPoles.SetValue(2, aPnt2.Translated(anUp10Vec)); - aBezierPoles.SetValue(3, aPnt3.Translated(anUp10Vec)); - aBezierPoles.SetValue(4, aPnt4.Translated(anUp10Vec)); - - // Define Bezier weights. - TColStd_Array1OfReal aBezierWeights(1, 4); - aBezierWeights.SetValue(1, 0.5); - aBezierWeights.SetValue(2, 1.5); - aBezierWeights.SetValue(3, 1.5); - aBezierWeights.SetValue(4, 0.5); - - // Create Bezier curve. - Handle(Geom2d_BezierCurve) aBezierCurve = new Geom2d_BezierCurve(aBezierPoles, aBezierWeights); - - Handle(AdaptorCurve2d_AIS) anAisBSpline = new AdaptorCurve2d_AIS(aBSplineCurve); - myObject2d.Append(anAisBSpline); - Handle(AdaptorCurve2d_AIS) anAisBezier = new AdaptorCurve2d_AIS(aBezierCurve); - myObject2d.Append(anAisBezier); - - DisplayPnt(aPnt1, "1", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt2, "2", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt3, "3", Aspect_TOM_PLUS, 0.5); - DisplayPnt(aPnt4, "4", Aspect_TOM_PLUS, 0.5); -} - -void GeometrySamples::TrimmedCurve3dSample() -{ - // Define a circle placed in the origin of XY coordinate - // plane and with the radius equal to 5. - gp_Circ aCirc(gp::XOY(), 5.0); - // Create a closed circular curve. - Handle(Geom_Circle) aCircCurve = new Geom_Circle(aCirc); - myResult << "Geom_Circle was created in yellow" << std::endl; - - // Cut off a quarter of the circle. - Handle(Geom_TrimmedCurve) aCircQuater = new Geom_TrimmedCurve(aCircCurve, 0.0, M_PI_2); - myResult << "Geom_TrimmedCurve was created in red" << std::endl; - - Handle(AIS_ColoredShape) anAisCirc = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aCircCurve).Shape()); - Handle(AIS_ColoredShape) anAisCircQuater = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aCircQuater).Shape()); - anAisCirc->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisCircQuater->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisCircQuater->SetWidth(2.5); - myObject3d.Append(anAisCirc); - myObject3d.Append(anAisCircQuater); -} - -void GeometrySamples::OffsetCurve3dSample() -{ - // Define a circle placed in the origin of XY coordinate - // plane and with the radius equal to 5. - gp_Circ aCirc(gp::XOY(), 5.0); - // Create a closed circular curve. - Handle(Geom_Circle) aCircCurve = new Geom_Circle(aCirc); - myResult << "Geom_Circle was created in yellow" << std::endl; - - // An offset curve is a curve at constant distance (Offset) from - // a basis curve in a reference direction V. - // The offset curve takes its parametrization from the basis curve. - // The Offset curve is in the direction of the normal N - // defined with the cross product T^V, where the vector T - // is given by the first derivative on the basis curve with non zero length. - // The distance offset may be positive or negative to indicate the - // preferred side of the curve: - // . distance offset >0 => the curve is in the direction of N - // . distance offset <0 => the curve is in the direction of - N - // On the Offset curve: - // Value (U) = BasisCurve.Value(U) + (Offset * (T ^ V)) / ||T ^ V|| - // At any point the Offset direction V must not be parallel to the - // vector T and the vector T must not have null length else the - // offset curve is not defined. - - // Expand the circle by Offset equal to a quarter of the radius - // with direction V equal to Z. - Standard_Real anExpandOffset = +aCirc.Radius() / 4.0; - gp_Dir anExpandDir = gp::DZ(); - Handle(Geom_OffsetCurve) anExpandCircCurve = new Geom_OffsetCurve( - aCircCurve, anExpandOffset, anExpandDir); - myResult << "Geom_OffsetCurve (expanded circle) was created in red" << std::endl; - - // Collapse the circle by Offset equal to a half of the radius with direction V equal to Z. - Standard_Real anCollapseOffset = -aCirc.Radius() / 2.0; - gp_Dir anCollapseDir = gp::DZ(); - Handle(Geom_OffsetCurve) anCollapseCircCurve = new Geom_OffsetCurve (aCircCurve, anCollapseOffset, anCollapseDir); - myResult << "Geom_OffsetCurve (collapsed circle) was created in green" << std::endl; - - Handle(AIS_ColoredShape) anAisCirc = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aCircCurve).Shape()); - Handle(AIS_ColoredShape) anAisExpandCirc = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(anExpandCircCurve).Shape()); - Handle(AIS_ColoredShape) anAisCpllapsedCirc = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(anCollapseCircCurve).Shape()); - anAisCirc->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisExpandCirc->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisCpllapsedCirc->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisCirc); - myObject3d.Append(anAisExpandCirc); - myObject3d.Append(anAisCpllapsedCirc); -} - -void GeometrySamples::BSplineFromCircle3dSample() -{ - // Define a circle placed in the origin of XY coordinate - // plane and with the radius equal to 5. - gp_Circ aCirc(gp::XOY(), 5.0); - // Create a closed circular curve. - Handle(Geom_Circle) aCircCurve = new Geom_Circle(aCirc); - myResult << "Geom_Circle was created in yellow" << std::endl; - - // Convert the circle curve to a BSpline one. - Handle(Geom_BSplineCurve) aBSplineFromCirc = GeomConvert::CurveToBSplineCurve(aCircCurve); - myResult << "Geom_BSplineCurve was created in red:" << std::endl; - myResult << "Degree: " << aBSplineFromCirc->Degree() << std::endl; - myResult << "Periodic: " << (aBSplineFromCirc->IsPeriodic() ? "Yes" : "No") << std::endl; - myResult << "Poles: [" << aBSplineFromCirc->Poles().Size() << "]" << std::endl; - for (TColgp_Array1OfPnt::Iterator anIt(aBSplineFromCirc->Poles()); anIt.More(); anIt.Next()) - { - myResult << " (" << anIt.Value().X() << ", " << anIt.Value().Y() << ", " << anIt.Value().Z() << ")" << std::endl; - } - - Handle(AIS_ColoredShape) anAisCirc = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aCircCurve).Shape()); - Handle(AIS_ColoredShape) anAisBSpline = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aBSplineFromCirc).Shape()); - anAisCirc->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisBSpline->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisCirc); - myObject3d.Append(anAisBSpline); -} - -void GeometrySamples::TrimmedSurface3dSample() -{ - // Define a XY plane. - gp_Pln aPln(gp::XOY()); - // Create a plane surface. - Handle(Geom_Plane) aPlaneSurf = new Geom_Plane(aPln); - myResult << "Geom_Plane was created" << std::endl; - - // Trim [0 ... 30 X 0 ... 50] rectangular range. - Standard_Real aUMin = 0.0; - Standard_Real aUMax = 30.0; - Standard_Real aVMin = 0.0; - Standard_Real aVMax = 50.0; - Handle(Geom_RectangularTrimmedSurface) aTrimmedPlaneSurf - = new Geom_RectangularTrimmedSurface(aPlaneSurf, aUMin, aUMax, aVMin, aVMax); - myResult << "Geom_RectangularTrimmedSurface was created in red" << std::endl; - - Handle(AIS_Plane) anAisPlane = new AIS_Plane(aPlaneSurf); - Handle(AIS_ColoredShape) anAisTimmedPlane = new AIS_ColoredShape (BRepBuilderAPI_MakeFace (aTrimmedPlaneSurf, 0.001).Shape()); - anAisTimmedPlane->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisPlane); - myObject3d.Append(anAisTimmedPlane); -} - -void GeometrySamples::OffsetSurface3dSample() -{ - // Define a XY plane. - gp_Pln aPln(gp::XOY()); - // Create a plane surface. - Handle(Geom_Plane) aPlaneSurf = new Geom_Plane(aPln); - myResult << "Geom_Plane was created" << std::endl; - - // An offset surface is defined by: - // - the basis surface to which it is parallel, and - // - the distance between the offset surface and its basis surface. - // A point on the offset surface is built by measuring the - // offset value along the normal vector at a point on the - // basis surface. This normal vector is given by the cross - // product D1u^D1v, where D1u and D1v are the - // vectors tangential to the basis surface in the u and v - // parametric directions at this point. The side of the - // basis surface on which the offset is measured - // depends on the sign of the offset value. - - // Offset the plane in the normal direction. - Standard_Real aPosOffset = 10.0; - Handle(Geom_OffsetSurface) aPosOffsetSurf = new Geom_OffsetSurface(aPlaneSurf, aPosOffset); - myResult << "Geom_OffsetSurface with " << aPosOffset << " was created in red" << std::endl; - - // Offset the plane in direction opposite to the normal one. - Standard_Real aNegOffset = -15.0; - Handle(Geom_OffsetSurface) aNegOffsetSurf = new Geom_OffsetSurface(aPlaneSurf, aNegOffset); - myResult << "Geom_OffsetSurface with " << aNegOffset << " was created in green" << std::endl; - - Handle(AIS_ColoredShape) anAisPlane = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aPlaneSurf, 0.0, 10.0, 0.0, 10.0, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisPosOffsetPlane = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aPosOffsetSurf, 0.0, 10.0, 0.0, 10.0, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisNegOffsetPlane = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aNegOffsetSurf, 0.0, 10.0, 0.0, 10.0, Precision::Confusion()).Shape()); - anAisPosOffsetPlane->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisNegOffsetPlane->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisPlane); - myObject3d.Append(anAisPosOffsetPlane); - myObject3d.Append(anAisNegOffsetPlane); -} - -void GeometrySamples::ExtrusionSurface3dSample() -{ - // Create an ellipse curve in XY plane. - Standard_Real aMinorRadius = 10.0; - Standard_Real aMajorRadius = 20.0; - Handle(Geom_Ellipse) anEllipseCurve = new Geom_Ellipse(gp::XOY(), aMajorRadius, aMinorRadius); - myResult << "Geom_Ellipse was created in yellow" << std::endl; - - // Make a linear extrusion of the ellipse at 45 degrees to Z axis - gp_Dir aDirOfExtr = gp::DZ(); - Handle(Geom_SurfaceOfLinearExtrusion) aLinExtrSurf - = new Geom_SurfaceOfLinearExtrusion(anEllipseCurve, aDirOfExtr); - myResult << "Geom_SurfaceOfLinearExtrusion was created in red" << std::endl; - - Handle(AIS_ColoredShape) anAisEllipse = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(anEllipseCurve).Shape()); - Handle(AIS_ColoredShape) anAisExtrSurf = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aLinExtrSurf, 0.0, 2.0 * M_PI, 0.0, 30.0, - Precision::Confusion()).Shape()); - anAisEllipse->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisEllipse->SetWidth(2.5); - anAisExtrSurf->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisEllipse); - myObject3d.Append(anAisExtrSurf); -} - -void GeometrySamples::RevolutionSurface3dSample() -{ - // Create an ellipse curve in XY plane with - // the center at (-10, 0, 0). - Standard_Real aMinorRadius = 5.0; - Standard_Real aMajorRadius = 10.0; - gp_Pnt aCenter(-30.0, 0.0, 0.0); - Handle(Geom_Ellipse) anEllipseCurve = new Geom_Ellipse(gp_Ax2(aCenter, gp::DZ()), - aMajorRadius, aMinorRadius); - myResult << "Geom_Ellipse was created in yellow" << std::endl; - - // Make a revolution of the ellipse around Y axis - Handle(Geom_SurfaceOfRevolution) aRevolSurf = new Geom_SurfaceOfRevolution(anEllipseCurve, gp::OY()); - myResult << "Geom_SurfaceOfRevolution was created in red" << std::endl; - - Handle(AIS_ColoredShape) anAisEllipse = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(anEllipseCurve).Shape()); - Handle(AIS_ColoredShape) anAisRevolSurf = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aRevolSurf, Precision::Confusion()).Shape()); - anAisEllipse->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisEllipse->SetWidth(2.5); - anAisRevolSurf->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisEllipse); - myObject3d.Append(anAisRevolSurf); -} - -void GeometrySamples::TrimmedCurve2dSample() -{ - // Create a closed circular curve. - Handle(Geom2d_Circle) aGeomCircle = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(), gp_Vec2d(1.0, 0.0)), 5.0); - Handle(AdaptorCurve2d_AIS) anAisCirc = new AdaptorCurve2d_AIS(aGeomCircle); - myObject2d.Append(anAisCirc); - - // Cut off a quarter of the circle. - Handle(Geom2d_TrimmedCurve) aCircQuater = new Geom2d_TrimmedCurve(aGeomCircle, 0.0, M_PI_2); - aCircQuater->Translate(gp_Vec2d(15.0, 0.0)); - Handle(AdaptorCurve2d_AIS) anAisCircQuater = new AdaptorCurve2d_AIS(aCircQuater); - myObject2d.Append(anAisCircQuater); -} - -void GeometrySamples::OffsetCurve2dSample() -{ - Handle(Geom2d_Circle) aGeomCircle = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(), gp_Vec2d(1.0, 0.0)), 5.0); - - Standard_Real anExpandOffset = aGeomCircle->Radius() / 4.0; - Handle(Geom2d_OffsetCurve) anExpandCircCurve = new Geom2d_OffsetCurve(aGeomCircle, anExpandOffset); - - Standard_Real anCollapseOffset = -aGeomCircle->Radius() / 2.0; - Handle(Geom2d_OffsetCurve) anCollapseCircCurve = new Geom2d_OffsetCurve(aGeomCircle, anCollapseOffset); - - Handle(AdaptorCurve2d_AIS) anAisCirc = new AdaptorCurve2d_AIS(aGeomCircle); - myObject2d.Append(anAisCirc); - Handle(AdaptorCurve2d_AIS) anAisExpand = new AdaptorCurve2d_AIS(anExpandCircCurve); - myObject2d.Append(anAisExpand); - Handle(AdaptorCurve2d_AIS) anAisCollapse = new AdaptorCurve2d_AIS(anCollapseCircCurve); - myObject2d.Append(anAisCollapse); -} - -void GeometrySamples::BoundingBoxOfSurface3dSample() -{ - // Define a 4x4 grid of points for BSpline surface. - TColgp_Array2OfPnt aPoints(1, 4, 1, 4); - for (Standard_Integer i = 1; i <= 4; ++i) - { - gp_Pnt aPnt; - aPnt.SetX(5.0 * i); - for (Standard_Integer j = 1; j <= 4; ++j) - { - aPnt.SetY(5.0 * j); - if (1 < i && i < 4 && 1 < j && j < 4) - { - aPnt.SetZ(5.0); - } - else - { - aPnt.SetZ(0.0); - } - aPoints.SetValue(i, j, aPnt); - } - } - - // Make a BSpline surface from the points array. - Handle(Geom_BSplineSurface) aBSplineSurf = GeomAPI_PointsToBSplineSurface(aPoints).Surface(); - myResult << "Geom_BSplineSurface was created" << std::endl; - - // Compute BSpline surface bounding box. - Bnd_Box aBndBox; - BndLib_AddSurface::AddOptimal(GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox); - myResult << "Bounding box:" << std::endl; - myResult << " Min corner = [ " - << aBndBox.CornerMin().X() << ", " - << aBndBox.CornerMin().Y() << ", " - << aBndBox.CornerMin().Z() << " ]" << std::endl; - myResult << " Max corner = [ " - << aBndBox.CornerMax().X() << ", " - << aBndBox.CornerMax().Y() << ", " - << aBndBox.CornerMax().Z() << " ]" << std::endl; - - Handle(AIS_ColoredShape) anAisBSplineSurf = new AIS_ColoredShape( - BRepBuilderAPI_MakeFace(aBSplineSurf, Precision::Confusion()).Shape()); - Handle(AIS_ColoredShape) anAisBndBox = new AIS_ColoredShape( - BRepPrimAPI_MakeBox(aBndBox.CornerMin(), aBndBox.CornerMax()).Shell()); - myObject3d.Append(anAisBSplineSurf); - myObject3d.Append(anAisBndBox); - myContext->SetDisplayMode(anAisBndBox, 0, Standard_True); -} - -void GeometrySamples::BoundingBoxOfCurves3dSample() -{ - // Define points. - gp_Pnt aPnt1(0.0, 0.0, 10.0); - gp_Pnt aPnt2(5.0, 5.0, 5.0); - gp_Pnt aPnt3(10.0, 10.0, 15.0); - gp_Pnt aPnt4(15.0, 5.0, 20.0); - - // Add points to the curve poles array. - TColgp_Array1OfPnt aPoles(1, 4); - aPoles.SetValue(1, aPnt1); - aPoles.SetValue(2, aPnt2); - aPoles.SetValue(3, aPnt3); - aPoles.SetValue(4, aPnt4); - - // Make a BSpline curve from the points array. - Handle(Geom_BSplineCurve) aBSplineCurve = GeomAPI_PointsToBSpline(aPoles).Curve(); - myResult << "aBSplineCurve was created" << std::endl; - - // Compute BSpline curve bounding box. - Bnd_Box aBndBox; - BndLib_Add3dCurve::AddOptimal(GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox); - myResult << "Bounding box:" << std::endl; - myResult << " Min corner = [ " - << aBndBox.CornerMin().X() << ", " - << aBndBox.CornerMin().Y() << ", " - << aBndBox.CornerMin().Z() << " ]" << std::endl; - myResult << " Max corner = [ " - << aBndBox.CornerMax().X() << ", " - << aBndBox.CornerMax().Y() << ", " - << aBndBox.CornerMax().Z() << " ]" << std::endl; - - Handle(AIS_ColoredShape) anAisBSplineCurve = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aBSplineCurve).Shape()); - Handle(AIS_ColoredShape) anAisBndBox = new AIS_ColoredShape (BRepPrimAPI_MakeBox(aBndBox.CornerMin(), aBndBox.CornerMax()).Shell()); - myObject3d.Append(anAisBSplineCurve); - myObject3d.Append(anAisBndBox); - myContext->SetDisplayMode(anAisBndBox, 0, Standard_True); -} - -void GeometrySamples::BoundingBoxOfCurves2dSample() -{ - // Define points. - gp_Pnt2d aPnt1(0.0, 0.0); - gp_Pnt2d aPnt2(5.0, 5.0); - gp_Pnt2d aPnt3(10.0, 10.0); - gp_Pnt2d aPnt4(15.0, 5.0); - - // Add points to the curve poles array. - TColgp_Array1OfPnt2d aPoles(1, 4); - aPoles.SetValue(1, aPnt1); - aPoles.SetValue(2, aPnt2); - aPoles.SetValue(3, aPnt3); - aPoles.SetValue(4, aPnt4); - - // Make a BSpline curve from the points array. - Handle(Geom2d_BSplineCurve) aBSplineCurve = Geom2dAPI_PointsToBSpline(aPoles).Curve(); - - // Compute BSpline curve bounding box. - Bnd_Box2d aBndBox; - BndLib_Add2dCurve::AddOptimal(aBSplineCurve, 0.0, 1.0, Precision::PConfusion(), aBndBox); - Standard_Real aXmin, aYmin, aXmax, aYmax; - aBndBox.Get(aXmin, aYmin, aXmax, aYmax); - - myResult << "Bounding box:" << std::endl; - myResult << " Min corner = [ " << aXmin << ", " << aYmin << " ]" << std::endl; - myResult << " Max corner = [ " << aXmax << ", " << aYmax << " ]" << std::endl; - - Handle(AdaptorCurve2d_AIS) anAisBSpline = new AdaptorCurve2d_AIS(aBSplineCurve); - - Handle(AdaptorVec_AIS) anAisVec1 = new AdaptorVec_AIS(gp_Pnt2d(aXmin, aYmin), gp_Pnt2d(aXmin, aYmax)); - Handle(AdaptorVec_AIS) anAisVec2 = new AdaptorVec_AIS(gp_Pnt2d(aXmin, aYmax), gp_Pnt2d(aXmax, aYmax)); - Handle(AdaptorVec_AIS) anAisVec3 = new AdaptorVec_AIS(gp_Pnt2d(aXmax, aYmax), gp_Pnt2d(aXmax, aYmin)); - Handle(AdaptorVec_AIS) anAisVec4 = new AdaptorVec_AIS(gp_Pnt2d(aXmax, aYmin), gp_Pnt2d(aXmin, aYmin)); - - myObject2d.Append(anAisBSpline); - myObject2d.Append(anAisVec1); - myObject2d.Append(anAisVec2); - myObject2d.Append(anAisVec3); - myObject2d.Append(anAisVec4); -} - -void GeometrySamples::DumpCircleInfoSample() -{ - // Define a circle placed in the origin of XY coordinate - // plane and with the radius equal to 0.5. - gp_Circ aCirc(gp::XOY(), 0.5); - // Create a closed circular curve. - Handle(Geom_Circle) aCircCurve = new Geom_Circle(aCirc); - myResult << "Geom_Circle was created:" << std::endl; - myResult << " Center = [ " - << aCircCurve->Position().Location().X() << ", " - << aCircCurve->Position().Location().Y() << ", " - << aCircCurve->Position().Location().Z() << " ]" - << std::endl; - myResult << " Radius = " << aCircCurve->Radius() << std::endl; - myResult << " Plane normal = [ " - << aCircCurve->Position().Direction().X() << ", " - << aCircCurve->Position().Direction().Y() << ", " - << aCircCurve->Position().Direction().Z() << " ]" - << std::endl; - - Handle(AIS_Circle) anAisCircle = new AIS_Circle(aCircCurve); - Handle(AIS_TextLabel) anAisCenterLabel = new AIS_TextLabel(); - anAisCenterLabel->SetText(" Center"); - anAisCenterLabel->SetPosition(aCircCurve->Position().Location()); - Handle(AIS_Point) anAisCenter = new AIS_Point(new Geom_CartesianPoint(aCirc.Location())); - Handle(AIS_Axis) anAisAxis = new AIS_Axis(new Geom_Axis2Placement(aCircCurve->Position()), AIS_TOAX_ZAxis); - myObject3d.Append(anAisCircle); - myObject3d.Append(anAisCenterLabel); - myObject3d.Append(anAisAxis); -} - -void GeometrySamples::DumpBSplineCurveInfoSample() -{ - // Define points. - gp_Pnt aPnt1(0.0, 0.0, 10.0); - gp_Pnt aPnt2(5.0, 5.0, 5.0); - gp_Pnt aPnt3(10.0, 10.0, 15.0); - gp_Pnt aPnt4(15.0, 5.0, 20.0); - - // Add points to the curve poles array. - TColgp_Array1OfPnt aPoles(1, 4); - aPoles.SetValue(1, aPnt1); - aPoles.SetValue(2, aPnt2); - aPoles.SetValue(3, aPnt3); - aPoles.SetValue(4, aPnt4); - - // Make a BSpline curve from the points array - Handle(Geom_BSplineCurve) aBSplineCurve = GeomAPI_PointsToBSpline(aPoles).Curve(); - myResult << "aBSplineCurve was created:" << std::endl; - myResult << " Degree = " << aBSplineCurve->Degree() << std::endl; - myResult << " Parameter range = [ " - << aBSplineCurve->FirstParameter() << ", " - << aBSplineCurve->LastParameter() << " ]" - << std::endl; - NCollection_List aParams; - aParams.Append(0.75 * aBSplineCurve->FirstParameter() + 0.25 * aBSplineCurve->LastParameter()); - aParams.Append(0.50 * aBSplineCurve->FirstParameter() + 0.50 * aBSplineCurve->LastParameter()); - aParams.Append(0.25 * aBSplineCurve->FirstParameter() + 0.75 * aBSplineCurve->LastParameter()); - myResult << " Curve info:" << std::endl; - for (NCollection_List::Iterator anIt(aParams); anIt.More(); anIt.Next()) - { - Standard_Real aParam = anIt.Value(); - gp_Pnt aPnt; - gp_Vec aVec; - aBSplineCurve->D1(aParam, aPnt, aVec); - myResult << " Param = " << aParam << std::endl; - myResult << " P = [ " << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() << " ]" << std::endl; - myResult << " D = [ " << aVec.X() << ", " << aVec.Y() << ", " << aVec.Z() << " ]" << std::endl; - myObject3d.Append(new AIS_Point(new Geom_CartesianPoint(aPnt))); - Handle(AIS_TextLabel) anAisCenterLabel = new AIS_TextLabel(); - Standard_SStream aSS; - aSS << "P [" << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() << "]" << std::endl; - aSS << "D [" << aVec.X() << ", " << aVec.Y() << ", " << aVec.Z() << "]" << std::endl; - anAisCenterLabel->SetText(aSS.str().c_str()); - anAisCenterLabel->SetPosition(aPnt); - myObject3d.Append(anAisCenterLabel); - Handle(AIS_Axis) anAisD = new AIS_Axis(new Geom_Axis1Placement(gp_Ax1(aPnt, aVec))); - myObject3d.Append(anAisD); - } - - Handle(AIS_ColoredShape) anAisBSplineCurve = new AIS_ColoredShape (BRepBuilderAPI_MakeEdge(aBSplineCurve).Shape()); - anAisBSplineCurve->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisBSplineCurve); -} diff --git a/samples/qt/OCCTOverview/code/GeometrySamples.h b/samples/qt/OCCTOverview/code/GeometrySamples.h deleted file mode 100644 index 7da4ad7645..0000000000 --- a/samples/qt/OCCTOverview/code/GeometrySamples.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef GEOMETRYSAMPLES_H -#define GEOMETRYSAMPLES_H - -#include "BaseSample.h" - -//! Implements Geometry samples -class GeometrySamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(GeometrySamples, BaseSample) -public: - - GeometrySamples (const TCollection_AsciiString& theSampleSourcePath, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample(theSampleSourcePath, theContext) {} - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - void DisplayPnt (const gp_Pnt& thePnt, const TCollection_AsciiString& theText, - Aspect_TypeOfMarker theMarker = Aspect_TOM_PLUS, - Standard_Real theDistance = 5.0); - void DisplayPnt (const gp_Pnt2d& thePnt2d, const TCollection_AsciiString& theText, - Aspect_TypeOfMarker theMarker = Aspect_TOM_PLUS, - Standard_Real theDistance = 5.0); - - // One function for every sample - void ZeroDimensionObjects3dSample(); - void Vectors3dSample(); - void InfinityLines3dSample(); - void SecondOrderCurves3dSample(); - void PlaneSurfaces3dSample(); - void SecondOrderSurfaces3dSample(); - void ZeroDimensionObjects2dSample(); - void Vectors2dSample(); - void InfinityLines2dSample(); - void SecondOrderCurves2dSample(); - void BarycenterPoint3dSample(); - void RotatedVector3dSample(); - void MirroredLine3dSample(); - void ScaledEllipse3dSample(); - void TransformedCylinder3dSample(); - void TranslatedTorus3dSample(); - void ConjugateObjects3dSample(); - void ProjectionOfPoint3dSample(); - void MinimalDistance3dSample(); - void Intersection3dSample(); - void TranslatedPoint2dSample(); - void RotatedDirection2dSample(); - void MirroredAxis2dSample(); - void TransformedEllipse2dSample(); - void ConjugateObjects2dSample(); - void Tangent2dSample(); - void ProjectionOfPoint2dSample(); - void MinimalDistance2dSample(); - void Intersection2dSample(); - void PointInfo3dSample(); - void EllipseInfo3dSample(); - void PointInfo2dSample(); - void CircleInfo2dSample(); - void FreeStyleCurves3dSample(); - void AnalyticalSurfaces3dSample(); - void FreeStyleSurfaces3dSample(); - void FreeStyleCurves2dSample(); - void TrimmedCurve3dSample(); - void OffsetCurve3dSample(); - void BSplineFromCircle3dSample(); - void TrimmedSurface3dSample(); - void OffsetSurface3dSample(); - void ExtrusionSurface3dSample(); - void RevolutionSurface3dSample(); - void TrimmedCurve2dSample(); - void OffsetCurve2dSample(); - void BoundingBoxOfSurface3dSample(); - void BoundingBoxOfCurves3dSample(); - void BoundingBoxOfCurves2dSample(); - void DumpCircleInfoSample(); - void DumpBSplineCurveInfoSample(); -}; - -#endif //GEOMETRYSAMPLES_H diff --git a/samples/qt/OCCTOverview/code/MakeBottle.cxx b/samples/qt/OCCTOverview/code/MakeBottle.cxx deleted file mode 100644 index 44307e0759..0000000000 --- a/samples/qt/OCCTOverview/code/MakeBottle.cxx +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "MakeBottle.h" - -#include - -#include - -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include - -TopoDS_Shape MakeBottle (const Standard_Real theWidth, - const Standard_Real theHeight, - const Standard_Real theThickness) -{ - // Profile : Define Support Points - gp_Pnt aPnt1(-theWidth / 2., 0, 0); - gp_Pnt aPnt2(-theWidth / 2., -theThickness / 4., 0); - gp_Pnt aPnt3(0, -theThickness / 2., 0); - gp_Pnt aPnt4(theWidth / 2., -theThickness / 4., 0); - gp_Pnt aPnt5(theWidth / 2., 0, 0); - - // Profile : Define the Geometry - Handle(Geom_TrimmedCurve) anArcOfCircle = GC_MakeArcOfCircle(aPnt2, aPnt3, aPnt4); - Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2); - Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5); - - // Profile : Define the Topology - TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1); - TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(anArcOfCircle); - TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2); - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3); - - // Complete Profile - gp_Ax1 xAxis = gp::OX(); - gp_Trsf aTrsf; - - aTrsf.SetMirror(xAxis); - BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf); - TopoDS_Shape aMirroredShape = aBRepTrsf.Shape(); - TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape); - - BRepBuilderAPI_MakeWire mkWire; - mkWire.Add(aWire); - mkWire.Add(aMirroredWire); - TopoDS_Wire myWireProfile = mkWire.Wire(); - - // Body : Prism the Profile - TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile); - gp_Vec aPrismVec(0, 0, theHeight); - TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec); - - // Body : Apply Fillets - BRepFilletAPI_MakeFillet mkFillet(myBody); - TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE); - while (anEdgeExplorer.More()) - { - TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current()); - //Add edge to fillet algorithm - mkFillet.Add(theThickness / 12., anEdge); - anEdgeExplorer.Next(); - } - - myBody = mkFillet.Shape(); - - // Body : Add the Neck - gp_Pnt neckLocation(0, 0, theHeight); - gp_Dir neckAxis = gp::DZ(); - gp_Ax2 neckAx2(neckLocation, neckAxis); - - Standard_Real myNeckRadius = theThickness / 4.; - Standard_Real myNeckHeight = theHeight / 10.; - - BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight); - TopoDS_Shape myNeck = MKCylinder.Shape(); - - myBody = BRepAlgoAPI_Fuse(myBody, myNeck); - - // Body : Create a Hollowed Solid - TopoDS_Face faceToRemove; - Standard_Real zMax = -1; - - for (TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE); aFaceExplorer.More(); aFaceExplorer.Next()) - { - TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current()); - // Check if is the top face of the bottle’s neck - Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace); - if (aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)) - { - Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface); - gp_Pnt aPnt = aPlane->Location(); - Standard_Real aZ = aPnt.Z(); - if (aZ > zMax) - { - zMax = aZ; - faceToRemove = aFace; - } - } - } - - TopTools_ListOfShape facesToRemove; - facesToRemove.Append(faceToRemove); - BRepOffsetAPI_MakeThickSolid aSolidMaker; - aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -theThickness / 50, 1.e-3); - myBody = aSolidMaker.Shape(); - // Threading : Create Surfaces - Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99); - Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05); - - // Threading : Define 2D Curves - gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.); - gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.); - gp_Ax2d anAx2d(aPnt, aDir); - - Standard_Real aMajor = 2. * M_PI; - Standard_Real aMinor = myNeckHeight / 10; - - Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor); - Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4); - Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI); - Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI); - gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0); - gp_Pnt2d anEllipsePnt2 = anEllipse1->Value(M_PI); - - Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2); - // Threading : Build Edges and Wires - TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1); - TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1); - TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2); - TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2); - TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1); - TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2); - BRepLib::BuildCurves3d(threadingWire1); - BRepLib::BuildCurves3d(threadingWire2); - - // Create Threading - BRepOffsetAPI_ThruSections aTool(Standard_True); - aTool.AddWire(threadingWire1); - aTool.AddWire(threadingWire2); - aTool.CheckCompatibility(Standard_False); - - TopoDS_Shape myThreading = aTool.Shape(); - - // Building the Resulting Compound - TopoDS_Compound aRes; - BRep_Builder aBuilder; - aBuilder.MakeCompound(aRes); - aBuilder.Add(aRes, myBody); - aBuilder.Add(aRes, myThreading); - - return aRes; -} diff --git a/samples/qt/OCCTOverview/code/MakeBottle.h b/samples/qt/OCCTOverview/code/MakeBottle.h deleted file mode 100644 index ad1e783064..0000000000 --- a/samples/qt/OCCTOverview/code/MakeBottle.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef MAKEBOTTLE_H -#define MAKEBOTTLE_H - -#include -#include - -//! Returns sample bottle TopoDS_Shape -TopoDS_Shape MakeBottle(const Standard_Real theWidth, - const Standard_Real theyHeight, - const Standard_Real theThickness); - -#endif // MAKEBOTTLE_H diff --git a/samples/qt/OCCTOverview/code/Ocaf.xml b/samples/qt/OCCTOverview/code/Ocaf.xml deleted file mode 100644 index ea269c4b19..0000000000 --- a/samples/qt/OCCTOverview/code/Ocaf.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/qt/OCCTOverview/code/OcafSamples.cxx b/samples/qt/OCCTOverview/code/OcafSamples.cxx deleted file mode 100644 index 0154f48d35..0000000000 --- a/samples/qt/OCCTOverview/code/OcafSamples.cxx +++ /dev/null @@ -1,629 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "OcafSamples.h" - -#include "TOcaf_Application.h" -#include "TOcafFunction_BoxDriver.h" -#include "TOcafFunction_CylDriver.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void OcafSamples::Process (const TCollection_AsciiString& theSampleName) -{ - if (IsImportSample(theSampleName)) - { - myObject3d.Clear(); - } - myObject2d.Clear(); - myCode.Clear(); - myIsProcessed = Standard_False; - try - { - ExecuteSample(theSampleName); - } - catch (...) - { - TraceError(TCollection_AsciiString("Error in sample: ") + theSampleName); - } -} - -void OcafSamples::ClearExtra() -{ - myOcafDoc = nullptr; - myContext->RemoveAll(Standard_True); -} - -void OcafSamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "CreateOcafDocument") - CreateOcafDocument(); - else if (theSampleName == "CreateBoxOcafSample") - CreateBoxOcafSample(); - else if (theSampleName == "CreateCylinderOcafSample") - CreateCylinderOcafSample(); - else if (theSampleName == "ModifyBoxOcafSample") - ModifyBoxOcafSample(); - else if (theSampleName == "ModifyCylinderOcafSample") - ModifyCylinderOcafSample(); - else if (theSampleName == "UndoOcafSample") - UndoOcafSample(); - else if (theSampleName == "RedoOcafSample") - RedoOcafSample(); - else if (theSampleName == "DialogOpenOcafSample") - DialogOpenOcafSample(); - else if (theSampleName == "DialogSaveBinOcafSample") - DialogSaveBinOcafSample(); - else if (theSampleName == "DialogSaveXmlOcafSample") - DialogSaveXmlOcafSample(); - else - { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -Standard_Boolean OcafSamples::IsExportSample (const TCollection_AsciiString& theSampleName) -{ - if (theSampleName == "DialogSaveBinOcafSample" || theSampleName == "DialogSaveXmlOcafSample") - { - return Standard_True; - } - else - { - return Standard_False; - } -} - -Standard_Boolean OcafSamples::IsImportSample (const TCollection_AsciiString& theSampleName) -{ - if (theSampleName == "DialogOpenOcafSample") - { - return Standard_True; - } - else - { - return Standard_False; - } -} - -Standard_Boolean OcafSamples::IsBinarySample (const TCollection_AsciiString& theSampleName) -{ - if (theSampleName == "DialogOpenOcafSample" || theSampleName == "DialogSaveBinOcafSample") - { - return Standard_True; - } - else - { - return Standard_False; - } -} - -Standard_Boolean OcafSamples::IsXmlSample (const TCollection_AsciiString& theSampleName) -{ - if (theSampleName == "DialogOpenOcafSample" || theSampleName == "DialogSaveXmlOcafSample") - { - return Standard_True; - } - else - { - return Standard_False; - } -} - -void OcafSamples::CreateOcafDocument() -{ - Handle(TOcaf_Application) anOcaf_Application = new TOcaf_Application; - anOcaf_Application->NewDocument("BinOcaf", myOcafDoc); - TPrsStd_AISViewer::New(myOcafDoc->Main(), myViewer); - - Handle(AIS_InteractiveContext) anAisContext; - TPrsStd_AISViewer::Find(myOcafDoc->Main(), anAisContext); - anAisContext->SetDisplayMode(AIS_Shaded, Standard_True); - myContext = anAisContext; - - // Set the maximum number of available "undo" actions - myOcafDoc->SetUndoLimit(10); -} - -void OcafSamples::CreateBoxOcafSample() -{ - // Open a new command (for undo) - myOcafDoc->NewCommand(); - - // A data structure for our box: - // the box itself is attached to the BoxLabel label (as his name and his function attribute) - // its arguments (dimensions: width, length and height; and position: x, y, z) - // are attached to the child labels of the box: - // 0:1 Box Label ---> Name ---> Named shape ---> Function - // 0:1:1 -- Width Label - // 0:1:2 -- Length Label - // 0:1:3 -- Height Label - // 0:1:4 -- X Label - // 0:1:5 -- Y Label - // 0:1:6 -- Z Label - - // Create a new label in the data structure for the box - TDF_Label aLabel = TDF_TagSource::NewChild(myOcafDoc->Main()); - - Standard_Real aBoxWidth(30.0), aBoxLength(20.0), aBoxHeight(10.0); - Standard_Real aBoxX(0.0), aBoxY(0.0), aBoxZ(0.0); - Standard_CString aBoxName("OcafBox"); - // Create the data structure : Set the dimensions, position and name attributes - TDataStd_Real::Set(aLabel.FindChild(1), aBoxWidth); - TDataStd_Real::Set(aLabel.FindChild(2), aBoxLength); - TDataStd_Real::Set(aLabel.FindChild(3), aBoxHeight); - TDataStd_Real::Set(aLabel.FindChild(4), aBoxX); - TDataStd_Real::Set(aLabel.FindChild(5), aBoxY); - TDataStd_Real::Set(aLabel.FindChild(6), aBoxZ); - TDataStd_Name::Set(aLabel, aBoxName); // Name - - // Instantiate a TFunction_Function attribute connected to the current box driver - // and attach it to the data structure as an attribute of the Box Label - Handle(TFunction_Function) myFunction = TFunction_Function::Set(aLabel, TOcafFunction_BoxDriver::GetID()); - - // Initialize and execute the box driver (look at the "Execute()" code) - Handle(TFunction_Logbook) aLogBook = TFunction_Logbook::Set(aLabel); - - Handle(TFunction_Driver) myBoxDriver; - // Find the TOcafFunction_BoxDriver in the TFunction_DriverTable using its GUID - if (!TFunction_DriverTable::Get()->FindDriver(TOcafFunction_BoxDriver::GetID(), myBoxDriver)) - { - myResult << "Ocaf Box driver not found" << std::endl; - } - - myBoxDriver->Init(aLabel); - if (myBoxDriver->Execute(aLogBook)) - { - myResult << "Create Box function execute failed" << std::endl; - } - - // Get the TPrsStd_AISPresentation of the new box TNaming_NamedShape - Handle(TPrsStd_AISPresentation) anAisPresentation = TPrsStd_AISPresentation::Set(aLabel, TNaming_NamedShape::GetID()); - // Display it - anAisPresentation->Display(1); - // Attach an integer attribute to aLabel to memorize it's displayed - TDataStd_Integer::Set(aLabel, 1); - myContext->UpdateCurrentViewer(); - - // Close the command (for undo) - myOcafDoc->CommitCommand(); - - myResult << "Created a box with name: " << aBoxName << std::endl; - myResult << "base coord X: " << aBoxX << " Y: " << aBoxY << " Z: " << aBoxZ << std::endl; - myResult << "width: " << aBoxWidth << " length: " << aBoxLength << " height: " << aBoxHeight << std::endl; -} - -void OcafSamples::CreateCylinderOcafSample() -{ - // Open a new command (for undo) - myOcafDoc->NewCommand(); - - // A data structure for our cylinder: - // the cylinder itself is attached to the CylinderLabel label (as his name and his function attribute) - // its arguments (dimensions: radius and height; and position: x, y, z) - // are attached to the child labels of the cylinder: - // 0:1 Cylinder Label ---> Name ---> Named shape ---> Function - // 0:1:1 -- Radius Label - // 0:1:2 -- Height Label - // 0:1:3 -- X Label - // 0:1:4 -- Y Label - // 0:1:5 -- Z Label - - // Create a new label in the data structure for the cylinder - TDF_Label aLabel = TDF_TagSource::NewChild(myOcafDoc->Main()); - - Standard_Real aCylRadius(10.0), aCylHeight(20.0); - Standard_Real aCylX(60.0), aCylY(40.0), aCylZ(0.0); - Standard_CString aCylName("OcafCylinder"); - // Create the data structure : Set the dimensions, position and name attributes - TDataStd_Real::Set(aLabel.FindChild(1), aCylRadius); - TDataStd_Real::Set(aLabel.FindChild(2), aCylHeight); - TDataStd_Real::Set(aLabel.FindChild(3), aCylX); - TDataStd_Real::Set(aLabel.FindChild(4), aCylY); - TDataStd_Real::Set(aLabel.FindChild(5), aCylZ); - TDataStd_Name::Set(aLabel, aCylName); - - // Instantiate a TFunction_Function attribute connected to the current cylinder driver - // and attach it to the data structure as an attribute of the Cylinder Label - Handle(TFunction_Function) myFunction = TFunction_Function::Set(aLabel, TOcafFunction_CylDriver::GetID()); - - // Initialize and execute the cylinder driver (look at the "Execute()" code) - Handle(TFunction_Logbook) aLogBook = TFunction_Logbook::Set(aLabel); - - Handle(TFunction_Driver) myCylDriver; - // Find the TOcafFunction_CylDriver in the TFunction_DriverTable using its GUID - if (!TFunction_DriverTable::Get()->FindDriver(TOcafFunction_CylDriver::GetID(), myCylDriver)) - { - myResult << "Ocaf Cylinder driver not found"; - } - myCylDriver->Init(aLabel); - if (myCylDriver->Execute(aLogBook)) - { - myResult << "Create Cylinder function execute failed"; - } - // Get the TPrsStd_AISPresentation of the new box TNaming_NamedShape - Handle(TPrsStd_AISPresentation) anAisPresentation = TPrsStd_AISPresentation::Set(aLabel, TNaming_NamedShape::GetID()); - // Display it - anAisPresentation->Display(1); - // Attach an integer attribute to aLabel to memorize it's displayed - TDataStd_Integer::Set(aLabel, 1); - myContext->UpdateCurrentViewer(); - - // Close the command (for undo) - myOcafDoc->CommitCommand(); - - myResult << "Created a cylinder with name: " << aCylName << std::endl; - myResult << "radius: " << aCylRadius << " height: " << aCylHeight << std::endl; - myResult << "base coord X: " << aCylX << " Y: " << aCylY << " Z: " << aCylZ << std::endl; -} - -void OcafSamples::ModifyBoxOcafSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - Standard_Integer aBoxCount(0); - for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - - // Get the main label of the selected object - Handle(TPrsStd_AISPresentation) anAisPresentation = Handle(TPrsStd_AISPresentation)::DownCast(anAisObject->GetOwner()); - TDF_Label aLabel = anAisPresentation->Label(); - - // Get the TFunction_Function attribute of the selected object - Handle(TFunction_Function) aFunction; - if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction)) - { - myResult << "Object cannot be modified."; - return; - } - // Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute - Standard_GUID aDriverID = aFunction->GetDriverGUID(); - - // Case of a box created with the box function driver - if (aDriverID == TOcafFunction_BoxDriver::GetID()) - { - aBoxCount++; - Standard_Real aBoxX, aBoxY, aBoxZ, aBoxWidth, aBoxLength, aBoxHeight; - - // Get the attributes values of the current box - Handle(TDataStd_Real) aCurrentReal; - aLabel.FindChild(1).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aBoxWidth = aCurrentReal->Get(); - aLabel.FindChild(2).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aBoxLength = aCurrentReal->Get(); - aLabel.FindChild(3).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aBoxHeight = aCurrentReal->Get(); - aLabel.FindChild(4).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aBoxX = aCurrentReal->Get(); - aLabel.FindChild(5).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aBoxY = aCurrentReal->Get(); - aLabel.FindChild(6).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aBoxZ = aCurrentReal->Get(); - Handle(TDataStd_Name) aBoxName; - aLabel.FindAttribute(TDataStd_Name::GetID(), aBoxName); - - myResult << "Current parameters of box with name: " << aBoxName->Get() << std::endl; - myResult << "width: " << aBoxWidth << " length: " << aBoxLength << " height: " << aBoxHeight << std::endl; - myResult << "base coord X: " << aBoxX << " Y: " << aBoxY << " Z: " << aBoxZ << std::endl; - - // Open a new command (for undo) - myOcafDoc->NewCommand(); - // Modify the box - 1.5 times increase - aBoxWidth *= 1.5; aBoxLength *= 1.5; aBoxHeight *= 1.5; - - TDataStd_Real::Set(aLabel.FindChild(1), aBoxWidth); - TDataStd_Real::Set(aLabel.FindChild(2), aBoxLength); - TDataStd_Real::Set(aLabel.FindChild(3), aBoxHeight); - TDataStd_Real::Set(aLabel.FindChild(4), aBoxX); - TDataStd_Real::Set(aLabel.FindChild(5), aBoxY); - TDataStd_Real::Set(aLabel.FindChild(6), aBoxZ); - - // Get the TFunction_FunctionDriver GUID used with the TFunction_Function - aDriverID = aFunction->GetDriverGUID(); - Handle(TFunction_Logbook) aLogBook = TFunction_Logbook::Set(aLabel); - Handle(TFunction_Driver) aBoxDriver; - // Find the TOcafFunction_BoxDriver in the TFunction_DriverTable using its GUID - TFunction_DriverTable::Get()->FindDriver(aDriverID, aBoxDriver); - // Execute the cut if it must be (if an attribute changes) - aBoxDriver->Init(aLabel); - - // Set the box touched, it will be useful to recompute an object which used this box as attribute - aLogBook->SetTouched(aLabel); - if (aBoxDriver->Execute(aLogBook)) - { - myResult << "Recompute failed" << std::endl; - } - - // Get the presentation of the box, display it and set it selected - anAisPresentation = TPrsStd_AISPresentation::Set(aLabel, TNaming_NamedShape::GetID()); - TDataStd_Integer::Set(aLabel, 1); - anAisPresentation->Display(1); - myContext->UpdateCurrentViewer(); - // Close the command (for undo) - myOcafDoc->CommitCommand(); - - myResult << std::endl; - myResult << "New box parameters: " << std::endl; - myResult << "base coord X: " << aBoxX << " Y: " << aBoxY << " Z: " << aBoxZ << std::endl; - myResult << "width: " << aBoxWidth << " length: " << aBoxLength << " height: " << aBoxHeight << std::endl; - } - } - if (aBoxCount) - { - myResult << "Number of modified boxes: " << aBoxCount << std::endl; - } - else - { - myResult << "No boxes to modify" << std::endl; - } -} - -void OcafSamples::ModifyCylinderOcafSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - Standard_Integer aCylCount(0); - for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - // Get the main label of the selected object - Handle(TPrsStd_AISPresentation) anAisPresentation = Handle(TPrsStd_AISPresentation)::DownCast(anAisObject->GetOwner()); - TDF_Label aLabel = anAisPresentation->Label(); - - // Get the TFunction_Function attribute of the selected object - Handle(TFunction_Function) aFunction; - if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction)) - { - myResult << "Object cannot be modified."; - return; - } - // Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute - Standard_GUID aDriverID = aFunction->GetDriverGUID(); - - // Case of a box created with the box function driver - if (aDriverID == TOcafFunction_CylDriver::GetID()) - { - aCylCount++; - Standard_Real aCylRadius, aCylHeight, aCylX, aCylY, aCylZ; - - // Get the attributes values of the current box - Handle(TDataStd_Real) aCurrentReal; - aLabel.FindChild(1).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aCylRadius = aCurrentReal->Get(); - aLabel.FindChild(2).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aCylHeight = aCurrentReal->Get(); - aLabel.FindChild(3).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aCylX = aCurrentReal->Get(); - aLabel.FindChild(4).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aCylY = aCurrentReal->Get(); - aLabel.FindChild(5).FindAttribute(TDataStd_Real::GetID(), aCurrentReal); - aCylZ = aCurrentReal->Get(); - - Handle(TDataStd_Name) aCylName; - aLabel.FindAttribute(TDataStd_Name::GetID(), aCylName); - - myResult << "Current parameters of box with name: " << aCylName->Get() << std::endl; - myResult << "radius: " << aCylRadius << " height: " << aCylHeight << std::endl; - myResult << "base coord X: " << aCylX << " Y: " << aCylY << " Z: " << aCylZ << std::endl; - - // Open a new command (for undo) - myOcafDoc->NewCommand(); - // Modify the cylinder - 2x increase - aCylRadius *= 2.0; aCylHeight *= 2.0; - // and move base point in XY plane - aCylX *= 2.0; aCylY *= 2.0; - - TDataStd_Real::Set(aLabel.FindChild(1), aCylRadius); - TDataStd_Real::Set(aLabel.FindChild(2), aCylHeight); - TDataStd_Real::Set(aLabel.FindChild(3), aCylX); - TDataStd_Real::Set(aLabel.FindChild(4), aCylY); - TDataStd_Real::Set(aLabel.FindChild(5), aCylZ); - - // Get the TFunction_FunctionDriver GUID used with the TFunction_Function - aDriverID = aFunction->GetDriverGUID(); - Handle(TFunction_Logbook) aLogBook = TFunction_Logbook::Set(aLabel); - Handle(TFunction_Driver) aCylDriver; - // Find the TOcafFunction_CylDriver in the TFunction_DriverTable using its GUID - TFunction_DriverTable::Get()->FindDriver(aDriverID, aCylDriver); - // Execute the cut if it must be (if an attribute changes) - aCylDriver->Init(aLabel); - - // Set the cylinder touched, it will be useful to recompute an object which used this box as attribute - aLogBook->SetTouched(aLabel); - if (aCylDriver->Execute(aLogBook)) - { - myResult << "Recompute failed" << std::endl; - } - // Get the presentation of the box, display it and set it selected - anAisPresentation = TPrsStd_AISPresentation::Set(aLabel, TNaming_NamedShape::GetID()); - TDataStd_Integer::Set(aLabel, 1); - anAisPresentation->Display(1); - myContext->UpdateCurrentViewer(); - // Close the command (for undo) - myOcafDoc->CommitCommand(); - - myResult << std::endl; - myResult << "New cylinder parameters: " << std::endl; - myResult << "radius: " << aCylRadius << " height: " << aCylHeight << std::endl; - myResult << "base coord X: " << aCylX << " Y: " << aCylY << " Z: " << aCylZ << std::endl; - } - } - if (aCylCount) - { - myResult << "Number of modified boxes: " << aCylCount << std::endl; - } - else - { - myResult << "No boxes to modify" << std::endl; - } -} - -void OcafSamples::UndoOcafSample() -{ - if (myOcafDoc->Undo()) - { - myOcafDoc->CommitCommand(); - myContext->UpdateCurrentViewer(); - myResult << "Undo was done successfully" << std::endl; - } - else - { - myResult << "Nothing to undo" << std::endl; - } -} - -void OcafSamples::RedoOcafSample() -{ - if (myOcafDoc->Redo()) - { - myOcafDoc->CommitCommand(); - myContext->UpdateCurrentViewer(); - myResult << "Redo was done successfully" << std::endl; - } - else - { - myResult << "Nothing to redo" << std::endl; - } -} - -void OcafSamples::DialogOpenOcafSample() -{ - Handle(TOcaf_Application) anOcaf_Application = new TOcaf_Application; - // load persistence - BinDrivers::DefineFormat(anOcaf_Application); - XmlDrivers::DefineFormat(anOcaf_Application); - // Look for already opened - if (anOcaf_Application->IsInSession(myFileName)) - { - myResult << "Document: " << myFileName << " is already in session" << std::endl; - return; - } - // Open the document in the current application - PCDM_ReaderStatus aReaderStatus = anOcaf_Application->Open(myFileName, myOcafDoc); - if (aReaderStatus == PCDM_RS_OK) - { - // Connect the document CAF (myDoc) with the AISContext (myAISContext) - TPrsStd_AISViewer::New(myOcafDoc->Main(), myViewer); - myOcafDoc->SetUndoLimit(10); - - myContext->RemoveAll(Standard_False); - Handle(AIS_InteractiveContext) aContext; - TPrsStd_AISViewer::Find(myOcafDoc->Main(), aContext); - aContext->SetDisplayMode(AIS_Shaded, Standard_True); - myContext = aContext; - - // Display the presentations (which was not stored in the document) - DisplayPresentation(); - myResult << "Open a document" << std::endl; - } - else - { - myResult << "Error! The file wasn't opened. PCDM_ReaderStatus: " << aReaderStatus << std::endl; - } -} - -void OcafSamples::DialogSaveBinOcafSample() -{ - Handle(TOcaf_Application) anOcaf_Application = new TOcaf_Application; - BinDrivers::DefineFormat(anOcaf_Application); - myOcafDoc->ChangeStorageFormat("BinOcaf"); - // Saves the document in the current application - PCDM_StoreStatus aStoreStatus = anOcaf_Application->SaveAs(myOcafDoc, myFileName); - if (aStoreStatus == PCDM_SS_OK) - { - myResult << "The file was saved successfully" << std::endl; - } - else - { - myResult << "Error! The file wasn't saved. PCDM_StoreStatus: " << aStoreStatus << std::endl; - } -} - -void OcafSamples::DialogSaveXmlOcafSample() -{ - Handle(TOcaf_Application) anOcaf_Application = new TOcaf_Application; - XmlDrivers::DefineFormat(anOcaf_Application); - myOcafDoc->ChangeStorageFormat("XmlOcaf"); - // Saves the document in the current application - PCDM_StoreStatus aStoreStatus = anOcaf_Application->SaveAs(myOcafDoc, myFileName); - if (aStoreStatus == PCDM_SS_OK) - { - myResult << "The file was saved successfully" << std::endl; - } - else - { - myResult << "Error! The file wasn't saved. PCDM_StoreStatus: " << aStoreStatus << std::endl; - } -} - -void OcafSamples::DisplayPresentation() -{ - TDF_Label aRootlabel = myOcafDoc->Main(); - - for (TDF_ChildIterator it(aRootlabel); it.More(); it.Next()) - { - TDF_Label aLabel = it.Value(); - Handle(TNaming_NamedShape) aNamedShape; - if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(), aNamedShape)) - { - continue; - } - Handle(TDataStd_Integer) aDataInteger; - - // To know if the object was displayed - if (aLabel.FindAttribute(TDataStd_Integer::GetID(), aDataInteger)) - { - if (!aDataInteger->Get()) - { - continue; - } - } - Handle(TPrsStd_AISPresentation) anAisPresentation; - if (!aLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), anAisPresentation)) - { - anAisPresentation = TPrsStd_AISPresentation::Set(aLabel, TNaming_NamedShape::GetID()); - } - anAisPresentation->SetColor(Quantity_NOC_ORANGE); - anAisPresentation->Display(1); - } - myContext->UpdateCurrentViewer(); -} diff --git a/samples/qt/OCCTOverview/code/OcafSamples.h b/samples/qt/OCCTOverview/code/OcafSamples.h deleted file mode 100644 index 96116efccf..0000000000 --- a/samples/qt/OCCTOverview/code/OcafSamples.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef OCAFSAMPLES_H -#define OCAFSAMPLES_H - -#include "BaseSample.h" -#include "TOcaf_Application.h" - -#include -#include -#include - -//! Implements OCAF samples -class OcafSamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(OcafSamples, BaseSample) -public: - - OcafSamples (const TCollection_AsciiString& theSampleSourcePath, - const Handle(V3d_Viewer)& theViewer, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample (theSampleSourcePath, theContext), - myViewer (theViewer) - { - // - } - - virtual void Process (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - - void ClearExtra(); - void SetFileName (const TCollection_AsciiString& theFileName) { myFileName = theFileName; }; - - static Standard_Boolean IsExportSample (const TCollection_AsciiString& theSampleName); - static Standard_Boolean IsImportSample (const TCollection_AsciiString& theSampleName); - static Standard_Boolean IsBinarySample (const TCollection_AsciiString& theSampleName); - static Standard_Boolean IsXmlSample (const TCollection_AsciiString& theSampleName); - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - // One function for every sample - void CreateOcafDocument(); - void CreateBoxOcafSample(); - void CreateCylinderOcafSample(); - void ModifyBoxOcafSample(); - void ModifyCylinderOcafSample(); - void UndoOcafSample(); - void RedoOcafSample(); - void DialogOpenOcafSample(); - void DialogSaveBinOcafSample(); - void DialogSaveXmlOcafSample(); - void DisplayPresentation(); - -private: - - TCollection_AsciiString myFileName; - Handle(V3d_Viewer) myViewer; - Handle(TDocStd_Document) myOcafDoc; -}; - -#endif //OCAFSAMPLES_H diff --git a/samples/qt/OCCTOverview/code/Sample2D_Face.cxx b/samples/qt/OCCTOverview/code/Sample2D_Face.cxx deleted file mode 100644 index 462ec01f9a..0000000000 --- a/samples/qt/OCCTOverview/code/Sample2D_Face.cxx +++ /dev/null @@ -1,486 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "Sample2D_Face.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -Sample2D_Face::Sample2D_Face (const TopoDS_Shape& theFace) -: myFORWARDColor (Quantity_NOC_BLUE1), - myREVERSEDColor (Quantity_NOC_YELLOW), - myINTERNALColor (Quantity_NOC_RED1), - myEXTERNALColor (Quantity_NOC_MAGENTA1), - myWidthIndex (1), - myTypeIndex (1), - // - myshape (theFace), - myForwardNum (0), - myReversedNum (0), - myInternalNum (0), - myExternalNum (0), - // - myForwardBounds (0), - myReversedBounds (0), - myInternalBounds (0), - myExternalBounds (0) -{ - SetAutoHilight(Standard_False); - FillData(Standard_True); -} - -void Sample2D_Face::DrawMarker (const Handle(Geom2d_TrimmedCurve)& theCurve, - const Handle(Prs3d_Presentation)& thePresentation) -{ - Standard_Real aCenterParam = (theCurve->FirstParameter() + theCurve->LastParameter()) / 2; - gp_Pnt2d p; - gp_Vec2d v; - theCurve->D1(aCenterParam, p, v); - if (v.Magnitude() > gp::Resolution()) - { - gp_Vec aDir(v.X(), v.Y(), 0.); - gp_Pnt aPoint(p.X(), p.Y(), 0.); - aDir.Normalize(); - aDir.Reverse(); - gp_Dir aZ(0, 0, 1); - gp_Pnt aLeft (aPoint.Translated(aDir.Rotated(gp_Ax1(aPoint, aZ), M_PI / 6) * 5)); - gp_Pnt aRight(aPoint.Translated(aDir.Rotated(gp_Ax1(aPoint, aZ), M_PI * 11 / 6) * 5)); - - Handle(Graphic3d_ArrayOfPolylines) anArrow = new Graphic3d_ArrayOfPolylines(3); - anArrow->AddVertex(aLeft); - anArrow->AddVertex(aPoint); - anArrow->AddVertex(aRight); - - thePresentation->CurrentGroup()->AddPrimitiveArray(anArrow); - } -} - -void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute) -{ - if (myshape.IsNull() || myshape.ShapeType() != TopAbs_FACE) - { - return; - } - - Standard_Real f, l; - TopoDS_Face aFace = TopoDS::Face(myshape); - - // count number of vertices and bounds in primitive arrays - if (isSizesRecompute) - { - mySeq_FORWARD.Clear(); - mySeq_REVERSED.Clear(); - mySeq_INTERNAL.Clear(); - mySeq_EXTERNAL.Clear(); - - myshape.Orientation(TopAbs_FORWARD); - for (TopExp_Explorer anEdgeIter (myshape, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next()) - { - const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Current()); - BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace); - GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2); - if (!anEdgeDistrib.IsDone()) - { - continue; - } - - switch (anEdge.Orientation()) - { - case TopAbs_FORWARD: - { - myForwardNum += anEdgeDistrib.NbPoints(); - myForwardBounds++; - break; - } - case TopAbs_REVERSED: - { - myReversedNum += anEdgeDistrib.NbPoints(); - myReversedBounds++; - break; - } - case TopAbs_INTERNAL: - { - myInternalNum += anEdgeDistrib.NbPoints(); - myInternalBounds++; - break; - } - case TopAbs_EXTERNAL: - { - myExternalNum += anEdgeDistrib.NbPoints(); - myExternalBounds++; - break; - } - } - } - } - - myForwardArray = new Graphic3d_ArrayOfPolylines(myForwardNum, myForwardBounds); - myReversedArray = new Graphic3d_ArrayOfPolylines(myReversedNum, myReversedBounds); - myInternalArray = new Graphic3d_ArrayOfPolylines(myInternalNum, myInternalBounds); - myExternalArray = new Graphic3d_ArrayOfPolylines(myExternalNum, myExternalBounds); - - // fill primitive arrays - for (TopExp_Explorer anEdgeIter (myshape, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next()) - { - const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Current()); - const Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface (anEdge, aFace, f, l); - Handle(Geom2d_TrimmedCurve) aTrimmedCurve = new Geom2d_TrimmedCurve(aCurve, f, l); - if (!aTrimmedCurve.IsNull()) - { - Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve); - BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace); - GCPnts_QuasiUniformDeflection anEdgeDistrib (aCurveOnEdge, 1.e-2); - if (!anEdgeDistrib.IsDone()) - { - continue; - } - - switch (anEdge.Orientation()) - { - case TopAbs_FORWARD: - { - myForwardArray->AddBound(anEdgeDistrib.NbPoints()); - for (Standard_Integer i = 1; i <= anEdgeDistrib.NbPoints(); ++i) - { - myForwardArray->AddVertex(anEdgeDistrib.Value(i)); - } - if (isSizesRecompute) - { - mySeq_FORWARD.Append(aCurve3d); - } - break; - } - case TopAbs_REVERSED: - { - myReversedArray->AddBound(anEdgeDistrib.NbPoints()); - for (Standard_Integer i = 1; i <= anEdgeDistrib.NbPoints(); ++i) - { - myReversedArray->AddVertex(anEdgeDistrib.Value(i)); - } - if (isSizesRecompute) - { - mySeq_REVERSED.Append(aCurve3d); - } - break; - } - case TopAbs_INTERNAL: - { - myInternalArray->AddBound(anEdgeDistrib.NbPoints()); - for (Standard_Integer i = 1; i <= anEdgeDistrib.NbPoints(); ++i) - { - myInternalArray->AddVertex(anEdgeDistrib.Value(i)); - } - if (isSizesRecompute) - { - mySeq_INTERNAL.Append(aCurve3d); - } - break; - } - case TopAbs_EXTERNAL: - { - myExternalArray->AddBound(anEdgeDistrib.NbPoints()); - for (Standard_Integer i = 1; i <= anEdgeDistrib.NbPoints(); ++i) - { - myExternalArray->AddVertex(anEdgeDistrib.Value(i)); - } - if (isSizesRecompute) - { - mySeq_EXTERNAL.Append(aCurve3d); - } - break; - } - } - } - } -} - -void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) -{ - if (theMode != 0) - { - return; - } - - thePresentation->Clear(); - myDrawer->SetWireDraw(1); - - if (myshape.IsNull() || myshape.ShapeType() != TopAbs_FACE) - { - return; - } - - Handle(Graphic3d_AspectLine3d) aLineAspect_FORWARD = new Graphic3d_AspectLine3d(myFORWARDColor, Aspect_TOL_SOLID, 1); - Handle(Graphic3d_AspectLine3d) aLineAspect_REVERSED = new Graphic3d_AspectLine3d(myREVERSEDColor, Aspect_TOL_SOLID, 1); - Handle(Graphic3d_AspectLine3d) aLineAspect_INTERNAL = new Graphic3d_AspectLine3d(myINTERNALColor, Aspect_TOL_SOLID, 1); - Handle(Graphic3d_AspectLine3d) aLineAspect_EXTERNAL = new Graphic3d_AspectLine3d(myEXTERNALColor, Aspect_TOL_SOLID, 1); - - Standard_Real f, l; - TopoDS_Face aFace = TopoDS::Face(myshape); - // estimating number of vertices in primitive arrays - for (TopExp_Explorer anEdgeIter (myshape, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next()) - { - const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeIter.Current()); - const Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface (anEdge, aFace, f, l); - - Handle(Geom2d_TrimmedCurve) aTrimmedCurve = new Geom2d_TrimmedCurve(aCurve, f, l); - // make a 3D curve from 2D trimmed curve to display it - Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve); - // make distribution of points - BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace); - GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2); - if (anEdgeDistrib.IsDone()) - { - switch (anEdge.Orientation()) - { - case TopAbs_FORWARD: - { - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD); - DrawMarker(aTrimmedCurve, thePresentation); - break; - } - case TopAbs_REVERSED: - { - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED); - DrawMarker(aTrimmedCurve, thePresentation); - break; - } - case TopAbs_INTERNAL: - { - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL); - DrawMarker(aTrimmedCurve, thePresentation); - - mySeq_INTERNAL.Append(aCurve3d); - break; - } - case TopAbs_EXTERNAL: - { - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL); - DrawMarker(aTrimmedCurve, thePresentation); - break; - } - } - } - } - - // add all primitives to the presentation - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD); - thePresentation->CurrentGroup()->AddPrimitiveArray(myForwardArray); - - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED); - thePresentation->CurrentGroup()->AddPrimitiveArray(myReversedArray); - - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL); - thePresentation->CurrentGroup()->AddPrimitiveArray(myInternalArray); - - thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL); - thePresentation->CurrentGroup()->AddPrimitiveArray(myExternalArray); -} - -void Sample2D_Face::HilightSelected (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const SelectMgr_SequenceOfOwner& theOwners) -{ - Handle(Prs3d_Presentation) aSelectionPrs = GetSelectPresentation (thePrsMgr); - - Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(Quantity_NOC_ANTIQUEWHITE, Aspect_TOL_SOLID, 2); - if (HasPresentation()) - { - aSelectionPrs->SetTransformPersistence(Presentation()->TransformPersistence()); - } - - const Standard_Integer aLength = theOwners.Length(); - aSelectionPrs->Clear(); - FillData(); - - Handle(Graphic3d_Group) aSelectGroup = aSelectionPrs->NewGroup(); - - for (Standard_Integer i = 1; i <= aLength; ++i) - { - Handle(SelectMgr_EntityOwner) anOwner = theOwners.Value(i); - // check priority of owner to add primitives in one of array - // containing primitives with certain type of orientation - switch (anOwner->Priority()) - { - case 7: - { - // add to objects with forward orientation - aSelectGroup->SetGroupPrimitivesAspect(aLineAspect); - aSelectGroup->AddPrimitiveArray(myForwardArray); - break; - } - case 6: - { - // add to objects with reversed orientation - aSelectGroup->SetGroupPrimitivesAspect(aLineAspect); - aSelectGroup->AddPrimitiveArray(myReversedArray); - break; - } - case 5: - { - // add to objects with internal orientation - aSelectGroup->SetGroupPrimitivesAspect(aLineAspect); - aSelectGroup->AddPrimitiveArray(myInternalArray); - break; - } - case 4: - { - // add to objects with external orientation - aSelectGroup->SetGroupPrimitivesAspect(aLineAspect); - aSelectGroup->AddPrimitiveArray(myExternalArray); - break; - } - } - } - aSelectionPrs->Display(); -} - -void Sample2D_Face::ClearSelected() -{ - if (Handle(Prs3d_Presentation) aSelectionPrs = GetSelectPresentation(NULL)) - { - aSelectionPrs->Clear(); - } -} - -void Sample2D_Face::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager)& thePM, - const Handle(Prs3d_Drawer)& theStyle, - const Handle(SelectMgr_EntityOwner)& theOwner) -{ - Handle(Prs3d_Presentation) aHighlightPrs = GetHilightPresentation(thePM); - if (HasPresentation()) - { - aHighlightPrs->SetTransformPersistence(Presentation()->TransformPersistence()); - } - if (theOwner.IsNull()) - { - return; - } - - aHighlightPrs->Clear(); - FillData(); - - // Direct highlighting - aHighlightPrs->NewGroup(); - Handle(Graphic3d_Group) aHilightGroup = aHighlightPrs->CurrentGroup(); - Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theStyle->Color(), Aspect_TOL_SOLID, 2); - switch (theOwner->Priority()) - { - case 7: - { - aHilightGroup->SetGroupPrimitivesAspect(aLineAspect); - aHilightGroup->AddPrimitiveArray(myForwardArray); - break; - } - case 6: - { - aHilightGroup->SetGroupPrimitivesAspect(aLineAspect); - aHilightGroup->AddPrimitiveArray(myReversedArray); - break; - } - case 5: - { - aHilightGroup->SetGroupPrimitivesAspect(aLineAspect); - aHilightGroup->AddPrimitiveArray(myInternalArray); - break; - } - case 4: - { - aHilightGroup->SetGroupPrimitivesAspect(aLineAspect); - aHilightGroup->AddPrimitiveArray(myExternalArray); - break; - } - } - if (thePM->IsImmediateModeOn()) - { - thePM->AddToImmediateList(aHighlightPrs); - } -} - -void Sample2D_Face::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, - const Standard_Integer theMode) -{ - if (myshape.IsNull() - || theMode != 0) - { - return; - } - - if (mySeq_FORWARD.IsEmpty() - && mySeq_REVERSED.IsEmpty() - && mySeq_INTERNAL.IsEmpty() - && mySeq_EXTERNAL.IsEmpty()) - { - return; - } - - // create entity owner for every part of the face - // set different priorities for primitives of different orientation - Handle(SelectMgr_EntityOwner) anOwner_Forward = new SelectMgr_EntityOwner(this, 7); - Handle(SelectMgr_EntityOwner) anOwner_Reversed = new SelectMgr_EntityOwner(this, 6); - Handle(SelectMgr_EntityOwner) anOwner_Internal = new SelectMgr_EntityOwner(this, 5); - Handle(SelectMgr_EntityOwner) anOwner_External = new SelectMgr_EntityOwner(this, 4); - - // create a sensitive for every part - Handle(Select3D_SensitiveGroup) aForwardGroup = new Select3D_SensitiveGroup(anOwner_Forward); - Handle(Select3D_SensitiveGroup) aReversedGroup = new Select3D_SensitiveGroup(anOwner_Reversed); - Handle(Select3D_SensitiveGroup) aInternalGroup = new Select3D_SensitiveGroup(anOwner_Internal); - Handle(Select3D_SensitiveGroup) aExternalGroup = new Select3D_SensitiveGroup(anOwner_External); - - Standard_Integer aLength = mySeq_FORWARD.Length(); - for (Standard_Integer i = 1; i <= aLength; ++i) - { - Handle(Select3D_SensitiveCurve) aSensitveCurve = new Select3D_SensitiveCurve(anOwner_Forward, mySeq_FORWARD(i)); - aForwardGroup->Add(aSensitveCurve); - } - theSelection->Add(aForwardGroup); - - aLength = mySeq_REVERSED.Length(); - for (Standard_Integer i = 1; i <= aLength; ++i) - { - Handle(Select3D_SensitiveCurve) aSensitveCurve = new Select3D_SensitiveCurve(anOwner_Reversed, mySeq_REVERSED(i)); - aReversedGroup->Add(aSensitveCurve); - } - theSelection->Add(aReversedGroup); - - aLength = mySeq_INTERNAL.Length(); - for (Standard_Integer i = 1; i <= aLength; ++i) - { - Handle(Select3D_SensitiveCurve) aSensitveCurve = new Select3D_SensitiveCurve(anOwner_Internal, mySeq_INTERNAL(i)); - aInternalGroup->Add(aSensitveCurve); - } - theSelection->Add(aInternalGroup); - - aLength = mySeq_EXTERNAL.Length(); - for (Standard_Integer i = 1; i <= aLength; ++i) - { - Handle(Select3D_SensitiveCurve) aSensitveCurve = new Select3D_SensitiveCurve(anOwner_External, mySeq_EXTERNAL(i)); - aExternalGroup->Add(aSensitveCurve); - } - theSelection->Add(aExternalGroup); -} diff --git a/samples/qt/OCCTOverview/code/Sample2D_Face.h b/samples/qt/OCCTOverview/code/Sample2D_Face.h deleted file mode 100644 index 8222593f9a..0000000000 --- a/samples/qt/OCCTOverview/code/Sample2D_Face.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _Sample2D_Face_HeaderFile -#define _Sample2D_Face_HeaderFile - -#include -#include -#include -#include -#include -#include - -//! AIS interactive Object for sample 2D face -class Sample2D_Face : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTI_INLINE(Sample2D_Face, AIS_InteractiveObject) -public: - - Standard_EXPORT Sample2D_Face (const TopoDS_Shape& theFace); - -public: - - TopoDS_Shape& Shape() { return myshape; } - void SetFace (const TopoDS_Shape& theFace) { myshape = theFace; } - -public: - - Quantity_Color myFORWARDColor; - Quantity_Color myREVERSEDColor; - Quantity_Color myINTERNALColor; - Quantity_Color myEXTERNALColor; - Standard_Integer myWidthIndex; - Standard_Integer myTypeIndex; - -private: - - //! Return TRUE for supported display modes (only mode 0 is supported). - virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; } - - //! Compute presentation. - virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) Standard_OVERRIDE; - - //! Compute selection. - virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, - const Standard_Integer theMode) Standard_OVERRIDE; - - virtual void ClearSelected() Standard_OVERRIDE; - - //! Method for advanced customizable selection of picked object - virtual void HilightSelected (const Handle(PrsMgr_PresentationManager)& thePrsMgr, - const SelectMgr_SequenceOfOwner& theOwners) Standard_OVERRIDE; - - //! Method for advanced customizable highlighting of picked object. - virtual void HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager)& thePM, - const Handle(Prs3d_Drawer)& theStyle, - const Handle(SelectMgr_EntityOwner)& theOwner) Standard_OVERRIDE; - - void DrawMarker (const Handle(Geom2d_TrimmedCurve)& theCurve, - const Handle(Prs3d_Presentation)& thePresentation); - - void FillData(Standard_Boolean isSizesRecomputed = Standard_False); - -private: - - TopoDS_Shape myshape; - TColGeom_SequenceOfCurve mySeq_FORWARD; - TColGeom_SequenceOfCurve mySeq_REVERSED; - TColGeom_SequenceOfCurve mySeq_INTERNAL; - TColGeom_SequenceOfCurve mySeq_EXTERNAL; - - Handle(Graphic3d_ArrayOfPolylines) myForwardArray; - Handle(Graphic3d_ArrayOfPolylines) myReversedArray; - Handle(Graphic3d_ArrayOfPolylines) myInternalArray; - Handle(Graphic3d_ArrayOfPolylines) myExternalArray; - - Standard_Integer myForwardNum; - Standard_Integer myReversedNum; - Standard_Integer myInternalNum; - Standard_Integer myExternalNum; - Standard_Integer myForwardBounds; - Standard_Integer myReversedBounds; - Standard_Integer myInternalBounds; - Standard_Integer myExternalBounds; - -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/Sample2D_Image.cxx b/samples/qt/OCCTOverview/code/Sample2D_Image.cxx deleted file mode 100644 index e86f849365..0000000000 --- a/samples/qt/OCCTOverview/code/Sample2D_Image.cxx +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "Sample2D_Image.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -Sample2D_Image::Sample2D_Image (const TCollection_AsciiString& theFileName, - const Standard_Real theX, - const Standard_Real theY, - const Standard_Real theScale) -: AIS_Shape (TopoDS_Shape()), - myFilename (theFileName), - myX (theX), - myY (theY), - myScale (theScale) -{ - // -} - -void Sample2D_Image::MakeShape() -{ - Standard_Real coeff = 1.0; - Handle(Image_AlienPixMap) anImage = new Image_AlienPixMap(); - if (anImage->Load (myFilename)) - { - coeff = Standard_Real(anImage->Height()) / Standard_Real(anImage->Width()) * myScale; - } - - TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge (gp_Pnt(myX, myY, 0.), - gp_Pnt(100 * myScale + myX, myY, 0.)); - TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge (gp_Pnt(100 * myScale + myX, myY, 0.), - gp_Pnt(100 * myScale + myX, 100 * coeff + myY, 0.)); - TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge (gp_Pnt(100 * myScale + myX, 100 * coeff + myY, 0.), - gp_Pnt(myX, 100 * coeff + myY, 0.)); - TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge (gp_Pnt(myX, 100 * coeff + myY, 0.), - gp_Pnt(myX, myY, 0.)); - TopoDS_Wire anImageBounds = BRepBuilderAPI_MakeWire(E1, E2, E3, E4); - myFace = BRepBuilderAPI_MakeFace(gp_Pln(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), anImageBounds); -} - -void Sample2D_Image::SetContext (const Handle(AIS_InteractiveContext)& theContext) -{ - if (theContext.IsNull() || theContext->CurrentViewer().IsNull()) - { - AIS_InteractiveObject::SetContext (theContext); - return; - } - - AIS_InteractiveObject::SetContext (theContext); - MakeShape(); - this->Set(TopoDS_Shape(myFace)); - - myDrawer->SetShadingAspect(new Prs3d_ShadingAspect()); - Handle(Graphic3d_Texture2D) aTexture = new Graphic3d_Texture2D (myFilename); - aTexture->DisableModulate(); - myDrawer->ShadingAspect()->Aspect()->SetTextureMap (aTexture); - myDrawer->ShadingAspect()->Aspect()->SetTextureMapOn(); -} diff --git a/samples/qt/OCCTOverview/code/Sample2D_Image.h b/samples/qt/OCCTOverview/code/Sample2D_Image.h deleted file mode 100644 index c3b9a886b4..0000000000 --- a/samples/qt/OCCTOverview/code/Sample2D_Image.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _Sample2D_Image_HeaderFile -#define _Sample2D_Image_HeaderFile -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//! AIS shape for sample 2D image -class Sample2D_Image : public AIS_Shape -{ - DEFINE_STANDARD_RTTI_INLINE(Sample2D_Image, AIS_Shape) -public: - - //! Constructor. - Standard_EXPORT Sample2D_Image (const TCollection_AsciiString& theFileName, - const Standard_Real theX = 0.0, - const Standard_Real theY = 0.0, - const Standard_Real theScale = 1.0); - - //! Return image coordinates. - void GetCoord (Standard_Real& theX, Standard_Real& theY) const - { - theX = myX; - theY = myY; - } - - //! Return image coordinates. - void SetCoord (const Standard_Real theX, const Standard_Real theY) - { - myX = theX; - myY = theY; - } - - //! Return image scale factor. - Standard_Real GetScale() const { return myScale; } - - //! Set image scale factor. - void SetScale(const Standard_Real theNewScale) { myScale = theNewScale; } - - //! Assign new interactive context to the object. - Standard_EXPORT virtual void SetContext (const Handle(AIS_InteractiveContext)& theContext) Standard_OVERRIDE; - -private: - - void MakeShape(); - -protected: - - TopoDS_Face myFace; - TCollection_AsciiString myFilename; - Standard_Real myX; - Standard_Real myY; - Standard_Real myScale; - -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/Sample2D_Markers.cxx b/samples/qt/OCCTOverview/code/Sample2D_Markers.cxx deleted file mode 100644 index a564bdcca7..0000000000 --- a/samples/qt/OCCTOverview/code/Sample2D_Markers.cxx +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "Sample2D_Markers.h" - -#include - -// generic marker -Sample2D_Markers::Sample2D_Markers (const Standard_Real theXPosition, - const Standard_Real theYPosition, - const Aspect_TypeOfMarker theMarkerType, - const Quantity_Color theColor, - const Standard_Real theScaleOrId) -: myArrayOfPoints (new Graphic3d_ArrayOfPoints(1)) -{ - myXPosition = theXPosition; - myYPosition = theYPosition; - myMarkerType = theMarkerType; - myColor = theColor; - myIndex = theScaleOrId; -} - -Sample2D_Markers::Sample2D_Markers (const Standard_Real theXPosition, - const Standard_Real theYPosition, - const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints, - const Aspect_TypeOfMarker theMarkerType, - const Quantity_Color theColor, - const Standard_Real theScaleOrId) -: myArrayOfPoints (new Graphic3d_ArrayOfPoints(6)) -{ - myXPosition = theXPosition; - myYPosition = theYPosition; - myMarkerType = theMarkerType; - myColor = theColor; - myIndex = theScaleOrId; - myArrayOfPoints = theArrayOfPoints; -} - -void Sample2D_Markers::Compute (const Handle(PrsMgr_PresentationManager)& , - const Handle(Prs3d_Presentation)& thePrs, - const Standard_Integer theMode) -{ - if (theMode != 0) - { - return; - } - - if (myMarkerType == Aspect_TOM_USERDEFINED) - { - Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT, myColor, myIndex); - thePrs->CurrentGroup()->SetGroupPrimitivesAspect(aMarker); - thePrs->CurrentGroup()->AddPrimitiveArray(myArrayOfPoints); - } - else - { - Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType, myColor, myIndex); - thePrs->CurrentGroup()->SetPrimitivesAspect(aMarker); - Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints(1); - anArrayOfPoints->AddVertex(myXPosition, myYPosition, 0); - thePrs->CurrentGroup()->AddPrimitiveArray(anArrayOfPoints); - } -} diff --git a/samples/qt/OCCTOverview/code/Sample2D_Markers.h b/samples/qt/OCCTOverview/code/Sample2D_Markers.h deleted file mode 100644 index f0252669f4..0000000000 --- a/samples/qt/OCCTOverview/code/Sample2D_Markers.h +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _Sample2D_Markers_HeaderFile -#define _Sample2D_Markers_HeaderFile - -#include -#include -#include - -//! AIS AIS interactive object for sample 2D marker -class Sample2D_Markers : public AIS_InteractiveObject -{ - DEFINE_STANDARD_RTTI_INLINE(Sample2D_Markers, AIS_InteractiveObject) -private: - enum Sample2D_CurrentTypeOfMarker - { - Sample2D_CTOM_Generic, - Sample2D_CTOM_Polyline, - Sample2D_CTOM_Circle, - Sample2D_CTOM_Ellips - }; - -public: - - //! Generic marker - Standard_EXPORT Sample2D_Markers (const Standard_Real theXPosition, - const Standard_Real theYPosition, - const Aspect_TypeOfMarker theMarkerType, - const Quantity_Color theColor, - const Standard_Real theScaleOrId=5.0); - - //! Polyline marker - Standard_EXPORT Sample2D_Markers (const Standard_Real theXPosition, - const Standard_Real theYPosition, - const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints, - const Aspect_TypeOfMarker theMarkerType, - const Quantity_Color theColor, - const Standard_Real theScaleOrId=2.0); - -private: - - //! Return TRUE for supported display modes (only mode 0 is supported). - virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; } - - //! Compute presentation. - virtual void Compute (const Handle(PrsMgr_PresentationManager)& /*aPresentationManager*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/, - const Standard_Integer theMode) Standard_OVERRIDE; - - //! Compute selection (not implemented). - virtual void ComputeSelection (const Handle(SelectMgr_Selection)& , - const Standard_Integer ) Standard_OVERRIDE {} - - virtual void SetContext(const Handle(AIS_InteractiveContext)& ) Standard_OVERRIDE {} - -private: - - Sample2D_CurrentTypeOfMarker myCurrentTypeOfMarker; - Standard_Real myXPosition; - Standard_Real myYPosition; - Aspect_TypeOfMarker myMarkerType; - Quantity_Color myColor; - Standard_Real myWidth; - Standard_Real myHeight; - Standard_Real myIndex; - //! specific polyline marker - Handle(Graphic3d_ArrayOfPoints) myArrayOfPoints; -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/Samples.qrc b/samples/qt/OCCTOverview/code/Samples.qrc deleted file mode 100644 index 5bc1783345..0000000000 --- a/samples/qt/OCCTOverview/code/Samples.qrc +++ /dev/null @@ -1,11 +0,0 @@ - - - Geometry.xml - Topology.xml - Triangulation.xml - DataExchange.xml - Viewer3d.xml - Viewer2d.xml - Ocaf.xml - - diff --git a/samples/qt/OCCTOverview/code/TOcafFunction_BoxDriver.cxx b/samples/qt/OCCTOverview/code/TOcafFunction_BoxDriver.cxx deleted file mode 100644 index 6589efab1f..0000000000 --- a/samples/qt/OCCTOverview/code/TOcafFunction_BoxDriver.cxx +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TOcafFunction_BoxDriver.h" - -#include -#include -#include -#include - -//======================================================================= -//function : GetID -//purpose : -//======================================================================= -const Standard_GUID& TOcafFunction_BoxDriver::GetID() -{ - static const Standard_GUID anID("22D22E51-D69A-11d4-8F1A-0060B0EE18E8"); - return anID; -} - -//======================================================================= -//function : Validate -//purpose : -//======================================================================= -void TOcafFunction_BoxDriver::Validate(Handle(TFunction_Logbook)& log) const -{ - // We validate the object label ( Label() ), all the arguments and the results of the object: - log->SetValid(Label(), Standard_True); -} - -//======================================================================= -//function : MustExecute -//purpose : -//======================================================================= -Standard_Boolean TOcafFunction_BoxDriver::MustExecute(const Handle(TFunction_Logbook)& log) const -{ - // If the object's label is modified: - if (log->IsModified(Label())) return Standard_True; - - // Cut (in our simple case) has two arguments: The original shape, and the tool shape. - // They are on the child labels of the box's label: - // So, OriginalNShape - is attached to the first child label - // ToolNShape - is attached to the second child label. - // - // Let's check them: - if (log->IsModified(Label().FindChild(1))) - { - return Standard_True; // width. - } - if (log->IsModified(Label().FindChild(2))) - { - return Standard_True; // length, - } - if (log->IsModified(Label().FindChild(3))) - { - return Standard_True; // width. - } - if (log->IsModified(Label().FindChild(4))) - { - return Standard_True; // length, - } - if (log->IsModified(Label().FindChild(5))) - { - return Standard_True; // width. - } - if (log->IsModified(Label().FindChild(6))) - { - return Standard_True; // length, - } - // if there are no any modifications concerned the box, - // it's not necessary to recompute (to call the method Execute()): - return Standard_False; -} - -//======================================================================= -//function : Execute -//purpose : -//======================================================================= -Standard_Integer TOcafFunction_BoxDriver::Execute(Handle(TFunction_Logbook)& /*log*/) const -{ - // Get the values of dimension and position attributes - Handle(TDataStd_Real) TSR; - Standard_Real x, y, z, l, h, w; - if (!Label().FindChild(1).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - l = TSR->Get(); - - if (!Label().FindChild(2).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - h = TSR->Get(); - - if (!Label().FindChild(3).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - w = TSR->Get(); - - if (!Label().FindChild(4).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - x = TSR->Get(); - - if (!Label().FindChild(5).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - y = TSR->Get(); - - if (!Label().FindChild(6).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - z = TSR->Get(); - - // Build a box using the dimension and position attributes - BRepPrimAPI_MakeBox mkBox(gp_Pnt(x, y, z), l, h, w); - TopoDS_Shape ResultShape = mkBox.Shape(); - - // Build a TNaming_NamedShape using built box - TNaming_Builder B(Label()); - B.Generated(ResultShape); - // That's all: - // If there are no any mistakes we return 0: - return 0; -} diff --git a/samples/qt/OCCTOverview/code/TOcafFunction_BoxDriver.h b/samples/qt/OCCTOverview/code/TOcafFunction_BoxDriver.h deleted file mode 100644 index bbeed55506..0000000000 --- a/samples/qt/OCCTOverview/code/TOcafFunction_BoxDriver.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _TOcafFunction_BoxDriver_HeaderFile -#define _TOcafFunction_BoxDriver_HeaderFile - -#include -#include - -//! Creation of an instance of the box driver. It's possible (and recommended) -//! to have only one instance of a driver for the whole session. -class TOcafFunction_BoxDriver : public TFunction_Driver -{ - DEFINE_STANDARD_RTTI_INLINE(TOcafFunction_BoxDriver, TFunction_Driver) -public: - Standard_EXPORT static const Standard_GUID& GetID(); -public: - - TOcafFunction_BoxDriver() {} - - //! Validation of the object label, its arguments and its results. - Standard_EXPORT virtual void Validate (Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - - //! We call this method to check if the object was modified to be invoked. - //! If the object label or an argument is modified, we must recompute the object - to call the method Execute(). - Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - - //! We compute the object and topologically name it. - //! If during the execution we found something wrong, we return the number of the failure. - //! For example: - //! 1 - an attribute hasn't been found, - //! 2 - algorithm failed, - //! if there are no any mistakes occurred we return 0: - //! 0 - no mistakes were found. - Standard_EXPORT virtual Standard_Integer Execute (Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/TOcafFunction_CutDriver.cxx b/samples/qt/OCCTOverview/code/TOcafFunction_CutDriver.cxx deleted file mode 100644 index cbbaca349b..0000000000 --- a/samples/qt/OCCTOverview/code/TOcafFunction_CutDriver.cxx +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TOcafFunction_CutDriver.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -//======================================================================= -//function : GetID -//purpose : -//======================================================================= -const Standard_GUID& TOcafFunction_CutDriver::GetID() -{ - static const Standard_GUID anID("22D22E52-D69A-11d4-8F1A-0060B0EE18E8"); - return anID; -} - -//======================================================================= -//function : Validate -//purpose : -//======================================================================= -void TOcafFunction_CutDriver::Validate (Handle(TFunction_Logbook)& log) const -{ - // We validate the object label ( Label() ), all the arguments and the results of the object: - log->SetValid(Label(), Standard_True); -} - -//======================================================================= -//function : MustExecute -//purpose : -//======================================================================= -Standard_Boolean TOcafFunction_CutDriver::MustExecute(const Handle(TFunction_Logbook)& log) const -{ - // If the object's label is modified: - if (log->IsModified(Label())) return Standard_True; - - // Cut (in our simple case) has two arguments: The original shape, and the tool shape. - // They are on the child labels of the cut's label: - // So, OriginalNShape - is attached to the first child label - // ToolNShape - is attached to the second child label, - // . - // Let's check them: - Handle(TDF_Reference) OriginalRef; - //TDF_Label aLabel = Label().FindChild(1); -/* - BOOL f = Label().IsNull(); - int a = Label().NbChildren(); -*/ - TCollection_AsciiString aEntry; - TDF_Tool::Entry(Label(), aEntry); - std::cout << "Entry: " << aEntry.ToCString() << std::endl; - Label().FindChild(1).FindAttribute(TDF_Reference::GetID(), OriginalRef); - if (log->IsModified(OriginalRef->Get())) return Standard_True; // Original shape. - - Handle(TDF_Reference) ToolRef; - Label().FindChild(2).FindAttribute(TDF_Reference::GetID(), ToolRef); - if (log->IsModified(ToolRef->Get())) return Standard_True; // Tool shape. - - // if there are no any modifications concerned the cut, - // it's not necessary to recompute (to call the method Execute()): - return Standard_False; -} - -//======================================================================= -//function : Execute -//purpose : -//======================================================================= -Standard_Integer TOcafFunction_CutDriver::Execute(Handle(TFunction_Logbook)& /*log*/) const -{ - // Let's get the arguments (OriginalNShape, ToolNShape of the object): - - // First, we have to retrieve the TDF_Reference attributes to obtain - // the root labels of the OriginalNShape and the ToolNShape: - Handle(TDF_Reference) OriginalRef, ToolRef; - if (!Label().FindChild(1).FindAttribute(TDF_Reference::GetID(), OriginalRef)) - { - return 1; - } - TDF_Label OriginalLab = OriginalRef->Get(); - if (!Label().FindChild(2).FindAttribute(TDF_Reference::GetID(), ToolRef)) - { - return 1; - } - TDF_Label ToolLab = ToolRef->Get(); - - // Get the TNaming_NamedShape attributes of these labels - Handle(TNaming_NamedShape) OriginalNShape, ToolNShape; - if (!(OriginalLab.FindAttribute(TNaming_NamedShape::GetID(), OriginalNShape))) - { - throw Standard_Failure("TOcaf_Commands::CutObjects"); - } - if (!(ToolLab.FindAttribute(TNaming_NamedShape::GetID(), ToolNShape))) - { - throw Standard_Failure("TOcaf_Commands::CutObjects"); - } - - // Now, let's get the TopoDS_Shape of these TNaming_NamedShape: - TopoDS_Shape OriginalShape = OriginalNShape->Get(); - TopoDS_Shape ToolShape = ToolNShape->Get(); - - // STEP 2: - // Let's call for algorithm computing a cut operation: - BRepAlgoAPI_Cut mkCut(OriginalShape, ToolShape); - // Let's check if the Cut has been successful: - if (!mkCut.IsDone()) - { - QMessageBox::critical(qApp->activeWindow(), - QObject::tr("Cut Function Driver"), - QObject::tr("Cut not done.")); - return 2; - } - TopoDS_Shape ResultShape = mkCut.Shape(); - - // Build a TNaming_NamedShape using built cut - TNaming_Builder B(Label()); - B.Modify(OriginalShape, ResultShape); - // That's all: - // If there are no any mistakes we return 0: - return 0; -} diff --git a/samples/qt/OCCTOverview/code/TOcafFunction_CutDriver.h b/samples/qt/OCCTOverview/code/TOcafFunction_CutDriver.h deleted file mode 100644 index 9b25cecf95..0000000000 --- a/samples/qt/OCCTOverview/code/TOcafFunction_CutDriver.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _TOcafFunction_CutDriver_HeaderFile -#define _TOcafFunction_CutDriver_HeaderFile - -#include -#include - -//! Creation of an instance of the cut driver. It's possible (and recommended) -//! to have only one instance of a driver for the whole session. -class TOcafFunction_CutDriver : public TFunction_Driver -{ - DEFINE_STANDARD_RTTI_INLINE(TOcafFunction_CutDriver, TFunction_Driver) -public: - Standard_EXPORT static const Standard_GUID& GetID(); -public: - - TOcafFunction_CutDriver() {} - - //! Validation of the object label, its arguments and its results. - Standard_EXPORT virtual void Validate (Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - - //! We call this method to check if the object was modified to be invoked. - //! If the object label or an argument is modified, we must recompute the object - to call the method Execute(). - Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - - //! We compute the object and topologically name it. - //! If during the execution we found something wrong, we return the number of the failure. - //! For example: - //! 1 - an attribute hasn't been found, - //! 2 - algorithm failed, - //! if there are no any mistakes occurred we return 0: - //! 0 - no mistakes were found. - Standard_EXPORT virtual Standard_Integer Execute (Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/TOcafFunction_CylDriver.cxx b/samples/qt/OCCTOverview/code/TOcafFunction_CylDriver.cxx deleted file mode 100644 index 3b687e5172..0000000000 --- a/samples/qt/OCCTOverview/code/TOcafFunction_CylDriver.cxx +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TOcafFunction_CylDriver.h" - -#include -#include -#include -#include -#include -#include - -//======================================================================= -//function : GetID -//purpose : -//======================================================================= -const Standard_GUID& TOcafFunction_CylDriver::GetID() -{ - static const Standard_GUID anID("22D22E53-D69A-11d4-8F1A-0060B0EE18E8"); - return anID; -} - -//======================================================================= -//function : TPartStd_CylDriver -//purpose : -//======================================================================= -TOcafFunction_CylDriver::TOcafFunction_CylDriver() -{ - // -} - -//======================================================================= -//function : Validate -//purpose : -//======================================================================= -void TOcafFunction_CylDriver::Validate (Handle(TFunction_Logbook)& log) const -{ - // We validate the object label ( Label() ), all the arguments and the results of the object: - log->SetValid(Label(), Standard_True); -} - -//======================================================================= -//function : MustExecute -//purpose : -//======================================================================= -Standard_Boolean TOcafFunction_CylDriver::MustExecute(const Handle(TFunction_Logbook)& log) const -{ - // If the object's label is modified: - if (log->IsModified(Label())) return Standard_True; - - // Cylinder (in our simple case) has 5 arguments: - // - // Let's check them: - if (log->IsModified(Label().FindChild(1))) - { - return Standard_True; // radius. - } - if (log->IsModified(Label().FindChild(2))) - { - return Standard_True; // height, - } - if (log->IsModified(Label().FindChild(3))) - { - return Standard_True; // x. - } - if (log->IsModified(Label().FindChild(4))) - { - return Standard_True; // y, - } - if (log->IsModified(Label().FindChild(5))) - { - return Standard_True; // z. - } - // if there are no any modifications concerned the Cyl, - // it's not necessary to recompute (to call the method Execute()): - return Standard_False; -} - -//======================================================================= -//function : Execute -//purpose : -//======================================================================= -Standard_Integer TOcafFunction_CylDriver::Execute(Handle(TFunction_Logbook)& /*log*/) const -{ - // Get the values of dimension and position attributes - Handle(TDataStd_Real) TSR; - Standard_Real x, y, z, r, h; - if (!Label().FindChild(1).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - r = TSR->Get(); - - if (!Label().FindChild(2).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - h = TSR->Get(); - - if (!Label().FindChild(3).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - x = TSR->Get(); - - if (!Label().FindChild(4).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - y = TSR->Get(); - - if (!Label().FindChild(5).FindAttribute(TDataStd_Real::GetID(), TSR)) - { - return 1; - } - z = TSR->Get(); - - // Build a Cyl using the dimension and position attributes - BRepPrimAPI_MakeCylinder mkCyl(gp_Ax2(gp_Pnt(x, y, z), gp_Dir(0, 0, 1)), r, h); - TopoDS_Shape ResultShape = mkCyl.Shape(); - - - // Build a TNaming_NamedShape using built Cyl - TNaming_Builder B(Label()); - B.Generated(ResultShape); - // That's all: - // If there are no any mistakes we return 0: - return 0; -} diff --git a/samples/qt/OCCTOverview/code/TOcafFunction_CylDriver.h b/samples/qt/OCCTOverview/code/TOcafFunction_CylDriver.h deleted file mode 100644 index e6d2534b71..0000000000 --- a/samples/qt/OCCTOverview/code/TOcafFunction_CylDriver.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _TOcafFunction_CylDriver_HeaderFile -#define _TOcafFunction_CylDriver_HeaderFile - -#include -#include - -//! Creation of an instance of the cylinder driver. It's possible (and recommended) -//! to have only one instance of a driver for the whole session. -class TOcafFunction_CylDriver : public TFunction_Driver -{ - DEFINE_STANDARD_RTTI_INLINE(TOcafFunction_CylDriver, TFunction_Driver) -public: - Standard_EXPORT static const Standard_GUID& GetID(); -public: - - //! Creation of an instance of the driver. It's possible (and recommended) - //! to have only one instance of a driver for the whole session. - Standard_EXPORT TOcafFunction_CylDriver(); - - //! Validation of the object label, its arguments and its results. - Standard_EXPORT virtual void Validate (Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - - //! We call this method to check if the object was modified to be invoked. - //! If the object label or an argument is modified, we must recompute the object - to call the method Execute(). - Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - - //! We compute the object and topologically name it. - //! If during the execution we found something wrong, - //! we return the number of the failure. For example: - //! 1 - an attribute hasn't been found, - //! 2 - algorithm failed, - //! if there are no any mistakes occurred we return 0: - //! 0 - no mistakes were found. - Standard_EXPORT virtual Standard_Integer Execute (Handle(TFunction_Logbook)& theLog) const Standard_OVERRIDE; - -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/TOcaf_Application.cxx b/samples/qt/OCCTOverview/code/TOcaf_Application.cxx deleted file mode 100644 index ceea5843f0..0000000000 --- a/samples/qt/OCCTOverview/code/TOcaf_Application.cxx +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TOcaf_Application.h" - -#include -#include -#include -#include -#include - -#include "TOcafFunction_BoxDriver.h" -#include "TOcafFunction_CylDriver.h" -#include "TOcafFunction_CutDriver.h" - -//======================================================================= -//function : TOcaf_Application -//purpose : -//======================================================================= -TOcaf_Application::TOcaf_Application() -{ - // Instantiate a TOcafFunction_BoxDriver and add it to the TFunction_DriverTable - TFunction_DriverTable::Get()->AddDriver (TOcafFunction_BoxDriver::GetID(), - new TOcafFunction_BoxDriver()); - - // Instantiate a TOcafFunction_Cyl Driver and add it to the TFunction_DriverTable - TFunction_DriverTable::Get()->AddDriver (TOcafFunction_CylDriver::GetID(), - new TOcafFunction_CylDriver()); - - // Instantiate a TOcafFunction_CutDriver and add it to the TFunction_DriverTable - Handle(TOcafFunction_CutDriver) myCutDriver = new TOcafFunction_CutDriver(); - TFunction_DriverTable::Get()->AddDriver (TOcafFunction_CutDriver::GetID(), - new TOcafFunction_CutDriver()); -} diff --git a/samples/qt/OCCTOverview/code/TOcaf_Application.h b/samples/qt/OCCTOverview/code/TOcaf_Application.h deleted file mode 100644 index bcaaf03a06..0000000000 --- a/samples/qt/OCCTOverview/code/TOcaf_Application.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _TOcaf_Application_HeaderFile -#define _TOcaf_Application_HeaderFile - -#include -#include - -//! Sample OCAF application -class TOcaf_Application : public TDocStd_Application -{ - DEFINE_STANDARD_RTTI_INLINE(TOcaf_Application, TDocStd_Application) -public: - - Standard_EXPORT TOcaf_Application(); -}; - -#endif diff --git a/samples/qt/OCCTOverview/code/Topology.xml b/samples/qt/OCCTOverview/code/Topology.xml deleted file mode 100644 index a49a69e84a..0000000000 --- a/samples/qt/OCCTOverview/code/Topology.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/qt/OCCTOverview/code/TopologySamples.cxx b/samples/qt/OCCTOverview/code/TopologySamples.cxx deleted file mode 100644 index 65f0e38a2d..0000000000 --- a/samples/qt/OCCTOverview/code/TopologySamples.cxx +++ /dev/null @@ -1,1884 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TopologySamples.h" - -#include "AdaptorVec_AIS.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -void TopologySamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "Vertex3dSample") - Vertex3dSample(); - else if (theSampleName == "Edge3dSample") - Edge3dSample(); - else if (theSampleName == "Face3dSample") - Face3dSample(); - else if (theSampleName == "Wire3dSample") - Wire3dSample(); - else if (theSampleName == "Shell3dSample") - Shell3dSample(); - else if (theSampleName == "Solid3dSample") - Solid3dSample(); - else if (theSampleName == "Edge2dSample") - Edge2dSample(); - else if (theSampleName == "Box3dSample") - Box3dSample(); - else if (theSampleName == "Cylinder3dSample") - Cylinder3dSample(); - else if (theSampleName == "Revolution3dSample") - Revolution3dSample(); - else if (theSampleName == "TopologyIterator3dSample") - TopologyIterator3dSample(); - else if (theSampleName == "TopologyExplorer3dSample") - TopologyExplorer3dSample(); - else if (theSampleName == "AssessToCurve3dSample") - AssessToCurve3dSample(); - else if (theSampleName == "AssessToCompositeCurve3dSample") - AssessToCompositeCurve3dSample(); - else if (theSampleName == "AssessToSurface3dSample") - AssessToSurface3dSample(); - else if (theSampleName == "Common3dSample") - Common3dSample(); - else if (theSampleName == "Cut3dSample") - Cut3dSample(); - else if (theSampleName == "Cut3dSample") - Cut3dSample(); - else if (theSampleName == "Fuse3dSample") - Fuse3dSample(); - else if (theSampleName == "Section3dSample") - Section3dSample(); - else if (theSampleName == "Splitter3dSample") - Splitter3dSample(); - else if (theSampleName == "Defeaturing3dSample") - Defeaturing3dSample(); - else if (theSampleName == "Fillet3dSample") - Fillet3dSample(); - else if (theSampleName == "Chamfer3dSample") - Chamfer3dSample(); - else if (theSampleName == "Offset3dSample") - Offset3dSample(); - else if (theSampleName == "Evolved3dSample") - Evolved3dSample(); - else if (theSampleName == "Copy3dSample") - Copy3dSample(); - else if (theSampleName == "Transform3dSample") - Transform3dSample(); - else if (theSampleName == "ConvertToNurbs3dSample") - ConvertToNurbs3dSample(); - else if (theSampleName == "SewContiguousFaces3dSample") - SewContiguousFaces3dSample(); - else if (theSampleName == "CheckValidity3dSample") - CheckValidity3dSample(); - else if (theSampleName == "ComputeLinearProperties3dSample") - ComputeLinearProperties3dSample(); - else if (theSampleName == "ComputeSurfaceProperties3dSample") - ComputeSurfaceProperties3dSample(); - else if (theSampleName == "ComputeVolumeProperties3dSample") - ComputeVolumeProperties3dSample(); - else - { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -void TopologySamples::Vertex3dSample() -{ - // Make a vertex from a 3D point. - gp_Pnt aPnt(0.0, 0.0, 10.0); - TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(aPnt); - myResult << "TopoDS_Vertex was created at [ " - << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() - << " ]" << std::endl; - - Handle(AIS_Shape) aAisVertex = new AIS_Shape(aVertex); - Handle(AIS_TextLabel) anAisLabel = new AIS_TextLabel(); - Standard_SStream aSS; - aSS << "TopoDS_Vertex [" << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() << "]" << std::endl; - anAisLabel->SetText(aSS.str().c_str()); - anAisLabel->SetPosition(aPnt); - myObject3d.Append(aAisVertex); - myObject3d.Append(anAisLabel); -} - -void TopologySamples::Edge3dSample() -{ - // Make an edge from two 3D points. - gp_Pnt aPnt1(0.0, 10.0, 0.0); - gp_Pnt aPnt2(10.0, 10.0, 0.0); - TopoDS_Edge anEdgeP12 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt2); - myResult << "TopoDS_Edge between [ " - << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << " ] and [ " - << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << " ] was created in yellow" << std::endl - << std::endl; - - // Make an edge from a circular segment. - // Create a circle in XY plane of the radius 5.0. - gp_Circ aCirc(gp::XOY(), 5.0); - // Make a circular edge from the 1st quoter in the parametric space. - TopoDS_Edge anEdgeCirc = BRepBuilderAPI_MakeEdge(aCirc, 0.0, M_PI_2); - myResult << "TopoDS_Edge on the circle's 1st quoter" << std::endl - << "with the center at [ " - << aCirc.Location().X() << ", " << aCirc.Location().Y() << ", " << aCirc.Location().Z() - << " ] and R = " << aCirc.Radius() << " was created in red" << std::endl - << std::endl; - - // Make an edge from a 3D curve (BSpline). - // Define points. - gp_Pnt aPole1(0.0, 0.0, 10.0); - gp_Pnt aPole2(5.0, 5.0, 5.0); - gp_Pnt aPole3(10.0, 10.0, 15.0); - gp_Pnt aPole4(15.0, 5.0, 20.0); - // Add points to the curve poles array. - TColgp_Array1OfPnt aPoles(1, 4); - aPoles.SetValue(1, aPole1); - aPoles.SetValue(2, aPole2); - aPoles.SetValue(3, aPole3); - aPoles.SetValue(4, aPole4); - // Make a BSpline curve from the points array - Handle(Geom_BSplineCurve) aBSplineCurve = GeomAPI_PointsToBSpline(aPoles).Curve(); - // Make an edge between two point on the BSpline curve. - gp_Pnt aPntOnCurve1, aPntOnCurve2; - aBSplineCurve->D0 (0.75 * aBSplineCurve->FirstParameter() - + 0.25 * aBSplineCurve->LastParameter(), - aPntOnCurve1); - aBSplineCurve->D0 (0.25 * aBSplineCurve->FirstParameter() - + 0.75 * aBSplineCurve->LastParameter(), - aPntOnCurve2); - TopoDS_Edge anEdgeBSpline = BRepBuilderAPI_MakeEdge(aBSplineCurve, aPntOnCurve1, aPntOnCurve2); - myResult << "TopoDS_Edge on the BSpline curve" << std::endl - << "between [ " - << aPntOnCurve1.X() << ", " << aPntOnCurve1.Y() << ", " << aPntOnCurve1.Z() - << " ] and [ " - << aPntOnCurve2.X() << ", " << aPntOnCurve2.Y() << ", " << aPntOnCurve2.Z() - << " ]" << std::endl - << "was created in green" << std::endl; - - Handle(AIS_ColoredShape) anAisEdgeP12 = new AIS_ColoredShape(anEdgeP12); - Handle(AIS_ColoredShape) anAisEdgeCirc = new AIS_ColoredShape(anEdgeCirc); - Handle(AIS_ColoredShape) anAisEdgeBSpline = new AIS_ColoredShape(anEdgeBSpline); - anAisEdgeP12->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisEdgeCirc->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisEdgeBSpline->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisEdgeP12); - myObject3d.Append(anAisEdgeCirc); - myObject3d.Append(anAisEdgeBSpline); - Handle(AIS_TextLabel) anAisEdgeP12Label = new AIS_TextLabel(); - anAisEdgeP12Label->SetText("Edge between two points"); - anAisEdgeP12Label->SetPosition(0.5 * (aPnt1.XYZ() + aPnt2.XYZ())); - anAisEdgeP12Label->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisEdgeP12Label); - Handle(AIS_TextLabel) anAisEdgeCircLabel = new AIS_TextLabel(); - anAisEdgeCircLabel->SetText("Circular edge"); - anAisEdgeCircLabel->SetPosition(aCirc.Location()); - anAisEdgeCircLabel->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisEdgeCircLabel); - Handle(AIS_TextLabel) anAisEdgeBSplineLabel = new AIS_TextLabel(); - anAisEdgeBSplineLabel->SetText("BSpline edge"); - anAisEdgeBSplineLabel->SetPosition(aPole3); - anAisEdgeBSplineLabel->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisEdgeBSplineLabel); - TopoDS_Vertex anEdgeP12_V1, anEdgeP12_V2; - TopExp::Vertices(anEdgeP12, anEdgeP12_V1, anEdgeP12_V2); - myObject3d.Append(new AIS_Shape(anEdgeP12_V1)); - myObject3d.Append(new AIS_Shape(anEdgeP12_V2)); - TopoDS_Vertex anEdgeCirc_V1, anEdgeCirc_V2; - TopExp::Vertices(anEdgeCirc, anEdgeCirc_V1, anEdgeCirc_V2); - myObject3d.Append(new AIS_Shape(anEdgeCirc_V1)); - myObject3d.Append(new AIS_Shape(anEdgeCirc_V2)); - TopoDS_Vertex anEdgeBSpline_V1, anEdgeBSpline_V2; - TopExp::Vertices(anEdgeBSpline, anEdgeBSpline_V1, anEdgeBSpline_V2); - myObject3d.Append(new AIS_Shape(anEdgeBSpline_V1)); - myObject3d.Append(new AIS_Shape(anEdgeBSpline_V2)); -} - -void TopologySamples::Face3dSample() -{ - // Make a face from a sphere with the center - // at [0.0, 0.0, 10.0] and R = 5. - gp_Sphere aSphere(gp_Ax3(gp_Pnt(0.0, 0.0, 10.0), gp::DZ()), 5.0); - TopoDS_Face aFaceSphere = BRepBuilderAPI_MakeFace(aSphere); - myResult << "TopoDS_Face on the sphere with" << std::endl - << "the center at [ " - << aSphere.Location().X() << ", " << aSphere.Location().Y() << ", " << aSphere.Location().Z() - << " ] and R = " << aSphere.Radius() << " was created in yellow" << std::endl - << std::endl; - - // Make a flat rectangular face on XY plane. - gp_Pln aPln(gp::XOY()); - TopoDS_Face aFaceRect = BRepBuilderAPI_MakeFace(aPln, -10.0, +10.0, -20.0, +20.0); - myResult << "TopoDS_Face on the rectangle was created in red" << std::endl - << std::endl; - - // Make a face from a BSpline surface. - // Define a 4x4 grid of points for BSpline surface. - TColgp_Array2OfPnt aPoints(1, 4, 1, 4); - for (Standard_Integer i = 1; i <= 4; ++i) - { - gp_Pnt aPnt; - aPnt.SetX(5.0 * i); - for (Standard_Integer j = 1; j <= 4; ++j) - { - aPnt.SetY(5.0 * j); - if (1 < i && i < 4 && 1 < j && j < 4) - { - aPnt.SetZ(15.0); - } - else - { - aPnt.SetZ(10.0); - } - aPoints.SetValue(i, j, aPnt); - } - } - // Make a BSpline surface from the points array. - Handle(Geom_BSplineSurface) aBSplineSurf = GeomAPI_PointsToBSplineSurface(aPoints).Surface(); - Standard_Real aU1, aU2, aV1, aV2; - aBSplineSurf->Bounds(aU1, aU2, aV1, aV2); - TopoDS_Face aFaceBSpline = BRepBuilderAPI_MakeFace(aBSplineSurf, aU1, aU2, aV1, aV2, Precision::Confusion()); - myResult << "TopoDS_Face on the BSpline surface was created in green" << std::endl << std::endl; - - Handle(AIS_ColoredShape) anAisFaceSphere = new AIS_ColoredShape(aFaceSphere); - Handle(AIS_ColoredShape) anAisFaceRect = new AIS_ColoredShape(aFaceRect); - Handle(AIS_ColoredShape) anAisFaceBSpline = new AIS_ColoredShape(aFaceBSpline); - anAisFaceSphere->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisFaceRect->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisFaceBSpline->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisFaceSphere); - myObject3d.Append(anAisFaceRect); - myObject3d.Append(anAisFaceBSpline); - Handle(AIS_TextLabel) anAisFaceSphereLabel = new AIS_TextLabel(); - anAisFaceSphereLabel->SetText("Spherical face"); - anAisFaceSphereLabel->SetPosition(aSphere.Location().XYZ() + aSphere.Radius() * gp::DZ().XYZ()); - anAisFaceSphereLabel->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisFaceSphereLabel); - Handle(AIS_TextLabel) anAisFaceRectLabel = new AIS_TextLabel(); - anAisFaceRectLabel->SetText("Flat rectangular face"); - anAisFaceRectLabel->SetPosition(aPln.Location().XYZ() + 2.5 * gp::DZ().XYZ()); - anAisFaceRectLabel->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisFaceRectLabel); - Handle(AIS_TextLabel) anAisFaceBSplineLabel = new AIS_TextLabel(); - anAisFaceBSplineLabel->SetText("BSpline face"); - anAisFaceBSplineLabel->SetPosition(aPoints(4, 4)); - anAisFaceBSplineLabel->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisFaceBSplineLabel); -} - -void TopologySamples::Wire3dSample() -{ - // Make a wire from edges created on a set of points. - // Add points to the curve poles array. - TColgp_Array1OfPnt aPoints(1, 4); - aPoints.SetValue(1, gp_Pnt(0.0, 0.0, 0.0)); - aPoints.SetValue(2, gp_Pnt(20.0, 0.0, 0.0)); - aPoints.SetValue(3, gp_Pnt(20.0, 10.0, 0.0)); - aPoints.SetValue(4, gp_Pnt(0.0, 10.0, 0.0)); - // A wire maker contains an empty wire. - BRepBuilderAPI_MakeWire aMakeWire; - for (Standard_Integer i = 1; i <= 4; ++i) - { - Standard_Integer i1 = i; - Standard_Integer i2 = i1 < 4 ? i1 + 1 : 1; - const gp_Pnt& aPnt1 = aPoints.Value(i1); - const gp_Pnt& aPnt2 = aPoints.Value(i2); - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aPnt1, aPnt2); - // Add an edge to the wire under construction. - // The edge must be connectible to the wire under construction, and, - // unless it is the first edge of the wire, must satisfy the following - // condition: one of its vertices must be geometrically coincident - // with one of the vertices of the wire (provided that the highest - // tolerance factor is assigned to the two vertices). - // It could also be the same vertex. - // Warning - // If the edge is not connectible to the wire under construction it is not added. - // The function IsDone will return false and the function - // Wire will raise an error, until a new connectible edge is added. - aMakeWire.Add(anEdge); - Standard_ASSERT_VOID(aMakeWire.IsDone(), "Added edge isn't connectible!"); - } - // Retrieve a constructed wire. - TopoDS_Wire aWire = aMakeWire.Wire(); - myResult << "TopoDS_Wire was created. Vertices :" << std::endl; - // Retrieve wire vertices. 4 vertices are expected, because of - // edges connecting during wire constructing. - TopTools_IndexedMapOfShape aVertices; - TopExp::MapShapes(aWire, TopAbs_VERTEX, aVertices); - for (TopTools_IndexedMapOfShape::Iterator anIt(aVertices); anIt.More(); anIt.Next()) - { - TopoDS_Vertex aVertex = TopoDS::Vertex(anIt.Value()); - gp_Pnt aPnt = BRep_Tool::Pnt(aVertex); - myResult << "[ " << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() << " ]" << std::endl; - Handle(AIS_Shape) anAisVertex = new AIS_Shape(aVertex); - myObject3d.Append(anAisVertex); - } - - Handle(AIS_Shape) anAisWire = new AIS_Shape(aWire); - myObject3d.Append(anAisWire); -} - -void TopologySamples::Shell3dSample() -{ - // Make a shell from a cylinder with R = 5 and directed along Z axis - gp_Cylinder aCyl(gp::XOY(), 5.0); - Handle(Geom_Surface) aCylSurf = new Geom_CylindricalSurface(aCyl); - TopoDS_Shell aCylShell = BRepBuilderAPI_MakeShell(aCylSurf, 0.0, 2.0 * M_PI, -10.0, +10.0); - myResult << "TopoDS_Shell on the cylinder R = " << aCyl.Radius() << std::endl - << "with axis [ " - << aCyl.Position().Direction().X() << ", " - << aCyl.Position().Direction().Y() << ", " - << aCyl.Position().Direction().Z() << " ]" << std::endl - << "limited in length [-10 ... +10] was created" << std::endl; - - Handle(AIS_Shape) anAisShell = new AIS_Shape(aCylShell); - myObject3d.Append(anAisShell); -} - -void TopologySamples::Solid3dSample() -{ - // Make a torus from a shell. - gp_Torus aTorus(gp::XOY(), 20.0, 7.5); - Handle(Geom_Surface) aTorusSurf = new Geom_ToroidalSurface(aTorus); - TopoDS_Shell aTorusShell = BRepBuilderAPI_MakeShell(aTorusSurf, 0.0, 2.0 * M_PI, 0.0, 2.0 * M_PI); - // Make a solid on the torus shell. - TopoDS_Solid aTorusSolid = BRepBuilderAPI_MakeSolid(aTorusShell); - myResult << "TopoDS_Solid on the torus with" << std::endl - << "R major = " << aTorus.MajorRadius() << std::endl - << "R minor = " << aTorus.MinorRadius() << std::endl - << "was created" << std::endl; - - Handle(AIS_Shape) anAisSolid = new AIS_Shape(aTorusSolid); - myObject3d.Append(anAisSolid); -} - -void TopologySamples::Edge2dSample() -{ - // Make an edge from two 2D points. - gp_Pnt2d aPnt1(0.0, 10.0); - gp_Pnt2d aPnt2(10.0, 10.0); - TopoDS_Edge anEdgeP12 = BRepBuilderAPI_MakeEdge2d(aPnt1, aPnt2); - myResult << "TopoDS_Edge between [ " - << aPnt1.X() << ", " << aPnt1.Y() << " ] and [ " - << aPnt2.X() << ", " << aPnt2.Y() << " ] was created in yellow" << std::endl - << std::endl; - - // Make an edge from a circular segment. - // Create a circle of the radius 5.0. - gp_Circ2d aCirc(gp::OX2d(), 5.0); - // Make a circular edge from the 1st quoter in the parametric space. - TopoDS_Edge anEdgeCirc = BRepBuilderAPI_MakeEdge2d(aCirc, 0.0, M_PI_2); - myResult << "TopoDS_Edge on the 2D circle's 1st quoter" << std::endl - << "with the center at [ " << aCirc.Location().X() << ", " << aCirc.Location().Y() - << " ] and R = " << aCirc.Radius() << " was created in red" << std::endl - << std::endl; - - // Make an edge from a 2D curve (BSpline). - // Define points. - gp_Pnt2d aPole1(0.0, 0.0); - gp_Pnt2d aPole2(5.0, 5.0); - gp_Pnt2d aPole3(10.0, 10.0); - gp_Pnt2d aPole4(15.0, 5.0); - // Add points to the curve poles array. - TColgp_Array1OfPnt2d aPoles(1, 4); - aPoles.SetValue(1, aPole1); - aPoles.SetValue(2, aPole2); - aPoles.SetValue(3, aPole3); - aPoles.SetValue(4, aPole4); - // Make a BSpline curve from the points array - Handle(Geom2d_BSplineCurve) aBSplineCurve = Geom2dAPI_PointsToBSpline(aPoles).Curve(); - // Make an edge between two point on the BSpline curve. - gp_Pnt2d aPntOnCurve1, aPntOnCurve2; - aBSplineCurve->D0 (0.75 * aBSplineCurve->FirstParameter() - + 0.25 * aBSplineCurve->LastParameter(), - aPntOnCurve1); - aBSplineCurve->D0 (0.25 * aBSplineCurve->FirstParameter() - + 0.75 * aBSplineCurve->LastParameter(), - aPntOnCurve2); - TopoDS_Edge anEdgeBSpline = BRepBuilderAPI_MakeEdge2d(aBSplineCurve, aPntOnCurve1, aPntOnCurve2); - myResult << "TopoDS_Edge on the 2D BSpline curve" << std::endl - << "between [ " << aPntOnCurve1.X() << ", " << aPntOnCurve1.Y() - << " ] and [ " << aPntOnCurve2.X() << ", " << aPntOnCurve2.Y() << " ]" << std::endl - << "was created in green" << std::endl; - - Handle(AIS_ColoredShape) anAisEdgeP12 = new AIS_ColoredShape(anEdgeP12); - Handle(AIS_ColoredShape) anAisEdgeCirc = new AIS_ColoredShape(anEdgeCirc); - Handle(AIS_ColoredShape) anAisEdgeBSpline = new AIS_ColoredShape(anEdgeBSpline); - anAisEdgeP12->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisEdgeCirc->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisEdgeBSpline->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject2d.Append(anAisEdgeP12); - myObject2d.Append(anAisEdgeCirc); - myObject2d.Append(anAisEdgeBSpline); - Handle(AIS_TextLabel) anAisEdgeP12Label = new AIS_TextLabel(); - anAisEdgeP12Label->SetText("Edge between two 2d points"); - anAisEdgeP12Label->SetPosition(0.5 * (gp_XYZ(aPnt1.X(), aPnt1.Y() + 0.5, 0.0) + gp_XYZ(aPnt2.X(), aPnt2.Y() + 0.5, 0.0))); - anAisEdgeP12Label->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject2d.Append(anAisEdgeP12Label); - Handle(AIS_TextLabel) anAisEdgeCircLabel = new AIS_TextLabel(); - anAisEdgeCircLabel->SetText("Circular edge"); - anAisEdgeCircLabel->SetPosition(gp_XYZ(aCirc.Location().X(), aCirc.Location().Y() + 0.5, 0.0)); - anAisEdgeCircLabel->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject2d.Append(anAisEdgeCircLabel); - Handle(AIS_TextLabel) anAisEdgeBSplineLabel = new AIS_TextLabel(); - anAisEdgeBSplineLabel->SetText("BSpline edge"); - anAisEdgeBSplineLabel->SetPosition(gp_XYZ(aPole3.X(), aPole3.Y() + 0.5, 0.0)); - anAisEdgeBSplineLabel->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject2d.Append(anAisEdgeBSplineLabel); - TopoDS_Vertex anEdgeP12_V1, anEdgeP12_V2; - TopExp::Vertices(anEdgeP12, anEdgeP12_V1, anEdgeP12_V2); - myObject2d.Append(new AIS_Shape(anEdgeP12_V1)); - myObject2d.Append(new AIS_Shape(anEdgeP12_V2)); - TopoDS_Vertex anEdgeCirc_V1, anEdgeCirc_V2; - TopExp::Vertices(anEdgeCirc, anEdgeCirc_V1, anEdgeCirc_V2); - myObject2d.Append(new AIS_Shape(anEdgeCirc_V1)); - myObject2d.Append(new AIS_Shape(anEdgeCirc_V2)); - TopoDS_Vertex anEdgeBSpline_V1, anEdgeBSpline_V2; - TopExp::Vertices(anEdgeBSpline, anEdgeBSpline_V1, anEdgeBSpline_V2); - myObject2d.Append(new AIS_Shape(anEdgeBSpline_V1)); - myObject2d.Append(new AIS_Shape(anEdgeBSpline_V2)); -} - -void TopologySamples::Box3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 5.0; - Standard_Real aSizeY = 10.0; - Standard_Real aSizeZ = 15.0; - TopoDS_Shape aBox1 = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow" << std::endl; - - // Make a box by two points. - gp_Pnt aPnt1(10.0, 0.0, 0.0); - gp_Pnt aPnt2(20.0, 10.0, 15.0); - TopoDS_Shape aBox2 = BRepPrimAPI_MakeBox(aPnt1, aPnt2); - myResult << "Box with corners [" - << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << "] and [" - << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << "] was created in red" << std::endl; - - Handle(AIS_ColoredShape) anAisBox1 = new AIS_ColoredShape(aBox1); - Handle(AIS_ColoredShape) anAisBox2 = new AIS_ColoredShape(aBox2); - anAisBox1->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisBox2->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisBox1); - myObject3d.Append(anAisBox2); -} - -void TopologySamples::Cylinder3dSample() -{ - // Make a cylinder of the specified radius and length. - Standard_Real aRadius1 = 5.0; - Standard_Real aLength1 = 15.0; - TopoDS_Shape aCyl1 = BRepPrimAPI_MakeCylinder(aRadius1, aLength1); - myResult << "Cylinder with Radius = " << aRadius1 - << " and Length = " << aLength1 - << " was created in yellow" << std::endl; - - // Make a cylinder of the specified radius, length and sector angle. - Standard_Real aRadius2 = 8.0; - Standard_Real aLength2 = 25.0; - Standard_Real anAngle = M_PI_2; - TopoDS_Shape aCyl2 = BRepPrimAPI_MakeCylinder(aRadius2, aLength2, anAngle); - myResult << "Cylinder with Radius = " << aRadius2 - << " , Length = " << aLength2 - << " and Angle = " << anAngle - << " was created in red" << std::endl; - - Handle(AIS_ColoredShape) anAisCyl1 = new AIS_ColoredShape(aCyl1); - Handle(AIS_ColoredShape) anAisCyl2 = new AIS_ColoredShape(aCyl2); - anAisCyl1->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisCyl2->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisCyl1); - myObject3d.Append(anAisCyl2); -} - -void TopologySamples::Revolution3dSample() -{ - // Make a toroidal face by a series of shape revolves. - // Make a starting vertex at [-1.0, 0, 0]. - TopoDS_Shape aVertex = BRepBuilderAPI_MakeVertex(gp_Pnt(-1.0, 0.0, 0.0)); - - // Make a circular edge by revolting aVertex around - // an axis Y positioned at [-1.5, 0.0, 0.0] on 2*Pi angle - gp_Ax1 anAxis1(gp_Pnt(-1.5, 0.0, 0.0), gp::DY()); - TopoDS_Shape anEdge = BRepPrimAPI_MakeRevol(aVertex, anAxis1); - myResult << "Circular edge was created in yellow" << std::endl; - - // Make a toroidal face by revolting anEdge around - // Z axis on 2*Pi angle. - TopoDS_Shape aFace = BRepPrimAPI_MakeRevol(anEdge, gp::OZ()); - myResult << "Toroidal face was created in red" << std::endl; - - Handle(AIS_Axis) anAisAxis1 = new AIS_Axis(new Geom_Axis1Placement(anAxis1)); - Handle(AIS_Axis) anAisAxis2 = new AIS_Axis(new Geom_Axis1Placement(gp::OZ())); - Handle(AIS_Shape) anAisVertex = new AIS_Shape(aVertex); - Handle(AIS_ColoredShape) anAisEdge = new AIS_ColoredShape(anEdge); - Handle(AIS_ColoredShape) anAisFace = new AIS_ColoredShape(aFace); - anAisEdge->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisEdge->SetWidth(1.5); - anAisAxis1->SetColor(Quantity_NOC_GREEN); - anAisFace->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisAxis2->SetColor(Quantity_NOC_RED); - myObject3d.Append(anAisVertex); - myObject3d.Append(anAisEdge); - myObject3d.Append(anAisFace); -} - -void TopologySamples::TopologyIterator3dSample() -{ - // Make a compound shape. - TopoDS_Compound aComp; - BRep_Builder aBuilder; - aBuilder.MakeCompound(aComp); - // Add shapes to the compound. - aBuilder.Add(aComp, BRepBuilderAPI_MakeVertex(gp::Origin())); - aBuilder.Add(aComp, BRepBuilderAPI_MakeEdge(gp_Pnt(5.0, 0.0, 0.0), gp_Pnt(10.0, 0.0, 0.0))); - aBuilder.Add(aComp, BRepBuilderAPI_MakeFace(gp_Sphere(gp::XOY(), 10.0))); - aBuilder.Add(aComp, BRepBuilderAPI_MakeWire( - BRepBuilderAPI_MakeEdge(gp_Pnt(15.0, 0.0, 0.0), gp_Pnt(20.0, 0.0, 0.0)), - BRepBuilderAPI_MakeEdge(gp_Pnt(20.0, 0.0, 0.0), gp_Pnt(25.0, 10.0, 5.0)) - )); - aBuilder.Add(aComp, BRepPrimAPI_MakeBox(5.0, 6.0, 7.0).Shell()); - aBuilder.Add(aComp, BRepPrimAPI_MakeBox(5.0, 6.0, 7.0).Solid()); - TopoDS_Compound aComp1; - aBuilder.MakeCompound(aComp1); - aBuilder.Add(aComp, aComp1); - - // Iterate over compound components. - myResult << "Compound components:" << std::endl; - Standard_Integer anI = 1; - for (TopoDS_Iterator anIt(aComp); anIt.More(); anIt.Next(), ++anI) - { - const TopoDS_Shape& aShape = anIt.Value(); - myResult << "#" << anI << " : "; - Handle(AIS_ColoredShape) anAisShape; - switch (aShape.ShapeType()) - { - case TopAbs_VERTEX: - myResult << "TopAbs_VERTEX"; - anAisShape = new AIS_ColoredShape(aShape); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - break; - case TopAbs_EDGE: - anAisShape = new AIS_ColoredShape(aShape); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myResult << "TopAbs_EDGE"; - break; - case TopAbs_WIRE: - myResult << "TopAbs_WIRE"; - break; - case TopAbs_FACE: - anAisShape = new AIS_ColoredShape(aShape); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_RED)); - myResult << "TopAbs_FACE"; - break; - case TopAbs_SHELL: - myResult << "TopAbs_SHELL"; - break; - case TopAbs_SOLID: - myResult << "TopAbs_SOLID"; - break; - case TopAbs_COMPOUND: - myResult << "TopAbs_COMPOUND"; - break; - case TopAbs_COMPSOLID: - myResult << "TopAbs_COMPSOLID"; - break; - case TopAbs_SHAPE: - myResult << "TopAbs_SHAPE"; - break; - } - myResult << std::endl; - if (anAisShape) - { - myObject3d.Append(anAisShape); - } - } -} - -void TopologySamples::TopologyExplorer3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 5.0; - Standard_Real aSizeY = 10.0; - Standard_Real aSizeZ = 15.0; - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - - // Explore vertex references. - myResult << "Vertex refs. : "; - Standard_Integer nbVertices = 0; - for (TopExp_Explorer anExp(aBox, TopAbs_VERTEX); anExp.More(); anExp.Next(), ++nbVertices) - { - const TopoDS_Shape& aShape = anExp.Current(); - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisShape); - } - myResult << nbVertices << std::endl; - - // Explore edge references. - myResult << "Edge refs. : "; - Standard_Integer nbEdges = 0; - for (TopExp_Explorer anExp(aBox, TopAbs_EDGE); anExp.More(); anExp.Next(), ++nbEdges) - { - const TopoDS_Shape& aShape = anExp.Current(); - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisShape->SetWidth(2.5); - myObject3d.Append(anAisShape); - } - myResult << nbEdges << std::endl; - - // Explore face references. - myResult << "Face refs. : "; - Standard_Integer nbFaces = 0; - for (TopExp_Explorer anExp(aBox, TopAbs_FACE); anExp.More(); anExp.Next(), ++nbFaces) - { - const TopoDS_Shape& aShape = anExp.Current(); - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisShape->SetWidth(2.5); - myObject3d.Append(anAisShape); - } - myResult << nbFaces << std::endl; - - // Explore shell references. - myResult << "Wire refs. : "; - Standard_Integer nbWires = 0; - for (TopExp_Explorer anExp(aBox, TopAbs_WIRE); anExp.More(); anExp.Next(), ++nbWires) - { - } - myResult << nbWires << std::endl; - - // Explore shell references. - myResult << "Shell refs. : "; - Standard_Integer nbShells = 0; - for (TopExp_Explorer anExp(aBox, TopAbs_SHELL); anExp.More(); anExp.Next(), ++nbShells) - { - } - myResult << nbShells << std::endl; - - // Explore solid references. - myResult << "Solid refs. : "; - Standard_Integer nbSolids = 0; - for (TopExp_Explorer anExp(aBox, TopAbs_SOLID); anExp.More(); anExp.Next(), ++nbSolids) - { - } - myResult << nbSolids << std::endl; -} - -void TopologySamples::AssessToCurve3dSample() -{ - // Make a face from a sphere. - gp_Sphere aSphere(gp::XOY(), 1.0); - TopoDS_Face aFace = BRepBuilderAPI_MakeFace(aSphere); - myResult << "TopoDS_Face on the sphere with" << std::endl - << "the center at [ " - << aSphere.Location().X() << ", " << aSphere.Location().Y() << ", " << aSphere.Location().Z() - << " ] and R = " << aSphere.Radius() << " was created in yellow" << std::endl - << std::endl; - - Handle(AIS_ColoredShape) anAisFace = new AIS_ColoredShape(aFace); - anAisFace->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisFace); - - // Retrieve the first not degenerated edge. - TopoDS_Edge aCurveEdge; - for (TopExp_Explorer anExp(aFace, TopAbs_EDGE); anExp.More(); anExp.Next()) - { - TopoDS_Edge anEdge = TopoDS::Edge(anExp.Current()); - if (!BRep_Tool::Degenerated(anEdge)) - { - aCurveEdge = anEdge; - break; - } - } - if (!aCurveEdge.IsNull()) - { - // Make a curve on edge adaptor. - BRepAdaptor_Curve aCurveAdaptor(aCurveEdge); - myResult << "Curve adaptor for edge was built in red" << std::endl; - - Handle(AIS_ColoredShape) anAisCurveEdge = new AIS_ColoredShape(aCurveEdge); - anAisCurveEdge->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisCurveEdge->SetWidth(1.5); - myObject3d.Append(anAisCurveEdge); - - // Use the curve adaptor for some calculations, e.g. compute - // a set of points using GCPnts_QuasiUniformDeflection algo. - Standard_Real aDeflection = 0.1; - GCPnts_QuasiUniformDeflection anAlgo(aCurveAdaptor, aDeflection); - Standard_ASSERT_VOID(anAlgo.IsDone(), "Success is expected!"); - myResult << "Distribution of point on the curve with " << aDeflection - << " deflection was performed:" << std::endl; - for (Standard_Integer i = 1; i <= anAlgo.NbPoints(); ++i) - { - gp_Pnt aPnt = anAlgo.Value(i); - myResult << "Point #" << i << " : [ " - << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() << " ]" << std::endl; - Handle(AIS_Point) anAisPnt = new AIS_Point(new Geom_CartesianPoint(aPnt)); - myObject3d.Append(anAisPnt); - } - } -} - -void TopologySamples::AssessToCompositeCurve3dSample() -{ - // Make a wire containing two BSpline curves. - // Define points. - gp_Pnt aPole1(0.0, 0.0, 10.0); - gp_Pnt aPole2(5.0, 5.0, 5.0); - gp_Pnt aPole3(10.0, 10.0, 15.0); - gp_Pnt aPole4(15.0, 5.0, 20.0); - gp_Pnt aPole5(25.0, 15.0, 20.0); - gp_Pnt aPole6(35.0, 15.0, 15.0); - gp_Pnt aPole7(45.0, 25.0, 10.0); - // Add points to the curve poles array. - TColgp_Array1OfPnt aPoles1(1, 4), aPoles2(1, 4); - aPoles1.SetValue(1, aPole1); - aPoles1.SetValue(2, aPole2); - aPoles1.SetValue(3, aPole3); - aPoles1.SetValue(4, aPole4); - aPoles2.SetValue(1, aPole4); - aPoles2.SetValue(2, aPole5); - aPoles2.SetValue(3, aPole6); - aPoles2.SetValue(4, aPole7); - // Make a BSpline curves from the point arrays - Handle(Geom_BSplineCurve) aBSplineCurve1 = GeomAPI_PointsToBSpline(aPoles1).Curve(); - Handle(Geom_BSplineCurve) aBSplineCurve2 = GeomAPI_PointsToBSpline(aPoles2).Curve(); - // Make edges - TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aBSplineCurve1); - TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aBSplineCurve2); - // Make a wire - BRepBuilderAPI_MakeWire aMakeWire; - aMakeWire.Add(anEdge1); - aMakeWire.Add(anEdge2); - Standard_ASSERT_VOID(aMakeWire.IsDone(), "Added edge isn't connectible!"); - TopoDS_Wire aWire = aMakeWire.Wire(); - myResult << "Wire of two BSpline curves was created" << std::endl; - - Handle(AIS_ColoredShape) anAisWire = new AIS_ColoredShape(aWire); - myObject3d.Append(anAisWire); - - // Make an adaptor. - BRepAdaptor_CompCurve aCurveAdaptor(aWire); - - // Use the curve adaptor for some calculations, e.g. compute - // a set of points using GCPnts_QuasiUniformDeflection algo. - Standard_Real aDeflection = 0.5; - GCPnts_QuasiUniformDeflection anAlgo(aCurveAdaptor, aDeflection); - Standard_ASSERT_VOID(anAlgo.IsDone(), "Success is expected!"); - myResult << "Distribution of point on the curve with " << aDeflection - << " deflection was performed:" << std::endl; - for (Standard_Integer i = 1; i <= anAlgo.NbPoints(); ++i) - { - gp_Pnt aPnt = anAlgo.Value(i); - myResult << "Point #" << i << " : [ " - << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z() << " ]" << std::endl; - Handle(AIS_Point) anAisPnt = new AIS_Point(new Geom_CartesianPoint(aPnt)); - myObject3d.Append(anAisPnt); - } -} - -void TopologySamples::AssessToSurface3dSample() -{ - // Make a face from a sphere. - gp_Sphere aSphere(gp::XOY(), 4.0); - TopoDS_Face aFace = BRepBuilderAPI_MakeFace(aSphere); - myResult << "TopoDS_Face on the sphere with" << std::endl - << "the center at [ " - << aSphere.Location().X() << ", " << aSphere.Location().Y() << ", " << aSphere.Location().Z() - << " ] and R = " << aSphere.Radius() << " was created in yellow" << std::endl - << std::endl; - - // Make a surface adaptor. - BRepAdaptor_Surface aSurfAdaptor(aFace); - - // Use the surface adaptor for some calculations, e.g. compute - // a normal vector at a surface point. - Standard_Real anU = 0.0, aV = 0.0; - gp_Pnt aPnt; - gp_Vec aDU, aDV; - aSurfAdaptor.D1(anU, aV, aPnt, aDU, aDV); - gp_Vec aNorm = aDU.Crossed(aDV); - Standard_ASSERT_VOID(aNorm.Magnitude() > Precision::Confusion(), "Non zero vector is expected!"); - aNorm.Normalize(); - myResult << "Normal vector at ( " << anU << ", " << aV << " )" << std::endl - << " = " << aNorm.X() << ", " << aNorm.Y() << ", " << aNorm.Z() << " ] is in red" << std::endl; - - Handle(AIS_ColoredShape) anAisFace = new AIS_ColoredShape(aFace); - anAisFace->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - Handle(AIS_Point) anAisPnt = new AIS_Point(new Geom_CartesianPoint(aPnt)); - Handle(AIS_ColoredShape) anAisNorm = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aPnt, aPnt.XYZ() + aNorm.XYZ())); - myObject3d.Append(anAisFace); - myObject3d.Append(anAisNorm); - myObject3d.Append(anAisPnt); -} - -void TopologySamples::Common3dSample() -{ - // Make a box #1 with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - TopoDS_Shape aShape1 = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow wireframe" << std::endl; - - // Make a box #2 by two points. - gp_Pnt aPnt1(5.0, 7.5, 10.0); - gp_Pnt aPnt2(20.0, 25.0, 30.0); - TopoDS_Shape aShape2 = BRepPrimAPI_MakeBox(aPnt1, aPnt2); - myResult << "Box with corners [" - << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << "] and [" - << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << "] was created in green wirefreme" << std::endl; - - // Create a boolean algo. - BRepAlgoAPI_Common anAlgo(aShape1, aShape2); - - // Make operation. - anAlgo.Build(); - - if (!anAlgo.IsDone()) // Process errors - { - myResult << "Errors : " << std::endl; - anAlgo.DumpErrors(myResult); - } - if (anAlgo.HasWarnings()) // Process warnings - { - myResult << "Warnings : " << std::endl; - anAlgo.DumpErrors(myResult); - } - - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResultShape = anAlgo.Shape(); - myResult << "Result shape was created in red shading" << std::endl; - - Handle(AIS_ColoredShape) anAisShape1 = new AIS_ColoredShape(aShape1); - Handle(AIS_ColoredShape) anAisShape2 = new AIS_ColoredShape(aShape2); - anAisShape1->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisShape2->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResultShape); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisShape1); - myObject3d.Append(anAisShape2); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisShape1, 0, Standard_True); - myContext->SetDisplayMode(anAisShape2, 0, Standard_True); - myContext->SetDisplayMode(anAisResult, 1, Standard_True); - } -} - -void TopologySamples::Cut3dSample() -{ - // Make a box #1 with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - TopoDS_Shape aShape1 = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow wireframe" << std::endl; - - // Make a box #2 by two points as a cutting tool. - gp_Pnt aPnt1(5.0, 7.5, 10.0); - gp_Pnt aPnt2(20.0, 25.0, 30.0); - TopoDS_Shape aShape2 = BRepPrimAPI_MakeBox(aPnt1, aPnt2); - myResult << "Box with corners [" - << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << "] and [" - << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << "] was created in green wireframe" << std::endl; - - // Create a boolean algo. - BRepAlgoAPI_Cut anAlgo(aShape1, aShape2); - - // Make operation. - anAlgo.Build(); - - if (!anAlgo.IsDone()) // Process errors - { - myResult << "Errors : " << std::endl; - anAlgo.DumpErrors(myResult); - } - if (anAlgo.HasWarnings()) // Process warnings - { - myResult << "Warnings : " << std::endl; - anAlgo.DumpErrors(myResult); - } - - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResultShape = anAlgo.Shape(); - myResult << "Result shape was created in red shading" << std::endl; - Handle(AIS_ColoredShape) anAisShape1 = new AIS_ColoredShape(aShape1); - Handle(AIS_ColoredShape) anAisShape2 = new AIS_ColoredShape(aShape2); - anAisShape1->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisShape2->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResultShape); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisShape1); - myObject3d.Append(anAisShape2); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisShape1, 0, Standard_True); - myContext->SetDisplayMode(anAisShape2, 0, Standard_True); - myContext->SetDisplayMode(anAisResult, 1, Standard_True); - } -} - -void TopologySamples::Fuse3dSample() -{ - // Make a box #1 with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - TopoDS_Shape aShape1 = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow wireframe" << std::endl; - - // Make a box #2 by two points. - gp_Pnt aPnt1(5.0, 7.5, 10.0); - gp_Pnt aPnt2(20.0, 25.0, 30.0); - TopoDS_Shape aShape2 = BRepPrimAPI_MakeBox(aPnt1, aPnt2); - myResult << "Box with corners [" - << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << "] and [" - << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << "] was created in green wireframe" << std::endl; - - // Create a boolean algo. - BRepAlgoAPI_Fuse anAlgo(aShape1, aShape2); - - // Make operation. - anAlgo.Build(); - - if (!anAlgo.IsDone()) // Process errors - { - myResult << "Errors : " << std::endl; - anAlgo.DumpErrors(myResult); - } - if (anAlgo.HasWarnings()) // Process warnings - { - myResult << "Warnings : " << std::endl; - anAlgo.DumpErrors(myResult); - } - - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResultShape = anAlgo.Shape(); - myResult << "Result shape was created in red shading" << std::endl; - Handle(AIS_ColoredShape) anAisShape1 = new AIS_ColoredShape(aShape1); - Handle(AIS_ColoredShape) anAisShape2 = new AIS_ColoredShape(aShape2); - anAisShape1->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisShape2->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResultShape); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisShape1); - myObject3d.Append(anAisShape2); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisShape1, 0, Standard_True); - myContext->SetDisplayMode(anAisShape2, 0, Standard_True); - myContext->SetDisplayMode(anAisResult, 1, Standard_True); - } -} - -void TopologySamples::Section3dSample() -{ - // Make a box #1 with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - TopoDS_Shape aShape = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow wireframe" << std::endl; - - // Create a boolean algo. - // Make a section by a plane. - gp_Pln aPln(gp_Pnt(aSizeX / 2.0, aSizeY / 2.0, aSizeZ / 2.0), gp::DZ()); - BRepAlgoAPI_Section anAlgo(aShape, aPln, Standard_False); - - // Make operation. - anAlgo.Build(); - - if (!anAlgo.IsDone()) // Process errors - { - myResult << "Errors : " << std::endl; - anAlgo.DumpErrors(myResult); - } - if (anAlgo.HasWarnings()) // Process warnings - { - myResult << "Warnings : " << std::endl; - anAlgo.DumpErrors(myResult); - } - - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResultShape = anAlgo.Shape(); - myResult << "Result shape was created in red" << std::endl; - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - Handle(AIS_Plane) anAisPlane = new AIS_Plane(new Geom_Plane(aPln)); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResultShape); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisShape); - myObject3d.Append(anAisPlane); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisShape, 0, Standard_True); - } -} - -void TopologySamples::Splitter3dSample() -{ - // Make a box by two points. - gp_Pnt aPnt1(-5.0, -7.5, -10.0); - gp_Pnt aPnt2(10.0, 15.0, 10.0); - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(aPnt1, aPnt2); - myResult << "Box with corners [" - << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << "] and [" - << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << "] was created in yellow" << std::endl; - - // Make a splitting tool as XY plane. - TopoDS_Shape aTool = BRepBuilderAPI_MakeFace(gp_Pln(gp::XOY())); - - // Create a splitter algo. - BRepAlgoAPI_Splitter aSplitter; - - // Add shapes to be split. - TopTools_ListOfShape anArguments; - anArguments.Append(aBox); - aSplitter.SetArguments(anArguments); - - // Add tool shapes. - TopTools_ListOfShape aTools; - aTools.Append(aTool); - aSplitter.SetTools(aTools); - - // Perform splitting. - aSplitter.Build(); - - if (!aSplitter.IsDone()) // Process errors - { - myResult << "Errors : " << std::endl; - aSplitter.DumpErrors(myResult); - } - if (aSplitter.HasWarnings()) // Process warnings - { - myResult << "Warnings : " << std::endl; - aSplitter.DumpErrors(myResult); - } - - Handle(AIS_ColoredShape) anAisBox = new AIS_ColoredShape(aBox); - anAisBox->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisBox); - - if (aSplitter.IsDone()) // Process results - { - // Simplification of the result shape is performed by the means of - // ShapeUpgrade_UnifySameDomain algorithm. The result of the operation will - // be overwritten with the simplified result. - // The simplification is performed without creation of the Internal shapes, - // i.e. shapes connections will never be broken. - // Simplification is performed on the whole result shape. Thus, if the input - // shapes contained connected tangent edges or faces unmodified during the operation - // they will also be unified. - aSplitter.SimplifyResult(); - - // Get result of splitting. - TopoDS_Shape aResult = aSplitter.Shape(); - myResult << "Splitting result (shapes are moved apart for illustativeness) is in red" << std::endl; - - // In this particular sample two shapes in the result are expected. - // Lets move apart them for illustrative purposes. - TopoDS_Iterator anIt(aResult); - Standard_ASSERT_VOID(anIt.More(), "Not empty result is expected!"); - TopoDS_Shape aBox1 = anIt.Value(); anIt.Next(); - Standard_ASSERT_VOID(anIt.More(), "Two shapes in the result are expected!"); - TopoDS_Shape aBox2 = anIt.Value(); - gp_Trsf aTrsf1; aTrsf1.SetTranslation(gp_Vec(0.0, 0.0, -15.0)); - aBox1.Move(aTrsf1); - gp_Trsf aTrsf2; aTrsf2.SetTranslation(gp_Vec(0.0, 0.0, +15.0)); - aBox2.Move(aTrsf2); - - Handle(AIS_ColoredShape) anAisBox1 = new AIS_ColoredShape(aBox1); - Handle(AIS_ColoredShape) anAisBox2 = new AIS_ColoredShape(aBox2); - anAisBox1->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisBox2->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisBox1); - myObject3d.Append(anAisBox2); - } -} - -void TopologySamples::Defeaturing3dSample() -{ - // Prepare a box with a chamfer. - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 8.0; - Standard_Real aSizeY = 10.0; - Standard_Real aSizeZ = 15.0; - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - // Initialize chamfer algo. - BRepFilletAPI_MakeChamfer anAlgo(aBox); - // Set edge to apply a chamfer with specified distance from it. - // Select the 5th edge in the map returned by TopExp::MapShapes method. - TopTools_IndexedMapOfShape anEdges; - TopExp::MapShapes(aBox, TopAbs_EDGE, anEdges); - TopoDS_Edge anEdge = TopoDS::Edge(anEdges.FindKey(5)); - Standard_Real aDist = 4.0; - anAlgo.Add(aDist, anEdge); - // Make a chamfer. - anAlgo.Build(); - Standard_ASSERT_VOID(anAlgo.IsDone(), "Couldn't prepare a box with a chamfer!"); - // Get a box with a chamfer. - TopoDS_Shape aBoxWithChamfer = anAlgo.Shape(); - myResult << "Box with a chamfer is in yellow shading" << std::endl; - - Handle(AIS_ColoredShape) anAisBoxWithChamfer = new AIS_ColoredShape(aBoxWithChamfer); - anAisBoxWithChamfer->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisBoxWithChamfer); - myContext->SetDisplayMode(anAisBoxWithChamfer, 1, Standard_True); - - // Retrieve chamfer faces generated from the edge - const TopTools_ListOfShape& aGenShapes = anAlgo.Generated(anEdge); - Standard_ASSERT_VOID(!aGenShapes.IsEmpty(), "Chamfer face is expected!"); - for (TopTools_ListOfShape::Iterator anIt(aGenShapes); anIt.More(); anIt.Next()) - { - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(anIt.Value()); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisShape->SetWidth(2.5); - myObject3d.Append(anAisShape); - myContext->SetDisplayMode(anAisBoxWithChamfer, 1, Standard_True); - } - myResult << "Chamfer faces : " << aGenShapes.Size() << std::endl; - myResult << "The first one is using to remove" << std::endl; - myResult << "The removed face is in green" << std::endl; - - // Initialize defeaturing algo. - BRepAlgoAPI_Defeaturing aDefeatAlgo; - aDefeatAlgo.SetShape(aBoxWithChamfer); - aDefeatAlgo.AddFaceToRemove(aGenShapes.First()); - - // Remove the chamfer. - aDefeatAlgo.Build(); - - if (aDefeatAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResult = aDefeatAlgo.Shape(); - myResult << "Defeatured box is in red wireframe" << std::endl; - - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResult); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisResult, 0, Standard_True); - } -} - -void TopologySamples::Fillet3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 8.0; - Standard_Real aSizeY = 10.0; - Standard_Real aSizeZ = 15.0; - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow wireframe" << std::endl; - - // Initialize fillet algo. - BRepFilletAPI_MakeFillet anAlgo(aBox); - - // Set edge to apply a fillet with specified radius. - // Select the first edge in the map returned by TopExp::MapShapes method. - TopTools_IndexedMapOfShape anEdges; - TopExp::MapShapes(aBox, TopAbs_EDGE, anEdges); - TopoDS_Edge anEdge = TopoDS::Edge(anEdges.FindKey(1)); - Standard_Real aRadius = 3.0; - anAlgo.Add(aRadius, anEdge); - myResult << "Make a fillet of " << aRadius << " radius on an edge in green" << std::endl; - - Handle(AIS_ColoredShape) anAisBox = new AIS_ColoredShape(aBox); - Handle(AIS_ColoredShape) anAisEdge = new AIS_ColoredShape(anEdge); - anAisBox->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisEdge->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisEdge->SetWidth(2.5); - myObject3d.Append(anAisBox); - myObject3d.Append(anAisEdge); - myContext->SetDisplayMode(anAisBox, 0, Standard_True); - - // Make a fillet. - anAlgo.Build(); - - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResult = anAlgo.Shape(); - myResult << "Fillet was built. Result shape is in red shading" << std::endl; - - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResult); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisResult, 1, Standard_True); - } -} - -void TopologySamples::Chamfer3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 8.0; - Standard_Real aSizeY = 10.0; - Standard_Real aSizeZ = 15.0; - TopoDS_Shape aBox = BRepPrimAPI_MakeBox(aSizeX, aSizeY, aSizeZ); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow wirewrame" << std::endl; - - // Initialize chamfer algo. - BRepFilletAPI_MakeChamfer anAlgo(aBox); - - // Set edge to apply a chamfer with specified distance from it. - // Select the 5th edge in the map returned by TopExp::MapShapes method. - TopTools_IndexedMapOfShape anEdges; - TopExp::MapShapes(aBox, TopAbs_EDGE, anEdges); - TopoDS_Edge anEdge = TopoDS::Edge(anEdges.FindKey(5)); - Standard_Real aDist = 4.0; - anAlgo.Add(aDist, anEdge); - myResult << "Make a chamfer of " << aDist << " size on an edge in green" << std::endl; - - Handle(AIS_ColoredShape) anAisBox = new AIS_ColoredShape(aBox); - Handle(AIS_ColoredShape) anAisEdge = new AIS_ColoredShape(anEdge); - anAisBox->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisEdge->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisEdge->SetWidth(2.5); - myObject3d.Append(anAisBox); - myObject3d.Append(anAisEdge); - myContext->SetDisplayMode(anAisBox, 0, Standard_True); - - // Make a chamfer. - anAlgo.Build(); - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResult = anAlgo.Shape(); - myResult << "Fillet was built. Result shape is in red shading" << std::endl; - - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResult); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisResult); - myContext->SetDisplayMode(anAisResult, 1, Standard_True); - - const TopTools_ListOfShape& aGenShapes = anAlgo.Generated(anEdge); - for (TopTools_ListOfShape::Iterator anIt(aGenShapes); anIt.More(); anIt.Next()) - { - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(anIt.Value()); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_RED)); - anAisShape->SetWidth(2.5); - myObject3d.Append(anAisShape); - } - } -} - -void TopologySamples::Offset3dSample() -{ - // Make a triangle wire. - BRepBuilderAPI_MakePolygon aTria; - TopoDS_Vertex aVertA = BRepBuilderAPI_MakeVertex(gp_Pnt(-0.5, 0.0, 0.0)); - TopoDS_Vertex aVertB = BRepBuilderAPI_MakeVertex(gp_Pnt(0.0, 0.0, +1.0)); - TopoDS_Vertex aVertC = BRepBuilderAPI_MakeVertex(gp_Pnt(+0.5, 0.0, 0.0)); - aTria.Add(aVertA); - aTria.Add(aVertB); - aTria.Add(aVertC); - aTria.Close(); - TopoDS_Wire aWire = aTria.Wire(); - myResult << "Triangular wire was created in yellow" << std::endl; - - Handle(AIS_ColoredShape) anAisWire = new AIS_ColoredShape(aWire); - anAisWire->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - myObject3d.Append(anAisWire); - - // Initialize offset algo. - BRepOffsetAPI_MakeOffset anAlgo(aWire); - - // Perform a series of offsets with linearly increasing value and altitude. - Standard_Real anOffsetStep = 0.2; - Standard_Real anAltitudeStep = 0.1; - for (Standard_Integer i = 1; i <= 4; ++i) - { - Standard_Real anOffset = anOffsetStep * i; - Standard_Real anAltitude = anAltitudeStep * i; - anAlgo.Perform(anOffset, anAltitude); - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResult = anAlgo.Shape(); - myResult << "#" << i << " : Offset = " << anOffset << " Altitude = " << anAltitude - << ". Result is in red." << std::endl; - - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResult); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisResult); - } - } -} - -void TopologySamples::Evolved3dSample() -{ - // Make a triangle wire as a spine. - BRepBuilderAPI_MakePolygon aTria; - TopoDS_Vertex aVertA = BRepBuilderAPI_MakeVertex(gp_Pnt(-0.5, 0.0, 0.0)); - TopoDS_Vertex aVertB = BRepBuilderAPI_MakeVertex(gp_Pnt(0.0, +1.0, 0.0)); - TopoDS_Vertex aVertC = BRepBuilderAPI_MakeVertex(gp_Pnt(+0.5, 0.0, 0.0)); - aTria.Add(aVertA); - aTria.Add(aVertB); - aTria.Add(aVertC); - aTria.Close(); - TopoDS_Wire aSpine = aTria.Wire(); - myResult << "Profile wire was created in yellow" << std::endl; - - // Make a wire as a profile. - BRepBuilderAPI_MakePolygon aPoly; - TopoDS_Vertex aVert1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-0.5, 0.0, 0.0)); - TopoDS_Vertex aVert2 = BRepBuilderAPI_MakeVertex(gp_Pnt(-0.5, -0.1, 0.5)); - TopoDS_Vertex aVert3 = BRepBuilderAPI_MakeVertex(gp_Pnt(-0.5, -0.2, 1.0)); - aPoly.Add(aVert1); - aPoly.Add(aVert2); - aPoly.Add(aVert3); - TopoDS_Wire aProfile = aPoly.Wire(); - myResult << "Spine wire was created in greed" << std::endl; - - Handle(AIS_ColoredShape) anAisSpine = new AIS_ColoredShape(aSpine); - Handle(AIS_ColoredShape) anAisProfile = new AIS_ColoredShape(aProfile); - anAisSpine->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisSpine->SetWidth(2.5); - anAisProfile->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisProfile->SetWidth(2.5); - myObject3d.Append(anAisSpine); - myObject3d.Append(anAisProfile); - - // Initialize evolving algo. - GeomAbs_JoinType aJoinType = GeomAbs_Arc; - Standard_Boolean aIsGlobalCS = Standard_False; - Standard_Boolean aIsSolid = Standard_True; - BRepOffsetAPI_MakeEvolved anAlgo(aSpine, aProfile, aJoinType, aIsGlobalCS, aIsSolid); - - // Perform evolving. - anAlgo.Build(); - - if (anAlgo.IsDone()) - { - // Get result. - TopoDS_Shape aResult = anAlgo.Shape(); - myResult << "Evolving result is in red" << std::endl; - - Handle(AIS_ColoredShape) anAisResult = new AIS_ColoredShape(aResult); - anAisResult->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisResult); - } -} - -void TopologySamples::Copy3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - BRepPrimAPI_MakeBox aBoxMake(aSizeX, aSizeY, aSizeZ); - TopoDS_Shape aBox = aBoxMake.Shape(); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow" << std::endl; - - // Make a box copy. - TopoDS_Shape aBoxCopy = BRepBuilderAPI_Copy(aBox); - myResult << "Box copy was created in red" << std::endl; - - gp_Trsf aTrsf1; aTrsf1.SetTranslation(gp_Vec(15.0, 0.0, 0.0)); - aBoxCopy.Move(aTrsf1); - myResult << "Box copy shape is moved apart for illustativeness" << std::endl; - - Handle(AIS_ColoredShape) anAisBox = new AIS_ColoredShape(aBox); - anAisBox->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisBox->SetWidth(2.5); - Handle(AIS_ColoredShape) anAisBoxCopy = new AIS_ColoredShape(aBoxCopy); - anAisBoxCopy->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisBox); - myObject3d.Append(anAisBoxCopy); -} - -void TopologySamples::Transform3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - BRepPrimAPI_MakeBox aBoxMake(aSizeX, aSizeY, aSizeZ); - TopoDS_Shape aBox = aBoxMake.Shape(); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow" << std::endl; - - // Move the box. - gp_Trsf aTrMove; aTrMove.SetTranslation(gp_Vec(15.0, 20.0, 25.0)); - TopoDS_Shape aMovedBox = BRepBuilderAPI_Transform(aBox, aTrMove, Standard_True); - myResult << "Moved box in green" << std::endl; - - // Rotate the moved box - gp_Trsf aTrRot; aTrRot.SetRotation(gp_Ax1(gp_Pnt(15.0, 20.0, 25.0), gp::DZ()), 3.0*M_PI_4); - TopoDS_Shape aRotatedBox = BRepBuilderAPI_Transform(aBox, aTrRot, Standard_True); - myResult << "Rotated box in red" << std::endl; - - Handle(AIS_ColoredShape) anAisBox = new AIS_ColoredShape(aBox); - Handle(AIS_ColoredShape) anAisMovedBox = new AIS_ColoredShape(aMovedBox); - Handle(AIS_ColoredShape) anAisRotatedBox = new AIS_ColoredShape(aRotatedBox); - anAisBox->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisMovedBox->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - anAisRotatedBox->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisBox); - myObject3d.Append(anAisMovedBox); - myObject3d.Append(anAisRotatedBox); -} - -void TopologySamples::ConvertToNurbs3dSample() -{ - // Make a torus face. - gp_Torus aTorus(gp::XOY(), 20.0, 7.5); - TopoDS_Shape aTorusFace = BRepBuilderAPI_MakeFace(aTorus); - myResult << "TopoDS_Solid on the torus with" << std::endl - << "R major = " << aTorus.MajorRadius() << std::endl - << "R minor = " << aTorus.MinorRadius() << std::endl - << "was created in yellow" << std::endl; - - // Convert faces/edges from analytic to NURBS geometry. - TopoDS_Shape aNurbsFace = BRepBuilderAPI_NurbsConvert(aTorusFace); - myResult << "Converted torus in red" << std::endl; - gp_Trsf aTrsf1; aTrsf1.SetTranslation(gp_Vec(60.0, 0.0, 0.0)); - aNurbsFace.Move(aTrsf1); - myResult << "Converted torus is moved apart for illustativeness" << std::endl; - - Handle(AIS_ColoredShape) anAisTorus = new AIS_ColoredShape(aTorusFace); - Handle(AIS_ColoredShape) anAisNurbs = new AIS_ColoredShape(aNurbsFace); - anAisTorus->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisTorus->SetWidth(2.5); - anAisNurbs->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisTorus); - myObject3d.Append(anAisNurbs); -} - -void TopologySamples::SewContiguousFaces3dSample() -{ - // Make a sphere. - gp_Sphere aSphere(gp::XOY(), 1.0); - // South hemisphere. - TopoDS_Face aFace1 = BRepBuilderAPI_MakeFace(aSphere, 0.0, 2.0 * M_PI, -M_PI_2, 0.0); - // North hemisphere. - TopoDS_Face aFace2 = BRepBuilderAPI_MakeFace(aSphere, 0.0, 2.0 * M_PI, 0.0, +M_PI_2); - - // Make a default tailor. - BRepBuilderAPI_Sewing aTailor; - - // Add hemisphere faces. - aTailor.Add(aFace1); - aTailor.Add(aFace2); - - // Perform sewing. - aTailor.Perform(); - - // Get result. - const TopoDS_Shape& aSewedSphere = aTailor.SewedShape(); - myResult << "Two hemispheres were sewed : " << aTailor.NbFreeEdges() << " free edges" << std::endl; - - Handle(AIS_ColoredShape) anAisSewedSphere = new AIS_ColoredShape(aSewedSphere); - anAisSewedSphere->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisSewedSphere); -} - -void TopologySamples::CheckValidity3dSample() -{ - // Make a box with a corner at [0, 0, 0] and the specified sizes. - Standard_Real aSizeX = 10.0; - Standard_Real aSizeY = 15.0; - Standard_Real aSizeZ = 20.0; - BRepPrimAPI_MakeBox aBoxMake(aSizeX, aSizeY, aSizeZ); - TopoDS_Shape aBox = aBoxMake.Shape(); - myResult << "Box at corner [0, 0, 0] and sizes [" - << aSizeX << ", " << aSizeY << ", " << aSizeZ - << "] was created in yellow" << std::endl; - - // Analyze the box. - BRepCheck_Analyzer anAnalyzer(aBox); - myResult << "Box is " << (anAnalyzer.IsValid() ? "valid" : "invalid") << std::endl; - - // Make the box invalid manually. - Handle(BRepTools_ReShape) aReShape = new BRepTools_ReShape(); - myResult << "Remove the top face from the box (red)" << std::endl; - aReShape->Remove(aBoxMake.TopFace()); - TopoDS_Shape aBox1 = aReShape->Apply(aBox); - myResult << "The top face was removed" << std::endl; - - // Analyze the modified box. - BRepCheck_Analyzer anAnalyzer1(aBox1); - myResult << "Modified box is " << (anAnalyzer1.IsValid() ? "valid" : "invalid") << std::endl; - - Handle(AIS_ColoredShape) anAisBox = new AIS_ColoredShape(aBox); - Handle(AIS_ColoredShape) anAisTopFace = new AIS_ColoredShape(aBoxMake.TopFace()); - anAisBox->SetColor(Quantity_Color(Quantity_NOC_YELLOW)); - anAisTopFace->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject3d.Append(anAisBox); - myObject3d.Append(anAisTopFace); -} - -void TopologySamples::ComputeLinearProperties3dSample() -{ - // Make an edge from a circular segment. - // Create a circle in XY plane of the radius 1.0. - gp_Circ aCirc(gp::XOY(), 1.0); - // Make a circular edge from the 1st quoter in the parametric space. - TopoDS_Edge aShape = BRepBuilderAPI_MakeEdge(aCirc, 0.0, M_PI); - myResult << "TopoDS_Edge on the circle's 1st quoter" << std::endl - << "with the center at [ " - << aCirc.Location().X() << ", " << aCirc.Location().Y() << ", " << aCirc.Location().Z() - << " ] and R = " << aCirc.Radius() << " was created in red" << std::endl - << std::endl; - - // Retrieve linear properties from the edge. - GProp_GProps aGProps; - BRepGProp::LinearProperties(aShape, aGProps); - Standard_Real aLength = aGProps.Mass(); - gp_Pnt aCOM = aGProps.CentreOfMass(); - Standard_Real anIx, anIy, anIz; - aGProps.StaticMoments(anIx, anIy, anIz); - gp_Mat aMOI = aGProps.MatrixOfInertia(); - myResult << "Linear properties:" << std::endl - << " Length = " << aLength << std::endl - << " Center of mass = [ " << aCOM.X() << ", " << aCOM.Y() << ", " << aCOM.Z() << " ]" << std::endl - << " Static moments = [ " << anIx << ", " << anIy << ", " << anIz << " ]" << std::endl - << " Matrix of inertia = [ " - << aMOI(1, 1) << ", " << aMOI(1, 2) << ", " << aMOI(1, 3) << std::endl - << std::setw(33) << aMOI(2, 1) << ", " << aMOI(2, 2) << ", " << aMOI(2, 3) << std::endl - << std::setw(33) << aMOI(3, 1) << ", " << aMOI(3, 2) << ", " << aMOI(3, 3) << " ]" << std::endl; - GProp_PrincipalProps aPProps = aGProps.PrincipalProperties(); - Standard_Real anIxx, anIyy, anIzz; - aPProps.Moments(anIxx, anIyy, anIzz); - Standard_Real aRxx, aRyy, aRzz; - aPProps.RadiusOfGyration(aRxx, aRyy, aRzz); - myResult << "Principal properties:" << std::endl - << " Has symmetric axis : " << (aPProps.HasSymmetryAxis() ? "YES" : "NO") << std::endl - << " Has symmetric point : " << (aPProps.HasSymmetryPoint() ? "YES" : "NO") << std::endl - << " Moments of inertia = [ " << anIxx << ", " << anIyy << ", " << anIzz << " ]" << std::endl - << " Radius of gyration = [ " << aRxx << ", " << aRyy << ", " << aRzz << " ]" << std::endl; - if (!aPProps.HasSymmetryPoint()) - { - const gp_Vec& anAxis1 = aPProps.FirstAxisOfInertia(); - myResult << " 1st axis of inertia = [ " << anAxis1.X() << ", " << anAxis1.Y() << ", " << anAxis1.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis1 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis1.XYZ())); - anAisAxis1->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis1); - if (!aPProps.HasSymmetryPoint()) - { - const gp_Vec& anAxis2 = aPProps.SecondAxisOfInertia(); - myResult << " 2nd axis of inertia = [ " << anAxis2.X() << ", " << anAxis2.Y() << ", " << anAxis2.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis2 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis2.XYZ())); - anAisAxis2->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis2); - const gp_Vec& anAxis3 = aPProps.ThirdAxisOfInertia(); - myResult << " 3rd axis of inertia = [ " << anAxis3.X() << ", " << anAxis3.Y() << ", " << anAxis3.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis3 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis3.XYZ())); - anAisAxis3->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis3); - } - } - - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - Handle(AIS_Point) anAisCOM = new AIS_Point(new Geom_CartesianPoint(aCOM)); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_RED)); - Handle(AIS_TextLabel) aCOMLabel = new AIS_TextLabel(); - aCOMLabel->SetText("Center of mass"); - aCOMLabel->SetPosition(aCOM); - Handle(AIS_Axis) anAisAxisX = new AIS_Axis(new Geom_Axis2Placement(gp::YOZ()), AIS_TOAX_XAxis); - Handle(AIS_Axis) anAisAxisY = new AIS_Axis(new Geom_Axis2Placement(gp::ZOX()), AIS_TOAX_YAxis); - Handle(AIS_Axis) anAisAxisZ = new AIS_Axis(new Geom_Axis2Placement(gp::XOY()), AIS_TOAX_ZAxis); - myObject3d.Append(anAisAxisX); - myObject3d.Append(anAisAxisY); - myObject3d.Append(anAisAxisZ); - myObject3d.Append(anAisShape); - myObject3d.Append(anAisCOM); - myObject3d.Append(aCOMLabel); -} - -void TopologySamples::ComputeSurfaceProperties3dSample() -{ - // Make a face from a cylinder with R = 1 - // and directed along Z axis - gp_Cylinder aCyl(gp::XOY(), 1.0); - TopoDS_Face aShape = BRepBuilderAPI_MakeFace(aCyl, 0.0, M_PI, -1.0, +1.0).Face(); - myResult << "TopoDS_Face on the cylinder R = " << aCyl.Radius() << std::endl - << "with axis [ " << aCyl.Position().Direction().X() << ", " << aCyl.Position().Direction().Y() << ", " << aCyl.Position().Direction().Z() << " ]" << std::endl - << "limited in length [-1 ... +1] was created in red" << std::endl; - - // Retrieve surface properties from the face. - GProp_GProps aGProps; - BRepGProp::SurfaceProperties(aShape, aGProps); - Standard_Real aArea = aGProps.Mass(); - gp_Pnt aCOM = aGProps.CentreOfMass(); - Standard_Real anIx, anIy, anIz; - aGProps.StaticMoments(anIx, anIy, anIz); - gp_Mat aMOI = aGProps.MatrixOfInertia(); - myResult << "Linear properties:" << std::endl - << " Area = " << aArea << std::endl - << " Center of mass = [ " << aCOM.X() << ", " << aCOM.Y() << ", " << aCOM.Z() << " ]" << std::endl - << " Static moments = [ " << anIx << ", " << anIy << ", " << anIz << " ]" << std::endl - << " Matrix of inertia = [ " - << aMOI(1, 1) << ", " << aMOI(1, 2) << ", " << aMOI(1, 3) << std::endl - << std::setw(33) << aMOI(2, 1) << ", " << aMOI(2, 2) << ", " << aMOI(2, 3) << std::endl - << std::setw(33) << aMOI(3, 1) << ", " << aMOI(3, 2) << ", " << aMOI(3, 3) << " ]" << std::endl; - GProp_PrincipalProps aPProps = aGProps.PrincipalProperties(); - Standard_Real anIxx, anIyy, anIzz; - aPProps.Moments(anIxx, anIyy, anIzz); - Standard_Real aRxx, aRyy, aRzz; - aPProps.RadiusOfGyration(aRxx, aRyy, aRzz); - myResult << "Principal properties:" << std::endl - << " Has symmetric axis : " << (aPProps.HasSymmetryAxis() ? "YES" : "NO") << std::endl - << " Has symmetric point : " << (aPProps.HasSymmetryPoint() ? "YES" : "NO") << std::endl - << " Moments of inertia = [ " << anIxx << ", " << anIyy << ", " << anIzz << " ]" << std::endl - << " Radius of gyration = [ " << aRxx << ", " << aRyy << ", " << aRzz << " ]" << std::endl; - if (!aPProps.HasSymmetryPoint()) - { - const gp_Vec& anAxis1 = aPProps.FirstAxisOfInertia(); - myResult << " 1st axis of inertia = [ " << anAxis1.X() << ", " << anAxis1.Y() << ", " << anAxis1.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis1 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis1.XYZ())); - anAisAxis1->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis1); - if (!aPProps.HasSymmetryPoint()) - { - const gp_Vec& anAxis2 = aPProps.SecondAxisOfInertia(); - myResult << " 2nd axis of inertia = [ " << anAxis2.X() << ", " << anAxis2.Y() << ", " << anAxis2.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis2 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis2.XYZ())); - anAisAxis2->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis2); - const gp_Vec& anAxis3 = aPProps.ThirdAxisOfInertia(); - myResult << " 3rd axis of inertia = [ " << anAxis3.X() << ", " << anAxis3.Y() << ", " << anAxis3.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis3 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis3.XYZ())); - anAisAxis3->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis3); - } - } - - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - Handle(AIS_Point) anAisCOM = new AIS_Point(new Geom_CartesianPoint(aCOM)); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_RED)); - Handle(AIS_TextLabel) aCOMLabel = new AIS_TextLabel(); - aCOMLabel->SetText("Center of mass"); - aCOMLabel->SetPosition(aCOM); - Handle(AIS_Axis) anAisAxisX = new AIS_Axis(new Geom_Axis2Placement(gp::YOZ()), AIS_TOAX_XAxis); - Handle(AIS_Axis) anAisAxisY = new AIS_Axis(new Geom_Axis2Placement(gp::ZOX()), AIS_TOAX_YAxis); - Handle(AIS_Axis) anAisAxisZ = new AIS_Axis(new Geom_Axis2Placement(gp::XOY()), AIS_TOAX_ZAxis); - myObject3d.Append(anAisAxisX); - myObject3d.Append(anAisAxisY); - myObject3d.Append(anAisAxisZ); - myObject3d.Append(anAisShape); - myObject3d.Append(anAisCOM); - myObject3d.Append(aCOMLabel); -} - -void TopologySamples::ComputeVolumeProperties3dSample() -{ - // Make a box by two points. - gp_Pnt aPnt1(-0.5, -0.6, -0.7); - gp_Pnt aPnt2(+0.8, +0.9, +1.0); - TopoDS_Shape aShape = BRepPrimAPI_MakeBox(aPnt1, aPnt2); - myResult << "Box with corners [" << aPnt1.X() << ", " << aPnt1.Y() << ", " << aPnt1.Z() - << "] and [" << aPnt2.X() << ", " << aPnt2.Y() << ", " << aPnt2.Z() - << "] was created in red" << std::endl; - - // Retrieve volume properties from the face. - GProp_GProps aGProps; - BRepGProp::VolumeProperties(aShape, aGProps); - Standard_Real aVolume = aGProps.Mass(); - gp_Pnt aCOM = aGProps.CentreOfMass(); - Standard_Real anIx, anIy, anIz; - aGProps.StaticMoments(anIx, anIy, anIz); - gp_Mat aMOI = aGProps.MatrixOfInertia(); - myResult << "Linear properties:" << std::endl - << " Volume = " << aVolume << std::endl - << " Center of mass = [ " << aCOM.X() << ", " << aCOM.Y() << ", " << aCOM.Z() << " ]" << std::endl - << " Static moments = [ " << anIx << ", " << anIy << ", " << anIz << " ]" << std::endl - << " Matrix of inertia = [ " - << aMOI(1, 1) << ", " << aMOI(1, 2) << ", " << aMOI(1, 3) << std::endl - << std::setw(33) << aMOI(2, 1) << ", " << aMOI(2, 2) << ", " << aMOI(2, 3) << std::endl - << std::setw(33) << aMOI(3, 1) << ", " << aMOI(3, 2) << ", " << aMOI(3, 3) << " ]" << std::endl; - GProp_PrincipalProps aPProps = aGProps.PrincipalProperties(); - Standard_Real anIxx, anIyy, anIzz; - aPProps.Moments(anIxx, anIyy, anIzz); - Standard_Real aRxx, aRyy, aRzz; - aPProps.RadiusOfGyration(aRxx, aRyy, aRzz); - myResult << "Principal properties:" << std::endl - << " Has symmetric axis : " << (aPProps.HasSymmetryAxis() ? "YES" : "NO") << std::endl - << " Has symmetric point : " << (aPProps.HasSymmetryPoint() ? "YES" : "NO") << std::endl - << " Moments of inertia = [ " << anIxx << ", " << anIyy << ", " << anIzz << " ]" << std::endl - << " Radius of gyration = [ " << aRxx << ", " << aRyy << ", " << aRzz << " ]" << std::endl; - if (!aPProps.HasSymmetryPoint()) - { - const gp_Vec& anAxis1 = aPProps.FirstAxisOfInertia(); - myResult << " 1st axis of inertia = [ " << anAxis1.X() << ", " << anAxis1.Y() << ", " << anAxis1.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis1 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis1.XYZ())); - anAisAxis1->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis1); - if (!aPProps.HasSymmetryPoint()) - { - const gp_Vec& anAxis2 = aPProps.SecondAxisOfInertia(); - myResult << " 2nd axis of inertia = [ " << anAxis2.X() << ", " << anAxis2.Y() << ", " << anAxis2.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis2 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis2.XYZ())); - anAisAxis2->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis2); - const gp_Vec& anAxis3 = aPProps.ThirdAxisOfInertia(); - myResult << " 3rd axis of inertia = [ " << anAxis3.X() << ", " << anAxis3.Y() << ", " << anAxis3.Z() << " ]" << std::endl; - Handle(AIS_ColoredShape) anAisAxis3 = new AIS_ColoredShape( - BRepBuilderAPI_MakeEdge(aCOM, aCOM.XYZ() + anAxis3.XYZ())); - anAisAxis3->SetColor(Quantity_Color(Quantity_NOC_GREEN)); - myObject3d.Append(anAisAxis3); - } - } - - Handle(AIS_ColoredShape) anAisShape = new AIS_ColoredShape(aShape); - Handle(AIS_Point) anAisCOM = new AIS_Point(new Geom_CartesianPoint(aCOM)); - anAisShape->SetColor(Quantity_Color(Quantity_NOC_RED)); - Handle(AIS_TextLabel) aCOMLabel = new AIS_TextLabel(); - aCOMLabel->SetText("Center of mass"); - aCOMLabel->SetPosition(aCOM); - Handle(AIS_Axis) anAisAxisX = new AIS_Axis(new Geom_Axis2Placement(gp::YOZ()), AIS_TOAX_XAxis); - Handle(AIS_Axis) anAisAxisY = new AIS_Axis(new Geom_Axis2Placement(gp::ZOX()), AIS_TOAX_YAxis); - Handle(AIS_Axis) anAisAxisZ = new AIS_Axis(new Geom_Axis2Placement(gp::XOY()), AIS_TOAX_ZAxis); - myObject3d.Append(anAisAxisX); - myObject3d.Append(anAisAxisY); - myObject3d.Append(anAisAxisZ); - myObject3d.Append(anAisShape); - myObject3d.Append(anAisCOM); - myObject3d.Append(aCOMLabel); -} diff --git a/samples/qt/OCCTOverview/code/TopologySamples.h b/samples/qt/OCCTOverview/code/TopologySamples.h deleted file mode 100644 index ecb6ca51ac..0000000000 --- a/samples/qt/OCCTOverview/code/TopologySamples.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef TOPOLOGYSAMPLES_H -#define TOPOLOGYSAMPLES_H - -#include "BaseSample.h" - -#include - -//! Implements Topology samples -class TopologySamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(TopologySamples, BaseSample) -public: - - TopologySamples (const TCollection_AsciiString& theSampleSourcePath, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample(theSampleSourcePath, theContext) - {} - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - // One function for every sample - void Vertex3dSample(); - void Edge3dSample(); - void Face3dSample(); - void Wire3dSample(); - void Shell3dSample(); - void Solid3dSample(); - void Edge2dSample(); - void Box3dSample(); - void Cylinder3dSample(); - void Revolution3dSample(); - void TopologyIterator3dSample(); - void TopologyExplorer3dSample(); - void AssessToCurve3dSample(); - void AssessToCompositeCurve3dSample(); - void AssessToSurface3dSample(); - void Common3dSample(); - void Cut3dSample(); - void Fuse3dSample(); - void Section3dSample(); - void Splitter3dSample(); - void Defeaturing3dSample(); - void Fillet3dSample(); - void Chamfer3dSample(); - void Offset3dSample(); - void Evolved3dSample(); - void Copy3dSample(); - void Transform3dSample(); - void ConvertToNurbs3dSample(); - void SewContiguousFaces3dSample(); - void CheckValidity3dSample(); - void ComputeLinearProperties3dSample(); - void ComputeSurfaceProperties3dSample(); - void ComputeVolumeProperties3dSample(); -}; - -#endif //TOPOLOGYSAMPLES_H diff --git a/samples/qt/OCCTOverview/code/Triangulation.xml b/samples/qt/OCCTOverview/code/Triangulation.xml deleted file mode 100644 index 04d37b3db0..0000000000 --- a/samples/qt/OCCTOverview/code/Triangulation.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/samples/qt/OCCTOverview/code/TriangulationSamples.cxx b/samples/qt/OCCTOverview/code/TriangulationSamples.cxx deleted file mode 100644 index 1635ef7c7e..0000000000 --- a/samples/qt/OCCTOverview/code/TriangulationSamples.cxx +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TriangulationSamples.h" - -#include "MakeBottle.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void TriangulationSamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "Triangulation3dSample") - { - Triangulation3dSample(); - } - else - { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -void TriangulationSamples::Triangulation3dSample() -{ - TopoDS_Shape aBottle = MakeBottle(50, 70, 30); - BRepMesh_IncrementalMesh(aBottle, 1); - - BRep_Builder aBuilder; - TopoDS_Compound aCompound; - aBuilder.MakeCompound(aCompound); - - Standard_Integer aNbTriangles(0); - for (TopExp_Explorer anExplorer(aBottle, TopAbs_FACE); anExplorer.More(); anExplorer.Next()) - { - TopoDS_Face aFace = TopoDS::Face(anExplorer.Current()); - TopLoc_Location aLocation; - Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation(aFace, aLocation); - - for (Standard_Integer i = 1; i <= aTriangulation->NbTriangles(); i++) - { - const Poly_Triangle trian = aTriangulation->Triangle (i); - Standard_Integer index1, index2, index3, M = 0, N = 0; - trian.Get(index1, index2, index3); - - for (Standard_Integer j = 1; j <= 3; j++) - { - switch (j) - { - case 1: - M = index1; - N = index2; - break; - case 2: - N = index3; - break; - case 3: - M = index2; - } - - BRepBuilderAPI_MakeEdge anEdgeMaker(aTriangulation->Node (M), aTriangulation->Node (N)); - if (anEdgeMaker.IsDone()) - { - aBuilder.Add(aCompound, anEdgeMaker.Edge()); - } - } - } - Handle(AIS_Triangulation) anAisTriangulation = new AIS_Triangulation(aTriangulation); - aNbTriangles += aTriangulation->NbTriangles(); - myObject3d.Append(anAisTriangulation); - } - - Handle(AIS_Shape) anAisCompound = new AIS_Shape(aCompound); - myObject3d.Append(anAisCompound); - - Handle(AIS_Shape) AISBottle = new AIS_Shape(aBottle); - myObject3d.Append(AISBottle); - - myResult << "Compute the triangulation on a shape: " << aNbTriangles; -} diff --git a/samples/qt/OCCTOverview/code/TriangulationSamples.h b/samples/qt/OCCTOverview/code/TriangulationSamples.h deleted file mode 100644 index aaab1fc070..0000000000 --- a/samples/qt/OCCTOverview/code/TriangulationSamples.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef TRIANGULATIONSAMPLES_H -#define TRIANGULATIONSAMPLES_H - -#include "BaseSample.h" - -//! Implements Triangulation sample -class TriangulationSamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(TriangulationSamples, BaseSample) -public: - - TriangulationSamples (const TCollection_AsciiString& theSampleSourcePath, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample (theSampleSourcePath, theContext) - { - // - } - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - // One function for every sample - void Triangulation3dSample(); - -}; - -#endif //TRIANGULATIONSAMPLES_H diff --git a/samples/qt/OCCTOverview/code/Viewer2d.xml b/samples/qt/OCCTOverview/code/Viewer2d.xml deleted file mode 100644 index 3b890519ef..0000000000 --- a/samples/qt/OCCTOverview/code/Viewer2d.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/qt/OCCTOverview/code/Viewer2dSamples.cxx b/samples/qt/OCCTOverview/code/Viewer2dSamples.cxx deleted file mode 100644 index 624881da34..0000000000 --- a/samples/qt/OCCTOverview/code/Viewer2dSamples.cxx +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "Viewer2dSamples.h" - -#include "Sample2D_Markers.h" -#include "Sample2D_Face.h" -#include "Sample2D_Image.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void Viewer2dSamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "TextView2dSample") - TextView2dSample(); - else if (theSampleName == "MarkerView2dSample") - MarkerView2dSample(); - else if (theSampleName == "FillAreaView2dSample") - FillAreaView2dSample(); - else if (theSampleName == "LoopOnFaceView2dSample") - LoopOnFaceView2dSample(); - else if (theSampleName == "RectagularLineGrid2dSample") - RectagularLineGrid2dSample(); - else if (theSampleName == "RectagularPointGrid2dSample") - RectagularPointGrid2dSample(); - else if (theSampleName == "CircularLineGrid2dSample") - CircularLineGrid2dSample(); - else if (theSampleName == "CircularPointGrid2dSample") - CircularPointGrid2dSample(); - else if (theSampleName == "ClearGrid2dSample") - ClearGrid2dSample(); - else if (theSampleName == "BackgroungImage2dSample") - BackgroungImage2dSample(); - else { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -void Viewer2dSamples::ClearExtra() -{ - myContext->RemoveAll(Standard_True); - myViewer->DeactivateGrid(); -} - -void Viewer2dSamples::TextView2dSample() -{ - Standard_Integer aColor = Quantity_NOC_MATRABLUE; - for (Standard_Integer j = 15; j <= 20; j++) - { - Handle(AIS_TextLabel) aText = new AIS_TextLabel(); - aText->SetText(TCollection_AsciiString("font 0 scale ") + (j / 20.0)); - aText->SetPosition(gp_Pnt(0.0, 15.0 * (j - 15.0), 0.0)); - aText->SetAngle(30.0 * M_PI / 180.0); - aText->SetColor(Quantity_NameOfColor(aColor++)); - aText->SetFontAspect(Font_FA_Regular); - aText->SetFont("Courier"); - aText->SetHeight(j); - aText->SetHJustification(Graphic3d_HTA_LEFT); - aText->SetVJustification(Graphic3d_VTA_BOTTOM); - aText->SetZoomable(Standard_False); - myObject2d.Append(aText); - } - - for (Standard_Real j = 10; j <= 15; j++) - { - Handle(AIS_TextLabel) aText = new AIS_TextLabel(); - aText->SetText(TCollection_AsciiString("font 1 scale ") + (j / 10.0)); - aText->SetPosition(gp_Pnt(80.0, 15.0 * (j - 10.0), 0.0)); - aText->SetAngle(0.0); - aText->SetColor(Quantity_NameOfColor(aColor++)); - aText->SetFontAspect(Font_FA_BoldItalic); - aText->SetFont("Cambria"); - aText->SetHeight(j * 2); - aText->SetHJustification(Graphic3d_HTA_LEFT); - aText->SetVJustification(Graphic3d_VTA_BOTTOM); - aText->SetZoomable(Standard_False); - myObject2d.Append(aText); - } - - aColor = Quantity_NOC_MATRABLUE; - for (Standard_Real j = 5; j <= 10; j++) - { - Handle(AIS_TextLabel) aText = new AIS_TextLabel(); - aText->SetText(TCollection_AsciiString("font 2 scale ") + (j / 10.0)); - aText->SetPosition(gp_Pnt(140.0, 15.0 * (j - 5.0), 0.0)); - aText->SetAngle(0.0); - aText->SetColor(Quantity_NameOfColor(aColor++)); - aText->SetFontAspect(Font_FA_Bold); - aText->SetFont("Arial"); - aText->SetHeight(j * 2); - aText->SetHJustification(Graphic3d_HTA_LEFT); - aText->SetVJustification(Graphic3d_VTA_BOTTOM); - aText->SetZoomable(Standard_False); - myObject2d.Append(aText); - } - for (Standard_Real j = 10; j <= 15; j++) - { - Handle(AIS_TextLabel) aText = new AIS_TextLabel(); - aText->SetText(TCollection_AsciiString("font 3 scale ") + (j / 10.0)); - aText->SetPosition(gp_Pnt(200.0, 15.0 * (j - 10.0), 0.0)); - aText->SetAngle(0.0); - aText->SetColor(Quantity_NameOfColor(aColor++)); - aText->SetFontAspect(Font_FA_Italic); - aText->SetFont("Georgia"); - aText->SetHeight(j * 2); - aText->SetHJustification(Graphic3d_HTA_LEFT); - aText->SetVJustification(Graphic3d_VTA_BOTTOM); - aText->SetZoomable(Standard_False); - myObject2d.Append(aText); - } -} - -void Viewer2dSamples::MarkerView2dSample() -{ - // generic Markers - Standard_Integer aColor = 20; - for (int i = 1; i <= 2; i++) - { - Handle(Sample2D_Markers) aMarker = new Sample2D_Markers(10 + 5, 5 * i, Aspect_TOM_POINT, Quantity_NOC_YELLOW, 2.0); - myObject2d.Append(aMarker); - } - for (int i = 1; i <= 2; i++) - { - Handle(Sample2D_Markers) aMarker = new Sample2D_Markers(10 + 10, 5 * i, Aspect_TOM_O, (Quantity_NameOfColor)(aColor++)); - myObject2d.Append(aMarker); - } - for (int i = 1; i <= 2; i++) - { - Handle(Sample2D_Markers) aMarker = new Sample2D_Markers(10 + 15, 5 * i, Aspect_TOM_O_PLUS, (Quantity_NameOfColor)(aColor++)); - myObject2d.Append(aMarker); - } - for (int i = 1; i <= 2; i++) - { - Handle(Sample2D_Markers) aMarker = new Sample2D_Markers(10 + 20, 5 * i, Aspect_TOM_RING1, (Quantity_NameOfColor)(aColor++)); - myObject2d.Append(aMarker); - } - for (int i = 1; i <= 2; i++) - { - Handle(Sample2D_Markers) aMarker = new Sample2D_Markers(10 + 25, 5 * i, Aspect_TOM_STAR, (Quantity_NameOfColor)(aColor++)); - myObject2d.Append(aMarker); - } - for (int i = 1; i <= 2; i++) - { - Handle(Sample2D_Markers) aMarker = new Sample2D_Markers(10 + 30, 5 * i, Aspect_TOM_O_X, (Quantity_NameOfColor)(aColor++)); - myObject2d.Append(aMarker); - } -} - -void Viewer2dSamples::FillAreaView2dSample() -{ - for (int i = 0; i <= 13; ++i) - { - for (int j = 0; j <= 5; ++j) - { - // set of rectangles here - TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(10 * i, 10 * j, 0.), gp_Pnt(10 * i + 7, 10 * j, 0.)); - TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(10 * i + 7, 10 * j, 0.), gp_Pnt(10 * i + 7, 10 * j + 5, 0.)); - TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(10 * i + 7, 10 * j + 5, 0.), gp_Pnt(10 * i, 10 * j + 5, 0.)); - TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(gp_Pnt(10 * i, 10 * j + 5, 0.), gp_Pnt(10 * i, 10 * j, 0.)); - TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1, E2, E3, E4); - TopoDS_Face F = BRepBuilderAPI_MakeFace(W); - Handle(AIS_Shape) aRect = new AIS_Shape(F); - // set attributes of boundaries - Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer(); - Handle(Prs3d_LineAspect) aLineAttrib = new Prs3d_LineAspect (Quantity_NOC_YELLOW, - (Aspect_TypeOfLine)(Aspect_TOL_SOLID + j), 1); - aDrawer->SetFaceBoundaryAspect(aLineAttrib); - aDrawer->SetFaceBoundaryDraw(Standard_True); - aRect->SetAttributes(aDrawer); - - myContext->SetDisplayMode(aRect, 1, Standard_False); - myContext->SetColor(aRect, (Quantity_NameOfColor)(Quantity_NOC_CADETBLUE + 2 * i), Standard_False); - myContext->SetMaterial(aRect, Graphic3d_NOM_PLASTIC, Standard_False); - myObject2d.Append(aRect); - - } - } -} - -void Viewer2dSamples::LoopOnFaceView2dSample() -{ - // Make a flat rectangular face on XY plane. - gp_Pln aPln(gp::XOY()); - TopoDS_Face aFaceRect = BRepBuilderAPI_MakeFace(aPln, -10.0, +10.0, -20.0, +20.0); - - Handle(AIS_ColoredShape) anAisFaceRect = new AIS_ColoredShape(aFaceRect); - anAisFaceRect->SetColor(Quantity_Color(Quantity_NOC_RED)); - myObject2d.Append(anAisFaceRect); - - TopoDS_Shape aFaceShape; - Handle(Sample2D_Face) anAISFace = new Sample2D_Face(aFaceRect); - myObject2d.Append(anAISFace); -} - -void Viewer2dSamples::RectagularLineGrid2dSample() -{ - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1, Quantity_NOC_WHITE, 2); - myViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth = 0, aHeight = 0, anOffset = 0; - myView->Window()->Size(aWidth, aHeight); - myViewer->SetRectangularGridGraphicValues(aWidth, aHeight, anOffset); - myViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Lines); - myViewer->Redraw(); -} - -void Viewer2dSamples::RectagularPointGrid2dSample() -{ - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1, Quantity_NOC_WHITE, 2); - myViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth = 0, aHeight = 0, anOffset = 0; - myView->Window()->Size(aWidth, aHeight); - myViewer->SetRectangularGridGraphicValues(aWidth, aHeight, anOffset); - myViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Points); - myViewer->Redraw(); -} - -void Viewer2dSamples::CircularLineGrid2dSample() -{ - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1, Quantity_NOC_WHITE, 2); - myViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth = 0, aHeight = 0, anOffset = 0; - myView->Window()->Size(aWidth, aHeight); - myViewer->SetRectangularGridGraphicValues(aWidth, aHeight, anOffset); - myViewer->ActivateGrid(Aspect_GT_Circular, Aspect_GDM_Lines); - myViewer->Redraw(); -} - -void Viewer2dSamples::CircularPointGrid2dSample() -{ - Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1, Quantity_NOC_WHITE, 2); - myViewer->SetGridEcho(aGridAspect); - Standard_Integer aWidth = 0, aHeight = 0, anOffset = 0; - myView->Window()->Size(aWidth, aHeight); - myViewer->SetRectangularGridGraphicValues(aWidth, aHeight, anOffset); - myViewer->ActivateGrid(Aspect_GT_Circular, Aspect_GDM_Points); - myViewer->Redraw(); -} - -void Viewer2dSamples::ClearGrid2dSample() -{ - myViewer->DeactivateGrid(); - myViewer->Redraw(); -} - -void Viewer2dSamples::BackgroungImage2dSample() -{ - Handle(Sample2D_Image) anImage = new Sample2D_Image(myFileName); - anImage->SetCoord(40, 50); - anImage->SetScale(1.0); - myObject2d.Append(anImage); -} diff --git a/samples/qt/OCCTOverview/code/Viewer2dSamples.h b/samples/qt/OCCTOverview/code/Viewer2dSamples.h deleted file mode 100644 index 66deb43b70..0000000000 --- a/samples/qt/OCCTOverview/code/Viewer2dSamples.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef VIEWER2DSAMPLES_H -#define VIEWER2DSAMPLES_H - -#include "BaseSample.h" - -#include -#include - -//! Implements viewer 2D samples. -class Viewer2dSamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(Viewer2dSamples, BaseSample) -public: - - Viewer2dSamples(const TCollection_AsciiString& theSampleSourcePath, - const Handle(V3d_View)& theView, - const Handle(V3d_Viewer)& theViewer, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample (theSampleSourcePath, theContext), - myView (theView), - myViewer (theViewer) - {} - - void SetFileName (const TCollection_AsciiString& theFileName) { myFileName = theFileName; } - void ClearExtra(); - - static Standard_Boolean IsFileSample (const TCollection_AsciiString& theSampleName) { return theSampleName == "BackgroungImage2dSample"; } - static Standard_Boolean IsShadedSample(const TCollection_AsciiString& theSampleName) { return theSampleName == "BackgroungImage2dSample"; } - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - - // One function for every sample - void TextView2dSample(); - void MarkerView2dSample(); - void FillAreaView2dSample(); - void LoopOnFaceView2dSample(); - void RectagularLineGrid2dSample(); - void RectagularPointGrid2dSample(); - void CircularLineGrid2dSample(); - void CircularPointGrid2dSample(); - void ClearGrid2dSample(); - void BackgroungImage2dSample(); - -private: - - TCollection_AsciiString myFileName; - Handle(V3d_View) myView; - Handle(V3d_Viewer) myViewer; - -}; - -#endif // VIEWER2DSAMPLES_H diff --git a/samples/qt/OCCTOverview/code/Viewer3d.xml b/samples/qt/OCCTOverview/code/Viewer3d.xml deleted file mode 100644 index 2c504e5dc6..0000000000 --- a/samples/qt/OCCTOverview/code/Viewer3d.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/qt/OCCTOverview/code/Viewer3dSamples.cxx b/samples/qt/OCCTOverview/code/Viewer3dSamples.cxx deleted file mode 100644 index 5cb2b76380..0000000000 --- a/samples/qt/OCCTOverview/code/Viewer3dSamples.cxx +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "Viewer3dSamples.h" - -#include "MakeBottle.h" - -#include -#include -#include -#include -#include -#include -#include - -void Viewer3dSamples::ExecuteSample (const TCollection_AsciiString& theSampleName) -{ - Standard_Boolean anIsSamplePresent = Standard_True; - FindSourceCode(theSampleName); - if (theSampleName == "SpotLight3dSample") - SpotLight3dSample(); - else if (theSampleName == "PositionalLight3dSample") - PositionalLight3dSample(); - else if (theSampleName == "DirectionalLight3dSample") - DirectionalLight3dSample(); - else if (theSampleName == "AmbientLight3dSample") - AmbientLight3dSample(); - else if (theSampleName == "ClearLight3dSample") - ClearLight3dSample(); - else if (theSampleName == "VerticesSelect3dSample") - VerticesSelect3dSample(); - else if (theSampleName == "EdgesSelect3dSample") - EdgesSelect3dSample(); - else if (theSampleName == "FacesSelect3dSample") - FacesSelect3dSample(); - else if (theSampleName == "NeutralPointSelect3dSample") - NeutralPointSelect3dSample(); - else if (theSampleName == "WireFramePresentation3dSample") - WireFramePresentation3dSample(); - else if (theSampleName == "ShadingPresentation3dSample") - ShadingPresentation3dSample(); - else if (theSampleName == "RedColorPresentation3dSample") - RedColorPresentation3dSample(); - else if (theSampleName == "GrayColorPresentation3dSample") - GrayColorPresentation3dSample(); - else if (theSampleName == "PlasticPresentation3dSample") - PlasticPresentation3dSample(); - else if (theSampleName == "BronzePresentation3dSample") - BronzePresentation3dSample(); - else if (theSampleName == "OpaquePresentation3dSample") - OpaquePresentation3dSample(); - else if (theSampleName == "HalfTransparencyPresentation3dSample") - HalfTransparencyPresentation3dSample(); - else if (theSampleName == "VboOn3dSample") - VboOn3dSample(); - else if (theSampleName == "VboOff3dSample") - VboOff3dSample(); - else - { - myResult << "No function found: " << theSampleName; - myCode += TCollection_AsciiString("No function found: ") + theSampleName; - anIsSamplePresent = Standard_False; - } - myIsProcessed = anIsSamplePresent; -} - -void Viewer3dSamples::AppendBottle() -{ - TopoDS_Shape aBottle = MakeBottle(50, 70, 30); - Handle(AIS_InteractiveObject) aShape = new AIS_Shape(aBottle); - myObject3d.Append(aShape); - Handle(AIS_ViewCube) aViewCube = new AIS_ViewCube(); - myObject3d.Append(aViewCube); - myResult << "A bottle shape was created." << std::endl; -} - -void Viewer3dSamples::ClearExtra() -{ - NeutralPointSelect3dSample(); - VboOff3dSample(); - ClearLight3dSample(); - // Delete Lights - V3d_ListOfLight aLights; - for(V3d_ListOfLightIterator anIter = myView->Viewer()->DefinedLightIterator(); - anIter.More(); anIter.Next()) - { - aLights.Append(anIter.Value()); - } - - for(V3d_ListOfLightIterator aLightIter (aLights); - aLightIter.More(); aLightIter.Next()) - { - myView->Viewer()->DelLight (aLightIter.Value()); - } - myView->Viewer()->SetDefaultLights(); // Setting the default lights on - myView->Update(); - - myContext->RemoveAll (Standard_True); -} - -void Viewer3dSamples::SpotLight3dSample() -{ - // Spot light source creation - Handle(V3d_SpotLight) aSpotLight = - new V3d_SpotLight(gp_Pnt(100.0, 0.0, 0.0), gp_Dir(-1.0, 0.0, 0.0), Quantity_NOC_RED); - aSpotLight->SetIntensity(5000); - myView->SetLightOn(aSpotLight); -} - -void Viewer3dSamples::PositionalLight3dSample() -{ - Handle(V3d_PositionalLight) aPositionalLight = - new V3d_PositionalLight(gp_Pnt(0.0, -100.0, 5.0), Quantity_NOC_GREEN); - aPositionalLight->SetAttenuation(1, 0); - myView->SetLightOn(aPositionalLight); -} - -void Viewer3dSamples::DirectionalLight3dSample() -{ - Handle(V3d_DirectionalLight) aDirectionalLight = - new V3d_DirectionalLight(gp_Dir(-1.0, 0.0, -1.0), Quantity_NOC_BLUE1); - myView->SetLightOn(aDirectionalLight); -} - -void Viewer3dSamples::AmbientLight3dSample() -{ - Handle(V3d_AmbientLight) aAmbientLight = - new V3d_AmbientLight(Quantity_NOC_MAGENTA1); - myView->SetLightOn(aAmbientLight); -} - -void Viewer3dSamples::ClearLight3dSample() -{ - // Setting Off all viewer active lights - V3d_ListOfLight aLights; - for(V3d_ListOfLightIterator anIter = myView->Viewer()->ActiveLightIterator(); - anIter.More(); anIter.Next()) - { - aLights.Append(anIter.Value()); - } - - for(V3d_ListOfLightIterator aLightIter(aLights); - aLightIter.More(); aLightIter.Next()) - { - myView->Viewer()->SetLightOff (aLightIter.Value()); - } - // Setting Off all view active lights - aLights.Clear(); - for(V3d_ListOfLightIterator anIter = myView->ActiveLightIterator(); - anIter.More(); anIter.Next()) - { - aLights.Append(anIter.Value()); - } - - for(V3d_ListOfLightIterator aLightIter (aLights); - aLightIter.More(); aLightIter.Next()) - { - myView->SetLightOff (aLightIter.Value()); - } - myView->Viewer()->SetDefaultLights(); // Setting the default lights on - myView->Update(); -} - -void Viewer3dSamples::VerticesSelect3dSample() -{ - myContext->Deactivate(); - myContext->Activate(AIS_Shape::SelectionMode(TopAbs_VERTEX)); -} - -void Viewer3dSamples::EdgesSelect3dSample() -{ - myContext->Deactivate(); - myContext->Activate(AIS_Shape::SelectionMode(TopAbs_EDGE)); -} - -void Viewer3dSamples::FacesSelect3dSample() -{ - myContext->Deactivate(); - myContext->Activate(AIS_Shape::SelectionMode(TopAbs_FACE)); -} - -void Viewer3dSamples::NeutralPointSelect3dSample() -{ - myContext->Deactivate(); - myContext->Activate(0); -} - -void Viewer3dSamples::WireFramePresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetDisplayMode(anAisObject, 0, false); // set wireframe - } - myContext->UpdateCurrentViewer(); -} - -void Viewer3dSamples::ShadingPresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetDisplayMode(anAisObject, 1, false); // set shading - } - myContext->UpdateCurrentViewer(); -} - -void Viewer3dSamples::RedColorPresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - Quantity_Color aShapeColor; - myContext->Color(anAisObject, aShapeColor); - myResult << "A Current shape color: Red = " << aShapeColor.Red() - << " Green = " << aShapeColor.Green() << " Blue = " << aShapeColor.Blue() << std::endl; - aShapeColor.SetValues(0.8, 0.1, 0.1, Quantity_TOC_RGB); - myContext->SetColor(anAisObject, aShapeColor, Standard_False); - myResult << "A New shape color: Red = " << aShapeColor.Red() - << " Green = " << aShapeColor.Green() << " Blue = " << aShapeColor.Blue() << std::endl; - } -} - -void Viewer3dSamples::GrayColorPresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - Quantity_Color aShapeColor; - myContext->Color(anAisObject, aShapeColor); - myResult << "A Current shape color: Hue = " << aShapeColor.Hue() - << " Light = " << aShapeColor.Light() - << " Saturation = " << aShapeColor.Saturation() << std::endl; - aShapeColor.SetValues(0.0, 0.3, 0.1, Quantity_TOC_HLS); - myContext->SetColor(anAisObject, aShapeColor, Standard_False); - myResult << "A New shape color: Hue = " << aShapeColor.Hue() - << " Light = " << aShapeColor.Light() - << " Saturation = " << aShapeColor.Saturation() << std::endl; - } -} - -void Viewer3dSamples::PlasticPresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - Graphic3d_NameOfMaterial aMaterial = Graphic3d_NOM_PLASTIC; - for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetMaterial(anAisObject, aMaterial, Standard_False); - } - myContext->UpdateCurrentViewer(); -} - -void Viewer3dSamples::BronzePresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - Graphic3d_NameOfMaterial aMaterial = Graphic3d_NOM_BRONZE; - for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetMaterial(anAisObject, aMaterial, Standard_False); - } - myContext->UpdateCurrentViewer(); -} - -void Viewer3dSamples::OpaquePresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetTransparency(anAisObject, 0.0, Standard_False); - } - myContext->UpdateCurrentViewer(); -} - -void Viewer3dSamples::HalfTransparencyPresentation3dSample() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - for(AIS_ListOfInteractive::Iterator anIter (anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetTransparency(anAisObject, 0.5, Standard_False); - } - myContext->UpdateCurrentViewer(); -} - -void Viewer3dSamples::VboOn3dSample() -{ - if(Handle(OpenGl_GraphicDriver) aDriver = - Handle(OpenGl_GraphicDriver)::DownCast(myContext->CurrentViewer()->Driver())) - { - aDriver->ChangeOptions().vboDisable = Standard_False; - } -} - -void Viewer3dSamples::VboOff3dSample() -{ - if(Handle(OpenGl_GraphicDriver) aDriver = - Handle(OpenGl_GraphicDriver)::DownCast(myContext->CurrentViewer()->Driver())) - { - aDriver->ChangeOptions().vboDisable = Standard_True; - } -} diff --git a/samples/qt/OCCTOverview/code/Viewer3dSamples.h b/samples/qt/OCCTOverview/code/Viewer3dSamples.h deleted file mode 100644 index 1691736b30..0000000000 --- a/samples/qt/OCCTOverview/code/Viewer3dSamples.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef VIEWER3DSAMPLES_H -#define VIEWER3DSAMPLES_H - -#include "BaseSample.h" - -#include -#include - -//! Implements viewer 3D samples. -class Viewer3dSamples : public BaseSample -{ - DEFINE_STANDARD_RTTI_INLINE(Viewer3dSamples, BaseSample) -public: - - Viewer3dSamples (const TCollection_AsciiString& theSampleSourcePath, - const Handle(V3d_View)& theView, - const Handle(AIS_InteractiveContext)& theContext) - : BaseSample (theSampleSourcePath, theContext), - myView (theView) - {} - - void AppendBottle(); - void ClearExtra(); - -protected: - virtual void ExecuteSample (const TCollection_AsciiString& theSampleName) Standard_OVERRIDE; - -private: - - // One function for every sample - void SpotLight3dSample(); - void PositionalLight3dSample(); - void DirectionalLight3dSample(); - void AmbientLight3dSample(); - void ClearLight3dSample(); - void VerticesSelect3dSample(); - void EdgesSelect3dSample(); - void FacesSelect3dSample(); - void NeutralPointSelect3dSample(); - void WireFramePresentation3dSample(); - void ShadingPresentation3dSample(); - void RedColorPresentation3dSample(); - void GrayColorPresentation3dSample(); - void PlasticPresentation3dSample(); - void BronzePresentation3dSample(); - void OpaquePresentation3dSample(); - void HalfTransparencyPresentation3dSample(); - void VboOn3dSample(); - void VboOff3dSample(); - -private: - - Handle(V3d_View) myView; - -}; - -#endif //VIEWER3DSAMPLES_H diff --git a/samples/qt/OCCTOverview/custom.bat.template b/samples/qt/OCCTOverview/custom.bat.template deleted file mode 100644 index 49dccac5e8..0000000000 --- a/samples/qt/OCCTOverview/custom.bat.template +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -rem Rename this file to custom.bat, -rem define QTDIR variable - path to Qt directory -rem and CASROOT variable - path to Open CASCADE installation directory. - -set "CASROOT=%~dp0../../.." -set "QTDIR=" diff --git a/samples/qt/OCCTOverview/custom.sh.template b/samples/qt/OCCTOverview/custom.sh.template deleted file mode 100644 index 756d3dda9d..0000000000 --- a/samples/qt/OCCTOverview/custom.sh.template +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# Rename this file to custom.sh, -# define QTDIR variable - path to QT directory -# and CASROOT variable - path to CasCade installation directory. - -aScriptPath=${BASH_SOURCE%/*} - -export CASROOT=${aScriptPath}/../../.. -export QTDIR= diff --git a/samples/qt/OCCTOverview/env.bat b/samples/qt/OCCTOverview/env.bat deleted file mode 100644 index 6dc128a1e1..0000000000 --- a/samples/qt/OCCTOverview/env.bat +++ /dev/null @@ -1,32 +0,0 @@ -@echo off - -if exist "%~dp0custom.bat" ( - call "%~dp0custom.bat" %1 %2 %3 -) - -call "%CASROOT%\env.bat" %1 %2 %3 -if /I ["%1"] == ["vc141"] set "VCVER=vc141" -if /I ["%1"] == ["vc142"] set "VCVER=vc142" -if /I ["%1"] == ["vc143"] set "VCVER=vc143" -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -set "LIB_DIR=win%ARCH%\%VCVER%\libd" - -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" - set "LIB_DIR=win%ARCH%\%VCVER%\lib" -) - -set "PATH=%~dp0%BIN_DIR%;%PATH%" - -if not "%QTDIR%" == "" ( - set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res" - - set "CSF_ResourcesDefaults=!RES_DIR!" - set "CSF_TutorialResourcesDefaults=!RES_DIR!" - set "CSF_IEResourcesDefaults=!RES_DIR!" - - set "PATH=%QTDIR%/bin;%PATH%" - set "QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms" -) - -set "CSF_OCCTOverviewSampleCodePath=%~dp0..\..\OCCTOverview\code" diff --git a/samples/qt/OCCTOverview/env.sh b/samples/qt/OCCTOverview/env.sh deleted file mode 100644 index c161ee025b..0000000000 --- a/samples/qt/OCCTOverview/env.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "custom.sh" ]; then - source "custom.sh" $*; -fi - -source ${CASROOT}/bin/env.sh $* - -if [ "${QTDIR}" != "" ]; then - export PATH=${QTDIR}/bin:${PATH} -else - aQMakePath=`which qmake` - echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script." - if [ -x "$aQMakePath" ]; then - echo "qmake from PATH will be used instead." - else - exit 1 - fi -fi - -host=`uname -s` -export STATION=$host -export RES_DIR=${aSamplePath}/${STATION}/res diff --git a/samples/qt/OCCTOverview/genproj.bat b/samples/qt/OCCTOverview/genproj.bat deleted file mode 100644 index f3670f3eae..0000000000 --- a/samples/qt/OCCTOverview/genproj.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -REM Generation of vcproj files with qmake utilite -REM Variable QTDIR and PATH to qmake executable must be defined without fail - -REM Use first argument to specify version of Visual Studio (vc10, vc11, vc12 or vc14), -REM second argument specifies architecture) (win32 or win64) -REM third argument specifies Debug or Release mode - -call "%~dp0env.bat" %1 %2 %3 - -if ["%VCARCH%"] == [""] set "VCARCH=%ARCH%" -if ["%VCARCH%"] == ["64"] set "VCARCH=amd64" -if ["%VCARCH%"] == ["32"] set "VCARCH=x86" - -call "%VCVARS%" %VCARCH% - -qmake -tp vc -r -o OCCTOverview.sln OCCTOverview0.pro diff --git a/samples/qt/OCCTOverview/images/sample_overview_qt.png b/samples/qt/OCCTOverview/images/sample_overview_qt.png deleted file mode 100644 index 76850440a9..0000000000 Binary files a/samples/qt/OCCTOverview/images/sample_overview_qt.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/make.sh b/samples/qt/OCCTOverview/make.sh deleted file mode 100644 index 421dc19817..0000000000 --- a/samples/qt/OCCTOverview/make.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi - -cd $aSamplePath -qmake OCCTOverview.pro -if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then - aNbJobs="$(getconf _NPROCESSORS_ONLN)" - if [ "${CASDEB}" == "d" ]; then - make -j $aNbJobs debug - else - make -j $aNbJobs release - fi -fi diff --git a/samples/qt/OCCTOverview/msvc.bat b/samples/qt/OCCTOverview/msvc.bat deleted file mode 100644 index 6164118ece..0000000000 --- a/samples/qt/OCCTOverview/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0OCCTOverview.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/qt/OCCTOverview/res/antialiasing.png b/samples/qt/OCCTOverview/res/antialiasing.png deleted file mode 100644 index da8e5047a4..0000000000 Binary files a/samples/qt/OCCTOverview/res/antialiasing.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/cursor_rotate.png b/samples/qt/OCCTOverview/res/cursor_rotate.png deleted file mode 100644 index a3cb0c1ecc..0000000000 Binary files a/samples/qt/OCCTOverview/res/cursor_rotate.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/cursor_zoom.png b/samples/qt/OCCTOverview/res/cursor_zoom.png deleted file mode 100644 index 0020fea39f..0000000000 Binary files a/samples/qt/OCCTOverview/res/cursor_zoom.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/help.png b/samples/qt/OCCTOverview/res/help.png deleted file mode 100644 index e57336285e..0000000000 Binary files a/samples/qt/OCCTOverview/res/help.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/lamp.png b/samples/qt/OCCTOverview/res/lamp.png deleted file mode 100644 index a5a6775c33..0000000000 Binary files a/samples/qt/OCCTOverview/res/lamp.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/raytracing.png b/samples/qt/OCCTOverview/res/raytracing.png deleted file mode 100644 index 211e697237..0000000000 Binary files a/samples/qt/OCCTOverview/res/raytracing.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/reflections.png b/samples/qt/OCCTOverview/res/reflections.png deleted file mode 100644 index ad48a95615..0000000000 Binary files a/samples/qt/OCCTOverview/res/reflections.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/shadows.png b/samples/qt/OCCTOverview/res/shadows.png deleted file mode 100644 index 7562c12918..0000000000 Binary files a/samples/qt/OCCTOverview/res/shadows.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/tool_color.png b/samples/qt/OCCTOverview/res/tool_color.png deleted file mode 100644 index 0daa160caf..0000000000 Binary files a/samples/qt/OCCTOverview/res/tool_color.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/tool_delete.png b/samples/qt/OCCTOverview/res/tool_delete.png deleted file mode 100644 index 3886af51d8..0000000000 Binary files a/samples/qt/OCCTOverview/res/tool_delete.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/tool_material.png b/samples/qt/OCCTOverview/res/tool_material.png deleted file mode 100644 index f846a56371..0000000000 Binary files a/samples/qt/OCCTOverview/res/tool_material.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/tool_shading.png b/samples/qt/OCCTOverview/res/tool_shading.png deleted file mode 100644 index 6bb9dc46de..0000000000 Binary files a/samples/qt/OCCTOverview/res/tool_shading.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/tool_transparency.png b/samples/qt/OCCTOverview/res/tool_transparency.png deleted file mode 100644 index 786803a5cf..0000000000 Binary files a/samples/qt/OCCTOverview/res/tool_transparency.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/tool_wireframe.png b/samples/qt/OCCTOverview/res/tool_wireframe.png deleted file mode 100644 index 32ad5248ae..0000000000 Binary files a/samples/qt/OCCTOverview/res/tool_wireframe.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_axo.png b/samples/qt/OCCTOverview/res/view_axo.png deleted file mode 100644 index 4801ab4592..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_axo.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_back.png b/samples/qt/OCCTOverview/res/view_back.png deleted file mode 100644 index 0798f52938..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_back.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_bottom.png b/samples/qt/OCCTOverview/res/view_bottom.png deleted file mode 100644 index c7cfdc208a..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_bottom.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_comp_off.png b/samples/qt/OCCTOverview/res/view_comp_off.png deleted file mode 100644 index c900b196f0..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_comp_off.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_comp_on.png b/samples/qt/OCCTOverview/res/view_comp_on.png deleted file mode 100644 index 73ca4c83d0..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_comp_on.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_fitall.png b/samples/qt/OCCTOverview/res/view_fitall.png deleted file mode 100644 index 21d2f423ef..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_fitall.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_front.png b/samples/qt/OCCTOverview/res/view_front.png deleted file mode 100644 index a9e99c59b6..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_front.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_left.png b/samples/qt/OCCTOverview/res/view_left.png deleted file mode 100644 index 7d25b6ab2f..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_left.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_reset.png b/samples/qt/OCCTOverview/res/view_reset.png deleted file mode 100644 index 38849fd694..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_reset.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_right.png b/samples/qt/OCCTOverview/res/view_right.png deleted file mode 100644 index 5540220cfa..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_right.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/res/view_top.png b/samples/qt/OCCTOverview/res/view_top.png deleted file mode 100644 index b788de36fb..0000000000 Binary files a/samples/qt/OCCTOverview/res/view_top.png and /dev/null differ diff --git a/samples/qt/OCCTOverview/run.bat b/samples/qt/OCCTOverview/run.bat deleted file mode 100644 index 6c7bcbe24c..0000000000 --- a/samples/qt/OCCTOverview/run.bat +++ /dev/null @@ -1,23 +0,0 @@ -Setlocal EnableDelayedExpansion - -call "%~dp0env.bat" %1 %2 %3 %4 - -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" -) - -if not exist "%~dp0%BIN_DIR%\OCCTOverview.exe" goto ERR_EXE - -echo Starting OCCTOverview ..... -"%~dp0%BIN_DIR%\OCCTOverview.exe" %4 - -goto END - -:ERR_EXE -echo Executable %~dp0%BIN_DIR%\OCCTOverview.exe not found. -echo Probably you didn't compile the application. -pause -goto END - -:END \ No newline at end of file diff --git a/samples/qt/OCCTOverview/run.sh b/samples/qt/OCCTOverview/run.sh deleted file mode 100644 index 7abe6f12a4..0000000000 --- a/samples/qt/OCCTOverview/run.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath - -aSystem=`uname -s` -if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - if [ "${CASDEB}" == "d" ]; then - BIN_DIR="${aSamplePath}/build/Debug/OCCTOverview.app/Contents/MacOS" - else - BIN_DIR="${aSamplePath}/build/Release/OCCTOverview.app/Contents/MacOS" - fi -else - BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}" -fi - -CSF_ResourcesDefaults="${RES_DIR}" -CSF_TutorialResourcesDefaults="${RES_DIR}" - -PATH="${BIN_DIR}:${PATH}" - -export CSF_TutorialResourcesDefaults CSF_ResourcesDefaults -export PATH - -if test ! -r "${BIN_DIR}/OCCTOverview"; then - echo "Executable \"${BIN_DIR}/OCCTOverview\" not found." - if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - echo "Probably you don't compile the application. Build it with Xcode." - else - echo "Probably you don't compile the application. Execute \"make\"." - fi - exit 1 -fi - -${BIN_DIR}/OCCTOverview diff --git a/samples/qt/OCCTOverview/src/ApplicationCommon.cxx b/samples/qt/OCCTOverview/src/ApplicationCommon.cxx deleted file mode 100644 index 5754c96e96..0000000000 --- a/samples/qt/OCCTOverview/src/ApplicationCommon.cxx +++ /dev/null @@ -1,692 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "ApplicationCommon.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -ApplicationCommonWindow::ApplicationCommonWindow (ApplicationType theCategory) -: QMainWindow (nullptr), - myAppType(theCategory), - myStdToolBar (nullptr), - myViewBar (nullptr), - myCasCadeBar (nullptr), - myFilePopup (nullptr), - myCategoryPopup (nullptr) -{ - ALL_CATEGORIES[AppType_Geometry] = "Geometry"; - ALL_CATEGORIES[AppType_Topology] = "Topology"; - ALL_CATEGORIES[AppType_Triangulation] = "Triangulation"; - ALL_CATEGORIES[AppType_DataExchange] = "DataExchange"; - ALL_CATEGORIES[AppType_Ocaf] = "OCAF"; - ALL_CATEGORIES[AppType_Viewer3d] = "3D viewer"; - ALL_CATEGORIES[AppType_Viewer2d] = "2D Viewer"; - - mySampleMapper = new QSignalMapper(this); - myExchangeMapper = new QSignalMapper(this); - myOcafMapper = new QSignalMapper(this); - myViewer3dMapper = new QSignalMapper(this); - myViewer2dMapper = new QSignalMapper(this); - - myCategoryMapper = new QSignalMapper(this); - - connect(mySampleMapper, SIGNAL(mapped(const QString &)), this, SLOT(onProcessSample(const QString &))); - connect(myExchangeMapper, SIGNAL(mapped(const QString &)), this, SLOT(onProcessExchange(const QString &))); - connect(myOcafMapper, SIGNAL(mapped(const QString &)), this, SLOT(onProcessOcaf(const QString &))); - connect(myViewer3dMapper, SIGNAL(mapped(const QString &)), this, SLOT(onProcessViewer3d(const QString &))); - connect(myViewer2dMapper, SIGNAL(mapped(const QString &)), this, SLOT(onProcessViewer2d(const QString &))); - - connect(myCategoryMapper, SIGNAL(mapped(const QString &)), this, SLOT(onChangeCategory(const QString &))); - - setFocusPolicy(Qt::StrongFocus); - - QFont aCodeViewFont; - aCodeViewFont.setFamily("Courier"); - aCodeViewFont.setFixedPitch(true); - aCodeViewFont.setPointSize(10); - - QGroupBox* aCodeFrame = new QGroupBox(tr("Sample code")); - QVBoxLayout* aCodeLayout = new QVBoxLayout(aCodeFrame); - aCodeLayout->setContentsMargins(3, 3, 3, 3); - myCodeView = new QTextEdit(aCodeFrame); - aCodeLayout->addWidget(myCodeView); - myCodeView->setDocumentTitle("Code"); - myCodeView->setLineWrapMode(QTextEdit::NoWrap); - myCodeView->setReadOnly(true); - myCodeView->setFont(aCodeViewFont); - myCodeViewHighlighter = new OcctHighlighter(myCodeView->document()); - - QGroupBox* aResultFrame = new QGroupBox(tr("Output")); - QVBoxLayout* aResultLayout = new QVBoxLayout(aResultFrame); - aResultLayout->setContentsMargins(3, 3, 3, 3); - myResultView = new QTextEdit(aResultFrame); - aResultLayout->addWidget(myResultView); - myResultView->setDocumentTitle("Output"); - myResultView->setReadOnly(true); - myResultView->setFont(aCodeViewFont); - - QSplitter* aCodeResultSplitter = new QSplitter(Qt::Vertical); - aCodeResultSplitter->addWidget(aCodeFrame); - aCodeResultSplitter->addWidget(aResultFrame); - - myDocument3d = createNewDocument(); - myDocument2d = createNewDocument(); - - QFrame* aViewFrame = new QFrame; - aViewFrame->setFrameStyle(QFrame::Panel | QFrame::Sunken); - aViewFrame->setLineWidth(3); - QVBoxLayout* aViewLayout = new QVBoxLayout(aViewFrame); - aViewLayout->setContentsMargins(0, 0, 0, 0); - myGeomWidget = new GeomWidget(myDocument3d, myDocument2d, aViewFrame); - aViewLayout->addWidget(myGeomWidget); - - myGeomWidget->setContentsMargins(0, 0, 0, 0); - QSplitter* aGeomTextSplitter = new QSplitter(Qt::Horizontal); - - aGeomTextSplitter->addWidget(aViewFrame); - aGeomTextSplitter->addWidget(aCodeResultSplitter); - aGeomTextSplitter->setStretchFactor(0, 1); - aGeomTextSplitter->setStretchFactor(1, 1); - QList aSizeList; - aSizeList.append(640); - aSizeList.append(640); - aGeomTextSplitter->setSizes(aSizeList); - setCentralWidget(aGeomTextSplitter); - -#include - Q_INIT_RESOURCE(Samples); -#include - - TCollection_AsciiString aSampleSourcePach = getSampleSourceDir(); - myGeometrySamples = new GeometrySamples(aSampleSourcePach, - myDocument3d->getContext()); - myTopologySamples = new TopologySamples(aSampleSourcePach, - myDocument3d->getContext()); - myTriangulationSamples = new TriangulationSamples(aSampleSourcePach, - myDocument3d->getContext()); - myDataExchangeSamples = new DataExchangeSamples(aSampleSourcePach, - myGeomWidget->Get3dView(), - myDocument3d->getContext()); - myOcafSamples = new OcafSamples(aSampleSourcePach, - myDocument3d->getViewer(), - myDocument3d->getContext()); - myViewer3dSamples = new Viewer3dSamples(aSampleSourcePach, - myGeomWidget->Get3dView(), - myDocument3d->getContext()); - myViewer2dSamples = new Viewer2dSamples(aSampleSourcePach, - myGeomWidget->Get2dView(), - myDocument2d->getViewer(), - myDocument2d->getContext()); - - - MenuFormXml(":/menus/Geometry.xml", mySampleMapper, myGeometryMenus); - MenuFormXml(":/menus/Topology.xml", mySampleMapper, myTopologyMenus); - MenuFormXml(":/menus/Triangulation.xml", mySampleMapper, myTriangulationMenus); - MenuFormXml(":/menus/DataExchange.xml", myExchangeMapper, myDataExchangeMenus); - MenuFormXml(":/menus/Ocaf.xml", myOcafMapper, myOcafMenus); - MenuFormXml(":/menus/Viewer3d.xml", myViewer3dMapper, myViewer3dMenus); - MenuFormXml(":/menus/Viewer2d.xml", myViewer2dMapper, myViewer2dMenus); - - onChangeCategory(ALL_CATEGORIES[myAppType]); - - resize(1280, 560); -} - -void ApplicationCommonWindow::RebuildMenu() -{ - menuBar()->clear(); - - myStdActions[StdActions_FileQuit] = CreateAction("Quit", "CTRL+Q"); - connect(myStdActions[StdActions_FileQuit], SIGNAL(triggered()), this, SLOT(onCloseAllWindows())); - myStdActions[StdActions_HelpAbout] = CreateAction("About", "F1", ":/icons/help.png"); - connect(myStdActions[StdActions_HelpAbout], SIGNAL(triggered()), this, SLOT(onAbout())); - - // populate a menu with all actions - myFilePopup = new QMenu(this); - myFilePopup = menuBar()->addMenu(tr("&File")); - myFilePopup->addAction(myStdActions[StdActions_FileQuit]); - - myCategoryPopup = new QMenu(this); - myCategoryPopup = menuBar()->addMenu(tr("&Category")); - - foreach (ApplicationType aCategory, ALL_CATEGORIES.keys()) - { - QString aCategoryName = ALL_CATEGORIES.value(aCategory); - QAction* anAction = myCategoryPopup->addAction(aCategoryName); - anAction->setText(aCategoryName); - myCategoryMapper->setMapping(anAction, aCategoryName); - connect(anAction, SIGNAL(triggered()), myCategoryMapper, SLOT(map())); - myCategoryPopup->addAction(anAction); - myCategoryActions.insert(aCategory, anAction); - } - - foreach (QMenu* aSampleMenu, GetCurrentMenus()) - { - menuBar()->addMenu(aSampleMenu); - } - - // add a help menu - QMenu* aHelp = new QMenu(this); - menuBar()->addSeparator(); - aHelp = menuBar()->addMenu(tr("&Help")); - aHelp->addAction(myStdActions[StdActions_HelpAbout]); -} - -Handle(BaseSample) ApplicationCommonWindow::GetCurrentSamples() -{ - switch (myAppType) - { - case AppType_Geometry: return myGeometrySamples; - case AppType_Topology: return myTopologySamples; - case AppType_Triangulation: return myTriangulationSamples; - case AppType_DataExchange: return myDataExchangeSamples; - case AppType_Ocaf: return myOcafSamples; - case AppType_Viewer2d: return myViewer2dSamples; - case AppType_Viewer3d: return myViewer3dSamples; - case AppType_Unknown: - break; - } - throw QString("Unknown Application type"); -} - -const QList& ApplicationCommonWindow::GetCurrentMenus() -{ - switch (myAppType) - { - case AppType_Geometry: return myGeometryMenus; - case AppType_Topology: return myTopologyMenus; - case AppType_Triangulation: return myTriangulationMenus; - case AppType_DataExchange: return myDataExchangeMenus; - case AppType_Ocaf: return myOcafMenus; - case AppType_Viewer2d: return myViewer2dMenus; - case AppType_Viewer3d: return myViewer3dMenus; - case AppType_Unknown: - break; - } - throw QString("Unknown Application type"); -} - -DocumentCommon* ApplicationCommonWindow::createNewDocument() -{ - return new DocumentCommon(this); -} - -void ApplicationCommonWindow::onChangeCategory(const QString& theCategory) -{ - myAppType = ALL_CATEGORIES.key(theCategory); - setWindowTitle(ALL_CATEGORIES[myAppType]); - - myOcafSamples->ClearExtra(); - myViewer3dSamples->ClearExtra(); - myViewer2dSamples->ClearExtra(); - - GetCurrentSamples()->Clear(); - myDocument3d->Clear(); - myDocument2d->Clear(); - - myCodeView->setPlainText(""); - myResultView->setPlainText(""); - GetCurrentSamples()->AppendCube(); - myDocument3d->SetObjects(GetCurrentSamples()->Get3dObjects()); - myGeomWidget->FitAll(); - - RebuildMenu(); - - switch (myAppType) - { - case AppType_DataExchange: - { - myDataExchangeSamples->AppendBottle(); - myDocument3d->SetObjects(GetCurrentSamples()->Get3dObjects()); - myGeomWidget->Show3d(); - break; - } - case AppType_Ocaf: - { - onProcessOcaf("CreateOcafDocument"); - myGeomWidget->Show3d(); - break; - } - case AppType_Viewer2d: - { - myGeomWidget->Show2d(); - break; - } - case AppType_Viewer3d: - { - myViewer3dSamples->AppendBottle(); - myDocument3d->SetObjects(GetCurrentSamples()->Get3dObjects()); - myGeomWidget->Show3d(); - break; - } - case AppType_Geometry: - case AppType_Topology: - case AppType_Triangulation: - case AppType_Unknown: - { - break; - } - } -} - -void ApplicationCommonWindow::onAbout() -{ - QMessageBox::information(this, tr("OCCT Overview"), - tr("Qt based application to study OpenCASCADE Technology"), - tr("Ok"), QString::null, QString::null, 0, 0); -} - -TCollection_AsciiString ApplicationCommonWindow::getSampleSourceDir() -{ - TCollection_AsciiString aSampleSourceDir = OSD_Environment("CSF_OCCTOverviewSampleCodePath").Value(); - if (aSampleSourceDir.IsEmpty()) - { - TCollection_AsciiString aCasRoot = OSD_Environment("CASROOT").Value(); - if (!aCasRoot.IsEmpty()) - { - aSampleSourceDir = aCasRoot + "/samples/qt/OCCTOverview/code"; - } - } - return aSampleSourceDir; -} - -QAction* ApplicationCommonWindow::CreateAction (const QString& theActionName, - const QString& theShortcut, - const QString& theIconName) -{ - QAction* aAction(NULL); - if (theIconName.isEmpty()) - { - aAction = new QAction(theActionName, this); - } - else - { - QPixmap aIcon = QPixmap(theIconName); - aAction = new QAction(aIcon, theActionName, this); - } - aAction->setToolTip(theActionName); - aAction->setStatusTip(theActionName); - aAction->setShortcut(theShortcut); - - return aAction; -} - -template -QAction* ApplicationCommonWindow::CreateSample (PointerToMemberFunction theHandlerMethod, - const char* theActionName) -{ - QAction* anAction = new QAction(QObject::tr(theActionName), this); - connect(anAction, SIGNAL(triggered()), this, SLOT(theHandlerMethod())); - return anAction; -} - -void ApplicationCommonWindow::resizeEvent(QResizeEvent* e) -{ - QMainWindow::resizeEvent(e); - statusBar()->setSizeGripEnabled(!isMaximized()); -} - -void ApplicationCommonWindow::onProcessSample(const QString& theSampleName) -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - setWindowTitle(ALL_CATEGORIES[myAppType] + " - " + theSampleName); - GetCurrentSamples()->Process(theSampleName.toUtf8().data()); - myDocument3d->SetObjects(GetCurrentSamples()->Get3dObjects()); - myDocument2d->SetObjects(GetCurrentSamples()->Get2dObjects()); - myCodeView->setPlainText(GetCurrentSamples()->GetCode().ToCString()); - myResultView->setPlainText(GetCurrentSamples()->GetResult().ToCString()); - myGeomWidget->FitAll(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationCommonWindow::onProcessExchange(const QString& theSampleName) -{ - setWindowTitle(ALL_CATEGORIES[myAppType] + " - " + theSampleName); - int aMode = 0; - QString aFileName = selectFileName(theSampleName, getDataExchangeDialog(theSampleName), aMode); - if (aFileName.isEmpty()) - { - return; - } - - QApplication::setOverrideCursor(Qt::WaitCursor); - myDataExchangeSamples->SetFileName(aFileName.toUtf8().data()); - myDataExchangeSamples->SetStepType(static_cast(aMode)); - myDataExchangeSamples->Process(theSampleName.toUtf8().data()); - myDocument3d->SetObjects(myDataExchangeSamples->Get3dObjects()); - myDocument2d->SetObjects(myDataExchangeSamples->Get2dObjects()); - myCodeView->setPlainText(myDataExchangeSamples->GetCode().ToCString()); - myResultView->setPlainText(myDataExchangeSamples->GetResult().ToCString()); - myGeomWidget->FitAll(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationCommonWindow::onProcessOcaf(const QString& theSampleName) -{ - setWindowTitle(ALL_CATEGORIES[myAppType] + " - " + theSampleName); - - if (theSampleName.indexOf("Dialog") == 0) - { - int aMode = 0; // not used - QString aFileName = selectFileName(theSampleName, getOcafDialog(theSampleName), aMode); - if (aFileName.isEmpty()) - { - return; - } - myOcafSamples->SetFileName(aFileName.toUtf8().data()); - } - QApplication::setOverrideCursor(Qt::WaitCursor); - myOcafSamples->Process(theSampleName.toUtf8().data()); - myDocument2d->SetObjects(myOcafSamples->Get2dObjects()); - myCodeView->setPlainText(myOcafSamples->GetCode().ToCString()); - myResultView->setPlainText(myOcafSamples->GetResult().ToCString()); - QApplication::restoreOverrideCursor(); -} - -void ApplicationCommonWindow::onProcessViewer3d(const QString& theSampleName) -{ - setWindowTitle(ALL_CATEGORIES[myAppType] + " - " + theSampleName); - - QApplication::setOverrideCursor(Qt::WaitCursor); - myViewer3dSamples->Process(theSampleName.toUtf8().data()); - myCodeView->setPlainText(myViewer3dSamples->GetCode().ToCString()); - myResultView->setPlainText(myViewer3dSamples->GetResult().ToCString()); - myGeomWidget->FitAll(); - QApplication::restoreOverrideCursor(); -} - -void ApplicationCommonWindow::onProcessViewer2d(const QString& theSampleName) -{ - setWindowTitle(ALL_CATEGORIES[myAppType] + " - " + theSampleName); - - Standard_Boolean anIsFileSample = Viewer2dSamples::IsFileSample(theSampleName.toUtf8().data()); - QString aFileName; - if (anIsFileSample) - { - int aMode = 0; // not used - aFileName = selectFileName(theSampleName, getOcafDialog(theSampleName), aMode); - if (aFileName.isEmpty()) - { - return; - } - - myViewer2dSamples->SetFileName(aFileName.toUtf8().data()); - } - if (!anIsFileSample || (anIsFileSample && !aFileName.isEmpty())) - { - QApplication::setOverrideCursor(Qt::WaitCursor); - myViewer2dSamples->Process(theSampleName.toUtf8().data()); - if (!Viewer2dSamples::IsShadedSample(theSampleName.toUtf8().data())) - { - myDocument2d->SetObjects(myViewer2dSamples->Get2dObjects(), Standard_False); - } - else - { - myDocument2d->SetObjects(myViewer2dSamples->Get2dObjects(), Standard_True); - } - myCodeView->setPlainText(myViewer2dSamples->GetCode().ToCString()); - myResultView->setPlainText(myViewer2dSamples->GetResult().ToCString()); - myGeomWidget->Show2d(); - QApplication::restoreOverrideCursor(); - } - else - { - myResultView->setPlainText("No file selected!"); - } -} - -QString ApplicationCommonWindow::selectFileName(const QString& theSampleName, - TranslateDialog* theDialog, int& theMode) -{ - Q_UNUSED(theSampleName) - - std::shared_ptr aDialog(theDialog); - - int ret = aDialog->exec(); - theMode = aDialog->getMode(); - - qApp->processEvents(); - - QString aFilename; - QStringList aFileNameList; - if (ret != QDialog::Accepted) - { - return aFilename; - } - aFileNameList = aDialog->selectedFiles(); - if (!aFileNameList.isEmpty()) - { - aFilename = aFileNameList[0]; - } - - if (!QFileInfo(aFilename).completeSuffix().length()) - { - QString selFilter = aDialog->selectedNameFilter(); - int idx = selFilter.indexOf("(*."); - if (idx != -1) - { - QString tail = selFilter.mid(idx + 3); - idx = tail.indexOf(" "); - if (idx == -1) - { - idx = tail.indexOf(")"); - } - QString ext = tail.left(idx); - if (ext.length()) - { - aFilename += QString(".") + ext; - } - } - } - - return aFilename; -} - -TranslateDialog* ApplicationCommonWindow::getDataExchangeDialog(const QString& theSampleName) -{ - TranslateDialog* aTranslateDialog = new TranslateDialog(this, 0, true); - TCollection_AsciiString aSampleName(theSampleName.toUtf8().data()); - - if (DataExchangeSamples::IsExportSample(aSampleName)) - { - aTranslateDialog->setWindowTitle("Export file"); - aTranslateDialog->setFileMode(QFileDialog::AnyFile); - aTranslateDialog->setAcceptMode(QFileDialog::AcceptSave); - } - else if (DataExchangeSamples::IsImportSample(aSampleName)) - { - aTranslateDialog->setWindowTitle("Import file"); - aTranslateDialog->setFileMode(QFileDialog::ExistingFile); - aTranslateDialog->setAcceptMode(QFileDialog::AcceptOpen); - } - QString aFormatFilter; - if (DataExchangeSamples::IsBrepSample(aSampleName)) - { - aFormatFilter = "BREP Files(*.brep *.rle)"; - } - else if (DataExchangeSamples::IsStepSample(aSampleName)) - { - aFormatFilter = "STEP Files (*.stp *.step)"; - aTranslateDialog->addMode(STEPControl_ManifoldSolidBrep, "Manifold Solid Brep"); - aTranslateDialog->addMode(STEPControl_FacetedBrep, "Faceted Brep"); - aTranslateDialog->addMode(STEPControl_ShellBasedSurfaceModel, "Shell Based Surface Model"); - aTranslateDialog->addMode(STEPControl_GeometricCurveSet, "Geometric Curve Set"); - } - else if (DataExchangeSamples::IsIgesSample(aSampleName)) - { - aFormatFilter = "IGES Files (*.igs *.iges)"; - } - else if (DataExchangeSamples::IsStlSample(aSampleName)) - { - aFormatFilter = "STL Files (*.stl)"; - } - else if (DataExchangeSamples::IsVrmlSample(aSampleName)) - { - aFormatFilter = "VRML Files (*.vrml)"; - } - else if (DataExchangeSamples::IsImageSample(aSampleName)) - { - aFormatFilter = "All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)"; - } - QStringList aFilters; - aFilters.append(aFormatFilter); - aFilters.append("All Files(*.*)"); - - aTranslateDialog->setNameFilters(aFilters); - aTranslateDialog->clear(); - return aTranslateDialog; -} - -TranslateDialog* ApplicationCommonWindow::getOcafDialog(const QString& theSampleName) -{ - TranslateDialog* aTranslateDialog = new TranslateDialog(this, 0, true); - TCollection_AsciiString aSampleName(theSampleName.toUtf8().data()); - - if (OcafSamples::IsExportSample(aSampleName)) - { - aTranslateDialog->setWindowTitle("Export file"); - aTranslateDialog->setFileMode(QFileDialog::AnyFile); - aTranslateDialog->setAcceptMode(QFileDialog::AcceptSave); - } - else if (OcafSamples::IsImportSample(aSampleName)) - { - aTranslateDialog->setWindowTitle("Import file"); - aTranslateDialog->setFileMode(QFileDialog::ExistingFile); - aTranslateDialog->setAcceptMode(QFileDialog::AcceptOpen); - } - QStringList aFilters; - if (OcafSamples::IsBinarySample(aSampleName)) - { - aFilters.append("Binary OCAF Sample (*.cbf)"); - } - if (OcafSamples::IsXmlSample(aSampleName)) - { - aFilters.append("XML OCAF Sample (*.xml)"); - } - aFilters.append("All Files(*.*)"); - - aTranslateDialog->setNameFilters(aFilters); - aTranslateDialog->clear(); - return aTranslateDialog; -} - -QMenu* ApplicationCommonWindow::MenuFromDomNode(QDomElement& theItemElement, - QWidget* theParent, - QSignalMapper* theMapper) -{ - QString anItemName = theItemElement.attribute("name"); - QMenu* aMenu = new QMenu(anItemName, theParent); - QDomElement anChildItemElement = theItemElement.firstChildElement("MenuItem"); - QDomElement anSampleElement = theItemElement.firstChildElement("Sample"); - - while(anChildItemElement.isElement()) - { - aMenu->addMenu(MenuFromDomNode(anChildItemElement, aMenu, theMapper)); - anChildItemElement = anChildItemElement.nextSibling().toElement(); - } - - while(anSampleElement.isElement()) - { - QString aSampleName = anSampleElement.attribute("name"); - QString aSampleFunction = anSampleElement.attribute("function"); - QAction* anAction = aMenu->addAction(aSampleFunction); - anAction->setText(aSampleName); - theMapper->setMapping(anAction, aSampleFunction); - connect(anAction, SIGNAL(triggered()), theMapper, SLOT(map())); - anSampleElement = anSampleElement.nextSibling().toElement(); - } - return aMenu; -} - -void ApplicationCommonWindow::MenuFormXml(const QString& thePath, - QSignalMapper* theMapper, - QList& theMunusList) -{ - QDomDocument aDomDocument; - theMunusList.clear(); - QFile aXmlFile(thePath); - QString anErrorMessage; - if (aXmlFile.error() != QFile::NoError) - { - anErrorMessage = aXmlFile.errorString(); - Message::SendFail() << "QFile creating error: " << anErrorMessage.toUtf8().constData(); - aXmlFile.close(); - return; - } - if (!aXmlFile.open(QIODevice::ReadOnly | QIODevice::Text)) - { - Message::SendFail() << "File " << thePath.toUtf8().constData() << " could not open"; - if (aXmlFile.error() != QFile::NoError) - { - anErrorMessage = aXmlFile.errorString(); - Message::SendFail() << "QFile opening error: " << anErrorMessage.toUtf8().constData(); - } - aXmlFile.close(); - return; - } - bool aNamespaceProcessing(false); - QString anErrorMsg; - int anErrorLine(0); - int anErrorColumn(0); - if (!aDomDocument.setContent(&aXmlFile, aNamespaceProcessing, &anErrorMsg, &anErrorLine, &anErrorColumn)) - { - Message::SendFail() << "XML file parsing error: " << anErrorMsg.toStdString() - << " at line: " << anErrorLine << " column: " << anErrorColumn; - aXmlFile.close(); - return; - } - aXmlFile.close(); - - QDomElement aRootElement = aDomDocument.documentElement(); - QDomElement anItemElement = aRootElement.firstChildElement("MenuItem"); - while(!anItemElement.isNull()) - { - theMunusList.push_back(MenuFromDomNode(anItemElement, this, theMapper)); - anItemElement = anItemElement.nextSiblingElement("MenuItem"); - } -} diff --git a/samples/qt/OCCTOverview/src/ApplicationCommon.h b/samples/qt/OCCTOverview/src/ApplicationCommon.h deleted file mode 100644 index a93dd3e4dc..0000000000 --- a/samples/qt/OCCTOverview/src/ApplicationCommon.h +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef APPLICATION_COMMON_OVERVIEW_H -#define APPLICATION_COMMON_OVERVIEW_H - -#include "BaseSample.h" -#include "CommonSample.h" -#include "DataExchangeSamples.h" -#include "DocumentCommon.h" -#include "GeometrySamples.h" -#include "GeomWidget.h" -#include "OcafSamples.h" -#include "OcctHighlighter.h" -#include "TopologySamples.h" -#include "TranslateDialog.h" -#include "TriangulationSamples.h" -#include "View.h" -#include "Viewer2dSamples.h" -#include "Viewer3dSamples.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum StdActions -{ - StdActions_FileQuit, - StdActions_HelpAbout -}; - -enum ApplicationType -{ - AppType_Geometry, - AppType_Topology, - AppType_Triangulation, - AppType_DataExchange, - AppType_Ocaf, - AppType_Viewer2d, - AppType_Viewer3d, - AppType_Unknown -}; - - -//! Main application window -class ApplicationCommonWindow: public QMainWindow -{ - Q_OBJECT - -public: - ApplicationCommonWindow(ApplicationType theCategory); - - ApplicationType GetApplicationType() const { return myAppType; } - void SetApplicationType(ApplicationType theApplicationType) { myAppType = theApplicationType; } - - static TCollection_AsciiString getSampleSourceDir(); - -protected: - virtual DocumentCommon* createNewDocument(); - -public slots: - virtual void onAbout(); - virtual void onChangeCategory(const QString& theCategory); - -protected: - QAction* CreateAction(const QString& theActionName, - const QString& theShortcut = "", - const QString& theIconName = ""); - - template - QAction* CreateSample(PointerToMemberFunction theHandlerMethod, - const char* theActionName); - - virtual void resizeEvent( QResizeEvent* ); - QMenu* getFilePopup() { return myFilePopup; } - QToolBar* getCasCadeBar() { return myCasCadeBar; } - - void MenuFormXml (const QString& thePath, - QSignalMapper* theMapper, - QList& theMunusList); - QMenu* MenuFromDomNode(QDomElement& theItemElement, - QWidget* theParent, - QSignalMapper* theMapper); - - -private slots: - void onCloseAllWindows() { qApp->closeAllWindows(); } - - void onProcessSample(const QString& theSampleName); - void onProcessExchange(const QString& theSampleName); - void onProcessOcaf(const QString& theSampleName); - void onProcessViewer3d(const QString& theSampleName); - void onProcessViewer2d(const QString& theSampleName); - -private: - - void RebuildMenu(); - Handle(BaseSample) GetCurrentSamples(); - const QList& GetCurrentMenus(); - - QString selectFileName(const QString& theSampleName, TranslateDialog* theDialog, int& theMode); - TranslateDialog* getDataExchangeDialog(const QString& theSampleName); - TranslateDialog* getOcafDialog(const QString& theSampleName); - -private: - ApplicationType myAppType; - QMap ALL_CATEGORIES; - - Handle(GeometrySamples) myGeometrySamples; - Handle(TopologySamples) myTopologySamples; - Handle(TriangulationSamples) myTriangulationSamples; - Handle(DataExchangeSamples) myDataExchangeSamples; - Handle(OcafSamples) myOcafSamples; - Handle(Viewer3dSamples) myViewer3dSamples; - Handle(Viewer2dSamples) myViewer2dSamples; - - QMap myStdActions; - QMap myCategoryActions; - QMap myMaterialActions; - - QToolBar* myStdToolBar; - QToolBar* myViewBar; - QToolBar* myCasCadeBar; - QMenu* myFilePopup; - QMenu* myCategoryPopup; - - QList myGeometryMenus; - QList myTopologyMenus; - QList myTriangulationMenus; - QList myDataExchangeMenus; - QList myOcafMenus; - QList myViewer3dMenus; - QList myViewer2dMenus; - - QSignalMapper* mySampleMapper; - QSignalMapper* myExchangeMapper; - QSignalMapper* myOcafMapper; - QSignalMapper* myViewer3dMapper; - QSignalMapper* myViewer2dMapper; - - QSignalMapper* myCategoryMapper; - - QTextEdit* myCodeView; - QTextEdit* myResultView; - OcctHighlighter* myCodeViewHighlighter; - - GeomWidget* myGeomWidget; - - DocumentCommon* myDocument3d; - DocumentCommon* myDocument2d; -}; - -#endif diff --git a/samples/qt/OCCTOverview/src/CommonSample.h b/samples/qt/OCCTOverview/src/CommonSample.h deleted file mode 100644 index 0bb38acba6..0000000000 --- a/samples/qt/OCCTOverview/src/CommonSample.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef COMMONSAMPLE_H -#define COMMONSAMPLE_H - -#ifndef NO_COMMONSAMPLE_EXPORTS -#ifdef COMMONSAMPLE_EXPORTS -#ifdef _WIN32 -#define COMMONSAMPLE_EXPORT __declspec( dllexport ) -#else -#define COMMONSAMPLE_EXPORT -#endif -#else -#ifdef _WIN32 -#define COMMONSAMPLE_EXPORT __declspec( dllimport ) -#else -#define COMMONSAMPLE_EXPORT -#endif -#endif -#else -#define COMMONSAMPLE_EXPORT -#endif - -#endif diff --git a/samples/qt/OCCTOverview/src/DocumentCommon.cxx b/samples/qt/OCCTOverview/src/DocumentCommon.cxx deleted file mode 100644 index d92b6d538e..0000000000 --- a/samples/qt/OCCTOverview/src/DocumentCommon.cxx +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "DocumentCommon.h" - -#include "ApplicationCommon.h" -#include "Transparency.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -// ======================================================================= -// function : Viewer -// purpose : -// ======================================================================= -Handle(V3d_Viewer) DocumentCommon::Viewer(const Standard_ExtString, - const Standard_CString, - const Standard_Real theViewSize, - const V3d_TypeOfOrientation theViewProj, - const Standard_Boolean theComputedMode, - const Standard_Boolean theDefaultComputedMode) -{ - static Handle(OpenGl_GraphicDriver) aGraphicDriver; - if (aGraphicDriver.IsNull()) - { - Handle(Aspect_DisplayConnection) aDisplayConnection; -#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) - aDisplayConnection = new Aspect_DisplayConnection(OSD_Environment("DISPLAY").Value()); -#endif - aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection); - } - - Handle(V3d_Viewer) aViewer = new V3d_Viewer(aGraphicDriver); - aViewer->SetDefaultViewSize(theViewSize); - aViewer->SetDefaultViewProj(theViewProj); - aViewer->SetComputedMode(theComputedMode); - aViewer->SetDefaultComputedMode(theDefaultComputedMode); - return aViewer; -} - -DocumentCommon::DocumentCommon(ApplicationCommonWindow* theApp) -: QObject (theApp), - myContextIsEmpty(true) -{ - TCollection_ExtendedString a3DName("Visu3D"); - - myViewer = Viewer(a3DName.ToExtString(), "", 1000.0, V3d_XposYnegZpos, Standard_True, Standard_True); - - myViewer->SetDefaultLights(); - myViewer->SetLightOn(); - - myContext = new AIS_InteractiveContext(myViewer); -} - -void DocumentCommon::SetObjects (const NCollection_Vector& theObjects, - Standard_Boolean theDisplayShaded) -{ - myContext->RemoveAll(Standard_False); - myContextIsEmpty = theObjects.IsEmpty(); - - for(NCollection_Vector::Iterator anIter(theObjects); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anObject = anIter.Value(); - if (!theDisplayShaded) - { - myContext->Display(anObject, Standard_False); - } - else - { - myContext->Display(anObject, AIS_Shaded, 0, Standard_False); - } - } - myViewer->Redraw(); -} - -void DocumentCommon::Clear() -{ - myContext->RemoveAll(Standard_True); - myContextIsEmpty = true; -} diff --git a/samples/qt/OCCTOverview/src/DocumentCommon.h b/samples/qt/OCCTOverview/src/DocumentCommon.h deleted file mode 100644 index 565802be4c..0000000000 --- a/samples/qt/OCCTOverview/src/DocumentCommon.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef DOCUMENT_COMMON_OVERVIEW_H -#define DOCUMENT_COMMON_OVERVIEW_H - -#include "CommonSample.h" - -#include -#include -#include -#include - -#include -#include - -class ApplicationCommonWindow; - -//! Implements visualization of samples content -class DocumentCommon : public QObject -{ - Q_OBJECT -public: - - DocumentCommon(ApplicationCommonWindow* ); - ~DocumentCommon() { } - - const Handle(AIS_InteractiveContext)& getContext() { return myContext; } - - const Handle(V3d_Viewer)& getViewer() { return myViewer; } - - void setViewer (const Handle(V3d_Viewer)& theViewer) { myViewer = theViewer; } - - void SetObjects(const NCollection_Vector& theObjects, - Standard_Boolean theDisplayShaded = Standard_False); - void Clear(); - bool IsEmpty() const { return myContextIsEmpty; } - -signals: - void selectionChanged(); - void sendCloseDocument( DocumentCommon* ); - -private: - Handle(V3d_Viewer) Viewer (const Standard_ExtString theName, - const Standard_CString theDomain, - const Standard_Real theViewSize, - const V3d_TypeOfOrientation theViewProj, - const Standard_Boolean theComputedMode, - const Standard_Boolean theDefaultComputedMode ); - -private: - Handle(V3d_Viewer) myViewer; - Handle(AIS_InteractiveContext) myContext; - bool myContextIsEmpty; -}; - -#endif diff --git a/samples/qt/OCCTOverview/src/GeomWidget.cxx b/samples/qt/OCCTOverview/src/GeomWidget.cxx deleted file mode 100644 index 22cb515a2d..0000000000 --- a/samples/qt/OCCTOverview/src/GeomWidget.cxx +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "GeomWidget.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -GeomWidget::GeomWidget (DocumentCommon* theDocument3d, - DocumentCommon* theDocument2d, - QWidget* theParent) -: QWidget (theParent), - myDocument3d(theDocument3d), - myDocument2d(theDocument2d) -{ - QVBoxLayout* aMainLayout = new QVBoxLayout(this); - aMainLayout->setContentsMargins(0, 0, 0, 0); - - my2dVidget = new QWidget; - QVBoxLayout* a2dLayout = new QVBoxLayout(my2dVidget); - a2dLayout->setContentsMargins(0, 0, 0, 0); - a2dLayout->setSpacing(0); - myView2d = new View(myDocument2d->getContext(), false, my2dVidget); - QToolBar* aToolBar2d = new QToolBar; - aToolBar2d->addActions(myView2d->getViewActions()); - a2dLayout->addWidget(aToolBar2d); - a2dLayout->addWidget(myView2d); - - my3dVidget = new QWidget; - QVBoxLayout* a3dLayout = new QVBoxLayout(my3dVidget); - a3dLayout->setContentsMargins(0, 0, 0, 0); - a3dLayout->setSpacing(0); - myView3d = new View(myDocument3d->getContext(), true, my3dVidget); - QToolBar* aToolBar3d = new QToolBar; - aToolBar3d->addActions(myView3d->getViewActions()); - aToolBar3d->addSeparator(); - aToolBar3d->addActions(myView3d->getRaytraceActions()); - a3dLayout->addWidget(aToolBar3d); - a3dLayout->addWidget(myView3d); - - myStackWidget = new QStackedWidget(this); - aMainLayout->addWidget(myStackWidget); - myStackWidget->addWidget(my2dVidget); - myStackWidget->addWidget(my3dVidget); - - FitAll(); -} - -void GeomWidget::FitAll() -{ - if (myDocument2d->IsEmpty()) - Show3d(); - else - Show2d(); -} - -void GeomWidget::Show3d() -{ - myView3d->axo(); - myView3d->fitAll(); - QAction* aShadingAction = myView3d->getViewAction(ViewAction_Shading); - aShadingAction->trigger(); - aShadingAction->setChecked(true); - QAction* aHlrOffAction = myView3d->getViewAction(ViewAction_HlrOff); - aHlrOffAction->trigger(); - aHlrOffAction->setChecked(true); - myStackWidget->setCurrentWidget(my3dVidget); - setStatusTip("Mouse buttons: Right-Zoom, Middle-Pan, Left-Rotate"); -} - -void GeomWidget::Show2d() -{ - myView2d->fitAll(); - myStackWidget->setCurrentWidget(my2dVidget); - setStatusTip("Mouse buttons: Right-Zoom, Middle-Pan"); -} diff --git a/samples/qt/OCCTOverview/src/GeomWidget.h b/samples/qt/OCCTOverview/src/GeomWidget.h deleted file mode 100644 index 77165c6c89..0000000000 --- a/samples/qt/OCCTOverview/src/GeomWidget.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef GEOMWIDGET_H -#define GEOMWIDGET_H - -#include "View.h" -#include "DocumentCommon.h" - -#include -#include -#include - -class ApplicationCommon; -class QStackedWidget; - -//! Qt widget for organize 3D & 2D documents -class GeomWidget : public QWidget -{ - Q_OBJECT -public: - GeomWidget(DocumentCommon* theDocument3d, - DocumentCommon* theDocument2d, - QWidget* theParent = nullptr); - - void FitAll(); - - Handle(V3d_View) Get3dView() { return myView3d->getView(); } - - Handle(V3d_View) Get2dView() { return myView2d->getView(); } - - void Show3d(); - void Show2d(); - -private: - View* myView3d; - View* myView2d; - - QWidget* my3dVidget; - QWidget* my2dVidget; - QStackedWidget* myStackWidget; - - DocumentCommon* myDocument3d; - DocumentCommon* myDocument2d; -}; - -#endif //GEOMWIDGET_H diff --git a/samples/qt/OCCTOverview/src/Main.cxx b/samples/qt/OCCTOverview/src/Main.cxx deleted file mode 100644 index 72bdd94788..0000000000 --- a/samples/qt/OCCTOverview/src/Main.cxx +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "ApplicationCommon.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -int main ( int argc, char* argv[] ) -{ - QApplication aQApp( argc, argv ); - -#include - Q_INIT_RESOURCE(OCCTOverview); -#include - - QSettings settings("OCCTOverview.conf", QSettings::IniFormat); - settings.beginGroup("ApplicationSetting"); - ApplicationType aCategory = static_cast(settings.value("ApplicationType", "").toInt()); - settings.endGroup(); - - ApplicationCommonWindow* aWindow = new ApplicationCommonWindow(aCategory); - QString aResName(":/icons/lamp.png"); - aWindow->setWindowIcon(QPixmap(aResName)); - - settings.beginGroup("WindowPosition"); - int x = settings.value("x", -1).toInt(); - int y = settings.value("y", -1).toInt(); - int width = settings.value("width", -1).toInt(); - int height = settings.value("height", -1).toInt(); - settings.endGroup(); - - if (x > 0 && y > 0 && width > 0 && height > 0) - { - aWindow->setGeometry(x, y, width, height); - } - aWindow->SetApplicationType(aCategory); - - aWindow->show(); - int aResult = aQApp.exec(); - - settings.beginGroup("WindowPosition"); - settings.setValue("x", aWindow->x()); - settings.setValue("y", aWindow->y()); - settings.setValue("width", aWindow->width()); - settings.setValue("height", aWindow->height()); - settings.endGroup(); - - settings.beginGroup("ApplicationSetting"); - settings.setValue("ApplicationType", aWindow->GetApplicationType()); - settings.endGroup(); - - return aResult; -} diff --git a/samples/qt/OCCTOverview/src/OCCTOverview.qrc b/samples/qt/OCCTOverview/src/OCCTOverview.qrc deleted file mode 100644 index 8516659917..0000000000 --- a/samples/qt/OCCTOverview/src/OCCTOverview.qrc +++ /dev/null @@ -1,29 +0,0 @@ - - - ../res/lamp.png - ../res/view_axo.png - ../res/view_back.png - ../res/view_bottom.png - ../res/view_comp_off.png - ../res/view_comp_on.png - ../res/view_fitall.png - ../res/view_front.png - ../res/view_left.png - ../res/view_reset.png - ../res/view_top.png - ../res/antialiasing.png - ../res/raytracing.png - ../res/reflections.png - ../res/shadows.png - ../res/view_right.png - ../res/tool_material.png - ../res/tool_color.png - ../res/tool_delete.png - ../res/tool_shading.png - ../res/tool_transparency.png - ../res/tool_wireframe.png - ../res/help.png - ../res/cursor_rotate.png - ../res/cursor_zoom.png - - diff --git a/samples/qt/OCCTOverview/src/OcctHighlighter.cxx b/samples/qt/OCCTOverview/src/OcctHighlighter.cxx deleted file mode 100644 index 5dcc887f9a..0000000000 --- a/samples/qt/OCCTOverview/src/OcctHighlighter.cxx +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "OcctHighlighter.h" - -#include -#include -#include -#include - - - - - -OcctHighlighter::OcctHighlighter(QTextDocument* theParent) -: QSyntaxHighlighter (theParent) -{ - QStringList aKeywordPatterns; - aKeywordPatterns - << "\\balignas\\b" << "\\balignof\\b" << "\\band\\b" << "\\band_eq\\b" << "\\basm\\b" - << "\\bauto\\b" << "\\bbitand\\b" << "\\bbitor\\b" << "\\bbool\\b" << "\\bbreak\\b" - << "\\bcase\\b" << "\\bcatch\\b" << "\\bchar\\b" << "\\bchar16_t\\b" << "\\bchar32_t\\b" - << "\\bclass\\b" << "\\bcompl\\b" << "\\bconst\\b" << "\\bconstexpr\\b" << "\\bconst_cast\\b" - << "\\bcontinue\\b" << "\\bdecltype\\b" << "\\bdefault\\b" << "\\bdelete\\b" << "\\bdo\\b" - << "\\bdouble\\b" << "\\bdynamic_cast\\b" << "\\belse\\b" << "\\benum\\b" << "\\bexplicit\\b" - << "\\bexport\\b" << "\\bextern\\b" << "\\bfalse\\b" << "\\bfloat\\b" << "\\bfor\\b" - << "\\bfriend\\b" << "\\bgoto\\b" << "\\bif\\b" << "\\binline\\b" << "\\bint\\b" << "\\blong\\b" - << "\\bmutable\\b" << "\\bnamespace\\b" << "\\bnew\\b" << "\\bnoexcept\\b" << "\\bnot\\b" - << "\\bnot_eq\\b" << "\\bnullptr\\b" << "\\boperator\\b" << "\\bor\\b" << "\\bor_eq\\b" - << "\\bprivate\\b" << "\\bprotected\\b" << "\\bpublic\\b" << "\\bregister\\b" - << "\\breinterpret_cast\\b" << "\\breturn\\b" << "\\bshort\\b" << "\\bsigned\\b" << "\\bsizeof\\b" - << "\\bstatic\\b" << "\\bstatic_assert\\b" << "\\bstatic_cast\\b" << "\\bstruct\\b" - << "\\bswitch\\b" << "\\btemplate\\b" << "\\bthis\\b" << "\\bthread_local\\b" << "\\bthrow\\b" - << "\\btrue\\b" << "\\btry\\b" << "\\btypedef\\b" << "\\btypeid\\b" << "\\btypename\\b" - << "\\bunion\\b" << "\\bunsigned\\b" << "\\busing\\b" << "\\bvirtual\\b" << "\\bvoid\\b" - << "\\bvolatile\\b" << "\\bwchar_t\\b" << "\\bwhile\\b" << "\\bxor\\b" << "\\bxor_eq\\b" - << "\\boverride\\b" << "\\bfinal\\b"; - - QStringList anOcctPatterns; - anOcctPatterns - << "gp_Pnt" << "gp_XYZ" << "gp_Vec" << "gp_Dir" << "gp_Ax1" << "gp_Ax2" << "gp_Ax3" << "gp_Lin" - << "gp_Circ" << "gp_Elips" << "gp_Parab" << "gp_Hypr" << "gp_Cylinder" << "gp_Cone" << "gp_Sphere" - << "gp_Torus" << "gp_Pnt2d" << "gp_XY" << "gp_Ax2d" << "gp_Ax22d" << "gp_Lin2d" << "gp_Circ2d" - << "gp_Elips2d" << "gp_Parab2d" << "gp_Hypr2d" << "Geom2d_BSplineCurve" << "Geom2d_BezierCurve" - << "Geom2d_OffsetCurve" << "ProjLib" << "ElSLib" << "IntAna_IntConicQuad" << "GccAna_Lin2d2Tan" - << "GccEnt_QualifiedCirc" << "Geom2dAPI_ProjectPointOnCurve" << "Geom2dAPI_ExtremaCurveCurve" - << "Geom2dAPI_InterCurveCurve" << "Geom2dAPI_PointsToBSpline" << "Geom_CartesianPoint" - << "Geom_VectorWithMagnitude" << "Geom_Axis1Placement" << "Geom_Axis2Placement" << "Geom_Line" - << "Geom_Circle" << "Geom_Ellipse" << "Geom_Parabola" << "Geom_Hyperbola" << "Geom_BSplineCurve" - << "Geom_BezierCurve" << "Geom_TrimmedCurve" << "Geom_OffsetCurve" << "Geom_BSplineSurface" - << "Geom_BezierSurface" << "Geom_Plane" << "Geom_CylindricalSurface" << "Geom_ConicalSurface" - << "Geom_SphericalSurface" << "Geom_ToroidalSurface" << "Geom_RectangularTrimmedSurface" - << "Geom_OffsetSurface" << "Geom_SurfaceOfLinearExtrusion" << "Geom_SurfaceOfRevolution" - << "BndLib_Add3dCurve" << "BndLib_AddSurface" << "GeomAdaptor_Curve" << "GeomAdaptor_Surface" - << "GeomAPI_PointsToBSpline" << "GeomAPI_PointsToBSplineSurface" << "GeomConvert" - << "Geom2d_CartesianPoint" << "Geom2d_VectorWithMagnitude" << "Geom2d_Line" << "Geom2d_Circle" - << "Geom2d_Ellipse" << "Geom2d_Parabola" << "Geom2d_Hyperbola" << "Geom2d_TrimmedCurve" - << "Geom2dAdaptor_Curve" << "Bnd_Box2d" << "BndLib_Add2dCurve" << "Adaptor2d_Curve2d" - << "BRepBuilderAPI_MakeEdge" << "BRepBuilderAPI_MakeFace" << "BRepPrimAPI_MakeBox" << "AIS_Point" - << "AIS_TextLabel" << "AIS_Axis" << "AIS_Circle" << "AIS_Plane" << "AIS_Shape" - << "AIS_ColoredShape" << "GProp_PEquation" << "Extrema_ExtCS" << "GCPnts_QuasiUniformDeflection" - << "GProp_GProps" << "GProp_PrincipalProps" << "TopoDS" << "TopoDS_Iterator" << "TopoDS_Compound" - << "TopoDS_Edge" << "TopoDS_Face" << "TopoDS_Shell" << "TopoDS_Solid" << "TopoDS_Vertex" - << "TopoDS_Wire" << "TopExp" << "TopExp_Explorer" << "TColgp_Array2OfPnt" << "BRep_Builder" - << "BRepGProp" << "BRep_Tool" << "BRepTools" << "BRepTools_ReShape" << "BRepAdaptor_Curve" - << "BRepAdaptor_CompCurve" << "BRepAdaptor_Surface" << "BRepAlgoAPI_Common" << "BRepAlgoAPI_Cut" - << "BRepAlgoAPI_Fuse" << "BRepAlgoAPI_Section" << "BRepAlgoAPI_Splitter" << "BRepAlgoAPI_Defeaturing" - << "BRepBuilderAPI_Copy" << "BRepBuilderAPI_MakeVertex" << "BRepBuilderAPI_MakeEdge" - << "BRepBuilderAPI_MakeFace" << "BRepBuilderAPI_MakePolygon" << "BRepBuilderAPI_MakeShell" - << "BRepBuilderAPI_MakeSolid" << "BRepBuilderAPI_MakeWire" << "BRepBuilderAPI_NurbsConvert" - << "BRepBuilderAPI_Sewing" << "BRepBuilderAPI_Transform" << "BRepCheck_Analyzer" - << "BRepPrimAPI_MakeBox" << "BRepPrimAPI_MakeCylinder" << "BRepPrimAPI_MakeRevol" - << "BRepFilletAPI_MakeChamfer" << "BRepFilletAPI_MakeFillet" << "BRepOffsetAPI_MakeOffset" - << "BRepOffsetAPI_MakeEvolved.hxx" << "Standard_Integer" << "Standard_Real" << "Standard_Boolean" - << "Standard_ShortReal" << "Standard_Character" << "Standard_Byte" << "Standard_Address" - << "Standard_Size" << "Standard_Time" << "Standard_Utf8Char" << "Standard_Utf8UChar" - << "Standard_ExtCharacter" << "Standard_Utf16Char" << "Standard_Utf32Char" << "Standard_WideChar" - << "Standard_CString" << "Standard_ExtString" << "NCollection_Vector" << "TCollection_AsciiString" - << "TCollection_ExtendedString" << "TCollection_HAsciiString" << "TCollection_HExtendedString" - << "Standard_False" << "Standard_True" - << "TCollection" << "NCollection" << "gp_Trsf" << "Handle" << "Aspect_TOL_DASH" - << "Aspect_TOM_O_STAR" << "Aspect_TOL_SOLID" << "Aspect_TOM_O_STAR" << "AIS_InteractiveObject" - << "AIS_ListOfInteractive" << "Aspect_GDM_Lines" << "Aspect_GDM_Points" << "Aspect_TOM_POINT" - << "Aspect_TOM_RING1" << "Aspect_TOM_O" << "BinDrivers" << "DefineFormat" << "Font_FA_Bold" - << "Font_FA_BoldItalic" << "Font_FA_Italic" << "Font_FA_Regular" << "DownCast" << "gp_Pln" - << "Graphic3d_AspectMarker3d" << "Graphic3d_HTA_LEFT" << "Graphic3d_NameOfMaterial" - << "Graphic3d_NOM_BRONZE" << "Graphic3d_NOM_PLASTIC" << "Graphic3d_VTA_BOTTOM" - << "OpenGl_GraphicDriver" << "PCDM_RS_OK" << "PCDM_SS_OK" << "PCDM_ReaderStatus" - << "PCDM_StoreStatus" << "Prs3d_Drawer" << "TPrsStd_AISPresentation" << "Quantity_Color" - << "Quantity_NameOfColor" << "Quantity_NOC_BLUE1" << "Quantity_NOC_CADETBLUE" - << "Quantity_NOC_GREEN" << "Quantity_NOC_MAGENTA1" << "Quantity_NOC_RED" << "Quantity_NOC_YELLOW" - << "Quantity_NOC_WHITE" << "Quantity_NOC_MATRABLUE" << "Quantity_TOC_RGB" << "Quantity_TOC_HLS" - << "Standard_GUID" << "TColStd_ListIteratorOfListOfTransient" << "TColStd_ListOfTransient" - << "TDataStd_Integer" << "TDataStd_Name" << "TDataStd_Real" << "TFunction_Driver" - << "TFunction_DriverTable" << "TFunction_Function" << "TFunction_Logbook" << "TDF_Label" - << "TDF_TagSource" << "TNaming_NamedShape" << "TopAbs_EDGE" << "TopAbs_FACE" << "TopAbs_VERTEX" - << "TPrsStd_AISPresentation" << "TPrsStd_AISViewer" << "V3d_AmbientLight" - << "V3d_DirectionalLight" << "V3d_PositionalLight" << "V3d_SpotLight" << "XmlDrivers"; - - QStringList aHelperPatterns; - aHelperPatterns - << "AdaptorCurve_AIS" << "AdaptorVec_AIS" << "AdaptorCurve2d_AIS" << "AdaptorPnt2d_AIS" - << "Sample2D_Image" << "Sample2D_Markers" << "Sample2D_Face" << "TOcafFunction_BoxDriver" - << "TOcafFunction_CylDriver" << "DisplayPresentation"; - - HighlightingRule aRule; - - myOcctFormat.setForeground(Qt::darkCyan); - - foreach (const QString& aPattern, anOcctPatterns) - { - aRule.myPattern = QRegExp(aPattern); - aRule.myFormat = myOcctFormat; - myHighlightingRules.append(aRule); - } - - myHelperFormat.setForeground(Qt::red); - foreach (const QString& aPattern, aHelperPatterns) - { - aRule.myPattern = QRegExp(aPattern); - aRule.myFormat = myHelperFormat; - myHighlightingRules.append(aRule); - } - - - myKeywordFormat.setForeground(Qt::darkBlue); - myKeywordFormat.setFontWeight(QFont::Bold); - foreach (const QString& aPattern, aKeywordPatterns) - { - aRule.myPattern = QRegExp(aPattern); - aRule.myFormat = myKeywordFormat; - myHighlightingRules.append(aRule); - } - - myMemberFormat.setFontWeight(QFont::Bold); - aRule.myPattern = QRegExp(QLatin1String("\\bmy[0-9A-Za-z]+\\b")); - aRule.myFormat = myMemberFormat; - myHighlightingRules.append(aRule); - - myLocalFormat.setForeground(Qt::darkMagenta); - aRule.myPattern = QRegExp(QLatin1String("\\ba[0-9A-Za-z]+\\b")); - aRule.myFormat = myLocalFormat; - myHighlightingRules.append(aRule); - - myQuotationFormat.setForeground(Qt::darkRed); - aRule.myPattern = QRegExp(QLatin1String("\".*\"")); - aRule.myFormat = myQuotationFormat; - myHighlightingRules.append(aRule); - - myFunctionFormat.setFontItalic(true); - myFunctionFormat.setForeground(Qt::blue); - aRule.myPattern = QRegExp(QLatin1String("\\b[A-Za-z0-9_]+(?=\\()")); - aRule.myFormat = myFunctionFormat; - myHighlightingRules.append(aRule); - - mySingleLineCommentFormat.setForeground(Qt::darkGreen); - aRule.myPattern = QRegExp(QLatin1String("//[^\n]*")); - aRule.myFormat = mySingleLineCommentFormat; - myHighlightingRules.append(aRule); - - myMultiLineCommentFormat.setForeground(Qt::darkGreen); - - myCommentStartExpression = QRegExp(QLatin1String("/\\*")); - myCommentEndExpression = QRegExp(QLatin1String("\\*/")); -} - -void OcctHighlighter::highlightBlock (const QString& theText) -{ - foreach (const HighlightingRule &rule, myHighlightingRules) - { - QRegExp expression(rule.myPattern); - int index = expression.indexIn(theText); - while (index >= 0) - { - int length = expression.matchedLength(); - setFormat(index, length, rule.myFormat); - index = expression.indexIn(theText, index + length); - } - } - - setCurrentBlockState(0); - - int startIndex = 0; - if (previousBlockState() != 1) - startIndex = theText.indexOf(myCommentStartExpression); - - while (startIndex >= 0) - { - int endIndex = myCommentEndExpression.indexIn(theText, startIndex); - int commentLength; - if (endIndex == -1) - { - setCurrentBlockState(1); - commentLength = theText.length() - startIndex; - } - else - { - commentLength = endIndex - startIndex - + myCommentEndExpression.matchedLength(); - } - setFormat(startIndex, commentLength, myMultiLineCommentFormat); - startIndex = myCommentEndExpression.indexIn(theText, startIndex + commentLength); - } -} diff --git a/samples/qt/OCCTOverview/src/OcctHighlighter.h b/samples/qt/OCCTOverview/src/OcctHighlighter.h deleted file mode 100644 index 967fa49df7..0000000000 --- a/samples/qt/OCCTOverview/src/OcctHighlighter.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef OCCTHIGHLIGHTER_H -#define OCCTHIGHLIGHTER_H - -#include - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QTextDocument; -QT_END_NAMESPACE - -//! Implements C++ and OCCT objects syntax -//! highlighting for sample code window -class OcctHighlighter: public QSyntaxHighlighter -{ - Q_OBJECT -public: - - OcctHighlighter(QTextDocument* theParent = 0); - -protected: - void highlightBlock(const QString& theText) Standard_OVERRIDE; - -private: - struct HighlightingRule - { - QRegExp myPattern; - QTextCharFormat myFormat; - }; - -private: - QVector myHighlightingRules; - // QRegExp (Qt4+) introduced by the patch as alternative to QRegularExpression - // (Qt5+) for compatibility reasons. QRegExp will be moved in future Qt6 to - // a qt5compat module: QRegExp -> Qt5::QRegExp - QRegExp myCommentStartExpression; - QRegExp myCommentEndExpression; - - QTextCharFormat myKeywordFormat; - QTextCharFormat mySingleLineCommentFormat; - QTextCharFormat myMultiLineCommentFormat; - QTextCharFormat myQuotationFormat; - QTextCharFormat myFunctionFormat; - QTextCharFormat myOcctFormat; - QTextCharFormat myMemberFormat; - QTextCharFormat myLocalFormat; - QTextCharFormat myHelperFormat; -}; - -#endif diff --git a/samples/qt/OCCTOverview/src/OcctWindow.cxx b/samples/qt/OCCTOverview/src/OcctWindow.cxx deleted file mode 100644 index 6a5adf9571..0000000000 --- a/samples/qt/OCCTOverview/src/OcctWindow.cxx +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "OcctWindow.h" - -IMPLEMENT_STANDARD_RTTIEXT(OcctWindow, Aspect_Window) - -// ======================================================================= -// function : OcctWindow -// purpose : -// ======================================================================= -OcctWindow::OcctWindow(QWidget* theWidget, const Quantity_NameOfColor theBackColor) - : myWidget(theWidget) -{ - SetBackground(theBackColor); - myXLeft = myWidget->rect().left(); - myYTop = myWidget->rect().top(); - myXRight = myWidget->rect().right(); - myYBottom = myWidget->rect().bottom(); -} - -// ======================================================================= -// function : NativeParentHandle -// purpose : -// ======================================================================= -Aspect_Drawable OcctWindow::NativeParentHandle() const -{ - QWidget* aParentWidget = myWidget->parentWidget(); - if (aParentWidget != NULL) - { - return (Aspect_Drawable)aParentWidget->winId(); - } - else - { - return 0; - } -} - -// ======================================================================= -// function : Map -// purpose : -// ======================================================================= -void OcctWindow::Map() const -{ - myWidget->show(); - myWidget->update(); -} - -// ======================================================================= -// function : Unmap -// purpose : -// ======================================================================= -void OcctWindow::Unmap() const -{ - myWidget->hide(); - myWidget->update(); -} - -// ======================================================================= -// function : DoResize -// purpose : -// ======================================================================= -Aspect_TypeOfResize OcctWindow::DoResize() -{ - int aMask = 0; - Aspect_TypeOfResize aMode = Aspect_TOR_UNKNOWN; - - if (!myWidget->isMinimized()) - { - if (std::abs(myWidget->rect().left() - myXLeft) > 2) - { - aMask |= 1; - } - if (std::abs(myWidget->rect().right() - myXRight) > 2) - { - aMask |= 2; - } - if (std::abs(myWidget->rect().top() - myYTop) > 2) - { - aMask |= 4; - } - if (std::abs(myWidget->rect().bottom() - myYBottom) > 2) - { - aMask |= 8; - } - - switch (aMask) - { - case 0: - aMode = Aspect_TOR_NO_BORDER; - break; - case 1: - aMode = Aspect_TOR_LEFT_BORDER; - break; - case 2: - aMode = Aspect_TOR_RIGHT_BORDER; - break; - case 4: - aMode = Aspect_TOR_TOP_BORDER; - break; - case 5: - aMode = Aspect_TOR_LEFT_AND_TOP_BORDER; - break; - case 6: - aMode = Aspect_TOR_TOP_AND_RIGHT_BORDER; - break; - case 8: - aMode = Aspect_TOR_BOTTOM_BORDER; - break; - case 9: - aMode = Aspect_TOR_BOTTOM_AND_LEFT_BORDER; - break; - case 10: - aMode = Aspect_TOR_RIGHT_AND_BOTTOM_BORDER; - break; - default: - break; - } // end switch - - myXLeft = myWidget->rect().left(); - myXRight = myWidget->rect().right(); - myYTop = myWidget->rect().top(); - myYBottom = myWidget->rect().bottom(); - } - - return aMode; -} - -// ======================================================================= -// function : Ratio -// purpose : -// ======================================================================= -Standard_Real OcctWindow::Ratio() const -{ - QRect aRect = myWidget->rect(); - return Standard_Real(aRect.right() - aRect.left()) / Standard_Real(aRect.bottom() - aRect.top()); -} - -// ======================================================================= -// function : Size -// purpose : -// ======================================================================= -void OcctWindow::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const -{ - QRect aRect = myWidget->rect(); - theWidth = aRect.width(); - theHeight = aRect.height(); -} - -// ======================================================================= -// function : Position -// purpose : -// ======================================================================= -void OcctWindow::Position(Standard_Integer& theX1, - Standard_Integer& theY1, - Standard_Integer& theX2, - Standard_Integer& theY2) const -{ - theX1 = myWidget->rect().left(); - theX2 = myWidget->rect().right(); - theY1 = myWidget->rect().top(); - theY2 = myWidget->rect().bottom(); -} diff --git a/samples/qt/OCCTOverview/src/OcctWindow.h b/samples/qt/OCCTOverview/src/OcctWindow.h deleted file mode 100644 index 73ae4cb618..0000000000 --- a/samples/qt/OCCTOverview/src/OcctWindow.h +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef OcctWindow_H -#define OcctWindow_H - -#include - -#include -#include -#include - -//! OcctWindow class implements Aspect_Window interface using Qt API -//! as a platform-independent source of window geometry information. -//! A similar class should be used instead of platform-specific OCCT -//! classes (WNT_Window, Xw_Window) in any Qt 5 application using OCCT -//! 3D visualization. -//! -//! With Qt 5, the requirement for a Qt-based application to rely fully -//! on Qt public API and stop using platform-specific APIs looks mandatory. -//! An example of this is changed QWidget event sequence: when a widget is -//! first shown on the screen, a resize event is generated before the -//! underlying native window is resized correctly, however the QWidget instance -//! already holds correct size information at that moment. The OCCT classes -//! acting as a source of window geometry for V3d_View class (WNT_Window, Xw_Window) -//! are no longer compatible with changed Qt behavior because they rely on -//! platform-specific API that cannot return correct window geometry information -//! in some cases. A reasonable solution is to provide a Qt-based implementation -//! of Aspect_Window interface at application level. -class OcctWindow : public Aspect_Window -{ - DEFINE_STANDARD_RTTIEXT(OcctWindow,Aspect_Window) -public: - - //! Constructor - OcctWindow( QWidget* theWidget, const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY ); - - //! Destructor - virtual ~OcctWindow() - { - myWidget = NULL; - } - - //! Returns native Window handle - virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE - { - return (Aspect_Drawable)myWidget->winId(); - } - - //! Returns parent of native Window handle. - virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE; - - //! Applies the resizing to the window - virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE; - - //! Returns True if the window is opened - //! and False if the window is closed. - virtual Standard_Boolean IsMapped() const Standard_OVERRIDE - { - return !(myWidget->isMinimized() || myWidget->isHidden()); - } - - //! Apply the mapping change to the window - //! and returns TRUE if the window is mapped at screen. - virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; } - - //! Opens the window . - virtual void Map() const Standard_OVERRIDE; - - //! Closes the window . - virtual void Unmap() const Standard_OVERRIDE; - - virtual void Position( Standard_Integer& theX1, Standard_Integer& theY1, - Standard_Integer& theX2, Standard_Integer& theY2 ) const Standard_OVERRIDE; - - //! Returns The Window RATIO equal to the physical - //! WIDTH/HEIGHT dimensions. - virtual Standard_Real Ratio() const Standard_OVERRIDE; - - virtual void Size( Standard_Integer& theWidth, Standard_Integer& theHeight ) const Standard_OVERRIDE; - - virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; } - -protected: - Standard_Integer myXLeft; - Standard_Integer myYTop; - Standard_Integer myXRight; - Standard_Integer myYBottom; - QWidget* myWidget; -}; - - -#endif // OcctWindow_H \ No newline at end of file diff --git a/samples/qt/OCCTOverview/src/TranslateDialog.cxx b/samples/qt/OCCTOverview/src/TranslateDialog.cxx deleted file mode 100644 index fdf0eef594..0000000000 --- a/samples/qt/OCCTOverview/src/TranslateDialog.cxx +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "TranslateDialog.h" - -#include -#include -#include - -TranslateDialog::TranslateDialog(QWidget* parent, Qt::WindowFlags flags, bool modal) -: QFileDialog(parent, flags) -{ - setOption(QFileDialog::DontUseNativeDialog); - setModal(modal); - - QGridLayout* grid = ::qobject_cast(layout()); - - if (grid) - { - QVBoxLayout *vbox = new QVBoxLayout; - - QWidget* paramGroup = new QWidget(this); - paramGroup->setLayout(vbox); - - myBox = new QComboBox(paramGroup); - vbox->addWidget(myBox); - - int row = grid->rowCount(); - grid->addWidget(paramGroup, row, 1, 1, 3); // make combobox occupy 1 row and 3 columns starting from 1 - } -} - -TranslateDialog::~TranslateDialog() -{ -} - -int TranslateDialog::getMode() const -{ - if (myBox->currentIndex() < 0 || myBox->currentIndex() > (int)myList.count() - 1) - { - return -1; - } - else - { - return myList.at(myBox->currentIndex()); - } -} - -void TranslateDialog::setMode(const int mode) -{ - int idx = myList.indexOf(mode); - if (idx >= 0) - { - myBox->setCurrentIndex(idx); - } -} - -void TranslateDialog::addMode(const int mode, const QString& name) -{ - myBox->show(); - myBox->addItem(name); - myList.append(mode); - myBox->updateGeometry(); - updateGeometry(); -} - -void TranslateDialog::clear() -{ - myList.clear(); - myBox->clear(); - myBox->hide(); - myBox->updateGeometry(); - updateGeometry(); -} - -QListView* TranslateDialog::findListView(const QObjectList & childList) -{ - QListView* listView = 0; - for (int i = 0, n = childList.count(); i < n && !listView; i++) - { - listView = qobject_cast(childList.at(i)); - if (!listView && childList.at(i)) - { - listView = findListView(childList.at(i)->children()); - } - } - return listView; -} - -void TranslateDialog::showEvent(QShowEvent* event) -{ - QFileDialog::showEvent(event); - QListView* aListView = findListView(children()); - aListView->setViewMode(QListView::ListMode); -} diff --git a/samples/qt/OCCTOverview/src/TranslateDialog.h b/samples/qt/OCCTOverview/src/TranslateDialog.h deleted file mode 100644 index df28094d96..0000000000 --- a/samples/qt/OCCTOverview/src/TranslateDialog.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef TRANSLATEDIALOG_H -#define TRANSLATEDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include - -//! Qt file dialog for save and restore sample files -class TranslateDialog : public QFileDialog -{ -public: - TranslateDialog(QWidget* = 0, Qt::WindowFlags flags = 0, bool = true); - ~TranslateDialog(); - int getMode() const; - void setMode(const int); - void addMode(const int, const QString&); - void clear(); - -protected: - void showEvent(QShowEvent* event); - -private: - QListView* findListView(const QObjectList&); - -private: - QComboBox* myBox; - QList myList; -}; - -#endif // TRANSLATEDIALOG_H diff --git a/samples/qt/OCCTOverview/src/Transparency.cxx b/samples/qt/OCCTOverview/src/Transparency.cxx deleted file mode 100644 index 33fd02fc8e..0000000000 --- a/samples/qt/OCCTOverview/src/Transparency.cxx +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "Transparency.h" - -#include -#include -#include -#include - -DialogTransparency::DialogTransparency(QWidget* parent) -: QDialog(parent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint) -{ - setWindowTitle(tr("Transparency")); - QHBoxLayout* base = new QHBoxLayout(this); - - base->addWidget(new QLabel("0", this)); - - mySlider = new QSlider(Qt::Horizontal, this); - mySlider->setRange(0, 10); - mySlider->setTickPosition(QSlider::TicksBelow); - mySlider->setTickInterval(1); - mySlider->setPageStep(2); - base->addWidget(mySlider); - connect(mySlider, SIGNAL(valueChanged(int)), this, SIGNAL(sendTransparencyChanged(int))); - - base->addWidget(new QLabel("10", this)); -} diff --git a/samples/qt/OCCTOverview/src/Transparency.h b/samples/qt/OCCTOverview/src/Transparency.h deleted file mode 100644 index 80409e1748..0000000000 --- a/samples/qt/OCCTOverview/src/Transparency.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include -#include -#include -#include -#include - -#include - -class QSlider; - -//! Qt dialog with slider for change shapes transparency -class DialogTransparency : public QDialog -{ - Q_OBJECT -public: - DialogTransparency ( QWidget * parent=0 ); - ~DialogTransparency() { } - - int value() const - { - return mySlider->value(); - } - - void setValue(int theVal) const - { - mySlider->setValue(theVal); - } - -signals: - void sendTransparencyChanged(int value); - -private: - QSlider* mySlider; -}; diff --git a/samples/qt/OCCTOverview/src/View.cxx b/samples/qt/OCCTOverview/src/View.cxx deleted file mode 100644 index 929e5e8ec5..0000000000 --- a/samples/qt/OCCTOverview/src/View.cxx +++ /dev/null @@ -1,679 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#if !defined _WIN32 -#define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */ -#endif - -#include "View.h" - -#include "ApplicationCommon.h" -#include "OcctWindow.h" -#include "Transparency.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && QT_VERSION < 0x050000 -#include -#endif - -#include -#include -#include - -namespace -{ - //! Map Qt buttons bitmask to virtual keys. - static Aspect_VKeyMouse qtMouseButtons2VKeys(Qt::MouseButtons theButtons) - { - Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE; - if ((theButtons & Qt::LeftButton) != 0) - { - aButtons |= Aspect_VKeyMouse_LeftButton; - } - if ((theButtons & Qt::MiddleButton) != 0) - { - aButtons |= Aspect_VKeyMouse_MiddleButton; - } - if ((theButtons & Qt::RightButton) != 0) - { - aButtons |= Aspect_VKeyMouse_RightButton; - } - return aButtons; - } - - //! Map Qt mouse modifiers bitmask to virtual keys. - static Aspect_VKeyFlags qtMouseModifiers2VKeys(Qt::KeyboardModifiers theModifiers) - { - Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE; - if ((theModifiers & Qt::ShiftModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_SHIFT; - } - if ((theModifiers & Qt::ControlModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_CTRL; - } - if ((theModifiers & Qt::AltModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_ALT; - } - return aFlags; - } - - static QCursor* defCursor = NULL; - static QCursor* handCursor = NULL; - static QCursor* panCursor = NULL; - static QCursor* globPanCursor = NULL; - static QCursor* zoomCursor = NULL; - static QCursor* rotCursor = NULL; - -} - -View::View (const Handle(AIS_InteractiveContext)& theContext, bool theIs3dView, QWidget* theParent) -: QWidget(theParent), - myIsRaytracing(false), - myIsShadowsEnabled(true), - myIsReflectionsEnabled(false), - myIsAntialiasingEnabled(false), - myIs3dView (theIs3dView), - myBackMenu(NULL) -{ -#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && QT_VERSION < 0x050000 - XSynchronize(x11Info().display(), true); -#endif - myContext = theContext; - myCurZoom = 0; - - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - - myDefaultGestures = myMouseGestureMap; - myCurrentMode = CurrentAction3d_Nothing; - setMouseTracking(true); - - initViewActions(); - initCursors(); - - setBackgroundRole(QPalette::NoRole);//NoBackground ); - // set focus policy to threat QContextMenuEvent from keyboard - setFocusPolicy(Qt::StrongFocus); - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - init(); -} - -void View::init() -{ - if (myV3dView.IsNull()) - { - myV3dView = myContext->CurrentViewer()->CreateView(); - } - - Handle(OcctWindow) hWnd = new OcctWindow(this); - myV3dView->SetWindow(hWnd); - if (!hWnd->IsMapped()) - { - hWnd->Map(); - } - - if (myIs3dView) - { - SetAllowRotation(Standard_True); - myV3dView->SetBackgroundColor(Quantity_Color(0.0, 0.0, 0.3, Quantity_TOC_RGB)); - } - else - { - SetAllowRotation(Standard_False); - myV3dView->SetBackgroundColor(Quantity_Color(0.0, 0.2, 0.0, Quantity_TOC_RGB)); - myV3dView->SetProj(V3d_Zpos); - } - - myV3dView->MustBeResized(); - - if (myIsRaytracing) - { - myV3dView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING; - } -} - -void View::paintEvent(QPaintEvent *) -{ - myV3dView->InvalidateImmediate(); - FlushViewEvents(myContext, myV3dView, true); -} - -void View::resizeEvent(QResizeEvent *) -{ - if (!myV3dView.IsNull()) - { - myV3dView->MustBeResized(); - } -} - -void View::OnSelectionChanged(const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) -{ - Q_UNUSED(theCtx) - Q_UNUSED(theView) -} - -void View::fitAll() -{ - myV3dView->FitAll(); - myV3dView->ZFitAll(); - myV3dView->Redraw(); -} - -void View::axo() -{ - if (myIs3dView) - { - myV3dView->SetProj(V3d_XposYnegZpos); - } -} - -void View::hlrOff() -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - myV3dView->SetComputedMode(Standard_False); - myV3dView->Redraw(); - QAction* aShadingAction = getViewAction(ViewAction_Shading); - aShadingAction->setEnabled(true); - QAction* aWireframeAction = getViewAction(ViewAction_Wireframe); - aWireframeAction->setEnabled(true); - QApplication::restoreOverrideCursor(); -} - -void View::hlrOn() -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - myV3dView->SetComputedMode(Standard_True); - myV3dView->Redraw(); - QAction* aShadingAction = getViewAction(ViewAction_Shading); - aShadingAction->setEnabled(false); - QAction* aWireframeAction = getViewAction(ViewAction_Wireframe); - aWireframeAction->setEnabled(false); - QApplication::restoreOverrideCursor(); -} - -void View::shading() -{ - myContext->SetDisplayMode(1, Standard_True); -} - -void View::wireframe() -{ - myContext->SetDisplayMode(0, Standard_True); -} - -void View::SetRaytracedShadows(bool theState) -{ - myV3dView->ChangeRenderingParams().IsShadowEnabled = theState; - myIsShadowsEnabled = theState; - myContext->UpdateCurrentViewer(); -} - -void View::SetRaytracedReflections(bool theState) -{ - myV3dView->ChangeRenderingParams().IsReflectionEnabled = theState; - myIsReflectionsEnabled = theState; - myContext->UpdateCurrentViewer(); -} - -void View::onRaytraceAction() -{ - QAction* aSentBy = (QAction*)sender(); - - if (aSentBy == myRaytraceActions.value(RaytraceAction_Raytracing)) - { - bool aState = myRaytraceActions.value(RaytraceAction_Raytracing)->isChecked(); - - QApplication::setOverrideCursor(Qt::WaitCursor); - if (aState) - EnableRaytracing(); - else - DisableRaytracing(); - QApplication::restoreOverrideCursor(); - } - - if (aSentBy == myRaytraceActions.value(RaytraceAction_Shadows)) - { - bool aState = myRaytraceActions.value(RaytraceAction_Shadows)->isChecked(); - SetRaytracedShadows(aState); - } - - if (aSentBy == myRaytraceActions.value(RaytraceAction_Reflections)) - { - bool aState = myRaytraceActions.value(RaytraceAction_Reflections)->isChecked(); - SetRaytracedReflections(aState); - } - - if (aSentBy == myRaytraceActions.value(RaytraceAction_Antialiasing)) - { - bool aState = myRaytraceActions.value(RaytraceAction_Antialiasing)->isChecked(); - SetRaytracedAntialiasing(aState); - } -} - -void View::SetRaytracedAntialiasing(bool theState) -{ - myV3dView->ChangeRenderingParams().IsAntialiasingEnabled = theState; - myIsAntialiasingEnabled = theState; - myContext->UpdateCurrentViewer(); -} - -void View::EnableRaytracing() -{ - if (!myIsRaytracing) - { - myV3dView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING; - } - myIsRaytracing = true; - myContext->UpdateCurrentViewer(); -} - -void View::DisableRaytracing() -{ - if (myIsRaytracing) - { - myV3dView->ChangeRenderingParams().Method = Graphic3d_RM_RASTERIZATION; - } - myIsRaytracing = false; - myContext->UpdateCurrentViewer(); -} - -void View::updateToggled(bool isOn) -{ - QAction* sentBy = (QAction*)sender(); - if (!isOn) - { - return; - } - - foreach (QAction* anAction, myViewActions) - { - if (anAction && (anAction != sentBy)) - { - anAction->setCheckable(true); - anAction->setChecked(false); - } - else - { - if (sentBy == myViewActions.value(ViewAction_FitArea)) - setCursor(*handCursor); - else if (sentBy == myViewActions.value(ViewAction_Zoom)) - setCursor(*zoomCursor); - else if (sentBy == myViewActions.value(ViewAction_Pan)) - setCursor(*panCursor); - else if (sentBy == myViewActions.value(ViewAction_GlobalPan)) - setCursor(*globPanCursor); - else if (sentBy == myViewActions.value(ViewAction_Rotation)) - setCursor(*rotCursor); - else - setCursor(*defCursor); - - sentBy->setCheckable(false); - } - } -} - -void View::initCursors() -{ - if (!defCursor) - defCursor = new QCursor(Qt::ArrowCursor); - if (!handCursor) - handCursor = new QCursor(Qt::PointingHandCursor); - if (!panCursor) - panCursor = new QCursor(Qt::SizeAllCursor); - if (!globPanCursor) - globPanCursor = new QCursor(Qt::CrossCursor); - if (!zoomCursor) - zoomCursor = new QCursor(QPixmap(":/icons/cursor_zoom.png")); - if (!rotCursor) - rotCursor = new QCursor(QPixmap(":/icons/cursor_rotate.png")); -} - -QList View::getViewActions() -{ - initViewActions(); - return myViewActions.values(); -} - -QList View::getRaytraceActions() -{ - initRaytraceActions(); - return myRaytraceActions.values(); -} - -QAction* View::getViewAction(ViewAction theAction) -{ - return myViewActions.value(theAction); -} - -QAction* View::getRaytraceAction(RaytraceAction theAction) -{ - return myRaytraceActions.value(theAction); -} - -/*! - Get paint engine for the OpenGL viewer. [ virtual public ] -*/ -QPaintEngine* View::paintEngine() const -{ - return 0; -} - -QAction* View::RegisterAction(QString theIconPath, QString thePromt) -{ - QAction* anAction = new QAction(QPixmap(theIconPath), thePromt, this); - anAction->setToolTip(thePromt); - anAction->setStatusTip(thePromt); - return anAction; -} - -void View::initViewActions() -{ - if (!myViewActions.empty()) - return; - myViewActions[ViewAction_FitAll] = RegisterAction(":/icons/view_fitall.png", tr("Fit all")); - connect(myViewActions[ViewAction_FitAll], SIGNAL(triggered()), this, SLOT(fitAll())); - if (myIs3dView) - { - myViewActions[ViewAction_Axo] = RegisterAction(":/icons/view_axo.png", tr("Isometric")); - connect(myViewActions[ViewAction_Axo], SIGNAL(triggered()), this, SLOT(axo())); - - QActionGroup* aShadingActionGroup = new QActionGroup(this); - QAction* aShadingAction = RegisterAction(":/icons/tool_shading.png", tr("Shading")); - connect(aShadingAction, SIGNAL(triggered()), this, SLOT(shading())); - aShadingAction->setCheckable(true); - aShadingActionGroup->addAction(aShadingAction); - myViewActions[ViewAction_Shading] = aShadingAction; - - QAction* aWireframeAction = RegisterAction(":/icons/tool_wireframe.png", tr("Wireframe")); - connect(aWireframeAction, SIGNAL(triggered()), this, SLOT(wireframe())); - aWireframeAction->setCheckable(true); - aShadingActionGroup->addAction(aWireframeAction); - myViewActions[ViewAction_Wireframe] = aWireframeAction; - - QActionGroup* aHlrActionGroup = new QActionGroup(this); - QAction* aHlrOffAction = RegisterAction(":/icons/view_comp_off.png", tr("HLR off")); - connect(aHlrOffAction, SIGNAL(triggered()), this, SLOT(hlrOff())); - aHlrOffAction->setCheckable(true); - aHlrActionGroup->addAction(aHlrOffAction); - myViewActions[ViewAction_HlrOff] = aHlrOffAction; - - QAction* aHlrOnAction = RegisterAction(":/icons/view_comp_on.png", tr("HLR on")); - connect(aHlrOnAction, SIGNAL(triggered()), this, SLOT(hlrOn())); - aHlrOnAction->setCheckable(true); - aHlrActionGroup->addAction(aHlrOnAction); - myViewActions[ViewAction_HlrOn] = aHlrOnAction; - - QAction* aTransparencyAction = RegisterAction(":/icons/tool_transparency.png", tr("Transparency")); - connect(aTransparencyAction, SIGNAL(triggered()), this, SLOT(onTransparency())); - myViewActions[ViewAction_Transparency] = aTransparencyAction; - } -} - -void View::initRaytraceActions() -{ - if (!myRaytraceActions.empty()) - { - return; - } - - QAction* aRayTraceAction = RegisterAction(":/icons/raytracing.png", tr("Ray-tracing")); - connect(aRayTraceAction, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions[RaytraceAction_Raytracing] = aRayTraceAction; - aRayTraceAction->setCheckable(true); - aRayTraceAction->setChecked(false); - - QAction* aShadowAction = RegisterAction(":/icons/shadows.png", tr("Shadows")); - connect(aShadowAction, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions[RaytraceAction_Shadows] = aShadowAction; - aShadowAction->setCheckable(true); - aShadowAction->setChecked(true); - - QAction* aReflectAction = RegisterAction(":/icons/reflections.png", tr("Reflections")); - connect(aReflectAction, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions[RaytraceAction_Reflections] = aReflectAction; - aReflectAction->setCheckable(true); - aReflectAction->setChecked(false); - - QAction* anAntiAliasingAction = RegisterAction(":/icons/antialiasing.png", tr("Anti-aliasing")); - connect(anAntiAliasingAction, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); - myRaytraceActions[RaytraceAction_Antialiasing] = anAntiAliasingAction; - anAntiAliasingAction->setCheckable(true); - anAntiAliasingAction->setChecked(false); -} - -void View::activateCursor(const CurrentAction3d theMode) -{ - QCursor* aCursor = defCursor; - switch (theMode) - { - case CurrentAction3d_DynamicPanning: aCursor = panCursor; break; - case CurrentAction3d_DynamicZooming: aCursor = zoomCursor; break; - case CurrentAction3d_DynamicRotation: aCursor = rotCursor; break; - case CurrentAction3d_GlobalPanning: aCursor = globPanCursor; break; - case CurrentAction3d_WindowZooming: aCursor = handCursor; break; - case CurrentAction3d_Nothing: aCursor = defCursor; break; - default: - break; - } - setCursor(*aCursor); -} - -void View::mousePressEvent(QMouseEvent* theEvent) -{ - Qt::MouseButtons aMouseButtons = theEvent->buttons(); - const Graphic3d_Vec2i aPnt(theEvent->pos().x(), theEvent->pos().y()); - const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys(theEvent->modifiers()); - if (!myV3dView.IsNull() - && UpdateMouseButtons(aPnt, qtMouseButtons2VKeys(aMouseButtons), aFlags, false)) - { - updateView(); - } - myClickPos = aPnt; -} - -void View::mouseReleaseEvent(QMouseEvent* theEvent) -{ - Qt::MouseButtons aMouseButtons = theEvent->buttons(); - const Graphic3d_Vec2i aPnt(theEvent->pos().x(), theEvent->pos().y()); - const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys(theEvent->modifiers()); - if (!myV3dView.IsNull() - && UpdateMouseButtons(aPnt, qtMouseButtons2VKeys(aMouseButtons), aFlags, false)) - { - updateView(); - } - - if (myCurrentMode == CurrentAction3d_GlobalPanning) - { - myV3dView->Place(aPnt.x(), aPnt.y(), myCurZoom); - } - if (myCurrentMode != CurrentAction3d_Nothing) - { - setCurrentAction(CurrentAction3d_Nothing); - } -} - -void View::mouseMoveEvent(QMouseEvent* theEvent) -{ - Qt::MouseButtons aMouseButtons = theEvent->buttons(); - const Graphic3d_Vec2i aNewPos(theEvent->pos().x(), theEvent->pos().y()); - if (!myV3dView.IsNull() - && UpdateMousePosition(aNewPos, qtMouseButtons2VKeys(aMouseButtons), qtMouseModifiers2VKeys(theEvent->modifiers()), false)) - { - updateView(); - } -} - -//============================================================================== -//function : wheelEvent -//purpose : -//============================================================================== -void View::wheelEvent(QWheelEvent* theEvent) -{ - const Graphic3d_Vec2i aPos(theEvent->pos().x(), theEvent->pos().y()); - if (!myV3dView.IsNull() - && UpdateZoom(Aspect_ScrollDelta(aPos, theEvent->delta() / 8))) - { - updateView(); - } -} - -// ======================================================================= -// function : updateView -// purpose : -// ======================================================================= -void View::updateView() -{ - update(); -} - -void View::defineMouseGestures() -{ - myMouseGestureMap.Clear(); - AIS_MouseGesture aRot = AIS_MouseGesture_RotateOrbit; - activateCursor(myCurrentMode); - switch (myCurrentMode) - { - case CurrentAction3d_Nothing: - { - myMouseGestureMap = myDefaultGestures; - break; - } - case CurrentAction3d_DynamicZooming: - { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Zoom); - break; - } - case CurrentAction3d_GlobalPanning: - { - break; - } - case CurrentAction3d_WindowZooming: - { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_ZoomWindow); - break; - } - case CurrentAction3d_DynamicPanning: - { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Pan); - break; - } - case CurrentAction3d_DynamicRotation: - { - myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, aRot); - break; - } - default: - { - break; - } - } -} - -void View::addItemInPopup(QMenu* theMenu) -{ - Q_UNUSED(theMenu) -} - -void View::onBackground() -{ - QColor aColor; - Standard_Real R1; - Standard_Real G1; - Standard_Real B1; - myV3dView->BackgroundColor(Quantity_TOC_RGB, R1, G1, B1); - aColor.setRgb((Standard_Integer)(R1 * 255), (Standard_Integer)(G1 * 255), (Standard_Integer)(B1 * 255)); - - QColor aRetColor = QColorDialog::getColor(aColor); - if (aRetColor.isValid()) - { - R1 = aRetColor.red() / 255.; - G1 = aRetColor.green() / 255.; - B1 = aRetColor.blue() / 255.; - myV3dView->SetBackgroundColor(Quantity_TOC_RGB, R1, G1, B1); - } - myV3dView->Redraw(); -} - -void View::onEnvironmentMap() -{ - if (myBackMenu->actions().at(1)->isChecked()) - { - QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", - tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)")); - - const TCollection_AsciiString anUtf8Path(fileName.toUtf8().data()); - Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv(anUtf8Path); - myV3dView->SetTextureEnv(aTexture); - } - else - { - myV3dView->SetTextureEnv(Handle(Graphic3d_TextureEnv)()); - } - - myV3dView->Redraw(); -} - -void View::onTransparency() -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - if (anAisObjectsList.Extent() == 0) - { - return; - } - - double aTranspValue = anAisObjectsList.First()->Transparency(); - DialogTransparency aDlg(this); - aDlg.setValue(int(aTranspValue * 10)); - connect(&aDlg, SIGNAL(sendTransparencyChanged(int)), SLOT(onTransparencyChanged(int))); - aDlg.exec(); -} - -void View::onTransparencyChanged(int theVal) -{ - AIS_ListOfInteractive anAisObjectsList; - myContext->DisplayedObjects(anAisObjectsList); - double aTranspValue = theVal / 10.; - for(AIS_ListOfInteractive::Iterator anIter(anAisObjectsList); - anIter.More(); anIter.Next()) - { - const Handle(AIS_InteractiveObject)& anAisObject = anIter.Value(); - myContext->SetTransparency(anAisObject, aTranspValue, Standard_False); - } - myContext->UpdateCurrentViewer(); -} diff --git a/samples/qt/OCCTOverview/src/View.h b/samples/qt/OCCTOverview/src/View.h deleted file mode 100644 index a20216ca95..0000000000 --- a/samples/qt/OCCTOverview/src/View.h +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) 2020 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef VIEW_H -#define VIEW_H - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -class TopoDS_Shape; - -enum CurrentAction3d -{ - CurrentAction3d_Nothing, - CurrentAction3d_DynamicZooming, - CurrentAction3d_WindowZooming, - CurrentAction3d_DynamicPanning, - CurrentAction3d_GlobalPanning, - CurrentAction3d_DynamicRotation, - CurrentAction3d_ObjectDececting -}; -enum ViewAction -{ - ViewAction_FitAll, - ViewAction_FitArea, - ViewAction_Zoom, - ViewAction_Pan, - ViewAction_GlobalPan, - ViewAction_Front, - ViewAction_Back, - ViewAction_Top, - ViewAction_Bottom, - ViewAction_Left, - ViewAction_Right, - ViewAction_Axo, - ViewAction_Rotation, - ViewAction_Reset, - ViewAction_HlrOff, - ViewAction_HlrOn, - ViewAction_Shading, - ViewAction_Wireframe, - ViewAction_Transparency -}; -enum RaytraceAction -{ - RaytraceAction_Raytracing, - RaytraceAction_Shadows, - RaytraceAction_Reflections, - RaytraceAction_Antialiasing -}; - -//! Qt widget containing V3d_View and toolbar with view manipulation buttons. -//! Also use AIS_ViewController for redirecting user input (mouse, keyboard) -//! into 3D viewer events (rotation, panning, zooming) -class View: public QWidget, protected AIS_ViewController -{ - Q_OBJECT -public: - View (const Handle(AIS_InteractiveContext)& theContext, bool theIs3dView, QWidget* theParent); - - ~View() - { - delete myBackMenu; - } - - virtual void init(); - QList getViewActions(); - QAction* getViewAction(ViewAction theAction); - QList getRaytraceActions(); - QAction* getRaytraceAction(RaytraceAction theAction); - - void EnableRaytracing(); - void DisableRaytracing(); - - void SetRaytracedShadows (bool theState); - void SetRaytracedReflections (bool theState); - void SetRaytracedAntialiasing (bool theState); - - bool IsRaytracingMode() const { return myIsRaytracing; } - bool IsShadowsEnabled() const { return myIsShadowsEnabled; } - bool IsReflectionsEnabled() const { return myIsReflectionsEnabled; } - bool IsAntialiasingEnabled() const { return myIsAntialiasingEnabled; } - - static QString GetMessages(int type,TopAbs_ShapeEnum aSubShapeType, TopAbs_ShapeEnum aShapeType); - static QString GetShapeType(TopAbs_ShapeEnum aShapeType); - - Standard_EXPORT static void OnButtonuseraction(int ExerciceSTEP, Handle(AIS_InteractiveContext)& ); - Standard_EXPORT static void DoSelection(int Id, Handle(AIS_InteractiveContext)& ); - Standard_EXPORT static void OnSetSelectionMode(Handle(AIS_InteractiveContext)&, - Standard_Integer&, - TopAbs_ShapeEnum& SelectionMode, - Standard_Boolean& ); - virtual QPaintEngine* paintEngine() const; - const Handle(V3d_View)& getView() const { return myV3dView; } -signals: - void selectionChanged(); - -public slots: - void fitAll(); - void axo(); - void hlrOn(); - void hlrOff(); - void shading(); - void wireframe(); - void onTransparency(); - - void updateToggled( bool ); - void onBackground(); - void onEnvironmentMap(); - void onRaytraceAction(); - -private slots: -void onTransparencyChanged(int theVal); - -protected: - virtual void paintEvent( QPaintEvent* ) Standard_OVERRIDE; - virtual void resizeEvent( QResizeEvent* ) Standard_OVERRIDE; - virtual void mousePressEvent( QMouseEvent* ) Standard_OVERRIDE; - virtual void mouseReleaseEvent(QMouseEvent* ) Standard_OVERRIDE; - virtual void mouseMoveEvent( QMouseEvent* ) Standard_OVERRIDE; - virtual void wheelEvent(QWheelEvent*) Standard_OVERRIDE; - - virtual void addItemInPopup( QMenu* ); - - Handle(AIS_InteractiveContext)& getContext() { return myContext; } - - void activateCursor( const CurrentAction3d ); - - CurrentAction3d getCurrentMode() const { return myCurrentMode; } - -private: - void initCursors(); - void initViewActions(); - void initRaytraceActions(); - - QAction* RegisterAction(QString theIconPath, QString thePromt); - -private: - bool myIsRaytracing; - bool myIsShadowsEnabled; - bool myIsReflectionsEnabled; - bool myIsAntialiasingEnabled; - - bool myIs3dView; - - Handle(V3d_View) myV3dView; - Handle(AIS_InteractiveContext) myContext; - AIS_MouseGestureMap myDefaultGestures; - Graphic3d_Vec2i myClickPos; - - void updateView(); - - //! Setup mouse gestures. - void defineMouseGestures(); - - //! Set current action. - void setCurrentAction (CurrentAction3d theAction) - { - myCurrentMode = theAction; - defineMouseGestures(); - } - - //! Handle selection changed event. - void OnSelectionChanged(const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) Standard_OVERRIDE; - CurrentAction3d myCurrentMode; - Standard_Real myCurZoom; - QMap myViewActions; - QMap myRaytraceActions; - QMenu* myBackMenu; - QToolBar* myViewBar; -}; - -#endif diff --git a/samples/qt/Tutorial/.gitignore b/samples/qt/Tutorial/.gitignore deleted file mode 100644 index 7ac6e6bc69..0000000000 --- a/samples/qt/Tutorial/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/debug -/release -*.sln -*.vcxproj* -.qmake.stash -/custom.bat -/custom.sh diff --git a/samples/qt/Tutorial/CMakeLists.txt b/samples/qt/Tutorial/CMakeLists.txt deleted file mode 100644 index e9f458b364..0000000000 --- a/samples/qt/Tutorial/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -project(Tutorial) - -# Sample configuration -set (EXECUTABLE_PROJECT ON) -set (USE_QT ON) -set (RELATIVE_DIR "samples/qt") -set (TARGET_FOLDER "Samples") - -include_directories("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/${RELATIVE_DIR}") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/Interface/src") -include_directories("${OCCT_ROOT_DIR}/${RELATIVE_DIR}/Common/src") - -OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) - -# Target-specific definitions -target_compile_definitions(Tutorial PRIVATE -DNO_COMMONSAMPLE_EXPORTS -DNO_IESAMPLE_EXPORTS) - - diff --git a/samples/qt/Tutorial/EXTERNLIB.cmake b/samples/qt/Tutorial/EXTERNLIB.cmake deleted file mode 100644 index 0390483836..0000000000 --- a/samples/qt/Tutorial/EXTERNLIB.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# External dependencies for Tutorial sample -set(OCCT_Tutorial_EXTERNAL_LIBS - TKBRep - TKBool - TKBO - TKCDF - TKFillet - TKG2d - TKG3d - TKGeomAlgo - TKGeomBase - TKernel - TKHLR - TKDEIGES - TKMath - TKMesh - TKOffset - TKOpenGl - TKPrim - TKService - TKShHealing - TKDESTEP - TKDESTL - TKTopAlgo - TKV3d - TKDEVRML - TKXSBase -) \ No newline at end of file diff --git a/samples/qt/Tutorial/FILES.cmake b/samples/qt/Tutorial/FILES.cmake deleted file mode 100644 index 582da6d718..0000000000 --- a/samples/qt/Tutorial/FILES.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# Source files for Tutorial sample -set(OCCT_Tutorial_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") - -set(OCCT_Tutorial_FILES - src/ApplicationTut.cxx - src/ApplicationTut.h - src/DocumentTut.cxx - src/DocumentTut.h - src/Main.cxx - src/MakeBottle.cxx - src/Tutorial-icon.ts - src/Tutorial-string.ts - ../Common/src/ApplicationCommon.cxx - ../Common/src/ApplicationCommon.h - ../Common/src/Common-icon.ts - ../Common/src/Common-string.ts - ../Common/src/CommonSample.h - ../Common/src/DocumentCommon.cxx - ../Common/src/DocumentCommon.h - ../Common/src/Material.cxx - ../Common/src/Material.h - ../Common/src/MDIWindow.cxx - ../Common/src/MDIWindow.h - ../Common/src/OcctWindow.cxx - ../Common/src/OcctWindow.h - ../Common/src/Transparency.cxx - ../Common/src/Transparency.h - ../Common/src/View.cxx - ../Common/src/View.h - ../Interface/src/Application.cxx - ../Interface/src/Application.h - ../Interface/src/IESample.h - ../Interface/src/Interface-string.ts - ../Interface/src/Translate.cxx - ../Interface/src/Translate.h -) \ No newline at end of file diff --git a/samples/qt/Tutorial/PACKAGES.cmake b/samples/qt/Tutorial/PACKAGES.cmake deleted file mode 100644 index 7ce8db3957..0000000000 --- a/samples/qt/Tutorial/PACKAGES.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Packages for Tutorial sample -set(OCCT_Tutorial_LIST_OF_PACKAGES - Tutorial -) \ No newline at end of file diff --git a/samples/qt/Tutorial/ReadMe.md b/samples/qt/Tutorial/ReadMe.md deleted file mode 100644 index 7cbdd42668..0000000000 --- a/samples/qt/Tutorial/ReadMe.md +++ /dev/null @@ -1,11 +0,0 @@ -Qt: Bottle Tutorial (C++|Qt Widgets) {#samples_qt_tutorial} -========== - -The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object. -The purpose of the tutorial is not to explain all OCCT classes but to help start thinking in terms of the Open CASCADE Technology. - -This tutorial assumes that the user has experience in using and setting up C++. -From the viewpoint of programming, Open CASCADE Technology is designed to enhance user's C++ tools with high performance modeling classes, methods and functions. -The combination of these resources allows creating substantial applications. - -**See also:** @ref occt__tutorial "OCCT Tutorial" diff --git a/samples/qt/Tutorial/Tutorial.pro b/samples/qt/Tutorial/Tutorial.pro deleted file mode 100755 index 0ae8b2610a..0000000000 --- a/samples/qt/Tutorial/Tutorial.pro +++ /dev/null @@ -1,114 +0,0 @@ -TEMPLATE = app -CONFIG += debug_and_release qt - -TARGET = Tutorial - -isEmpty(CSF_OCCTSamplesPath) { - SAMPLESROOT = $$PWD/.. -} else { - SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt) -} - -HEADERS = src/*.h \ - $${SAMPLESROOT}/Common/src/*.h \ - $${SAMPLESROOT}/Interface/src/*.h - -SOURCES = src/*.cxx \ - $${SAMPLESROOT}/Common/src/*.cxx \ - $${SAMPLESROOT}/Interface/src/*.cxx - -TS_FILES = $${SAMPLESROOT}/Common/src/Common-icon.ts \ - $${SAMPLESROOT}/Common/src/Common-string.ts \ - ./src/Tutorial-icon.ts \ - ./src/Tutorial-string.ts - -RES_FILES = $${SAMPLESROOT}/Common/res/* \ - ./res/* - -RES_DIR = $$quote($$(RES_DIR)) - -INCLUDEPATH += $$quote($${SAMPLESROOT}/Common/src) -INCLUDEPATH += $$quote($${SAMPLESROOT}/Interface/src) -INCLUDEPATH += $$quote($$(CSF_OCCTIncludePath)) - -OCCT_DEFINES = $$(CSF_DEFINES) - -DEFINES = $$split(OCCT_DEFINES, ;) - -unix { - UNAME = $$system(uname -s) - LIBLIST = $$(LD_LIBRARY_PATH) - LIBPATHS = $$split(LIBLIST,":") - for(lib, LIBPATHS):LIBS += -L$${lib} - - CONFIG(debug, debug|release) { - DESTDIR = ./$$UNAME/bind - OBJECTS_DIR = ./$$UNAME/objd - MOC_DIR = ./$$UNAME/mocd - } else { - DESTDIR = ./$$UNAME/bin - OBJECTS_DIR = ./$$UNAME/obj - MOC_DIR = ./$$UNAME/moc - } - - MACOSX_USE_GLX = $$(MACOSX_USE_GLX) - - !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD - equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX - DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL - !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD - QMAKE_CXXFLAGS += -std=c++17 -} - -win32 { - CONFIG(debug, debug|release) { - DEFINES += _DEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bind - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/objd - MOC_DIR = ./win$$(ARCH)/$$(VCVER)/mocd - } else { - DEFINES += NDEBUG - DESTDIR = ./win$$(ARCH)/$$(VCVER)/bin - OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj - MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc - } - LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath) - QMAKE_CXXFLAGS += /std:c++17 - DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS -} - -LIBS += -lTKernel -lTKMath -lTKService -lTKV3d -lTKOpenGl \ - -lTKBRep -lTKDEIGES -lTKDESTL -lTKDEVRML -lTKDESTEP \ - -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \ - -lTKXSBase -lTKShHealing -lTKHLR -lTKTopAlgo -lTKMesh -lTKPrim \ - -lTKCDF -lTKBool -lTKBO -lTKFillet -lTKOffset -lTKLCAF \ - -!exists($${RES_DIR}) { - win32 { - system(mkdir $${RES_DIR}) - } else { - system(mkdir -p $${RES_DIR}) - } -} - -lrelease.name = LRELEASE ${QMAKE_FILE_IN} -lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm -lrelease.output = ${QMAKE_FILE_BASE}.qm -lrelease.input = TS_FILES -lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm -lrelease.CONFIG += no_link target_predeps -QMAKE_EXTRA_COMPILERS += lrelease - -copy_res.name = Copy resource ${QMAKE_FILE_IN} -copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -copy_res.input = RES_FILES -copy_res.CONFIG += no_link target_predeps -win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} -unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR} -QMAKE_EXTRA_COMPILERS += copy_res -#QMAKE_CXXFLAGS += /wd4996 - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} \ No newline at end of file diff --git a/samples/qt/Tutorial/Tutorial0.pro b/samples/qt/Tutorial/Tutorial0.pro deleted file mode 100644 index 0c46b29be6..0000000000 --- a/samples/qt/Tutorial/Tutorial0.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE=subdirs - -SUBDIRS=Tutorial0 - -Tutorial0.file=Tutorial.pro diff --git a/samples/qt/Tutorial/custom.bat.template b/samples/qt/Tutorial/custom.bat.template deleted file mode 100644 index dda84faa21..0000000000 --- a/samples/qt/Tutorial/custom.bat.template +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -rem Rename this file to custom.bat, -rem and define QTDIR variable. - -set "QTDIR=" diff --git a/samples/qt/Tutorial/custom.sh.template b/samples/qt/Tutorial/custom.sh.template deleted file mode 100644 index 52571f097b..0000000000 --- a/samples/qt/Tutorial/custom.sh.template +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Rename this file to custom.sh, -# and define QTDIR variable. - -export QTDIR="" diff --git a/samples/qt/Tutorial/env.bat b/samples/qt/Tutorial/env.bat deleted file mode 100755 index f44cfeb397..0000000000 --- a/samples/qt/Tutorial/env.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off - -if exist "%~dp0custom.bat" ( - call "%~dp0custom.bat" %1 %2 %3 -) - -call "%~dp0..\..\..\env.bat" %1 %2 %3 - -set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res" -set "CSF_ResourcesDefaults=%RES_DIR%" -set "CSF_TutorialResourcesDefaults=%RES_DIR%" - -set "PATH=%QTDIR%/bin;%PATH%" diff --git a/samples/qt/Tutorial/env.sh b/samples/qt/Tutorial/env.sh deleted file mode 100755 index 66610d7150..0000000000 --- a/samples/qt/Tutorial/env.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "custom.sh" ]; then - source "custom.sh" $*; -fi - -if [ -e "${aSamplePath}/../../../env.sh" ]; then - source "${aSamplePath}/../../../env.sh" $*; -fi - -if [ "${QTDIR}" != "" ]; then - export PATH=${QTDIR}/bin:${PATH} -else - aQMakePath=`which qmake` - echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script." - if [ -x "$aQMakePath" ]; then - echo "qmake from PATH will be used instead." - else - exit 1 - fi -fi - -host=`uname -s` -export STATION=$host -export RES_DIR=${aSamplePath}/${STATION}/res diff --git a/samples/qt/Tutorial/genproj.bat b/samples/qt/Tutorial/genproj.bat deleted file mode 100644 index c7ac4e8d54..0000000000 --- a/samples/qt/Tutorial/genproj.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -REM Generation of vcproj files with qmake utilite -REM Variable QTDIR and PATH to qmake executable must be defined without fail - -REM Use first argument to specify version of Visual Studio (vc10, vc11, vc12 or vc14), -REM second argument specifies architecture) (win32 or win64) -REM third argument specifies Debug or Release mode - -call "%~dp0env.bat" %1 %2 %3 - -call "%VCVARS%" %VCARCH% - -qmake -tp vc -r -o Tutorial.sln Tutorial0.pro diff --git a/samples/qt/Tutorial/make.sh b/samples/qt/Tutorial/make.sh deleted file mode 100644 index 2a4169279b..0000000000 --- a/samples/qt/Tutorial/make.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath -qmake Tutorial.pro -if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then - aNbJobs="$(getconf _NPROCESSORS_ONLN)" - if [ "${CASDEB}" == "d" ]; then - make -j $aNbJobs debug - else - make -j $aNbJobs release - fi -fi diff --git a/samples/qt/Tutorial/msvc.bat b/samples/qt/Tutorial/msvc.bat deleted file mode 100644 index e428205044..0000000000 --- a/samples/qt/Tutorial/msvc.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -Setlocal EnableDelayedExpansion - -rem Setup environment -call "%~dp0env.bat" %1 %2 %3 - -rem Define path to project file -set "PRJFILE=%~dp0Tutorial.sln" - -rem Launch Visual Studio - either professional (devenv) or Express, as available -if exist "%DevEnvDir%\devenv.exe" ( - start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" -) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( - start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" -) else ( - echo Error: Could not find MS Visual Studio ^(%VCVER%^) - echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) -) diff --git a/samples/qt/Tutorial/res/Bottle.png b/samples/qt/Tutorial/res/Bottle.png deleted file mode 100755 index 1c361c9eb2..0000000000 Binary files a/samples/qt/Tutorial/res/Bottle.png and /dev/null differ diff --git a/samples/qt/Tutorial/res/SampleImportExport.png b/samples/qt/Tutorial/res/SampleImportExport.png deleted file mode 100755 index 1c35262601..0000000000 Binary files a/samples/qt/Tutorial/res/SampleImportExport.png and /dev/null differ diff --git a/samples/qt/Tutorial/run.bat b/samples/qt/Tutorial/run.bat deleted file mode 100644 index e62d672912..0000000000 --- a/samples/qt/Tutorial/run.bat +++ /dev/null @@ -1,23 +0,0 @@ -Setlocal EnableDelayedExpansion - -call "%~dp0env.bat" %1 %2 %3 - -set "BIN_DIR=win%ARCH%\%VCVER%\bind" -if ["%CASDEB%"] == [""] ( - set "BIN_DIR=win%ARCH%\%VCVER%\bin" -) - -if not exist "%~dp0%BIN_DIR%\Tutorial.exe" goto ERR_EXE - -echo Starting Tutorial ..... -"%~dp0%BIN_DIR%\Tutorial.exe" - -goto END - -:ERR_EXE -echo Executable %~dp0%BIN_DIR%\Tutorial.exe not found. -echo Probably you didn't compile the application. -pause -goto END - -:END \ No newline at end of file diff --git a/samples/qt/Tutorial/run.sh b/samples/qt/Tutorial/run.sh deleted file mode 100755 index d314656906..0000000000 --- a/samples/qt/Tutorial/run.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi -cd $aSamplePath - -aSystem=`uname -s` -if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - if [ "${CASDEB}" == "d" ]; then - BIN_DIR="${aSamplePath}/build/Debug/Tutorial.app/Contents/MacOS" - else - BIN_DIR="${aSamplePath}/build/Release/Tutorial.app/Contents/MacOS" - fi -else - BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}" -fi - -CSF_ResourcesDefaults="${RES_DIR}" -CSF_TutorialResourcesDefaults="${RES_DIR}" - -PATH="${BIN_DIR}:${PATH}" - -export CSF_TutorialResourcesDefaults CSF_ResourcesDefaults -export PATH - -if test ! -r "${BIN_DIR}/Tutorial"; then - echo "Executable \"${BIN_DIR}/Tutorial\" not found." - if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then - echo "Probably you don't compile the application. Build it with Xcode." - else - echo "Probably you don't compile the application. Execute \"make\"." - fi - exit 1 -fi - -${BIN_DIR}/Tutorial diff --git a/samples/qt/Tutorial/src/ApplicationTut.cxx b/samples/qt/Tutorial/src/ApplicationTut.cxx deleted file mode 100755 index e2ea797705..0000000000 --- a/samples/qt/Tutorial/src/ApplicationTut.cxx +++ /dev/null @@ -1,70 +0,0 @@ -#include "ApplicationTut.h" -#include "DocumentTut.h" - -#include - -#include -#include -#include -#include -#include - -ApplicationTut::ApplicationTut() - : ApplicationCommonWindow( ) -{ - createMakeBottleOperation(); -} - -ApplicationTut::~ApplicationTut() -{ -} - -void ApplicationTut::createMakeBottleOperation(){ - QPixmap MakeBottleIcon; - QString dir = getTutResourceDir() + QString( "/" ); - MakeBottleIcon = QPixmap( dir+QObject::tr( "ICON_MAKE_BOTTLE" ) ); - - QAction * MakeBottleAction = new QAction( MakeBottleIcon, QObject::tr("TBR_MAKEBOT"), this ); - MakeBottleAction->setToolTip( QObject::tr( "TBR_MAKEBOT" ) ); - MakeBottleAction->setStatusTip( QObject::tr("TBR_MAKEBOT") ); - MakeBottleAction->setShortcut( QObject::tr( "CTRL+M" ) ); - connect( MakeBottleAction, SIGNAL( triggered() ) , this, SLOT( onMakeBottleAction() ) ); - - myMakeBottleBar = addToolBar( tr( "Make Bottle" ) ); - insertToolBar( getCasCadeBar(), myMakeBottleBar ); - myMakeBottleBar->addAction( MakeBottleAction ); - myMakeBottleBar->hide(); -} - -void ApplicationTut::updateFileActions() -{ - if ( getWorkspace()->subWindowList().isEmpty() ) - { - if ( !isDocument() ) - { - myMakeBottleBar->show(); - } - else - { - myMakeBottleBar->hide(); - } - } - ApplicationCommonWindow::updateFileActions(); -} - -void ApplicationTut::onMakeBottleAction() -{ - QMdiArea* ws = ApplicationCommonWindow::getWorkspace(); - DocumentTut* doc = (DocumentTut*)( qobject_cast( ws->activeSubWindow()->widget() )->getDocument() ); - statusBar()->showMessage( QObject::tr("INF_MAKE_BOTTLE"), 5000 ); - doc->onMakeBottle(); - statusBar()->showMessage(QObject::tr("INF_DONE")); -} - -QString ApplicationTut::getTutResourceDir() -{ - static QString resDir (OSD_Environment ("CSF_TutorialResourcesDefaults").Value().ToCString()); - if (resDir.isEmpty()) - resDir = QString (OSD_Environment ("CSF_OCCTResourcePath").Value().ToCString()) + "/samples"; - return resDir; -} diff --git a/samples/qt/Tutorial/src/ApplicationTut.h b/samples/qt/Tutorial/src/ApplicationTut.h deleted file mode 100755 index fa67d31d10..0000000000 --- a/samples/qt/Tutorial/src/ApplicationTut.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef APPLICATIONTUT_H -#define APPLICATIONTUT_H - -#include "DocumentTut.h" -#include "ApplicationCommon.h" - -class ApplicationTut: public ApplicationCommonWindow -{ - Q_OBJECT - -public: - - ApplicationTut(); - ~ApplicationTut(); - - static QString getTutResourceDir(); - virtual void updateFileActions(); - -public slots: - - void onMakeBottleAction(); - -private: - void createMakeBottleOperation(); - -private: - QToolBar* myMakeBottleBar; -}; - -#endif diff --git a/samples/qt/Tutorial/src/DocumentTut.cxx b/samples/qt/Tutorial/src/DocumentTut.cxx deleted file mode 100755 index 62dbda7af8..0000000000 --- a/samples/qt/Tutorial/src/DocumentTut.cxx +++ /dev/null @@ -1,52 +0,0 @@ -#include "DocumentTut.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -TopoDS_Shape -MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness); - -DocumentTut::DocumentTut( const int theIndex, ApplicationCommonWindow* app ) -: DocumentCommon( theIndex, app ) -{ -} - -DocumentTut::~DocumentTut() -{ -} - -void DocumentTut::onMakeBottle() -{ - Handle(AIS_InteractiveContext) aCtx = getContext(); - for (V3d_ListOfView::Iterator aViewIter (aCtx->CurrentViewer()->ActiveViews()); aViewIter.More(); aViewIter.Next()) - { - const Handle(V3d_View)& aView = aViewIter.Value(); - Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams(); - aParams.RenderResolutionScale = 2.0f; - } - - const Handle(Prs3d_Drawer)& aDefDrawer = aCtx->DefaultDrawer(); - aDefDrawer->SetIsoOnTriangulation (true); - - QApplication::setOverrideCursor( Qt::WaitCursor ); - TopoDS_Shape aBottle=MakeBottle(50,70,30); - Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle); - getContext()->SetMaterial (AISBottle, Graphic3d_NameOfMaterial_Gold, Standard_False); - getContext()->SetDisplayMode(AISBottle, 1, Standard_False); - getContext()->Display(AISBottle, Standard_False); - const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle; - getContext()->SetSelected(anIOAISBottle,Standard_False); - emit selectionChanged(); - fitAll(); - QApplication::restoreOverrideCursor(); -} - - diff --git a/samples/qt/Tutorial/src/DocumentTut.h b/samples/qt/Tutorial/src/DocumentTut.h deleted file mode 100755 index f5a170ac94..0000000000 --- a/samples/qt/Tutorial/src/DocumentTut.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef DOCUMENTTUT_H -#define DOCUMENTTUT_H - -#include "DocumentCommon.h" -#include - -class SurfConstruction; -class ApplicationCommon; - -class DocumentTut : public DocumentCommon -{ - Q_OBJECT - -public: - DocumentTut( const int, ApplicationCommonWindow* ); - ~DocumentTut(); - - void onMakeBottle(); - -private: - SurfConstruction* mySurfConstructor; -}; - -#endif diff --git a/samples/qt/Tutorial/src/Main.cxx b/samples/qt/Tutorial/src/Main.cxx deleted file mode 100755 index c9a08d8823..0000000000 --- a/samples/qt/Tutorial/src/Main.cxx +++ /dev/null @@ -1,52 +0,0 @@ -#include "ApplicationTut.h" - -#include - -#include -#include -#include -#include - -int main ( int argc, char* argv[] ) -{ -#if QT_VERSION > 0x050000 - TCollection_AsciiString aPlugindsDirName = OSD_Environment ("QTDIR").Value(); - if (!aPlugindsDirName.IsEmpty()) - QApplication::addLibraryPath (QString (aPlugindsDirName.ToCString()) + "/plugins"); -#endif - QApplication a( argc, argv ); - - QString resDir = ApplicationCommonWindow::getResourceDir(); - QString resTutDir = ApplicationTut::getTutResourceDir(); - - QTranslator strTrans( 0 ); - Standard_Boolean isOK = strTrans.load( "Common-string", resDir ); - if( isOK ) - a.installTranslator( &strTrans ); - - QTranslator iconTrans( 0 ); - isOK = iconTrans.load( "Common-icon", resDir ); - if( isOK ) - a.installTranslator( &iconTrans ); - - QTranslator strTutTrans( 0 ); - isOK = strTutTrans.load( "Tutorial-string", resTutDir ); - if( isOK ) - a.installTranslator( &strTutTrans ); - - QTranslator iconTutTrans( 0 ); - isOK = iconTutTrans.load( "Tutorial-icon", resTutDir ); - if( isOK ) - a.installTranslator( &iconTutTrans ); - - QObject::connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); - - ApplicationTut* mw = new ApplicationTut(); - mw->setWindowTitle( QObject::tr( "TIT_SAMPLE" ) ); - QString aResName( resDir + QString( "/" ) + QObject::tr( "ICON_SAMPLE" ) ); - mw->setWindowIcon( QPixmap( aResName ) ); - - mw->show(); - - return a.exec(); -} diff --git a/samples/qt/Tutorial/src/MakeBottle.cxx b/samples/qt/Tutorial/src/MakeBottle.cxx deleted file mode 100755 index c89b96df84..0000000000 --- a/samples/qt/Tutorial/src/MakeBottle.cxx +++ /dev/null @@ -1,193 +0,0 @@ -#include - -#include - -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include - - -TopoDS_Shape -MakeBottle(const Standard_Real myWidth, const Standard_Real myHeight, - const Standard_Real myThickness) -{ - // Profile : Define Support Points - gp_Pnt aPnt1(-myWidth / 2., 0, 0); - gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0); - gp_Pnt aPnt3(0, -myThickness / 2., 0); - gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0); - gp_Pnt aPnt5(myWidth / 2., 0, 0); - - // Profile : Define the Geometry - Handle(Geom_TrimmedCurve) anArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4); - Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2); - Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5); - - // Profile : Define the Topology - TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1); - TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(anArcOfCircle); - TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2); - TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3); - - // Complete Profile - gp_Ax1 xAxis = gp::OX(); - gp_Trsf aTrsf; - - aTrsf.SetMirror(xAxis); - BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf); - TopoDS_Shape aMirroredShape = aBRepTrsf.Shape(); - TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape); - - BRepBuilderAPI_MakeWire mkWire; - mkWire.Add(aWire); - mkWire.Add(aMirroredWire); - TopoDS_Wire myWireProfile = mkWire.Wire(); - - // Body : Prism the Profile - TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile); - gp_Vec aPrismVec(0, 0, myHeight); - TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec); - - // Body : Apply Fillets - BRepFilletAPI_MakeFillet mkFillet(myBody); - TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE); - while(anEdgeExplorer.More()){ - TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current()); - //Add edge to fillet algorithm - mkFillet.Add(myThickness / 12., anEdge); - anEdgeExplorer.Next(); - } - - myBody = mkFillet.Shape(); - - // Body : Add the Neck - gp_Pnt neckLocation(0, 0, myHeight); - gp_Dir neckAxis = gp::DZ(); - gp_Ax2 neckAx2(neckLocation, neckAxis); - - Standard_Real myNeckRadius = myThickness / 4.; - Standard_Real myNeckHeight = myHeight / 10.; - - BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight); - TopoDS_Shape myNeck = MKCylinder.Shape(); - - myBody = BRepAlgoAPI_Fuse(myBody, myNeck); - - // Body : Create a Hollowed Solid - TopoDS_Face faceToRemove; - Standard_Real zMax = -1; - - for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE); aFaceExplorer.More(); aFaceExplorer.Next()){ - TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current()); - // Check if is the top face of the bottle’s neck - Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace); - if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){ - Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface); - gp_Pnt aPnt = aPlane->Location(); - Standard_Real aZ = aPnt.Z(); - if(aZ > zMax){ - zMax = aZ; - faceToRemove = aFace; - } - } - } - - TopTools_ListOfShape facesToRemove; - facesToRemove.Append(faceToRemove); - BRepOffsetAPI_MakeThickSolid aSolidMaker; - aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3); - myBody = aSolidMaker.Shape(); - // Threading : Create Surfaces - Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99); - Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05); - - // Threading : Define 2D Curves - gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.); - gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.); - gp_Ax2d anAx2d(aPnt, aDir); - - Standard_Real aMajor = 2. * M_PI; - Standard_Real aMinor = myNeckHeight / 10; - - Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor); - Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4); - Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI); - Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI); - gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0); - gp_Pnt2d anEllipsePnt2 = anEllipse1->Value(M_PI); - - Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2); - // Threading : Build Edges and Wires - TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1); - TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1); - TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2); - TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2); - TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1); - TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2); - BRepLib::BuildCurves3d(threadingWire1); - BRepLib::BuildCurves3d(threadingWire2); - - // Create Threading - BRepOffsetAPI_ThruSections aTool(Standard_True); - aTool.AddWire(threadingWire1); - aTool.AddWire(threadingWire2); - aTool.CheckCompatibility(Standard_False); - - TopoDS_Shape myThreading = aTool.Shape(); - - // Building the Resulting Compound - TopoDS_Compound aRes; - BRep_Builder aBuilder; - aBuilder.MakeCompound (aRes); - aBuilder.Add (aRes, myBody); - aBuilder.Add (aRes, myThreading); - - return aRes; -} - diff --git a/samples/qt/Tutorial/src/Tutorial-icon.ts b/samples/qt/Tutorial/src/Tutorial-icon.ts deleted file mode 100755 index 79dd82aec0..0000000000 --- a/samples/qt/Tutorial/src/Tutorial-icon.ts +++ /dev/null @@ -1,10 +0,0 @@ - - - - QObject - - ICON_MAKE_BOTTLE - Bottle.png - - - diff --git a/samples/qt/Tutorial/src/Tutorial-string.ts b/samples/qt/Tutorial/src/Tutorial-string.ts deleted file mode 100755 index c59ae7c248..0000000000 --- a/samples/qt/Tutorial/src/Tutorial-string.ts +++ /dev/null @@ -1,26 +0,0 @@ - - - - QObject - - TIT_SAMPLE - Tutorial - - - INF_MAKE_BOTTLE - Making bottle ......... - - - TBR_MAKEBOT - MakeBottle - - - INF_DONE - Done - - - TIT_ABOUT - Tutorial - - - diff --git a/samples/webgl/.gitignore b/samples/webgl/.gitignore deleted file mode 100644 index ecdfdf7c9c..0000000000 --- a/samples/webgl/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -/work diff --git a/samples/webgl/CMakeLists.txt b/samples/webgl/CMakeLists.txt deleted file mode 100644 index c40372570d..0000000000 --- a/samples/webgl/CMakeLists.txt +++ /dev/null @@ -1,83 +0,0 @@ -cmake_minimum_required(VERSION 3.2) - -project(occt-webgl-sample) - -set(APP_VERSION_MAJOR 1) -set(APP_VERSION_MINOR 0) -set(APP_TARGET occt-webgl-sample) - -# option to enable or disable use of precompiled headers -if (NOT DEFINED SOURCE_MAP_BASE) - set (SOURCE_MAP_BASE "" CACHE STRING "Path to source map server for debugging C++ code; e.g. http://localhost:9090/") -endif() - -# customize build -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --bind") -if (NOT "${SOURCE_MAP_BASE}" STREQUAL "") - set(CMAKE_CXX_FLAGS_DEBUG "-g4 --source-map-base ${SOURCE_MAP_BASE}") -endif() - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s WASM=1") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s MAX_WEBGL_VERSION=2") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s MODULARIZE=1") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXPORT_NAME='createOccViewerModule'") - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1") -#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s TOTAL_MEMORY=16MB") - -#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --preload-file myFile") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --extern-post-js ${CMAKE_CURRENT_SOURCE_DIR}/occt-webgl-viewer.js") - -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) -file(GLOB SOURCES - *.h - *.cpp -) -source_group ("Headers" FILES - WasmOcctView.h) -source_group ("Sources" FILES - WasmOcctView.cpp - main.cpp) - -# FreeType -find_package(freetype REQUIRED NO_DEFAULT_PATH) -if(freetype_FOUND) - message (STATUS "Using FreeType from \"${freetype_DIR}\"" ) -else() - message(WARNING "Could not find FreeType, please set freetype_DIR variable." ) -endif() - -# Open CASCADE Technology -find_package(OpenCASCADE REQUIRED NO_DEFAULT_PATH) -if(OpenCASCADE_FOUND) - message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" ) - INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR}) - LINK_DIRECTORIES(${OpenCASCADE_LIBRARY_DIR}) -else() - message(WARNING "Could not find OpenCASCADE, please set OpenCASCADE_DIR variable." ) - set(OCCT_LIBRARY_DIR) - set(OCCT_BIN_DIR) -endif() - -set(OpenCASCADE_LIBS TKRWMesh TKDEGLTF TKDEOBJ TKDEPLY TKBinXCAF TKBin TKBinL TKOpenGles TKXCAF TKVCAF TKCAF TKV3d TKHLR TKMesh TKService TKShHealing TKPrim TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKLCAF TKCDF TKernel) - -add_executable(${APP_TARGET} ${SOURCES}) -target_link_libraries( - ${APP_TARGET} - ${OpenCASCADE_LIBS} - freetype -) - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}") -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.wasm DESTINATION ${CMAKE_INSTALL_PREFIX}) -if (NOT "${SOURCE_MAP_BASE}" STREQUAL "") - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.wasm.map DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() -endif() -install(FILES occt-webgl-sample.html DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX}) -install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX}) -if (CMAKE_CXX_FLAGS MATCHES "-pthread") - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.worker.js DESTINATION ${CMAKE_INSTALL_PREFIX}) -endif() diff --git a/samples/webgl/ReadMe.md b/samples/webgl/ReadMe.md deleted file mode 100644 index d7f1150e07..0000000000 --- a/samples/webgl/ReadMe.md +++ /dev/null @@ -1,31 +0,0 @@ -WebGL: 3D Viewer (JavaScript|C++|WebAssembly) {#occt_samples_webgl} -================== - -This sample demonstrates simple way of using OCCT libraries in Web application written in C++ and translated into WebAssembly module using Emscripten SDK (emsdk): -https://emscripten.org/ - -Sample consists of the Open CASCADE 3D Viewer with a button for opening a model in BREP format. -The sample requires a WebGL 2.0 capable browser supporting WebAssembly 1.0 (Wasm). -The sample could be found within OCCT repository in folder `/samples/webgl/`. - -@figure{sample_webgl.png,"",240} height=408px - -Installation and configuration: - 1. Install Emscripten SDK and activate minimal configuration (Python, Java and CLang) following *emsdk* documentation. Activate also MinGW when building sample on Windows host. - 2. Build (using *emsdk*) or download FreeType static library. - 3. Configure CMake for building Open CASCADE Technology (OCCT) static libraries (BUILD_LIBRARY_TYPE="Static"). - For this, activate *emsdk* command prompt, configure CMake for building OCCT using cross-compilation toolchain, disable *BUILD_MODULE_Draw*. - 4. Perform building and installation steps. -~~~~~ - > ${EMSDK}/fastcomp/emscripten/cmake/Modules/Platform/Emscripten.cmake -~~~~~ - 5. Configure CMake for building this WebGL sample using *emsdk* with paths to OCCT and FreeType. Perform building and installation steps. - 6. Copy data/occ/Ball.brep from OCCT into "samples" folder within WebGL sample installation path. - 7. Navigate to installation folder and start web server from it; Python coming with *emsdk* can be used for this purpose: -~~~~~ - > python -m SimpleHTTPServer 8080 -~~~~~ - 8. Open compatible browser and enter path taking into account your web server settings: -~~~~~ - > http://localhost:8080/occt-webgl-sample.html -~~~~~ diff --git a/samples/webgl/WasmOcctView.cpp b/samples/webgl/WasmOcctView.cpp deleted file mode 100644 index 8aa88568b9..0000000000 --- a/samples/webgl/WasmOcctView.cpp +++ /dev/null @@ -1,993 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include "WasmOcctView.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -#define THE_CANVAS_ID "canvas" - -namespace -{ - //! Auxiliary wrapper for loading model. - struct ModelAsyncLoader - { - std::string Name; - std::string Path; - - ModelAsyncLoader (const char* theName, const char* thePath) - : Name (theName), Path (thePath) {} - - //! File data read event. - static void onDataRead (void* theOpaque, void* theBuffer, int theDataLen) - { - const ModelAsyncLoader* aTask = (ModelAsyncLoader* )theOpaque; - WasmOcctView::openFromMemory (aTask->Name, reinterpret_cast(theBuffer), theDataLen, false); - delete aTask; - } - - //! File read error event. - static void onReadFailed (void* theOpaque) - { - const ModelAsyncLoader* aTask = (ModelAsyncLoader* )theOpaque; - Message::DefaultMessenger()->Send (TCollection_AsciiString("Error: unable to load file ") + aTask->Path.c_str(), Message_Fail); - delete aTask; - } - }; - - //! Auxiliary wrapper for loading cubemap. - struct CubemapAsyncLoader - { - //! Image file read event. - static void onImageRead (const char* theFilePath) - { - Handle(Graphic3d_CubeMapPacked) aCubemap; - Handle(Image_AlienPixMap) anImage = new Image_AlienPixMap(); - if (anImage->Load (theFilePath)) - { - aCubemap = new Graphic3d_CubeMapPacked (anImage); - } - WasmOcctView::Instance().View()->SetBackgroundCubeMap (aCubemap, true, false); - WasmOcctView::Instance().UpdateView(); - } - - //! Image file failed read event. - static void onImageFailed (const char* theFilePath) - { - Message::DefaultMessenger()->Send (TCollection_AsciiString("Error: unable to load image ") + theFilePath, Message_Fail); - } - }; -} - -// ================================================================ -// Function : Instance -// Purpose : -// ================================================================ -WasmOcctView& WasmOcctView::Instance() -{ - static WasmOcctView aViewer; - return aViewer; -} - -// ================================================================ -// Function : WasmOcctView -// Purpose : -// ================================================================ -WasmOcctView::WasmOcctView() -: myDevicePixelRatio (1.0f), - myNbUpdateRequests (0) -{ - addActionHotKeys (Aspect_VKey_NavForward, Aspect_VKey_W, Aspect_VKey_W | Aspect_VKeyFlags_SHIFT); - addActionHotKeys (Aspect_VKey_NavBackward , Aspect_VKey_S, Aspect_VKey_S | Aspect_VKeyFlags_SHIFT); - addActionHotKeys (Aspect_VKey_NavSlideLeft, Aspect_VKey_A, Aspect_VKey_A | Aspect_VKeyFlags_SHIFT); - addActionHotKeys (Aspect_VKey_NavSlideRight, Aspect_VKey_D, Aspect_VKey_D | Aspect_VKeyFlags_SHIFT); - addActionHotKeys (Aspect_VKey_NavRollCCW, Aspect_VKey_Q, Aspect_VKey_Q | Aspect_VKeyFlags_SHIFT); - addActionHotKeys (Aspect_VKey_NavRollCW, Aspect_VKey_E, Aspect_VKey_E | Aspect_VKeyFlags_SHIFT); - - addActionHotKeys (Aspect_VKey_NavSpeedIncrease, Aspect_VKey_Plus, Aspect_VKey_Plus | Aspect_VKeyFlags_SHIFT, - Aspect_VKey_Equal, - Aspect_VKey_NumpadAdd, Aspect_VKey_NumpadAdd | Aspect_VKeyFlags_SHIFT); - addActionHotKeys (Aspect_VKey_NavSpeedDecrease, Aspect_VKey_Minus, Aspect_VKey_Minus | Aspect_VKeyFlags_SHIFT, - Aspect_VKey_NumpadSubtract, Aspect_VKey_NumpadSubtract | Aspect_VKeyFlags_SHIFT); - - // arrow keys conflict with browser page scrolling, so better be avoided in non-fullscreen mode - addActionHotKeys (Aspect_VKey_NavLookUp, Aspect_VKey_Numpad8); // Aspect_VKey_Up - addActionHotKeys (Aspect_VKey_NavLookDown, Aspect_VKey_Numpad2); // Aspect_VKey_Down - addActionHotKeys (Aspect_VKey_NavLookLeft, Aspect_VKey_Numpad4); // Aspect_VKey_Left - addActionHotKeys (Aspect_VKey_NavLookRight, Aspect_VKey_Numpad6); // Aspect_VKey_Right - addActionHotKeys (Aspect_VKey_NavSlideLeft, Aspect_VKey_Numpad1); // Aspect_VKey_Left |Aspect_VKeyFlags_SHIFT - addActionHotKeys (Aspect_VKey_NavSlideRight, Aspect_VKey_Numpad3); // Aspect_VKey_Right|Aspect_VKeyFlags_SHIFT - addActionHotKeys (Aspect_VKey_NavSlideUp, Aspect_VKey_Numpad9); // Aspect_VKey_Up |Aspect_VKeyFlags_SHIFT - addActionHotKeys (Aspect_VKey_NavSlideDown, Aspect_VKey_Numpad7); // Aspect_VKey_Down |Aspect_VKeyFlags_SHIFT -} - -// ================================================================ -// Function : ~WasmOcctView -// Purpose : -// ================================================================ -WasmOcctView::~WasmOcctView() -{ -} - -// ================================================================ -// Function : run -// Purpose : -// ================================================================ -void WasmOcctView::run() -{ - initWindow(); - initViewer(); - initDemoScene(); - if (myView.IsNull()) - { - return; - } - - myView->MustBeResized(); - myView->Redraw(); - - // There is no infinite message loop, main() will return from here immediately. - // Tell that our Module should be left loaded and handle events through callbacks. - //emscripten_set_main_loop (redrawView, 60, 1); - //emscripten_set_main_loop (redrawView, -1, 1); - EM_ASM(Module['noExitRuntime'] = true); -} - -// ================================================================ -// Function : initWindow -// Purpose : -// ================================================================ -void WasmOcctView::initWindow() -{ - myDevicePixelRatio = emscripten_get_device_pixel_ratio(); - myCanvasId = THE_CANVAS_ID; - const char* aTargetId = !myCanvasId.IsEmpty() ? myCanvasId.ToCString() : EMSCRIPTEN_EVENT_TARGET_WINDOW; - const EM_BOOL toUseCapture = EM_TRUE; - emscripten_set_resize_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onResizeCallback); - - emscripten_set_mousedown_callback (aTargetId, this, toUseCapture, onMouseCallback); - // bind these events to window to track mouse movements outside of canvas - //emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback); - //emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback); - //emscripten_set_mouseleave_callback (aTargetId, this, toUseCapture, onMouseCallback); - emscripten_set_mouseup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onMouseCallback); - emscripten_set_mousemove_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onMouseCallback); - - emscripten_set_dblclick_callback (aTargetId, this, toUseCapture, onMouseCallback); - emscripten_set_click_callback (aTargetId, this, toUseCapture, onMouseCallback); - emscripten_set_mouseenter_callback (aTargetId, this, toUseCapture, onMouseCallback); - emscripten_set_wheel_callback (aTargetId, this, toUseCapture, onWheelCallback); - - emscripten_set_touchstart_callback (aTargetId, this, toUseCapture, onTouchCallback); - emscripten_set_touchend_callback (aTargetId, this, toUseCapture, onTouchCallback); - emscripten_set_touchmove_callback (aTargetId, this, toUseCapture, onTouchCallback); - emscripten_set_touchcancel_callback(aTargetId, this, toUseCapture, onTouchCallback); - - //emscripten_set_keypress_callback (aTargetId, this, toUseCapture, onKeyCallback); - emscripten_set_keydown_callback (aTargetId, this, toUseCapture, onKeyDownCallback); - emscripten_set_keyup_callback (aTargetId, this, toUseCapture, onKeyUpCallback); - //emscripten_set_focus_callback (aTargetId, this, toUseCapture, onFocusCallback); - //emscripten_set_focusin_callback (aTargetId, this, toUseCapture, onFocusCallback); - emscripten_set_focusout_callback (aTargetId, this, toUseCapture, onFocusCallback); -} - -// ================================================================ -// Function : dumpGlInfo -// Purpose : -// ================================================================ -void WasmOcctView::dumpGlInfo (bool theIsBasic) -{ - TColStd_IndexedDataMapOfStringString aGlCapsDict; - myView->DiagnosticInformation (aGlCapsDict, theIsBasic ? Graphic3d_DiagnosticInfo_Basic : Graphic3d_DiagnosticInfo_Complete); - if (theIsBasic) - { - TCollection_AsciiString aViewport; - aGlCapsDict.FindFromKey ("Viewport", aViewport); - aGlCapsDict.Clear(); - aGlCapsDict.Add ("Viewport", aViewport); - } - aGlCapsDict.Add ("Display scale", TCollection_AsciiString(myDevicePixelRatio)); - - // beautify output - { - TCollection_AsciiString* aGlVer = aGlCapsDict.ChangeSeek ("GLversion"); - TCollection_AsciiString* aGlslVer = aGlCapsDict.ChangeSeek ("GLSLversion"); - if (aGlVer != NULL - && aGlslVer != NULL) - { - *aGlVer = *aGlVer + " [GLSL: " + *aGlslVer + "]"; - aGlslVer->Clear(); - } - } - - TCollection_AsciiString anInfo; - for (TColStd_IndexedDataMapOfStringString::Iterator aValueIter (aGlCapsDict); aValueIter.More(); aValueIter.Next()) - { - if (!aValueIter.Value().IsEmpty()) - { - if (!anInfo.IsEmpty()) - { - anInfo += "\n"; - } - anInfo += aValueIter.Key() + ": " + aValueIter.Value(); - } - } - - ::Message::DefaultMessenger()->Send (anInfo, Message_Warning); -} - -// ================================================================ -// Function : initPixelScaleRatio -// Purpose : -// ================================================================ -void WasmOcctView::initPixelScaleRatio() -{ - SetTouchToleranceScale (myDevicePixelRatio); - if (!myView.IsNull()) - { - myView->ChangeRenderingParams().Resolution = (unsigned int )(96.0 * myDevicePixelRatio + 0.5); - } - if (!myContext.IsNull()) - { - myContext->SetPixelTolerance (int(myDevicePixelRatio * 6.0)); - if (!myViewCube.IsNull()) - { - static const double THE_CUBE_SIZE = 60.0; - myViewCube->SetSize (myDevicePixelRatio * THE_CUBE_SIZE, false); - myViewCube->SetBoxFacetExtension (myViewCube->Size() * 0.15); - myViewCube->SetAxesPadding (myViewCube->Size() * 0.10); - myViewCube->SetFontHeight (THE_CUBE_SIZE * 0.16); - if (myViewCube->HasInteractiveContext()) - { - myContext->Redisplay (myViewCube, false); - } - } - } -} - -// ================================================================ -// Function : initViewer -// Purpose : -// ================================================================ -bool WasmOcctView::initViewer() -{ - // Build with "--preload-file MyFontFile.ttf" option - // and register font in Font Manager to use custom font(s). - /*const char* aFontPath = "MyFontFile.ttf"; - if (Handle(Font_SystemFont) aFont = Font_FontMgr::GetInstance()->CheckFont (aFontPath)) - { - Font_FontMgr::GetInstance()->RegisterFont (aFont, true); - } - else - { - Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: font '") + aFontPath + "' is not found", Message_Fail); - }*/ - - Handle(Aspect_DisplayConnection) aDisp; - Handle(OpenGl_GraphicDriver) aDriver = new OpenGl_GraphicDriver (aDisp, false); - aDriver->ChangeOptions().buffersNoSwap = true; // swap has no effect in WebGL - aDriver->ChangeOptions().buffersOpaqueAlpha = true; // avoid unexpected blending of canvas with page background - if (!aDriver->InitContext()) - { - Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: EGL initialization failed"), Message_Fail); - return false; - } - - Handle(V3d_Viewer) aViewer = new V3d_Viewer (aDriver); - aViewer->SetComputedMode (false); - aViewer->SetDefaultShadingModel (Graphic3d_TypeOfShadingModel_Phong); - aViewer->SetDefaultLights(); - aViewer->SetLightOn(); - for (V3d_ListOfLight::Iterator aLightIter (aViewer->ActiveLights()); aLightIter.More(); aLightIter.Next()) - { - const Handle(V3d_Light)& aLight = aLightIter.Value(); - if (aLight->Type() == Graphic3d_TypeOfLightSource_Directional) - { - aLight->SetCastShadows (true); - } - } - - Handle(Wasm_Window) aWindow = new Wasm_Window (THE_CANVAS_ID); - aWindow->Size (myWinSizeOld.x(), myWinSizeOld.y()); - - myTextStyle = new Prs3d_TextAspect(); - myTextStyle->SetFont (Font_NOF_ASCII_MONO); - myTextStyle->SetHeight (12); - myTextStyle->Aspect()->SetColor (Quantity_NOC_GRAY95); - myTextStyle->Aspect()->SetColorSubTitle (Quantity_NOC_BLACK); - myTextStyle->Aspect()->SetDisplayType (Aspect_TODT_SHADOW); - myTextStyle->Aspect()->SetTextFontAspect (Font_FA_Bold); - myTextStyle->Aspect()->SetTextZoomable (false); - myTextStyle->SetHorizontalJustification (Graphic3d_HTA_LEFT); - myTextStyle->SetVerticalJustification (Graphic3d_VTA_BOTTOM); - - myView = new V3d_View (aViewer); - myView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective); - myView->SetImmediateUpdate (false); - myView->ChangeRenderingParams().IsShadowEnabled = false; - myView->ChangeRenderingParams().Resolution = (unsigned int )(96.0 * myDevicePixelRatio + 0.5); - myView->ChangeRenderingParams().ToShowStats = true; - myView->ChangeRenderingParams().StatsTextAspect = myTextStyle->Aspect(); - myView->ChangeRenderingParams().StatsTextHeight = (int )myTextStyle->Height(); - myView->SetWindow (aWindow); - dumpGlInfo (false); - - myContext = new AIS_InteractiveContext (aViewer); - initPixelScaleRatio(); - return true; -} - -// ================================================================ -// Function : initDemoScene -// Purpose : -// ================================================================ -void WasmOcctView::initDemoScene() -{ - if (myContext.IsNull()) - { - return; - } - - //myView->TriedronDisplay (Aspect_TOTP_LEFT_LOWER, Quantity_NOC_GOLD, 0.08, V3d_WIREFRAME); - - myViewCube = new AIS_ViewCube(); - // presentation parameters - initPixelScaleRatio(); - myViewCube->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_TriedronPers, Aspect_TOTP_RIGHT_LOWER, Graphic3d_Vec2i (100, 100))); - myViewCube->Attributes()->SetDatumAspect (new Prs3d_DatumAspect()); - myViewCube->Attributes()->DatumAspect()->SetTextAspect (myTextStyle); - // animation parameters - myViewCube->SetViewAnimation (myViewAnimation); - myViewCube->SetFixedAnimationLoop (false); - myViewCube->SetAutoStartAnimation (true); - myContext->Display (myViewCube, false); - - // Build with "--preload-file MySampleFile.brep" option to load some shapes here. -} - -// ================================================================ -// Function : ProcessInput -// Purpose : -// ================================================================ -void WasmOcctView::ProcessInput() -{ - if (!myView.IsNull()) - { - // Queue onRedrawView()/redrawView callback to redraw canvas after all user input is flushed by browser. - // Redrawing viewer on every single message would be a pointless waste of resources, - // as user will see only the last drawn frame due to WebGL implementation details. - // -1 in emscripten_async_call() redirects to requestAnimationFrame(); - // requestPostAnimationFrame() is a better under development alternative. - if (++myNbUpdateRequests == 1) - { - emscripten_async_call (onRedrawView, this, -1); - } - } -} - -// ================================================================ -// Function : UpdateView -// Purpose : -// ================================================================ -void WasmOcctView::UpdateView() -{ - if (!myView.IsNull()) - { - myView->Invalidate(); - // queue next onRedrawView()/redrawView() - ProcessInput(); - } -} - -// ================================================================ -// Function : redrawView -// Purpose : -// ================================================================ -void WasmOcctView::redrawView() -{ - if (!myView.IsNull()) - { - myNbUpdateRequests = 0; - FlushViewEvents (myContext, myView, true); - } -} - -// ================================================================ -// Function : handleViewRedraw -// Purpose : -// ================================================================ -void WasmOcctView::handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) -{ - AIS_ViewController::handleViewRedraw (theCtx, theView); - if (myToAskNextFrame) - { - // ask more frames - if (++myNbUpdateRequests == 1) - { - emscripten_async_call (onRedrawView, this, -1); - } - } -} - -// ================================================================ -// Function : onResizeEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onResizeEvent (int theEventType, const EmscriptenUiEvent* theEvent) -{ - (void )theEventType; // EMSCRIPTEN_EVENT_RESIZE or EMSCRIPTEN_EVENT_CANVASRESIZED - (void )theEvent; - if (myView.IsNull()) - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - Graphic3d_Vec2i aWinSizeNew; - aWindow->DoResize(); - aWindow->Size (aWinSizeNew.x(), aWinSizeNew.y()); - const float aPixelRatio = emscripten_get_device_pixel_ratio(); - if (aWinSizeNew != myWinSizeOld - || aPixelRatio != myDevicePixelRatio) - { - myWinSizeOld = aWinSizeNew; - if (myDevicePixelRatio != aPixelRatio) - { - myDevicePixelRatio = aPixelRatio; - initPixelScaleRatio(); - } - - myView->MustBeResized(); - myView->Invalidate(); - myView->Redraw(); - dumpGlInfo (true); - } - return EM_TRUE; -} - -//! Update canvas bounding rectangle. -EM_JS(void, jsUpdateBoundingClientRect, (), { - Module._myCanvasRect = Module.canvas.getBoundingClientRect(); -}); - -//! Get canvas bounding top. -EM_JS(int, jsGetBoundingClientTop, (), { - return Math.round(Module._myCanvasRect.top); -}); - -//! Get canvas bounding left. -EM_JS(int, jsGetBoundingClientLeft, (), { - return Math.round(Module._myCanvasRect.left); -}); - -// ================================================================ -// Function : onMouseEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onMouseEvent (int theEventType, const EmscriptenMouseEvent* theEvent) -{ - if (myView.IsNull()) - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - if (theEventType == EMSCRIPTEN_EVENT_MOUSEMOVE - || theEventType == EMSCRIPTEN_EVENT_MOUSEUP) - { - // these events are bound to EMSCRIPTEN_EVENT_TARGET_WINDOW, and coordinates should be converted - jsUpdateBoundingClientRect(); - EmscriptenMouseEvent anEvent = *theEvent; - anEvent.targetX -= jsGetBoundingClientLeft(); - anEvent.targetY -= jsGetBoundingClientTop(); - aWindow->ProcessMouseEvent (*this, theEventType, &anEvent); - return EM_FALSE; - } - - return aWindow->ProcessMouseEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE; -} - -// ================================================================ -// Function : onWheelEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onWheelEvent (int theEventType, const EmscriptenWheelEvent* theEvent) -{ - if (myView.IsNull() - || theEventType != EMSCRIPTEN_EVENT_WHEEL) - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - return aWindow->ProcessWheelEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE; -} - -// ================================================================ -// Function : onTouchEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onTouchEvent (int theEventType, const EmscriptenTouchEvent* theEvent) -{ - if (myView.IsNull()) - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - return aWindow->ProcessTouchEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE; -} - -// ================================================================ -// Function : navigationKeyModifierSwitch -// Purpose : -// ================================================================ -bool WasmOcctView::navigationKeyModifierSwitch (unsigned int theModifOld, - unsigned int theModifNew, - double theTimeStamp) -{ - bool hasActions = false; - for (unsigned int aKeyIter = 0; aKeyIter < Aspect_VKey_ModifiersLower; ++aKeyIter) - { - if (!myKeys.IsKeyDown (aKeyIter)) - { - continue; - } - - Aspect_VKey anActionOld = Aspect_VKey_UNKNOWN, anActionNew = Aspect_VKey_UNKNOWN; - myNavKeyMap.Find (aKeyIter | theModifOld, anActionOld); - myNavKeyMap.Find (aKeyIter | theModifNew, anActionNew); - if (anActionOld == anActionNew) - { - continue; - } - - if (anActionOld != Aspect_VKey_UNKNOWN) - { - myKeys.KeyUp (anActionOld, theTimeStamp); - } - if (anActionNew != Aspect_VKey_UNKNOWN) - { - hasActions = true; - myKeys.KeyDown (anActionNew, theTimeStamp); - } - } - return hasActions; -} - -// ================================================================ -// Function : onFocusEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onFocusEvent (int theEventType, const EmscriptenFocusEvent* theEvent) -{ - if (myView.IsNull() - || (theEventType != EMSCRIPTEN_EVENT_FOCUS - && theEventType != EMSCRIPTEN_EVENT_FOCUSIN // about to receive focus - && theEventType != EMSCRIPTEN_EVENT_FOCUSOUT)) - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - return aWindow->ProcessFocusEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE; -} - -// ================================================================ -// Function : onKeyDownEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onKeyDownEvent (int theEventType, const EmscriptenKeyboardEvent* theEvent) -{ - if (myView.IsNull() - || theEventType != EMSCRIPTEN_EVENT_KEYDOWN) // EMSCRIPTEN_EVENT_KEYPRESS - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - return aWindow->ProcessKeyEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE; -} - -//======================================================================= -//function : KeyDown -//purpose : -//======================================================================= -void WasmOcctView::KeyDown (Aspect_VKey theKey, - double theTime, - double thePressure) -{ - const unsigned int aModifOld = myKeys.Modifiers(); - AIS_ViewController::KeyDown (theKey, theTime, thePressure); - - const unsigned int aModifNew = myKeys.Modifiers(); - if (aModifNew != aModifOld - && navigationKeyModifierSwitch (aModifOld, aModifNew, theTime)) - { - // modifier key just pressed - } - - Aspect_VKey anAction = Aspect_VKey_UNKNOWN; - if (myNavKeyMap.Find (theKey | myKeys.Modifiers(), anAction) - && anAction != Aspect_VKey_UNKNOWN) - { - AIS_ViewController::KeyDown (anAction, theTime, thePressure); - } -} - -// ================================================================ -// Function : onKeyUpEvent -// Purpose : -// ================================================================ -EM_BOOL WasmOcctView::onKeyUpEvent (int theEventType, const EmscriptenKeyboardEvent* theEvent) -{ - if (myView.IsNull() - || theEventType != EMSCRIPTEN_EVENT_KEYUP) - { - return EM_FALSE; - } - - Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window()); - return aWindow->ProcessKeyEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE; -} - -//======================================================================= -//function : KeyUp -//purpose : -//======================================================================= -void WasmOcctView::KeyUp (Aspect_VKey theKey, - double theTime) -{ - const unsigned int aModifOld = myKeys.Modifiers(); - AIS_ViewController::KeyUp (theKey, theTime); - - Aspect_VKey anAction = Aspect_VKey_UNKNOWN; - if (myNavKeyMap.Find (theKey | myKeys.Modifiers(), anAction) - && anAction != Aspect_VKey_UNKNOWN) - { - AIS_ViewController::KeyUp (anAction, theTime); - processKeyPress (anAction); - } - - const unsigned int aModifNew = myKeys.Modifiers(); - if (aModifNew != aModifOld - && navigationKeyModifierSwitch (aModifOld, aModifNew, theTime)) - { - // modifier key released - } - - processKeyPress (theKey | aModifNew); -} - -//============================================================================== -//function : processKeyPress -//purpose : -//============================================================================== -bool WasmOcctView::processKeyPress (Aspect_VKey theKey) -{ - switch (theKey) - { - case Aspect_VKey_F: - { - myView->FitAll (0.01, false); - UpdateView(); - return true; - } - } - return false; -} - -// ================================================================ -// Function : setCubemapBackground -// Purpose : -// ================================================================ -void WasmOcctView::setCubemapBackground (const std::string& theImagePath) -{ - if (!theImagePath.empty()) - { - emscripten_async_wget (theImagePath.c_str(), "/emulated/cubemap.jpg", CubemapAsyncLoader::onImageRead, CubemapAsyncLoader::onImageFailed); - } - else - { - WasmOcctView::Instance().View()->SetBackgroundCubeMap (Handle(Graphic3d_CubeMapPacked)(), true, false); - WasmOcctView::Instance().UpdateView(); - } -} - -// ================================================================ -// Function : fitAllObjects -// Purpose : -// ================================================================ -void WasmOcctView::fitAllObjects (bool theAuto) -{ - WasmOcctView& aViewer = Instance(); - if (theAuto) - { - aViewer.FitAllAuto (aViewer.Context(), aViewer.View()); - } - else - { - aViewer.View()->FitAll (0.01, false); - } - aViewer.UpdateView(); -} - -// ================================================================ -// Function : removeAllObjects -// Purpose : -// ================================================================ -void WasmOcctView::removeAllObjects() -{ - WasmOcctView& aViewer = Instance(); - for (NCollection_IndexedDataMap::Iterator anObjIter (aViewer.myObjects); - anObjIter.More(); anObjIter.Next()) - { - aViewer.Context()->Remove (anObjIter.Value(), false); - } - aViewer.myObjects.Clear(); - aViewer.UpdateView(); -} - -// ================================================================ -// Function : removeObject -// Purpose : -// ================================================================ -bool WasmOcctView::removeObject (const std::string& theName) -{ - WasmOcctView& aViewer = Instance(); - Handle(AIS_InteractiveObject) anObj; - if (!theName.empty() - && !aViewer.myObjects.FindFromKey (theName.c_str(), anObj)) - { - return false; - } - - aViewer.Context()->Remove (anObj, false); - aViewer.myObjects.RemoveKey (theName.c_str()); - aViewer.UpdateView(); - return true; -} - -// ================================================================ -// Function : eraseObject -// Purpose : -// ================================================================ -bool WasmOcctView::eraseObject (const std::string& theName) -{ - WasmOcctView& aViewer = Instance(); - Handle(AIS_InteractiveObject) anObj; - if (!theName.empty() - && !aViewer.myObjects.FindFromKey (theName.c_str(), anObj)) - { - return false; - } - - aViewer.Context()->Erase (anObj, false); - aViewer.UpdateView(); - return true; -} - -// ================================================================ -// Function : displayObject -// Purpose : -// ================================================================ -bool WasmOcctView::displayObject (const std::string& theName) -{ - WasmOcctView& aViewer = Instance(); - Handle(AIS_InteractiveObject) anObj; - if (!theName.empty() - && !aViewer.myObjects.FindFromKey (theName.c_str(), anObj)) - { - return false; - } - - aViewer.Context()->Display (anObj, false); - aViewer.UpdateView(); - return true; -} - -// ================================================================ -// Function : openFromUrl -// Purpose : -// ================================================================ -void WasmOcctView::openFromUrl (const std::string& theName, - const std::string& theModelPath) -{ - ModelAsyncLoader* aTask = new ModelAsyncLoader (theName.c_str(), theModelPath.c_str()); - emscripten_async_wget_data (theModelPath.c_str(), (void* )aTask, ModelAsyncLoader::onDataRead, ModelAsyncLoader::onReadFailed); -} - -// ================================================================ -// Function : openFromMemory -// Purpose : -// ================================================================ -bool WasmOcctView::openFromMemory (const std::string& theName, - uintptr_t theBuffer, int theDataLen, - bool theToFree) -{ - removeObject (theName); - char* aBytes = reinterpret_cast(theBuffer); - if (aBytes == nullptr - || theDataLen <= 0) - { - return false; - } - - // Function to check if specified data stream starts with specified header. - #define dataStartsWithHeader(theData, theHeader) (::strncmp(theData, theHeader, sizeof(theHeader) - 1) == 0) - - if (dataStartsWithHeader(aBytes, "DBRep_DrawableShape")) - { - return openBRepFromMemory (theName, theBuffer, theDataLen, theToFree); - } - else if (dataStartsWithHeader(aBytes, "glTF")) - { - //return openGltfFromMemory (theName, theBuffer, theDataLen, theToFree); - } - if (theToFree) - { - free (aBytes); - } - - Message::SendFail() << "Error: file '" << theName.c_str() << "' has unsupported format"; - return false; -} - -// ================================================================ -// Function : openBRepFromMemory -// Purpose : -// ================================================================ -bool WasmOcctView::openBRepFromMemory (const std::string& theName, - uintptr_t theBuffer, int theDataLen, - bool theToFree) -{ - removeObject (theName); - - WasmOcctView& aViewer = Instance(); - TopoDS_Shape aShape; - BRep_Builder aBuilder; - bool isLoaded = false; - { - char* aRawData = reinterpret_cast(theBuffer); - Standard_ArrayStreamBuffer aStreamBuffer (aRawData, theDataLen); - std::istream aStream (&aStreamBuffer); - BRepTools::Read (aShape, aStream, aBuilder); - if (theToFree) - { - free (aRawData); - } - isLoaded = true; - } - if (!isLoaded) - { - return false; - } - - Handle(AIS_Shape) aShapePrs = new AIS_Shape (aShape); - if (!theName.empty()) - { - aViewer.myObjects.Add (theName.c_str(), aShapePrs); - } - aShapePrs->SetMaterial (Graphic3d_NameOfMaterial_Silver); - aViewer.Context()->Display (aShapePrs, AIS_Shaded, 0, false); - aViewer.View()->FitAll (0.01, false); - aViewer.UpdateView(); - - Message::DefaultMessenger()->Send (TCollection_AsciiString("Loaded file ") + theName.c_str(), Message_Info); - Message::DefaultMessenger()->Send (OSD_MemInfo::PrintInfo(), Message_Trace); - return true; -} - -// ================================================================ -// Function : displayGround -// Purpose : -// ================================================================ -void WasmOcctView::displayGround (bool theToShow) -{ - static Handle(AIS_Shape) aGroundPrs = new AIS_Shape (TopoDS_Shape()); - - WasmOcctView& aViewer = Instance(); - Bnd_Box aBox; - if (theToShow) - { - aViewer.Context()->Remove (aGroundPrs, false); - aBox = aViewer.View()->View()->MinMaxValues(); - } - if (aBox.IsVoid() - || aBox.IsZThin (Precision::Confusion())) - { - if (!aGroundPrs.IsNull() - && aGroundPrs->HasInteractiveContext()) - { - aViewer.Context()->Remove (aGroundPrs, false); - aViewer.UpdateView(); - } - return; - } - - const gp_XYZ aSize = aBox.CornerMax().XYZ() - aBox.CornerMin().XYZ(); - const double aRadius = Max (aSize.X(), aSize.Y()); - const double aZValue = aBox.CornerMin().Z() - Min (10.0, aSize.Z() * 0.01); - const double aZSize = aRadius * 0.01; - gp_XYZ aGroundCenter ((aBox.CornerMin().X() + aBox.CornerMax().X()) * 0.5, - (aBox.CornerMin().Y() + aBox.CornerMax().Y()) * 0.5, - aZValue); - - TopoDS_Compound aGround; - gp_Trsf aTrsf1, aTrsf2; - aTrsf1.SetTranslation (gp_Vec (aGroundCenter - gp_XYZ(0.0, 0.0, aZSize))); - aTrsf2.SetTranslation (gp_Vec (aGroundCenter)); - Prs3d_ToolCylinder aCylTool (aRadius, aRadius, aZSize, 50, 1); - Prs3d_ToolDisk aDiskTool (0.0, aRadius, 50, 1); - TopoDS_Face aCylFace, aDiskFace1, aDiskFace2; - BRep_Builder().MakeFace (aCylFace, aCylTool .CreatePolyTriangulation (aTrsf1)); - BRep_Builder().MakeFace (aDiskFace1, aDiskTool.CreatePolyTriangulation (aTrsf1)); - BRep_Builder().MakeFace (aDiskFace2, aDiskTool.CreatePolyTriangulation (aTrsf2)); - - BRep_Builder().MakeCompound (aGround); - BRep_Builder().Add (aGround, aCylFace); - BRep_Builder().Add (aGround, aDiskFace1); - BRep_Builder().Add (aGround, aDiskFace2); - - aGroundPrs->SetShape (aGround); - aGroundPrs->SetToUpdate(); - aGroundPrs->SetMaterial (Graphic3d_NameOfMaterial_Stone); - aGroundPrs->SetInfiniteState (false); - aViewer.Context()->Display (aGroundPrs, AIS_Shaded, -1, false); - aGroundPrs->SetInfiniteState (true); - aViewer.UpdateView(); -} - -// Module exports -EMSCRIPTEN_BINDINGS(OccViewerModule) { - emscripten::function("setCubemapBackground", &WasmOcctView::setCubemapBackground); - emscripten::function("fitAllObjects", &WasmOcctView::fitAllObjects); - emscripten::function("removeAllObjects", &WasmOcctView::removeAllObjects); - emscripten::function("removeObject", &WasmOcctView::removeObject); - emscripten::function("eraseObject", &WasmOcctView::eraseObject); - emscripten::function("displayObject", &WasmOcctView::displayObject); - emscripten::function("displayGround", &WasmOcctView::displayGround); - emscripten::function("openFromUrl", &WasmOcctView::openFromUrl); - emscripten::function("openFromMemory", &WasmOcctView::openFromMemory, emscripten::allow_raw_pointers()); - emscripten::function("openBRepFromMemory", &WasmOcctView::openBRepFromMemory, emscripten::allow_raw_pointers()); -} diff --git a/samples/webgl/WasmOcctView.h b/samples/webgl/WasmOcctView.h deleted file mode 100644 index e5be3c6cb3..0000000000 --- a/samples/webgl/WasmOcctView.h +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#ifndef _WasmOcctView_HeaderFile -#define _WasmOcctView_HeaderFile - -#include -#include -#include - -#include -#include - -class AIS_ViewCube; - -//! Sample class creating 3D Viewer within Emscripten canvas. -class WasmOcctView : protected AIS_ViewController -{ -public: - - //! Return global viewer instance. - static WasmOcctView& Instance(); - -public: //! @name methods exported by Module - - //! Set cubemap background. - //! File will be loaded asynchronously. - //! @param theImagePath [in] image path to load - static void setCubemapBackground (const std::string& theImagePath); - - //! Clear all named objects from viewer. - static void removeAllObjects(); - - //! Fit all/selected objects into view. - //! @param theAuto [in] fit selected objects (TRUE) or all objects (FALSE) - static void fitAllObjects (bool theAuto); - - //! Remove named object from viewer. - //! @param theName [in] object name - //! @return FALSE if object was not found - static bool removeObject (const std::string& theName); - - //! Temporarily hide named object. - //! @param theName [in] object name - //! @return FALSE if object was not found - static bool eraseObject (const std::string& theName); - - //! Display temporarily hidden object. - //! @param theName [in] object name - //! @return FALSE if object was not found - static bool displayObject (const std::string& theName); - - //! Show/hide ground. - //! @param theToShow [in] show or hide flag - static void displayGround (bool theToShow); - - //! Open object from the given URL. - //! File will be loaded asynchronously. - //! @param theName [in] object name - //! @param theModelPath [in] model path - static void openFromUrl (const std::string& theName, - const std::string& theModelPath); - - //! Open object from memory. - //! @param theName [in] object name - //! @param theBuffer [in] pointer to data - //! @param theDataLen [in] data length - //! @param theToFree [in] free theBuffer if set to TRUE - //! @return FALSE on reading error - static bool openFromMemory (const std::string& theName, - uintptr_t theBuffer, int theDataLen, - bool theToFree); - - //! Open BRep object from memory. - //! @param theName [in] object name - //! @param theBuffer [in] pointer to data - //! @param theDataLen [in] data length - //! @param theToFree [in] free theBuffer if set to TRUE - //! @return FALSE on reading error - static bool openBRepFromMemory (const std::string& theName, - uintptr_t theBuffer, int theDataLen, - bool theToFree); - -public: - - //! Default constructor. - WasmOcctView(); - - //! Destructor. - virtual ~WasmOcctView(); - - //! Main application entry point. - void run(); - - //! Return interactive context. - const Handle(AIS_InteractiveContext)& Context() const { return myContext; } - - //! Return view. - const Handle(V3d_View)& View() const { return myView; } - - //! Return device pixel ratio for handling high DPI displays. - float DevicePixelRatio() const { return myDevicePixelRatio; } - - //! Request view redrawing. - void UpdateView(); - -private: - - //! Create window. - void initWindow(); - - //! Create 3D Viewer. - bool initViewer(); - - //! Fill 3D Viewer with a DEMO items. - void initDemoScene(); - - //! Application event loop. - void mainloop(); - - //! Flush events and redraw view. - void redrawView(); - - //! Handle view redraw. - virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx, - const Handle(V3d_View)& theView) override; - - //! Schedule processing of window input events with the next repaint event. - virtual void ProcessInput() override; - - //! Handle key down event. - virtual void KeyDown (Aspect_VKey theKey, - double theTime, - double thePressure) override; - - //! Handle key up event. - virtual void KeyUp (Aspect_VKey theKey, - double theTime) override; - - //! Dump WebGL context information. - void dumpGlInfo (bool theIsBasic); - - //! Initialize pixel scale ratio. - void initPixelScaleRatio(); - -//! @name Emscripten callbacks -private: - //! Window resize event. - EM_BOOL onResizeEvent (int theEventType, const EmscriptenUiEvent* theEvent); - - //! Mouse event. - EM_BOOL onMouseEvent (int theEventType, const EmscriptenMouseEvent* theEvent); - - //! Scroll event. - EM_BOOL onWheelEvent (int theEventType, const EmscriptenWheelEvent* theEvent); - - //! Touch event. - EM_BOOL onTouchEvent (int theEventType, const EmscriptenTouchEvent* theEvent); - - //! Key down event. - EM_BOOL onKeyDownEvent (int theEventType, const EmscriptenKeyboardEvent* theEvent); - - //! Key up event. - EM_BOOL onKeyUpEvent (int theEventType, const EmscriptenKeyboardEvent* theEvent); - - //! Focus change event. - EM_BOOL onFocusEvent (int theEventType, const EmscriptenFocusEvent* theEvent); - -//! @name Emscripten callbacks (static functions) -private: - - static EM_BOOL onResizeCallback (int theEventType, const EmscriptenUiEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onResizeEvent (theEventType, theEvent); } - - static void onRedrawView (void* theView) - { return ((WasmOcctView* )theView)->redrawView(); } - - static EM_BOOL onMouseCallback (int theEventType, const EmscriptenMouseEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onMouseEvent (theEventType, theEvent); } - - static EM_BOOL onWheelCallback (int theEventType, const EmscriptenWheelEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onWheelEvent (theEventType, theEvent); } - - static EM_BOOL onTouchCallback (int theEventType, const EmscriptenTouchEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onTouchEvent (theEventType, theEvent); } - - static EM_BOOL onKeyDownCallback (int theEventType, const EmscriptenKeyboardEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onKeyDownEvent (theEventType, theEvent); } - - static EM_BOOL onKeyUpCallback (int theEventType, const EmscriptenKeyboardEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onKeyUpEvent (theEventType, theEvent); } - - static EM_BOOL onFocusCallback (int theEventType, const EmscriptenFocusEvent* theEvent, void* theView) - { return ((WasmOcctView* )theView)->onFocusEvent (theEventType, theEvent); } - -private: - - //! Register hot-keys for specified Action. - void addActionHotKeys (Aspect_VKey theAction, - unsigned int theHotKey1 = 0, - unsigned int theHotKey2 = 0, - unsigned int theHotKey3 = 0, - unsigned int theHotKey4 = 0, - unsigned int theHotKey5 = 0) - { - if (theHotKey1 != 0) { myNavKeyMap.Bind (theHotKey1, theAction); } - if (theHotKey2 != 0) { myNavKeyMap.Bind (theHotKey2, theAction); } - if (theHotKey3 != 0) { myNavKeyMap.Bind (theHotKey3, theAction); } - if (theHotKey4 != 0) { myNavKeyMap.Bind (theHotKey4, theAction); } - if (theHotKey5 != 0) { myNavKeyMap.Bind (theHotKey5, theAction); } - } - - //! Handle navigation keys. - bool navigationKeyModifierSwitch (unsigned int theModifOld, - unsigned int theModifNew, - double theTimeStamp); - - //! Handle hot-key. - bool processKeyPress (Aspect_VKey theKey); - -private: - - NCollection_IndexedDataMap myObjects; //!< map of named objects - - NCollection_DataMap myNavKeyMap; //!< map of Hot-Key (key+modifiers) to Action - - Handle(AIS_InteractiveContext) myContext; //!< interactive context - Handle(V3d_View) myView; //!< 3D view - Handle(Prs3d_TextAspect) myTextStyle; //!< text style for OSD elements - Handle(AIS_ViewCube) myViewCube; //!< view cube object - TCollection_AsciiString myCanvasId; //!< canvas element id on HTML page - Graphic3d_Vec2i myWinSizeOld; - float myDevicePixelRatio; //!< device pixel ratio for handling high DPI displays - unsigned int myNbUpdateRequests; //!< counter for unhandled update requests - -}; - -#endif // _WasmOcctView_HeaderFile diff --git a/samples/webgl/images/sample_webgl.png b/samples/webgl/images/sample_webgl.png deleted file mode 100644 index 7d3781faad..0000000000 Binary files a/samples/webgl/images/sample_webgl.png and /dev/null differ diff --git a/samples/webgl/main.cpp b/samples/webgl/main.cpp deleted file mode 100644 index abb7ba0326..0000000000 --- a/samples/webgl/main.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2019 OPEN CASCADE SAS -// -// This file is part of the examples of the Open CASCADE Technology software library. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - -#include - -#include "WasmOcctView.h" - -#include -#include -#include -#include -#include - -#include -#include - -//! Dummy main loop callback for a single shot. -extern "C" void onMainLoop() -{ - // do nothing here - viewer updates are handled on demand - emscripten_cancel_main_loop(); -} - -EMSCRIPTEN_KEEPALIVE int main() -{ - Message::DefaultMessenger()->Printers().First()->SetTraceLevel (Message_Trace); - Handle(Message_PrinterSystemLog) aJSConsolePrinter = new Message_PrinterSystemLog ("webgl-sample", Message_Trace); - Message::DefaultMessenger()->AddPrinter (aJSConsolePrinter); // open JavaScript console within the Browser to see this output - Message::SendTrace() << "Emscripten SDK " << __EMSCRIPTEN_major__ << "." << __EMSCRIPTEN_minor__ << "." << __EMSCRIPTEN_tiny__; -#if defined(__LP64__) - Message::SendTrace() << "Architecture: WASM 64-bit"; -#else - Message::SendTrace() << "Architecture: WASM 32-bit"; -#endif - Message::SendTrace() << "NbLogicalProcessors: " - << OSD_Parallel::NbLogicalProcessors() -#ifdef __EMSCRIPTEN_PTHREADS__ - << " (pthreads ON)" -#else - << " (pthreads OFF)" -#endif - ; - - // setup a dummy single-shot main loop callback just to shut up a useless Emscripten error message on calling eglSwapInterval() - emscripten_set_main_loop (onMainLoop, -1, 0); - - WasmOcctView& aViewer = WasmOcctView::Instance(); - aViewer.run(); - Message::DefaultMessenger()->Send (OSD_MemInfo::PrintInfo(), Message_Trace); - return 0; -} diff --git a/samples/webgl/occt-webgl-sample.html b/samples/webgl/occt-webgl-sample.html deleted file mode 100644 index 7b48a41c23..0000000000 --- a/samples/webgl/occt-webgl-sample.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - -OCCT WebGL Viewer Sample - - - -

OCCT WebGL Viewer Sample

-
- - -
- -
- - - -
-

Console output:

-

- - - - diff --git a/samples/webgl/occt-webgl-viewer.js b/samples/webgl/occt-webgl-viewer.js deleted file mode 100644 index 4dc2ec1202..0000000000 --- a/samples/webgl/occt-webgl-viewer.js +++ /dev/null @@ -1,28 +0,0 @@ -var OccViewerModule = -{ - print: (function() { - var anElement = document.getElementById('output'); - return function(theText) { anElement.innerHTML += theText + "
"; }; - })(), - printErr: function(theText) { - //var anElement = document.getElementById('output'); - //anElement.innerHTML += theText + "
"; - console.warn(theText); - }, - canvas: (function() { - var aCanvas = document.getElementById('occViewerCanvas'); - var aGlCtx = aCanvas.getContext ('webgl2', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } ); - if (aGlCtx == null) { aGlCtx = aCanvas.getContext ('webgl', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } ); } - return aCanvas; - })(), - - onRuntimeInitialized: function() { - //console.log(" @@ onRuntimeInitialized()" + Object.getOwnPropertyNames(OccViewerModule)); - } -}; - -const OccViewerModuleInitialized = createOccViewerModule(OccViewerModule); -OccViewerModuleInitialized.then(function(Module) { - //OccViewerModule.setCubemapBackground ("cubemap.jpg"); - OccViewerModule.openFromUrl ("ball", "samples/Ball.brep"); -}); diff --git a/samples/xaml/App.xaml b/samples/xaml/App.xaml deleted file mode 100644 index e922bc13c4..0000000000 --- a/samples/xaml/App.xaml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/samples/xaml/App.xaml.cpp b/samples/xaml/App.xaml.cpp deleted file mode 100644 index a948197a29..0000000000 --- a/samples/xaml/App.xaml.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// -// App.xaml.cpp -// Implementation of the App class. -// - -#include "pch.h" -#include "MainPage.xaml.h" - -using namespace uwp; - -using namespace Platform; -using namespace Windows::ApplicationModel; -using namespace Windows::ApplicationModel::Activation; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Controls::Primitives; -using namespace Windows::UI::Xaml::Data; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Interop; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Navigation; - -/// -/// Initializes the singleton application object. This is the first line of authored code -/// executed, and as such is the logical equivalent of main() or WinMain(). -/// -App::App() -{ - InitializeComponent(); - Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); -} - -/// -/// Invoked when the application is launched normally by the end user. Other entry points -/// will be used such as when the application is launched to open a specific file. -/// -/// Details about the launch request and process. -void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ theEvent) -{ -#if _DEBUG - // Show graphics profiling information while debugging. - if (IsDebuggerPresent()) - { - // Display the current frame rate counters - DebugSettings->EnableFrameRateCounter = true; - } -#endif - auto rootFrame = dynamic_cast(Window::Current->Content); - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == nullptr) - { - // Create a Frame to act as the navigation context and associate it with - // a SuspensionManager key - rootFrame = ref new Frame(); - - rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); - - if (theEvent->PreviousExecutionState == ApplicationExecutionState::Terminated) - { - // TODO: Restore the saved session state only when appropriate, scheduling the - // final launch steps after the restore is complete - - } - - if (theEvent->PrelaunchActivated == false) - { - if (rootFrame->Content == nullptr) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - rootFrame->Navigate(TypeName(MainPage::typeid), theEvent->Arguments); - } - // Place the frame in the current Window - Window::Current->Content = rootFrame; - // Ensure the current window is active - Window::Current->Activate(); - } - } - else - { - if (theEvent->PrelaunchActivated == false) - { - if (rootFrame->Content == nullptr) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - rootFrame->Navigate(TypeName(MainPage::typeid), theEvent->Arguments); - } - // Ensure the current window is active - Window::Current->Activate(); - } - } -} - -/// -/// Invoked when application execution is being suspended. Application state is saved -/// without knowing whether the application will be terminated or resumed with the contents -/// of memory still intact. -/// -/// The source of the suspend request. -/// Details about the suspend request. -void App::OnSuspending(Object^ theSender, SuspendingEventArgs^ theEvent) -{ - (void)theSender; // Unused parameter - (void)theEvent; // Unused parameter - - //TODO: Save application state and stop any background activity -} - -/// -/// Invoked when Navigation to a certain page fails -/// -/// The Frame which failed navigation -/// Details about the navigation failure -void App::OnNavigationFailed(Platform::Object ^theSender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^theEvent) -{ - throw ref new FailureException("Failed to load Page " + theEvent->SourcePageType.Name); -} \ No newline at end of file diff --git a/samples/xaml/App.xaml.h b/samples/xaml/App.xaml.h deleted file mode 100644 index 20cba08021..0000000000 --- a/samples/xaml/App.xaml.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// App.xaml.h -// Declaration of the App class. -// - -#pragma once - -#include "App.g.h" - -namespace uwp -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - ref class App sealed - { - protected: - virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ theEvent) override; - - internal: - App(); - - private: - void OnSuspending(Platform::Object^ theSender, Windows::ApplicationModel::SuspendingEventArgs^ theEvent); - void OnNavigationFailed(Platform::Object ^theSender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^theEvent); - }; -} diff --git a/samples/xaml/Assets/LockScreenLogo.scale-200.png b/samples/xaml/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 735f57adb5..0000000000 Binary files a/samples/xaml/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/samples/xaml/Assets/SplashScreen.scale-200.png b/samples/xaml/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 023e7f1fed..0000000000 Binary files a/samples/xaml/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/samples/xaml/Assets/Square150x150Logo.scale-200.png b/samples/xaml/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index af49fec1a5..0000000000 Binary files a/samples/xaml/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/samples/xaml/Assets/Square44x44Logo.scale-200.png b/samples/xaml/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index ce342a2ec8..0000000000 Binary files a/samples/xaml/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/samples/xaml/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/xaml/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index f6c02ce97e..0000000000 Binary files a/samples/xaml/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/samples/xaml/Assets/StoreLogo.png b/samples/xaml/Assets/StoreLogo.png deleted file mode 100644 index 7385b56c0e..0000000000 Binary files a/samples/xaml/Assets/StoreLogo.png and /dev/null differ diff --git a/samples/xaml/Assets/Wide310x150Logo.scale-200.png b/samples/xaml/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 288995b397..0000000000 Binary files a/samples/xaml/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/samples/xaml/CMakeLists.txt b/samples/xaml/CMakeLists.txt deleted file mode 100644 index 8265aea978..0000000000 --- a/samples/xaml/CMakeLists.txt +++ /dev/null @@ -1,112 +0,0 @@ -cmake_minimum_required(VERSION 3.4.0) -project(uwp) - -set_property(GLOBAL PROPERTY USE_FOLDERS ON) - -set(SOURCE_FILES - App.xaml.cpp - MainPage.xaml.cpp - pch.cpp - ) - -set(HEADER_FILES - App.xaml.h - MainPage.xaml.h - pch.h - ) - -set(XAML_FILES - App.xaml - MainPage.xaml - ) - -set(ASSET_FILES - Assets/LockScreenLogo.scale-200.png - Assets/SplashScreen.scale-200.png - Assets/Square150x150Logo.scale-200.png - Assets/Square44x44Logo.scale-200.png - Assets/Square44x44Logo.targetsize-24_altform-unplated.png - Assets/StoreLogo.png - Assets/Wide310x150Logo.scale-200.png - ) - -set(CONTENT_FILES - Package.appxmanifest - ) - -set(RESOURCE_FILES - ${CONTENT_FILES} ${ASSET_FILES} - uwp_TemporaryKey.pfx) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) -set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) -set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") - -set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition") - -source_group("Source Files" FILES ${SOURCE_FILES}) -source_group("Header Files" FILES ${HEADER_FILES}) -source_group("Resource Files" FILES ${RESOURCE_FILES}) -source_group("Xaml Files" FILES ${XAML_FILES}) - -if (USE_FREETYPE) - list (APPEND 3RDPARTY_DLLS "${3RDPARTY_FREETYPE_DLL}") - set_property(SOURCE ${3RDPARTY_DLLS} PROPERTY VS_DEPLOYMENT_CONTENT 1) -endif() - -add_executable(uwp WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES} ${3RDPARTY_DLLS}) - -set_property(TARGET uwp PROPERTY VS_WINRT_COMPONENT TRUE) - -# Set Visual Studio Windows target platform minimum version equal to OS version -string(REGEX MATCH "^([0-9]+\.[0-9]+\.[0-9]+)$" PLATFORM_WO_DEV_VER "${CMAKE_HOST_SYSTEM_VERSION}") -if (PLATFORM_WO_DEV_VER) - # Add tailing zero to platform version 10.0.14393 -> 10.0.14393.0 to have correct version - set (CMAKE_HOST_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}.0") -endif() -set_property(TARGET uwp PROPERTY VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") - -set_property (TARGET uwp PROPERTY FOLDER Samples) - -if (SINGLE_GENERATOR) - install (TARGETS uwp DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}") -else() - install (TARGETS uwp - CONFIGURATIONS Release RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}") - install (TARGETS uwp - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d") -endif() - -#include_directories - -# OCCT libraries for using -set (uwp_USED_LIBS TKernel - TKMath - TKG2d - TKG3d - TKGeomBase - TKBRep - TKGeomAlgo - TKTopAlgo - TKPrim - TKShHealing - TKBO - TKBool - TKFillet - TKMesh - TKFeat - TKHLR - TKOffset - TKXMesh - TKDEIGES - TKDESTEP - TKXSBase - TKDESTL - TKDEVRML - ) - -target_link_libraries (uwp ${uwp_USED_LIBS}) diff --git a/samples/xaml/MainPage.xaml b/samples/xaml/MainPage.xaml deleted file mode 100644 index 58ca32c34e..0000000000 --- a/samples/xaml/MainPage.xaml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -