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

Compare commits

..

13 Commits

Author SHA1 Message Date
gka
73996dd02e Redundant classes from StepData was removed 2017-10-27 11:07:14 +03:00
gka
bc68ae6c3b Fixes made for ISCAR delivery 20.10.2017 2017-10-23 12:04:01 +03:00
gka
a55de70aaf Fixes to thread safety 2017-10-17 15:53:27 +03:00
aka
bc25347bdc more modifications to avoid exceptions 2017-08-28 13:23:50 +03:00
gka
cf6a89b0e9 Modification to avoid exceptions in the parallel test 2017-08-28 12:50:27 +03:00
gka
108fd5ccca Fix for thread safety 2017-08-24 16:46:36 +03:00
aka
4f90ff1f51 Mutex for some static init functions 2017-08-24 14:30:23 +03:00
aka
c03f975a46 Comment unnecessary messages 2017-08-22 17:18:38 +03:00
aka
aa25f03295 initialization of ShapeProcess_OperLibrary added 2017-08-21 17:29:18 +03:00
aka
84f4287cc6 Remove static StepEdit, StepProtocol. Mutex for parser 2017-08-18 14:57:59 +03:00
aka
3cb513c0cb Remove static StepEdit, StepProtocol. Mutex for parser 2017-08-18 10:54:00 +03:00
aka
877230bcc6 Modification for thread-safety version of the step translator 2017-08-14 16:05:17 +03:00
gka
d671b083f8 Modificarion STEP translator for ISCAR project
Modification for loading a few STEP files in the model
2017-08-02 12:04:38 +03:00
505 changed files with 9837 additions and 14568 deletions

View File

