1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Compare commits

..

49 Commits

Author SHA1 Message Date
tiv
3f53006c35 0030599: Visualization - implement StdPrs_SectionLines tool
StdPrs_SectionLines tool is implemented: it is possible to compute a cross section of the shape with the plane.
# Some features have not been implemented yet:
#   * the method StdPrs_SectionLines::Add() that should add objects inside section to the Prs3d_Presentation;
#   * corresponding Draw Harness command;
#   * interactive object that could represent the cross section;
#   * triangles that lie inside the section plane have not been processed yet.
2019-04-19 20:27:36 +03:00
tiv
f9b30c0db3 0030623: Draw Harness - support hex color codes within ViewerTest::ParseColor()
ViewerTest::ParseColor() function is improved to be able to parse the following set of input arguments:
  - "Red Green Blue [Alpha]", where Red, Green, Blue, Alpha must be integers within the range [0, 255] or reals within the range [0.0, 1.0]. Note that "0 0 1" triple is parsed as "0.0 0.0 1.0" and will be interpreted as a blue color.
  - "ColorName [Alpha]", where ColorName is one of WHITE, BLACK, RED, GREEN, BLUE, etc. (look at Quantity_NameOfColor enumeration for all possible variants). Alpha may be integer or real, as described at the previous list item.
  - #HHH, [#]HHH[H], [#]HHHHHH[HH], where H is a hexadecimal digit (0 .. 9, a .. f, or A .. F). There are a short hexadecimal RGB, RGBA formats, and a usual RGB[A], respectively.
2019-04-12 18:48:18 +03:00
jgv
a5278fc126 0030597: BRepOffsetAPI_MakePipeShell raises Standard_RangeError
Constructor of GeomFill_SectionPlacement has been corrected: add correction of boundaries of curve to avoid mistake of LocateU in the case when the curve is BSpline.
2019-04-12 11:34:54 +03:00
kgv
74413ca7d3 0030643: Visualization, Ray-Tracing - shader compilation errors are not properly logged
OpenGl_View::initShader() now uses OpenGl_ShaderObject::LoadAndCompile().
2019-04-10 15:33:55 +03:00
kgv
98e6c6d17b 0030612: Visualization - provide texture map with video as image source
Introduced package Media wrapping FFmpeg structures.
Media_PlayerContext class manages video decoding into Media_IFrameQueue interface.
Graphic3d_MediaTextureSet implements Media_IFrameQueue interface and can be used as texture source.
AIS_MediaPlayer implements simple AIS object displaying video.
2019-04-09 14:18:35 +03:00
kgv
9491df8c1b 0030638: Visualization, TKOpenGl - load OpenGL 4.5 functions within OpenGl_Context 2019-04-09 14:17:47 +03:00
kgv
d325cb7f57 0030635: Visualization - move OpenGl_Layer to Graphic3d_Layer
Renamed classes (moved from TKOpenGl to TKV3d):
- OpenGl_Layer -> Graphic3d_Layer;
- OpenGl_BVHClipPrimitiveSet -> Graphic3d_BvhCStructureSet;
- OpenGl_BVHClipPrimitiveTrsfPersSet -> Graphic3d_BvhCStructureSetTrsfPers;
- OpenGl_BVHTreeSelector -> Graphic3d_CullingTool.

Method OpenGl_Layer::Render() has been moved to OpenGl_LayerList::renderLayer().

Standard Z-layers list definition has been moved
from OpenGl_GraphicDriver to base class Graphic3d_GraphicDriver.
2019-04-09 14:16:33 +03:00
kgv
24ee60ffd7 0030636: Configuration, qmake - unable to build using VS2017 2019-04-09 12:33:43 +03:00
emv
cea8d5c1ab 0030629: Modeling Algorithms - Invalid result of fuse operation
Plane/Torus intersection: take into account the Plane-Torus distance sign to compute the correct location of the section curve.

Test case for the issue.
2019-04-08 16:03:41 +03:00
kgv
fc867b96a5 0030618: Modeling Algorithms, BOPTools_Parallel - avoid using map for thread-local contexts without TBB
OSD_Parallel::ToUseOcctThreads() - new flag allowing to use OCCT threads implementation even when compiled with TBB (for testing).
Added new command dparallel for managing default Thread Pool.
OSD_Parallel::For() now avoid creation of universal iterator in simplest case.

BOPTools_Parallel - eliminated redundant typedefs/explicit instantiations of templates.
Added functor using array of per-thread context instead of a map.
2019-04-08 15:59:23 +03:00
kgv
aafe169f89 0030339: Configuration - add project files for qmake
Added adm/qmake/Occt.pro for building OCCT using Qt Creator.
genproj/genconf scripts have been extended with an option defining project format.

Draw_Appli now tries resolving CASROOT/DRAWDEFAULT/CSF_OCCTResourcePath/CSF_OCCTSamplesPath
locations within usual OCCT development/installation environment.
Added missing TKShHealing dependency to TKDraw/DRAWEXE (inherited from TKMesh).
OSD_Process::ExecutableFolder() - added method returning executable folder.
2019-04-07 13:21:59 +03:00
iko
84b904bc36 0030626: Visualization - manipulator crashes when is attached with scaling mode disabled
AIS_Manipulator crashes on SetPart method when 2 inputs (AIS_ManipulatorMode, Standard_Boolean) has been fixed up.
Test case for this bug has been added.
2019-04-03 19:05:38 +03:00
gka
33defc7121 0030616: Crash on reading STEP file
Added protections to avoid exceptions for null objects.
For reading entity StepShape_ToleranceValue was added reading lower and upper bounds represented by entities "StepRepr_ReprItemAndMeasureWithUnit" or "StepRepr_MeasureRepresentationItem"
2019-04-02 21:24:57 +03:00
kgv
2a0522b1c6 0030622: Visualization, TKOpenGl - Path Tracing fails on macOS
Fixed usage of non-existing function texture2D().
2019-04-01 18:31:16 +03:00
kgv
8693dfd0e8 0030619: Draw Harness, ViewerTest - add continuous rendering option to vrepaint command
Aspect_Window::InvalidateContent() - added new virtual method for invalidating window content using platform-specific API.

TKDraw, tkLoop() on Window platform has been changed so that to prevent
continuous input window events blocking terminal input
(e.g. in case if processing events is not fast enough or
if another continuously sends new events).

TKViewerTest, on X11 platform has been fixed a message processing
so that to avoid messages being not processed.
Added aggregation of Exposer and ConfigureNotify events.
Fixed aggregation MotionNotify events.
2019-04-01 18:29:16 +03:00
kgv
a738b534ca 0030611: Coding Rules - eliminate GCC compiler warnings -Wcatch-value
Add missing const& to catch statements.
2019-03-31 23:39:50 +03:00
kgv
f996b507d8 0030579: Draw Harness, Draw_Interpretor - catch exceptions other than Standard_Failure 2019-03-25 18:24:18 +03:00
kgv
d9166000fe 0030574: Configuration, genproj - CSF_DEFINES is not reset at the beginning of env.bat
env.bat now resets %CSF_DEFINES% variable to empty state
and append optional %CSF_DEFINES_EXTRA% external value.
2019-03-25 18:20:51 +03:00
kgv
3697d4fa2f 0030556: Coding - IGESData_GlobalSection missing member initialization in default constructor
IGESData_GlobalSection now initializes class fields.
2019-03-25 18:19:12 +03:00
iko
4bcd07385e 0030505: Volume Rendering - Deferred lighting
Missing getter for OpenGl_Texture::mySizedFormat has been added.
2019-03-25 18:16:41 +03:00
emv
d84b49c743 0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depending on the order of parameters
The following improvements have been implemented in BRepLib_MakeWire class to make it more reliable:
1. Quit adding edges of a wire into result if the current edges have not been added. Return NotDone status.
2. Allow merging not only bounding vertices (connected to only one edge) but also the middle ones, so the multi-connected vertices may appear in the result.

Test case for the issue.
2019-03-22 17:21:01 +03:00
kgv
aff73fd598 0030582: Coding - avoid defining references to properties of NULL objects
Approx_SweepApproximation::Perform() now creates empty arrays.
GeomAdaptor_SurfaceOfRevolution::UTrim() - fixed No_Exception misuse.
StdPrs_ShadedShape - fixed defining an invalid reference to Poly_Triangulation::UVNodes().

BSplCLib::MovePoint() and BSplCLib::MovePointAndTangent() now take optional
weights parameter as pointer consistent to other methods like BSplCLib::BuildEval().
2019-03-22 17:21:01 +03:00
ifv
afb3647b34 0030489: Modeling Algorithms - BRepBuilderAPI_GTransform hangs
Approx_ComputeCLine.gxx - criterium to stop interval cutting is increased.
ProjLib_ProjectedCurve.cxx - fix regression for bugs modalg_5 bug25886
Other tests are modified according to current state of algorithm
2019-03-22 17:21:00 +03:00
kgv
2328cae25d 0030593: Modeling Algorithms - ShapeUpgrade_ShapeDivide::Perform() throws Standard_NoMoreObject
Added missing TopExp_Explorer::More() checks to ShapeUpgrade_ShapeDivide::Perform() and BRepCheck_Analyzer::Perform().
2019-03-21 13:16:11 +03:00
kgv
85831628d6 0027316: Draw Harness - access violation on passing non-existing shape to XAddShape
Add NULL check to XAddShape command.
Removed broken test case bugs/step/bug27316.
2019-03-21 13:15:15 +03:00
kgv
667b5eb81b 0030583: Draw Harness - ignore cpulimit when Debugger is attached on Windows platform
cpulimit now omits ExitProcess() when IsDebuggerPresent() returns TRUE.
2019-03-20 19:00:48 +03:00
kgv
de07af824b 0030594: Data Exchange - access violation within IGESGeom_BSplineCurve constructor
Added NULL check.
2019-03-20 18:11:41 +03:00
kgv
cb6cad7df1 0023838: Modeling Data - Standard_OutOfRange in Geom_OffsetSurface::LocalDN (called by BRepFill_PipeShell)
Fixed incorrect array allocation within GeomEvaluator_OffsetSurface::CalculateDN()
and protection against assigning out-of-range values in case of non-square
number of U and V derivatives on surface.
2019-03-20 11:25:06 +03:00
kgv
ad67e36766 0030588: Coding - avoid calling operator->() on NULL Handle
Use .get() method instead of operator->() where result can be NULL.
STEPCAFControl_Reader::ReadLayers(), XCAFDoc_ColorTool,
XCAFDoc_LayerTool::SetVisibility() - fixed static functions syntax.
2019-03-20 11:23:45 +03:00
kgv
18434846a3 0030558: Coding - replace math_SingleTab with NCollection_LocalArray
math_Vector::Multiplied() - fixed modification of original array.

math_SVD::Solve(), math_SVD::PseudoInverse(), GeomFill_LocationGuide::InitX() - removed incorrect constness.

math_Vector, math_IntegerVector - math_SingleTab has been replaced by NCollection_LocalArray+NCollection_Array1.
Added accessors returning const value.
2019-03-20 11:23:08 +03:00
vro
43c8661e5e 0030536: Foundation Classes - TCollection_ExtendedString::StartsWith() and EndsWith() have a mistake
Draw-commands StartsWith and EndsWith are renamed to QAStartsWith and QAEndsWith.
The test script bug30536 was corrected.
2019-03-18 19:46:00 +03:00
abv
404504b234 0030544: Data Exchange - IGES import fails on specific file
Method IGESToBRep_BRepEntity::TransferEdge() is fixed to record result even if it is wire rather than edge.
This allows translation of EdgeLoop entities referring to CompositeCurve items in EdgeList entities.
Curves that fail to translate are recorded in result as Null shapes (rather than skipping them) to keep indexation of curves in EdgeList valid for remaining ones.

Method IGESToBRep_BRepEntity::TransferLoop() is improved to skip failed edges thus avoiding exception and allowing translation to complete for transferable entities.

Warning messages are corrected to be more meaningful.
Added test bugs iges bug30544
2019-03-18 19:45:07 +03:00
kgv
d65f9183fd 0030569: Foundation Classes - NCollection_Shared lacks inclusion of NCollection_DefineAlloc.hxx
Add missing includes.
2019-03-18 19:43:55 +03:00
kgv
6b121e2b48 0030584: Modeling Algorithms, BRepFill_OffsetWire - access violation on Face having no boundaries
Added missing NULL and empty result checks.
Updated test cases using offset_wire_092.brep shape containing all Edges
with TopAbs_INTERNAL orientation (hense no boundary to make offset).
2019-03-18 19:42:47 +03:00
kgv
437ef7713e 0030581: Modeling Data - Standard_OutOfRange within Geom_BSplineSurface::LocateV()
Geom2d_BSplineCurve::LocateU(),Geom_BSplineCurve::LocateU, Law_BSpline::LocateU()
Geom_BSplineSurface::LocateU() and Geom_BSplineSurface::LocateV()
have been corrected with missing range checks.
BSplCLib::Hunt() documentation has been corrected to reflect its actual implementation.
2019-03-18 19:41:40 +03:00
kgv
737e9a8da4 0030571: Visualization, TKOpenGl - mapped texture is ignored while drawing points
OpenGl_AspectsTextureSet now appends Sprite texture to the end of texture set.
OpenGl_Context::init() - fixed usage of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS on too old GL context.

Default sampler names occSampler0, occActiveSampler and occSamplerBaseColor
are now excluded from header with common declarations for build-in GLSL programs.

OpenGl_ShaderObject::LoadAndCompile() and OpenGl_ShaderProgram::Link()
now includes program Id within error log.

OpenGl_ShaderManager now supports mapping texture onto point primitive within built-in programs
(texture transformation is ignored).
2019-03-16 16:48:21 +03:00
oan
ad4b04291f 0030511: Mesh - too long meshing of assembly containing single solid (shared)
Added test case.
2019-03-16 16:46:53 +03:00
oan
e9fb0cba58 0030573: OSD_Parallel_TBB: limit number of execution threads using settings of OSD_ThreadPool::DefaultPool()
Add tbb::task_scheduler_init to OSD_Parallel::forEach().
2019-03-16 16:46:53 +03:00
kgv
f2b42160f4 0030575: Tests - v3d/materials unstable image screenshots of alpha-blending on GeForce with MSAA
testdiff now looks for "IMAGE_COLOR_TOLERANCE: Tol" statements in log
to execute diffimage with -toleranceOfColor Tol parameter.

Image difference is first performed with 0 tolerance and then optionally with non-zero tolerance,
so that the log always includes information that some images are different,
but with two different messages:
- "IMAGE differs" for images failed comparison;
- "IMAGE is similar" for images passed comparison only with non-zero tolerance.

v3d/materials - disabled MSAA and removed duplicate.
demo/samples/materials - compare screenshots with 0.8% color tolerance (2/255).
2019-03-16 16:46:52 +03:00
kgv
6072d5975a 0030580: Configuration, CMake - introduce BUILD_RELEASE_DISABLE_EXCEPTIONS option managing No_Exception macros 2019-03-16 16:46:51 +03:00
jgv
85c103d277 0030560: Modeling Algorithms - Improvement of the method BRepTools::DetectClosedness
1. Rewrite the method BRepTools::DetectClosedness.
2. Correct the method BRepOffset_Tool::EnLargeFace to process properly non-periodic but closed faces.
2019-03-16 16:46:50 +03:00
kgv
31fe1f8ec4 0030570: Visualization, TKOpenGl - OpenGl_AspectFace ignores texture revision on recompute
Added revision check to one more branch within OpenGl_AspectsTextureSet::build().
2019-03-15 19:11:45 +03:00
kgv
5716d13b43 0030564: Coding - math_Gauss uninitialized 'Singular' member variable
Removed unused class field Singular.
2019-03-13 16:39:43 +03:00
kgv
a7fd4b1bb0 0030562: Coding - TopOpeBRepBuild_Builder use of null pointer
TopOpeBRepBuild_Builder::Clear() - added NULL check.
2019-03-13 16:39:41 +03:00
mnv
226fce20f0 0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations AIS_InteractiveObject::myRecomputeEveryPrs.
PrsMgr_PresentableObject::Update() has been deprecated and replaced by PrsMgr_PresentableObject::UpdatePresentations()
recomputing only explicitly invalidated presentations.
2019-03-13 16:39:40 +03:00
kgv
ac8f17746b 0030554: Coding - ChFiDS_CommonPoint uninitialized member traarc
Added missing initialization to ChFiDS_CommonPoint constructor.
2019-03-13 11:00:23 +03:00
kgv
a98b97f5da 0030553: Coding - TopOpeBRepDS_Surface missing default initalizations
All class fields are now initialized within every TopOpeBRepDS_Surface constructor.
2019-03-13 11:00:22 +03:00
kgv
c3c2b331cd 0030545: Documentation - methods marked with Standard_DEPRECATED has ill-formed Doxygen output
Doxygen option PREDEFINED has been extended by Standard_DEPRECATED declaration.
2019-03-13 11:00:22 +03:00
kgv
af2fa459f1 0030547: Foundation Classes - NCollection_DoubleMap lacks Seek() method
Added Seek1() and Seek2() methods to NCollection_DoubleMap class.
2019-03-13 11:00:21 +03:00
403 changed files with 11137 additions and 5278 deletions

View File

@@ -86,6 +86,11 @@ if (BUILD_WITH_DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
endif()
# option disabling OCCT exceptions in Release builds (No_Exception)
if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
endif()
# option to enable or disable use of precompiled headers
if (NOT DEFINED BUILD_USE_PCH)
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")

1
adm/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build-*

View File

@@ -203,6 +203,7 @@ n Aspect
n DsgPrs
n Graphic3d
n Image
n Media
n MeshVS
n OpenGl
n D3DHost

View File

@@ -65,6 +65,7 @@ if (WIN32)
set (CSF_shell32 "shell32.lib")
set (CSF_wsock32 "wsock32.lib")
set (CSF_psapi "psapi.lib")
set (CSF_winmm "winmm.lib")
set (CSF_d3d9 "D3D9.lib")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlLibs "libEGL libGLESv2")

View File

@@ -143,5 +143,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
endif()
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
endif()

View File

@@ -28,6 +28,11 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default).
These exceptions are always enabled in Debug builds, but disable in Release for better performance")
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
Corresponding environment variable (CSF_FPE) can be changed manually

View File

