1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

..

34 Commits

Author SHA1 Message Date
gelin
f50111ec50 0032811: Bad result of sweep operation due to Surface Surface Intersect Bug 2022-01-29 20:08:52 +08:00
aml
7109a4ae58 0032806: Coding - get rid of unused headers [Contap to Extrema] 2022-01-28 18:30:32 +03:00
atychini
ff77ee8103 0032748: Data Exchange, Step Import - xstep.cascade.unit doesn't work [regression since OCCT 7.6.0]
Added new condition in STEPControl_ActorRead::Transfer: if StepData_StepModel is not an initialized Unit - we set unit to this step model
2022-01-28 18:29:12 +03:00
kgv
223ae699c7 0032795: Documentation - clarify indexation range within Poly_Triangulation/Graphic3d_ArrayOfPrimitives classes 2022-01-25 21:56:45 +03:00
ifv
9eee5ab7e4 0032701: Modeling Algorithms - 2d curve has bending near the degenerated edge of the face
ApproxInt_Approx, ApproxInt_KnotTools, BRepApprox_Approx,
GeomInt_IntSS, IntTools_FaceFace:
  Analysis of curvature is added for adjusting ParametrizationType

IntPatch_Intersection.cxx - adding methods for estimation of UV max step depending on used surfaces

GeomInt_IntSS.cxx, IntTools_FaceFace.cxx - using methods for max step estimation

Approx_SameParameter.cxx - adding control against big values.

BOPAlgo_PaveFiller_6.cxx - adjusting position of faces before intersection
2022-01-25 21:54:13 +03:00
kgv
5614b1369a 0032783: Documentation - Doxygen 1.9.3 generates corrupted HTML for dox/samples/ocaf.md
Fix incorrect/fragile Markdown syntax in samples/ocaf and user_guides/modeling_data.
2022-01-19 20:07:55 +03:00
aml
33a4d46b28 0032781: Coding - get rid of unused headers [BRepCheck to ChFiKPart] 2022-01-19 20:05:46 +03:00
Dzmitry Razmyslovich
d7dac7fc36 0032784: BinXCAF fails to load documents containing the shapes with scaled/mirrored location
A flag not to raise an exception is used on reading of an XCAF document. If such a shape with scaling transformation is stored in the document, it should be read.
2022-01-19 20:01:14 +03:00
kgv
ba9548c55b 0032668: Documentation - add tutorial for creating a custom AIS Interactive Object 2022-01-18 21:46:09 +03:00
kgv
2275caec09 0032780: Visualization, TKOpenGl - add smoothing to row interlaced stereoscopic output
Added new option Graphic3d_RenderingParams::ToSmoothInterlacing enabled by default.
Added -smooth   option to vstereo command.
Added -dpiAware option to vinit   command (Windows).
2022-01-17 20:04:30 +03:00
kgv
ddb9ed4810 0032779: Visualization, TKOpenGl - support using a wide color window buffer format (10bit per component / 30bit RGB)
Added new flag OpenGl_Caps::buffersDeepColor disabled by default.
OpenGl_Window now tries to find a RGB10_A2 pixel format using wglChoosePixelFormatARB().
OpenGl_TextureFormat::FindSizedFormat() - added handling of GL_RGB10_A2 internal format.
OpenGl_View::SetWindow() now selects preferred FBO color format basing on parameters.
OpenGl_Context::DiagnosticInformation()/OpenGl_View::DiagnosticInformation() now include
information about window pixel format / FBO texture format.
2022-01-17 20:03:28 +03:00
isn
7073768338 0028642: BRepOffsetAPI_ThruSections/BRepFill_Generator are modifying the input shape sections
1) BRepFill_Generator and BRepOffsetAPI_ThruSections now support 'non-destructive' mode for the input shapes (sections wires). The shape history of this algorithms also has been modified.
2) New test grids (based on the previous ones) have been added. These new cases use locked shapes as input arguments
3) The option '-safe' has been added to 'thrusections' command
2022-01-17 20:02:13 +03:00
achesnok
71943b31f8 0032722: Visualization, TKOpenGl - performance counters disappear at some camera viewpoints
Fixed OpenGl_FrameStatsPrs::Render() to enable depth clamping.
Fixed OpenGl_View::MinMaxValues() to take into account performance overlay.
2022-01-14 18:04:40 +03:00
emv
0101c6febe 0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode "Complete" join type "Intersection"
Add more faces for intersection in rebuilding process basing on the connection of the splits of offset faces (special treatment for the artificially invalid faces).
When rebuilding faces add vertices common for faces for trimming the new intersection edges.

Adjust existing and create new test cases.
2022-01-13 20:52:33 +03:00
kgv
dfa2a6719c 0032763: Coding Rules - eliminate CLang warning -Wbitwise-instead-of-logical in math_FunctionSetRoot.cxx 2022-01-13 20:51:37 +03:00
aml
9ff36dac47 0032768: Coding - get rid of unused headers [BopAlgo to BRepBuilderAPI] 2022-01-12 23:10:09 +03:00
kgv
7e524fcbe1 0032764: Coding Rules - missing include guard in BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx 2022-01-10 19:46:35 +03:00
kgv
d925497360 0032758: Visualization, TKOpenGl - disable shadow-map from transform-persistence objects
OpenGl_View::renderShadowMap() now skips transform-persistent objects.
OpenGl_ShadowMap::UpdateCamera() - removed redundant Z-range expansion for non-rendered objects.
Improved syntax of vdrawtext command.
2022-01-10 19:45:09 +03:00
vro
6cb968fd6f 0032757: Application Framework, scaling transformation - loading of an OCAF XML document fails
A flag not to raise an exception is used on reading of an OCAF document. If such a shape with scaling transformation is stored in the document, it should be read.

Modified files:
XmlMNaming\XmlMNaming_NamedShapeDriver.cxx: not checking of the type of transformation for a read shape
2022-01-10 19:43:48 +03:00
jgv
e2a956a633 0032747: Modeling Algorithms - Exact HLR algorithm gives wrong result
Modify the method IntWalk_IWalking::TestArretCadre: correct the value of scalar product of two vectors according to the tolerances in U and V.
2022-01-10 19:42:11 +03:00
achesnok
16a263dc17 0032606: Visualization - add a shader for sky V3d_View::BackgroundSkydome()
Introduced V3d_View::SkydomeAspect() property for generating skydome cubemap environment.
Skydome features: day/night cycle, 2 types of clouds, atmosphere, water surface, stars, fog.
2021-12-30 00:14:47 +03:00
asuraven
2ac4e1beee 0032744: Modeling Algorithms - Endless loop in GCPnts_UniformDeflection
fixed finish criteria in CPnts_UniformDeflection::Perform()
2021-12-28 19:23:48 +03:00
aml
2f23e4e3a5 0032751: Coding - get rid of unused headers [AppStd to BndLib] 2021-12-27 10:17:16 +03:00
emv
bcecb5832b 0032644: Modeling Algorithms - Empty result of section operation
Use distance criteria additionally to parameter criteria when verifying the extrema solution to belong to the edge boundary.
Refactor the BRepExtrema_DistanceSS class to remove the excessive methods with mirrored parameters.
2021-12-23 19:19:11 +03:00
aml
f32cb549d8 0032742: Coding - get rid of unused headers [Adaptor2d to Approx] 2021-12-20 18:11:59 +03:00
kgv
ce7fe22d97 0032743: Coding Rules - remove unused class friends of Package classes 2021-12-20 18:10:56 +03:00
kgv
1bc34debc1 0032740: Coding Rules, OpenGl_Context.cxx - new warning on macOS after integration fix for #32732 2021-12-19 12:29:47 +03:00
kgv
302ad26bff 0032739: Configuration, scripts - handle ABI list within macOS building script adm/scripts/macos_build.sh 2021-12-17 17:51:40 +03:00
kgv
90eac74988 0032738: Configuration, scripts - handle ABI list within iOS building script adm/scripts/ios_build.sh
Variables "toSimulator" and "anAbi" within "ios_custom.sh"
have been replaced by "anAbiList" which can be defined like "iPhoneOS|arm64 iPhoneSimulator|arm64".
Added "toPackFat" option packing multiple architectures into FAT archives.
2021-12-17 17:48:53 +03:00
kgv
4d476dd2ed 0032732: Visualization, TKOpenGl - do not include system headers within OpenGl_GlFunctions.hxx 2021-12-17 17:43:29 +03:00
kgv
f291ad2528 0032733: Coding Rules - fix misprints in Doxygen tags 2021-12-17 17:41:36 +03:00
ichesnok
468856bf4a 0032452: Data Exchange - IGES reader returns invalid shapes if xstep.cascade.unit property is changed from default
Fixed documentation in 'IGES Translator' and 'STEP Translator' sections (description of the read.maxprecision.val parameter).
2021-12-16 19:26:41 +03:00
kgv
2f195ab915 0032484: Configuration, CMake fails to find EGL and GLES2 include directory on iOS platform
Fixed configuration errors and compilation errors on iOS target due to unexpected EGL usage (non-existing on iOS).
2021-12-16 19:24:31 +03:00
ssafarov
6ba81a695f 0026174: Data Exchange, IGES - Loss of color after the second write of file
A copy of myface is made, where further on the copy the geometry changes. We connect the face, wire, edge of the original shape with the one whose geometry was changed. This is done in order to get the original shape in the TransferWire() and TransferEdge() methods.
2021-12-13 09:36:02 +03:00
1920 changed files with 11417 additions and 14071 deletions

View File

@@ -661,8 +661,10 @@ endif()
if (CAN_USE_GLES2)
if (USE_GLES2)
add_definitions (-DHAVE_GLES2_EXT)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
if (NOT IOS)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
endif()
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")

View File