@@ -561,27 +561,6 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
endif()
# FFmpeg
# search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
if (CAN_USE_FFMPEG)
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
if (USE_FFMPEG)
add_definitions (-DHAVE_FFMPEG)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_FFMPEG")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
endif()
# OpenGL ES 2.0
if (WIN32 AND CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")

View File

@@ -347,6 +347,8 @@ n StepToGeom
n StepToTopoDS
n StepVisual
n StlAPI
n StlMesh
n StlTransfer
n TopoDSToStep
n Transfer
n TransferBRep

View File

@@ -1,228 +0,0 @@
# FFmpeg
if (NOT DEFINED INSTALL_FFMPEG)
set (INSTALL_FFMPEG OFF CACHE BOOL "${INSTALL_FFMPEG_DESCR}")
endif()
if (NOT DEFINED 3RDPARTY_FFMPEG_DIR)
set (3RDPARTY_FFMPEG_DIR "" CACHE PATH "The directory containing FFmpeg")
endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify FFMPEG folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_FFMPEG_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" FFMPEG FFMPEG_DIR_NAME)
if (FFMPEG_DIR_NAME)
set (3RDPARTY_FFMPEG_DIR "${3RDPARTY_DIR}/${FFMPEG_DIR_NAME}" CACHE PATH "The directory containing FFmpeg" FORCE)
endif()
endif()
else()
endif()
# define required FFMPEG variables
if (NOT DEFINED 3RDPARTY_FFMPEG_INCLUDE_DIR)
set (3RDPARTY_FFMPEG_INCLUDE_DIR "" CACHE PATH "the path of headers directory")
endif()
if (NOT DEFINED 3RDPARTY_FFMPEG_LIBRARY OR NOT 3RDPARTY_FFMPEG_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
set (3RDPARTY_FFMPEG_LIBRARY "" CACHE FILEPATH "FFmpeg framework" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_FFMPEG_LIBRARY_DIR)
set (3RDPARTY_FFMPEG_LIBRARY_DIR "" CACHE PATH "The directory containing FFmpeg framework")
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_FFMPEG_DLL OR NOT 3RDPARTY_FFMPEG_DLL_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_DLL_DIR}")
set (3RDPARTY_FFMPEG_DLL "" CACHE FILEPATH "FFmpeg shared libraries" FORCE)
endif()
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_FFMPEG_DLL_DIR)
set (3RDPARTY_FFMPEG_DLL_DIR "" CACHE PATH "The directory containing FFmpeg shared libraries")
endif()
endif()
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_${PRODUCT_NAME}_DIR
if (3RDPARTY_FFMPEG_DIR AND EXISTS "${3RDPARTY_FFMPEG_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_INCLUDE_DIR PATH "the path to FFmpeg")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_LIBRARY FILEPATH "the path to FFmpeg framework")
if (3RDPARTY_FFMPEG_LIBRARY AND EXISTS "${3RDPARTY_FFMPEG_LIBRARY}")
get_filename_component (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY}" PATH)
set (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY_DIR}" CACHE PATH "The directory containing FFmpeg libraries" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_LIBRARY_DIR PATH "The directory containing FFmpeg libraries")
endif()
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_DLL FILEPATH "the path to FFmpeg shared libraries")
if (3RDPARTY_FFMPEG_DLL AND EXISTS "${3RDPARTY_FFMPEG_DLL}")
get_filename_component (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL}" PATH)
set (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL_DIR}" CACHE PATH "The directory containing FFmpeg shared libraries" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_DLL_DIR PATH "The directory containing FFmpeg shared libraries")
endif()
endif()
endif()
# header
if (NOT 3RDPARTY_FFMPEG_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_INCLUDE_DIR}")
set (HEADER_NAMES avutil.h libavutil/avutil.h)
# set 3RDPARTY_FFMPEG_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FFMPEG_INCLUDE_DIR
set (3RDPARTY_FFMPEG_INCLUDE_DIR "3RDPARTY_FFMPEG_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "the path to header directory" FORCE)
if (3RDPARTY_FFMPEG_DIR AND EXISTS "${3RDPARTY_FFMPEG_DIR}")
find_path (3RDPARTY_FFMPEG_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_FFMPEG_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_FFMPEG_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_FFMPEG_INCLUDE_DIR AND EXISTS "${3RDPARTY_FFMPEG_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FFMPEG_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FFMPEG_INCLUDE_DIR)
set (3RDPARTY_FFMPEG_INCLUDE_DIR "" CACHE FILEPATH "the path to avutil.h" FORCE)
endif()
# library
if (NOT 3RDPARTY_FFMPEG_LIBRARY OR NOT EXISTS "${3RDPARTY_FFMPEG_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (FFMPEG_PATH_SUFFIXES lib)
if (ANDROID)
set (FFMPEG_PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES} libs/${ANDROID_ABI})
elseif(APPLE)
set (FFMPEG_PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES} Frameworks)
endif()
# set 3RDPARTY_FFMPEG_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FFMPEG_LIBRARY
set (3RDPARTY_FFMPEG_LIBRARY "3RDPARTY_FFMPEG_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to FFmpeg library" FORCE)
if (3RDPARTY_FFMPEG_DIR AND EXISTS "${3RDPARTY_FFMPEG_DIR}")
find_library (3RDPARTY_FFMPEG_LIBRARY NAMES avutil
PATHS "${3RDPARTY_FFMPEG_LIBRARY_DIR}" "${3RDPARTY_FFMPEG_DIR}"
PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_FFMPEG_LIBRARY NAMES avutil
PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_FFMPEG_LIBRARY AND EXISTS "${3RDPARTY_FFMPEG_LIBRARY}")
get_filename_component (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY}" PATH)
set (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY_DIR}" CACHE PATH "The directory containing FFmpeg library" FORCE)
else()
set (3RDPARTY_FFMPEG_LIBRARY_DIR "" CACHE PATH "The directory containing FFmpeg library" FORCE)
endif()
endif()
if (3RDPARTY_FFMPEG_LIBRARY_DIR AND EXISTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FFMPEG_LIBRARY_DIR)
set (3RDPARTY_FFMPEG_LIBRARY "" CACHE FILEPATH "The path to FFmpeg library" FORCE)
endif()
# shared library
if (WIN32)
if (NOT 3RDPARTY_FFMPEG_DLL OR NOT EXISTS "${3RDPARTY_FFMPEG_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
set (3RDPARTY_FFMPEG_DLL "3RDPARTY_FFMPEG_DLL-NOTFOUND" CACHE FILEPATH "The path to FFmpeg shared library" FORCE)
# find FFmpeg shared library
file (GLOB 3RDPARTY_FFMPEG_DLL "${3RDPARTY_FFMPEG_DIR}/bin/avutil[-][0-9]*")
if (3RDPARTY_FFMPEG_DLL AND EXISTS "${3RDPARTY_FFMPEG_DLL}")
set (3RDPARTY_FFMPEG_DLL "${3RDPARTY_FFMPEG_DLL}" CACHE FILEPATH "FFmpeg shared library" FORCE)
get_filename_component (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL}" PATH)
set (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL_DIR}" CACHE PATH "The directory containing FFmpeg library" FORCE)
else()
set (3RDPARTY_FFMPEG_DLL_DIR "" CACHE PATH "The directory containing FFmpeg shared library" FORCE)
endif()
endif()
if (3RDPARTY_FFMPEG_DLL_DIR OR EXISTS "${3RDPARTY_FFMPEG_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_FFMPEG_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FFMPEG_DLL_DIR)
endif()
endif()
# install instructions
if (INSTALL_FFMPEG)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (DEFINED INSTALL_BIN_DIR)
install (FILES "${3RDPARTY_FFMPEG_DLL}" DESTINATION "${INSTALL_BIN_DIR}")
else()
install (FILES "${3RDPARTY_FFMPEG_DLL}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (FILES "${3RDPARTY_FFMPEG_DLL}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (FILES "${3RDPARTY_FFMPEG_DLL}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
endif()
else()
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_ABS ${3RDPARTY_FFMPEG_LIBRARY} REALPATH)
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_NAME ${3RDPARTY_FFMPEG_LIBRARY} NAME)
if (DEFINED INSTALL_LIB_DIR)
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
DESTINATION "${INSTALL_LIB_DIR}"
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
else()
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
endif()
endif()
set (USED_3RDPARTY_FFMPEG_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_FFMPEG_DIR ${3RDPARTY_FFMPEG_DLL_DIR})
else()
set (USED_3RDPARTY_FFMPEG_DIR ${3RDPARTY_FFMPEG_LIBRARY_DIR})
endif()
endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET (FFMPEG_INCLUDE_DIRS)
OCCT_CHECK_AND_UNSET (FFMPEG_LIBRARY_DIRS)
OCCT_CHECK_AND_UNSET (FFMPEG_DIR)
mark_as_advanced (3RDPARTY_FFMPEG_LIBRARY 3RDPARTY_FFMPEG_DLL)

View File

@@ -24,13 +24,6 @@ else()
set (CSF_FREETYPE)
endif()
# FFmpeg
if (USE_FFMPEG)
set (CSF_FFmpeg "avcodec avformat swscale avutil")
else()
set (CSF_FFmpeg)
endif()
# FREEIMAGE
if (USE_FREEIMAGE)
set (CSF_FreeImagePlus "freeimage")

View File

@@ -316,7 +316,6 @@ if (BUILD_USE_PCH)
# workaround for old gcc
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
add_definitions("-D__STDC_FORMAT_MACROS")
endif()

View File

@@ -82,7 +82,6 @@ endmacro()
INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples")
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
INSTALL_MESSAGE (INSTALL_FFMPEG "FFmpeg binaries")
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
INSTALL_MESSAGE (INSTALL_EGL "EGL binaries")
INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries")
@@ -137,10 +136,6 @@ set (3RDPARTY_DIR_DESCR
third-party product have been found - corresponding CMake variables will be specified
(VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
set (USE_FFMPEG_DESCR
"Indicates whether FFmpeg framework is used or not. FFmpeg stands for
multimedia data handling, open-source software libraries used for video encoding and decoding.")
set (USE_FREEIMAGE_DESCR
"Indicates whether Freeimage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)")

View File

@@ -119,21 +119,6 @@ proc wokdep:SearchHeader {theHeader} {
if { [file exists "$aPath"] } {
return "$aPath"
}
if { "$::tcl_platform(os)" == "Linux" } {
if { "$::ARCH" == "64" } {
set aPath "/usr/include/x86_64-linux-gnu/${theHeader}"
if { [file exists "$aPath"] } {
return "$aPath"
}
} else {
set aPath "/usr/include/i386-linux-gnu/${theHeader}"
if { [file exists "$aPath"] } {
return "$aPath"
}
}
}
return ""
}

View File

@@ -26,7 +26,7 @@ set path [file normalize .]
set THE_CASROOT ""
set fBranch ""
if { [info exists ::env(CASROOT)] } {
set THE_CASROOT [file normalize "$::env(CASROOT)"]
set THE_CASROOT "$::env(CASROOT)"
}
proc _get_options { platform type branch } {
@@ -344,22 +344,6 @@ proc genproj {theFormat args} {
genAllResources
}
# copy file providing warning if the target file exists and has
# different date or size; if it is newer than source, save it as .bak
proc copy_with_warning {from to} {
if { [file exists "$to"] &&
([file size "$to"] != [file size "$from"] ||
[file mtime "$to"] != [file mtime "$from"]) } {
puts "Warning: file $to is updated (copied from $from)!"
if { [file mtime $to] > [file mtime $from] } {
puts "Info: old content of file $to is saved in ${to}.bak"
file copy -force -- "$to" "${to}.bak"
}
}
file copy -force -- "$from" "$to"
}
proc genprojbat {theFormat thePlatform} {
set aTargetPlatformExt sh
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
@@ -385,11 +369,11 @@ proc genprojbat {theFormat thePlatform} {
close $anEnvFile
}
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
file copy -force -- "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
}
if { [regexp {^vc} $theFormat] } {
copy_with_warning "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
file copy -force -- "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
} else {
switch -exact -- "$theFormat" {
"cbp" {

View File

@@ -1,31 +0,0 @@
@echo off
rem Script to diff SVG images visually (as PNG) in TortoiseGit client
rem
rem It assumes that Inkscape and TortoiseGitIDiff executables are either
rem installed in default locations in Program Files, or are accessible by PATH
rem
rem To use this script for diffing SVG images, open TortoiseGit settings
rem (Start -> Programs -> TortoiseGit -> Settings), select "Diff Viewer",
rem click button "Advanced..." on the right tab and then add new record:
rem - Extension: .svg
rem - External program: <path to OCCT>\adm\svgdiff.bat %base %mine %bname %yname
rem Remove double quotes around arguments
set "f1=%1"
set "f2=%2"
set "f1=%f1:~1,-1%.png"
set "f2=%f2:~1,-1%.png"
rem Check if Inkscape and TortoiseGit are installed in default locations in
rem ProgramFiles; if not, assume they still may be accessible by PATH
set "inkscape=%ProgramFiles%\Inkscape\inkscape.exe"
if not exist "%inkscape%" set inkscape=inkscape.exe
set "tgitidiff=%ProgramFiles%\TortoiseGit\bin\TortoiseGitIDiff.exe"
if not exist "%tgitidiff%" set tgitidiff=TortoiseGitIDiff.exe
rem Convert SVG to PNG using Inkscape
"%inkscape%" -e "%f1%" %1
"%inkscape%" -e "%f2%" %2
rem Call Tortoise differ
"%tgitidiff%" /left:"%f1%" /right:"%f2%" /lefttitle:%3 /righttitle:%4

View File

@@ -61,7 +61,6 @@ set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
set (OpenCASCADE_WITH_TBB @USE_TBB@)
set (OpenCASCADE_WITH_VTK @USE_VTK@)
set (OpenCASCADE_WITH_FFMPEG @USE_FFMPEG@)
set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
@SET_OpenCASCADE_WITH_D3D@
@SET_OpenCASCADE_WITH_GLX@

View File

@@ -14,7 +14,6 @@ if /I "%VCVER%" == "@COMPILER@" (
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIRS@"
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
set "FFMPEG_DIR=@3RDPARTY_FFMPEG_DLL_DIR@"
if not "@3RDPARTY_QT_DIR@" == "" (
set "QTDIR=@3RDPARTY_QT_DIR@"

View File

@@ -12,7 +12,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIRS@"
export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
export FFMPEG_DIR="@3RDPARTY_FFMPEG_LIBRARY_DIR@"
if [ "x@3RDPARTY_QT_DIR" != "x" ]; then
export QTDIR="@3RDPARTY_QT_DIR@"

View File

@@ -16,7 +16,6 @@ if /I "%VCVER%" == "@COMPILER@" (
set "GL2PS_DIR=@USED_3RDPARTY_GL2PS_DIRS@"
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
set "FFMPEG_DIR=@USED_3RDPARTY_FFMPEG_DIR@"
if not "@USED_3RDPARTY_QT_DIR@" == "" (
set "QTDIR=@USED_3RDPARTY_QT_DIR@"

View File

@@ -12,7 +12,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIRS@"
export TBB_DIR="@USED_3RDPARTY_TBB_DIR@"
export VTK_DIR="@USED_3RDPARTY_VTK_DIR@"
export FFMPEG_DIR="@USED_3RDPARTY_FFMPEG_DIR@"
if [ "x@USED_3RDPARTY_QT_DIR@" != "x" ]; then
export QTDIR="@USED_3RDPARTY_QT_DIR@"

View File

@@ -115,7 +115,6 @@ if not ["%GLES2_DIR%"] == [""] set "PATH=%GLES2_DIR%;%PATH%"
if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
if not ["%FFMPEG_DIR%"] == [""] set "PATH=%FFMPEG_DIR%;%PATH%"
if not ["%QTDIR%"] == [""] set "PATH=%QTDIR%/bin;%PATH%"
rem ----- Set path to 3rd party and OCCT libraries -----

View File

@@ -66,10 +66,6 @@ if [ "$VTK_DIR" != "" ]; then
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
fi
if [ "$FFMPEG_DIR" != "" ]; then
THRDPARTY_PATH="${FFMPEG_DIR}:${THRDPARTY_PATH}"
fi
if [ "$QTDIR" != "" ]; then
THRDPARTY_PATH="${QTDIR}/lib:${THRDPARTY_PATH}"
fi

View File

@@ -110,7 +110,6 @@
<ProgramDatabaseFile>.\..\..\..\win32\__VCVER__\bin\__XQTNAM__.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\..\..\win32\__VCVER__\lib\__XQTNAM__.lib</ImportLibrary>
<AdditionalOptions>/LARGEADDRESSAWARE %(AdditionalOptions)</AdditionalOptions>
__VCLNKREL__
</Link>
</ItemDefinitionGroup>
@@ -156,7 +155,6 @@
<ProgramDatabaseFile>..\..\..\win32\__VCVER__\bind\__XQTNAM__.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\..\..\win32\__VCVER__\libd\__XQTNAM__.lib</ImportLibrary>
<AdditionalOptions>/LARGEADDRESSAWARE %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@@ -56,6 +56,6 @@ To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~~
./draw.sh cbp [d]
./draw_cbp.sh cbp [d]
~~~~~
Option *d* is used if OCCT has been built in **Debug** mode.

View File

@@ -82,7 +82,7 @@ The official repository contains:
@subsection occt_gitguide_1_5 Version of Git
The repository is tested to work with Git 1.7.6 and above.
The repository is tested to work with Git 1.7.6 to 1.7.9.
Please do not use versions below 1.7.1 as they are known to cause troubles.
@section occt_gitguide_2 Installing Tools for Work with Git
@@ -139,13 +139,6 @@ The official repository contains:
@figure{OCCT_GitGuide_V2_image006.png,"",320}
Optionally, you can set up TortoiseGit to use visual diff utility for SVG images used in OCCT documentation.
For that, click on item "Diff Viewer" in the Settings dialog, then click button "Advanced..." on the right tab add new record with the following parameters:
- Extension: <code>.svg</code>
- External program: <code>&lt;path_to_OCCT&gt;\\adm\\svgdiff.bat %%base %%mine %%bname %%yname</code>
@figure{OCCT_GitGuide_V2_svgdiff.png,"",709}
@subsection occt_gitguide_2_2 Linux platform
We assume that Linux users have Git already installed and available in the *PATH*.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -324,15 +324,6 @@ The methods *V3d_View::Convert* and *V3d_View::ConvertWithProj()* have ceased to
Porting of user applications from an earlier OCCT version to version 7.0.0 requires taking into account the following major changes.
Building OCCT now requires compiler supporting some C++11 features.
The supported compilers are:
- MSVC: version 10 (Visual Studio 2010) or later
- GCC: version 4.3 or later
- CLang: version 3.6 or later
- ICC: version XE 2013 SP 1 or later
When compiling code that uses OCCT with GCC and CLang compilers, it is necessary to use compiler option -std=c++0x (or its siblings) to enable C++11 features.
@subsection upgrade_700_persist Removal of legacy persistence
Legacy persistence for shapes and OCAF data based on *Storage_Schema* (toolkits *TKPShape*, *TKPLCAF*, *TKPCAF*, *TKShapeShcema, TLStdLSchema, TKStdSchema*, and *TKXCAFSchema*) has been removed in OCCT 7.0.0.
@@ -1204,9 +1195,6 @@ Management of highlight attributes has been revised and might require modificati
it is now possible to customize default highlight attributes like *Display Mode* and *ZLayer*, which previously could be defined only on Object level.
* Properties *Prs3d_Drawer::HighlightStyle()* and *Prs3d_Drawer::SelectionStyle()* have been removed.
Instead, *AIS_InteractiveObject* now defines *DynamicHilightAttributes()* for dynamic highlighting in addition to *HilightAttributes()* used for highlighting in selected state.
Note that *AIS_InteractiveObject::HilightAttributes()* and *AIS_InteractiveObject::DynamicHilightAttributes()* override highlighting properties for both - entire object and for part coming from decomposition.
This includes Z-layer settings, which will be the same when overriding properties through AIS_InteractiveObject, while *AIS_InteractiveContext::HighlightStyle()* allows customizing properties for local and global selection independently
(with Graphic3d_ZLayerId_Top used for dynamic highlighting of entire object and Graphic3d_ZLayerId_Topmost for dynamic highlighting of object part by default).
* The following protected fields have been removed from class *AIS_InteractiveObject*:
- *myOwnColor*, replaced by *myDrawer->Color()*
- *myTransparency*, replaced by *myDrawer->Transparency()*
@@ -1418,14 +1406,3 @@ In previous versions, *IsPeriodic()* always returned false if *IsClosed()* retur
The history of the changing of the initial shape was corrected:
* all shapes created by the algorithm are considered as modified shapes instead of generated ones;
* method Generated was removed and its calls should be replaced by calls of method History()->Modified.
@subsection upgrade_720_Change_In_RWStl Changes in STL Reader / Writer
Class RWStl now uses class Poly_Triangulation for storing triangular mesh instead of StlMesh data classes; the latter have been removed.
@subsection upgrade_720_New_Error_Warning_system_in_BOA Refactoring of the Error/Warning reporting system in Boolean Component
The Error/Warning reporting system of the algorithms in Boolean Component (in all BOPAlgo_* and BRepAlgoAPI_* algorithms) has been refactored.
The methods returning the status of errors and warnings of the algorithms (ErrorStatus() and WarningStatus()) have been removed.
Instead use methods HasErrors() and HasWarnings() to check for presence of errors and warnings, respectively.
The full list of errors and warnings, with associated data such as problematic sub-shapes, can be obtained by method GetReport().

View File

@@ -135,9 +135,6 @@ by fully automating techniques as precompiled header usage and single compilatio
Cotire is included in OCCT repository and used optionally by OCCT CMake scripts to accelerate builds by use of precompiled headers.
Cotire is licensed under the MIT license (https://github.com/sakra/cotire/blob/master/license).
**FFmpeg** is an Open Source framework supporting various image, video and audio codecs.
FFmpeg is optionally used by OCCT for video recording, on LGPL conditions (https://www.ffmpeg.org/legal.html).
**MikTEX** is up-to-date implementation of TeX/LaTeX and related programs for Windows. It is used
for generation of User and Developer Guides in PDF format. See https://miktex.org for information
on this tool.
@@ -213,7 +210,6 @@ for which OCCT is certified to work.
| TCL (for testing tools) | Tcl/Tk 8.6.3+ http://www.tcl.tk/software/tcltk/download.html <br> or ActiveTcl 8.6 http://www.activestate.com/activetcl/downloads (for Windows)|
| Freetype (for text rendering) | FreeType 2.4.11-2.5.5 http://sourceforge.net/projects/freetype/files/ |
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.17.0+ http://sourceforge.net/projects/freeimage/files |
| FFmpeg (optional, for video recording) | FFmpeg 3.1+ https://www.ffmpeg.org |
| gl2ps (optional, for export contents of OCCT viewer to vector formats) | gl2ps-1.3.8+ http://geuz.org/gl2ps/ |
| Intel TBB (optional, for multithreaded algorithms) | TBB 4.x or 5.x http://www.threadingbuildingblocks.org/ |
| VTK (for VTK Integration Services | VTK 6.1+ http://www.vtk.org/VTK/resources/software.html |

View File

@@ -540,23 +540,6 @@ The structure *BOPDS_FaceInfo* has the following contents.
The objects of type *BOPDS_FaceInfo* are stored in one container of array type. The array allows getting the access to the information by index. This index (if exists) is stored in the field *myReference*.
@section occt_algorithms_root_classes Root Classes
@subsection occt_algorithms_root_classes_1 Class BOPAlgo_Options
The class *BOPAlgo_Options* provides the following options for the algorithms:
* Set the appropriate memory allocator;
* Check the presence of the Errors and Warnings;
* Turn on/off the parallel processing;
* Set the additional tolerance for the operation;
* Break the operations by user request.
@subsection occt_algorithms_root_classes_2 Class BOPAlgo_Algo
The class *BOPAlgo_Algo* provides the base interface for all algorithms:
* Perform the operation;
* Check the input data;
* Check the result.
@section occt_algorithms_5 Intersection Part
Intersection Part (IP) is used to
@@ -570,7 +553,17 @@ Intersection Part (IP) is used to
IP is implemented in the class *BOPAlgo_PaveFiller*.
@figure{/user_guides/boolean_operations/images/operations_image064.png,"Diagram for Class BOPAlgo_PaveFiller",230}
@figure{/user_guides/boolean_operations/images/operations_image064.svg,"Diagram for Class BOPAlgo_PaveFiller",230}
@subsection occt_algorithms_5_1a Class BOPAlgo_Algo
The class *BOPAlgo_Algo* provides the base interface for all algorithms to provide the possibility to:
* Get Error status;
* Get Warning status;
* Turn on/off the parallel processing
* Break the operations by user request
* Check data;
* Check the result;
* Set the appropriate memory allocator.
The description provided in the next paragraphs is coherent with the implementation of the method *BOPAlgo_PaveFiller::Perform()*.
@@ -752,11 +745,8 @@ BP is implemented in the following classes:
* *BOPAlgo_Builder* -- for the General Fuse operator (GFA).
* *BOPAlgo_BOP* -- for the Boolean Operation operator (BOA).
* *BOPAlgo_Section* -- for the Section operator (SA).
* *BOPAlgo_MakerVolume* -- for the Volume Maker operator.
* *BOPAlgo_Splitter* -- for the Splitter operator.
* *BOPAlgo_CellsBuilder* -- for the Cells Builder operator.
@figure{/user_guides/boolean_operations/images/operations_image020.png,"Diagram for BP classes",300}
@figure{/user_guides/boolean_operations/images/operations_image020.svg,"Diagram for BP classes",300}
The class *BOPAlgo_BuilderShape* provides the interface for algorithms that have:
* A Shape as the result;
@@ -1098,7 +1088,7 @@ aSplitter.SetNonDestructive(bSafeMode);
aSplitter.SetGlue(aGlue);
//
aSplitter.Perform(); //perform the operation
if (aSplitter.HasErrors()) { //check error status
if (aSplitter.ErrorStatus()) { //check error status
return;
}
//
@@ -2071,7 +2061,7 @@ aMV.SetGlue(aGlue);
aMV.SetAvoidInternalShapes(bAvoidInternalShapes);
//
aMV.Perform(); //perform the operation
if (aMV.HasErrors()) { //check error status
if (aMV.ErrorStatus()) { //check error status
return;
}
//
@@ -2161,7 +2151,7 @@ aCBuilder.SetNonDestructive(bSafeMode);
aCBuilder.SetGlue(aGlue);
//
aCBuilder.Perform(); // build splits of all arguments (GF)
if (aCBuilder.HasErrors()) { // check error status
if (aCBuilder.ErrorStatus()) { // check error status
return;
}
//
@@ -2814,6 +2804,7 @@ The following example illustrates how to use General Fuse operator:
#include <BRepAlgoAPI_BuilderAlgo.hxx>
{…
Standard_Boolean bRunParallel;
Standard_Integer iErr;
Standard_Real aFuzzyValue;
BRepAlgoAPI_BuilderAlgo aBuilder;
//
@@ -2850,7 +2841,8 @@ The following example illustrates how to use General Fuse operator:
//
// run the algorithm
aBuilder.Build();
if (aBuilder.HasErrors()) {
iErr=aBuilder.ErrorStatus();
if (iErr) {
// an error treatment
return;
}
@@ -2953,7 +2945,7 @@ aSplitter.SetGlue(aGlueOpt);
// run the algorithm
aSplitter.Build();
// check error status
if (aSplitter.HasErrors()) {
if (aSplitter.ErrorStatus()) {
return;
}
//
@@ -3020,6 +3012,7 @@ The following example illustrates how to use Common operation:
#include < BRepAlgoAPI_Common.hxx>
{…
Standard_Boolean bRunParallel;
Standard_Integer iErr;
Standard_Real aFuzzyValue;
BRepAlgoAPI_Common aBuilder;
@@ -3059,7 +3052,8 @@ The following example illustrates how to use Common operation:
//
// run the algorithm
aBuilder.Build();
if (aBuilder.HasErrors()) {
iErr=aBuilder.ErrorStatus();
if (iErr) {
// an error treatment
return;
}
@@ -3125,6 +3119,7 @@ The following example illustrates how to use Fuse operation:
#include < BRepAlgoAPI_Fuse.hxx>
{…
Standard_Boolean bRunParallel;
Standard_Integer iErr;
Standard_Real aFuzzyValue;
BRepAlgoAPI_Fuse aBuilder;
@@ -3164,7 +3159,8 @@ The following example illustrates how to use Fuse operation:
//
// run the algorithm
aBuilder.Build();
if (aBuilder.HasErrors()) {
iErr=aBuilder.ErrorStatus();
if (iErr) {
// an error treatment
return;
}
@@ -3230,6 +3226,7 @@ The following example illustrates how to use Cut operation:
#include < BRepAlgoAPI_Cut.hxx>
{…
Standard_Boolean bRunParallel;
Standard_Integer iErr;
Standard_Real aFuzzyValue;
BRepAlgoAPI_Cut aBuilder;
@@ -3269,7 +3266,8 @@ The following example illustrates how to use Cut operation:
//
// run the algorithm
aBuilder.Build();
if (aBuilder.HasErrors()) {
iErr=aBuilder.ErrorStatus();
if (iErr) {
// an error treatment
return;
}
@@ -3336,6 +3334,7 @@ The following example illustrates how to use Section operation:
#include < BRepAlgoAPI_Section.hxx>
{…
Standard_Boolean bRunParallel;
Standard_Integer iErr;
Standard_Real aFuzzyValue;
BRepAlgoAPI_Section aBuilder;
@@ -3375,7 +3374,8 @@ The following example illustrates how to use Section operation:
//
// run the algorithm
aBuilder.Build();
if (aBuilder.HasErrors()) {
iErr=aBuilder.ErrorStatus();
if (iErr) {
// an error treatment
return;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,296 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="488.59842"
height="239.24245"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="operations_image020.svg">
<defs
id="defs4">
<marker
inkscape:stockid="Arrow2Lstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow2Lstart"
style="overflow:visible">
<path
id="path7116"
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(1.1) translate(1,0)" />
</marker>
<marker
inkscape:stockid="Arrow2Mend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow2Mend"
style="overflow:visible;">
<path
id="path7125"
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(0.6) rotate(180) translate(0,0)" />
</marker>
<clipPath
id="clipEmfPath1"
clipPathUnits="userSpaceOnUse">
<rect
id="rect2990"
height="19.040462"
width="177.28004"
y="73.463196"
x="191.21669" />
</clipPath>
<clipPath
id="clipEmfPath2"
clipPathUnits="userSpaceOnUse">
<rect
id="rect2993"
height="19.040462"
width="176.83047"
y="12.743616"
x="192.41554" />
</clipPath>
<clipPath
id="clipEmfPath3"
clipPathUnits="userSpaceOnUse">
<rect
id="rect2996"
height="18.890537"
width="177.28004"
y="133.13332"
x="191.21669" />
</clipPath>
<clipPath
id="clipEmfPath4"
clipPathUnits="userSpaceOnUse">
<rect
id="rect2999"
height="18.890537"
width="149.10706"
y="204.34763"
x="130.52487" />
</clipPath>
<clipPath
id="clipEmfPath5"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3002"
height="18.890537"
width="148.9572"
y="204.34763"
x="292.81927" />
</clipPath>
<marker
inkscape:stockid="Arrow2Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow2Lstart-3"
style="overflow:visible">
<path
inkscape:connector-curvature="0"
id="path7116-4"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="matrix(1.1,0,0,1.1,1.1,0)" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.1979709"
inkscape:cx="318.63273"
inkscape:cy="137.81983"
inkscape:document-units="px"
inkscape:current-layer="g3004"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1670"
inkscape:window-height="723"
inkscape:window-x="42"
inkscape:window-y="158"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-153.88697,-412.74096)">
<g
id="g3004"
transform="translate(153.4374,405.50687)">
<text
id="text3006"
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
y="246.47653"
x="0.44956902"
xml:space="preserve"> </text>
<path
id="path3008"
d="m 279.61319,66.547912 -0.0468,-23.360172 c -0.009,-0.346702 0.27162,-0.627811 0.61816,-0.627811 0.34654,0 0.62752,0.281109 0.62752,0.61844 l 0.0468,23.369543 c 0,0.337331 -0.28098,0.61844 -0.61815,0.61844 -0.34655,0.0094 -0.62753,-0.271738 -0.62753,-0.61844 z m -3.17508,-22.104551 3.73704,-7.505615 3.75578,7.486874 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.14985634px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path3010"
d="m 281.04619,126.53661 -0.59005,-22.61992 c 0,-0.3467 0.27161,-0.62781 0.60879,-0.63718 0.34654,-0.009 0.63689,0.26237 0.64625,0.60907 l 0.5807,22.61055 c 0.009,0.3467 -0.26225,0.62781 -0.59943,0.63718 -0.34654,0.009 -0.63689,-0.26237 -0.64626,-0.5997 z m -3.67148,-21.28933 3.54973,-7.589952 3.93373,7.393172 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.14985634px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path3016"
d="m 190.63599,68.421973 0,28.916764 178.32904,0 0,-28.916764 -178.32904,0 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path3018"
d="m 190.647,68.432978 0,28.894754 186.95136,0 0,-28.894754 z"
style="fill:none;stroke:#000000;stroke-width:0.95861244px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3020"
style="font-size:13.68622589px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="84.089729"
x="203.04033"
xml:space="preserve"
transform="scale(0.99270628,1.0073473)">BOPAlgo_BuilderShape</text>
<text
id="text3024"
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="102.69855"
x="283.97775"
xml:space="preserve"> </text>
<path
id="path3026"
d="m 191.75992,7.7023914 0,28.9167636 177.9544,0 0,-28.9167636 -177.9544,0 z"
clip-path="url(#clipEmfPath1)"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path3028"
d="m 191.7698,7.7122711 0,28.8970039 185.66905,0 0,-28.8970039 z"
style="fill:none;stroke:#000000;stroke-width:0.95636153px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3030"
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="23.987984"
x="231.37817"
xml:space="preserve">BOPAlgo_Algo</text>
<text
id="text3032"
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="23.987984"
x="330.28336"
xml:space="preserve"> </text>
<path
id="path3034"
d="m 190.63599,128.01712 0,28.91676 178.32904,0 0,-28.91676 -178.32904,0 z"
clip-path="url(#clipEmfPath2)"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path3036"
d="m 190.64871,128.02984 0,28.89132 188.31283,0 0,-28.89132 z"
style="fill:none;stroke:#000000;stroke-width:0.96203959px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3038"
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="144.37767"
x="218.04097"
xml:space="preserve">BOPAlgo_Builder</text>
<text
id="text3040"
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="144.37767"
x="341.67245"
xml:space="preserve"> </text>
<path
id="path3042"
d="m 129.94418,199.23144 0,28.91677 150.04365,0 0,-28.91677 -150.04365,0 z"
clip-path="url(#clipEmfPath3)"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" />
<text
id="text3050"
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="233.43306"
x="213.24557"
xml:space="preserve"> </text>
<path
id="path3052"
d="m 292.16366,199.23144 0,28.91677 150.04366,0 0,-28.91677 -150.04366,0 z"
clip-path="url(#clipEmfPath4)"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path3054"
d="m 67.466014,185.63759 0,28.80655 188.150506,0 0,-28.80655 z"
style="fill:none;stroke:#000000;stroke-width:1.04681468px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3056"
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="204.21788"
x="124.58641"
xml:space="preserve">BOPAlgo_BOP</text>
<text
id="text3058"
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="215.592"
x="412.70435"
xml:space="preserve"> </text>
<path
id="path3054-8"
d="m 300.37408,185.70141 0,28.80655 188.1505,0 0,-28.80655 z"
style="fill:none;stroke:#000000;stroke-width:1.04681468px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3056-9"
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="203.31017"
x="336.76245"
xml:space="preserve">BOPAlgo_Section</text>
<path
style="fill:none;stroke:#000000;stroke-width:0.95747238px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Lstart);marker-end:none"
d="m 267.10914,158.63892 -77.87032,26.89356"
id="path13459"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.88220716px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Lstart);marker-end:none"
d="m 316.41379,158.50756 65.91804,26.97147"
id="path13459-4"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="500.70731"
height="102.98"
id="svg3731"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="operations_image064.svg">
<defs
id="defs3733">
<marker
inkscape:stockid="Arrow2Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mstart"
style="overflow:visible">
<path
id="path4673"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(0.6,0.6)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible">
<path
id="path4649"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
<clipPath
id="clipEmfPath1"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3744"
height="157.5"
width="566.85828"
y="0"
x="0" />
</clipPath>
<clipPath
id="clipEmfPath2"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3747"
height="15"
width="134.10196"
y="14.7"
x="215.55315" />
</clipPath>
<clipPath
id="clipEmfPath3"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3750"
height="13.95"
width="158.85233"
y="118.5"
x="53.850784" />
</clipPath>
<clipPath
id="clipEmfPath4"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3753"
height="15"
width="189.90277"
y="68.849998"
x="185.10271" />
</clipPath>
<clipPath
id="clipEmfPath5"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3756"
height="13.95"
width="180.15263"
y="118.2"
x="315.3046" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.7435336"
inkscape:cx="250.35365"
inkscape:cy="74.48907"
inkscape:document-units="px"
inkscape:current-layer="g3758"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1037"
inkscape:window-height="615"
inkscape:window-x="38"
inkscape:window-y="209"
inkscape:window-maximized="0" />
<metadata
id="metadata3736">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(204.63937,-395.29983)">
<g
id="g3758"
transform="translate(-262.09021,339.42982)">
<text
id="text3760"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
y="142.64999"
x="558.15814"
xml:space="preserve"> </text>
<path
id="path3762"
d="m 214.87814,10.5 0,23.4375 135.43322,0 0,-23.4375 z"
clip-path="url(#clipEmfPath1)"
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
transform="translate(-1.4412873,56.78124)" />
<text
id="text3764"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="80.110596"
x="236.44154"
xml:space="preserve">BOPAlgo_Algo</text>
<text
id="text3766"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="25.049999"
x="327.60477"
xml:space="preserve"> </text>
<path
id="path3768"
d="m 53.175776,114.3 0,22.37812 160.127334,0 0,-22.37812 z"
clip-path="url(#clipEmfPath2)"
style="fill:none;stroke:#000000;stroke-width:1.24689317px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3772"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="128.85001"
x="204.603"
xml:space="preserve"> </text>
<text
id="text3774"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
y="158.85001"
x="57.45084"
xml:space="preserve"> </text>
<path
id="path3776"
d="m 280.56035,62.94375 -0.59064,-22.621875 c -0.009,-0.346875 0.26251,-0.6375 0.60939,-0.646875 0.34688,-0.0094 0.62813,0.2625 0.63751,0.609375 l 0.59063,22.63125 c 0.009,0.346875 -0.2625,0.628125 -0.60938,0.6375 -0.34688,0.0094 -0.62814,-0.2625 -0.63751,-0.609375 z m -3.68443,-21.290625 3.55317,-7.603125 3.94694,7.40625 z"
clip-path="url(#clipEmfPath3)"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.1500022px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path3778"
d="m 185.00124,121.96729 0,23.4375 191.2528,0 0,-23.4375 z"
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3780"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="135.98123"
x="213.3766"
xml:space="preserve">BOPAlgo_PaveFiller</text>
<text
id="text3782"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="79.199997"
x="351.30511"
xml:space="preserve"> </text>
<text
id="text3784"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="108.3"
x="188.70276"
xml:space="preserve"> </text>
<path
id="path3786"
d="m 198.98728,113.10938 20.70968,-20.700005 c 0.24375,-0.24375 0.63751,-0.24375 0.88126,0 0.24375,0.24375 0.24375,0.6375 0,0.88125 L 199.87792,114 c -0.24376,0.24375 -0.64689,0.24375 -0.89064,0 -0.24375,-0.24375 -0.24375,-0.64688 0,-0.89062 z m 17.61588,-22.031255 7.95012,-2.653125 -2.64379,7.959375 z"
clip-path="url(#clipEmfPath4)"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.1500022px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3794"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="128.55"
x="480.30701"
xml:space="preserve"> </text>
<text
id="text3796"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
y="158.39999"
x="318.75464"
xml:space="preserve"> </text>
<path
style="fill:#916f6f;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Mstart)"
d="m 281.70806,91.744904 0,30.398036"
id="path3875"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -6271,51 +6271,41 @@ bsplineprof res
@subsubsection occt_draw_7_2_6 mkoffset
**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurrences is not limited.
The offset distance defines the spacing and the positioning of the occurrences.
Syntax:
~~~~~
mkoffset result shape nboffset stepoffset [jointype(a/i) [alt]]
mkoffset result face/compound of wires nboffset stepoffset
~~~~~
where:
* *result* - the base name for the resulting wires. The index of the occurrence (starting with 1) will be added to this name, so the resulting wires will have the names - *result_1*, *result_2* ...;
* *shape* - input shape (face or compound of wires);
* *nboffset* - the number of the parallel occurrences;
* *stepoffset* - offset distance between occurrences;
* *jointype(a/i)* - join type (a for *arc* (default) and i for *intersection*);
* *alt* - altitude from the plane of the input face in relation to the normal to the face.
**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
The offset distance defines the spacing and the positioning of the occurences.
**Example:**
~~~~~
# Create a box and select a face
#Create a box and select a face
box b 1 2 3
explode b f
# Create three exterior parallel contours with an offset value of 2
#Create three exterior parallel contours with an offset
value of 2
mkoffset r b_1 3 2
# wires r_1, r_2 and r_3 are created
# Create three exterior parallel contours with an offset value of 2 without round corners
mkoffset r b_1 3 2 i
# wires r_1, r_2 and r_3 are created
# Create one interior parallel contour with an offset value of 0.4
Create one interior parallel contour with an offset
value of
0.4
mkoffset r b_1 1 -0.4
~~~~~
**Note** that on a concave input contour for an interior step *mkoffset* command may produce several wires which will be contained in a single compound.
**Note** that *mkoffset* command must be used with prudence, as angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused.
**Example:**
~~~~~
# to create the example contour
profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w
# creates an incoherent interior offset
# to create an incoherent interior offset
mkoffset r p 1 -0.50
==p is not a FACE but a WIRE
BRepFill_TrimEdgeTool: incoherent intersection
# to create two incoherent wires
mkoffset r p 1 -0.50
# creates two incoherent wires
mkoffset r p 1 -0.55
# r_1 is a compound of two wires
~~~~~
@subsubsection occt_draw_7_2_7 mkplane, mkface

View File

@@ -1508,8 +1508,8 @@ Such an object, for example, can be used for displaying the object and stored in
~~~~~
// read the data and create a data source
Handle(Poly_Triangulation) aSTLMesh = RWStl::ReadFile (aFileName);
Handle(XSDRAWSTLVRML_DataSource) aDataSource = new XSDRAWSTLVRML_DataSource (aSTLMesh);
Handle (StlMesh_Mesh) aSTLMesh = RWStl::ReadFile (aFileName);
Handle (XSDRAWSTLVRML_DataSource) aDataSource = new XSDRAWSTLVRML_DataSource (aSTLMesh);
// create mesh
Handle (MeshVS_Mesh) aMesh = new MeshVS();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -5,116 +5,32 @@
@section occt_xde_1 Introduction
For hierarchically organizing engineering data, OCCT provides application framework (OCAF). A specialization of OCAF for representing CAD product information is XDE (eXtended Data Exchange) toolset. XDE is capable of associating geometry with metadata (PMI, names, colors, layers, etc.). This framework uses the component-level abstraction of an assembly (see \ref occt_xde_references_ShahMantyla95 "[Shah and Mantyla 1995]" for the overview of possible abstractions). The leaf nodes in the XDE hierarchy are the _part instances_. The interior nodes are the _subassemblies_. The root node represents the _entire assembly_ (several roots are allowed).
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.
@figure{/user_guides/xde/images/646_xde_11_400.png,"Shape imported using XDE (courtesy of Dave Goetsch via GrabCAD).",240}
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.
Data types such as colors, layers, assembly descriptions and validation properties (i.e. center of gravity, etc.) are supported. These data are stored together with shapes in an XCAF document. It is also possible to add a new types of data taking the existing tools as prototypes.
Finally, the XDE provides reader and writer tools for reading and writing the data supported by XCAF to and from IGES and STEP files.
@figure{/user_guides/xde/images/646_xde_11_400.png,"Shape imported using XDE",240}
The XDE component requires @ref occt_user_guides__shape_healing "Shape Healing" toolkit for operation.
@subsection occt_xde_1_1 Basic terms
We use the following terminology throughout this documentation:
* **Assembly:** a hierarchy of elements representing a complex product.
* **Subassembly:** a group of elements inside an assembly. Typically, a subassembly is a set of components that are physically assembled into a unit and then assembled with other components.
* **Part:** a piece of data representing a simple individual product.
* **Instance:** a *usage occurrence* of a part or a subassembly. An instance is usually mounted to a parent component by specifying relative transformation. It should be noted that whenever term "instance" is used, it may refer to either a part or a subassembly. When an individual part is mentioned, we use a more precise "part instance" term.
* **Assembly item:** any element in the component hierarchy of an assembly. If visualization is employed, an assembly item typically corresponds to an element in a scene graph.
* **Component:** any *nested* assembly item.
The key terms are illustrated in the figure below.
@figure{/user_guides/xde/images/xde_assembly_design.png,"Parts and instances.",240}
The example above assumes that two parts (a plate and a cylinder) are created independently in some part design system. Then an assembly is constructed by instantiating these parts with some user-defined mutual placements (probably driven by assembly constraints). In this example, the root assembly item "MyAssembly" contains the following components:
* "Plate" as the only instance of the plate part.
* "Cylinders" as the subassembly which includes three instances of a cylinder part.
A CAD part in a design system has usually no link to other parts in a product unless it is dropped to an assembly structure. To become an assembly component, the part has to be instantiated. An instance is technically a reference to the part with a proper location. The distinction between *parts* and *instances* is one of the fundamental principles in assembly design. A single part may have multiple instances all sharing the same product information (geometry and metadata). It is also valid to associate metadata with the instances themselves, though the latter is not very common (and not fully supported in OCCT).
\note The important point is the distinction between parts and instances. A part is a single product which may several times occur in an assembly. An instance is a particular occurrence of a part in an assembly.
For better understanding of XDE, certain key terms are defined:
* **Shape** -- a standalone shape, which does not belong to the assembly structure.
* **Instance** -- a replication of another shape with a location that can be the same location or a different one.
* **Assembly** -- a construction that is either a root or a sub-assembly.
@subsection occt_xde_1_2 XDE Organization
@subsubsection occt_xde_1_2_1 Assemblies
The basis of XDE, called XCAF, is a framework based on OCAF (Open CASCADE Technology Application Framework) and is intended to be used with assemblies and with various kinds of attached data (attributes). Attributes can be Individual attributes for a shape, specifying some characteristics of a shape, or they can be Grouping attributes, specifying that a shape belongs to a given group whose definition is specified apart from the shapes.
Assembly components are represented as nodes in a directed graph. The arcs of the graph represent "part-of" relations between the components (read like "component A is part of component B"). The following figure illustrates a conventional assembly from \ref occt_xde_references_cax_if "[CAx-IF STEP Library]" composed of five unique parts.
XDE works in an OCAF document with a specific organization defined in a dedicated XCAF module. This organization is used by various functions of XDE to exchange standardized data other than shapes and geometry.
@figure{/user_guides/xde/images/xde_as1.png,"Sample assembly.",240}
Each part is defined in its local coordinate system and dropped to an assembly with a suitable placement. As such, the bolt has six instances, while a nut is instantiated eight times.
@figure{/user_guides/xde/images/xde_as1_parts.png,"Parts of sample assembly.",240}
The "part-of" graph is sketched in the following figure.
@figure{/user_guides/xde/images/xde_as1_part_of_graph.png,"\"Part-of\" assembly graph.",240}
There are as many component occurrences in an assembly as many paths exist to each leaf from the root nodes. Starting from the root node "as1", 18 unique ways are giving the total number of part occurrences in the component structure.
Technically, each node of the graph is represented by a label in the underlying OCAF structure. However, an OCAF label (TDF_Label) cannot be used as an identifier of an assembly item. In general case, one label can be reached from several "directions" of traversal. Thus, to address a single component occurrence unambiguously, one should use a full path to the occurrence in a component graph as an identifier. The following figure illustrates the result of assembly graph traversal which can be represented as a user-friendly tree (scene graph).
@figure{/user_guides/xde/images/xde_as1_part_of_tree.png,"\"Part-of\" assembly tree.",240}
Such a tree stands for the hierarchy of the components which can be shown to the user. A child-parent relation has "part-of" meaning. Notice that an individual node in the assembly tree is associated with a unique path to the item in the component graph. The following figure illustrates a simple bracket subassembly which is used twice as a component in the sample model.
@figure{/user_guides/xde/images/xde_as1_bracket_subassembly.png,"Bracket subassembly instantiated twice in sample model.",240}
The following figure outlines the component graph for this subassembly.
@figure{/user_guides/xde/images/xde_as1_bracket_subassembly_graph.png,"\"Part-of\" graph for bracket subassembly.",240}
Assembly structure is not directly related to any geometry. Therefore, assembly structure gives only a conceptual view of a product. According to \ref occt_xde_references_ShahMantyla95 "[Shah and Mantyla 1995]" (p. 9), many design tasks are not related to geometry at all, but to other characteristics of a product. Some problems involve idealized or simplified geometry, and it often happens that a detailed geometry is not even required (at least during some design phases). At the same time, the geometric model for a subassembly in XDE can be directly accessed at any time in the form of *TopoDS_Compound*.
XDE defines the specific organization of the assembly content. All elements are stored at sub-labels of label 0:1:1. There can be one or more roots. The hierarchy of labels is always two-levels nested. The first level (direct children of 0:1:1) declares all products within an assembly. The second level determines the "part-of" relations between the assembly elements.
@figure{/user_guides/xde/images/xde_assembly_ocaf.png,"Internal (OCAF) representation of XDE document.",240}
@subsubsection occt_xde_1_2_2 How to explore assembly structure
To explore the assembly structure, you may use a specialized *XCAFDoc_AssemblyGraph* tool. The following code snippet illustrates the construction of explicit assembly graph from XDE document.
\code
Handle(TDocStd_Document) doc = ...; // Your XDE document
// Prepare assembly graph
Handle(XCAFDoc_AssemblyGraph) asmGraph = new XCAFDoc_AssemblyGraph(doc, true);
\endcode
*XCAFDoc_AssemblyGraph* does not contain geometry of the assembly being explored. It is a formal graph structure which makes explicit the "part-of" relations between the assembly components. Each node in a graph is associated with one of the following types:
* **Root:**
* **Subassembly**
* **Part occurrence**
* **Part**
A node contains a persistent ID which points to the corresponding OCAF label. The persistent ID is a key to access geometric representations and metadata associated with the corresponding element of assembly.
@subsubsection occt_xde_1_2_3 Multiple component occurrences
Consider two parts: wheel and axle shown in the picture below.
@figure{/user_guides/xde/images/assm_wheel_axle.png,"Two parts: wheel and axle.",240}
Consider a wheel-axle subassembly composed of one axle and two wheels.
@figure{/user_guides/xde/images/assm_wheel_axle_sa.png,"Subassembly composed of two wheels and one axle.",240}
A higher-level chassis assembly is in turn composed of two wheel-axle subassemblies, the front, and the rear.
@figure{/user_guides/xde/images/assm_wheel_axle_root.png,"Chassis assembly with multiple component occurrences.",240}
There is a requirement to identify individual components such as the left-front wheel. However, a wheel part has only two instances in the owner wheel-axle subassembly. The necessity to uniquely identify all component occurrences requires introducing a *transient* key for the corresponding assembly item. This key is essentially a path in the component graph which unambiguously addresses the element in question.
\note As reported by \ref occt_xde_references_Ungerer02 "[Ungerer and Buchanan 2002]", STEP PDM Schema is capable of tracking specific usages of assembly components. However, OCCT makes no assumption on the used STEP schema, so multiple component occurrences should be implemented at the level of XDE-based application.
\todo mention Grab Instance
//////////////////////////////////////////////////////////
The Assembly Structure and attributes assigned to shapes are stored in the OCAF tree. It is possible to obtain TopoDS representation for each level of the assembly in the form of *TopoDS_Compound* or *TopoDS_Shape* using the API.
Basic elements used by XDE are introduced in the XCAF sub-module by the package XCAFDoc. These elements consist in descriptions of commonly used data structures (apart from the shapes themselves) in normalized data exchanges. They are not attached to specific applications and do not bring specific semantics, but are structured according to the use and needs of data exchanges.
The Document used by XDE usually starts as a *TDocStd_Document*.
@@ -129,7 +45,9 @@ For example, a mechanical assembly can be defined as follows:
@figure{/user_guides/xde/images/xde_image004.png,"Assembly View",240}
XDE defines the specific organization of the assembly content. Shapes are stored on sub-labels of label 0:1:1. There can be one or more roots (called free shapes) whether they are true trees or simple shapes. A shape can be considered to be an Assembly (such as AS1 under 0:1:1:1 in Figure1) if it is defined with Components (sub-shapes, located or not).
*XCAFDoc_ShapeTool* is a tool that allows managing the Shape section of the XCAF document. This tool is implemented as an attribute and located at the root label of the shape section.
@subsection occt_xde_1_4 Validation Properties
Validation properties are geometric characteristics of Shapes (volume, centroid, surface area) written to STEP files by the sending system. These characteristics are read by the receiving system to validate the quality of the translation. This is done by comparing the values computed by the original system with the same values computed by the receiving system on the resulting model.
@@ -767,14 +685,3 @@ As a result, if an application works on Assemblies, on Colors or Layers, on Vali
In addition, if an application has a data structure far from these notions, it can get data (such as Colors and Names on Shapes) according to its needs, but without having to consider the whole.
@section occt_xde_references References
-# \anchor occt_xde_references_ShahMantyla95
Shah J., Mantyla M. Parametric and Feature Based CAD/CAM. 1995.
-# \anchor occt_xde_references_cax_if
CAx-IF STEP File Library // URL: https://cax-if.org/library/index.html
-# \anchor occt_xde_references_Ungerer02
Ungerer, M. and Buchanan, K. 2002. Usage Guide for the STEP PDM Schema Release 4.3. PDM Implementor Forum, Darmstadt January.

View File

@@ -6,10 +6,8 @@
# initialize environment
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
if [ ! -e "${aScriptPath}/env.sh" ]; then
cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
fi
if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
# run GUI tool
tclsh "${aScriptPath}/adm/genconf.tcl"

View File

@@ -15,7 +15,7 @@
#ifndef _GeoAlgo_Sol_HeaderFile
#define _GeoAlgo_Sol_HeaderFile
#ifndef _Geom_BSplineSurface_HeaderFile
#ifndef _Handle_Geom_BSplineSurface_HeaderFile
#include <Geom_BSplineSurface.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile

View File

@@ -462,10 +462,10 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\TOcaf_Application.hxx" />
<ClInclude Include="..\..\..\src\TOcafFunction_BoxDriver.hxx" />
<ClInclude Include="..\..\..\src\TOcafFunction_CutDriver.hxx" />
<ClInclude Include="..\..\..\src\TOcafFunction_CylDriver.hxx" />
<ClInclude Include="..\..\..\src\Handle_TOcaf_Application.hxx" />
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_BoxDriver.hxx" />
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CutDriver.hxx" />
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CylDriver.hxx" />
<ClInclude Include="..\..\..\src\NewBoxDlg.h" />
<ClInclude Include="..\..\..\src\NewCylDlg.h" />
<ClInclude Include="..\..\..\src\OcafApp.h" />

View File

@@ -58,16 +58,16 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\TOcaf_Application.hxx">
<ClInclude Include="..\..\..\src\Handle_TOcaf_Application.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\TOcafFunction_BoxDriver.hxx">
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_BoxDriver.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\TOcafFunction_CutDriver.hxx">
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CutDriver.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\TOcafFunction_CylDriver.hxx">
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CylDriver.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\NewBoxDlg.h">

View File

@@ -34,9 +34,6 @@
#define OPERATION_NOT_DONE 8
#define NULL_OPERATION 9
// OCCT RTTI
IMPLEMENT_STANDARD_RTTIEXT (OCAFSample_CommonDriver, OCAFSample_Driver)
//=======================================================================
//function : Constructor
//purpose :

View File

@@ -16,22 +16,84 @@
#ifndef _OCAFSample_CommonDriver_HeaderFile
#define _OCAFSample_CommonDriver_HeaderFile
#include <Standard_Type.hxx>
#include <OCAFSample_Driver.hxx>
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_OCAFSample_CommonDriver_HeaderFile
#endif
#ifndef _OCAFSample_Driver_HeaderFile
#include <OCAFSample_Driver.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class TFunction_Logbook;
class OCAFSample_CommonDriver : public OCAFSample_Driver
{
class OCAFSample_CommonDriver : public OCAFSample_Driver {
public:
Standard_EXPORT OCAFSample_CommonDriver ();
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& theLogbook) const;
Standard_EXPORT ~OCAFSample_CommonDriver ();
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT OCAFSample_CommonDriver();
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& theLogbook) const;
Standard_EXPORT ~OCAFSample_CommonDriver();
// Type management
//
Standard_EXPORT friend Handle(Standard_Type)& OCAFSample_CommonDriver_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT (OCAFSample_CommonDriver, OCAFSample_Driver)
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -16,29 +16,92 @@
#ifndef _OCAFSample_Driver_HeaderFile
#define _OCAFSample_Driver_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_OCAFSample_Driver_HeaderFile
#endif
#ifndef _TFunction_Driver_HeaderFile
#include <TFunction_Driver.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class TFunction_Logbook;
#include <TDF_LabelMap.hxx>
class TFunction_Logbook;
class OCAFSample_Driver : public TFunction_Driver
{
class OCAFSample_Driver : public TFunction_Driver {
public:
Standard_EXPORT void Validate (TFunction_Logbook& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean Arguments (TDF_LabelMap& theArgs) const;
Standard_EXPORT virtual Standard_Boolean Results (TDF_LabelMap& theRes) const;
Standard_EXPORT ~OCAFSample_Driver ();
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT void Validate(TFunction_Logbook& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean Arguments(TDF_LabelMap& theArgs) const;
Standard_EXPORT virtual Standard_Boolean Results(TDF_LabelMap& theRes) const;
Standard_EXPORT ~OCAFSample_Driver();
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT(OCAFSample_Driver,TFunction_Driver)
// Type management
//
Standard_EXPORT friend Handle(Standard_Type)& OCAFSample_Driver_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
Standard_EXPORT OCAFSample_Driver ();
// Methods PROTECTED
//
Standard_EXPORT OCAFSample_Driver();
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -0,0 +1,68 @@
// File generated by CPPExt (Transient)
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#include <OCAFSample_Driver.jxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
OCAFSample_Driver::~OCAFSample_Driver() {}
Standard_EXPORT Handle_Standard_Type& OCAFSample_Driver_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
static Handle_Standard_Type _aType = new Standard_Type("OCAFSample_Driver",
sizeof(OCAFSample_Driver),
1,
(Standard_Address)_Ancestors,
(Standard_Address)NULL);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(OCAFSample_Driver) Handle(OCAFSample_Driver)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(OCAFSample_Driver) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(OCAFSample_Driver))) {
_anOtherObject = Handle(OCAFSample_Driver)((Handle(OCAFSample_Driver)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& OCAFSample_Driver::DynamicType() const
{
return STANDARD_TYPE(OCAFSample_Driver) ;
}
Standard_Boolean OCAFSample_Driver::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(OCAFSample_Driver) == AType || TFunction_Driver::IsKind(AType));
}
Handle_OCAFSample_Driver::~Handle_OCAFSample_Driver() {}

View File

@@ -0,0 +1,9 @@
#ifndef _TFunction_Logbook_HeaderFile
#include <TFunction_Logbook.hxx>
#endif
#ifndef _TDF_LabelMap_HeaderFile
#include <TDF_LabelMap.hxx>
#endif
#ifndef _OCAFSample_Driver_HeaderFile
#include <OCAFSample_Driver.hxx>
#endif

View File

@@ -10,6 +10,7 @@
#include <OCC_App.h>
#include "OcafDoc.h"
#include "TOCAF_Application.hxx"
#include <TOcaf_Application.hxx>

View File

@@ -12,8 +12,6 @@
#include "BRepPrimAPI_MakeBox.hxx"
#include "TNaming_Builder.hxx"
IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_BoxDriver, TFunction_Driver)
//=======================================================================
//function : GetID
//purpose :
@@ -120,3 +118,32 @@ Standard_Integer TOcafFunction_BoxDriver::Execute(Handle(TFunction_Logbook)& /*l
// If there are no any mistakes we return 0:
return 0;
}
TOcafFunction_BoxDriver::~TOcafFunction_BoxDriver() {}
// DownCast method
// allow safe downcasting
//
const Handle(TOcafFunction_BoxDriver) TOcafFunction_BoxDriver::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(TOcafFunction_BoxDriver) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_BoxDriver))) {
_anOtherObject = Handle(TOcafFunction_BoxDriver)::DownCast (AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& TOcafFunction_BoxDriver::DynamicType() const
{
return STANDARD_TYPE(TOcafFunction_BoxDriver) ;
}
Standard_Boolean TOcafFunction_BoxDriver::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(TOcafFunction_BoxDriver) == AType || TFunction_Driver::IsKind(AType));
}

View File

@@ -31,19 +31,74 @@
#endif
class TFunction_Logbook;
class TOcafFunction_BoxDriver : public TFunction_Driver
{
class TOcafFunction_BoxDriver : public TFunction_Driver {
public:
Standard_EXPORT static const Standard_GUID& GetID ();
Standard_EXPORT TOcafFunction_BoxDriver ();
Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT static const Standard_GUID& GetID() ;
Standard_EXPORT TOcafFunction_BoxDriver();
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT ~TOcafFunction_BoxDriver();
// Type management
//
//Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_BoxDriver_Type_();
Standard_EXPORT const Handle(TOcafFunction_BoxDriver) DownCast(const Handle(Standard_Transient)& AnObject);
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT(TOcafFunction_BoxDriver,TFunction_Driver)
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -17,8 +17,6 @@
#include "TFunction_Logbook.hxx"
#include "TDF_Reference.hxx"
IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_CutDriver, TFunction_Driver)
//=======================================================================
//function : GetID
//purpose :
@@ -141,3 +139,32 @@ Standard_Integer TOcafFunction_CutDriver::Execute(Handle(TFunction_Logbook)& /*l
// If there are no any mistakes we return 0:
return 0;
}
TOcafFunction_CutDriver::~TOcafFunction_CutDriver() {}
// DownCast method
// allow safe downcasting
//
const Handle(TOcafFunction_CutDriver) TOcafFunction_CutDriver::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(TOcafFunction_CutDriver) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_CutDriver))) {
_anOtherObject = Handle(TOcafFunction_CutDriver)::DownCast (AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& TOcafFunction_CutDriver::DynamicType() const
{
return STANDARD_TYPE(TOcafFunction_CutDriver) ;
}
Standard_Boolean TOcafFunction_CutDriver::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(TOcafFunction_CutDriver) == AType || TFunction_Driver::IsKind(AType));
}

View File

@@ -32,18 +32,73 @@
class TFunction_Logbook;
class TOcafFunction_CutDriver : public TFunction_Driver
{
class TOcafFunction_CutDriver : public TFunction_Driver {
public:
Standard_EXPORT static const Standard_GUID& GetID() ;
Standard_EXPORT TOcafFunction_CutDriver ();
Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT static const Standard_GUID& GetID() ;
Standard_EXPORT TOcafFunction_CutDriver();
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT ~TOcafFunction_CutDriver();
// Type management
//
//Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_CutDriver_Type_();
Standard_EXPORT const Handle(TOcafFunction_CutDriver) DownCast(const Handle(Standard_Transient)& AnObject);
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT(TOcafFunction_CutDriver,TFunction_Driver)
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -13,7 +13,6 @@
#include "TDataStd_Real.hxx"
#include "TNaming_Builder.hxx"
IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_CylDriver, TFunction_Driver)
//=======================================================================
//function : GetID
@@ -114,3 +113,32 @@ Standard_Integer TOcafFunction_CylDriver::Execute(Handle(TFunction_Logbook)& /*l
// If there are no any mistakes we return 0:
return 0;
}
TOcafFunction_CylDriver::~TOcafFunction_CylDriver() {}
// DownCast method
// allow safe downcasting
//
const Handle(TOcafFunction_CylDriver) TOcafFunction_CylDriver::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(TOcafFunction_CylDriver) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_CylDriver))) {
_anOtherObject = Handle(TOcafFunction_CylDriver)::DownCast (AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& TOcafFunction_CylDriver::DynamicType() const
{
return STANDARD_TYPE(TOcafFunction_CylDriver) ;
}
Standard_Boolean TOcafFunction_CylDriver::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(TOcafFunction_CylDriver) == AType || TFunction_Driver::IsKind(AType));
}

View File

@@ -32,18 +32,73 @@
class TFunction_Logbook;
class TOcafFunction_CylDriver : public TFunction_Driver
{
class TOcafFunction_CylDriver : public TFunction_Driver {
public:
Standard_EXPORT static const Standard_GUID& GetID ();
Standard_EXPORT TOcafFunction_CylDriver ();
Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT static const Standard_GUID& GetID() ;
Standard_EXPORT TOcafFunction_CylDriver();
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
Standard_EXPORT ~TOcafFunction_CylDriver();
// Type management
//
//Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_CylDriver_Type_();
Standard_EXPORT const Handle(TOcafFunction_CylDriver) DownCast(const Handle(Standard_Transient)& AnObject);
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT(TOcafFunction_CylDriver,TFunction_Driver)
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -5,7 +5,7 @@
//Modified by Sergey RUIN (An instanciation of the drivers)
#include <stdafx.h>
#include <TOcaf_Application.hxx>
#include <TOcaf_Application.ixx>
#include <TDF_Label.hxx>
#include <TPrsStd_AISPresentation.hxx>
#include <TPrsStd_AISViewer.hxx>
@@ -15,8 +15,6 @@
#include "TOcafFunction_CylDriver.hxx"
#include "TOcafFunction_CutDriver.hxx"
IMPLEMENT_STANDARD_RTTIEXT (TOcaf_Application, TDocStd_Application)
//=======================================================================
//function : TOcaf_Application
//purpose :

View File

@@ -26,13 +26,49 @@
class TDocStd_Document;
class TOcaf_Application : public TDocStd_Application
{
public:
Standard_EXPORT TOcaf_Application ();
class TOcaf_Application : public TDocStd_Application {
public:
// Methods PUBLIC
//
Standard_EXPORT TOcaf_Application();
// Type management
//
//Standard_EXPORT friend Handle(Standard_Type)& TOcaf_Application_Type_();
Standard_EXPORT const Handle(TOcaf_Application) DownCast(const Handle(Standard_Transient)& AnObject);
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT (TOcaf_Application, TDocStd_Application)
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -0,0 +1,45 @@
// File generated by CPPExt (Transient)
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#include <TOcaf_Application.jxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
// DownCast method
// allow safe downcasting
//
const Handle(TOcaf_Application) TOcaf_Application::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(TOcaf_Application) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(TOcaf_Application))) {
_anOtherObject = Handle(TOcaf_Application)((Handle(TOcaf_Application)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& TOcaf_Application::DynamicType() const
{
return STANDARD_TYPE(TOcaf_Application) ;
}
Standard_Boolean TOcaf_Application::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(TOcaf_Application) == AType || TDocStd_Application::IsKind(AType));
}

View File

@@ -0,0 +1,9 @@
#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
#include <TColStd_SequenceOfExtendedString.hxx>
#endif
#ifndef _TDocStd_Document_HeaderFile
#include <TDocStd_Document.hxx>
#endif
#ifndef _TOcaf_Application_HeaderFile
#include <TOcaf_Application.hxx>
#endif

View File

@@ -1,8 +1,8 @@
@echo off
call "%~dp0..\..\..\env.bat" %1 %2 %3
call "custom.bat" %1 %2 %3
call "%~dp0..\..\..\env.bat" %1 %2 %3
set "PATH=%QTDIR%/bin;%PATH%"
set "QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms"

View File

@@ -1,9 +1,9 @@
@echo off
call "%~dp0..\..\..\env.bat" %1 %2 %3
call "custom.bat" %1 %2 %3
call "%~dp0..\..\..\env.bat" %1 %2 %3
set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
set "CSF_ResourcesDefaults=%RES_DIR%"
set "CSF_IEResourcesDefaults=%RES_DIR%"

View File

@@ -1,9 +1,9 @@
@echo off
call "%~dp0..\..\..\env.bat" %1 %2 %3
call "custom.bat" %1 %2 %3
call "%~dp0..\..\..\env.bat" %1 %2 %3
set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
set "CSF_ResourcesDefaults=%RES_DIR%"
set "CSF_TutorialResourcesDefaults=%RES_DIR%"

View File

@@ -331,8 +331,10 @@ Standard_Boolean MainPage::SaveSTEP(const wchar_t* theFilePath, const TopoDS_Sha
return Standard_False;
}
const TCollection_AsciiString aFilePath (theFilePath);
switch (aWriter.Write (aFilePath.ToCString()))
char theFilePathA[MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
switch (aWriter.Write(theFilePathA))
{
case IFSelect_RetError:
Output_TextBlock->Text += L"Error: Incorrect Data\n";
@@ -356,8 +358,11 @@ Standard_Boolean MainPage::SaveSTEP(const wchar_t* theFilePath, const TopoDS_Sha
Standard_Boolean MainPage::SaveSTL(const wchar_t* theFilePath, const TopoDS_Shape& theShape)
{
StlAPI_Writer myStlWriter;
const TCollection_AsciiString aFilePath (theFilePath);
return myStlWriter.Write (theShape, aFilePath.ToCString());
char theFilePathA[MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
return myStlWriter.Write(theShape, theFilePathA) == StlAPI_StatusOK;
}
//=======================================================================
@@ -367,8 +372,12 @@ Standard_Boolean MainPage::SaveSTL(const wchar_t* theFilePath, const TopoDS_Shap
Standard_Boolean MainPage::SaveVRML(const wchar_t* theFilePath, const TopoDS_Shape& theShape)
{
VrmlAPI_Writer aWriter;
const TCollection_AsciiString aFilePath (theFilePath);
aWriter.Write (theShape, aFilePath.ToCString());
char theFilePathA[MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
aWriter.Write(theShape, theFilePathA);
return Standard_True;
}
@@ -381,8 +390,11 @@ Standard_Boolean MainPage::ReadBREP(const wchar_t* theFilePath, TopoDS_Shape& th
theShape.Nullify();
BRep_Builder aBuilder;
const TCollection_AsciiString aFilePath (theFilePath);
if (!BRepTools::Read(theShape, aFilePath.ToCString(), aBuilder))
char theFilePathA[MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
if (!BRepTools::Read(theShape, theFilePathA, aBuilder))
return Standard_False;
return !theShape.IsNull() && BRepAlgo::IsValid(theShape);
@@ -398,8 +410,10 @@ Standard_Boolean MainPage::ReadIGES(const wchar_t* theFilePath, TopoDS_Shape& th
IGESControl_Reader Reader;
const TCollection_AsciiString aFilePath (theFilePath);
if (Reader.ReadFile (aFilePath.ToCString()) != IFSelect_RetDone)
char theFilePathA[MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
if (Reader.ReadFile(theFilePathA) != IFSelect_RetDone)
return Standard_False;
Reader.TransferRoots();
@@ -417,8 +431,11 @@ Standard_Boolean MainPage::ReadSTEP(const wchar_t* theFilePath, TopoDS_Shape& th
theShape.Nullify();
STEPControl_Reader aReader;
const TCollection_AsciiString aFilePath (theFilePath);
switch (aReader.ReadFile (aFilePath.ToCString()))
char theFilePathA[MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
switch (aReader.ReadFile(theFilePathA))
{
case IFSelect_RetError:
Output_TextBlock->Text += L"Error: Not a valid Step file\n";

View File

@@ -2336,9 +2336,6 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
clearDynamicHighlight();
}
// make sure highlighting presentations are properly erased
theIObj->ErasePresentations (false);
if (IsSelected (theIObj)
&& aStatus->DisplayMode() != aDispMode)
{
@@ -2399,7 +2396,6 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
unhighlightOwners (theIObj);
myMainPM->Erase (theIObj, -1);
theIObj->ErasePresentations (true); // make sure highlighting presentations are properly erased
// Object removes from Detected sequence
Standard_DISABLE_DEPRECATION_WARNINGS
@@ -2615,9 +2611,11 @@ Standard_Boolean AIS_InteractiveContext::IsoOnTriangulation() const
return myDefaultDrawer->IsoOnTriangulation();
}
//=======================================================================
//function : SetPixelTolerance
//purpose :
//purpose : Disables the mechanism of adaptive tolerance calculation in
// SelectMgr_ViewerSelector and sets the given tolerance for ALL
// sensitive entities activated. For more information, see
// SelectMgr_ViewerSelector.hxx
//=======================================================================
void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecision)
{
@@ -2783,6 +2781,24 @@ Standard_Boolean AIS_InteractiveContext::PlaneSize (Standard_Real& theX,
return (Abs (theX - theY) <= Precision::Confusion());
}
//=======================================================================
//function : SetAutoActivateSelection
//purpose :
//=======================================================================
void AIS_InteractiveContext::SetAutoActivateSelection (const Standard_Boolean theIsAuto)
{
myIsAutoActivateSelMode = theIsAuto;
}
//=======================================================================
//function : GetAutoActivateSelection
//purpose :
//=======================================================================
Standard_Boolean AIS_InteractiveContext::GetAutoActivateSelection() const
{
return myIsAutoActivateSelMode;
}
//=======================================================================
//function : SetZLayer
//purpose :

File diff suppressed because it is too large Load Diff

View File

@@ -1661,22 +1661,6 @@ void AIS_InteractiveContext::NextDetected()
myCurDetected++;
}
//=======================================================================
//function : DetectedCurrentOwner
//purpose :
//=======================================================================
Handle(SelectMgr_EntityOwner) AIS_InteractiveContext::DetectedCurrentOwner() const
{
if (HasOpenedContext())
{
return myLocalContexts (myCurLocalIndex)->DetectedCurrentOwner();
}
return MoreDetected()
? myMainSel->Picked (myDetectedSeq (myCurDetected))
: Handle(SelectMgr_EntityOwner)();
}
//=======================================================================
//function : DetectedCurrentShape
//purpose :

View File

@@ -237,13 +237,12 @@ public:
//! Gets next current object during iteration through mouse-detected
//! interactive objects.
Standard_EXPORT void NextDetected();
//! @return current mouse-detected Owner or null object if there is no current detected.
Standard_EXPORT Handle(SelectMgr_EntityOwner) DetectedCurrentOwner() const;
//! @return current mouse-detected shape or empty (null) shape, if current interactive object
//! is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
//! @return current mouse-detected interactive object or null object if there is no current detected.
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
@@ -425,6 +424,7 @@ private:
Standard_Integer myCurrentOwner;
TColStd_SequenceOfInteger myDetectedSeq;
Standard_Integer myCurDetected;
AIS_SequenceOfInteractive myAISDetectedSeq;
Standard_Integer myAISCurDetected;
Handle(Prs3d_Drawer) mySubintStyle;

View File

@@ -73,6 +73,7 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
}
myAISCurDetected = 0;
myAISDetectedSeq.Clear();
myCurDetected = 0;
myDetectedSeq.Clear();
@@ -83,10 +84,17 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
{
Handle(SelectMgr_EntityOwner) anOwner = myMainVS->Picked (aDetIter);
if (!anOwner.IsNull()
&& myFilters->IsOk (anOwner))
if (anOwner.IsNull()
|| !myFilters->IsOk (anOwner))
{
myDetectedSeq.Append (aDetIter); // normally they are already arranged in correct order...
continue;
}
myDetectedSeq.Append (aDetIter); // normally they are already arranged in correct order...
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (!anObj.IsNull())
{
myAISDetectedSeq.Append (anObj);
}
}
@@ -860,17 +868,15 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
}
myDetectedSeq.Remove (anIdx--);
if (myCurDetected > anIdx)
if (anIdx < myCurDetected)
{
--myCurDetected;
}
if (myAISCurDetected > anIdx)
{
--myAISCurDetected;
myCurDetected--;
}
}
myCurDetected = Max (myCurDetected, 1);
myAISCurDetected = Max (myAISCurDetected, 1);
myCurDetected = Max (myCurDetected, 1);
Standard_Boolean isAISRemainsDetected = Standard_False;
// 3. AIS_Selection : remove entity owners from AIS_Selection
const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer();
@@ -883,7 +889,11 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
continue;
}
if (!aValidOwners.Contains (anOwner))
if (aValidOwners.Contains (anOwner))
{
isAISRemainsDetected = Standard_True;
}
else
{
aRemoveEntites.Append (anOwner);
anOwner->SetSelected (Standard_False);
@@ -958,6 +968,28 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
Standard_False);
}
}
// Renew iterator of ::DetectedCurrentObject()
if (!isAISRemainsDetected)
{
// Remove the interactive object from detected sequences
for (Standard_Integer anIdx = 1; anIdx <= myAISDetectedSeq.Length(); ++anIdx)
{
Handle(AIS_InteractiveObject) aDetectedIO = myAISDetectedSeq.Value (anIdx);
if (aDetectedIO.IsNull() || aDetectedIO != theIO)
{
continue;
}
myAISDetectedSeq.Remove (anIdx--);
if (anIdx < myAISCurDetected)
{
myAISCurDetected--;
}
}
myAISCurDetected = Max (myAISCurDetected, 1);
}
}
//=======================================================================
@@ -1422,7 +1454,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
//=======================================================================
void AIS_LocalContext::InitDetected()
{
myAISCurDetected = !myDetectedSeq.IsEmpty() ? myDetectedSeq.Lower() : 0;
myAISCurDetected = myAISDetectedSeq.Length()? 1 : 0;
}
//=======================================================================
@@ -1431,8 +1463,7 @@ void AIS_LocalContext::InitDetected()
//=======================================================================
Standard_Boolean AIS_LocalContext::MoreDetected() const
{
return myAISCurDetected >= myDetectedSeq.Lower()
&& myAISCurDetected <= myDetectedSeq.Upper();
return (myAISCurDetected > 0 && myAISCurDetected <= myAISDetectedSeq.Length());
}
//=======================================================================
@@ -1459,29 +1490,13 @@ const TopoDS_Shape& AIS_LocalContext::DetectedCurrentShape() const
return aCurrentShape->Shape();
}
//=======================================================================
//function : DetectedCurrentOwner
//purpose :
//=======================================================================
Handle(SelectMgr_EntityOwner) AIS_LocalContext::DetectedCurrentOwner() const
{
return MoreDetected()
? myMainVS->Picked (myDetectedSeq (myAISCurDetected))
: Handle(SelectMgr_EntityOwner)();
}
//=======================================================================
//function : DetectedCurrentObject
//purpose :
//=======================================================================
Handle(AIS_InteractiveObject) AIS_LocalContext::DetectedCurrentObject() const
{
if (!MoreDetected())
{
return Handle(AIS_InteractiveObject)();
}
return Handle(AIS_InteractiveObject)::DownCast (myMainVS->Picked (myDetectedSeq (myAISCurDetected))->Selectable());
return MoreDetected() ? myAISDetectedSeq(myAISCurDetected) : NULL;
}
//=======================================================================

View File

@@ -128,7 +128,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
switch (aMode)
switch (aMode)
{
case 0:
const TColgp_Array1OfPnt& nodes = myTriangulation->Nodes(); //Nodes
@@ -203,7 +203,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
//=======================================================================
//function : ComputeSelection
//purpose :
//purpose :
//=======================================================================
void AIS_Triangulation::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
@@ -238,7 +238,7 @@ Handle(TColStd_HArray1OfInteger) AIS_Triangulation::GetColors() const
//=======================================================================
//function : SetTriangulation
//purpose :
//purpose :
//=======================================================================
void AIS_Triangulation::SetTriangulation(const Handle(Poly_Triangulation)& aTriangulation)
{
@@ -247,7 +247,7 @@ void AIS_Triangulation::SetTriangulation(const Handle(Poly_Triangulation)& aTria
//=======================================================================
//function : GetTriangulation
//purpose :
//purpose :
//=======================================================================
Handle(Poly_Triangulation) AIS_Triangulation::GetTriangulation() const{
return myTriangulation;
@@ -255,19 +255,25 @@ Handle(Poly_Triangulation) AIS_Triangulation::GetTriangulation() const{
//=======================================================================
//function : AttenuateColor
//purpose :
//purpose : Attenuates 32-bit color by a given attenuation factor (0...1):
// aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
// All color components are multiplied by aComponent, the result is then packed again as 32-bit integer.
// Color attenuation is applied to the vertex colors in order to have correct visual result
// after glColorMaterial(GL_AMBIENT_AND_DIFFUSE). Without it, colors look unnatural and flat.
//=======================================================================
Graphic3d_Vec4ub AIS_Triangulation::attenuateColor (const Standard_Integer theColor,
const Standard_Real theComposition)
{
const Standard_Byte* anRgbx = reinterpret_cast<const Standard_Byte*> (&theColor);
const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub*> (&theColor);
// If IsTranparent() is false alpha value will be ignored anyway.
Standard_Byte anAlpha = IsTransparent() ? static_cast<Standard_Byte> (255.0 - myDrawer->ShadingAspect()->Aspect()->FrontMaterial().Transparency() * 255.0)
: 255;
return Graphic3d_Vec4ub ((Standard_Byte)(theComposition * anRgbx[0]),
(Standard_Byte)(theComposition * anRgbx[1]),
(Standard_Byte)(theComposition * anRgbx[2]),
return Graphic3d_Vec4ub ((Standard_Byte)(theComposition * aColor.r()),
(Standard_Byte)(theComposition * aColor.g()),
(Standard_Byte)(theComposition * aColor.b()),
anAlpha);
}

View File

@@ -37,100 +37,100 @@ static Handle(TCollection_HAsciiString) nulstr;
static Handle(Interface_HArray1OfHAsciiString) nularr;
APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader
(const Handle(StepData_StepModel)& model)
(const Handle(StepData_StepModel)& model)
{
done = Standard_True;
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileName))) {
if (model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileName))) {
fn = GetCasted(HeaderSection_FileName,
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileName)));
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileName)));
}
else done = Standard_False;
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileSchema))) {
if (model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema))) {
fs = GetCasted(HeaderSection_FileSchema,
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema)));
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema)));
}
else done = Standard_False;
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileDescription))) {
if (model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription))) {
fd = GetCasted(HeaderSection_FileDescription,
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription)));
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription)));
}
else done = Standard_False;
}
APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader
(const Standard_Integer shapetype)
(const Standard_Integer shapetype)
{
switch(shapetype) {
case 1 : Init ("Open CASCADE Facetted BRep Model"); break;
case 2 : Init ("Open CASCADE Face Based Surface Model"); break;
case 3 : Init ("Open CASCADE Shell Based Surface Model"); break;
case 4 : Init ("Open CASCADE Manifold Solid Brep Model"); break;
default: Init ("Open CASCADE Shape Model"); break;
switch (shapetype) {
case 1: Init("Open CASCADE Facetted BRep Model"); break;
case 2: Init("Open CASCADE Face Based Surface Model"); break;
case 3: Init("Open CASCADE Shell Based Surface Model"); break;
case 4: Init("Open CASCADE Manifold Solid Brep Model"); break;
default: Init("Open CASCADE Shape Model"); break;
}
}
void APIHeaderSection_MakeHeader::Init (const Standard_CString nameval)
void APIHeaderSection_MakeHeader::Init(const Standard_CString nameval)
{
done = Standard_True;
// - File Name
char timestamp[50];
if (fn.IsNull()) fn = new HeaderSection_FileName;
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(nameval);
fn->SetName(name);
Interface_MSG::TDate (timestamp,0,0,0,0,0,1,"C:%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"); // actually
Handle(TCollection_HAsciiString) tst =
Interface_MSG::TDate(timestamp, 0, 0, 0, 0, 0, 1, "C:%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"); // actually
Handle(TCollection_HAsciiString) tst =
new TCollection_HAsciiString(timestamp);
fn->SetTimeStamp(tst);
Handle(Interface_HArray1OfHAsciiString) authors =
new Interface_HArray1OfHAsciiString(1,1);
Handle(TCollection_HAsciiString) a1 =
Handle(Interface_HArray1OfHAsciiString) authors =
new Interface_HArray1OfHAsciiString(1, 1);
Handle(TCollection_HAsciiString) a1 =
new TCollection_HAsciiString("Author");
authors->SetValue(1,a1);
authors->SetValue(1, a1);
fn->SetAuthor(authors);
Handle(Interface_HArray1OfHAsciiString) org =
new Interface_HArray1OfHAsciiString(1,1);
Handle(TCollection_HAsciiString) org1 =
Handle(Interface_HArray1OfHAsciiString) org =
new Interface_HArray1OfHAsciiString(1, 1);
Handle(TCollection_HAsciiString) org1 =
new TCollection_HAsciiString("Open CASCADE");
org->SetValue(1,org1);
org->SetValue(1, org1);
fn->SetOrganization(org);
char procver[80];
sprintf (procver, XSTEP_PROCESSOR_VERSION, "STEP");
Handle(TCollection_HAsciiString) pv = new TCollection_HAsciiString (procver);
sprintf(procver, XSTEP_PROCESSOR_VERSION, "STEP");
Handle(TCollection_HAsciiString) pv = new TCollection_HAsciiString(procver);
//Handle(TCollection_HAsciiString) pv =
//new TCollection_HAsciiString(XSTEP_VERSION);
fn->SetPreprocessorVersion(pv);
Handle(TCollection_HAsciiString) sys =
Handle(TCollection_HAsciiString) sys =
new TCollection_HAsciiString(XSTEP_SYSTEM_VERSION);//#58 rln
fn->SetOriginatingSystem(sys);
Handle(TCollection_HAsciiString) auth =
Handle(TCollection_HAsciiString) auth =
new TCollection_HAsciiString("Unknown");
fn->SetAuthorisation(auth);
// - File Description
if (fd.IsNull()) fd = new HeaderSection_FileDescription;
Handle(Interface_HArray1OfHAsciiString) descr =
new Interface_HArray1OfHAsciiString(1,1);
Handle(TCollection_HAsciiString) descr1 =
new Interface_HArray1OfHAsciiString(1, 1);
Handle(TCollection_HAsciiString) descr1 =
new TCollection_HAsciiString("Open CASCADE Model");
descr->SetValue(1,descr1);
descr->SetValue(1, descr1);
fd->SetDescription(descr);
Handle(TCollection_HAsciiString) il =
Handle(TCollection_HAsciiString) il =
new TCollection_HAsciiString("2;1");
fd->SetImplementationLevel(il);
// - File Schema
if (fs.IsNull()) fs = new HeaderSection_FileSchema;
if (fs.IsNull()) fs = new HeaderSection_FileSchema;
Handle(Interface_HArray1OfHAsciiString) schid =
new Interface_HArray1OfHAsciiString(1,1);
Handle(TCollection_HAsciiString) schid1 =
new Interface_HArray1OfHAsciiString(1, 1);
Handle(TCollection_HAsciiString) schid1 =
new TCollection_HAsciiString("");
schid->SetValue(1,schid1);
schid->SetValue(1, schid1);
fs->SetSchemaIdentifiers(schid);
}
@@ -141,30 +141,31 @@ Standard_Boolean APIHeaderSection_MakeHeader::IsDone() const
}
void APIHeaderSection_MakeHeader::Apply
(const Handle(StepData_StepModel)& model) const
(const Handle(StepData_StepModel)& model) const
{
Interface_EntityIterator header = model->Header();
if (HasFd() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileDescription)))
if (HasFd() && !model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription)))
header.AddItem(fd);
if (HasFn() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileName)))
if (HasFn() && !model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileName)))
header.AddItem(fn);
if (HasFs() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileSchema))) {
if (HasFs() && !model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema))) {
// Schema defined? If not take it from the protocole
// Schema defined? If not take it from the protocole
Handle(TCollection_HAsciiString) sch;
Handle(Interface_HArray1OfHAsciiString) schid = fs->SchemaIdentifiers();
if (!schid.IsNull()) sch = schid->Value(1);
else {
schid = new Interface_HArray1OfHAsciiString(1,1);
schid = new Interface_HArray1OfHAsciiString(1, 1);
fs->SetSchemaIdentifiers(schid);
}
if (!sch.IsNull()) { if (sch->Length() < 2) sch.Nullify(); } // not defined
if (sch.IsNull()) {
Handle(StepData_Protocol) stepro = Handle(StepData_Protocol)::DownCast
( model->Protocol());
if (!stepro.IsNull()) sch = new TCollection_HAsciiString
(stepro->SchemaName());
if (!sch.IsNull()) schid->SetValue (1,sch);
(model->Protocol());
Handle(Interface_Static) aParam = model->GetParam("write.step.schema");
if (!aParam.IsNull() && !stepro.IsNull())
sch = new TCollection_HAsciiString(stepro->SchemaName(aParam->IntegerValue()));
if (!sch.IsNull()) schid->SetValue(1, sch);
}
header.AddItem(fs);
}
@@ -179,12 +180,12 @@ void APIHeaderSection_MakeHeader::Apply
// ========
Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel
(const Handle(Interface_Protocol)& protocol) const
(const Handle(Interface_Protocol)& protocol) const
{
Handle(StepData_StepModel) stepmodel = new StepData_StepModel;
stepmodel->SetProtocol (protocol);
stepmodel->SetProtocol(protocol);
// - Make Header information
// - Make Header information
Apply(stepmodel);
return stepmodel;
@@ -197,7 +198,9 @@ Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel
// ========
Standard_Boolean APIHeaderSection_MakeHeader::HasFn() const
{ return (!fn.IsNull()); }
{
return (!fn.IsNull());
}
Handle(HeaderSection_FileName) APIHeaderSection_MakeHeader::FnValue() const
{
@@ -208,23 +211,23 @@ Handle(HeaderSection_FileName) APIHeaderSection_MakeHeader::FnValue() const
void APIHeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer shapetype)
{
Handle(TCollection_HAsciiString) name;
switch(shapetype)
switch(shapetype)
{
case 1: // face_based_surface_model
name = new TCollection_HAsciiString
("Euclid Face Based Surface Model");
("Euclid Face Based Surface Model");
break;
case 2: // manifold_solid_brep
name = new TCollection_HAsciiString
("Euclid Manifold Solid Brep Model");
name = new TCollection_HAsciiString
("Euclid Manifold Solid Brep Model");
break;
case 3: // facetted_brep
name = new TCollection_HAsciiString
("Euclid Facetted Brep Model");
("Euclid Facetted Brep Model");
break;
default : // others ?
name = new TCollection_HAsciiString
("Euclid Shape Model");
("Euclid Shape Model");
break;
}
SetName(aName);
@@ -233,106 +236,106 @@ void APIHeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer sh
void APIHeaderSection_MakeHeader::SetName(const Handle(TCollection_HAsciiString)& aName)
{
if (!fn.IsNull()) fn->SetName(aName);
if (!fn.IsNull()) fn->SetName(aName);
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Name() const
{
return (fn.IsNull() ? nulstr : fn->Name());
return (fn.IsNull() ? nulstr : fn->Name());
}
void APIHeaderSection_MakeHeader::SetTimeStamp(const Handle(TCollection_HAsciiString)& aTimeStamp)
{
if (!fn.IsNull()) fn->SetTimeStamp(aTimeStamp);
if (!fn.IsNull()) fn->SetTimeStamp(aTimeStamp);
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::TimeStamp() const
{
return (fn.IsNull() ? nulstr : fn->TimeStamp());
return (fn.IsNull() ? nulstr : fn->TimeStamp());
}
void APIHeaderSection_MakeHeader::SetAuthor(const Handle(Interface_HArray1OfHAsciiString)& aAuthor)
{
if (!fn.IsNull()) fn->SetAuthor(aAuthor);
if (!fn.IsNull()) fn->SetAuthor(aAuthor);
}
void APIHeaderSection_MakeHeader::SetAuthorValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aAuthor)
{
if (fn.IsNull()) return;
Handle(Interface_HArray1OfHAsciiString) li = fn->Author();
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aAuthor);
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aAuthor);
}
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Author() const
{
return (fn.IsNull() ? nularr : fn->Author());
return (fn.IsNull() ? nularr : fn->Author());
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::AuthorValue(const Standard_Integer num) const
{
return (fn.IsNull() ? nulstr : fn->AuthorValue(num));
return (fn.IsNull() ? nulstr : fn->AuthorValue(num));
}
Standard_Integer APIHeaderSection_MakeHeader::NbAuthor () const
Standard_Integer APIHeaderSection_MakeHeader::NbAuthor() const
{
return (fn.IsNull() ? 0 : fn->NbAuthor());
return (fn.IsNull() ? 0 : fn->NbAuthor());
}
void APIHeaderSection_MakeHeader::SetOrganization(const Handle(Interface_HArray1OfHAsciiString)& aOrganization)
{
if (!fn.IsNull()) fn->SetOrganization(aOrganization);
if (!fn.IsNull()) fn->SetOrganization(aOrganization);
}
void APIHeaderSection_MakeHeader::SetOrganizationValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aOrgan)
{
if (fn.IsNull()) return;
Handle(Interface_HArray1OfHAsciiString) li = fn->Organization();
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aOrgan);
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aOrgan);
}
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Organization() const
{
return (fn.IsNull() ? nularr : fn->Organization());
return (fn.IsNull() ? nularr : fn->Organization());
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::OrganizationValue(const Standard_Integer num) const
{
return (fn.IsNull() ? nulstr : fn->OrganizationValue(num));
return (fn.IsNull() ? nulstr : fn->OrganizationValue(num));
}
Standard_Integer APIHeaderSection_MakeHeader::NbOrganization () const
Standard_Integer APIHeaderSection_MakeHeader::NbOrganization() const
{
return (fn.IsNull() ? 0 : fn->NbOrganization());
return (fn.IsNull() ? 0 : fn->NbOrganization());
}
void APIHeaderSection_MakeHeader::SetPreprocessorVersion(const Handle(TCollection_HAsciiString)& aPreprocessorVersion)
{
if (!fn.IsNull()) fn->SetPreprocessorVersion(aPreprocessorVersion);
if (!fn.IsNull()) fn->SetPreprocessorVersion(aPreprocessorVersion);
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::PreprocessorVersion() const
{
return (fn.IsNull() ? nulstr : fn->PreprocessorVersion());
return (fn.IsNull() ? nulstr : fn->PreprocessorVersion());
}
void APIHeaderSection_MakeHeader::SetOriginatingSystem(const Handle(TCollection_HAsciiString)& aOriginatingSystem)
{
if (!fn.IsNull()) fn->SetOriginatingSystem(aOriginatingSystem);
if (!fn.IsNull()) fn->SetOriginatingSystem(aOriginatingSystem);
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::OriginatingSystem() const
{
return (fn.IsNull() ? nulstr : fn->OriginatingSystem());
return (fn.IsNull() ? nulstr : fn->OriginatingSystem());
}
void APIHeaderSection_MakeHeader::SetAuthorisation(const Handle(TCollection_HAsciiString)& aAuthorisation)
{
if (!fn.IsNull()) fn->SetAuthorisation(aAuthorisation);
if (!fn.IsNull()) fn->SetAuthorisation(aAuthorisation);
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Authorisation() const
{
return (fn.IsNull() ? nulstr : fn->Authorisation());
return (fn.IsNull() ? nulstr : fn->Authorisation());
}
// ===========
@@ -340,7 +343,9 @@ Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Authorisation() co
// ===========
Standard_Boolean APIHeaderSection_MakeHeader::HasFs() const
{ return (!fs.IsNull()); }
{
return (!fs.IsNull());
}
Handle(HeaderSection_FileSchema) APIHeaderSection_MakeHeader::FsValue() const
{
@@ -349,29 +354,29 @@ Handle(HeaderSection_FileSchema) APIHeaderSection_MakeHeader::FsValue() const
void APIHeaderSection_MakeHeader::SetSchemaIdentifiers(const Handle(Interface_HArray1OfHAsciiString)& aSchemaIdentifiers)
{
if (!fs.IsNull()) fs->SetSchemaIdentifiers(aSchemaIdentifiers);
if (!fs.IsNull()) fs->SetSchemaIdentifiers(aSchemaIdentifiers);
}
void APIHeaderSection_MakeHeader::SetSchemaIdentifiersValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aSchem)
{
if (fs.IsNull()) return;
Handle(Interface_HArray1OfHAsciiString) li = fs->SchemaIdentifiers();
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aSchem);
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aSchem);
}
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::SchemaIdentifiers() const
{
return (fs.IsNull() ? nularr : fs->SchemaIdentifiers());
return (fs.IsNull() ? nularr : fs->SchemaIdentifiers());
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::SchemaIdentifiersValue(const Standard_Integer num) const
{
return (fs.IsNull() ? nulstr : fs->SchemaIdentifiersValue(num));
return (fs.IsNull() ? nulstr : fs->SchemaIdentifiersValue(num));
}
Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers () const
Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers() const
{
return (fs.IsNull() ? 0 : fs->NbSchemaIdentifiers());
return (fs.IsNull() ? 0 : fs->NbSchemaIdentifiers());
}
//=======================================================================
@@ -381,24 +386,24 @@ Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers () const
void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_HAsciiString)& aSchem)
{
if ( fs.IsNull() ) fs = new HeaderSection_FileSchema;
if (fs.IsNull()) fs = new HeaderSection_FileSchema;
Handle(Interface_HArray1OfHAsciiString) idents = fs->SchemaIdentifiers();
// check that requested subschema is already in the list
Standard_Integer i;
for ( i=1; ! idents.IsNull() && i <= idents->Length(); i++ ) {
if ( aSchem->IsSameString ( idents->Value(i) ) ) return;
for (i = 1; !idents.IsNull() && i <= idents->Length(); i++) {
if (aSchem->IsSameString(idents->Value(i))) return;
}
// add a subshema
Handle(Interface_HArray1OfHAsciiString) ids =
new Interface_HArray1OfHAsciiString ( 1, ( idents.IsNull() ? 1 : idents->Length() + 1 ) );
for ( i=1; ! idents.IsNull() && i <= idents->Length(); i++ ) {
ids->SetValue ( i, idents->Value(i) );
Handle(Interface_HArray1OfHAsciiString) ids =
new Interface_HArray1OfHAsciiString(1, (idents.IsNull() ? 1 : idents->Length() + 1));
for (i = 1; !idents.IsNull() && i <= idents->Length(); i++) {
ids->SetValue(i, idents->Value(i));
}
ids->SetValue ( i, aSchem );
fs->SetSchemaIdentifiers ( ids );
ids->SetValue(i, aSchem);
fs->SetSchemaIdentifiers(ids);
}
// ================
@@ -406,7 +411,9 @@ void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_H
// ================
Standard_Boolean APIHeaderSection_MakeHeader::HasFd() const
{ return (!fd.IsNull()); }
{
return (!fd.IsNull());
}
Handle(HeaderSection_FileDescription) APIHeaderSection_MakeHeader::FdValue() const
{
@@ -415,37 +422,37 @@ Handle(HeaderSection_FileDescription) APIHeaderSection_MakeHeader::FdValue() con
void APIHeaderSection_MakeHeader::SetDescription(const Handle(Interface_HArray1OfHAsciiString)& aDescription)
{
if (!fs.IsNull()) fd->SetDescription(aDescription);
if (!fs.IsNull()) fd->SetDescription(aDescription);
}
void APIHeaderSection_MakeHeader::SetDescriptionValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aDescr)
{
if (fd.IsNull()) return;
Handle(Interface_HArray1OfHAsciiString) li = fd->Description();
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aDescr);
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aDescr);
}
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Description() const
{
return (fd.IsNull() ? nularr : fd->Description());
return (fd.IsNull() ? nularr : fd->Description());
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::DescriptionValue(const Standard_Integer num) const
{
return (fd.IsNull() ? nulstr : fd->DescriptionValue(num));
return (fd.IsNull() ? nulstr : fd->DescriptionValue(num));
}
Standard_Integer APIHeaderSection_MakeHeader::NbDescription () const
Standard_Integer APIHeaderSection_MakeHeader::NbDescription() const
{
return (fd.IsNull() ? 0 : fd->NbDescription());
return (fd.IsNull() ? 0 : fd->NbDescription());
}
void APIHeaderSection_MakeHeader::SetImplementationLevel(const Handle(TCollection_HAsciiString)& aImplementationLevel)
{
if (!fd.IsNull()) fd->SetImplementationLevel(aImplementationLevel);
if (!fd.IsNull()) fd->SetImplementationLevel(aImplementationLevel);
}
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::ImplementationLevel() const
{
return (fd.IsNull() ? nulstr : fd->ImplementationLevel());
return (fd.IsNull() ? nulstr : fd->ImplementationLevel());
}

View File

@@ -17,7 +17,6 @@
#include <AdvApp2Var_Data_f2c.hxx>
#include <AdvApp2Var_MathBase.hxx>
#include <AdvApp2Var_Data.hxx>
#include <NCollection_Array1.hxx>
// statics
static
@@ -121,11 +120,11 @@ int mmdrvcb_(integer *ideriv,
static
int mmexthi_(integer *ndegre,
NCollection_Array1<doublereal>& hwgaus);
doublereal *hwgaus);
static
int mmextrl_(integer *ndegre,
NCollection_Array1<doublereal>& rootlg);
doublereal *rootlg);
@@ -153,7 +152,7 @@ int mmpojac_(doublereal *tparam,
integer *iordre,
integer *ncoeff,
integer *nderiv,
NCollection_Array1<doublereal>& valjac,
doublereal *valjac,
integer *iercod);
static
@@ -3765,7 +3764,7 @@ int AdvApp2Var_MathBase::mmeps1_(doublereal *epsilo)
//purpose :
//=======================================================================
int mmexthi_(integer *ndegre,
NCollection_Array1<doublereal>& hwgaus)
doublereal *hwgaus)
{
/* System generated locals */
@@ -3856,6 +3855,8 @@ int mmexthi_(integer *ndegre,
/************************************************************************
*****/
/* Parameter adjustments */
--hwgaus;
/* Function Body */
ibb = AdvApp2Var_SysBase::mnfndeb_();
@@ -3881,7 +3882,7 @@ int mmexthi_(integer *ndegre,
i__1 = *ndegre;
for (ii = ideb; ii <= i__1; ++ii) {
kpt = iadd + ii - ideb;
hwgaus(ii) = mlgdrtl_.hiltab[kpt + nmod2 * 465 - 1];
hwgaus[ii] = mlgdrtl_.hiltab[kpt + nmod2 * 465 - 1];
/* L100: */
}
@@ -3890,7 +3891,7 @@ int mmexthi_(integer *ndegre,
i__1 = ndeg2;
for (ii = 1; ii <= i__1; ++ii) {
hwgaus(ii) = hwgaus(*ndegre + 1 - ii);
hwgaus[ii] = hwgaus[*ndegre + 1 - ii];
/* L200: */
}
@@ -3898,7 +3899,7 @@ int mmexthi_(integer *ndegre,
/* associated Gauss weights are loaded. */
if (nmod2 == 1) {
hwgaus(ndeg2 + 1) = mlgdrtl_.hi0tab[ndeg2];
hwgaus[ndeg2 + 1] = mlgdrtl_.hi0tab[ndeg2];
}
/* --------------------------- The end ----------------------------------
@@ -3915,7 +3916,7 @@ int mmexthi_(integer *ndegre,
//purpose :
//=======================================================================
int mmextrl_(integer *ndegre,
NCollection_Array1<doublereal>& rootlg)
doublereal *rootlg)
{
/* System generated locals */
integer i__1;
@@ -4001,6 +4002,8 @@ int mmextrl_(integer *ndegre,
/************************************************************************
*****/
/* Parameter adjustments */
--rootlg;
/* Function Body */
ibb = AdvApp2Var_SysBase::mnfndeb_();
@@ -4026,7 +4029,7 @@ int mmextrl_(integer *ndegre,
i__1 = *ndegre;
for (ii = ideb; ii <= i__1; ++ii) {
kpt = iadd + ii - ideb;
rootlg(ii) = mlgdrtl_.rootab[kpt + nmod2 * 465 - 1];
rootlg[ii] = mlgdrtl_.rootab[kpt + nmod2 * 465 - 1];
/* L100: */
}
@@ -4037,14 +4040,14 @@ int mmextrl_(integer *ndegre,
i__1 = ndeg2;
for (ii = 1; ii <= i__1; ++ii) {
rootlg(ii) = -rootlg(*ndegre + 1 - ii);
rootlg[ii] = -rootlg[*ndegre + 1 - ii];
/* L200: */
}
/* Case NDEGRE uneven, 0 is root of Legendre polynom. */
if (nmod2 == 1) {
rootlg(ndeg2 + 1) = 0.;
rootlg[ndeg2 + 1] = 0.;
}
/* -------------------------------- THE END -----------------------------
@@ -6587,8 +6590,7 @@ L9900:
integer valbas_dim1, i__1;
/* Local variables */
doublereal vjacc[80], herm[24];
NCollection_Array1<doublereal> vjac (vjacc[0], 1, 80);
doublereal vjac[80], herm[24];
integer iord[2];
doublereal wval[4];
integer nwcof, iunit;
@@ -6783,7 +6785,7 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac] = wval[0] * vjac(ii);
valbas[ii + iorjac] = wval[0] * vjac[ii - 1];
}
/* (3) Evaluation of order 1 */
@@ -6799,8 +6801,8 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac + valbas_dim1] = wval[0] * vjac(ii + kk1)
+ wval[1] * vjac(ii);
valbas[ii + iorjac + valbas_dim1] = wval[0] * vjac[ii + kk1 - 1]
+ wval[1] * vjac[ii - 1];
}
}
@@ -6816,9 +6818,9 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac + (valbas_dim1 << 1)] = wval[0] * vjac(ii +
kk2) + wval[1] * 2 * vjac(ii + kk1) + wval[2] *
vjac(ii);
valbas[ii + iorjac + (valbas_dim1 << 1)] = wval[0] * vjac[ii +
kk2 - 1] + wval[1] * 2 * vjac[ii + kk1 - 1] + wval[2] *
vjac[ii - 1];
}
}
@@ -6834,9 +6836,9 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac + valbas_dim1 * 3] = wval[0] * vjac(ii + kk3)
+ wval[1] * 3 * vjac(ii + kk2) + wval[2] * 3 *
vjac(ii + kk1) + wval[3] * vjac(ii);
valbas[ii + iorjac + valbas_dim1 * 3] = wval[0] * vjac[ii + kk3 -
1] + wval[1] * 3 * vjac[ii + kk2 - 1] + wval[2] * 3 *
vjac[ii + kk1 - 1] + wval[3] * vjac[ii - 1];
}
}
@@ -7090,7 +7092,7 @@ int mmpojac_(doublereal *tparam,
integer *iordre,
integer *ncoeff,
integer *nderiv,
NCollection_Array1<doublereal>& valjac,
doublereal *valjac,
integer *iercod)
{
@@ -7165,6 +7167,7 @@ int mmpojac_(doublereal *tparam,
/* Parameter adjustments */
valjac_dim1 = *ncoeff;
--valjac;
/* Function Body */
@@ -7210,21 +7213,21 @@ int mmpojac_(doublereal *tparam,
/* --- Trivial Positions ----- */
valjac(1) = 1.;
valjac[1] = 1.;
aux1 = (doublereal) (*iordre + 1);
valjac(2) = aux1 * *tparam;
valjac[2] = aux1 * *tparam;
if (*nderiv >= 1) {
valjac(valjac_dim1 + 1) = 0.;
valjac(valjac_dim1 + 2) = aux1;
valjac[valjac_dim1 + 1] = 0.;
valjac[valjac_dim1 + 2] = aux1;
if (*nderiv >= 2) {
valjac((valjac_dim1 << 1) + 1) = 0.;
valjac((valjac_dim1 << 1) + 2) = 0.;
valjac[(valjac_dim1 << 1) + 1] = 0.;
valjac[(valjac_dim1 << 1) + 2] = 0.;
if (*nderiv >= 3) {
valjac(valjac_dim1 * 3 + 1) = 0.;
valjac(valjac_dim1 * 3 + 2) = 0.;
valjac[valjac_dim1 * 3 + 1] = 0.;
valjac[valjac_dim1 * 3 + 2] = 0.;
}
}
}
@@ -7244,26 +7247,26 @@ int mmpojac_(doublereal *tparam,
denom = 1. / denom;
/* --> Pi(t) */
valjac(ii) = (cofa * *tparam * valjac(kk1) + cofb * valjac(kk2)) *
valjac[ii] = (cofa * *tparam * valjac[kk1] + cofb * valjac[kk2]) *
denom;
/* --> P'i(t) */
if (*nderiv >= 1) {
valjac(ii + valjac_dim1) = (cofa * *tparam * valjac(kk1 +
valjac_dim1) + cofa * valjac(kk1) + cofb * valjac(kk2 +
valjac_dim1)) * denom;
valjac[ii + valjac_dim1] = (cofa * *tparam * valjac[kk1 +
valjac_dim1] + cofa * valjac[kk1] + cofb * valjac[kk2 +
valjac_dim1]) * denom;
/* --> P''i(t) */
if (*nderiv >= 2) {
valjac(ii + (valjac_dim1 << 1)) = (cofa * *tparam * valjac(
kk1 + (valjac_dim1 << 1)) + cofa * 2 * valjac(kk1 +
valjac_dim1) + cofb * valjac(kk2 + (valjac_dim1 << 1))
valjac[ii + (valjac_dim1 << 1)] = (cofa * *tparam * valjac[
kk1 + (valjac_dim1 << 1)] + cofa * 2 * valjac[kk1 +
valjac_dim1] + cofb * valjac[kk2 + (valjac_dim1 << 1)]
) * denom;
}
/* --> P'i(t) */
if (*nderiv >= 3) {
valjac(ii + valjac_dim1 * 3) = (cofa * *tparam * valjac(kk1 +
valjac_dim1 * 3) + cofa * 3 * valjac(kk1 + (
valjac_dim1 << 1)) + cofb * valjac(kk2 + valjac_dim1 *
3)) * denom;
valjac[ii + valjac_dim1 * 3] = (cofa * *tparam * valjac[kk1 +
valjac_dim1 * 3] + cofa * 3 * valjac[kk1 + (
valjac_dim1 << 1)] + cofb * valjac[kk2 + valjac_dim1 *
3]) * denom;
}
}
}
@@ -7274,8 +7277,8 @@ int mmpojac_(doublereal *tparam,
for (ii = 1; ii <= i__1; ++ii) {
i__2 = *nderiv;
for (jj = 0; jj <= i__2; ++jj) {
valjac(ii + jj * valjac_dim1) = tnorm[ii - 1] * valjac(ii + jj *
valjac_dim1);
valjac[ii + jj * valjac_dim1] = tnorm[ii - 1] * valjac[ii + jj *
valjac_dim1];
}
}
@@ -10655,8 +10658,7 @@ int mvgaus0_(integer *kindic,
integer i__1;
/* Local variables */
doublereal tampc[40];
NCollection_Array1<doublereal> tamp (tampc[0], 1, 40);
doublereal tamp[40];
integer ndegl, kg, ii;
/* **********************************************************************
@@ -10749,7 +10751,7 @@ int mvgaus0_(integer *kindic,
mmextrl_(&ndegl, tamp);
i__1 = *nbrval;
for (ii = 1; ii <= i__1; ++ii) {
urootl[ii] = -tamp(ii);
urootl[ii] = -tamp[ii - 1];
/* L100: */
}
@@ -10760,7 +10762,7 @@ int mvgaus0_(integer *kindic,
mmexthi_(&ndegl, tamp);
i__1 = *nbrval;
for (ii = 1; ii <= i__1; ++ii) {
hiltab[ii] = tamp(ii);
hiltab[ii] = tamp[ii - 1];
/* L200: */
}

View File

@@ -102,8 +102,8 @@ class BOPAlgo_PaveFiller;
//! aMV.SetIntersect(bIntersect); //intersect or not the shapes from <aLS>
//! //
//! aMV.Perform(); //perform the operation
//! if (aMV.HasErrors()) { //check error status
//! return;
//! if (aMV.ErrorStatus()) { //check error status
//! return;
//! }
//! //
//! const TopoDS_Shape& aResult = aMV.Shape(); //result of the operation

View File

@@ -2602,27 +2602,21 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks
}
//
if (bRebuild) {
Standard_Integer nE = aPB->Edge();
// Check if the Pave Block has the edge set
if (nE < 0) {
// untouched edge
nE = aPB->OriginalEdge();
}
Standard_Boolean isDegEdge = myDS->ShapeInfo(nE).HasFlag();
Standard_Boolean isDegEdge = myDS->ShapeInfo(aPB->Edge()).HasFlag();
if (wasRegularEdge && !isDegEdge && nV[0] == nV[1]) {
// now edge has the same vertex on both ends;
// check if it is not a regular closed curve.
const TopoDS_Edge& aE = TopoDS::Edge(myDS->Shape(nE));
const TopoDS_Edge& aE = TopoDS::Edge(myDS->Shape(aPB->Edge()));
const TopoDS_Vertex& aV = TopoDS::Vertex(myDS->Shape(nV[0]));
Standard_Real aLength = IntTools::Length(aE);
Standard_Real aTolV = BRep_Tool::Tolerance(aV);
if (aLength <= aTolV * 2.) {
// micro edge, so mark it for removal
aMicroEdges.Add(nE);
aMicroEdges.Add(aPB->Edge());
continue;
}
}
nSp = SplitEdge(nE, nV[0], aT[0], nV[1], aT[1]);
nSp = SplitEdge(aPB->Edge(), nV[0], aT[0], nV[1], aT[1]);
if (bCB)
aCB->SetEdge(nSp);
else

View File

@@ -1074,7 +1074,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T,
}
// allocate the arrays
TColStd_Array1OfInteger Free (1, Max (1, 2 * nFree));
TColStd_Array1OfInteger Free(1,2*nFree);
// array is replaced on map because it is impossible
// to calculate number of internal edges in advance

View File

@@ -13,11 +13,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// ---------------------
// ---------------------
// Version: 0.0
// Version Date Purpose
// 0.0 Feb 10 1997 Creation
// Version: 0.0
//Version Date Purpose
// 0.0 Feb 10 1997 Creation
#include <DDF.hxx>
@@ -64,11 +64,11 @@
//=======================================================================
static Standard_Integer DDF_Children (Draw_Interpretor& di,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
if (n < 2) return 1;
Handle(TDF_Data) DF;
TCollection_AsciiString entry;
@@ -97,11 +97,11 @@ static Standard_Integer DDF_Children (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_Attributes (Draw_Interpretor& di,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
if (n != 3) return 1;
Handle(TDF_Data) DF;
if (!DDF::GetDF (a[1], DF)) return 1;
@@ -124,11 +124,11 @@ static Standard_Integer DDF_Attributes (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_ForgetAll(Draw_Interpretor& /*di*/,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
if (n != 3) return 1;
Handle(TDF_Data) DF;
if (!DDF::GetDF (a[1], DF)) return 1;
@@ -137,35 +137,11 @@ static Standard_Integer DDF_ForgetAll(Draw_Interpretor& /*di*/,
TDF_Tool::Label(DF,a[2],label);
if (label.IsNull()) return 1;
label.ForgetAllAttributes();
//POP pour NT
//POP pour NT
return 0;
}
//=======================================================================
//function : ForgetAttribute
//purpose : "ForgetAtt dfname Label guid"
//=======================================================================
static Standard_Integer DDF_ForgetAttribute(Draw_Interpretor& di,
Standard_Integer n,
const char** a)
{
if (n != 4) return 1;
Handle(TDF_Data) DF;
if (!DDF::GetDF (a[1], DF)) return 1;
TDF_Label aLabel;
TDF_Tool::Label(DF,a[2],aLabel);
if (aLabel.IsNull()) return 1;
if (!Standard_GUID::CheckGUIDFormat(a[3]))
{
di<<"DDF: The format of GUID is invalid\n";
return 1;
}
Standard_GUID guid(a[3]);
aLabel.ForgetAttribute(guid);
return 0;
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// save/restore & Store/Retrieve commands
@@ -233,8 +209,8 @@ void ErrorMessage (const Storage_Error n)
//=======================================================================
static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
Standard_Integer nb,
const char** arg)
{
if (nb == 3) {
Handle(TDF_Data) DF;
@@ -256,8 +232,8 @@ static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
Standard_Integer nb,
const char** arg)
{
if (nb == 3) {
Handle(TDF_Data) DF;
@@ -278,8 +254,8 @@ static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_NewChild (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
Standard_Integer nb,
const char** arg)
{
Handle(TDF_Data) DF;
if (nb>=2){
@@ -338,38 +314,35 @@ void DDF::BasicCommands (Draw_Interpretor& theCommands)
const char* g = "DF basic commands";
// Label :
// Label :
theCommands.Add ("SetTagger",
"SetTagger (DF, entry)",
__FILE__, DDF_SetTagger, g);
__FILE__, DDF_SetTagger, g);
theCommands.Add ("NewTag",
"NewTag (DF, tagger)",
__FILE__, DDF_NewTag, g);
__FILE__, DDF_NewTag, g);
theCommands.Add ("NewChild",
"NewChild (DF, [tagger])",
__FILE__, DDF_NewChild, g);
__FILE__, DDF_NewChild, g);
theCommands.Add ("Children",
" Returns the list of label children: Children DF label",
__FILE__, DDF_Children, g);
" Returns the list of label children: Children DF label",
__FILE__, DDF_Children, g);
theCommands.Add ("Attributes",
" Returns the list of label attributes: Attributes DF label",
__FILE__, DDF_Attributes, g);
" Returns the list of label attributes: Attributes DF label",
__FILE__, DDF_Attributes, g);
theCommands.Add ("ForgetAll",
"Forgets all attributes from the label: ForgetAll DF Label",
__FILE__, DDF_ForgetAll, g);
theCommands.Add ("ForgetAtt",
"Forgets the specified by guid attribute from the label: ForgetAtt DF Label guid",
__FILE__, DDF_ForgetAttribute, g);
"Forgets all attributes from the label: ForgetAll DF Label",
__FILE__, DDF_ForgetAll, g);
theCommands.Add ("Label",
"Label DF entry",
__FILE__, DDF_Label, g);
"Label DF entry",
__FILE__, DDF_Label, g);
}

View File

@@ -350,11 +350,6 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
#else
di << "FreeImage disabled\n";
#endif
#ifdef HAVE_FFMPEG
di << "FFmpeg enabled (HAVE_FFMPEG)\n";
#else
di << "FFmpeg disabled\n";
#endif
#ifdef HAVE_GLES2
di << "OpenGL: ES2\n";
#else

View File

@@ -576,12 +576,13 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& C)
//-- if(Nbp < MinNb) { cout<<"\n*"; } else { cout<<"\n."; }
while(Nbp < MinNb) {
//-- cout<<" \nGCPnts TangentialDeflection : Ajout de Points ("<<Nbp<<" "<<minNbPnts<<" )"<<endl;
for (i = 2; i <= Nbp; i += 2) {
for(i=2; i<=Nbp; i++) {
MiddleU = (parameters.Value(i-1)+parameters.Value(i))*0.5;
D0 (C, MiddleU, MiddlePoint);
parameters.InsertBefore(i,MiddleU);
points.InsertBefore(i,MiddlePoint);
Nbp++;
i++;
}
}
//Additional check for intervals

View File

@@ -294,8 +294,6 @@ GccAna_Circ2d3Tan::
else {
TheSame1(NbrSol) = 0;
gp_Dir2d dc(center1.XY()-Center.XY());
if (qualifier1(NbrSol) == GccEnt_enclosed)
dc.Reverse(); // if tangent circle is inside the source circle, moving to edge of source circle
pnttg1sol(NbrSol)=gp_Pnt2d(Center.XY()+Radius(k1)*dc.XY());
par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),
pnttg1sol(NbrSol));

View File

@@ -185,10 +185,9 @@ GccAna_Circ2d3Tan::
else {
TheSame1(NbrSol) = 0;
gp_Dir2d dc(center1.XY()-Center.XY());
if (qualifier1(NbrSol) == GccEnt_enclosed)
dc.Reverse(); // if tangent circle is inside the source circle, moving to edge of source circle
pnttg1sol(NbrSol)=gp_Pnt2d(Center.XY()+Radius(nbsol3)*dc.XY());
par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol), pnttg1sol(NbrSol));
par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),
pnttg1sol(NbrSol));
pararg1(NbrSol)=ElCLib::Parameter(C1,pnttg1sol(NbrSol));
}

View File

@@ -22,45 +22,6 @@
#include <GccEnt_QualifiedLin.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Lin2d.hxx>
#include <TCollection_AsciiString.hxx>
namespace
{
static Standard_CString GccEnt_Table_PrintPosition[5] =
{
"UNQUALIFIED", "ENCLOSING", "ENCLOSED", "OUTSIDE", "NOQUALIFIER"
};
}
//=======================================================================
//function : PositionToString
//purpose :
//=======================================================================
Standard_CString GccEnt::PositionToString (GccEnt_Position thePosition)
{
return GccEnt_Table_PrintPosition[thePosition];
}
//=======================================================================
//function : PositionFromString
//purpose :
//=======================================================================
Standard_Boolean GccEnt::PositionFromString (Standard_CString thePositionString,
GccEnt_Position& thePosition)
{
TCollection_AsciiString aName (thePositionString);
aName.UpperCase();
for (Standard_Integer aTypeIter = 0; aTypeIter <= GccEnt_noqualifier; ++aTypeIter)
{
Standard_CString aTypeName = GccEnt_Table_PrintPosition[aTypeIter];
if (aName == aTypeName)
{
thePosition = GccEnt_Position(aTypeIter);
return Standard_True;
}
}
return Standard_False;
}
GccEnt_QualifiedLin
GccEnt::Unqualified(const gp_Lin2d& Line) {

View File

@@ -17,7 +17,6 @@
#ifndef _GccEnt_HeaderFile
#define _GccEnt_HeaderFile
#include <GccEnt_Position.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
@@ -54,34 +53,6 @@ public:
DEFINE_STANDARD_ALLOC
//! Prints the name of Position type as a String on the Stream.
static Standard_OStream& Print (const GccEnt_Position thePosition, Standard_OStream& theStream)
{
return (theStream << PositionToString (thePosition));
}
//! Returns the string name for a given position.
//! @param thePosition position type
//! @return string identifier from the list UNQUALIFIED ENCLOSING ENCLOSED OUTSIDE NOQUALIFIER
Standard_EXPORT static Standard_CString PositionToString (GccEnt_Position thePosition);
//! Returns the position from the given string identifier (using case-insensitive comparison).
//! @param thePositionString string identifier
//! @return position or GccEnt_unqualified if string identifier is invalid
static GccEnt_Position PositionFromString (Standard_CString thePositionString)
{
GccEnt_Position aPosition = GccEnt_unqualified;
PositionFromString (thePositionString, aPosition);
return aPosition;
}
//! Determines the position from the given string identifier (using case-insensitive comparison).
//! @param thePositionString string identifier
//! @param thePosition detected shape type
//! @return TRUE if string identifier is known
Standard_EXPORT static Standard_Boolean PositionFromString (Standard_CString thePositionString,
GccEnt_Position& thePosition);
//! Constructs a qualified line,
//! so that the relative position to the circle or line of the

View File

@@ -72,90 +72,12 @@ GeomEvaluator_OffsetSurface::GeomEvaluator_OffsetSurface(
{
}
// If point is on parametric boundary, and calculation of normal fails,
// try shifting it towards the inside in the hope that derivatives
// are better defined there.
//
// NB: temporarily this is made as static function and not class method,
// hence code duplications
static Standard_Boolean shiftPoint (Standard_Real& theU, Standard_Real& theV,
const Handle(Geom_Surface)& theSurf,
const Handle(GeomAdaptor_HSurface)& theAdaptor)
{
// Get parametric bounds and closure status
Standard_Real aUMin, aUMax, aVMin, aVMax;
Standard_Boolean isUPeriodic, isVPeriodic;
if (! theSurf.IsNull())
{
theSurf->Bounds (aUMin, aUMax, aVMin, aVMax);
isUPeriodic = theSurf->IsUPeriodic();
isVPeriodic = theSurf->IsVPeriodic();
}
else
{
aUMin = theAdaptor->FirstUParameter();
aUMax = theAdaptor->LastUParameter();
aVMin = theAdaptor->FirstVParameter();
aVMax = theAdaptor->LastVParameter();
isUPeriodic = theAdaptor->IsUPeriodic();
isVPeriodic = theAdaptor->IsVPeriodic();
}
Standard_Boolean isShifted = Standard_False;
// shift by U
if (! isUPeriodic && aUMax - aUMin > 2 * Precision::PConfusion())
{
if (Abs (theU - aUMin) < Precision::PConfusion())
{
theU += Precision::PConfusion();
isShifted = Standard_True;
}
else if (Abs (theU - aUMax) < Precision::PConfusion())
{
theU -= Precision::PConfusion();
isShifted = Standard_True;
}
}
// shift by V
if (! isVPeriodic && aVMax - aVMin > 2 * Precision::PConfusion())
{
if (Abs (theV - aVMin) < Precision::PConfusion())
{
theV += Precision::PConfusion();
isShifted = Standard_True;
}
else if (Abs (theV - aVMax) < Precision::PConfusion())
{
theV -= Precision::PConfusion();
isShifted = Standard_True;
}
}
return isShifted;
}
void GeomEvaluator_OffsetSurface::D0(
const Standard_Real theU, const Standard_Real theV, gp_Pnt& theValue) const
{
gp_Vec aD1U, aD1V;
BaseD1(theU, theV, theValue, aD1U, aD1V);
try
{
CalculateD0(theU, theV, theValue, aD1U, aD1V);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD1(aU, aV, theValue, aD1U, aD1V);
CalculateD0(theU, theV, theValue, aD1U, aD1V);
}
CalculateD0(theU, theV, theValue, aD1U, aD1V);
}
void GeomEvaluator_OffsetSurface::D1(
@@ -164,21 +86,7 @@ void GeomEvaluator_OffsetSurface::D1(
{
gp_Vec aD2U, aD2V, aD2UV;
BaseD2(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
try
{
CalculateD1(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD2 (aU, aV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
CalculateD1(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
}
CalculateD1(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
}
void GeomEvaluator_OffsetSurface::D2(
@@ -189,24 +97,8 @@ void GeomEvaluator_OffsetSurface::D2(
gp_Vec aD3U, aD3V, aD3UUV, aD3UVV;
BaseD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
try
{
CalculateD2(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
CalculateD2(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
}
CalculateD2(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
}
void GeomEvaluator_OffsetSurface::D3(
@@ -217,24 +109,8 @@ void GeomEvaluator_OffsetSurface::D3(
{
BaseD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
try
{
CalculateD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD3(aU, aV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
CalculateD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
}
CalculateD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
}
gp_Vec GeomEvaluator_OffsetSurface::DN(
@@ -249,21 +125,7 @@ gp_Vec GeomEvaluator_OffsetSurface::DN(
gp_Pnt aP;
gp_Vec aD1U, aD1V;
BaseD1(theU, theV, aP, aD1U, aD1V);
try
{
return CalculateDN(theU, theV, theDerU, theDerV, aD1U, aD1V);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD1 (aU, aV, aP, aD1U, aD1V);
return CalculateDN (theU, theV, theDerU, theDerV, aD1U, aD1V);
}
return CalculateDN(theU, theV, theDerU, theDerV, aD1U, aD1V);
}

View File

@@ -5,9 +5,6 @@ GeometryTest_APICommands.cxx
GeometryTest_ConstraintCommands.cxx
GeometryTest_ContinuityCommands.cxx
GeometryTest_CurveCommands.cxx
GeometryTest_CurveTanCommands.cxx
GeometryTest_DrawableQualifiedCurve2d.cxx
GeometryTest_DrawableQualifiedCurve2d.hxx
GeometryTest_FairCurveCommands.cxx
GeometryTest_PolyCommands.cxx
GeometryTest_SurfaceCommands.cxx

View File

@@ -30,7 +30,6 @@ void GeometryTest::AllCommands(Draw_Interpretor& theCommands)
GeomliteTest::AllCommands(theCommands);
GeometryTest::CurveCommands(theCommands);
GeometryTest::CurveTanCommands(theCommands);
GeometryTest::FairCurveCommands(theCommands);
GeometryTest::SurfaceCommands(theCommands);
GeometryTest::ConstraintCommands(theCommands);

View File

@@ -39,9 +39,6 @@ public:
//! defines curve commands.
Standard_EXPORT static void CurveCommands (Draw_Interpretor& I);
//! defines tangent curve commands.
Standard_EXPORT static void CurveTanCommands (Draw_Interpretor& I);
//! defines fair curve commands.
Standard_EXPORT static void FairCurveCommands (Draw_Interpretor& I);

View File

@@ -1,340 +0,0 @@
// Created on: 2017-06-16
// Created by: Natalia ERMOLAEVA
// Copyright (c) 2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Draw.hxx>
#include <DrawTrSurf.hxx>
#include <Draw_Interpretor.hxx>
#include <GccAna_Circ2d3Tan.hxx>
#include <GccEnt.hxx>
#include <GccEnt_QualifiedLin.hxx>
#include <GccEnt_QualifiedCirc.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <GeometryTest.hxx>
#include <GeometryTest_DrawableQualifiedCurve2d.hxx>
#include <Precision.hxx>
#include <TCollection_AsciiString.hxx>
#include <stdio.h>
//=======================================================================
//function : qcircle
//purpose : Parses command: "qcircle name x y radius [-unqualified|-enclosing|-enclosed|-outside|-noqualifier]"
//=======================================================================
static Standard_Integer qcurve (Draw_Interpretor&, Standard_Integer theArgsNb, const char** theArgVec)
{
if (theArgsNb < 5)
{
cout << "Error: wrong number of arguments.\n";
return 1;
}
Handle(Geom2d_Curve) aResult2d;
TCollection_AsciiString aPositionType;
if (!strcmp (theArgVec[0], "qcircle"))
{
if (theArgsNb == 5 || theArgsNb == 6)
aResult2d = new Geom2d_Circle (gp_Ax22d (gp_Pnt2d (Draw::Atof (theArgVec[2]), Draw::Atof (theArgVec[3])),
gp_Dir2d (1,0)), Draw::Atof (theArgVec[4]));
else if (theArgsNb == 7 || theArgsNb == 8)
aResult2d = new Geom2d_Circle (gp_Ax22d (gp_Pnt2d (Draw::Atof (theArgVec[2]), Draw::Atof (theArgVec[3])),
gp_Dir2d (Draw::Atof (theArgVec[4]), Draw::Atof (theArgVec[5]))), Draw::Atof (theArgVec[6]));
if (theArgsNb == 6)
aPositionType = theArgVec[5];
else if (theArgsNb == 8)
aPositionType = theArgVec[7];
}
else if(!strcmp (theArgVec[0], "qline"))
{
if (theArgsNb < 6)
{
cout << "Error: wrong number of arguments.\n";
return 1;
}
aResult2d = new Geom2d_Line (gp_Pnt2d (Draw::Atof (theArgVec[2]), Draw::Atof (theArgVec[3])),
gp_Dir2d (Draw::Atof (theArgVec[4]), Draw::Atof (theArgVec[5])));
if (theArgsNb == 7)
aPositionType = theArgVec[6];
}
else
{
cout << "Error: wrong command name.\n";
return 1;
}
GccEnt_Position aKindOfPosition = GccEnt_unqualified;
if (!aPositionType.IsEmpty())
{
GccEnt_Position aParameterPosition;
if (GccEnt::PositionFromString (aPositionType.ToCString(), aParameterPosition))
aKindOfPosition = aParameterPosition;
}
Draw::Set (theArgVec[1], new GeometryTest_DrawableQualifiedCurve2d (aResult2d, aKindOfPosition));
return 0;
}
//=======================================================================
//function : solutions
//purpose :
//=======================================================================
static Standard_Integer solutions (Draw_Interpretor& theDI, GccAna_Circ2d3Tan& theCirTan3, const char* theName)
{
if (!theCirTan3.IsDone())
{
cout << "GccAna_Circ2d3Tan is not done";
return 1;
}
TCollection_AsciiString aName = TCollection_AsciiString (theName) + "_";
GccEnt_Position aQualifier1, aQualifier2, aQualifier3;
Standard_Real aParSol, aParArg;
gp_Pnt2d aPntSol;
for (Standard_Integer aSolId = 1; aSolId <= theCirTan3.NbSolutions(); aSolId++)
{
Handle(Geom2d_Circle) aCircle = new Geom2d_Circle (theCirTan3.ThisSolution (aSolId));
TCollection_AsciiString aSolIdName = aName;
aSolIdName += TCollection_AsciiString (aSolId);
DrawTrSurf::Set (aSolIdName.ToCString(), aCircle);
theCirTan3.WhichQualifier (aSolId, aQualifier1, aQualifier2, aQualifier3);
theDI << "circle: " << aSolIdName.ToCString() << ", " << "qualifiers: " << GccEnt::PositionToString (aQualifier1)
<< ", " << GccEnt::PositionToString (aQualifier2) << ", " << GccEnt::PositionToString (aQualifier3) << "\n";
theDI << " tangent points: point (parameter on solution, parameter on argument)\n";
// the first tangent point
if (theCirTan3.IsTheSame1 (aSolId))
theDI << " " << "= the solution number " << aSolId << " is equal to the first argument\n";
else
{
theCirTan3.Tangency1 (aSolId, aParSol, aParArg, aPntSol);
TCollection_AsciiString aTanPntIdName = aSolIdName + "_tp_1";
DrawTrSurf::Set (aTanPntIdName.ToCString(), aPntSol);
theDI << " " << aTanPntIdName.ToCString() << " (" << aParSol << ", " << aParArg << ")\n";
}
// the second tangent point
if (theCirTan3.IsTheSame2 (aSolId))
theDI << " " << "= the solution number " << aSolId << " is equal to the second argument\n";
else
{
theCirTan3.Tangency2 (aSolId, aParSol, aParArg, aPntSol);
TCollection_AsciiString aTanPntIdName = aSolIdName + "_tp_2";
DrawTrSurf::Set (aTanPntIdName.ToCString(), aPntSol);
theDI << " " << aTanPntIdName.ToCString() << " (" << aParSol << ", " << aParArg << ")\n";
}
// the third tangent point
if (theCirTan3.IsTheSame3 (aSolId))
theDI << " " << "= the solution number " << aSolId << " is equal to the third argument\n";
else
{
theCirTan3.Tangency3 (aSolId, aParSol, aParArg, aPntSol);
TCollection_AsciiString aTanPntIdName = aSolIdName + "_tp_3";
DrawTrSurf::Set (aTanPntIdName.ToCString(), aPntSol);
theDI << " " << aTanPntIdName.ToCString() << " (" << aParSol << ", " << aParArg << ")";
}
if (aSolId != theCirTan3.NbSolutions())
theDI << "\n";
}
return 0;
}
//=======================================================================
//function : circ2d3Tan
//purpose : Parses command: [circ2d3Tan cname qcicrle1/qlin1/point1 qcicrle2/qlin2/point2 qcicrle3/qlin3/point3
// tolerance]
//=======================================================================
static Standard_Integer circ2d3Tan (Draw_Interpretor& theDI, Standard_Integer theArgsNb, const char** theArgVec)
{
if (theArgsNb < 5)
{
cout << "Error: wrong number of arguments.\n";
return 1;
}
Handle(GeometryTest_DrawableQualifiedCurve2d) aQCurve1 =
Handle(GeometryTest_DrawableQualifiedCurve2d)::DownCast (Draw::Get (theArgVec[2]));
Handle(GeometryTest_DrawableQualifiedCurve2d) aQCurve2 =
Handle(GeometryTest_DrawableQualifiedCurve2d)::DownCast (Draw::Get (theArgVec[3]));
Handle(GeometryTest_DrawableQualifiedCurve2d) aQCurve3 =
Handle(GeometryTest_DrawableQualifiedCurve2d)::DownCast (Draw::Get (theArgVec[4]));
gp_Pnt2d aPoint1, aPoint2, aPoint3;
Standard_Boolean anIsPoint1 = DrawTrSurf::GetPoint2d (theArgVec[2], aPoint1);
Standard_Boolean anIsPoint2 = DrawTrSurf::GetPoint2d (theArgVec[3], aPoint2);
Standard_Boolean anIsPoint3 = DrawTrSurf::GetPoint2d (theArgVec[4], aPoint3);
Standard_Real aTolerance = Precision::Confusion();
if (theArgsNb > 5)
aTolerance = Draw::Atof (theArgVec[5]);
if (aQCurve1.IsNull()) // <point, point, point>
{
if (!anIsPoint1 || !anIsPoint2 || !anIsPoint3)
{
cout << "Error: wrong points definition.\n";
return 1;
}
GccAna_Circ2d3Tan aCircBuilder (aPoint1, aPoint2, aPoint3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
// the first curve is not NULL
if (aQCurve2.IsNull()) // <qcircle, point, point> or <qlin, point, point>
{
if (!anIsPoint2 || !anIsPoint3)
{
cout << "Error: wrong points definition.\n";
return 1;
}
Geom2dAdaptor_Curve anAdaptorCurve1 (aQCurve1->GetCurve());
if (anAdaptorCurve1.GetType() == GeomAbs_Circle)
{
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aPoint2, aPoint3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
else if (anAdaptorCurve1.GetType() == GeomAbs_Line)
{
GccEnt_QualifiedLin aQualifiedLin1 (anAdaptorCurve1.Line(), aQCurve1->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedLin1, aPoint2, aPoint3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
cout << "Error: wrong curve type.\n";
return 1;
}
// the first and the second curves are not NULL
if (aQCurve3.IsNull()) // <qcircle, qcircle, point> or <qcircle, qlin, point> or <qlin, qlin, point>
{
if (!anIsPoint3)
{
cout << "Error: wrong point definition.\n";
return 1;
}
Geom2dAdaptor_Curve anAdaptorCurve1 (aQCurve1->GetCurve());
Geom2dAdaptor_Curve anAdaptorCurve2 (aQCurve2->GetCurve());
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Circle)
{
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
GccEnt_QualifiedCirc aQualifiedCircle2 (anAdaptorCurve2.Circle(), aQCurve2->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedCircle2, aPoint3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
else if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Line)
{
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedLin2, aPoint3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
else if (anAdaptorCurve1.GetType() == GeomAbs_Line && anAdaptorCurve2.GetType() == GeomAbs_Line)
{
GccEnt_QualifiedLin aQualifiedLin1 (anAdaptorCurve1.Line(), aQCurve1->GetPosition());
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedLin1, aQualifiedLin2, aPoint3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
cout << "Error: wrong curve type.\n";
return 1;
}
// the first, the second and the third curves are not NULL
// <qcircle, qcircle, qcircle> or <qcircle, qcircle, qlin>, <qcircle, qlin, qlin>, <qlin, qlin, qlin>
Geom2dAdaptor_Curve anAdaptorCurve1 (aQCurve1->GetCurve());
Geom2dAdaptor_Curve anAdaptorCurve2 (aQCurve2->GetCurve());
Geom2dAdaptor_Curve anAdaptorCurve3 (aQCurve3->GetCurve());
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Circle &&
anAdaptorCurve3.GetType() == GeomAbs_Circle)
{
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
GccEnt_QualifiedCirc aQualifiedCircle2 (anAdaptorCurve2.Circle(), aQCurve2->GetPosition());
GccEnt_QualifiedCirc aQualifiedCircle3 (anAdaptorCurve3.Circle(), aQCurve3->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedCircle2, aQualifiedCircle3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Circle &&
anAdaptorCurve3.GetType() == GeomAbs_Line)
{
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
GccEnt_QualifiedCirc aQualifiedCircle2 (anAdaptorCurve2.Circle(), aQCurve2->GetPosition());
GccEnt_QualifiedLin aQualifiedLin3 (anAdaptorCurve3.Line(), aQCurve3->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedCircle2, aQualifiedLin3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Line &&
anAdaptorCurve3.GetType() == GeomAbs_Line)
{
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
GccEnt_QualifiedLin aQualifiedLin3 (anAdaptorCurve3.Line(), aQCurve3->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedLin2, aQualifiedLin3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
if (anAdaptorCurve1.GetType() == GeomAbs_Line && anAdaptorCurve2.GetType() == GeomAbs_Line &&
anAdaptorCurve3.GetType() == GeomAbs_Line)
{
GccEnt_QualifiedLin aQualifiedLin1 (anAdaptorCurve1.Line(), aQCurve1->GetPosition());
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
GccEnt_QualifiedLin aQualifiedLin3 (anAdaptorCurve3.Line(), aQCurve3->GetPosition());
GccAna_Circ2d3Tan aCircBuilder (aQualifiedLin1, aQualifiedLin2, aQualifiedLin3, aTolerance);
return solutions (theDI, aCircBuilder, theArgVec[1]);
}
cout << "Error: wrong curve type.\n";
return 1;
}
//=======================================================================
//function : CurveTanCommands
//purpose :
//=======================================================================
void GeometryTest::CurveTanCommands (Draw_Interpretor& theCommands)
{
static Standard_Boolean aLoaded = Standard_False;
if (aLoaded) return;
aLoaded = Standard_True;
DrawTrSurf::BasicCommands (theCommands);
const char* aGroup;
aGroup = "GEOMETRY tangent curves creation";
theCommands.Add ("qcircle",
"qcircle name {x y [ux uy] radius} [-unqualified|-enclosing|-enclosed|-outside|-noqualifier]"
"\n\t\t: Creates qualified circle.",
__FILE__, qcurve, aGroup);
theCommands.Add ("qline",
"qline name x y dx dy [-unqualified|-enclosing|-enclosed|-outside|-noqualifier]"
"\n\t\t: Creates qualified line.",
__FILE__, qcurve, aGroup);
theCommands.Add ("circ2d3Tan",
"circ2d3Tan cname {qcicrle1|qlin1|point1} {qcicrle2|qlin2|point2} {qcicrle3|qlin3|point3} [tolerance]"
"\n\t\t: Creates 2d circles tangent to 3 arguments. The arguments are points, lines or circles."
"\n\t\t: Possible arguments combinations:"
"\n\t\t: <qcircle, qcircle, qcircle>,"
"\n\t\t: <qcircle, qcircle, qlin>,"
"\n\t\t: <qcircle, qcircle, point>,"
"\n\t\t: <qcircle, qlin, qlin>,"
"\n\t\t: <qcircle, qlin, point>,"
"\n\t\t: <qcircle, qlin, qlin>,"
"\n\t\t: <qcircle, point, point>,"
"\n\t\t: <qlin, qlin, qlin>,"
"\n\t\t: <qlin, qlin, point>,"
"\n\t\t: <qlin, point, point>,"
"\n\t\t: <point, point, point>.",
__FILE__, circ2d3Tan, aGroup);
}

View File

@@ -1,96 +0,0 @@
// Created on: 2017-06-16
// Created by: Natalia ERMOLAEVA
// Copyright (c) 2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <GeometryTest_DrawableQualifiedCurve2d.hxx>
#include <GccEnt.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
IMPLEMENT_STANDARD_RTTIEXT(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve2d)
//=======================================================================
//function : GeometryTest_DrawableQualifiedCurve2d
//purpose :
//=======================================================================
GeometryTest_DrawableQualifiedCurve2d::GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
const GccEnt_Position thePosition,
const Standard_Boolean theDispOrigin)
: DrawTrSurf_Curve2d (theCurve, theDispOrigin), myPosition (thePosition)
{
look = Draw_orange;
}
//=======================================================================
//function : GeometryTest_DrawableQualifiedCurve2d
//purpose :
//=======================================================================
GeometryTest_DrawableQualifiedCurve2d::GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
const Draw_Color& theColor,
const Standard_Integer theDiscret,
const GccEnt_Position thePosition,
const Standard_Boolean theDispOrigin,
const Standard_Boolean theDispCurvRadius,
const Standard_Real theRadiusMax,
const Standard_Real theRatioOfRadius)
: DrawTrSurf_Curve2d (theCurve, theColor, theDiscret, theDispOrigin, theDispCurvRadius, theRadiusMax, theRatioOfRadius),
myPosition (thePosition)
{
look = Draw_orange;
}
//=======================================================================
//function : DrawOn
//purpose :
//=======================================================================
void GeometryTest_DrawableQualifiedCurve2d::DrawOn (Draw_Display& theDisplay) const
{
DrawTrSurf_Curve2d::DrawOn (theDisplay);
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
void GeometryTest_DrawableQualifiedCurve2d::Dump (Standard_OStream& theStream) const
{
theStream << "Qualified curve 2D: \n";
theStream << "Position :" << GccEnt::PositionToString (myPosition) << "\n";
DrawTrSurf_Curve2d::Dump (theStream);
}
//=======================================================================
//function : Whatis
//purpose :
//=======================================================================
void GeometryTest_DrawableQualifiedCurve2d::Whatis (Draw_Interpretor& theDI)const
{
Handle(Standard_Type) aType = GetCurve()->DynamicType();
if (aType == STANDARD_TYPE (Geom2d_Circle))
{
theDI << "qualified 2d Circle";
}
else if (aType == STANDARD_TYPE (Geom2d_Line))
{
theDI << "qualified 2d Line";
}
}

View File

@@ -1,88 +0,0 @@
// Created on: 2017-06-16
// Created by: Natalia ERMOLAEVA
// Copyright (c) 2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _GeometryTest_DrawableQualifiedCirc_HeaderFile
#define _GeometryTest_DrawableQualifiedCirc_HeaderFile
#include <Standard.hxx>
#include <DrawTrSurf_Curve2d.hxx>
#include <GccEnt_Position.hxx>
class Geom2d_Curve;
class GeometryTest_DrawableQualifiedCurve2d;
DEFINE_STANDARD_HANDLE(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve)
//! Create geom curve drawable presentation with the position of a solution of a construction algorithm.
class GeometryTest_DrawableQualifiedCurve2d : public DrawTrSurf_Curve2d
{
public:
//! Creates a drawable curve from a curve of package Geom.
Standard_EXPORT GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
const GccEnt_Position thePosition,
const Standard_Boolean theDispOrigin = Standard_True);
//! Creates a drawable curve from a curve of package Geom.
Standard_EXPORT GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
const Draw_Color& theColor,
const Standard_Integer theDiscret,
const GccEnt_Position thePosition,
const Standard_Boolean theDispOrigin = Standard_True,
const Standard_Boolean theDispCurvRadius = Standard_False,
const Standard_Real theRadiusMax = 1.0e3,
const Standard_Real theRatioOfRadius = 0.1);
//! \returns position of a solution
Standard_EXPORT GccEnt_Position GetPosition() const { return myPosition; }
//! Sets position of a solution
//! \param thePosition the value
void SetPosition (const GccEnt_Position thePosition) { myPosition = thePosition; }
//! Paints the drawable presentation in given display
//! \param theDisplay
Standard_EXPORT void DrawOn (Draw_Display& theDisplay) const Standard_OVERRIDE;
//! For variable dump.
Standard_EXPORT virtual void Dump (Standard_OStream& S) const Standard_OVERRIDE;
//! For variable whatis command. Set as a result the
//! type of the variable.
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve2d)
protected:
private:
GccEnt_Position myPosition;
};
#endif // _GeometryTest_DrawableQualifiedCirc_HeaderFile

View File

@@ -6,6 +6,7 @@ Graphic3d_ArrayOfPolylines.cxx
Graphic3d_ArrayOfPolylines.hxx
Graphic3d_ArrayOfPrimitives.cxx
Graphic3d_ArrayOfPrimitives.hxx
Graphic3d_ArrayOfPrimitives.lxx
Graphic3d_ArrayOfQuadrangles.cxx
Graphic3d_ArrayOfQuadrangles.hxx
Graphic3d_ArrayOfQuadrangleStrips.cxx

View File

@@ -14,18 +14,22 @@
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_Group.hxx>
#include <NCollection_AlignedAllocator.hxx>
#include <OSD_Environment.hxx>
#include <Quantity_Color.hxx>
#include <Standard.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <stdio.h>
#include <stdlib.h>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPrimitives,Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPrimitives, Standard_Transient)
// =======================================================================
// function : Graphic3d_ArrayOfPrimitives
// purpose :
// =======================================================================
Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOfPrimitiveArray theType,
const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxBounds,
@@ -148,11 +152,7 @@ Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOf
myMaxEdges = theMaxEdges;
}
// =======================================================================
// function : ~Graphic3d_ArrayOfPrimitives
// purpose :
// =======================================================================
Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
void Graphic3d_ArrayOfPrimitives::Destroy()
{
myVNor = 0;
myVTex = 0;
@@ -162,10 +162,98 @@ Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
myBounds .Nullify();
}
// =======================================================================
// function : AddBound
// purpose :
// =======================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX,
const Standard_ShortReal theY,
const Standard_ShortReal theZ)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const Quantity_Color& theColor)
{
const Standard_Integer anIndex = AddVertex (theVertex);
SetVertexColor (anIndex, theColor.Red(), theColor.Green(), theColor.Blue());
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const Standard_Integer theColor32)
{
const Standard_Integer anIndex = AddVertex (theVertex);
SetVertexColor (anIndex, theColor32);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ,
const Standard_ShortReal theNX, const Standard_ShortReal theNY, const Standard_ShortReal theNZ)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
SetVertexNormal (anIndex, theNX, theNY, theNZ);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal,
const Quantity_Color& theColor)
{
const Standard_Integer anIndex = AddVertex (theVertex, theNormal);
SetVertexColor (anIndex, theColor.Red(), theColor.Green(), theColor.Blue());
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal,
const Standard_Integer theColor32)
{
const Standard_Integer anIndex = AddVertex (theVertex, theNormal);
SetVertexColor (anIndex, theColor32);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ,
const Standard_ShortReal theTX, const Standard_ShortReal theTY)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
SetVertexTexel (anIndex, theTX, theTY);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ,
const Standard_ShortReal theNX, const Standard_ShortReal theNY, const Standard_ShortReal theNZ,
const Standard_ShortReal theTX, const Standard_ShortReal theTY)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
SetVertexNormal (anIndex, theNX, theNY, theNZ);
SetVertexTexel (anIndex, theTX, theTY);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer theEdgeNumber)
{
if (myBounds.IsNull())
@@ -183,10 +271,12 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer t
return anIndex;
}
// =======================================================================
// function : AddBound
// purpose :
// =======================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer theEdgeNumber,
const Quantity_Color& theColor)
{
return AddBound (theEdgeNumber, theColor.Red(), theColor.Green(), theColor.Blue());
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer theEdgeNumber,
const Standard_Real theR,
const Standard_Real theG,
@@ -208,10 +298,6 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer t
return anIndex;
}
// =======================================================================
// function : AddEdge
// purpose :
// =======================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge (const Standard_Integer theVertexIndex)
{
if (myIndices.IsNull())
@@ -237,10 +323,59 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge (const Standard_Integer th
return anIndex;
}
// =======================================================================
// function : StringType
// purpose :
// =======================================================================
void Graphic3d_ArrayOfPrimitives::SetVertice (const Standard_Integer theIndex,
const gp_Pnt& theVertex)
{
SetVertice (theIndex,
Standard_ShortReal (theVertex.X()),
Standard_ShortReal (theVertex.Y()),
Standard_ShortReal (theVertex.Z()));
}
void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Quantity_Color& theColor)
{
SetVertexColor (theIndex, theColor.Red(), theColor.Green(), theColor.Blue());
}
void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Standard_Integer theColor)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVCol != 0)
{
*reinterpret_cast<Standard_Integer* >(myAttribs->changeValue (theIndex - 1) + size_t(myVCol)) = theColor;
}
}
void Graphic3d_ArrayOfPrimitives::SetVertexNormal (const Standard_Integer theIndex,
const gp_Dir& theNormal)
{
SetVertexNormal (theIndex, theNormal.X(), theNormal.Y(), theNormal.Z());
}
void Graphic3d_ArrayOfPrimitives::SetVertexTexel (const Standard_Integer theIndex,
const gp_Pnt2d& theTexel)
{
SetVertexTexel (theIndex, theTexel.X(), theTexel.Y());
}
void Graphic3d_ArrayOfPrimitives::SetBoundColor (const Standard_Integer theIndex,
const Quantity_Color& theColor)
{
SetBoundColor (theIndex, theColor.Red(), theColor.Green(), theColor.Blue());
}
Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
{
switch (myType)
@@ -259,10 +394,41 @@ Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
return "UndefinedArray";
}
// =======================================================================
// function : ItemNumber
// purpose :
// =======================================================================
gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice (const Standard_Integer theRank) const
{
Standard_Real anXYZ[3];
Vertice (theRank, anXYZ[0], anXYZ[1], anXYZ[2]);
return gp_Pnt (anXYZ[0], anXYZ[1], anXYZ[2]);
}
Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer theRank) const
{
Standard_Real anRGB[3];
VertexColor (theRank, anRGB[0], anRGB[1], anRGB[2]);
return Quantity_Color (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
}
gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal (const Standard_Integer theRank) const
{
Standard_Real anXYZ[3];
VertexNormal (theRank, anXYZ[0], anXYZ[1], anXYZ[2]);
return gp_Dir (anXYZ[0], anXYZ[1], anXYZ[2]);
}
gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel (const Standard_Integer theRank) const
{
Standard_Real anXY[2];
VertexTexel (theRank, anXY[0], anXY[1]);
return gp_Pnt2d (anXY[0], anXY[1]);
}
Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor (const Standard_Integer theRank) const
{
Standard_Real anRGB[3] = {0.0, 0.0, 0.0};
BoundColor (theRank, anRGB[0], anRGB[1], anRGB[2]);
return Quantity_Color (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
}
Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
{
if (myAttribs.IsNull())
@@ -298,10 +464,66 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
return -1;
}
// =======================================================================
// function : IsValid
// purpose :
// =======================================================================
void Graphic3d_ArrayOfPrimitives::ComputeVNormals (const Standard_Integer theFrom,
const Standard_Integer theTo)
{
Standard_Integer aNext = theFrom + 1;
Standard_Integer aLast = theTo + 1;
gp_Pnt aTri[3];
if (myMaxEdges > 0)
{
aTri[0] = Vertice (Edge (aNext++));
aTri[1] = Vertice (Edge (aNext++));
}
else
{
aTri[0] = Vertice (aNext++);
aTri[1] = Vertice (aNext++);
}
gp_Vec vn;
while (aNext <= aLast)
{
if (myMaxEdges > 0)
{
aTri[2] = Vertice (Edge (aNext));
}
else
{
aTri[2] = Vertice (aNext);
}
gp_Vec v21 (aTri[1], aTri[0]);
gp_Vec v31 (aTri[2], aTri[0]);
vn = v21 ^ v31;
if (vn.SquareMagnitude() > 0.0)
{
break;
}
aNext++;
}
if (aNext > aLast)
{
return;
}
vn.Normalize();
if (myMaxEdges > 0)
{
for (int i = theFrom + 1; i <= theTo + 1; i++)
{
SetVertexNormal (Edge (i), vn);
}
}
else
{
for (int i = theFrom + 1; i <= theTo + 1; i++)
{
SetVertexNormal (i, vn);
}
}
}
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
{
if (myAttribs.IsNull())

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,427 @@
// Created on: 2000-06-16
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_OutOfRange.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
inline const Handle(Graphic3d_IndexBuffer)& Graphic3d_ArrayOfPrimitives::Indices() const
{
return myIndices;
}
inline const Handle(Graphic3d_Buffer)& Graphic3d_ArrayOfPrimitives::Attributes() const
{
return myAttribs;
}
inline const Handle(Graphic3d_BoundBuffer)& Graphic3d_ArrayOfPrimitives::Bounds() const
{
return myBounds;
}
inline Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type() const
{
return myType;
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals() const
{
return myVNor != 0;
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors() const
{
return myVCol != 0;
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels() const
{
return myVTex != 0;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber() const
{
return !myAttribs.IsNull() ? myAttribs->NbElements : -1;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Graphic3d_Vec3& theVertex)
{
return AddVertex (theVertex.x(), theVertex.y(), theVertex.z());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const Graphic3d_Vec4ub& theColor)
{
const Standard_Integer anIndex = AddVertex (theVertex);
SetVertexColor (anIndex, theColor);
return anIndex;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX,
const Standard_Real theY,
const Standard_Real theZ)
{
return AddVertex (RealToShortReal (theX),
RealToShortReal (theY),
RealToShortReal (theZ));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z(),
theNormal.X(), theNormal.Y(), theNormal.Z());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ)
{
return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theNX), Standard_ShortReal (theNY), Standard_ShortReal (theNZ));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Pnt2d& theTexel)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z(),
theTexel.X(), theTexel.Y());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theTX, const Standard_Real theTY)
{
return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theTX), Standard_ShortReal (theTY));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal,
const gp_Pnt2d& theTexel)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z(),
theNormal.X(), theNormal.Y(), theNormal.Z(),
theTexel.X(), theTexel.Y());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ,
const Standard_Real theTX, const Standard_Real theTY)
{
return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theNX), Standard_ShortReal (theNY), Standard_ShortReal (theNZ),
Standard_ShortReal (theTX), Standard_ShortReal (theTY));
}
inline void Graphic3d_ArrayOfPrimitives::SetVertice (const Standard_Integer theIndex,
const Standard_ShortReal theX,
const Standard_ShortReal theY,
const Standard_ShortReal theZ)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
Graphic3d_Vec3& aVec = myAttribs->ChangeValue<Graphic3d_Vec3> (theIndex - 1);
aVec.x() = theX;
aVec.y() = theY;
aVec.z() = theZ;
if (myAttribs->NbElements < theIndex)
{
myAttribs->NbElements = theIndex;
}
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Standard_Real theR,
const Standard_Real theG,
const Standard_Real theB)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVCol != 0)
{
Graphic3d_Vec4ub aColor (Standard_Byte(theR * 255.0),
Standard_Byte(theG * 255.0),
Standard_Byte(theB * 255.0), 255);
SetVertexColor (theIndex, *reinterpret_cast<Standard_Integer*>(&aColor));
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Graphic3d_Vec4ub& theColor)
{
SetVertexColor (theIndex, *reinterpret_cast<const Standard_Integer*> (&theColor));
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexNormal (const Standard_Integer theIndex,
const Standard_Real theNX,
const Standard_Real theNY,
const Standard_Real theNZ)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVNor != 0)
{
Graphic3d_Vec3& aVec = *reinterpret_cast<Graphic3d_Vec3* >(myAttribs->changeValue (theIndex - 1) + size_t(myVNor));
aVec.x() = Standard_ShortReal (theNX);
aVec.y() = Standard_ShortReal (theNY);
aVec.z() = Standard_ShortReal (theNZ);
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel (const Standard_Integer theIndex,
const Standard_Real theTX,
const Standard_Real theTY)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVTex != 0)
{
Graphic3d_Vec2& aVec = *reinterpret_cast<Graphic3d_Vec2* >(myAttribs->changeValue (theIndex - 1) + size_t(myVTex));
aVec.x() = Standard_ShortReal (theTX);
aVec.y() = Standard_ShortReal (theTY);
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
inline void Graphic3d_ArrayOfPrimitives::SetBoundColor (const Standard_Integer theIndex,
const Standard_Real theR,
const Standard_Real theG,
const Standard_Real theB)
{
if (myBounds.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxBounds)
{
throw Standard_OutOfRange("BAD BOUND index");
}
Graphic3d_Vec4& aVec = myBounds->Colors[theIndex - 1];
aVec.r() = Standard_ShortReal (theR);
aVec.g() = Standard_ShortReal (theG);
aVec.b() = Standard_ShortReal (theB);
aVec.a() = 1.0f;
myBounds->NbBounds = Max (theIndex, myBounds->NbBounds);
}
inline void Graphic3d_ArrayOfPrimitives::Vertice (const Standard_Integer theIndex,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ) const
{
theX = theY = theZ = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
const Graphic3d_Vec3& aVec = myAttribs->Value<Graphic3d_Vec3> (theIndex - 1);
theX = Standard_Real(aVec.x());
theY = Standard_Real(aVec.y());
theZ = Standard_Real(aVec.z());
}
inline void Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer theIndex,
Standard_Real& theR,
Standard_Real& theG,
Standard_Real& theB) const
{
theR = theG = theB = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
Standard_Integer aColorInt = 0;
VertexColor (theIndex, aColorInt);
const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub* >(&aColorInt);
theR = Standard_Real(aColor.r()) / 255.0;
theG = Standard_Real(aColor.g()) / 255.0;
theB = Standard_Real(aColor.b()) / 255.0;
}
inline void Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer theIndex,
Standard_Integer& theColor) const
{
if (myVCol != 0)
{
theColor = *reinterpret_cast<const Standard_Integer* >(myAttribs->value (theIndex - 1) + size_t(myVCol));
}
}
inline void Graphic3d_ArrayOfPrimitives::VertexNormal (const Standard_Integer theIndex,
Standard_Real& theNX,
Standard_Real& theNY,
Standard_Real& theNZ) const
{
theNX = theNY = theNZ = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVNor != 0)
{
const Graphic3d_Vec3& aVec = *reinterpret_cast<const Graphic3d_Vec3* >(myAttribs->value (theIndex - 1) + size_t(myVNor));
theNX = Standard_Real(aVec.x());
theNY = Standard_Real(aVec.y());
theNZ = Standard_Real(aVec.z());
}
}
inline void Graphic3d_ArrayOfPrimitives::VertexTexel (const Standard_Integer theIndex,
Standard_Real& theTX,
Standard_Real& theTY) const
{
theTX = theTY = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVTex != 0)
{
const Graphic3d_Vec2& aVec = *reinterpret_cast<const Graphic3d_Vec2* >(myAttribs->value (theIndex - 1) + size_t(myVTex));
theTX = Standard_Real(aVec.x());
theTY = Standard_Real(aVec.y());
}
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber() const
{
return !myIndices.IsNull() ? myIndices->NbElements : -1;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge (const Standard_Integer theIndex) const
{
if (myIndices.IsNull()
|| theIndex <= 0
|| theIndex > myIndices->NbElements)
{
throw Standard_OutOfRange("BAD EDGE index");
}
return Standard_Integer(myIndices->Index (theIndex - 1) + 1);
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors() const
{
return !myBounds.IsNull() && myBounds->Colors != NULL;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber() const
{
return !myBounds.IsNull() ? myBounds->NbBounds : -1;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound (const Standard_Integer theIndex) const
{
if (myBounds.IsNull()
|| theIndex <= 0
|| theIndex > myBounds->NbBounds)
{
throw Standard_OutOfRange("BAD BOUND index");
}
return myBounds->Bounds[theIndex - 1];
}
inline void Graphic3d_ArrayOfPrimitives::BoundColor (const Standard_Integer theIndex,
Standard_Real& theR,
Standard_Real& theG,
Standard_Real& theB) const
{
if (myBounds.IsNull()
|| myBounds->Colors == NULL
|| theIndex <= 0
|| theIndex > myBounds->NbBounds)
{
throw Standard_OutOfRange(" BAD BOUND index");
}
const Graphic3d_Vec4& aVec = myBounds->Colors[theIndex - 1];
theR = Standard_Real(aVec.r());
theG = Standard_Real(aVec.g());
theB = Standard_Real(aVec.b());
}

View File

@@ -6,7 +6,5 @@ HeaderSection_FileName.cxx
HeaderSection_FileName.hxx
HeaderSection_FileSchema.cxx
HeaderSection_FileSchema.hxx
HeaderSection_HeaderRecognizer.cxx
HeaderSection_HeaderRecognizer.hxx
HeaderSection_Protocol.cxx
HeaderSection_Protocol.hxx

View File

@@ -16,12 +16,12 @@
#include <HeaderSection_Protocol.hxx>
#include <Interface_Statics.hxx>
StaticHandle(HeaderSection_Protocol, proto);
//StaticHandle(HeaderSection_Protocol, proto);
Handle(HeaderSection_Protocol) HeaderSection::Protocol()
{
InitHandleVoid(HeaderSection_Protocol, proto);
return proto;
}
{
//InitHandleVoid(HeaderSection_Protocol, proto);
return new HeaderSection_Protocol;
}

View File

@@ -1,51 +0,0 @@
// Created on: 1994-06-27
// Created by: Frederic MAUPAS
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <HeaderSection_FileDescription.hxx>
#include <HeaderSection_FileName.hxx>
#include <HeaderSection_FileSchema.hxx>
#include <HeaderSection_HeaderRecognizer.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
static TCollection_AsciiString reco_FileName ("FILE_NAME");
static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA");
static TCollection_AsciiString reco_FileDescription ("FILE_DESCRIPTION");
HeaderSection_HeaderRecognizer::HeaderSection_HeaderRecognizer ()
{ }
void HeaderSection_HeaderRecognizer::Eval
(const TCollection_AsciiString& key)
{
if (key.IsEqual(reco_FileName)) {
SetOK(new HeaderSection_FileName);
return;
}
if (key.IsEqual(reco_FileSchema)) {
SetOK(new HeaderSection_FileSchema);
return;
}
if (key.IsEqual(reco_FileDescription)) {
SetOK(new HeaderSection_FileDescription);
return;
}
}

View File

@@ -1,66 +0,0 @@
// Created on: 1994-06-27
// Created by: Frederic MAUPAS
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _HeaderSection_HeaderRecognizer_HeaderFile
#define _HeaderSection_HeaderRecognizer_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <StepData_FileRecognizer.hxx>
class TCollection_AsciiString;
class HeaderSection_HeaderRecognizer;
DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
//! Recognizes STEP Standard Header Entities
//! (FileName, FileDescription, FileSchema)
class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer
{
public:
Standard_EXPORT HeaderSection_HeaderRecognizer();
DEFINE_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
protected:
//! Recognizes data types of Header STEP Standard
Standard_EXPORT void Eval (const TCollection_AsciiString& key) Standard_OVERRIDE;
private:
};
#endif // _HeaderSection_HeaderRecognizer_HeaderFile

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