@@ -30,10 +30,30 @@ set aRowIter 0
set aCheckRowIter 0
frame .myFrame -padx 5 -pady 5
pack .myFrame -fill both -expand 1
frame .myFrame.myPrjFrame
frame .myFrame.myVsFrame
frame .myFrame.myHxxChecks
frame .myFrame.myChecks
# project file format
set SYS_PRJFMT_LIST {}
set SYS_PRJNAME_LIST {}
if { "$::tcl_platform(platform)" == "windows" } {
lappend ::SYS_PRJFMT_LIST "vcxproj"
lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
}
if { "$tcl_platform(os)" == "Darwin" } {
lappend ::SYS_PRJFMT_LIST "xcd"
lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
}
lappend ::SYS_PRJFMT_LIST "cbp"
lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
lappend ::SYS_PRJFMT_LIST "pro"
lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
@@ -101,6 +121,7 @@ proc wokdep:gui:Close {} {
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
@@ -390,6 +411,8 @@ proc wokdep:gui:Show64Bitness { theRowIter } {
}
# Header
ttk::label .myFrame.myPrjFrame.myPrjLbl -text "Project format:" -padding {5 5 20 5}
ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
@@ -494,6 +517,10 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
# Create grid
# Header
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
incr aRowIter
if { "$tcl_platform(platform)" == "windows" } {
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
@@ -592,6 +619,9 @@ grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
# Bind events
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}

View File

@@ -27,8 +27,10 @@ if { "$tcl_platform(platform)" == "unix" } {
set SYS_EXE_SUFFIX ""
if { "$tcl_platform(os)" == "Darwin" } {
set SYS_LIB_SUFFIX "dylib"
set PRJFMT "xcd"
} else {
set SYS_LIB_SUFFIX "so"
set PRJFMT "cbp"
}
set VCVER "gcc"
set VCVARS ""
@@ -39,6 +41,7 @@ if { "$tcl_platform(platform)" == "unix" } {
set SYS_EXE_SUFFIX ".exe"
set VCVER "vc10"
set VCVARS ""
set PRJFMT "vcxproj"
}
set SHORTCUT_HEADERS "ShortCut"
@@ -82,7 +85,7 @@ if { "$tcl_platform(platform)" != "windows" } {
set HAVE_D3D ""
set HAVE_RelWithDebInfo ""
}
foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
@@ -1118,15 +1121,33 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
return "$isFound"
}
# Returns OCCT version string from file Standard_Version.hxx (if available)
proc wokdep:DetectCasVersion {} {
set occt_ver 7.0.0
set aCasRoot [file normalize [file dirname [info script]]]
set filename "${aCasRoot}/src/Standard/Standard_Version.hxx"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
} else {
puts "Error: file '$filename' not found"
}
return $occt_ver
}
# Generate (override) custom environment file
proc wokdep:SaveCustom {} {
set aGenInfo "This environment file was generated by genconf.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
if { "$::tcl_platform(platform)" == "windows" } {
set aCustomFilePath "./custom.bat"
set aFile [open $aCustomFilePath "w"]
puts $aFile "@echo off"
puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
puts $aFile "rem $aGenInfo"
puts $aFile ""
puts $aFile "set PRJFMT=$::PRJFMT"
puts $aFile "set VCVER=$::VCVER"
puts $aFile "set ARCH=$::ARCH"
puts $aFile "set VCVARS=$::VCVARS"
@@ -1175,9 +1196,10 @@ proc wokdep:SaveCustom {} {
set aCustomFilePath "./custom.sh"
set aFile [open $aCustomFilePath "w"]
puts $aFile "#!/bin/bash"
puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
puts $aFile "# $aGenInfo"
puts $aFile ""
puts $aFile "export PRJFMT=$::PRJFMT"
puts $aFile "export ARCH=$::ARCH"
puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
@@ -1211,6 +1233,52 @@ proc wokdep:SaveCustom {} {
close $aFile
}
puts "Configuration saved to file '$aCustomFilePath'"
if { "$::PRJFMT" == "pro" } {
set aCasVer [wokdep:DetectCasVersion]
set aCustomFilePath "./adm/qmake/custom.auto.pri"
set aFile [open $aCustomFilePath "w"]
puts $aFile "# $aGenInfo"
puts $aFile ""
puts $aFile "VERSION=$aCasVer"
puts $aFile "PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
puts $aFile ""
puts $aFile "# Optional 3rd-parties switches"
foreach anEnvIter $::THE_ENV_VARIABLES {
set aName ${anEnvIter}
set aValue [set ::${anEnvIter}]
if { "$aValue" == "true" } {
puts $aFile "CONFIG += ${aName}"
} else {
#puts $aFile "CONFIG -= ${aName}"
}
}
puts $aFile ""
puts $aFile "# Additional headers search paths"
foreach anIncPath $::CSF_OPT_INC {
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
}
puts $aFile ""
puts $aFile "# Additional libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {
puts $aFile "LIBS += -L\"${aLibPath}\""
}
if { "$::tcl_platform(platform)" == "windows" } {
puts $aFile ""
puts $aFile "# Additional DLLs search paths"
foreach aDllPath [set ::CSF_OPT_BIN$::ARCH] {
puts $aFile "LIBS += -L\"${aDllPath}\""
}
}
puts $aFile ""
close $aFile
puts "Configuration saved to file '$aCustomFilePath'"
}
}

View File

@@ -256,7 +256,7 @@ proc genAllResources {} {
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -314,6 +314,7 @@ proc genproj {theFormat args} {
vc141 - Visual Studio 2017
cbp - CodeBlocks
xcd - XCode
pro - Qt Creator
Platform (optional):
wnt - Windows Desktop
@@ -395,9 +396,14 @@ proc genprojbat {theFormat thePlatform} {
"cbp" {
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat"
# Code::Blocks 16.01 does not create directory for import libs, help him
file mkdir "$::path/$thePlatform/cbp/lib"
file mkdir "$::path/$thePlatform/cbp/libd"
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
set aPlatformAndCompiler "${thePlatform}/clang"
}
file mkdir "$::path/${aPlatformAndCompiler}/lib"
file mkdir "$::path/${aPlatformAndCompiler}/libd"
}
"xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
}
@@ -472,15 +478,6 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
}
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
}
# create the out dir if it does not exist
if (![file isdirectory $path/inc]) {
puts "$path/inc folder does not exists and will be created"
@@ -491,6 +488,19 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
puts "Collecting required header files into $path/inc ..."
osutils:collectinc $aModules $path/inc
if { "$theFormat" == "pro" } {
return
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
}
# Generating project files for the selected format
switch -exact -- "$theFormat" {
"vc7" -
@@ -1349,6 +1359,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_opengl32) "opengl32"
set aLibsMap(CSF_wsock32) "wsock32"
set aLibsMap(CSF_netapi32) "netapi32"
set aLibsMap(CSF_winmm) "winmm"
set aLibsMap(CSF_OpenGlLibs) "opengl32"
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
@@ -2295,6 +2306,10 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
set aCmplFlagsDebug [list]
set toPassArgsByFile 0
set aLibPrefix "lib"
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
set aPlatformAndCompiler "${thePlatform}/clang"
}
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" || "$thePlatform" == "qnx" } {
set toPassArgsByFile 1
}
@@ -2351,17 +2366,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
# Release target configuration
puts $aFile "\t\t\t<Target title=\"Release\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/obj\" />"
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/obj\" />"
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
@@ -2384,7 +2399,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
if { $toPassArgsByFile == 1 } {
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkFileName\" />"
}
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/lib\" />"
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/lib\" />"
if { "$thePlatform" == "mac" } {
if { [ lsearch $theLibsList X11 ] >= 0} {
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
@@ -2392,7 +2407,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
}
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch})\" />"
if { "$thePlatform" == "lin" } {
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/lib\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/lib\" />"
}
puts $aFile "\t\t\t\t</Linker>"
@@ -2401,17 +2416,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
# Debug target configuration
puts $aFile "\t\t\t<Target title=\"Debug\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/objd\" />"
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/objd\" />"
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
@@ -2434,7 +2449,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
if { $toPassArgsByFile == 1 } {
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkDebFileName\" />"
}
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/libd\" />"
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/libd\" />"
if { "$thePlatform" == "mac" } {
if { [ lsearch $theLibsList X11 ] >= 0} {
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
@@ -2442,7 +2457,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
}
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch}D)\" />"
if { "$thePlatform" == "lin" } {
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/libd\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/libd\" />"
}
puts $aFile "\t\t\t\t</Linker>"
@@ -2509,8 +2524,8 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
puts $aFile "\t\t\t<Option link=\"0\" />"
puts $aFile "\t\t</Unit>"
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/obj/src/"] $aSrcFile]]
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/objd/src/"] $aSrcFile]]
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/obj/src/"] $aSrcFile]]
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/objd/src/"] $aSrcFile]]
puts -nonewline $aFileLnkObj "$aFileObj "
puts -nonewline $aFileLnkObjd "$aFileObjd "
} else {

5
adm/qmake/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
/*/*.pro
/*/*/*.pro
*.pro.user
custom.pri
custom.auto.pri

150
adm/qmake/OccCppConfig.pri Normal file
View File

@@ -0,0 +1,150 @@
# This is project defines C++ compilation rules for building an OCCT Toolkit.
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Disable some dummy Qt defaults
QT -= core gui
CONFIG -= qt app_bundle
CONFIG -= qml_debug
CONFIG -= debug_and_release
OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags
!win32 { DEFINES += OCC_CONVERT_SIGNALS }
android {
CONFIG += warn_off
QMAKE_CFLAGS += -fexceptions -Wno-ignored-qualifiers -Wall
QMAKE_CXXFLAGS += -fexceptions -Wno-ignored-qualifiers -Wall
#android-g++ { QMAKE_CXXFLAGS += -Wno-strict-overflow }
} else:win32 {
QMAKE_CXXFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
QMAKE_CXXFLAGS_STL_ON = /EHa
QMAKE_CXXFLAGS += -fp:precise
#QMAKE_CXXFLAGS -= -Zc:throwingNew
#QMAKE_CXXFLAGS -= -Zc:rvalueCast
QMAKE_LFLAGS += -INCREMENTAL:NO
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -Od
QMAKE_CXXFLAGS += -Ob1
}
DEFINES -= WIN32
DEFINES -= WIN64
DEFINES += _CRT_SECURE_NO_WARNINGS
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
DEFINES += _SCL_SECURE_NO_WARNINGS
} else:mac {
CONFIG += c++11
CONFIG += warn_off
QMAKE_CXXFLAGS += -Wall
QMAKE_CXXFLAGS += -fvisibility=default
iphoneos {
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
}
}
# Define output folder depending on compiler name
MY_BITNESS = 32
equals(QMAKE_TARGET.arch, x86_64) | equals(QMAKE_HOST.arch, x86_64) { MY_BITNESS = 64 }
equals(ANDROID_TARGET_ARCH, arm64-v8a) { MY_BITNESS = 64 }
has64Target = $$find(QMAKE_TARGET.arch, "x64")
count(has64Target, 1) { MY_BITNESS = 64 }
MY_PLATFORM = platform
CONFIG(iphonesimulator, iphoneos|iphonesimulator) { MY_PLATFORM = iphonesimulator
} else:CONFIG(iphoneos, iphoneos|iphonesimulator) { MY_PLATFORM = iphoneos
} else:android { MY_PLATFORM = android-$$ANDROID_TARGET_ARCH
} else:win32 { MY_PLATFORM = win$$MY_BITNESS
} else:mac { MY_PLATFORM = mac
} else:linux { MY_PLATFORM = lin
} else:unix { MY_PLATFORM = unix
} else { warning (Unknown platform. "$$MY_PLATFORM" is used) }
MY_COMPILER = compiler
MY_VC_VER = 0
android-g++ {
MY_COMPILER = gcc
} else:clang {
MY_COMPILER = clang
} else:gcc {
MY_COMPILER = gcc
} else:win32-msvc2010 {
MY_COMPILER = vc10
MY_VC_VER = 10
} else:win32-msvc2012 {
MY_COMPILER = vc11
MY_VC_VER = 11
} else:win32-msvc2013 {
MY_COMPILER = vc12
MY_VC_VER = 12
} else:win32-msvc2015 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc2017 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc {
MY_COMPILER = vc14
MY_VC_VER = 14
aMsvcVer = $$(VisualStudioVersion)
equals(aMsvcVer, 14.0){
# VS2015, vc140
} else:equals(aMsvcVer, 15.0){
# VS2015, vc141
} else:equals(aMsvcVer, 16.0){
# VS2019, vc142
} else {
warning (Unknown msvc version. "$$MY_COMPILER" is used)
}
} else {
warning (Unknown compiler. "$$MY_COMPILER" is used)
}
MY_PLATFORM_AND_COMPILER = $$MY_PLATFORM/$$MY_COMPILER
#warning (The platform is "$$MY_PLATFORM"; bitness is "$$MY_BITNESS"; compiler is "$$MY_COMPILER")
CONFIG(debug, debug|release) { MY_BUILDTYPE = d }
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/lib$${MY_BUILDTYPE}
win32 {
DESTDIR = $$OccGitRoot/win$${MY_BITNESS}/vc$${MY_VC_VER}/bin$${MY_BUILDTYPE}
aLibDest = $$DESTDIR/../lib$${MY_BUILDTYPE}
#DLLDESTDIR = $$DESTDIR/../bin$${MY_BUILDTYPE}
# dummy target creating lib/libd folder
occtkgen_libfolder.input = $$_PRO_FILE_PWD_/../../OcctDummy.in
occtkgen_libfolder.output = $$aLibDest/dummy.tmp
occtkgen_libfolder.config = verbatim
QMAKE_SUBSTITUTES += occtkgen_libfolder
LIBS += -L$$aLibDest
HAVE_RelWithDebInfo {
!CONFIG(debug, debug|release) { CONFIG += force_debug_info }
}
equals(TEMPLATE, lib) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.dll
QMAKE_CLEAN += $$aLibDest/$${TARGET}.lib
QMAKE_CLEAN += $$aLibDest/$${TARGET}.exp
} else {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.exe
}
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.pdb
QMAKE_LFLAGS += -PDB:"$$DESTDIR/$${TARGET}.pdb"
QMAKE_LFLAGS += -IMPLIB:"$$aLibDest/$${TARGET}.lib"
} else {
LIBS += -L$$DESTDIR
equals(TEMPLATE, app) {
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/bin$${MY_BUILDTYPE}
}
}
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}

36
adm/qmake/OccModule.pri Normal file
View File

@@ -0,0 +1,36 @@
# This is a project template file defining an OCCT Module.
# This project should be included with predefined OCC_MODULE_NAME variable.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Iterate over Toolkits within current Module and generate sub-project per Toolkit
aModuleList = $$cat(../MODULES, lines)
for (aModuleIter, aModuleList) {
#aTkList = $$list($$aModuleIter) - this doesn't work, qmake bug?
aModule = $$first($$list($$aModuleIter))
equals (aModule, $$OCC_MODULE_NAME) {
for (aToolKit, $$list($$aModuleIter)) {
toSkipToolkit = 0
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
eval(occtkgen_$${aToolKit}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aToolKit})
SUBDIRS += $${aToolKit}
aModExtList = $$cat(../../src/$${aToolKit}/EXTERNLIB, lines)
aTkDepends = $${aToolKit}.depends
for (aModExtIter, aModExtList) {
contains ($$list($$aModuleIter), $$aModExtIter) { eval ($${aTkDepends} += $$aModExtIter) }
}
#warning($$aToolKit depends on: $$reverse($${aTkDepends}))
}
}
}
}

View File

@@ -0,0 +1,2 @@
OCC_MODULE_NAME = \$\$TARGET
include(../OccModule.pri)

137
adm/qmake/OccToolkit.pri Normal file
View File

@@ -0,0 +1,137 @@
# This is a project template file defining an OCCT Toolkit.
# This project should be included with predefined OCC_TOOLKIT_NAME variable.
TEMPLATE = lib
!exists(../../src/$$OCC_TOOLKIT_NAME/PACKAGES) {
TEMPLATE = app
CONFIG += console
}
win32 {
# do not append version to DLL name
CONFIG += skip_target_version_ext
}
include(OccCppConfig.pri)
aSrcRoot = $$OccGitRoot/src
aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot
# CSF variables
CSF_FREETYPE = -lfreetype
CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
win32 {
CSF_kernel32 = -lkernel32
CSF_advapi32 = -ladvapi32
CSF_gdi32 = -lgdi32
CSF_user32 = -luser32 -lcomdlg32
CSF_shell32 = -lShell32
CSF_opengl32 = -lopengl32
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_psapi = -lPsapi
CSF_d3d9 = -ld3d9
CSF_TclLibs = -ltcl86
CSF_TclTkLibs = -ltk86
CSF_TBB =
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
CSF_Appkit = -framework AppKit
CSF_IOKit = -framework IOKit
CSF_OpenGlLibs = -framework OpenGL
CSF_TclLibs = -framework Tcl
CSF_TclTkLibs = -framework Tk
} else {
CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlLibs = -lGL
CSF_TclTkLibs = -lX11 -ltk8.6
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_MotifLibs = -lX11
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
# Define the list of standard OCCT file extensions
aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$
aPxxRegex = ^.*\.(pxx)$
aCxxRegex = ^.*\.(cxx|c)$
mac { aCxxRegex = ^.*\.(cxx|c|m|mm)$ }
# Auxiliary function for probing file extension
defineTest (occCheckExtension) {
aProbe = $$find(1, "$$2")
count(aProbe, 1) { return(true) } else { return(false) }
}
# Auxiliary function for probing compilable files
defineTest (occIsCxxFile) { occCheckExtension ($$1, $$aCxxRegex) { return(true) } else { return(false) } }
# Auxiliary function for probing header files
defineTest (occIsHxxFile) { occCheckExtension ($$1, $$aHxxRegex) { return(true) } else { return(false) } }
aTkFiles = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/FILES, lines)
aTkFiles += CMakeLists.txt
aPackages = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/PACKAGES, lines)
anExternLibs = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/EXTERNLIB, lines)
for (aTkFileIter, aTkFiles) { OTHER_FILES += $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aTkFileIter }
for (anExternLib, anExternLibs) {
hasCsf = $$find(anExternLib, CSF_)
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
} else {
LIBS += -l$$anExternLib
}
}
# Iterate over Packages and add compilable files into this project
isEmpty (aPackages) { aPackages = $$OCC_TOOLKIT_NAME }
for (aPackage, aPackages) {
aPackageFolder = $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aPackage
aPackageFiles = $$cat($$aSrcRoot/$$aPackage/FILES, lines)
for (aFileIter, aPackageFiles) {
occIsCxxFile($$aFileIter) {
SOURCES += $$aSrcRoot/$$aPackage/$$aFileIter
}
}
}
# extend clean with versioned .so files
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}.$${aVerMic}
}
}
}

View File

@@ -0,0 +1,2 @@
OCC_TOOLKIT_NAME = \$\$TARGET
include(../../OccToolkit.pri)

41
adm/qmake/Occt.pro Normal file
View File

@@ -0,0 +1,41 @@
# This is an experimental Solution project for building entire OCCT framework using qmake.
# It can be also used for just source code navigation in Qt Creator without actually building OCCT.
# Note, as this is an experimental project, compiler flags might differ from official builds - use it on your own risk!
# Building OCCT using CMake is a preferred solution.
#
# This project GENERATES sub-projects (OCCT modules) dynamically, so to start using it:
# - Launch genconf, select Project Format "Qt Project" and configure dependencies; this will also generate "custom.auto.pri".
# - Launch genproj to fill in "inc" folder with links to header files.
# - Open project in Qt Creator, and call "Run qmake".
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
# - "Run qmake" and perform Build.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
OTHER_FILES += OccModule.pro.in \
OcctHeaderLink.hxx.in \
OccToolkit.pro.in \
OccCppConfig.pri \
OccModule.pri \
OccToolkit.pri \
custom.pri.template
# Iterate over Modules and generate sub-projects
aSolModuleList = $$cat(../MODULES, lines)
for (aSolModuleIter, aSolModuleList) {
aSolModule = $$first($$list($$aSolModuleIter))
eval(occtkgen_$${aSolModule}.input = $$_PRO_FILE_PWD_/OccModule.pro.in)
eval(occtkgen_$${aSolModule}.output = $$_PRO_FILE_PWD_/$${aSolModule}/$${aSolModule}.pro)
eval(occtkgen_$${aSolModule}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aSolModule})
SUBDIRS += $${aSolModule}
}
# These dependencies are manually defined
ModelingData.depends = FoundationClasses
ModelingAlgorithms.depends = FoundationClasses ModelingData
Visualization.depends = FoundationClasses ModelingData ModelingAlgorithms
ApplicationFramework.depends = FoundationClasses ModelingData ModelingAlgorithms Visualization
DataExchange.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework
Draw.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework DataExchange Visualization

0
adm/qmake/OcctDummy.in Normal file
View File

View File

@@ -0,0 +1 @@
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"

View File

@@ -0,0 +1,17 @@
PRODUCTS_PATH = c:/3rdparty/vc14
#CONFIG += HAVE_FREEIMAGE
#CONFIG += HAVE_FFMPEG
#CONFIG += HAVE_TBB
#CONFIG += HAVE_GLES2
#CONFIG += HAVE_D3D
#CONFIG += HAVE_VTK
aFreeType = $$PRODUCTS_PATH/freetype-2.5.5-vc14-64
aTclTk = $$PRODUCTS_PATH/tcltk-86-64
INCLUDEPATH += $$aFreeType/include
LIBS += -L$$aFreeType/lib
INCLUDEPATH += $$aTclTk/include
LIBS += -L$$aTclTk/lib

View File

@@ -29,6 +29,7 @@ set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64="
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"

View File

@@ -6,7 +6,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath
# Reset values
export CASROOT="__CASROOT__"
export CASDEB=""
export TARGET="";
export PRJFMT="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_FREEIMAGE="false";
@@ -40,9 +40,9 @@ do
elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
export CASDEB="i"
elif [ "$i" == "cbp" ]; then
export TARGET="cbp";
export PRJFMT="cbp";
elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
export TARGET="xcd";
export PRJFMT="xcd";
fi
done
shopt -u nocasematch
@@ -64,28 +64,32 @@ else
fi
export CASBIN=""
if [ "${TARGET}" == "cbp" ]; then
export CASBIN="${WOKSTATION}/cbp"
elif [ "${TARGET}" == "xcd" ]; then
if [ "${PRJFMT}" == "xcd" ]; then
export CASBIN="adm/mac/xcd/build"
else
if [ "$aSystem" == "Darwin" ]; then
export CASBIN="${WOKSTATION}/clang"
else
export CASBIN="${WOKSTATION}/gcc"
fi
fi
export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
if [ "${TARGET}" == "cbp" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
elif [ "${TARGET}" == "xcd" ]; then
if [ "${PRJFMT}" == "xcd" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
else
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
fi
export CSF_OPT_CMPL=""
@@ -174,7 +178,7 @@ export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}"
export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
if [ "${TARGET}" == "xcd" ]; then
if [ "${PRJFMT}" == "xcd" ]; then
if [ "${CASDEB}" == "d" ]; then
export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
else

View File

@@ -1716,9 +1716,30 @@ aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array
aGroup->AddPrimitiveArray (aLines);
~~~~
@subsection upgrade_740_prsupdate Presentation invalidation
Historically AIS_InteractiveObject provided two independent mechanisms invalidating presentation (asking presentation manager to recompute specific display mode or all modes):
1. *AIS_InteractiveObject::SetToUpdate()*, marking existing presentation for update.
This is main invalidation API, which is expected to be followed by *AIS_InteractiveContext::Update()* call.
2. *AIS_InteractiveObject::myToRecomputeModes* + *myRecomputeEveryPrs*.
This is auxiliary invalidation API, used internally by AIS_InteractiveContext::SetColor()/UnsetColor() and similar modification methods.
The latter one has been removed to avoid confusion and unexpected behavior.
In addition, two methods *AIS_InteractiveObject::Update()* have been deprecated in favor of new *AIS_InteractiveObject::UpdatePresentations()* recomputing only invalidated presentations.
Custom presentations implementing interface methods *AIS_InteractiveObject::SetColor()* and others should be revised to use *AIS_InteractiveObject::SetToUpdate()*
or updating presentation without recomputation (see *AIS_InteractiveObject::SynchronizeAspects()* and *AIS_InteractiveObject::replaceAspects()*).
@subsection upgrade_740_interiorstyles Interior styles
* *Aspect_IS_HOLLOW* is now an alias to *Aspect_IS_EMPTY* and does not implicitly enables drawing mesh edges anymore.
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_EMPTY) to get previous behavior of Aspect_IS_HOLLOW style.
* *Aspect_IS_HIDDENLINE* does not implicitly enables drawing mesh edges anymore.
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_HIDDENLINE) to get previous behavior of Aspect_IS_HIDDENLINE style.
@subsection upgrade_740_geproj Custom defines within env.bat
*env.bat* produced by Visual Studio project generator *genproj.bat* has been modified so that *%CSF_DEFINES%* variable is reset to initial state.
Custom building environment relying on old behavior and setting extra macros within *%CSF_DEFINES%* before env.bat should be updated
to either modify custom.bat or setup new variable *%CSF_DEFINES_EXTRA%* instead.

View File

@@ -23,7 +23,7 @@ WARNINGS = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC "Standard_DEPRECATED=//! @deprecated "
GENERATE_HTML = YES
GENERATE_LATEX = NO
SEARCH_INCLUDES = YES

10
genproj
View File

@@ -19,10 +19,6 @@ anOpt2=$2
anOpt3=$3
anOpt4=$4
anOpt5=$5
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
if [ ! -e "${aScriptPath}/custom.sh" ]; then
tclsh "${aScriptPath}/adm/genconf.tcl"
@@ -37,6 +33,12 @@ source "${aScriptPath}/custom.sh"
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
if [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
cd $aScriptPath
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5

View File

@@ -49,6 +49,10 @@ if "%aPlatform%" == "" (
)
)
set aPrjFmt=%PRJFMT%
if "%aPrjFmt%" == "" ( set "aPrjFmt=vcxproj" )
if "%aPrjFmt%" == "vcxproj" ( set "aPrjFmt=%VCFMT%" )
cd %~dp0
%TCL_EXEC% %~dp0adm/start.tcl genproj %VCFMT% %aPlatform% %3 %4 %5
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% %3 %4 %5
SET "PATH=%OLD_PATH%"

View File

@@ -17,7 +17,8 @@ void ISession2D_Shape::Add(const TopoDS_Shape& aShape)
myListOfShape.Append(aShape);
myAlgo.Nullify();
myPolyAlgo.Nullify();
Update(); // protected method used to specify that the presentation are not up to date
SetToUpdate();
UpdatePresentations();
}
void ISession2D_Shape::Remove (const TopoDS_Shape& theShape)
@@ -42,23 +43,17 @@ void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
myProjector= aProjector;
myAlgo.Nullify();
myPolyAlgo.Nullify();
Update(); // protected method used to specify that the presentation are not up to date
SetToUpdate();
UpdatePresentations();
};
void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos)
{
myNbIsos= aNbIsos;
myAlgo.Nullify();
// declare the mode 100 to 110 as non valid
for (int i=100;i<=110;i++)
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
// declare the mode 1100 to 1110 as non valid
for (int i=1100;i<=1110;i++)
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
{
myNbIsos= aNbIsos;
myAlgo.Nullify();
SetToUpdate();
UpdatePresentations();
};
void ISession2D_Shape::BuildAlgo()

View File

@@ -51,7 +51,7 @@ proc drawObjects {theRow theColor} {
uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
uplevel #0 ttranslate $aSph $x $y 0
uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
uplevel #0 vdisplay -noredraw $aSph $aBox
uplevel #0 vdisplay -noredraw -dispMode 1 $aSph $aBox
uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
if {$theColor != ""} {
uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
@@ -64,21 +64,19 @@ proc drawObjects {theRow theColor} {
# setup 3D viewer content
pload MODELING VISUALIZATION
catch { vclose View1 }
vinit View1 w=768 h=768
vclear
vclose ALL
vinit View1 w=768 h=768
vtop
vglinfo
vsetgradientbg 180 200 255 180 180 180 2
vlight -change 0 -dir 0.577 -0.577 -0.577
vsetdispmode 1
vrenderparams -msaa 8
# adjust scene bounding box
box bnd 0 0 0 180 210 1
vdisplay -noredraw bnd
vsetdispmode bnd 0
vdisplay -noredraw -dispMode 0 bnd
vfit
vremove -noredraw bnd
@@ -88,5 +86,3 @@ drawObjects 0 ""
drawObjects 1 red
drawObjects 2 green
drawObjects 3 blue1
#vfit
vzfit

View File

@@ -168,7 +168,7 @@ void AIS_Animation::StartTimer (const Standard_Real theStartPts,
{
if (myTimer.IsNull())
{
myTimer = new AIS_AnimationTimer();
myTimer = new Media_Timer();
}
myTimer->Stop();
myTimer->Seek (theStartPts);

View File

@@ -191,7 +191,7 @@ protected:
protected:
Handle(AIS_AnimationTimer) myTimer;
Handle(Media_Timer) myTimer;
TCollection_AsciiString myName; //!< animation name
NCollection_Sequence<Handle(AIS_Animation)>

View File

@@ -15,60 +15,7 @@
#ifndef _AIS_AnimationTimer_HeaderFile
#define _AIS_AnimationTimer_HeaderFile
#include <OSD_Timer.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
//! Auxiliary class defining the animation timer.
class AIS_AnimationTimer : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationTimer, Standard_Transient)
public:
//! Empty constructor.
AIS_AnimationTimer() : myTimerFrom (0.0), myTimerSpeed (1.0) {}
//! Return elapsed time in seconds.
Standard_Real ElapsedTime() const
{
return myTimerFrom + myTimer.ElapsedTime() * myTimerSpeed;
}
//! Return playback speed coefficient (1.0 means normal speed).
Standard_Real PlaybackSpeed() const { return myTimerSpeed; }
//! Setup playback speed coefficient.
Standard_EXPORT void SetPlaybackSpeed (const Standard_Real theSpeed);
//! Return true if timer has been started.
Standard_Boolean IsStarted() const
{
return myTimer.IsStarted();
}
//! Start the timer.
void Start()
{
myTimer.Start();
}
//! Pause the timer.
Standard_EXPORT void Pause();
//! Stop the timer.
Standard_EXPORT void Stop();
//! Seek the timer to specified position.
Standard_EXPORT void Seek (const Standard_Real theTime);
protected:
OSD_Timer myTimer;
Standard_Real myTimerFrom;
Standard_Real myTimerSpeed;
};
DEFINE_STANDARD_HANDLE(AIS_AnimationTimer, Standard_Transient)
#include <Media_Timer.hxx>
typedef Media_Timer AIS_AnimationTimer;
#endif // _AIS_AnimationTimer_HeaderFile

View File

@@ -81,7 +81,7 @@ myIsXYZAxis(Standard_True)
Standard_Real aLength;
try {
aLength = UnitsAPI::AnyToLS(100. ,"mm");
} catch (Standard_Failure) {
} catch (Standard_Failure const&) {
aLength = 0.1;
}
DA->SetAxisLength(aLength,aLength,aLength);
@@ -221,7 +221,7 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(aCol);
SynchronizeAspects();
}
//=======================================================================
@@ -230,7 +230,6 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
//=======================================================================
void AIS_Axis::SetWidth(const Standard_Real aValue)
{
if(aValue<0.0) return;
if(aValue==0) UnsetWidth();
@@ -240,6 +239,7 @@ void AIS_Axis::SetWidth(const Standard_Real aValue)
DA->LineAspect(Prs3d_DP_XAxis)->SetWidth(aValue);
DA->LineAspect(Prs3d_DP_YAxis)->SetWidth(aValue);
DA->LineAspect(Prs3d_DP_ZAxis)->SetWidth(aValue);
SynchronizeAspects();
}
@@ -324,14 +324,13 @@ AcceptDisplayMode(const Standard_Integer aMode) const
//=======================================================================
void AIS_Axis::UnsetColor()
{
myDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
hasOwnColor=Standard_False;
hasOwnColor = Standard_False;
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_NOC_TURQUOISE);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_NOC_TURQUOISE);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_NOC_TURQUOISE);
SynchronizeAspects();
}
//=======================================================================
//function : UnsetWidth
@@ -340,10 +339,10 @@ void AIS_Axis::UnsetColor()
void AIS_Axis::UnsetWidth()
{
myOwnWidth = 0.0;
myOwnWidth = 0.0f;
myDrawer->LineAspect()->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(1.);
SynchronizeAspects();
}

View File

@@ -90,6 +90,7 @@ void AIS_CameraFrustum::SetColor (const Quantity_Color& theColor)
AIS_InteractiveObject::SetColor (theColor);
myDrawer->ShadingAspect()->SetColor (theColor);
myDrawer->LineAspect()->SetColor (theColor);
SynchronizeAspects();
}
//=======================================================================
@@ -107,6 +108,7 @@ void AIS_CameraFrustum::UnsetColor()
myDrawer->ShadingAspect()->SetColor (THE_DEFAULT_COLOR);
myDrawer->LineAspect()->SetColor (THE_DEFAULT_COLOR);
SynchronizeAspects();
}
//=======================================================================
@@ -117,6 +119,7 @@ void AIS_CameraFrustum::UnsetTransparency()
{
myDrawer->ShadingAspect()->SetTransparency (0.0f);
myDrawer->SetTransparency (0.0f);
SynchronizeAspects();
}
//=======================================================================

View File

@@ -112,6 +112,29 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
}
//=======================================================================
//function : replaceWithNewLineAspect
//purpose :
//=======================================================================
void AIS_Circle::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetLineAspect (theAspect);
return;
}
const Handle(Graphic3d_AspectLine3d) anAspectOld = myDrawer->LineAspect()->Aspect();
const Handle(Graphic3d_AspectLine3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetLineAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -122,34 +145,41 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
hasOwnColor=Standard_True;
myDrawer->SetColor (aCol);
Standard_Real WW = HasWidth() ? myOwnWidth :
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
1.;
if (!myDrawer->HasOwnLineAspect ())
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
if (!myDrawer->HasOwnLineAspect())
{
Standard_Real WW = HasWidth() ? myOwnWidth :
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
1.;
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
}
else
{
myDrawer->LineAspect()->SetColor(aCol);
SynchronizeAspects();
}
}
//=======================================================================
//function : SetWidth
//purpose :
//=======================================================================
void AIS_Circle::SetWidth(const Standard_Real aValue)
{
myOwnWidth=aValue;
myOwnWidth = (Standard_ShortReal )aValue;
if (!myDrawer->HasOwnLineAspect ()) {
if (!myDrawer->HasOwnLineAspect())
{
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
} else
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
}
else
{
myDrawer->LineAspect()->SetWidth(aValue);
SynchronizeAspects();
}
}
@@ -161,15 +191,18 @@ void AIS_Circle::UnsetColor()
{
hasOwnColor = Standard_False;
Handle(Prs3d_LineAspect) NullAsp;
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
else{
if (!HasWidth())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Quantity_Color CC = Quantity_NOC_YELLOW;;
if( HasColor() ) CC = myDrawer->Color();
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
myDrawer->LineAspect()->SetColor(CC);
myDrawer->SetColor (CC);
SynchronizeAspects();
}
}
@@ -179,11 +212,13 @@ void AIS_Circle::UnsetColor()
//=======================================================================
void AIS_Circle::UnsetWidth()
{
Handle(Prs3d_LineAspect) NullAsp;
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
else{
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
if (!HasColor())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.0f;
myDrawer->LineAspect()->SetWidth(WW);
myOwnWidth = WW;
}

View File

@@ -115,6 +115,9 @@ private:
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
//! Replace aspects of already computed groups with the new value.
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
private:
Handle(Geom_Circle) myComponent;

View File

@@ -124,8 +124,7 @@ Handle(AIS_ColoredDrawer) AIS_ColoredShape::CustomAspects (const TopoDS_Shape& t
{
aDrawer = new AIS_ColoredDrawer (myDrawer);
myShapeColors.Bind (theShape, aDrawer);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
SetToUpdate();
}
return aDrawer;
}
@@ -141,8 +140,7 @@ void AIS_ColoredShape::ClearCustomAspects()
return;
}
myShapeColors.Clear();
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
SetToUpdate();
}
//=======================================================================
@@ -157,8 +155,7 @@ void AIS_ColoredShape::UnsetCustomAspects (const TopoDS_Shape& theShape,
return;
}
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
SetToUpdate();
if (theToUnregister)
{
myShapeColors.UnBind (theShape);
@@ -183,8 +180,6 @@ void AIS_ColoredShape::SetCustomColor (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setColor (aDrawer, theColor);
aDrawer->SetOwnColor (theColor);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -202,8 +197,6 @@ void AIS_ColoredShape::SetCustomTransparency (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setTransparency (aDrawer, theTransparency);
aDrawer->SetOwnTransparency (theTransparency);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -221,8 +214,6 @@ void AIS_ColoredShape::SetCustomWidth (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setWidth (aDrawer, theLineWidth);
aDrawer->SetOwnWidth (theLineWidth);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================

View File

@@ -352,7 +352,7 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
Handle(Font_FTFont) aFont = new Font_FTFont();
aFont->Init (aTextAspect->Aspect()->Font().ToCString(),
aTextAspect->Aspect()->GetTextFontAspect(),
(const unsigned int)aTextAspect->Height(),
(unsigned int )aTextAspect->Height(),
THE_2D_TEXT_RESOLUTION);
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )

View File

@@ -952,7 +952,8 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
return;
}
theIObj->Update (theAllModes);
theIObj->SetToUpdate();
theIObj->UpdatePresentations (theAllModes);
if (!theToUpdateViewer)
{
return;
@@ -1006,13 +1007,7 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
return;
}
TColStd_ListOfInteger aPrsModes;
theIObj->ToBeUpdated (aPrsModes);
for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
{
theIObj->Update (aPrsModesIt.Value(), Standard_False);
}
theIObj->UpdatePresentations();
mgrSelector->Update(theIObj);
if (theUpdateViewer)
@@ -1369,63 +1364,6 @@ void AIS_InteractiveContext::SetCurrentFacingModel (const Handle(AIS_Interactive
}
}
//=======================================================================
//function : redisplayPrsRecModes
//purpose :
//=======================================================================
void AIS_InteractiveContext::redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer)
{
if (theIObj->RecomputeEveryPrs())
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
for (TColStd_ListIteratorOfListOfInteger aModes (theIObj->ListOfRecomputeModes()); aModes.More(); aModes.Next())
{
theIObj->Update (aModes.Value(), Standard_False);
}
theIObj->UpdateSelection();
theIObj->SetRecomputeOk();
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
//function : redisplayPrsModes
//purpose :
//=======================================================================
void AIS_InteractiveContext::redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer)
{
if (theIObj->RecomputeEveryPrs())
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
TColStd_ListOfInteger aModes;
theIObj->ToBeUpdated (aModes);
for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
{
theIObj->Update (aModeIter.Value(), Standard_False);
}
theIObj->SetRecomputeOk();
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -1441,7 +1379,11 @@ void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theI
setContextToObject (theIObj);
theIObj->SetColor (theColor);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1486,7 +1428,11 @@ void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_Interacti
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnDeviationCoefficient (theCoefficient);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1516,7 +1462,11 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_Intera
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1545,7 +1495,11 @@ void AIS_InteractiveContext::SetDeviationAngle (const Handle(AIS_InteractiveObje
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnDeviationAngle (theAngle);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1574,15 +1528,10 @@ void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveO
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetAngleAndDeviation (theAngle);
if (theIObj->RecomputeEveryPrs())
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
Update (theIObj, theToUpdateViewer);
UpdateCurrentViewer();
}
}
@@ -1611,7 +1560,11 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_Interacti
}
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetHLRAngleAndDeviation (theAngle);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1639,7 +1592,11 @@ void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveO
}
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnHLRDeviationAngle (theAngle);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1655,7 +1612,11 @@ void AIS_InteractiveContext::UnsetColor (const Handle(AIS_InteractiveObject)& th
}
theIObj->UnsetColor();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1701,7 +1662,7 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
setContextToObject (theIObj);
theIObj->SetWidth (theWidth);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
{
if (myLastinMain->IsAutoHilight())
@@ -1718,6 +1679,10 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
myLastinMain);
}
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1733,7 +1698,11 @@ void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& th
}
theIObj->UnsetWidth();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1751,7 +1720,11 @@ void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& t
setContextToObject (theIObj);
theIObj->SetMaterial (theMaterial);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1766,7 +1739,11 @@ void AIS_InteractiveContext::UnsetMaterial (const Handle(AIS_InteractiveObject)&
return;
}
theIObj->UnsetMaterial();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1796,7 +1773,11 @@ void AIS_InteractiveContext::SetTransparency (const Handle(AIS_InteractiveObject
}
theIObj->SetTransparency (theValue);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1812,7 +1793,11 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
}
theIObj->UnsetTransparency();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================

View File

@@ -1082,6 +1082,7 @@ public: //! @name iso-line display attributes
//! Returns true if drawing isolines on triangulation algorithm is enabled.
Standard_EXPORT Standard_Boolean IsoOnTriangulation() const;
//! @name obsolete methods
public:
//! Updates the view of the current object in open context.
@@ -1207,14 +1208,6 @@ protected: //! @name internal methods
Standard_EXPORT void InitAttributes();
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
//! UNKNOWN
Standard_EXPORT void redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer);
//! UNKNOWN
Standard_EXPORT void redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer);
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);

View File

@@ -52,12 +52,11 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveObject,SelectMgr_SelectableObject)
AIS_InteractiveObject::AIS_InteractiveObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
myCTXPtr (NULL),
myOwnWidth (0.0),
myOwnWidth (0.0f),
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
myInfiniteState (Standard_False),
hasOwnColor (Standard_False),
hasOwnMaterial (Standard_False),
myRecomputeEveryPrs (Standard_True)
hasOwnMaterial (Standard_False)
{
SetCurrentFacingModel();
}
@@ -90,14 +89,6 @@ AIS_KindOfInteractive AIS_InteractiveObject::Type() const
Standard_Integer AIS_InteractiveObject::Signature() const
{return -1;}
//=======================================================================
//function : RecomputeEveryPrs
//purpose :
//=======================================================================
Standard_Boolean AIS_InteractiveObject::RecomputeEveryPrs() const
{return myRecomputeEveryPrs;}
//=======================================================================
//function :
//purpose :
@@ -200,7 +191,7 @@ void AIS_InteractiveObject::UnsetColor()
//=======================================================================
void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
{
myOwnWidth = aValue;
myOwnWidth = (Standard_ShortReal )aValue;
}
//=======================================================================
@@ -209,7 +200,7 @@ void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
//=======================================================================
void AIS_InteractiveObject::UnsetWidth()
{
myOwnWidth = 0.;
myOwnWidth = 0.0f;
}
//=======================================================================
@@ -333,32 +324,10 @@ void AIS_InteractiveObject::UnsetAttributes()
hasOwnColor = Standard_False;
hasOwnMaterial = Standard_False;
myOwnWidth = 0.0;
myOwnWidth = 0.0f;
myDrawer->SetTransparency (0.0f);
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void AIS_InteractiveObject::MustRecomputePrs(const Standard_Integer ) const
{}
//=======================================================================
//function :
//purpose :
//=======================================================================
const TColStd_ListOfInteger& AIS_InteractiveObject::ListOfRecomputeModes() const
{return myToRecomputeModes;}
//=======================================================================
//function :
//purpose :
//=======================================================================
void AIS_InteractiveObject::SetRecomputeOk()
{myToRecomputeModes.Clear();}
//=======================================================================
//function : AcceptDisplayMode
//purpose :

View File

@@ -283,7 +283,7 @@ public:
virtual void Color (Quantity_Color& theColor) const { theColor = myDrawer->Color(); }
//! Returns true if the Interactive Object has width.
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0; }
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0f; }
//! Returns the width setting of the Interactive Object.
Standard_Real Width() const { return myOwnWidth; }
@@ -395,36 +395,19 @@ protected:
//! and then modify them directly followed by SynchronizeAspects() call.
Standard_EXPORT void replaceAspects (const Graphic3d_MapOfAspectsToAspects& theMap);
private:
Standard_EXPORT virtual Standard_Boolean RecomputeEveryPrs() const;
Standard_EXPORT void MustRecomputePrs (const Standard_Integer aMode) const;
Standard_EXPORT const TColStd_ListOfInteger& ListOfRecomputeModes() const;
Standard_EXPORT void SetRecomputeOk();
protected:
//! The TypeOfPresention3d means that the interactive object
//! may have a presentation dependant of the view of Display.
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
private:
protected:
AIS_InteractiveContext* myCTXPtr;
Handle(Standard_Transient) myOwner;
protected:
TColStd_ListOfInteger myToRecomputeModes;
Standard_Real myOwnWidth;
Standard_ShortReal myOwnWidth;
Aspect_TypeOfFacingModel myCurrentFacingModel;
Standard_Boolean myInfiniteState;
Standard_Boolean hasOwnColor;
Standard_Boolean hasOwnMaterial;
Standard_Boolean myRecomputeEveryPrs;
};

View File

@@ -41,52 +41,6 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_Line,AIS_InteractiveObject)
//==================================================================
// function: FindLimits
// purpose:
//==================================================================
//unused
/*#ifdef OCCT_DEBUG
static void FindLimits(const Adaptor3d_Curve& aCurve,
const Standard_Real aLimit,
gp_Pnt& P1,
gp_Pnt& P2)
{
Standard_Real First = aCurve.FirstParameter();
Standard_Real Last = aCurve.LastParameter();
Standard_Boolean firstInf = Precision::IsNegativeInfinite(First);
Standard_Boolean lastInf = Precision::IsPositiveInfinite(Last);
if (firstInf || lastInf) {
Standard_Real delta = 1;
if (firstInf && lastInf) {
do {
delta *= 2;
First = - delta;
Last = delta;
aCurve.D0(First,P1);
aCurve.D0(Last,P2);
} while (P1.Distance(P2) < aLimit);
}
else if (firstInf) {
aCurve.D0(Last,P2);
do {
delta *= 2;
First = Last - delta;
aCurve.D0(First,P1);
} while (P1.Distance(P2) < aLimit);
}
else if (lastInf) {
aCurve.D0(First,P1);
do {
delta *= 2;
Last = First + delta;
aCurve.D0(Last,P2);
} while (P1.Distance(P2) < aLimit);
}
}
}
#endif
*/
//=======================================================================
//function : AIS_Line
//purpose :
@@ -126,8 +80,7 @@ void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager3d)&,
void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
// throw Standard_NotImplemented("AIS_Line::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
}
//=======================================================================
@@ -152,6 +105,29 @@ void AIS_Line::ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
}
}
//=======================================================================
//function : replaceWithNewLineAspect
//purpose :
//=======================================================================
void AIS_Line::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetLineAspect (theAspect);
return;
}
const Handle(Graphic3d_Aspects)& anAspectOld = myDrawer->LineAspect()->Aspect();
const Handle(Graphic3d_Aspects)& anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetLineAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -165,10 +141,15 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
if (!myDrawer->HasOwnLineAspect ())
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
if (!myDrawer->HasOwnLineAspect())
{
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
}
else
myDrawer->LineAspect()->SetColor(aCol);
{
myDrawer->LineAspect()->SetColor (aCol);
SynchronizeAspects();
}
}
@@ -180,16 +161,19 @@ void AIS_Line::UnsetColor()
{
hasOwnColor = Standard_False;
Handle(Prs3d_LineAspect) NullAsp;
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
else{
if (!HasWidth())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
myDrawer->LineAspect()->SetColor(CC);
myDrawer->SetColor (CC);
}
SynchronizeAspects();
}
}
//=======================================================================
@@ -198,15 +182,20 @@ void AIS_Line::UnsetColor()
//=======================================================================
void AIS_Line::SetWidth(const Standard_Real aValue)
{
myOwnWidth=aValue;
myOwnWidth = (Standard_ShortReal )aValue;
if (!myDrawer->HasOwnLineAspect ()) {
if (!myDrawer->HasOwnLineAspect())
{
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
} else
myDrawer->LineAspect()->SetWidth(aValue);
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
}
else
{
myDrawer->LineAspect()->SetWidth (aValue);
SynchronizeAspects();
}
}
@@ -216,14 +205,16 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
//=======================================================================
void AIS_Line::UnsetWidth()
{
Handle(Prs3d_LineAspect) NullAsp;
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
else{
Standard_Real WW = myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
myDrawer->LineAspect()->SetWidth(WW);
if (!HasColor())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.0f;
myDrawer->LineAspect()->SetWidth (WW);
myOwnWidth = WW;
SynchronizeAspects();
}
}