@@ -1,142 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of Bullet for Android platform.
rem Script should be placed into root of Bullet repository, edited with paths
rem to CMake, 3rd-parties, Android NDK and MinGW64 make tool.
rem CMake toolchain definition should be cloned from the following git repository:
rem https://github.com/taka-no-me/android-cmake
set "aBulletSrc=%~dp0"
set aNbJobs=%NUMBER_OF_PROCESSORS%
call c:\TDM-GCC-64\mingwvars.bat
set "PATH=c:\CMake\bin;%PATH%"
set "anNdkPath=c:/android-ndk-r12"
set "aToolchain=c:/android-cmake-master/android.toolchain.cmake"
set "toPack=1"
set /p aBulletVersion=<%aBulletSrc%VERSION
echo "aBulletVersion=%aBulletVersion%"
call :cmakeGenerate "15" "armeabi-v7a"
call :cmakeGenerate "15" "x86"
call :cmakeGenerate "21" "arm64-v8a"
call :cmakeGenerate "21" "x86_64"
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
if ["%THE_7Z_PATH%"] == [""] set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
if not exist "%THE_7Z_PATH%" set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
if not exist "%THE_7Z_PATH%" set "THE_7Z_PATH=%ProgramFiles%\7-Zip\7z.exe"
set "anArchName=bullet-%aBulletVersion%-android"
set "aTarget=%~dp0work\%anArchName%"
if "%toPack%"=="1" (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%\libs" ( mkdir "%aTarget%\libs" )
if exist "%~dp0work/%anArchName%.7z" del "%~dp0work/%anArchName%.7z"
xcopy /S /Y "%~dp0work\android-armeabi-v7a-gcc\include\*" "%aTarget%\"
xcopy /S /Y "%~dp0work\android-armeabi-v7a-gcc\libs\*" "%aTarget%\libs\"
xcopy /S /Y "%~dp0work\android-arm64-v8a-gcc\libs\*" "%aTarget%\libs\"
xcopy /S /Y "%~dp0work\android-x86-gcc\libs\*" "%aTarget%\libs\"
xcopy /S /Y "%~dp0work\android-x86_64-gcc\libs\*" "%aTarget%\libs\"
xcopy /Y "%aBulletSrc%README.md" "%aTarget%\"
xcopy /Y "%aBulletSrc%LICENSE.txt" "%aTarget%\"
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%~dp0work/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "anApi=%1"
set "anAbi=%2"
set "aPlatformAndCompiler=android-%anAbi%-gcc"
set "aWorkDir=work\%aPlatformAndCompiler%-make"
set "aLogFile=%~dp0build-%anAbi%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
pushd "%aWorkDir%"
set STARTTIME=%TIME%
echo Configuring Bullet for Android %anAbi% (API level %anApi%)...
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D ANDROID_NDK:FILEPATH="%anNdkPath%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D ANDROID_ABI:STRING="%anAbi%" ^
-D ANDROID_NATIVE_API_LEVEL:STRING="%anApi%" ^
-D ANDROID_STL:STRING="gnustl_shared" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D CMAKE_INSTALL_PREFIX:PATH="%~dp0work/%aPlatformAndCompiler%" ^
-D LIBRARY_OUTPUT_PATH:PATH="%~dp0work/%aPlatformAndCompiler%/libs/%anAbi%" ^
-D LIB_DESTINATION:STRING="libs/%anAbi%" ^
-D INCLUDE_INSTALL_DIR:STRING="%~dp0work/%aPlatformAndCompiler%/include/bullet" ^
-D BUILD_BULLET3:BOOL="ON" ^
-D BUILD_CPU_DEMOS:BOOL="OFF" ^
-D BUILD_EXTRAS:BOOL="OFF" ^
-D BUILD_BULLET2_DEMOS:BOOL="OFF" ^
-D BUILD_OPENGL3_DEMOS:BOOL="OFF" ^
-D BUILD_PYBULLET:BOOL="OFF" ^
-D BUILD_SHARED_LIBS:BOOL="OFF" ^
-D BUILD_UNIT_TESTS:BOOL="OFF" ^
-D BULLET2_USE_THREAD_LOCKS:BOOL="OFF" ^
-D USE_GLUT:BOOL="OFF" ^
-D USE_DOUBLE_PRECISION:BOOL="OFF" ^
-D USE_CUSTOM_VECTOR_MATH:BOOL="OFF" ^
-D USE_GRAPHICAL_BENCHMARK:BOOL="OFF" ^
-D USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD:BOOL="OFF" ^
"%aBulletSrc%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
mingw32-make clean
echo Building Bullet...
mingw32-make -j %aNbJobs% 2>> %aLogFile%
type %aLogFile%
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
echo Installing Bullet into %~dp0work/%aPlatformAndCompiler%...
mingw32-make install 2>> %aLogFile%
set ENDTIME=%TIME%
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%STARTTIME:~0,1%"==" " set "STARTTIME=%STARTTIME:~1%"
if "%ENDTIME:~0,1%"==" " set "ENDTIME=%ENDTIME:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%STARTTIME:~1,1%"==":" set "STARTTIME=0%STARTTIME%"
if "%ENDTIME:~1,1%"==":" set "ENDTIME=0%ENDTIME%"
rem convert hours:minutes:seconds:ms into duration
set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 + (1%STARTTIME:~9,2%-100)
set /A ENDTIME= (1%ENDTIME:~0,2%-100)*360000 + (1%ENDTIME:~3,2%-100)*6000 + (1%ENDTIME:~6,2%-100)*100 + (1%ENDTIME:~9,2%-100)
set /A DURATION=%ENDTIME%-%STARTTIME%
if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-%ENDTIME%
set /A DURATIONH=%DURATION% / 360000
set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% for %anAbi%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% >> %aLogFile%
popd
goto :eof

View File

@@ -1,144 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building building of Bullet for iOS platform.
# Script should be placed into root of Bullet repository, edited with paths to CMake.
# https://github.com/bulletphysics/bullet3/releases
# WARNING! The following line should be removed from CMakeLists.txt in Bullet for building for iOS:
# FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
# CMake toolchain definition should be cloned from the following git repository:
# https://github.com/leetal/ios-cmake
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then cd "$aScriptPath"; fi
aScriptPath="$PWD"
aProjName=${PWD##*/}
aBulletSrc=$aScriptPath
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
PATH=/Applications/CMake.app/Contents/bin:$PATH
aToolchain=$HOME/ios-cmake.git/ios.toolchain.cmake
# build stages to perform
toSimulator=0
toCMake=1
toClean=1
toMake=1
toInstall=1
toPack=1
export MACOSX_DEPLOYMENT_TARGET=
export IPHONEOS_DEPLOYMENT_TARGET=8.0
anAbi=arm64
aPlatform=OS
aPlatformAndCompiler=ios-$anAbi-clang
if [[ $toSimulator == 1 ]]; then
anAbi=x86_64
aPlatform=SIMULATOR64
aPlatformAndCompiler=ios-simulator64-clang
fi
aWorkDir=work/$aProjName-${aPlatformAndCompiler}-make
aDestDir=$aBulletSrc/work/$aProjName-$aPlatformAndCompiler
aLogFile=$aBulletSrc/build-${aPlatformAndCompiler}.log
mkdir -p $aWorkDir
rm -f $aLogFile
pushd $aWorkDir
aTimeZERO=$SECONDS
set -o pipefail
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> $aLogFile
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring Bullet for iOS...
cmake -G "Unix Makefiles" \
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="$aToolchain" \
-D IOS_PLATFORM:STRING="$aPlatform" \
-D IOS_ARCH:STRING="$anAbi" \
-D IOS_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D BUILD_LIBRARY_TYPE:STRING="Static" \
-D CMAKE_INSTALL_PREFIX:PATH="$aDestDir" \
-D CMAKE_INSTALL_PREFIX:PATH="%~dp0work/%aPlatformAndCompiler%" \
-D LIBRARY_OUTPUT_PATH:PATH="$aDestDir/lib" \
-D LIB_DESTINATION:STRING="lib" \
-D INCLUDE_INSTALL_DIR:STRING="$aDestDir/include/bullet" \
-D BUILD_BULLET3:BOOL="ON" \
-D BUILD_CPU_DEMOS:BOOL="OFF" \
-D BUILD_EXTRAS:BOOL="OFF" \
-D BUILD_BULLET2_DEMOS:BOOL="OFF" \
-D BUILD_OPENGL3_DEMOS:BOOL="OFF" \
-D BUILD_PYBULLET:BOOL="OFF" \
-D BUILD_SHARED_LIBS:BOOL="OFF" \
-D BUILD_UNIT_TESTS:BOOL="OFF" \
-D BULLET2_USE_THREAD_LOCKS:BOOL="OFF" \
-D USE_GLUT:BOOL="OFF" \
-D USE_DOUBLE_PRECISION:BOOL="OFF" \
-D USE_CUSTOM_VECTOR_MATH:BOOL="OFF" \
-D USE_GRAPHICAL_BENCHMARK:BOOL="OFF" \
-D USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD:BOOL="OFF" \
"$aBulletSrc" 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing into $aBulletSrc/work/$aPlatformAndCompiler...
make install 2>&1 | tee -a $aLogFile
xcodebuild -version > $aDestDir/config.log
clang --version >> $aDestDir/config.log
echo IPHONEOS_DEPLOYMENT_TARGET=$IPHONEOS_DEPLOYMENT_TARGET>> $aDestDir/config.log
cp -f $aBulletSrc/VERSION $aDestDir/VERSION
cp -f $aBulletSrc/LICENSE.txt $aDestDir/LICENSE.txt
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=$aProjName-$aPlatformAndCompiler.tar.bz2
echo Creating an archive $aBulletSrc/work/$anArchName...
rm $aBulletSrc/work/$anArchName &>/dev/null
pushd $aDestDir
tar -jcf $aBulletSrc/work/$anArchName *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd

View File

@@ -1,124 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building building of Bullet for macOS platform.
# Script should be placed into root of bullet repository, edited with paths to CMake.
# https://github.com/bulletphysics/bullet3/releases
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then cd "$aScriptPath"; fi
aScriptPath="$PWD"
aProjName=${PWD##*/}
aBulletSrc=$aScriptPath
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
PATH=/Applications/CMake.app/Contents/bin:$PATH
# build stages to perform
toCMake=1
toClean=1
toMake=1
toInstall=1
toPack=1
export MACOSX_DEPLOYMENT_TARGET=10.10
anAbi=arm64
#anAbi=x86_64
aPlatformAndCompiler=macos-$anAbi
aWorkDir=work/$aProjName-${aPlatformAndCompiler}-make
aDestDir=$aBulletSrc/work/$aProjName-$aPlatformAndCompiler
aLogFile=$aBulletSrc/build-${aPlatformAndCompiler}.log
mkdir -p $aWorkDir
rm -f $aLogFile
pushd $aWorkDir
aTimeZERO=$SECONDS
set -o pipefail
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> $aLogFile
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring Bullet for OS X...
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D BUILD_LIBRARY_TYPE:STRING="Static" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_INSTALL_PREFIX:PATH="$aDestDir" \
-D LIBRARY_OUTPUT_PATH:PATH="$aDestDir/lib" \
-D LIB_DESTINATION:STRING="lib" \
-D INCLUDE_INSTALL_DIR:STRING="$aDestDir/include/bullet" \
-D BUILD_BULLET3:BOOL="ON" \
-D BUILD_CPU_DEMOS:BOOL="OFF" \
-D BUILD_EXTRAS:BOOL="OFF" \
-D BUILD_BULLET2_DEMOS:BOOL="OFF" \
-D BUILD_OPENGL3_DEMOS:BOOL="OFF" \
-D BUILD_PYBULLET:BOOL="OFF" \
-D BUILD_SHARED_LIBS:BOOL="OFF" \
-D BUILD_UNIT_TESTS:BOOL="OFF" \
-D BULLET2_USE_THREAD_LOCKS:BOOL="OFF" \
-D USE_GLUT:BOOL="OFF" \
-D USE_DOUBLE_PRECISION:BOOL="OFF" \
-D USE_CUSTOM_VECTOR_MATH:BOOL="OFF" \
-D USE_GRAPHICAL_BENCHMARK:BOOL="OFF" \
-D USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD:BOOL="OFF" \
"$aBulletSrc" 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing into $aBulletSrc/work/$aPlatformAndCompiler...
make install 2>&1 | tee -a $aLogFile
xcodebuild -version > $aDestDir/config.log
clang --version >> $aDestDir/config.log
echo MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET>> $aDestDir/config.log
cp -f $aBulletSrc/VERSION $aDestDir/VERSION
cp -f $aBulletSrc/LICENSE.txt $aDestDir/LICENSE.txt
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=$aProjName-$aPlatformAndCompiler.tar.bz2
echo Creating an archive $aBulletSrc/work/$anArchName...
rm $aBulletSrc/work/$anArchName &>/dev/null
pushd $aDestDir
tar -jcf $aBulletSrc/work/$anArchName *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd

View File

@@ -1,101 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of Draco library for Android platform.
rem https://github.com/google/draco
set "aDracoSrc=%~dp0"
set "aBuildRoot=%aDracoSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
call c:\TDM-GCC-64\mingwvars.bat
set "aCmakeBin=c:\CMake\bin"
set "anNdkPath=c:/android-ndk-r12"
set "PATH=%aCmakeBin%;%PATH%"
set "aCompiler=gcc"
set "aCppLib=gnustl_shared"
if not exist "%anNdkPath%/sources/cxx-stl/gnu-libstdc++" (
if exist "%anNdkPath%/sources/cxx-stl/llvm-libc++" (
set "aCompiler=clang"
set "aCppLib=c++_shared"
)
)
set "aDestDir=%aBuildRoot%\draco-android-%aCompiler%"
rmdir /S /Q "%aDestDir%"
if not exist "%aDestDir%" ( mkdir "%aDestDir%" )
if not exist "%aDestDir%\include" ( mkdir "%aDestDir%\include" )
if not exist "%aDestDir%\libs" ( mkdir "%aDestDir%\libs" )
xcopy /Y "%aDracoSrc%\LICENSE" "%aDestDir%\"
xcopy /Y "%aDracoSrc%\README.md" "%aDestDir%\"
call :cmakeGenerate "15" "armeabi-v7a"
call :cmakeGenerate "15" "x86"
call :cmakeGenerate "21" "arm64-v8a"
call :cmakeGenerate "21" "x86_64"
set "anArchName=draco-android"
echo Creating archive %anArchName%.7z
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aDestDir%"
pause
goto :eof
:cmakeGenerate
set "anApi=%~1"
set "anAbi=%~2"
set "aPlatformAndCompiler=android-%anAbi%-%aCompiler%"
set "aWorkDir=%aBuildRoot%\draco-%aPlatformAndCompiler%-make"
set "aLogFile=%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
pushd "%aWorkDir%"
echo Configuring Draco for Android %anAbi%, API level %anApi%...
cmake -G "MinGW Makefiles" ^
-D CMAKE_SYSTEM_NAME:STRING="Android" ^
-D CMAKE_ANDROID_NDK="%anNdkPath%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D CMAKE_ANDROID_ARCH_ABI:STRING="%anAbi%" ^
-D CMAKE_SYSTEM_VERSION:STRING="%anApi%" ^
-D CMAKE_ANDROID_STL_TYPE="%aCppLib%" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aBuildRoot%/draco-%aPlatformAndCompiler%" ^
-D LIBRARY_OUTPUT_PATH:PATH="%aBuildRoot%/draco-%aPlatformAndCompiler%/libs/%anAbi%" ^
"%aDracoSrc%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
mingw32-make clean
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type %aLogFile%
popd
pause
exit /B
goto :eof
)
type %aLogFile%
echo Installing Draco into %aBuildRoot%/draco-%aPlatformAndCompiler%...
mingw32-make install 2>> %aLogFile%
xcopy /S /Y "%aBuildRoot%\draco-%aPlatformAndCompiler%\include\*" "%aDestDir%\include\"
xcopy /S /Y "%aBuildRoot%\draco-%aPlatformAndCompiler%\libs\*" "%aDestDir%\libs\"
popd
goto :eof

View File

@@ -1,102 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of Draco for Linux platform.
# Script should be placed into root of Draco repository, edited with paths to CMake.
# https://github.com/google/draco
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then cd "$aScriptPath"; fi
aScriptPath="$PWD"
aProjName=${PWD##*/}
aDracoSrc=$aScriptPath
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
# CMake should be up-to-date
#PATH=~/develop/local/bin:$PATH
# build stages to perform
toCMake=1
toClean=1
toMake=1
toInstall=1
toPack=1
aPlatformAndCompiler=lin64-gcc
aWorkDir=work/$aProjName-${aPlatformAndCompiler}-make
aDestDir=$aDracoSrc/work/$aProjName-$aPlatformAndCompiler
aLogFile=$aDracoSrc/build-${aPlatformAndCompiler}.log
mkdir -p $aWorkDir
rm -f $aLogFile
pushd $aWorkDir
aTimeZERO=$SECONDS
set -o pipefail
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> $aLogFile
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring Draco for Linux...
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D CMAKE_INSTALL_PREFIX:PATH="$aDestDir" \
-D BUILD_DOCS:BOOL="OFF" \
-D BUILD_LIBRARY_TYPE:STRING="Static" \
"$aDracoSrc" 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing into $aDracoSrc/work/$aPlatformAndCompiler...
make install 2>&1 | tee -a $aLogFile
gcc --version >> $aDestDir/config.log
cp -f $aDracoSrc/LICENSE $aDestDir/LICENSE
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=$aProjName-$aPlatformAndCompiler.tar.bz2
echo Creating an archive $aDracoSrc/work/$anArchName...
rm $aDracoSrc/work/$anArchName &>/dev/null
pushd $aDestDir
tar -jcf $aDracoSrc/work/$anArchName *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd

View File

@@ -1,107 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building building of Draco for macOS platform.
# Script should be placed into root of Draco repository, edited with paths to CMake.
# https://github.com/google/draco
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then cd "$aScriptPath"; fi
aScriptPath="$PWD"
aProjName=${PWD##*/}
aDracoSrc=$aScriptPath
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
PATH=/Applications/CMake.app/Contents/bin:$PATH
# build stages to perform
toCMake=1
toClean=1
toMake=1
toInstall=1
toPack=1
export MACOSX_DEPLOYMENT_TARGET=10.10
anAbi=arm64
#anAbi=x86_64
aPlatformAndCompiler=macos-$anAbi
aWorkDir=work/$aProjName-${aPlatformAndCompiler}-make
aDestDir=$aDracoSrc/work/$aProjName-$aPlatformAndCompiler
aLogFile=$aDracoSrc/build-${aPlatformAndCompiler}.log
mkdir -p $aWorkDir
rm -f $aLogFile
pushd $aWorkDir
aTimeZERO=$SECONDS
set -o pipefail
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> $aLogFile
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring Draco for macOS...
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D BUILD_LIBRARY_TYPE:STRING="Static" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_INSTALL_PREFIX:PATH="$aDestDir" \
"$aDracoSrc" 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a $aLogFile
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing into $aDracoSrc/work/$aPlatformAndCompiler...
make install 2>&1 | tee -a $aLogFile
xcodebuild -version > $aDestDir/config.log
clang --version >> $aDestDir/config.log
echo MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET>> $aDestDir/config.log
cp -f $aDracoSrc/README.md $aDestDir/README.md
cp -f $aDracoSrc/LICENSE $aDestDir/LICENSE
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=$aProjName-$aPlatformAndCompiler.tar.bz2
echo Creating an archive $aDracoSrc/work/$anArchName...
rm $aDracoSrc/work/$anArchName &>/dev/null
pushd $aDestDir
tar -jcf $aDracoSrc/work/$anArchName *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd

View File

@@ -1,107 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of Draco library as WebAssembly library.
rem https://github.com/google/draco
set "aDracoSrc=%~dp0"
set "aBuildRoot=%aDracoSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin=c:\CMake\bin"
set "EMSDK_ROOT=c:\emsdk"
set "EMSCRIPTEN=%EMSDK_ROOT%/upstream/emscripten"
set "PATH=%EMSDK_ROOT%\python\3.9.2-1_64bit;%PATH%"
rem Build stages to perform
set "toCMake=1"
set "toClean=1"
set "toMake=1"
set "toInstall=1"
set "toDebug=0"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "aBuildType=Release"
set "aBuildTypePrefix="
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=-debug"
)
call :cmakeGenerate
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\draco-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\draco-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\draco-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
pushd "%aWorkDir%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDir%" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D DRACO_WASM:BOOL="ON" ^
-D DRACO_JS_GLUE:BOOL="OFF" ^
"%aDracoSrc%"
rem -D DRACO_POINT_CLOUD_COMPRESSION:BOOL="OFF" ^
rem -D DRACO_MESH_COMPRESSION:BOOL="OFF" ^
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
pause
exit /B
goto :eof
)
type "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof

View File

@@ -1,139 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of FreeType for Android platform.
rem Script should be placed into root of FreeType repository, edited with paths
rem to CMake, 3rd-parties, Android NDK and MinGW64 make tool.
rem CMake toolchain definition should be cloned from the following git repository:
rem https://github.com/taka-no-me/android-cmake
rem CMake can be downloaded from official site:
rem https://cmake.org/download/
rem Android NDK can be downloaded from official site:
rem https://developer.android.com/ndk/downloads
set "aFreeTypeSrc=%~dp0"
set aNbJobs=%NUMBER_OF_PROCESSORS%
call c:\TDM-GCC-64\mingwvars.bat
set "PATH=c:\CMake\bin;%PATH%"
set "anNdkPath=c:/android-ndk-r12"
set "aToolchain=c:/android-cmake-master/android.toolchain.cmake"
set "toPack=1"
set "FREETYPE_MAJOR=0"
set "FREETYPE_MINOR=0"
set "FREETYPE_PATCH=0"
for /f "tokens=3" %%i in ('findstr /b /c:"#define FREETYPE_MAJOR" "%aFreeTypeSrc%\include\freetype\freetype.h"') do ( set "FREETYPE_MAJOR=%%i" )
for /f "tokens=3" %%i in ('findstr /b /c:"#define FREETYPE_MINOR" "%aFreeTypeSrc%\include\freetype\freetype.h"') do ( set "FREETYPE_MINOR=%%i" )
for /f "tokens=3" %%i in ('findstr /b /c:"#define FREETYPE_PATCH" "%aFreeTypeSrc%\include\freetype\freetype.h"') do ( set "FREETYPE_PATCH=%%i" )
set "aFreeTypeVersion=%FREETYPE_MAJOR%.%FREETYPE_MINOR%.%FREETYPE_PATCH%"
echo "aFreeTypeVersion=%aFreeTypeVersion%"
call :cmakeGenerate "15" "armeabi-v7a"
call :cmakeGenerate "15" "x86"
call :cmakeGenerate "21" "arm64-v8a"
call :cmakeGenerate "21" "x86_64"
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
if ["%THE_7Z_PATH%"] == [""] set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
if not exist "%THE_7Z_PATH%" set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
if not exist "%THE_7Z_PATH%" set "THE_7Z_PATH=%ProgramFiles%\7-Zip\7z.exe"
set "anArchName=freetype-%aFreeTypeVersion%-android"
set "aTarget=%~dp0work\%anArchName%"
if "%toPack%"=="1" (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%\libs" ( mkdir "%aTarget%\libs" )
if exist "%~dp0work/%anArchName%.7z" del "%~dp0work/%anArchName%.7z"
xcopy /S /Y /I "%~dp0work\android-armeabi-v7a-gcc\include\freetype2" "%aTarget%\include"
xcopy /Y "%~dp0work\android-armeabi-v7a-gcc\lib\*.so" "%aTarget%\libs\armeabi-v7a\"
xcopy /Y "%~dp0work\android-arm64-v8a-gcc\lib\*.so" "%aTarget%\libs\arm64-v8a\"
xcopy /Y "%~dp0work\android-x86-gcc\lib\*.so" "%aTarget%\libs\x86\"
xcopy /Y "%~dp0work\android-x86_64-gcc\lib\*.so" "%aTarget%\libs\x86_64\"
xcopy /Y "%aFreeTypeSrc%\README" "%aTarget%\"
xcopy /Y "%aFreeTypeSrc%\docs\FTL.TXT" "%aTarget%\"
xcopy /Y "%aFreeTypeSrc%\docs\GPLv2.TXT" "%aTarget%\"
xcopy /Y "%aFreeTypeSrc%\docs\LICENSE.TXT" "%aTarget%\"
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%~dp0work/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "anApi=%1"
set "anAbi=%2"
set "aPlatformAndCompiler=android-%anAbi%-gcc"
set "aWorkDir=work\%aPlatformAndCompiler%-make"
set "aLogFile=%~dp0build-%anAbi%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
pushd "%aWorkDir%"
set STARTTIME=%TIME%
echo Configuring OCCT for Android %anAbi% (API level %anApi%)...
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D ANDROID_NDK:FILEPATH="%anNdkPath%" ^
-D ANDROID_ABI:STRING="%anAbi%" ^
-D ANDROID_NATIVE_API_LEVEL:STRING="%anApi%" ^
-D ANDROID_STL:STRING="gnustl_shared" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D BUILD_SHARED_LIBS:BOOL="TRUE" ^
-D CMAKE_INSTALL_PREFIX:PATH="%~dp0work/%aPlatformAndCompiler%" ^
"%aFreeTypeSrc%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
mingw32-make clean
echo Building FreeType...
mingw32-make -j %aNbJobs% 2>> %aLogFile%
type %aLogFile%
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
echo Installing FreeType into %~dp0work/%aPlatformAndCompiler%...
mingw32-make install 2>> %aLogFile%
set ENDTIME=%TIME%
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%STARTTIME:~0,1%"==" " set "STARTTIME=%STARTTIME:~1%"
if "%ENDTIME:~0,1%"==" " set "ENDTIME=%ENDTIME:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%STARTTIME:~1,1%"==":" set "STARTTIME=0%STARTTIME%"
if "%ENDTIME:~1,1%"==":" set "ENDTIME=0%ENDTIME%"
rem convert hours:minutes:seconds:ms into duration
set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 + (1%STARTTIME:~9,2%-100)
set /A ENDTIME= (1%ENDTIME:~0,2%-100)*360000 + (1%ENDTIME:~3,2%-100)*6000 + (1%ENDTIME:~6,2%-100)*100 + (1%ENDTIME:~9,2%-100)
set /A DURATION=%ENDTIME%-%STARTTIME%
if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-%ENDTIME%
set /A DURATIONH=%DURATION% / 360000
set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% for %anAbi%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% >> %aLogFile%
popd
goto :eof

View File

@@ -1,103 +0,0 @@
#!/bin/bash
# Auxiliary script for building FreeType library for iOS platform.
aScriptDir=${BASH_SOURCE%/*}
if [ -d "$aScriptDir" ]; then cd "$aScriptDir"; fi
aScriptDir="$PWD"
aFreeType=freetype-2.10.4
aFreeTypeSrc=${aScriptDir}/${aFreeType}-src
PATH=/Applications/CMake.app/Contents/bin:$PATH
PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"
export IPHONEOS_DEPLOYMENT_TARGET=8.0
rm -r -f ${aFreeType}-ios
mkdir -p ${aFreeType}-ios/lib
rm -r -f ${aFreeType}-iPhoneSimulator
mkdir -p ${aFreeType}-iPhoneSimulator/lib
function buildArchCmake {
anAbi=$1
aPlatformSdk=$2
aSysRoot=$PLATFORMPATH/${aPlatformSdk}.platform/Developer/SDKs/${aPlatformSdk}.sdk
aPlatformAndCompiler=${aPlatformSdk}-${anAbi}-clang
aWorkDir="${aScriptDir}/${aFreeType}-${aPlatformAndCompiler}-make"
aDestDir="${aScriptDir}/${aFreeType}-${aPlatformAndCompiler}"
aLogFile="${aScriptDir}/${aFreeType}-build-${aPlatformAndCompiler}.log"
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
pushd ${aWorkDir}
cmake -G "Unix Makefiles" \
-D CMAKE_SYSTEM_NAME="iOS" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
-D CMAKE_OSX_SYSROOT:PATH="$aSysRoot" \
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D CMAKE_INSTALL_PREFIX:PATH="$aDestDir" \
-D BUILD_SHARED_LIBS:BOOL="OFF" \
-D FT_WITH_ZLIB:BOOL="OFF" \
-D FT_WITH_BZIP2:BOOL="OFF" \
-D FT_WITH_PNG:BOOL="OFF" \
-D FT_WITH_HARFBUZZ:BOOL="OFF" \
-D FT_WITH_BROTLI:BOOL="OFF" \
"$aFreeTypeSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
echo Building...
make 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make install
echo Installing into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
popd
}
buildArchCmake arm64 iPhoneOS
buildArchCmake arm64 iPhoneSimulator
buildArchCmake x86_64 iPhoneSimulator
aTargName=ios
cp -rf ./${aFreeType}-src/include ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/FTL.TXT ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/GPLv2.TXT ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/LICENSE.TXT ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/CHANGES ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/README ${aFreeType}-${aTargName}/
lipo -create -output ${aFreeType}-${aTargName}/lib/libfreetype.a ${aFreeType}-iPhoneOS-arm64-clang/lib/libfreetype.a
lipo -info ${aFreeType}-${aTargName}/lib/libfreetype.a
anArchName=${aFreeType}-${aTargName}.tar.bz2
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "./${aFreeType}-${aTargName}"
tar -jcf ${aScriptDir}/${anArchName} *
popd
aTargName=iPhoneSimulator
cp -rf ./${aFreeType}-src/include ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/FTL.TXT ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/GPLv2.TXT ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/LICENSE.TXT ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/CHANGES ${aFreeType}-${aTargName}/
cp ./${aFreeType}-src/docs/README ${aFreeType}-${aTargName}/
lipo -create -output ${aFreeType}-${aTargName}/lib/libfreetype.a ${aFreeType}-iPhoneSimulator-arm64-clang/lib/libfreetype.a ${aFreeType}-iPhoneSimulator-x86_64-clang/lib/libfreetype.a
lipo -info ${aFreeType}-${aTargName}/lib/libfreetype.a
anArchName=${aFreeType}-${aTargName}.tar.bz2
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "./${aFreeType}-${aTargName}"
tar -jcf ${aScriptDir}/${anArchName} *
popd

View File

@@ -1,50 +0,0 @@
#!/bin/bash
aFreeType=freetype-2.10.4
export MACOSX_DEPLOYMENT_TARGET=10.10
rm -r -f ${aFreeType}-macos
mkdir -p ${aFreeType}-macos/lib
function buildArch {
anArch=$1
pushd ./${aFreeType}-src
./configure CFLAGS="-mmacosx-version-min=10.10 -arch $anArch" LDFLAGS="-Wl,-install_name,@executable_path/../Frameworks/libfreetype.6.dylib" --enable-shared --enable-static
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
rm -r -f ../${aFreeType}-macos-$anArch
mkdir -p ../${aFreeType}-macos-$anArch/lib
cp -rf ./include ../${aFreeType}-macos-$anArch/
cp ./docs/FTL.TXT ../${aFreeType}-macos-$anArch/
cp ./docs/GPLv2.TXT ../${aFreeType}-macos-$anArch/
cp ./docs/LICENSE.TXT ../${aFreeType}-macos-$anArch/
cp ./docs/CHANGES ../${aFreeType}-macos-$anArch/
cp ./docs/README ../${aFreeType}-macos-$anArch/
cp ./objs/.libs/libfreetype.a ../${aFreeType}-macos-$anArch/lib/
cp ./objs/.libs/libfreetype.6.dylib ../${aFreeType}-macos-$anArch/lib/
cp ./objs/.libs/libfreetype.la ../${aFreeType}-macos-$anArch/lib/
#cp ./objs/.libs/libfreetype.dylib ../${aFreeType}-macos-$anArch/lib/
ln -s libfreetype.6.dylib ../${aFreeType}-macos-$anArch/lib/libfreetype.dylib
popd
}
for anArchIter in x86_64 arm64
do
buildArch $anArchIter
done
cp -rf ./${aFreeType}-src/include ${aFreeType}-macos/
cp ./${aFreeType}-src/docs/FTL.TXT ${aFreeType}-macos/
cp ./${aFreeType}-src/docs/GPLv2.TXT ${aFreeType}-macos/
cp ./${aFreeType}-src/docs/LICENSE.TXT ${aFreeType}-macos/
cp ./${aFreeType}-src/docs/CHANGES ${aFreeType}-macos/
cp ./${aFreeType}-src/docs/README ${aFreeType}-macos/
lipo -create -output ${aFreeType}-macos/lib/libfreetype.a ${aFreeType}-macos-x86_64/lib/libfreetype.a ${aFreeType}-macos-arm64/lib/libfreetype.a
lipo -create -output ${aFreeType}-macos/lib/libfreetype.6.dylib ${aFreeType}-macos-x86_64/lib/libfreetype.6.dylib ${aFreeType}-macos-arm64/lib/libfreetype.6.dylib
ln -s libfreetype.6.dylib ${aFreeType}-macos/lib/libfreetype.dylib
lipo -info ${aFreeType}-macos/lib/libfreetype.a
lipo -info ${aFreeType}-macos/lib/libfreetype.6.dylib

View File

@@ -20,13 +20,13 @@ export aRapidJson=
export aDraco=
# build stages to perform
export toSimulator=0
export isStatic=1
export toCMake=1
export toClean=1
export toMake=1
export toInstall=1
export toPack=0
export toPackFat=0
export toDebug=0
export BUILD_ModelingData=ON
@@ -41,13 +41,25 @@ export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export anAbi=arm64
#export anAbi=x86_64
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
export anAbiList="iPhoneOS|arm64"
if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
source "${aScriptDir}/ios_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
set -o pipefail
aBuildType="Release"
aBuildTypePrefix=
if [[ $toDebug == 1 ]]; then
@@ -58,59 +70,52 @@ aLibType="Shared"
if [[ $isStatic == 1 ]]; then
aLibType="Static"
fi
aPlatformAndCompiler=ios-${anAbi}${aBuildTypePrefix}-clang
aPlatformSdk="iphoneos"
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
if [[ $toSimulator == 1 ]]; then
#anAbi=x86_64
aPlatformAndCompiler=ios-simulator64-${anAbi}${aBuildTypePrefix}-clang
aPlatformSdk="iphonesimulator"
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
fi
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
function buildArch {
anAbi=$1
aPlatformSdk=$2
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
aPlatformAndCompiler=${aPlatformSdk}-${anAbi}${aBuildTypePrefix}-clang
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
set -o pipefail
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
}
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for iOS...
cmake -G "Unix Makefiles" \
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
fi
}
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/${aPlatformSdk}.platform/Developer/SDKs/${aPlatformSdk}.sdk"
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for iOS...
cmake -G "Unix Makefiles" \
-D CMAKE_SYSTEM_NAME="iOS" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
-D CMAKE_OSX_SYSROOT:PATH="$aSysRoot" \
-D ENABLE_VISIBILITY:BOOL="TRUE" \
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
@@ -145,57 +150,118 @@ if [[ $toCMake == 1 ]]; then
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
echo Platform: ${aPlatformSdk} ABI: ${anAbi} Build: ${aBuildType} IPHONEOS_DEPLOYMENT_TARGET: ${IPHONEOS_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
}
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
echo Platform: ${aPlatform} ABI: ${anArch} Build: ${aBuildType}
buildArch $anArch $aPlatform
done
# create a FAT archive
if [[ $toPackFat == 1 ]]; then
for aPlatIter in iPhoneOS iPhoneSimulator
do
aSuffixFat=${aPlatIter}${aBuildTypePrefix}-clang
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
# merge per-arch builds into fat builds
hasPlatform=0
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
if [[ $aPlatIter != ${aPlatform} ]]; then
continue
fi
aSuffixThin=${aPlatform}-${anArch}${aBuildTypePrefix}-clang
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
if [[ $hasPlatform == 0 ]]; then
hasPlatform=1
echo Packing FAT archive for platform: ${aPlatform}
rm -r -f "$aFatDir"
mkdir -p "$aFatDir"
rsync -r --exclude '*.a' "$anArchDir/" "$aFatDir"
rm -f "$aFatDir/build_target.txt"
for aLibIter in $anArchDir/lib/*.a; do
aLibName=`basename $aLibIter`
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
done
else
for aLibIter in $aFatDir/lib/*.a; do
aLibName=`basename $aLibIter`
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
#lipo -info "$aFatDir/lib/$aLibName"
done
fi
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
done
# create an archive
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
if [[ $aPlatIter != ${aPlatform} ]]; then
continue
fi
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aFatDir}/../${anArchName} &>/dev/null
pushd "$aFatDir"
tar -jcf ${aFatDir}/../${anArchName} *
popd
break
done
done
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd

View File

@@ -1,4 +1,4 @@
# environment configuration template for macos_build.sh (to be renamed as macos_custom_env.sh)
# environment configuration template for ios_build.sh (to be renamed as ios_custom_env.sh)
export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-ios"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-ios"
@@ -6,13 +6,13 @@ export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
# Uncomment to customize building steps
#export toSimulator=0
#export isStatic=0
#export toCMake=1
#export toClean=1
#export toMake=1
#export toInstall=1
#export toPack=0
#export toPackFat=1
#export toDebug=0
#export BUILD_ModelingData=ON
@@ -26,5 +26,5 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
#export USE_FREEIMAGE=ON
#export IPHONEOS_DEPLOYMENT_TARGET=8.0
#export anAbi=arm64
#export anAbi=x86_64
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
#export anAbiList="iPhoneOS|arm64"

View File

@@ -1,105 +0,0 @@
#!/bin/bash
# This is helpful script to perform building of liblzma for Android platform
# http://tukaani.org/xz/
anNdkRoot=/home/develop/android/android-ndk-r12b
anNdkArm32=/home/develop/android/android15-armv7a
anNdkArm64=/home/develop/android/android21-aarch64
anNdkx86=/home/develop/android/android15-x86
anNdkx86_64=/home/develop/android/android21-x86_64
#$anNdkRoot/build/tools/make-standalone-toolchain.sh --platform=android-15 --install-dir=$anNdkArm32 --ndk-dir=$anNdkRoot --toolchain=arm-linux-androideabi-4.9
#$anNdkRoot/build/tools/make-standalone-toolchain.sh --platform=android-21 --install-dir=$anNdkArm64 --ndk-dir=$anNdkRoot --toolchain=aarch64-linux-android-4.9
#$anNdkRoot/build/tools/make-standalone-toolchain.sh --platform=android-15 --install-dir=$anNdkx86 --ndk-dir=$anNdkRoot --toolchain=x86-4.9
#$anNdkRoot/build/tools/make-standalone-toolchain.sh --platform=android-21 --install-dir=$anNdkx86_64 --ndk-dir=$anNdkRoot --toolchain=x86_64-4.9
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then
cd "$aScriptPath"
fi
# define number of jobs from available CPU cores
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
set -o pipefail
aPathBak="$PATH"
anXzRoot="$PWD"
aCFlagsArmv7a="-O2 -march=armv7-a -mfloat-abi=softfp"
aCFlagsArmv8a="-O2 -march=armv8-a"
aCFlagsx86="-O2 -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32"
aCFlagsx86_64="-O2 -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel"
OUTPUT_FOLDER="$anXzRoot/install/liblzma-android"
rm -f -r "$OUTPUT_FOLDER"
mkdir -p "$OUTPUT_FOLDER/include"
mkdir -p "$OUTPUT_FOLDER/libs/armeabi-v7a"
mkdir -p "$OUTPUT_FOLDER/libs/x86"
mkdir -p "$OUTPUT_FOLDER/libs/arm64-v8a"
mkdir -p "$OUTPUT_FOLDER/libs/x86_64"
cp -f "$anXzRoot/COPYING" "$OUTPUT_FOLDER"
cp -f "$anXzRoot/README" "$OUTPUT_FOLDER"
cp -f "$anXzRoot/src/liblzma/api/lzma.h" "$OUTPUT_FOLDER/include"
cp -f -r "$anXzRoot/src/liblzma/api/lzma" "$OUTPUT_FOLDER/include"
echo "Output directory: $OUTPUT_FOLDER"
# armv7a
export "PATH=$anNdkArm32/bin:$aPathBak"
export "CC=arm-linux-androideabi-gcc"
export "CXX=arm-linux-androideabi-g++"
export "CFLAGS=$aCFlagsArmv7a"
export "CXXFLAGS=$aCFlagsArmv7a"
./configure --host arm-linux-androideabi 2>&1 | tee $OUTPUT_FOLDER/config-armv7a.log
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.so" "$OUTPUT_FOLDER/libs/armeabi-v7a"
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.a" "$OUTPUT_FOLDER/libs/armeabi-v7a"
# x86
export "PATH=$anNdkx86/bin:$aPathBak"
export "CC=i686-linux-android-gcc"
export "CXX=i686-linux-android-g++"
export "CFLAGS=$aCFlagsx86"
export "CXXFLAGS=$aCFlagsx86"
./configure --host i686-linux-android 2>&1 | tee $OUTPUT_FOLDER/config-x86.log
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.so" "$OUTPUT_FOLDER/libs/x86"
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.a" "$OUTPUT_FOLDER/libs/x86"
# armv8a
export "PATH=$anNdkArm64/bin:$aPathBak"
export "CC=aarch64-linux-android-gcc"
export "CXX=aarch64-linux-android-g++"
export "CFLAGS=$aCFlagsArmv8a"
export "CXXFLAGS=$aCFlagsArmv8a"
./configure --host aarch64-linux-android 2>&1 | tee $OUTPUT_FOLDER/config-aarch64.log
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.so" "$OUTPUT_FOLDER/libs/arm64-v8a"
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.a" "$OUTPUT_FOLDER/libs/arm64-v8a"
# x86_64
export "PATH=$anNdkx86_64/bin:$aPathBak"
export "CC=x86_64-linux-android-gcc"
export "CXX=x86_64-linux-android-g++"
export "CFLAGS=$aCFlagsx86_64"
export "CXXFLAGS=$aCFlagsx86_64"
./configure --host x86_64-linux-android 2>&1 | tee $OUTPUT_FOLDER/config-x86_64.log
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.so" "$OUTPUT_FOLDER/libs/x86_64"
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.a" "$OUTPUT_FOLDER/libs/x86_64"
export "PATH=$aPathBak"
rm $OUTPUT_FOLDER/../liblzma-android.7z &>/dev/null
7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $OUTPUT_FOLDER/../liblzma-android.7z $OUTPUT_FOLDER

View File

@@ -1,51 +0,0 @@
#!/bin/bash
# This is helpful script to perform building of liblzma for macOS platform
# http://tukaani.org/xz/
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then
cd "$aScriptPath"
fi
# define number of jobs from available CPU cores
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
set -o pipefail
anXzRoot="$PWD"
export MACOSX_DEPLOYMENT_TARGET=10.10
OUTPUT_FOLDER="$anXzRoot/work/liblzma-macos"
rm -f -r "$OUTPUT_FOLDER"
mkdir -p "$OUTPUT_FOLDER/include"
mkdir -p "$OUTPUT_FOLDER/lib"
cp -f "$anXzRoot/COPYING" "$OUTPUT_FOLDER"
cp -f "$anXzRoot/README" "$OUTPUT_FOLDER"
cp -f "$anXzRoot/src/liblzma/api/lzma.h" "$OUTPUT_FOLDER/include"
cp -f -r "$anXzRoot/src/liblzma/api/lzma" "$OUTPUT_FOLDER/include"
echo "Output directory: $OUTPUT_FOLDER"
# x86_64
./configure CFLAGS="-O2 -arch x86_64" CXXFLAGS="-O2 -arch x86_64" 2>&1 | tee $OUTPUT_FOLDER/config-x86_64.log
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
#cp -f "$anXzRoot/src/liblzma/.libs/liblzma.so" "$OUTPUT_FOLDER/libs/x86"
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.a" "$OUTPUT_FOLDER/lib/liblzma-x86_64.a"
# armv8a
./configure CFLAGS="-O2 -arch arm64" CXXFLAGS="-O2 -arch arm64" 2>&1 | tee $OUTPUT_FOLDER/config-arm64.log
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
#cp -f "$anXzRoot/src/liblzma/.libs/liblzma.so" "$OUTPUT_FOLDER/libs/arm64-v8a"
cp -f "$anXzRoot/src/liblzma/.libs/liblzma.a" "$OUTPUT_FOLDER/lib/liblzma-arm64.a"
lipo -create -output "$OUTPUT_FOLDER/lib/liblzma.a" "$OUTPUT_FOLDER/lib/liblzma-x86_64.a" "$OUTPUT_FOLDER/lib/liblzma-arm64.a"
lipo -info "$OUTPUT_FOLDER/lib/liblzma.a"
#rm $OUTPUT_FOLDER/../liblzma-macos.7z &>/dev/null
#7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $OUTPUT_FOLDER/../liblzma-macos.7z $OUTPUT_FOLDER

View File

@@ -20,11 +20,13 @@ export aRapidJson=
export aDraco=
# build stages to perform
export isStatic=0
export toCMake=1
export toClean=1
export toMake=1
export toInstall=1
export toPack=0
export toPackFat=0
export toDebug=0
export BUILD_ModelingData=ON
@@ -34,72 +36,92 @@ export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_Draw=ON
export USE_FREETYPE=ON
export USE_FREEIMAGE=ON
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbi=arm64
export anAbi=x86_64
#export anAbiList="arm64 x86_64"
export anAbiList="x86_64"
aPlatform="macos"
if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
source "${aScriptDir}/macos_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
set -o pipefail
aBuildType="Release"
aBuildTypePrefix=
if [[ $toDebug == 1 ]]; then
aBuildType="Debug"
aBuildTypePrefix="-debug"
fi
aPlatformAndCompiler=mac-${anAbi}${aBuildTypePrefix}-clang
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
aLibType="Shared"
aLibExt="dylib"
if [[ $isStatic == 1 ]]; then
aLibType="Static"
aLibExt="a"
fi
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
function buildArch {
anAbi=$1
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
aPlatformAndCompiler=${aPlatform}-${anAbi}${aBuildTypePrefix}-clang
pushd "$aWorkDir"
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
aTimeZERO=$SECONDS
set -o pipefail
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
}
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for macOS...
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="Shared" \
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for macOS...
cmake -G "Unix Makefiles" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
-D INSTALL_DIR:PATH="$aDestDir" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
@@ -125,57 +147,122 @@ if [[ $toCMake == 1 ]]; then
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building OCCT...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# build the project
if [[ $toMake == 1 ]]; then
echo Building OCCT...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
echo Platform: macOS ABI: ${anAbi} Build: ${aBuildType} MACOSX_DEPLOYMENT_TARGET: ${MACOSX_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd
}
for anArchIter in $anAbiList
do
echo Platform: macOS ABI: ${anArchIter} Build: ${aBuildType}
buildArch $anArchIter
done
# create a FAT archive
if [[ $toPackFat == 1 ]]; then
aSuffixFat=${aPlatform}${aBuildTypePrefix}-clang
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
# merge per-arch builds into fat builds
hasPlatform=0
for anArchIter in $anAbiList
do
aSuffixThin=${aPlatform}-${anArchIter}${aBuildTypePrefix}-clang
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
if [[ $hasPlatform == 0 ]]; then
hasPlatform=1
echo Packing FAT archive
rm -r -f "$aFatDir"
mkdir -p "$aFatDir"
if [[ $isStatic == 1 ]]; then
rsync -r -l --exclude '*.a' "$anArchDir/" "$aFatDir"
else
rsync -r -l --exclude '*.dylib' "$anArchDir/" "$aFatDir"
fi
rm -f "$aFatDir/build_target.txt"
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
rm $aFatDir/bin/$aDrawExe
lipo "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
fi
for aLibIter in $anArchDir/lib/*.$aLibExt; do
aLibName=`basename $aLibIter`
if [[ -L "$anArchDir/lib/$aLibName" ]]; then
cp -a "$anArchDir/lib/$aLibName" "$aFatDir/lib/"
else
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
fi
done
else
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
lipo "$aFatDir/bin/$aDrawExe" "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
fi
for aLibIter in $aFatDir/lib/*.$aLibExt; do
aLibName=`basename $aLibIter`
if [[ ! -L "$anArchDir/lib/$aLibName" ]]; then
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
#lipo -info "$aFatDir/lib/$aLibName"
fi
done
fi
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
done
# create an archive
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
rm ${aFatDir}/../${anArchName} &>/dev/null
pushd "$aFatDir"
tar -jcf ${aFatDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd

View File

@@ -12,6 +12,7 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
#export toMake=1
#export toInstall=1
#export toPack=1
#export toPackFat=1
#export BUILD_ModelingData=ON
#export BUILD_ModelingAlgorithms=ON
@@ -25,5 +26,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
#export USE_FREEIMAGE=ON
#export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbi=arm64
#export anAbi=x86_64
#export anAbiList=arm64
#export anAbiList=x86_64
#export anAbiList="arm64 x86_64"

View File

@@ -1,60 +0,0 @@
#!/bin/bash
# This is helpful script to perform building of Tcl for Android platform
# https://www.tcl.tk/software/tcltk/download.html
#$HOME/develop/android-ndk-r12b/build/tools/make-standalone-toolchain.sh --platform=android-15 --install-dir=$HOME/develop/android15-armv7a --ndk-dir=$HOME/develop/android-ndk-r12b --toolchain=arm-linux-androideabi-4.9
#$HOME/develop/android-ndk-r12b/build/tools/make-standalone-toolchain.sh --platform=android-21 --install-dir=$HOME/develop/android21-aarch64 --ndk-dir=$HOME/develop/android-ndk-r12b --toolchain=aarch64-linux-android-4.9
#$HOME/develop/android-ndk-r12b/build/tools/make-standalone-toolchain.sh --platform=android-15 --install-dir=$HOME/develop/android15-x86 --ndk-dir=$HOME/develop/android-ndk-r12b --toolchain=x86-4.9
ANDROID_ROOT="/home/develop/android"
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then
cd "$aScriptPath"
fi
# define number of jobs from available CPU cores
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
set -o pipefail
aPathBak="$PATH"
aTclRoot="$PWD"
OUTPUT_FOLDER="$aTclRoot/install/tcl-android"
rm -f -r "$OUTPUT_FOLDER"
mkdir -p "$OUTPUT_FOLDER"
cp -f "$aTclRoot/license.terms" "$OUTPUT_FOLDER"
cp -f "$aTclRoot/README.md" "$OUTPUT_FOLDER"
echo "Output directory: $OUTPUT_FOLDER"
set -o pipefail
function buildArch {
anAbi=$1
anArch=$2
aToolPath=$3
aCFlags=$4
export "PATH=$ANDROID_ROOT/$aToolPath/bin:$aPathBak"
export "CC=$anArch-gcc"
export "AR=$anArch-ar"
export "RANLIB=$anArch-ranlib"
export "CFLAGS=$aCFlags"
pushd "$aTclRoot/unix"
./configure --build x86_64-linux --host $anArch --prefix=${OUTPUT_FOLDER} --libdir=${OUTPUT_FOLDER}/libs/$anAbi --bindir=${OUTPUT_FOLDER}/bins/$anAbi 2>&1 | tee $OUTPUT_FOLDER/config-$anAbi.log
aResult=$?; if [[ $aResult != 0 ]]; then echo "FAILED configure $anAbi"; exit $aResult; fi
make clean
make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then echo "FAILED make $anAbi"; exit $aResult; fi
make install
popd
export "PATH=$aPathBak"
}
buildArch "arm64-v8a" "aarch64-linux-android" "android21-aarch64" "-O2 -march=armv8-a"
buildArch "armeabi-v7a" "arm-linux-androideabi" "android15-armv7a" "-O2 -march=armv7-a -mfloat-abi=softfp"
buildArch "x86" "i686-linux-android" "android15-x86" "-O2 -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32"
buildArch "x86_64" "x86_64-linux-android" "android21-x86_64" "-O2 -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel"
rm $OUTPUT_FOLDER/../tcl-android.7z &>/dev/null
7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $OUTPUT_FOLDER/../tcl-android.7z $OUTPUT_FOLDER

View File

@@ -1,46 +0,0 @@
#!/bin/bash
# This is helpful script to perform building of Tcl for WebAssembly platform
# https://www.tcl.tk/software/tcltk/download.html
EMSDK_ROOT="/home/develop/wasm/emsdk"
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}
if [ -d "$aScriptPath" ]; then
cd "$aScriptPath"
fi
# define number of jobs from available CPU cores
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
set -o pipefail
aPathBak="$PATH"
aTclRoot="$PWD"
OUTPUT_FOLDER="$aTclRoot/install/tcl-wasm32"
rm -f -r "$OUTPUT_FOLDER"
mkdir -p "$OUTPUT_FOLDER"
cp -f "$aTclRoot/license.terms" "$OUTPUT_FOLDER"
cp -f "$aTclRoot/README.md" "$OUTPUT_FOLDER"
echo "Output directory: $OUTPUT_FOLDER"
. "${EMSDK_ROOT}/emsdk_env.sh"
#export "PATH=$EMSDK_ROOT/upstream/bin:$aPathBak"
#export "CC=emcc"
#export "AR=llvm-ar"
#export "RANLIB=llvm-ranlib"
#export "CFLAGS=$aCFlags"
pushd "$aTclRoot/unix"
#./configure --build x86_64-linux --host wasm32 --prefix=${OUTPUT_FOLDER} 2>&1 | tee $OUTPUT_FOLDER/config-wasm32.log
emconfigure ./configure --prefix=${OUTPUT_FOLDER} --enable-shared=no 2>&1 | tee $OUTPUT_FOLDER/config-wasm32.log
aResult=$?; if [[ $aResult != 0 ]]; then echo "FAILED configure"; exit $aResult; fi
emmake make clean
emmake make -j$aNbJobs
aResult=$?; if [[ $aResult != 0 ]]; then echo "FAILED make"; exit $aResult; fi
emmake make install
popd
export "PATH=$aPathBak"
rm $OUTPUT_FOLDER/../tcl-wasm32.7z &>/dev/null
7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $OUTPUT_FOLDER/../tcl-wasm32.7z $OUTPUT_FOLDER

View File

@@ -22,6 +22,7 @@ samples/samples.md
samples/ocaf.md
samples/ocaf_func.md
samples/draw_scripts.md
samples/ais_object.md
samples/novice_guide.md
tutorial/tutorial.md

911
dox/samples/ais_object.md Normal file
View File

@@ -0,0 +1,911 @@
AIS: Custom Presentation {#tutorials__ais_object}
========
@tableofcontents
@section intro Getting Started
OCCT provides a strong set of built-in Interactive Objects for rapid application development,
but the real power and flexibility of **Application Interactive Services** (@c AIS) could be revealed by subclassing and implementing custom presentations.
In this tutorial we will focus on the development of a custom @c AIS_InteractiveObject and show the basics step by step.
Let's start from the very beginning and try subclassing @c AIS_InteractiveObject object:
~~~~{.cpp}
class MyAisObject : public AIS_InteractiveObject
{
DEFINE_STANDARD_RTTI_INLINE(MyAisObject, AIS_InteractiveObject)
public:
MyAisObject() {}
public:
virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode) override {}
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode) override {}
virtual bool AcceptDisplayMode (const Standard_Integer theMode) const override
{ return true; }
};
~~~~
@c DEFINE_STANDARD_RTTI_INLINE() macro will register the new class within the OCCT Run-Time Type Information (RTTI) system.
This step is optional (you may skip it if you are not going to use methods like @c Standard_Transient::DynamicType() in application code), but it is a common practice while subclassing OCCT classes.
The @c AIS_InteractiveObject interface defines only a couple of pure virtual methods - @c @::Compute() defining an object presentation and @c @::ComputeSelection() defining a selectable (pickable) volume.
Selection and presentation are two independent mechanisms in **AIS**. Presentation rendering is done with help of OpenGL or a similar low-level graphics library, while selection doesn't depend on a graphic driver at all.
Providing an empty implementation of these two methods would be enough for adding the object to @c AIS_InteractiveContext (@c @::Display()), but obviously nothing will appear on the screen.
@section prs_builders Presentation builders
To go ahead, we need to define some presentation of our object.
OCCT provides a set of presentation building tools for common elements like arrows, shapes, boxes, etc.
These tools could be found within @c Prs3d, @c StdPrs and @c DsgPrs packages:
- **Prs3d**
provides builders for simple geometric elements.
- @c Prs3d_Arrow, @c Prs3d_BndBox, @c Prs3d_Point, @c Prs3d_Text, @c Prs3d_ToolCylinder, @c Prs3d_ToolDisk, @c Prs3d_ToolSector, @c Prs3d_ToolSphere, @c Prs3d_ToolTorus
- **StdPrs**
provides builders for analytical geometry and B-Rep shapes (@c TopoDS_Shape).
- @c StdPrs_WFShape, @c StdPrs_ShadedShape, @c StdPrs_BRepTextBuilder
- **DsgPrs**
provides builders for datums, dimensions and relations.
Presentation builders are reusable bricks for constructing @c AIS objects.
Standard OCCT interactive objects highly rely on them, so that you may easily replicate @c AIS_Shape presentation for displaying a shape with just a couple of lines calling @c StdPrs_ShadedShape:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
}
...
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, true);
~~~~
@figure{ais_object_step1_shaded.png,"@c StdPrs_ShadedShape presentation builder.",409} height=409px
@c PrsMgr_PresentableObject::Compute() method takes three arguments:
- **Presentation Manager** (@c PrsMgr_PresentationManager).
Rarely used parameter, but might be necessary for some advanced use cases.
- **Presentation** (@c Prs3d_Presentation or @c Graphic3d_Structure).
Defines the structure to fill in with presentation elements.
- **Display Mode** (integer number).
Specifies the display mode to compute.
**0** is a default display mode, if not overridden by @c AIS_InteractiveObject::SetDisplayMode() or by @c AIS_InteractiveContext::Display().
For each supported display mode, the **Presentation Manager** creates a dedicated @c Prs3d_Presentation and stores it within the object itself as a list of presentations @c PrsMgr_PresentableObject::Presentations().
It is a good practice to reject unsupported display modes within @c @::Compute() method:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
if (theMode != 0) { return; } // reject non-zero display modes
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
}
~~~~
This wouldn't, however, prevent application from displaying the object with another display mode like this:
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, 100, -1, true);
~~~~
The code above will display @c MyAisObject with display mode equal to 100, and after @c @::Compute() modifications nothing will be displayed on the screen.
@c AIS will still create a presentation with specified display mode, but it will be empty - method @c @::AcceptDisplayMode() could be overridden to disallow even creation of an empty presentation:
~~~~{.cpp}
bool MyAisObject::AcceptDisplayMode (const Standard_Integer theMode) const
{
return theMode == 0; // reject non-zero display modes
}
~~~~
@c AIS_InteractiveContext::Display() checks if requested display mode is actually supported by the object, and uses default display mode (_**0**_) if it is not.
@c StdPrs_ShadedShape prepares a shaded (triangulated) presentation of a shape, while @c StdPrs_WFShape creates a wireframe presentation with B-Rep wire boundaries:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
if (!AcceptDisplayMode (theMode)) { return; }
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer); // add shading
StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
}
~~~~
@figure{ais_object_step1_shaded_wf.png,"Result of @c StdPrs_ShadedShape + @c StdPrs_WFShape presentation builders.",409} height=409px
Presentation builders take the @c Prs3d_Drawer object defining various attributes - material of shaded shape, number of isolines in wireframe mode, tessellation quality, line colors and many others.
@c PrsMgr_PresentableObject defines @c myDrawer property with default attributes.
@c StdPrs makes it easy to display topological shapes.
With the help of @c Prs3d tools we may display elements like arrows, boxes or text labels.
Let's extend our presentation with a second **display mode 1** showing a bounding box using @c Prs3d_BndBox builder:
~~~~{.cpp}
bool MyAisObject::AcceptDisplayMode (const Standard_Integer theMode) const
{
return theMode == 0 || theMode == 1;
}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
if (theMode == 0)
{
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
}
else if (theMode == 1)
{
Bnd_Box aBox;
BRepBndLib::Add (aShape, aBox);
Prs3d_BndBox::Add (thePrs, aBox, myDrawer);
}
}
~~~~
Now, displaying an object with **display mode 1** will show a box:
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, 1, 0, true);
~~~~
@figure{ais_object_step1_bndbox.png,"@c Prs3d_BndBox presentation builder.",409} height=409px
@c AIS disallows activating multiple display modes at the same time, so that these presentation modes should be alternatives to each other.
But @c AIS may use non-active display mode for highlighting purposes - like wireframe (@c AIS_Wireframe) presentation displayed on top of shaded (@c AIS_Shaded) presentation for selected @c AIS_Shape objects.
Let's define a dedicated enumeration for display modes supported by our interactive object and setup the 1st (@c MyDispMode_Highlight) display mode for highlighting with help of @c PrsMgr_PresentableObject::SetHilightMode():
~~~~{.cpp}
class MyAisObject : public AIS_InteractiveObject
{
public:
enum MyDispMode { MyDispMode_Main = 0, MyDispMode_Highlight = 1 };
...
MyAisObject::MyAisObject()
{
SetDisplayMode (MyDispMode_Main); // main (active) display mode
SetHilightMode (MyDispMode_Highlight); // auxiliary (highlighting) mode
}
...
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
theCtx->HilightWithColor (aPrs, aPrs->HilightAttributes(), false);
theCtx->CurrentViewer()->Redraw();
~~~~
@figure{ais_object_step1_highlight.png,"Highlighting by color (left) and highlighting by another display mode (right).",818} height=409px
In this particular use case we've used the method @c AIS_InteractiveContext::HilightWithColor() instead of @c @::SetSelected() - just because our object is not selectable yet and @c @::SetSelected() wouldn't work.
Highlighted presentation appears on the screen with modulated color (see left screenshot above).
Using a dedicated display mode for highlighting (right screenshot above) allows customizing presentation in selected / highlighted states.
@section prim_arrays Primitive arrays
@c Prs3d_Presentation might be filled in by the following **primitives**:
- **Triangles**
- @c Graphic3d_ArrayOfTriangles
- @c Graphic3d_ArrayOfTriangleFans
- @c Graphic3d_ArrayOfTriangleStrips
- **Lines**
- @c Graphic3d_ArrayOfSegments
- @c Graphic3d_ArrayOfPolylines
- **Points** or **Markers**
- @c Graphic3d_ArrayOfPoints
This triplet of primitives is what graphics hardware is capable of rendering, so that it could be transferred directly to low-level graphics libraries in the form of *Vertex Buffer Objects* (VBO).
Each **primitive array** consists of an array of vertex attributes (_**position**, **normal**, **texture coordinates**, **vertex colors**_, etc.) and optional **array of indices**.
The latter one avoids duplicating vertices shared between connected elements (triangles, polylines) in attributes array.
@c Graphic3d_ArrayOfPrimitives and it's subclasses provide a convenient interface for filling in primitive arrays:
- Constructor takes a number of vertices, number of edges (indices) and a bitmask of optional vertex attributes.
- @c Graphic3d_ArrayOfPrimitives::AddVertex() appends a vertex with specified attributes to the end of the array (within the range specified at construction time).
- @c Graphic3d_ArrayOfPrimitives::AddEdges() appends indices, starting with 1.
Each line segment is defined by two consequential edges, each triangle is defined by three consequential edges.
Let's extend our sample and display a cylinder section contour defined by array of indexed segments (e.g. a polyline of four vertices):
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
if (theMode == MyDispMode_Main)
{
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
//StdPrs_WFShape::Add (thePrs, aShape, myDrawer);
Handle(Graphic3d_ArrayOfSegments) aSegs = new Graphic3d_ArrayOfSegments (4, 4 * 2, Graphic3d_ArrayFlags_None);
aSegs->AddVertex (gp_Pnt (0.0, -aRadius, 0.0));
aSegs->AddVertex (gp_Pnt (0.0, -aRadius, aHeight));
aSegs->AddVertex (gp_Pnt (0.0, aRadius, aHeight));
aSegs->AddVertex (gp_Pnt (0.0, aRadius, 0.0));
aSegs->AddEdges (1, 2);
aSegs->AddEdges (2, 3);
aSegs->AddEdges (3, 4);
aSegs->AddEdges (4, 1);
Handle(Graphic3d_Group) aGroupSegs = thePrs->NewGroup();
aGroupSegs->SetGroupPrimitivesAspect (myDrawer->WireAspect()->Aspect());
aGroupSegs->AddPrimitiveArray (aSegs);
}
else if (theMode == MyDispMode_Highlight) { ... }
}
~~~~
@figure{ais_object_step2_segments.png,"Displaying @c Graphic3d_ArrayOfSegments.",409} height=409px
The process is quite straightforward:
- Create a new @c Graphic3d_Group using @c Prs3d_Presentation::NewGroup();
- Specify presentation aspects using @c Graphic3d_Group::SetGroupPrimitivesAspect();
- Create and add an array of primitives using @c Graphic3d_Group::AddPrimitiveArray().
Standard presentation builders like @c StdPrs_ShadedShape / @c StdPrs_WFShape internally do exactly the same thing - a tessellated representation of a shape is added to presentation in form of triangles (shaded),
line segments (wireframe and free edges) and markers (free shape vertices).
A single @c Graphic3d_Group normally defines just a single primitive array, but it is technically possible adding more arrays to the same group @c Graphic3d_Group::AddPrimitiveArray()
and with different aspects @c Graphic3d_Group::SetPrimitivesAspect(), which might be considered in advanced scenarios.
Method @c Graphic3d_Group::AddText() allows adding text labels to a presentation.
Internally, text labels are rendered as an array of textured triangles using texture atlas created from a font, but this complex logic is hidden from the user.
@section prim_aspects Primitive aspects
@c Graphic3d_Aspects is a class defining **display properties** of a primitive array (@c Graphic3d_Group::SetGroupPrimitivesAspect()) -
_**material**, **shading model**, **color**, **texture maps**, **blending mode**, **line width**_ and others.
There are also subclasses @c Graphic3d_AspectFillArea3d (triangles), @c Graphic3d_AspectLine3d (lines), @c Graphic3d_AspectMarker3d (markers)
and @c Graphic3d_AspectText3d (text labels) defined as specializations for a specific primitive array type.
These subclasses exist for historical reasons and are treated by renderers in exactly the same way.
It is technically possible to create transient aspects directly within @c @::Compute() method like this:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
Handle(Graphic3d_Aspects) anAspects = new Graphic3d_Aspects();
anAspects->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
anAspects->SetColor (Quantity_NOC_RED);
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (anAspects);
...
}
~~~~
While this code would work as expected, but prevents further dynamic updates of presentation aspects without recomputing entire presentation.
Instead, it is preferred taking attributes from @c PrsMgr_PresentableObject::myDrawer / @c @::Attributes() or storing custom attributes as class fields.
@c Prs3d_Drawer defines a set of attributes used by @c AIS presentation builders, but the same parameters might be used by a custom builder as well.
It is also preferred preallocating attributes in the class constructor.
This would allow changing attributes without recomputing the entire presentation - just by calling @c PrsMgr_PresentableObject::SynchronizeAspects() after modifications.
Our custom object uses @c myDrawer->ShadingAspect() and @c myDrawer->WireAspect() aspects, so let's initialize them explicitly - assign silver material for shading and green color to line segments:
~~~~{.cpp}
MyAisObject::MyAisObject()
{
SetHilightMode (MyDispMode_Highlight);
myDrawer->SetupOwnShadingAspect();
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Silver);
myDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 2.0));
}
~~~~
@section quadric_builders Quadric builders
Previously, we've used @c StdPrs_ShadedShape for displaying cylinder geometry.
The @c Prs3d package provides a simpler way for displaying geometry like cylinders, spheres and toruses - based on the @c Prs3d_ToolQuadric interface.
This interface allows bypassing creation of a complex B-Rep (@c TopoDS_Shape) definition of a simple geometry, and to avoid using general-purpose tessellators like @c BRepMesh.
> This difference could be negligible for a small number of such objects, but might become considerable for larger amounts.
> The B-Rep definition of a valid cylinder includes 2 unique @c TopoDS_Vertex, 3 @c TopoDS_Edge, 3 @c TopoDS_Wire, 3 @c TopoDS_Face, 1 @c TopoDS_Shell and 1 @c TopoDS_Solid.
> Internally each @c TopoDS_Edge also defines curves (@c Geom_Curve as well as 2D parametric @c Geom2d_Curve) and each @c TopoDS_Face defines analytical surface (@c Geom_Surface).
> Meshing such geometry with the help of @c BRepMesh is much more complicated than one may think.
> A plenty of data structures (memory!) and computations (time!) for displaying a geometry that could be triangulated by a simple for loop.
@c Prs3d_ToolQuadric solves this problem by creating a triangulation for such kinds of shapes in a straight-forward way.
Let's try using @c Prs3d_ToolCylinder in our sample:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
if (theMode == MyDispMode_Main)
{
//StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer); // add shading
//StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 10, 10, gp_Trsf());
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroupTris->AddPrimitiveArray (aTris);
...
}
...
}
~~~~
@figure{ais_object_step3_quadrics_10.png,"@c Prs3d_ToolCylinder (10 slices).",409} height=409px
Well... that looks a little bit edgy.
Quadric builder creates a triangulation taking the following parameters:
- Geometry parameters.
(in case of a cylinder - base radius, top radius and height).
- Number of subdivisions along U (slices) and V (stacks) parameters.
In some cases only one parametric scope matters.
- Transformation @c gp_Trsf to apply
(original geometry is defined within some reference coordinate system).
Let's increase number of subdivisions from _10_ to _25_:
~~~~{.cpp}
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 25, 25, gp_Trsf());
~~~~
@figure{ais_object_step3_quadrics_25.png,"@c Prs3d_ToolCylinder (25 slices).",409} height=409px
It looks much better now! Note that @c Prs3d_ToolCylinder could be used for building both cones and cylinders depending on top/bottom radius definition.
There is one issue though - our cylinder doesn't have top and bottom anymore!
To fix this problem we will use one more quadric builder @c Prs3d_ToolDisk:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
if (theMode == MyDispMode_Main)
{
Prs3d_ToolCylinder aCyl (aRadius, aRadius, aHeight, 25, 25);
Prs3d_ToolDisk aDisk (0.0, aRadius, 25, 1);
Handle(Graphic3d_ArrayOfTriangles) aTris =
new Graphic3d_ArrayOfTriangles (aCyl.VerticesNb() + 2 * aDisk.VerticesNb(),
3 * (aCyl.TrianglesNb() + 2 * aDisk.TrianglesNb()),
Graphic3d_ArrayFlags_VertexNormal);
aCyl .FillArray (aTris, gp_Trsf());
aDisk.FillArray (aTris, gp_Trsf());
gp_Trsf aDisk2Trsf;
aDisk2Trsf.SetTransformation (gp_Ax3 (gp_Pnt (0.0, 0.0, aHeight), -gp::DZ(), gp::DX()), gp::XOY());
aDisk.FillArray (aTris, aDisk2Trsf);
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroupTris->AddPrimitiveArray (aTris);
aGroupTris->SetClosed (true);
...
}
}
~~~~
Now our cylinder looks solid! The sample above merges two triangulations into a single one instead of appending each primitive array individually.
This looks like a minor difference, but it might have a _dramatic impact on performance_ in case of a large scene,
as each `Graphic3d_ArrayOfPrimitives` is mapped into a dedicated draw call at graphic driver (OpenGL) level.
@figure{ais_object_step3_quadrics_fin.png,"@c Prs3d_ToolCylinder + @c Prs3d_ToolDisk.",409} height=409px
As an exercise, let's try computing a triangulation for cylinder disk without help of @c Prs3d_ToolDisk builder:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
if (theMode == MyDispMode_Main)
{
const int aNbSlices = 25;
Prs3d_ToolCylinder aCyl (aRadius, aRadius, aHeight, aNbSlices, aNbSlices);
Handle(Graphic3d_ArrayOfTriangles) aTris =
new Graphic3d_ArrayOfTriangles (aCyl.VerticesNb(),
3 * (aCyl.TrianglesNb()),
Graphic3d_ArrayFlags_VertexNormal);
aCyl.FillArray (aTris, gp_Trsf());
Handle(Graphic3d_ArrayOfTriangles) aTris2 =
new Graphic3d_ArrayOfTriangles (aNbSlices + 1, aNbSlices * 3, Graphic3d_ArrayFlags_VertexNormal);
aTris2->AddVertex (gp_Pnt (0.0, 0.0, aHeight), -gp::DZ());
for (int aSliceIter = 0; aSliceIter < aNbSlices; ++aSliceIter)
{
double anAngle = M_PI * 2.0 * double(aSliceIter) / double(aNbSlices);
aTris2->AddVertex (gp_Pnt (Cos (anAngle) * aRadius, Sin (anAngle) * aRadius, aHeight), -gp::DZ());
}
for (int aSliceIter = 0; aSliceIter < aNbSlices; ++aSliceIter)
{
aTris2->AddEdges (1, aSliceIter + 2, aSliceIter + 1 < aNbSlices ? (aSliceIter + 3) : 2);
}
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroupTris->AddPrimitiveArray (aTris);
aGroupTris->AddPrimitiveArray (aTris2);
...
}
}
~~~~
@figure{ais_object_step3_quadrics_disk.png,"Manually triangulated disk.",409} height=409px
The disk is here, but it has a strange color - like it is not affected by lighting.
This happens when vertex normals are defined incorrectly.
In our case we defined disk normal as @c -DZ (see the second argument of @c Graphic3d_ArrayOfTriangles::AddVertex()),
but normal direction should be also aligned to triangulation winding rule.
Graphic driver defines the front side of triangle using clockwise order of triangle nodes, and normal should be defined for a front side of triangle - e.g. it should be @c gp::DZ() in our case.
After reversing vertex normal direction, cylinder looks exactly like when @c Prs3d_ToolDisk was used.
Front / back face orientation might be displayed using different material based on @c Graphic3d_Aspects::SetDistinguish() flag and @c @::FrontMaterial() / @c @::BackMaterial() setup.
@section ais_selection Computing selection
In the first part of the tutorial we have created a custom @c AIS object @c MyAisObject computing presentation by implementing the @c PrsMgr_PresentableObject::Compute() interface.
In this part we will extend our object with interactive capabilities and make it selectable through implementing @c SelectMgr_SelectableObject interface.
Let's do the first step and put into @c @::ComputeSelection() method some logic.
This method should fill in the @c SelectMgr_Selection argument with @c SelectMgr_SensitiveEntity entities defining selectable elements - triangulations, polylines, points and their composition.
@c Select3D_SensitiveBox is probably the simplest way to define selectable volume - by it's bounding box:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
Bnd_Box aBox;
BRepBndLib::Add (aShape, aBox);
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
Handle(Select3D_SensitiveBox) aSensBox = new Select3D_SensitiveBox (anOwner, aBox);
theSel->Add (aSensBox);
}
~~~~
@c SelectMgr_EntityOwner is a key object in selection logic - it serves as an identifier of a pickable object or it's part.
You may see this object in methods like @c AIS_InteractiveContext::DetectedOwner(), **Owners** are stored within the list of selection objects @c AIS_Selection
and it received by methods like @c AIS_InteractiveContext::SetSelected() and @c AIS_InteractiveContext::AddOrRemoveSelected().
From the Selector's point of view, @c AIS_InteractiveObject is just a drawer for @c SelectMgr_EntityOwner.
The _**0th selection mode**_ normally defines a single Owner of the entire object.
To make a composite object selectable as whole, we add to Selection as many SensitiveEntity as necessary referring to the same Owner.
It might look confusing from first glance, that @c SelectMgr_SensitiveEntity stores @c SelectMgr_EntityOwner as a class field, and not in the opposite way
(@c SelectMgr_EntityOwner doesn't store the list of @c SelectMgr_SensitiveEntity defining it's picking volume).
For local selection (selection of object parts) we create individual Owners for each part and add SensitiveEntity to Selection in the same way.
Owner may store an additional identifier as a class field, like @c StdSelect_BRepOwner stores @c TopoDS_Shape as an identifier of picked sub-shape with @c AIS_Shape object.
In a similar way as @c StdPrs_ShadedShape is a **presentation builder** for @c TopoDS_Shape, the @c StdSelect_BRepSelectionTool can be seen as a standard **selection builder** for shapes:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
Standard_Real aDefl = StdPrs_ToolTriangulatedShape::GetDeflection (aShape, myDrawer);
StdSelect_BRepSelectionTool::Load (theSel, this, aShape, TopAbs_SHAPE, aDefl,
myDrawer->DeviationAngle(),
myDrawer->IsAutoTriangulation());
}
~~~~
Internally, @c StdSelect_BRepSelectionTool iterates over sub-shapes and appends to the Selection (@c theSel) entities like @c Select3D_SensitiveTriangulation (for faces) and @c Select3D_SensitiveCurve (for edges).
Previously, we have used @c Prs3d_ToolCylinder to triangulate a cylinder, so let's try to construct @c Select3D_SensitivePrimitiveArray from the same triangulation:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 25, 25, gp_Trsf());
Handle(Select3D_SensitivePrimitiveArray) aSensTri =
new Select3D_SensitivePrimitiveArray (anOwner);
aSensTri->InitTriangulation (aTris->Attributes(), aTris->Indices(),
TopLoc_Location());
theSel->Add (aSensTri);
}
~~~~
Selection is computed independently from presentation, so that they don't have to match each other.
But inconsistency between presentation and selection might confuse a user, when he will not be able to pick an object clearly displayed under the mouse cursor.
These issues might happen, for example, when selection uses tessellated representation of the same geometry computed with different parameters (different number of subdivisions, or different deflection parameters).
As in case of @c @::Compute(), it makes sense defining some enumeration of **selection modes** supported by specific object and reject unsupported ones to avoid unexpected behavior:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
if (theMode != 0) { return; }
...
}
~~~~
Unlike display modes, @c AIS_InteractiveContext allows activating an arbitrary combination of selection modes.
A user should be careful to activate only the modes that actually make sense and may work together.
Selection mode to activate could be specified while displaying the object (passing _**-1**_ instead of _**0**_ would display an object with deactivated selection):
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
~~~~
Later on @c AIS_InteractiveContext::SetSelectionModeActive(), or it's wrappers @c AIS_InteractiveContext::Activate() and @c AIS_InteractiveContext::Deactivate(),
could be used to enable or disable desired selection modes one by one.
@section sel_owner_highlight Highlighting selection owner
As has been mentioned in the previous section, @c SelectMgr_EntityOwner is a key object which can be used as an identifier of selectable part(s).
Naturally, you might want to subclass it to put some application-specific ids for identification of selected parts.
But there are more things you may do with the Owner class like customized highlighting.
Let's start from the beginning and define a custom Owner class:
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
DEFINE_STANDARD_RTTI_INLINE(MyAisOwner, SelectMgr_EntityOwner)
public:
MyAisOwner (const Handle(MyAisObject)& theObj, int thePriority = 0)
: SelectMgr_EntityOwner (theObj, thePriority) {}
virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode) override
{ base_type::HilightWithColor (thePrsMgr, theStyle, theMode); }
virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Standard_Integer theMode) override
{ base_type::Unhilight (thePrsMgr, theMode); }
protected:
Handle(Prs3d_Presentation) myPrs;
};
~~~~
@c SelectMgr_EntityOwner doesn't define any pure virtual methods, and can be instanced straight ahead, like it was done within @c MyAisObject::ComputeSelection() implementation above.
Let's revert usage of a dedicated display mode for highlighting (remove @c SetHilightMode() in @c MyAisObject constructor) and use our new class @c MyAisOwner within @c @::ComputeSelection():
~~~~{.cpp}
MyAisObject::MyAisObject()
{
//SetHilightMode (MyDispMode_Highlight);
myDrawer->SetupOwnShadingAspect();
...
}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
Handle(MyAisOwner) anOwner = new MyAisOwner (this);
...
}
~~~~
The further logic creating sensitive entities and filling in Selection could be left as is.
Substitution of @c SelectMgr_EntityOwner with @c MyAisOwner currently doesn't change behavior and we see highlighting of the entire object through color modulation.
This is because default implementation of @c SelectMgr_EntityOwner for highlighting logic looks like this (simplified):
~~~~{.cpp}
void SelectMgr_EntityOwner::HilightWithColor (
const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
const Graphic3d_ZLayerId aHiLayer =
theStyle->ZLayer() != Graphic3d_ZLayerId_UNKNOWN
? theStyle->ZLayer()
: mySelectable->ZLayer();
thePrsMgr->Color (mySelectable, theStyle, theMode, NULL, aHiLayer);
}
~~~~
@figure{ais_object_step4_highlight1.png,"Default behavior of @c SelectMgr_EntityOwner::HilightWithColor().",409} height=409px
Now, let's override the @c SelectMgr_EntityOwner::HilightWithColor() method and display a bounding box presentation:
~~~~{.cpp}
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
if (myPrs.IsNull())
{
myPrs = new Prs3d_Presentation (thePrsMgr->StructureManager());
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
anObj->Compute (thePrsMgr, myPrs, MyAisObject::MyDispMode_Highlight);
}
if (!thePrsMgr->IsImmediateModeOn())
{
myPrs->Display();
}
}
~~~~
@c SelectMgr_EntityOwner::HilightWithColor() doesn't receive a presentation to fill in as an argument; highlight presentation should be manually created and even explicitly displayed on the screen.
To avoid code duplication, the code above reuses @c MyAisObject::Compute() already implementing computation of highlight presentation.
@figure{ais_object_step4_highlight2.png,"Result of custom implementation @c MyAisOwner::HilightWithColor().",409} height=409px
The visual result of the selected object looks exactly the same as when we've used a dedicated highlight mode.
One thing became broken, though - highlighting remains displayed even after clearing selection.
To fix this issue, we need implementing @c SelectMgr_EntityOwner::Unhilight() and hide our custom presentation explicitly:
~~~~{.cpp}
void MyAisOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Standard_Integer theMode)
{
if (!myPrs.IsNull()) { myPrs->Erase(); }
}
~~~~
Another problem is that the object is no longer dynamically highlighted.
To fix that we need to handle @c PrsMgr_PresentationManager::IsImmediateModeOn() specifically.
Within this mode turned ON, presentation should be displayed on the screen with help of @c PrsMgr_PresentationManager::AddToImmediateList() method
(it will be cleared from the screen automatically on the next mouse movement):
~~~~{.cpp}
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
if (myPrs.IsNull())
{
myPrs = new Prs3d_Presentation (thePrsMgr->StructureManager());
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
anObj->Compute (thePrsMgr, myPrs, MyAisObject::MyDispMode_Highlight);
}
if (thePrsMgr->IsImmediateModeOn())
{
Handle(Prs3d_PresentationShadow) aShadow =
new Prs3d_PresentationShadow (thePrsMgr->StructureManager(), myPrs);
aShadow->SetZLayer (Graphic3d_ZLayerId_Top);
aShadow->Highlight (theStyle);
thePrsMgr->AddToImmediateList (aShadow);
}
else
{
myPrs->Display();
}
}
~~~~
We may create two dedicated presentations for dynamic highlighting or reuse existing one for both cases with help of a transient object @c Prs3d_PresentationShadow.
Let's go further and make dynamic highlighting a little bit more interesting - by drawing a surface normal at the point where mouse picked the object:
~~~~{.cpp}
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
if (thePrsMgr->IsImmediateModeOn())
{
Handle(StdSelect_ViewerSelector) aSelector =
anObj->InteractiveContext()->MainSelector();
SelectMgr_SortCriterion aPickPnt;
for (int aPickIter = 1; aPickIter <= aSelector->NbPicked(); ++aPickIter)
{
if (aSelector->Picked (aPickIter) == this)
{
aPickPnt = aSelector->PickedData (aPickIter);
break;
}
}
Handle(Prs3d_Presentation) aPrs = mySelectable->GetHilightPresentation (thePrsMgr);
aPrs->SetZLayer (Graphic3d_ZLayerId_Top);
aPrs->Clear();
Handle(Graphic3d_Group) aGroup = aPrs->NewGroup();
aGroupPnt->SetGroupPrimitivesAspect (theStyle->ArrowAspect()->Aspect());
gp_Trsf aTrsfInv = mySelectable->LocalTransformation().Inverted();
gp_Dir aNorm (aPickPnt.Normal.x(), aPickPnt.Normal.y(), aPickPnt.Normal.z());
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_Arrow::DrawShaded (gp_Ax1(aPickPnt.Point, aNorm).Transformed (aTrsfInv),
1.0, 15.0,
3.0, 4.0, 10);
aGroupPnt->AddPrimitiveArray (aTris);
thePrsMgr->AddToImmediateList (aPrs);
}
}
~~~~
Code above does not store our new highlight presentation as a property of @c MyAisOwner, and instead uses @c SelectMgr_SelectableObject::GetHilightPresentation() method
to create a presentation stored directly inside of our interactive object.
Next trick is passing through the last picking results in @c StdSelect_ViewerSelector.
Dynamic highlighting is expected to be called right after picking, so that highlighted Owner should be always found in picking results.
@c StdSelect_ViewerSelector::Picked() returns entities in the descending order of their distance from picking ray origin (mouse cursor);
normally our Owner should be the very first one in this list when no selection filters are assigned to @c AIS_InteractiveContext.
@c SelectMgr_SortCriterion provides us useful information like 3D point on detected object lying on the picking ray, and surface normal direction at this point (actually, it would be a normal to a picked triangle),
which we display as an arrow with help of @c Prs3d_Arrow presentation builder.
@figure{ais_object_step4_highlight3.png,"Surface normal on mouse over.",409} height=409px
Result looks pretty nice on the screenshot, but has interaction problems - once displayed, an arrow is no longer updated with further mouse movements.
But this behavior is not a bug - @c AIS calls @c MyAisOwner::HilightWithColor() only when picking Owner changes to avoid unnecessary Viewer updates.
To override this behavior, we may override @c SelectMgr_EntityOwner::IsForcedHilight() option:
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
...
virtual bool IsForcedHilight() const override { return true; }
};
~~~~
This solves the problem within our specific use case.
Keep in mind that most objects don't need updating highlight presentation on every mouse move;
overriding this flag everywhere would be a waste of resources and may cause performance issues - use it sparingly.
@section highlight_apporaches Highlighting approaches
@c AIS provides one more alternative to handle presentation highlighting, which is managed by option @c SelectMgr_SelectableObject::IsAutoHilight().
By default, this option is turned ON and redirects highlighting logic to @c SelectMgr_EntityOwner::HilightWithColor() demonstrated in the previous section.
Turning this option OFF redirects highlighting logic to the interactive object itself @c SelectMgr_SelectableObject::HilightSelected().
Apart from moving the logic from Owner to Interactive Object, this approach allows handling highlighting of all selected Owners within the same Object at once and sharing a common presentation
instead of per-Owner presentation - improving performance and reducing memory utilization in case of a large number of small selectable elements, like mesh nodes in @c MeshVS_Mesh object.
The further optimization of such a scenario would be using a single Owner for the entire Object
storing the list of selected elements within the Owner itself - as utilized by @c AIS_PointCloud object for highlighting individual points.
We wouldn't describe these advanced techniques here in detail - let's just summarize main highlighting approaches available in @c AIS:
- Highlighting of a main presentation of Interactive Object (active display mode)
filled in by @c PrsMgr_PresentableObject::Compute()
and displayed with color modulation by @c AIS logic.
- Example: @c AIS_TextLabel.
- Highlighting of a secondary presentation of Interactive Object
filled in by @c PrsMgr_PresentableObject::Compute()
and displayed with color modulation by @c AIS logic.
- Example: @c AIS_Shape, displayed in @c AIS_Shaded display mode and highlighted using @c AIS_Wireframe display mode (default behavior).
See also @c PrsMgr_PresentableObject::SetHilightMode().
- Highlight presentation stored within a custom @c SelectMgr_EntityOwner
and managed by @c SelectMgr_EntityOwner::HilightWithColor().
- Example: @c StdSelect_BRepOwner for selection of sub-shapes.
- Custom highlight presentation stored within Interactive Object itself
(see @c SelectMgr_SelectableObject::GetHilightPresentation() / @c @::GetSelectPresentation() methods).
- Filled in by @c SelectMgr_EntityOwner::HilightWithColor()
with @c SelectMgr_SelectableObject::IsAutoHilight() turned ON.<br>
Example: @c AIS_PointCloud.
- Filled in by @c SelectMgr_SelectableObject::HilightSelected()
with @c SelectMgr_SelectableObject::IsAutoHilight() turned OFF.<br>
Example: @c MeshVS_Mesh.
- Main presentation of Interactive Object (active display mode)
filled in by @c PrsMgr_PresentableObject::Compute()
and manually updated (recomputed or modified aspects) on highlight events.
- Example: @c AIS_Manipulator.
The number of options looks overwhelming but in general, it is better to stick to the simplest approach working for you and consider alternatives only when you have to.
@section mouse_click Mouse click
Dynamic highlighting is only one of scenarios where @c SelectMgr_EntityOwner could be useful.
Another feature is an interface for handling a mouse click @c SelectMgr_EntityOwner @c @::HandleMouseClick().
This interface is useful for defining some user interface elements like buttons, and most likely your application will use a more comprehensive GUI framework for this purpose instead of @c AIS.
But let's have some fun and make our object to change a color on each mouse click:
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
...
virtual bool HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick) override;
};
bool MyAisOwner::HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick)
{
static math_BullardGenerator aRandGen;
Quantity_Color aRandColor (float(aRandGen.NextInt() % 256) / 255.0f,
float(aRandGen.NextInt() % 256) / 255.0f,
float(aRandGen.NextInt() % 256) / 255.0f,
Quantity_TOC_sRGB);
mySelectable->Attributes()->ShadingAspect()->SetColor(aRandColor);
mySelectable->SynchronizeAspects();
return true;
}
~~~~
Looks pretty simple. Now let's make things more interesting and launch some simple object animation on each click.
We use a couple of global (@c static) variables in our sample for simplicity - don't do that in a real production code.
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
...
void SetAnimation (const Handle(AIS_Animation)& theAnim)
{ myAnim = theAnim; }
...
Handle(AIS_Animation) myAnim;
};
bool MyAisOwner::HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick)
{
static bool isFirst = true;
isFirst = !isFirst;
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
gp_Trsf aTrsfTo;
aTrsfTo.SetRotation (gp_Ax1 (gp::Origin(), gp::DX()),
isFirst ? M_PI * 0.5 : -M_PI * 0.5);
gp_Trsf aTrsfFrom = anObj->LocalTransformation();
Handle(AIS_AnimationObject) anAnim =
new AIS_AnimationObject ("MyAnim", anObj->InteractiveContext(),
anObj, aTrsfFrom, aTrsfTo);
anAnim->SetOwnDuration (2.0);
myAnim->Clear();
myAnim->Add (anAnim);
myAnim->StartTimer (0.0, 1.0, true);
return true;
}
~~~~
Animation is a complex topic that is worth a dedicated article - let's not go too deep in detail here.
To perform animation in a non-interrupted way, it should be handled by some class like @c AIS_ViewController, which is responsible for managing user input events and for 3D viewer updates.
To utilize it, you need adding a custom object animation to @c AIS_ViewController::ObjectsAnimation() or adding custom view animation to @c AIS_ViewController::ViewAnimation().
Somewhere in application this might look like this:
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(AIS_ViewController) theViewCtrl;
Handle(MyAisObject) aPrs = new MyAisObject();
aPrs->SetAnimation (theViewCtrl->ObjectsAnimation());
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
~~~~
@section final Final result
The final sample could be seen by calling @c QATutorialAisObject command from Draw Harness plugin @c QAcommands (@c TKQADraw toolkit):
~~~~
pload VISUALIZATION QAcommands
vinit View1
QATutorialAisObject p
vfit
~~~~
You may also take a look onto source code of this command at @c src/QADraw/QADraw_Tutorials.cxx if you have some problems following the tutorial.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,82 +1,76 @@
OCAF: Usage Tutorial {#samples__ocaf}
========
## Getting Started
## Getting Started
At the beginning of your development, you first define an application class by inheriting from the Application abstract class.
You only have to create and determine the resources of the application for specifying the format of your documents (you generally use the standard one) and their file extension.
Then, you design the application data model by organizing attributes you choose among those provided with OCAF.
You can specialize these attributes using the User attribute. For example, if you need a reflection coefficient,
you aggregate a User attribute identified as a reflection coefficient
with a Real attribute containing the value of the coefficient (as such, you don't define a new class).
If you need application specific data not provided with OCAF, for example, to incorporate a finite element model in the data structure,
you define a new attribute class containing the mesh, and you include its persistent homologue in a new file format.
Once you have implemented the commands which create and modify the data structure according to your specification, OCAF provides you, without any additional programming:
* Persistent reference to any data, including geometric elements - several documents can be linked with such reference;
* Document-View association;
* Ready-to-use functions such as:
* Undo-redo;
* Save and open application data.
Finally, you develop the application's graphical user interface using the toolkit of your choice, for example:
* KDE Qt or GNOME GTK+ on Linux;
* Microsoft Foundation Classes (MFC) on Windows Motif on Sun;
* Other commercial products such as Ilog Views.
You can also implement the user interface in the Java language using the Swing-based Java Application Desktop component (JAD) provided with OCAF.
At the beginning of your development, you first define an application class by inheriting from the Application abstract class.
You only have to create and determine the resources of the application
for specifying the format of your documents (you generally use the standard one) and their file extension.
Then, you design the application data model by organizing attributes you choose among those provided with OCAF.
You can specialize these attributes using the User attribute. For example, if you need a reflection coefficient,
you aggregate a User attribute identified as a reflection coefficient
with a Real attribute containing the value of the coefficient (as such, you don't define a new class).
If you need application specific data not provided with OCAF, for example,
to incorporate a finite element model in the data structure,
you define a new attribute class containing the mesh,
and you include its persistent homologue in a new file format.
Once you have implemented the commands which create and modify the data structure
according to your specification, OCAF provides you, without any additional programming:
* Persistent reference to any data, including geometric elements â€" several documents can be linked with such reference;
* Document-View association;
* Ready-to-use functions such as :
* Undo-redo;
* Save and open application data.
Finally, you develop the application's graphical user interface using the toolkit of your choice, for example:
* KDE Qt or GNOME GTK+ on Linux;
* Microsoft Foundation Classes (MFC) on Windows Motif on Sun;
* Other commercial products such as Ilog Views.
You can also implement the user interface in the Java language using
the Swing-based Java Application Desktop component (JAD) provided with OCAF.
## An example of OCAF usage
To create a useful OCAF-based application, it is necessary to redefine two deferred methods: <i> Formats</i> and <i> ResourcesName</i>
To create a useful OCAF-based application, it is necessary to redefine two deferred methods: <i>Formats</i> and <i>ResourcesName</i>
In the <i> Formats </i> method, add the format of the documents, which need to be read by the application and may have been built in other applications.
In the <i>Formats</i> method, add the format of the documents, which need to be read by the application and may have been built in other applications.
For example:
~~~~
~~~~{.cpp}
void myApplication::Formats(TColStd_SequenceOfExtendedString& Formats)
{
Formats.Append(TCollection_ExtendedString ("OCAF-myApplication"));
}
~~~~
In the <i> ResourcesName</i> method, you only define the name of the resource file. This
file contains several definitions for the saving and opening mechanisms associated
with each format and calling of the plug-in file.
In the <i>ResourcesName</i> method, you only define the name of the resource file.
This file contains several definitions for the saving and opening mechanisms associated with each format and calling of the plug-in file.
~~~~
~~~~{.cpp}
Standard_CString myApplication::ResourcesName()
{
return Standard_CString ("Resources");
}
~~~~
To obtain the saving and opening mechanisms, it is necessary to set two environment variables: <i> CSF_PluginDefaults</i>, which defines the path of the plug-in file, and <i> CSF_ResourcesDefault</i>, which defines the resource file:
To obtain the saving and opening mechanisms, it is necessary to set two environment variables: <i>CSF_PluginDefaults</i>, which defines the path of the plug-in file,
and <i>CSF_ResourcesDefault</i>, which defines the resource file:
~~~~
SetEnvironmentVariable ( "CSF_ResourcesDefaults",myDirectory);
SetEnvironmentVariable ( "CSF_PluginDefaults",myDirectory);
~~~~{.cpp}
SetEnvironmentVariable ("CSF_ResourcesDefaults", myDirectory);
SetEnvironmentVariable ("CSF_PluginDefaults", myDirectory);
~~~~
The plugin and the resource files of the application will be located in <i> myDirector</i>.
The plugin and the resource files of the application will be located in <i>myDirector</i>.
The name of the plugin file must be <i>Plugin</i>.
### Resource File
The resource file describes the documents (type and extension) and
the type of data that the application can manipulate
The resource file describes the documents (type and extension) and the type of data that the application can manipulate
by identifying the storage and retrieval drivers appropriate for this data.
Each driver is unique and identified by a GUID generated, for example, with the <i> uuidgen </i> tool in Windows.
Each driver is unique and identified by a GUID generated, for example, with the <i>uuidgen</i> tool in Windows.
Five drivers are required to use all standard attributes provided within OCAF:
@@ -86,8 +80,7 @@ Five drivers are required to use all standard attributes provided within OCAF:
* the attribute storage driver (47b0b826-d931-11d1-b5da-00a0c9064368)
* the attribute retrieval driver (47b0b827-d931-11d1-b5da-00a0c9064368)
These drivers are provided as plug-ins and are located in the <i> PappStdPlugin</i> library.
These drivers are provided as plug-ins and are located in the <i>PappStdPlugin</i> library.
For example, this is a resource file, which declares a new model document OCAF-MyApplication:
@@ -104,12 +97,11 @@ OCAF-MyApplication.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c906436
### Plugin File
The plugin file describes the list of required plug-ins to run the application and the
libraries in which plug-ins are located.
The plugin file describes the list of required plug-ins to run the application and the libraries in which plug-ins are located.
You need at least the <i> FWOSPlugin</i> and the plug-in drivers to run an OCAF application.
You need at least the <i>FWOSPlugin</i> and the plug-in drivers to run an OCAF application.
The syntax of each item is <i> Identification.Location Library_Name, </i> where:
The syntax of each item is <i>Identification.Location Library_Name</i>, where:
* Identification is GUID.
* Location defines the location of the Identification (where its definition is found).
* Library_Name is the name (and path to) the library, where the plug-in is located.
@@ -125,412 +117,414 @@ ad696002-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
47b0b826-d931-11d1-b5da-00a0c9064368.Location: PAppStdPlugin
47b0b827-d931-11d1-b5da-00a0c9064368.Location: PAppStdPlugin
~~~~
## Implementation of Attribute Transformation in a HXX file
~~~~
\#include <TDF_Attribute.hxx>
~~~~{.cpp}
#include <TDF_Attribute.hxx>
\#include <gp_Ax3.hxx>
\#include <gp_Pnt.hxx>
\#include <gp_Vec.hxx>
\#include <gp_Trsf.hxx>
#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Trsf.hxx>
//! This attribute implements a transformation data container
class MyPackage_Transformation : public TDF_Attribute
{
public:
//!@ name Static methods
public: //!@ name Static methods
//! The method returns a unique GUID of this attribute.
//! By means of this GUID this attribute may be identified
//! among other attributes attached to the same label.
//! The method returns a unique GUID of this attribute.
//! By means of this GUID this attribute may be identified
//! among other attributes attached to the same label.
Standard_EXPORT static const Standard_GUID& GetID ();
//! Finds or creates the attribute attached to <theLabel>.
//! The found or created attribute is returned.
//! Finds or creates the attribute attached to <theLabel>.
//! The found or created attribute is returned.
Standard_EXPORT static Handle(MyPackage_Transformation) Set (const TDF_Label theLabel);
//!@ name Methods for access to the attribute data
//! The method returns the transformation.
Standard_EXPORT gp_Trsf Get () const;
public: //!@ name Methods for access to the attribute data
//!@ name Methods for setting the data of transformation
//! The method returns the transformation.
Standard_EXPORT gp_Trsf Get () const;
//! The method defines a rotation type of transformation.
Standard_EXPORT void SetRotation (const gp_Ax1& theAxis, Standard_Real theAngle);
public: //!@ name Methods for setting the data of transformation
//! The method defines a translation type of transformation.
Standard_EXPORT void SetTranslation (const gp_Vec& theVector);
//! The method defines a rotation type of transformation.
Standard_EXPORT void SetRotation (const gp_Ax1& theAxis, Standard_Real theAngle);
//! The method defines a point mirror type of transformation (point symmetry).
Standard_EXPORT void SetMirror (const gp_Pnt& thePoint);
//! The method defines a translation type of transformation.
Standard_EXPORT void SetTranslation (const gp_Vec& theVector);
//! The method defines an axis mirror type of transformation (axial symmetry).
Standard_EXPORT void SetMirror (const gp_Ax1& theAxis);
//! The method defines a point mirror type of transformation (point symmetry).
Standard_EXPORT void SetMirror (const gp_Pnt& thePoint);
//! The method defines a point mirror type of transformation (planar symmetry).
Standard_EXPORT void SetMirror (const gp_Ax2& thePlane);
//! The method defines an axis mirror type of transformation (axial symmetry).
Standard_EXPORT void SetMirror (const gp_Ax1& theAxis);
//! The method defines a scale type of transformation.
Standard_EXPORT void SetScale (const gp_Pnt& thePoint, Standard_Real theScale);
//! The method defines a point mirror type of transformation (planar symmetry).
Standard_EXPORT void SetMirror (const gp_Ax2& thePlane);
//! The method defines a scale type of transformation.
Standard_EXPORT void SetScale (const gp_Pnt& thePoint, Standard_Real theScale);
//! The method defines a complex type of transformation from one coordinate system to another.
Standard_EXPORT void SetTransformation (const gp_Ax3& theCoordinateSystem1, const gp_Ax3& theCoordinateSystem2);
Standard_EXPORT void SetTransformation (const gp_Ax3& theCoordinateSystem1, const gp_Ax3& theCoordinateSystem2);
//!@ name Overridden methods from TDF_Attribute
//! The method returns a unique GUID of the attribute.
//! By means of this GUID this attribute may be identified among other attributes attached to the same label.
Standard_EXPORT const Standard_GUID& ID () const;
public: //!@ name Overridden methods from TDF_Attribute
//! The method is called on Undo / Redo.
//! It copies the content of theAttribute into this attribute (copies the fields).
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theAttribute);
//! The method returns a unique GUID of the attribute.
//! By means of this GUID this attribute may be identified among other attributes attached to the same label.
Standard_EXPORT const Standard_GUID& ID () const;
//! It creates a new instance of this attribute.
//! It is called on Copy / Paste, Undo / Redo.
//! The method is called on Undo / Redo.
//! It copies the content of theAttribute into this attribute (copies the fields).
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theAttribute);
//! It creates a new instance of this attribute.
//! It is called on Copy / Paste, Undo / Redo.
Standard_EXPORT Handle(TDF_Attribute) NewEmpty () const;
//! The method is called on Copy / Paste.
//! It copies the content of this attribute into theAttribute (copies the fields).
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theAttribute, const Handle(TDF_RelocationTable)& theRelocationTable);
//! The method is called on Copy / Paste.
//! It copies the content of this attribute into theAttribute (copies the fields).
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theAttribute, const Handle(TDF_RelocationTable)& theRelocationTable);
//! Prints the content of this attribute into the stream.
//! Prints the content of this attribute into the stream.
Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS);
//!@ name Constructor
public: //!@ name Constructor
//! The C++ constructor of this attribute class.
//! Usually it is never called outside this class.
//! Usually it is never called outside this class.
Standard_EXPORT MyPackage_Transformation();
private:
gp_TrsfForm myType;
// Axes (Ax1, Ax2, Ax3)
// Axes (Ax1, Ax2, Ax3)
gp_Ax1 myAx1;
gp_Ax2 myAx2;
gp_Ax3 myFirstAx3;
gp_Ax3 mySecondAx3;
// Scalar values
// Scalar values
Standard_Real myAngle;
Standard_Real myScale;
// Points
// Points
gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint;
};
};
~~~~
## Implementation of Attribute Transformation in a CPP file
~~~~{.cpp}
\#include <MyPackage_Transformation.hxx>
//=======================================================================
//function : GetID
//purpose : The method returns a unique GUID of this attribute.
// By means of this GUID this attribute may be identified
// among other attributes attached to the same label.
//=======================================================================
const Standard_GUID& MyPackage_Transformation::GetID()
{
static Standard_GUID ID("4443368E-C808-4468-984D-B26906BA8573");
return ID;
}
//=======================================================================
//function : Set
//purpose : Finds or creates the attribute attached to <theLabel>.
// The found or created attribute is returned.
//=======================================================================
Handle(MyPackage_Transformation) MyPackage_Transformation::Set(const TDF_Label& theLabel)
{
Handle(MyPackage_Transformation) T;
if (!theLabel.FindAttribute(MyPackage_Transformation::GetID(), T))
{
T = new MyPackage_Transformation();
theLabel.AddAttribute(T);
}
return T;
}
//=======================================================================
//function : Get
//purpose : The method returns the transformation.
//=======================================================================
gp_Trsf MyPackage_Transformation::Get() const
{
gp_Trsf transformation;
switch (myType)
{
case gp_Identity:
{
break;
}
case gp_Rotation:
{
transformation.SetRotation(myAx1, myAngle);
break;
}
case gp_Translation:
{
transformation.SetTranslation(myFirstPoint, mySecondPoint);
break;
}
case gp_PntMirror:
{
transformation.SetMirror(myFirstPoint);
break;
}
case gp_Ax1Mirror:
{
transformation.SetMirror(myAx1);
break;
}
case gp_Ax2Mirror:
{
transformation.SetMirror(myAx2);
break;
}
case gp_Scale:
{
transformation.SetScale(myFirstPoint, myScale);
break;
}
case gp_CompoundTrsf:
{
transformation.SetTransformation(myFirstAx3, mySecondAx3);
break;
}
case gp_Other:
{
break;
}
}
return transformation;
}
//=======================================================================
//function : SetRotation
//purpose : The method defines a rotation type of transformation.
//=======================================================================
void MyPackage_Transformation::SetRotation(const gp_Ax1& theAxis, const Standard_Real theAngle)
{
Backup();
myType = gp_Rotation;
myAx1 = theAxis;
myAngle = theAngle;
}
//=======================================================================
//function : SetTranslation
//purpose : The method defines a translation type of transformation.
//=======================================================================
void MyPackage_Transformation::SetTranslation(const gp_Vec& theVector)
{
Backup();
myType = gp_Translation;
myFirstPoint.SetCoord(0, 0, 0);
mySecondPoint.SetCoord(theVector.X(), theVector.Y(), theVector.Z());
}
//=======================================================================
//function : SetMirror
//purpose : The method defines a point mirror type of transformation
// (point symmetry).
//=======================================================================
void MyPackage_Transformation::SetMirror(const gp_Pnt& thePoint)
{
Backup();
myType = gp_PntMirror;
myFirstPoint = thePoint;
}
//=======================================================================
//function : SetMirror
//purpose : The method defines an axis mirror type of transformation
// (axial symmetry).
//=======================================================================
void MyPackage_Transformation::SetMirror(const gp_Ax1& theAxis)
{
Backup();
myType = gp_Ax1Mirror;
myAx1 = theAxis;
}
//=======================================================================
//function : SetMirror
//purpose : The method defines a point mirror type of transformation
// (planar symmetry).
//=======================================================================
void MyPackage_Transformation::SetMirror(const gp_Ax2& thePlane)
{
Backup();
myType = gp_Ax2Mirror;
myAx2 = thePlane;
}
//=======================================================================
//function : SetScale
//purpose : The method defines a scale type of transformation.
//=======================================================================
void MyPackage_Transformation::SetScale(const gp_Pnt& thePoint, const Standard_Real theScale)
{
Backup();
myType = gp_Scale;
myFirstPoint = thePoint;
myScale = theScale;
}
//=======================================================================
//function : SetTransformation
//purpose : The method defines a complex type of transformation
// from one coordinate system to another.
//=======================================================================
void MyPackage_Transformation::SetTransformation(const gp_Ax3& theCoordinateSystem1,
const gp_Ax3& theCoordinateSystem2)
{
Backup();
myFirstAx3 = theCoordinateSystem1;
mySecondAx3 = theCoordinateSystem2;
}
//=======================================================================
//function : ID
//purpose : The method returns a unique GUID of the attribute.
// By means of this GUID this attribute may be identified
// among other attributes attached to the same label.
//=======================================================================
const Standard_GUID& MyPackage_Transformation::ID() const
{
return GetID();
}
//=======================================================================
//function : Restore
//purpose : The method is called on Undo / Redo.
// It copies the content of <theAttribute>
// into this attribute (copies the fields).
//=======================================================================
void MyPackage_Transformation::Restore(const Handle(TDF_Attribute)& theAttribute)
{
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
myType = theTransformation->myType;
myAx1 = theTransformation->myAx1;
myAx2 = theTransformation->myAx2;
myFirstAx3 = theTransformation->myFirstAx3;
mySecondAx3 = theTransformation->mySecondAx3;
myAngle = theTransformation->myAngle;
myScale = theTransformation->myScale;
myFirstPoint = theTransformation->myFirstPoint;
mySecondPoint = theTransformation->mySecondPoint;
}
//=======================================================================
//function : NewEmpty
//purpose : It creates a new instance of this attribute.
// It is called on Copy / Paste, Undo / Redo.
//=======================================================================
Handle(TDF_Attribute) MyPackage_Transformation::NewEmpty() const
{
return new MyPackage_Transformation();
}
//=======================================================================
//function : Paste
//purpose : The method is called on Copy / Paste.
// It copies the content of this attribute into
// <theAttribute> (copies the fields).
//=======================================================================
void MyPackage_Transformation::Paste(const Handle(TDF_Attribute)& theAttribute,
const Handle(TDF_RelocationTable)& ) const
{
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
theTransformation->myType = myType;
theTransformation->myAx1 = myAx1;
theTransformation->myAx2 = myAx2;
theTransformation->myFirstAx3 = myFirstAx3;
theTransformation->mySecondAx3 = mySecondAx3;
theTransformation->myAngle = myAngle;
theTransformation->myScale = myScale;
theTransformation->myFirstPoint = myFirstPoint;
theTransformation->mySecondPoint = mySecondPoint;
}
//=======================================================================
//function : Dump
//purpose : Prints the content of this attribute into the stream.
//=======================================================================
Standard_OStream& MyPackage_Transformation::Dump(Standard_OStream& anOS) const
{
anOS = "Transformation: ";
switch (myType)
{
case gp_Identity:
{
anOS = "gp_Identity";
break;
}
case gp_Rotation:
{
anOS = "gp_Rotation";
break;
}
case gp_Translation:
{
anOS = "gp_Translation";
break;
}
case gp_PntMirror:
{
anOS = "gp_PntMirror";
break;
}
case gp_Ax1Mirror:
{
anOS = "gp_Ax1Mirror";
break;
}
case gp_Ax2Mirror:
{
anOS = "gp_Ax2Mirror";
break;
}
case gp_Scale:
{
anOS = "gp_Scale";
break;
}
case gp_CompoundTrsf:
{
anOS = "gp_CompoundTrsf";
break;
}
case gp_Other:
{
anOS = "gp_Other";
break;
}
}
return anOS;
}
#include <MyPackage_Transformation.hxx>
//=======================================================================
//function : MyPackage_Transformation
//purpose : A constructor.
//function : GetID
//purpose : The method returns a unique GUID of this attribute.
// By means of this GUID this attribute may be identified
// among other attributes attached to the same label.
//=======================================================================
MyPackage_Transformation::MyPackage_Transformation():myType(gp_Identity){
const Standard_GUID& MyPackage_Transformation::GetID()
{
static Standard_GUID ID("4443368E-C808-4468-984D-B26906BA8573");
return ID;
}
//=======================================================================
//function : Set
//purpose : Finds or creates the attribute attached to <theLabel>.
// The found or created attribute is returned.
//=======================================================================
Handle(MyPackage_Transformation) MyPackage_Transformation::Set(const TDF_Label& theLabel)
{
Handle(MyPackage_Transformation) T;
if (!theLabel.FindAttribute(MyPackage_Transformation::GetID(), T))
{
T = new MyPackage_Transformation();
theLabel.AddAttribute(T);
}
return T;
}
//=======================================================================
//function : Get
//purpose : The method returns the transformation.
//=======================================================================
gp_Trsf MyPackage_Transformation::Get() const
{
gp_Trsf transformation;
switch (myType)
{
case gp_Identity:
{
break;
}
case gp_Rotation:
{
transformation.SetRotation(myAx1, myAngle);
break;
}
case gp_Translation:
{
transformation.SetTranslation(myFirstPoint, mySecondPoint);
break;
}
case gp_PntMirror:
{
transformation.SetMirror(myFirstPoint);
break;
}
case gp_Ax1Mirror:
{
transformation.SetMirror(myAx1);
break;
}
case gp_Ax2Mirror:
{
transformation.SetMirror(myAx2);
break;
}
case gp_Scale:
{
transformation.SetScale(myFirstPoint, myScale);
break;
}
case gp_CompoundTrsf:
{
transformation.SetTransformation(myFirstAx3, mySecondAx3);
break;
}
case gp_Other:
{
break;
}
}
return transformation;
}
//=======================================================================
//function : SetRotation
//purpose : The method defines a rotation type of transformation.
//=======================================================================
void MyPackage_Transformation::SetRotation(const gp_Ax1& theAxis, const Standard_Real theAngle)
{
Backup();
myType = gp_Rotation;
myAx1 = theAxis;
myAngle = theAngle;
}
//=======================================================================
//function : SetTranslation
//purpose : The method defines a translation type of transformation.
//=======================================================================
void MyPackage_Transformation::SetTranslation(const gp_Vec& theVector)
{
Backup();
myType = gp_Translation;
myFirstPoint.SetCoord(0, 0, 0);
mySecondPoint.SetCoord(theVector.X(), theVector.Y(), theVector.Z());
}
//=======================================================================
//function : SetMirror
//purpose : The method defines a point mirror type of transformation
// (point symmetry).
//=======================================================================
void MyPackage_Transformation::SetMirror(const gp_Pnt& thePoint)
{
Backup();
myType = gp_PntMirror;
myFirstPoint = thePoint;
}
//=======================================================================
//function : SetMirror
//purpose : The method defines an axis mirror type of transformation
// (axial symmetry).
//=======================================================================
void MyPackage_Transformation::SetMirror(const gp_Ax1& theAxis)
{
Backup();
myType = gp_Ax1Mirror;
myAx1 = theAxis;
}
//=======================================================================
//function : SetMirror
//purpose : The method defines a point mirror type of transformation
// (planar symmetry).
//=======================================================================
void MyPackage_Transformation::SetMirror(const gp_Ax2& thePlane)
{
Backup();
myType = gp_Ax2Mirror;
myAx2 = thePlane;
}
//=======================================================================
//function : SetScale
//purpose : The method defines a scale type of transformation.
//=======================================================================
void MyPackage_Transformation::SetScale(const gp_Pnt& thePoint, const Standard_Real theScale)
{
Backup();
myType = gp_Scale;
myFirstPoint = thePoint;
myScale = theScale;
}
//=======================================================================
//function : SetTransformation
//purpose : The method defines a complex type of transformation
// from one coordinate system to another
//=======================================================================
void MyPackage_Transformation::SetTransformation (const gp_Ax3& theCoordinateSystem1,
const gp_Ax3& theCoordinateSystem2)
{
Backup();
myFirstAx3 = theCoordinateSystem1;
mySecondAx3 = theCoordinateSystem2;
}
//=======================================================================
//function : ID
//purpose : The method returns a unique GUID of the attribute.
// By means of this GUID this attribute may be identified
// among other attributes attached to the same label.
//=======================================================================
const Standard_GUID& MyPackage_Transformation::ID() const
{
return GetID();
}
//=======================================================================
//function : Restore
//purpose : The method is called on Undo / Redo.
// It copies the content of <theAttribute>
// into this attribute (copies the fields).
//=======================================================================
void MyPackage_Transformation::Restore(const Handle(TDF_Attribute)& theAttribute)
{
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
myType = theTransformation->myType;
myAx1 = theTransformation->myAx1;
myAx2 = theTransformation->myAx2;
myFirstAx3 = theTransformation->myFirstAx3;
mySecondAx3 = theTransformation->mySecondAx3;
myAngle = theTransformation->myAngle;
myScale = theTransformation->myScale;
myFirstPoint = theTransformation->myFirstPoint;
mySecondPoint = theTransformation->mySecondPoint;
}
//=======================================================================
//function : NewEmpty
//purpose : It creates a new instance of this attribute.
// It is called on Copy / Paste, Undo / Redo.
//=======================================================================
Handle(TDF_Attribute) MyPackage_Transformation::NewEmpty() const
{
return new MyPackage_Transformation();
}
//=======================================================================
//function : Paste
//purpose : The method is called on Copy / Paste.
// It copies the content of this attribute into
// <theAttribute> (copies the fields).
//=======================================================================
void MyPackage_Transformation::Paste (const Handle(TDF_Attribute)& theAttribute,
const Handle(TDF_RelocationTable)& ) const
{
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
theTransformation->myType = myType;
theTransformation->myAx1 = myAx1;
theTransformation->myAx2 = myAx2;
theTransformation->myFirstAx3 = myFirstAx3;
theTransformation->mySecondAx3 = mySecondAx3;
theTransformation->myAngle = myAngle;
theTransformation->myScale = myScale;
theTransformation->myFirstPoint = myFirstPoint;
theTransformation->mySecondPoint = mySecondPoint;
}
//=======================================================================
//function : Dump
//purpose : Prints the content of this attribute into the stream.
//=======================================================================
Standard_OStream& MyPackage_Transformation::Dump(Standard_OStream& theOS) const
{
anOS << "Transformation: ";
switch (myType)
{
case gp_Identity:
{
anOS << "gp_Identity";
break;
}
case gp_Rotation:
{
anOS << "gp_Rotation";
break;
}
case gp_Translation:
{
anOS << "gp_Translation";
break;
}
case gp_PntMirror:
{
anOS << "gp_PntMirror";
break;
}
case gp_Ax1Mirror:
{
anOS << "gp_Ax1Mirror";
break;
}
case gp_Ax2Mirror:
{
anOS << "gp_Ax2Mirror";
break;
}
case gp_Scale:
{
anOS << "gp_Scale";
break;
}
case gp_CompoundTrsf:
{
anOS << "gp_CompoundTrsf";
break;
}
case gp_Other:
{
anOS << "gp_Other";
break;
}
}
return anOS;
}
//=======================================================================
//function : MyPackage_Transformation
//purpose : A constructor.
//=======================================================================
MyPackage_Transformation::MyPackage_Transformation()
: myType (gp_Identity)
{
//
}
~~~~
## Implementation of typical actions with standard OCAF attributes.
## Implementation of typical actions with standard OCAF attributes.
There are four sample files provided in the directory 'OpenCasCade/ros/samples/ocafsamples'. They present typical actions with OCAF services (mainly for newcomers).
There are four sample files provided in the directory 'OpenCasCade/ros/samples/ocafsamples'.
They present typical actions with OCAF services (mainly for newcomers).
The method *Sample()* of each file is not dedicated for execution 'as is', it is rather a set of logical actions using some OCAF services.
### TDataStd_Sample.cxx
@@ -549,7 +543,7 @@ This sample contains templates for typical actions with the following standard O
- TDataXtd_Constraint attribute management;
- TDataStd_Directory attribute management;
- TDataStd_TreeNode attribute management.
### TDocStd_Sample.cxx
This sample contains template for the following typical actions:
- creating application;
@@ -560,7 +554,7 @@ This sample contains template for the following typical actions:
- closing a document;
- opening the document stored in the file;
- copying content of a document to another document with possibility to update the copy in the future.
### TPrsStd_Sample.cxx
This sample contains template for the following typical actions:
- starting with data framework;
@@ -577,7 +571,7 @@ This sample contains template for the following typical actions:
- updating and displaying presentation of the attribute to be displayed;
- setting a color to the displayed attribute;
- getting transparency of the displayed attribute;
- modify attribute;
- modify attribute;
- updating presentation of the attribute in viewer.
### TNaming_Sample.cxx
@@ -591,4 +585,3 @@ The following scenario is used:
- creating a Fillet (using the selected edges) and pushing the result as a modification of Box1;
- creating a Cut (Box1, Box2) as a modification of Box1 and push it in DF;
- recovering the result from DF.

View File

@@ -14,6 +14,8 @@
<br>A set of code snippets performing typical actions with @ref occt_user_guides__ocaf "OCAF" services for newcomers.
* @ref samples__ocaf_func
<br>A simple example dedicated to the usage of "Function Mechanism" of @ref occt_user_guides__ocaf "OCCT Application Framework".
* @ref tutorials__ais_object
<br>A programming tutorial teaching how to compute presentation within AIS_InteractiveObject subclass for displaying in @ref occt_user_guides__visualization "OCCT 3D Viewer".
- @subpage samples__projects
* @ref samples_qt_iesample
<br>A cross-platform multi-document 3D Viewer sample with CAD import / export functionality based on **Qt Widgets** framework.
@@ -44,6 +46,7 @@
- @subpage occt__tutorial
- @subpage samples__ocaf
- @subpage samples__ocaf_func
- @subpage tutorials__ais_object
@page samples__projects Sample Projects
- @subpage samples_qt_iesample

View File

@@ -7,6 +7,8 @@ Upgrade from older OCCT versions {#occt__upgrade}
This document provides technical details on changes made in particular versions of OCCT. It can help to upgrade user applications based on previous versions of OCCT to newer ones.
@ref upgrade_occt770 "SEEK TO THE LAST CHAPTER (UPGRADE TO 7.7.0)"
@subsection upgrade_intro_precautions Precautions
Back-up your code before the upgrade.
@@ -24,7 +26,6 @@ The automatic upgrade tool is provided as is, without warranty of any kind, and
It is your responsibility to ensure that the changes you made in your code are correct.
When you upgrade the code by an automatic script, make sure to carefully review the introduced changes at each step before committing them.
@section upgrade_65 Upgrade to OCCT 6.5.0
Porting of user applications from an earlier OCCT version to version 6.5 requires taking into account the following major changes:
@@ -2299,6 +2300,10 @@ void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
Building OCCT now requires C++11-compliant compiler, so that some legacy compilers (Visual Studio 2010 and 2012) are no more supported.
It is recommended using Visual Studio 2015 or newer for building OCCT on Windows platform.
@subsection upgrade_770_removed_features Removed features
* One of the constructors of the BRepExtrema_DistanceSS class (the one without deflection parameter) has been removed as excessive. The remaining constructor has to be used instead.
@subsection upgrade_occt770_parallel_flag_removed Removed parameter theIsParallel from Put/Compute/Perform
theIsParallel parameter has been removed from Put/Compute/Perform from the next classes:
@@ -2321,3 +2326,10 @@ aValidateEdge.Process();
`Prs3d_Drawer` getters no more implicitly create "default" aspects.
If specific property has not been set before to this drawer instance nor to linked drawer instance, then NULL property will be returned.
Make sure to set property beforehand or to call `SetOwn*` / `SetupOwn*` methods to derive from defaults.
@subsection upgrade_occt770_opengl OpenGL functions
Applications extending OCCT 3D Viewer and calling OpenGL functions directly (like @c @::glEnable(), e.g. using global namespace) might be affected by changes in `OpenGl_GlFunctions.hxx`.
This header, as well as `OpenGl_GlCore20.hxx` and similar, no more include system OpenGL / OpenGL ES headers to define function table.
Application code calling OpenGL functions directly should be changed to either use `OpenGl_Context::core11fwd` (as designed)
or to include system OpenGL headers in advance (with help of `OpenGl_GlNative.hxx`).

View File

@@ -165,7 +165,9 @@ if (!Interface_Static::SetIVal ("read.maxprecision.mode",1))
Default value is *Preferred (0)*.
<h4>read.maxprecision.val</h4>
defines the maximum allowable tolerance (in mm) of the shape. It should be not less than the basis value of tolerance set in processor (either Resolution from the file or *read.precision.val*). Actually, the maximum between *read.maxprecision.val* and basis tolerance is used to define maximum allowed tolerance.
defines the maximum allowable tolerance (in internal units, which are specified in xstep.cascade.unit) of the shape.
It should be not less than the basis value of tolerance set in processor (either Resolution from the file or *read.precision.val*).
Actually, the maximum between *read.maxprecision.val* and basis tolerance is used to define maximum allowed tolerance.
Read this parameter with:
~~~~{.cpp}
Standard_Real rp = Interface_Static::RVal("read.maxprecision.val");

File diff suppressed because it is too large Load Diff

View File

@@ -182,7 +182,9 @@ By default this value is 0.0001.
The value given to this parameter is a basic value for ShapeHealing algorithms and the processor. It does its best to reach it. Under certain circumstances, the value you give may not be attached to all of the entities concerned at the end of processing. STEP-to-OpenCASCADE translation does not improve the quality of the geometry in the original STEP file. This means that the value you enter may be impossible to attach to all shapes with the given quality of the geometry in the STEP file.
<h4>read.maxprecision.val</h4>
Defines the maximum allowed tolerance (in mm) of the shape. It should be not less than the basic value of tolerance set in the processor (either the uncertainty from the file or *read.precision.val*). Actually, the maximum between *read.maxprecision.val* and the basis tolerance is used to define the maximum allowed tolerance.
Defines the maximum allowed tolerance (in internal units, which are specified in xstep.cascade.unit) of the shape.
It should be not less than the basic value of tolerance set in the processor (either the uncertainty from the file or *read.precision.val*).
Actually, the maximum between *read.maxprecision.val* and the basis tolerance is used to define the maximum allowed tolerance.
Read this parameter with:
~~~~{.cpp}

View File

@@ -14,8 +14,6 @@
#include <AIS_AnimationCamera.hxx>
#include <Graphic3d_Camera.hxx>
#include <Precision.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationCamera, AIS_Animation)

View File

@@ -15,8 +15,6 @@
#include <AIS_AnimationObject.hxx>
#include <AIS_InteractiveContext.hxx>
#include <TopLoc_Location.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)

View File

@@ -22,7 +22,6 @@
#include <Quantity_NameOfColor.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <SelectMgr_Filter.hxx>
class SelectMgr_EntityOwner;

View File

@@ -36,8 +36,6 @@
#include <SelectMgr_Selection.hxx>
#include <Standard_NumericError.hxx>
#include <StdPrs_Curve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS.hxx>
#include <UnitsAPI.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Axis,AIS_InteractiveObject)

View File

@@ -17,12 +17,9 @@
// <g_design>
#include <AIS_BadEdgeFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopoDS_Edge.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_BadEdgeFilter,SelectMgr_Filter)

View File

@@ -18,12 +18,10 @@
#define _AIS_BadEdgeFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Filter.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_ShapeEnum.hxx>
class SelectMgr_EntityOwner;
class TopoDS_Edge;

View File

@@ -18,7 +18,6 @@
#include <AIS_C0RegularityFilter.hxx>
#include <BRep_Tool.hxx>
#include <GeomAbs_Shape.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopExp.hxx>

View File

@@ -18,11 +18,9 @@
#define _AIS_C0RegularityFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopTools_MapOfShape.hxx>
#include <SelectMgr_Filter.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_ShapeEnum.hxx>
class TopoDS_Shape;
class SelectMgr_EntityOwner;

View File

@@ -18,7 +18,6 @@
#include <AIS_GraphicTool.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <Geom_Circle.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Graphic3d_AspectLine3d.hxx>
@@ -32,8 +31,6 @@
#include <SelectMgr_Selection.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_DeflectionCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Circle,AIS_InteractiveObject)

View File

@@ -17,26 +17,18 @@
#include <AIS_InteractiveContext.hxx>
#include <Aspect_TypeOfColorScaleData.hxx>
#include <Aspect_TypeOfColorScalePosition.hxx>
#include <Aspect_Window.hxx>
#include <Geom_Line.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Graphic3d_ArrayOfPolygons.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_GraphicDriver.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Text.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <StdPrs_Curve.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColorScale, AIS_InteractiveObject)

View File

@@ -19,28 +19,21 @@
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Precision.hxx>
#include <Prs3d.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <Standard_ErrorHandler.hxx>
#include <StdSelect_BRepSelectionTool.hxx>
#include <StdPrs_ShadedShape.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>
#include <StdPrs_WFShape.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>

View File

@@ -19,7 +19,6 @@
#include <AIS_DataMapOfShapeDrawer.hxx>
#include <AIS_Shape.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <StdPrs_Volume.hxx>
#include <TopoDS_Compound.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TColStd_MapTransientHasher.hxx>

View File

@@ -20,22 +20,16 @@
#include <AIS_Shape.hxx>
#include <BRepTools.hxx>
#include <NCollection_DataMap.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_HLRPolyShape.hxx>
#include <StdPrs_WFShape.hxx>
#include <StdSelect.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ConnectedInteractive,AIS_InteractiveObject)

View File

@@ -16,7 +16,6 @@
#include <AIS_ColoredDrawer.hxx>
#include <NCollection_DataMap.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ShapeMapHasher.hxx>
typedef NCollection_DataMap<TopoDS_Shape, Handle(AIS_ColoredDrawer), TopTools_ShapeMapHasher> AIS_DataMapOfShapeDrawer;

View File

@@ -20,7 +20,6 @@
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ExclusionFilter,SelectMgr_Filter)

View File

@@ -20,7 +20,6 @@
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <SelectMgr_Filter.hxx>
#include <AIS_KindOfInteractive.hxx>

View File

@@ -18,13 +18,10 @@
#define _AIS_GlobalStatus_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <AIS_DisplayStatus.hxx>
#include <Prs3d_Drawer.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Transient.hxx>
DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, Standard_Transient)

View File

@@ -16,9 +16,7 @@
#include <AIS_GraphicTool.hxx>
#include <Aspect_InteriorStyle.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_MaterialAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>

View File

@@ -21,7 +21,6 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Prs3d_Drawer.hxx>
#include <AIS_TypeOfAttribute.hxx>
#include <Standard_Real.hxx>

View File

@@ -21,9 +21,7 @@
#include <AIS_GlobalStatus.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_MultipleConnectedInteractive.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Precision.hxx>
#include <Prs3d_BasicAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
@@ -31,7 +29,6 @@
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TopLoc_Location.hxx>
#include <V3d_View.hxx>

View File

@@ -42,7 +42,6 @@
#include <TCollection_AsciiString.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <Quantity_Color.hxx>
class V3d_Viewer;
@@ -1434,8 +1433,8 @@ protected: //! @name internal methods
}
//! Bind/Unbind status to object and its children
//! @param theObj [in] the object to change status
//! @param theStatus status, if NULL, unbind object
//! @param[in] theIObj the object to change status
//! @param[in] theStatus status, if NULL, unbind object
Standard_EXPORT void setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
const PrsMgr_DisplayStatus theStatus,
const Standard_Integer theDispyMode,

View File

@@ -17,10 +17,6 @@
#include <AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_CStructure.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Structure.hxx>

View File

@@ -20,7 +20,6 @@
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_CView.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_ArrowAspect.hxx>

View File

@@ -17,7 +17,6 @@
#define _AIS_LightSource_HeaderFile
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_CLight.hxx>
#include <SelectMgr_EntityOwner.hxx>
class Select3D_SensitiveSphere;

View File

@@ -18,13 +18,11 @@
#include <AIS_GraphicTool.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <GC_MakeSegment.hxx>
#include <Geom_Line.hxx>
#include <Geom_Point.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
@@ -34,7 +32,6 @@
#include <SelectMgr_Selection.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_Curve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <UnitsAPI.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Line,AIS_InteractiveObject)

View File

@@ -15,6 +15,7 @@
#include <AIS_Manipulator.hxx>
#include <AIS_DisplayMode.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_ManipulatorOwner.hxx>
#include <Extrema_ExtElC.hxx>

View File

@@ -18,17 +18,14 @@
#include <AIS_InteractiveObject.hxx>
#include <AIS_ManipulatorMode.hxx>
#include <gp.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_ArrayOfQuadrangles.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Group.hxx>
#include <NCollection_HSequence.hxx>
#include <Poly_Triangulation.hxx>
#include <V3d_View.hxx>
#include <Standard_Version.hxx>
#include <Standard_DefineHandle.hxx>
NCOLLECTION_HSEQUENCE(AIS_ManipulatorObjectSequence, Handle(AIS_InteractiveObject))

View File

@@ -16,10 +16,8 @@
#include <AIS_InteractiveContext.hxx>
#include <Media_PlayerContext.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_MediaTexture.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
#include <V3d_Viewer.hxx>

View File

@@ -19,10 +19,7 @@
#include <AIS_ConnectedInteractive.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_NotImplemented.hxx>
#include <TopLoc_Location.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_MultipleConnectedInteractive,AIS_InteractiveObject)

View File

@@ -17,7 +17,6 @@
#include <AIS_Plane.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <DsgPrs_ShadedPlanePresentation.hxx>
#include <DsgPrs_XYZPlanePresentation.hxx>
#include <ElSLib.hxx>
@@ -45,11 +44,7 @@
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_Plane.hxx>
#include <StdPrs_ShadedShape.hxx>
#include <StdPrs_ShadedSurface.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Plane,AIS_InteractiveObject)

View File

@@ -18,13 +18,10 @@
// + (-1) selection mode token into account
// (SAMTECH specific)
#include <AIS_InteractiveObject.hxx>
#include <AIS_Line.hxx>
#include <AIS_PlaneTrihedron.hxx>
#include <AIS_Point.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <DsgPrs_XYZAxisPresentation.hxx>
#include <Geom_Axis1Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Line.hxx>
@@ -33,9 +30,6 @@
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_MaterialAspect.hxx>
#include <Graphic3d_Structure.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_Drawer.hxx>

View File

@@ -17,15 +17,11 @@
#include <AIS_Point.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <Geom_Point.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Structure.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitivePoint.hxx>

View File

@@ -17,7 +17,6 @@
#ifndef _AIS_Point_HeaderFile
#define _AIS_Point_HeaderFile
#include <Aspect_TypeOfMarker.hxx>
#include <AIS_InteractiveObject.hxx>
class Geom_Point;

View File

@@ -17,13 +17,11 @@
#include <AIS_GraphicTool.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_Presentations.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
#include <SelectMgr_EntityOwner.hxx>

View File

@@ -23,10 +23,7 @@
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_TransModeFlags.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>

View File

@@ -80,10 +80,10 @@ public:
const Handle(SelectMgr_EntityOwner)& Value() const { return myIterator.Value(); }
//! Select or deselect owners depending on the selection scheme.
//! @param theOwners [in] elements to change selection state
//! @param theSelScheme [in] selection scheme, defines how owner is selected
//! @param theToAllowSelOverlap [in] selection flag, if true - overlapped entities are allowed
//! @param theFilter [in] context filter to skip not acceptable owners
//! @param[in] thePickedOwners elements to change selection state
//! @param[in] theSelScheme selection scheme, defines how owner is selected
//! @param[in] theToAllowSelOverlap selection flag, if true - overlapped entities are allowed
//! @param[in] theFilter context filter to skip not acceptable owners
Standard_EXPORT virtual void SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwners,
const AIS_SelectionScheme theSelScheme,
const Standard_Boolean theToAllowSelOverlap,

View File

@@ -18,36 +18,25 @@
#include <AIS_GraphicTool.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <BRep_Builder.hxx>
#include <BRepBndLib.hxx>
#include <BRepTools.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_MaterialAspect.hxx>
#include <Graphic3d_SequenceOfGroup.hxx>
#include <Graphic3d_Structure.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <HLRBRep.hxx>
#include <OSD_Timer.hxx>
#include <Precision.hxx>
#include <Prs3d.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_BndBox.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_Type.hxx>
@@ -56,10 +45,7 @@
#include <StdPrs_ShadedShape.hxx>
#include <StdPrs_WFShape.hxx>
#include <StdSelect.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <StdSelect_BRepSelectionTool.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopExp.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)

View File

@@ -17,6 +17,7 @@
#ifndef _AIS_Shape_HeaderFile
#define _AIS_Shape_HeaderFile
#include <AIS_DisplayMode.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Bnd_Box.hxx>
#include <TopoDS_Shape.hxx>

View File

@@ -23,7 +23,6 @@
#include <Standard_Integer.hxx>
#include <AIS_TypeFilter.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Standard_Boolean.hxx>
class SelectMgr_EntityOwner;

View File

@@ -25,10 +25,8 @@
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <Standard_ErrorHandler.hxx>
@@ -36,7 +34,6 @@
#include <StdPrs_ShadedShape.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>
#include <StdPrs_WFShape.hxx>
#include <TopExp_Explorer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_TexturedShape,AIS_Shape)

View File

@@ -18,12 +18,10 @@
#include <AIS_Shape.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_NameOfTexture2D.hxx>
#include <Image_PixMap.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Prs3d_Presentation.hxx>
#include <PrsMgr_PresentationManager.hxx>

View File

@@ -16,14 +16,10 @@
#include <AIS_DisplayMode.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Standard_Type.hxx>
#include <Poly_Array1OfTriangle.hxx>
#include <Poly_Triangulation.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <TShort_Array1OfShortReal.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TShort_HArray1OfShortReal.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>

View File

@@ -18,10 +18,9 @@
#include <AIS_InteractiveContext.hxx>
#include <AIS_TrihedronOwner.hxx>
#include <AIS_TrihedronSelectionMode.hxx>
#include <Geom_Axis2Placement.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>

View File

@@ -19,17 +19,13 @@
#include <AIS_InteractiveObject.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <AIS_TrihedronSelectionMode.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_DatumMode.hxx>
#include <Prs3d_DatumParts.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <SelectMgr_Selection.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Quantity_Color.hxx>
class Geom_Axis2Placement;

View File

@@ -22,7 +22,6 @@
#include <AIS_KindOfInteractive.hxx>
#include <SelectMgr_Filter.hxx>
#include <Standard_Boolean.hxx>
class SelectMgr_EntityOwner;

View File

@@ -21,10 +21,7 @@
#include <Aspect_XRSession.hxx>
#include <Aspect_Grid.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <gp_Quaternion.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>

View File

@@ -14,8 +14,6 @@
#ifndef _AIS_ViewController_HeaderFile
#define _AIS_ViewController_HeaderFile
#include <Aspect_VKeySet.hxx>
#include <Aspect_TouchMap.hxx>
#include <Aspect_WindowInputListener.hxx>
#include <Aspect_XRHapticActionData.hxx>
#include <Aspect_XRTrackedDeviceRole.hxx>

View File

@@ -18,14 +18,12 @@
#include <AIS_AnimationCamera.hxx>
#include <AIS_InteractiveContext.hxx>
#include <gp_Ax2.hxx>
#include <Graphic3d_ViewAffinity.hxx>
#include <Graphic3d_Text.hxx>
#include <NCollection_Lerp.hxx>
#include <Prs3d.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_ToolDisk.hxx>
#include <Prs3d_ToolSphere.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
#include <V3d.hxx>

View File

@@ -16,7 +16,6 @@
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Image_Texture.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>

View File

@@ -15,7 +15,6 @@
#include <APIHeaderSection_EditHeader.hxx>
#include <APIHeaderSection_MakeHeader.hxx>
#include <IFSelect_EditForm.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_TypedValue.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>

View File

@@ -18,10 +18,8 @@
#define _APIHeaderSection_EditHeader_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <IFSelect_Editor.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class TCollection_AsciiString;
class IFSelect_EditForm;

View File

@@ -25,7 +25,6 @@
#include <Interface_HArray1OfHAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <Interface_MSG.hxx>
#include <Interface_Protocol.hxx>
#include <Interface_Version.hxx>
#include <StepData_Protocol.hxx>
#include <StepData_StepModel.hxx>

View File

@@ -23,7 +23,6 @@
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_CString.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
class HeaderSection_FileName;
class HeaderSection_FileSchema;

View File

@@ -25,10 +25,7 @@
#include <gp_Parab2d.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_OutOfRange.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Adaptor2d_Curve2d, Standard_Transient)

View File

@@ -25,7 +25,6 @@
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_OutOfRange.hxx>

View File

@@ -19,10 +19,8 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <gp_Ax2d.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Integer.hxx>

View File

@@ -15,8 +15,6 @@
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2dEvaluator.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <gp.hxx>
#include <gp_Ax22d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Dir2d.hxx>
@@ -26,7 +24,6 @@
#include <gp_Parab2d.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_VectorWithNullMagnitude.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoSuchObject.hxx>

View File

@@ -26,10 +26,7 @@
#include <gp_Parab.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_OutOfRange.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Adaptor3d_Curve, Standard_Transient)

View File

@@ -17,7 +17,6 @@
#ifndef _Adaptor3d_Curve_HeaderFile
#define _Adaptor3d_Curve_HeaderFile
#include <gp_Lin.hxx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>

View File

@@ -25,9 +25,7 @@
#include <Geom2d_BSplineCurve.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_OffsetSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <gp_Ax22d.hxx>
#include <gp_Circ.hxx>
@@ -50,7 +48,6 @@
#include <Standard_DomainError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_OutOfRange.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfInteger.hxx>

View File

@@ -18,7 +18,6 @@
#define _Adaptor3d_CurveOnSurface_HeaderFile
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_Surface.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx>

Some files were not shown because too many files have changed in this diff Show More