Coding - Migration of Inspector to own repository #438
New repository for Inspector: https://github.com/Open-Cascade-SAS/Inspector Documentation and all build process are fully migrated. "tools" folder keep to share information for some time. Keep building inspector as before to keep control of API changes via GitHub actions.
21
.github/actions/build-tinspector/action.yml
vendored
@ -35,11 +35,18 @@ runs:
|
||||
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 6da9ba776ef72a17dca3331974df4200024c7f34
|
||||
|
||||
- name: Configure TInspector - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd tools
|
||||
cd inspector
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Visual Studio 17 2022" -A x64 `
|
||||
@ -47,40 +54,40 @@ runs:
|
||||
-D BUILD_SHARED_LIBS=ON `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 `
|
||||
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/tools/install `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/inspector/install `
|
||||
..
|
||||
|
||||
- name: Configure TInspector - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd tools
|
||||
cd inspector
|
||||
mkdir build
|
||||
cd build
|
||||
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 }}/tools/install \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/inspector/install \
|
||||
..
|
||||
|
||||
- name: Build TInspector - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd tools/build
|
||||
cd inspector/build
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
- name: Build TInspector - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd tools/build
|
||||
cd inspector/build
|
||||
make install -j$(nproc)
|
||||
|
||||
- name: Upload TInspector installation
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: inspector-${{ inputs.platform }}-x64
|
||||
path: tools/install
|
||||
path: inspector/install
|
||||
retention-days: 7
|
||||
|
@ -8,7 +8,7 @@ inputs:
|
||||
file-pattern:
|
||||
description: 'Pattern to match files for formatting check'
|
||||
required: false
|
||||
default: '^(src|tools)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
|
||||
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
|
||||
clang-format-version:
|
||||
description: 'Required clang-format version'
|
||||
required: false
|
||||
|
@ -327,8 +327,6 @@ if (MSVC)
|
||||
endif()
|
||||
set (BUILD_SAMPLES_QT OFF CACHE BOOL "${BUILD_SAMPLES_QT_DESCR}")
|
||||
|
||||
set (BUILD_Inspector OFF CACHE BOOL "${BUILD_Inspector_DESCR}")
|
||||
|
||||
# uwp sample
|
||||
if (MSVC)
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
|
||||
@ -745,8 +743,8 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC")
|
||||
endif()
|
||||
|
||||
# qt for inspector and samples
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
# qt for samples
|
||||
if (BUILD_SAMPLES_QT)
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/qt")
|
||||
@ -1021,28 +1019,6 @@ else()
|
||||
set (SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
# OCCT tools
|
||||
# include original list of tools
|
||||
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
|
||||
# list <OCCT_TOOLS> will contain all tools
|
||||
if (BUILD_Inspector)
|
||||
add_definitions (-DHAVE_Inspector)
|
||||
|
||||
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
|
||||
foreach (OCCT_TOOL ${OCCT_TOOLS})
|
||||
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
|
||||
endforeach()
|
||||
|
||||
# collect all the headers to <binary dir>/inc/inspector folder
|
||||
|
||||
# Ensure the include directory exists
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/inspector")
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "tools" "${INSTALL_DIR_INCLUDE}/inspector")
|
||||
endif()
|
||||
|
||||
# OCCT samples
|
||||
# get absolute path from INSTALL_DIR
|
||||
set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}")
|
||||
@ -1227,13 +1203,6 @@ if (MSVC AND 3RDPARTY_DLL_DIRS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include patched toolkit projects or original ones
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
|
||||
OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
|
||||
# samples do not support patch usage
|
||||
if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT)
|
||||
@ -1255,7 +1224,7 @@ endif()
|
||||
|
||||
OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
|
||||
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
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)
|
||||
@ -1284,15 +1253,6 @@ if (BUILD_MODULE_UwpSample)
|
||||
add_subdirectory(samples/xaml)
|
||||
endif()
|
||||
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
|
||||
# patch TInspectorEXE
|
||||
OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/tools/TInspectorEXE/TInspectorEXE.vcxproj.user")
|
||||
endif()
|
||||
|
||||
# Prepare variables for configuration of OpenCASCADE cmake config file
|
||||
set (OCCT_MODULES_ENABLED)
|
||||
set (OCCT_LIBRARIES)
|
||||
|
@ -1,4 +0,0 @@
|
||||
TModelingData TKShapeView TKMessageModel TKMessageView
|
||||
TVisualization TKView TKVInspector
|
||||
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
|
||||
TTool TKTInspector TKToolsDraw TInspectorEXE
|
20
adm/UDLIST
@ -472,26 +472,6 @@ n RWGltf
|
||||
n RWMesh
|
||||
n RWObj
|
||||
n RWPly
|
||||
n DFBrowser
|
||||
n DFBrowserPane
|
||||
n DFBrowserPaneXDE
|
||||
n ShapeView
|
||||
n TInspector
|
||||
n TInspectorAPI
|
||||
x TInspectorEXE
|
||||
t TKDFBrowser
|
||||
t TKShapeView
|
||||
t TKTInspector
|
||||
t TKTInspectorAPI
|
||||
t TKToolsDraw
|
||||
t TKTreeModel
|
||||
t TKView
|
||||
t TKVInspector
|
||||
n ToolsDraw
|
||||
n TreeModel
|
||||
n View
|
||||
n ViewControl
|
||||
n VInspector
|
||||
n Express
|
||||
t TKExpress
|
||||
x ExpToCasExe
|
||||
|
@ -1,13 +0,0 @@
|
||||
if ("${TARGET_FOLDER}" STREQUAL "")
|
||||
set (USE_QT ON)
|
||||
set (RELATIVE_DIR "tools")
|
||||
set (MODULES_LIST ${OCCT_TOOLS})
|
||||
set (TARGET_FOLDER "Tools")
|
||||
set (TOOLKITS_NAME_SUFFIX "TOOL_TOOLKITS")
|
||||
else()
|
||||
unset (USE_QT)
|
||||
unset (RELATIVE_DIR)
|
||||
unset (MODULES_LIST)
|
||||
unset (TARGET_FOLDER)
|
||||
unset (TOOLKITS_NAME_SUFFIX)
|
||||
endif("${TARGET_FOLDER}" STREQUAL "")
|
@ -137,13 +137,6 @@ set (BUILD_SAMPLES_QT_DESCR
|
||||
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_Inspector_DESCR
|
||||
"Indicates whether OCCT inspector should be built together with OCCT.
|
||||
This inspector provides functionality to interactively inspect low-level content
|
||||
of the OCAF data model, OCCT viewer, etc. have been introduced in OCCT.
|
||||
It can be executed with script inspector.bat from the installation directory (INSTALL_DIR) or
|
||||
using 'tinspector' command in DRAW interpretator")
|
||||
|
||||
set (BUILD_MODULE_UwpSample_DESCR
|
||||
"Indicates whether OCCT UWP sample should be built together with OCCT.")
|
||||
|
||||
|
@ -16,7 +16,6 @@ rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
|
||||
rem set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
rem set BUILD_DOC_Overview=OFF
|
||||
rem set BUILD_Inspector=OFF
|
||||
rem set BUILD_LIBRARY_TYPE=Shared
|
||||
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
rem set BUILD_WITH_DEBUG=OFF
|
||||
|
@ -11,7 +11,6 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
|
||||
#INSTALL_DIR="$SrcRoot/install"
|
||||
|
||||
#BUILD_DOC_Overview=OFF
|
||||
#BUILD_Inspector=OFF
|
||||
#BUILD_LIBRARY_TYPE=Shared
|
||||
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
#BUILD_WITH_DEBUG=OFF
|
||||
|
@ -17,7 +17,6 @@ set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
set BUILD_ADDITIONAL_TOOLKITS=
|
||||
set BUILD_DOC_Overview=OFF
|
||||
set BUILD_Inspector=OFF
|
||||
set BUILD_LIBRARY_TYPE=Shared
|
||||
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
set BUILD_WITH_DEBUG=OFF
|
||||
@ -58,7 +57,6 @@ cmake -G "%arch_compile%" ^
|
||||
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
|
||||
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
|
||||
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
|
||||
-D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
|
||||
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
|
||||
|
@ -22,7 +22,6 @@ INSTALL_DIR_LIB=lin64/gcc/lib$DEB
|
||||
|
||||
BUILD_ADDITIONAL_TOOLKITS=
|
||||
BUILD_DOC_Overview=OFF
|
||||
BUILD_Inspector=OFF
|
||||
BUILD_LIBRARY_TYPE=Shared
|
||||
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
BUILD_WITH_DEBUG=OFF
|
||||
@ -59,7 +58,6 @@ cmake -G "Unix Makefiles" \
|
||||
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
|
||||
-D BUILD_ADDITIONAL_TOOLKITS:STRING="$BUILD_ADDITIONAL_TOOLKITS" \
|
||||
-D BUILD_DOC_Overview:BOOL=$BUILD_DOC_Overview \
|
||||
-D BUILD_Inspector:BOOL=$BUILD_Inspector \
|
||||
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
|
||||
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
|
||||
|
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@i;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@d;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -1,17 +0,0 @@
|
||||
@echo off
|
||||
|
||||
rem Use:
|
||||
rem - first argument specifies version of Visual Studio (vc8, vc9, or vc10),
|
||||
rem - second argument specifies architecture (win32 or win64),
|
||||
rem - third argument specifies build mode (Debug or Release)
|
||||
rem - fourth and next arguments specify loaded tool plugins
|
||||
rem The arguments are: dfbrowser shapeview vinspector
|
||||
rem If there are no tool plugins are specified, all plugins will be loaded
|
||||
rem Default options are:
|
||||
rem vc8 win32 Release
|
||||
|
||||
rem Setup environment and launch TInspector
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
TInspectorEXE.exe %*
|
||||
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
aCurrentPath="$PWD"
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
source "${aScriptPath}/env.sh" "$1"
|
||||
|
||||
cd ${aCurrentPath}
|
||||
TInspectorEXE
|
@ -48,7 +48,6 @@ user_guides/xde/xde.md
|
||||
user_guides/de_wrapper/de_wrapper.md
|
||||
user_guides/ocaf/ocaf.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
user_guides/inspector/inspector.md
|
||||
user_guides/vis/vis.md
|
||||
|
||||
specification/specification.md
|
||||
|
@ -21,7 +21,6 @@ user_guides/iges/iges.md
|
||||
user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/de_wrapper/de_wrapper.md
|
||||
user_guides/inspector/inspector.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
|
||||
contribution/contribution_workflow/contribution_workflow.md
|
||||
|
@ -62,7 +62,6 @@ Additionally, @ref occt_user_guides__modeling_algos "Modeling Algorithms" are us
|
||||
|
||||
The **Topology** section of the Overview demonstrates the functions used in 3D operations.
|
||||
Multiple use cases are provided, including different object intersections, modifying and calculations.
|
||||
Some of these use cases are described in the documentation, such as @ref occt_user_guides__inspector "Inspector" usage.
|
||||
|
||||
@figure{sample_overview_qt_topology.png,"",240} height=440px
|
||||
|
||||
|
@ -10885,6 +10885,7 @@ mdist
|
||||
|
||||
|
||||
This section describes commands that make possible to use Inspector.
|
||||
Inspector available in https://github.com/Open-Cascade-SAS/Inspector repository.
|
||||
|
||||
@subsection occt_draw_13_1 tinspector
|
||||
|
||||
|
Before Width: | Height: | Size: 6.9 KiB |
@ -1,224 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="165.36458mm"
|
||||
height="99.483337mm"
|
||||
viewBox="0 0 165.36458 99.483337"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
sodipodi:docname="3DView_elements.svg"
|
||||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="237.05748"
|
||||
inkscape:cy="217.01184"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1410"
|
||||
inkscape:window-height="786"
|
||||
inkscape:window-x="265"
|
||||
inkscape:window-y="101"
|
||||
inkscape:window-maximized="0"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
showborder="true"
|
||||
inkscape:showpageshadow="false" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-208.35938,-140.66904)">
|
||||
<rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4147-9"
|
||||
width="164.83542"
|
||||
height="98.95417"
|
||||
x="208.62396"
|
||||
y="140.93362"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5"
|
||||
width="155.95102"
|
||||
height="20.214758"
|
||||
x="212.62312"
|
||||
y="145.17099"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4159-1"
|
||||
width="155.83388"
|
||||
height="64.776878"
|
||||
x="212.62471"
|
||||
y="170.05089"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.36620295;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1"
|
||||
width="30.417513"
|
||||
height="11.316654"
|
||||
x="286.53876"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.36620295;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-5-9"
|
||||
width="30.417513"
|
||||
height="11.316654"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="295.72775"
|
||||
y="156.1628"
|
||||
id="text5675-5"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3"
|
||||
x="295.72775"
|
||||
y="156.1628"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Single</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="331.03946"
|
||||
y="156.53418"
|
||||
id="text5679-5"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0"
|
||||
x="331.03946"
|
||||
y="156.53418"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Clean</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.45057005;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-8-33"
|
||||
width="14.354354"
|
||||
height="56.42762"
|
||||
x="216.9996"
|
||||
y="174.34537"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.83517319;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-7-0"
|
||||
width="67.939919"
|
||||
height="26.352776"
|
||||
x="265.93634"
|
||||
y="189.26295"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.3866663px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222221px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="295.6308"
|
||||
y="201.46571"
|
||||
id="text5683-5-2"
|
||||
transform="scale(0.98830373,1.0118347)"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5685-3-7"
|
||||
x="295.6308"
|
||||
y="201.46571"
|
||||
style="font-size:3.83516741px;line-height:1.25;stroke-width:0.28222221px">3D view</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.36620298;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1-3"
|
||||
width="30.417513"
|
||||
height="11.316654"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="227.84984"
|
||||
y="156.48491"
|
||||
id="text5675-5-2"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-2"
|
||||
x="227.84984"
|
||||
y="156.48491"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">View</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.36620298;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1-9"
|
||||
width="30.417513"
|
||||
height="11.316654"
|
||||
x="251.86369"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="262.35156"
|
||||
y="156.53418"
|
||||
id="text5675-5-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-0"
|
||||
x="262.35156"
|
||||
y="156.53418"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Multi</tspan></text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 38 KiB |
@ -1,27 +0,0 @@
|
||||
<svg width="609" height="426" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="Layer_1">
|
||||
<title>Layer 1</title>
|
||||
<rect stroke="#58a50b" id="svg_1" height="424.00001" width="605" y="-0.00001" x="0.5" stroke-width="4" fill="#ffffff"/>
|
||||
<rect id="svg_2" height="89" width="575" y="16" x="13.5" stroke-width="4" stroke="#58a50b" fill="#66af1c"/>
|
||||
<rect stroke="#58a50b" id="svg_3" height="280" width="277.99999" y="121" x="16.5" stroke-width="4" fill="#66af1c"/>
|
||||
<rect stroke="#58a50b" id="svg_4" height="122" width="277.99999" y="120" x="309.5" stroke-width="4" fill="#66af1c"/>
|
||||
<rect stroke="#58a50b" id="svg_5" height="140" width="277.99999" y="256" x="310.5" stroke-width="4" fill="#66af1c"/>
|
||||
<rect id="svg_6" height="64" width="219" y="184" x="47.5" stroke-width="4" stroke="#58a50b" fill="#ffffff"/>
|
||||
<rect id="svg_7" height="40" width="277" y="36" x="30.5" stroke-width="4" stroke="#58a50b" fill="#ffffff"/>
|
||||
<rect stroke="#58a50b" id="svg_8" height="40" width="112" y="36" x="321.5" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#58a50b" id="svg_10" height="40" width="119" y="36" x="446.5" stroke-width="4" fill="#ffffff"/>
|
||||
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_11" y="61" x="98.5" stroke-width="0" stroke="#58a50b" fill="#000000">Tree Navigation</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_12" y="63" x="338.5" stroke-width="0" stroke="#58a50b" fill="#000000">Update</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_13" y="65" x="474.5" stroke-width="0" stroke="#58a50b" fill="#ffffff">Search</text>
|
||||
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_14" y="62" x="475.5" stroke-width="0" stroke="#58a50b" fill="#000000">Search</text>
|
||||
<rect stroke="#58a50b" id="svg_20" height="54" width="136.99999" y="291" x="318.5" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#58a50b" id="svg_21" height="52" width="188" y="180" x="391.5" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#58a50b" id="svg_22" height="54" width="163" y="136" x="323.5" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#58a50b" id="svg_23" height="53" width="146" y="317" x="426.5" stroke-width="4" fill="#ffffff"/>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_27" y="170" x="338.5" stroke-width="0" stroke="#58a50b" fill="#000000">Property panel</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_28" y="227" x="83.5" stroke-width="0" stroke="#58a50b" fill="#000000">OCAF tree view</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="21" id="svg_30" y="322" x="322.5" stroke-width="0" stroke="#58a50b" fill="#000000">Dump View</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_31" y="352" x="459.5" stroke-width="0" stroke="#58a50b" fill="#000000">3D View</text>
|
||||
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="18" id="svg_32" y="214" x="398.5" stroke-width="0" stroke="#58a50b" fill="#000000">Property panel (custom)</text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 33 KiB |
@ -1,21 +0,0 @@
|
||||
<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="Layer_1">
|
||||
<title>Layer 1</title>
|
||||
<rect stroke="#ff56ff" id="svg_1" height="296.99999" width="297.00002" y="1.6" x="1" stroke-width="4" fill="#ffffff"/>
|
||||
<rect id="svg_3" height="120" width="136" y="22.6" x="153" stroke-width="4" stroke="#ff56ff" fill="#ff56ff"/>
|
||||
<rect stroke="#ff56ff" id="svg_4" height="259.99999" width="126.99999" y="18.6" x="16" stroke-width="4" fill="#ff56ff"/>
|
||||
<rect stroke="#ff56ff" id="svg_5" height="122" width="131" y="155.6" x="156" stroke-width="4" fill="#ff56ff"/>
|
||||
<rect stroke="#ff56ff" id="svg_6" height="41.00001" width="125" y="87.6" x="17" stroke-width="4" fill="#ffffff"/>
|
||||
<rect id="svg_7" height="3" width="2" y="364.6" x="89" stroke-width="4" stroke="#ff56ff" fill="#ffffff"/>
|
||||
<rect stroke="#ffffff" id="svg_8" height="41.00001" width="117" y="126.6" x="21" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#ff56ff" id="svg_9" height="41.00001" width="125" y="63.6" x="164" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#ff56ff" id="svg_10" height="64.00001" width="114.00001" y="158.6" x="159" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#ff56ff" id="svg_11" height="41.00001" width="101.00001" y="215.6" x="184" stroke-width="4" fill="#ffffff"/>
|
||||
<text transform="matrix(0.742836 0 0 0.850555 6.17194 14.6433)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_13" y="119.6" x="24" stroke-width="0" fill="#000000">Message report</text>
|
||||
<text style="cursor: move;" transform="matrix(0.742836 0 0 0.850555 6.17194 46.6433)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_14" y="118.4243" x="24" stroke-width="0" fill="#000000">tree view</text>
|
||||
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_15" y="90.6" x="167" stroke-width="0" stroke="#ff56ff" fill="#000000">Dump panel</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_16" y="245.6" x="190" stroke-width="0" stroke="#ff56ff" fill="#000000">3D View</text>
|
||||
<text transform="matrix(0.784367 0 0 0.769922 36.8545 36.9383)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_17" y="181.6" x="157" stroke-width="0" fill="#000000">Property panel</text>
|
||||
<text transform="matrix(0.884685 0 0 0.774516 20.9874 38.7657)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_18" y="206.5113" x="176.34827" stroke-width="0" fill="#000000">(custom)</text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 62 KiB |
@ -1,16 +0,0 @@
|
||||
<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="Layer_1">
|
||||
<title>Layer 1</title>
|
||||
<rect stroke-width="4" stroke="#ffaa56" id="svg_1" height="295" width="294.99999" y="2.59999" x="3" fill="#fff"/>
|
||||
<rect id="svg_3" height="252" width="130" y="26.6" x="20" stroke-width="4" stroke="#ffaa56" fill="#ffaa56"/>
|
||||
<rect stroke="#ffaa56" id="svg_4" height="121.00001" width="130" y="157.6" x="158" stroke-width="4" fill="#ffaa56"/>
|
||||
<rect stroke="#ffaa56" id="svg_5" height="116.99999" width="130" y="25.6" x="159" stroke-width="4" fill="#ffaa56"/>
|
||||
<rect stroke="#ffaa56" id="svg_10" height="83" width="120" y="97.6" x="24" stroke-width="0" fill="#ffffff"/>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_12" y="125.6" x="33" stroke-width="0" stroke="#7f7f2f" fill="#000000">Topo_DS</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_13" y="160.6" x="28" stroke-width="0" stroke="#7f7f2f" fill="#000000">Shape view</text>
|
||||
<rect stroke="#ffaa56" id="svg_14" height="50" width="120" y="197.6" x="164" stroke-width="0" fill="#ffffff"/>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_15" y="231.6" x="184" stroke-width="0" stroke="#7f7f2f" fill="#000000">3D view</text>
|
||||
<rect stroke="#ffaa56" id="svg_16" height="50" width="125.99999" y="59.6" x="161" stroke-width="0" fill="#ffffff"/>
|
||||
<text transform="matrix(0.893464 0 0 0.962463 18.0458 2.59472)" stroke="#7f7f2f" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_17" y="92.678" x="160" stroke-width="0" fill="#000000">Property panel</text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 19 KiB |
@ -1,19 +0,0 @@
|
||||
<svg width="609" height="426" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
<g>
|
||||
<title>Layer 1</title>
|
||||
<rect stroke="#7f3f00" stroke-width="4" id="svg_2" height="419.99998" width="605.00004" y="2.8" x="1.99999" fill="#ffffff"/>
|
||||
<rect id="svg_5" height="193" width="413" y="207.8" x="167" stroke-width="3" stroke="#08a4d8" fill="#ffffff"/>
|
||||
<rect stroke="#f2780e" id="svg_6" height="193.99999" width="409.99997" y="173.8" x="137" opacity="NaN" stroke-width="3" fill="#ffffff"/>
|
||||
<rect stroke="#d608cb" id="svg_7" height="192" width="404.99998" y="136.8" x="106" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#5fbf00" id="svg_9" height="193" width="406.00001" y="91.8" x="66.99999" stroke-width="4" fill="#ffffff"/>
|
||||
<rect id="svg_10" height="43" width="137" y="23.8" x="19" stroke-width="4" stroke="#5fbf00" fill="#5fbf00"/>
|
||||
<rect stroke="#d608cb" id="svg_16" height="43" width="137" y="23.8" x="163" stroke-width="4" fill="#ffffff"/>
|
||||
<rect stroke="#f2780e" opacity="NaN" id="svg_17" height="42" width="135" y="23.8" x="309" stroke-width="3" fill="#ffffff"/>
|
||||
<rect stroke="#08a4d8" id="svg_18" height="43" width="135" y="23.8" x="451" stroke-width="3" fill="#ffffff"/>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_19" y="52.8" x="32" stroke-width="0" stroke="#08a4d8" fill="#000000">DFBrowser</text>
|
||||
<text transform="matrix(0.903837 0 0 1 19.0402 0)" stroke="#010b0f" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_22" y="52.8" x="165.91458" stroke-width="0" fill="#000000">MessageView</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_23" y="52.8" x="325" stroke-width="0" stroke="#5fbf00" fill="#000000">ShapeView</text>
|
||||
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_24" y="51.8" x="463" stroke-width="0" stroke="#7f3f00" fill="#000000">VInspector</text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.9 KiB |
@ -1,417 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="165.36458mm"
|
||||
height="99.483337mm"
|
||||
viewBox="0 0 165.36458 99.483337"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
sodipodi:docname="treeview_preferences.svg"
|
||||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
|
||||
<defs
|
||||
id="defs2">
|
||||
<linearGradient
|
||||
id="linearGradient920"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#f0f0f0;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop918" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="237.05748"
|
||||
inkscape:cy="217.01184"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1336"
|
||||
inkscape:window-height="850"
|
||||
inkscape:window-x="276"
|
||||
inkscape:window-y="52"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
showborder="true"
|
||||
inkscape:showpageshadow="false" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-208.35938,-140.66904)">
|
||||
<rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4147-9"
|
||||
width="164.83542"
|
||||
height="98.95417"
|
||||
x="208.62396"
|
||||
y="140.93362"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#e3f4d7;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4159-1"
|
||||
width="155.83388"
|
||||
height="89.326508"
|
||||
x="212.62471"
|
||||
y="145.50125"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.42238337;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1"
|
||||
width="40.466312"
|
||||
height="11.316654"
|
||||
x="280.74753"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.42572066;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-5-9"
|
||||
width="41.108295"
|
||||
height="11.316654"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="291.19687"
|
||||
y="156.27933"
|
||||
id="text5675-5"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3"
|
||||
x="291.19687"
|
||||
y="156.27933"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_1</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="331.87143"
|
||||
y="156.27933"
|
||||
id="text5679-5"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0"
|
||||
x="331.87143"
|
||||
y="156.27933"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_4</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.97454143;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-7-0"
|
||||
width="145.13353"
|
||||
height="68.954567"
|
||||
x="217.1886"
|
||||
y="160.74771"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5293566;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1-3"
|
||||
width="63.558933"
|
||||
height="11.316654"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="243.21165"
|
||||
y="156.4707"
|
||||
id="text5675-5-2"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-2"
|
||||
x="243.21165"
|
||||
y="156.4707"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Name</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8"
|
||||
width="63.558926"
|
||||
height="80.271225"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-8"
|
||||
width="40.466305"
|
||||
height="80.271225"
|
||||
x="280.74753"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-8-8"
|
||||
width="41.108303"
|
||||
height="80.271225"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1"
|
||||
width="63.558929"
|
||||
height="11.316656"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-0"
|
||||
width="40.466309"
|
||||
height="11.316656"
|
||||
x="280.74753"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-7"
|
||||
width="41.108307"
|
||||
height="11.316656"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#f0f0f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.44990167;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5"
|
||||
width="38.957039"
|
||||
height="58.495327"
|
||||
x="307.89423"
|
||||
y="158.80739"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="174.62115"
|
||||
id="text5675-5-4"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-6"
|
||||
x="317.94843"
|
||||
y="174.62115"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_1</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.78735"
|
||||
y="165.06331"
|
||||
id="text5675-5-2-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-2-1"
|
||||
x="317.78735"
|
||||
y="165.06331"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Name</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="184.37038"
|
||||
id="text5679-5-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2"
|
||||
x="317.94843"
|
||||
y="184.37038"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_2</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8"
|
||||
width="38.957031"
|
||||
height="9.7492247"
|
||||
x="307.89423"
|
||||
y="158.80739"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-8"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="168.55661"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-7"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="178.30583"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-4"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="188.05505"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-2"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="197.80428"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-71"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="207.5535"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<image
|
||||
y="170.78539"
|
||||
x="310.04617"
|
||||
id="image1119"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAA3NCSVQICAjb4U/gAAAAi0lEQVQ4 jWOccOIbA7mAiWydI0Lz+yd3yNR8bHHblvbEL2+fk6z52OK2uye2W8VW8ghL4tP8/skdNOfBdSpb eBFw9sWtc3dOyIHrx6MTi2ar2GpeYUmIfvw6GRgYGDGT569vX3ZPzH335A4DAwMenVhsZmBgYOPi cc2fLCSjgl8ndpuJB0MieQ4bzQCA/UWjCjrjVAAAAABJRU5ErkJggg== "
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="5.2916665"
|
||||
width="5.2916665" />
|
||||
<image
|
||||
y="161.03616"
|
||||
x="310.04617"
|
||||
id="image1119-4"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAA3NCSVQICAjb4U/gAAAAi0lEQVQ4 jWOccOIbA7mAiWydI0Lz+yd3yNR8bHHblvbEL2+fk6z52OK2uye2W8VW8ghL4tP8/skdNOfBdSpb eBFw9sWtc3dOyIHrx6MTi2ar2GpeYUmIfvw6GRgYGDGT569vX3ZPzH335A4DAwMenVhsZmBgYOPi cc2fLCSjgl8ndpuJB0MieQ4bzQCA/UWjCjrjVAAAAABJRU5ErkJggg== "
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="5.2916665"
|
||||
width="5.2916665" />
|
||||
<image
|
||||
y="200.03305"
|
||||
x="310.04617"
|
||||
id="image1119-7"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAA3NCSVQICAjb4U/gAAAAi0lEQVQ4 jWOccOIbA7mAiWydI0Lz+yd3yNR8bHHblvbEL2+fk6z52OK2uye2W8VW8ghL4tP8/skdNOfBdSpb eBFw9sWtc3dOyIHrx6MTi2ar2GpeYUmIfvw6GRgYGDGT569vX3ZPzH335A4DAwMenVhsZmBgYOPi cc2fLCSjgl8ndpuJB0MieQ4bzQCA/UWjCjrjVAAAAABJRU5ErkJggg== "
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="5.2916665"
|
||||
width="5.2916665" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="194.1196"
|
||||
id="text5679-5-9-2"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2-3"
|
||||
x="317.94843"
|
||||
y="194.1196"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_3</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="203.86882"
|
||||
id="text5679-5-9-4"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2-9"
|
||||
x="317.94843"
|
||||
y="203.86882"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_4</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="213.61804"
|
||||
id="text5679-5-9-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2-4"
|
||||
x="317.94843"
|
||||
y="213.61804"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_5</tspan></text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB |
@ -1,19 +0,0 @@
|
||||
<svg width="609" height="234" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="Layer_1">
|
||||
<title>Layer 1</title>
|
||||
<rect fill="#ffffff" stroke-width="4" x="3.5" y="3.2" width="603.99998" height="227.99999" id="svg_1" stroke="#007fff"/>
|
||||
<rect stroke="#007fff" fill="#007fff" stroke-width="4" x="24.5" y="30.2" width="202" height="67" id="svg_8"/>
|
||||
<rect stroke="#007fff" fill="#007fff" stroke-width="4" x="407.50001" y="29.19999" width="186.99999" height="185" id="svg_9"/>
|
||||
<rect stroke="#007fff" fill="#ffffff" stroke-width="4" x="57.5" y="36.2" width="128" height="56" id="svg_11"/>
|
||||
<rect stroke="#ffffff" fill="#ffffff" stroke-width="4" x="418.50001" y="91.2" width="163.99997" height="56" id="svg_13"/>
|
||||
<text fill="#000000" stroke="#007fff" stroke-width="0" x="86.5" y="73.2" id="svg_14" font-size="24" font-family="Noto Sans JP" text-anchor="start" xml:space="preserve">Update</text>
|
||||
<text fill="#000000" stroke="#007fff" stroke-width="0" x="458.5" y="127.2" id="svg_15" font-size="24" font-family="Noto Sans JP" text-anchor="start" xml:space="preserve">3D view</text>
|
||||
<rect stroke="#007fff" fill="#007fff" stroke-width="4" x="22.5" y="113.2" width="206" height="102" id="svg_18"/>
|
||||
<rect stroke="#ffffff" fill="#ffffff" stroke-width="4" x="27.5" y="138.2" width="194" height="56" id="svg_19"/>
|
||||
<text fill="#000000" stroke="#007fff" stroke-width="0" x="30.5" y="174.2" id="svg_21" font-size="20" font-family="Noto Sans JP" text-anchor="start" xml:space="preserve">Presentations tree view</text>
|
||||
<rect stroke="#007fff" fill="#007fff" stroke-width="4" x="239.5" y="30.19999" width="157" height="185" id="svg_2"/>
|
||||
<rect stroke="#ffffff" fill="#ffffff" stroke-width="4" x="245.50002" y="84.2" width="147.99997" height="56" id="svg_3"/>
|
||||
<text fill="#000000" stroke="#007fff" stroke-width="0" x="248.5" y="121.2" id="svg_5" font-size="24" font-family="Noto Sans JP" text-anchor="start" xml:space="preserve">Property panel</text>
|
||||
</g>
|
||||
|
||||
</svg>
|
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 17 KiB |
@ -1,635 +0,0 @@
|
||||
Inspector {#occt_user_guides__inspector}
|
||||
===============================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section occt_inspector_1 Introduction
|
||||
|
||||
This manual explains how to use the Inspector.
|
||||
|
||||
@subsection occt_inspector_1_1 Overview
|
||||
Inspector is a Qt-based library that provides functionality to interactively inspect low-level content of the OCAF data model, OCCT viewer and Modeling Data.
|
||||
This component is aimed to assist the developers of OCCT-based applications to debug the problematic situations that occur in their applications.
|
||||
|
||||
Inspector has a plugin-oriented architecture. The current release contains the following plugins:
|
||||
|
||||
| Plugin | OCCT component | Root class of OCCT investigated component |
|
||||
| :----- | :----- | :----- |
|
||||
| @ref occt_inspector_2_2 "DFBrowser"| OCAF | *TDocStd_Application* |
|
||||
| @ref occt_inspector_2_3 "VInspector"| Visualization | *AIS_InteractiveContext* |
|
||||
| @ref occt_inspector_2_4 "ShapeView"| Modeling Data | *TopoDS_Shape* |
|
||||
| @ref occt_inspector_2_5 "MessageView"| Modeling Data | *Message_Report* |
|
||||
|
||||
|
||||
Each plugin implements logic of a corresponding OCCT component.
|
||||
|
||||
Each of the listed plugins is embedded in the common framework, thus it is possible to manage, which plugins should be loaded by the Inspector, and to extend their number by implementing a new plugin.
|
||||
|
||||
|
||||
@subsection occt_inspector_1_3 Getting started
|
||||
|
||||
There are two launch modes:
|
||||
1. Launch **TInspectorEXE** executable sample. For more details see @ref occt_inspector_4_1 "TInspectorEXE" section;
|
||||
2. Launch DRAW, load plugin INSPECTOR, and use *tinspector* command.
|
||||
For more details, see @ref occt_inspector_4_2 "Launch in DRAW Test Harness" section.
|
||||
|
||||
|
||||
**Note**. If you have no Inspector library in your build directory, make sure that OCCT is compiled with *BUILD_Inspector*
|
||||
option ON. For more details see @ref occt_inspector_5 "Build procedure".
|
||||
|
||||
|
||||
@section occt_inspector_2 Inspector Plugins
|
||||
|
||||
@subsection occt_inspector_2_1 Overview
|
||||
|
||||
Inspector consists of the following components:
|
||||
* <b>buttons</b> to activate the corresponding plugin;
|
||||
* <b>view area</b> to visualize the plugin content.
|
||||
|
||||
@figure{tinspector_elements.svg,"Plugins placement in Inspector",360}
|
||||
|
||||
@subsection occt_inspector_2_2 DFBrowser Plugin
|
||||
|
||||
@subsubsection occt_inspector_2_2_1 Overview
|
||||
|
||||
@figure{dfbrowser.png, "DFBrowser"}
|
||||
|
||||
This plugin visualizes the content of *TDocStd_Application* in a tree view. It shows application documents,
|
||||
the hierarchy of *TDF_Labels*, the content of *TDF_Attributes* and interconnection between attributes (e.g. references).
|
||||
Additionally there is a 3D view to visualize *TopoDS_Shape* elements stored in the document.
|
||||
|
||||
@subsubsection occt_inspector_2_2_2 Elements
|
||||
|
||||
@figure{dfbrowser_elements.svg, "DFBrowser Elements",360}
|
||||
|
||||
<b>OCAF tree view</b>
|
||||
|
||||
Each OCAF element has own tree view item:
|
||||
|
||||
| Type | Tree item | Text | Description |
|
||||
| :----- | :----- | :----- | :----- |
|
||||
| *TDocStd_Application* | Application | *TDocStd_Application* | The root of tree view. Its children are documents.|
|
||||
| *TDocStd_Document* | Document | entry : name | A child of *Application* item. Its children are *Label* and *Attribute* items.<br> Text view is an entry of the root label and the value of *TDataStd_Name* attribute for the label if it exists. |
|
||||
| *TDF_Label* | Label | entry : name | A child of a *Document* or another *Label* item. Its children and text view are the same as for Document item. |
|
||||
| *TDF_Attribute* | Attribute | attribute type [additional information] | A child of a *Label*. It has no children. <br> Text view is the attribute type *(DynamicType()->Name()* of *TDF_Attribute*) and additional information (a combination of attribute values). |
|
||||
|
||||
|
||||
Additional information about TDF_Attributes:
|
||||
|
||||
| Type | Text |
|
||||
| :----- | :----- |
|
||||
| *TDocStd_Owner* | [storage format] |
|
||||
| *TDataStd_AsciiString*,<br> *TDataStd_Name*,<br> *TDataStd_Real*,<br> other *Simple* type attributes | [value] |
|
||||
| *TDataStd_BooleanList*,<br> *TDataStd_ExtStringList*,<br> other *List* attributes | [value_1 ... value_n] |
|
||||
| *TDataStd_BooleanArray*,<br> *TDataStd_ByteArray*,<br> other *Array* type attributes | [value_1 ... value_n] |
|
||||
| *TDataStd_TreeNode* | [tree node ID ==> Father()->Label()] (if it has a father) or <br> [tree node ID <== First()->Label()] (if it has NO father)|
|
||||
| *TDataStd_TreeNode(XDE)* | [XDE tree node ID ==> Father()->Label()] (if it has a father), <br> [XDE tree Node ID <== label_1, ..., label_n] (if it has NO father)|
|
||||
| *TNaming_NamedShape* | [shape type : evolution] |
|
||||
| *TNaming_UsedShapes* | [map extent] |
|
||||
|
||||
|
||||
Custom color of items:
|
||||
|
||||
| OCAF element Type | Color |
|
||||
| :----- | :----- |
|
||||
| *TDF_Label* | <b>dark green</b>, if the label has *TDataStd_Name* attribute, <br><b>light grey</b> if the label is empty (has no attributes on all levels of hierarchy),<br> <b>black</b> otherwise. |
|
||||
| *TNaming_NamedShape* | <b>dark gray</b> for *TopAbs_FORWARD* orientation of *TopoDS_Shape*, <br> <b>gray</b> for *TopAbs_REVERSED* orientation of *TopoDS_Shape*, <br> <b>black</b> for other orientation. |
|
||||
|
||||
|
||||
Context pop-up menu:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Expand | Expands the next two levels under the selected item. |
|
||||
| Expand All | Expands the whole tree of the selected item. |
|
||||
| Collapse All | Collapses the whole tree of the selected item. |
|
||||
|
||||
<b>Property Panel</b>
|
||||
|
||||
Property panel is used to display the result of <b>TDF_Attribute::Dump()</b> or <b>TDF_Label::Dump()</b> of the selected tree view item.
|
||||
The information is shown in one table.
|
||||
|
||||
@figure{property_panel.png,"PropertyPanel",360}
|
||||
|
||||
<b>Property Panel (custom)</b>
|
||||
|
||||
Property panel (custom) is used to display the content of *Label* or *Attribute* tree view items or Search result view.
|
||||
The information is usually shown in one or several tables.
|
||||
|
||||
*TDF_Attribute* has the following content in the Property Panel:
|
||||
|
||||
<table>
|
||||
<tr><th>Type</th><th>Description</th><th>Content</th></tr>
|
||||
<tr><td><i>TDF_Label</i></td>
|
||||
<td> a table of [entry or attribute name, value]</td>
|
||||
<td>@figure{property_panel_custom_label.png, "",140}</td></tr>
|
||||
<tr><td><i>TDocStd_Owner</i>,<br> Simple type attributes, <br> List type attributes</td>
|
||||
<td>a table of [method name, value]</td>
|
||||
<td>@figure{property_panel_custom_simple_type.png, "",140}</td></tr>
|
||||
<tr><td><i>TDataStd_BooleanArray</i>,<br> <i>TDataStd_ByteArray</i>,<br> other Array type attributes</td>
|
||||
<td>2 controls: <br> - a table of [array bound, value], <br> - a table of [method name, value] </td>
|
||||
<td>@figure{property_panel_custom_array.png, "",140}</td></tr>
|
||||
<tr><td><i>TDataStd_TreeNode</i></td>
|
||||
<td>2 controls: <br> - a table of [Tree ID, value] (visible only if Tree ID() != ID() ), <br> - a tree view of tree nodes starting from *Root()* of the tree node. The current tree node has <b>dark blue</b> text.</td>
|
||||
<td>@figure{property_panel_custom_tree_node.png, "",140} </td></tr>
|
||||
<tr><td><i>TDataStd_NamedData</i></td>
|
||||
<td>tab bar of attribute elements, each tab has a table of [name, value]</td>
|
||||
<td>@figure{property_panel_custom_named_data.png, "",140}</td></tr>
|
||||
<tr><td><i>TNaming_UsedShapes</i></td>
|
||||
<td>a table of all shapes handled by the framework</td>
|
||||
<td>@figure{property_panel_custom_tnaming_used_shapes.png, "",140}</td></tr>
|
||||
<tr><td><i>TNaming_NamedShape</i></td>
|
||||
<td>2 controls: <br> - a table of [method name, value] including CurrentShape/OriginalShape methods result of <i>TNaming_Tools</i>, <br> - an evolution table. <br> Tables contain buttons for @ref occt_shape_export "TopoDS_Shape export".</td>
|
||||
<td>@figure{property_panel_custom_tnaming_named_shape.png, "",140}</td></tr>
|
||||
<tr><td><i>TNaming_Naming</i></td>
|
||||
<td>2 controls: <br> - a table of <i>TNaming_Name</i> values,<br> - a table of [method name, value]</td>
|
||||
<td>@figure{property_panel_custom_tnaming_naming.png, "",140}</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<b>Dump view</b>
|
||||
|
||||
@figure{dump_attribute.png, "Dump of TDF_Attribute",200}
|
||||
|
||||
Dump view shows the result of <b>TDF_Attribute::Dump()</b> or <b>TDF_Label::Dump()</b> of the selected tree view item.
|
||||
|
||||
<b>3D view</b>
|
||||
|
||||
3D View visualizes *TopoDS_Shape* elements of OCAF attribute via AIS facilities.
|
||||
|
||||
DFBrowser creates two kinds of presentations depending on the selection place:
|
||||
|
||||
<table>
|
||||
<tr><th>Kind</th><th>Source object</th><th>Visualization properties</th><th>View</th></tr>
|
||||
<tr><td>Main presentation</td>
|
||||
<td>Tree view item:<br> *TPrsStd_AISPresentation*,<br> *TNaming_NamedShape*,<br> *TNaming_Naming*</td>
|
||||
<td>Color: a default color for shape type of the current *TopoDS_Shape*.</td>
|
||||
<td>@figure{display_main_presentation.png, "",100}</td></tr>
|
||||
<tr><td>Additional presentation</td>
|
||||
<td>References in Property panel</td>
|
||||
<td>Color: white</td>
|
||||
<td>@figure{display_additional_presentation.png, "",100}</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<b>Tree Navigation</b>
|
||||
|
||||
Tree Navigation shows a path to the item selected in the tree view.
|
||||
The path is a sequence of label entries and attribute type names.
|
||||
Each element in the path is selectable - simply click on it to select the corresponding tree view item.
|
||||
|
||||
Navigation control has buttons to go to the previous and the next selected tree view items.
|
||||
|
||||
|
||||
<b>Update Button</b>
|
||||
|
||||
Update button synchronizes content of tree view to the current content of OCAF document that could be modified outside.
|
||||
|
||||
<b>Search</b>
|
||||
|
||||
The user can search OCAF element by typing:
|
||||
* *TDF_Label* entry,
|
||||
* *TDF_Attribute* name,
|
||||
* *TDataStd_Name* and *TDataStd_Comment* attributes value.
|
||||
|
||||
@figure{search.png,"Search",360}
|
||||
|
||||
As soon as the user confirms the typed criteria, the Property panel is filled by all satisfied values.
|
||||
The user can click a value to highlight the corresponding tree view item. By double click the item will be selected.
|
||||
|
||||
|
||||
@subsubsection occt_inspector_2_2_3 Elements cooperation
|
||||
|
||||
<b>Tree item selection</b>
|
||||
|
||||
Selection of tree view item updates content of the following controls:
|
||||
* Navigation line;
|
||||
* Property Panel;
|
||||
* 3D View (if it is possible to create an interactive presentation);
|
||||
* Dump View.
|
||||
|
||||
@figure{dfbrowser_selection_in_tree_view.svg,"",360}
|
||||
|
||||
<b>Property Panel (custom) item selection </b>
|
||||
|
||||
If the property panel (custom) shows content of *TDF_Label*:
|
||||
* selection of the table row highlights the corresponding item in the tree view,
|
||||
* double click on the table row selects this item in the tree view.
|
||||
|
||||
If the property panel (custom) shows content of *TDF_Attribute* that has reference to another attribute, selection of this reference:
|
||||
* highlights the referenced item in the tree view,
|
||||
* displays additional presentation in the 3D view if it can be created.
|
||||
|
||||
@figure{property_panel_custom_item_selection.svg,"",360}
|
||||
|
||||
Attributes having references:
|
||||
|
||||
| Type | Reference | Additional presentation
|
||||
| :----- | :----- | :----- |
|
||||
| *TDF_Reference* | *TDF_Label* | |
|
||||
| *TDataStd_ReferenceArray*, <br> *TDataStd_ReferenceList*, <br> *TNaming_Naming* | One or several *TDF_Label* in a container. | |
|
||||
| *TDataStd_TreeNode* | *TDF_Label* | |
|
||||
| *TNaming_NamedShape* | *TDF_Label* in Evolution table | *TopoDS_Shapes* selected in the property panel tables. |
|
||||
| *TNaming_UsedShapes* | one or several *TNaming_NamedShape* | *TopoDS_Shapes* of the selected *TNaming_NamedShape*. |
|
||||
|
||||
|
||||
@subsubsection occt_shape_export TopoDS_Shape export
|
||||
|
||||
Property panel of *TNaming_NamedShape* attribute has controls to export *TopoDS_Shape* to:
|
||||
* BREP. **Save file** dialog is open to enter the result file name,
|
||||
* @ref occt_inspector_2_4 "ShapeView" plugin. The dialog for exporting element to ShapeView allows activating this plugin immediately.
|
||||
|
||||
|
||||
@subsection occt_inspector_2_3 VInspector Plugin
|
||||
|
||||
@subsubsection occt_inspector_2_3_1 Overview
|
||||
|
||||
@figure{vinspector.png, "VInspector",360}
|
||||
|
||||
This plugin visualizes interactive objects displayed in *AIS_InteractiveContext* in a tree view with computed selection
|
||||
components for each presentation. It shows the selected elements in the context and allows selecting these elements.
|
||||
|
||||
@subsubsection occt_inspector_2_3_2 Elements
|
||||
|
||||
@figure{vinspector_elements.svg,"VInspector Elements",360}
|
||||
|
||||
<b>Presentations tree view</b>
|
||||
|
||||
This view shows presentations and selection computed on them. Also, the view has columns with information about the state of visualization elements.
|
||||
|
||||
VInspector tree items.
|
||||
|
||||
| Type | Description |
|
||||
| :----- | :----- |
|
||||
| *AIS_InteractiveContext* | The root of tree view. Its children are interactive objects obtained by *DisplayedObjects* and *ErasedObjects* methods.|
|
||||
| *AIS_InteractiveObject* | A child of *AIS_InteractiveContext* item. Its children are *SelectMgr_Selection* obtained by iteration on *CurrentSelection*. |
|
||||
| *SelectMgr_Selection* | A child of *AIS_InteractiveObject*. Its children are *SelectMgr_SensitiveEntity* obtaining by iteration on *Sensitive*. |
|
||||
| *SelectMgr_SensitiveEntity* | A child of *SelectMgr_Selection*. Its children are *SelectMgr_SensitiveEntity* obtaining by iteration on *OwnerId*. |
|
||||
| *SelectBasics_EntityOwner* | A child of *SelectMgr_SensitiveEntity*. It has no children. |
|
||||
|
||||
|
||||
Custom color of tree view items:
|
||||
|
||||
| OCAF element Type | Column | What | Color |
|
||||
| :----- | :----- | :----- | :----- |
|
||||
| *AIS_InteractiveObject* | 0 | Text | <b>dark gray</b> in *ErasedObjects* list of *AIS_InteractiveContext*,<br> <b>black</b> otherwise |
|
||||
| *AIS_InteractiveObject*, <br> *SelectMgr_SensitiveEntity*, <br> *SelectBasics_EntityOwner*| 1 | Background | <b>dark blue</b>, if there is a selected owner under the item, <br> <b>black</b> otherwise |
|
||||
| *SelectMgr_Selection*,<br> *SelectMgr_SensitiveEntity*,<br> *electBasics_EntityOwner* | all | Text | <b>dark gray</b>, if *SelectionState* of *SelectMgr_Selection* is not *SelectMgr_SOS_Activated*,<br> <b>black</b> otherwise |
|
||||
|
||||
|
||||
Context popup menu in tree view:
|
||||
| Action | Item | Functionality |
|
||||
| :----- | :----- | :----- |
|
||||
| Export to ShapeView | *AIS_InteractiveObject* | Exports *TopoDS_Shape* of the *AIS_Interactive* presentation to ShapeView plugin. <br> It should be *AIS_Shape* presentation and ShapeView plugin should be registered in Inspector<br> Dialog about exporting element to ShapeView is shown with a possibility to activate this plugin immediately. |
|
||||
| Show | *AIS_InteractiveObject* | Displays presentation in *AIS_InteractiveContext*. |
|
||||
| Hide | *AIS_InteractiveObject* | Erases presentation from *AIS_InteractiveContext*. |
|
||||
|
||||
<b>Update</b>
|
||||
|
||||
This button synchronizes the plugin content with the current state of *AIS_InteractiveContext* and updates the presence of items and their current selection.
|
||||
|
||||
@subsubsection occt_inspector_2_3_3 Elements cooperation
|
||||
|
||||
*VInspector* marks the presentations currently selected in *AIS_InteractiveContext* with a blue background in tree items. Use **Update** button to synchronize VInspector selected items state to the context.
|
||||
|
||||
It is also possible to perform selection in the context using "Selection controls" VInspector feature. However, this operation should be performed carefully as
|
||||
it clears the current selection in *AIS_InteractiveContext*.
|
||||
|
||||
Selection change:
|
||||
| From | To | Action | Result |
|
||||
| :----- | :----- | :----- | :----- |
|
||||
| *AIS_InteractiveContext* | VInspector | Performs selection in *AIS_InteractiveContext*. | Click **Update** button in VInspector and check **Selection** column: <br> *AIS_InteractiveContext* item contains some selected objects, <br> the value of some *AIS_InteractiveObject* is filled if they are selected for this presentation or its entity owner. |
|
||||
| VInspector | *AIS_InteractiveContext* | Activates one of Selection controls and selects one or several elements in the tree view. | The objects become selected in *AIS_InteractiveContext*. |
|
||||
|
||||
@subsubsection occt_inspector_2_3_4 VInspector tree view columns
|
||||
|
||||
Use context pop-up menu on the tree view header to select, which columns should be displayed.
|
||||
@figure{vinspector_tree_columns.png, "Vinspector tree header context menu",360}
|
||||
|
||||
Use the setting Lights (position, color) in the view.
|
||||
@figure{vinspector_light_setting.png, "Vinspector light setting",360}
|
||||
|
||||
@subsubsection occt_inspector_2_3_5 VInspector property panel
|
||||
|
||||
Property panel shows the result of <b>AIS_InteractiveContext::Dump()</b> or <b>AIS_InteractiveObject::Dump()</b>.
|
||||
@figure{vinspector_property_panel.png, "Vinspector property panel",360}
|
||||
|
||||
@subsection occt_inspector_2_4 ShapeView Plugin
|
||||
|
||||
@subsubsection occt_inspector_2_4_1 Overview
|
||||
|
||||
@figure{shapeview.png, "ShapeView",360}
|
||||
|
||||
This plugin visualizes content of *TopoDS_Shape* in a tree view.
|
||||
|
||||
@subsubsection occt_inspector_2_4_2 Property panel
|
||||
|
||||
Property panel shows properties for TopoDS_Shape based on DumpJson.
|
||||
|
||||
@figure{shapeview_property_panel.png, "ShapeView Property panel",360}
|
||||
|
||||
@subsubsection occt_inspector_2_4_3 Elements
|
||||
|
||||
@figure{shapeview_elements.svg,"ShapeView Elements",360}
|
||||
|
||||
<b>TopoDS_Shape View</b>
|
||||
|
||||
The view elements are *TopoDS_Shape* objects.
|
||||
The shape is exploded into sub-shapes using *TopoDS_Iterator* of the *TopoDS_Shape*.
|
||||
Children sub-shapes are presented in the view as children of the initial shape.
|
||||
By iterating recursively through all shapes we obtain a tree view of items shown in the ShapeView.
|
||||
|
||||
The columns of the View show some information about *TopoDS_Shape* of the item.
|
||||
The first column allows changing the visibility of the item shape in the 3D view.
|
||||
|
||||
Context pop-up menu in tree view:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Load BREP file | Opens the selected file and appends the resulting *TopoDS_Shape* into the tree view. |
|
||||
| Remove all shape items | Clears tree view. |
|
||||
| BREP view | Shows the text view with BREP content of the selected item. Creates the BREP file in a temporary directory of the plugin. |
|
||||
| Close All BREP views | Closes all opened text views. |
|
||||
| BREP directory | Displays the folder, where temporary BREP files have been stored. |
|
||||
|
||||
@subsubsection occt_inspector_2_4_4 Elements cooperation
|
||||
|
||||
Selection of one or several items in *TopoDS_Shape* View creates its *AIS_Shape* presentation and displays it in the 3D View.
|
||||
|
||||
@subsubsection occt_inspector_2_4_5 ShapeView tree view columns
|
||||
|
||||
Use context pop-up menu on the tree view header to select, which columns should be displayed.
|
||||
@figure{shapeview_tree_columns.png, "ShapeView tree header context menu",360}
|
||||
|
||||
@subsection occt_inspector_2_5 MessageView Plugin
|
||||
|
||||
MessageView plugin is used to display content of Message_Report.
|
||||
|
||||
@subsubsection occt_inspector_2_5_1 Message report tree view
|
||||
|
||||
Message report tree view shows the content of the Message_Report.
|
||||
|
||||
Context pop-up menu in message report tree view:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Export Report | Exports the report as json file. |
|
||||
| WallClock Metric statistic | Creates the table that sums the number of calls and the time spent on the functionality inside the value and shows it in Property panel (custom). It's necessary to activate "WallClock metric". |
|
||||
| Preview children presentations | Displays presentations of children items of selected items if found. |
|
||||
| Deactivate | Deactivates all types of metrics for the current report. |
|
||||
| Activate | Appends items to activate report metrics. |
|
||||
| Clear | Clears message report. |
|
||||
| Activate metric | Switches active state in report for clicked type of metric. |
|
||||
| Test metric | Sends several alerts to check metric of message-alert-tool mechanism. |
|
||||
| Test Message_Messenger | Sends several alerts to check property panel/presentations of messenger-alert-tool mechanism. |
|
||||
| Test Tree of messages | Sends several alerts to check tree of alerts. |
|
||||
|
||||
@figure{messageview_pop_up_menu.png, "MessageView pop-up menu",360}
|
||||
|
||||
@subsubsection occt_inspector_2_5_2 3D View
|
||||
|
||||
3D View shows the selected item (TopoDS_Shape) in message report tree view.
|
||||
@figure{messageview_view.png, "MessageView 3D View",360}
|
||||
|
||||
@subsubsection occt_inspector_2_5_3 Dump panel
|
||||
|
||||
Shows Dump() information of the selected item if the item has Dump().
|
||||
@figure{messageview_dump_panel.png, "MessageView 3D View",360}
|
||||
|
||||
@subsubsection occt_inspector_2_5_4 Property panel (custom)
|
||||
|
||||
Shows the table for WallClock Metric statistic option.
|
||||
@figure{messageview_property_panel_custom.png, "MessageView 3D View",360}
|
||||
|
||||
@subsubsection occt_inspector_2_5_5 Elements
|
||||
@figure{messageview_elements.svg, "MessageView elements",360}
|
||||
|
||||
@section occt_inspector_3 Common controls
|
||||
|
||||
@subsection occt_inspector_3_1 Tree View
|
||||
|
||||
This control shows presentation hierarchy of the investigated OCCT element, e.g. *TDocStd_Application* for DFBrowser, see @ref occt_inspector_1_1 "Overview".
|
||||
The first column contains the name, other columns are informative.
|
||||
|
||||
The tree view has a context menu with plugin-specific actions.
|
||||
|
||||
@subsubsection occt_inspector_3_1_1 Tree View preferences
|
||||
|
||||
It is possible to define visibility and width of columns.
|
||||
This option is available in a view that contains more than one column,
|
||||
e.g. @ref occt_inspector_2_3_4 "VInspector tree view columns"
|
||||
and @ref occt_inspector_2_4_4 "ShapeView tree view columns".
|
||||
|
||||
@figure{treeview_preferences.svg, "Preferences schema",360}
|
||||
|
||||
|
||||
@subsection occt_inspector_3_2 3D View
|
||||
|
||||
@subsubsection occt_inspector_3_2_1 Overview
|
||||
|
||||
@figure{3DView.png, "3D View",360}
|
||||
|
||||
This control for OCCT 3D viewer creates visualization view components and allows performing some user actions in the view.
|
||||
|
||||
|
||||
@subsubsection occt_inspector_3_2_2 Elements
|
||||
|
||||
@figure{3DView_elements.svg,"3DView Elements",360}
|
||||
|
||||
3D View contains the following elements:
|
||||
| Element | Functionality |
|
||||
| :----- | :----- |
|
||||
| 3D view | V3d viewer with mouse events processing. |
|
||||
| Context | Allows choosing another context that should be used in the plugin. The following contexts are available:<br> **Own** - the context of this view, <br> **External** - the context of the @ref occt_inspector_4_3 "external application", which initializes the plugin, <br> **None** - the visualization is not performed at all (useful if the presentation is too complex). |
|
||||
| Multi/Single | The buttons define what to do with the previously displayed objects: <br> **Multi** displays new presentations together with already displayed ones, <br> **Single** removes all previously displayed presentations. |
|
||||
| Clean | Removes all displayed presentations. |
|
||||
| Trihedron display | Shows the trihedron. |
|
||||
| View cube display | Shows the view cube. |
|
||||
| Fit All | Scene manipulation actions<br> (Fit All is checkable. If checked(by double click), display/hide of new objects will perform **Fit All** of the scene.) |
|
||||
| Display Mode | Sets *AIS_Shading* or *AIS_WireFrame* display mode for all presentations. |
|
||||
|
||||
Context popup menu:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Set View Orientation | Shows the list of available *V3d_View* projections. Selection of an item with change the view. |
|
||||
|
||||
@figure{3DView_set_orientation.png,"Set view orientation",360}
|
||||
|
||||
@subsubsection occt_inspector_3_2_3 3D View preferences.
|
||||
View preferences store the current view orientation.
|
||||
|
||||
@subsection occt_inspector_3_3 Preferences context menu
|
||||
|
||||
@figure{preferences.png,"Plugin preferences",360}
|
||||
|
||||
Context menu contains:
|
||||
| Element | Functionality |
|
||||
| :----- | :----- |
|
||||
| Tree Level Line,<br> PropertyPanel,<br> PropertyPanel (custom),<br> Dump, <br> View| Names of dock widgets in the active plugin. If the button is checked, dock widget is visible. |
|
||||
| Store Preferences | Creates ".tinspector.xml" preferences file with the current settings for each plugin.<br> This file is created in TEMP/TMP directory (by default) or in a user-defined directory. |
|
||||
| Remove Preferences | Removes preferences file. After the Inspector is restarted, default values will be applied. |
|
||||
|
||||
|
||||
The following controls have store/restore preferences:
|
||||
| Element | Preferences |
|
||||
| :----- | :----- |
|
||||
| Geometry| Inspector window size and position. <br>State of dockable widgets : visibility, position, size.|
|
||||
| @ref occt_inspector_3_1_1 "Tree View preferences"| Columns visible in the tree view and their width. |
|
||||
| @ref occt_inspector_3_2_3 "3D View preferences"| 3D view camera direction. |
|
||||
|
||||
@section occt_inspector_4 Getting Started
|
||||
|
||||
@subsection occt_inspector_4_1 TInspectorEXE sample
|
||||
|
||||
This sample allows trying Inspector functionality.
|
||||
|
||||
Use *inspector.bat* script file placed in a binary directory of OCCT to launch it.
|
||||
|
||||
This script accepts the names of plugin's DLL that should be loaded. By default it loads all plugins described above.
|
||||
|
||||
|
||||
@figure{TStandaloneEXE.png, "TStandaloneEXE",360}
|
||||
|
||||
Click on the Open button shows the dialog to select a file.
|
||||
@figure{TStandaloneEXE_open.png, "",360}
|
||||
|
||||
Depending on the active plugin, it is possible to select the following files in the dialog:<br>
|
||||
- DFBRowser: OCAF document or STEP files;
|
||||
- VInspector: BREP files;
|
||||
- ShapeView: BREP files.
|
||||
|
||||
Click the file name in the proposed directory and enter it manually or using **Browse** button.
|
||||
|
||||
By default, TInspectorEXE opens the following files for plugins:
|
||||
| Plugin DLL library name | Files |
|
||||
| :----- | :----- |
|
||||
| TKDFBrowser | step/screw.step |
|
||||
| TKVInspector | occ/hammer.brep |
|
||||
| TKShapeView | occ/face1.brep, <br> occ/face2.brep |
|
||||
|
||||
These files are found relatively to *CSF_OCCTDataPath*.
|
||||
|
||||
@subsubsection occt_inspector_4_1_1 TInspectorEXE preferences
|
||||
The application stores recently loaded files. On the application start, the last file is activated.
|
||||
**Open file** dialog contains recently loaded files.
|
||||
Selection of a new file updates the container of recently loaded files and rewrites preferences.
|
||||
|
||||
Source code of *TIspectorEXE* is a good sample for @ref occt_inspector_4_3 "using the Inspector in a custom application".
|
||||
|
||||
@subsection occt_inspector_4_2 How to launch the Inspector in DRAW Test Harness
|
||||
|
||||
*TKToolsDraw* plugin provides DRAW commands for Qt tools. Use *INSPECTOR* parameter of @ref occt_draw_1_3_3 "pload"
|
||||
command to download the commands of this library. It contains *tinspector* command to start Inspector under DRAW.
|
||||
See more detailed description of the @ref occt_draw_13_1 "tinspector" command.
|
||||
|
||||
The simple code to start Inspector with all plugins loaded:
|
||||
|
||||
~~~~
|
||||
pload INSPECTOR
|
||||
tinspector
|
||||
~~~~
|
||||
|
||||
@figure{drawexe_tinspector.png,"tinspector",360}
|
||||
|
||||
This command does the following:
|
||||
- all available Plugins are presented in the Inspector. These are @ref occt_inspector_2_2 "DFBrowser", @ref occt_inspector_2_3 "VInspector", @ref occt_inspector_2_4 "ShapeView" and @ref occt_inspector_2_5 "MessageView";
|
||||
- DFBrowser is the active plugin;
|
||||
- OCAF tree is empty.
|
||||
|
||||
After this, we should create objects in DRAW and update *tinspector*.
|
||||
The examples of using Inspector in DRAW can be found in OCCT source directory /tests/tools.
|
||||
|
||||
@subsection occt_inspector_4_3 How to use the Inspector in a custom application
|
||||
|
||||
The example of using the Inspector in a custom application is presented in OCCT qt sample - <b>FuncDemo</b>.
|
||||
For building qt samples, switch on *BUILD_SAMPLES_QT* variable in @ref build_cmake_conf "Configuration process".
|
||||
|
||||
In general, the following steps should be taken:
|
||||
* Set dependencies to OCCT and Qt in the application (Header and Link);
|
||||
* Create an instance of *TInspector_Communicator*;
|
||||
* Register the plugins of interest in the communicator by DLL library name;
|
||||
* Initialize the communicator with objects that will be investigated;
|
||||
* Set visible true for the communicator.
|
||||
|
||||
|
||||
|
||||
Here is an example of C++ implementation:
|
||||
~~~~{.cpp}
|
||||
|
||||
#include <inspector/TInspector_Communicator.hxx>
|
||||
|
||||
static TInspector_Communicator* MyTCommunicator;
|
||||
|
||||
void CreateInspector()
|
||||
{
|
||||
NCollection_List<Handle(Standard_Transient)> aParameters;
|
||||
//... append parameters in the list
|
||||
|
||||
if (!MyTCommunicator)
|
||||
{
|
||||
MyTCommunicator = new TInspector_Communicator();
|
||||
|
||||
MyTCommunicator->RegisterPlugin ("TKDFBrowser");
|
||||
MyTCommunicator->RegisterPlugin ("TKVInspector");
|
||||
MyTCommunicator->RegisterPlugin ("TKShapeView");
|
||||
MyTCommunicator->RegisterPlugin ("TKMessageView");
|
||||
|
||||
MyTCommunicator->Init (aParameters);
|
||||
MyTCommunicator->Activate ("TKDFBrowser");
|
||||
}
|
||||
MyTCommunicator->SetVisible (true);
|
||||
}
|
||||
~~~~
|
||||
|
||||
Give one the following objects for a plugin using a container of parameters:
|
||||
|
||||
| Plugin | to be initialized by |
|
||||
| :----- | :----- |
|
||||
| *TKDFBrowser* | *TDocStd_Application* |
|
||||
| *TKVInspector* | *AIS_InteractiveContext* |
|
||||
| *TKShapeView* | *TopoDS_TShape* |
|
||||
| *TKMessageView* | *Message_Report* |
|
||||
|
||||
|
||||
@section occt_inspector_5 Build procedure
|
||||
|
||||
|
||||
@subsection occt_inspector_5_1 Building with CMake within OCCT
|
||||
|
||||
By default the Inspector compilation is off.
|
||||
To compile it, set the *BUILD_Inspector* flag to "ON". See @ref build_cmake_conf "Configuration process".
|
||||
|
||||
When this option is switched ON, MS Visual Studio project has an additional tree of folders:
|
||||
|
||||
@figure{VStudio_projects.png,"Inspector packages in MS Visual Studio",160}
|
||||
|
||||
|
||||
@section occt_inspector_6 Sources and packaging
|
||||
|
||||
OCCT sources are extended by the /tools directory.
|
||||
|
||||
Distribution of plugin packages :
|
||||
| Source packages | Plugin |
|
||||
| :----- | :----- |
|
||||
| *DFBrowser*, <br> *DFBrowserPane*, <br> *DFBrowserPaneXDE*, <br> *TKDFBrowser* | DFBrowser |
|
||||
| *VInspector*, <br> *TKVInspector* | VInspector |
|
||||
| *ShapeView*, <br> *TKShapeView* | ShapeView |
|
||||
| *MessageView*, <br> *TKMessageView* | MessageView |
|
||||
|
||||
Other packages:
|
||||
| Source packages| Used in |
|
||||
| :----- | :----- |
|
||||
| *TInspectorAPI*, <br> *TKInspectorAPI* | Interface for connection to plugin. |
|
||||
| *ViewControl*, <br> *TKTreeModel* | Classes for property view, table, table model. |
|
||||
| *TreeModel*, <br> *TKTreeView* | Items-oriented model to simplify work with GUI tree control. |
|
||||
| *View*, <br> *TKView* | 3D View component. |
|
||||
| *TInspector*, <br> *TKTInspector* | Inspector window, where plugins are placed. |
|
||||
| *ToolsDraw*, <br> *TKToolsDraw* | Plugin for DRAW to start Inspector. |
|
||||
|
||||
|
||||
In MSVC studio, a separate folder contains Inspector projects.
|
||||
|
||||
@section occt_inspector_7 Glossary
|
||||
* **Component** -- a part of OCCT , e.g. OCAF, VISUALIZATION, MODELING and others.
|
||||
* **Plugin** -- a library that is loaded in some executable/library. Here, the plugins are:
|
||||
* DFBrowser,
|
||||
* ShapeView,
|
||||
* VInspector.
|
@ -16,4 +16,3 @@ OCCT User Guides are organized by OCCT modules:
|
||||
* @subpage occt_user_guides__de_wrapper "Data Exchange Wrapper (DE Wrapper)"
|
||||
* @subpage occt_user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
|
||||
* @subpage occt_user_guides__test_harness "DRAW Test Harness"
|
||||
* @subpage occt_user_guides__inspector "Inspector"
|
||||
|
@ -1,405 +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)
|
||||
|
||||
set (ADDITIONAL_INLCUDE_DIR_DESCR "Additional directory to be added in the projects include section")
|
||||
if (NOT DEFINED ADDITIONAL_INLCUDE_DIR)
|
||||
set (ADDITIONAL_INLCUDE_DIR "" CACHE PATH ${ADDITIONAL_INLCUDE_DIR_DESCR})
|
||||
get_filename_component (ADDITIONAL_INLCUDE_DIR "${ADDITIONAL_INLCUDE_DIR}" ABSOLUTE)
|
||||
else()
|
||||
file (TO_CMAKE_PATH "${ADDITIONAL_INLCUDE_DIR}" ADDITIONAL_INLCUDE_DIR)
|
||||
set (ADDITIONAL_INLCUDE_DIR "${ADDITIONAL_INLCUDE_DIR}" CACHE PATH "${ADDITIONAL_INLCUDE_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
|
||||
set (ADDITIONAL_DLL_DIR_DESCR "Additional directories that should be included into PATH")
|
||||
if (NOT DEFINED ADDITIONAL_DLL_DIR)
|
||||
set (ADDITIONAL_DLL_DIR "" CACHE PATH ${ADDITIONAL_DLL_DIR_DESCR})
|
||||
get_filename_component (ADDITIONAL_DLL_DIR "${ADDITIONAL_DLL_DIR}" ABSOLUTE)
|
||||
else()
|
||||
file (TO_CMAKE_PATH "${ADDITIONAL_DLL_DIR}" ADDITIONAL_DLL_DIR)
|
||||
set (ADDITIONAL_DLL_DIR "${ADDITIONAL_DLL_DIR}" CACHE PATH "${ADDITIONAL_DLL_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
|
||||
set (CURRENT_DIR "${CMAKE_SOURCE_DIR}")
|
||||
set (CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/.." CACHE INTERNAL "" FORCE)
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
|
||||
|
||||
set (CMAKE_SUPPRESS_REGENERATION TRUE)
|
||||
|
||||
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
|
||||
|
||||
# include cmake file
|
||||
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
|
||||
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_INCLUDE_3RDPARTY_PRODUCT USE_PRODUCT PRODUCT_CONFIG_FILE)
|
||||
if (${USE_PRODUCT})
|
||||
OCCT_INCLUDE_CMAKE_FILE ("${PRODUCT_CONFIG_FILE}")
|
||||
endif (${USE_PRODUCT})
|
||||
endmacro()
|
||||
|
||||
# include variable description
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
|
||||
|
||||
# set type of OCCT libraries
|
||||
if (NOT BUILD_LIBRARY_TYPE)
|
||||
set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "${BUILD_LIBRARY_TYPE_DESCR}" FORCE)
|
||||
SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
|
||||
endif()
|
||||
|
||||
if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
|
||||
set (BUILD_SHARED_LIBS ON)
|
||||
|
||||
if (NOT DEFINED BUILD_SHARED_LIBRARY_NAME_POSTFIX)
|
||||
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX "" CACHE STRING "${BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
unset (BUILD_SHARED_LIBS)
|
||||
unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX)
|
||||
endif()
|
||||
|
||||
# the name of the project
|
||||
project (Inspector)
|
||||
|
||||
if (WIN32)
|
||||
add_definitions(-DUNICODE)
|
||||
add_definitions(-D_UNICODE)
|
||||
endif()
|
||||
|
||||
# include occt macros
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
# Solution folder property
|
||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
|
||||
# check this variable and set if it's required
|
||||
if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
|
||||
set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||
endif()
|
||||
|
||||
if (BUILD_WITH_DEBUG)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
|
||||
endif()
|
||||
|
||||
# install dir of the project
|
||||
if (NOT DEFINED INSTALL_DIR)
|
||||
# set default install directory for Windows
|
||||
if (WIN32 AND NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
set (CMAKE_INSTALL_PREFIX "C:/opencascade-${OCC_VERSION_STRING_EXT}/inspector")
|
||||
endif()
|
||||
set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}")
|
||||
else()
|
||||
file (TO_CMAKE_PATH "${INSTALL_DIR}" INSTALL_DIR)
|
||||
set (INSTALL_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
|
||||
# choose a variant of the layout of the install paths
|
||||
if (NOT INSTALL_DIR_LAYOUT)
|
||||
if (WIN32)
|
||||
set (INSTALL_DIR_LAYOUT "Windows" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
|
||||
else()
|
||||
set (INSTALL_DIR_LAYOUT "Unix" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
|
||||
endif()
|
||||
SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix)
|
||||
endif()
|
||||
|
||||
# check INSTALL_DIR_LAYOUT changes and update INSTALL_DIR_* paths if necessary
|
||||
if (NOT DEFINED INSTALL_DIR_LAYOUT_PREV)
|
||||
set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
|
||||
elseif (NOT "${INSTALL_DIR_LAYOUT_PREV}" STREQUAL "${INSTALL_DIR_LAYOUT}")
|
||||
set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
|
||||
# The structure of install folder should be reset due to changed layout
|
||||
OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
|
||||
|
||||
# Unset INSTALL_DIR_WITH_VERSION on windows
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
|
||||
OCCT_CHECK_AND_UNSET (INSTALL_DIR_WITH_VERSION)
|
||||
else()
|
||||
if (NOT DEFINED INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_WITH_VERSION OFF CACHE BOOL "${INSTALL_DIR_WITH_VERSION_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check CMAKE_INSTALL_PREFIX changes and update INSTALL_DIR if necessary
|
||||
if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV)
|
||||
set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
|
||||
elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
|
||||
# CMAKE_INSTALL_PREFIX has been changed at previous step
|
||||
set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
# INSTALL_DIR is required to be updated
|
||||
set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
|
||||
# check INSTALL_DIR changes and update CMAKE_INSTALL_PREFIX if necessary
|
||||
if (NOT DEFINED INSTALL_DIR_PREV)
|
||||
set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}")
|
||||
# INSTALL_DIR has been changed at previous step
|
||||
set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
# sync CMAKE_INSTALL_PREFIX with INSTALL_DIR
|
||||
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
# set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder
|
||||
set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
if (NOT DEFINED INSTALL_DIR_WITH_VERSION_PREV)
|
||||
set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
|
||||
elseif (NOT "${INSTALL_DIR_WITH_VERSION_PREV}" STREQUAL "${INSTALL_DIR_WITH_VERSION}")
|
||||
# INSTALL_DIR_WITH_VERSION has been changed at previous step
|
||||
set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# hide CMAKE_INSTALL_PREFIX from a user
|
||||
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
set (BIN_LETTER "")
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
set (BIN_LETTER "d")
|
||||
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
set (BIN_LETTER "i")
|
||||
endif()
|
||||
|
||||
# Get all used variables: OS_WITH_BIT, COMPILER
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
# do not define INSTALL_DIR_BIN for win.
|
||||
# Leave library structure for win: <prefix>/win64/vc10/bin(d)
|
||||
if (NOT DEFINED INSTALL_DIR_BIN)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_BIN "bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# define folder containing all shell/batch scripts
|
||||
if (NOT DEFINED INSTALL_DIR_SCRIPT)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_SCRIPT "." CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# place the libraries to <prefix>/lib folder for unix and leave old structure for windows
|
||||
if (NOT DEFINED INSTALL_DIR_LIB)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OCCT headers: <prefix>/inc for windows,
|
||||
# <prefix>/include/opencascade-7.0.0 for unix
|
||||
if (NOT DEFINED INSTALL_DIR_INCLUDE)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_INCLUDE "include/opencascade" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_INCLUDE "include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OCCT resources: <prefix>/src for windows,
|
||||
# <prefix>/share/opencascade-7.0.0/resources for unix
|
||||
if (NOT DEFINED INSTALL_DIR_RESOURCE)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_RESOURCE "share/opencascade/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_RESOURCE "share/opencascade-${OCC_VERSION_STRING_EXT}/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (INSTALL_DIR_RESOURCE "src" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OCCT data
|
||||
if (NOT DEFINED INSTALL_DIR_DATA)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_DATA "share/opencascade/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_DATA "share/opencascade-${OCC_VERSION_STRING_EXT}/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (INSTALL_DIR_DATA "data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include original list of definitions and flags
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_DIR)
|
||||
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
|
||||
get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
|
||||
else()
|
||||
file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
|
||||
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
|
||||
find_package(OpenCASCADE QUIET PATHS "${OpenCASCADE_DIR}" "${OpenCASCADE_INSTALL_PREFIX}" NO_DEFAULT_PATH)
|
||||
# include OCCT headers
|
||||
include_directories ("${OpenCASCADE_INCLUDE_DIR}")
|
||||
|
||||
if (NOT OpenCASCADE_FOUND)
|
||||
message (FATAL_ERROR "could not find OpenCASCADE, please set OpenCASCADE_DIR variable" )
|
||||
else()
|
||||
set (OpenCASCADE_DIR "${OpenCASCADE_INSTALL_PREFIX}" CACHE PATH "OpenCASCADE directory" FORCE)
|
||||
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
|
||||
endif()
|
||||
|
||||
set (USE_TCL "${OpenCASCADE_WITH_TCL}")
|
||||
set (USE_FREETYPE "${OpenCASCADE_WITH_FREETYPE}")
|
||||
set (USE_FREEIMAGE "${OpenCASCADE_WITH_FREEIMAGE}")
|
||||
set (USE_GL2PS "${OpenCASCADE_WITH_GL2PS}")
|
||||
set (USE_TBB "${OpenCASCADE_WITH_TBB}")
|
||||
set (USE_VTK "${OpenCASCADE_WITH_VTK}")
|
||||
set (USE_FFMPEG "${OpenCASCADE_WITH_FFMPEG}")
|
||||
set (USE_GLES2 "${OpenCASCADE_WITH_GLES2}")
|
||||
set (USE_GLX "${OpenCASCADE_WITH_GLX}")
|
||||
|
||||
|
||||
# define CSF variable
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
|
||||
|
||||
# custom definitions (CMakeConfig of OCCT)
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_TCL "adm/cmake/tcl")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FREETYPE "adm/cmake/freetype")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FREEIMAGE "adm/cmake/freeimage")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GL2PS "adm/cmake/gl2ps")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_TBB "adm/cmake/tbb")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_VTK "adm/cmake/vtk")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FFMPEG "adm/cmake/ffmpeg")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLES2 "adm/cmake/egl")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLES2 "adm/cmake/gles2")
|
||||
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLX "adm/cmake/glx")
|
||||
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
#include (${CMAKE_SOURCE_DIR}/adm/cmake/3rdparty.cmake)
|
||||
|
||||
set (3RDPARTY_DLL_DEB_PATH "${3RDPARTY_DLL_PATH}")
|
||||
|
||||
# build directories
|
||||
if (SINGLE_GENERATOR)
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
|
||||
if (WIN32)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
||||
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||
|
||||
if (WIN32)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||
endif()
|
||||
|
||||
# OCCT tools
|
||||
# include original list of tools
|
||||
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
|
||||
# list <OCCT_TOOLS> will contain all tools
|
||||
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
|
||||
foreach (OCCT_TOOL ${OCCT_TOOLS})
|
||||
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
|
||||
endforeach()
|
||||
|
||||
# collect all the headers to <binary dir>/inc/inspector folder
|
||||
|
||||
# Ensure the include directory exists
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/inspector")
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "tools" "${INSTALL_DIR_INCLUDE}/inspector")
|
||||
|
||||
# include <cmake binary folder>/inc
|
||||
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
|
||||
|
||||
include_directories (${ADDITIONAL_INLCUDE_DIR})
|
||||
|
||||
if (3RDPARTY_INCLUDE_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
|
||||
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
|
||||
message (STATUS "Info: The directories of 3rdparty headers: \n\t${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
|
||||
include_directories (${3RDPARTY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_LIBRARY_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
|
||||
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
|
||||
message (STATUS "Info: The directories of 3rdparty libraries: \n\t${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
|
||||
link_directories (${3RDPARTY_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
# include patched toolkit projects or original ones
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
|
||||
OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
|
||||
|
||||
OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
|
||||
|
||||
# patch TInspectorEXE
|
||||
if (MSVC AND 3RDPARTY_DLL_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS)
|
||||
set (3RDPARTY_DLL_DIRS_FOR_PATH "")
|
||||
|
||||
foreach (3RDPARTY_DLL_DIR ${3RDPARTY_DLL_DIRS})
|
||||
set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
|
||||
endforeach()
|
||||
|
||||
if (ADDITIONAL_DLL_DIR)
|
||||
foreach (3RDPARTY_DLL_DIR ${ADDITIONAL_DLL_DIR})
|
||||
set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
|
||||
endforeach()
|
||||
endif (ADDITIONAL_DLL_DIR)
|
||||
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
set (X_COMPILER_BITNESS "x64")
|
||||
if ("${COMPILER_BITNESS}" STREQUAL "32")
|
||||
set (X_COMPILER_BITNESS "Win32")
|
||||
endif()
|
||||
|
||||
# patch TInspectorEXE
|
||||
OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/TInspectorEXE/TInspectorEXE.vcxproj.user")
|
||||
endif()
|
||||
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) Inspector configuration files prepared")
|
@ -1,294 +0,0 @@
|
||||
// Created on: 2020-01-25
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2020 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 <inspector/Convert_Tools.hxx>
|
||||
#include <inspector/Convert_TransientShape.hxx>
|
||||
|
||||
#include <AIS_Line.hxx>
|
||||
#include <AIS_Plane.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <BRepPreviewAPI_MakeBox.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Prs3d_PlaneAspect.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : ReadShape
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TopoDS_Shape Convert_Tools::ReadShape(const TCollection_AsciiString& theFileName)
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
BRep_Builder aBuilder;
|
||||
BRepTools::Read(aShape, theFileName.ToCString(), aBuilder);
|
||||
return aShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : ConvertStreamToPresentations
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void Convert_Tools::ConvertStreamToPresentations(
|
||||
const Standard_SStream& theSStream,
|
||||
const Standard_Integer theStartPos,
|
||||
const Standard_Integer /*theLastPos*/,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations)
|
||||
{
|
||||
int aStartPos = theStartPos;
|
||||
|
||||
gp_XYZ aPoint;
|
||||
if (aPoint.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
thePresentations.Append(new Convert_TransientShape(BRepBuilderAPI_MakeVertex(aPoint)));
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Pnt aPnt;
|
||||
if (aPnt.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
thePresentations.Append(new Convert_TransientShape(BRepBuilderAPI_MakeVertex(aPnt)));
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Dir aDir;
|
||||
if (aDir.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
gp_Lin aLin(gp::Origin(), aDir);
|
||||
Handle(Geom_Line) aGeomLine = new Geom_Line(aLin);
|
||||
CreatePresentation(aGeomLine, thePresentations);
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Ax2 anAx2;
|
||||
if (anAx2.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
Handle(Geom_Plane) aGeomPlane = new Geom_Plane(gp_Ax3(anAx2));
|
||||
CreatePresentation(aGeomPlane, thePresentations);
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Ax3 anAx3; // should be after gp_Ax2
|
||||
if (anAx3.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
Handle(Geom_Plane) aGeomPlane = new Geom_Plane(anAx3);
|
||||
CreatePresentation(aGeomPlane, thePresentations);
|
||||
return;
|
||||
}
|
||||
|
||||
// should be after gp_Ax3
|
||||
gp_Ax1 anAxis;
|
||||
if (anAxis.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
thePresentations.Append(new Convert_TransientShape(
|
||||
BRepBuilderAPI_MakeEdge(anAxis.Location(),
|
||||
anAxis.Location().Coord() + anAxis.Direction().XYZ())));
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Trsf aTrsf;
|
||||
if (aTrsf.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
CreatePresentation(aTrsf, thePresentations);
|
||||
return;
|
||||
}
|
||||
|
||||
Bnd_Box aBox;
|
||||
if (aBox.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
if (Convert_Tools::CreateShape(aBox, aShape))
|
||||
thePresentations.Append(new Convert_TransientShape(aShape));
|
||||
return;
|
||||
}
|
||||
|
||||
Select3D_BndBox3d aSelectBndBox;
|
||||
if (aSelectBndBox.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
gp_Pnt aPntMin = gp_Pnt(aSelectBndBox.CornerMin().x(),
|
||||
aSelectBndBox.CornerMin().y(),
|
||||
aSelectBndBox.CornerMin().z());
|
||||
gp_Pnt aPntMax = gp_Pnt(aSelectBndBox.CornerMax().x(),
|
||||
aSelectBndBox.CornerMax().y(),
|
||||
aSelectBndBox.CornerMax().z());
|
||||
if (CreateBoxShape(aPntMin, aPntMax, aShape))
|
||||
thePresentations.Append(new Convert_TransientShape(aShape));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : ConvertStreamToColor
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean Convert_Tools::ConvertStreamToColor(const Standard_SStream& theSStream,
|
||||
Quantity_Color& theColor)
|
||||
{
|
||||
Standard_Integer aStartPos = 1;
|
||||
Quantity_ColorRGBA aColorRGBA;
|
||||
if (aColorRGBA.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
theColor = aColorRGBA.GetRGB();
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
Quantity_Color aColor;
|
||||
if (aColor.InitFromJson(theSStream, aStartPos))
|
||||
{
|
||||
theColor = aColor;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : CreateShape
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean Convert_Tools::CreateShape(const Bnd_Box& theBoundingBox, TopoDS_Shape& theShape)
|
||||
{
|
||||
if (theBoundingBox.IsVoid() || theBoundingBox.IsWhole())
|
||||
return Standard_False;
|
||||
|
||||
Standard_Real aXmin, anYmin, aZmin, aXmax, anYmax, aZmax;
|
||||
theBoundingBox.Get(aXmin, anYmin, aZmin, aXmax, anYmax, aZmax);
|
||||
|
||||
gp_Pnt aPntMin = gp_Pnt(aXmin, anYmin, aZmin);
|
||||
gp_Pnt aPntMax = gp_Pnt(aXmax, anYmax, aZmax);
|
||||
|
||||
return CreateBoxShape(aPntMin, aPntMax, theShape);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : CreateShape
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean Convert_Tools::CreateShape(const Bnd_OBB& theBoundingBox, TopoDS_Shape& theShape)
|
||||
{
|
||||
if (theBoundingBox.IsVoid())
|
||||
return Standard_False;
|
||||
|
||||
TColgp_Array1OfPnt anArrPnts(0, 8);
|
||||
theBoundingBox.GetVertex(&anArrPnts(0));
|
||||
|
||||
BRep_Builder aBuilder;
|
||||
TopoDS_Compound aCompound;
|
||||
aBuilder.MakeCompound(aCompound);
|
||||
|
||||
aBuilder.Add(aCompound,
|
||||
BRepBuilderAPI_MakeEdge(gp_Pnt(anArrPnts.Value(0)), gp_Pnt(anArrPnts.Value(1))));
|
||||
aBuilder.Add(aCompound,
|
||||
BRepBuilderAPI_MakeEdge(gp_Pnt(anArrPnts.Value(0)), gp_Pnt(anArrPnts.Value(2))));
|
||||
aBuilder.Add(aCompound,
|
||||
BRepBuilderAPI_MakeEdge(gp_Pnt(anArrPnts.Value(1)), gp_Pnt(anArrPnts.Value(3))));
|
||||
aBuilder.Add(aCompound,
|
||||
BRepBuilderAPI_MakeEdge(gp_Pnt(anArrPnts.Value(2)), gp_Pnt(anArrPnts.Value(3))));
|
||||
|
||||
theShape = aCompound;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : CreateBoxShape
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean Convert_Tools::CreateBoxShape(const gp_Pnt& thePntMin,
|
||||
const gp_Pnt& thePntMax,
|
||||
TopoDS_Shape& theShape)
|
||||
{
|
||||
BRepPreviewAPI_MakeBox aMakeBox;
|
||||
aMakeBox.Init(thePntMin, thePntMax);
|
||||
theShape = aMakeBox.Shape();
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : CreatePresentation
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void Convert_Tools::CreatePresentation(
|
||||
const Handle(Geom_Line)& theLine,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations)
|
||||
{
|
||||
Handle(AIS_Line) aLinePrs = new AIS_Line(theLine);
|
||||
aLinePrs->SetColor(Quantity_NOC_TOMATO);
|
||||
thePresentations.Append(aLinePrs);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : CreatePresentation
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void Convert_Tools::CreatePresentation(
|
||||
const Handle(Geom_Plane)& thePlane,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations)
|
||||
{
|
||||
Handle(AIS_Plane) aPlanePrs = new AIS_Plane(thePlane);
|
||||
|
||||
aPlanePrs->Attributes()->SetPlaneAspect(new Prs3d_PlaneAspect());
|
||||
Handle(Prs3d_PlaneAspect) aPlaneAspect = aPlanePrs->Attributes()->PlaneAspect();
|
||||
aPlaneAspect->SetPlaneLength(100, 100);
|
||||
aPlaneAspect->SetDisplayCenterArrow(Standard_True);
|
||||
aPlaneAspect->SetDisplayEdgesArrows(Standard_True);
|
||||
aPlaneAspect->SetArrowsSize(100);
|
||||
aPlaneAspect->SetArrowsLength(100);
|
||||
aPlaneAspect->SetDisplayCenterArrow(Standard_True);
|
||||
aPlaneAspect->SetDisplayEdges(Standard_True);
|
||||
|
||||
aPlanePrs->SetColor(Quantity_NOC_WHITE);
|
||||
aPlanePrs->SetTransparency(0);
|
||||
|
||||
thePresentations.Append(aPlanePrs);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : CreatePresentation
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void Convert_Tools::CreatePresentation(
|
||||
const gp_Trsf& theTrsf,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations)
|
||||
{
|
||||
Bnd_Box aBox(gp_Pnt(), gp_Pnt(10., 10., 10));
|
||||
|
||||
TopoDS_Shape aBoxShape;
|
||||
if (!Convert_Tools::CreateShape(aBox, aBoxShape))
|
||||
return;
|
||||
|
||||
Handle(AIS_Shape) aSourcePrs = new AIS_Shape(aBoxShape);
|
||||
aSourcePrs->Attributes()->SetAutoTriangulation(Standard_False);
|
||||
aSourcePrs->SetColor(Quantity_NOC_WHITE);
|
||||
aSourcePrs->SetTransparency(0.5);
|
||||
thePresentations.Append(aSourcePrs);
|
||||
|
||||
Handle(AIS_Shape) aTransformedPrs = new AIS_Shape(aBoxShape);
|
||||
aTransformedPrs->Attributes()->SetAutoTriangulation(Standard_False);
|
||||
aTransformedPrs->SetColor(Quantity_NOC_TOMATO);
|
||||
aTransformedPrs->SetTransparency(0.5);
|
||||
aTransformedPrs->SetLocalTransformation(theTrsf);
|
||||
thePresentations.Append(aTransformedPrs);
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
// Created on: 2020-01-25
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2020 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 Convert_Tools_H
|
||||
#define Convert_Tools_H
|
||||
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Bnd_OBB.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class Geom_Line;
|
||||
class Geom_Plane;
|
||||
class Geom_Transformation;
|
||||
|
||||
//! \class Convert_Tools
|
||||
//! \brief The tool that gives auxiliary methods for qt elements manipulation.
|
||||
class Convert_Tools
|
||||
{
|
||||
public:
|
||||
//! Reads Shape using BREP reader
|
||||
//! \param theFileName a file name
|
||||
//! \return shape or NULL
|
||||
Standard_EXPORT static TopoDS_Shape ReadShape(const TCollection_AsciiString& theFileName);
|
||||
|
||||
//! Creates shape presentations on the stream if possible. Tries to init some OCCT base for a new
|
||||
//! presentation \param theStream source of presentation \param thePresentations container to
|
||||
//! collect new presentations
|
||||
Standard_EXPORT static void ConvertStreamToPresentations(
|
||||
const Standard_SStream& theSStream,
|
||||
const Standard_Integer theStartPos,
|
||||
const Standard_Integer theLastPos,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations);
|
||||
|
||||
//! Converts stream to color if possible. It processes Quantity_Color, Quantity_ColorRGBA
|
||||
//! \param theStream source of presentation
|
||||
//! \param[out] theColor converted color
|
||||
//! \returns true if done
|
||||
Standard_EXPORT static Standard_Boolean ConvertStreamToColor(const Standard_SStream& theSStream,
|
||||
Quantity_Color& theColor);
|
||||
|
||||
//! Creates box shape
|
||||
//! \param theBoundingBox box shape parameters
|
||||
//! \return created shape
|
||||
Standard_EXPORT static Standard_Boolean CreateShape(const Bnd_Box& theBoundingBox,
|
||||
TopoDS_Shape& theShape);
|
||||
|
||||
//! Creates box shape
|
||||
//! \param theBoundingBox box shape parameters
|
||||
//! \return created shape
|
||||
Standard_EXPORT static Standard_Boolean CreateShape(const Bnd_OBB& theBoundingBox,
|
||||
TopoDS_Shape& theShape);
|
||||
|
||||
//! Creates box shape
|
||||
//! \param thePntMin minimum point on the bounding box
|
||||
//! \param thePntMax maximum point on the bounding box
|
||||
//! \return created shape
|
||||
Standard_EXPORT static Standard_Boolean CreateBoxShape(const gp_Pnt& thePntMin,
|
||||
const gp_Pnt& thePntMax,
|
||||
TopoDS_Shape& theShape);
|
||||
|
||||
//! Creates presentation AIS_Line
|
||||
//! \param theLine source line
|
||||
//! \param thePresentations container to collect new presentations
|
||||
Standard_EXPORT static void CreatePresentation(
|
||||
const Handle(Geom_Line)& theLine,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations);
|
||||
|
||||
//! Creates presentation AIS_Plane
|
||||
//! \param thePlane source plane
|
||||
//! \param thePresentations container to collect new presentations
|
||||
Standard_EXPORT static void CreatePresentation(
|
||||
const Handle(Geom_Plane)& thePlane,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations);
|
||||
|
||||
//! Creates two presentations base on gp_Trsf: box in initial place and transformed box
|
||||
//! \param thePlane source plane
|
||||
//! \param thePresentations container to collect new presentations
|
||||
Standard_EXPORT static void CreatePresentation(
|
||||
const gp_Trsf& theTrsf,
|
||||
NCollection_List<Handle(Standard_Transient)>& thePresentations);
|
||||
};
|
||||
|
||||
#endif
|
@ -1,50 +0,0 @@
|
||||
// Created on: 2020-01-25
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2020 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 Convert_TransientShape_H
|
||||
#define Convert_TransientShape_H
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//! \class Convert_TransientShape
|
||||
//! \brief An interface to convert a shape into a transient object to be used in arguments
|
||||
class Convert_TransientShape : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
Convert_TransientShape(const TopoDS_Shape& theShape) { SetShape(theShape); }
|
||||
|
||||
//! Destructor
|
||||
virtual ~Convert_TransientShape() {}
|
||||
|
||||
//! Returns current shape
|
||||
const TopoDS_Shape Shape() const { return myShape; }
|
||||
|
||||
//! Fills current shape
|
||||
void SetShape(const TopoDS_Shape& theShape) { myShape = theShape; }
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(Convert_TransientShape, Standard_Transient)
|
||||
|
||||
private:
|
||||
TopoDS_Shape myShape; //!< the shape
|
||||
};
|
||||
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
Convert_Tools.cxx
|
||||
Convert_Tools.hxx
|
||||
Convert_TransientShape.hxx
|
@ -1,18 +0,0 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>icons/attribute.png</file>
|
||||
<file>icons/attribute_40x40.png</file>
|
||||
<file>icons/export_shape.png</file>
|
||||
<file>icons/folder_export.png</file>
|
||||
<file>icons/item_type_folder.png</file>
|
||||
<file>icons/item_type_folder_40x40.png</file>
|
||||
<file>icons/level_change.png</file>
|
||||
<file>icons/named_shape.png</file>
|
||||
<file>icons/named_shape_40x40.png</file>
|
||||
<file>icons/search.png</file>
|
||||
<file>icons/search_cancel.png</file>
|
||||
<file>icons/treeline_backward.png</file>
|
||||
<file>icons/treeline_forward.png</file>
|
||||
<file>icons/treeline_update.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,153 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_AttributePaneStack.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePaneAPI.hxx>
|
||||
#include <inspector/DFBrowserPane_AttributePaneSelector.hxx>
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
#include <inspector/DFBrowser_TreeLevelView.hxx>
|
||||
#include <inspector/DFBrowser_TreeModel.hxx>
|
||||
#include <inspector/DFBrowser_SearchView.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
|
||||
#include <inspector/ViewControl_Tools.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QMap>
|
||||
#include <QStackedWidget>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_AttributePaneStack::DFBrowser_AttributePaneStack(QObject* theParent)
|
||||
: QObject(theParent),
|
||||
myCurrentPane(0),
|
||||
myAttributesStack(0),
|
||||
myModule(0),
|
||||
myTreeLevelView(0),
|
||||
mySearchView(0),
|
||||
myEmptyWidget(0),
|
||||
myPaneMode(DFBrowser_AttributePaneType_ItemView)
|
||||
{
|
||||
myPaneSelector = new DFBrowserPane_AttributePaneSelector(theParent);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : CreateWidget
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_AttributePaneStack::CreateWidget(QWidget* theParent)
|
||||
{
|
||||
myAttributesStack = new QStackedWidget(theParent);
|
||||
ViewControl_Tools::SetWhiteBackground(myAttributesStack);
|
||||
myEmptyWidget = new QWidget(theParent);
|
||||
ViewControl_Tools::SetWhiteBackground(myEmptyWidget);
|
||||
|
||||
myAttributesStack->addWidget(myEmptyWidget);
|
||||
|
||||
myTreeLevelView = new DFBrowser_TreeLevelView(theParent);
|
||||
myAttributesStack->addWidget(myTreeLevelView->GetControl());
|
||||
|
||||
mySearchView = new DFBrowser_SearchView(theParent);
|
||||
myAttributesStack->addWidget(mySearchView->GetControl());
|
||||
|
||||
myAttributesStack->setCurrentWidget(myEmptyWidget);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetPaneMode
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_AttributePaneStack::SetPaneMode(const DFBrowser_AttributePaneType& theMode)
|
||||
{
|
||||
if (myPaneMode == theMode)
|
||||
return;
|
||||
|
||||
myPaneMode = theMode;
|
||||
if (myPaneMode == DFBrowser_AttributePaneType_SearchView)
|
||||
{
|
||||
// clear highlight in tree model
|
||||
DFBrowser_TreeModel* aModel = dynamic_cast<DFBrowser_TreeModel*>(myModule->GetOCAFViewModel());
|
||||
if (aModel && aModel->HasHighlighted())
|
||||
aModel->SetHighlighted(QModelIndexList());
|
||||
myAttributesStack->setCurrentWidget(mySearchView->GetControl());
|
||||
}
|
||||
else
|
||||
{
|
||||
QItemSelectionModel* aSelectionModel = myModule->GetOCAFViewSelectionModel();
|
||||
QModelIndex anIndex =
|
||||
TreeModel_ModelBase::SingleSelected(aSelectionModel->selectedIndexes(), 0);
|
||||
SetCurrentItem(anIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCurrentItem
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_AttributePaneStack::SetCurrentItem(const QModelIndex& theIndex)
|
||||
{
|
||||
if (myPaneMode != DFBrowser_AttributePaneType_ItemView)
|
||||
return;
|
||||
|
||||
// clear highlight in tree model
|
||||
DFBrowser_TreeModel* aModel = dynamic_cast<DFBrowser_TreeModel*>(myModule->GetOCAFViewModel());
|
||||
if (aModel && aModel->HasHighlighted())
|
||||
aModel->SetHighlighted(QModelIndexList());
|
||||
|
||||
myCurrentPane = 0;
|
||||
QWidget* aWidget = 0;
|
||||
TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex(theIndex);
|
||||
if (!anItemBase)
|
||||
return;
|
||||
|
||||
if (DFBrowser_TreeLevelView::ProcessItem(theIndex))
|
||||
aWidget = myTreeLevelView->GetControl();
|
||||
else
|
||||
{
|
||||
DFBrowser_ItemPtr anItem = itemDynamicCast<DFBrowser_Item>(anItemBase);
|
||||
if (!anItem)
|
||||
return;
|
||||
|
||||
if (myAttributesStack->currentWidget() == myTreeLevelView->GetControl())
|
||||
myTreeLevelView->ClearSelection();
|
||||
Handle(TDF_Attribute) anAttribute = anItem->GetAttribute();
|
||||
myCurrentPane = myModule->GetAttributePane(anAttribute);
|
||||
|
||||
if (myCurrentPane)
|
||||
{
|
||||
aWidget = myCurrentPane->GetWidget(myAttributesStack, true);
|
||||
if (aWidget)
|
||||
{
|
||||
int aWidgetIndex = myAttributesStack->indexOf(aWidget);
|
||||
if (aWidgetIndex < 0)
|
||||
myAttributesStack->addWidget(aWidget);
|
||||
}
|
||||
myCurrentPane->Init(anAttribute);
|
||||
|
||||
std::list<QItemSelectionModel*> aSelectionModels = myCurrentPane->GetSelectionModels();
|
||||
myPaneSelector->SetCurrentSelectionModels(aSelectionModels);
|
||||
}
|
||||
}
|
||||
myAttributesStack->setCurrentWidget(aWidget != NULL ? aWidget : myEmptyWidget);
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_AttributePaneStack_H
|
||||
#define DFBrowser_AttributePaneStack_H
|
||||
|
||||
#include <inspector/DFBrowser_AttributePaneType.hxx>
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QMap>
|
||||
#include <QItemSelection>
|
||||
#include <QStackedWidget>
|
||||
#include <QWidget>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowserPane_AttributePaneAPI;
|
||||
class DFBrowserPane_AttributePaneSelector;
|
||||
class DFBrowser_Module;
|
||||
class DFBrowser_SearchView;
|
||||
class DFBrowser_TreeLevelView;
|
||||
|
||||
class QStackedWidget;
|
||||
class QWidget;
|
||||
|
||||
//! \class DFBrowser_AttributePaneStack
|
||||
//! \brief Provides work to stacked widget where the current attribute pane is shown.
|
||||
class DFBrowser_AttributePaneStack : public QObject
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_AttributePaneStack(QObject* theParent);
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_AttributePaneStack() {}
|
||||
|
||||
//! Creates a stacked widget
|
||||
//! \param theParent a parent widget
|
||||
Standard_EXPORT virtual void CreateWidget(QWidget* theParent);
|
||||
|
||||
//! \return the stacked widget
|
||||
QWidget* GetWidget() const { return myAttributesStack; }
|
||||
|
||||
//! Fills stack with the information
|
||||
//! \param theAttributeTypes a map of attribute type name to information pane
|
||||
void SetModule(DFBrowser_Module* theModule) { myModule = theModule; }
|
||||
|
||||
//! Sets the current widget in the stacked control either attribute pane or search view
|
||||
//! \param theMode an active mode
|
||||
Standard_EXPORT void SetPaneMode(const DFBrowser_AttributePaneType& theMode);
|
||||
|
||||
//! \return an attribute pane, which corresponds the current widget of the stacked widget control
|
||||
DFBrowserPane_AttributePaneAPI* GetCurrentPane() const { return myCurrentPane; }
|
||||
|
||||
//! \return tree level view
|
||||
DFBrowser_TreeLevelView* GetTreeLevelView() const { return myTreeLevelView; }
|
||||
|
||||
//! \return the search view
|
||||
DFBrowser_SearchView* GetSearchView() const { return mySearchView; }
|
||||
|
||||
//! \return the pane selector
|
||||
DFBrowserPane_AttributePaneSelector* GetPaneSelector() const { return myPaneSelector; }
|
||||
|
||||
//! Sets an active widget of attribute pane if the pane mode is item view mode.
|
||||
//! Gets selection models of this pane and set the models into pane selector
|
||||
Standard_EXPORT void SetCurrentItem(const QModelIndex& theIndex);
|
||||
|
||||
protected:
|
||||
DFBrowserPane_AttributePaneAPI* myCurrentPane; //!< active pane if mode is item view mode
|
||||
DFBrowserPane_AttributePaneSelector* myPaneSelector; //!< pane selector filled by the active pane
|
||||
QStackedWidget* myAttributesStack; //!< container of already created panes
|
||||
DFBrowser_Module* myModule; //!< the current module
|
||||
DFBrowser_TreeLevelView* myTreeLevelView; //!< view of objects from one level of tree view
|
||||
DFBrowser_SearchView* mySearchView; //!< view of search control
|
||||
QWidget* myEmptyWidget; //!< an empty widget when nothing is selected in tree view
|
||||
DFBrowser_AttributePaneType
|
||||
myPaneMode; //!< the current pane mode, either item view or search view
|
||||
};
|
||||
|
||||
#endif
|
@ -1,27 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_AttributePaneType_H
|
||||
#define DFBrowser_AttributePaneType_H
|
||||
|
||||
//! Type of view shown in attribute pane stack
|
||||
enum DFBrowser_AttributePaneType
|
||||
{
|
||||
DFBrowser_AttributePaneType_ItemView, //!< attribute pane stack shows either TreeLevelView or
|
||||
//!< attribute pane
|
||||
DFBrowser_AttributePaneType_SearchView //!< attribute pane stack shows search view
|
||||
};
|
||||
|
||||
#endif
|
@ -1,50 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_Communicator.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : CreateCommunicator
|
||||
// purpose : Creates a communicator by the library loading
|
||||
// =======================================================================
|
||||
Standard_EXPORTEXTERNC TInspectorAPI_Communicator* CreateCommunicator()
|
||||
{
|
||||
return new DFBrowser_Communicator();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_Communicator::DFBrowser_Communicator()
|
||||
: TInspectorAPI_Communicator(),
|
||||
myWindow(0)
|
||||
{
|
||||
myWindow = new DFBrowser_Window();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetParameters
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Communicator::SetParameters(
|
||||
const Handle(TInspectorAPI_PluginParameters)& theParameters)
|
||||
{
|
||||
myWindow->SetParameters(theParameters);
|
||||
myWindow->UpdateContent();
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_Communicator_H
|
||||
#define DFBrowser_Communicator_H
|
||||
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
#include <inspector/TInspectorAPI_Communicator.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowser_Window;
|
||||
|
||||
//! \class DFBrowser_Communicator.
|
||||
//! \brief This is a connector from TInspector application to DFBrowser view
|
||||
class DFBrowser_Communicator : public QObject, public TInspectorAPI_Communicator
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_Communicator();
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_Communicator() {}
|
||||
|
||||
//! Provides the container with a parent where this container should be inserted.
|
||||
//! If Qt implementation, it should be QWidget with QLayout set inside
|
||||
//! \param theParent a parent class
|
||||
virtual void SetParent(void* theParent) Standard_OVERRIDE { myWindow->SetParent(theParent); }
|
||||
|
||||
//! Sets parameters container, it should be used when the plugin is initialized or in update
|
||||
//! content \param theParameters a parameters container
|
||||
Standard_EXPORT virtual void SetParameters(
|
||||
const Handle(TInspectorAPI_PluginParameters)& theParameters) Standard_OVERRIDE;
|
||||
|
||||
//! Provides container for actions available in inspector on general level
|
||||
//! \param theMenu if Qt implementation, it is QMenu object
|
||||
Standard_EXPORT virtual void FillActionsMenu(void* theMenu) Standard_OVERRIDE
|
||||
{
|
||||
myWindow->FillActionsMenu(theMenu);
|
||||
}
|
||||
|
||||
//! Returns plugin preferences, empty implementation by default
|
||||
//! \param theItem container of preference elements
|
||||
virtual void GetPreferences(TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE
|
||||
{
|
||||
myWindow->GetPreferences(theItem);
|
||||
}
|
||||
|
||||
//! Stores plugin preferences, empty implementation by default
|
||||
//! \param theItem container of preference elements
|
||||
virtual void SetPreferences(const TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE
|
||||
{
|
||||
myWindow->SetPreferences(theItem);
|
||||
}
|
||||
|
||||
//! Updates content of the current window
|
||||
virtual void UpdateContent() Standard_OVERRIDE { myWindow->UpdateContent(); }
|
||||
|
||||
private:
|
||||
DFBrowser_Window* myWindow; //!< the current window
|
||||
};
|
||||
|
||||
#endif
|
@ -1,98 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_DumpView.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
#include <inspector/DFBrowser_TreeLevelView.hxx>
|
||||
#include <OSD_OpenFile.hxx>
|
||||
#include <inspector/TreeModel_ModelBase.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QTextStream>
|
||||
#include <QWidget>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : onSelectionChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_DumpView::OnTreeViewSelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection&)
|
||||
{
|
||||
myTextEdit->setVisible(false);
|
||||
myTextEdit->clear();
|
||||
|
||||
QModelIndexList aSelectedIndices = theSelected.indexes();
|
||||
QModelIndexList aFirstColumnSelectedIndices;
|
||||
for (QModelIndexList::const_iterator aSelIt = aSelectedIndices.begin();
|
||||
aSelIt != aSelectedIndices.end();
|
||||
aSelIt++)
|
||||
{
|
||||
QModelIndex anIndex = *aSelIt;
|
||||
if (anIndex.column() == 0)
|
||||
aFirstColumnSelectedIndices.append(anIndex);
|
||||
}
|
||||
if (aFirstColumnSelectedIndices.size() != 1)
|
||||
return;
|
||||
|
||||
QString aDumpInfo;
|
||||
const QModelIndex& anIndex = aFirstColumnSelectedIndices.first();
|
||||
TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex(anIndex);
|
||||
DFBrowser_ItemPtr anItem;
|
||||
if (anItemBase)
|
||||
anItem = itemDynamicCast<DFBrowser_Item>(anItemBase);
|
||||
|
||||
if (!anItem)
|
||||
return;
|
||||
|
||||
TCollection_AsciiString aFileName = DFBrowser_Window::TmpDirectory();
|
||||
aFileName += "/dfbrowser.txt";
|
||||
// print dump to file(not in a string stream because result might be too long)
|
||||
std::ofstream aFileStream;
|
||||
OSD_OpenStream(aFileStream, aFileName, std::ios::out);
|
||||
if (anItem->HasAttribute())
|
||||
{
|
||||
Handle(TDF_Attribute) anAttribute = anItem->GetAttribute();
|
||||
if (!anAttribute.IsNull())
|
||||
anAttribute->Dump(aFileStream);
|
||||
}
|
||||
else if (anItem->HasLabel())
|
||||
anItem->GetLabel().Dump(aFileStream);
|
||||
aFileStream.close();
|
||||
|
||||
// read dumped file to fill view
|
||||
QFile aFile(aFileName.ToCString());
|
||||
if (!aFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return;
|
||||
QTextStream aStream(&aFile);
|
||||
while (!aStream.atEnd())
|
||||
{
|
||||
aDumpInfo.append(QString("%1\n").arg(aStream.readLine()));
|
||||
}
|
||||
aFile.close();
|
||||
QDir aDir;
|
||||
aDir.remove(aFileName.ToCString());
|
||||
if (!aDumpInfo.isEmpty())
|
||||
{
|
||||
myTextEdit->setVisible(true);
|
||||
myTextEdit->setPlainText(aDumpInfo);
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_DumpView_H
|
||||
#define DFBrowser_DumpView_H
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QObject>
|
||||
#include <QItemSelection>
|
||||
#include <QPlainTextEdit>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class QWidget;
|
||||
|
||||
//! \class DFBrowser_DumpView
|
||||
//! \brief View to display result of Dump() method of a TDF_Attribute
|
||||
class DFBrowser_DumpView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! Constructor
|
||||
DFBrowser_DumpView(QWidget* theParent)
|
||||
: QObject(theParent),
|
||||
myTextEdit(new QPlainTextEdit(theParent))
|
||||
{
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_DumpView() {}
|
||||
|
||||
//! \return the text edit control
|
||||
QWidget* GetControl() const { return myTextEdit; }
|
||||
|
||||
public slots:
|
||||
|
||||
//! Listens selection change and update the current control content by selection
|
||||
//! \param theSelected container of selected items
|
||||
//! \param theDeselected container of items that become deselected
|
||||
Standard_EXPORT void OnTreeViewSelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection& theDeselected);
|
||||
|
||||
private:
|
||||
QPlainTextEdit* myTextEdit; //!< information view
|
||||
};
|
||||
#endif
|
@ -1,39 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_HighlightDelegate.hxx>
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QPainter>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : paint
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_HighlightDelegate::paint(QPainter* thePainter,
|
||||
const QStyleOptionViewItem& theOption,
|
||||
const QModelIndex& theIndex) const
|
||||
{
|
||||
// highlight cell
|
||||
if (theOption.state & QStyle::State_MouseOver)
|
||||
{
|
||||
QColor aHighlightColor = DFBrowserPane_Tools::LightHighlightColor();
|
||||
thePainter->fillRect(theOption.rect, aHighlightColor);
|
||||
}
|
||||
// default paint
|
||||
QItemDelegate::paint(thePainter, theOption, theIndex);
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_HighlightDelegate_H
|
||||
#define DFBrowser_HighlightDelegate_H
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QItemDelegate>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
//! \class DFBrowser_HighlightDelegate
|
||||
//! \brief An item delegate to paint in highlight color the cell when the mouse cursor is over it
|
||||
class DFBrowser_HighlightDelegate : public QItemDelegate
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
DFBrowser_HighlightDelegate(QObject* theParent = 0)
|
||||
: QItemDelegate(theParent)
|
||||
{
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_HighlightDelegate() {}
|
||||
|
||||
//! Redefines of the parent virtual method to color the cell rectangle in highlight style
|
||||
//! \param thePainter a painter
|
||||
//! \param theOption a paint options
|
||||
//! \param theIndex a view index
|
||||
Standard_EXPORT virtual void paint(QPainter* thePainter,
|
||||
const QStyleOptionViewItem& theOption,
|
||||
const QModelIndex& theIndex) const Standard_OVERRIDE;
|
||||
};
|
||||
#endif
|
@ -1,216 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_Item.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_ItemRole.hxx>
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePane.hxx>
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <TDF_AttributeIterator.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QIcon>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : hasAttribute
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool DFBrowser_Item::HasAttribute() const
|
||||
{
|
||||
initItem();
|
||||
return myAttributeGUID != Standard_GUID();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : getAttribute
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(TDF_Attribute) DFBrowser_Item::GetAttribute() const
|
||||
{
|
||||
initItem();
|
||||
Handle(TDF_Attribute) anAttribute;
|
||||
GetLabel().FindAttribute(myAttributeGUID, anAttribute);
|
||||
return anAttribute;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Init
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Item::Init()
|
||||
{
|
||||
DFBrowser_ItemBasePtr aParentItem = itemDynamicCast<DFBrowser_ItemBase>(Parent());
|
||||
if (!aParentItem)
|
||||
return;
|
||||
TDF_Label aParentLabel = aParentItem->GetLabel();
|
||||
// items can exist only by items with not empty label
|
||||
if (aParentLabel.IsNull())
|
||||
return;
|
||||
|
||||
int aNbAttributes = aParentLabel.NbAttributes();
|
||||
int aRowId = Row();
|
||||
if (aRowId < aNbAttributes)
|
||||
{
|
||||
Handle(TDF_Attribute) anAttribute;
|
||||
int anAttributeId = 0;
|
||||
for (TDF_AttributeIterator anAttrIt(aParentLabel); anAttrIt.More();
|
||||
anAttrIt.Next(), anAttributeId++)
|
||||
{
|
||||
if (anAttributeId == aRowId)
|
||||
anAttribute = anAttrIt.Value();
|
||||
}
|
||||
SetAttribute(anAttribute);
|
||||
}
|
||||
else
|
||||
{
|
||||
int aCurrentId = aRowId - aNbAttributes;
|
||||
TDF_ChildIterator aLabelsIt(aParentLabel);
|
||||
TDF_Label aLabel;
|
||||
for (int aLabelId = 0; aLabelsIt.More(); aLabelsIt.Next(), aLabelId++)
|
||||
{
|
||||
if (aLabelId < aCurrentId)
|
||||
continue;
|
||||
aLabel = aLabelsIt.Value();
|
||||
break;
|
||||
}
|
||||
if (!aLabel.IsNull())
|
||||
setLabel(aLabel);
|
||||
}
|
||||
TreeModel_ItemBase::Init();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : reset
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Item::Reset()
|
||||
{
|
||||
SetAttribute(Handle(TDF_Attribute)());
|
||||
|
||||
DFBrowser_ItemBase::Reset();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initRowCount
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
int DFBrowser_Item::initRowCount() const
|
||||
{
|
||||
return HasAttribute() ? 0 : DFBrowser_ItemBase::initRowCount();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initValue
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_Item::initValue(const int theItemRole) const
|
||||
{
|
||||
if (!HasAttribute())
|
||||
return DFBrowser_ItemBase::initValue(theItemRole);
|
||||
|
||||
if (theItemRole == DFBrowserPane_ItemRole_DisplayExtended
|
||||
|| theItemRole == DFBrowserPane_ItemRole_ToolTipExtended)
|
||||
{
|
||||
int aRole =
|
||||
theItemRole == DFBrowserPane_ItemRole_DisplayExtended ? Qt::DisplayRole : Qt::ToolTipRole;
|
||||
QVariant aValue =
|
||||
DFBrowser_Module::GetAttributeInfo(GetAttribute(), GetModule(), aRole, Column());
|
||||
QString anAdditionalInfo = DFBrowser_Module::GetAttributeInfo(GetAttribute(),
|
||||
GetModule(),
|
||||
DFBrowser_ItemRole_AdditionalInfo,
|
||||
Column())
|
||||
.toString();
|
||||
if (!anAdditionalInfo.isEmpty())
|
||||
{
|
||||
if (theItemRole == DFBrowserPane_ItemRole_DisplayExtended)
|
||||
anAdditionalInfo = TreeModel_Tools::CutString(anAdditionalInfo);
|
||||
if (!anAdditionalInfo.isEmpty())
|
||||
aValue = QVariant(aValue.toString() + QString(" [%1]").arg(anAdditionalInfo));
|
||||
// if (aRole == Qt::ToolTipRole)
|
||||
// aValue = wrapTextByWords(aValue.toString().toStdString(), INFO_LENGHT).c_str();
|
||||
}
|
||||
return aValue;
|
||||
}
|
||||
|
||||
return DFBrowser_Module::GetAttributeInfo(GetAttribute(), GetModule(), theItemRole, Column());
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initStream
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Item::initStream(Standard_OStream& theOStream) const
|
||||
{
|
||||
if (!HasAttribute())
|
||||
return;
|
||||
|
||||
if (DFBrowser_Window::IsUseDumpJson())
|
||||
{
|
||||
Handle(TDF_Attribute) anAttribute = GetAttribute();
|
||||
if (!anAttribute.IsNull())
|
||||
{
|
||||
anAttribute->DumpJson(theOStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAttributeInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_Item::GetAttributeInfo(int theRole) const
|
||||
{
|
||||
initItem();
|
||||
return cachedValue(theRole);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initItem
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Item::initItem() const
|
||||
{
|
||||
if (IsInitialized())
|
||||
return;
|
||||
|
||||
const_cast<DFBrowser_Item*>(this)->Init();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetAttribute
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Item::SetAttribute(Handle(TDF_Attribute) theAttribute)
|
||||
{
|
||||
if (!theAttribute.IsNull())
|
||||
{
|
||||
setLabel(theAttribute->Label());
|
||||
myAttributeGUID = theAttribute->ID();
|
||||
}
|
||||
else
|
||||
{
|
||||
setLabel(TDF_Label());
|
||||
myAttributeGUID = Standard_GUID();
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_Item_H
|
||||
#define DFBrowser_Item_H
|
||||
|
||||
#include <inspector/DFBrowser_ItemBase.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QMap>
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowser_Item;
|
||||
typedef QExplicitlySharedDataPointer<DFBrowser_Item> DFBrowser_ItemPtr;
|
||||
|
||||
//! \class DFBrowser_Item
|
||||
//! \brief Declaration of the tree model root item.
|
||||
class DFBrowser_Item : public DFBrowser_ItemBase
|
||||
{
|
||||
public:
|
||||
//! Creates an item wrapped by a shared pointer
|
||||
//! \param theRow the item row position in the parent item
|
||||
//! \param theColumn the item column position in the parent item
|
||||
//! \return the pointer to the created item
|
||||
static DFBrowser_ItemPtr CreateItem(TreeModel_ItemBasePtr theParent,
|
||||
const int theRow,
|
||||
const int theColumn)
|
||||
{
|
||||
return DFBrowser_ItemPtr(new DFBrowser_Item(theParent, theRow, theColumn));
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_Item() {}
|
||||
|
||||
//! \return true if the attribute is set in the item, otherwise it is initialized by a label
|
||||
Standard_EXPORT bool HasAttribute() const;
|
||||
|
||||
//! \return the item attribute
|
||||
Standard_EXPORT Handle(TDF_Attribute) GetAttribute() const;
|
||||
|
||||
//! Finds int parent item attribute or label by this item row and store it in a field of this
|
||||
//! item.
|
||||
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
|
||||
|
||||
//! Resets the cached item values, set null attribute and calls reset of the parent class
|
||||
Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
|
||||
|
||||
//! Inits item and calls cachedValue() for the role
|
||||
//! \param theItemRole a value role
|
||||
//! \return the value
|
||||
Standard_EXPORT QVariant GetAttributeInfo(int theRole) const;
|
||||
|
||||
protected:
|
||||
//! \return number of children.
|
||||
virtual int initRowCount() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns data value for the role:
|
||||
//! - if content is label, calls DFBrowser_ItemBase;
|
||||
//! - if content is attribute, if the fole is extended display, asks additional info text or ask
|
||||
//! module about info \param theItemRole a value role \return the value
|
||||
virtual QVariant initValue(const int theItemRole) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns stream value of the item to fulfill property panel.
|
||||
//! \return stream value or dummy
|
||||
Standard_EXPORT virtual void initStream(Standard_OStream& theOStream) const Standard_OVERRIDE;
|
||||
|
||||
//! Constructor
|
||||
//! \param theParent a parent item
|
||||
//! \param theRow the item row position in the parent item
|
||||
//! \param theColumn the item column position in the parent item
|
||||
DFBrowser_Item(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
|
||||
: DFBrowser_ItemBase(theParent, theRow, theColumn)
|
||||
{
|
||||
}
|
||||
|
||||
//! Initializes the current item. It creates a backup of the specific item information
|
||||
virtual void initItem() const Standard_OVERRIDE;
|
||||
|
||||
//! Sets the item attribute
|
||||
//! \param theAttribute an item attribute
|
||||
void SetAttribute(Handle(TDF_Attribute) theAttribute);
|
||||
|
||||
private:
|
||||
Standard_GUID myAttributeGUID; //!< if attribute, stores GUID of the attribute because label can
|
||||
//!< contain only one attribute of a kind
|
||||
};
|
||||
|
||||
#endif
|
@ -1,69 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_ItemApplication.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_ItemDocument.hxx>
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePane.hxx>
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : createChild
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TreeModel_ItemBasePtr DFBrowser_ItemApplication::createChild(int theRow, int theColumn)
|
||||
{
|
||||
TreeModel_ItemBasePtr anItem =
|
||||
DFBrowser_ItemDocument::CreateItem(currentItem(), theRow, theColumn);
|
||||
DFBrowser_ItemBasePtr aBaseItem = itemDynamicCast<DFBrowser_ItemBase>(anItem);
|
||||
aBaseItem->SetModule(GetModule());
|
||||
|
||||
return anItem;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initRowCount
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
int DFBrowser_ItemApplication::initRowCount() const
|
||||
{
|
||||
if (myApplication.IsNull())
|
||||
return 0;
|
||||
|
||||
return myApplication->NbDocuments();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initValue
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_ItemApplication::initValue(const int theItemRole) const
|
||||
{
|
||||
if (theItemRole == Qt::DisplayRole || theItemRole == Qt::EditRole
|
||||
|| theItemRole == Qt::ToolTipRole || theItemRole == DFBrowserPane_ItemRole_DisplayExtended
|
||||
|| theItemRole == DFBrowserPane_ItemRole_ToolTipExtended)
|
||||
{
|
||||
return "TDocStd_Application";
|
||||
}
|
||||
return QVariant();
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_ItemApplication_H
|
||||
#define DFBrowser_ItemApplication_H
|
||||
|
||||
#include <inspector/DFBrowser_ItemBase.hxx>
|
||||
|
||||
#include <TDocStd_Application.hxx>
|
||||
|
||||
class DFBrowser_ItemApplication;
|
||||
typedef QExplicitlySharedDataPointer<DFBrowser_ItemApplication> DFBrowser_ItemApplicationPtr;
|
||||
|
||||
//! \class DFBrowser_ItemApplication
|
||||
//! \brief Declaration of the tree model root item.
|
||||
//! This item is connected to the main label of the document.
|
||||
class DFBrowser_ItemApplication : public DFBrowser_ItemBase
|
||||
{
|
||||
public:
|
||||
//! Creates an item wrapped by a shared pointer
|
||||
static DFBrowser_ItemApplicationPtr CreateItem(TreeModel_ItemBasePtr theParent)
|
||||
{
|
||||
return DFBrowser_ItemApplicationPtr(new DFBrowser_ItemApplication(theParent));
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_ItemApplication() {}
|
||||
|
||||
//! Sets the item label
|
||||
//! \param theLabel an object where the child items structure is found
|
||||
void SetApplication(const Handle(TDocStd_Application)& theApplication)
|
||||
{
|
||||
myApplication = theApplication;
|
||||
}
|
||||
|
||||
//! Returns the current label
|
||||
//! \return a label
|
||||
const Handle(TDocStd_Application)& GetApplication() const { return myApplication; }
|
||||
|
||||
protected:
|
||||
//! Returns number of documents if the application is not NULL
|
||||
//! \return rows count
|
||||
virtual int initRowCount() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns fixed item text or empty.
|
||||
//! \param theItemRole a value role
|
||||
//! \return the value
|
||||
virtual QVariant initValue(const int theItemRole) const Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
//! Creates a child item in the given position.
|
||||
//! \param theRow the child row position
|
||||
//! \param theColumn the child column position
|
||||
//! \return the created item
|
||||
virtual TreeModel_ItemBasePtr createChild(int theRow, int theColumn) Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
//! Constructor
|
||||
//! \param theParent a parent item
|
||||
DFBrowser_ItemApplication(TreeModel_ItemBasePtr theParent)
|
||||
: DFBrowser_ItemBase(theParent, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
Handle(TDocStd_Application) myApplication; //!<! OCAF application
|
||||
};
|
||||
|
||||
#endif
|
@ -1,162 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_ItemBase.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePane.hxx>
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QColor>
|
||||
#include <QIcon>
|
||||
#include <QVariant>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_ItemBase::DFBrowser_ItemBase(TreeModel_ItemBasePtr theParent,
|
||||
const int theRow,
|
||||
const int theColumn)
|
||||
: TreeModel_ItemBase(theParent, theRow, theColumn),
|
||||
myModule(0),
|
||||
myIsUseAdditionalInfo(true)
|
||||
{
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : reset
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_ItemBase::Reset()
|
||||
{
|
||||
setLabel(TDF_Label());
|
||||
TreeModel_ItemBase::Reset();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetLabel
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TDF_Label DFBrowser_ItemBase::GetLabel() const
|
||||
{
|
||||
initItem();
|
||||
return myLabel;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : data
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_ItemBase::data(const QModelIndex& theIndex, int theRole) const
|
||||
{
|
||||
int aRole = theRole;
|
||||
if (Column() == 0 && useAdditionalInfo())
|
||||
{
|
||||
switch (theRole)
|
||||
{
|
||||
case Qt::DisplayRole: {
|
||||
aRole = DFBrowserPane_ItemRole_DisplayExtended;
|
||||
break;
|
||||
}
|
||||
case Qt::ToolTipRole: {
|
||||
aRole = DFBrowserPane_ItemRole_ToolTipExtended;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TreeModel_ItemBase::data(theIndex, aRole);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initRowCount
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
int DFBrowser_ItemBase::initRowCount() const
|
||||
{
|
||||
TDF_Label aLabel = GetLabel();
|
||||
if (aLabel.IsNull())
|
||||
return 0;
|
||||
|
||||
return aLabel.NbChildren() + aLabel.NbAttributes();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initValue
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_ItemBase::initValue(const int theItemRole) const
|
||||
{
|
||||
switch (theItemRole)
|
||||
{
|
||||
case Qt::DisplayRole:
|
||||
case Qt::EditRole:
|
||||
case Qt::ToolTipRole:
|
||||
return DFBrowser_Tools::GetLabelInfo(myLabel, false);
|
||||
case DFBrowserPane_ItemRole_DisplayExtended:
|
||||
case DFBrowserPane_ItemRole_ToolTipExtended:
|
||||
return DFBrowser_Tools::GetLabelInfo(myLabel, true);
|
||||
case Qt::ForegroundRole: {
|
||||
QVariant aValue = QColor(Qt::black);
|
||||
if (DFBrowser_Tools::IsEmptyLabel(GetLabel()))
|
||||
aValue = QColor(Qt::lightGray);
|
||||
else
|
||||
{ // TEMPORARY HERE : should be moved in the pane of TDataStd_Name kind of attribute
|
||||
Handle(TDataStd_Name) aName;
|
||||
if (useAdditionalInfo() && myLabel.FindAttribute(TDataStd_Name::GetID(), aName))
|
||||
aValue = QColor(Qt::darkGreen);
|
||||
}
|
||||
return aValue;
|
||||
}
|
||||
case Qt::DecorationRole:
|
||||
return DFBrowser_Tools::GetLabelIcon(myLabel);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : createChild
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TreeModel_ItemBasePtr DFBrowser_ItemBase::createChild(int theRow, int theColumn)
|
||||
{
|
||||
TreeModel_ItemBasePtr anItem = DFBrowser_Item::CreateItem(currentItem(), theRow, theColumn);
|
||||
DFBrowser_ItemBasePtr aBaseItem = itemDynamicCast<DFBrowser_ItemBase>(anItem);
|
||||
aBaseItem->SetModule(GetModule());
|
||||
|
||||
return anItem;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetUseAdditionalInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool DFBrowser_ItemBase::SetUseAdditionalInfo(const bool theValue)
|
||||
{
|
||||
bool aPreviousValue = myIsUseAdditionalInfo;
|
||||
myIsUseAdditionalInfo = theValue;
|
||||
return aPreviousValue;
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_ItemBase_H
|
||||
#define DFBrowser_ItemBase_H
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
class DFBrowser_ItemBase;
|
||||
class DFBrowser_Module;
|
||||
typedef QExplicitlySharedDataPointer<DFBrowser_ItemBase> DFBrowser_ItemBasePtr;
|
||||
|
||||
//! \class DFBrowser_ItemBase
|
||||
//! \brief Declaration of the tree model base item.
|
||||
//! This item provide method to process a TDF label.
|
||||
class DFBrowser_ItemBase : public TreeModel_ItemBase
|
||||
{
|
||||
public:
|
||||
//! Sets the module to have an access to attribute information
|
||||
//! \param theModule a current loaded application module
|
||||
void SetModule(DFBrowser_Module* theModule) { myModule = theModule; }
|
||||
|
||||
//! Resets the cached item values
|
||||
Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
|
||||
|
||||
//! \return true if the current label is not null
|
||||
bool HasLabel() const { return !GetLabel().IsNull(); }
|
||||
|
||||
//! \return the current label
|
||||
Standard_EXPORT virtual TDF_Label GetLabel() const;
|
||||
|
||||
//! \return the current module
|
||||
DFBrowser_Module* GetModule() const { return myModule; }
|
||||
|
||||
//! Changes using of additional information in item. If it does not use additional info,
|
||||
//! it will not return extended text in initValue().
|
||||
//! \param theValue a new value
|
||||
//! \return the previous value
|
||||
Standard_EXPORT bool SetUseAdditionalInfo(const bool theValue);
|
||||
|
||||
//! Returns the data stored under the given role for the current item
|
||||
//! \param theIndex the item model index
|
||||
//! \param theRole the item model role
|
||||
Standard_EXPORT virtual QVariant data(const QModelIndex& theIndex,
|
||||
int theRole) const Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
//! Sets the item label
|
||||
//! \param theLabel an object where the child items structure is found
|
||||
void setLabel(TDF_Label theLabel) { myLabel = theLabel; }
|
||||
|
||||
//! Returns if additional information is shown in item for Display and ToolTip values
|
||||
//! \return boolean value
|
||||
bool useAdditionalInfo() const { return myIsUseAdditionalInfo; }
|
||||
|
||||
//! Returns sum of label children and attributes
|
||||
//! \return rows count
|
||||
virtual int initRowCount() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns label information like text, icon or background(if it contains TDataStd_Name
|
||||
//! attribute) \param theItemRole a value role \return the value
|
||||
virtual QVariant initValue(const int theItemRole) const Standard_OVERRIDE;
|
||||
|
||||
//! Creates a child item in the given position.
|
||||
//! \param theRow the child row position
|
||||
//! \param theColumn the child column position
|
||||
//! \return the created item
|
||||
virtual TreeModel_ItemBasePtr createChild(int theRow, int theColumn) Standard_OVERRIDE;
|
||||
|
||||
//! Initializes the current item. It creates a backup of the specific item information
|
||||
virtual void initItem() const Standard_OVERRIDE {}
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
//! \param theParent a parent item
|
||||
//! \param theRow the item row position in the parent item
|
||||
//! \param theColumn the item column position in the parent item
|
||||
DFBrowser_ItemBase(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn);
|
||||
|
||||
private:
|
||||
TDF_Label myLabel; //!< a label of the document, which contains child labels and attributes
|
||||
DFBrowser_Module* myModule; //!< the current module
|
||||
bool myIsUseAdditionalInfo; //!< if true, additional item info is shown in square brackets
|
||||
};
|
||||
|
||||
#endif
|
@ -1,149 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_ItemDocument.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_ItemApplication.hxx>
|
||||
#include <inspector/DFBrowser_ItemDocument.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePane.hxx>
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QIcon>
|
||||
#include <QLabel>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : GetLabel
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TDF_Label DFBrowser_ItemDocument::GetLabel() const
|
||||
{
|
||||
TDF_Label aLabel;
|
||||
if (myDocument.IsNull())
|
||||
getDocument();
|
||||
|
||||
if (!myDocument.IsNull())
|
||||
aLabel = myDocument->Main().Root();
|
||||
|
||||
if (!aLabel.IsNull())
|
||||
aLabel = aLabel.Root();
|
||||
|
||||
return aLabel;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : getDocument
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const Handle(TDocStd_Document)& DFBrowser_ItemDocument::getDocument() const
|
||||
{
|
||||
initItem();
|
||||
return myDocument;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initValue
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_ItemDocument::initValue(const int theItemRole) const
|
||||
{
|
||||
if (theItemRole == Qt::DisplayRole || theItemRole == Qt::EditRole
|
||||
|| theItemRole == DFBrowserPane_ItemRole_DisplayExtended
|
||||
|| theItemRole == DFBrowserPane_ItemRole_ToolTipExtended)
|
||||
return DFBrowser_Tools::GetLabelInfo(GetLabel());
|
||||
if (theItemRole == Qt::DecorationRole)
|
||||
return DFBrowser_Tools::GetLabelIcon(GetLabel());
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : createChild
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TreeModel_ItemBasePtr DFBrowser_ItemDocument::createChild(int theRow, int theColumn)
|
||||
{
|
||||
TreeModel_ItemBasePtr anItem = DFBrowser_Item::CreateItem(currentItem(), theRow, theColumn);
|
||||
DFBrowser_ItemBasePtr aBaseItem = itemDynamicCast<DFBrowser_ItemBase>(anItem);
|
||||
aBaseItem->SetModule(GetModule());
|
||||
|
||||
return anItem;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Init
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_ItemDocument::Init()
|
||||
{
|
||||
DFBrowser_ItemApplicationPtr aParentItem = itemDynamicCast<DFBrowser_ItemApplication>(Parent());
|
||||
if (!aParentItem)
|
||||
return;
|
||||
|
||||
const Handle(TDocStd_Application)& anApplication = aParentItem->GetApplication();
|
||||
// items can exist only by items with not empty label
|
||||
if (anApplication.IsNull())
|
||||
return;
|
||||
|
||||
int aRowId = Row();
|
||||
|
||||
int aDocumentId = -1;
|
||||
for (Standard_Integer aDocId = 1, aNbDoc = anApplication->NbDocuments();
|
||||
aDocId <= aNbDoc && aDocumentId < 0;
|
||||
aDocId++)
|
||||
{
|
||||
if (aDocId - 1 == aRowId)
|
||||
aDocumentId = aDocId;
|
||||
}
|
||||
if (aDocumentId > 0)
|
||||
{
|
||||
Handle(TDocStd_Document) aDocument;
|
||||
anApplication->GetDocument(aDocumentId, aDocument);
|
||||
setDocument(aDocument);
|
||||
}
|
||||
else
|
||||
setDocument(Handle(TDocStd_Document)());
|
||||
|
||||
TreeModel_ItemBase::Init();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : reset
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_ItemDocument::Reset()
|
||||
{
|
||||
Handle(TDocStd_Document) aDocument;
|
||||
setDocument(aDocument);
|
||||
|
||||
DFBrowser_ItemBase::Reset();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : initItem
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_ItemDocument::initItem() const
|
||||
{
|
||||
if (IsInitialized())
|
||||
return;
|
||||
|
||||
const_cast<DFBrowser_ItemDocument*>(this)->Init();
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_ItemDocument_H
|
||||
#define DFBrowser_ItemDocument_H
|
||||
|
||||
#include <inspector/DFBrowser_ItemBase.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
|
||||
class DFBrowser_ItemDocument;
|
||||
typedef QExplicitlySharedDataPointer<DFBrowser_ItemDocument> DFBrowser_ItemDocumentPtr;
|
||||
|
||||
//! \class DFBrowser_ItemDocument
|
||||
//! \brief Declaration of the tree model document item.
|
||||
//! This item is connected to the OCAF document. Parent item is application, children are either
|
||||
//! labels or attributes
|
||||
class DFBrowser_ItemDocument : public DFBrowser_ItemBase
|
||||
{
|
||||
public:
|
||||
//! Creates an item wrapped by a shared pointer
|
||||
//! \param theRow the item row position in the parent item
|
||||
//! \param theColumn the item column position in the parent item
|
||||
//! \return the pointer to the created item
|
||||
static DFBrowser_ItemDocumentPtr CreateItem(TreeModel_ItemBasePtr theParent,
|
||||
const int theRow,
|
||||
const int theColumn)
|
||||
{
|
||||
return DFBrowser_ItemDocumentPtr(new DFBrowser_ItemDocument(theParent, theRow, theColumn));
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_ItemDocument() {}
|
||||
|
||||
//! Returns the current label
|
||||
//! \return a label
|
||||
Standard_EXPORT virtual TDF_Label GetLabel() const Standard_OVERRIDE;
|
||||
|
||||
//! Sets the item document
|
||||
//! \param theLabel an object where the child items structure is found
|
||||
void setDocument(const Handle(TDocStd_Document)& theDocument) { myDocument = theDocument; }
|
||||
|
||||
//! Returns true if the current document is not null
|
||||
//! \return a boolean value
|
||||
bool hasDocument() const { return !getDocument().IsNull(); }
|
||||
|
||||
//! Returns the current document
|
||||
//! \return a label
|
||||
Standard_EXPORT const Handle(TDocStd_Document)& getDocument() const;
|
||||
|
||||
//! Inits the item, fills internal containers
|
||||
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
|
||||
|
||||
//! Resets the cached item values
|
||||
Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
//! Initializes the current item. It is empty because Reset() is also empty.
|
||||
virtual void initItem() const Standard_OVERRIDE;
|
||||
|
||||
//! Initializes the current item. It creates a backup of the specific item information
|
||||
virtual QVariant initValue(const int theItemRole) const Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
//! Creates a child item in the given position.
|
||||
//! \param theRow the child row position
|
||||
//! \param theColumn the child column position
|
||||
//! \return the created item
|
||||
virtual TreeModel_ItemBasePtr createChild(int theRow, int theColumn) Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
//! Constructor
|
||||
//! \param theParent a parent item
|
||||
DFBrowser_ItemDocument(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
|
||||
: DFBrowser_ItemBase(theParent, theRow, theColumn)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
Handle(TDocStd_Document) myDocument; //!< cached application document by the row index of the item
|
||||
};
|
||||
|
||||
#endif
|
@ -1,32 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_ItemRole_H
|
||||
#define DFBrowser_ItemRole_H
|
||||
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <Qt>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
//! Additional data item role for DFBrowser tree item
|
||||
enum DFBrowser_ItemRole
|
||||
{
|
||||
DFBrowser_ItemRole_AdditionalInfo =
|
||||
DFBrowserPane_ItemRole_LastTreeRole + 1 //!< an attribute additional information
|
||||
};
|
||||
|
||||
#endif
|
@ -1,254 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_Module.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_ItemApplication.hxx>
|
||||
#include <inspector/DFBrowser_ItemBase.hxx>
|
||||
#include <inspector/DFBrowser_ItemRole.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
#include <inspector/DFBrowser_TreeModel.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePane.hxx>
|
||||
#include <inspector/DFBrowserPane_AttributePaneCreator.hxx>
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <XCAFApp_Application.hxx>
|
||||
#include <XCAFDoc.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QMessageBox>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_Module::DFBrowser_Module()
|
||||
: myOCAFViewModel(0)
|
||||
{
|
||||
RegisterPaneCreator(new DFBrowserPane_AttributePaneCreator());
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : CreateViewModel
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Module::CreateViewModel(void* theParent)
|
||||
{
|
||||
myOCAFViewModel = new DFBrowser_TreeModel((QWidget*)theParent);
|
||||
myOCAFViewModel->InitColumns();
|
||||
myOCAFViewModel->SetModule(this);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetApplication
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Module::SetApplication(const Handle(TDocStd_Application)& theApplication)
|
||||
{
|
||||
myOCAFViewModel->Init(theApplication);
|
||||
|
||||
myPaneCreators.clear();
|
||||
RegisterPaneCreator(new DFBrowserPane_AttributePaneCreator());
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetExternalContext
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Module::SetExternalContext(const Handle(Standard_Transient)& theContext)
|
||||
{
|
||||
myExternalContext = Handle(AIS_InteractiveContext)::DownCast(theContext);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetTDocStdApplication
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(TDocStd_Application) DFBrowser_Module::GetTDocStdApplication() const
|
||||
{
|
||||
return myOCAFViewModel->GetTDocStdApplication();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : UpdateTreeModel
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Module::UpdateTreeModel()
|
||||
{
|
||||
QAbstractItemModel* aModel = GetOCAFViewModel();
|
||||
QItemSelectionModel* aSelectionModel = GetOCAFViewSelectionModel();
|
||||
if (!aModel || !aSelectionModel)
|
||||
return;
|
||||
aSelectionModel->clearSelection();
|
||||
|
||||
emit beforeUpdateTreeModel();
|
||||
myOCAFViewModel->Reset();
|
||||
myOCAFViewModel->EmitLayoutChanged();
|
||||
|
||||
SetInitialTreeViewSelection();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetInitialTreeViewSelection
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_Module::SetInitialTreeViewSelection()
|
||||
{
|
||||
QAbstractItemModel* aModel = GetOCAFViewModel();
|
||||
QItemSelectionModel* aSelectionModel = GetOCAFViewSelectionModel();
|
||||
if (!aModel || !aSelectionModel)
|
||||
return;
|
||||
|
||||
// select a parent(application) item
|
||||
aSelectionModel->select(aModel->index(0, 0), QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : FindAttribute
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(TDF_Attribute) DFBrowser_Module::FindAttribute(const QModelIndex& theIndex)
|
||||
{
|
||||
TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex(theIndex);
|
||||
if (!anItemBase)
|
||||
return Handle(TDF_Attribute)();
|
||||
|
||||
DFBrowser_ItemPtr anItem = itemDynamicCast<DFBrowser_Item>(anItemBase);
|
||||
return (anItem && anItem->HasAttribute()) ? anItem->GetAttribute() : Handle(TDF_Attribute)();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAttributePane
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowserPane_AttributePaneAPI* DFBrowser_Module::GetAttributePane(
|
||||
Handle(TDF_Attribute) theAttribute)
|
||||
{
|
||||
DFBrowserPane_AttributePaneAPI* aPane = 0;
|
||||
if (theAttribute.IsNull())
|
||||
return aPane;
|
||||
return GetAttributePane(theAttribute->DynamicType()->Name());
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAttributePane
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowserPane_AttributePaneAPI* DFBrowser_Module::GetAttributePane(
|
||||
Standard_CString theAttributeName)
|
||||
{
|
||||
DFBrowserPane_AttributePaneAPI* aPane = 0;
|
||||
|
||||
if (!myAttributeTypes.contains(theAttributeName))
|
||||
{
|
||||
aPane = CreateAttributePane(theAttributeName);
|
||||
if (aPane)
|
||||
myAttributeTypes[theAttributeName] = aPane;
|
||||
}
|
||||
else
|
||||
aPane = myAttributeTypes[theAttributeName];
|
||||
|
||||
return aPane;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAttributeInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_Module::GetAttributeInfo(Handle(TDF_Attribute) theAttribute,
|
||||
DFBrowser_Module* theModule,
|
||||
int theRole,
|
||||
int theColumnId)
|
||||
{
|
||||
DFBrowserPane_AttributePane* anAttributePane = 0;
|
||||
if (!theAttribute.IsNull())
|
||||
{
|
||||
DFBrowserPane_AttributePaneAPI* anAPIPane = theModule->GetAttributePane(theAttribute);
|
||||
if (anAPIPane)
|
||||
anAttributePane = dynamic_cast<DFBrowserPane_AttributePane*>(anAPIPane);
|
||||
}
|
||||
|
||||
TCollection_AsciiString anInfo;
|
||||
if (theRole == DFBrowser_ItemRole_AdditionalInfo)
|
||||
{
|
||||
anInfo = XCAFDoc::AttributeInfo(theAttribute);
|
||||
}
|
||||
QVariant aValue;
|
||||
if (!anInfo.IsEmpty())
|
||||
{
|
||||
aValue = anInfo.ToCString();
|
||||
}
|
||||
else if (anAttributePane)
|
||||
aValue = anAttributePane->GetAttributeInfo(
|
||||
theAttribute,
|
||||
theRole == DFBrowser_ItemRole_AdditionalInfo ? DFBrowserPane_ItemRole_ShortInfo : theRole,
|
||||
theColumnId);
|
||||
else
|
||||
aValue =
|
||||
DFBrowserPane_AttributePane::GetAttributeInfoByType(theAttribute->DynamicType()->Name(),
|
||||
theRole,
|
||||
theColumnId);
|
||||
return aValue;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAttributeInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_Module::GetAttributeInfo(Standard_CString theAttributeName,
|
||||
DFBrowser_Module* theModule,
|
||||
int theRole,
|
||||
int theColumnId)
|
||||
{
|
||||
DFBrowserPane_AttributePane* anAttributePane = 0;
|
||||
DFBrowserPane_AttributePaneAPI* anAPIPane = theModule->GetAttributePane(theAttributeName);
|
||||
if (anAPIPane)
|
||||
anAttributePane = dynamic_cast<DFBrowserPane_AttributePane*>(anAPIPane);
|
||||
|
||||
QVariant aValue;
|
||||
if (anAttributePane)
|
||||
{
|
||||
Handle(TDF_Attribute) anAttribute;
|
||||
aValue = anAttributePane->GetAttributeInfo(
|
||||
anAttribute,
|
||||
theRole == DFBrowser_ItemRole_AdditionalInfo ? DFBrowserPane_ItemRole_ShortInfo : theRole,
|
||||
theColumnId);
|
||||
}
|
||||
else
|
||||
aValue =
|
||||
DFBrowserPane_AttributePane::GetAttributeInfoByType(theAttributeName, theRole, theColumnId);
|
||||
return aValue;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : CreateAttributePane
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowserPane_AttributePaneAPI* DFBrowser_Module::CreateAttributePane(
|
||||
Standard_CString theAttributeName)
|
||||
{
|
||||
DFBrowserPane_AttributePaneAPI* aPane = 0;
|
||||
// iteration should be performed from the tail of the list, as latest added creator has
|
||||
// larger priority
|
||||
for (int aPaneCreatorId = myPaneCreators.size() - 1; aPaneCreatorId >= 0 && !aPane;
|
||||
aPaneCreatorId--)
|
||||
aPane = myPaneCreators[aPaneCreatorId]->CreateAttributePane(theAttributeName);
|
||||
return aPane;
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_Module_H
|
||||
#define DFBrowser_Module_H
|
||||
|
||||
#include <inspector/DFBrowser_TreeModel.hxx>
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDocStd_Application.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowserPane_AttributePaneAPI;
|
||||
class DFBrowserPane_AttributePaneCreatorAPI;
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QItemSelectionModel;
|
||||
|
||||
//! \class DFBrowser_Module
|
||||
//! The class is a container of current components of DFBrowser:
|
||||
//! - OCAF view model
|
||||
//! - OCAF selection model
|
||||
//! - container of attribute panes into attribute name
|
||||
//! - acceptable attribute pane creators
|
||||
//! - external AIS interactive context
|
||||
//! It has general attribute pane creator, if the application is XDE, it uses XDE attribute pane
|
||||
//! creator. It fills container of created attribute pane.
|
||||
class DFBrowser_Module : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_Module();
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_Module() {}
|
||||
|
||||
//! Creates tree model for OCAF application
|
||||
Standard_EXPORT void CreateViewModel(void* theParent);
|
||||
|
||||
//! Fills tree model by the application and register pane creator
|
||||
//! \param theApplication a current application
|
||||
Standard_EXPORT void SetApplication(const Handle(TDocStd_Application)& theApplication);
|
||||
|
||||
//! Fills viewer by the context
|
||||
//! \param theContext a current context where presentations should be visualized
|
||||
Standard_EXPORT void SetExternalContext(const Handle(Standard_Transient)& theContext);
|
||||
|
||||
//! Returns external context or NULL
|
||||
const Handle(AIS_InteractiveContext)& GetExternalContext() const { return myExternalContext; }
|
||||
|
||||
//! Returns a view model with the OCAF structure content
|
||||
QAbstractItemModel* GetOCAFViewModel() { return myOCAFViewModel; }
|
||||
|
||||
//! Sets selection model of tree view
|
||||
void SetOCAFViewSelectionModel(QItemSelectionModel* theSelectionModel)
|
||||
{
|
||||
myOCAFViewSelectionModel = theSelectionModel;
|
||||
}
|
||||
|
||||
//! Returns selection model of tree view
|
||||
QItemSelectionModel* GetOCAFViewSelectionModel() const { return myOCAFViewSelectionModel; }
|
||||
|
||||
//! Returns an OCAF application or NULL
|
||||
//! \return an application instance
|
||||
Standard_EXPORT Handle(TDocStd_Application) GetTDocStdApplication() const;
|
||||
|
||||
//! Rebuilds an OCAF tree view model
|
||||
Standard_EXPORT void UpdateTreeModel();
|
||||
|
||||
//! Sets initial selection in OCAF tree view, it is an application(root) item
|
||||
Standard_EXPORT void SetInitialTreeViewSelection();
|
||||
|
||||
//! Returns attribute placed on the parameter index in the OCAF tree view or NULL
|
||||
//! \param theIndex an index in OCAF tree view.
|
||||
//! \return an attribute
|
||||
Standard_EXPORT Handle(TDF_Attribute) FindAttribute(const QModelIndex& theIndex);
|
||||
|
||||
//! Appends creator of a pane by attribute type
|
||||
//! \param thePaneCreator
|
||||
void RegisterPaneCreator(DFBrowserPane_AttributePaneCreatorAPI* thePaneCreator)
|
||||
{
|
||||
myPaneCreators.append(thePaneCreator);
|
||||
}
|
||||
|
||||
//! Returns an attribute pane for the attribute: create a new if it is not exist in
|
||||
//! internal map and the module processes this kind of attribute
|
||||
//! \param theAttributeGUID an attribute key
|
||||
//! \return attribute pane
|
||||
Standard_EXPORT DFBrowserPane_AttributePaneAPI* GetAttributePane(
|
||||
Handle(TDF_Attribute) theAttribute);
|
||||
|
||||
//! Returns an attribute pane for the attribute GUID: create a new if it is not exist in
|
||||
//! internal map and the module processes this kind of attribute
|
||||
//! \param theAttributeGUID an attribute key
|
||||
//! \return attribute pane
|
||||
Standard_EXPORT DFBrowserPane_AttributePaneAPI* GetAttributePane(
|
||||
Standard_CString theAttributeName);
|
||||
|
||||
//! Finds the attribute pane according to the give attribute and returns its information
|
||||
//! \param theAttribute a source attribute
|
||||
//! \param theModule to provide a map of attribute id to attribute pane
|
||||
//! \param theRole an attribute role in the tree view, includes: text, icon, color roles
|
||||
//! \param theColumnId a column index
|
||||
Standard_EXPORT static QVariant GetAttributeInfo(Handle(TDF_Attribute) theAttribute,
|
||||
DFBrowser_Module* theModule,
|
||||
int theRole,
|
||||
int theColumnId);
|
||||
|
||||
//! Returns information for the given attribute type name
|
||||
//! \param theAttributeName a current attribute type name
|
||||
//! \param theModule a current module
|
||||
//! \param theRole a role of information, used by tree model (e.g. DisplayRole, icon, background
|
||||
//! and so on) \param theColumnId a tree model column \return value, interpreted by tree model
|
||||
//! depending on the role
|
||||
Standard_EXPORT static QVariant GetAttributeInfo(Standard_CString theAttributeName,
|
||||
DFBrowser_Module* theModule,
|
||||
int theRole,
|
||||
int theColumnId);
|
||||
signals:
|
||||
|
||||
//! Emits signal about updating tree model
|
||||
void beforeUpdateTreeModel();
|
||||
|
||||
protected:
|
||||
//! Tries to create attribute pane for the attribute name using registered attribute pane creators
|
||||
//! \param theAttributeName a source attribute
|
||||
//! \return attribute pane or NULL
|
||||
DFBrowserPane_AttributePaneAPI* CreateAttributePane(Standard_CString theAttributeName);
|
||||
|
||||
private:
|
||||
DFBrowser_TreeModel* myOCAFViewModel; //!< the tree view abstract model
|
||||
QItemSelectionModel* myOCAFViewSelectionModel; //!< selection model over OCAF tree view
|
||||
QMap<TCollection_AsciiString, DFBrowserPane_AttributePaneAPI*>
|
||||
myAttributeTypes; //!< container of created panes
|
||||
QList<DFBrowserPane_AttributePaneCreatorAPI*> myPaneCreators; //!< pane creators
|
||||
Handle(AIS_InteractiveContext) myExternalContext; //!< context that comes in initialize parameters
|
||||
};
|
||||
|
||||
#endif
|
@ -1,104 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_OpenApplication.hxx>
|
||||
|
||||
#include <BinDrivers.hxx>
|
||||
#include <BinLDrivers.hxx>
|
||||
#include <BinXCAFDrivers.hxx>
|
||||
#include <PCDM_ReadWriter.hxx>
|
||||
#include <StdDrivers.hxx>
|
||||
#include <StdLDrivers.hxx>
|
||||
#include <STEPCAFControl_Reader.hxx>
|
||||
#include <STEPCAFControl_Controller.hxx>
|
||||
#include <TPrsStd_DriverTable.hxx>
|
||||
#include <XCAFApp_Application.hxx>
|
||||
#include <XCAFPrs_Driver.hxx>
|
||||
#include <XmlDrivers.hxx>
|
||||
#include <XmlLDrivers.hxx>
|
||||
#include <XmlXCAFDrivers.hxx>
|
||||
#include <UTL.hxx>
|
||||
|
||||
namespace DFBrowser_OpenApplication
|
||||
{
|
||||
|
||||
// =======================================================================
|
||||
// function : OpenApplication
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(TDocStd_Application) OpenApplication(const TCollection_AsciiString& theFileName,
|
||||
bool& isSTEPFile)
|
||||
{
|
||||
Handle(TDocStd_Application) anApplication = CreateApplicationBySTEPFile(theFileName);
|
||||
if (!anApplication.IsNull())
|
||||
{
|
||||
isSTEPFile = true;
|
||||
return anApplication;
|
||||
}
|
||||
|
||||
// Load static variables for STEPCAF (ssv; 16.08.2012)
|
||||
STEPCAFControl_Controller::Init();
|
||||
|
||||
anApplication = new TDocStd_Application();
|
||||
// Initialize standard document formats at creation - they should
|
||||
// be available even if this DRAW plugin is not loaded by pload command
|
||||
StdLDrivers::DefineFormat(anApplication);
|
||||
BinLDrivers::DefineFormat(anApplication);
|
||||
XmlLDrivers::DefineFormat(anApplication);
|
||||
StdDrivers::DefineFormat(anApplication);
|
||||
BinDrivers::DefineFormat(anApplication);
|
||||
XmlDrivers::DefineFormat(anApplication);
|
||||
|
||||
// Initialize XCAF formats
|
||||
BinXCAFDrivers::DefineFormat(anApplication);
|
||||
XmlXCAFDrivers::DefineFormat(anApplication);
|
||||
|
||||
// Register driver in global table for displaying XDE documents
|
||||
// in 3d viewer using OCAF mechanics
|
||||
TPrsStd_DriverTable::Get()->AddDriver(XCAFPrs_Driver::GetID(), new XCAFPrs_Driver);
|
||||
|
||||
Handle(TDocStd_Document) aDocument;
|
||||
PCDM_ReaderStatus aStatus = anApplication->Open(theFileName, aDocument);
|
||||
if (aStatus != PCDM_RS_OK)
|
||||
return Handle(TDocStd_Application)();
|
||||
return anApplication;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : CreateApplicationBySTEPFile
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(TDocStd_Application) CreateApplicationBySTEPFile(const TCollection_AsciiString& theFileName)
|
||||
{
|
||||
if (!theFileName.EndsWith(".step") && !theFileName.EndsWith(".stp"))
|
||||
return Handle(TDocStd_Application)();
|
||||
|
||||
Handle(TDocStd_Application) aTmpApplication = XCAFApp_Application::GetApplication();
|
||||
STEPCAFControl_Reader aStepReader;
|
||||
|
||||
const TCollection_AsciiString aStr(theFileName);
|
||||
IFSelect_ReturnStatus aStatus = aStepReader.ReadFile(aStr.ToCString());
|
||||
if (aStatus != IFSelect_RetDone)
|
||||
return Handle(TDocStd_Application)();
|
||||
|
||||
aStepReader.SetColorMode(Standard_True);
|
||||
aStepReader.SetLayerMode(Standard_True);
|
||||
aStepReader.SetNameMode(Standard_True);
|
||||
|
||||
Handle(TDocStd_Document) aDocument;
|
||||
aTmpApplication->NewDocument("BinOcaf", aDocument);
|
||||
return aStepReader.Transfer(aDocument) ? aTmpApplication : Handle(TDocStd_Application)();
|
||||
}
|
||||
} // namespace DFBrowser_OpenApplication
|
@ -1,42 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_OpenApplication_H
|
||||
#define DFBrowser_OpenApplication_H
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TDocStd_Application.hxx>
|
||||
|
||||
//! \namespace DFBrowser_OpenApplication
|
||||
namespace DFBrowser_OpenApplication
|
||||
{
|
||||
|
||||
//! Opens the application by the name.
|
||||
//! \param theFileName a name of the file initialized the application
|
||||
//! \param isSTEPFile an output parameter, true if the file name is a STEP file
|
||||
//! \return an opened application
|
||||
Standard_EXPORT Handle(TDocStd_Application) OpenApplication(
|
||||
const TCollection_AsciiString& theFileName,
|
||||
bool& isSTEPFile);
|
||||
|
||||
//! Creates a new application if the name contains "stp" or "step" extension. The application is
|
||||
//! "BinOcaf", STEP reader transfers the file into the application \param theFileName a name of the
|
||||
//! file initialized the application \return a new application
|
||||
Standard_EXPORT Handle(TDocStd_Application) CreateApplicationBySTEPFile(
|
||||
const TCollection_AsciiString& theFileName);
|
||||
} // namespace DFBrowser_OpenApplication
|
||||
|
||||
#endif
|
@ -1,65 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_PropertyPanel.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_AttributePaneStack.hxx>
|
||||
#include <inspector/DFBrowser_Item.hxx>
|
||||
#include <inspector/DFBrowser_SearchView.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
#include <inspector/DFBrowser_TreeLevelView.hxx>
|
||||
|
||||
#include <inspector/TreeModel_ModelBase.hxx>
|
||||
|
||||
#include <inspector/ViewControl_Tools.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QGridLayout>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QWidget>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_PropertyPanel::DFBrowser_PropertyPanel(QWidget* theParent)
|
||||
: QObject(theParent),
|
||||
myAttributesStack(0)
|
||||
{
|
||||
myMainWindow = new QWidget(theParent);
|
||||
ViewControl_Tools::SetWhiteBackground(myMainWindow);
|
||||
|
||||
QGridLayout* aLayout = new QGridLayout(myMainWindow);
|
||||
aLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
myAttributesStack = new DFBrowser_AttributePaneStack(this);
|
||||
myAttributesStack->CreateWidget(myMainWindow);
|
||||
aLayout->addWidget(myAttributesStack->GetWidget(), 0, 0);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : UpdateBySelectionChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_PropertyPanel::UpdateBySelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection&)
|
||||
{
|
||||
GetAttributesStack()->GetSearchView()->Reset();
|
||||
|
||||
QModelIndex anIndex = TreeModel_ModelBase::SingleSelected(theSelected.indexes(), 0);
|
||||
myAttributesStack->SetCurrentItem(anIndex);
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_PropertyPanel_H
|
||||
#define DFBrowser_PropertyPanel_H
|
||||
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QItemSelection>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowser_AttributePaneStack;
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QWidget;
|
||||
|
||||
//! \class DFBrowser_PropertyPanel
|
||||
//! Control that contains attribute pane stack
|
||||
class DFBrowser_PropertyPanel : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_PropertyPanel(QWidget* theParent);
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_PropertyPanel() {}
|
||||
|
||||
//! Returns main control
|
||||
QWidget* GetControl() const { return myMainWindow; }
|
||||
|
||||
//! Returns instance of attributes stack
|
||||
//! \return stack
|
||||
DFBrowser_AttributePaneStack* GetAttributesStack() { return myAttributesStack; }
|
||||
|
||||
//! Fills attributes stack by selected index
|
||||
//! \param theSelected selected items
|
||||
//! \param theDeselected deselected items
|
||||
Standard_EXPORT void UpdateBySelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection& theDeselected);
|
||||
|
||||
private:
|
||||
QWidget* myMainWindow; //!< parent of attribute stack control
|
||||
DFBrowser_AttributePaneStack* myAttributesStack; //!< panes stack
|
||||
};
|
||||
#endif
|
@ -1,62 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_SearchItemInfo_H
|
||||
#define DFBrowser_SearchItemInfo_H
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QVariant>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
//! \class DFBrowser_SearchItemInfo
|
||||
//! Information of item in search model
|
||||
class DFBrowser_SearchItemInfo
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
DFBrowser_SearchItemInfo() {}
|
||||
|
||||
//! Constructor
|
||||
DFBrowser_SearchItemInfo(const QVariant& theIcon,
|
||||
const QString& theName,
|
||||
const QStringList& thePath,
|
||||
const QString& theSeparator)
|
||||
: myIcon(theIcon),
|
||||
myPath(thePath)
|
||||
{
|
||||
myPathUnited = QString("%1 \n%2").arg(theName).arg(myPath.join(theSeparator));
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_SearchItemInfo() {}
|
||||
|
||||
//! Returns the item icon
|
||||
const QVariant& Icon() const { return myIcon; }
|
||||
|
||||
//! Returns path to the item.
|
||||
const QStringList& Path() const { return myPath; }
|
||||
|
||||
//! Returns united path to the item.
|
||||
const QString& PathUnited() const { return myPathUnited; }
|
||||
|
||||
private:
|
||||
QVariant myIcon; //!< item icon
|
||||
QStringList myPath; //!< item path
|
||||
QString myPathUnited; //!< item name and item path
|
||||
};
|
||||
|
||||
#endif
|
@ -1,191 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_SearchLine.hxx>
|
||||
#include <inspector/DFBrowser_SearchLineModel.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
|
||||
#include <inspector/ViewControl_Tools.hxx>
|
||||
|
||||
#include <TDocStd_Application.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <TDF_AttributeIterator.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QToolButton>
|
||||
#include <QCompleter>
|
||||
#include <QIcon>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QStyle>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
//! class DFBrowser_LineEdit
|
||||
//! Extension of Qt line edit to visualize help text until the line edit control has not been filled
|
||||
//! yet
|
||||
class DFBrowser_LineEdit : public QLineEdit
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
DFBrowser_LineEdit(QWidget* theParent)
|
||||
: QLineEdit(theParent)
|
||||
{
|
||||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_LineEdit() {}
|
||||
|
||||
//! Sets text that is shown in line edit it the text of this control is empty
|
||||
//! \param theText a string value
|
||||
void setPlaneHolder(const QString& theText) { myPlaceHolder = theText; }
|
||||
|
||||
//! Draws the line edit context, put plane holder if text is empty
|
||||
//! \param theEvent a paint event
|
||||
virtual void paintEvent(QPaintEvent* theEvent) Standard_OVERRIDE
|
||||
{
|
||||
QLineEdit::paintEvent(theEvent);
|
||||
if (!text().isEmpty())
|
||||
return;
|
||||
|
||||
QPainter aPainter(this);
|
||||
QFontMetrics aFontMetrics = fontMetrics();
|
||||
QRect aLineRect = rect();
|
||||
Qt::Alignment anAlignment = QStyle::visualAlignment(layoutDirection(), Qt::AlignLeft);
|
||||
|
||||
QColor aColor = Qt::gray;
|
||||
QPen anOldpen = aPainter.pen();
|
||||
aPainter.setPen(aColor);
|
||||
aLineRect.adjust(4, 4, 0, 0);
|
||||
QString anElidedText =
|
||||
aFontMetrics.elidedText(myPlaceHolder, Qt::ElideRight, aLineRect.width());
|
||||
aPainter.drawText(aLineRect, anAlignment, anElidedText);
|
||||
aPainter.setPen(anOldpen);
|
||||
}
|
||||
|
||||
private:
|
||||
QString myPlaceHolder; //!< text of filling line edit content if the text is empty
|
||||
};
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_SearchLine::DFBrowser_SearchLine(QWidget* theParent)
|
||||
: QFrame(theParent)
|
||||
{
|
||||
QHBoxLayout* aLayout = new QHBoxLayout(this);
|
||||
aLayout->setContentsMargins(0, 0, 0, 0);
|
||||
aLayout->setSpacing(0);
|
||||
|
||||
myLineControl = new DFBrowser_LineEdit(this);
|
||||
((DFBrowser_LineEdit*)myLineControl)->setPlaneHolder(QString(tr("Scanning application ...")));
|
||||
mySearchButton = new QToolButton(this);
|
||||
mySearchButton->setIcon(QIcon(":/icons/search.png"));
|
||||
|
||||
QCompleter* aCompleter = new QCompleter(this);
|
||||
aCompleter->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
myLineControl->setCompleter(aCompleter);
|
||||
|
||||
aLayout->addWidget(myLineControl);
|
||||
aLayout->addWidget(mySearchButton);
|
||||
|
||||
connect(myLineControl,
|
||||
SIGNAL(textChanged(const QString&)),
|
||||
this,
|
||||
SLOT(onTextChanged(const QString&)));
|
||||
connect(myLineControl, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
|
||||
connect(mySearchButton, SIGNAL(clicked()), this, SLOT(onSearchButtonClicked()));
|
||||
|
||||
ViewControl_Tools::SetWhiteBackground(this);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetModule
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLine::SetModule(DFBrowser_Module* theModule)
|
||||
{
|
||||
DFBrowser_SearchLineModel* aModel = new DFBrowser_SearchLineModel(myLineControl, theModule);
|
||||
myLineControl->completer()->setModel(aModel);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetModule
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_Module* DFBrowser_SearchLine::GetModule()
|
||||
{
|
||||
DFBrowser_SearchLineModel* aModel = dynamic_cast<DFBrowser_SearchLineModel*>(GetModel());
|
||||
return aModel->GetModule();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetValues
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLine::SetValues(
|
||||
const QMap<int, QMap<QString, DFBrowser_SearchItemInfo>>& theDocumentValues,
|
||||
const QMap<int, QStringList>& theDocumentInfoValues)
|
||||
{
|
||||
DFBrowser_SearchLineModel* aModel = dynamic_cast<DFBrowser_SearchLineModel*>(GetModel());
|
||||
aModel->SetValues(theDocumentValues, theDocumentInfoValues);
|
||||
|
||||
QString aFirstValue =
|
||||
!theDocumentInfoValues.empty() ? theDocumentInfoValues.begin().value().first() : "";
|
||||
DFBrowser_LineEdit* aLineEdit = dynamic_cast<DFBrowser_LineEdit*>(myLineControl);
|
||||
aLineEdit->setPlaneHolder(QString(tr("Search : %1")).arg(aFirstValue));
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : ClearValues
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLine::ClearValues()
|
||||
{
|
||||
DFBrowser_SearchLineModel* aModel = dynamic_cast<DFBrowser_SearchLineModel*>(GetModel());
|
||||
aModel->ClearValues();
|
||||
|
||||
DFBrowser_LineEdit* aLineEdit = dynamic_cast<DFBrowser_LineEdit*>(myLineControl);
|
||||
aLineEdit->setPlaneHolder(QString(tr("Scanning application ...")));
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onTextChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLine::onTextChanged(const QString& theText)
|
||||
{
|
||||
mySearchButton->setIcon(theText.isEmpty() ? QIcon(":/icons/search.png")
|
||||
: QIcon(":/icons/search_cancel.png"));
|
||||
emit searchActivated();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onSearchButtonClicked
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLine::onSearchButtonClicked()
|
||||
{
|
||||
if (!Text().isEmpty())
|
||||
SetText(QString());
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_SearchLine_H
|
||||
#define DFBrowser_SearchLine_H
|
||||
|
||||
#include <inspector/DFBrowser_SearchLineModel.hxx> // to include DFBrowser_SearchItemInfo
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <TDocStd_Application.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QCompleter>
|
||||
#include <QFrame>
|
||||
#include <QLineEdit>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowser_Module;
|
||||
class DFBrowser_SearchLineModel;
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QLineEdit;
|
||||
class QToolButton;
|
||||
class QStringList;
|
||||
|
||||
//! \class DFBrowser_SearchLine
|
||||
//! It contains a line edit control with auto completion and search button
|
||||
class DFBrowser_SearchLine : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_SearchLine(QWidget* theParent);
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_SearchLine() {}
|
||||
|
||||
//! Creates search line model filled by the module. It is necessary for auto completion of line
|
||||
//! edit \param theModule a current module
|
||||
Standard_EXPORT void SetModule(DFBrowser_Module* theModule);
|
||||
|
||||
//! Returns the current module
|
||||
Standard_EXPORT DFBrowser_Module* GetModule();
|
||||
|
||||
//! Fills the search line model by OCAF document values
|
||||
//! \param theDocumentValues container of document index to container of entry/attribute name to
|
||||
//! item information \param theDocumentInfoValues container of a document index to entry/attribute
|
||||
//! name
|
||||
Standard_EXPORT void SetValues(
|
||||
const QMap<int, QMap<QString, DFBrowser_SearchItemInfo>>& theDocumentValues,
|
||||
const QMap<int, QStringList>& theDocumentInfoValues);
|
||||
|
||||
//! Clears cache of values in search line model
|
||||
Standard_EXPORT void ClearValues();
|
||||
|
||||
//! Returns completer model
|
||||
QAbstractItemModel* GetModel() { return myLineControl->completer()->model(); }
|
||||
|
||||
//! Returns completion completer model
|
||||
QAbstractItemModel* GetCompletionModel() { return myLineControl->completer()->completionModel(); }
|
||||
|
||||
//! Returns the current line edit text
|
||||
QString Text() const { return myLineControl->text(); }
|
||||
|
||||
//! Sets the current text value
|
||||
//! \param theValue a string value
|
||||
void SetText(const QString& theValue) { myLineControl->setText(theValue); }
|
||||
|
||||
signals:
|
||||
|
||||
//! Signals that is emitted by text changed in line edit control
|
||||
void searchActivated();
|
||||
|
||||
private slots:
|
||||
|
||||
//! Updates icon of search button depending on text is empty and emits searchActivated signal
|
||||
void onTextChanged(const QString& theText);
|
||||
|
||||
//! Sets completion prefix in completer model
|
||||
void onReturnPressed() { myLineControl->completer()->setCompletionPrefix(myLineControl->text()); }
|
||||
|
||||
//! Sets empty text if the current text is not empty: new search is started
|
||||
void onSearchButtonClicked();
|
||||
|
||||
private:
|
||||
QLineEdit* myLineControl; //!< line editor control
|
||||
QToolButton* mySearchButton; //!< search button
|
||||
};
|
||||
|
||||
#endif
|
@ -1,213 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_SearchLineModel.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_Module.hxx>
|
||||
#include <inspector/DFBrowser_Tools.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePane.hxx>
|
||||
#include <inspector/DFBrowserPane_ItemRole.hxx>
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QDir>
|
||||
#include <QIcon>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_SearchLineModel::DFBrowser_SearchLineModel(QObject* theParent,
|
||||
DFBrowser_Module* theModule)
|
||||
: QAbstractTableModel(theParent),
|
||||
myModule(theModule),
|
||||
myRowCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetValues
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLineModel::SetValues(
|
||||
const QMap<int, QMap<QString, DFBrowser_SearchItemInfo>>& theDocumentValues,
|
||||
const QMap<int, QStringList>& theDocumentInfoValues)
|
||||
{
|
||||
myAdditionalValues = theDocumentValues;
|
||||
myDocumentInfoValues = theDocumentInfoValues;
|
||||
|
||||
myRowCount = 0;
|
||||
for (QMap<int, QStringList>::const_iterator aValuesIt = myDocumentInfoValues.begin();
|
||||
aValuesIt != myDocumentInfoValues.end();
|
||||
aValuesIt++)
|
||||
myRowCount += aValuesIt.value().size();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : ClearValues
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLineModel::ClearValues()
|
||||
{
|
||||
myAdditionalValues.clear();
|
||||
myDocumentInfoValues.clear();
|
||||
myRowCount = 0;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetPath
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QStringList DFBrowser_SearchLineModel::GetPath(const QModelIndex& theIndex) const
|
||||
{
|
||||
int aRowInDocument;
|
||||
int aDocumentId = getDocumentId(theIndex.row(), aRowInDocument);
|
||||
if (aDocumentId < 0)
|
||||
return QStringList();
|
||||
|
||||
const QMap<QString, DFBrowser_SearchItemInfo>& anAdditionalValues =
|
||||
myAdditionalValues[aDocumentId];
|
||||
const QStringList& anInfoValues = myDocumentInfoValues[aDocumentId];
|
||||
|
||||
return anAdditionalValues[anInfoValues[aRowInDocument]].Path();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetValue
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QString DFBrowser_SearchLineModel::GetValue(const QModelIndex& theIndex) const
|
||||
{
|
||||
int aRowInDocument;
|
||||
int aDocumentId = getDocumentId(theIndex.row(), aRowInDocument);
|
||||
if (aDocumentId < 0)
|
||||
return QString();
|
||||
QString aValue = myDocumentInfoValues[aDocumentId][aRowInDocument];
|
||||
return aValue.mid(0, aValue.indexOf(SplitSeparator()));
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : index
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QModelIndex DFBrowser_SearchLineModel::index(int theRow,
|
||||
int theColumn,
|
||||
const QModelIndex& theParent) const
|
||||
{
|
||||
if (!hasIndex(theRow, theColumn, theParent))
|
||||
return QModelIndex();
|
||||
return createIndex(theRow, theColumn);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : data
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant DFBrowser_SearchLineModel::data(const QModelIndex& theIndex, int theRole) const
|
||||
{
|
||||
switch (theIndex.column())
|
||||
{
|
||||
case 0: {
|
||||
if (theRole == Qt::DisplayRole || theRole == Qt::EditRole || theRole == Qt::ToolTipRole)
|
||||
{
|
||||
int aRowInDocument;
|
||||
int aDocumentId = getDocumentId(theIndex.row(), aRowInDocument);
|
||||
if (aDocumentId < 0)
|
||||
return QVariant();
|
||||
return myDocumentInfoValues[aDocumentId][aRowInDocument];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (theRole == Qt::DecorationRole)
|
||||
{
|
||||
int aRowInDocument;
|
||||
int aDocumentId = getDocumentId(theIndex.row(), aRowInDocument);
|
||||
if (aDocumentId < 0)
|
||||
return QVariant();
|
||||
QString anInfoValue = myDocumentInfoValues[aDocumentId][aRowInDocument];
|
||||
QVariant anIcon = myAdditionalValues[aDocumentId][anInfoValue].Icon();
|
||||
if (anIcon.isNull())
|
||||
{
|
||||
QString anAttributeName = anInfoValue.mid(0, anInfoValue.indexOf(SplitSeparator()));
|
||||
anIcon = DFBrowser_Module::GetAttributeInfo(anAttributeName.toUtf8().data(),
|
||||
myModule,
|
||||
DFBrowserPane_ItemRole_Decoration_40x40,
|
||||
0);
|
||||
}
|
||||
else
|
||||
anIcon = DFBrowser_Tools::GetLabelIcon(TDF_Label(), false);
|
||||
return anIcon;
|
||||
}
|
||||
if (theRole == Qt::SizeHintRole)
|
||||
return QSize(80, 80);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (theRole == Qt::DisplayRole || theRole == Qt::EditRole)
|
||||
{
|
||||
int aRowInDocument;
|
||||
int aDocumentId = getDocumentId(theIndex.row(), aRowInDocument);
|
||||
if (aDocumentId < 0)
|
||||
return QVariant();
|
||||
QString anInfoValue = myDocumentInfoValues[aDocumentId][aRowInDocument];
|
||||
return myAdditionalValues[aDocumentId][anInfoValue].PathUnited();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : emitLayoutChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchLineModel::EmitLayoutChanged()
|
||||
{
|
||||
emit layoutChanged();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : getDocumentId
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
int DFBrowser_SearchLineModel::getDocumentId(const int theRow, int& theRowInDocument) const
|
||||
{
|
||||
theRowInDocument = 0;
|
||||
int aDocumentId = -1;
|
||||
|
||||
int aCurrentRow = theRow;
|
||||
for (int aValueId = 0, aSize = myDocumentInfoValues.size(); aValueId < aSize; aValueId++)
|
||||
{
|
||||
int aValueIndex = aValueId + 1;
|
||||
if (!myDocumentInfoValues.contains(aValueIndex))
|
||||
continue;
|
||||
QStringList aValues = myDocumentInfoValues[aValueIndex];
|
||||
int aValuesSize = aValues.size();
|
||||
if (aCurrentRow < aValuesSize)
|
||||
{
|
||||
aDocumentId = aValueIndex;
|
||||
theRowInDocument = aCurrentRow;
|
||||
}
|
||||
else
|
||||
aCurrentRow = aCurrentRow - aValuesSize;
|
||||
}
|
||||
return aDocumentId;
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_SearchLineModel_H
|
||||
#define DFBrowser_SearchLineModel_H
|
||||
|
||||
#include <inspector/DFBrowser_SearchItemInfo.hxx>
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QAbstractTableModel>
|
||||
#include <QMap>
|
||||
#include <QStringList>
|
||||
#include <QVariant>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class QObject;
|
||||
class DFBrowser_Module;
|
||||
|
||||
//! \class DFBrowser_SearchLineModel
|
||||
//! Table view model filled by OCAF labels and attributes. It contain information in the next form:
|
||||
//! <document index> into <document values container>
|
||||
//! <document values container> is key(attribute name or label entry) into item information
|
||||
//! The model contains 3 columns:
|
||||
//! - 0: information text
|
||||
//! - 1: icon size is [80, 80]
|
||||
//! - 2: information text that contains united path
|
||||
class DFBrowser_SearchLineModel : public QAbstractTableModel
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_SearchLineModel(QObject* theParent, DFBrowser_Module* theModule);
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_SearchLineModel() {}
|
||||
|
||||
//! Separator as attribute name is divided from the label entry in information text
|
||||
static QString SplitSeparator() { return ": "; }
|
||||
|
||||
//! Returns the current module
|
||||
DFBrowser_Module* GetModule() const { return myModule; }
|
||||
|
||||
//! Fills internal containers by the OCAF values. Updates number of rows value
|
||||
//! \param theDocumentValues container of document index to container of entry/attribute name to
|
||||
//! item information \param theDocumentInfoValues container of a document index to entry/attribute
|
||||
//! name
|
||||
Standard_EXPORT void SetValues(
|
||||
const QMap<int, QMap<QString, DFBrowser_SearchItemInfo>>& theDocumentValues,
|
||||
const QMap<int, QStringList>& theDocumentInfoValues);
|
||||
|
||||
//! Clears cache of values
|
||||
Standard_EXPORT void ClearValues();
|
||||
|
||||
//! Returns path to attribute or label element of OCAF by the index.
|
||||
//! \param theIndex a tree model index
|
||||
Standard_EXPORT QStringList GetPath(const QModelIndex& theIndex) const;
|
||||
|
||||
//! Returns value(attribute name or label entry) of OCAF by the index
|
||||
Standard_EXPORT QString GetValue(const QModelIndex& theIndex) const;
|
||||
|
||||
//! Emits the layoutChanged signal from outside of this class
|
||||
Standard_EXPORT void EmitLayoutChanged();
|
||||
|
||||
//! Creates new model index
|
||||
//! \param theRow the index row position
|
||||
//! \param theColummn the index column position
|
||||
//! \param theParent the parent index
|
||||
//! \return the model index
|
||||
Standard_EXPORT virtual QModelIndex index(int theRow,
|
||||
int theColumn,
|
||||
const QModelIndex& theParent = QModelIndex()) const
|
||||
Standard_OVERRIDE;
|
||||
|
||||
//! Returns the data stored under the given role for the item referred to by the index.
|
||||
//! \param theIndex a model index
|
||||
//! \param theRole an enumeration value of role for data obtaining
|
||||
Standard_EXPORT virtual QVariant data(const QModelIndex& theIndex,
|
||||
int theRole = Qt::DisplayRole) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the number of rows under the given parent.
|
||||
//! \param theParent a parent model index
|
||||
//! \return the number of rows
|
||||
|
||||
virtual int rowCount(const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE
|
||||
{
|
||||
(void)theParent;
|
||||
return myRowCount;
|
||||
}
|
||||
|
||||
//! Returns the number of columns for the children of the given parent.
|
||||
//! \param theParent a parent model index
|
||||
//! \return the number of columns
|
||||
virtual int columnCount(const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE
|
||||
{
|
||||
(void)theParent;
|
||||
return 3;
|
||||
}
|
||||
|
||||
protected:
|
||||
//! Returns document index by a row index in table model
|
||||
//! \param theRow a row index of a QModelIndex
|
||||
//! \param theRowInDocument an output index, to obtain information from myDocumentInfoValues
|
||||
int getDocumentId(const int theRow, int& theRowInDocument) const;
|
||||
|
||||
private:
|
||||
DFBrowser_Module*
|
||||
myModule; //!< the current module
|
||||
//! a document index to container of entry/attribute name to item information
|
||||
QMap<int, QMap<QString, DFBrowser_SearchItemInfo>> myAdditionalValues;
|
||||
QMap<int, QStringList> myDocumentInfoValues; //!< a document index to entry/attribute name
|
||||
int myRowCount; //!< number of rows in the model: summ of row counts in all documents
|
||||
};
|
||||
#endif
|
@ -1,133 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_SearchView.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_HighlightDelegate.hxx>
|
||||
#include <inspector/DFBrowser_SearchLine.hxx>
|
||||
#include <inspector/DFBrowser_SearchLineModel.hxx>
|
||||
#include <inspector/DFBrowser_Window.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <inspector/TreeModel_ModelBase.hxx>
|
||||
#include <inspector/TreeModel_Tools.hxx>
|
||||
|
||||
#include <inspector/ViewControl_Tools.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QAbstractProxyModel>
|
||||
#include <QGridLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QTableView>
|
||||
#include <QWidget>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
static const int DEFAULT_ICON_SIZE = 40;
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_SearchView::DFBrowser_SearchView(QWidget* theParent)
|
||||
: QObject(theParent)
|
||||
{
|
||||
myMainWindow = new QWidget(theParent);
|
||||
QGridLayout* aLayout = new QGridLayout(myMainWindow);
|
||||
aLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
myTableView = new QTableView(myMainWindow);
|
||||
myTableView->verticalHeader()->setVisible(false);
|
||||
myTableView->verticalHeader()->setDefaultSectionSize(DEFAULT_ICON_SIZE
|
||||
+ TreeModel_Tools::HeaderSectionMargin());
|
||||
myTableView->setIconSize(QSize(DEFAULT_ICON_SIZE, DEFAULT_ICON_SIZE));
|
||||
myTableView->horizontalHeader()->setVisible(false);
|
||||
myTableView->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
myTableView->viewport()->setAttribute(Qt::WA_Hover);
|
||||
myTableView->setItemDelegate(new DFBrowser_HighlightDelegate(myTableView));
|
||||
|
||||
aLayout->addWidget(myTableView);
|
||||
|
||||
ViewControl_Tools::SetWhiteBackground(myTableView);
|
||||
myTableView->setGridStyle(Qt::NoPen);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : InitModels
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchView::InitModels()
|
||||
{
|
||||
QAbstractItemModel* aModel = mySearchLine->GetCompletionModel();
|
||||
myTableView->setModel(aModel);
|
||||
myTableView->setColumnWidth(0, 0); // to hide column
|
||||
myTableView->setColumnWidth(1, DEFAULT_ICON_SIZE + TreeModel_Tools::HeaderSectionMargin());
|
||||
|
||||
QItemSelectionModel* aSelectionModel = new QItemSelectionModel(aModel);
|
||||
myTableView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
myTableView->setSelectionModel(aSelectionModel);
|
||||
connect(aSelectionModel,
|
||||
SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
|
||||
this,
|
||||
SLOT(onTableSelectionChanged(const QItemSelection&, const QItemSelection&)));
|
||||
connect(myTableView,
|
||||
SIGNAL(doubleClicked(const QModelIndex&)),
|
||||
this,
|
||||
SLOT(onTableDoubleClicked(const QModelIndex&)));
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onTableSelectionChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchView::onTableSelectionChanged(const QItemSelection&, const QItemSelection&)
|
||||
{
|
||||
QItemSelectionModel* aSelectionModel = myTableView->selectionModel();
|
||||
QModelIndexList aSelectedIndices = aSelectionModel->selectedIndexes();
|
||||
QModelIndex aSelectedIndex = TreeModel_ModelBase::SingleSelected(aSelectedIndices, 2);
|
||||
if (!aSelectedIndex.isValid())
|
||||
return;
|
||||
QAbstractProxyModel* aTableModel = dynamic_cast<QAbstractProxyModel*>(myTableView->model());
|
||||
if (!aTableModel)
|
||||
return;
|
||||
DFBrowser_SearchLineModel* aSourceModel =
|
||||
dynamic_cast<DFBrowser_SearchLineModel*>(aTableModel->sourceModel());
|
||||
if (!aSourceModel)
|
||||
return;
|
||||
|
||||
QModelIndex aSourceSelectedIndex = aTableModel->mapToSource(aSelectedIndex);
|
||||
emit pathSelected(aSourceModel->GetPath(aSourceSelectedIndex),
|
||||
aSourceModel->GetValue(aSourceSelectedIndex));
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onTableDoubleClicked
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowser_SearchView::onTableDoubleClicked(const QModelIndex& theIndex)
|
||||
{
|
||||
QAbstractProxyModel* aTableModel = dynamic_cast<QAbstractProxyModel*>(myTableView->model());
|
||||
if (!aTableModel)
|
||||
return;
|
||||
DFBrowser_SearchLineModel* aSourceModel =
|
||||
dynamic_cast<DFBrowser_SearchLineModel*>(aTableModel->sourceModel());
|
||||
if (!aSourceModel)
|
||||
return;
|
||||
|
||||
QModelIndex aSourceSelectedIndex = aTableModel->mapToSource(theIndex);
|
||||
emit pathDoubleClicked(aSourceModel->GetPath(aSourceSelectedIndex),
|
||||
aSourceModel->GetValue(aSourceSelectedIndex));
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_SearchView_H
|
||||
#define DFBrowser_SearchView_H
|
||||
|
||||
#include <inspector/DFBrowser_SearchLine.hxx>
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QItemSelection>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowser_SearchLine;
|
||||
class QTableView;
|
||||
class QWidget;
|
||||
|
||||
//! \class DFBrowser_SearchView
|
||||
//! Container of search result. It has a table of values
|
||||
class DFBrowser_SearchView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_SearchView(QWidget* theParent);
|
||||
|
||||
//! Destructor
|
||||
virtual ~DFBrowser_SearchView() {}
|
||||
|
||||
//! Returns search parent control
|
||||
QWidget* GetControl() const { return myMainWindow; }
|
||||
|
||||
//! Sets search line to connect to the search line completion model
|
||||
void SetSearchLine(DFBrowser_SearchLine* theSearchLine) { mySearchLine = theSearchLine; }
|
||||
|
||||
//! Fills the table by values of search line completion model. The zero column of the table is
|
||||
//! hidden, so it visualizes values of 1st and 2nd columns of this model. It creates selection
|
||||
//! model and connects to selectionChanged and doubleClicked signals
|
||||
Standard_EXPORT void InitModels();
|
||||
|
||||
//! Resets search line
|
||||
void Reset() { mySearchLine->SetText(""); }
|
||||
|
||||
signals:
|
||||
|
||||
//! Signal about selecting of an item in the view.
|
||||
//! \param thePath path to the selected item (e.g. 0, 0:1, 0:1:1)
|
||||
//! \param theValue value of the selected item (e.g. TDataStd_Name)
|
||||
void pathSelected(const QStringList& thePath, const QString& theValue);
|
||||
|
||||
//! Signal about double click on an item in the view.
|
||||
//! \param thePath path to the selected item (e.g. 0, 0:1, 0:1:1)
|
||||
//! \param theValue value of the selected item (e.g. TDataStd_Name)
|
||||
void pathDoubleClicked(const QStringList& thePath, const QString& theValue);
|
||||
|
||||
protected slots:
|
||||
|
||||
//! Listens selection change and emits the pathSelected signal
|
||||
//! \param theSelected selected items
|
||||
//! \param theDeselected deselected items
|
||||
void onTableSelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection& theDeselected);
|
||||
|
||||
//! Listens double click signal on table view
|
||||
//! \theIndex a model index of double clicked item
|
||||
void onTableDoubleClicked(const QModelIndex& theIndex);
|
||||
|
||||
private:
|
||||
QWidget* myMainWindow; //!< control where table view is placed
|
||||
QTableView* myTableView; //!< table view to visualize search values
|
||||
DFBrowser_SearchLine* mySearchLine; //!< search line to have access to search model completor
|
||||
};
|
||||
#endif
|
@ -1,105 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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 <inspector/DFBrowser_Tools.hxx>
|
||||
|
||||
#include <inspector/DFBrowser_ItemBase.hxx>
|
||||
|
||||
#include <inspector/DFBrowserPane_AttributePaneCreator.hxx>
|
||||
#include <inspector/DFBrowserPane_Tools.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QColor>
|
||||
#include <QDir>
|
||||
#include <QPalette>
|
||||
#include <QWidget>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
namespace DFBrowser_Tools
|
||||
{
|
||||
// =======================================================================
|
||||
// function : IsEmptyLabel
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool IsEmptyLabel(const TDF_Label& theLabel)
|
||||
{
|
||||
if (theLabel.IsNull())
|
||||
return true;
|
||||
|
||||
if (theLabel.IsRoot())
|
||||
return false;
|
||||
|
||||
if (theLabel.NbAttributes() > 0)
|
||||
return false;
|
||||
|
||||
for (TDF_ChildIterator aChildIt(theLabel); aChildIt.More(); aChildIt.Next())
|
||||
{
|
||||
if (!IsEmptyLabel(aChildIt.Value()))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetLabelInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QString GetLabelInfo(const TDF_Label& theLabel, const bool isUseShortInfo)
|
||||
{
|
||||
QString aValue = DFBrowserPane_Tools::GetEntry(theLabel).ToCString();
|
||||
if (!isUseShortInfo)
|
||||
return aValue;
|
||||
|
||||
Handle(TDataStd_Name) aName;
|
||||
if (!theLabel.FindAttribute(TDataStd_Name::GetID(), aName))
|
||||
return aValue;
|
||||
|
||||
aValue += " ";
|
||||
aValue += DFBrowserPane_Tools::ToString(aName->Get());
|
||||
|
||||
return aValue;
|
||||
}
|
||||
|
||||
enum DFBrowser_IconType
|
||||
{
|
||||
DFBrowser_IconType_16x16,
|
||||
DFBrowser_IconType_40x40
|
||||
};
|
||||
|
||||
static QMap<DFBrowser_IconType, QIcon> MyLabelIcons;
|
||||
|
||||
// =======================================================================
|
||||
// function : GetLabelIcon
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QIcon GetLabelIcon(const TDF_Label& theLabel, bool isStandard16x16)
|
||||
{
|
||||
(void)theLabel;
|
||||
if (MyLabelIcons.empty())
|
||||
{
|
||||
MyLabelIcons[DFBrowser_IconType_16x16] = QIcon(":/icons/label_folder_16x16.png");
|
||||
MyLabelIcons[DFBrowser_IconType_40x40] = QIcon(":/icons/label_folder_40x40.png");
|
||||
}
|
||||
return MyLabelIcons[isStandard16x16 ? DFBrowser_IconType_16x16 : DFBrowser_IconType_40x40];
|
||||
}
|
||||
} // namespace DFBrowser_Tools
|
@ -1,59 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// 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.
|
||||
|
||||
#ifndef DFBrowser_Tools_H
|
||||
#define DFBrowser_Tools_H
|
||||
|
||||
#include <inspector/TreeModel_ItemBase.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QColor>
|
||||
#include <QMap>
|
||||
#include <QModelIndex>
|
||||
#include <QPixmap>
|
||||
#include <QString>
|
||||
#include <QIcon>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class DFBrowserPane_AttributePaneAPI;
|
||||
|
||||
//! \namespace DFBrowser_Tools
|
||||
//! The namespace that gives auxiliary methods for TDF elements manipulation
|
||||
namespace DFBrowser_Tools
|
||||
{
|
||||
|
||||
//! Returns true if the label is not root, has attribute or at least one sub-label with attribute
|
||||
//! \param theLabel a label
|
||||
//! \return boolean result
|
||||
Standard_EXPORT bool IsEmptyLabel(const TDF_Label& theLabel);
|
||||
|
||||
//! Returns the label entry
|
||||
//! \param isUseShortInfo boolean value if value of name attribute should be included to result
|
||||
//! \return string value
|
||||
Standard_EXPORT QString GetLabelInfo(const TDF_Label& theLabel, const bool isUseShortInfo = true);
|
||||
|
||||
//! Returns the label icon
|
||||
Standard_EXPORT QIcon GetLabelIcon(const TDF_Label& theLabel, bool isStandard16x16 = true);
|
||||
} // namespace DFBrowser_Tools
|
||||
|
||||
#endif
|