View File

@@ -107,6 +107,9 @@ private:
Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
//! Replace aspects of already computed groups with the new value.
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
private:
Handle(Geom_Line) myComponent;

View File

@@ -297,7 +297,7 @@ void AIS_Manipulator::SetPart (const Standard_Integer theAxisIndex, const AIS_Ma
//=======================================================================
void AIS_Manipulator::SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled)
{
for (Standard_Integer anIt = 0; anIt < 4; ++anIt)
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
SetPart (anIt, theMode, theIsEnabled);
}

250
src/AIS/AIS_MediaPlayer.cxx Normal file
View File

@@ -0,0 +1,250 @@
// Created by: Kirill GAVRILOV
// Copyright (c) 2019 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 <AIS_MediaPlayer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Media_PlayerContext.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_MediaTexture.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
#include <V3d_Viewer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_MediaPlayer, AIS_InteractiveObject)
//! Create an array of triangles defining a rectangle.
static Handle(Graphic3d_ArrayOfTriangles) createRectangleArray (const Graphic3d_Vec2i& theLower,
const Graphic3d_Vec2i& theUpper,
Graphic3d_ArrayFlags theFlags)
{
Handle(Graphic3d_ArrayOfTriangles) aRectTris = new Graphic3d_ArrayOfTriangles (4, 6, theFlags);
aRectTris->AddVertex (gp_Pnt (theLower.x(), theLower.y(), 0.0), gp_Pnt2d (0.0, 1.0));
aRectTris->AddVertex (gp_Pnt (theLower.x(), theUpper.y(), 0.0), gp_Pnt2d (0.0, 0.0));
aRectTris->AddVertex (gp_Pnt (theUpper.x(), theUpper.y(), 0.0), gp_Pnt2d (1.0, 0.0));
aRectTris->AddVertex (gp_Pnt (theUpper.x(), theLower.y(), 0.0), gp_Pnt2d (1.0, 1.0));
aRectTris->AddEdges (1, 2, 3);
aRectTris->AddEdges (1, 3, 4);
return aRectTris;
}
//================================================================
// Function : AIS_MediaPlayer
// Purpose :
//================================================================
AIS_MediaPlayer::AIS_MediaPlayer()
: myFramePair (new Graphic3d_MediaTextureSet()),
myFrameSize (1, 1),
myToClosePlayer (false)
{
SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_LOWER));
SetZLayer (Graphic3d_ZLayerId_TopOSD);
SetInfiniteState (true);
Graphic3d_MaterialAspect aMat;
myFrameAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_WHITE, Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0f, aMat, aMat);
myFrameAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
myFrameAspect->SetTextureMapOn (true);
myFrameAspect->SetTextureSet (myFramePair);
}
//================================================================
// Function : ~AIS_MediaPlayer
// Purpose :
//================================================================
AIS_MediaPlayer::~AIS_MediaPlayer()
{
// stop threads
myFramePair.Nullify();
}
// =======================================================================
// function : OpenInput
// purpose :
// =======================================================================
void AIS_MediaPlayer::OpenInput (const TCollection_AsciiString& thePath,
Standard_Boolean theToWait)
{
if (myFramePair->PlayerContext().IsNull()
&& thePath.IsEmpty())
{
return;
}
myFramePair->OpenInput (thePath, theToWait);
SynchronizeAspects();
}
// =======================================================================
// function : PresentFrame
// purpose :
// =======================================================================
bool AIS_MediaPlayer::PresentFrame (const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize)
{
if (myToClosePlayer)
{
myToClosePlayer = false;
if (!HasInteractiveContext())
{
return false;
}
if (!myFramePair->PlayerContext().IsNull())
{
myFramePair->PlayerContext()->Pause();
}
Handle(AIS_InteractiveContext) aCtx = GetContext();
Handle(AIS_InteractiveObject) aThis = this;
aCtx->Remove (aThis, false);
aCtx->CurrentViewer()->Invalidate();
return true;
}
if (myFramePair->PlayerContext().IsNull())
{
return false;
}
bool toRedraw = myFramePair->SwapFrames();
toRedraw = updateSize (theLeftCorner, theMaxSize) || toRedraw;
if (toRedraw)
{
myFrameAspect->SetShaderProgram (myFramePair->ShaderProgram());
SynchronizeAspects();
}
return toRedraw;
}
// =======================================================================
// function : updateSize
// purpose :
// =======================================================================
bool AIS_MediaPlayer::updateSize (const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize)
{
const Graphic3d_Vec2i aFrameSize = myFramePair->FrameSize();
Graphic3d_Vec2i aNewPos = theLeftCorner;
Graphic3d_Vec2i aNewSize = myFrameSize;
if (aFrameSize.x() > 0
&& aFrameSize.y() > 0)
{
const double anAspect = double(theMaxSize.x()) / double(theMaxSize.y());
const double aFitAspect = double(aFrameSize.x()) / double(aFrameSize.y());
aNewSize = aFrameSize;
if (aFitAspect >= anAspect)
{
aNewSize.y() = int(double(aFrameSize.x()) / aFitAspect);
}
else
{
aNewSize.x() = int(double(aFrameSize.y()) * aFitAspect);
}
for (int aCoord = 0; aCoord < 2; ++aCoord)
{
if (aNewSize[aCoord] > theMaxSize[aCoord])
{
const double aScale = double(theMaxSize[aCoord]) / double(aNewSize[aCoord]);
aNewSize.x() = int(double(aNewSize.x()) * aScale);
aNewSize.y() = int(double(aNewSize.y()) * aScale);
}
}
aNewPos = theLeftCorner + theMaxSize / 2 - aNewSize / 2;
}
else if (myFrameSize.x() < 2
|| myFrameSize.y() < 2)
{
aNewSize = theMaxSize;
}
if (myFrameSize == aNewSize
&& myFrameBottomLeft == aNewPos)
{
return false;
}
myFrameSize = aNewSize;
myFrameBottomLeft = aNewPos;
if (HasInteractiveContext())
{
SetToUpdate();
GetContext()->Redisplay (this, false);
GetContext()->CurrentViewer()->Invalidate();
}
return true;
}
// =======================================================================
// function : PlayPause
// purpose :
// =======================================================================
void AIS_MediaPlayer::PlayPause()
{
if (myFramePair->PlayerContext().IsNull())
{
return;
}
Standard_Real aProgress = 0.0, aDuration = 0.0;
bool isPaused = false;
myFramePair->PlayerContext()->PlayPause (isPaused, aProgress, aDuration);
}
// =======================================================================
// function : Compute
// purpose :
// =======================================================================
void AIS_MediaPlayer::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
thePrs->SetInfiniteState (IsInfinite());
if (theMode != 0)
{
return;
}
// main frame
{
Handle(Graphic3d_ArrayOfTriangles) aTris = createRectangleArray (myFrameBottomLeft, myFrameBottomLeft + myFrameSize, Graphic3d_ArrayFlags_VertexTexel);
Handle(Graphic3d_Group) aMainGroup = thePrs->NewGroup();
aMainGroup->SetGroupPrimitivesAspect (myFrameAspect);
aMainGroup->AddPrimitiveArray (aTris);
}
}
// =======================================================================
// function : ComputeSelection
// purpose :
// =======================================================================
void AIS_MediaPlayer::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
if (theMode != 0)
{
return;
}
Handle(Graphic3d_ArrayOfTriangles) aTris = createRectangleArray (myFrameBottomLeft, myFrameBottomLeft + myFrameSize, Graphic3d_ArrayFlags_None);
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this, 5);
Handle(Select3D_SensitivePrimitiveArray) aSens = new Select3D_SensitivePrimitiveArray (anOwner);
aSens->InitTriangulation (aTris->Attributes(), aTris->Indices(), TopLoc_Location());
theSel->Add (aSens);
}

