Compare commits
216 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
77242088bc | ||
|
1e1b83c07b | ||
|
8f08e231fa | ||
|
f0ada3e8d4 | ||
|
9171cefaad | ||
|
247ecf1b16 | ||
|
3f7e5e99d5 | ||
|
6d43db4f74 | ||
|
128654b60b | ||
|
21095f2dc2 | ||
|
420f5c8682 | ||
|
85b147584e | ||
|
7f24b768c3 | ||
|
787ff2408c | ||
|
64943a5187 | ||
|
486ad71287 | ||
|
c9125b6232 | ||
|
87c7d55469 | ||
|
14b741b0ef | ||
|
89180f9822 | ||
|
517ba7aa70 | ||
|
68064d7bc3 | ||
|
62afcbbb4a | ||
|
7ef1f9b7c1 | ||
|
877fd611ac | ||
|
dc9f1dbf69 | ||
|
895a80d38a | ||
|
6a9f983a16 | ||
|
22fa1da36e | ||
|
fb99177766 | ||
|
67441d0ca3 | ||
|
b5163d2f8d | ||
|
29263c947e | ||
|
08669adf1b | ||
|
68ad329c9d | ||
|
d6e18114eb | ||
|
e5c11edd7b | ||
|
fffc249f21 | ||
|
739c7e5968 | ||
|
f732ea1ab5 | ||
|
ae87bb87d0 | ||
|
3d60d73f76 | ||
|
0950253ca6 | ||
|
f6d8ca74d5 | ||
|
00cdefc7a2 | ||
|
d850414af1 | ||
|
b380b06c5d | ||
|
c64efd9e30 | ||
|
cd43c08f2b | ||
|
28b13b31aa | ||
|
10ac040338 | ||
|
7e1c1e4869 | ||
|
a2803f37e7 | ||
|
18348b382e | ||
|
64e68ea690 | ||
|
bee13ef1cf | ||
|
e73ef9d219 | ||
|
8b3fbdef34 | ||
|
e2550e48f1 | ||
|
62beabff7c | ||
|
5e06dfcb32 | ||
|
35befde2ad | ||
|
bc73b00672 | ||
|
00ea7f2676 | ||
|
fe758dbe2c | ||
|
8811d6f2aa | ||
|
1939cfd9cb | ||
|
7860770232 | ||
|
6216ed573e | ||
|
973f7d55bd | ||
|
0c74168c42 | ||
|
3eba1c72ef | ||
|
e83d440f92 | ||
|
6558400123 | ||
|
389f5b59dd | ||
|
08353e37cf | ||
|
c8bead4752 | ||
|
9df71488b3 | ||
|
ef59b5e064 | ||
|
0c061f3d9d | ||
|
88b312d3a4 | ||
|
0858125fd4 | ||
|
89d855ba58 | ||
|
d415125a68 | ||
|
0da2ecac41 | ||
|
bdd09cfaf4 | ||
|
9504a30d15 | ||
|
9a1701fbcb | ||
|
c68c346d2b | ||
|
e2447a80ea | ||
|
936ce1f273 | ||
|
6ef7a1f9e5 | ||
|
23c2ae55c7 | ||
|
8bfae263c1 | ||
|
1c2ddf5612 | ||
|
5a8d30b87b | ||
|
b7b22996bb | ||
|
552a74d829 | ||
|
c37bd936c3 | ||
|
4e8c1d8666 | ||
|
72f6dc612c | ||
|
f051908edc | ||
|
420b38fde9 | ||
|
34e7ac6817 | ||
|
2b5a58a33c | ||
|
e513a6c538 | ||
|
8c2d331426 | ||
|
caee80f39f | ||
|
01b2f506d6 | ||
|
df8c7e3e18 | ||
|
3f1675c941 | ||
|
6a56fe9240 | ||
|
51ee6a7dbb | ||
|
14a356b178 | ||
|
4eff0c0480 | ||
|
8f00325d73 | ||
|
9a90a4524e | ||
|
31a5a359bb | ||
|
bf97419a18 | ||
|
4c26106f76 | ||
|
15e4e6a23e | ||
|
6b467e52bb | ||
|
08b438b076 | ||
|
a14f2b4722 | ||
|
a1a9b24952 | ||
|
f979709590 | ||
|
e9d05765c2 | ||
|
7756fc599d | ||
|
b31fbc832d | ||
|
1bd04b5a02 | ||
|
6466cc9eb1 | ||
|
f7fc0c03be | ||
|
67312b7991 | ||
|
f4a7308f61 | ||
|
53d770b3a2 | ||
|
7ed6e985e2 | ||
|
da6b95a075 | ||
|
565baee64b | ||
|
36e28f96f6 | ||
|
215dd33149 | ||
|
5646c90e87 | ||
|
97e0059b05 | ||
|
8445efca81 | ||
|
a6a66c3a21 | ||
|
cc99be369e | ||
|
1a5007a920 | ||
|
3818aacaa5 | ||
|
e1d039d56d | ||
|
a4815d5509 | ||
|
ba00aab7a0 | ||
|
aaf8d6a98d | ||
|
b008226203 | ||
|
eff3eff916 | ||
|
bf327822d6 | ||
|
63da0df9c2 | ||
|
13a44c4b7f | ||
|
f04de1335c | ||
|
c08fd12706 | ||
|
d7992a77f6 | ||
|
8c787b5fa9 | ||
|
44fafc477f | ||
|
780fbc2897 | ||
|
620a6baa59 | ||
|
89073268fd | ||
|
6ed44b1ca9 | ||
|
746cb7c328 | ||
|
8ba3d978db | ||
|
c275673dbf | ||
|
9e3045dae1 | ||
|
c2bcd98369 | ||
|
683b72c3c1 | ||
|
3358ed643b | ||
|
2724a0b3cc | ||
|
0deeff45a0 | ||
|
fd47711d68 | ||
|
c61c864f73 | ||
|
d9619512e1 | ||
|
7863dabb54 | ||
|
cf97685735 | ||
|
92686513a2 | ||
|
8c186dad9b | ||
|
3de0f78449 | ||
|
8aafd5f9e3 | ||
|
cc50812d6f | ||
|
467e864adf | ||
|
0a5ec5f380 | ||
|
27bd52b540 | ||
|
9196ea9d5a | ||
|
d537c5e67d | ||
|
e774a5534c | ||
|
258a844b63 | ||
|
cbaac5de6d | ||
|
1f99e08822 | ||
|
eb62cbc494 | ||
|
1e0a1fc9cb | ||
|
25093c3f54 | ||
|
0904aa6395 | ||
|
c42ef16585 | ||
|
1f44d29a0f | ||
|
05ed7ed8e0 | ||
|
f4b0c77247 | ||
|
487942b562 | ||
|
8b037fe4ea | ||
|
cd58de63de | ||
|
5859be3886 | ||
|
d45b7860a5 | ||
|
0cdaa8a4a5 | ||
|
3b80dc166a | ||
|
fdae2107d9 | ||
|
44b80414d3 | ||
|
b1492cb30f | ||
|
5c225e8e07 | ||
|
3068c3bb65 | ||
|
ac293bde7f | ||
|
a53d3975c9 | ||
|
94beb42a68 |
@@ -708,6 +708,18 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
|
||||
endif()
|
||||
|
||||
# qt for inspector and samples
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
|
||||
message (STATUS "Info: Qt is used by OCCT")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
|
||||
endif()
|
||||
|
||||
# check all 3rdparty include paths
|
||||
string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
|
||||
if (3RDPARTY_NOT_INCLUDED)
|
||||
@@ -795,17 +807,6 @@ else()
|
||||
set (SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
|
||||
message (STATUS "Info: Qt is used by OCCT")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
|
||||
endif()
|
||||
|
||||
# OCCT tools
|
||||
# include the patched or original list of tools
|
||||
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
|
||||
|
23
adm/UDLIST
@@ -108,6 +108,7 @@ n BRepMesh
|
||||
n BRepMeshData
|
||||
n BRepOffset
|
||||
n BRepOffsetAPI
|
||||
n BRepPreviewAPI
|
||||
n BRepPrim
|
||||
n BRepPrimAPI
|
||||
n BRepProj
|
||||
@@ -201,6 +202,7 @@ n InterfaceGraphic
|
||||
n AIS
|
||||
n Aspect
|
||||
n DsgPrs
|
||||
n PrsDim
|
||||
n Graphic3d
|
||||
n Image
|
||||
n Media
|
||||
@@ -214,7 +216,6 @@ n SelectBasics
|
||||
n SelectMgr
|
||||
n StdPrs
|
||||
n StdSelect
|
||||
n TColQuantity
|
||||
n V3d
|
||||
n WNT
|
||||
n Xw
|
||||
@@ -443,3 +444,23 @@ t TKRWMesh
|
||||
n RWGltf
|
||||
n RWMesh
|
||||
n RWObj
|
||||
n DFBrowser
|
||||
n DFBrowserPane
|
||||
n DFBrowserPaneXDE
|
||||
n ShapeView
|
||||
n TInspector
|
||||
n TInspectorAPI
|
||||
x TInspectorEXE
|
||||
t TKDFBrowser
|
||||
t TKShapeView
|
||||
t TKTInspector
|
||||
t TKTInspectorAPI
|
||||
t TKToolsDraw
|
||||
t TKTreeModel
|
||||
t TKView
|
||||
t TKVInspector
|
||||
n ToolsDraw
|
||||
n TreeModel
|
||||
n View
|
||||
n ViewControl
|
||||
n VInspector
|
||||
|
@@ -108,6 +108,7 @@ else()
|
||||
elseif (ANDROID)
|
||||
set (CSF_ThreadLibs "c")
|
||||
set (CSF_OpenGlLibs "EGL GLESv2")
|
||||
set (CSF_androidlog "log")
|
||||
elseif (UNIX)
|
||||
set (CSF_ThreadLibs "pthread rt stdc++")
|
||||
if (USE_GLES2)
|
||||
|
@@ -130,7 +130,9 @@ elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
|
||||
if (APPLE)
|
||||
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
|
||||
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
|
||||
else()
|
||||
elseif(NOT WIN32)
|
||||
# CLang for Windows (at least CLang 8.0 distributed with VS 2019)
|
||||
# does not support option "-std=c++0x"
|
||||
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
@@ -12,18 +12,12 @@ macro (OCCT_CHECK_AND_UNSET VARNAME)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_CHECK_AND_UNSET_GROUP VARNAME)
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_DIR")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_INCLUDE_DIR")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_LIBRARY")
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_LIBRARY_DIR")
|
||||
|
||||
if (WIN32)
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_DLL")
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_DLL_DIR")
|
||||
endif()
|
||||
macro (OCCT_CHECK_AND_UNSET_GROUP GROUPNAME)
|
||||
get_cmake_property(VARS VARIABLES)
|
||||
string (REGEX MATCHALL "(^|;)${GROUPNAME}[A-Za-z0-9_]*" GROUPNAME_VARS "${VARS}")
|
||||
foreach(GROUPNAME_VAR ${GROUPNAME_VARS})
|
||||
OCCT_CHECK_AND_UNSET(${GROUPNAME_VAR})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS)
|
||||
@@ -274,7 +268,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
|
||||
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
|
||||
|
||||
# emit warnings if there is unprocessed headers
|
||||
# emit warnings if there are unprocessed headers
|
||||
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
|
||||
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
|
||||
|
||||
@@ -307,8 +301,8 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
|
||||
|
||||
# collect header files with name that does not contain its package one
|
||||
string (FIND "${OCCT_FILE_NAME}" "${OCCT_PACKAGE}_" FOUND_INDEX)
|
||||
if (NOT ${FOUND_INDEX} EQUAL 0)
|
||||
string (REGEX MATCH "^${OCCT_PACKAGE}[_.]" IS_HEADER_MATHCING_PACKAGE "${OCCT_FILE_NAME}")
|
||||
if (NOT IS_HEADER_MATHCING_PACKAGE)
|
||||
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -355,12 +349,12 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
||||
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not presented in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not present in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
||||
else()
|
||||
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is presented in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is present in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,23 +1,22 @@
|
||||
#qt
|
||||
|
||||
#looking for 3RDPARTY_QT_DIR variable used later in qt_macro.cmake
|
||||
SET(CSF_QtCore "QtCore")
|
||||
THIRDPARTY_PRODUCT("QT" "" "CSF_QtCore" "d")
|
||||
# Qt is searched manually first (just determine root)
|
||||
message (STATUS "Processing Qt 3-rd party")
|
||||
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
|
||||
if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
|
||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
|
||||
|
||||
list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_INCLUDE_DIR")
|
||||
list (REMOVE_ITEM 3RDPARTY_NO_LIBS "3RDPARTY_QT_LIBRARY_DIR")
|
||||
list (REMOVE_ITEM 3RDPARTY_NO_DLLS "3RDPARTY_QT_DLL_DIR")
|
||||
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
|
||||
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt")
|
||||
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
|
||||
endif()
|
||||
|
||||
UNSET (${3RDPARTY_QT_DLL} CACHE)
|
||||
UNSET (${3RDPARTY_QT_DLL_DIR} CACHE)
|
||||
UNSET (${3RDPARTY_QT_INCLUDE_DIR} CACHE)
|
||||
UNSET (${3RDPARTY_QT_LIBRARY} CACHE)
|
||||
UNSET (${3RDPARTY_QT_LIBRARY_DIR} CACHE)
|
||||
# Combine directory name with absolute path and show in GUI
|
||||
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
|
||||
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
|
||||
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
|
||||
|
||||
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
|
||||
# Without this setting find_package() will not work
|
||||
@@ -34,3 +33,9 @@ if (NOT ${Qt5_FOUND})
|
||||
else()
|
||||
#message (STATUS "Qt5 cmake configuration")
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)
|
||||
endif()
|
||||
|
@@ -24,6 +24,9 @@
|
||||
# load tools
|
||||
source [file join [file dirname [info script]] genconfdeps.tcl]
|
||||
|
||||
# proxy variable for implicit file path normalization
|
||||
set PRODUCTS_PATH_INPUT "$::PRODUCTS_PATH"
|
||||
|
||||
package require Tk
|
||||
|
||||
set aRowIter 0
|
||||
@@ -79,6 +82,11 @@ if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Micr
|
||||
lappend ::SYS_VC_LIST "vc142-uwp"
|
||||
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
|
||||
}
|
||||
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] } {
|
||||
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
|
||||
lappend ::SYS_VC_LIST "vclang"
|
||||
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
|
||||
}
|
||||
|
||||
# detect installed Visual Studio instances from global environment
|
||||
if { [info exists ::env(VS140COMNTOOLS)] } {
|
||||
@@ -190,7 +198,11 @@ proc wokdep:gui:UpdateList {} {
|
||||
}
|
||||
|
||||
if { "$::HAVE_ZLIB" == "true" } {
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "zlib" {"zlib"}
|
||||
set aCheckLib "z"
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set aCheckLib "zlib"
|
||||
}
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "$aCheckLib" {"zlib"}
|
||||
}
|
||||
if { "$::HAVE_LIBLZMA" == "true" } {
|
||||
set aCheckLib "lzma"
|
||||
@@ -199,13 +211,26 @@ proc wokdep:gui:UpdateList {} {
|
||||
}
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
|
||||
}
|
||||
if { "$::HAVE_E57" == "true" } {
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "e57" "e57/E57Foundation.h" "E57RefImpl" {"e57"}
|
||||
set aCheckLib "xerces-c"
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set aCheckLib "xerces-c_3"
|
||||
}
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "xerces-c" "xercesc/sax2/XMLReaderFactory.hpp" "$aCheckLib" {"xerces"}
|
||||
}
|
||||
if { "$::HAVE_RAPIDJSON" == "true" } {
|
||||
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
}
|
||||
|
||||
if { "$::CHECK_QT4" == "true" } {
|
||||
wokdep:SearchQt4 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
if {"$::BUILD_Inspector" == "true" } {
|
||||
set ::CHECK_QT "true"
|
||||
}
|
||||
|
||||
if { "$::CHECK_QT" == "true" } {
|
||||
wokdep:SearchQt anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
}
|
||||
|
||||
if { "$::CHECK_JDK" == "true" } {
|
||||
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
}
|
||||
@@ -225,9 +250,9 @@ proc wokdep:gui:BrowseVcVars {} {
|
||||
}
|
||||
|
||||
proc wokdep:gui:BrowsePartiesRoot {} {
|
||||
set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH -title "Choose a directory"]
|
||||
set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH_INPUT -title "Choose a directory"]
|
||||
if { "$aResult" != "" } {
|
||||
set ::PRODUCTS_PATH $aResult
|
||||
set ::PRODUCTS_PATH_INPUT $aResult
|
||||
wokdep:gui:UpdateList
|
||||
}
|
||||
}
|
||||
@@ -441,7 +466,7 @@ ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling he
|
||||
|
||||
#
|
||||
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
|
||||
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH -width 80
|
||||
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
|
||||
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
|
||||
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
|
||||
@@ -459,6 +484,9 @@ checkbutton .myFrame.myChecks.myFFmpegCheck -offvalue "false" -onvalue "true
|
||||
ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
|
||||
#checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList
|
||||
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
|
||||
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
|
||||
|
||||
checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
|
||||
ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing"
|
||||
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
|
||||
@@ -468,15 +496,19 @@ checkbutton .myFrame.myChecks.myZLibCheck -offvalue "false" -onvalue "true
|
||||
ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib"
|
||||
checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
|
||||
checkbutton .myFrame.myChecks.myE57Check -offvalue "false" -onvalue "true" -variable HAVE_E57 -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myE57Lbl -text "Use E57"
|
||||
|
||||
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
|
||||
|
||||
checkbutton .myFrame.myChecks.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4"
|
||||
checkbutton .myFrame.myChecks.myQtCheck -offvalue "false" -onvalue "true" -variable CHECK_QT -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myQtLbl -text "Search Qt"
|
||||
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myJDKLbl -text "Search JDK"
|
||||
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
checkbutton .myFrame.myChecks.myInspectorBuild -offvalue "false" -onvalue "true" -variable BUILD_Inspector -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myInspectorLbl -text "Build Inspector"
|
||||
}
|
||||
|
||||
# Additional headers search paths
|
||||
ttk::label .myFrame.myIncLbl -text "Additional headers search paths:" -padding {5 5 80 5}
|
||||
scrollbar .myFrame.myIncScrl -command ".myFrame.myIncList yview"
|
||||
@@ -580,8 +612,8 @@ if { "$::tcl_platform(os)" != "Darwin" } {
|
||||
grid .myFrame.myChecks.myZLibCheck -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myZLibLbl -row $aCheckRowIter -column 7 -sticky w
|
||||
|
||||
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 13 -sticky w
|
||||
grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
|
||||
|
||||
incr aCheckRowIter
|
||||
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
@@ -591,6 +623,9 @@ grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
} elseif { "$::tcl_platform(os)" == "Darwin" } {
|
||||
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
}
|
||||
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
|
||||
@@ -598,14 +633,16 @@ grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
|
||||
|
||||
incr aCheckRowIter
|
||||
if { "$::tcl_platform(os)" == "Darwin" } {
|
||||
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
incr aCheckRowIter
|
||||
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -sticky w
|
||||
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
grid .myFrame.myChecks.myInspectorBuild -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myInspectorLbl -row $aCheckRowIter -column 13 -sticky w
|
||||
}
|
||||
|
||||
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 7 -sticky w
|
||||
incr aCheckRowIter
|
||||
|
||||
# Additional headers search paths
|
||||
@@ -650,6 +687,7 @@ bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
|
||||
}
|
||||
|
||||
.myFrame.mySrchEntry configure -validate all -validatecommand {
|
||||
set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]
|
||||
#return [file exists "$::PRODUCTS_PATH"]
|
||||
wokdep:gui:UpdateList
|
||||
return 1
|
||||
|
@@ -68,7 +68,7 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
|
||||
}
|
||||
|
||||
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
|
||||
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
|
||||
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo BUILD_Inspector}
|
||||
foreach anEnvIter $THE_ENV_VARIABLES {
|
||||
set ${anEnvIter} "false"
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
@@ -85,11 +85,14 @@ if { "$tcl_platform(platform)" != "windows" } {
|
||||
set HAVE_D3D ""
|
||||
set HAVE_RelWithDebInfo ""
|
||||
}
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT } {
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
set ${anEnvIter} "$::env(${anEnvIter})"
|
||||
}
|
||||
}
|
||||
if { [info exists ::env(PRODUCTS_PATH)] } {
|
||||
set PRODUCTS_PATH [file normalize "$::env(PRODUCTS_PATH)"]
|
||||
}
|
||||
|
||||
if { [info exists ::env(CSF_OPT_INC)] } {
|
||||
set CSF_OPT_INC [split "$::env(CSF_OPT_INC)" $::SYS_PATH_SPLITTER]
|
||||
@@ -143,9 +146,12 @@ proc wokdep:SearchHeader {theHeader} {
|
||||
# Search library file in $::CSF_OPT_LIB* and standard paths
|
||||
proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
|
||||
if { "$theSearchPath" != "" } {
|
||||
set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath2 "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { "$::tcl_platform(platform)" != "windows" && [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
@@ -153,31 +159,42 @@ proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
|
||||
|
||||
# search in custom paths
|
||||
foreach aLibPath [set ::CSF_OPT_LIB$theBitness] {
|
||||
set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath2 "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { "$::tcl_platform(platform)" != "windows" && [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
}
|
||||
|
||||
# search in system
|
||||
if { "$::ARCH" == "$theBitness"} {
|
||||
set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath2 "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if { "$::tcl_platform(os)" == "Linux" } {
|
||||
if { "$theBitness" == "64" } {
|
||||
set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
|
||||
set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
|
||||
set aPath2 "/usr/lib/x86_64-linux-gnu/lib${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
} else {
|
||||
set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so"
|
||||
set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so"
|
||||
set aPath2 "/usr/lib/i386-linux-gnu/lib${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,7 +241,11 @@ proc wokdep:Preferred {theList theCmpl theArch} {
|
||||
|
||||
# keep only two first digits in "vc141"
|
||||
if { ! [regexp {^vc[0-9][0-9]} $theCmpl aCmpl] } {
|
||||
set aCmpl $theCmpl
|
||||
if { [regexp {^vclang} $theCmpl] } {
|
||||
set aCmpl vc14
|
||||
} else {
|
||||
set aCmpl $theCmpl
|
||||
}
|
||||
}
|
||||
|
||||
set aShortList {}
|
||||
@@ -614,7 +635,11 @@ proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
||||
|
||||
# keep only two first digits in "vc141"
|
||||
if { ! [regexp {^vc[0-9][0-9]} ${::VCVER} aVcLib] } {
|
||||
set aVcLib ${::VCVER}
|
||||
if { [regexp {^vclang} ${::VCVER}] } {
|
||||
set aVcLib vc14
|
||||
} else {
|
||||
set aVcLib ${::VCVER}
|
||||
}
|
||||
}
|
||||
|
||||
set isFound "true"
|
||||
@@ -997,8 +1022,8 @@ proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
||||
return "$isFound"
|
||||
}
|
||||
|
||||
# Search Qt4 libraries placement
|
||||
proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
|
||||
# Search Qt libraries placement
|
||||
proc wokdep:SearchQt {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
|
||||
upvar $theErrInc anErrInc
|
||||
upvar $theErrLib32 anErrLib32
|
||||
upvar $theErrLib64 anErrLib64
|
||||
@@ -1006,53 +1031,46 @@ proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
||||
upvar $theErrBin64 anErrBin64
|
||||
|
||||
set isFound "true"
|
||||
set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qmessagebox.h"]
|
||||
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt}*] "$::VCVER" "$::ARCH" ]
|
||||
set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qguiapplication.h"]
|
||||
if { "$aQMsgBoxHPath" == "" } {
|
||||
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$::ARCH" ]
|
||||
if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qmessagebox.h"] } {
|
||||
if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qguiapplication.h"] } {
|
||||
lappend ::CSF_OPT_INC "$aPath/include"
|
||||
lappend ::CSF_OPT_INC "$aPath/include/Qt"
|
||||
lappend ::CSF_OPT_INC "$aPath/include/QtGui"
|
||||
lappend ::CSF_OPT_INC "$aPath/include/QtCore"
|
||||
lappend ::CSF_OPT_INC "$aPath/include/QtWidgets"
|
||||
lappend ::CSF_OPT_INC "$aPath/include/QtXml"
|
||||
} else {
|
||||
if { [file exists "/usr/include/qt4/QtGui/qmessagebox.h"] } {
|
||||
lappend ::CSF_OPT_INC "/usr/include/qt4"
|
||||
lappend ::CSF_OPT_INC "/usr/include/qt4/Qt"
|
||||
lappend ::CSF_OPT_INC "/usr/include/qt4/QtGui"
|
||||
lappend ::CSF_OPT_INC "/usr/include/qt4/QtCore"
|
||||
} else {
|
||||
lappend anErrInc "Error: 'QtGui/qmessagebox.h' not found (Qt4)"
|
||||
lappend anErrInc "Error: 'QtGui/qguiapplication.h' not found"
|
||||
set isFound "false"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set aQtGuiLibName "QtGui"
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set aQtGuiLibName "QtGui4"
|
||||
set aQtGuiLibName "Qt5Gui"
|
||||
}
|
||||
|
||||
foreach anArchIter {64 32} {
|
||||
set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter"]
|
||||
if { "$aQMsgBoxLibPath" == "" } {
|
||||
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
|
||||
set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter" "$aPath/lib"]
|
||||
if { "$aQMsgBoxLibPath" != "" } {
|
||||
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
|
||||
} else {
|
||||
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt4)"
|
||||
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt)"
|
||||
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
|
||||
}
|
||||
}
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter"]
|
||||
set aQMsgBoxDllPath [wokdep:SearchBin "${aQtGuiLibName}.dll" "$anArchIter"]
|
||||
if { "$aQMsgBoxDllPath" == "" } {
|
||||
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
|
||||
set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter" "$aPath/bin"]
|
||||
set aQMsgBoxDllPath [wokdep:SearchBin "${aQtGuiLibName}.dll" "$anArchIter" "$aPath/bin"]
|
||||
if { "$aQMsgBoxDllPath" != "" } {
|
||||
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
|
||||
} else {
|
||||
lappend anErrBin$anArchIter "Error: 'QtGui4.dll' not found (Qt4)"
|
||||
lappend anErrBin$anArchIter "Error: '${aQtGuiLibName}.dll' not found (Qt)"
|
||||
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
|
||||
}
|
||||
}
|
||||
|
594
adm/genproj.tcl
@@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
# This file has been generated by genproj.tcl script from CASROOT/adm/templates/codeblocks.sh
|
||||
|
||||
export TARGET="cbp"
|
||||
|
||||
source ./env.sh "$1" "$TARGET"
|
||||
|
||||
if [ -e "/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks" ]; then
|
||||
/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/$WOKSTATION/cbp/OCCT.workspace
|
||||
/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/$WOKSTATION/cbp/__SOLUTION__.workspace
|
||||
else
|
||||
codeblocks ./adm/$WOKSTATION/cbp/OCCT.workspace
|
||||
codeblocks ./adm/$WOKSTATION/cbp/__SOLUTION__.workspace
|
||||
fi
|
||||
|
@@ -25,6 +25,7 @@ set "HAVE_D3D=false"
|
||||
set "HAVE_ZLIB=false"
|
||||
set "HAVE_LIBLZMA=false"
|
||||
set "HAVE_RAPIDJSON=false"
|
||||
set "HAVE_E57=false"
|
||||
set "CSF_OPT_INC="
|
||||
set "CSF_OPT_LIB32="
|
||||
set "CSF_OPT_LIB64="
|
||||
@@ -76,6 +77,9 @@ if "%VCVER:~-4%" == "-uwp" (
|
||||
set VCLIB=%VCLIB%-uwp
|
||||
set VCPROP=Universal
|
||||
)
|
||||
if "%VCFMT%" == "vclang" (
|
||||
set VCLIB=vc14
|
||||
)
|
||||
rem echo VCVER=%VCVER% VCFMT=%VCFMT% VCLIB=%VCLIB% VCPROP=%VCPROP%
|
||||
|
||||
rem ----- Parsing of Visual Studio platform -----
|
||||
@@ -101,6 +105,14 @@ if not "%DevEnvDir%" == "" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[15.0,15.99]" -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "DevEnvDir=%%i\Common7\IDE\"
|
||||
)
|
||||
) else if /I "%VCFMT%" == "vc142" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "DevEnvDir=%%i\Common7\IDE\"
|
||||
)
|
||||
) else if /I "%VCFMT%" == "vclang" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "DevEnvDir=%%i\Common7\IDE\"
|
||||
)
|
||||
) else if /I "%VCFMT%" == "gcc" (
|
||||
rem MinGW
|
||||
) else (
|
||||
@@ -112,6 +124,8 @@ if not "%DevEnvDir%" == "" (
|
||||
echo vc12 = VS 2013 ^(SP3^)
|
||||
echo vc14 = VS 2015
|
||||
echo vc141 = VS 2017
|
||||
echo vc142 = VS 2019
|
||||
echo vclang = VS 2019 with ClangCL toolset
|
||||
exit /B
|
||||
)
|
||||
|
||||
@@ -136,6 +150,16 @@ if /I "%VCFMT%" == "vc9" (
|
||||
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
)
|
||||
set "VCPlatformToolSet=v141"
|
||||
) else if /I "%VCFMT%" == "vc142" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
)
|
||||
set "VCPlatformToolSet=v142"
|
||||
) else if /I "%VCFMT%" == "vclang" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
)
|
||||
set "VCPlatformToolSet=ClangCL"
|
||||
) else if /I "%VCFMT%" == "gcc" (
|
||||
rem MinGW
|
||||
) else (
|
||||
@@ -165,6 +189,7 @@ if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
|
||||
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
|
||||
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
|
||||
if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%"
|
||||
if ["%HAVE_E57%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_E57" & set "CSF_DEFINES=HAVE_E57;%CSF_DEFINES%"
|
||||
|
||||
rem Eliminate VS warning
|
||||
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
|
||||
|
@@ -70,6 +70,10 @@ if not "%DevEnvDir%" == "" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[15.0,15.99]" -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "DevEnvDir=%%i\Common7\IDE\"
|
||||
)
|
||||
) else if /I "%VCFMT%" == "vc142" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "DevEnvDir=%%i\Common7\IDE\"
|
||||
)
|
||||
) else if /I "%VCFMT%" == "gcc" (
|
||||
rem MinGW
|
||||
) else (
|
||||
@@ -98,6 +102,11 @@ if /I "%VCFMT%" == "vc9" (
|
||||
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
)
|
||||
set "VCPlatformToolSet=v141"
|
||||
) else if /I "%VCFMT%" == "vc142" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
)
|
||||
set "VCPlatformToolSet=v142"
|
||||
) else if /I "%VCFMT%" == "gcc" (
|
||||
rem MinGW
|
||||
) else (
|
||||
|
@@ -15,6 +15,8 @@ export HAVE_VTK="false";
|
||||
export HAVE_GLES2="false";
|
||||
export HAVE_ZLIB="false";
|
||||
export HAVE_LIBLZMA="false";
|
||||
export HAVE_RAPIDJSON="false";
|
||||
export HAVE_E57="false";
|
||||
export MACOSX_USE_GLX="false";
|
||||
export CSF_OPT_INC=""
|
||||
export CSF_OPT_LIB32=""
|
||||
@@ -103,6 +105,8 @@ if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D
|
||||
if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
|
||||
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
|
||||
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
|
||||
if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi
|
||||
if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi
|
||||
# Option to compile OCCT with X11 libs on Mac OS X
|
||||
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
|
||||
|
||||
|
@@ -1,10 +1,11 @@
|
||||
@echo off
|
||||
rem This file has been generated by genproj.tcl script from CASROOT/adm/templates/msvc.bat
|
||||
|
||||
rem Setup environment
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
rem Define path to project file
|
||||
set "PRJFILE=%~dp0\adm\msvc\%VCVER%\OCCT.sln"
|
||||
set "PRJFILE=%~dp0\adm\msvc\%VCVER%\__SOLUTION__.sln"
|
||||
if not exist "%PRJFILE%" set "PRJFILE=%~dp0\adm\msvc\%VCVER%\Products.sln"
|
||||
if not "%4" == "" (
|
||||
set "PRJFILE=%4"
|
||||
|
@@ -159,7 +159,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
|
||||
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
|
||||
<OutputFile>.\..\..\..\win32\__VCVER__\bind\__TKNAM__.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\libd;$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
@@ -255,7 +255,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
|
||||
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
|
||||
<OutputFile>.\..\..\..\win64\__VCVER__\bind\__TKNAM__.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
|
@@ -149,7 +149,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
|
||||
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\libd;$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -238,7 +238,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
|
||||
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
# This file has been generated by genproj.tcl script from CASROOT/adm/templates/xcode.sh
|
||||
|
||||
export TARGET="xcd"
|
||||
|
||||
source ./env.sh "$1" "$TARGET"
|
||||
|
||||
open -a Xcode ./adm/mac/xcd/OCCT.xcworkspace
|
||||
open -a Xcode ./adm/mac/xcd/__SOLUTION__.xcworkspace
|
||||
|
@@ -14,6 +14,7 @@ overview/overview.md
|
||||
../samples/qt/AndroidQt/ReadMe.md
|
||||
../samples/java/jniviewer/ReadMe.md
|
||||
../samples/ios/UIKitSample/ReadMe.md
|
||||
../samples/webgl/ReadMe.md
|
||||
|
||||
tutorial/tutorial.md
|
||||
|
||||
|
@@ -10,7 +10,7 @@ products used by Open CASCADE Technology and samples on Linux platform.
|
||||
|
||||
The links for downloading the third-party products are available on the web site
|
||||
of OPEN CASCADE SAS at
|
||||
http://www.opencascade.com/content/3rd-party-components.
|
||||
https://www.opencascade.com/content/3rd-party-components.
|
||||
|
||||
There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
@@ -30,7 +30,7 @@ Tcl/Tk is required for DRAW test harness.
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_linux_2_1_2 Installation from sources: Tcl
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
|
||||
|
||||
@@ -53,7 +53,7 @@ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.ht
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_linux_2_1_3 Installation from sources: Tk
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
|
||||
|
||||
@@ -78,7 +78,7 @@ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.ht
|
||||
@subsection dev_guides__building_3rdparty_linux_2_2 FreeType
|
||||
|
||||
FreeType is required for text display in the 3D viewer.
|
||||
Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
|
||||
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
|
||||
|
||||
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
|
||||
|
||||
@@ -103,13 +103,13 @@ Download the necessary archive from http://sourceforge.net/projects/freetype/fil
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_1 TBB
|
||||
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org.
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
|
||||
To install, unpack the downloaded archive of TBB product.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
|
||||
|
||||
Download the necessary archive from http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
|
||||
|
||||
1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
|
||||
@@ -174,11 +174,11 @@ and unpack it. The directory with unpacked sources is further referred to as *F
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_4 VTK
|
||||
|
||||
You can download VTK sources from http://www.vtk.org/VTK/resources/software.html
|
||||
You can download VTK sources from https://www.vtk.org/VTK/resources/software.html
|
||||
|
||||
### The building procedure:
|
||||
|
||||
Download the necessary archive from http://www.vtk.org/VTK/resources/software.html and unpack it.
|
||||
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it.
|
||||
|
||||
1. Install or build *cmake* product from the source file.
|
||||
2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
|
||||
|
14
dox/dev_guides/building/3rdparty/3rdparty_osx.md
vendored
@@ -8,7 +8,7 @@ This document presents additional guidelines for building third-party products
|
||||
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
|
||||
|
||||
The links for downloading the third-party products are available
|
||||
on the web site of OPEN CASCADE SAS at http://www.opencascade.com/content/3rd-party-components.
|
||||
on the web site of OPEN CASCADE SAS at https://www.opencascade.com/content/3rd-party-components.
|
||||
|
||||
There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
@@ -27,7 +27,7 @@ Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with O
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_osx_2_1_2 Installation from sources: Tcl 8.5
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the *macosx* sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
|
||||
|
||||
@@ -50,7 +50,7 @@ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.ht
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_osx_2_1_3 Installation from sources: Tk 8.5
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the *macosx* sub-directory of the directory where the source files of Tk are located <i>(TK_SRC_DIR)</i>.
|
||||
|
||||
@@ -74,7 +74,7 @@ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.ht
|
||||
|
||||
FreeType is required for text display in the 3D viewer.
|
||||
|
||||
Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
|
||||
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
|
||||
|
||||
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
|
||||
|
||||
@@ -100,7 +100,7 @@ Download the necessary archive from http://sourceforge.net/projects/freetype/fil
|
||||
@subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
|
||||
|
||||
This third-party product is installed with binaries from the archive
|
||||
that can be downloaded from http://threadingbuildingblocks.org/.
|
||||
that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*)
|
||||
and pick the archive for Mac OS X platform.
|
||||
To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
|
||||
@@ -108,12 +108,12 @@ To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.
|
||||
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
|
||||
|
||||
Download the necessary archive from
|
||||
http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
|
||||
|
||||
Note that for building FreeImage on Mac OS X 10.7 you should replace *Makefile.osx*
|
||||
in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
|
||||
(http://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
|
||||
(https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
|
||||
|
||||
1. If you build FreeImage 3.15.x you can skip this step.
|
||||
Modify <i>FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:</i>
|
||||
|
@@ -8,7 +8,7 @@ This document presents guidelines for building third-party products used by Open
|
||||
|
||||
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
|
||||
|
||||
The links for downloading the third-party products are available on the web site of OPEN CASCADE SAS at http://www.opencascade.com/content/3rd-party-components.
|
||||
The links for downloading the third-party products are available on the web site of OPEN CASCADE SAS at https://www.opencascade.com/content/3rd-party-components.
|
||||
|
||||
There are two types of third-party products used by OCCT:
|
||||
|
||||
@@ -32,7 +32,7 @@ Tcl/Tk is required for DRAW test harness.
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_win_2_1_1 Installation from sources: Tcl
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. In the *win* sub-directory, edit file *buildall.vc.bat*:
|
||||
|
||||
@@ -85,7 +85,7 @@ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.ht
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_win_2_1_2 Installation from sources: Tk
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
Apply the same steps as described for building Tcl above, with the same INSTALLDIR.
|
||||
Note that Tk produces its own executable, called *wish*.
|
||||
@@ -94,7 +94,7 @@ You might need to edit default value of *TCLDIR* variable defined in *buildall.v
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_2_2 FreeType
|
||||
|
||||
FreeType is required for text display in a 3D viewer. You can download its sources from http://sourceforge.net/projects/freetype/files/
|
||||
FreeType is required for text display in a 3D viewer. You can download its sources from https://sourceforge.net/projects/freetype/files/
|
||||
|
||||
### The building procedure
|
||||
|
||||
@@ -148,7 +148,7 @@ FreeType is required for text display in a 3D viewer. You can download its sourc
|
||||
@subsection dev_guides__building_3rdparty_win_3_1 TBB
|
||||
|
||||
This third-party product is installed with binaries
|
||||
from the archive that can be downloaded from http://threadingbuildingblocks.org/.
|
||||
from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*) and pick the archive for Windows platform.
|
||||
|
||||
Unpack the downloaded archive of TBB product into the *3rdparty* folder.
|
||||
@@ -159,7 +159,7 @@ Further in this document, this folder is referred to as *tbb*.
|
||||
|
||||
This third-party product should be built as a dynamically loadable library (.dll file).
|
||||
You can download its sources from
|
||||
http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
|
||||
### The building procedure:
|
||||
|
||||
@@ -232,7 +232,7 @@ VTK is an open-source, freely available software system for 3D computer graphics
|
||||
|
||||
### The building procedure:
|
||||
|
||||
1. Download the necessary archive from http://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
|
||||
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
|
||||
|
||||
As a result, you will get a folder named, for example, <i>3rdparty\VTK-6.1.0.</i>
|
||||
|
||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 37 KiB |
@@ -10,9 +10,9 @@ The steps on Windows and Ubuntu are similar. There is the only one difference: m
|
||||
on Windows and native GNU make on Ubuntu.
|
||||
|
||||
Required tools (download and install if it is required):
|
||||
- CMake v3.7+ http://www.cmake.org/cmake/resources/software.html
|
||||
- CMake v3.7+ https://www.cmake.org/cmake/resources/software.html
|
||||
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
|
||||
- GNU Make: MinGW v4.82+ for Windows (http://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
|
||||
- GNU Make: MinGW v4.82+ for Windows (https://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -64,7 +64,7 @@ Then makefiles will appear in the build folder (e.g. <i> D:/occt/build-android <
|
||||
|
||||
Alternatively one may specify the values without a toolchain file:
|
||||
|
||||
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=15 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
|
||||
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
|
||||
|
||||
@figure{/dev_guides/building/android/images/android_image006.png}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ The list of required libraries depends on what OCCT modules will be used, and yo
|
||||
The typical minimum is **Freetype** (necessary for Visualization) and **Tcl/Tk** (for DRAW Test Harness).
|
||||
See "Third-party libraries" section in \ref OCCT_OVW_SECTION_5 "Overview" for a full list.
|
||||
|
||||
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from http://www.opencascade.com/content/3rd-party-components.
|
||||
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://www.opencascade.com/content/3rd-party-components.
|
||||
On Linux and OS X, it is recommended to use the version installed in the system natively.
|
||||
|
||||
You can also build third-party libraries from their sources:
|
||||
|
@@ -82,6 +82,7 @@ The following table gives the full list of environment variables used at the con
|
||||
|----------|------|---------|
|
||||
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
|
||||
| USE_FREEIMAGE | Boolean flag | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
|
||||
| USE_RAPIDJSON | Boolean flag | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
|
||||
| USE_TBB | Boolean flag | Indicates whether TBB 3rd party is used or not. TBB stands for Threading Building Blocks, the technology of Intel Corp, which comes with different mechanisms and patterns for injecting parallelism into your application. OCCT remains parallel even without TBB product |
|
||||
| USE_VTK | Boolean flag | Indicates whether VTK 3rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
|
||||
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
|
||||
|
@@ -18,7 +18,7 @@ If you have official distribution with project files included, you can use them
|
||||
|
||||
Before building OCCT, make sure to have all the required third-party libraries installed.
|
||||
|
||||
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from http://www.opencascade.com/content/3rd-party-components.
|
||||
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from https://www.opencascade.com/content/3rd-party-components.
|
||||
|
||||
You can also build third-party libraries from their sources, see @ref occt_dev_guides__building_3rdparty_windows for instructions.
|
||||
|
||||
@@ -37,6 +37,8 @@ If you have Visual Studio projects already available (pre-installed or generated
|
||||
| vc14-uwp | 2015 (14) | UWP (Universal Windows Platform) | vc14-uwp |
|
||||
| vc141 | 2017 (15) | Desktop (Windows API) | vc14 |
|
||||
| vc141-uwp | 2017 (15) | UWP (Universal Windows Platform) | vc14-uwp |
|
||||
| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
|
||||
| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
|
||||
|
||||
* *ARCH* -- architecture (32 or 64), affects only *PATH* variable for execution
|
||||
* <i>HAVE_*</i> -- flags to enable or disable use of optional third-party products
|
||||
|
@@ -82,7 +82,7 @@ To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the fol
|
||||
|
||||
3.Run the script
|
||||
~~~~~
|
||||
./draw_cbp.sh xcd [d]
|
||||
./draw.sh xcd [d]
|
||||
~~~~~
|
||||
|
||||
Option *d* is used if OCCT has been built in **Debug** mode.
|
||||
|
@@ -10,7 +10,7 @@ The purpose of this document is to describe standard workflow for processing con
|
||||
|
||||
Each contribution should have corresponding issue (bug, or feature, or integration request)
|
||||
registered in the MantisBT issue tracker system accessible by URL
|
||||
http://tracker.dev.opencascade.org.
|
||||
https://tracker.dev.opencascade.org.
|
||||
The issue is processed according to the described workflow.
|
||||
|
||||
@subsection occt_contribution_intro_access Access levels
|
||||
|
@@ -136,11 +136,70 @@ const char* GeomTools_Dump (void* theHandlePtr)
|
||||
Dump geometric object to cout.
|
||||
- *theHandlePtr* -- a pointer to the geometric variable (<i>Handle</i> to *Geom_Geometry* or *Geom2d_Curve* or descendant) to be set.
|
||||
|
||||
|
||||
@section occt_debug_dump_json Dump OCCT objects into Json
|
||||
|
||||
Many OCCT classes may dump the current state into the stream. This stream contains the information about the class field into the field value/s.
|
||||
It is possible to prepare recursive dump using corresponded macro for class fields. The depth of this recursion is defined by parameter of the dump.
|
||||
The object defines What parameters should be presented in the Dump. The usual way is to dump all object fields.
|
||||
|
||||
@subsection occt_debug_dump_json_object Implementation in object
|
||||
|
||||
Steps to prepare dump of the object into json:
|
||||
|
||||
1. Create method <b>DumpJson</b>. The method should accept the output stream and the depth for the fields dump.
|
||||
Depth, equal to zero means that only fields of this class should be dumped. Default value -1 means that whole tree of dump will be built recursively calling dump of all fields.
|
||||
|
||||
2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b> or <b>OCCT_DUMP_TRANSIENT_CLASS_BEGIN</b> (for Standard_Transient objects).
|
||||
This macro appends class name into output stream.
|
||||
|
||||
3. Add several macro to store field values.
|
||||
|
||||
The following macro are defined to cover the object parameters into json format:
|
||||
|
||||
| Name | Result in json |
|
||||
| :-------------------------- | :--------|
|
||||
| OCCT_DUMP_FIELD_VALUE_NUMERICAL | "field": value |
|
||||
| OCCT_DUMP_FIELD_VALUE_STRING | "field": "value" |
|
||||
| OCCT_DUMP_FIELD_VALUE_POINTER | "field": "pointer address" |
|
||||
| OCCT_DUMP_FIELD_VALUES_DUMPED | "field": { result of field->DumpJson(...) } |
|
||||
| OCCT_DUMP_FIELD_VALUES_NUMERICAL | "field": [value_1, ..., value_n]
|
||||
| OCCT_DUMP_FIELD_VALUES_STRING | "field": ["value_1", ..., "value_n"]
|
||||
| OCCT_DUMP_BASE_CLASS | "kind": { result of kind::DumpJson(...) } |
|
||||
|
||||
@subsection occt_debug_dump_json_draw Using in DRAW
|
||||
|
||||
In DRAW, key '-dumpJson' is used to dump an object.
|
||||
It is implemented in 'vaspect' and 'boundingbox' commands.
|
||||
|
||||
Json output for Bnd_OBB (using command 'bounding v -obb -dumpJson'):
|
||||
|
||||
~~~~~
|
||||
"Bnd_OBB": {
|
||||
"Center": {
|
||||
"gp_XYZ": [1, 2, 3]
|
||||
},
|
||||
"Axes[0]": {
|
||||
"gp_XYZ:" [1, 0, 0]
|
||||
},
|
||||
"Axes[1]": {
|
||||
"gp_XYZ:" [0, 1, 0]
|
||||
},
|
||||
"Axes[2]": {
|
||||
"gp_XYZ:" [0, 0, 1]
|
||||
},
|
||||
"HDims[0]": 0,
|
||||
"HDims[1]": 0,
|
||||
"HDims[2]": 0,
|
||||
"IsAABox": 1,
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@section occt_debug_vstudio Using Visual Studio debugger
|
||||
|
||||
@subsection occt_debug_vstudio_command Command window
|
||||
|
||||
Visual Studio debugger provides the Command Window (can be activated from menu <b>View / Other Windows / Command Window</b>), which can be used to evaluate variables and expressions interactively in a debug session (see http://msdn.microsoft.com/en-us/library/c785s0kz.aspx). Note that the Immediate Window can also be used but it has some limitations, e.g. does not support aliases.
|
||||
Visual Studio debugger provides the Command Window (can be activated from menu <b>View / Other Windows / Command Window</b>), which can be used to evaluate variables and expressions interactively in a debug session (see https://msdn.microsoft.com/en-us/library/c785s0kz.aspx). Note that the Immediate Window can also be used but it has some limitations, e.g. does not support aliases.
|
||||
|
||||
When the execution is interrupted by a breakpoint, you can use this window to call the above described functions in context of the currently debugged function. Note that in most cases you will need to specify explicitly context of the function by indicating the name of the DLL where it is defined.
|
||||
|
||||
@@ -310,3 +369,53 @@ Each counter has its name shown when the collected statistics are printed.
|
||||
In DRAW, use command *dperf* to print all performance statistics.
|
||||
|
||||
Note that performance counters are not thread-safe.
|
||||
|
||||
@section occt_debug_sanitizers Use of compiler sanitizers
|
||||
|
||||
GCC and Clang compilers provide options for instrumenting the code with the tools intended for detection of run-time errors, called sanitizers.
|
||||
This section provides some hints for using sanitizers for detecting possible errors in OCCT code.
|
||||
|
||||
@subsection occt_debug_sanitizers_linux Linux
|
||||
|
||||
Example of configuration steps for Ubuntu:
|
||||
|
||||
1. In CMake configuration:
|
||||
|
||||
- Use up-to-date version of the GCC or CLang compiler; make sure that if CMAKE_CXX_COMPILER is set to C++ compiler (e.g. "clang++-6.0") and CMAKE_C_COMPILER is set to C compiler (e.g. "clang-6.0")
|
||||
- Ensure that CMAKE_LINKER is set to the C++ linker bundled with compiler (e.g. clang++-6.0); this is important to avoid linking problems
|
||||
- For building with Address sanitizer, set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS to "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls"
|
||||
- For building with Undefined Behavior sanitizer, set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS to "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls"
|
||||
- Set CMAKE_BUILD_TYPE to RelWithDebInfo to get more informative stack traces on errors
|
||||
|
||||
2. Build as usual (make)
|
||||
|
||||
Be prepared that it works much slower than normal build and consumes more disk space.
|
||||
|
||||
3. Before running executable, make sure that "llvm-symbolizer" is in PATH; this is necessary to get human-readable stack traces. The tool must have exactly that name.
|
||||
|
||||
If it is installed in common folder (/usr/bin or similar) with different name, one option is to create a symlink, for instance:
|
||||
> sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer
|
||||
|
||||
Alternatively, add directory where actual llvm-symbolizer is located (such as /usr/lib/llvm-6.0/bin) to the PATH variable.
|
||||
|
||||
4. Set environment variable to disable memory leaks detection (they seem to be reported for every global variable at exit, not much useful):
|
||||
> export ASAN_OPTIONS=detect_leaks=0
|
||||
|
||||
5. Set environment variable CSF_CPULIMIT_FACTOR to reasonably large number to increase the time limits for program execution (used by OCCT tests) to compensate the performance penalty introduced by sanitizers:
|
||||
> export CSF_CPULIMIT_FACTOR=20
|
||||
|
||||
6. When using UBSan, set environment variable UBSAN_OPTIONS to get stack traces:
|
||||
> export UBSAN_OPTIONS=print_stacktrace=1
|
||||
|
||||
7. Run DRAW and perform tests as usual, keeping in mind that running with sanitizer is much heavier than normal build:
|
||||
> ./draw.sh relwithdeb <br>
|
||||
> Draw[]> testgrid -parallel 0
|
||||
|
||||
Note that when running tests under sanitizers, behavior may be different.
|
||||
Known problems (as of CLang 6.0) are:
|
||||
- Software signals (access violation etc.) are not handled
|
||||
- Heap memory usage always reports zero
|
||||
|
||||
@subsection occt_debug_sanitizers_windows Windows
|
||||
|
||||
Though CLang toolset is available in Visual Studio 2015 and newer, sanitizer do not seem to be available out of the box (last tested with VS 2019 16.2.3).
|
||||
|
@@ -12,15 +12,15 @@ This document provides practical guidelines for generation and editing of OCCT u
|
||||
You need to have the following software installed to generate the documentation.
|
||||
|
||||
**Tcl/Tk**
|
||||
Version 8.5 or 8.6: http://www.tcl.tk/software/tcltk/download.html
|
||||
Version 8.5 or 8.6: https://www.tcl.tk/software/tcltk/download.html
|
||||
|
||||
**Doxygen**
|
||||
Version 1.8.4 or above: http://www.stack.nl/~dimitri/doxygen/download.html
|
||||
Version 1.8.4 or above: http://www.doxygen.nl/download.html
|
||||
|
||||
**Dot**
|
||||
Part of Graphviz software, used by Doxygen for generation of class diagrams in Reference Manual: http://www.graphviz.org/Download..php
|
||||
Part of Graphviz software, used by Doxygen for generation of class diagrams in Reference Manual: https://www.graphviz.org/download/
|
||||
|
||||
**MiKTeX** or other package providing **pdflatex** command (only needed for generation of PDF documents): http://miktex.org/download
|
||||
**MiKTeX** or other package providing **pdflatex** command (only needed for generation of PDF documents): https://miktex.org/download
|
||||
|
||||
**Inkscape** (only needed for generation of PDF documents containing SVG images): http://www.inkscape.org/download
|
||||
|
||||
|
@@ -12,7 +12,7 @@ Guide to installing and using Git for OCCT development {#occt_dev_guides__git_gu
|
||||
and to facilitate the use of the official OCCT Git repository for code contribution to OCCT.
|
||||
|
||||
It can be useful to learn more about Git concepts and tools from a book a or manual.
|
||||
Many good books on Git can be found at http://git-scm.com/documentation
|
||||
Many good books on Git can be found at https://git-scm.com/documentation
|
||||
|
||||
For the experienced Git users it can be enough to read sections 1 and 3
|
||||
of this document to start working with the repository.
|
||||
@@ -21,7 +21,7 @@ Guide to installing and using Git for OCCT development {#occt_dev_guides__git_gu
|
||||
that describes how Git is used for processing contributions to OCCT.
|
||||
|
||||
This and related documents are available at the Resources page
|
||||
of the OCCT development portal at http://dev.opencascade.org/index.php?q=home/resources.
|
||||
of the OCCT development portal at https://dev.opencascade.org/index.php?q=home/resources.
|
||||
|
||||
@subsection occt_gitguide_1_2 Git URL
|
||||
|
||||
@@ -113,7 +113,7 @@ The official repository contains:
|
||||
|
||||
@subsubsection occt_gitguide_2_1_2 Installation and configuration of TortoiseGit
|
||||
|
||||
Download TortoiseGit distributive from http://code.google.com/p/tortoisegit/downloads/list.
|
||||
Download TortoiseGit distributive from https://tortoisegit.org/download/.
|
||||
Launch the installation.
|
||||
|
||||
* Select your SSH client. Choose option
|
||||
@@ -238,7 +238,7 @@ The official repository contains:
|
||||
|
||||
@subsection occt_gitguide_3_3 Adding public key in your account
|
||||
|
||||
Log in on the portal http://dev.opencascade.org and click on **My account** link to the right. If you have a Contributor status, you will see **SSH keys** tab to the right.
|
||||
Log in on the portal https://dev.opencascade.org and click on **My account** link to the right. If you have a Contributor status, you will see **SSH keys** tab to the right.
|
||||
|
||||
Click on that tab, then click **Add a public key**, and paste the text of the public key (see above sections on how to generate the key) into the text box.
|
||||
|
||||
@@ -496,7 +496,7 @@ To rebase your branch into a single commit, you need to do the following:
|
||||
|
||||
The changes made in the branch can be reviewed without direct access to Git, using GitWeb interface:
|
||||
|
||||
* Open GitWeb in your web browser: http://git.dev.opencascade.org/gitweb/?p=occt.git
|
||||
* Open GitWeb in your web browser: https://git.dev.opencascade.org/gitweb/?p=occt.git
|
||||
* Locate the branch you want to review among **heads** (click ‘…’ at the bottom of the page to see the full list).
|
||||
* Click **log** (or **shortlog**) to see the history of the branch.
|
||||
|
||||
|
@@ -347,7 +347,7 @@ The test group may contain *parse.rules* file. This file defines patterns used f
|
||||
|
||||
Each line in the file should specify a status (single word), followed by a regular expression delimited by slashes (*/*) that will be matched against lines in the test output log to check if it corresponds to this status.
|
||||
|
||||
The regular expressions should follow <a href="http://www.tcl.tk/man/tcl/TclCmd/re_syntax.htm">Tcl syntax</a>, with a special exception that "\b" is considered as word limit (Perl-style), in addition to "\y" used in Tcl.
|
||||
The regular expressions should follow <a href="https://www.tcl.tk/man/tcl/TclCmd/re_syntax.htm">Tcl syntax</a>, with a special exception that "\b" is considered as word limit (Perl-style), in addition to "\y" used in Tcl.
|
||||
|
||||
The rest of the line can contain a comment message, which will be added to the test report when this status is detected.
|
||||
|
||||
@@ -622,7 +622,7 @@ The new test created for an unsolved problem should return BAD. The new test cre
|
||||
|
||||
@subsection testmanual_3_6 Marking BAD cases
|
||||
|
||||
If the test produces an invalid result at a certain moment then the corresponding bug should be created in the OCCT issue tracker located at http://tracker.dev.opencascade.org, and the problem should be marked as TODO in the test script.
|
||||
If the test produces an invalid result at a certain moment then the corresponding bug should be created in the OCCT issue tracker located at https://tracker.dev.opencascade.org, and the problem should be marked as TODO in the test script.
|
||||
|
||||
The following statement should be added to such a test script:
|
||||
~~~~~
|
||||
|
@@ -439,7 +439,7 @@ class TColStd_Array1OfReal; -> #include <TColStd_Array1OfReal.hxx>
|
||||
~~~~~
|
||||
Handle_Class -> Handle(Class)
|
||||
~~~~~
|
||||
This change is not applied if the source or header file is recognized as containing the definition of Qt class with signals or slots, to avoid possible compilation errors of MOC files caused by inability of MOC to recognize macros (see http://doc.qt.io/qt-4.8/signalsandslots.html).
|
||||
This change is not applied if the source or header file is recognized as containing the definition of Qt class with signals or slots, to avoid possible compilation errors of MOC files caused by inability of MOC to recognize macros (see https://doc.qt.io/qt-4.8/signalsandslots.html).
|
||||
The file is considered as defining a Qt object if it contains strings *Q_OBJECT* and either *slots:* or *signals:*.
|
||||
|
||||
4. Removes forward declarations of classes with names <i>Handle(C)</i> or *Handle_C*, replacing them either by forward declaration of its argument class, or (for files defining Qt objects) <i>\#include</i> statement for a header with the name of the argument class and extension .hxx:
|
||||
@@ -736,9 +736,9 @@ If you like to preserve the compatibility of your application code with OCCT ver
|
||||
If your application is essentially based on CDL, and you need to upgrade it to OCCT 7.0, you will very likely need to convert your application code to non-CDL form.
|
||||
This is a non-trivial effort; the required actions would depend strongly on the structure of the code and used CDL features.
|
||||
|
||||
The upgrade script and sources of a specialized WOK version used for OCCT code upgrade can be found in WOK Git repository in branch [CR0_700_2](http://git.dev.opencascade.org/gitweb/?p=occt-wok.git;a=log;h=refs/heads/CR0_700_2).
|
||||
The upgrade script and sources of a specialized WOK version used for OCCT code upgrade can be found in WOK Git repository in branch [CR0_700_2](https://git.dev.opencascade.org/gitweb/?p=occt-wok.git;a=log;h=refs/heads/CR0_700_2).
|
||||
|
||||
[Contact us](http://www.opencascade.com/contact/) if you need more help.
|
||||
[Contact us](https://www.opencascade.com/contact/) if you need more help.
|
||||
|
||||
@subsection upgrade_occt700_bspline Separation of BSpline cache
|
||||
|
||||
@@ -1584,10 +1584,6 @@ To use the custom printer in OCAF, it can be either added to default messenger o
|
||||
@subsection upgrade_740_BRepPrimAPI_MakeRevol Changes in BRepPrimAPI_MakeRevol algorithm
|
||||
Previously the algorithm could create a shape with the same degenerated edge shared between some faces. Now it is prevented. The algorithm creates the different copy of this edge for each face. The method *Generated(...)* has been changed in order to apply restriction to the input shape: input shape can be only of type VERTEX, EDGE, FACE or SOLID. For input shape of another type the method always returns empty list.
|
||||
|
||||
@subsection upgrade_740_extremaalgo Changes in behavior of Extrema algorithms
|
||||
|
||||
Since OCCT 7.4.0 exception is thrown on the attempt of taking points in case of infinite number of solution (IsParallel status). Request of distances is available as before. Method NbExt() always returns 1 in such cases.
|
||||
|
||||
@subsection upgrade_740_removed Removed features
|
||||
* The following methods of the class *BRepAlgoAPI_BooleanOperation* have been removed as obsolete or replaced:
|
||||
- *BuilderCanWork* can be replaced with *IsDone* or *HasErrors* method.
|
||||
@@ -1815,6 +1811,34 @@ Forward declarations of *Prs3d_Presentation* should be corrected, since it is no
|
||||
|
||||
Proxy classes *SelectBasics_SensitiveEntity* and *SelectBasics_EntityOwner* have been removed - *Select3D_SensitiveEntity* and *SelectMgr_EntityOwner* should be now used directly instead.
|
||||
|
||||
@subsection upgrade_740_offset Polygon offset defaults
|
||||
|
||||
*Graphic3d_PolygonOffset* default constructor has been corrected to define Units=1 instead of Units=0.
|
||||
Default polygon offset settings Mode=Aspect_POM_Fill + Factor=1 + Units=1 are intended to push triangulation
|
||||
(Shaded presentation) a little bit behind of lines (Wireframe and Face Edges)
|
||||
for reducing z-fighting effect of Shaded+Wireframe combination.
|
||||
The change in defaults (Units changed from 0 to 1) is intended to cover scenario when camera direction is perpendicular to model plane (like 2D view).
|
||||
|
||||
Application observing unexpected visual difference on this change should consider customizing this property within AIS_InteractiveContext default attributes
|
||||
or on per-presentation basis via *Graphic3d_Aspects::SetPolygonOffset()* methods.
|
||||
|
||||
@subsection upgrade_740_zlayer Adding ZLayers in given position
|
||||
|
||||
Interface of insertion ZLayer in the viewer has been improved with ability to insert new layer before or after existing one.
|
||||
Previously undocumented behavior of *V3d_Viewer::AddZlayer()* method has been corrected to insert new layer before *Graphic3d_ZLayerId_Top*.
|
||||
Applications might need revising their custom layers creation code and specify precisely their order with new methods *V3d_Viewer::InsertLayerBefore()* and *V3d_Viewer::InsertLayerAfter()*.
|
||||
|
||||
@subsection upgrade_740_enum_changed Modified enumerations
|
||||
|
||||
Applications using integer values of the following enumerations in persistence
|
||||
should be corrected as these enumerations have been modified:
|
||||
|
||||
| Name |
|
||||
| :----- |
|
||||
| AIS_TypeOfAttribute |
|
||||
| Aspect_InteriorStyle |
|
||||
| Font_FontAspect |
|
||||
|
||||
@subsection upgrade_740_geproj Custom defines within env.bat
|
||||
|
||||
*env.bat* produced by Visual Studio project generator *genproj.bat* has been modified so that *%CSF_DEFINES%* variable is reset to initial state.
|
||||
@@ -1833,3 +1857,80 @@ The following API changes have been made:
|
||||
@subsection upgrade_740_stdnamespace Standard_Stream.hxx no more has "using std::" statements
|
||||
*Standard_Stream.hxx* header, commonly included by other OCCT header files, does no more add entities from *std namespace* related to streams (like *std::cout*, *std::istream* and others) into global namespace.
|
||||
The application code relying on this matter should be updated to either specify std namespace explicitly (like std::cout) or add "using std::" statements locally.
|
||||
|
||||
@section upgrade_occt750 Upgrade to OCCT 7.5.0
|
||||
|
||||
@subsection upgrade_750_srgb_color RGB color definition
|
||||
|
||||
OCCT 3D Viewer has been improved to properly perform lighting using in linear RGB color space and then convert result into non-linear gamma-shifted sRGB color space before displaying on display.
|
||||
This change affects texture mapping, material definition and color definition.
|
||||
|
||||
Previously *Quantity_Color* definition was provided with unspecified RGB color space.
|
||||
In practice, mixed color spaces have been actually used, with non-linear sRGB prevailing in general.
|
||||
Since OCCT 7.5.0, *Quantity_Color* now specifies that components are defined in linear RGB color space.
|
||||
|
||||
This change affects following parts:
|
||||
* Standard colors defined by *Quantity_NameOfColor* enumeration have been converted into linear RGB values within Quantity_Color construction.
|
||||
* Application may use new enumeration value *Quantity_TOC_sRGB* for passing/fetching colors in sRGB color space,
|
||||
which can be useful for interoperation with color picking widgets (returning 8-bit integer values within [0..255] range)
|
||||
or for porting colors constants within old application code without manual conversion.
|
||||
* *Graphic3d_MaterialAspect* color components are now expected in linear RGB color space,
|
||||
and standard OCCT materials within *Graphic3d_NameOfMaterial* enumeration have been updated accordingly.
|
||||
* Texture mapping now handles new *Graphic3d_TextureRoot::IsColorMap()* for interpreting content in linear RGB or sRGB color space.
|
||||
It is responsibility of user specifying this flag correctly. The flag value is TRUE by default.
|
||||
* Method *Image_PixMap::PixelColor()* has been extended with a new Boolean flag for performing linearization of non-linear sRGB.
|
||||
This flag is FALSE by default; application should consider passing TRUE instead for further handling *Quantity_Color* properly as linear RGB values.
|
||||
|
||||
@subsection upgrade_750_aspectwindow Aspect_Window interface change
|
||||
|
||||
Unexpected const-ness of Aspect_Window::DoResize() method has been removed, so that application classes implementing this interface should be updated accordingly.
|
||||
|
||||
@subsection upgrade_750_rename Renaming of types
|
||||
|
||||
Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity.
|
||||
|
||||
@subsection upgrade_750_tkv3d TKV3d/TKService toolkits changes
|
||||
|
||||
The following changes could be highlighted while porting:
|
||||
* *Prs3d::GetDeflection()* has been moved to *StdPrs_ToolTriangulatedShape::GetDeflection()*.
|
||||
* *Prs3d_ShapeTool* has been moved to *StdPrs_ShapeTool*.
|
||||
* *StdSelect_ViewerSelector3d* has been moved to *SelectMgr_ViewerSelector3d*.
|
||||
* *Font_BRepFont* has been moved to *StdPrs_BRepFont*.
|
||||
* Visualization classes now use *TopLoc_Datum3D* (from *TKMath*) instead of *Geom_Transformation* (from *TKG3d*) as smart pointer to *gp_Trsf*.
|
||||
This is rather an internal change, but some applications might need to be updated.
|
||||
|
||||
@subsection upgrade_750_hlrangle Prs3d_Drawer deviation angle
|
||||
|
||||
Properties Prs3d_Drawer::HLRAngle() and Prs3d_Drawer::HLRDeviationCoefficient() have been removed from classes *Prs3d_Drawer*, *AIS_Shape* and *AIS_InteractiveContext*.
|
||||
Prs3d_Drawer::DeviationAngle() should be now used instead of Prs3d_Drawer::HLRAngle() and Prs3d_Drawer::DeviationCoefficient() instead of Prs3d_Drawer::HLRDeviationCoefficient().
|
||||
The default value of Prs3d_Drawer::DeviationAngle() property has been changed from 12 to 20 degrees to match removed Prs3d_Drawer::HLRAngle(), previously used as input for triangulation algorithm.
|
||||
|
||||
@subsection upgrade_750_hlrprs Changes in HLR presentation API
|
||||
|
||||
Methods computing HLR presentation within *PrsMgr_PresentableObject::Compute()* have been renamed to *PrsMgr_PresentableObject::computeHLR()*
|
||||
and now accept *Graphic3d_Camera* object instead of removed *Prs3d_Projector*.
|
||||
|
||||
@subsection upgrade_750_dimensions Dimension and Relation presentations moved from AIS to PrsDim
|
||||
|
||||
Presentation classes displaying Dimensions and Relations have been moved from *AIS* package to *PrsDim*.
|
||||
Corresponding classes should be renamed in application code (like *AIS_LengthDimension* -> *PrsDim_LengthDimension*).
|
||||
|
||||
@subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change
|
||||
|
||||
The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly.
|
||||
|
||||
|
||||
@subsection upgrade_750_Booleans Changes in Boolean operations algorithm
|
||||
|
||||
* TreatCompound method has been moved from *BOPAlgo_Tools* to *BOPTools_AlgoTools*. Additionally, the map parameter became optional:
|
||||
~~~~
|
||||
void BOPTools_AlgoTools::TreatCompound (const TopoDS_Shape& theS,
|
||||
TopTools_ListOfShape& theLS,
|
||||
TopTools_MapOfShape* theMap = NULL);
|
||||
~~~~
|
||||
|
||||
@subsection upgrade_750_Adaptor2d_OffsetCurve Offset direction change
|
||||
|
||||
Offset direction, which used in class Adaptor2d_OffsetCurve for evaluating values and derivatives of offset curve is unified for offset direction used in class Geom2d_OffsetCurve: now offset direction points to outer ("right") side of base curve instead of the previously used inner ("left") side. Old usage of class in any application should be changed something like that:
|
||||
|
||||
Adaptor2d_OffsetCurve aOC(BaseCurve, Offset) --> Adaptor2d_OffsetCurve aOC(BaseCurve, -Offset)
|
||||
|
BIN
dox/overview/images/sample_webgl.png
Normal file
After Width: | Height: | Size: 74 KiB |
@@ -109,7 +109,7 @@ implementation of 3D viewer. OpenGL specification is developed by the
|
||||
Khronos group, https://www.khronos.org/opengl/. OCCT code includes header
|
||||
file *glext.h* obtained from Khronos web site.
|
||||
|
||||
**VTK** -- The **Visualization Toolkit (VTK)** is an open-source, freely available software system for 3D computer graphics, image processing and visualization. OCCT VIS component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library. If you need further information on VTK, refer to VTK Homepage http://www.vtk.org/.
|
||||
**VTK** -- The **Visualization Toolkit (VTK)** is an open-source, freely available software system for 3D computer graphics, image processing and visualization. OCCT VIS component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library. If you need further information on VTK, refer to VTK Homepage https://www.vtk.org/.
|
||||
|
||||
**Doxygen** developed by Dimitri van Heesch is open source documentation system for
|
||||
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
|
||||
@@ -120,7 +120,7 @@ If you need further information on Doxygen, refer to https://www.stack.nl/~dimit
|
||||
Graph visualization is representiation of structured information as diagrams of abstract graphs and networks.
|
||||
This product is used together with Doxygen in Open CASCADE Technology for automatic creation of Technical Documentation
|
||||
(generation of dependency graphs). Current versions of Graphviz are licensed on an open source
|
||||
basis under The Eclipse Public License (EPL) (http://www.graphviz.org/License.php).
|
||||
basis under The Eclipse Public License (EPL) (https://www.graphviz.org/license/).
|
||||
|
||||
**Inno Setup** is a free script-driven installation system created in CodeGear Delphi by Jordan Russell.
|
||||
In OCCT Inno Setup is used to create Installation Wizard on Windows.
|
||||
@@ -130,10 +130,10 @@ It is licensed under Inno Setup License (http://www.jrsoftware.org/files/is/lice
|
||||
and others used by multimedia applications. This library is developed by Hervé Drolon and Floris van den Berg.
|
||||
FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit or 64-bit versions of Windows,
|
||||
and cross-platform (works both with Linux and Mac OS X). FreeImage is optionally used by OCCT to work
|
||||
with images, on conditions of the FreeImage Public License (FIPL) (http://freeimage.sourceforge.net/freeimage-license.txt).
|
||||
with images, on conditions of the FreeImage Public License (FIPL) (https://freeimage.sourceforge.net/freeimage-license.txt).
|
||||
|
||||
**David M. Gay's floating point routines** (dtoa.c) are used for fast reading of floating point values from text strings.
|
||||
These routines are available under MIT-like license (see http://www.netlib.org/fp/).
|
||||
These routines are available under MIT-like license (see https://www.netlib.org/fp/).
|
||||
|
||||
**CMake** is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.
|
||||
OCCT uses CMake as a build system. CMake is available under BSD 3-Clause license. See more at https://cmake.org/
|
||||
@@ -150,6 +150,12 @@ FFmpeg is optionally used by OCCT for video recording, on LGPL conditions (https
|
||||
for generation of User and Developer Guides in PDF format. See https://miktex.org for information
|
||||
on this tool.
|
||||
|
||||
**RapidJSON** is an Open Source JSON parser and generator for C++.
|
||||
RapidJSON is optionally used by OCCT for reading glTF files (https://rapidjson.org/).
|
||||
|
||||
**DejaVu** fonts are a font family based on the Vera Fonts under a permissive license (MIT-like, https://dejavu-fonts.github.io/License.html).
|
||||
DejaVu Sans (basic Latin sub-set) is used by OCCT as fallback font when no system font is available.
|
||||
|
||||
Adobe Systems, Inc. provides **Adobe Reader**, which can be used to view files in Portable Document Format (PDF).
|
||||
|
||||
@section OCCT_OVW_SECTION_3 Documentation
|
||||
@@ -204,13 +210,13 @@ for which OCCT is certified to work.
|
||||
|
||||
| OS | Compiler |
|
||||
| --------- | ----------- |
|
||||
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1<sup>1</sup>, 2012 Update 4, 2013 Update 5, 2015, 2017 <br> GCC 4.3+ (Mingw-w64)|
|
||||
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
|
||||
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
|
||||
| OS X / macOS | XCode 6 or newer |
|
||||
| Android | NDK r10, GNU gcc 4.8 or newer |
|
||||
| Web | Emscripten SDK 1.39 or newer (CLang) |
|
||||
|
||||
1) VC++ 10 64-bit is used for regular testing and for building
|
||||
binary package of official release of OCCT on Windows.
|
||||
1) VC++ 141 64-bit is used for regular testing and for building binary package of official release of OCCT on Windows.
|
||||
|
||||
@subsection overview_req_libs Third-party libraries
|
||||
|
||||
@@ -222,9 +228,9 @@ for which OCCT is certified to work.
|
||||
| Freetype (for text rendering) | FreeType 2.4.11-2.7.1 https://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.17.0+ https://sourceforge.net/projects/freeimage/files |
|
||||
| FFmpeg (optional, for video recording) | FFmpeg 3.1+ https://www.ffmpeg.org/download.html |
|
||||
| RapidJSON (optional, for reading glTF) | RapidJSON 1.1+ http://rapidjson.org/ |
|
||||
| RapidJSON (optional, for reading glTF) | RapidJSON 1.1+ https://rapidjson.org/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 4.x or 5.x https://www.threadingbuildingblocks.org/ |
|
||||
| VTK (for VTK Integration Services | VTK 6.1+ http://www.vtk.org/download/ |
|
||||
| VTK (for VTK Integration Services | VTK 6.1+ https://www.vtk.org/download/ |
|
||||
| Doxygen (optional for building documentation) | Doxygen 1.8.5+ https://www.stack.nl/~dimitri/doxygen/download.html |
|
||||
|
||||
@subsection overview_req_hw Hardware
|
||||
@@ -282,13 +288,13 @@ When the installation is complete, you will find the directories for 3rd party p
|
||||
|
||||
@figure{/overview/images/overview_3rdparty.png}
|
||||
|
||||
The contents of the OCCT-7.3.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
The contents of the OCCT-7.4.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
|
||||
@figure{/overview/images/overview_installation.png, "The directory tree"}
|
||||
|
||||
* **adm** This folder contains administration files, which allow rebuilding OCCT;
|
||||
* **adm/cmake** This folder contains files of CMake building procedure;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2010, 2012, 2013, 2015 and 2017 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2010, 2012, 2013, 2015, 2017 and 2019 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
|
||||
* **doc** This folder contains OCCT documentation in HTML and PDF format;
|
||||
* **dox** This folder contains sources of OCCT documentation in plain text (MarkDown) format;
|
||||
@@ -307,7 +313,7 @@ To run any Open CASCADE Technology application you need to set the environment v
|
||||
|
||||
You can define the environment variables with env.bat script located in the
|
||||
$CASROOT folder. This script accepts two arguments to be used:
|
||||
the version of Visual Studio (vc10 -- vc141) and the architecture (win32 or win64).
|
||||
the version of Visual Studio (vc10 -- vc142) and the architecture (win32 or win64).
|
||||
|
||||
The additional environment settings necessary for compiling OCCT libraries and samples
|
||||
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
|
||||
@@ -330,7 +336,7 @@ The scripts are located in the OCCT root folder.
|
||||
|
||||
* **CASROOT** is used to define the root directory of Open CASCADE Technology;
|
||||
* **PATH** is required to define the path to OCCT binaries and 3rdparty folder;
|
||||
* **LD_LIBRARY_PATH** is required to define the path to OCCT libraries (on UNIX platforms only);
|
||||
* **LD_LIBRARY_PATH** is required to define the path to OCCT libraries (on UNIX platforms only; **DYLD_LIBRARY_PATH** variable in case of macOS);
|
||||
* **MMGT_OPT** (optional) if set to 1, the memory manager performs optimizations as described below; if set to 2,
|
||||
Intel (R) TBB optimized memory manager is used; if 0 (default), every memory block is allocated
|
||||
in C memory heap directly (via malloc() and free() functions).
|
||||
@@ -411,8 +417,7 @@ Remarks:
|
||||
|
||||
**On Linux:**
|
||||
|
||||
1. If OCCT was built by Code::Blocks use <i>$CASROOT/draw_cbp.sh</i> file to launch *DRAWEXE* executable;
|
||||
2. If OCCT was built by Automake use <i>$CASROOT/draw_amk.sh</i> file to launch *DRAWEXE* executable;
|
||||
* If OCCT was built by Code::Blocks use <i>$CASROOT/draw.sh</i> file to launch *DRAWEXE* executable.
|
||||
|
||||
Draw[1]> prompt appears in the command window
|
||||
|
||||
@@ -568,3 +573,11 @@ There is a sample demonstrating usage of OCCT on iOS with Apple UIKit framework.
|
||||
@figure{/overview/images/sample_ios_uikit.png}
|
||||
|
||||
See \subpage occt_samples_ios_uikit "iOS sample Readme" for details.
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_6 Web
|
||||
|
||||
WebGL Viewer sample demonstrating usage of OCCT 3D Viewer in Web browser with Emscripten SDK can be found in `samples/webgl`.
|
||||
|
||||
@figure{/overview/images/sample_webgl.png}
|
||||
|
||||
See \subpage occt_samples_webgl "WebGL sample Readme" for details.
|
||||
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -48,6 +48,6 @@ LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
|
||||
# Define alias for inserting images in uniform way (both HTML and PDF)
|
||||
ALIASES += figure{1}="\image latex \1"
|
||||
ALIASES += figure{2}="\image latex \1 \2"
|
||||
ALIASES += figure{3}="\image latex \1 \2 width=\3"
|
||||
ALIASES += figure{1}="\image latex \1 \n"
|
||||
ALIASES += figure{2}="\image latex \1 \2 \n"
|
||||
ALIASES += figure{3}="\image latex \1 \2 width=\3 \n"
|
||||
|
@@ -58,7 +58,7 @@ This module also provides a variety of general-purpose services, such as:
|
||||
|
||||
See the details in @ref occt_user_guides__foundation_classes "Foundation Classes User's Guide"
|
||||
|
||||
See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also: our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@section OCCT_TOVW_SECTION_3 Modeling Data
|
||||
|
||||
@@ -90,7 +90,7 @@ See the details in @ref occt_user_guides__modeling_data "Modeling Data User's Gu
|
||||
3D geometric models can be stored in OCCT native BREP format.
|
||||
See @ref occt_user_guides__brep_wp "BREP Format Description White Paper" for details on the format.
|
||||
|
||||
See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also: our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@section OCCT_TOVW_SECTION_4 Modeling Algorithms
|
||||
|
||||
@@ -149,7 +149,7 @@ See @ref occt_user_guides__boolean_operations "Boolean Operations" User's Guide
|
||||
|
||||
See the details in @ref occt_user_guides__modeling_algos "Modeling Algorithms User's Guide".
|
||||
|
||||
See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also: our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@section OCCT_TOVW_SECTION_4a Mesh
|
||||
|
||||
@@ -163,8 +163,8 @@ Open CASCADE Technology includes two mesh converters:
|
||||
- STL converter translates Open CASCADE shapes to STL files. STL (STtereoLithography) format is widely used for rapid prototyping (3D printing).
|
||||
|
||||
Open CASCADE SAS also offers Advanced Mesh Products:
|
||||
- <a href="http://www.opencascade.com/content/mesh-framework">Open CASCADE Mesh Framework (OMF)</a>
|
||||
- <a href="http://www.opencascade.com/content/express-mesh">Express Mesh</a>
|
||||
- <a href="https://www.opencascade.com/content/mesh-framework">Open CASCADE Mesh Framework (OMF)</a>
|
||||
- <a href="https://www.opencascade.com/content/express-mesh">Express Mesh</a>
|
||||
|
||||
@figure{/technical_overview/images/0003.png}
|
||||
|
||||
@@ -208,7 +208,7 @@ For more details, see @ref occt_user_guides__visualization "Visualization User's
|
||||
|
||||
The visualization of OCCT topological shapes by means of VTK library provided by VIS component is described in a separate @ref occt_user_guides__vis "VTK Integration Services" User's Guide.
|
||||
|
||||
See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also: our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
|
||||
@section OCCT_TOVW_SECTION_6 Data Exchange
|
||||
@@ -222,12 +222,14 @@ See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-l
|
||||
* **Standardized Data Exchange** interfaces allow querying and examining the input file, converting its contents to a CAD model and running validity checks on a fully translated shape. The following formats are currently supported.
|
||||
* @ref occt_user_guides__step "STEP" (AP203 : Mechanical Design, this covers General 3D CAD; AP214: Automotive Design)
|
||||
* @ref occt_user_guides__iges "IGES" (up to 5.3)
|
||||
* VRML and STL meshes.
|
||||
* glTF, OBJ, VRML and STL meshes.
|
||||
* @ref occt_user_guides__xde "Extended data exchange" (XDE) allows translating additional attributes attached to geometric data (colors, layers, names, materials etc).
|
||||
* <a href="http://www.opencascade.com/content/advanced-data-exchange-components">Advanced Data Exchange Components</a> are available in addition to standard Data Exchange interfaces to support interoperability and data adaptation (also using @ref OCCT_TOVW_SECTION_6a "Shape Healing") with CAD software using the following proprietary formats:
|
||||
* <a href="http://www.opencascade.com/content/acis-sat-import-export">ACIS SAT</a>
|
||||
* <a href="http://www.opencascade.com/content/parasolid-import">Parasolid</a>
|
||||
* <a href="http://www.opencascade.com/content/dxf-import-export">DXF</a>
|
||||
* <a href="https://www.opencascade.com/content/advanced-data-exchange-components">Advanced Data Exchange Components</a> are available in addition to standard Data Exchange interfaces to support interoperability and data adaptation (also using @ref OCCT_TOVW_SECTION_6a "Shape Healing") with CAD software using the following proprietary formats:
|
||||
* <a href="https://www.opencascade.com/content/acis-sat-import-export">ACIS SAT</a>
|
||||
* <a href="https://www.opencascade.com/content/parasolid-import">Parasolid</a>
|
||||
* <a href="https://www.opencascade.com/content/dxf-import-export">DXF</a>
|
||||
* <a href="https://www.opencascade.com/content/ifc-import">IFC</a>
|
||||
* <a href="https://www.opencascade.com/content/jt-import-export">JT</a>
|
||||
|
||||
These components are based on the same architecture as interfaces with STEP and IGES.
|
||||
|
||||
@@ -265,7 +267,7 @@ Each sub-domain of Shape Healing has its own scope of functionality:
|
||||
|
||||
For more details, refer to @ref occt_user_guides__shape_healing "Shape Healing User's guide".
|
||||
|
||||
See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also: our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
|
||||
@section OCCT_TOVW_SECTION_7 Application Framework
|
||||
@@ -287,7 +289,7 @@ OCAF organizes and embeds these attributes in a document. OCAF documents, in the
|
||||
|
||||
For more details, see @ref occt_user_guides__ocaf "OCAF User's Guide".
|
||||
|
||||
See also: our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also: our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
|
||||
@section OCCT_TOVW_SECTION_8 Draw Test Harness
|
||||
|
@@ -701,7 +701,7 @@ Congratulations! Your bottle is complete. Here is the result snapshot of the Tut
|
||||
@figure{/tutorial/images/tutorial_image019.png,"",320}
|
||||
|
||||
We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
|
||||
If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at http://www.opencascade.com/content/technology-support. Our professional services can maximize the power of your Open CASCADE Technology applications.
|
||||
If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at https://www.opencascade.com/content/technology-support. Our professional services can maximize the power of your Open CASCADE Technology applications.
|
||||
|
||||
|
||||
@section sec6 Appendix
|
||||
|
@@ -5,7 +5,7 @@ Foundation Classes {#occt_user_guides__foundation_classes}
|
||||
|
||||
@section occt_fcug_1 Introduction
|
||||
|
||||
This manual explains how to use Open CASCADE Technology (**OCCT**) Foundation Classes. It provides basic documentation on foundation classes. For advanced information on foundation classes and their applications, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
This manual explains how to use Open CASCADE Technology (**OCCT**) Foundation Classes. It provides basic documentation on foundation classes. For advanced information on foundation classes and their applications, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
Foundation Classes provide a variety of general-purpose services such as automated dynamic memory management (manipulation of objects by handle), collections, exception handling, genericity by down-casting and plug-in creation.
|
||||
|
||||
@@ -183,12 +183,12 @@ The table below presents the equivalence existing between C++ fundamental types
|
||||
| int | Standard_Integer |
|
||||
| double | Standard_Real |
|
||||
| float | Standard_ShortReal |
|
||||
| unsigned int | Standard_Boolean |
|
||||
| bool | Standard_Boolean |
|
||||
| char | Standard_Character |
|
||||
| short | Standard_ExtCharacter |
|
||||
| char16_t | Standard_ExtCharacter |
|
||||
| char\* | Standard_CString |
|
||||
| void\* | Standard_Address |
|
||||
| short\* | Standard_ExtString |
|
||||
| char16_t\* | Standard_ExtString |
|
||||
|
||||
\* The types with asterisk are pointers.
|
||||
|
||||
@@ -197,12 +197,12 @@ The table below presents the equivalence existing between C++ fundamental types
|
||||
* **Standard_Integer** : fundamental type representing 32-bit integers yielding negative, positive or null values. *Integer* is implemented as a *typedef* of the C++ *int* fundamental type. As such, the algebraic operations +, -, *, / as well as the ordering and equivalence relations <, <=, ==, !=, >=, > are defined on it.
|
||||
* **Standard_Real** : fundamental type representing real numbers with finite precision and finite size. **Real** is implemented as a *typedef* of the C++ *double* (double precision) fundamental type. As such, the algebraic operations +, -, *, /, unary- and the ordering and equivalence relations <, <=, ==, !=, >=, > are defined on reals.
|
||||
* **Standard_ShortReal** : fundamental type representing real numbers with finite precision and finite size. *ShortReal* is implemented as a *typedef* of the C++ *float* (simple precision) fundamental type. As such, the algebraic operations +, -, *, /, unary- and the ordering and equivalence relations <, <=, ==, !=, >=, > are defined on reals.
|
||||
* **Standard_Boolean** : fundamental type representing logical expressions. It has two values: *false* and *true*. *Boolean* is implemented as a *typedef* of the C++ *unsigned int* fundamental type. As such, the algebraic operations *and, or, xor* and *not* as well as equivalence relations == and != are defined on Booleans.
|
||||
* **Standard_Boolean** : fundamental type representing logical expressions. It has two values: *false* and *true*. *Boolean* is implemented as a *typedef* of the C++ *bool* fundamental type. As such, the algebraic operations *and, or, xor* and *not* as well as equivalence relations == and != are defined on Booleans.
|
||||
* **Standard_Character** : fundamental type representing the normalized ASCII character set. It may be assigned the values of the 128 ASCII characters. *Character* is implemented as a *typedef* of the C++ *char* fundamental type. As such, the ordering and equivalence relations <, <=, ==, !=, >=, > are defined on characters using the order of the ASCII chart (ex: A B).
|
||||
* **Standard_ExtCharacter** : fundamental type representing the Unicode character set. It is a 16-bit character type. *ExtCharacter* is implemented as a *typedef* of the C++ *short* fundamental type. As such, the ordering and equivalence relations <, <=, ==, !=, >=, > are defined on extended characters using the order of the UNICODE chart (ex: A B).
|
||||
* **Standard_CString** : fundamental type representing string literals. A string literal is a sequence of ASCII (8 bits) characters enclosed in double quotes. *CString* is implemented as a *typedef* of the C++ *char* fundamental type.
|
||||
* **Standard_ExtCharacter** : fundamental type representing the Unicode character set. It is a 16-bit character type. *ExtCharacter* is implemented as a *typedef* of the C++ *char16_t* fundamental type. As such, the ordering and equivalence relations <, <=, ==, !=, >=, > are defined on extended characters using the order of the UNICODE chart (ex: A B).
|
||||
* **Standard_CString** : fundamental type representing string literals. A string literal is a sequence of UTF-8 (8 bits) code points enclosed in double quotes. *CString* is implemented as a *typedef* of the C++ *char* fundamental type.
|
||||
* **Standard_Address** : fundamental type representing a generic pointer. *Address* is implemented as a *typedef* of the C++ *void* fundamental type.
|
||||
* **Standard_ExtString** is a fundamental type representing string literals as sequences of Unicode (16 bits) characters. *ExtString* is implemented as a *typedef* of the C++ *short* fundamental type.
|
||||
* **Standard_ExtString** is a fundamental type representing string literals as sequences of Unicode (16 bits) characters. *ExtString* is implemented as a *typedef* of the C++ *char16_t* fundamental type.
|
||||
|
||||
@subsubsection occt_fcug_2_1_2 Types manipulated by value
|
||||
There are three categories of types which are manipulated by value:
|
||||
@@ -254,13 +254,13 @@ Objects of classes derived (directly or indirectly) from *Transient*, are normal
|
||||
Handle is defined as template class *opencascade::handle<>*.
|
||||
Open CASCADE Technology provides preprocessor macro *Handle()* that is historically used throughout OCCT code to name a handle:
|
||||
~~~~~{.cpp}
|
||||
Handle(Geom_Line) aLine; // "Handle(Geom_Line)" is expanded to "opencascade::handleL<Geom_Line>"
|
||||
Handle(Geom_Line) aLine; // "Handle(Geom_Line)" is expanded to "opencascade::handle<Geom_Line>"
|
||||
~~~~~
|
||||
|
||||
In addition, for standard OCCT classes additional *typedef* is defined for a handle, as the name of a class prefixed by *Handle_*.
|
||||
For instance, the above example can be also coded as:
|
||||
~~~~~{.cpp}
|
||||
Handle_Geom_Line aLine; // "Handle_Geom_Line" is typedef to "opencascade::handleL<Geom_Line>"
|
||||
Handle_Geom_Line aLine; // "Handle_Geom_Line" is typedef to "opencascade::handle<Geom_Line>"
|
||||
~~~~~
|
||||
|
||||
#### Using a Handle
|
||||
@@ -593,16 +593,16 @@ The following paragraphs describe recommended approaches for using exceptions w
|
||||
|
||||
To raise an exception of a definite type method Raise() of the appropriate exception class shall be used.
|
||||
~~~~~
|
||||
DomainError::Raise(“Cannot cope with this condition”);
|
||||
Standard_DomainError::Raise(“Cannot cope with this condition”);
|
||||
~~~~~
|
||||
raises an exception of *DomainError* type with the associated message “Cannot cope with this condition”, the message being optional. This exception may be caught by a handler of a *DomainError* type as follows:
|
||||
raises an exception of *Standard_DomainError* type with the associated message “Cannot cope with this condition”, the message being optional. This exception may be caught by a handler of a *Standard_DomainError* type as follows:
|
||||
~~~~~
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
// try block
|
||||
}
|
||||
catch(DomainError) {
|
||||
// handle DomainError exceptions here
|
||||
catch(const Standard_DomainError& ) {
|
||||
// handle Standard_DomainError exceptions here
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@@ -652,8 +652,7 @@ Using this syntax, the *Value* function becomes:
|
||||
~~~~~
|
||||
Item TCollection_Array1::Value (const Standard_Integer&index) const
|
||||
{
|
||||
OutOfRange_Raise_if(index < r1 || index > r2,
|
||||
“index out of range in Array1::Value”);
|
||||
Standard_OutOfRange_Raise_if(index < r1 || index > r2, “index out of range in Array1::Value”);
|
||||
return contents[index];
|
||||
}
|
||||
~~~~~
|
||||
|
@@ -15,7 +15,7 @@ Other kinds of data such as colors and names can be read or written with the hel
|
||||
* an IGES entity is an entity in the IGES normal sense.
|
||||
* a root entity is the highest level entity of any given type, e.g. type 144 for surfaces and type 186 for solids. Roots are not referenced by other entities.
|
||||
|
||||
This manual mainly explains how to convert an IGES file to an Open CASCADE Technology (**OCCT**) shape and vice versa. It provides basic documentation on conversion. For advanced information on conversion, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
This manual mainly explains how to convert an IGES file to an Open CASCADE Technology (**OCCT**) shape and vice versa. It provides basic documentation on conversion. For advanced information on conversion, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
IGES files produced in accordance with IGES standard versions up to and including version 5.3 can be read. IGES files that are produced by this interface conform to IGES version 5.3 (Initial Graphics Exchange Specification, IGES 5.3. ANS US PRO/IPO-100-1996).
|
||||
|
||||
|
@@ -5,7 +5,7 @@ Modeling Algorithms {#occt_user_guides__modeling_algos}
|
||||
|
||||
@section occt_modalg_1 Introduction
|
||||
|
||||
This manual explains how to use the Modeling Algorithms. It provides basic documentation on modeling algorithms. For advanced information on Modeling Algorithms, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
This manual explains how to use the Modeling Algorithms. It provides basic documentation on modeling algorithms. For advanced information on Modeling Algorithms, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
The Modeling Algorithms module brings together a wide range of topological algorithms used in modeling. Along with these tools, you will find the geometric algorithms, which they call.
|
||||
|
||||
@@ -475,7 +475,7 @@ The Curves and Surfaces from Constraints component groups together high level fu
|
||||
* construction of plate surfaces
|
||||
* extension of a 3D curve or surface beyond its original bounds.
|
||||
|
||||
OPEN CASCADE company also provides a product known as <a href="http://www.opencascade.com/content/surfaces-scattered-points">Surfaces from Scattered Points</a>, which allows constructing surfaces from scattered points. This algorithm accepts or constructs an initial B-Spline surface and looks for its deformation (finite elements method) which would satisfy the constraints. Using optimized computation methods, this algorithm is able to construct a surface from more than 500 000 points.
|
||||
OPEN CASCADE company also provides a product known as <a href="https://www.opencascade.com/content/surfaces-scattered-points">Surfaces from Scattered Points</a>, which allows constructing surfaces from scattered points. This algorithm accepts or constructs an initial B-Spline surface and looks for its deformation (finite elements method) which would satisfy the constraints. Using optimized computation methods, this algorithm is able to construct a surface from more than 500 000 points.
|
||||
|
||||
SSP product is not supplied with Open CASCADE Technology, but can be purchased separately.
|
||||
|
||||
@@ -3089,14 +3089,14 @@ Open CASCADE Technology includes two mesh converters:
|
||||
- STL converter translates Open CASCADE shapes to STL files. STL (STtereoLithography) format is widely used for rapid prototyping.
|
||||
|
||||
Open CASCADE SAS also offers Advanced Mesh Products:
|
||||
- <a href="http://www.opencascade.com/content/mesh-framework">Open CASCADE Mesh Framework (OMF)</a>
|
||||
- <a href="http://www.opencascade.com/content/express-mesh">Express Mesh</a>
|
||||
- <a href="https://www.opencascade.com/content/mesh-framework">Open CASCADE Mesh Framework (OMF)</a>
|
||||
- <a href="https://www.opencascade.com/content/express-mesh">Express Mesh</a>
|
||||
|
||||
Besides, we can efficiently help you in the fields of surface and volume meshing algorithms, mesh optimization algorithms etc. If you require a qualified advice about meshing algorithms, do not hesitate to benefit from the expertise of our team in that domain.
|
||||
|
||||
The projects dealing with numerical simulation can benefit from using SALOME - an Open Source Framework for CAE with CAD data interfaces, generic Pre- and Post- F.E. processors and API for integrating F.E. solvers.
|
||||
|
||||
Learn more about SALOME platform on http://www.salome-platform.org
|
||||
Learn more about SALOME platform on https://www.salome-platform.org
|
||||
|
||||
@subsection occt_modalg_11_2 Meshing algorithm
|
||||
|
||||
|
@@ -7,7 +7,7 @@ Modeling Data {#occt_user_guides__modeling_data}
|
||||
|
||||
Modeling Data supplies data structures to represent 2D and 3D geometric models.
|
||||
|
||||
This manual explains how to use Modeling Data. For advanced information on modeling data, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
This manual explains how to use Modeling Data. For advanced information on modeling data, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@section occt_modat_1 Geometry Utilities
|
||||
|
||||
@@ -1324,7 +1324,7 @@ BRepBndLib class contains methods for creation of bounding boxes (both AABB and
|
||||
|
||||
@subsubsection occt_modat_6_1_1 Creation of OBB from set of points
|
||||
|
||||
The algorithm is described in <a href="http://www.idt.mdh.se/~tla/publ/FastOBBs.pdf">"Fast Computation of Tight Fitting Oriented Bounding Boxes" by Thomas Larsson and Linus Källberg</a>. It includes the following steps:
|
||||
The algorithm is described in "Fast Computation of Tight Fitting Oriented Bounding Boxes" by Thomas Larsson and Linus Källberg (FastOBBs.pdf). It includes the following steps:
|
||||
|
||||
<span>1.</span> Choose \f$ N_{a} (N_{a} \geq 3) \f$ initial axes.<br>
|
||||
<span>2.</span> Project every given point to the every chosen (in item 1) axis. At that, "minimal" and "maximal" points of every axis (i.e. point having minimal and maximal parameter (correspondingly) of the projection to this axis) are chosen. I.e. \f$ 2*N_{a} \f$ points will be held and this set can contain equal points. Later (unless otherwise specified) in this algorithm we will work with these \f$ 2*N_{a} \f$ points only.<br>
|
||||
@@ -1379,7 +1379,7 @@ The algorithm contains the following steps:
|
||||
|
||||
@subsubsection occt_modat_6_1_4 Method IsOut for another OBB
|
||||
|
||||
According to the <a href="http://www.jkh.me/files/tutorials/Separating%20Axis%20Theorem%20for%20Oriented%20Bounding%20Boxes.pdf">"Separating Axis Theorem for Oriented Bounding Boxes"</a>, it is necessary to check the 15 separating axes: 6 axes of the boxes and 9 are their cross products.<br>
|
||||
According to the <a href="https://www.jkh.me/files/tutorials/Separating%20Axis%20Theorem%20for%20Oriented%20Bounding%20Boxes.pdf">"Separating Axis Theorem for Oriented Bounding Boxes"</a>, it is necessary to check the 15 separating axes: 6 axes of the boxes and 9 are their cross products.<br>
|
||||
The algorithm of analyzing axis \f$ \mathbf{l} \f$ is following:
|
||||
1. Compute the "length" according to the formula: \f$ L_{j}=\sum_{i=0}^{2}{H_{i}\cdot \left | \overrightarrow{\mathbf{a_{i}}} \cdot \overrightarrow{\mathbf{l}} \right |} \f$. Here, \f$ \mathbf{a_{i}} \f$ is an i-th axis (X-axis, Y-axis, Z-axis) of j-th BndBox (j=1...2). \f$ H_{i} \f$ is a half-dimension along i-th axis.
|
||||
2. If \f$ \left |\overrightarrow{C_{1}C_{2}} \cdot \overrightarrow{\mathbf{l}} \right | > L_{1}+L_{2} \f$ (where \f$ C_{j} \f$ is the center of j-th OBB) then the considered OBBs are not interfered in terms of the axis \f$ \mathbf{l} \f$.
|
||||
|
@@ -7,7 +7,7 @@ OCAF {#occt_user_guides__ocaf}
|
||||
|
||||
This manual explains how to use the Open CASCADE Application Framework (OCAF).
|
||||
It provides basic documentation on using OCAF. For advanced information on OCAF
|
||||
and its applications, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
and its applications, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@subsection occt_ocaf_1_1 Purpose of OCAF
|
||||
|
||||
|
@@ -7,7 +7,7 @@ Shape Healing {#occt_user_guides__shape_healing}
|
||||
|
||||
@subsection occt_shg_1_1 Introduction
|
||||
|
||||
This manual explains how to use Shape Healing. It provides basic documentation on its operation. For advanced information on Shape Healing and its applications, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
This manual explains how to use Shape Healing. It provides basic documentation on its operation. For advanced information on Shape Healing and its applications, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
The **Shape Healing** toolkit provides a set of tools to work on the geometry and topology of Open CASCADE Technology (**OCCT**) shapes. Shape Healing adapts shapes so as to make them as appropriate for use by Open CASCADE Technology as possible.
|
||||
|
||||
|
@@ -24,7 +24,7 @@ File translation is performed in the programming mode, via C++ calls.
|
||||
|
||||
For testing the STEP component in DRAW Test Harness, a set of commands for reading and writing STEP files and analysis of relevant data are provided by the *TKXSDRAW* plugin.
|
||||
|
||||
See also our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
See also our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@subsection occt_step_1_1 STEP Exchanges in Open Cascade technology
|
||||
|
||||
@@ -123,7 +123,7 @@ For further information see 2.4 Mapping STEP entities to Open CASCADE Technology
|
||||
Before performing any other operation you have to load the file with:
|
||||
~~~~~
|
||||
STEPControl_Reader reader;
|
||||
IFSelect_ReturnStatus stat = reader.ReadFile(;filename.stp;);
|
||||
IFSelect_ReturnStatus stat = reader.ReadFile("filename.stp");
|
||||
~~~~~
|
||||
Loading the file only memorizes the data, it does not translate it.
|
||||
|
||||
@@ -406,6 +406,47 @@ if(!Interface_Static::SetIVal(;read.step.shape.aspect;,1))
|
||||
~~~~~
|
||||
Default value is 1 (ON).
|
||||
|
||||
<h4>read.step.constructivegeom.relationship:</h4>
|
||||
|
||||
Boolean flag regulating translation of "CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP" entities that define
|
||||
position of constructive geometry entities contained in "CONSTRUCTIVE_GEOMETRY_REPRESENTATION" with respect to the
|
||||
main representation of the shape (product).
|
||||
|
||||
By default, the flag is set to 0 (OFF) so these entities are not translated.
|
||||
Set this flag to 1 (ON) if you need to translate constructive geometry entities associated with the parts:
|
||||
|
||||
~~~~~
|
||||
if (!Interface_Static::SetIVal("read.step.constructivegeom.relationship", 1)) { .. error .. }
|
||||
~~~~~
|
||||
|
||||
The "CONSTRUCTIVE_GEOMETRY_REPRESENTATION" entity is translated into compound of two unlimited planar faces,
|
||||
whose location is result of translation of corresponding "AXIS_PLACEMENT" entity.
|
||||
Note that appropriate interpretation of the translated data should be done after translation.
|
||||
|
||||
The result of translation can be obtained either for the "CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP" entity,
|
||||
of for each of the two "AXIS2_PLACEMENT_3D" entities referenced by it. as follows:
|
||||
|
||||
~~~~~
|
||||
STEPControl_Reader aReader;
|
||||
... // translate file and parse STEP model to find relevant axis entity
|
||||
Handle(StepGeom_Axis2Placement3d) aSTEPAxis = ...;
|
||||
Handle(Transfer_Binder) aBinder = aReader->WS()->TransferReader()->TransientProcess()->Find(aSTEPAxis);
|
||||
Handle(TransferBRep_ShapeBinder) aShBinder = Handle(TransferBRep_ShapeBinder)::DownCast(aBinder);
|
||||
if (! aShBinder.IsNull())
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face (aShBinder->Result());
|
||||
if (! aFace.IsNull())
|
||||
{
|
||||
Handle(Geom_Plane) aSurf = Handle(Geom_Plane)::DownCast (BRep_Tool::Surface (aFace));
|
||||
if (! aSurf.IsNull())
|
||||
{
|
||||
gp_Ax3 anAxis = aSurf->Placement();
|
||||
... // use the axis placement data
|
||||
}
|
||||
}
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_step_2_3_4 Performing the STEP file translation
|
||||
|
||||
Perform the translation according to what you want to translate. You can choose either root entities (all or selected by the number of root), or select any entity by its number in the STEP file. There is a limited set of types of entities that can be used as starting entities for translation. Only the following entities are recognized as transferable:
|
||||
@@ -602,21 +643,21 @@ Not all entities defining the assembly structure in the STEP file are translated
|
||||
| Placements | axis1_placement | Geom_Axis1Placement | |
|
||||
| | axis2_placement_2d | Geom2d_AxisPlacement | |
|
||||
| | axis2_placement_3d | Geom_Axis2Placement | |
|
||||
| Curves | circle | Geom_Circle, Geom2d_Circle, Geom2d_BsplineCurve | Circle is translated into *Geom2d_BSplineCurve* when it references the surface of revolution (spherical surface, conical surface, etc.) |
|
||||
| | ellipse | Geom_Ellipse, Geom2d_Ellipse, Geom2d_BsplineCurve | Ellipse is translated into *Geom2d_BSplineCurve* when it references the surface of revolution (spherical surface, conical surface, etc.) |
|
||||
| Curves | circle | Geom_Circle, Geom2d_Circle, Geom2d_BSplineCurve | Circle is translated into *Geom2d_BSplineCurve* when it references the surface of revolution (spherical surface, conical surface, etc.) |
|
||||
| | ellipse | Geom_Ellipse, Geom2d_Ellipse, Geom2d_BSplineCurve | Ellipse is translated into *Geom2d_BSplineCurve* when it references the surface of revolution (spherical surface, conical surface, etc.) |
|
||||
| | hyperbola | Geom_Hyperbola, Geom2d_Hyperbola | |
|
||||
| | line | Geom_Line, Geom2d_Line | |
|
||||
| | parabola | Geom_Parabola, Geom2d_Parabola | |
|
||||
| | pcurve | Geom2d_Curve | Pcurve in edge |
|
||||
| | curve_replica | Geom_Curve or Geom2d_Curve | Depending on the type of the base curve |
|
||||
| | offset_curve_3d | Geom_OffsetCurve | |
|
||||
| | trimmed_curve | Geom_TrimmedCurve or Geom2d_BsplineCurve | Only trimmed_curves trimmed by parameters are translated. All *trimmed_curves* are converted to *Geom2d_BSplineCurve*. |
|
||||
| | b_spline_curve | Geom_BsplineCurve or Geom2d_BsplineCurve | |
|
||||
| | b_spline_curve_with_knots | Geom_BsplineCurve or Geom2d_BsplineCurve | |
|
||||
| | bezier_curve | Geom_BsplineCurve or Geom2d_BsplineCurve | |
|
||||
| | rational_b_spline_curve | Geom_BsplineCurve or Geom2d_BsplineCurve | |
|
||||
| | uniform_curve | Geom_BsplineCurve or Geom2d_BsplineCurve | |
|
||||
| | quasi_ uniform_curve | Geom_BsplineCurve or Geom2d_BsplineCurve | |
|
||||
| | trimmed_curve | Geom_TrimmedCurve or Geom2d_BSplineCurve | Only trimmed_curves trimmed by parameters are translated. All *trimmed_curves* are converted to *Geom2d_BSplineCurve*. |
|
||||
| | b_spline_curve | Geom_BSplineCurve or Geom2d_BSplineCurve | |
|
||||
| | b_spline_curve_with_knots | Geom_BSplineCurve or Geom2d_BSplineCurve | |
|
||||
| | bezier_curve | Geom_BSplineCurve or Geom2d_BSplineCurve | |
|
||||
| | rational_b_spline_curve | Geom_BSplineCurve or Geom2d_BSplineCurve | |
|
||||
| | uniform_curve | Geom_BSplineCurve or Geom2d_BSplineCurve | |
|
||||
| | quasi_ uniform_curve | Geom_BSplineCurve or Geom2d_BSplineCurve | |
|
||||
| | surface_curve | TopoDS_Edge | *surface_curve* defines geometrical support of an edge and its pcurves. |
|
||||
| | seam_curve | TopoDS_Edge | The same as *surface_curve* |
|
||||
| | composite_curve_segment | TopoDS_Edge | as a segment of *composite_curve* |
|
||||
@@ -746,7 +787,7 @@ The following diagram illustrates the structure of calls in reading STEP. The hi
|
||||
Standard_Integer main()
|
||||
{
|
||||
STEPControl_Reader reader;
|
||||
reader.ReadFile(;MyFile.stp;);
|
||||
reader.ReadFile("MyFile.stp");
|
||||
|
||||
// Loads file MyFile.stp
|
||||
Standard_Integer NbRoots = reader.NbRootsForTransfer();
|
||||
@@ -1037,8 +1078,8 @@ The table below describes STEP entities, which are created when the assembly str
|
||||
| | Geom2d_Ellipse | Ellipse, rational_b_spline_curve | |
|
||||
| | Geom_Hyperbola, Geom2d_Hyperbola | Hyperbola | |
|
||||
| | Geom_Parabola, Geom2d_Parabola | Parabola | |
|
||||
| | Geom_BSplineCurve | b_spline_curve_with_knots or rational_b_spline_curve | *rational_b_spline_curve* is produced if *Geom_BsplineCurve* is a rational BSpline |
|
||||
| | Geom2d_BSplineCurve | b_spline_curve_with_knots or rational_b_spline_curve | *rational_b_spline_curve* is produced if *Geom2d_BsplineCurve* is a rational BSpline |
|
||||
| | Geom_BSplineCurve | b_spline_curve_with_knots or rational_b_spline_curve | *rational_b_spline_curve* is produced if *Geom_BSplineCurve* is a rational BSpline |
|
||||
| | Geom2d_BSplineCurve | b_spline_curve_with_knots or rational_b_spline_curve | *rational_b_spline_curve* is produced if *Geom2d_BSplineCurve* is a rational BSpline |
|
||||
| | Geom_BezierCurve | b_spline_curve_with_knots | |
|
||||
| | Geom_Line or Geom2d_Line | Line | |
|
||||
| Surfaces | Geom_Plane | Plane | |
|
||||
@@ -1439,7 +1480,7 @@ where *doc* is a variable which contains a handle to the output document and sho
|
||||
@subsection occt_step_7_2 Attributes read from STEP
|
||||
|
||||
### Colors
|
||||
Colors are implemented in accordance with <a href="http://www.cax-if.org/documents/rec_prac_styling_org_v15.pdf">Recommended practices for model styling and organization</a> sections 4 and 5.
|
||||
Colors are implemented in accordance with <a href="https://www.cax-if.org/documents/rec_prac_styling_org_v15.pdf">Recommended practices for model styling and organization</a> sections 4 and 5.
|
||||
|
||||
The following attributes are imported from STEP file:
|
||||
* colors linked to assemblies, solids, shells, faces/surfaces, wireframes, edges/curves and vertices/points;
|
||||
@@ -1452,15 +1493,15 @@ The following attributes are mentioned in the Recommended Practices, but not han
|
||||
* point markers.
|
||||
|
||||
### Layers
|
||||
Layers are implemented in accordance with <a href="http://www.cax-if.org/documents/rec_prac_styling_org_v15.pdf">Recommended practices for model styling and organization</a> section 6.
|
||||
Layers are implemented in accordance with <a href="https://www.cax-if.org/documents/rec_prac_styling_org_v15.pdf">Recommended practices for model styling and organization</a> section 6.
|
||||
All layers are imported, but invisibility styles are skipped.
|
||||
|
||||
### Materials
|
||||
Materials are implemented in accordance with <a href="http://www.cax-if.org/documents/RecPrac_MaterialDensity_v21.pdf">Recommended practices for material identification and density</a> section 4.
|
||||
Materials are implemented in accordance with <a href="https://www.cax-if.org/documents/RecPrac_MaterialDensity_v21.pdf">Recommended practices for material identification and density</a> section 4.
|
||||
OCCT translator processes materials attached to solids in shape representations. The name, description and density (name and value) are imported for each material.
|
||||
|
||||
### Validation properties
|
||||
Validation properties are implemented in accordance with <a href="http://www.cax-if.org/documents/rec_prac_gvp_v44.pdf">Recommended practices for geometric and assembly validation properties</a> section 4 for AP214.
|
||||
Validation properties are implemented in accordance with <a href="https://www.cax-if.org/documents/rec_prac_gvp_v44.pdf">Recommended practices for geometric and assembly validation properties</a> section 4 for AP214.
|
||||
OCCT processes several types of geometric validation properties for solids, shells and geometric sets:
|
||||
* area;
|
||||
* volume;
|
||||
@@ -1530,7 +1571,7 @@ OCCT STEP Reader also handles Annotations, linked directly to shapes (section 9.
|
||||
Simple types of GD&T (Dimensions, Tolerances and Datums without presentations or any types of modifiers) are also handled in AP214. However, according to the Recommended Practices for the Representation and Presentation of Product Manufacturing, this implementation is obsolete.
|
||||
|
||||
### Saved views
|
||||
Saved views are implemented in accordance with <a href="http://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">Recommended practices for the Representation and Presentation of Product Manufacturing</a> section 9.4.1-9.4.4.
|
||||
Saved views are implemented in accordance with <a href="https://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">Recommended practices for the Representation and Presentation of Product Manufacturing</a> section 9.4.1-9.4.4.
|
||||
For each Saved View OCCT STEP Reader will retrieve the following attributes:
|
||||
- set of displayed shape representations;
|
||||
- set of displayed PMI presentations;
|
||||
|
@@ -35,7 +35,7 @@ To answer different needs of CASCADE users, this User's Guide offers the followi
|
||||
* If the 3D services proposed in AIS meet your requirements, you need only read chapter 3 @ref occt_visu_3 "AIS: Application Interactive Services".
|
||||
* If you need more detail, for example, a selection filter on another type of entity -- you should read chapter 2 @ref occt_visu_2 "Fundamental Concepts", chapter 3 @ref occt_visu_3 "AIS: Application Interactive Services", and 4 @ref occt_visu_4 "3D Presentations". You may want to begin with the chapter presenting AIS.
|
||||
|
||||
For advanced information on visualization algorithms, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
For advanced information on visualization algorithms, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
@section occt_visu_2 Fundamental Concepts
|
||||
|
||||
@@ -88,7 +88,7 @@ Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext (theViewer)
|
||||
BRepPrimAPI_MakeWedge aWedgeMaker (theWedgeDX, theWedgeDY, theWedgeDZ, theWedgeLtx);
|
||||
TopoDS_Solid aShape = aWedgeMaker.Solid();
|
||||
Handle(AIS_Shape) aShapePrs = new AIS_Shape (aShape); // creation of the presentable object
|
||||
aContext->Display (aShapePrs); // display the presentable object in the 3d viewer
|
||||
aContext->Display (aShapePrs, AIS_Shaded, 0, true); // display the presentable object and redraw 3d viewer
|
||||
~~~~~
|
||||
|
||||
The shape is created using the *BRepPrimAPI_MakeWedge* command. An *AIS_Shape* is then created from the shape. When calling the *Display* command, the interactive context calls the Compute method of the presentable object to calculate the presentation data and transfer it to the viewer. See figure below.
|
||||
@@ -137,14 +137,14 @@ Selectable object stores information about all created selection modes and sensi
|
||||
|
||||
All successors of a selectable object must implement the method that splits its presentation into sensitive entities according to the given mode. The computed entities are arranged in one selection and added to the list of all selections of this object. No selection will be removed from the list until the object is deleted permanently.
|
||||
|
||||
For all standard OCCT shapes, zero mode is supposed to select the whole object (but it may be redefined easily in the custom object). For example, the standard OCCT selection mechanism and *AIS_Shape* determine the following modes:
|
||||
For all standard OCCT shapes, zero mode is supposed to select the whole object (but it may be redefined easily in the custom object). For example, the standard OCCT selection mechanism and *AIS_Shape* determine the following modes (see AIS_Shape::SelectionMode()):
|
||||
- 0 -- selection of the entire object *(AIS_Shape)*;
|
||||
- 1 -- selection of the vertices;
|
||||
- 2 -- selection of the edges;
|
||||
- 3 -- selection of the wires;
|
||||
- 4 -- selection of the faces;
|
||||
- 5 -- selection of the shells;
|
||||
- 6 -- selection of the constituent solids.
|
||||
- 1 -- selection of the vertices (TopAbs_VERTEX);
|
||||
- 2 -- selection of the edges (TopAbs_EDGE);
|
||||
- 3 -- selection of the wires (TopAbs_WIRE);
|
||||
- 4 -- selection of the faces (TopAbs_FACE);
|
||||
- 5 -- selection of the shells (TopAbs_SHELL);
|
||||
- 6 -- selection of the constituent solids (TopAbs_SOLID).
|
||||
|
||||
@figure{visualization_image006.png,"Hierarchy of references from sensitive entity to selectable object",400}
|
||||
|
||||
@@ -263,7 +263,7 @@ The package also contains two auxiliary classes, *Select3D_SensitivePoly* and *S
|
||||
- keeping selection BVH data up-to-date.
|
||||
|
||||
A brief description of the main classes:
|
||||
- *SelectMgr_FrustumBase*, *SelectMgr_Frustum*, *SelectMgr_RectangularFrustum*, *SelectMgr_TriangluarFrustum* and *SelectMgr_TriangularFrustumSet* -- interfaces and implementations of selecting frustums, these classes implement different SAT tests for overlap and inclusion detection. They also contain methods to measure characteristics of detected entities (depth, distance to center of geometry);
|
||||
- *SelectMgr_BaseFrustum*, *SelectMgr_Frustum*, *SelectMgr_RectangularFrustum*, *SelectMgr_TriangularFrustum* and *SelectMgr_TriangularFrustumSet* -- interfaces and implementations of selecting frustums, these classes implement different SAT tests for overlap and inclusion detection. They also contain methods to measure characteristics of detected entities (depth, distance to center of geometry);
|
||||
- *SelectMgr_SensitiveEntity*, *SelectMgr_Selection* and *SelectMgr_SensitiveEntitySet* -- store and handle sensitive entities; *SelectMgr_SensitiveEntitySet* implements a primitive set for the second level BVH tree;
|
||||
- *SelectMgr_SelectableObject* and *SelectMgr_SelectableObjectSet* -- describe selectable objects. They also manage storage, calculation and removal of selections. *SelectMgr_SelectableObjectSet* implements a primitive set for the first level BVH tree;
|
||||
- *SelectMgr_ViewerSelector* -- encapsulates all logics of the selection algorithm and implements the third level BVH tree traverse;
|
||||
@@ -274,7 +274,7 @@ A brief description of the main classes:
|
||||
*StdSelect* package contains the implementation of some *SelectMgr* classes and tools for creation of selection structures. For example,
|
||||
- *StdSelect_BRepOwner* -- defines an entity owner with a link to its topological shape and methods for highlighting;
|
||||
- *StdSelect_BRepSelectionTool* -- contains algorithms for splitting standard AIS shapes into sensitive primitives;
|
||||
- *StdSelect_ViewerSelector3d* -- an example of *SelectMgr_ViewerSelecor* implementation, which is used in a default OCCT selection mechanism;
|
||||
- *StdSelect_ViewerSelector3d* -- an example of *SelectMgr_ViewerSelector* implementation, which is used in a default OCCT selection mechanism;
|
||||
- *StdSelect_FaceFilter*, *StdSelect_EdgeFilter* -- implementation of selection filters.
|
||||
|
||||
@subsubsection occt_visu_2_2_4 Examples of usage
|
||||
@@ -315,7 +315,7 @@ void InteractiveBox::ComputeSelection (const Handle(SelectMgr_Selection)& theSel
|
||||
~~~~
|
||||
|
||||
The algorithms for creating selection structures store sensitive primitives in *SelectMgr_Selection* instance. Each *SelectMgr_Selection* sequence in the list of selections of the object must correspond to a particular selection mode.
|
||||
To describe the decomposition of the object into selectable primitives, a set of ready-made sensitive entities is supplied in *Select3D* package. Custom sensitive primitives can be defined through inheritance from *SelectBasics_SensitiveEntity*.
|
||||
To describe the decomposition of the object into selectable primitives, a set of ready-made sensitive entities is supplied in *Select3D* package. Custom sensitive primitives can be defined through inheritance from *Select3D_SensitiveEntity*.
|
||||
To make custom interactive objects selectable or customize selection modes of existing objects, the entity owners must be defined. They must inherit *SelectMgr_EntityOwner* interface.
|
||||
|
||||
Selection structures for any interactive object are created in *SelectMgr_SelectableObject::ComputeSelection()* method.
|
||||
@@ -340,7 +340,7 @@ The *StdSelect_BRepSelectionTool* class provides a high level API for computing
|
||||
|
||||
The traditional way of highlighting selected entity owners adopted by Open CASCADE Technology assumes that each entity owner highlights itself on its own. This approach has two drawbacks:
|
||||
|
||||
- each entity owner has to maintain its own *Prs3d_Presentation* object, that results in a considerable memory overhead;
|
||||
- each entity owner has to maintain its own *Graphic3d_Structure* object, that results in a considerable memory overhead;
|
||||
- drawing selected owners one by one is not efficient from the visualization point of view.
|
||||
|
||||
Therefore, to overcome these limitations, OCCT has an alternative way to implement the highlighting of a selected presentation. Using this approach, the interactive object itself will be responsible for the highlighting, not the entity owner.
|
||||
@@ -348,7 +348,6 @@ Therefore, to overcome these limitations, OCCT has an alternative way to impleme
|
||||
On the basis of *SelectMgr_EntityOwner::IsAutoHilight()* return value, *AIS_InteractiveContext* object either uses the traditional way of highlighting (in case if *IsAutoHilight()* returns TRUE) or groups such owners according to their selectable objects and finally calls *SelectMgr_SelectableObject::HilightSelected()* or *SelectMgr_SelectableObject::ClearSelected()*, passing a group of owners as an argument.
|
||||
|
||||
Hence, an application can derive its own interactive object and redefine virtual methods *HilightSelected()*, *ClearSelected()* and *HilightOwnerWithColor()* from *SelectMgr_SelectableObject*. *SelectMgr_SelectableObject::GetHilightPresentation* and *SelectMgr_SelectableObject::GetSelectPresentation* methods can be used to optimize filling of selection and highlight presentations according to the user's needs.
|
||||
The *AIS_InteractiveContext::HighlightSelected()* method can be used for efficient redrawing of the selection presentation for a given interactive object from an application code.
|
||||
|
||||
After all the necessary sensitive entities are computed and packed in *SelectMgr_Selection* instance with the corresponding owners in a redefinition of *SelectMgr_SelectableObject::ComputeSelection()* method, it is necessary to register the prepared selection in *SelectMgr_SelectionManager* through the following steps:
|
||||
- if there was no *AIS_InteractiveContext* opened, create an interactive context and display the selectable object in it;
|
||||
@@ -376,7 +375,7 @@ theContext->Activate (theBox, 1);
|
||||
|
||||
// Run the detection mechanism for activated entities in the current mouse coordinates and in the current view.
|
||||
// Detected owners will be highlighted with context highlight color
|
||||
theContext->MoveTo (aXMousePos, aYMousePos, myView);
|
||||
theContext->MoveTo (aXMousePos, aYMousePos, myView, false);
|
||||
// Select the detected owners
|
||||
theContext->Select();
|
||||
// Iterate through the selected owners
|
||||
@@ -449,6 +448,7 @@ void PackageName_ClassName::Compute (const Handle(PrsMgr_PresentationManager3d)&
|
||||
~~~~~
|
||||
|
||||
#### For hidden line removal (HLR) mode in 3D:
|
||||
|
||||
~~~~~
|
||||
void PackageName_ClassName::Compute (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Prs3d_Presentation)& thePresentation);
|
||||
@@ -460,7 +460,7 @@ The view can have two states: the normal mode or the computed mode (Hidden Line
|
||||
|
||||
By convention, the Interactive Object accepts or rejects the representation of HLR mode. It is possible to make this declaration in one of two ways:
|
||||
|
||||
* Initially by using one of the values of the enumeration *PrsMgr_TypeOfPresentation*:
|
||||
* Initially by using one of the values of the enumeration *PrsMgr_TypeOfPresentation3d*:
|
||||
* *PrsMgr_TOP_AllView*,
|
||||
* *PrsMgr_TOP_ProjectorDependant*
|
||||
|
||||
@@ -475,7 +475,7 @@ The type of the HLR algorithm is stored in *Prs3d_Drawer* of the shape. It is a
|
||||
The type of the HLR algorithm used for *AIS_Shape* can be changed by calling the *AIS_Shape::SetTypeOfHLR()* method.
|
||||
The current HLR algorithm type can be obtained using *AIS_Shape::TypeOfHLR()* method is to be used.
|
||||
|
||||
These methods get the value from the drawer of *AIS_Shape*. If the HLR algorithm type in the *AIS_Drawer* is set to *Prs3d_TOH_NotSet*, the *AIS_Drawer* gets the value from the default drawer of *AIS_InteractiveContext*.
|
||||
These methods get the value from the drawer of *AIS_Shape*. If the HLR algorithm type in the *Prs3d_Drawer* is set to *Prs3d_TOH_NotSet*, the *Prs3d_Drawer* gets the value from the default drawer of *AIS_InteractiveContext*.
|
||||
So it is possible to change the default HLR algorithm used by all newly displayed interactive objects. The value of the HLR algorithm type stored in the context drawer can be *Prs3d_TOH_Algo* or *Prs3d_TOH_PolyAlgo*. The polygonal algorithm is the default one.
|
||||
|
||||
@subsubsection occt_visu_3_2_3 Presentation modes
|
||||
@@ -503,7 +503,7 @@ The functions *AIS_InteractiveContext::SetDisplayMode* and *AIS_InteractiveConte
|
||||
|
||||
At dynamic detection, the presentation echoed by the Interactive Context, is by default the presentation already on the screen.
|
||||
|
||||
The functions *AIS_InteractiveObject::SetHilightMode* and *AIS_InteractiveObject::UnSetHilightMode* allow specifying the display mode used for highlighting (so called highlight mode), which is valid independently from the active representation of the object. It makes no difference whether this choice is temporary or definitive.
|
||||
The functions *AIS_InteractiveObject::SetHilightMode* and *AIS_InteractiveObject::UnsetHilightMode* allow specifying the display mode used for highlighting (so called highlight mode), which is valid independently from the active representation of the object. It makes no difference whether this choice is temporary or definitive.
|
||||
|
||||
Note that the same presentation (and consequently the same highlight mode) is used for highlighting *detected* objects and for highlighting *selected* objects, the latter being drawn with a special *selection color* (refer to the section related to *Interactive Context* services).
|
||||
|
||||
@@ -516,9 +516,14 @@ If you do not want an object to be affected by a *FitAll* view, you must declare
|
||||
Let us take for example the class called *IShape* representing an interactive object:
|
||||
|
||||
~~~~~
|
||||
myPk_IShape::myPK_IShape (const TopoDS_Shape& theShape, PrsMgr_TypeOfPresentation theType)
|
||||
myPk_IShape::myPk_IShape (const TopoDS_Shape& theShape, PrsMgr_TypeOfPresentation theType)
|
||||
: AIS_InteractiveObject (theType), myShape (theShape) { SetHilightMode (0); }
|
||||
|
||||
Standard_Boolean myPk_IShape::AcceptDisplayMode (const Standard_Integer theMode) const
|
||||
{
|
||||
return theMode == 0 || theMode == 1;
|
||||
}
|
||||
|
||||
void myPk_IShape::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
@@ -598,14 +603,14 @@ The following functions allow "moving" the representation and selection of Inter
|
||||
|
||||
#### Connect an interactive object to an applicative entity
|
||||
|
||||
Each Interactive Object has functions that allow attributing it an *Owner* in form of a *Transient*.
|
||||
Each Interactive Object has functions that allow attributing it an *GetOwner* in form of a *Transient*.
|
||||
* *AIS_InteractiveObject::SetOwner*
|
||||
* *AIS_InteractiveObject::HasOwner*
|
||||
* *AIS_InteractiveObject::Owner*
|
||||
* *AIS_InteractiveObject::GetOwner*
|
||||
|
||||
An interactive object can therefore be associated or not with an applicative entity, without affecting its behavior.
|
||||
|
||||
**NOTE:** Don't be confused by owners of another kind - *SelectBasics_EntityOwner* used for identifying selectable parts of the object or object itself.
|
||||
**NOTE:** Don't be confused by owners of another kind - *SelectMgr_EntityOwner* used for identifying selectable parts of the object or object itself.
|
||||
|
||||
#### Resolving coincident topology
|
||||
|
||||
@@ -758,6 +763,9 @@ theCtx->SetDisplayMode (2, true);
|
||||
|
||||
*PresentationManager* and *Selector3D*, which manage the presentation and selection of present interactive objects, are associated to the main Viewer.
|
||||
|
||||
*WARNING!* Do NOT use integer values (like in sample above) in real code - use appropriate enumerations instead!
|
||||
Each presentable object has independent list of supported display and selection modes; for instance, *AIS_DisplayMode* enumeration is applicable only to *AIS_Shape* presentations.
|
||||
|
||||
@subsection occt_visu_3_4 Local Selection
|
||||
|
||||
@subsubsection occt_visu_3_4_1 Selection Modes
|
||||
@@ -767,7 +775,7 @@ See, for example, *MeshVS_SelectionModeFlags* for *MeshVS_Mesh* object.
|
||||
|
||||
*AIS_Shape* is the most used interactive object. It provides API to manage selection operations on the constituent elements of shapes (selection of vertices, edges, faces, etc.). The Selection Mode for a specific shape type (*TopAbs_ShapeEnum*) is returned by method *AIS_Shape::SelectionMode()*.
|
||||
|
||||
The method *AIS_InteractiveObject::Display()* without a Selection Mode argument activates the default Selection Mode of the object.
|
||||
The method *AIS_InteractiveContext::Display()* without a Selection Mode argument activates the default Selection Mode of the object.
|
||||
The methods *AIS_InteractiveContext::Activate()* and *AIS_InteractiveContext::Deactivate()* activate and deactivate a specific Selection Mode.
|
||||
|
||||
More than one Selection Mode can be activated at the same time (but default 0 mode for selecting entire object is exclusive - it cannot be combined with others).
|
||||
@@ -815,7 +823,7 @@ myContext->AddFilter (aFil1);
|
||||
myContext->AddFilter (aFil2);
|
||||
|
||||
// only faces of revolution or planar faces will be selected
|
||||
myContext->MoveTo (thePixelX, thePixelY, myView);
|
||||
myContext->MoveTo (thePixelX, thePixelY, myView, true);
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_visu_3_4_6 Selection
|
||||
@@ -848,6 +856,7 @@ The Interactive Object itself can be retrieved by method *SelectMgr_EntityOwner:
|
||||
In case of *AIS_Shape*, the (sub)shape is returned by method *StdSelect_BRepOwner::Shape*.
|
||||
|
||||
#### Example
|
||||
|
||||
~~~~~
|
||||
for (myAISCtx->InitSelected(); myAISCtx->MoreSelected(); myAISCtx->NextSelected())
|
||||
{
|
||||
@@ -879,12 +888,12 @@ If you want to give a particular type and signature to your interactive object,
|
||||
The **Datum** groups together the construction elements such as lines, circles, points, trihedrons, plane trihedrons, planes and axes.
|
||||
|
||||
*AIS_Point, AIS_Axis, AIS_Line, AIS_Circle, AIS_Plane* and *AIS_Trihedron* have four selection modes:
|
||||
* mode 0 : selection of a trihedron;
|
||||
* mode 1 : selection of the origin of the trihedron;
|
||||
* mode 2 : selection of the axes;
|
||||
* mode 3 : selection of the planes XOY, YOZ, XOZ.
|
||||
* mode AIS_TrihedronSelectionMode_EntireObject : selection of a trihedron;
|
||||
* mode AIS_TrihedronSelectionMode_Origin : selection of the origin of the trihedron;
|
||||
* mode AIS_TrihedronSelectionMode_Axes : selection of the axes;
|
||||
* mode AIS_TrihedronSelectionMode_MainPlanes : selection of the planes XOY, YOZ, XOZ.
|
||||
|
||||
when you activate one of modes: 1 2 3 4, you pick AIS objects of type:
|
||||
when you activate one of modes, you pick AIS objects of type:
|
||||
* *AIS_Point*;
|
||||
* *AIS_Axis* (and information on the type of axis);
|
||||
* *AIS_Plane* (and information on the type of plane).
|
||||
@@ -901,8 +910,8 @@ For the presentation of planes and trihedra, the default length unit is millimet
|
||||
The **Object** type includes topological shapes, and connections between shapes.
|
||||
|
||||
*AIS_Shape* has two visualization modes:
|
||||
* mode 0 : Line (default mode)
|
||||
* mode 1 : Shading (depending on the type of shape)
|
||||
* mode AIS_WireFrame : Line (default mode)
|
||||
* mode AIS_Shaded : Shading (depending on the type of shape)
|
||||
|
||||
*AIS_ConnectedInteractive* is an Interactive Object connecting to another interactive object reference, and located elsewhere in the viewer makes it possible not to calculate presentation and selection, but to deduce them from your object reference.
|
||||
*AIS_MultipleConnectedInteractive* is an object connected to a list of interactive objects (which can also be Connected objects. It does not require memory-hungry presentation calculations).
|
||||
@@ -953,26 +962,26 @@ This command can also draw a sphere surface or a volume with a large amount of p
|
||||
|
||||
The **Relation** is made up of constraints on one or more interactive shapes and the corresponding reference geometry. For example, you might want to constrain two edges in a parallel relation. This constraint is considered as an object in its own right, and is shown as a sensitive primitive. This takes the graphic form of a perpendicular arrow marked with the || symbol and lying between the two edges.
|
||||
|
||||
The following relations are provided by *AIS*:
|
||||
* *AIS_ConcentricRelation*
|
||||
* *AIS_FixRelation*
|
||||
* *AIS_IdenticRelation*
|
||||
* *AIS_ParallelRelation*
|
||||
* *AIS_PerpendicularRelation*
|
||||
* *AIS_Relation*
|
||||
* *AIS_SymmetricRelation*
|
||||
* *AIS_TangentRelation*
|
||||
The following relations are provided by *PrsDim*:
|
||||
* *PrsDim_ConcentricRelation*
|
||||
* *PrsDim_FixRelation*
|
||||
* *PrsDim_IdenticRelation*
|
||||
* *PrsDim_ParallelRelation*
|
||||
* *PrsDim_PerpendicularRelation*
|
||||
* *PrsDim_Relation*
|
||||
* *PrsDim_SymmetricRelation*
|
||||
* *PrsDim_TangentRelation*
|
||||
|
||||
The list of relations is not exhaustive.
|
||||
|
||||
@subsubsection occt_visu_3_5_4 Dimensions
|
||||
* *AIS_AngleDimension*
|
||||
* *AIS_Chamf3dDimension*
|
||||
* *AIS_DiameterDimension*
|
||||
* *AIS_DimensionOwner*
|
||||
* *AIS_LengthDimension*
|
||||
* *AIS_OffsetDimension*
|
||||
* *AIS_RadiusDimension*
|
||||
* *PrsDim_AngleDimension*
|
||||
* *PrsDim_Chamf3dDimension*
|
||||
* *PrsDim_DiameterDimension*
|
||||
* *PrsDim_DimensionOwner*
|
||||
* *PrsDim_LengthDimension*
|
||||
* *PrsDim_OffsetDimension*
|
||||
* *PrsDim_RadiusDimension*
|
||||
|
||||
@subsubsection occt_visu_3_5_5 MeshVS_Mesh
|
||||
|
||||
@@ -1196,7 +1205,7 @@ aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
|
||||
@subsubsection occt_visu_4_2_5 Text primitive
|
||||
|
||||
*TKOpenGL* toolkit renders text labels using texture fonts. *Graphic3d* text primitives have the following features:
|
||||
*TKOpenGl* toolkit renders text labels using texture fonts. *Graphic3d* text primitives have the following features:
|
||||
* fixed size (non-zoomable) or zoomable,
|
||||
* can be rotated to any angle in the view plane,
|
||||
* support unicode charset.
|
||||
@@ -1204,46 +1213,13 @@ aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
The text attributes for the group could be defined with the *Graphic3d_AspectText3d* attributes group.
|
||||
To add any text to the graphic structure you can use the following methods:
|
||||
~~~~~
|
||||
void Graphic3d_Group::Text (const Standard_CString theText,
|
||||
const Graphic3d_Vertex& thePoint,
|
||||
const Standard_Real theHeight,
|
||||
const Quantity_PlaneAngle theAngle,
|
||||
const Graphic3d_TextPath theTp,
|
||||
const Graphic3d_HorizontalTextAlignment theHta,
|
||||
const Graphic3d_VerticalTextAlignment theVta,
|
||||
const Standard_Boolean theToEvalMinMax);
|
||||
void Graphic3d_Group::AddText (const Handle(Graphic3d_Text)& theTextParams,
|
||||
const Standard_Boolean theToEvalMinMax);
|
||||
~~~~~
|
||||
|
||||
The meaning of these parameters is as follows:
|
||||
* *theText* - the text string,
|
||||
* *thePoint* - the three-dimensional position of the text,
|
||||
* *theHeight* - the text height,
|
||||
* *theAngle* - the text orientation (at the moment, this parameter has no effect, but you can specify the text orientation through the *Graphic3d_AspectText3d* attributes).
|
||||
* *theTp* defines the text path,
|
||||
* *theHta* - the horizontal alignment of the text,
|
||||
* *theVta* - the vertical alignment of the text.
|
||||
|
||||
You can pass FALSE as *theToEvalMinMax* if you do not want the graphic3d structure boundaries to be affected by the text position.
|
||||
|
||||
**Note** that the text orientation angle can be defined by *Graphic3d_AspectText3d* attributes.
|
||||
~~~~~
|
||||
void Graphic3d_Group::Text (const Standard_CString theText,
|
||||
const Graphic3d_Vertex& thePoint,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Boolean theToEvalMinMax);
|
||||
void Graphic3d_Group::Text (const TCcollection_ExtendedString& theText,
|
||||
const Graphic3d_Vertex& thePoint,
|
||||
const Standard_Real theHeight,
|
||||
const Quantity_PlaneAngle theAngle,
|
||||
const Graphic3d_TextPath theTp,
|
||||
const Graphic3d_HorizontalTextAlignment theHta,
|
||||
const Graphic3d_VerticalTextAlignment theVta,
|
||||
const Standard_Boolean theToEvalMinMax);
|
||||
void Graphic3d_Group::Text (const TCcollection_ExtendedString& theText,
|
||||
const Graphic3d_Vertex& thePoint,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Boolean theToEvalMinMax);
|
||||
~~~~~
|
||||
|
||||
See the example:
|
||||
~~~~~
|
||||
@@ -1257,8 +1233,10 @@ aTextAspect->SetTextAngle (45.0);
|
||||
aGroup->SetPrimitivesAspect (aTextAspect);
|
||||
|
||||
// add a text primitive to the structure
|
||||
Graphic3d_Vertex aPoint (1, 1, 1);
|
||||
aGroup->Text (Standard_CString ("Text"), aPoint, 16.0);
|
||||
Handle(Graphic3d_Text) aText = new Graphic3d_Text (16.0f);
|
||||
aText->SetText ("Text");
|
||||
aText->SetPosition (gp_Pnt (1, 1, 1));
|
||||
aGroup->AddText (aText);
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_visu_4_2_6 Materials
|
||||
@@ -1451,8 +1429,8 @@ aView->Update();
|
||||
**IOD** -- defines the intraocular distance (in world space units).
|
||||
|
||||
There are two types of IOD:
|
||||
* _IODType_Absolute_ : Intraocular distance is defined as an absolute value.
|
||||
* _IODType_Relative_ : Intraocular distance is defined relative to the camera focal length (as its coefficient).
|
||||
* _Graphic3d_Camera::IODType_Absolute_ : Intraocular distance is defined as an absolute value.
|
||||
* _Graphic3d_Camera::IODType_Relative_ : Intraocular distance is defined relative to the camera focal length (as its coefficient).
|
||||
|
||||
**Field of view (FOV)** -- defines the field of camera view by y axis in degrees (45<34> is default).
|
||||
|
||||
@@ -1468,7 +1446,7 @@ To enable stereo projection, your workstation should meet the following requirem
|
||||
|
||||
In stereographic projection mode the camera prepares two projection matrices to display different stereo-pictures for the left and for the right eye. In a non-stereo camera this effect is not visible because only the same projection is used for both eyes.
|
||||
|
||||
To enable quad buffering support you should provide the following settings to the graphic driver *opengl_caps*:
|
||||
To enable quad buffering support you should provide the following settings to the graphic driver *OpenGl_Caps*:
|
||||
|
||||
~~~~~
|
||||
Handle(OpenGl_GraphicDriver) aDriver = new OpenGl_GraphicDriver();
|
||||
@@ -1493,7 +1471,7 @@ aView->Update();
|
||||
The algorithm of frustum culling on CPU-side is activated by default for 3D viewer. This algorithm allows skipping the presentation outside camera at the rendering stage, providing better performance. The following features support this method:
|
||||
* *Graphic3d_Structure::CalculateBoundBox()* is used to calculate axis-aligned bounding box of a presentation considering its transformation.
|
||||
* *V3d_View::SetFrustumCulling* enables or disables frustum culling for the specified view.
|
||||
* Classes *OpenGl_BVHClipPrimitiveSet* and *OpenGl_BVHTreeSelector* handle the detection of outer objects and usage of acceleration structure for frustum culling.
|
||||
* Classes *Graphic3d_BvhCStructureSet* and *Graphic3d_CullingTool* handle the detection of outer objects and usage of acceleration structure for frustum culling.
|
||||
* *BVH_BinnedBuilder* class splits several objects with null bounding box.
|
||||
|
||||
@subsubsection occt_visu_4_4_9 View background styles
|
||||
@@ -1537,7 +1515,7 @@ Standard_Boolean V3d_View::Dump (const Standard_CString theFile,
|
||||
~~~~
|
||||
Dumps the scene into an image file with the view dimensions.
|
||||
The raster image data handling algorithm is based on the *Image_AlienPixMap* class. The supported extensions are ".png", ".bmp", ".jpg" and others supported by **FreeImage** library.
|
||||
The value passed as *theBufferType* argument defines the type of the buffer for an output image *(RGB, RGBA, floating-point, RGBF, RGBAF)*. Method returns TRUE if the scene has been successfully dumped.
|
||||
The value passed as *theBufferType* argument defines the type of the buffer for an output image (RGB, RGBA, floating-point, RGBF, RGBAF). Method returns TRUE if the scene has been successfully dumped.
|
||||
|
||||
~~~~
|
||||
Standard_Boolean V3d_View::ToPixMap (Image_PixMap& theImage,
|
||||
@@ -1728,7 +1706,7 @@ aView->Update();
|
||||
|
||||
Back face culling reduces the rendered number of triangles (which improves the performance) and eliminates artifacts at shape boundaries. However, this option can be used only for solid objects, where the interior is actually invisible from any point of view. Automatic back-face culling mechanism is turned on by default, which is controlled by *V3d_View::SetBackFacingModel()*.
|
||||
|
||||
The following features are applied in *StdPrs_ToolShadedShape::IsClosed()*, which is used for definition of back face culling in *ShadingAspect*:
|
||||
The following features are applied in *StdPrs_ToolTriangulatedShape::IsClosed()*, which is used for definition of back face culling in *ShadingAspect*:
|
||||
* disable culling for free closed Shells (not inside the Solid) since reversed orientation of a free Shell is a valid case;
|
||||
* enable culling for Solids packed into a compound;
|
||||
* ignore Solids with incomplete triangulation.
|
||||
@@ -1856,7 +1834,7 @@ myAISContext->Display (anAISShape);
|
||||
Follow the procedure below to compute the presentable object:
|
||||
|
||||
1. Build a presentable object inheriting from *AIS_InteractiveObject* (refer to the Chapter on @ref occt_visu_2_1 "Presentable Objects").
|
||||
2. Reuse the *Prs3d_Presentation* provided as an argument of the compute methods.
|
||||
2. Reuse the *Graphic3d_Structure* provided as an argument of the compute methods.
|
||||
|
||||
**Note** that there are two compute methods: one for a standard representation, and the other for a degenerated representation, i.e. in hidden line removal and wireframe modes.
|
||||
|
||||
@@ -1864,14 +1842,14 @@ Let us look at the example of compute methods
|
||||
|
||||
~~~~~
|
||||
void MyPresentableObject::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsManager,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Handle(Graphic3d_Structure)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
(
|
||||
//...
|
||||
)
|
||||
|
||||
void MyPresentableObject::Compute (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Prs3d_Presentation)& thePrs)
|
||||
const Handle(Graphic3d_Structure)& thePrs)
|
||||
(
|
||||
//...
|
||||
)
|
||||
@@ -1879,7 +1857,7 @@ void MyPresentableObject::Compute (const Handle(Prs3d_Projector)& theProjector,
|
||||
|
||||
@subsubsection occt_visu_4_5_6 Create primitives in the interactive object
|
||||
|
||||
Get the group used in *Prs3d_Presentation*.
|
||||
Get the group used in *Graphic3d_Structure*.
|
||||
|
||||
~~~~~
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
@section occt_xde_1 Introduction
|
||||
|
||||
This manual explains how to use the Extended Data Exchange (XDE). It provides basic documentation on setting up and using XDE. For advanced information on XDE and its applications, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
This manual explains how to use the Extended Data Exchange (XDE). It provides basic documentation on setting up and using XDE. For advanced information on XDE and its applications, see our <a href="https://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
|
||||
The Extended Data Exchange (XDE) module allows extending the scope of exchange by translating additional data attached to geometric BREP data, thereby improving the interoperability with external software.
|
||||
|
||||
|
2
genproj
@@ -40,7 +40,7 @@ if [ "$aTarget" == "" ]; then
|
||||
fi
|
||||
|
||||
cd $aScriptPath
|
||||
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5
|
||||
tclsh "./adm/start.tcl" genproj ${aTarget} -solution "OCCT" $anOpt2 $anOpt3 $anOpt4 $anOpt5
|
||||
|
||||
export PATH="$anOldPath"
|
||||
export LD_LIBRARY_PATH="$anOldLd"
|
||||
|
@@ -54,5 +54,5 @@ if "%aPrjFmt%" == "" ( set "aPrjFmt=vcxproj" )
|
||||
if "%aPrjFmt%" == "vcxproj" ( set "aPrjFmt=%VCFMT%" )
|
||||
|
||||
cd %~dp0
|
||||
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% %3 %4 %5
|
||||
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% -solution "OCCT" %3 %4 %5
|
||||
SET "PATH=%OLD_PATH%"
|
||||
|
@@ -35,13 +35,49 @@
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
//! Convert GLFW mouse button into Aspect_VKeyMouse.
|
||||
static Aspect_VKeyMouse mouseButtonFromGlfw (int theButton)
|
||||
{
|
||||
switch (theButton)
|
||||
{
|
||||
case GLFW_MOUSE_BUTTON_LEFT: return Aspect_VKeyMouse_LeftButton;
|
||||
case GLFW_MOUSE_BUTTON_RIGHT: return Aspect_VKeyMouse_RightButton;
|
||||
case GLFW_MOUSE_BUTTON_MIDDLE: return Aspect_VKeyMouse_MiddleButton;
|
||||
}
|
||||
return Aspect_VKeyMouse_NONE;
|
||||
}
|
||||
|
||||
//! Convert GLFW key modifiers into Aspect_VKeyFlags.
|
||||
static Aspect_VKeyFlags keyFlagsFromGlfw (int theFlags)
|
||||
{
|
||||
Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE;
|
||||
if ((theFlags & GLFW_MOD_SHIFT) != 0)
|
||||
{
|
||||
aFlags |= Aspect_VKeyFlags_SHIFT;
|
||||
}
|
||||
if ((theFlags & GLFW_MOD_CONTROL) != 0)
|
||||
{
|
||||
aFlags |= Aspect_VKeyFlags_CTRL;
|
||||
}
|
||||
if ((theFlags & GLFW_MOD_ALT) != 0)
|
||||
{
|
||||
aFlags |= Aspect_VKeyFlags_ALT;
|
||||
}
|
||||
if ((theFlags & GLFW_MOD_SUPER) != 0)
|
||||
{
|
||||
aFlags |= Aspect_VKeyFlags_META;
|
||||
}
|
||||
return aFlags;
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
// Function : GlfwOcctView
|
||||
// Purpose :
|
||||
// ================================================================
|
||||
GlfwOcctView::GlfwOcctView()
|
||||
: myCurAction3d (CurAction3d_Nothing),
|
||||
myToRedraw (true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -193,15 +229,7 @@ void GlfwOcctView::mainloop()
|
||||
glfwWaitEvents();
|
||||
if (!myView.IsNull())
|
||||
{
|
||||
if (myView->IsInvalidated())
|
||||
{
|
||||
myView->Redraw();
|
||||
}
|
||||
else if (myToRedraw)
|
||||
{
|
||||
myView->RedrawImmediate();
|
||||
}
|
||||
myToRedraw = false;
|
||||
FlushViewEvents (myContext, myView, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,7 +265,6 @@ void GlfwOcctView::onResize (int theWidth, int theHeight)
|
||||
myView->MustBeResized();
|
||||
myView->Invalidate();
|
||||
myView->Redraw();
|
||||
//myToRedraw = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,13 +274,10 @@ void GlfwOcctView::onResize (int theWidth, int theHeight)
|
||||
// ================================================================
|
||||
void GlfwOcctView::onMouseScroll (double theOffsetX, double theOffsetY)
|
||||
{
|
||||
if (myView.IsNull()) { return; }
|
||||
|
||||
const Graphic3d_Vec2i aPos = myOcctWindow->CursorPosition();
|
||||
myView->StartZoomAtPoint (aPos.x(), aPos.y());
|
||||
myView->ZoomAtPoint (0, 0, int(theOffsetY * 4.0), int(theOffsetY * 4.0));
|
||||
myView->Invalidate();
|
||||
myToRedraw = true;
|
||||
if (!myView.IsNull())
|
||||
{
|
||||
UpdateZoom (Aspect_ScrollDelta (myOcctWindow->CursorPosition(), int(theOffsetY * 8.0)));
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
@@ -265,27 +289,13 @@ void GlfwOcctView::onMouseButton (int theButton, int theAction, int theMods)
|
||||
if (myView.IsNull()) { return; }
|
||||
|
||||
const Graphic3d_Vec2i aPos = myOcctWindow->CursorPosition();
|
||||
if (theAction != GLFW_PRESS)
|
||||
if (theAction == GLFW_PRESS)
|
||||
{
|
||||
myCurAction3d = CurAction3d_Nothing;
|
||||
return;
|
||||
PressMouseButton (aPos, mouseButtonFromGlfw (theButton), keyFlagsFromGlfw (theMods), false);
|
||||
}
|
||||
|
||||
myMouseMin = aPos;
|
||||
myMouseMax = aPos;
|
||||
switch (theButton)
|
||||
else
|
||||
{
|
||||
case GLFW_MOUSE_BUTTON_RIGHT:
|
||||
{
|
||||
myCurAction3d = CurAction3d_DynamicRoation;
|
||||
myView->StartRotation (aPos.x(), aPos.y());
|
||||
break;
|
||||
}
|
||||
case GLFW_MOUSE_BUTTON_MIDDLE:
|
||||
{
|
||||
myCurAction3d = CurAction3d_DynamicPanning;
|
||||
break;
|
||||
}
|
||||
ReleaseMouseButton (aPos, mouseButtonFromGlfw (theButton), keyFlagsFromGlfw (theMods), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,30 +305,9 @@ void GlfwOcctView::onMouseButton (int theButton, int theAction, int theMods)
|
||||
// ================================================================
|
||||
void GlfwOcctView::onMouseMove (int thePosX, int thePosY)
|
||||
{
|
||||
if (myView.IsNull()) { return; }
|
||||
|
||||
switch (myCurAction3d)
|
||||
const Graphic3d_Vec2i aNewPos (thePosX, thePosY);
|
||||
if (!myView.IsNull())
|
||||
{
|
||||
case CurAction3d_DynamicRoation:
|
||||
{
|
||||
myView->Rotation (thePosX, thePosY);
|
||||
myView->Invalidate();
|
||||
myToRedraw = true;
|
||||
break;
|
||||
}
|
||||
case CurAction3d_DynamicPanning:
|
||||
{
|
||||
myView->Pan (thePosX - myMouseMax.x(), -(thePosY - myMouseMax.y()));
|
||||
myView->Invalidate();
|
||||
myToRedraw = true;
|
||||
myMouseMax.SetValues (thePosX, thePosY);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
myContext->MoveTo (thePosX, thePosY, myView, false);
|
||||
myToRedraw = true;
|
||||
break;
|
||||
}
|
||||
UpdateMousePosition (aNewPos, PressedMouseButtons(), LastMouseFlags(), false);
|
||||
}
|
||||
}
|
||||
|
@@ -25,20 +25,12 @@
|
||||
#include "GlfwOcctWindow.h"
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_ViewController.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
|
||||
//! Sample class creating 3D Viewer within GLFW window.
|
||||
class GlfwOcctView
|
||||
class GlfwOcctView : protected AIS_ViewController
|
||||
{
|
||||
public:
|
||||
enum CurAction3d
|
||||
{
|
||||
CurAction3d_Nothing,
|
||||
CurAction3d_DynamicZooming,
|
||||
CurAction3d_DynamicPanning,
|
||||
CurAction3d_DynamicRoation
|
||||
};
|
||||
|
||||
public:
|
||||
//! Default constructor.
|
||||
GlfwOcctView();
|
||||
@@ -115,11 +107,6 @@ private:
|
||||
Handle(V3d_View) myView;
|
||||
Handle(AIS_InteractiveContext) myContext;
|
||||
|
||||
CurAction3d myCurAction3d;
|
||||
Graphic3d_Vec2i myMouseMin;
|
||||
Graphic3d_Vec2i myMouseMax;
|
||||
bool myToRedraw;
|
||||
|
||||
};
|
||||
|
||||
#endif // _GlfwOcctView_Header
|
||||
|
@@ -134,17 +134,17 @@ void GlfwOcctWindow::Unmap() const
|
||||
// Function : DoResize
|
||||
// Purpose :
|
||||
// ================================================================
|
||||
Aspect_TypeOfResize GlfwOcctWindow::DoResize() const
|
||||
Aspect_TypeOfResize GlfwOcctWindow::DoResize()
|
||||
{
|
||||
if (glfwGetWindowAttrib (myGlfwWindow, GLFW_VISIBLE) == 1)
|
||||
{
|
||||
int anXPos = 0, anYPos = 0, aWidth = 0, aHeight = 0;
|
||||
glfwGetWindowPos (myGlfwWindow, &anXPos, &anYPos);
|
||||
glfwGetWindowSize(myGlfwWindow, &aWidth, &aHeight);
|
||||
*const_cast<Standard_Integer*>(&myXLeft ) = anXPos;
|
||||
*const_cast<Standard_Integer*>(&myXRight ) = anXPos + aWidth;
|
||||
*const_cast<Standard_Integer*>(&myYTop ) = anYPos;
|
||||
*const_cast<Standard_Integer*>(&myYBottom) = anYPos + aHeight;
|
||||
myXLeft = anXPos;
|
||||
myXRight = anXPos + aWidth;
|
||||
myYTop = anYPos;
|
||||
myYBottom = anYPos + aHeight;
|
||||
}
|
||||
return Aspect_TOR_UNKNOWN;
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return 0; }
|
||||
|
||||
//! Applies the resizing to the window <me>
|
||||
virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE;
|
||||
virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE;
|
||||
|
||||
//! Returns True if the window <me> is opened and False if the window is closed.
|
||||
virtual Standard_Boolean IsMapped() const Standard_OVERRIDE;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
#include <Prs3d.hxx>
|
||||
#include <StdPrs_ToolTriangulatedShape.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <STEPControl_Reader.hxx>
|
||||
#include <STEPCAFControl_Reader.hxx>
|
||||
@@ -257,12 +257,12 @@ bool OcctViewer::ImportSTEP(std::string theFilename)
|
||||
}
|
||||
|
||||
Handle(Prs3d_Drawer) aDrawer = myContext->DefaultDrawer();
|
||||
Standard_Real aDeflection = Prs3d::GetDeflection (aCompound, aDrawer);
|
||||
Standard_Real aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection (aCompound, aDrawer);
|
||||
if (!BRepTools::Triangulation (aCompound, aDeflection))
|
||||
{
|
||||
BRepMesh_IncrementalMesh anAlgo;
|
||||
anAlgo.ChangeParameters().Deflection = aDeflection;
|
||||
anAlgo.ChangeParameters().Angle = aDrawer->HLRAngle();
|
||||
anAlgo.ChangeParameters().Angle = aDrawer->DeviationAngle();
|
||||
anAlgo.ChangeParameters().InParallel = Standard_True;
|
||||
anAlgo.SetShape (aCompound);
|
||||
anAlgo.Perform();
|
||||
|
@@ -44,7 +44,7 @@ public:
|
||||
virtual void Unmap() const Standard_OVERRIDE {}
|
||||
|
||||
//! Applies the resizing to the window <me>
|
||||
virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE { return Aspect_TOR_UNKNOWN; }
|
||||
virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE { return Aspect_TOR_UNKNOWN; }
|
||||
|
||||
//! Apply the mapping change to the window <me>
|
||||
virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
|
||||
|
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="All"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MakeFileProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="10"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/All.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="10"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/All.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -1,431 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="Approx"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\../Debug"
|
||||
IntermediateDirectory=".\../Debug/objd"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WNT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Debug/objd/Approx.pch"
|
||||
AssemblerListingLocation=".\../Debug/objd/"
|
||||
ObjectFile=".\../Debug/objd/"
|
||||
ProgramDataBaseFileName=".\../Debug/objd/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
|
||||
OutputFile=".\../Debug/Approx.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\../Debug/Approx.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Debug/Approx.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\../Release"
|
||||
IntermediateDirectory=".\../Release/obj"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Release/obj/Approx.pch"
|
||||
AssemblerListingLocation=".\../Release/obj/"
|
||||
ObjectFile=".\../Release/obj/"
|
||||
ProgramDataBaseFileName=".\../Release/obj/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
|
||||
OutputFile=".\../Release/Approx.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\../Release/Approx.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Release/Approx.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="Approx_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="Approx_Presentation.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Common"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\env.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\readme.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\run.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\vc.bat">
|
||||
</File>
|
||||
<Filter
|
||||
Name="Source Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.rc">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar.bmp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar1.bmp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\occ_logo.bmp">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -1,603 +0,0 @@
|
||||
// Approx_Presentation.cpp: implementation of the Approx_Presentation class.
|
||||
// Approximation of curves and surfaces from points.
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Approx_Presentation.h"
|
||||
|
||||
#include <GeomAPI_PointsToBSpline.hxx>
|
||||
#include <GeomAPI_PointsToBSplineSurface.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
#ifdef WNT
|
||||
#define EOL "\r\n"
|
||||
#else
|
||||
#define EOL "\n"
|
||||
#endif
|
||||
|
||||
#define SCALE 100
|
||||
|
||||
|
||||
// Initialization of global variable with an instance of this class
|
||||
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Approx_Presentation;
|
||||
|
||||
// Initialization of array of samples
|
||||
const Approx_Presentation::PSampleFuncType Approx_Presentation::SampleFuncs[] =
|
||||
{
|
||||
&Approx_Presentation::sample1,
|
||||
&Approx_Presentation::sample2,
|
||||
&Approx_Presentation::sample3,
|
||||
&Approx_Presentation::sample4
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Approx_Presentation::Approx_Presentation()
|
||||
{
|
||||
myIndex = 0;
|
||||
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
|
||||
setName ("Approximation of curves and surfaces.");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sample execution
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Approx_Presentation::DoSample()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
if (myIndex >=0 && myIndex < myNbSamples)
|
||||
(this->*SampleFuncs[myIndex])();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sample functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//================================================================
|
||||
|
||||
//defining the data of BSpline curves and surfaces:
|
||||
|
||||
static Standard_Real Tol [] =
|
||||
{
|
||||
0.5*SCALE,
|
||||
0.7*SCALE,
|
||||
0.4*SCALE,
|
||||
1*SCALE
|
||||
};
|
||||
|
||||
static Standard_Integer DegMin [] =
|
||||
{
|
||||
2,3,5,7
|
||||
};
|
||||
|
||||
static Standard_Integer DegMax [] =
|
||||
{
|
||||
7,9,10,12
|
||||
};
|
||||
|
||||
static GeomAbs_Shape Continuity [] =
|
||||
{
|
||||
GeomAbs_C2, GeomAbs_C1, GeomAbs_C2, GeomAbs_C3
|
||||
};
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Comment
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
static TCollection_AsciiString Comment(Standard_Real Step,
|
||||
Standard_Integer Upper,
|
||||
Standard_Integer DegMin,
|
||||
Standard_Integer DegMax,
|
||||
Standard_Integer Indicator,
|
||||
Standard_Real Tol)
|
||||
{
|
||||
TCollection_AsciiString aText;
|
||||
aText = (
|
||||
"/////////////////////////////////////////////////////////////////" EOL
|
||||
"// Approximation of surface." EOL
|
||||
"// Building a BSpline surface which approximates a set of points." EOL
|
||||
"/////////////////////////////////////////////////////////////////" EOL EOL
|
||||
|
||||
"// creating a set of points:" EOL
|
||||
);
|
||||
|
||||
aText += "Standard_Real Step = ";
|
||||
aText += TCollection_AsciiString(Step);
|
||||
aText += ";" EOL;
|
||||
aText += "Standard_Integer Upper = ";
|
||||
aText += TCollection_AsciiString(Upper);
|
||||
aText += ";" EOL EOL;
|
||||
aText += (
|
||||
" //a set of X and Y coordinates:" EOL
|
||||
" Standard_Real aXStep = Step , aYStep = Step ;" EOL
|
||||
" Standard_Real aX0 = -300, aY0 = -200;" EOL
|
||||
" //Z coordinates:" EOL
|
||||
" TColStd_Array2OfReal aZPoints( 1, Upper , 1, Upper );" EOL EOL
|
||||
|
||||
"// initializing array of Z coordinates:" EOL
|
||||
"// aZPoints(1,1) = -2;" EOL
|
||||
"// aZPoints(1,2) = 3;" EOL
|
||||
"// ..." EOL EOL
|
||||
|
||||
"//creating a approximate BSpline surface:" EOL
|
||||
);
|
||||
|
||||
aText += "Parameters of surface:" EOL ;
|
||||
aText += "DegMin = ";
|
||||
aText += TCollection_AsciiString(DegMin);
|
||||
aText += ";" EOL;
|
||||
aText += "DegMax = ";
|
||||
aText += TCollection_AsciiString(DegMax);
|
||||
aText += ";" EOL;
|
||||
aText += "Continuity = " ;
|
||||
|
||||
if( Indicator == 2 )
|
||||
aText += "GeomAbs_C1";
|
||||
if( Indicator == 3 )
|
||||
aText += "GeomAbs_C2";
|
||||
if( Indicator == 4 )
|
||||
aText += "GeomAbs_C3";
|
||||
aText += ";" EOL;
|
||||
aText += "Tolerance = ";
|
||||
aText += TCollection_AsciiString(Tol/SCALE);
|
||||
aText += ";" EOL EOL ;
|
||||
|
||||
aText += (
|
||||
"GeomAPI_PointsToBSplineSurface aPTBS;" EOL
|
||||
"aPTBS.Init(aZPoints,aX0,aXStep,aY0,aYStep," EOL
|
||||
" DegMin,DegMax,Continuity,Tolerance);" EOL
|
||||
"Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();" EOL EOL EOL
|
||||
);
|
||||
|
||||
return aText;
|
||||
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Approx_Presentation::CreateBSplineSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) Approx_Presentation::CreateBSplineSurface(TColStd_Array2OfReal& aZPoints,
|
||||
Standard_Real theXStep,
|
||||
Standard_Real theYStep,
|
||||
Standard_Integer Count)
|
||||
{
|
||||
Standard_Real aX0 = -300, aY0 = -200;
|
||||
|
||||
GeomAPI_PointsToBSplineSurface aPTBS;
|
||||
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
|
||||
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
||||
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
|
||||
|
||||
return aSurface;
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Approx_Presentation::DrawModifyBSplineSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
Standard_Boolean Approx_Presentation::DrawModifyBSplineSurface(TColStd_Array2OfReal& aZPoints,
|
||||
Standard_Real theXStep,
|
||||
Standard_Real theYStep,
|
||||
Standard_Integer theIndexX,
|
||||
Standard_Integer theIndexY,
|
||||
Standard_Real theDeflection,
|
||||
Handle(AIS_InteractiveObject)& aMovePnt,
|
||||
Handle(AIS_InteractiveObject)& aObj,
|
||||
Standard_Integer Count)
|
||||
|
||||
{
|
||||
Handle(AIS_InteractiveObject) auxObj;
|
||||
Standard_Real aX0 = -300, aY0 = -200;
|
||||
Standard_Real aLastZ = aZPoints(theIndexX,theIndexY);
|
||||
aZPoints(theIndexX,theIndexY) += 100*theDeflection;
|
||||
Standard_Real aCurrentX = aX0 + theXStep*(theIndexX-1),
|
||||
aCurrentY = aY0 + theYStep*(theIndexY-1);
|
||||
|
||||
getAISContext()->Erase(aMovePnt);
|
||||
aMovePnt = drawPoint(gp_Pnt(aCurrentX,aCurrentY,aZPoints(theIndexX,theIndexY)));
|
||||
|
||||
if(WAIT_A_LITTLE) return Standard_False;
|
||||
|
||||
|
||||
GeomAPI_PointsToBSplineSurface aPTBS;
|
||||
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
|
||||
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
||||
|
||||
aZPoints(theIndexX,theIndexY) = aLastZ;
|
||||
|
||||
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
|
||||
|
||||
auxObj = drawSurface(aSurface);
|
||||
getAISContext()->Erase(aObj);
|
||||
aObj = auxObj;
|
||||
if(WAIT_A_SECOND) return Standard_False;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Approx_Presentation::sample1
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
void Approx_Presentation::sample1()
|
||||
{
|
||||
Standard_Integer Count = 0;
|
||||
|
||||
TCollection_AsciiString aText = (
|
||||
"//////////////////////////////////////////////////////////////" EOL
|
||||
"// Approximation of curve." EOL
|
||||
"// Building a BSpline curve which approximates a set of points." EOL
|
||||
"//////////////////////////////////////////////////////////////" EOL EOL
|
||||
|
||||
"// creating a set of points to approximate," EOL
|
||||
"// nPoint is the number of points:" EOL
|
||||
"Standard_Integer nPoint = 20;" EOL
|
||||
"TColgp_Array1OfPnt aCurvePoint (1, nPoint);" EOL EOL
|
||||
|
||||
"// initializing this array of points:" EOL
|
||||
"// aCurvePoint(1,1) = gp_Pnt(-6,1,0);" EOL
|
||||
"// aCurvePoint(1,2) = gp_Pnt(-5,1.5,0);" EOL
|
||||
"// ..." EOL EOL
|
||||
|
||||
"//creating an empty approximation algorithm:" EOL
|
||||
"GeomAPI_PointsToBSpline aPTB;" EOL EOL
|
||||
|
||||
"//creating a approximate BSpline curve:" EOL
|
||||
);
|
||||
|
||||
aText += "//parameters of curve:" EOL ;
|
||||
aText += "DegMin = ";
|
||||
aText += TCollection_AsciiString(DegMin[Count]);
|
||||
aText += ";" EOL;
|
||||
aText += "DegMax = ";
|
||||
aText += TCollection_AsciiString(DegMax[Count]);
|
||||
aText += ";" EOL;
|
||||
aText += "Continuity = GeomAbs_C2" ;
|
||||
aText += ";" EOL;
|
||||
aText += "Tolerance = ";
|
||||
aText += TCollection_AsciiString(Tol[Count]/SCALE);
|
||||
aText += ";" EOL EOL ;
|
||||
|
||||
aText += (
|
||||
"aPTB.Init(aCurvePoint,DegMin,DegMax,Continuity,Tolerance);" EOL
|
||||
"Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();" EOL
|
||||
);
|
||||
|
||||
setResultTitle("Creating approximations of curves");
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_Real aCoords[][3] = {
|
||||
{-6,1,0},{-5,1.5,0},{-4,2,0},{-3.5,3,0},{-3,2.7,0},{-2,2.5,0},{-1.5,1,0},{-1,0.5,0},
|
||||
{0,0,0},{1,0.3,0},{2,1,0},{3,1.5,0},{4,2.3,0},{5,2.7,0},{5.5,3.2,0},{6,2.5,0},
|
||||
{7,2,0},{7.5,1,0},{8,0,0},{8.5,-1,0}
|
||||
};
|
||||
|
||||
Standard_Integer nPoint = sizeof(aCoords)/(sizeof(Standard_Real)*3);
|
||||
|
||||
TColgp_Array1OfPnt aCurvePoint (1, nPoint);
|
||||
|
||||
GeomAPI_PointsToBSpline aPTB;
|
||||
|
||||
Handle(AIS_InteractiveObject) aIndexPnt [2],aObj;
|
||||
Standard_Integer aIndex[2] = {9,13};
|
||||
Standard_Real aDeflection[2] = {-1.5,2};
|
||||
|
||||
for (Standard_Integer i=0; i < nPoint; i++)
|
||||
{
|
||||
aCurvePoint(i+1) = gp_Pnt (aCoords[i][0]*SCALE-100, aCoords[i][1]*SCALE-100, aCoords[i][2]*SCALE);
|
||||
if( i+1 == aIndex[0])
|
||||
aIndexPnt[0] = drawPoint(aCurvePoint(aIndex[0]));
|
||||
if( i+1 == aIndex[1])
|
||||
aIndexPnt[1] = drawPoint(aCurvePoint(aIndex[1]));
|
||||
if( i+1 != aIndex[0] && i+1 != aIndex[1])
|
||||
drawPoint(aCurvePoint(i+1));
|
||||
}
|
||||
|
||||
if(WAIT_A_LITTLE) return;
|
||||
|
||||
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
||||
Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();
|
||||
aObj = drawCurve(aCurve);
|
||||
|
||||
for( i = 0 ; i < 2 ; i++)
|
||||
{
|
||||
if (WAIT_A_SECOND) return;
|
||||
getAISContext()->Erase(aIndexPnt[i]);
|
||||
|
||||
aCurvePoint(aIndex[i]) = gp_Pnt(aCurvePoint(aIndex[i]).X()-SCALE*aDeflection[i],
|
||||
aCurvePoint(aIndex[i]).Y()+SCALE*aDeflection[i],
|
||||
aCurvePoint(aIndex[i]).Z());
|
||||
|
||||
|
||||
aIndexPnt[i] = drawPoint(aCurvePoint(aIndex[i]));
|
||||
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
||||
aCurve = aPTB.Curve();
|
||||
|
||||
if (WAIT_A_LITTLE) return;
|
||||
getAISContext()->Erase(aObj);
|
||||
aObj = drawCurve(aCurve);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Approx_Presentation::sample2
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
void Approx_Presentation::sample2()
|
||||
{
|
||||
setResultTitle("Creating approximations of surfaces");
|
||||
|
||||
Standard_Integer Count = 1;
|
||||
Standard_Real aZCoords [] =
|
||||
{
|
||||
{-1},{0},{0},{1},{0},{-1},{-1},{0},{0},{-1.5},{-2.5},{0},{1},{-2},{-3},{0}
|
||||
};
|
||||
|
||||
Standard_Real aXStep = 175, aYStep = 175;
|
||||
Standard_Real aX0 = -300, aY0 = -200;
|
||||
|
||||
Standard_Integer anUpper = 4;
|
||||
TColStd_Array2OfReal aZPoints(1,anUpper,1,anUpper);
|
||||
|
||||
Standard_Integer aIndexX[] = { 4, 3, 2, 2, 1 };
|
||||
Standard_Integer aIndexY[] = { 4, 3, 2, 3, 4 };
|
||||
Standard_Real aDeflection[] = { 1.5, 2.5, 1.5, 1.5, -1 };
|
||||
|
||||
Standard_Integer aNumOfIndexPnt = sizeof(aIndexX)/sizeof(Standard_Integer);
|
||||
|
||||
|
||||
TColgp_Array2OfPnt aPnt(1,4,1,4);
|
||||
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
|
||||
|
||||
Standard_Integer aColLength = aZPoints.ColLength();
|
||||
Standard_Integer aRowLength = aZPoints.RowLength();
|
||||
Standard_Integer aIndex = -1;
|
||||
|
||||
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
|
||||
{
|
||||
for(Standard_Integer j = 0; j < aColLength ; j++)
|
||||
{
|
||||
aIndex++;
|
||||
aZPoints(i+1,j+1) = aZCoords[aIndex];
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real auxY0,auxX0 = aX0 - aXStep;
|
||||
|
||||
for( i = 0 ; i < aColLength ; i++)
|
||||
{
|
||||
auxX0 += aXStep;
|
||||
auxY0 = aY0 - aYStep;
|
||||
|
||||
for(Standard_Integer j = 0 ; j < aRowLength ; j++)
|
||||
{
|
||||
aZPoints(i+1,j+1) *=SCALE;
|
||||
auxY0 += aYStep;
|
||||
aPnt(i+1,j+1) = gp_Pnt (auxX0,auxY0,aZPoints(i+1,j+1));
|
||||
aShowPnt[i][j] = drawPoint(aPnt(i+1,j+1));
|
||||
}
|
||||
}
|
||||
|
||||
if(WAIT_A_LITTLE) return ;
|
||||
|
||||
TCollection_AsciiString aText;
|
||||
aText = Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
||||
aObj = drawSurface(aSurface);
|
||||
Standard_Boolean aBool;
|
||||
if(WAIT_A_LITTLE) return ;
|
||||
|
||||
for( i = 0 ; i < aNumOfIndexPnt ; i++)
|
||||
{
|
||||
aMovePnt = aShowPnt[aIndexX[i]-1][aIndexY[i]-1];
|
||||
aBool = DrawModifyBSplineSurface(aZPoints,aXStep,aYStep,aIndexX[i],aIndexY[i],
|
||||
aDeflection[i],aMovePnt,aObj,Count);
|
||||
if(!aBool) return;
|
||||
|
||||
if( i < aNumOfIndexPnt - 1)
|
||||
{
|
||||
drawPoint(aPnt(aIndexX[i],aIndexY[i]));
|
||||
getAISContext()->Erase(aMovePnt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Approx_Presentation::sample3
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
void Approx_Presentation::sample3()
|
||||
{
|
||||
setResultTitle("Creating approximations of surfaces");
|
||||
|
||||
Standard_Integer Count = 2;
|
||||
Standard_Real aZCoords [] =
|
||||
{
|
||||
{-3},{-2.3},{-3},{-0.5},{-1},{-1},{-1},{-1},{0},{0},{0},{0},{1},{-1},{-1},{0}
|
||||
};
|
||||
|
||||
Standard_Integer anUpper = 4;
|
||||
TColStd_Array2OfReal aZPoints(1,anUpper,1,anUpper);
|
||||
|
||||
Standard_Integer aIndexX[] = {1, 2, 3, 4};
|
||||
Standard_Integer aIndexY[] = {1, 2, 3, 4};
|
||||
Standard_Real aDeflection[] = {1.5, 2, 1, 1.5};
|
||||
|
||||
Standard_Integer aNumOfIndexPnt = sizeof(aIndexX)/sizeof(Standard_Integer);
|
||||
|
||||
|
||||
TColgp_Array2OfPnt aPnt(1,4,1,4);
|
||||
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
|
||||
|
||||
Standard_Integer aColLength = aZPoints.ColLength();
|
||||
Standard_Integer aRowLength = aZPoints.RowLength();
|
||||
Standard_Integer aIndex = -1;
|
||||
|
||||
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
|
||||
{
|
||||
for(Standard_Integer j = 0; j < aColLength ; j++)
|
||||
{
|
||||
aIndex++;
|
||||
aZPoints(i+1,j+1) = aZCoords[aIndex];
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real aXStep = 175, aYStep = 175;
|
||||
Standard_Real aX0 = -300, aY0 = -200;
|
||||
Standard_Real auxY0,auxX0 = aX0 - aXStep;
|
||||
|
||||
for( i = 0 ; i < aColLength ; i++)
|
||||
{
|
||||
auxX0 += aXStep;
|
||||
auxY0 = aY0 - aYStep;
|
||||
|
||||
for(Standard_Integer j = 0 ; j < aRowLength ; j++)
|
||||
{
|
||||
aZPoints(i+1,j+1) *=SCALE;
|
||||
auxY0 += aYStep;
|
||||
aPnt(i+1,j+1) = gp_Pnt (auxX0,auxY0,aZPoints(i+1,j+1));
|
||||
aShowPnt[i][j] = drawPoint(aPnt(i+1,j+1));
|
||||
}
|
||||
}
|
||||
|
||||
if(WAIT_A_LITTLE) return ;
|
||||
|
||||
TCollection_AsciiString aText;
|
||||
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
||||
aObj = drawSurface(aSurface);
|
||||
Standard_Boolean aBool;
|
||||
if(WAIT_A_LITTLE) return ;
|
||||
|
||||
for( i = 0 ; i < aNumOfIndexPnt ; i++)
|
||||
{
|
||||
aMovePnt = aShowPnt[aIndexX[i]-1][aIndexY[i]-1];
|
||||
aBool = DrawModifyBSplineSurface(aZPoints,aXStep,aYStep,aIndexX[i],aIndexY[i],
|
||||
aDeflection[i],aMovePnt,aObj,Count);
|
||||
if(!aBool) return;
|
||||
|
||||
if( i < aNumOfIndexPnt - 1)
|
||||
{
|
||||
drawPoint(aPnt(aIndexX[i],aIndexY[i]));
|
||||
getAISContext()->Erase(aMovePnt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Approx_Presentation::sample4
|
||||
// Purpose :
|
||||
//================================================================
|
||||
|
||||
void Approx_Presentation::sample4()
|
||||
{
|
||||
setResultTitle("Creating approximations of surfaces");
|
||||
|
||||
Standard_Integer Count = 3;
|
||||
Standard_Real aZCoords [] =
|
||||
{
|
||||
{-1.5},{0.5},{1},{0.5},{-1.5},{0},{-0.5},{0},{-0.5},{0},{1},{-0.5},{0},{-0.5},{1},{0},{-0.5},
|
||||
{0},{-0.5},{0},{-1.5},{0.5},{1},{0.5},{-1.5}
|
||||
};
|
||||
|
||||
Standard_Integer anUpper = 5;
|
||||
TColStd_Array2OfReal aZPoints(1,anUpper,1,anUpper);
|
||||
|
||||
Standard_Integer aIndexX[] = { 1, 3, 5 };
|
||||
Standard_Integer aIndexY[] = { 3, 3, 3 };
|
||||
Standard_Real aDeflection[] = {-2, 1, -2 };
|
||||
|
||||
Standard_Integer aNumOfIndexPnt = sizeof(aIndexX)/sizeof(Standard_Integer);
|
||||
|
||||
|
||||
TColgp_Array2OfPnt aPnt(1,5,1,5);
|
||||
Handle(AIS_InteractiveObject) aShowPnt[5][5],aObj,aMovePnt;
|
||||
|
||||
Standard_Integer aColLength = aZPoints.ColLength();
|
||||
Standard_Integer aRowLength = aZPoints.RowLength();
|
||||
Standard_Integer aIndex = -1;
|
||||
|
||||
for(Standard_Integer i = 0 ; i < aRowLength ; i++)
|
||||
{
|
||||
for(Standard_Integer j = 0; j < aColLength ; j++)
|
||||
{
|
||||
aIndex++;
|
||||
aZPoints(i+1,j+1) = aZCoords[aIndex];
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real aXStep = 140, aYStep = 140;
|
||||
Standard_Real aX0 = -300, aY0 = -200;
|
||||
Standard_Real auxY0,auxX0 = aX0 - aXStep;
|
||||
|
||||
for( i = 0 ; i < aColLength ; i++)
|
||||
{
|
||||
auxX0 += aXStep;
|
||||
auxY0 = aY0 - aYStep;
|
||||
|
||||
for(Standard_Integer j = 0 ; j < aRowLength ; j++)
|
||||
{
|
||||
aZPoints(i+1,j+1) *=SCALE;
|
||||
auxY0 += aYStep;
|
||||
aPnt(i+1,j+1) = gp_Pnt (auxX0,auxY0,aZPoints(i+1,j+1));
|
||||
aShowPnt[i][j] = drawPoint(aPnt(i+1,j+1));
|
||||
}
|
||||
}
|
||||
|
||||
if(WAIT_A_LITTLE) return ;
|
||||
|
||||
TCollection_AsciiString aText;
|
||||
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
||||
aObj = drawSurface(aSurface);
|
||||
Standard_Boolean aBool;
|
||||
if(WAIT_A_LITTLE) return ;
|
||||
|
||||
for( i = 0 ; i < aNumOfIndexPnt ; i++)
|
||||
{
|
||||
aMovePnt = aShowPnt[aIndexX[i]-1][aIndexY[i]-1];
|
||||
aBool = DrawModifyBSplineSurface(aZPoints,aXStep,aYStep,aIndexX[i],aIndexY[i],
|
||||
aDeflection[i],aMovePnt,aObj,Count);
|
||||
if(!aBool) return;
|
||||
|
||||
if( i < aNumOfIndexPnt - 1)
|
||||
{
|
||||
drawPoint(aPnt(aIndexX[i],aIndexY[i]));
|
||||
getAISContext()->Erase(aMovePnt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,50 +0,0 @@
|
||||
// Approx_Presentation.h: interface for the Approx_Presentation class.
|
||||
// Presentation class: Approximation of curves and surfaces.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_Approx_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_Approx_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <OCCDemo_Presentation.h>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
|
||||
class Approx_Presentation : public OCCDemo_Presentation
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
Approx_Presentation();
|
||||
|
||||
public:
|
||||
// Iteration on samples
|
||||
virtual void DoSample();
|
||||
// one phase of iterations
|
||||
|
||||
private:
|
||||
// Sample functions
|
||||
void sample1();
|
||||
void sample2();
|
||||
void sample3();
|
||||
void sample4();
|
||||
Standard_Boolean DrawModifyBSplineSurface(TColStd_Array2OfReal& ,
|
||||
Standard_Real ,Standard_Real ,
|
||||
Standard_Integer ,Standard_Integer ,
|
||||
Standard_Real,Handle(AIS_InteractiveObject)&,
|
||||
Handle(AIS_InteractiveObject)&,
|
||||
Standard_Integer);
|
||||
|
||||
Handle(Geom_BSplineSurface) CreateBSplineSurface(TColStd_Array2OfReal& ,
|
||||
Standard_Real ,Standard_Real,
|
||||
Standard_Integer);
|
||||
|
||||
private:
|
||||
// Array of pointers to sample functions
|
||||
typedef void (Approx_Presentation::*PSampleFuncType)();
|
||||
static const PSampleFuncType SampleFuncs[];
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_Approx_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,428 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="Chamfers"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\../Release"
|
||||
IntermediateDirectory=".\../Release/obj"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WNT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Release/obj/Chamfers.pch"
|
||||
AssemblerListingLocation=".\../Release/obj/"
|
||||
ObjectFile=".\../Release/obj/"
|
||||
ProgramDataBaseFileName=".\../Release/obj/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
|
||||
OutputFile=".\../Release/Chamfers.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\../Release/Chamfers.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Release/Chamfers.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\../Debug"
|
||||
IntermediateDirectory=".\../Debug/objd"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Debug/objd/Chamfers.pch"
|
||||
AssemblerListingLocation=".\../Debug/objd/"
|
||||
ObjectFile=".\../Debug/objd/"
|
||||
ProgramDataBaseFileName=".\../Debug/objd/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBO.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib"
|
||||
OutputFile=".\../Debug/Chamfers.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\../Debug/Chamfers.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Debug/Chamfers.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="Chamfers_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="Chamfers_Presentation.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Common"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\env.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\readme.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\run.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\vc.bat">
|
||||
</File>
|
||||
<Filter
|
||||
Name="Source Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.rc">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar.bmp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar1.bmp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -1,781 +0,0 @@
|
||||
// Chamfers_Presentation.cpp: implementation of the Chamfers_Presentation class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Chamfers_Presentation.h"
|
||||
|
||||
#ifdef WNT
|
||||
#pragma warning (disable : 4786)
|
||||
#endif
|
||||
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <BRepPrimAPI_MakeCylinder.hxx>
|
||||
#include <BRepAlgo_Fuse.hxx>
|
||||
#include <BRepAlgoAPI_Fuse.hxx>
|
||||
#include <BRepFilletAPI_MakeChamfer.hxx>
|
||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopOpeBRepBuild_HBuilder.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#ifdef WNT
|
||||
#define EOL "\r\n"
|
||||
#else
|
||||
#define EOL "\n"
|
||||
#endif
|
||||
|
||||
#define BOX_SIDE_LEN 500
|
||||
|
||||
// Initialization of global variable with an instance of this class
|
||||
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Chamfers_Presentation;
|
||||
|
||||
// Initialization of array of samples
|
||||
const Chamfers_Presentation::PSampleFuncType Chamfers_Presentation::SampleFuncs[] =
|
||||
{
|
||||
&Chamfers_Presentation::sampleBoxChamfer,
|
||||
&Chamfers_Presentation::sampleBoxCylChamfer,
|
||||
&Chamfers_Presentation::sampleBoxCylAngChamfer,
|
||||
&Chamfers_Presentation::sampleBoxFillet,
|
||||
&Chamfers_Presentation::sampleBoxCylFillet,
|
||||
&Chamfers_Presentation::sampleBoxCylAngFillet
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Chamfers_Presentation::Chamfers_Presentation()
|
||||
{
|
||||
myIndex = 0;
|
||||
myNbSamples = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
|
||||
setName ("Chamfers and Fillets");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sample execution
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Chamfers_Presentation::DoSample()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
if (myIndex >=0 && myIndex < myNbSamples)
|
||||
(this->*SampleFuncs[myIndex])();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sample functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//================================================================
|
||||
// Function : createDiverseChamferOnBox
|
||||
// Purpose : makes chamfers of different size on 3 converging edges
|
||||
// of the given box using given distances d1, d2, d3;
|
||||
// outputs its own source code into result dialog
|
||||
//================================================================
|
||||
Standard_Boolean Chamfers_Presentation::createDiverseChamferOnBox(
|
||||
TopoDS_Solid& aBox,
|
||||
Standard_Real d1, // chamfer on edge 1
|
||||
Standard_Real d2, // chamfer on edge 2
|
||||
Standard_Real d3, // chamfer on edge 3
|
||||
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
|
||||
// we display the new shape first, then erase the previous one
|
||||
{
|
||||
// initializing a class that builds chamfer
|
||||
BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);
|
||||
|
||||
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
|
||||
// of the box that "touch" the edge
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
|
||||
// filling the map with edges and faces of the box
|
||||
TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
|
||||
|
||||
// array of indexes of edges to be chamfered
|
||||
int aEdgeInd[] = {6, 2, 10, 12, 5};
|
||||
|
||||
// creating chamfer on one of an edge of the top face, using d1
|
||||
if (d1 > Precision::Confusion())
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[0]));
|
||||
TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());
|
||||
aMakeChamfer.Add(d1, d1, anEdge, aFace);
|
||||
}
|
||||
|
||||
// creating chamfer on the other 3 edges of the top face, using d2
|
||||
if (d2 > Precision::Confusion())
|
||||
{
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));
|
||||
TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());
|
||||
aMakeChamfer.Add(d2, d2, anEdge, aFace);
|
||||
}
|
||||
}
|
||||
|
||||
// creating chamfer on a vertical edge of box, using d3
|
||||
if (d3 > Precision::Confusion())
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[4]));
|
||||
TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());
|
||||
aMakeChamfer.Add(d3, d3, anEdge, aFace);
|
||||
}
|
||||
|
||||
aMakeChamfer.Build();
|
||||
if (aMakeChamfer.IsDone())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aNewShape = new AIS_Shape(aMakeChamfer.Shape());
|
||||
getAISContext()->Erase(thePrevShape, Standard_False);
|
||||
thePrevShape = aNewShape;
|
||||
getAISContext()->Display(aNewShape);
|
||||
}
|
||||
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a box and centering it on the screen" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL EOL
|
||||
|
||||
" // initializing a class that builds chamfer" EOL
|
||||
" BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);" EOL EOL
|
||||
|
||||
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
|
||||
" // of the box that \"touch\" the edge" EOL
|
||||
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
|
||||
" // filling the map with edges and faces of the box" EOL
|
||||
" TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL
|
||||
"" EOL
|
||||
" Standard_Real d1 = "+TCollection_AsciiString(d1)+";" EOL
|
||||
" Standard_Real d2 = "+TCollection_AsciiString(d2)+";" EOL
|
||||
" Standard_Real d3 = "+TCollection_AsciiString(d3)+";" EOL
|
||||
"" EOL
|
||||
" // array of indexes of edges to be chamfered" EOL
|
||||
" int aEdgeInd[] = {6, 2, 10, 12, 5};" EOL
|
||||
"" EOL
|
||||
" // creating chamfer on one of an edge of the top face, using d1" EOL
|
||||
" if (d1 > Precision::Confusion())" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[0]));" EOL
|
||||
" TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());" EOL
|
||||
" aMakeChamfer.Add(d1, d1, anEdge, aFace);" EOL
|
||||
" }" EOL
|
||||
"" EOL
|
||||
" // creating chamfer on the other 3 edges of the top face, using d2" EOL
|
||||
" if (d2 > Precision::Confusion())" EOL
|
||||
" {" EOL
|
||||
" for (Standard_Integer i = 1; i <= 3; i++)" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));" EOL
|
||||
" TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());" EOL
|
||||
" aMakeChamfer.Add(d2, d2, anEdge, aFace);" EOL
|
||||
" }" EOL
|
||||
" }" EOL
|
||||
"" EOL
|
||||
" // creating chamfer on a vertical edge of box, using d3" EOL
|
||||
" if (d3 > Precision::Confusion())" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[4]));" EOL
|
||||
" TopoDS_Face aFace = TopoDS::Face(aMapOfEdgeToFaces.FindFromKey(anEdge).First());" EOL
|
||||
" aMakeChamfer.Add(d3, d3, anEdge, aFace);" EOL
|
||||
" }" EOL
|
||||
" " EOL
|
||||
" aMakeChamfer.Build();" EOL
|
||||
" if (aMakeChamfer.IsDone())" EOL
|
||||
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
return WAIT_A_SECOND;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : createChamferOnBox
|
||||
// Purpose : makes chamfers on edges of the top face of the given box
|
||||
// using given distances theDistA and theDistB, outputs its own
|
||||
// source code into result dialog
|
||||
//================================================================
|
||||
Standard_Boolean Chamfers_Presentation::createChamferOnBox(
|
||||
TopoDS_Solid& aBox,
|
||||
Standard_Real theDistA, // distance along first face
|
||||
Standard_Real theDistB, // distance along second face
|
||||
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
|
||||
// we display the new shape first, then erase the previous one
|
||||
{
|
||||
// initializing a class that builds chamfer
|
||||
BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);
|
||||
|
||||
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
|
||||
// of the box that "touch" the edge
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
|
||||
// filling the map with edges and faces of the box
|
||||
TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
|
||||
|
||||
// array of indexes of edges to be chamfered
|
||||
int aEdgeInd[] = {2, 6, 10, 12};
|
||||
|
||||
// building chamfers
|
||||
for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)
|
||||
//for (int i = 1; i <= 12; i++) // uncomment to iterate through ALL edges of the box
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));
|
||||
//TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(i));
|
||||
// uncomment to iterate through ALL edges of the box
|
||||
const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);
|
||||
TopoDS_Face aFace = TopoDS::Face(aFaces.First());
|
||||
aMakeChamfer.Add(theDistA, theDistB, anEdge, aFace);
|
||||
}
|
||||
|
||||
aMakeChamfer.Build();
|
||||
if (aMakeChamfer.IsDone())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aNewShape = new AIS_Shape(aMakeChamfer.Shape());
|
||||
getAISContext()->Erase(thePrevShape, Standard_False);
|
||||
getAISContext()->Display(aNewShape, Standard_True);
|
||||
thePrevShape = aNewShape;
|
||||
}
|
||||
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a box and centering it on the screen" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL EOL
|
||||
|
||||
" // initializing a class that builds chamfer" EOL
|
||||
" BRepFilletAPI_MakeChamfer aMakeChamfer(aBox);" EOL EOL
|
||||
|
||||
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
|
||||
" // of the box that \"touch\" the edge" EOL
|
||||
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
|
||||
" // filling the map with edges and faces of the box" EOL
|
||||
" TopExp::MapShapesAndAncestors(aBox, TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL
|
||||
"" EOL
|
||||
" Standard_Real aDistA = "+TCollection_AsciiString(theDistA)+";" EOL
|
||||
" Standard_Real aDistB = "+TCollection_AsciiString(theDistB)+";" EOL
|
||||
"" EOL
|
||||
" // array of indexes of edges to be chamfered" EOL
|
||||
" int aEdgeInd[] = {2, 6, 10, 12};" EOL EOL
|
||||
|
||||
" // building chamfers" EOL
|
||||
" for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdgeToFaces.FindKey(aEdgeInd[i]));" EOL
|
||||
" const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);" EOL
|
||||
" TopoDS_Face aFace = TopoDS::Face(aFaces.First());" EOL
|
||||
" // creating a chamfer with lengths aDistA, aDistB" EOL
|
||||
" aMakeChamfer.Add(aDistA, aDistB, anEdge, aFace);" EOL
|
||||
" }" EOL EOL
|
||||
|
||||
" aMakeChamfer.Build();" EOL
|
||||
" if (aMakeChamfer.IsDone())" EOL
|
||||
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
return WAIT_A_SECOND;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : createFilletOnBox
|
||||
// Purpose : creates a box with side=10, makes fillets on some of its edges
|
||||
// using given value of radius and shape of fillet, outputs its own
|
||||
// source code into theText parameter
|
||||
//================================================================
|
||||
Standard_Boolean Chamfers_Presentation::createFilletOnBox(
|
||||
TopoDS_Solid& aBox,
|
||||
Standard_Real theRad, // radius of fillet
|
||||
ChFi3d_FilletShape theFShape, // shape of fillet
|
||||
Handle(AIS_InteractiveObject)& thePrevObj) // to erase
|
||||
// the previous shape
|
||||
{
|
||||
// initializing a class that builds fillet
|
||||
// second parameter is a shape of fillet:
|
||||
// enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };
|
||||
BRepFilletAPI_MakeFillet aMakeFillet(aBox, theFShape);
|
||||
|
||||
// a map of edges
|
||||
TopTools_IndexedMapOfShape aMapOfEdges;
|
||||
// filling the map with edges of the box
|
||||
TopExp::MapShapes(aBox, TopAbs_EDGE, aMapOfEdges);
|
||||
|
||||
// array of indexes of edges to be chamfered
|
||||
int aEdgeInd[] = {2, 6, 10, 12};
|
||||
|
||||
// adding edges that will have fillet
|
||||
for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdges(aEdgeInd[i]));
|
||||
aMakeFillet.Add(theRad, anEdge);
|
||||
}
|
||||
|
||||
aMakeFillet.Build();
|
||||
if (aMakeFillet.IsDone())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aNewShape = new AIS_Shape(aMakeFillet.Shape());
|
||||
getAISContext()->Erase(thePrevObj, Standard_False);
|
||||
getAISContext()->Display(aNewShape, Standard_True);
|
||||
thePrevObj = aNewShape;
|
||||
}
|
||||
|
||||
// calculating the string corresponding to theFShape
|
||||
TCollection_AsciiString aFShapeStr;
|
||||
aFShapeStr = ((theFShape==ChFi3d_Rational)? "ChFi3d_Rational":
|
||||
((theFShape==ChFi3d_QuasiAngular)? "ChFi3d_QuasiAngular":
|
||||
"ChFi3d_Polynomial"));
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a box and centering it on the screen" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL
|
||||
" " EOL
|
||||
" // initializing a class that builds fillet" EOL
|
||||
" // second parameter is a shape of fillet:" EOL
|
||||
" // enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };" EOL
|
||||
" BRepFilletAPI_MakeFillet aMakeFillet(aBox, "+aFShapeStr+");" EOL
|
||||
" " EOL
|
||||
" // a map of edges" EOL
|
||||
" TopTools_IndexedMapOfShape aMapOfEdges;" EOL
|
||||
" // filling the map with edges of the box" EOL
|
||||
" TopExp::MapShapes(aBox, TopAbs_EDGE, aMapOfEdges);" EOL EOL
|
||||
|
||||
" // array of indexes of edges to be chamfered" EOL
|
||||
" int aEdgeInd[] = {2, 6, 10, 12};" EOL EOL
|
||||
|
||||
" // adding edges that will have fillet" EOL
|
||||
" Standard_Real r = "+TCollection_AsciiString(theRad)+";" EOL
|
||||
" for (int i = 0; i <= sizeof(aEdgeInd)/sizeof(int)-1; i++)" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(aMapOfEdges(aEdgeInd[i]));" EOL
|
||||
" aMakeFillet.Add(r, anEdge);" EOL
|
||||
" }" EOL
|
||||
|
||||
" aMakeFillet.Build();" EOL
|
||||
" if (aMakeFillet.IsDone())" EOL
|
||||
" TopoDS_Shape aShapeWithFillet = aMakeFillet.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
return WAIT_A_SECOND;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ===============================================================
|
||||
// CHAMFER CASES
|
||||
// ===============================================================
|
||||
//================================================================
|
||||
// Function : Chamfers_Presentation::sampleBoxChamfer1,2,3
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Chamfers_Presentation::sampleBoxChamfer()
|
||||
{
|
||||
setResultTitle("Creating Chamfer");
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a box and centering it on the screen" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
// show initial shape
|
||||
Standard_Real a = BOX_SIDE_LEN;
|
||||
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
|
||||
Handle(AIS_InteractiveObject) aPrevShape = new AIS_Shape(aBox);
|
||||
getAISContext()->Display(aPrevShape, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
|
||||
if (WAIT_A_SECOND) return;
|
||||
|
||||
// show several chamfers
|
||||
if (createChamferOnBox(aBox, a/10, a/10, aPrevShape)) return;
|
||||
if (createChamferOnBox(aBox, a/24, a/10, aPrevShape)) return;
|
||||
if (createChamferOnBox(aBox, a/10, a/10, aPrevShape)) return;
|
||||
if (createChamferOnBox(aBox, a/10, a/24, aPrevShape)) return;
|
||||
if (createChamferOnBox(aBox, a/10, a/10, aPrevShape)) return;
|
||||
if (createDiverseChamferOnBox(aBox, a/6, a/10, 0, aPrevShape)) return;
|
||||
if (createDiverseChamferOnBox(aBox, a/6, a/10, a/24, aPrevShape)) return;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Chamfers_Presentation::sampleBoxCylChamfer
|
||||
// Purpose : creates a more complecated chamfer on a shape created
|
||||
// by fusing box and cylinder
|
||||
//================================================================
|
||||
void Chamfers_Presentation::sampleBoxCylChamfer()
|
||||
{
|
||||
setResultTitle("Creating Chamfer");
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a shape, a result of fusing of a box and cylinder" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" Standard_Real b = a/2;" EOL
|
||||
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
|
||||
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);" EOL
|
||||
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
|
||||
" aFuser.Build();" EOL EOL
|
||||
|
||||
" // initializing a class that builds chamfer" EOL
|
||||
" BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());" EOL EOL
|
||||
|
||||
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
|
||||
" // of the box that \"touch\" the edge" EOL
|
||||
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
|
||||
" // filling the map with edges and faces of the box" EOL
|
||||
" TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL EOL
|
||||
|
||||
" // retrieving list of edges to build a chamfer on - edges of " EOL
|
||||
" // intersection of the cylinder and the box" EOL
|
||||
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
|
||||
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL
|
||||
"" EOL
|
||||
" // creating fillet on edge intersection edges" EOL
|
||||
" Standard_Real d = a/20;" EOL
|
||||
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());" EOL
|
||||
" if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;" EOL
|
||||
" const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);" EOL
|
||||
" TopoDS_Face aFace = TopoDS::Face(aFaces.First());" EOL
|
||||
" aMakeChamfer.Add(d, d, anEdge, aFace);" EOL
|
||||
" }" EOL
|
||||
" " EOL
|
||||
" aMakeChamfer.Build();" EOL
|
||||
" if (aMakeChamfer.IsDone())" EOL
|
||||
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
// creating a shape, a result of fusing of a box and cylinder
|
||||
Standard_Real a = BOX_SIDE_LEN;
|
||||
Standard_Real b = a/2;
|
||||
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
|
||||
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);
|
||||
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
|
||||
aFuser.Build();
|
||||
|
||||
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
|
||||
getAISContext()->Display(aPrevObj, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
|
||||
if (WAIT_A_SECOND) return;
|
||||
|
||||
// initializing a class that builds chamfer
|
||||
BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());
|
||||
|
||||
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
|
||||
// of the box that "touch" the edge
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
|
||||
// filling the map with edges and faces of the box
|
||||
TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
|
||||
|
||||
// retrieving list of edges to build a chamfer on - edges of
|
||||
// intersection of the cylinder and the box
|
||||
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
|
||||
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
|
||||
|
||||
// creating fillet on edge intersection edges
|
||||
Standard_Real d = a/20;
|
||||
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());
|
||||
if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;
|
||||
const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);
|
||||
TopoDS_Face aFace = TopoDS::Face(aFaces.First());
|
||||
aMakeChamfer.Add(d, d, anEdge, aFace);
|
||||
}
|
||||
|
||||
aMakeChamfer.Build();
|
||||
|
||||
if (aMakeChamfer.IsDone())
|
||||
{
|
||||
getAISContext()->Erase(aPrevObj, Standard_False);
|
||||
getAISContext()->Display(new AIS_Shape(aMakeChamfer.Shape()));
|
||||
//aPrevObj = aNewShape;// uncomment if further thePrevObj is used
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Chamfers_Presentation::sampleBoxCylAngChamfer
|
||||
// Purpose : creates a more complecated chamfer on a shape created
|
||||
// by fusing box and cylinder
|
||||
//================================================================
|
||||
void Chamfers_Presentation::sampleBoxCylAngChamfer()
|
||||
{
|
||||
setResultTitle("Creating Chamfer");
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a shape, a result of fusing of a box and cylinder" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" Standard_Real b = a/2;" EOL
|
||||
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
|
||||
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);" EOL
|
||||
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
|
||||
" aFuser.Build();" EOL EOL
|
||||
|
||||
" // initializing a class that builds chamfer" EOL
|
||||
" BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());" EOL EOL
|
||||
|
||||
" // a map of \"edge-to-list of faces\". Key = edge, value = list of 2 faces " EOL
|
||||
" // of the box that \"touch\" the edge" EOL
|
||||
" TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;" EOL
|
||||
" // filling the map with edges and faces of the box" EOL
|
||||
" TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);" EOL EOL
|
||||
|
||||
" // retrieving list of edges to build a chamfer on - edges of " EOL
|
||||
" // intersection of the cylinder and the box" EOL
|
||||
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
|
||||
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL EOL
|
||||
|
||||
" // creating chamfer on intersection edges" EOL
|
||||
" Standard_Real d = a/20;" EOL
|
||||
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
|
||||
" {" EOL
|
||||
" TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());" EOL
|
||||
" if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;" EOL
|
||||
" const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);" EOL
|
||||
" TopoDS_Face aFace = TopoDS::Face(aFaces.First());" EOL
|
||||
" aMakeChamfer.Add(d, d, anEdge, aFace);" EOL
|
||||
" }" EOL EOL
|
||||
|
||||
" aMakeChamfer.Build();" EOL
|
||||
" if (aMakeChamfer.IsDone())" EOL
|
||||
" TopoDS_Shape aChamferedShape = aMakeChamfer.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
// creating a shape, a result of fusing of a box and cylinder
|
||||
Standard_Real a = BOX_SIDE_LEN;
|
||||
Standard_Real b = a/2;
|
||||
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
|
||||
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);
|
||||
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
|
||||
aFuser.Build();
|
||||
|
||||
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
|
||||
getAISContext()->Display(aPrevObj, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
|
||||
if (WAIT_A_SECOND) return;
|
||||
|
||||
// initializing a class that builds chamfer
|
||||
BRepFilletAPI_MakeChamfer aMakeChamfer(aFuser.Shape());
|
||||
|
||||
// a map of "edge-to-list of faces". Key = edge, value = list of 2 faces
|
||||
// of the box that "touch" the edge
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapOfEdgeToFaces;
|
||||
// filling the map with edges and faces of the box
|
||||
TopExp::MapShapesAndAncestors(aFuser.Shape(), TopAbs_EDGE, TopAbs_FACE, aMapOfEdgeToFaces);
|
||||
|
||||
// retrieving list of edges to build a chamfer on - edges of
|
||||
// intersection of the cylinder and the box
|
||||
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
|
||||
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
|
||||
|
||||
// creating fillet on edge intersection edges
|
||||
Standard_Real d = a/20;
|
||||
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(anIntersectionEdgesIt.Value());
|
||||
if (!aMapOfEdgeToFaces.Contains(anEdge)) continue;
|
||||
const TopTools_ListOfShape& aFaces = aMapOfEdgeToFaces.FindFromKey(anEdge);
|
||||
TopoDS_Face aFace = TopoDS::Face(aFaces.First());
|
||||
aMakeChamfer.Add(d, d, anEdge, aFace);
|
||||
}
|
||||
|
||||
aMakeChamfer.Build();
|
||||
|
||||
if (aMakeChamfer.IsDone())
|
||||
{
|
||||
getAISContext()->Erase(aPrevObj, Standard_False);
|
||||
getAISContext()->Display(new AIS_Shape(aMakeChamfer.Shape()));
|
||||
//thePrevShape = aNewShape;// uncomment if further thePrevObj is used
|
||||
}
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// FILLET CASES
|
||||
// ===============================================================
|
||||
//================================================================
|
||||
// Function : Chamfers_Presentation::sampleBoxFillet1,2,3
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Chamfers_Presentation::sampleBoxFillet()
|
||||
{
|
||||
setResultTitle("Creating Fillet");
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a box and centering it on the screen" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
// show initial shape
|
||||
Standard_Real a = BOX_SIDE_LEN;
|
||||
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
|
||||
|
||||
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aBox);
|
||||
getAISContext()->Display(aPrevObj, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
|
||||
if (WAIT_A_SECOND) return;
|
||||
|
||||
// show several fillets
|
||||
if (createFilletOnBox(aBox, a/10, ChFi3d_Polynomial, aPrevObj)) return;
|
||||
if (createFilletOnBox(aBox, a/5, ChFi3d_QuasiAngular, aPrevObj)) return;
|
||||
if (createFilletOnBox(aBox, a/3.3, ChFi3d_Rational, aPrevObj)) return;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Chamfers_Presentation::sampleBoxCylFillet
|
||||
// Purpose : creates a more complecated chamfer on a shape created
|
||||
// by fusing box and cylinder
|
||||
//================================================================
|
||||
void Chamfers_Presentation::sampleBoxCylFillet()
|
||||
{
|
||||
setResultTitle("Creating Fillet");
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a shape - result of fusing a box and a cylinder" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" Standard_Real b = a/2;" EOL
|
||||
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
|
||||
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);" EOL
|
||||
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
|
||||
" aFuser.Build();" EOL EOL
|
||||
|
||||
" // initializing a class that builds fillet" EOL
|
||||
" // second parameter is a shape of fillet:" EOL
|
||||
" // enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };" EOL
|
||||
" BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);" EOL EOL
|
||||
|
||||
" // retrieving list of edges to build a chamfer on - edges of " EOL
|
||||
" // intersection of the cylinder and the box" EOL
|
||||
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
|
||||
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL EOL
|
||||
|
||||
" // creating fillet on edge intersection edges" EOL
|
||||
" Standard_Real d = a/10;" EOL
|
||||
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
|
||||
" aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));" EOL
|
||||
"" EOL
|
||||
" aMakeFillet.Build();" EOL EOL
|
||||
|
||||
" if (aMakeFillet.IsDone())" EOL
|
||||
" TopoDS_Shape aShapeWithFillet = aMakeFillet.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
// creating a shape, a result of fusing of a box and cylinder
|
||||
Standard_Real a = BOX_SIDE_LEN;
|
||||
Standard_Real b = a/2;
|
||||
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
|
||||
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), a/4, a);
|
||||
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
|
||||
aFuser.Build();
|
||||
|
||||
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
|
||||
getAISContext()->Display(aPrevObj, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
|
||||
if (WAIT_A_SECOND) return;
|
||||
|
||||
// initializing a class that builds fillet
|
||||
// second parameter is a shape of fillet:
|
||||
// enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };
|
||||
BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);
|
||||
|
||||
// retrieving list of edges to build a chamfer on - edges of
|
||||
// intersection of the cylinder and the box
|
||||
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
|
||||
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
|
||||
|
||||
// creating fillet on edge intersection edges
|
||||
Standard_Real d = a/10;
|
||||
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
|
||||
aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));
|
||||
|
||||
aMakeFillet.Build();
|
||||
|
||||
if (aMakeFillet.IsDone())
|
||||
{
|
||||
getAISContext()->Erase(aPrevObj, Standard_False);
|
||||
//aPrevObj = new AIS_Shape(aMakeFillet.Shape());// uncomment if aPrevObj is used further
|
||||
getAISContext()->Display(new AIS_Shape(aMakeFillet.Shape()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Chamfers_Presentation::sampleBoxCylAngFillet
|
||||
// Purpose : creates a fillet on a more complecated shape created
|
||||
// by fusing box and cylinder
|
||||
//================================================================
|
||||
void Chamfers_Presentation::sampleBoxCylAngFillet()
|
||||
{
|
||||
setResultTitle("Creating Fillet");
|
||||
TCollection_AsciiString aText;
|
||||
aText = aText +
|
||||
" // creating a shape - result of fusing a box and a cylinder" EOL
|
||||
" Standard_Real a = "+TCollection_AsciiString(BOX_SIDE_LEN)+";" EOL
|
||||
" Standard_Real b = a/2;" EOL
|
||||
" BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);" EOL
|
||||
" BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);" EOL
|
||||
" BRepAlgoAPI_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());" EOL
|
||||
" aFuser.Build();" EOL EOL
|
||||
|
||||
" // initializing a class that builds fillet" EOL
|
||||
" // second parameter is a shape of fillet:" EOL
|
||||
" // enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };" EOL
|
||||
" BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);" EOL EOL
|
||||
|
||||
" // retrieving list of edges to build a chamfer on - edges of " EOL
|
||||
" // intersection of the cylinder and the box" EOL
|
||||
" const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();" EOL
|
||||
" TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);" EOL EOL
|
||||
|
||||
" // creating fillet on intersection edges" EOL
|
||||
" Standard_Real d = a/10;" EOL
|
||||
" for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())" EOL
|
||||
" aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));" EOL
|
||||
" aMakeFillet.Build();" EOL EOL
|
||||
|
||||
" if (aMakeFillet.IsDone())" EOL
|
||||
" TopoDS_Shape aShapeWithFillet = aMakeFillet.Shape();" EOL;
|
||||
setResultText(aText.ToCString());
|
||||
|
||||
// creating a shape, a result of fusing of a box and cylinder
|
||||
Standard_Real a = BOX_SIDE_LEN;
|
||||
Standard_Real b = a/2;
|
||||
BRepPrimAPI_MakeBox aBoxMaker (gp_Pnt(-b, -b, -b), a, a, a);
|
||||
BRepPrimAPI_MakeCylinder aCylMaker(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,-0.4,0.6)), a/4, a);
|
||||
BRepAlgo_Fuse aFuser(aBoxMaker.Solid(), aCylMaker.Solid());
|
||||
aFuser.Build();
|
||||
|
||||
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aFuser.Shape());
|
||||
getAISContext()->Display(aPrevObj, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
|
||||
if (WAIT_A_SECOND) return;
|
||||
|
||||
// initializing a class that builds fillet
|
||||
// second parameter is a shape of fillet:
|
||||
// enum ChFi3d_FilletShape { ChFi3d_Rational, ChFi3d_QuasiAngular, ChFi3d_Polynomial };
|
||||
BRepFilletAPI_MakeFillet aMakeFillet(aFuser.Shape(), ChFi3d_Rational);
|
||||
|
||||
// retrieving list of edges to build a chamfer on - edges of
|
||||
// intersection of the cylinder and the box
|
||||
const TopTools_ListOfShape& aEdgesOfIntersection = aFuser.Builder()->Section();
|
||||
TopTools_ListIteratorOfListOfShape anIntersectionEdgesIt(aEdgesOfIntersection);
|
||||
|
||||
// creating fillet on edge intersection edges
|
||||
Standard_Real d = a/10;
|
||||
for (; anIntersectionEdgesIt.More(); anIntersectionEdgesIt.Next())
|
||||
aMakeFillet.Add(d, TopoDS::Edge(anIntersectionEdgesIt.Value()));
|
||||
|
||||
aMakeFillet.Build();
|
||||
|
||||
if (aMakeFillet.IsDone())
|
||||
{
|
||||
getAISContext()->Erase(aPrevObj, Standard_False);
|
||||
//aPrevObj = new AIS_Shape(aMakeFillet.Shape());// uncomment if aPrevObj is used further
|
||||
getAISContext()->Display(new AIS_Shape(aMakeFillet.Shape()));
|
||||
}
|
||||
}
|
@@ -1,57 +0,0 @@
|
||||
// Chamfers_Presentation.h: interface for the Chamfers_Presentation class.
|
||||
// Presentation class: Example on chamfers and fillets
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_Chamfers_PRESENTATION_H)
|
||||
#define AFX_Chamfers_PRESENTATION_H
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <OCCDemo_Presentation.h>
|
||||
#include <ChFi3d_FilletShape.hxx>
|
||||
|
||||
class AIS_InteractiveObject;
|
||||
class TopoDS_Solid;
|
||||
|
||||
class Chamfers_Presentation : public OCCDemo_Presentation
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
Chamfers_Presentation();
|
||||
|
||||
public:
|
||||
// Iteration on samples
|
||||
virtual void DoSample();
|
||||
// one phase of iterations
|
||||
|
||||
private:
|
||||
Standard_Boolean createChamferOnBox(
|
||||
TopoDS_Solid&, Standard_Real, Standard_Real,
|
||||
Handle(AIS_InteractiveObject)&);
|
||||
|
||||
Standard_Boolean createDiverseChamferOnBox(
|
||||
TopoDS_Solid&, Standard_Real, Standard_Real,
|
||||
Standard_Real, Handle(AIS_InteractiveObject)&);
|
||||
|
||||
Standard_Boolean createFilletOnBox(
|
||||
TopoDS_Solid&, Standard_Real, ChFi3d_FilletShape,
|
||||
Handle(AIS_InteractiveObject)&);
|
||||
|
||||
// Sample functions
|
||||
void sampleBoxChamfer();
|
||||
void sampleBoxFillet();
|
||||
void sampleBoxCylChamfer();
|
||||
void sampleBoxCylAngChamfer();
|
||||
void sampleBoxCylFillet();
|
||||
void sampleBoxCylAngFillet();
|
||||
|
||||
private:
|
||||
// Array of pointers to sample functions
|
||||
typedef void (Chamfers_Presentation::*PSampleFuncType)();
|
||||
static const PSampleFuncType SampleFuncs[];
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_Chamfers_PRESENTATION_H)
|
@@ -1,77 +0,0 @@
|
||||
// ISession_Curve.cpp: implementation of the ISession_Curve class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ISession_Curve.h"
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
|
||||
|
||||
//
|
||||
// Foreach ancestors, we add a IMPLEMENT_STANDARD_SUPERTYPE and
|
||||
// a IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY macro.
|
||||
// We must respect the order: from the direct ancestor class
|
||||
// to the base class.
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
ISession_Curve::ISession_Curve(const Handle(Geom_Curve)& aCurve)
|
||||
:AIS_InteractiveObject(),myCurve(aCurve)
|
||||
{
|
||||
}
|
||||
|
||||
ISession_Curve::~ISession_Curve()
|
||||
{
|
||||
|
||||
}
|
||||
void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer /*aMode*/)
|
||||
{
|
||||
GeomAdaptor_Curve anAdaptorCurve(myCurve);
|
||||
if (hasOwnColor)
|
||||
myDrawer->LineAspect()->SetColor (myDrawer->Color());
|
||||
myDrawer->Link()->SetDiscretisation(100);
|
||||
myDrawer->Link()->SetMaximalParameterValue(500);
|
||||
|
||||
StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer);
|
||||
}
|
||||
|
||||
void ISession_Curve::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
const Handle(Prs3d_Presentation)& aPresentation)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
const Standard_Integer aMode)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -1,33 +0,0 @@
|
||||
// ISession_Curve.h: interface for the ISession_Curve class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_)
|
||||
#define AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
|
||||
DEFINE_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
|
||||
|
||||
class ISession_Curve : public AIS_InteractiveObject
|
||||
{
|
||||
public:
|
||||
ISession_Curve(const Handle(Geom_Curve)& aCurve);
|
||||
virtual ~ISession_Curve();
|
||||
DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
|
||||
private:
|
||||
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
|
||||
Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
|
||||
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
|
||||
|
||||
Handle(Geom_Curve) myCurve;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_)
|
@@ -1,314 +0,0 @@
|
||||
// OCCDemo_Presentation.cpp: implementation of the OCCDemo_Presentation class.
|
||||
// This is a base class for all presentations
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OCCDemo_Presentation.h"
|
||||
#include "OCCDemoView.h"
|
||||
#include "ISession_Curve.h"
|
||||
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Prs_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom2d_OffsetCurve.hxx>
|
||||
#include <GeomAPI.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Geom_OffsetCurve.hxx>
|
||||
|
||||
#define MAX_PARAM 1000 // if a surface parameter is infinite, it is assingned
|
||||
// this value in order to display the "infinit" object in the viewer.
|
||||
|
||||
|
||||
Standard_Boolean OCCDemo_Presentation::WaitForInput (unsigned long aMilliSeconds)
|
||||
{
|
||||
//::WaitForSingleObject(::CreateEvent (NULL, FALSE, FALSE, NULL), aMilliSeconds);
|
||||
if (::MsgWaitForMultipleObjects(0, NULL, FALSE, aMilliSeconds,
|
||||
QS_KEY | QS_MOUSEBUTTON) != WAIT_TIMEOUT)
|
||||
{
|
||||
MSG msg;
|
||||
if (::PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
|
||||
{
|
||||
if (msg.message == WM_KEYUP)
|
||||
{
|
||||
::PeekMessage (&msg, NULL, 0, 0, PM_REMOVE);
|
||||
return WaitForInput (aMilliSeconds);
|
||||
}
|
||||
else
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : fixParam
|
||||
// Purpose : assings a finite value to theParam if it intinite
|
||||
// (equal to +- Precision::Infinite())
|
||||
//================================================================
|
||||
static Standard_Boolean fixParam(Standard_Real& theParam)
|
||||
{
|
||||
Standard_Boolean aResult = Standard_False;
|
||||
if (Precision::IsNegativeInfinite(theParam))
|
||||
{
|
||||
theParam = -MAX_PARAM;
|
||||
aResult = Standard_True;
|
||||
}
|
||||
if (Precision::IsPositiveInfinite(theParam))
|
||||
{
|
||||
theParam = MAX_PARAM;
|
||||
aResult = Standard_True;
|
||||
}
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : DrawSurface
|
||||
// Purpose : displays a given geometric surface in 3d viewer
|
||||
// (creates a finite face and displays it)
|
||||
//================================================================
|
||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
|
||||
(const Handle(Geom_Surface)& theSurface,
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay)
|
||||
{
|
||||
Standard_Real u1, u2, v1, v2;
|
||||
theSurface->Bounds(u1,u2,v1,v2);
|
||||
fixParam(u1);
|
||||
fixParam(u2);
|
||||
fixParam(v1);
|
||||
fixParam(v2);
|
||||
|
||||
Handle(AIS_Shape) aGraphicSurface =
|
||||
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
|
||||
|
||||
getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
|
||||
getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
|
||||
if (toDisplay) {
|
||||
if (FitMode){
|
||||
getAISContext()->Display (aGraphicSurface, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
}
|
||||
else
|
||||
getAISContext()->Display (aGraphicSurface);
|
||||
}
|
||||
|
||||
return aGraphicSurface;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : DrawCurve
|
||||
// Purpose : displays a given curve 3d
|
||||
//================================================================
|
||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
|
||||
(const Handle(Geom_Curve)& theCurve,
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay)
|
||||
{
|
||||
Handle(ISession_Curve) aGraphicCurve = new ISession_Curve (theCurve);
|
||||
|
||||
getAISContext()->SetColor (aGraphicCurve, theColor, toDisplay);
|
||||
aGraphicCurve->Attributes()->Link()->SetLineArrowDraw(Standard_False);
|
||||
if (toDisplay){
|
||||
if (FitMode){
|
||||
getAISContext()->Display (aGraphicCurve, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
}
|
||||
else
|
||||
getAISContext()->Display (aGraphicCurve);
|
||||
}
|
||||
|
||||
return aGraphicCurve;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : DrawCurve
|
||||
// Purpose : displays a given curve 2d
|
||||
//================================================================
|
||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
|
||||
(const Handle(Geom2d_Curve)& theCurve,
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay,
|
||||
const gp_Ax2& aPosition)
|
||||
{
|
||||
// create 3D curve in plane
|
||||
Handle(Geom_Curve) aCurve3d;
|
||||
if (theCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve)))
|
||||
{
|
||||
Handle(Geom2d_OffsetCurve) aOffCurve =
|
||||
Handle(Geom2d_OffsetCurve)::DownCast(theCurve);
|
||||
Handle(Geom_Curve) aBasCurve3d =
|
||||
GeomAPI::To3d (aOffCurve->BasisCurve(), gp_Pln(aPosition));
|
||||
Standard_Real aDist = aOffCurve->Offset();
|
||||
aCurve3d = new Geom_OffsetCurve (aBasCurve3d, aDist, aPosition.Direction());
|
||||
}
|
||||
else
|
||||
{
|
||||
aCurve3d = GeomAPI::To3d (theCurve, gp_Pln(aPosition));
|
||||
}
|
||||
return drawCurve (aCurve3d, theColor, toDisplay);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : drawPoint
|
||||
// Purpose : displays a given point
|
||||
//================================================================
|
||||
Handle(AIS_Point) OCCDemo_Presentation::drawPoint
|
||||
(const gp_Pnt& aPnt,
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay)
|
||||
{
|
||||
Handle(AIS_Point) aGraphicPoint = new AIS_Point (new Geom_CartesianPoint(aPnt));
|
||||
|
||||
getAISContext()->SetColor (aGraphicPoint, theColor, toDisplay);
|
||||
if (toDisplay) {
|
||||
getAISContext()->Display (aGraphicPoint);
|
||||
//COCCDemoDoc::Fit();
|
||||
}
|
||||
|
||||
return aGraphicPoint;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : drawVector
|
||||
// Purpose : displays a given vector in 3d viewer
|
||||
// (segment of line starting at thePnt with the arrow at the end,
|
||||
// the length of segment is the length of the vector)
|
||||
//================================================================
|
||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
|
||||
(const gp_Pnt& thePnt,
|
||||
const gp_Vec& theVec,
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay)
|
||||
{
|
||||
Standard_Real aLength = theVec.Magnitude();
|
||||
if (aLength < Precision::Confusion())
|
||||
return Handle(AIS_InteractiveObject)();
|
||||
|
||||
Handle(Geom_Curve) aCurve = new Geom_Line (thePnt, theVec);
|
||||
aCurve = new Geom_TrimmedCurve (aCurve, 0, aLength);
|
||||
|
||||
Handle(ISession_Curve) aGraphicCurve = new ISession_Curve (aCurve);
|
||||
|
||||
getAISContext()->SetColor (aGraphicCurve, theColor, toDisplay);
|
||||
Handle(Prs3d_Drawer) aDrawer = aGraphicCurve->Attributes()->Link();
|
||||
aDrawer->SetLineArrowDraw(Standard_True);
|
||||
aDrawer->ArrowAspect()->SetLength(aLength/10);
|
||||
if (toDisplay) {
|
||||
if (FitMode){
|
||||
getAISContext()->Display (aGraphicCurve, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
}
|
||||
else
|
||||
getAISContext()->Display (aGraphicCurve);
|
||||
}
|
||||
|
||||
return aGraphicCurve;
|
||||
}
|
||||
|
||||
|
||||
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
|
||||
(const TopoDS_Shape& theShape,const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay)
|
||||
{
|
||||
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
|
||||
|
||||
getAISContext()->SetMaterial(aGraphicShape, Graphic3d_NOM_PLASTIC, toDisplay);
|
||||
getAISContext()->SetColor (aGraphicShape, theColor, toDisplay);
|
||||
if (toDisplay){
|
||||
if (FitMode){
|
||||
getAISContext()->Display (aGraphicShape, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
}
|
||||
else
|
||||
getAISContext()->Display (aGraphicShape);
|
||||
}
|
||||
|
||||
return aGraphicShape;
|
||||
}
|
||||
|
||||
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
|
||||
(const TopoDS_Shape& theShape,
|
||||
const Graphic3d_NameOfMaterial theMaterial,
|
||||
const Standard_Boolean toDisplay)
|
||||
{
|
||||
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
|
||||
|
||||
getAISContext()->SetMaterial(aGraphicShape, theMaterial, toDisplay);
|
||||
if (toDisplay) {
|
||||
if (FitMode){
|
||||
getAISContext()->Display (aGraphicShape, Standard_False);
|
||||
COCCDemoDoc::Fit();
|
||||
}
|
||||
else
|
||||
getAISContext()->Display (aGraphicShape);
|
||||
}
|
||||
|
||||
return aGraphicShape;
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewCenter(Standard_Real& Xc, Standard_Real& Yc)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->GetViewCenter(Xc,Yc);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::SetViewCenter(Standard_Real Xc, Standard_Real Yc)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewCenter(Xc,Yc);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->GetViewEye(X,Y,Z);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewEye(X,Y,Z);
|
||||
}
|
||||
|
||||
Standard_Real OCCDemo_Presentation::GetViewScale()
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
return pView->GetViewScale();
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::SetViewScale(Standard_Real Coef)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewScale(Coef);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::ResetView()
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->Reset();
|
||||
}
|
@@ -1,132 +0,0 @@
|
||||
// OCCDemo_Presentation.h: interface for the OCCDemo_Presentation class.
|
||||
// This is a base class for all presentations
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
#define WAIT_A_LITTLE WaitForInput(500)
|
||||
#define WAIT_A_SECOND WaitForInput(1000)
|
||||
|
||||
#include <OCCDemoDoc.h>
|
||||
class AIS_InteractiveObject;
|
||||
class Geom_Surface;
|
||||
class Geom_Curve;
|
||||
class Geom2d_Curve;
|
||||
class Quantity_Color;
|
||||
|
||||
class OCCDemo_Presentation
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
OCCDemo_Presentation() : myIndex(0), myNbSamples(0), FitMode(false){}
|
||||
virtual ~OCCDemo_Presentation() {}
|
||||
|
||||
public:
|
||||
static OCCDemo_Presentation* Current;
|
||||
// this pointer must be initialized when realize a derivable class;
|
||||
// it is used by application to access to a presentation class instance
|
||||
|
||||
void SetDocument (COCCDemoDoc* theDoc) {myDoc = theDoc;}
|
||||
// document must be set by the user of this class before first use of iterations
|
||||
|
||||
public:
|
||||
// Titling
|
||||
const CString& GetName() const {return myName;}
|
||||
|
||||
public:
|
||||
// Iteration on samples
|
||||
void FirstSample() {myIndex=0;}
|
||||
void LastSample() {myIndex=myNbSamples-1;}
|
||||
Standard_Boolean AtFirstSample() const {return myIndex <= 0;}
|
||||
Standard_Boolean AtLastSample() const {return myIndex >= myNbSamples-1;}
|
||||
void NextSample() {myIndex++;}
|
||||
void PrevSample() {myIndex--;}
|
||||
virtual void DoSample() = 0;
|
||||
static void GetViewCenter(Standard_Real& Xc, Standard_Real& Yc);
|
||||
static void SetViewCenter(const Standard_Real Xc, const Standard_Real Yc);
|
||||
static void GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z);
|
||||
static void SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z);
|
||||
static Standard_Real GetViewScale();
|
||||
static void SetViewScale(Standard_Real Coef);
|
||||
static void ResetView();
|
||||
|
||||
|
||||
// place one-time initialization code in this function
|
||||
virtual void Init() {}
|
||||
|
||||
protected:
|
||||
// Methods to call from a derivable class
|
||||
void setName (const char* theName) {myName = CString(theName);}
|
||||
Handle(AIS_InteractiveContext) getAISContext() const {return myDoc->GetAISContext();}
|
||||
Handle(V3d_Viewer) getViewer() const {return myDoc->GetViewer();}
|
||||
void setResultTitle (const char* theTitle) {myDoc->GetResultDialog()->SetTitle(theTitle);}
|
||||
void setResultText (const char* theText) {myDoc->GetResultDialog()->SetText(theText);}
|
||||
Standard_CString GetDataDir() {return myDoc->GetDataDir();}
|
||||
|
||||
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
||||
// Waits for a user input or a period of time has been elapsed
|
||||
|
||||
Handle(AIS_InteractiveObject) drawSurface (const Handle(Geom_Surface)& theSurface,
|
||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_LEMONCHIFFON3),
|
||||
const Standard_Boolean toDisplay = Standard_True);
|
||||
// creates a finite face based on the given geometric surface
|
||||
// and displays it in the viewer if toDisplay = Standard_True
|
||||
|
||||
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom_Curve)& theCurve,
|
||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
|
||||
const Standard_Boolean toDisplay = Standard_True);
|
||||
// creates an ISession_Curve based on the given geometric curve
|
||||
// and displays it in the viewer if toDisplay = Standard_True
|
||||
|
||||
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom2d_Curve)& theCurve,
|
||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
|
||||
const Standard_Boolean toDisplay = Standard_True,
|
||||
const gp_Ax2& aPosition = gp::XOY());
|
||||
// converts a given curve to 3d using aPosition and calls the previous method
|
||||
|
||||
Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
|
||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
||||
const Standard_Boolean toDisplay = Standard_True);
|
||||
// creates a presentation of the given point
|
||||
// and displays it in the viewer if toDisplay = Standard_True
|
||||
|
||||
Handle(AIS_InteractiveObject) drawVector (const gp_Pnt& thePnt,
|
||||
const gp_Vec& theVec,
|
||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_YELLOW),
|
||||
const Standard_Boolean toDisplay = Standard_True);
|
||||
// creates a presentation of the given vector
|
||||
// and displays it in the viewer if toDisplay = Standard_True
|
||||
|
||||
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
|
||||
const Quantity_Color& theColor,
|
||||
const Standard_Boolean toDisplay = Standard_True);
|
||||
// creates a presentation of the given shape
|
||||
// with material PLASTIC and a given color
|
||||
// and displays it in the viewer if toDisplay = Standard_True
|
||||
|
||||
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
|
||||
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
||||
const Standard_Boolean toDisplay = Standard_True);
|
||||
// creates a presentation of the given shape with the given material
|
||||
// (color is default for a given material)
|
||||
// and displays it in the viewer if toDisplay = Standard_True
|
||||
|
||||
protected:
|
||||
// Fields to use in a derivable class
|
||||
BOOL FitMode;
|
||||
int myIndex;
|
||||
int myNbSamples;
|
||||
|
||||
private:
|
||||
COCCDemoDoc* myDoc;
|
||||
CString myName;
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,112 +0,0 @@
|
||||
// MainFrm.cpp : implementation of the CMainFrame class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OCCDemo.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
#include "OCCDemoDoc.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
|
||||
//{{AFX_MSG_MAP(CMainFrame)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
static UINT indicators[] =
|
||||
{
|
||||
ID_SEPARATOR // status line indicator
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame construction/destruction
|
||||
|
||||
CMainFrame::CMainFrame()
|
||||
{
|
||||
// TODO: add member initialization code here
|
||||
|
||||
}
|
||||
|
||||
CMainFrame::~CMainFrame()
|
||||
{
|
||||
}
|
||||
|
||||
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
|
||||
/* | CBRS_GRIPPER */| CBRS_TOOLTIPS | CBRS_FLYBY) ||
|
||||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
||||
{
|
||||
TRACE0("Failed to create toolbar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
if (!m_wndToolBar1.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
|
||||
| CBRS_TOOLTIPS | CBRS_FLYBY) ||
|
||||
!m_wndToolBar1.LoadToolBar(IDR_TOOLBAR1))
|
||||
{
|
||||
TRACE0("Failed to create toolbar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
if (!m_wndStatusBar.Create(this) ||
|
||||
!m_wndStatusBar.SetIndicators(indicators,
|
||||
sizeof(indicators)/sizeof(UINT)))
|
||||
{
|
||||
TRACE0("Failed to create status bar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
// TODO: Delete these three lines if you don't want the toolbar to
|
||||
// be dockable
|
||||
//m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||
//EnableDocking(CBRS_ALIGN_ANY);
|
||||
//DockControlBar(&m_wndToolBar);
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
if( !CFrameWnd::PreCreateWindow(cs) )
|
||||
return FALSE;
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMainFrame::AssertValid() const
|
||||
{
|
||||
CFrameWnd::AssertValid();
|
||||
}
|
||||
|
||||
void CMainFrame::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CFrameWnd::Dump(dc);
|
||||
}
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame message handlers
|
||||
|
@@ -1,59 +0,0 @@
|
||||
// MainFrm.h : interface of the CMainFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINFRM_H__57A6A22C_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_MAINFRM_H__57A6A22C_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
{
|
||||
|
||||
protected: // create from serialization only
|
||||
CMainFrame();
|
||||
DECLARE_DYNCREATE(CMainFrame)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMainFrame)
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMainFrame();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected: // control bar embedded members
|
||||
CStatusBar m_wndStatusBar;
|
||||
CToolBar m_wndToolBar;
|
||||
CToolBar m_wndToolBar1;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAINFRM_H__57A6A22C_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,201 +0,0 @@
|
||||
// OCCDemo.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OCCDemo.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
#include "OCCDemoDoc.h"
|
||||
#include "OCCDemoView.h"
|
||||
|
||||
#include <Standard_Version.hxx>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(COCCDemoApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(COCCDemoApp)
|
||||
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
|
||||
//}}AFX_MSG_MAP
|
||||
// Standard file based document commands
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp construction
|
||||
|
||||
COCCDemoApp::COCCDemoApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
try
|
||||
{
|
||||
myGraphicDevice = new Graphic3d_WNTGraphicDevice;
|
||||
}
|
||||
catch(Standard_Failure)
|
||||
{
|
||||
AfxMessageBox("Fatal Error During Graphic Initialisation");
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only COCCDemoApp object
|
||||
|
||||
COCCDemoApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp initialization
|
||||
|
||||
BOOL COCCDemoApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
// Change the registry key under which our settings are stored.
|
||||
// TODO: You should modify this string to be something appropriate
|
||||
// such as the name of your company or organization.
|
||||
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
|
||||
|
||||
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
|
||||
|
||||
// Register the application's document templates. Document templates
|
||||
// serve as the connection between documents, frame windows and views.
|
||||
|
||||
CSingleDocTemplate* pDocTemplate;
|
||||
pDocTemplate = new CSingleDocTemplate(
|
||||
IDR_MAINFRAME,
|
||||
RUNTIME_CLASS(COCCDemoDoc),
|
||||
RUNTIME_CLASS(CMainFrame), // main SDI frame window
|
||||
RUNTIME_CLASS(COCCDemoView));
|
||||
AddDocTemplate(pDocTemplate);
|
||||
|
||||
// Parse command line for standard shell commands, DDE, file open
|
||||
CCommandLineInfo cmdInfo;
|
||||
ParseCommandLine(cmdInfo);
|
||||
|
||||
// Dispatch commands specified on the command line
|
||||
if (!ProcessShellCommand(cmdInfo))
|
||||
return FALSE;
|
||||
|
||||
// Create result dialog
|
||||
AfxInitRichEdit();
|
||||
CMainFrame* cFrame = (CMainFrame*) GetMainWnd();
|
||||
COCCDemoDoc* aDoc = (COCCDemoDoc*) cFrame->GetActiveDocument();
|
||||
|
||||
// pass cFrame->GetDesktopWindow() as parent to have an independent dialog
|
||||
// pass cFrame as parent to have the result dialog always above the main window
|
||||
if (!aDoc->GetResultDialog()->Create(CResultDialog::IDD, cFrame->GetDesktopWindow()))
|
||||
TRACE0("Failed to create result dialog\n");
|
||||
|
||||
aDoc->GetResultDialog()->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
|
||||
aDoc->GetResultDialog()->ShowWindow(SW_HIDE);
|
||||
aDoc->GetResultDialog()->Initialize();
|
||||
|
||||
// resize the result dialog, so no clipping occures when user
|
||||
// resizes the dialog manually
|
||||
// position the result dialog to the left bottom corner of the view
|
||||
CRect aDlgRect, aViewRect;
|
||||
aDoc->GetResultDialog()->GetWindowRect(&aDlgRect);
|
||||
cFrame->GetActiveView()->GetWindowRect(&aViewRect);
|
||||
|
||||
int x = aViewRect.left;
|
||||
int y = aViewRect.bottom - aDlgRect.Size().cy;
|
||||
int cx = aDlgRect.Size().cx+1;
|
||||
int cy = aDlgRect.Size().cy+1;
|
||||
aDoc->GetResultDialog()->SetWindowPos(NULL, x, y, cx, cy, SWP_NOREDRAW | SWP_NOZORDER);
|
||||
|
||||
m_pMainWnd->ShowWindow(SW_SHOW);
|
||||
m_pMainWnd->UpdateWindow();
|
||||
m_pMainWnd->SetFocus();
|
||||
aDoc->Start();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
BOOL OnInitDialog();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BOOL CAboutDlg::OnInitDialog(){
|
||||
|
||||
CWnd* TitleWnd = GetDlgItem(IDC_ABOUTBOX_TITLE);
|
||||
CString TitleString;
|
||||
TitleWnd->GetWindowText(TitleString);
|
||||
|
||||
CString OCC_Version = OCC_VERSION_STRING;
|
||||
TitleString = TitleString + OCC_Version;
|
||||
|
||||
TitleWnd->SetWindowText(TitleString);
|
||||
|
||||
CenterWindow();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
// App command to run the dialog
|
||||
void COCCDemoApp::OnAppAbout()
|
||||
{
|
||||
CAboutDlg aboutDlg;
|
||||
aboutDlg.DoModal();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp message handlers
|
||||
|
@@ -1,55 +0,0 @@
|
||||
// OCCDemo.h : main header file for the OCCDEMO application
|
||||
//
|
||||
|
||||
#if !defined(AFX_OCCDEMO_H__57A6A228_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_OCCDEMO_H__57A6A228_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp:
|
||||
// See OCCDemo.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class COCCDemoApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
COCCDemoApp();
|
||||
Handle(Graphic3d_WNTGraphicDevice) GetGraphicDevice() const
|
||||
{ return myGraphicDevice; } ;
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(COCCDemoApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
//{{AFX_MSG(COCCDemoApp)
|
||||
afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
Handle(Graphic3d_WNTGraphicDevice) myGraphicDevice;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_OCCDEMO_H__57A6A228_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,380 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\OCCDemo.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\OCCDemo.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_OCC_LOGO BITMAP DISCARDABLE "res\\occ_logo.bmp"
|
||||
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
|
||||
IDR_TOOLBAR1 BITMAP DISCARDABLE "res\\Toolbar1.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Toolbar
|
||||
//
|
||||
|
||||
IDR_MAINFRAME TOOLBAR DISCARDABLE 20, 20
|
||||
BEGIN
|
||||
BUTTON ID_BUTTONStart
|
||||
BUTTON ID_BUTTONPrev
|
||||
BUTTON ID_BUTTONRepeat
|
||||
BUTTON ID_BUTTONNext
|
||||
BUTTON ID_BUTTONEnd
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTONShowResult
|
||||
BUTTON ID_DUMP_VIEW
|
||||
END
|
||||
|
||||
IDR_TOOLBAR1 TOOLBAR DISCARDABLE 20, 20
|
||||
BEGIN
|
||||
BUTTON ID_BUTTONZoomAll
|
||||
BUTTON ID_BUTTONZoomWin
|
||||
BUTTON ID_BUTTONZoomProg
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTONPan
|
||||
BUTTON ID_BUTTONPanGlo
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTONFront
|
||||
BUTTON ID_BUTTONTop
|
||||
BUTTON ID_BUTTONLeft
|
||||
BUTTON ID_BUTTONBack
|
||||
BUTTON ID_BUTTONRight
|
||||
BUTTON ID_BUTTONBottom
|
||||
BUTTON ID_BUTTONAxo
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTONRot
|
||||
BUTTON ID_BUTTONReset
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTONWire
|
||||
BUTTON ID_BUTTONShade
|
||||
BUTTON ID_BUTTONHlrOn
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "Reset", ID_FILE_NEW
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", ID_APP_EXIT
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About OCCDemo...", ID_APP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
|
||||
BEGIN
|
||||
"A", ID_BUTTONAxo, VIRTKEY, CONTROL, NOINVERT
|
||||
"B", ID_BUTTONBack, VIRTKEY, CONTROL, NOINVERT
|
||||
"F", ID_BUTTONZoomAll, VIRTKEY, NOINVERT
|
||||
"F", ID_BUTTONFront, VIRTKEY, CONTROL, NOINVERT
|
||||
"H", ID_BUTTONHlrOn, VIRTKEY, SHIFT, NOINVERT
|
||||
"L", ID_BUTTONLeft, VIRTKEY, CONTROL, NOINVERT
|
||||
"M", ID_BUTTONBottom, VIRTKEY, CONTROL, NOINVERT
|
||||
"R", ID_BUTTONReset, VIRTKEY, NOINVERT
|
||||
"R", ID_BUTTONRight, VIRTKEY, CONTROL, NOINVERT
|
||||
"S", ID_BUTTONShade, VIRTKEY, SHIFT, NOINVERT
|
||||
"T", ID_BUTTONTop, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_END, ID_BUTTONEnd, VIRTKEY, NOINVERT
|
||||
VK_F11, ID_BUTTONShowResult, VIRTKEY, NOINVERT
|
||||
VK_F12, ID_DUMP_VIEW, VIRTKEY, NOINVERT
|
||||
VK_HOME, ID_BUTTONStart, VIRTKEY, NOINVERT
|
||||
VK_NEXT, ID_BUTTONNext, VIRTKEY, NOINVERT
|
||||
VK_PRIOR, ID_BUTTONPrev, VIRTKEY, NOINVERT
|
||||
VK_SPACE, ID_BUTTONRepeat, VIRTKEY, NOINVERT
|
||||
"W", ID_BUTTONWire, VIRTKEY, SHIFT, NOINVERT
|
||||
"X", ID_APP_EXIT, VIRTKEY, CONTROL, NOINVERT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 34, 22, 201, 161
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||
CAPTION "About"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CTEXT "OCCDemo, Open CASCADE ",IDC_ABOUTBOX_TITLE,3,8,195,8
|
||||
CTEXT "Copyright (C) 2008, Open CASCADE Company",IDC_STATIC,28,
|
||||
99,147,8,SS_CENTERIMAGE
|
||||
DEFPUSHBUTTON "OK",IDOK,55,135,88,14,WS_GROUP
|
||||
CTEXT "http://www.opencascade.com",IDC_STATIC,50,115,98,8,
|
||||
SS_CENTERIMAGE
|
||||
CONTROL 1300,IDC_STATIC,"Static",SS_BITMAP,36,27,129,62,
|
||||
WS_EX_CLIENTEDGE
|
||||
END
|
||||
|
||||
IDD_ResultDialog DIALOG DISCARDABLE 0, 0, 244, 231
|
||||
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
|
||||
WS_THICKFRAME
|
||||
CAPTION "Result Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_RICHEDIT_ResultDialog,"RICHEDIT",ES_MULTILINE |
|
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NOHIDESEL |
|
||||
ES_READONLY | WS_BORDER | WS_VSCROLL | WS_HSCROLL |
|
||||
WS_TABSTOP,0,7,243,192
|
||||
PUSHBUTTON "Copy selection",IDC_CopySelectionToClipboard,0,206,60,
|
||||
18
|
||||
PUSHBUTTON "Copy all",IDC_CopyAllToClipboard,65,206,60,18
|
||||
PUSHBUTTON "Close",IDCANCEL,183,206,60,18
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "Open CASCADE Demonstration Application\0"
|
||||
VALUE "CompanyName", "Open CASCADE, France\0"
|
||||
VALUE "FileDescription", "OCCDemo MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "OCCDemo\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2001, Open CASCADE Company\0"
|
||||
VALUE "LegalTrademarks", "Open CASCADE\0"
|
||||
VALUE "OriginalFilename", "OCCDemo.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "OCCDemo Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ResultDialog, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 243
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 224
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "OCCDemo\n\nOCCDem\n\n\nOCCDemo.Document\nOCCDem Document"
|
||||
END
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_APP_TITLE "OCCDemo"
|
||||
AFX_IDS_IDLEMESSAGE "Ready"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_NEW "Start demo a new\nReset"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
|
||||
ID_APP_EXIT "Quit the application\nExit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCSIZE "Change the window size"
|
||||
AFX_IDS_SCMOVE "Change the window position"
|
||||
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
|
||||
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
|
||||
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
|
||||
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
|
||||
AFX_IDS_SCCLOSE "Close the active window"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCRESTORE "Restore the window to normal size"
|
||||
AFX_IDS_SCTASKLIST "Activate Task List"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_BUTTONZoomAll "Press to zoom the application objects in the view\nFitAll (F)"
|
||||
ID_BUTTONZoomWin "Press and drag MB1 to select a zoom window\nZoom Window"
|
||||
ID_BUTTONZoomProg "Press and drag MB1 to zoom\nDynamic Zooming"
|
||||
ID_BUTTONPan "Press and drag MB1 to pan\nDynamic Panning"
|
||||
ID_BUTTONPanGlo "Press and select a new view center t\nGlobal Panning"
|
||||
ID_BUTTONFront "Press to select a front View\nFront (Ctrl+F)"
|
||||
ID_BUTTONLeft "Press to select a left View\nLeft (Ctrl+L)"
|
||||
ID_BUTTONTop "Press to select a top View\nTop (Ctrl+T)"
|
||||
ID_BUTTONBack "Press to select a back View\nBack (Ctrl+B)"
|
||||
ID_BUTTONRight "Press to select a right View\nRight (Ctrl+R)"
|
||||
ID_BUTTONBottom "Press to select a bottom View\nBottom (Ctrl+M)"
|
||||
ID_BUTTONAxo "Press to select axonometric View\nAxo (Ctrl+A)"
|
||||
ID_BUTTONRot "Press and drag MB1 to rotate\nDynamic Rotation"
|
||||
ID_BUTTONReset "Press to reset view\nReset (R)"
|
||||
ID_BUTTONWire "Press to switch to wireframe mode\nWireframe mode (Shift+W)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_BUTTONShade "Press to switch to shading mode\nShading mode (Shift+S)"
|
||||
ID_BUTTONHlrOn "Press to switch to HLR mode\nHLR mode (Shift+H)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_BUTTONStart "Press to go to the first sample\nFirst sample (Home)"
|
||||
ID_BUTTONNext "Press to go to the next sample\nNext sample (PgDn)"
|
||||
ID_BUTTONShowResult "Press to toggle show of source code on/off\nSource code (F11)"
|
||||
ID_DUMP_VIEW "Save current frame into a GIF file\nExport view to GIF (F12)"
|
||||
ID_BUTTONEnd "Press to go to the last sample\nLast sample (End)"
|
||||
ID_BUTTONPrev "Press to go to the previous sample\nPrevious sample (PgUp)"
|
||||
ID_BUTTONRepeat "Press to repeat the current sample\nRepeat sample (Space)"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\OCCDemo.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@@ -1,273 +0,0 @@
|
||||
// OCCDemoDoc.cpp : implementation of the COCCDemoDoc class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OCCDemo.h"
|
||||
|
||||
#include "OCCDemoDoc.h"
|
||||
#include "OCCDemo_Presentation.h"
|
||||
#include "OCCDemoView.h"
|
||||
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoDoc
|
||||
|
||||
IMPLEMENT_DYNCREATE(COCCDemoDoc, CDocument)
|
||||
|
||||
BEGIN_MESSAGE_MAP(COCCDemoDoc, CDocument)
|
||||
//{{AFX_MSG_MAP(COCCDemoDoc)
|
||||
ON_COMMAND(ID_BUTTONNext, OnBUTTONNext)
|
||||
ON_COMMAND(ID_BUTTONStart, OnBUTTONStart)
|
||||
ON_COMMAND(ID_BUTTONRepeat, OnBUTTONRepeat)
|
||||
ON_COMMAND(ID_BUTTONPrev, OnBUTTONPrev)
|
||||
ON_COMMAND(ID_BUTTONEnd, OnBUTTONEnd)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONNext, OnUpdateBUTTONNext)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONPrev, OnUpdateBUTTONPrev)
|
||||
ON_COMMAND(ID_FILE_NEW, OnFileNew)
|
||||
ON_COMMAND(ID_BUTTONShowResult, OnBUTTONShowResult)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONShowResult, OnUpdateBUTTONShowResult)
|
||||
ON_COMMAND(ID_DUMP_VIEW, OnDumpView)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoDoc construction/destruction
|
||||
|
||||
COCCDemoDoc::COCCDemoDoc()
|
||||
{
|
||||
// TODO: add one-time construction code here
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice();
|
||||
|
||||
myViewer = new V3d_Viewer(theGraphicDevice);
|
||||
myViewer->SetDefaultLights();
|
||||
myViewer->SetLightOn();
|
||||
myViewer->SetDefaultBackgroundColor(Quantity_TOC_RGB, 0.,0.,0.);
|
||||
|
||||
myAISContext = new AIS_InteractiveContext(myViewer);
|
||||
myShowResult = FALSE;
|
||||
myPresentation = OCCDemo_Presentation::Current;
|
||||
myPresentation->SetDocument(this);
|
||||
|
||||
CFile aFile;
|
||||
if (!aFile.Open("Data\\points.dat", CFile::modeRead)){
|
||||
strcpy(myDataDir, "..\\Data");
|
||||
}
|
||||
else
|
||||
strcpy(myDataDir, "Data");
|
||||
strcpy(myLastPath, ".");
|
||||
}
|
||||
|
||||
COCCDemoDoc::~COCCDemoDoc()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL COCCDemoDoc::OnNewDocument()
|
||||
{
|
||||
if (!CDocument::OnNewDocument())
|
||||
return FALSE;
|
||||
|
||||
// TODO: add reinitialization code here
|
||||
// (SDI documents will reuse this document)
|
||||
|
||||
SetTitle(myPresentation->GetName());
|
||||
|
||||
myAISContext->EraseAll(Standard_False);
|
||||
myAISContext->SetDisplayMode(AIS_Shaded);
|
||||
|
||||
POSITION pos = GetFirstViewPosition();
|
||||
while (pos != NULL)
|
||||
{
|
||||
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
|
||||
pView->Reset();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void COCCDemoDoc::Start()
|
||||
{
|
||||
myPresentation->Init();
|
||||
OnBUTTONStart();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoDoc serialization
|
||||
|
||||
void COCCDemoDoc::Serialize(CArchive& ar)
|
||||
{
|
||||
if (ar.IsStoring())
|
||||
{}// TODO: add storing code here
|
||||
else
|
||||
{}// TODO: add loading code here
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoDoc diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void COCCDemoDoc::AssertValid() const
|
||||
{
|
||||
CDocument::AssertValid();
|
||||
}
|
||||
|
||||
void COCCDemoDoc::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CDocument::Dump(dc);
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoDoc commands
|
||||
|
||||
void COCCDemoDoc::OnFileNew()
|
||||
{
|
||||
OnNewDocument();
|
||||
Start();
|
||||
}
|
||||
|
||||
void COCCDemoDoc::InitViewButtons()
|
||||
{
|
||||
POSITION pos = GetFirstViewPosition();
|
||||
while (pos != NULL)
|
||||
{
|
||||
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
|
||||
pView->InitButtons();
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoDoc::DoSample()
|
||||
{
|
||||
InitViewButtons();
|
||||
|
||||
HCURSOR hOldCursor = ::GetCursor();
|
||||
HCURSOR hNewCursor = AfxGetApp()->LoadStandardCursor(IDC_APPSTARTING);
|
||||
|
||||
SetCursor(hNewCursor);
|
||||
{
|
||||
try
|
||||
{
|
||||
myPresentation->DoSample();
|
||||
}
|
||||
catch (Standard_Failure)
|
||||
{
|
||||
Standard_SStream ostr;
|
||||
ostr<<Standard_Failure::Caught()<<"\n\0";
|
||||
|
||||
AfxMessageBox (GetSString(ostr));
|
||||
}
|
||||
}
|
||||
SetCursor(hOldCursor);
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnBUTTONStart()
|
||||
{
|
||||
myAISContext->EraseAll(Standard_False);
|
||||
myPresentation->FirstSample();
|
||||
DoSample();
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnBUTTONEnd()
|
||||
{
|
||||
myAISContext->EraseAll(Standard_False);
|
||||
myPresentation->LastSample();
|
||||
DoSample();
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnBUTTONRepeat()
|
||||
{
|
||||
DoSample();
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnBUTTONNext()
|
||||
{
|
||||
if (!myPresentation->AtLastSample())
|
||||
{
|
||||
myPresentation->NextSample();
|
||||
DoSample();
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnBUTTONPrev()
|
||||
{
|
||||
if (!myPresentation->AtFirstSample())
|
||||
{
|
||||
myPresentation->PrevSample();
|
||||
DoSample();
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnUpdateBUTTONNext(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->Enable (!myPresentation->AtLastSample());
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnUpdateBUTTONPrev(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->Enable (!myPresentation->AtFirstSample());
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnBUTTONShowResult()
|
||||
{
|
||||
myShowResult = !myShowResult;
|
||||
if (myShowResult)
|
||||
myCResultDialog.ShowWindow(SW_SHOWNORMAL);
|
||||
else
|
||||
myCResultDialog.ShowWindow(SW_HIDE);
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnUpdateBUTTONShowResult(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myShowResult);
|
||||
}
|
||||
|
||||
void COCCDemoDoc::OnDumpView()
|
||||
{
|
||||
// save current directory and restore it on exit
|
||||
char aCurPath[MAX_PATH];
|
||||
::GetCurrentDirectory(MAX_PATH, aCurPath);
|
||||
|
||||
::SetCurrentDirectory(myLastPath);
|
||||
|
||||
CFileDialog *aDlg = new CFileDialog(false, "gif", "OCCView.gif",
|
||||
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "GIF Files (*.gif)|*.gif||", NULL);
|
||||
|
||||
int result = aDlg->DoModal();
|
||||
if ( result == IDOK)
|
||||
{
|
||||
CString aFileName = aDlg->GetFileName();
|
||||
delete aDlg;
|
||||
|
||||
POSITION pos = GetFirstViewPosition();
|
||||
while (pos != NULL)
|
||||
{
|
||||
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
|
||||
pView->UpdateWindow();
|
||||
}
|
||||
|
||||
myViewer->InitActiveViews();
|
||||
Handle(V3d_View) aView = myViewer->ActiveView();
|
||||
char aStrFileName[MAX_PATH];
|
||||
strcpy(aStrFileName, aFileName);
|
||||
aView->Dump(aStrFileName);
|
||||
}
|
||||
else
|
||||
delete aDlg;
|
||||
|
||||
::GetCurrentDirectory(MAX_PATH, myLastPath);
|
||||
::SetCurrentDirectory(aCurPath);
|
||||
}
|
||||
|
||||
void COCCDemoDoc::Fit()
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->FitAll();
|
||||
}
|
@@ -1,88 +0,0 @@
|
||||
// OCCDemoDoc.h : interface of the COCCDemoDoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_OCCDEMODOC_H__57A6A22E_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_OCCDEMODOC_H__57A6A22E_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ResultDialog.h"
|
||||
class OCCDemo_Presentation;
|
||||
|
||||
class COCCDemoDoc : public CDocument
|
||||
{
|
||||
public:
|
||||
Handle(V3d_Viewer) GetViewer() const { return myViewer; };
|
||||
Handle(AIS_InteractiveContext) GetAISContext() const { return myAISContext; };
|
||||
CResultDialog* GetResultDialog () {return &myCResultDialog;}
|
||||
Standard_CString GetDataDir() {return myDataDir;}
|
||||
|
||||
protected: // create from serialization only
|
||||
COCCDemoDoc();
|
||||
DECLARE_DYNCREATE(COCCDemoDoc)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
BOOL& IsShowResult() {return myShowResult;}
|
||||
|
||||
// Operations
|
||||
public:
|
||||
void Start();
|
||||
static void Fit();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(COCCDemoDoc)
|
||||
public:
|
||||
virtual BOOL OnNewDocument();
|
||||
virtual void Serialize(CArchive& ar);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~COCCDemoDoc();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void InitViewButtons();
|
||||
void DoSample();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(COCCDemoDoc)
|
||||
afx_msg void OnBUTTONNext();
|
||||
afx_msg void OnBUTTONStart();
|
||||
afx_msg void OnBUTTONRepeat();
|
||||
afx_msg void OnBUTTONPrev();
|
||||
afx_msg void OnBUTTONEnd();
|
||||
afx_msg void OnUpdateBUTTONNext(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONPrev(CCmdUI* pCmdUI);
|
||||
afx_msg void OnFileNew();
|
||||
afx_msg void OnBUTTONShowResult();
|
||||
afx_msg void OnUpdateBUTTONShowResult(CCmdUI* pCmdUI);
|
||||
afx_msg void OnDumpView();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
Handle(V3d_Viewer) myViewer;
|
||||
Handle(AIS_InteractiveContext) myAISContext;
|
||||
OCCDemo_Presentation *myPresentation;
|
||||
CResultDialog myCResultDialog;
|
||||
BOOL myShowResult;
|
||||
char myDataDir[8]; // for "..\Data\0"
|
||||
char myLastPath[MAX_PATH]; // directory of lastly saved file in DumpView()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_OCCDEMODOC_H__57A6A22E_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,583 +0,0 @@
|
||||
// OCCDemoView.cpp : implementation of the COCCDemoView class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainFrm.h"
|
||||
#include "OCCDemo.h"
|
||||
#include "OCCDemoDoc.h"
|
||||
#include "OCCDemoView.h"
|
||||
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
|
||||
#define ValZWMin 1
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoView
|
||||
|
||||
IMPLEMENT_DYNCREATE(COCCDemoView, CView)
|
||||
|
||||
BEGIN_MESSAGE_MAP(COCCDemoView, CView)
|
||||
//{{AFX_MSG_MAP(COCCDemoView)
|
||||
ON_COMMAND(ID_BUTTONAxo, OnBUTTONAxo)
|
||||
ON_COMMAND(ID_BUTTONBack, OnBUTTONBack)
|
||||
ON_COMMAND(ID_BUTTONBottom, OnBUTTONBottom)
|
||||
ON_COMMAND(ID_BUTTONFront, OnBUTTONFront)
|
||||
ON_COMMAND(ID_BUTTONHlrOn, OnBUTTONHlrOn)
|
||||
ON_COMMAND(ID_BUTTONLeft, OnBUTTONLeft)
|
||||
ON_COMMAND(ID_BUTTONPan, OnBUTTONPan)
|
||||
ON_COMMAND(ID_BUTTONPanGlo, OnBUTTONPanGlo)
|
||||
ON_COMMAND(ID_BUTTONReset, OnBUTTONReset)
|
||||
ON_COMMAND(ID_BUTTONRight, OnBUTTONRight)
|
||||
ON_COMMAND(ID_BUTTONRot, OnBUTTONRot)
|
||||
ON_COMMAND(ID_BUTTONTop, OnBUTTONTop)
|
||||
ON_COMMAND(ID_BUTTONZoomAll, OnBUTTONZoomAll)
|
||||
ON_WM_SIZE()
|
||||
ON_COMMAND(ID_BUTTONZoomProg, OnBUTTONZoomProg)
|
||||
ON_COMMAND(ID_BUTTONZoomWin, OnBUTTONZoomWin)
|
||||
ON_WM_LBUTTONDOWN()
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_WM_RBUTTONDOWN()
|
||||
ON_WM_RBUTTONUP()
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONPanGlo, OnUpdateBUTTONPanGlo)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONPan, OnUpdateBUTTONPan)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomProg, OnUpdateBUTTONZoomProg)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomWin, OnUpdateBUTTONZoomWin)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONRot, OnUpdateBUTTONRot)
|
||||
ON_COMMAND(ID_BUTTONWire, OnBUTTONWire)
|
||||
ON_COMMAND(ID_BUTTONShade, OnBUTTONShade)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOn, OnUpdateBUTTONHlrOn)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONShade, OnUpdateBUTTONShade)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONWire, OnUpdateBUTTONWire)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoView construction/destruction
|
||||
|
||||
COCCDemoView::COCCDemoView()
|
||||
{
|
||||
myXmin=0;
|
||||
myYmin=0;
|
||||
myXmax=0;
|
||||
myYmax=0;
|
||||
myCurZoom=0;
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
myVisMode = VIS_SHADE;
|
||||
m_Pen = NULL;
|
||||
myGraphicDriver = Handle(Graphic3d_GraphicDriver)::DownCast(
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice()->GraphicDriver() );
|
||||
}
|
||||
|
||||
COCCDemoView::~COCCDemoView()
|
||||
{
|
||||
if (!myView.IsNull())
|
||||
myView->Remove();
|
||||
if (m_Pen)
|
||||
delete m_Pen;
|
||||
}
|
||||
|
||||
BOOL COCCDemoView::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return CView::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoView drawing
|
||||
|
||||
void COCCDemoView::OnInitialUpdate()
|
||||
{
|
||||
CView::OnInitialUpdate();
|
||||
|
||||
myView = GetDocument()->GetViewer()->CreateView();
|
||||
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice();
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ());
|
||||
myView->SetWindow(aWNTWindow);
|
||||
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
|
||||
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
myVisMode = VIS_SHADE;
|
||||
RedrawVisMode();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnDraw(CDC* pDC)
|
||||
{
|
||||
COCCDemoDoc* pDoc = GetDocument();
|
||||
ASSERT_VALID(pDoc);
|
||||
// TODO: add draw code for native data here
|
||||
myView->Redraw();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoView diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void COCCDemoView::AssertValid() const
|
||||
{
|
||||
CView::AssertValid();
|
||||
}
|
||||
|
||||
void COCCDemoView::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CView::Dump(dc);
|
||||
}
|
||||
|
||||
COCCDemoDoc* COCCDemoView::GetDocument() // non-debug version is inline
|
||||
{
|
||||
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COCCDemoDoc)));
|
||||
return (COCCDemoDoc*)m_pDocument;
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoView message handlers
|
||||
|
||||
void COCCDemoView::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
if (!myView.IsNull())
|
||||
myView->MustBeResized();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONBack()
|
||||
{
|
||||
myView->SetProj(V3d_Ypos);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONFront()
|
||||
{
|
||||
myView->SetProj(V3d_Yneg);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONBottom()
|
||||
{
|
||||
myView->SetProj(V3d_Zneg);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONTop()
|
||||
{
|
||||
myView->SetProj(V3d_Zpos);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONLeft()
|
||||
{
|
||||
myView->SetProj(V3d_Xneg);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONRight()
|
||||
{
|
||||
myView->SetProj(V3d_Xpos);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONAxo()
|
||||
{
|
||||
myView->SetProj(V3d_XposYnegZpos);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONPan()
|
||||
{
|
||||
myCurrentMode = CurAction3d_DynamicPanning;
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONPanGlo()
|
||||
{
|
||||
// save the current zoom value
|
||||
myCurZoom = myView->Scale();
|
||||
// Do a Global Zoom
|
||||
myView->FitAll();
|
||||
// Set the mode
|
||||
myCurrentMode = CurAction3d_GlobalPanning;
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONReset()
|
||||
{
|
||||
myView->Reset();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONRot()
|
||||
{
|
||||
myCurrentMode = CurAction3d_DynamicRotation;
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONZoomAll()
|
||||
{
|
||||
myView->FitAll();
|
||||
myView->ZFitAll();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONZoomProg()
|
||||
{
|
||||
myCurrentMode = CurAction3d_DynamicZooming;
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONZoomWin()
|
||||
{
|
||||
myCurrentMode = CurAction3d_WindowZooming;
|
||||
}
|
||||
|
||||
void COCCDemoView::OnLButtonDown(UINT nFlags, CPoint point)
|
||||
{
|
||||
// save the current mouse coordinate in min
|
||||
myXmin=point.x; myYmin=point.y;
|
||||
myXmax=point.x; myYmax=point.y;
|
||||
|
||||
if ( ! (nFlags & MK_CONTROL) )
|
||||
{
|
||||
if (myCurrentMode == CurAction3d_DynamicRotation)
|
||||
{
|
||||
myView->SetComputedMode(Standard_False);
|
||||
myView->StartRotation(point.x,point.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
if ( !(nFlags & MK_CONTROL) )
|
||||
{
|
||||
switch (myCurrentMode)
|
||||
{
|
||||
case CurAction3d_Nothing :
|
||||
myXmax=point.x;
|
||||
myYmax=point.y;
|
||||
break;
|
||||
case CurAction3d_DynamicZooming :
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
break;
|
||||
case CurAction3d_WindowZooming :
|
||||
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
|
||||
myXmax=point.x;
|
||||
myYmax=point.y;
|
||||
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
|
||||
// Test if the zoom window is greater than a minimale window.
|
||||
{
|
||||
// Do the zoom window between Pmin and Pmax
|
||||
myView->WindowFitAll(myXmin,myYmin,myXmax,myYmax);
|
||||
}
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
break;
|
||||
case CurAction3d_DynamicPanning :
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
break;
|
||||
case CurAction3d_GlobalPanning :
|
||||
myView->Place(point.x,point.y,myCurZoom);
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
break;
|
||||
case CurAction3d_DynamicRotation :
|
||||
if (myVisMode == VIS_HLR)
|
||||
{
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
||||
myView->SetComputedMode(Standard_True);
|
||||
myView->Redraw();
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
|
||||
}
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
break;
|
||||
} //switch (myCurrentMode)
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::OnRButtonDown(UINT nFlags, CPoint point)
|
||||
{
|
||||
if ( nFlags & MK_CONTROL )
|
||||
{
|
||||
myView->SetComputedMode(Standard_False);
|
||||
myView->StartRotation(point.x,point.y);
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::OnRButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
if (myVisMode == VIS_HLR)
|
||||
{
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
||||
myView->SetComputedMode(Standard_True);
|
||||
myView->Redraw();
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::OnMouseMove(UINT nFlags, CPoint point)
|
||||
{
|
||||
// ============================ LEFT BUTTON =======================
|
||||
if ( nFlags & MK_LBUTTON)
|
||||
{
|
||||
if ( nFlags & MK_CONTROL )
|
||||
{
|
||||
// move with MB1 and Control : on the dynamic zooming
|
||||
// Do the zoom in function of mouse's coordinates
|
||||
myView->Zoom(myXmax,myYmax,point.x,point.y);
|
||||
// save the current mouse coordinate in max
|
||||
myXmax = point.x;
|
||||
myYmax = point.y;
|
||||
}
|
||||
else // if ( Ctrl )
|
||||
{
|
||||
switch (myCurrentMode)
|
||||
{
|
||||
case CurAction3d_Nothing :
|
||||
myXmax = point.x;
|
||||
myYmax = point.y;
|
||||
break;
|
||||
case CurAction3d_DynamicZooming :
|
||||
myView->Zoom(myXmax,myYmax,point.x,point.y);
|
||||
// save the current mouse coordinate in max;
|
||||
myXmax=point.x;
|
||||
myYmax=point.y;
|
||||
break;
|
||||
case CurAction3d_WindowZooming :
|
||||
myXmax = point.x; myYmax = point.y;
|
||||
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
|
||||
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
|
||||
break;
|
||||
case CurAction3d_DynamicPanning :
|
||||
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
|
||||
myXmax = point.x; myYmax = point.y;
|
||||
break;
|
||||
case CurAction3d_GlobalPanning : // nothing
|
||||
break;
|
||||
case CurAction3d_DynamicRotation :
|
||||
myView->Rotation(point.x,point.y);
|
||||
myView->Redraw();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ============================ MIDDLE BUTTON =======================
|
||||
else if ( nFlags & MK_MBUTTON)
|
||||
{
|
||||
if ( nFlags & MK_CONTROL )
|
||||
{
|
||||
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
|
||||
myXmax = point.x; myYmax = point.y;
|
||||
}
|
||||
}
|
||||
// ============================ RIGHT BUTTON =======================
|
||||
else if ( nFlags & MK_RBUTTON)
|
||||
{
|
||||
if ( nFlags & MK_CONTROL )
|
||||
{
|
||||
myView->Rotation(point.x,point.y);
|
||||
}
|
||||
}
|
||||
// ============================ NO BUTTON =======================
|
||||
else
|
||||
{
|
||||
myXmax = point.x;
|
||||
myYmax = point.y;
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myCurrentMode == CurAction3d_GlobalPanning);
|
||||
pCmdUI->Enable (myCurrentMode != CurAction3d_GlobalPanning);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONPan(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicPanning);
|
||||
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicPanning );
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicZooming );
|
||||
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicZooming);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myCurrentMode == CurAction3d_WindowZooming);
|
||||
pCmdUI->Enable (myCurrentMode != CurAction3d_WindowZooming);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONRot(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicRotation);
|
||||
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicRotation);
|
||||
}
|
||||
|
||||
void COCCDemoView::DrawRectangle(const Standard_Integer MinX,
|
||||
const Standard_Integer MinY,
|
||||
const Standard_Integer MaxX,
|
||||
const Standard_Integer MaxY,
|
||||
const Standard_Boolean Draw,
|
||||
const LineStyle aLineStyle)
|
||||
{
|
||||
static int m_DrawMode;
|
||||
if (!m_Pen && aLineStyle ==Solid )
|
||||
{
|
||||
m_Pen = new CPen(PS_SOLID, 1, RGB(0,0,0)); m_DrawMode = R2_MERGEPENNOT;
|
||||
}
|
||||
else if (!m_Pen && aLineStyle ==Dot )
|
||||
{
|
||||
m_Pen = new CPen(PS_DOT, 1, RGB(0,0,0)); m_DrawMode = R2_XORPEN;
|
||||
}
|
||||
else if (!m_Pen && aLineStyle == ShortDash)
|
||||
{
|
||||
m_Pen = new CPen(PS_DASH, 1, RGB(255,0,0)); m_DrawMode = R2_XORPEN;
|
||||
}
|
||||
else if (!m_Pen && aLineStyle == LongDash)
|
||||
{
|
||||
m_Pen = new CPen(PS_DASH, 1, RGB(0,0,0)); m_DrawMode = R2_NOTXORPEN;
|
||||
}
|
||||
else if (aLineStyle == Default)
|
||||
{
|
||||
m_Pen = NULL; m_DrawMode = R2_MERGEPENNOT;
|
||||
}
|
||||
|
||||
CPen* aOldPen;
|
||||
CClientDC clientDC(this);
|
||||
if (m_Pen)
|
||||
aOldPen = clientDC.SelectObject(m_Pen);
|
||||
clientDC.SetROP2(m_DrawMode);
|
||||
|
||||
static Standard_Integer StoredMinX, StoredMaxX, StoredMinY, StoredMaxY;
|
||||
static Standard_Boolean m_IsVisible = Standard_False;
|
||||
|
||||
if ( m_IsVisible && !Draw) // move or up : erase at the old position
|
||||
{
|
||||
clientDC.MoveTo(StoredMinX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMaxY);
|
||||
clientDC.LineTo(StoredMaxX,StoredMaxY);
|
||||
clientDC.LineTo(StoredMaxX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMinY);
|
||||
m_IsVisible = false;
|
||||
}
|
||||
|
||||
StoredMinX = min ( MinX, MaxX );
|
||||
StoredMinY = min ( MinY, MaxY );
|
||||
StoredMaxX = max ( MinX, MaxX );
|
||||
StoredMaxY = max ( MinY, MaxY);
|
||||
|
||||
if (Draw) // move : draw
|
||||
{
|
||||
clientDC.MoveTo(StoredMinX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMaxY);
|
||||
clientDC.LineTo(StoredMaxX,StoredMaxY);
|
||||
clientDC.LineTo(StoredMaxX,StoredMinY); clientDC.LineTo(StoredMinX,StoredMinY);
|
||||
m_IsVisible = true;
|
||||
}
|
||||
|
||||
if (m_Pen)
|
||||
clientDC.SelectObject(aOldPen);
|
||||
}
|
||||
|
||||
void COCCDemoView::InitButtons()
|
||||
{
|
||||
myXmin=0;
|
||||
myYmin=0;
|
||||
myXmax=0;
|
||||
myYmax=0;
|
||||
myCurZoom=0;
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
}
|
||||
|
||||
void COCCDemoView::Reset()
|
||||
{
|
||||
InitButtons();
|
||||
myVisMode = VIS_SHADE;
|
||||
if (!myView.IsNull())
|
||||
{
|
||||
RedrawVisMode();
|
||||
myView->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::RedrawVisMode()
|
||||
{
|
||||
switch (myVisMode)
|
||||
{
|
||||
case VIS_WIREFRAME:
|
||||
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
|
||||
myView->SetComputedMode (Standard_False);
|
||||
myView->Redraw();
|
||||
break;
|
||||
case VIS_SHADE:
|
||||
GetDocument()->GetAISContext()->SetDisplayMode(AIS_Shaded);
|
||||
myView->SetComputedMode (Standard_False);
|
||||
myView->Redraw();
|
||||
break;
|
||||
case VIS_HLR:
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
||||
myView->SetComputedMode (Standard_True);
|
||||
myView->Redraw();
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
|
||||
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONWire()
|
||||
{
|
||||
myVisMode = VIS_WIREFRAME;
|
||||
RedrawVisMode();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONShade()
|
||||
{
|
||||
myVisMode = VIS_SHADE;
|
||||
RedrawVisMode();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnBUTTONHlrOn()
|
||||
{
|
||||
myVisMode = VIS_HLR;
|
||||
RedrawVisMode();
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONWire(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myVisMode == VIS_WIREFRAME);
|
||||
pCmdUI->Enable (myVisMode != VIS_WIREFRAME);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONShade(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myVisMode == VIS_SHADE);
|
||||
pCmdUI->Enable (myVisMode != VIS_SHADE);
|
||||
}
|
||||
|
||||
void COCCDemoView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
|
||||
{
|
||||
pCmdUI->SetCheck (myVisMode == VIS_HLR);
|
||||
pCmdUI->Enable (myVisMode != VIS_HLR);
|
||||
}
|
||||
|
||||
void COCCDemoView::GetViewCenter(Standard_Real& Xc, Standard_Real& Yc)
|
||||
{
|
||||
myView->Center(Xc,Yc);
|
||||
}
|
||||
|
||||
void COCCDemoView::SetViewCenter(Standard_Real Xc, Standard_Real Yc)
|
||||
{
|
||||
myView->SetCenter(Xc,Yc);
|
||||
}
|
||||
|
||||
void COCCDemoView::GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z)
|
||||
{
|
||||
myView->Eye(X,Y,Z);
|
||||
}
|
||||
|
||||
void COCCDemoView::SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z)
|
||||
{
|
||||
myView->SetEye(X,Y,Z);
|
||||
}
|
||||
|
||||
Standard_Real COCCDemoView::GetViewScale()
|
||||
{
|
||||
return myView->Scale();
|
||||
}
|
||||
|
||||
void COCCDemoView::SetViewScale(Standard_Real Coef)
|
||||
{
|
||||
myView->SetScale(Coef);
|
||||
}
|
@@ -1,138 +0,0 @@
|
||||
// OCCDemoView.h : interface of the COCCDemoView class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
enum View3D_CurrentAction {
|
||||
CurAction3d_Nothing,
|
||||
CurAction3d_DynamicZooming,
|
||||
CurAction3d_WindowZooming,
|
||||
CurAction3d_DynamicPanning,
|
||||
CurAction3d_GlobalPanning,
|
||||
CurAction3d_DynamicRotation
|
||||
};
|
||||
|
||||
class COCCDemoView : public CView
|
||||
{
|
||||
protected: // create from serialization only
|
||||
COCCDemoView();
|
||||
DECLARE_DYNCREATE(COCCDemoView)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
COCCDemoDoc* GetDocument();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
void InitButtons();
|
||||
void Reset();
|
||||
void FitAll() { myView->FitAll(); myView->ZFitAll(); };
|
||||
void GetViewCenter(Standard_Real& Xc, Standard_Real& Yc);
|
||||
void SetViewCenter(const Standard_Real Xc, const Standard_Real Yc);
|
||||
void GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z);
|
||||
void SetViewEye(const Standard_Real X,const Standard_Real Y,const Standard_Real Z);
|
||||
Standard_Real GetViewScale();
|
||||
void SetViewScale(const Standard_Real Coef);
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(COCCDemoView)
|
||||
public:
|
||||
virtual void OnDraw(CDC* pDC); // overridden to draw this view
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual void OnInitialUpdate();
|
||||
protected:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~COCCDemoView();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(COCCDemoView)
|
||||
afx_msg void OnBUTTONAxo();
|
||||
afx_msg void OnBUTTONBack();
|
||||
afx_msg void OnBUTTONBottom();
|
||||
afx_msg void OnBUTTONFront();
|
||||
afx_msg void OnBUTTONHlrOn();
|
||||
afx_msg void OnBUTTONLeft();
|
||||
afx_msg void OnBUTTONPan();
|
||||
afx_msg void OnBUTTONPanGlo();
|
||||
afx_msg void OnBUTTONReset();
|
||||
afx_msg void OnBUTTONRight();
|
||||
afx_msg void OnBUTTONRot();
|
||||
afx_msg void OnBUTTONTop();
|
||||
afx_msg void OnBUTTONZoomAll();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnBUTTONZoomProg();
|
||||
afx_msg void OnBUTTONZoomWin();
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
|
||||
afx_msg void OnBUTTONWire();
|
||||
afx_msg void OnBUTTONShade();
|
||||
afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONShade(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONWire(CCmdUI* pCmdUI);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
void RedrawVisMode();
|
||||
|
||||
private:
|
||||
enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
|
||||
Handle(V3d_View) myView;
|
||||
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
|
||||
View3D_CurrentAction myCurrentMode;
|
||||
VisMode myVisMode;
|
||||
Standard_Integer myXmin;
|
||||
Standard_Integer myYmin;
|
||||
Standard_Integer myXmax;
|
||||
Standard_Integer myYmax;
|
||||
Standard_Real myCurZoom;
|
||||
|
||||
private:
|
||||
enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };
|
||||
CPen* m_Pen;
|
||||
virtual void DrawRectangle (const Standard_Integer MinX ,
|
||||
const Standard_Integer MinY ,
|
||||
const Standard_Integer MaxX ,
|
||||
const Standard_Integer MaxY ,
|
||||
const Standard_Boolean Draw ,
|
||||
const LineStyle aLineStyle = Default );
|
||||
|
||||
};
|
||||
|
||||
#ifndef _DEBUG // debug version in OCCDemoView.cpp
|
||||
inline COCCDemoDoc* COCCDemoView::GetDocument()
|
||||
{ return (COCCDemoDoc*)m_pDocument; }
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,206 +0,0 @@
|
||||
// ResultDialog.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OCCDemo.h"
|
||||
#include "ResultDialog.h"
|
||||
#include "MainFrm.h"
|
||||
#include "OCCDemoDoc.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
// minimum distance between buttons, button and dialog border
|
||||
#define d 5
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CResultDialog dialog
|
||||
|
||||
|
||||
CResultDialog::CResultDialog(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CResultDialog::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CResultDialog)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CResultDialog::Empty()
|
||||
{
|
||||
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
|
||||
pEd->Clear();
|
||||
}
|
||||
|
||||
void CResultDialog::SetText(LPCSTR aText)
|
||||
{
|
||||
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
|
||||
CString aCStr(aText);
|
||||
pEd->SetWindowText(aCStr);
|
||||
}
|
||||
|
||||
void CResultDialog::SetTitle(LPCSTR aTitle)
|
||||
{
|
||||
CString aCStr(aTitle);
|
||||
SetWindowText(aCStr);
|
||||
}
|
||||
|
||||
void CResultDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CResultDialog)
|
||||
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CResultDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CResultDialog)
|
||||
ON_BN_CLICKED(IDC_CopySelectionToClipboard, OnCopySelectionToClipboard)
|
||||
ON_BN_CLICKED(IDC_CopyAllToClipboard, OnCopyAllToClipboard)
|
||||
ON_WM_SIZE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CResultDialog message handlers
|
||||
|
||||
void CResultDialog::OnCopySelectionToClipboard()
|
||||
{
|
||||
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
|
||||
pEd->Copy( );
|
||||
}
|
||||
|
||||
void CResultDialog::OnCopyAllToClipboard()
|
||||
{
|
||||
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
|
||||
long nStartChar, nEndChar;
|
||||
pEd->GetSel (nStartChar, nEndChar);
|
||||
pEd->SetSel (0, -1);
|
||||
pEd->Copy();
|
||||
pEd->SetSel (nStartChar, nEndChar);
|
||||
}
|
||||
|
||||
void CResultDialog::OnCancel()
|
||||
{
|
||||
CMainFrame* cFrame = (CMainFrame*) AfxGetApp()->GetMainWnd();
|
||||
COCCDemoDoc* aDoc = (COCCDemoDoc*) cFrame->GetActiveDocument();
|
||||
aDoc->IsShowResult() = FALSE;
|
||||
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
void CResultDialog::Initialize()
|
||||
{
|
||||
// Set Fixed Width Font for rich edit control
|
||||
CRichEditCtrl *pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
|
||||
CFont aFixedWidthFont;
|
||||
VERIFY(aFixedWidthFont.CreateFont(
|
||||
15, // nHeight
|
||||
5, // nWidth
|
||||
0, // nEscapement
|
||||
0, // nOrientation
|
||||
FW_NORMAL, // nWeight
|
||||
FALSE, // bItalic
|
||||
FALSE, // bUnderline
|
||||
0, // cStrikeOut
|
||||
ANSI_CHARSET, // nCharSet
|
||||
OUT_DEFAULT_PRECIS, // nOutPrecision
|
||||
CLIP_DEFAULT_PRECIS, // nClipPrecision
|
||||
DEFAULT_QUALITY, // nQuality
|
||||
FF_MODERN, // Fix width fonts are FF_MODERN
|
||||
"Courier New")); // lpszFacename
|
||||
pEd->SetFont(&aFixedWidthFont, false);
|
||||
|
||||
// save button's width and height, so they are calculated only once
|
||||
RECT rect;
|
||||
CWnd *pBCopy = (CWnd *) GetDlgItem (IDC_CopySelectionToClipboard);
|
||||
pBCopy->GetWindowRect(&rect);
|
||||
bw = rect.right - rect.left; // a button's width (they are all equal)
|
||||
bh = rect.bottom - rect.top; // a button's height
|
||||
}
|
||||
|
||||
|
||||
// OnSize is a message handler of WM_SIZE messge,
|
||||
// it is reimplemented in order to reposition the buttons
|
||||
// (keep them always in the bottom part of the dialog)
|
||||
// and resize the rich edit controls as user resized THIS dialog.
|
||||
void CResultDialog::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
// call the base class handler
|
||||
CDialog::OnSize(nType, cx, cy);
|
||||
|
||||
//resizes internal GUI controls (rich edit control and 3 buttons)
|
||||
//according to given values of this dialog width (cx) and height (cy).
|
||||
//the method is called from OnSize message handler and
|
||||
//from InitInstance of OCCDemo to do initial resize
|
||||
CWnd *pEd = (CWnd *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
|
||||
CWnd *pBCopy = (CWnd *) GetDlgItem (IDC_CopySelectionToClipboard);
|
||||
CWnd *pBCopyAll = (CWnd *) GetDlgItem (IDC_CopyAllToClipboard);
|
||||
CWnd *pBClose = (CWnd *) GetDlgItem (IDCANCEL);
|
||||
|
||||
if (pEd != NULL) // it is NULL when dialog is being created and OnSize is called
|
||||
{
|
||||
int butY = cy-bh-d; // y coordinate of buttons' top left corner
|
||||
|
||||
pEd->SetWindowPos(&wndTop, 0, 0, cx, butY-4*d, SWP_NOMOVE);
|
||||
pBCopy->SetWindowPos(&wndTop, d, butY, 0, 0, SWP_NOSIZE);
|
||||
pBCopyAll->SetWindowPos(&wndTop, d+bw+d, butY, 0, 0, SWP_NOSIZE);
|
||||
pBClose->SetWindowPos(&wndTop, cx-bw-d, butY, 0, 0, SWP_NOSIZE);
|
||||
}
|
||||
|
||||
RedrawWindow();
|
||||
}
|
||||
|
||||
LRESULT CResultDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (message != WM_SIZING)
|
||||
return CDialog::WindowProc(message, wParam, lParam);
|
||||
|
||||
LPRECT pRect = (LPRECT) lParam;
|
||||
int cx = pRect->right - pRect->left;
|
||||
int cy = pRect->bottom - pRect->top;
|
||||
|
||||
int minCx = 3*bw+5*d;
|
||||
int minCy = 2*d+bh+200;
|
||||
|
||||
if (cx < minCx || cy < minCy)
|
||||
{
|
||||
switch (wParam)
|
||||
{
|
||||
case WMSZ_BOTTOM:
|
||||
pRect->bottom = pRect->top + minCy;
|
||||
break;
|
||||
case WMSZ_TOP:
|
||||
pRect->top = pRect->bottom - minCy;
|
||||
break;
|
||||
case WMSZ_LEFT:
|
||||
pRect->left = pRect->right - minCx;
|
||||
break;
|
||||
case WMSZ_RIGHT:
|
||||
pRect->right = pRect->left + minCx;
|
||||
break;
|
||||
case WMSZ_TOPLEFT:
|
||||
if (cx < minCx) pRect->left = pRect->right - minCx;
|
||||
if (cy < minCy) pRect->top = pRect->bottom - minCy;
|
||||
break;
|
||||
case WMSZ_BOTTOMRIGHT:
|
||||
if (cx < minCx) pRect->right = pRect->left + minCx;
|
||||
if (cy < minCy) pRect->bottom = pRect->top + minCy;
|
||||
break;
|
||||
case WMSZ_TOPRIGHT:
|
||||
if (cx < minCx) pRect->right = pRect->left + minCx;
|
||||
if (cy < minCy) pRect->top = pRect->bottom - minCy;
|
||||
break;
|
||||
case WMSZ_BOTTOMLEFT:
|
||||
if (cx < minCx) pRect->left = pRect->right - minCx;
|
||||
if (cy < minCy) pRect->bottom = pRect->top + minCy;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return CDialog::WindowProc(message, wParam, lParam);
|
||||
}
|
||||
|
@@ -1,66 +0,0 @@
|
||||
#if !defined(AFX_RESULTDIALOG_H__6597303D_7F5B_11D5_BA4D_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_RESULTDIALOG_H__6597303D_7F5B_11D5_BA4D_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// ResultDialog.h : header file
|
||||
//
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CResultDialog dialog
|
||||
|
||||
class CResultDialog : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
void Initialize();
|
||||
CResultDialog(CWnd* pParent = NULL); // standard constructor
|
||||
void SetTitle(LPCSTR aTitle);
|
||||
void SetText(LPCSTR aText);
|
||||
void Empty();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CResultDialog)
|
||||
enum { IDD = IDD_ResultDialog };
|
||||
// NOTE: the ClassWizard will add data members here
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CResultDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CResultDialog)
|
||||
afx_msg void OnCopySelectionToClipboard();
|
||||
afx_msg void OnCopyAllToClipboard();
|
||||
virtual void OnCancel();
|
||||
|
||||
// OnSize is a message handler of WM_SIZE messge,
|
||||
// it is reimplemented in order to reposition the buttons
|
||||
// (keep them always in the bottom part of the dialog)
|
||||
// and resize the rich edit controls as user resized THIS dialog.
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
int bw, bh; // button width and height
|
||||
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_RESULTDIALOG_H__6597303D_7F5B_11D5_BA4D_0060B0EE18EA__INCLUDED_)
|
@@ -1,6 +0,0 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// OCCDemo.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
@@ -1,44 +0,0 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__57A6A22A_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_STDAFX_H__57A6A22A_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
//#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#if !defined(WNT)
|
||||
#error WNT precompiler directive is mandatory for CasCade
|
||||
#endif
|
||||
|
||||
#pragma warning( disable : 4244 ) // Issue warning 4244
|
||||
#include "Standard_ShortReal.hxx"
|
||||
#pragma warning( default : 4244 ) // Issue warning 4244
|
||||
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__57A6A22A_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
Before Width: | Height: | Size: 3.7 KiB |
@@ -1 +0,0 @@
|
||||
// This file is to be included in the main resource file
|
Before Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.5 KiB |
@@ -1,49 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by OCCDemo.rc
|
||||
//
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_TOOLBAR1 130
|
||||
#define IDD_ResultDialog 133
|
||||
#define IDC_CopySelectionToClipboard 1000
|
||||
#define IDC_CopyAllToClipboard 1001
|
||||
#define IDC_RICHEDIT_ResultDialog 1005
|
||||
#define IDB_OCC_LOGO 1300
|
||||
#define IDD_ABOUTBOX 10000
|
||||
#define IDC_ABOUTBOX_TITLE 10001
|
||||
#define ID_BUTTONZoomAll 40000
|
||||
#define ID_BUTTONZoomWin 40002
|
||||
#define ID_BUTTONZoomProg 40003
|
||||
#define ID_BUTTONPan 40004
|
||||
#define ID_BUTTONPanGlo 40005
|
||||
#define ID_BUTTONFront 40006
|
||||
#define ID_BUTTONLeft 40007
|
||||
#define ID_BUTTONTop 40008
|
||||
#define ID_BUTTONBack 40009
|
||||
#define ID_BUTTONRight 40010
|
||||
#define ID_BUTTONBottom 40011
|
||||
#define ID_BUTTONAxo 40012
|
||||
#define ID_BUTTONRot 40013
|
||||
#define ID_BUTTONReset 40014
|
||||
#define ID_BUTTONWire 40015
|
||||
#define ID_BUTTONShade 40016
|
||||
#define ID_BUTTONHlrOn 40017
|
||||
#define ID_BUTTONStart 40103
|
||||
#define ID_BUTTONNext 40104
|
||||
#define ID_BUTTONShowResult 40105
|
||||
#define ID_DUMP_VIEW 40106
|
||||
#define ID_BUTTONEnd 40107
|
||||
#define ID_BUTTONPrev 40109
|
||||
#define ID_BUTTONRepeat 40110
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 136
|
||||
#define _APS_NEXT_COMMAND_VALUE 40111
|
||||
#define _APS_NEXT_CONTROL_VALUE 1007
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
@@ -1,428 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="Convert"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\../Release"
|
||||
IntermediateDirectory=".\../Release/obj"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Release/obj/Convert.pch"
|
||||
AssemblerListingLocation=".\../Release/obj/"
|
||||
ObjectFile=".\../Release/obj/"
|
||||
ProgramDataBaseFileName=".\../Release/obj/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
|
||||
OutputFile=".\../Release/Convert.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\../Release/Convert.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Release/Convert.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\../Debug"
|
||||
IntermediateDirectory=".\../Debug/objd"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Debug/objd/Convert.pch"
|
||||
AssemblerListingLocation=".\../Debug/objd/"
|
||||
ObjectFile=".\../Debug/objd/"
|
||||
ProgramDataBaseFileName=".\../Debug/objd/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
|
||||
OutputFile=".\../Debug/Convert.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\../Debug/Convert.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Debug/Convert.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="Convert_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="Convert_Presentation.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Common"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\env.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\readme.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\run.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\vc.bat">
|
||||
</File>
|
||||
<Filter
|
||||
Name="Source Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.rc">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar.bmp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar1.bmp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -1,461 +0,0 @@
|
||||
// Convert_Presentation.cpp: implementation of the Convert_Presentation class.
|
||||
// Conversion of elementary geometry to BSpline curves and surfaces
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Convert_Presentation.h"
|
||||
|
||||
#include <Quantity_Color.hxx>
|
||||
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
|
||||
#include <GeomConvert.hxx>
|
||||
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
|
||||
|
||||
// Initialization of global variable with an instance of this class
|
||||
OCCDemo_Presentation* OCCDemo_Presentation::Current = new Convert_Presentation;
|
||||
|
||||
// Initialization of array of samples
|
||||
const Convert_Presentation::PSampleFuncType Convert_Presentation::SampleFuncs[] =
|
||||
{
|
||||
&Convert_Presentation::sampleCircle,
|
||||
&Convert_Presentation::sampleEllipse,
|
||||
&Convert_Presentation::sampleBezier,
|
||||
&Convert_Presentation::sampleBezierSurface,
|
||||
&Convert_Presentation::sampleCylindricalSurface,
|
||||
&Convert_Presentation::sampleRevolSurface,
|
||||
&Convert_Presentation::sampleToroidalSurface,
|
||||
&Convert_Presentation::sampleConicalSurface,
|
||||
&Convert_Presentation::sampleSphericalSurface
|
||||
};
|
||||
|
||||
// Colors of objects
|
||||
static const Quantity_Color CurveColor (1,1,0, Quantity_TOC_RGB); // yellow
|
||||
static const Quantity_Color SurfaceColor (1,1,0, Quantity_TOC_RGB); // yellow
|
||||
static const Quantity_Color BSplineColor (1,0.647,0, Quantity_TOC_RGB); // orange
|
||||
static const Quantity_Color BSplineSurfaceColor (0,0,1, Quantity_TOC_RGB); // blue
|
||||
|
||||
#ifdef WNT
|
||||
#define EOL "\r\n"
|
||||
#else
|
||||
#define EOL "\n"
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Convert_Presentation::Convert_Presentation()
|
||||
{
|
||||
FitMode = true;
|
||||
setName ("Conversion to BSpline curves and surfaces");
|
||||
myIndex = 0;
|
||||
myNbFuncs = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
|
||||
myNbSamples = myNbFuncs;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sample execution
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Convert_Presentation::DoSample()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
if (myIndex >=0 && myIndex < myNbFuncs)
|
||||
(this->*SampleFuncs[myIndex])();
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurface,
|
||||
const Standard_CString theName,
|
||||
TCollection_AsciiString& theText)
|
||||
{
|
||||
TCollection_AsciiString aTitle ("Converting ");
|
||||
aTitle += theName;
|
||||
aTitle += " to BSpline surface";
|
||||
|
||||
theText += EOL
|
||||
" Handle(Geom_BSplineSurface) aBSplineSurface = " EOL
|
||||
" GeomConvert::SurfaceToBSplineSurface(aSurface);" EOL;
|
||||
|
||||
setResultTitle (aTitle.ToCString());
|
||||
setResultText (theText.ToCString());
|
||||
|
||||
drawSurface (theSurface, SurfaceColor);
|
||||
|
||||
if (WAIT_A_LITTLE) return;
|
||||
|
||||
Handle(Geom_BSplineSurface) aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
|
||||
|
||||
_ASSERTE(!aBSplineSurface.IsNull());
|
||||
|
||||
drawSurface (aBSplineSurface, BSplineSurfaceColor);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::drawCurveAndItsBSpline
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::drawCurveAndItsBSpline(Handle(Geom_Curve) theCurve,
|
||||
const Standard_CString theName,
|
||||
TCollection_AsciiString& theText)
|
||||
{
|
||||
TCollection_AsciiString aTitle ("Converting ");
|
||||
aTitle += theName;
|
||||
aTitle += " to BSpline curve";
|
||||
|
||||
theText += EOL
|
||||
" Handle(Geom_BSplineCurve) aBSpline = " EOL
|
||||
" GeomConvert::CurveToBSplineCurve(aCurve);" EOL;
|
||||
|
||||
setResultTitle (aTitle.ToCString());
|
||||
setResultText (theText.ToCString());
|
||||
|
||||
drawCurve (theCurve, CurveColor);
|
||||
|
||||
if (WAIT_A_LITTLE) return;
|
||||
|
||||
Handle(Geom_BSplineCurve) aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);
|
||||
|
||||
drawCurve (aBSpline, BSplineColor);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sample functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleCircle
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleCircle()
|
||||
{
|
||||
gp_Pnt aOrigin (0,0,0);
|
||||
gp_Dir aDir (1,0,0);
|
||||
gp_Ax2 aAxis (aOrigin, aDir);
|
||||
Standard_Real aRadius = 300;
|
||||
Handle(Geom_Circle) aCurve = new Geom_Circle (aAxis, aRadius);
|
||||
|
||||
TCollection_AsciiString aText (
|
||||
" gp_Pnt aOrigin (0,0,0);" EOL
|
||||
" gp_Dir aDir (1,0,0);" EOL
|
||||
" gp_Ax2 aAxis (aOrigin, aDir);" EOL
|
||||
" Standard_Real aRadius = 300;" EOL
|
||||
" Handle(Geom_Circle) aCurve = new Geom_Circle (aAxis, aRadius);" EOL
|
||||
);
|
||||
drawCurveAndItsBSpline (aCurve, "Circle", aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleEllipse
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleEllipse()
|
||||
{
|
||||
gp_Pnt aOrigin (0,0,0);
|
||||
gp_Dir aDir (1,0,0);
|
||||
gp_Ax2 aMajorAxis (aOrigin, aDir);
|
||||
Standard_Real aMajorRadius = 300;
|
||||
Standard_Real aMinorRadius = 150;
|
||||
Handle(Geom_Ellipse) aCurve =
|
||||
new Geom_Ellipse (aMajorAxis, aMajorRadius, aMinorRadius);
|
||||
|
||||
TCollection_AsciiString aText (
|
||||
" gp_Pnt aOrigin (0,0,0);" EOL
|
||||
" gp_Dir aDir (1,0,0);" EOL
|
||||
" gp_Ax2 aAxis (aOrigin, aDir);" EOL
|
||||
" Standard_Real aMajorRadius = 300;" EOL
|
||||
" Standard_Real aMinorRadius = 150;" EOL
|
||||
" Handle(Geom_Ellipse) aCurve = " EOL
|
||||
" new Geom_Ellipse (aAxis, aMajorRadius, aMinorRadius);" EOL
|
||||
);
|
||||
drawCurveAndItsBSpline (aCurve, "Ellipse", aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleBezier
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleBezier()
|
||||
{
|
||||
TCollection_AsciiString aText (
|
||||
" Standard_Real aPolesCoords[][3] = {" EOL
|
||||
" {0,0,0},{0,1,0},{1,1,0},{1,2,0},{2,2,0},{2,1,0},{3,1,0},{3,0,0},{2,0,0},{2,-1,0}," EOL
|
||||
" {3,-1,0},{3,-2,0},{4,-2,0},{4,-1,0},{5,-1,0},{5,0,0},{6,0,0},{6,-1,0},{7,-1,0}," EOL
|
||||
" {7,0,0},{8,0,0},{8,1,0}" EOL
|
||||
" };" EOL
|
||||
" TColgp_Array1OfPnt aPoles (1, sizeof(aPolesCoords)/(sizeof(Standard_Real)*2));" EOL
|
||||
" " EOL
|
||||
" for (Standard_Integer i=1; i <= aPoles.Upper(); i++)" EOL
|
||||
" aPoles(i) = gp_Pnt (aPolesCoords[i-1][0]*100, " EOL
|
||||
" aPolesCoords[i-1][1]*100, " EOL
|
||||
" aPolesCoords[i-1][2]*100);" EOL
|
||||
" " EOL
|
||||
" Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve (aPoles);" EOL
|
||||
);
|
||||
|
||||
Standard_Real aPolesCoords[][3] = {
|
||||
{0,0,0},{0,1,0},{1,1,0},{1,2,0},{2,2,0},{2,1,0},{3,1,0},{3,0,0},{2,0,0},{2,-1,0},
|
||||
{3,-1,0},{3,-2,0},{4,-2,0},{4,-1,0},{5,-1,0},{5,0,0},{6,0,0},{6,-1,0},{7,-1,0},
|
||||
{7,0,0},{8,0,0},{8,1,0}
|
||||
};
|
||||
TColgp_Array1OfPnt aPoles (1, sizeof(aPolesCoords)/(sizeof(Standard_Real)*3));
|
||||
|
||||
for (Standard_Integer i=1; i <= aPoles.Upper(); i++)
|
||||
aPoles(i) = gp_Pnt (aPolesCoords[i-1][0]*150-500,
|
||||
aPolesCoords[i-1][1]*150,
|
||||
aPolesCoords[i-1][2]*150);
|
||||
|
||||
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve (aPoles);
|
||||
|
||||
drawCurveAndItsBSpline (aCurve, "BezierCurve", aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleBezierSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleBezierSurface()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_CString aName = "BezierSurface";
|
||||
// Create a BezierSurface
|
||||
TColgp_Array2OfPnt aPoles(1,2,1,4); // 8 points
|
||||
TColStd_Array2OfReal aWeights(1,2,1,4);
|
||||
// initializing array of points
|
||||
aPoles.SetValue(1,1,gp_Pnt(0,10,0)); aPoles.SetValue(1,2,gp_Pnt(3.3,6.6,3));
|
||||
aPoles.SetValue(1,3,gp_Pnt(6.6,6.6,-3)); aPoles.SetValue(1,4,gp_Pnt(10,10,0));
|
||||
aPoles.SetValue(2,1,gp_Pnt(0,0,0)); aPoles.SetValue(2,2,gp_Pnt(3.3,3.3,-3));
|
||||
aPoles.SetValue(2,3,gp_Pnt(6.6,3.3,3)); aPoles.SetValue(2,4,gp_Pnt(10,0,0));
|
||||
// scaling poles
|
||||
for (Standard_Integer i=1; i <= aPoles.ColLength(); i++)
|
||||
for (Standard_Integer j=1; j <= aPoles.RowLength(); j++)
|
||||
aPoles(i,j).ChangeCoord() = aPoles(i,j).Coord() * 100 + gp_XYZ(-500,-500,0);
|
||||
//initializing array of weights
|
||||
aWeights.SetValue(1,1,1); aWeights.SetValue(1,2,3);
|
||||
aWeights.SetValue(1,3,9); aWeights.SetValue(1,4,1);
|
||||
aWeights.SetValue(2,1,1); aWeights.SetValue(2,2,2);
|
||||
aWeights.SetValue(2,3,5); aWeights.SetValue(2,4,1);
|
||||
Handle(Geom_BezierSurface) aSurface =
|
||||
new Geom_BezierSurface(aPoles, aWeights);
|
||||
|
||||
TCollection_AsciiString aText (
|
||||
" // Create a BezierSurface" EOL
|
||||
" TColgp_Array2OfPnt aPoles(1,2,1,4); // 8 points" EOL
|
||||
" TColStd_Array2OfReal aWeights(1,2,1,4);" EOL
|
||||
" // initializing array of points" EOL
|
||||
" aPoles.SetValue(1,1,gp_Pnt(0,10,0)); aPoles.SetValue(1,2,gp_Pnt(3.3,6.6,3));" EOL
|
||||
" aPoles.SetValue(1,3,gp_Pnt(6.6,6.6,-3)); aPoles.SetValue(1,4,gp_Pnt(10,10,0));" EOL
|
||||
" aPoles.SetValue(2,1,gp_Pnt(0,0,0)); aPoles.SetValue(2,2,gp_Pnt(3.3,3.3,-3));" EOL
|
||||
" aPoles.SetValue(2,3,gp_Pnt(6.6,3.3,3)); aPoles.SetValue(2,4,gp_Pnt(10,0,0)); " EOL
|
||||
" // scaling poles" EOL
|
||||
" for (Standard_Integer i=1; i <= aPoles.ColLength(); i++)" EOL
|
||||
" for (Standard_Integer j=1; j <= aPoles.RowLength(); j++)" EOL
|
||||
" aPoles(i,j).ChangeCoord() = aPoles(i,j).Coord() * 100 + gp_XYZ(-500,-500,0);" EOL
|
||||
" //initializing array of weights" EOL
|
||||
" aWeights.SetValue(1,1,1); aWeights.SetValue(1,2,3);" EOL
|
||||
" aWeights.SetValue(1,3,9); aWeights.SetValue(1,4,1);" EOL
|
||||
" aWeights.SetValue(2,1,1); aWeights.SetValue(2,2,2);" EOL
|
||||
" aWeights.SetValue(2,3,5); aWeights.SetValue(2,4,1);" EOL
|
||||
" Handle(Geom_BezierSurface) aSurface =" EOL
|
||||
" new Geom_BezierSurface(aPoles, aWeights);" EOL
|
||||
);
|
||||
|
||||
drawSurfaceAndItsBSpline (aSurface, aName, aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : OCCDemo_Presentation::sampleCylindricalSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleCylindricalSurface()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_CString aName = "Cylindrical Surface";
|
||||
TCollection_AsciiString aText (
|
||||
" // creating an axis parallel to Y axis" EOL
|
||||
" gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));" EOL EOL
|
||||
|
||||
" // creating a cylindrical surface along anAx with radius = 100" EOL
|
||||
" Handle(Geom_CylindricalSurface) aCylSurface = new Geom_CylindricalSurface(anAx, 100);" EOL EOL
|
||||
|
||||
" // only finit surfaces can be converted to BSpline surfaces, " EOL
|
||||
" // cylindrical surface is infinite, it must be trimmed" EOL
|
||||
" Handle(Geom_RectangularTrimmedSurface) aSurface = " EOL
|
||||
" new Geom_RectangularTrimmedSurface(aCylSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);" EOL);
|
||||
|
||||
// creating an axis parallel to Y axis
|
||||
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));
|
||||
|
||||
// creating a cylindrical surface along anAx with radius = 4
|
||||
Handle(Geom_CylindricalSurface) aCylSurface = new Geom_CylindricalSurface(anAx, 100);
|
||||
|
||||
// only finit surfaces can be converted to BSpline surfaces,
|
||||
// cylindrical surface is infinite, it must be trimmed
|
||||
Handle(Geom_RectangularTrimmedSurface) aSurface =
|
||||
new Geom_RectangularTrimmedSurface(aCylSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);
|
||||
|
||||
drawSurfaceAndItsBSpline(aSurface, aName, aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : OCCDemo_Presentation::sampleRevolSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleRevolSurface()
|
||||
{
|
||||
FitMode=false;
|
||||
ResetView();
|
||||
SetViewCenter(176.84682,102.12892);
|
||||
SetViewScale(0.69326);
|
||||
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_CString aName = "Surface of revolution";
|
||||
TCollection_AsciiString aText (
|
||||
" // creating a curve for revolution. Let it be a Bezier curve." EOL
|
||||
" Handle(Geom_BezierCurve) aBezierCurve;" EOL EOL
|
||||
|
||||
" // array of the bezier curve poles" EOL
|
||||
" TColgp_Array1OfPnt aPoles(1,4);" EOL
|
||||
" // array of the poles' weights" EOL
|
||||
" TColStd_Array1OfReal aWeights(1,4);" EOL EOL
|
||||
|
||||
" aPoles(1) = gp_Pnt(0, 0, 0); aWeights(1) = 1;" EOL
|
||||
" aPoles(2) = gp_Pnt(150, 250, 0); aWeights(2) =75;" EOL
|
||||
" aPoles(3) = gp_Pnt(350, 150, 0); aWeights(3) =120;" EOL
|
||||
" aPoles(4) = gp_Pnt(500, 500, 0); aWeights(4) = 1;" EOL EOL
|
||||
|
||||
" // creating a bezier curve" EOL
|
||||
" aBezierCurve = new Geom_BezierCurve(aPoles, aWeights);" EOL EOL
|
||||
|
||||
" // creating a surface of revolution of the bezier curve around Y axis" EOL
|
||||
" gp_Ax1 anAx(gp_Pnt(0, 0, 0), gp_Dir(0,1,0));" EOL
|
||||
" Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aBezierCurve, anAx);" EOL
|
||||
);
|
||||
|
||||
// array of the bezier curve poles
|
||||
TColgp_Array1OfPnt aPoles(1,4);
|
||||
// array of the poles' weights
|
||||
TColStd_Array1OfReal aWeights(1,4);
|
||||
|
||||
aPoles(1) = gp_Pnt(0, 0, 0); aWeights(1) = 1;
|
||||
aPoles(2) = gp_Pnt(150, 250, 0); aWeights(2) =75;
|
||||
aPoles(3) = gp_Pnt(350, 150, 0); aWeights(3) =120;
|
||||
aPoles(4) = gp_Pnt(500, 500, 0); aWeights(4) = 1;
|
||||
|
||||
Handle(Geom_BezierCurve) aBezierCurve = new Geom_BezierCurve(aPoles, aWeights);
|
||||
drawCurve(aBezierCurve);
|
||||
|
||||
// creating a surface of revolution of the bezier curve around Y axis
|
||||
gp_Ax1 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));
|
||||
Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aBezierCurve, anAx);
|
||||
|
||||
drawSurfaceAndItsBSpline (aSurface, aName, aText);
|
||||
FitMode=true;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleToroidalSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleToroidalSurface()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_CString aName = "Toroidal surface";
|
||||
TCollection_AsciiString aText (
|
||||
" // creating an axis parallel to Y axis" EOL
|
||||
" gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));" EOL
|
||||
" // creating a toroidal surface with major radius = 240 and minor radius = 120" EOL
|
||||
" Handle(Geom_ToroidalSurface) aSurface = new Geom_ToroidalSurface(anAx, 240, 120);" EOL);
|
||||
|
||||
// creating an axis parallel to Y axis
|
||||
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,1,0));
|
||||
// creating a toroidal surface with major radius = 240 and minor radius = 120
|
||||
Handle(Geom_ToroidalSurface) aSurface = new Geom_ToroidalSurface(anAx, 240, 120);
|
||||
|
||||
drawSurfaceAndItsBSpline(aSurface, aName, aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleConicalSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleConicalSurface()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_CString aName = "Conical surface";
|
||||
TCollection_AsciiString aText (
|
||||
" // creating an axis parallel to Z axis" EOL
|
||||
" gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1)); " EOL
|
||||
" // creating a conical surface with base radius = 10 and angle = 20 deg" EOL
|
||||
" Handle(Geom_ConicalSurface) aConicalSurface = new Geom_ConicalSurface(anAx,PI/9., 10);" EOL EOL
|
||||
|
||||
" // only finit surfaces can be converted to BSpline surfaces, " EOL
|
||||
" // conical surface is infinite, it must be trimmed" EOL
|
||||
" Handle(Geom_RectangularTrimmedSurface) aSurface = " EOL
|
||||
" new Geom_RectangularTrimmedSurface(aConicalSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);" EOL);
|
||||
|
||||
// creating an axis parallel to Z axis
|
||||
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1));
|
||||
// creating a conical surface with base radius = 10 and angle = 20 deg
|
||||
Handle(Geom_ConicalSurface) aConicalSurface = new Geom_ConicalSurface(anAx,PI/9., 10);
|
||||
|
||||
// only finit surfaces can be converted to BSpline surfaces,
|
||||
// conical surface is infinite, it must be trimmed
|
||||
Handle(Geom_RectangularTrimmedSurface) aSurface =
|
||||
new Geom_RectangularTrimmedSurface(aConicalSurface, 0, 2*PI, -1000, 1000, Standard_True, Standard_True);
|
||||
|
||||
drawSurfaceAndItsBSpline(aSurface, aName, aText);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::sampleSphericalSurface
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void Convert_Presentation::sampleSphericalSurface()
|
||||
{
|
||||
getAISContext()->EraseAll();
|
||||
|
||||
Standard_CString aName = "Spherical surface";
|
||||
TCollection_AsciiString aText (
|
||||
"// creating an axis parallel to Z axis" EOL
|
||||
"gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1));" EOL
|
||||
"// creating a spherical surface with radius = 300" EOL
|
||||
"Handle(Geom_SphericalSurface) aSurface = new Geom_SphericalSurface(anAx,300);" EOL);
|
||||
|
||||
// creating an axis parallel to Z axis
|
||||
gp_Ax3 anAx(gp_Pnt(0,0,0), gp_Dir(0,0,1));
|
||||
// creating a spherical surface with radius = 300
|
||||
Handle(Geom_SphericalSurface) aSurface = new Geom_SphericalSurface(anAx,300);
|
||||
|
||||
drawSurfaceAndItsBSpline(aSurface, aName, aText);
|
||||
}
|
||||
|
@@ -1,55 +0,0 @@
|
||||
// Convert_Presentation.h: interface for the Convert_Presentation class.
|
||||
// Conversion of elementary geometry to BSpline curves and surfaces
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_Convert_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_Convert_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <OCCDemo_Presentation.h>
|
||||
class Geom_Curve;
|
||||
class Geom_Surface;
|
||||
|
||||
class Quantity_Color;
|
||||
|
||||
class Convert_Presentation : public OCCDemo_Presentation
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
Convert_Presentation();
|
||||
|
||||
public:
|
||||
// Iteration on samples
|
||||
virtual void DoSample();
|
||||
// one phase of iterations
|
||||
|
||||
private:
|
||||
// Sample functions
|
||||
void sampleCircle();
|
||||
void sampleEllipse();
|
||||
void sampleBezier();
|
||||
void sampleBezierSurface();
|
||||
void sampleCylindricalSurface();
|
||||
void sampleRevolSurface();
|
||||
void sampleToroidalSurface();
|
||||
void sampleConicalSurface();
|
||||
void sampleSphericalSurface();
|
||||
|
||||
void drawCurveAndItsBSpline (Handle(Geom_Curve) theCurve,
|
||||
const Standard_CString theName, TCollection_AsciiString& theText);
|
||||
|
||||
void drawSurfaceAndItsBSpline (Handle(Geom_Surface) theSurface,
|
||||
const Standard_CString theName, TCollection_AsciiString& theText);
|
||||
|
||||
private:
|
||||
// Array of pointers to sample functions
|
||||
typedef void (Convert_Presentation::*PSampleFuncType)();
|
||||
static const PSampleFuncType SampleFuncs[];
|
||||
|
||||
int myNbFuncs;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_Convert_Presentation_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
@@ -1,428 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="DCA"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\../Release"
|
||||
IntermediateDirectory=".\../Release/obj"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WNT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Release/obj/DCA.pch"
|
||||
AssemblerListingLocation=".\../Release/obj/"
|
||||
ObjectFile=".\../Release/obj/"
|
||||
ProgramDataBaseFileName=".\../Release/obj/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
|
||||
OutputFile=".\../Release/DCA.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\../Release/DCA.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Release/DCA.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\../Debug"
|
||||
IntermediateDirectory=".\../Debug/objd"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../,../Common,../Common/WNT,../Common/ISession"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WNT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="StdAfx.h"
|
||||
PrecompiledHeaderFile=".\../Debug/objd/DCA.pch"
|
||||
AssemblerListingLocation=".\../Debug/objd/"
|
||||
ObjectFile=".\../Debug/objd/"
|
||||
ProgramDataBaseFileName=".\../Debug/objd/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKGeomAlgo.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKV2d.lib TKV3d.lib TKBRep.lib TKG2d.lib TKG3d.lib TKGeomBase.lib TKBO.lib"
|
||||
OutputFile=".\../Debug/DCA.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\../Debug/DCA.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\../Debug/DCA.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="DCA_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="DCA_Presentation.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Common"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\env.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\readme.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\run.bat">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\vc.bat">
|
||||
</File>
|
||||
<Filter
|
||||
Name="Source Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.rc">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\RLS\tmp\demo\Common\WNT"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files No. 1"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\ISession\ISession_Curve.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\MainFrm.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemo.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OCCDemo_Presentation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoDoc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\OCCDemoView.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\ResultDialog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\StdAfx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\OCCDemo.rc2">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar.bmp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\WNT\res\toolbar1.bmp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@@ -1,47 +0,0 @@
|
||||
// DCA_Presentation.h: interface for the DCA_Presentation class.
|
||||
// Geometry Direct Construction Algorithms
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_DCA_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|
||||
#define AFX_DCA_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <OCCDemo_Presentation.h>
|
||||
|
||||
class DCA_Presentation : public OCCDemo_Presentation
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
DCA_Presentation();
|
||||
|
||||
public:
|
||||
// Iteration on samples
|
||||
virtual void DoSample();
|
||||
// one phase of iterations
|
||||
|
||||
private:
|
||||
// Sample functions
|
||||
void sampleLine();
|
||||
void sampleParabola();
|
||||
void sampleHyperbola();
|
||||
void sampleCircle();
|
||||
void sampleEllipse();
|
||||
void samplePlane();
|
||||
void sampleCylindricalSurface();
|
||||
void sampleToroidalSurface();
|
||||
void sampleConicalSurface();
|
||||
void sampleSphericalSurface();
|
||||
|
||||
void Comment(const Standard_CString theTitle,TCollection_AsciiString& theText);
|
||||
|
||||
private:
|
||||
// Array of pointers to sample functions
|
||||
typedef void (DCA_Presentation::*PSampleFuncType)();
|
||||
static const PSampleFuncType SampleFuncs[];
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_DCA_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
|