View File

@@ -0,0 +1,96 @@
// Created by: Kirill GAVRILOV
// Copyright (c) 2019 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 _AIS_MediaPlayer_HeaderFile
#define _AIS_MediaPlayer_HeaderFile
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_MediaTextureSet.hxx>
class Media_PlayerContext;
//! Presentation for video playback.
class AIS_MediaPlayer : public AIS_InteractiveObject
{
DEFINE_STANDARD_RTTIEXT(AIS_MediaPlayer, AIS_InteractiveObject)
public:
//! Empty constructor.
Standard_EXPORT AIS_MediaPlayer();
//! Destructor.
Standard_EXPORT virtual ~AIS_MediaPlayer();
//! Setup callback to be called on queue progress (e.g. when new frame should be displayed).
void SetCallback (Graphic3d_MediaTextureSet::CallbackOnUpdate_t theCallbackFunction, void* theCallbackUserPtr)
{
myFramePair->SetCallback (theCallbackFunction, theCallbackUserPtr);
}
//! Open specified file.
Standard_EXPORT void OpenInput (const TCollection_AsciiString& thePath,
Standard_Boolean theToWait);
//! Display new frame.
Standard_EXPORT bool PresentFrame (const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize);
//! Return player context.
const Handle(Media_PlayerContext)& PlayerContext() const { return myFramePair->PlayerContext(); }
//! Switch playback state.
Standard_EXPORT void PlayPause();
//! Schedule player to be closed.
void SetClosePlayer()
{
myToClosePlayer = true;
myFramePair->Notify();
}
//! Return duration.
double Duration() const { return myFramePair->Duration(); }
//! @name AIS_InteractiveObject interface
protected:
//! Accept only display mode 0.
virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
//! Compute presentation.
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode) Standard_OVERRIDE;
//! Compute selection
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode) Standard_OVERRIDE;
protected:
//! Update frame size.
Standard_EXPORT bool updateSize (const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize);
protected:
Handle(Graphic3d_MediaTextureSet) myFramePair;
Handle(Graphic3d_AspectFillArea3d) myFrameAspect;
Graphic3d_Vec2i myFrameBottomLeft;
Graphic3d_Vec2i myFrameSize;
bool myToClosePlayer;
};
#endif // _AIS_MediaPlayer_HeaderFile

View File

@@ -387,7 +387,8 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
myHasOwnSize = Standard_True;
Update();
SetToUpdate();
UpdatePresentations();
UpdateSelection();
}
@@ -418,7 +419,8 @@ void AIS_Plane::UnsetSize()
}
myHasOwnSize = Standard_False;
Update();
SetToUpdate();
UpdatePresentations();
UpdateSelection();
}

View File

@@ -248,6 +248,7 @@ void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
myDrawer->SetColor (aCol);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
SynchronizeAspects();
}

View File

@@ -89,7 +89,7 @@ public:
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
//! Allows you to provide settings for the color aColor.
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; }

View File

@@ -205,6 +205,29 @@ void AIS_Point::UnsetMarker()
|| theMode == -99;
}
//=======================================================================
//function : replaceWithNewPointAspect
//purpose :
//=======================================================================
void AIS_Point::replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetPointAspect (theAspect);
return;
}
const Handle(Graphic3d_AspectMarker3d) anAspectOld = myDrawer->PointAspect()->Aspect();
const Handle(Graphic3d_AspectMarker3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->PointAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetPointAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : UpdatePointValues
//purpose :
@@ -212,12 +235,14 @@ void AIS_Point::UnsetMarker()
void AIS_Point::UpdatePointValues()
{
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
if (!hasOwnColor
&& myOwnWidth == 0.0f
&& !myHasTOM)
{
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
replaceWithNewPointAspect (Handle(Prs3d_PointAspect)());
return;
}
Quantity_Color aCol (Quantity_NOC_YELLOW);
Aspect_TypeOfMarker aTOM = Aspect_TOM_PLUS;
Standard_Real aScale = 1.0;
@@ -229,20 +254,20 @@ void AIS_Point::UpdatePointValues()
}
if(hasOwnColor) aCol = myDrawer->Color();
if(myOwnWidth!=0.0) aScale = myOwnWidth;
if(myOwnWidth != 0.0f) aScale = myOwnWidth;
if(myHasTOM) aTOM = myTOM;
if(myDrawer->HasOwnPointAspect()){
// CLE
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
if(myDrawer->HasOwnPointAspect())
{
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
// ENDCLE
PA->SetColor(aCol);
PA->SetTypeOfMarker(aTOM);
PA->SetScale(aScale);
SynchronizeAspects();
}
else
myDrawer->SetPointAspect(new Prs3d_PointAspect(aTOM,aCol,aScale));
{
replaceWithNewPointAspect (new Prs3d_PointAspect (aTOM, aCol, aScale));
}
}

View File

@@ -59,10 +59,10 @@ public:
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Allows you to provide settings for the Color.
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
//! Allows you to remove color settings.
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
//! Allows you to provide settings for a marker. These include
//! - type of marker,
@@ -91,6 +91,9 @@ private:
Standard_EXPORT void UpdatePointValues();
//! Replace aspects of already computed groups with the new value.
void replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
private:
Handle(Geom_Point) myComponent;

View File

@@ -68,15 +68,6 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)
static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
{
TColStd_ListIteratorOfListOfInteger It(LL);
for(;It.More();It.Next()){
if(It.Value()==aMode)
return Standard_True;}
return Standard_False;
}
// Auxiliary macros
#define replaceAspectWithDef(theMap, theAspect) \
if (myDrawer->Link()->theAspect()->Aspect() != myDrawer->theAspect()->Aspect()) \
@@ -411,8 +402,6 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
myDrawer->SetColor (theColor);
hasOwnColor = Standard_True;
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!toRecompute
|| !myDrawer->HasLink())
{
@@ -432,8 +421,6 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
void AIS_Shape::UnsetColor()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!HasColor())
{
return;
@@ -578,10 +565,8 @@ bool AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
{
myOwnWidth = theLineWidth;
myOwnWidth = (Standard_ShortReal )theLineWidth;
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!setWidth (myDrawer, theLineWidth)
|| !myDrawer->HasLink())
{
@@ -601,14 +586,12 @@ void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
void AIS_Shape::UnsetWidth()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (myOwnWidth == 0.0)
if (myOwnWidth == 0.0f)
{
return;
}
myOwnWidth = 0.0;
myOwnWidth = 0.0f;
if (!HasColor())
{
Graphic3d_MapOfAspectsToAspects aReplaceMap;
@@ -681,8 +664,6 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
setMaterial (myDrawer, theMat, HasColor(), IsTransparent());
hasOwnMaterial = Standard_True;
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!toRecompute
|| !myDrawer->HasLink())
{
@@ -701,8 +682,6 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
void AIS_Shape::UnsetMaterial()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!HasMaterial())
{
return;
@@ -761,8 +740,6 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
setTransparency (myDrawer, theValue);
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!toRecompute
|| !myDrawer->HasLink())
{
@@ -781,9 +758,6 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
void AIS_Shape::UnsetTransparency()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
myDrawer->SetTransparency (0.0f);
if (!myDrawer->HasOwnShadingAspect())
{
@@ -805,18 +779,6 @@ void AIS_Shape::UnsetTransparency()
}
}
//=======================================================================
//function : LoadRecomputable
//purpose :
//=======================================================================
void AIS_Shape::LoadRecomputable(const Standard_Integer TheMode)
{
myRecomputeEveryPrs = Standard_False;
if(!IsInList(myToRecomputeModes,TheMode))
myToRecomputeModes.Append(TheMode);
}
//=======================================================================
//function : BoundingBox
//purpose :
@@ -903,8 +865,7 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
void AIS_Shape::SetOwnDeviationCoefficient ( const Standard_Real aCoefficient )
{
myDrawer->SetDeviationCoefficient( aCoefficient );
SetToUpdate(0) ; // WireFrame
SetToUpdate(1) ; // Shadding
SetToUpdate();
}
//=======================================================================
@@ -923,11 +884,10 @@ void AIS_Shape::SetOwnHLRDeviationCoefficient ( const Standard_Real aCoefficien
//purpose :
//=======================================================================
void AIS_Shape::SetOwnDeviationAngle ( const Standard_Real anAngle )
void AIS_Shape::SetOwnDeviationAngle (const Standard_Real theAngle)
{
myDrawer->SetDeviationAngle(anAngle );
SetToUpdate(0) ; // WireFrame
myDrawer->SetDeviationAngle (theAngle);
SetToUpdate (AIS_WireFrame);
}
//=======================================================================
//function : SetOwnDeviationAngle
@@ -941,8 +901,7 @@ void AIS_Shape::SetAngleAndDeviation ( const Standard_Real anAngle )
SetOwnDeviationAngle(anAngle) ;
SetOwnDeviationCoefficient(OutDefl) ;
myInitAng = anAngle;
SetToUpdate(0);
SetToUpdate(1);
SetToUpdate();
}
//=======================================================================

View File

@@ -302,8 +302,6 @@ protected:
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
Standard_EXPORT void LoadRecomputable (const Standard_Integer TheMode);
//! Create own aspects (if they do not exist) and set color to them.
//! @return TRUE if new aspects have been created
Standard_EXPORT bool setColor (const Handle(Prs3d_Drawer)& theDrawer, const Quantity_Color& theColor) const;

View File

@@ -57,6 +57,7 @@ void AIS_TextLabel::SetColor (const Quantity_Color& theColor)
hasOwnColor = Standard_True;
myDrawer->SetColor (theColor);
myDrawer->TextAspect()->SetColor (theColor);
SynchronizeAspects();
}
//=======================================================================
@@ -74,6 +75,7 @@ void AIS_TextLabel::SetTransparency (const Standard_Real theValue)
myDrawer->TextAspect()->Aspect()->SetColor (aTextColor);
myDrawer->TextAspect()->Aspect()->SetColorSubTitle (aSubColor);
myDrawer->SetTransparency (Standard_ShortReal(theValue));
SynchronizeAspects();
}
//=======================================================================

View File

@@ -425,7 +425,7 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
updateAttributes (thePrs);
}
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
#ifdef OCCT_DEBUG
std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";

View File

@@ -111,9 +111,6 @@ void AIS_Triangulation::updatePresentation()
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
}
}
myRecomputeEveryPrs = Standard_False; // no mode to recalculate - only viewer update
myToRecomputeModes.Clear();
}
}

View File

@@ -85,7 +85,7 @@ AIS_Trihedron::AIS_Trihedron (const Handle(Geom_Axis2Placement)& theComponent)
void AIS_Trihedron::SetComponent (const Handle(Geom_Axis2Placement)& theComponent)
{
myComponent = theComponent;
LoadRecomputable (AIS_WireFrame);
SetToUpdate();
}
//=======================================================================
@@ -135,7 +135,8 @@ void AIS_Trihedron::SetSize(const Standard_Real aValue)
setOwnDatumAspect();
myDrawer->DatumAspect()->SetAxisLength(aValue, aValue, aValue);
Update();
SetToUpdate();
UpdatePresentations();
UpdateSelection();
}
@@ -162,7 +163,8 @@ void AIS_Trihedron::UnsetSize()
}
else
{
Update();
SetToUpdate();
UpdatePresentations();
}
UpdateSelection();
}
@@ -560,19 +562,6 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
}
}
//=======================================================================
//function : LoadRecomputable
//purpose :
//=======================================================================
void AIS_Trihedron::LoadRecomputable (const Standard_Integer theMode)
{
myRecomputeEveryPrs = Standard_False;
if (!myToRecomputeModes.Contains (theMode))
{
myToRecomputeModes.Append (theMode);
}
}
//=======================================================================
//function : SetColor
//purpose :

View File

@@ -224,8 +224,6 @@ protected:
protected:
Standard_EXPORT void LoadRecomputable (const Standard_Integer theMode);
//! Creates a sensitive entity for the datum part that will be used in selection owner creation.
Standard_EXPORT Handle(SelectBasics_SensitiveEntity) createSensitiveEntity (const Prs3d_DatumParts thePart,
const Handle(SelectBasics_EntityOwner)& theOwner) const;

View File

@@ -2,7 +2,6 @@ AIS.cxx
AIS.hxx
AIS_Animation.cxx
AIS_Animation.hxx
AIS_AnimationTimer.cxx
AIS_AnimationTimer.hxx
AIS_AnimationCamera.cxx
AIS_AnimationCamera.hxx
@@ -105,6 +104,8 @@ AIS_MapIteratorOfMapOfInteractive.hxx
AIS_MapOfInteractive.hxx
AIS_MaxRadiusDimension.cxx
AIS_MaxRadiusDimension.hxx
AIS_MediaPlayer.cxx
AIS_MediaPlayer.hxx
AIS_MidPointRelation.cxx
AIS_MidPointRelation.hxx
AIS_MidPointRelation.lxx

View File

@@ -487,7 +487,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
try {
Variation.Approximate();
}
catch (Standard_Failure) {
catch (Standard_Failure const&) {
return;
}

View File

@@ -34,14 +34,14 @@
//=======================================================================
Approx_ComputeCLine::Approx_ComputeCLine
(const MultiLine& Line,
const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
(const MultiLine& Line,
const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
{
mydegremin = degreemin;
mydegremax = degreemax;
@@ -61,13 +61,13 @@ Approx_ComputeCLine::Approx_ComputeCLine
//=======================================================================
Approx_ComputeCLine::Approx_ComputeCLine
(const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
(const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
{
alldone = Standard_False;
mydegremin = degreemin;
@@ -88,21 +88,22 @@ Approx_ComputeCLine::Approx_ComputeCLine
void Approx_ComputeCLine::Perform(const MultiLine& Line)
{
Standard_Real UFirst, ULast;
Standard_Boolean Finish = Standard_False,
begin = Standard_True, Ok = Standard_False;
Standard_Boolean Finish = Standard_False,
begin = Standard_True, Ok = Standard_False;
Standard_Real thetol3d = Precision::Confusion(), thetol2d = Precision::Confusion();
UFirst = Line.FirstParameter();
ULast = Line.LastParameter();
Standard_Real TolU = Max((ULast-UFirst)*1.e-05, Precision::PApproximation());
Standard_Real myfirstU = UFirst;
ULast = Line.LastParameter();
Standard_Real TolU = Max((ULast - UFirst)*1.e-03, Precision::Confusion());
Standard_Real myfirstU = UFirst;
Standard_Real mylastU = ULast;
Standard_Integer aMaxSegments = 0;
Standard_Integer aMaxSegments1 = myMaxSegments - 1;
Standard_Integer aNbCut = 0, aNbImp = 0, aNbComp = 5;
if (!mycut)
{
alldone = Compute(Line, UFirst, ULast, thetol3d, thetol2d);
if (!alldone)
if (!alldone)
{
tolreached = Standard_False;
myfirstparam.Append(UFirst);
@@ -112,25 +113,27 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
Tolers2d.Append(currenttol2d);
}
}
else
else
{
// previous decision to be taken if we get worse with next cut (eap)
AppParCurves_MultiCurve KeptMultiCurve;
Standard_Real KeptUfirst = 0., KeptUlast = 0., KeptT3d = RealLast(), KeptT2d = 0.;
while (!Finish)
while (!Finish)
{
// Gestion du decoupage de la multiline pour approximer:
if (!begin)
if (!begin)
{
if (Ok)
if (Ok)
{
// Calcul de la partie a approximer.
myfirstU = mylastU;
mylastU = ULast;
if (Abs(ULast-myfirstU) <= RealEpsilon()
mylastU = ULast;
aNbCut = 0;
aNbImp = 0;
if (Abs(ULast - myfirstU) <= RealEpsilon()
|| aMaxSegments >= myMaxSegments)
{
Finish = Standard_True;
@@ -147,50 +150,59 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
{
KeptMultiCurve = TheMultiCurve;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
aNbImp++;
}
// cut an interval
mylastU = (myfirstU + mylastU)/2;
mylastU = (myfirstU + mylastU) / 2;
aNbCut++;
}
}
// Calcul des parametres sur ce nouvel intervalle.
Ok = Compute(Line, myfirstU, mylastU, thetol3d, thetol2d);
if(Ok)
if (Ok)
{
aMaxSegments++;
}
//cout << myfirstU << " - " << mylastU << " tol : " << thetol3d << " " << thetol2d << endl;
// is new decision better?
if (!Ok && (Abs(myfirstU-mylastU) <= TolU || aMaxSegments >= aMaxSegments1))
Standard_Boolean aStopCutting = Standard_False;
if (aNbCut >= aNbComp)
{
Ok = Standard_True; // stop interval cutting, approx the rest part
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
{
KeptMultiCurve = TheMultiCurve;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
}
mylastU = KeptUlast;
tolreached = Standard_False; // helas
myMultiCurves.Append(KeptMultiCurve);
aMaxSegments++;
Tolers3d.Append (KeptT3d);
Tolers2d.Append (KeptT2d);
myfirstparam.Append (KeptUfirst);
mylastparam.Append (KeptUlast);
if (aNbCut > aNbImp)
{
aStopCutting = Standard_True;
}
}
// is new decision better?
if (!Ok && (Abs(myfirstU - mylastU) <= TolU || aMaxSegments >= aMaxSegments1 || aStopCutting ))
{
Ok = Standard_True; // stop interval cutting, approx the rest part
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
{
KeptMultiCurve = TheMultiCurve;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
}
mylastU = KeptUlast;
tolreached = Standard_False; // helas
myMultiCurves.Append(KeptMultiCurve);
aMaxSegments++;
Tolers3d.Append(KeptT3d);
Tolers2d.Append(KeptT2d);
myfirstparam.Append(KeptUfirst);
mylastparam.Append(KeptUlast);
}
begin = Standard_False;
} // while (!Finish)
@@ -225,10 +237,10 @@ const
//=======================================================================
Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
const Standard_Real Ufirst,
const Standard_Real Ulast,
Standard_Real& TheTol3d,
Standard_Real& TheTol2d)
const Standard_Real Ufirst,
const Standard_Real Ulast,
Standard_Real& TheTol3d,
Standard_Real& TheTol2d)
{
@@ -243,14 +255,14 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
if (mydone) {
LSquare.Error(Fv, TheTol3d, TheTol2d);
if (TheTol3d <= mytol3d && TheTol2d <= mytol2d) {
// Stockage de la multicurve approximee.
tolreached = Standard_True;
// Stockage de la multicurve approximee.
tolreached = Standard_True;
myMultiCurves.Append(LSquare.Value());
myfirstparam.Append(Ufirst);
mylastparam.Append(Ulast);
Tolers3d.Append(TheTol3d);
Tolers2d.Append(TheTol2d);
return Standard_True;
myfirstparam.Append(Ufirst);
mylastparam.Append(Ulast);
Tolers3d.Append(TheTol3d);
Tolers2d.Append(TheTol2d);
return Standard_True;
}
}
if (deg == mydegremax) {
@@ -258,7 +270,7 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
currenttol3d = TheTol3d;
currenttol2d = TheTol2d;
}
}
return Standard_False;
}
@@ -270,11 +282,11 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
//=======================================================================
void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
Standard_Real& firstpar,
Standard_Real& lastpar) const
Standard_Real& firstpar,
Standard_Real& lastpar) const
{
firstpar = myfirstparam.Value(Index);
lastpar = mylastparam.Value(Index);
lastpar = mylastparam.Value(Index);
}
//=======================================================================
@@ -283,7 +295,7 @@ void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
//=======================================================================
void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
const Standard_Integer degreemax)
const Standard_Integer degreemax)
{
mydegremin = degreemin;
mydegremax = degreemax;
@@ -295,7 +307,7 @@ void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
//=======================================================================
void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d)
const Standard_Real Tolerance2d)
{
mytol3d = Tolerance3d;
mytol2d = Tolerance2d;
@@ -307,10 +319,10 @@ void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
//=======================================================================
void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
const AppParCurves_Constraint LastC)
{
myfirstC = FirstC;
mylastC = LastC;
mylastC = LastC;
}
//=======================================================================
@@ -318,7 +330,7 @@ void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
//purpose : Changes the max number of segments, which is allowed for cutting.
//=======================================================================
void Approx_ComputeCLine:: SetMaxSegments(const Standard_Integer theMaxSegments)
void Approx_ComputeCLine::SetMaxSegments(const Standard_Integer theMaxSegments)
{
myMaxSegments = theMaxSegments;
}
@@ -351,8 +363,8 @@ const {
//=======================================================================
void Approx_ComputeCLine::Error(const Standard_Integer Index,
Standard_Real& tol3d,
Standard_Real& tol2d) const
Standard_Real& tol3d,
Standard_Real& tol2d) const
{
tol3d = Tolers3d.Value(Index);
tol2d = Tolers2d.Value(Index);

View File

@@ -163,12 +163,21 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
myDWeigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
myD2Weigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
if (Num2DSS>0) {
if (Num2DSS>0)
{
myPoles2d = new (TColgp_HArray1OfPnt2d)(1, Num2DSS);
myDPoles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
}
else
{
myPoles2d = new TColgp_HArray1OfPnt2d();
myDPoles2d = new TColgp_HArray1OfVec2d();
myD2Poles2d = new TColgp_HArray1OfVec2d();
COnSurfErr = new TColStd_HArray1OfReal();
}
// Checks if myFunc->D2 is implemented
if (continuity >= GeomAbs_C2) {
Standard_Boolean B;

View File

@@ -30,6 +30,8 @@
#include <Aspect_TypeOfResize.hxx>
#include <Standard_Integer.hxx>
#include <Aspect_Drawable.hxx>
class Aspect_DisplayConnection;
class Aspect_WindowDefinitionError;
class Aspect_WindowError;
class Aspect_Background;
@@ -43,70 +45,80 @@ class Aspect_Window : public Standard_Transient
{
public:
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Quantity_Color& color);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
//! Opens the window <me>.
Standard_EXPORT virtual void Map() const = 0;
//! Closes the window <me>.
Standard_EXPORT virtual void Unmap() const = 0;
//! Apply the resizing to the window <me>.
Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
//! Apply the mapping change to the window <me>.
//! and returns TRUE if the window is mapped at screen.
Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
//! Returns the window background.
Standard_EXPORT Aspect_Background Background() const;
//! Returns the current image background fill mode.
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
//! Returns the window gradient background.
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
//! Returns True if the window <me> is opened
//! and False if the window is closed.
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
//! Returns True if the window <me> is virtual
Standard_EXPORT Standard_Boolean IsVirtual() const;
//! Setup the virtual state
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
//! Returns The Window RATIO equal to the physical
//! WIDTH/HEIGHT dimensions
Standard_EXPORT virtual Standard_Real Ratio() const = 0;
//! Returns The Window POSITION in PIXEL
Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
//! Returns The Window SIZE in PIXEL
Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
//! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
//! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
//! Returns native Window FB config (GLXFBConfig on Xlib)
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
//! Invalidate entire window content.
//!
//! Implementation is expected to allow calling this method from non-GUI thread,
//! e.g. by queuing exposure event into window message queue or in other thread-safe manner.
//!
//! Optional display argument should be passed when called from non-GUI thread
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
protected:

View File

@@ -232,7 +232,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform()
TestCurveOnSurface();
}
}
catch(Standard_Failure) {
catch(Standard_Failure const&) {
BOPAlgo_CheckResult aResult;
aResult.SetCheckStatus(BOPAlgo_CheckUnknown);
myResult.Append(aResult);

View File

@@ -233,7 +233,7 @@ void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
PerformInternal1(theFiller);
}
//
catch (Standard_Failure) {
catch (Standard_Failure const&) {
AddError (new BOPAlgo_AlertBuilderFailed);
}
}

View File

@@ -116,33 +116,13 @@ class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_Algo {
Handle(IntTools_Context) myContext;
};
//
typedef NCollection_Vector<BOPAlgo_PairOfShapeBoolean> \
BOPAlgo_VectorOfPairOfShapeBoolean;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_PairOfShapeBoolean,
BOPAlgo_VectorOfPairOfShapeBoolean,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_BuilderSDFaceFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_BuilderSDFaceFunctor,
BOPAlgo_VectorOfPairOfShapeBoolean,
Handle(IntTools_Context)> BOPAlgo_BuilderSDFaceCnt;
//
typedef NCollection_Vector<BOPAlgo_PairOfShapeBoolean> BOPAlgo_VectorOfPairOfShapeBoolean;
//=======================================================================
// BuilderFace
//
typedef NCollection_Vector<BOPAlgo_BuilderFace> BOPAlgo_VectorOfBuilderFace;
//
typedef BOPTools_Functor
<BOPAlgo_BuilderFace,
BOPAlgo_VectorOfBuilderFace> BOPAlgo_BuilderFaceFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_BuilderFaceFunctor,
BOPAlgo_VectorOfBuilderFace> BOPAlgo_BuilderFaceCnt;
//
//=======================================================================
//class : BOPAlgo_VFI
//purpose :
@@ -205,18 +185,7 @@ class BOPAlgo_VFI : public BOPAlgo_Algo {
};
//
typedef NCollection_Vector<BOPAlgo_VFI> BOPAlgo_VectorOfVFI;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_VFI,
BOPAlgo_VectorOfVFI,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_VFIFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_VFIFunctor,
BOPAlgo_VectorOfVFI,
Handle(IntTools_Context)> BOPAlgo_VFICnt;
//
//=======================================================================
//function : FillImagesFaces
//purpose :
@@ -474,7 +443,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
}// for (i=0; i<aNbS; ++i) {
//
//===================================================
BOPAlgo_BuilderFaceCnt::Perform(myRunParallel, aVBF);
BOPTools_Parallel::Perform (myRunParallel, aVBF);
//===================================================
//
Standard_Integer aNbBF = aVBF.Length();
@@ -663,7 +632,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
//================================================================
// Perform analysis
BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVPSB, myContext);
//================================================================
NCollection_List<TopTools_ListOfShape> aMBlocks(aAllocator);
@@ -816,7 +785,7 @@ void BOPAlgo_Builder::FillInternalVertices()
// Perform classification
//================================================================
BOPAlgo_VFICnt::Perform(myRunParallel, aVVFI, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVVFI, myContext);
//================================================================
Standard_Integer aNbVFI = aVVFI.Length();

View File

@@ -341,13 +341,6 @@ private:
// Vector of Solid Builders
typedef NCollection_Vector<BOPAlgo_SplitSolid> BOPAlgo_VectorOfBuilderSolid;
// Functors to split solids
typedef BOPTools_Functor<BOPAlgo_SplitSolid,
BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidFunctor;
//
typedef BOPTools_Cnt<BOPAlgo_BuilderSolidFunctor,
BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidCnt;
//=======================================================================
//=======================================================================
//function : BuildSplitSolids
@@ -447,7 +440,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
aNbBS=aVBS.Length();
//
//===================================================
BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
BOPTools_Parallel::Perform (myRunParallel, aVBS);
//===================================================
//
for (k = 0; k < aNbBS; ++k)

View File

@@ -102,17 +102,7 @@ class BOPAlgo_FaceSelfIntersect :
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_FaceSelfIntersect> BOPAlgo_VectorOfFaceSelfIntersect;
//
typedef BOPTools_Functor
<BOPAlgo_FaceSelfIntersect,
BOPAlgo_VectorOfFaceSelfIntersect> BOPAlgo_FaceSelfIntersectFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_FaceSelfIntersectFunctor,
BOPAlgo_VectorOfFaceSelfIntersect> BOPAlgo_FaceSelfIntersectCnt;
typedef NCollection_Vector<BOPAlgo_FaceSelfIntersect> BOPAlgo_VectorOfFaceSelfIntersect;
//=======================================================================
//function :
@@ -206,7 +196,7 @@ void BOPAlgo_CheckerSI::Perform()
PostTreat();
}
//
catch (Standard_Failure) {
catch (Standard_Failure const&) {
AddError (new BOPAlgo_AlertIntersectionFailed);
}
}
@@ -447,7 +437,7 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
Standard_Integer aNbFace = aVFace.Length();
//======================================================
BOPAlgo_FaceSelfIntersectCnt::Perform(myRunParallel, aVFace);
BOPTools_Parallel::Perform (myRunParallel, aVFace);
//======================================================
//
for (Standard_Integer k = 0; k < aNbFace; k++)

View File

@@ -115,19 +115,8 @@ class BOPAlgo_VertexSolid {
Handle(IntTools_Context) myContext;
};
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_VertexSolid,
BOPAlgo_VectorOfVertexSolid,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_VertexSolidFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_VertexSolidFunctor,
BOPAlgo_VectorOfVertexSolid,
Handle(IntTools_Context)> BOPAlgo_VertexSolidCnt;
typedef NCollection_Vector<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
/////////////////////////////////////////////////////////////////////////
//=======================================================================
//class : BOPAlgo_ShapeSolid
@@ -185,17 +174,8 @@ class BOPAlgo_ShapeSolid {
BOPDS_DS* myDS;
};
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
//
typedef BOPTools_Functor
<BOPAlgo_ShapeSolid,
BOPAlgo_VectorOfShapeSolid> BOPAlgo_ShapeSolidFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_ShapeSolidFunctor,
BOPAlgo_VectorOfShapeSolid> BOPAlgo_ShapeSolidCnt;
//
typedef NCollection_Vector<BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
/////////////////////////////////////////////////////////////////////////
//=======================================================================
//class : BOPAlgo_SolidSolid
@@ -225,18 +205,7 @@ class BOPAlgo_SolidSolid : public BOPAlgo_ShapeSolid {
};
};
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
//
typedef BOPTools_Functor
<BOPAlgo_SolidSolid,
BOPAlgo_VectorOfSolidSolid> BOPAlgo_SolidSolidFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_SolidSolidFunctor,
BOPAlgo_VectorOfSolidSolid> BOPAlgo_SolidSolidCnt;
//
/////////////////////////////////////////////////////////////////////////
typedef NCollection_Vector<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
//=======================================================================
//function : PerformVZ
@@ -286,7 +255,7 @@ void BOPAlgo_CheckerSI::PerformVZ()
//
aNbVVS=aVVS.Length();
//=============================================================
BOPAlgo_VertexSolidCnt::Perform(myRunParallel, aVVS, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVVS, myContext);
//=============================================================
for (k=0; k < aNbVVS; ++k) {
const BOPAlgo_VertexSolid& aVertexSolid=aVVS(k);
@@ -344,7 +313,7 @@ void BOPAlgo_CheckerSI::PerformZZ()
//
aNbSolidSolid=aVSolidSolid.Length();
//======================================================
BOPAlgo_SolidSolidCnt::Perform(myRunParallel, aVSolidSolid);
BOPTools_Parallel::Perform (myRunParallel, aVSolidSolid);
//======================================================
//
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
@@ -391,7 +360,7 @@ void BOPAlgo_CheckerSI::PerformSZ(const TopAbs_ShapeEnum aTS)
//
aNbShapeSolid=aVShapeSolid.Length();
//======================================================
BOPAlgo_ShapeSolidCnt::Perform(myRunParallel, aVShapeSolid);
BOPTools_Parallel::Perform (myRunParallel, aVShapeSolid);
//======================================================
//
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();

View File

@@ -223,7 +223,7 @@ void BOPAlgo_PaveFiller::Perform()
PerformInternal();
}
//
catch (Standard_Failure) {
catch (Standard_Failure const&) {
AddError (new BOPAlgo_AlertIntersectionFailed);
}
}

View File

@@ -118,7 +118,7 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
myFlag=myContext->ComputeVE (myV, myE, myT, myTolVNew, myFuzzyValue);
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}
@@ -136,20 +136,8 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
Handle(BOPDS_PaveBlock) myPB;
};
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_VertexEdge,
BOPAlgo_VectorOfVertexEdge,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_VertexEdgeFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_VertexEdgeFunctor,
BOPAlgo_VectorOfVertexEdge,
Handle(IntTools_Context)> BOPAlgo_VertexEdgeCnt;
//
typedef NCollection_Vector<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
//=======================================================================
// function: PerformVE
// purpose:
@@ -271,7 +259,7 @@ void BOPAlgo_PaveFiller::IntersectVE
//
// Perform intersection
//=============================================================
BOPAlgo_VertexEdgeCnt::Perform(myRunParallel, aVVE, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext);
//=============================================================
//
// Keep the modified edges for further update

View File

@@ -102,7 +102,7 @@ class BOPAlgo_EdgeEdge :
IntTools_EdgeEdge::Perform();
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}
@@ -114,18 +114,8 @@ class BOPAlgo_EdgeEdge :
};
//
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
//
typedef BOPTools_Functor
<BOPAlgo_EdgeEdge,
BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_EdgeEdgeFunctor,
BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeCnt;
//
/////////////////////////////////////////////////////////////////////////
typedef NCollection_Vector<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
//=======================================================================
// function: PerformEE
// purpose:
@@ -234,7 +224,7 @@ void BOPAlgo_PaveFiller::PerformEE()
//
aNbEdgeEdge=aVEdgeEdge.Length();
//======================================================
BOPAlgo_EdgeEdgeCnt::Perform(myRunParallel, aVEdgeEdge);
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
//======================================================
//
for (k = 0; k < aNbEdgeEdge; ++k) {
@@ -1050,7 +1040,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
anAlloc->Reset();
// Perform intersection of the found pairs
BOPAlgo_EdgeEdgeCnt::Perform(myRunParallel, aVEdgeEdge);
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
if (aEEs.IsEmpty())

View File

@@ -114,7 +114,7 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
myFlag=myContext->ComputeVF(myV, myF, myT1, myT2, myTolVNew, myFuzzyValue);
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}
@@ -132,20 +132,8 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
Handle(IntTools_Context) myContext;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_VertexFace>
BOPAlgo_VectorOfVertexFace;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_VertexFace,
BOPAlgo_VectorOfVertexFace,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_VertexFaceFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_VertexFaceFunctor,
BOPAlgo_VectorOfVertexFace,
Handle(IntTools_Context)> BOPAlgo_VertexFaceCnt;
//
typedef NCollection_Vector<BOPAlgo_VertexFace> BOPAlgo_VectorOfVertexFace;
//=======================================================================
// function: PerformVF
// purpose:
@@ -234,7 +222,7 @@ void BOPAlgo_PaveFiller::PerformVF()
//
aNbVF=aVVF.Length();
//================================================================
BOPAlgo_VertexFaceCnt::Perform(myRunParallel, aVVF, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext);
//================================================================
//
for (k=0; k < aNbVF; ++k) {

View File

@@ -113,7 +113,7 @@ class BOPAlgo_EdgeFace :
IntTools_EdgeFace::Perform();
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}
@@ -128,18 +128,7 @@ class BOPAlgo_EdgeFace :
//
//=======================================================================
typedef NCollection_Vector<BOPAlgo_EdgeFace> BOPAlgo_VectorOfEdgeFace;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_EdgeFace,
BOPAlgo_VectorOfEdgeFace,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_EdgeFaceFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_EdgeFaceFunctor,
BOPAlgo_VectorOfEdgeFace,
Handle(IntTools_Context)> BOPAlgo_EdgeFaceCnt;
//
//=======================================================================
//function : PerformEF
//purpose :
@@ -265,7 +254,7 @@ void BOPAlgo_PaveFiller::PerformEF()
//
aNbEdgeFace=aVEdgeFace.Length();
//=================================================================
BOPAlgo_EdgeFaceCnt::Perform(myRunParallel, aVEdgeFace, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
//=================================================================
//
for (k=0; k < aNbEdgeFace; ++k) {
@@ -972,7 +961,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
anAlloc->Reset();
// Perform intersection of the found pairs
BOPAlgo_EdgeFaceCnt::Perform(myRunParallel, aVEdgeFace, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
if (theAddInterf && aEFs.IsEmpty())

View File

@@ -150,7 +150,7 @@ class BOPAlgo_FaceFace :
IntTools_FaceFace::Perform(myF1, myF2);
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}
@@ -165,16 +165,8 @@ class BOPAlgo_FaceFace :
};
//
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
//
typedef BOPTools_Functor
<BOPAlgo_FaceFace,
BOPAlgo_VectorOfFaceFace> BOPAlgo_FaceFaceFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_FaceFaceFunctor,
BOPAlgo_VectorOfFaceFace> BOPAlgo_FaceFaceCnt;
typedef NCollection_Vector<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
/////////////////////////////////////////////////////////////////////////
//=======================================================================
//function : PerformFF
@@ -287,7 +279,7 @@ void BOPAlgo_PaveFiller::PerformFF()
//
//======================================================
// Perform intersection
BOPAlgo_FaceFaceCnt::Perform(myRunParallel, aVFaceFace);
BOPTools_Parallel::Perform (myRunParallel, aVFaceFace);
//======================================================
// Treatment of the results
Standard_Integer k, aNbFaceFace = aVFaceFace.Length();

View File

@@ -169,20 +169,8 @@ class BOPAlgo_SplitEdge : public BOPAlgo_Algo {
};
//
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_SplitEdge> BOPAlgo_VectorOfSplitEdge;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_SplitEdge,
BOPAlgo_VectorOfSplitEdge,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_SplitEdgeFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_SplitEdgeFunctor,
BOPAlgo_VectorOfSplitEdge,
Handle(IntTools_Context)> BOPAlgo_SplitEdgeCnt;
//
typedef NCollection_Vector<BOPAlgo_SplitEdge> BOPAlgo_VectorOfSplitEdge;
//=======================================================================
//class : BOPAlgo_MPC
//purpose :
@@ -301,7 +289,7 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
UpdateVertices(aCopyE, myF);
}
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertBuildingPCurveFailed(TopoDS_Shape()));
}
@@ -333,20 +321,8 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
};
//
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_MPC> BOPAlgo_VectorOfMPC;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_MPC,
BOPAlgo_VectorOfMPC,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_MPCFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_MPCFunctor,
BOPAlgo_VectorOfMPC,
Handle(IntTools_Context)> BOPAlgo_MPCCnt;
//
typedef NCollection_Vector<BOPAlgo_MPC> BOPAlgo_VectorOfMPC;
//=======================================================================
//class : BOPAlgo_BPC
//purpose :
@@ -391,18 +367,8 @@ class BOPAlgo_BPC {
Standard_Boolean myToUpdate;
};
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
//
typedef BOPTools_Functor
<BOPAlgo_BPC,
BOPAlgo_VectorOfBPC> BOPAlgo_BPCFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_BPCFunctor,
BOPAlgo_VectorOfBPC> BOPAlgo_BPCCnt;
//
//
typedef NCollection_Vector<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
//=======================================================================
// function: MakeSplitEdges
// purpose:
@@ -524,7 +490,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
//
aNbVBSE=aVBSE.Length();
//======================================================
BOPAlgo_SplitEdgeCnt::Perform(myRunParallel, aVBSE, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVBSE, myContext);
//======================================================
//
for (k=0; k < aNbVBSE; ++k) {
@@ -753,7 +719,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
}//if (bPCurveOnS1 || bPCurveOnS2 ) {
//
//======================================================
BOPAlgo_MPCCnt::Perform(myRunParallel, aVMPC, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVMPC, myContext);
//======================================================
// Add warnings of the failed projections and update edges with new pcurves
@@ -876,7 +842,7 @@ void BOPAlgo_PaveFiller::Prepare()
}
//
//======================================================
BOPAlgo_BPCCnt::Perform(myRunParallel, aVBPC);
BOPTools_Parallel::Perform (myRunParallel, aVBPC);
//======================================================
// pcurves are built, and now update edges

View File

@@ -63,20 +63,8 @@ class BOPAlgo_ShrunkRange : public IntTools_ShrunkRange {
};
//
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_ShrunkRange> BOPAlgo_VectorOfShrunkRange;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_ShrunkRange,
BOPAlgo_VectorOfShrunkRange,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_ShrunkRangeFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_ShrunkRangeFunctor,
BOPAlgo_VectorOfShrunkRange,
Handle(IntTools_Context)> BOPAlgo_ShrunkRangeCnt;
//
typedef NCollection_Vector<BOPAlgo_ShrunkRange> BOPAlgo_VectorOfShrunkRange;
//=======================================================================
// function: FillShrunkData
// purpose:
@@ -141,7 +129,7 @@ void BOPAlgo_PaveFiller::FillShrunkData(const TopAbs_ShapeEnum aType1,
//
aNbVSD=aVSD.Length();
//=============================================================
BOPAlgo_ShrunkRangeCnt::Perform(myRunParallel, aVSD, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVSD, myContext);
//=============================================================
//
for (k=0; k < aNbVSD; ++k) {

View File

@@ -155,7 +155,7 @@ void BOPAlgo_RemoveFeatures::Perform()
// Post treatment
PostTreat();
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
AddError(new BOPAlgo_AlertRemoveFeaturesFailed());
}
@@ -354,7 +354,7 @@ public: //! @name Perform the operation
// Trim the extended faces
TrimExtendedFaces(aFaceExtFaceMap);
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
// Make sure the warning will be given on the higher level
myHasAdjacentFaces = Standard_True;
@@ -716,12 +716,6 @@ private: //! @name Fields
typedef NCollection_Vector<FillGap> VectorOfFillGap;
typedef BOPTools_Functor <FillGap, VectorOfFillGap> FillGapFunctor;
typedef BOPTools_Cnt <FillGapFunctor, VectorOfFillGap> FillGapCnt;
//=======================================================================
//=======================================================================
// function: RemoveFeatures
// purpose: Remove features by filling the gaps by extension of the
@@ -762,7 +756,7 @@ void BOPAlgo_RemoveFeatures::RemoveFeatures()
}
// Perform the reconstruction of the adjacent faces
FillGapCnt::Perform(myRunParallel, aVFG);
BOPTools_Parallel::Perform (myRunParallel, aVFG);
// Even if the history is not requested, it is necessary to track:
// - The solids modification after each feature removal to find

View File

@@ -71,17 +71,8 @@ class BOPAlgo_CBK {
BOPTools_ConnexityBlock *myPCB;
};
//=======================================================================
typedef NCollection_Vector
<BOPAlgo_CBK> BOPAlgo_VectorOfCBK;
//
typedef BOPTools_Functor
<BOPAlgo_CBK,
BOPAlgo_VectorOfCBK> BOPAlgo_CBKFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_CBKFunctor,
BOPAlgo_VectorOfCBK> BOPAlgo_CBKCnt;
//
typedef NCollection_Vector<BOPAlgo_CBK> BOPAlgo_VectorOfCBK;
//=======================================================================
//function :
//purpose :
@@ -560,7 +551,7 @@ void BOPAlgo_ShellSplitter::MakeShells()
//
aNbVCBK=aVCBK.Length();
//===================================================
BOPAlgo_CBKCnt::Perform(myRunParallel, aVCBK);
BOPTools_Parallel::Perform (myRunParallel, aVCBK);
//===================================================
for (k=0; k<aNbVCBK; ++k) {
BOPAlgo_CBK& aCBK=aVCBK(k);

View File

@@ -714,7 +714,7 @@ Standard_Boolean BOPAlgo_Tools::WiresToFaces(const TopoDS_Shape& theWires,
aBB.Add(aRFaces, aFSp);
}
}
catch (Standard_Failure) {
catch (Standard_Failure const&) {
continue;
}
}
@@ -958,16 +958,8 @@ Standard_Boolean FindPlane(const TopoDS_Shape& theWire,
//purpose :
//=======================================================================
class BOPAlgo_TNV;
typedef NCollection_Vector
<BOPAlgo_TNV> BOPAlgo_VectorOfTNV;
//
typedef BOPTools_Functor
<BOPAlgo_TNV,
BOPAlgo_VectorOfTNV> BOPAlgo_TNVFunctor;
//
typedef BOPTools_Cnt
<BOPAlgo_TNVFunctor,
BOPAlgo_VectorOfTNV> BOPAlgo_TNVCnt;
typedef NCollection_Vector<BOPAlgo_TNV> BOPAlgo_VectorOfTNV;
//=======================================================================
class BOPAlgo_TNV : public BOPTools_BoxBndTreeSelector{
public:
@@ -1090,7 +1082,7 @@ void BOPAlgo_Tools::IntersectVertices(const TopTools_IndexedDataMapOfShapeReal&
aTreeFiller.Fill();
//
// Perform intersection
BOPAlgo_TNVCnt::Perform(theRunParallel, aVTNV);
BOPTools_Parallel::Perform (theRunParallel, aVTNV);
//
// Fence map
TColStd_MapOfInteger aMFence;
@@ -1529,16 +1521,6 @@ void BOPAlgo_FillIn3DParts::MakeConnexityBlock(const TopoDS_Face& theFStart,
// Vector of solid classifiers
typedef NCollection_Vector<BOPAlgo_FillIn3DParts> BOPAlgo_VectorOfFillIn3DParts;
// Functors to perform classification
typedef BOPTools_ContextFunctor<BOPAlgo_FillIn3DParts,
BOPAlgo_VectorOfFillIn3DParts,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_FillIn3DPartsFunctor;
typedef BOPTools_ContextCnt<BOPAlgo_FillIn3DPartsFunctor,
BOPAlgo_VectorOfFillIn3DParts,
Handle(IntTools_Context)> BOPAlgo_FillIn3DPartsCnt;
//=======================================================================
//function : ClassifyFaces
//purpose :
@@ -1629,7 +1611,7 @@ void BOPAlgo_Tools::ClassifyFaces(const TopTools_ListOfShape& theFaces,
// Perform classification
//================================================================
BOPAlgo_FillIn3DPartsCnt::Perform(theRunParallel, aVFIP, theContext);
BOPTools_Parallel::Perform (theRunParallel, aVFIP, theContext);
//================================================================
// Analyze the results and fill the resulting map

View File

@@ -169,19 +169,7 @@ protected:
Handle(IntTools_Context) myContext;
};
typedef NCollection_Vector<BOPAlgo_WS_ConnexityBlock> \
BOPAlgo_VectorOfConnexityBlock;
//
typedef BOPTools_ContextFunctor
<BOPAlgo_WS_ConnexityBlock,
BOPAlgo_VectorOfConnexityBlock,
Handle(IntTools_Context),
IntTools_Context> BOPAlgo_SplitBlockFunctor;
//
typedef BOPTools_ContextCnt
<BOPAlgo_SplitBlockFunctor,
BOPAlgo_VectorOfConnexityBlock,
Handle(IntTools_Context)> BOPAlgo_SplitBlockCnt;
typedef NCollection_Vector<BOPAlgo_WS_ConnexityBlock> BOPAlgo_VectorOfConnexityBlock;
//=======================================================================
//function : MakeWires
@@ -214,7 +202,7 @@ void BOPAlgo_WireSplitter::MakeWires()
}
}
//===================================================
BOPAlgo_SplitBlockCnt::Perform(myRunParallel, aVCB, myContext);
BOPTools_Parallel::Perform (myRunParallel, aVCB, myContext);
//===================================================
aNbVCB=aVCB.Length();
for (k=0; k<aNbVCB; ++k) {

View File

@@ -73,9 +73,7 @@ class BOPDS_TSR : public BOPTools_BoxBndTreeSelector{
};
//
//=======================================================================
typedef NCollection_Vector <BOPDS_TSR> BOPDS_VectorOfTSR;
typedef BOPTools_Functor <BOPDS_TSR,BOPDS_VectorOfTSR> BOPDS_TSRFunctor;
typedef BOPTools_Cnt <BOPDS_TSRFunctor, BOPDS_VectorOfTSR> BOPDS_TSRCnt;
typedef NCollection_Vector<BOPDS_TSR> BOPDS_VectorOfTSR;
/////////////////////////////////////////////////////////////////////////
@@ -323,7 +321,7 @@ void BOPDS_Iterator::Intersect(const Handle(IntTools_Context)& theCtx,
aTreeFiller.Fill();
//
//===========================================
BOPDS_TSRCnt::Perform(myRunParallel, aVTSR);
BOPTools_Parallel::Perform (myRunParallel, aVTSR);
//===========================================
//
BOPDS_MapOfPair aMPFence;
@@ -454,7 +452,7 @@ void BOPDS_Iterator::IntersectExt(const TColStd_MapOfInteger& theIndices)
}
// Perform selection
BOPDS_TSRCnt::Perform(myRunParallel, aVTSR);
BOPTools_Parallel::Perform (myRunParallel, aVTSR);
// Treat selections

View File

@@ -136,7 +136,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
BRepLib::SameParameter(aE1T);
BRepLib::SameRange(aE1T);
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
iRet = 6;
return iRet;

View File

@@ -159,15 +159,7 @@ class BOPTools_CPC {
//
//=======================================================================
typedef NCollection_Vector<BOPTools_CPC> BOPTools_VectorOfCPC;
//
typedef BOPTools_Functor
<BOPTools_CPC,
BOPTools_VectorOfCPC> BOPTools_CPCFunctor;
//
typedef BOPTools_Cnt
<BOPTools_CPCFunctor,
BOPTools_VectorOfCPC> BOPTools_CPCCnt;
//
//=======================================================================
//class : BOPTools_CWT
//purpose :
@@ -199,15 +191,7 @@ class BOPTools_CWT {
};
//=======================================================================
typedef NCollection_Vector<BOPTools_CWT> BOPTools_VectorOfCWT;
//
typedef BOPTools_Functor
<BOPTools_CWT,
BOPTools_VectorOfCWT> BOPTools_CWTFunctor;
//
typedef BOPTools_Cnt
<BOPTools_CWTFunctor,
BOPTools_VectorOfCWT> BOPTools_CWTCnt;
//
//=======================================================================
//class : BOPTools_CDT
//purpose :
@@ -250,15 +234,7 @@ class BOPTools_CDT {
};
//=======================================================================
typedef NCollection_Vector<BOPTools_CDT> BOPTools_VectorOfCDT;
//
typedef BOPTools_Functor
<BOPTools_CDT,
BOPTools_VectorOfCDT> BOPTools_CDTFunctor;
//
typedef BOPTools_Cnt
<BOPTools_CDTFunctor,
BOPTools_VectorOfCDT> BOPTools_CDTCnt;
//
//=======================================================================
//class : BOPTools_CVT
//purpose :
@@ -291,15 +267,7 @@ class BOPTools_CVT {
//
//=======================================================================
typedef NCollection_Vector<BOPTools_CVT> BOPTools_VectorOfCVT;
//
typedef BOPTools_Functor
<BOPTools_CVT,
BOPTools_VectorOfCVT> BOPTools_CVTFunctor;
//
typedef BOPTools_Cnt
<BOPTools_CVTFunctor,
BOPTools_VectorOfCVT> BOPTools_CVTCnt;
//
//=======================================================================
//class : BOPTools_CET
//purpose :
@@ -331,18 +299,7 @@ class BOPTools_CET {
};
//=======================================================================
typedef NCollection_Vector<BOPTools_CET> BOPTools_VectorOfCET;
//
typedef BOPTools_Functor
<BOPTools_CET,
BOPTools_VectorOfCET> BOPTools_CETFunctor;
//
typedef BOPTools_Cnt
<BOPTools_CETFunctor,
BOPTools_VectorOfCET> BOPTools_CETCnt;
//
//
//=======================================================================
//
//=======================================================================
// Function : CorrectTolerances
// purpose :
@@ -380,7 +337,7 @@ void BOPTools_AlgoTools::CorrectPointOnCurve
}
//
//======================================================
BOPTools_CPCCnt::Perform(bRunParallel, aVCPC);
BOPTools_Parallel::Perform (bRunParallel, aVCPC);
//======================================================
}
//=======================================================================
@@ -418,9 +375,9 @@ void BOPTools_AlgoTools::CorrectCurveOnSurface
}
//
//======================================================
BOPTools_CWTCnt::Perform(bRunParallel, aVCWT);
BOPTools_Parallel::Perform (bRunParallel, aVCWT);
//======================================================
BOPTools_CDTCnt::Perform(bRunParallel, aVCDT);
BOPTools_Parallel::Perform (bRunParallel, aVCDT);
//======================================================
}
//=======================================================================
@@ -445,7 +402,7 @@ void BOPTools_AlgoTools::CorrectShapeTolerances
}
//
//======================================================
BOPTools_CVTCnt::Perform(bRunParallel, aVCVT);
BOPTools_Parallel::Perform (bRunParallel, aVCVT);
//======================================================
//
aExp.Init(aShape, TopAbs_FACE);
@@ -457,7 +414,7 @@ void BOPTools_AlgoTools::CorrectShapeTolerances
}
//
//======================================================
BOPTools_CETCnt::Perform(bRunParallel, aVCET);
BOPTools_Parallel::Perform (bRunParallel, aVCET);
//======================================================
}
//

View File

@@ -18,158 +18,178 @@
#include <Standard_Macro.hxx>
#include <Standard_NotImplemented.hxx>
#include <OSD_Parallel.hxx>
#include <OSD_ThreadPool.hxx>
#include <NCollection_DataMap.hxx>
#include <Standard_Mutex.hxx>
#include <OSD_Thread.hxx>
//
// 1. Implementation of Functors/Starters
//
// 1.1. Pure version
//
//=======================================================================
//class : BOPTools_Functor
//purpose :
//=======================================================================
template <class TypeSolver, class TypeSolverVector>
class BOPTools_Functor
//! Implementation of Functors/Starters
class BOPTools_Parallel
{
public:
//! Constructor.
explicit BOPTools_Functor(TypeSolverVector& theSolverVec)
: mySolvers(theSolverVec) {}
//! Defines functor interface.
void operator() (const Standard_Integer theIndex) const
template<class TypeSolverVector>
class Functor
{
TypeSolver& aSolver = mySolvers(theIndex);
aSolver.Perform();
}
public:
//! Constructor.
explicit Functor(TypeSolverVector& theSolverVec) : mySolvers (theSolverVec) {}
private:
BOPTools_Functor(const BOPTools_Functor&);
BOPTools_Functor& operator= (const BOPTools_Functor&);
private:
TypeSolverVector& mySolvers;
};
//=======================================================================
//class : BOPTools_Cnt
//purpose :
//=======================================================================
template <class TypeFunctor, class TypeSolverVector>
class BOPTools_Cnt
{
public:
static void Perform( const Standard_Boolean isRunParallel,
TypeSolverVector& theSolverVector )
{
TypeFunctor aFunctor(theSolverVector);
OSD_Parallel::For(0, theSolverVector.Length(), aFunctor, !isRunParallel);
}
};
//
// 1.2. Context dependent version
//
//=======================================================================
//class : BOPTools_ContextFunctor
//purpose :
//=======================================================================
template <class TypeSolver, class TypeSolverVector,
class TypeContext, typename TN>
class BOPTools_ContextFunctor
{
//! Auxiliary thread ID hasher.
struct Hasher
{
static Standard_Integer HashCode(const Standard_ThreadId theKey,
const Standard_Integer Upper)
//! Defines functor interface.
void operator() (const Standard_Integer theIndex) const
{
return ::HashCode((Standard_Size)theKey, Upper);
typename TypeSolverVector::value_type& aSolver = mySolvers[theIndex];
aSolver.Perform();
}
static Standard_Boolean IsEqual(const Standard_ThreadId theKey1,
const Standard_ThreadId theKey2)
{
return theKey1 == theKey2;
}
private:
Functor(const Functor&);
Functor& operator= (const Functor&);
private:
TypeSolverVector& mySolvers;
};
typedef NCollection_DataMap<Standard_ThreadId, TypeContext, Hasher> ContextMap;
public:
//! Constructor
explicit BOPTools_ContextFunctor( TypeSolverVector& theVector )
: mySolverVector(theVector) {}
//! Binds main thread context
void SetContext( TypeContext& theContext )
//! Functor storing map of thread id -> algorithm context
template<class TypeSolverVector, class TypeContext>
class ContextFunctor
{
myContexts.Bind(OSD_Thread::Current(), theContext);
}
//! Returns current thread context
TypeContext& GetThreadContext() const
{
const Standard_ThreadId aThreadID = OSD_Thread::Current();
if ( myContexts.IsBound(aThreadID) )
//! Auxiliary thread ID hasher.
struct Hasher
{
TypeContext& aContext = myContexts(aThreadID);
if ( aContext.IsNull() == Standard_False )
return aContext;
static Standard_Integer HashCode(const Standard_ThreadId theKey,
const Standard_Integer Upper)
{
return ::HashCode((Standard_Size)theKey, Upper);
}
static Standard_Boolean IsEqual(const Standard_ThreadId theKey1,
const Standard_ThreadId theKey2)
{
return theKey1 == theKey2;
}
};
public:
//! Constructor
explicit ContextFunctor (TypeSolverVector& theVector) : mySolverVector(theVector) {}
//! Binds main thread context
void SetContext (const opencascade::handle<TypeContext>& theContext)
{
myContextMap.Bind (OSD_Thread::Current(), theContext);
}
// Create new context
TypeContext aContext = new TN
( NCollection_BaseAllocator::CommonBaseAllocator() );
//! Returns current thread context
const opencascade::handle<TypeContext>& GetThreadContext() const
{
const Standard_ThreadId aThreadID = OSD_Thread::Current();
if (const opencascade::handle<TypeContext>* aContextPtr = myContextMap.Seek (aThreadID))
{
if (!aContextPtr->IsNull())
{
return *aContextPtr;
}
}
Standard_Mutex::Sentry aLocker(myMutex);
myContexts.Bind(aThreadID, aContext);
// Create new context
opencascade::handle<TypeContext> aContext = new TypeContext (NCollection_BaseAllocator::CommonBaseAllocator());
return myContexts(aThreadID);
}
Standard_Mutex::Sentry aLocker (myMutex);
myContextMap.Bind (aThreadID, aContext);
return myContextMap (aThreadID);
}
//! Defines functor interface
void operator()( const Standard_Integer theIndex ) const
//! Defines functor interface
void operator()( const Standard_Integer theIndex ) const
{
const opencascade::handle<TypeContext>& aContext = GetThreadContext();
typename TypeSolverVector::value_type& aSolver = mySolverVector[theIndex];
aSolver.SetContext(aContext);
aSolver.Perform();
}
private:
ContextFunctor(const ContextFunctor&);
ContextFunctor& operator= (const ContextFunctor&);
private:
TypeSolverVector& mySolverVector;
mutable NCollection_DataMap<Standard_ThreadId, opencascade::handle<TypeContext>, Hasher> myContextMap;
mutable Standard_Mutex myMutex;
};
//! Functor storing array of algorithm contexts per thread in pool
template<class TypeSolverVector, class TypeContext>
class ContextFunctor2
{
TypeContext& aContext = GetThreadContext();
TypeSolver& aSolver = mySolverVector(theIndex);
public:
aSolver.SetContext(aContext);
aSolver.Perform();
}
//! Constructor
explicit ContextFunctor2 (TypeSolverVector& theVector, const OSD_ThreadPool::Launcher& thePoolLauncher)
: mySolverVector(theVector),
myContextArray (thePoolLauncher.LowerThreadIndex(), thePoolLauncher.UpperThreadIndex()) {}
private:
BOPTools_ContextFunctor(const BOPTools_ContextFunctor&);
BOPTools_ContextFunctor& operator= (const BOPTools_ContextFunctor&);
//! Binds main thread context
void SetContext (const opencascade::handle<TypeContext>& theContext)
{
myContextArray.ChangeLast() = theContext; // OSD_ThreadPool::Launcher::UpperThreadIndex() is reserved for a main thread
}
private:
TypeSolverVector& mySolverVector;
mutable ContextMap myContexts;
mutable Standard_Mutex myMutex;
};
//! Defines functor interface with serialized thread index.
void operator() (int theThreadIndex,
int theIndex) const
{
opencascade::handle<TypeContext>& aContext = myContextArray.ChangeValue (theThreadIndex);
if (aContext.IsNull())
{
aContext = new TypeContext (NCollection_BaseAllocator::CommonBaseAllocator());
}
typename TypeSolverVector::value_type& aSolver = mySolverVector[theIndex];
aSolver.SetContext (aContext);
aSolver.Perform();
}
private:
ContextFunctor2(const ContextFunctor2&);
ContextFunctor2& operator= (const ContextFunctor2&);
private:
TypeSolverVector& mySolverVector;
mutable NCollection_Array1< opencascade::handle<TypeContext> > myContextArray;
};
//=======================================================================
//class : BOPTools_ContextCnt
//purpose :
//=======================================================================
template <class TypeFunctor, class TypeSolverVector, class TypeContext>
class BOPTools_ContextCnt
{
public:
static void Perform( const Standard_Boolean isRunParallel,
TypeSolverVector& theSolverVector,
TypeContext& theContext )
{
TypeFunctor aFunctor(theSolverVector);
aFunctor.SetContext(theContext);
OSD_Parallel::For(0, theSolverVector.Length(), aFunctor, !isRunParallel);
//! Pure version
template<class TypeSolverVector>
static void Perform (Standard_Boolean theIsRunParallel,
TypeSolverVector& theSolverVector)
{
Functor<TypeSolverVector> aFunctor (theSolverVector);
OSD_Parallel::For (0, theSolverVector.Length(), aFunctor, !theIsRunParallel);
}
//! Context dependent version
template<class TypeSolverVector, class TypeContext>
static void Perform (Standard_Boolean theIsRunParallel,
TypeSolverVector& theSolverVector,
opencascade::handle<TypeContext>& theContext)
{
if (OSD_Parallel::ToUseOcctThreads())
{
const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
OSD_ThreadPool::Launcher aPoolLauncher (*aThreadPool, theIsRunParallel ? theSolverVector.Length() : 0);
ContextFunctor2<TypeSolverVector, TypeContext> aFunctor (theSolverVector, aPoolLauncher);
aFunctor.SetContext (theContext);
aPoolLauncher.Perform (0, theSolverVector.Length(), aFunctor);
}
else
{
ContextFunctor<TypeSolverVector, TypeContext> aFunctor (theSolverVector);
aFunctor.SetContext (theContext);
OSD_Parallel::For (0, theSolverVector.Length(), aFunctor, !theIsRunParallel);
}
}
};

View File

@@ -326,7 +326,7 @@ void BRepBuilderAPI_FastSewing::Perform(void)
myResShape = aQuilt.Shells();
}
catch(Standard_Failure)
catch(Standard_Failure const&)
{
SetStatus(FS_Exception);
#ifdef OCCT_DEBUG

View File

@@ -903,7 +903,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
}
}
catch(Standard_Failure)
catch(Standard_Failure const&)
{
isSamePar = Standard_False;
}
@@ -4744,7 +4744,7 @@ void BRepBuilderAPI_Sewing::SameParameterShape()
BRepLib::SameParameter(sec, BRep_Tool::Tolerance(sec));
}
catch (Standard_Failure) {
catch (Standard_Failure const&) {
#ifdef OCCT_DEBUG
cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
#endif

View File

@@ -147,7 +147,6 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
if ( ! aRes.IsNull() )
{
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}

View File

@@ -238,19 +238,27 @@ static Standard_Boolean KPartCircle
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
Standard_Boolean& myIsDone)
{
TopExp_Explorer exp(mySpine,TopAbs_EDGE);
Standard_Integer NbEdges = 0;
TopoDS_Edge E;
for (; exp.More(); exp.Next()) {
NbEdges++;
E = TopoDS::Edge(exp.Current());
if (NbEdges > 1) return Standard_False;
TopoDS_Edge E;
for (TopExp_Explorer anEdgeIter (mySpine, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next())
{
if (!E.IsNull())
{
return Standard_False;
}
E = TopoDS::Edge (anEdgeIter.Current());
}
if (E.IsNull())
{
return Standard_False;
}
Standard_Real f,l;
TopLoc_Location L;
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,f,l);
if (C.IsNull())
{
return Standard_False;
}
if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
Handle(Geom_TrimmedCurve) Ct = Handle(Geom_TrimmedCurve)::DownCast(C);
@@ -741,7 +749,6 @@ void BRepFill_OffsetWire::PerformWithBiLo
return;
BRep_Builder myBuilder;
myBuilder.MakeCompound(TopoDS::Compound(myShape));
//---------------------------------------------------------------------
// MapNodeVertex : associate to each node of the map (key1) and to
@@ -785,6 +792,11 @@ void BRepFill_OffsetWire::PerformWithBiLo
TopExp::Vertices(theWire, Ends[0], Ends[1]);
}
if (Locus.NumberOfContours() == 0)
{
return;
}
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
TopoDS_Shape PEE = Link.GeneratingShape(Locus.BasicElt(ic,Locus.NumberOfElts(ic)));
TopoDS_Shape& PE = PEE ;

View File

@@ -2297,7 +2297,7 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
B.Continuity(E,F1,F2,aCont);
}
catch(Standard_Failure)
catch(Standard_Failure const&)
{
#ifdef OCCT_DEBUG
cout << "Failure: Exception in BRepLib::EncodeRegularity" << endl;

View File

@@ -152,7 +152,7 @@ static Standard_Boolean Is2DClosed(const TopoDS_Shape& theShape,
TopoDS_Vertex aV2 = TopExp::LastVertex( aLastEdge, Standard_True );
return ( aV1.IsSame( aV2 ) && Is2DConnected( aLastEdge, aFisrtEdge, theSurface, theLocation));
}
catch ( Standard_Failure ) {
catch (Standard_Failure const&) {
return Standard_False;
}
}

View File

@@ -131,10 +131,10 @@ BRepLib_MakeWire::BRepLib_MakeWire(const TopoDS_Wire& W,
void BRepLib_MakeWire::Add(const TopoDS_Wire& W)
{
TopExp_Explorer ex(W,TopAbs_EDGE);
while (ex.More()) {
Add(TopoDS::Edge(ex.Current()));
ex.Next();
for (TopoDS_Iterator it(W); it.More(); it.Next()) {
Add(TopoDS::Edge(it.Value()));
if (myError != BRepLib_WireDone)
break;
}
}

View File

@@ -24,10 +24,10 @@
#include <BRepLib_WireError.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepLib_MakeShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <NCollection_Map.hxx>
#include <Bnd_Box.hxx>
#include <NCollection_UBTree.hxx>
@@ -172,14 +172,14 @@ private:
};
void CollectCoincidentVertices(const TopTools_ListOfShape& theL,
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
void CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV);
TopTools_DataMapOfShapeShape& theO2NV);
void CreateNewListOfEdges(const TopTools_ListOfShape& theL,
const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
TopTools_ListOfShape& theNewEList);
const TopTools_DataMapOfShapeShape& theO2NV,
TopTools_ListOfShape& theNewEList);
void Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeometryProximity);

View File

@@ -58,7 +58,7 @@ void BRepLib_MakeWire::Add(const TopTools_ListOfShape& L)
CollectCoincidentVertices(L, aGrVL);
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex> anO2NV;
TopTools_DataMapOfShapeShape anO2NV;
CreateNewVertices(aGrVL, anO2NV);
@@ -188,17 +188,13 @@ void BRepLib_MakeWire::CollectCoincidentVertices(const TopTools_ListOfShape& the
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL)
{
TopTools_IndexedMapOfShape anAllV;
TopTools_ListIteratorOfListOfShape anItL;
TopTools_IndexedDataMapOfShapeListOfShape aMV2EL;
TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
TopExp_Explorer exp;
for (anItL.Initialize(theL); anItL.More(); anItL.Next())
TopExp::MapShapesAndAncestors(anItL.Value(), TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
TopExp::MapShapes(myShape, TopAbs_VERTEX, anAllV);
for (int i = 1; i <= aMV2EL.Extent(); i++)
if (aMV2EL(i).Extent() == 1)
anAllV.Add(aMV2EL.FindKey(i));
TopTools_ListIteratorOfListOfShape anItL(theL);
for (; anItL.More(); anItL.Next())
TopExp::MapShapes(anItL.Value(), TopAbs_VERTEX, anAllV);
//aV2CV : vertex <-> its coincident vertices
NCollection_DataMap<TopoDS_Vertex, NCollection_Map<TopoDS_Vertex>> aV2CV;
@@ -303,8 +299,8 @@ void BRepLib_MakeWire::CollectCoincidentVertices(const TopTools_ListOfShape& the
//function : CreateNewVertices
//purpose :
//=======================================================================
void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV)
void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
TopTools_DataMapOfShapeShape& theO2NV)
{
//map [old vertex => new vertex]
//note that already existing shape (i.e. the original ones)
@@ -356,7 +352,7 @@ void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List
//purpose :
//=======================================================================
void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL,
const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
const TopTools_DataMapOfShapeShape& theO2NV,
TopTools_ListOfShape& theNewEList)
{
///create the new list (theNewEList) from the input list L

View File

@@ -70,7 +70,12 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo,
Standard_Integer i;
nbSect.Clear();
theGraph = new MAT_Graph();
nbContours = anExplo.NumberOfContours();
if (nbContours == 0)
{
return;
}
//---------------------------------
// Lecture des donnees de anExplo.
@@ -121,7 +126,6 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo,
TheRoots->BackAdd(TheMAT.Bisector());
}
theGraph = new MAT_Graph();
theGraph->Perform(TheMAT.SemiInfinite(),
TheRoots,
theTool.NumberOfItems(),

View File

@@ -123,12 +123,6 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
const TopoDS_Face& aFace,
TopoDS_Face& aNewFace)
{
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
// This method is totally rewroted to include check
// of connection and creation of a new spine.
NewContour();
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
// Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin
// Taking into account side of bisecting loci construction.
// TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD));
@@ -136,10 +130,15 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
BRepTools_WireExplorer anExp(Spine, aFace);
// Modified by skv - Wed Jun 23 12:23:02 2004 Integration End
TopTools_IndexedDataMapOfShapeShape anOldNewE;
if (!anExp.More())
return;
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
// This method is totally rewroted to include check
// of connection and creation of a new spine.
NewContour();
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
TopoDS_Edge aFirstEdge = anExp.Current();
TopoDS_Edge aPrevEdge = aFirstEdge;
Standard_Real UFirst,ULast, aD;

View File

@@ -223,7 +223,7 @@ private:
this->registerNode(BRep_Tool::Pnt(theVertex), aPnt2d,
BRepMesh_Fixed, Standard_False);
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
}
}

View File

@@ -347,7 +347,7 @@ static void ComputeMaxAngleOnShape(const TopoDS_Shape& S,
{
tgtfaces(E, F1, F2, couture, theResAngle);
}
catch(Standard_Failure)
catch(Standard_Failure const&)
{
}
}
@@ -562,7 +562,7 @@ TopoDS_Face BRepOffset_MakeSimpleOffset::BuildWallFace(const TopoDS_Edge& theOri
if (aFM.IsDone())
aF = aFM.Face();
}
catch(Standard_Failure)
catch(Standard_Failure const&)
{
}

View File

@@ -3103,6 +3103,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
TopLoc_Location L;
Handle (Geom_Surface) S = BRep_Tool::Surface(F,L);
Standard_Real UU1,VV1,UU2,VV2;
Standard_Boolean uperiodic = Standard_False, vperiodic = Standard_False;
Standard_Boolean isVV1degen = Standard_False, isVV2degen = Standard_False;
Standard_Real US1,VS1,US2,VS2;
Standard_Real UF1,VF1,UF2,VF2;
@@ -3146,6 +3147,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
if (S->IsUPeriodic()) {
uperiodic = Standard_True;
Standard_Real Period = S->UPeriod();
Standard_Real Delta = Period - (UF2 - UF1);
Standard_Real alpha = 0.1;
@@ -3155,6 +3157,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
}
if (S->IsVPeriodic()) {
vperiodic = Standard_True;
Standard_Real Period = S->VPeriod();
Standard_Real Delta = Period - (VF2 - VF1);
Standard_Real alpha = 0.1;
@@ -3199,6 +3202,12 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
//Detect closedness in U and V directions
Standard_Boolean uclosed = Standard_False, vclosed = Standard_False;
BRepTools::DetectClosedness(F, uclosed, vclosed);
if (uclosed && !uperiodic &&
(theLenBeforeUfirst != 0. || theLenAfterUlast != 0.))
uclosed = Standard_False;
if (vclosed && !vperiodic &&
(theLenBeforeVfirst != 0. && theLenAfterVlast != 0.))
vclosed = Standard_False;
MakeFace(S,UU1,UU2,VV1,VV2,uclosed,vclosed,isVV1degen,isVV2degen,BF);
BF.Location(L);

View File

@@ -489,7 +489,7 @@ void BRepOffsetAPI_ThruSections::Build()
CreateSmoothed();
}
}
catch (Standard_Failure)
catch (Standard_Failure const&)
{
NotDone();
return;

View File

@@ -67,25 +67,6 @@
#include <errno.h>
//=======================================================================
//function : IsPCurveUiso
//purpose :
//=======================================================================
static Standard_Boolean IsPCurveUiso(const Handle(Geom2d_Curve)& thePCurve,
Standard_Real theFirstPar,
Standard_Real theLastPar)
{
gp_Pnt2d FirstP2d = thePCurve->Value(theFirstPar);
gp_Pnt2d LastP2d = thePCurve->Value(theLastPar);
Standard_Real DeltaU = Abs(FirstP2d.X() - LastP2d.X());
Standard_Real DeltaV = Abs(FirstP2d.Y() - LastP2d.Y());
return (DeltaU < DeltaV);
}
//=======================================================================
//function : UVBounds
//purpose :
@@ -977,28 +958,24 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace,
{
theUclosed = theVclosed = Standard_False;
BRepAdaptor_Surface BAsurf(theFace, Standard_False);
Standard_Boolean IsSurfUclosed = BAsurf.IsUClosed();
Standard_Boolean IsSurfVclosed = BAsurf.IsVClosed();
if (!IsSurfUclosed && !IsSurfVclosed)
return;
TopExp_Explorer Explo(theFace, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
if (BRepTools::IsReallyClosed(anEdge, theFace))
if (BRep_Tool::IsClosed(anEdge, theFace) &&
BRepTools::IsReallyClosed(anEdge, theFace))
{
Standard_Real fpar, lpar;
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
Standard_Boolean IsUiso = IsPCurveUiso(aPCurve, fpar, lpar);
if (IsSurfUclosed && IsUiso)
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(TopoDS::Edge(anEdge.Reversed()),
theFace, fpar, lpar);
gp_Pnt2d Point1 = PCurve1->Value(fpar);
gp_Pnt2d Point2 = PCurve2->Value(fpar);
Standard_Boolean IsUiso = (Abs(Point1.X() - Point2.X()) > Abs(Point1.Y() - Point2.Y()));
if (IsUiso)
theUclosed = Standard_True;
if (IsSurfVclosed && !IsUiso)
else
theVclosed = Standard_True;
if (theUclosed && theVclosed)
break;
}
}
}

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