1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

380 Commits

Author SHA1 Message Date
inv
d2abb6d844 Update version up to 7.6.1 2022-02-01 15:05:58 +03:00
jgv
e697b85307 0032747: Modeling Algorithms - Exact HLR algorithm gives wrong result
Modify the method IntWalk_IWalking::TestArretCadre: correct the value of scalar product of two vectors according to the tolerances in U and V.
2022-01-31 18:26:58 +03:00
emv
9967602647 0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode "Complete" join type "Intersection"
Add more faces for intersection in rebuilding process basing on the connection of the splits of offset faces (special treatment for the artificially invalid faces).
When rebuilding faces add vertices common for faces for trimming the new intersection edges.

Adjust existing and create new test cases.
2022-01-31 18:23:59 +03:00
kgv
e1a92d9ef0 0032484: Configuration, CMake fails to find EGL and GLES2 include directory on iOS platform
Fixed configuration errors and compilation errors on iOS target due to unexpected EGL usage (non-existing on iOS).
2022-01-31 18:21:49 +03:00
atychini
730b9ecc2d 0032748: Data Exchange, Step Import - xstep.cascade.unit doesn't work [regression since OCCT 7.6.0]
Added new condition in STEPControl_ActorRead::Transfer: if StepData_StepModel is not an initialized Unit - we set unit to this step model
2022-01-31 16:06:08 +03:00
Dzmitry Razmyslovich
336e2cdeda 0032784: BinXCAF fails to load documents containing the shapes with scaled/mirrored location
A flag not to raise an exception is used on reading of an XCAF document. If such a shape with scaling transformation is stored in the document, it should be read.
2022-01-19 10:34:30 +03:00
vro
e5021ff47f 0032757: Application Framework, scaling transformation - loading of an OCAF XML document fails
A flag not to raise an exception is used on reading of an OCAF document. If such a shape with scaling transformation is stored in the document, it should be read.

Modified files:
XmlMNaming\XmlMNaming_NamedShapeDriver.cxx: not checking of the type of transformation for a read shape
2022-01-18 17:49:03 +03:00
Dzmitry Razmyslovich
9735948819 0031087: Configuration - make FreeType dependency optional [part 2] 2021-11-25 20:52:26 +03:00
kgv
660a8938a3 0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape
SelectMgr_RectangularFrustum::OverlapsCylinder() - added missing 3D point transformation.
StdSelect_BRepSelectionTool::ComputeSensitive() - fixed cylinder height computation on TopoDS_Shape with scale transformation.
SelectMgr_AxisIntersector::OverlapsCylinder(),::OverlapsSphere() - added missing computations of surface normal.
2021-11-19 10:13:36 +03:00
dipts
642ddd1253 0032661: Coding - Forward class declaration in ProjLib collides with typeref
Removed redundant forward declarations from ProjLib.hxx.
2021-11-19 10:13:12 +03:00
Xu Zhongxing
03fc07c28b 0032649: Bug in BRepLib::EnsureNormalConsistency()
Fix a typo in variable name.
2021-11-19 10:12:42 +03:00
kgv
2e84f455db 0032654: Data Exchange - fix misprint in RWGltf_TriangulationReader::readDracoBuffer()
Added missing break.
Fixes reading of glTF files with Normal attributes preceding Position
(and eliminates redundant / erroneous copy when Position attributes precede Normal).
2021-11-19 10:12:36 +03:00
kgv
2d7f390051 Update version up to 7.6.1dev. 2021-11-19 10:11:21 +03:00
inv
80ffc5f84d Update version up to 7.6.0 2021-11-01 18:12:14 +03:00
kgv
d1069cad4b 0032156: Documentation, gendoc.tcl - wrong processing of 'mathjax' option
Fixed handling of -s=<search_mode> option.
Fixed handling of -mathjax=<path> option.
2021-11-01 18:12:14 +03:00
akaftasev
0c4931e873 0032444: Modeling Algorithm - BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine
Added checking for null edges in BRepFill_TrimShellCorner::ChooseSection()
2021-10-29 17:18:18 +03:00
btokarev
3ea347e562 0032551: Documentation - Novice user guide for OCCT Documentation
Added novice guide.
Improved structure of Tutorials & Samples.
2021-10-29 17:08:16 +03:00
dpasukhi
510d099d15 0028104: Data Exchange - Extract sub-assembly (XDE)
- Added getting and setting Material, VisMaterial and Props to XCAFDoc_Editor::Expand.
- Added XCAFDoc_Editor::Extract to transfer part to a new location
  - XCAFDoc_Editor::Extract allows to extract a part as a component or simply extract to an empty label with attached colors, layers, materials, vismaterials and props
- Added XCAFDoc_Editor::CloneMetaData to clone shape's attributes to new location
- Added XCAFDoc_Editor::CloneShapeLabel to clone shape to new document
- Added XCAFDoc_DocumentTool::Check*Tool methods to check an existing of an any tool
- Protected against creating a new label for non-existent tools via extract or expand process
2021-10-28 22:04:04 +03:00
ski
5bd54bef32 0024975: Improve of preprocessor directives in header files to be equal to the file name
Preprocessor directives were changed or created by function "check_headers" from script adm/upgrade.tcl (CR24816)
2021-10-27 21:00:02 +03:00
kgv
4f7ad5fb76 0032640: Coding Rules - fix misprints in GeomliteTest_API2dCommands.cxx 2021-10-27 20:58:18 +03:00
aml
f706c128c2 0032641: Coding - get rid of unused forward declarations [IGESAppli to LDOM] 2021-10-27 20:57:19 +03:00
asuraven
209ae313a5 0032031: Analyze Precise HLR behaviour in Draw/AIS
- Set "Algo" as default HLR algorithm in MFC HLR sample
2021-10-26 23:12:30 +03:00
knosulko
81f57d1135 0030046: Modeling Algorithms - Cannot find necessary projection of the curve
move algorithm of obtaining results from function gproject to method ProjLib_CompProjectedCurve::Perform;
fix tolerances in ProjLib_PrjResolve::ProjLib_PrjResolve;
new treatment of myMaxDist;
use extend bounds in approximation;
add test;
test case "bugs modalg_5 bug25980", "bugs modalg_7 bug24185" have been changed according to new behavior.
2021-10-26 23:10:34 +03:00
ifv
9923f08703 0032557: Modeling Data - Use of BRepBuilderAPI_NurbsConvert create 2d p-curves with gaps
GeomConvert/GeomConvert_1.cxx - method CheckAndSegment is added to adjust surface periodic boundaries
bug32557 - test is updated by new cases
2021-10-25 11:18:27 +03:00
aml
5b756182c2 0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect] 2021-10-22 20:17:18 +03:00
kgv
5f69cfa70c 0032638: Draw Harness, ViewerTest - HTML input range misbehavior in WebAssembly
ViewerTest_EventManager - added tracking of EMSCRIPTEN_EVENT_FOCUSOUT event.
onWasmMouseCallback() has been adjusted to return FALSE for EMSCRIPTEN_EVENT_TARGET_WINDOW
target to avoid misbehavior of other HTML controls.

WNT_Window::ProcessMessage() now handles WM_SETFOCUS/WM_KILLFOCUS instead of WM_ACTIVATE to track focus changes.

AIS_ViewController::ProcessFocus() now redirects to AIS_ViewController::ResetViewInput() on focus loss.
This fixes issues when key action (like WASD navigation) keep working even after releasing key if window has been switched.
2021-10-22 19:58:16 +03:00
vro
19da974edc 0032632: Visualization, AIS_ViewCube - the class AIS_ViewCubeSensitive is hidden inside CXX file 2021-10-22 19:58:16 +03:00
kgv
bcb2a742a7 0032631: Draw Harness - add DRAWEXE.evalAsync() to WebAssembly 2021-10-22 19:58:16 +03:00
kgv
005caf39cf 0032633: Draw Harness - extend command incmesh to apply default visualization parameters
incmesh - added -prs option to use StdPrs_ToolTriangulatedShape::GetDeflection() as meshing parameters.
vdisplay, XDisplay - added -autoTriangulation option to manage meshing behavior before displaying a shape.
trinfo - added output of meshing parameters.
Fixed broken incmesh syntax usage in several test cases.
2021-10-22 19:58:15 +03:00
kgv
2c8c4b8086 0032629: Configuration, scripts - add USE_PTHREADS building option to wasm_build.bat 2021-10-22 19:58:15 +03:00
mpv
7e63845c9e 0026981: Application Framework - read a BinOcaf document from С++ stream sequentially
The current version of the document supports partial reading. So, as a result, the shapes section is dispersed into attributes and it becomes easy avoid any seekg call during the reading.
But this will work only in case whole document is opened. For partial reading seekg functions could be naturally called.
2021-10-22 19:58:15 +03:00
jgv
f8d8c3f2bc 0032623: [Regression] Modelling Algorithms - UnifySameDomain invalid result only in release mode
Correct local function ReconstructMissedSeam: use copy of existing pcurve for seam edge reconstruction to prevent possible corruption of another edges.
2021-10-20 20:06:30 +03:00
kgv
4e61131a1c 0032626: Samples - add Qt::WA_NativeWindow attribute to Qt IESample 2021-10-18 20:14:35 +03:00
kgv
4e2151f654 0032624: Configuration, genproj - add support for VS 2022 / vc143 2021-10-18 20:13:10 +03:00
dpasukhi
475da0f135 0032310: Data Exchange - Invalid STEP export/import of backslashes in names [Regression since OCCT 7.5.0]
Fixed a problem with handling slashes and apostrophes
Changed cleaning of the 'TEXT' fields of the step entity to direct order w/o removing operations
Changed converting text locale to covert before cleaning directives and specials symbols (all directives and sp. symbols encoded in ASCII[0-125] and haven't any differ with any locals)
Special case, when directives have two slashes before name changed to don't handle directives value and converts as is (combine two slashes as one and write, for example "\\X2\00C3" as "X2\00C3")
2021-10-15 19:52:25 +03:00
jgv
538700ffa2 0032619: [Regression] Modelling Algorithms - UnifySameDomain ignores shared face
Correct method ShapeUpgrade_UnifySameDomain::UnifyFaces: exclude free boundary edges from unification.
2021-10-15 19:50:25 +03:00
abulyche
eb78d737d4 0030747: Modeling Algorithms - 2d Curves concatenator doesn't properly process closed contours.
Corrected Geom2dConvert_CompCurveToBSplineCurve::Add in Geom2dConvert_CompCurveToBSplineCurve.cxx;
Added the test for this problem;
Corrected "gluing" curves in ProjLib_ProjectedCurve.cxx.
2021-10-14 20:19:22 +03:00
kgv
c1638a8db8 0032622: Draw Harness - writebrep "-version 3" is unrecognized
Fixed version range check.
Added description of -normals argument.
2021-10-14 20:17:11 +03:00
aml
0c9c466e9d CR32614 Coding - get rid of unsused forward declarations [Adaptor2d to GccAna]
Packages from Adaptor2d to GccAna are processed.
2021-10-12 20:11:16 +03:00
kgv
16f9b46dbb 0032612: Data Exchange, RWGltf_CafReader - lost hierarchy of two nested compounds
RWGltf_GltfJsonParser::gltfParseSceneNode() - prevent flattering of Scene nodes
(allow flattering only of Mesh nodes).

Added command XAutoNaming managing XCAFDoc_ShapeTool::SetAutoNaming().
Added comparisons with reference Xdump data to glTF tests.
2021-10-12 20:08:57 +03:00
kgv
34043fc845 0032613: Samples - glfw compilation error on Linux
GlfwOcctWindow - added cast to Aspect_XDisplay*.
Added auxiliary OCCT searching script as alternative to CMake config files.
2021-10-12 09:37:23 +03:00
ifv
56b495d93b 0032607: Modeling Algorithms - BOPAlgo_BOP returns incomplete result
IntPatch/IntPatch_ImpPrmIntersection.cxx - decreasing step for some conditions
tests/lowalgos/intss/bug32607 - test case added
2021-10-08 20:51:50 +03:00
vkuzin
96b92906de 0029405: Modeling Algorithms - Check normal define status in HLRBRep_Data
Fixed exception when trying to calculate line and edge normal in methods HLRBRep_Data::OrientOutLine and HLRBRep_Data::OrientOthEdge, added a check for the existence of the normal before subsequent calculations. A correct check for zero derivative, correction of floating point error and division by zero determinant directly in HLRBRep_EdgeFaceTool::CurvatureValue was set.
2021-10-08 20:51:13 +03:00
kgv
f1c209dc77 0032609: Visualization, Wasm_Window - handle mouse movements outside canvas element
Wasm_Window::ProcessMouseEvent() - removed redundant check on EMSCRIPTEN_EVENT_MOUSEUP event.
ViewerTest and WebGL sample - mouse movements are now tracked on window element
to allow tracking updates when mouse with clicked button is moved outside canvas element.
2021-10-08 20:26:22 +03:00
kgv
f9ae10ed21 0032604: Visualization, AIS_LightSource - improve dragging robustness 2021-10-08 20:24:43 +03:00
achesnok
956d91571c 0032591: Visualization, V3d_View - improve corner gradient
- Added new shader for correct Aspect_GradientFillMethod_Corner mode shading.
2021-10-08 20:22:22 +03:00
aml
c2064b60e7 0032603: Coding - get rid of unsused forward declarations
Packages from Adaptor2d to BRepMesh are processed.
2021-10-04 20:03:10 +03:00
kgv
eba0379cde 0032602: Configuration, genconf - reduce window height with empty error log
Font height is reduced to 1 for empty error labels is empty to win some space.
2021-10-04 19:54:22 +03:00
msv
41fc11b056 0032601: Foundation Classes - Poly_Connect hangs on the given incorrect triangulation 2021-10-04 19:53:12 +03:00
asuraven
0f05f21194 0032539: Modeling Algorithms - Parallelize BRepExtrema_DistShapeShape algorithm 2021-10-01 19:14:13 +03:00
dpasukhi
7d5e26eb2e 0032596: [REGRESSION] Data Exchange, STEP Reader - OCCT 7.6.0dev does not open file correctly
Fixed typo in the StepToTopoDS_TranslateFace.cxx after #29564 issue
2021-10-01 19:08:36 +03:00
btokarev
5c38397303 0032550: Documentation - Proofreading for "Tutorials and Samples -> Tutorial"
New images added for better representation of solid model;
Minor fixes for misprints and old classes;
Proofreading done.
2021-10-01 19:06:33 +03:00
jgv
ca65b1ae37 0032581: Modelling Algorithms - UnifySameDomain produces invalid result
1. Correct local function TransformPCurves of ShapeUpgrade_UnifySameDomain: take into account the case of seam edge.
2. Correct local function ReconstructMissedSeam of ShapeUpgrade_UnifySameDomain: use previously stored seam edge in some cases.
2021-09-30 19:43:06 +03:00
kgv
b4871a3b12 0032595: Documentation - revise "Build OCCT" structure to highlight CMake usage
"Building with CMake tool" subsection has been moved out from "Windows" to a dedicated top-level section.
genproj sections have been merged and restructured.
Added description of some new CMake configuration options.
Updated URL to 3rd-party components on Development Portal.
2021-09-30 19:41:47 +03:00
kgv
ff60d28357 0032597: Coding Rules, Wasm_Window - add missing setter for DevicePixelRatio property 2021-09-30 19:39:45 +03:00
aml
307fef1dcd 0032593: Documentation - get rid of unused file in the documentation. 2021-09-28 20:15:15 +03:00
abulyche
95c380d252 0030148: Modeling Algorithms - exception in BRepOffestAPI_MakePipe for some periodic BSpline spines
This problem was solved by fix for 0030597.
Added the non-regression test for this problem.
2021-09-28 20:12:06 +03:00
ifv
f277dcbbc0 0032557: Modeling Data - Use of BRepBuilderAPI_NurbsConvert create 2d p-curves with errors
BRepTools/BRepTools_NurbsConvertModification.cxx -
 Checking domain of 2dCurves if surfaces are periodic is improved

tests/bugs/moddata_3/bug32557 - test case added
2021-09-28 20:10:04 +03:00
ifv
af0cb16691 0032569: Modeling Algorithm - Section not found
IntPatch/IntPatch_WLineTool.cxx - adding control of maximal ratio of distances between 3 sequential points.
tests/bugs/modalg_7/bug32569 - new test case added
tests/lowalgos/intss/bug29972_1 test case is modified according new behavior of intersection algorithm
2021-09-28 20:06:09 +03:00
emv
f72c595119 0032578: Modeling Algorithms - Splitting face by set of edges fails
Update information about ON/IN sub-shapes for all touched faces when intersection with shapes of lower types (edges and vertices) complete.
Previously only the faces participating in the Face/Face intersection were updated.
2021-09-27 20:12:00 +03:00
kgv
3e9cb80644 0032590: Visualization, V3d_View - improve API for setting Image Based Lighting
Added method V3d_View::SetImageBasedLighting() for managing IBL.
OpenGl_View implementation has been revised to handle IBL updates in a more straightforward way,
2021-09-26 16:44:20 +03:00
achesnok
9af0d66b84 0031039: Visualization - add elliptical gradient background style
Added new elliptical gradient fill method and updated vbackground command.
Renamed enum values of Aspect_GradientFillMethod and defined aliases for old ones.
Changed draw mode in OpenGl_BackgroundArray from triangle-strip to GL_TRIANGLES.
2021-09-26 11:05:34 +03:00
kgv
3be25c1170 0032585: Data Exchange, RWGltf_CafWriter - include OCCT version 2021-09-24 18:34:45 +03:00
kgv
ea99d048d7 0032582: Configuration, genproj - make CSF_OPT_LIB64D configurable by genconf 2021-09-23 19:59:22 +03:00
kgv
c585f731eb 0032579: Draw Harness, ViewerTest - extend vbackground -cubemap syntax to configure sRGB flag
Command vbackground has been refactored to simplify logic and relax syntax.
Added -srgb argument to vbackground and vtexture commands.
2021-09-22 20:11:44 +03:00
kgv
c983176406 0032580: Data Exchange, STL - add option splitting nodes at sharp corners
Added Poly_MergeNodesTool tool for merging nodes within triangulation.
Added RWStl_Reader::MergeAngle() property managing merging behavior.
2021-09-22 20:09:48 +03:00
asemenov
5dd92c395a 0029478: Crash because bSplineSurfaceWithKnots is NULL.
Modified the method void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep
Added processing B spline surface with knots and rational B spline surface with empty data in the name field
Added test
2021-09-20 20:03:49 +03:00
abulyche
296dbe8cc8 0031631: Modeling Algorithms - Invalid result of Pipe builder
Added the ability to operate the algorithm with different types of curves.
2021-09-18 17:07:06 +03:00
dpasukhi
812ee2c9be 0031388: Data Exchange - support kinematics data in STEP format
- add new STEP entities.
2021-09-17 20:08:51 +03:00
asuraven
92c1f9728e 0032552: Modeling Algorithms - BRepExtrema_DistShapeShape algorithm consumes too much memory
Used a new BRepExtrema_DistShapeShape::DistanceVertVert() function to replace DistanceMapMap() to calculate vertex/vertex distance
2021-09-17 20:07:40 +03:00
emv
b878139461 0032566: Modeling Algorithms - Incorrect result of offset operation in mode "Complete" join type "Intersection"
Before removal of the part make sure that it was not filled due to overlapping of opposite parts.
Improve procedure of checking for inverted edges by taking into account that the original edges may not be connected.

Correct test case offset/shape_type_i_c/YL5, as it was working incorrectly - some parts were missing.
2021-09-17 20:07:39 +03:00
kgv
5aa7b61083 0032236: Modeling Algorithms - Exception on calculation optimal bounding box
- BRepBndLib - added VOID box checks to AdjustFaceBox() method.
 - added the test
2021-09-17 20:07:39 +03:00
kgv
eee6a80a90 0032089: Visualization, TKOpenGl - support GL_EXT_sRGB extension to OpenGL ES 2.0 2021-09-17 20:07:39 +03:00
sshutina
58f2990bc5 0032461: Visualization - expensive call of glGetTexEnviv/glTexEnvi in each render of OpenGl_Text
- removed the call of glGetTexEnviv, glTexEnvi
 - replaced on the OpenGl_Sampler::applyGlobalTextureParams/resetGlobalTextureParams
 - added the method in OpenGl_Font returning first texture
2021-09-15 20:12:43 +03:00
akaftasev
7c6fecf9a8 0032330: Modeling Algorithms - Extend Offset algorithm with Progress Indicator and User Break
Add progress indicator to BRepOffset_MakeOffset::MakeOffsetShape().
2021-09-15 20:08:36 +03:00
kgv
13b36bb14f 0032567: Coding Rules - rename Graphic3d_TypeOfShadingModel values to include full enumeration name 2021-09-15 20:07:06 +03:00
ifv
e2421df543 0030422: Random behaviour of BRepAdaptor_CompCurve
BRepTools/BRepTools_WireExplorer.cxx - replace MapOfShape vmap by IndexedMapOfShape
to avoid random behavior of algorithm

bugs/moddata_3/bug30422 - new test case added
2021-09-15 20:07:06 +03:00
jgv
1e6b2065b5 0032561: Modelling Algorithms - UnifySameDomain does nothing while it is expected to union two pairs of faces
Correct method ShapeUpgrade_UnifySameDomain::UnifyFaces: when creating the Edge-Face map of initial shape, count each face only once.
2021-09-15 20:07:06 +03:00
kgv
e2d6f0e37a 0032423: Coding Rules - NSOpenGLContext deprecation warnings during compilation for macOS 10.14+
The warning has been suppressed for building TKOpenGl.
2021-09-15 20:07:05 +03:00
asuraven
9ae883970d 0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters 2021-09-11 11:15:44 +03:00
asemenov
8019a482b5 0029233: Incorrect result of conversion to the STEP format.
Modified the method TopoDSToStep_MakeStepFace::Init
Added processing of degenerate toroidal surfaces, which are the base surfaces of offset surfaces
Added test
2021-09-10 20:24:53 +03:00
kgv
36d21f1a1a 0032565: Foundation Classes, OSD_FileSystem - expose interface for registering global protocols
Added methods OSD_FileSystem::AddDefaultProtocol()/::RemoveDefaultProtocol()
and fixed misleading description of OSD_FileSystemSelector::AddProtocol().
2021-09-10 20:24:52 +03:00
kgv
8a17a8bb45 0032540: RWGltf_CafReader - optional "scene" parameter encoded as mandatory
First scene is now loaded when default one is undefined.
2021-09-10 20:24:52 +03:00
sshutina
8dcb81ac82 0031337: Inspectors - user guide update
- Modifyed 3D view:
     Added the trihedron, view cube
     Removed the scene manipulation actions (Fit all isn't removed)
 - Added the new MessageView plugin to display content of Message_Report
 - DFBrowser plugin improvements:
     Added the  button to switch ON DumpJson in DFBrowser(OFF by default, for better performance)
     Renamed in DFBrowser "Property Panel" into "Property Panel (custom)
     Removed the selection controls
 - ShapeView plugin improvements:
     Property View content based on DumpJson (columns in tree view for properties are removed),
     Properties for TopoDS_Shape are displayed
 - VInspector plugin imrovements:
      Property View content based on DumpJson (columns in tree view for properties are removed),
      Properties for AIS_InteractiveContext and AIS_InteractiveObject are displayed
      Removed History panel in VInspector as not used
      Implemented the item and actions in VInspector for setting Lights in the view
2021-09-10 20:24:52 +03:00
kgv
cd4977383d 0032092: Visualization, TKService - Image_VideoRecorder writes garbage from Grayscale image
Image_VideoRecorder::writeVideoFrame(), added protection from API misuse.
2021-09-10 20:24:51 +03:00
kgv
801e67bc7b 0032564: Foundation Classes, OSD_CachedFileSystem - allow referring to non-default File System
Linked file system can be now customized within OSD_CachedFileSystem.
2021-09-10 20:24:51 +03:00
sshutina
7d7541ceeb 0032507: Visualization, TKOpenGl - topmost text disappears with Graphic3d_RTM_DEPTH_PEELING_OIT enabled 2021-09-10 20:24:51 +03:00
vro
e8ae1c42a8 0032531: Application Framework - There should be methods to get explanations of PCDM_StoreStatus and PCDM_ReaderStatus values
Documentation is added for PCDM_ReaderStatus enumeration.

Modified:
- PCDM_ReaderStatus.hxx: each value received a short explanation.
2021-09-10 20:24:51 +03:00
emv
74a53b82dc 0030206: Improve API of commands bbop and bapibop
0030620: Tests - perf/bop/buildfaces does not match description (broken)

Allow using meaningful parameters for the commands bbop and bapibop:
* common - for Common operation
* fuse - for Fuse operation
* cut - for Cut operation
* tuc/cut21 - for Cut21 operation
* section - for Section operation

Add description for the commands dealing with Boolean/GF/Split operations.
Validate arguments of these commands.

Correct test case perf/bop/buildfaces to perform GF execution in parallel and serial modes - compare the results.
2021-09-10 20:24:50 +03:00
emv
efac173377 0030151: Modeling Algorithms - Removal of the API level of old Boolean operations algorithm (BRepAlgo_BooleanOperation)
The following classes have been removed as obsolete:
- BRepAlgo_BooleanOperation
- BRepAlgo_Fuse
- BRepAlgo_Cut
- BRepAlgo_Common
- BRepAlgo_Section

The corresponding classes from BRepAlgoAPI package have to be used instead.

Draw commands:
- fuse
- cut
- common
- section/psection
have also been removed as obsolete.

The corresponding commands for modern Boolean operations algorithm (bfuse/bcut/bcommon/bsection) have to be used instead.

Adjustment of the test cases to use the commands for modern algorithm.
2021-09-10 20:24:50 +03:00
kgv
35ad04e78b 0032107: Data Exchange, RWGltf_CafReader - reading glTF document back loses sharing
RWGltf_CafWriter has been fixed to write shared Faces having a different style.
RWGltf_GltfJsonParser::gltfParsePrimArray() now tries to create a shared TopoDS_Face
from the same primitive array definition.

RWGltf_CafReader - improved name generation.
2021-09-10 20:22:59 +03:00
akaftasev
8ab0b859df 0030788: Modeling Algorithms - BRepAlgoAPI_Defeaturing does not propagate progress indicator to underlying algorithms
Added progress indicator to BRepAlgoAPI_Defeaturing
2021-09-08 19:14:11 +03:00
kgv
5e76328243 0032328: Missing include of TopoDS_Edge.hxx in ShapeUpgrade_UnifySameDomain.hxx 2021-09-07 20:03:29 +03:00
abulyche
41e2eed0fc 0030722: Modeling Algorithms - BRepExtrema_DistShapeShape computes wrong distances
Updated the math_DirectPolynomialRoots.cxx
Added the test case "bug30722"
Updated the command "b2dclassify" in the BOPTest_LowCommands.cxx
2021-09-07 20:01:40 +03:00
msv
a1ae05e173 0018170: Modeling Data - crash in TopExp_Explorer::Init if Clear was called after empty constructor
TopExp_Explorer::Clear() now sets myTop=-1 with align to TopExp_Explorer::Init() logic.
2021-09-05 23:13:27 +03:00
asuraven
f26ee38f2a 0029792: Add ::IsParallel method to GeomAPI_Extrema* classes
Add IsParallel() methods for classes:
- GeomAPI_ExtremaCurveCurve
- GeomAPI_ExtremaCurveSurface
- GeomAPI_ExtremaSurfaceSurface
2021-09-03 20:20:20 +03:00
ifv
4391df896c 0026269: Modeling Data - Analytical extrema does not take into account trimmed input data
Treatment of trimmed data is added
Extrema/Extrema_ExtCC.cxx

Test cases added
tests/lowalgos/extcc/bug26269_1
tests/lowalgos/extcc/bug26269_2

Test cases are modified according to new behavior of algorithm
2021-09-03 20:19:56 +03:00
asuraven
872a7e3a7e 0032485: Modeling Algorithms - Add Clone() function for adapters
Provide ShallowCopy() functions for adapters & evaluators of curves, 2d curves and surfaces. This will allow using copies of the same adapter in multi-thread calculations.
2021-09-03 20:19:56 +03:00
asuraven
82bee1621a 0031942: Modeling Algorithms - add possibility to abort the BRepExtrema_DistShapeShape algorithm
- Now available to interrupt the DRAW 'distmini' command by Ctrl/C
- Message_ProgressRange/Message_ProgressScope used in BRepExtrema_DistShapeShape::Perform() to provide user break
2021-09-03 20:19:56 +03:00
akaftasev
d03c08988c 0021264: Modeling Algorithms - Progress indicator for Boolean operations
Update BOP commands to use progress indicator
Deleted wrong usage of progress indicator from bop operations
Added UserBreak() method to break execution boolean operation if progress indicator is used
Added method AnalyzeProgress() to calculate steps of progress indicator
Introduce BOPAlgo_ParallelAlgo which has myRange as a field to be used in parallel vector.
Provide suitable way of keeping the progress steps of operations.
Give meaningful names to progress scopes.
Propagate progress indicator into deeper methods of BOA.
Add progress indicator to BOPAlgo_BuilderFace and BOPAlgo_WireSplitter, BOPAlgo_BuilderSolid and BOPAlgo_ShellSplitter
2021-09-03 20:19:55 +03:00
vro
632deee0b0 0032125: Application Framework, OCAF - need to have adequate message if document cannot be saved due to unrecognized format
A list of storage statuses (PCDM_StoreStatus) is extended for PCDM_SS_UnrecognizedFormat. It is set if
- extension of a document file name is not defined (the extension doesn't correspond to any declared file formats) or
- a storage driver is not found for the document storage format.

Modified:
CDF_StoreList.cxx: the mechanism of raising and catching exceptions is replaced by direct setting the status and error message for each particular error.
PCDM_StoreStatus.hxx: a new enumeration value is added - PCDM_SS_UnrecognizedFormat. Also, a short explanation is added to each enumeration value.
DDocStd_ApplicationCommands.cxx: processing of a new enumeration value by the draw-command.
XDEDRAW.cxx: processed a new enumeration value PCDM_SS_UnrecognizedFormat by saveDoc draw-command.

Deleted:
CDF_MetaDataDriverError.hxx: It is not used anywhere and it seems it will not be used by someone.
2021-09-03 20:19:55 +03:00
dpasukhi
9443cf8ec4 0032556: Data Exchange - A toroidal part of solid is corrupted while writing or reading STEP file
Fix STEP writing Wire for periodic surface
2021-09-03 20:19:54 +03:00
mkrylova
3016a39071 0032495: Coding rules - eliminate CLang UndefinedBehaviorSanitizer warnings
- fixed CLang UndefinedBehaviorSanitizer warnings
2021-09-03 20:19:54 +03:00
kgv
e21db5b80e 0030976: Configuration, CMake - Build failure with static FreeType dependency
Removed linkage with "freetype.lib" with help of pragma lib specific to msvc.
FreeType library should be configured as a normal external dependency via CSF_FreeType
by CMake and genproj, which is already done (information was duplicated).
2021-09-03 20:19:53 +03:00
kgv
e639e9bcdc 0032553: Configuration, CMake - unable to building with ActiveTcl
Removed linkage with "tcl8.6.lib" with help of pragma lib specific to msvc.
Tcl libraries should be configured as normal external dependencies via CSF_TclLibs
by CMake and genproj, which is already done (information was duplicated).
2021-09-03 20:19:53 +03:00
sshutina
0b1fd5909d 0031351: Inspectors - thread in DFBrowser removing
- DFBrowser_Thread and connected are removed from the package as obsolete
2021-09-03 20:19:52 +03:00
jgv
13584d1468 0032502: Modeling Algorithms - BOP wrong result on sphere and cylinder
Modifications in the method IntPatch_ALineToWLine::MakeWLine:
correct setting parameters to vertices on IntPatch_WLine curve.
2021-09-03 20:19:52 +03:00
kgv
c1b3ce202a 0032549: Configuration - fix misprint in adm/scripts/android_build.bat for Draco library name 2021-08-31 20:54:52 +03:00
kgv
ce83709ac9 0032546: Data Exchange, XCAF - mark material as defined XCAFDoc_VisMaterialPBR::IsDefined=true within default constructor
XCAFDoc_VisMaterialCommon and XCAFDoc_VisMaterialPBR default constructors now set IsDefined property to TRUE.
So that it is required to set IsDefined=false explicitly to create an undefined material,
which is done by XCAFDoc_VisMaterial constructor.

Existing application code shouldn't require any modifications in most cases
(IsDefined=true required before to setup material could be now removed).
2021-08-31 20:05:37 +03:00
kgv
19691a22fd 0032545: Configuration, CMake - add BUILD_FORCE_RelWithDebInfo option for generating VS project files with Debug info in Release mode 2021-08-31 19:53:33 +03:00
akaftasev
7e187d6b22 0028687: Offset for open wire is built with incorrect direction
Added new condition to exclude offsetting non closed part of circle as complete circle
2021-08-30 09:47:33 +03:00
akaftasev
55b5d19bd8 0028684: BRepOffsetAPI_MakeOffset produces wire with another orientation in compare with source wire
Added flag to reverse resulting shape, if it was reverse in BuildDomains() to bringing to the same direction as the original shape
2021-08-30 09:47:33 +03:00
kgv
8f70959571 0032464: Draw Harness, ViewerTest - rely on AIS_ViewController within vanimation command
Added AIS_ViewController::ObjectsAnimation() property
similar to AIS_ViewController::ViewAnimation() but designed for objects animation.
2021-08-27 19:11:44 +03:00
mkrylova
9dd8af261f 0032281: Visualization - add Select3D_SensitiveCylinder
- implemented Select3D_SensitiveCylinder class performing an analytical intersection with an untriangulated cone/cylinder
- added tests
2021-08-27 19:09:09 +03:00
kgv
8a77384b0c 0032403: Visualization - RayTracing renders all object as white color in view with white background
OpenGl_Caps::buffersOpaqueAlpha is now set to TRUE by default.
OpenGl_View::runPathtrace - fixed higlighting with PathTracing turned on and buffersOpaqueAlpha=true.
2021-08-27 19:08:14 +03:00
msv
45d498ef1f 0031514: Foundation Classes - Add Base64 encoding function
The class FSD_Base64Decoder has been renamed to FSD_Base64.
The new method FSD_Base64::Encode has been added.
The method Decode has been improved for performance.
2021-08-27 19:08:14 +03:00
dpasukhi
da80ff68f1 0031382: Data Exchange - BinXCAF should preserve length unit information
Possibility for adding LengthUnit info to XCAF document using special class XCAFDoc_LenghtUnit and XCAFDoc_LenghtUnitTool is implemented.
Package UnitsMethods is split: geom methods were placed to new file GeomConvert_Units which is in the toolkit TKXSBase, internal step scale factors was placed to StepData.
Updated UnitMethods to convert scale factor to different unit types.
Now, XSAlgo::XSAlgo_AlgoContainer is used to update unit info from static interface values.
New Draw command "XSetLengthUnit" and "XGetLengthUnit" for set or get XDE attribute.
Upgraded tests for STEP, IGES, OBJ, glTF, VRML formats to check area regressing with used unit.
Upgraded tests\de test cases to use any units in the "loop back" algorithms.
2021-08-20 20:30:11 +03:00
ifv
9592ae247b 0027457: Modeling - Raise exception if scaled transformation is used for shape location
Implementation of raising exception while using scale and mirror transformation in shape location
TopLoc/TopLoc_Location.hxx
TopoDS/TopoDS_Shape.hxx

Implementation of new tools for removing forbidden locations from shapes:
BRepTools/BRepTools_PurgeLocations.cxx
BRepTools/BRepTools_PurgeLocations.hxx
BRepTools/BRepTools.cxx
BRepTools/BRepTools.hxx

Draw commands for transforming shapes are corrected, new draw commands: purgeloc, checkloc added
BRepTest/BRepTest_BasicCommands.cxx

Fixing unstable test bug xde bug24759
StepToGeom/StepToGeom.cxx

All other C++ commits are modification of algorithms used mainly in import/export operations in order to allows these operations if shape locations contains scale and mirror transformations.

New test for command purgeloc added
tests/bugs/moddata_3/bug27457
tests/bugs/moddata_3/bug27457_1
tests/bugs/moddata_3/bug27457_2

Some test corrected according to modifications.
2021-08-20 20:18:06 +03:00
kgv
91428b468b 0032536: Configuration - extend adm/scripts with USE_DRACO option 2021-08-14 18:00:19 +03:00
knosulko
7b5f784419 0026979: Parabola curve intersection with variety of surfaces produces incorrect results.
Method Intf_Tool::ParabBox now properly estimates the number of segments for a 3D parabola.
Fix input arguments of called Bnd_Box::Get method in Intf_Tool::HyprBox method.
2021-08-13 20:43:47 +03:00
abulyche
715fcb5a92 0027884: Modeling Algorithms - Possible improvement for 2d classifier
Added the implementation of bndbox<->line and bndbox<->segment intersections for 2D to Bnd_Box2d
Added the speedup for 2d classification to BRepClass_Intersector.cxx
Added the test for our improvement
2021-08-13 20:22:41 +03:00
kgv
fceeb82917 0032533: Visualization, TKOpenGl - suppress error reported on Intel drivers due to OpenGL 4.5 specs violation
OpenGl_GlCore45 - removed a couple of FFP-related functions introduced by OpenGL 4.5 Compatible Profile, but not Core Profile.

OpenGl_GlFunctions::load() now tries to load a set of functions
from GL_ARB_robustness extension (having ARB suffix) to fill OpenGL 4.5 function table,
and from GL_ARB_indirect_parameters extension to fill missing items in OpenGL 4.6 function table on Intel drivers.
Warning message (trace level) is now reported instead of error in case of fallback usage.
2021-08-12 19:15:44 +03:00
kgv
11c23250dc 0032530: Data Exchange, RWGltf_CafWriter - add option merging Faces within the Part
Added RWGltf_CafWriter::ToMergeFaces() property disabled by default.
RWMesh_MaterialMap - fixed creation of texture folder within working dir ".".
XCAFDoc_VisMaterial::FillMaterialAspect() - added clamping of too small shininess values.

Added options -mergefaces and -splitindices16 to WriteGltf for new feature.
Added -systemCoordSys option to WriteGltf for consistency with WriteObj.
2021-08-12 19:12:23 +03:00
kgv
fd42e7645d 0032527: Data Exchange, RWGltf_CafWriter - make name format configurable
Added properties RWGltf_CafWriter::NodeNameFormat() and ::MeshNameFormat().
2021-08-12 19:07:52 +03:00
kgv
d9d75a845f 0032525: Data Exchange, RWGltf_CafReader - support KHR_draco_mesh_compression
Added new optional dependency - Draco library.
RWGltf_GltfJsonParser now detects KHR_draco_mesh_compression extension,
marks accessor being compressed and redirects to compressed buffer view.
RWGltf_TriangulationReader now handles decoding of buffer view compressed using Draco.

env.bat template for genproj has been modified to allow specifying dedicated folders
with debug versions of libraries (CSF_OPT_LIB64D / CSF_OPT_BIN64D) within custom.bat.
Removed unused CSF_FREETYPE from TKOpenGl.
2021-08-12 19:03:55 +03:00
kgv
aeef9e2c13 0032524: Data Exchange, RWGltf_CafWriter - avoid writing translucent metallic materials
RWGltf_GltfMaterialMap::DefineMaterial() and XCAFDoc_VisMaterial::ConvertToPbrMaterial()
now reset matallic factor to 0.0f in case of transparent color.
2021-08-12 18:59:54 +03:00
achesnok
45fc824bac 0031220: Visualization - remove internal field of viewer selector in context
- Removed myMainSel field from AIS_InteractiveContext and obtained this value from mgrSelector.
- Moved SelectMgr_ViewerSelector3d implementation into SelectMgr_ViewerSelector to get rid of redundant separation and extra DownCast's.
- Declared SelectMgr_ViewerSelector3d as deprecated.
2021-08-12 18:57:05 +03:00
kgv
f227f3dc96 0032523: Draw Harness, ViewerTest - vrepaint -continuous has no effect
ViewerTest_ContinuousRedrawer now explicitly invalidates V3d_View content
in addition to emitting window content redrawing request.

"vrepaint -continuous" now tries to avoid creation of dedicated thread
on Windows platform and relies on AIS_ViewController::SetContinuousRedraw().
2021-08-12 18:53:12 +03:00
achesnok
1b5eb2be23 0026083: Coding Rules - Poor design of Graphic3d_GraduatedTrihedron
- Made class Graphic3d_AxisAspect publicly nested in Graphic3d_GraduatedTrihedron.
- Removed public PtrView field from trihedron and obtained it from OpenGL_Workspace while rendering.
- Made CubicAxesCallback protected and provided corresponding getter/setter.
- Renamed AxisAspect() to AxisAspectAt().
2021-08-09 19:14:26 +03:00
mkrylova
27e64adb38 0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
- provided OSD_FileSystem::OpenOStream() for output streams
- replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
2021-08-04 20:13:20 +03:00
kgv
e93008abdd 0032518: Visualization - add AIS_InteractiveContext::SetDefaultDrawer() 2021-08-04 20:11:27 +03:00
jgv
1a75fcddae 0032470: Modeling Algorithms - BOP wrong result on sphere and box
Correct adjusting pcurves on periodic surfaces: take the middle point as a reference point.
2021-08-04 20:08:52 +03:00
kgv
286e9f13f3 0032508: Visualization - OpenGl_FrameBuffer::InitWrapper() should not fail on wrapping textured FBO
OpenGl_FrameBuffer::InitWrapper() now reads viewport from GL_VIEWPORT
and doesn't return error on GL_TEXTURE attachments.
OpenGl_FrameBuffer::Release() assertion is now skipped for wrapped FBOs.
2021-08-01 12:34:41 +03:00
kgv
32f86ef5a3 0032506: Visualization - add AIS_InteractiveContext::ObjectIterator() for iterating over objects in context 2021-07-31 13:14:05 +03:00
kgv
6054db8a29 0032482: Visualization - Object owner isn't removed from picked owner when object is removed
SelectMgr_ViewerSelector::RemoveSelectableObject() now removes object from picking results.
2021-07-31 13:11:27 +03:00
asuraven
bec59435e0 0032492: Coding - New warnings after integration fix for 27814 2021-07-27 14:51:05 +03:00
nds
4e993e4d0d 0027919: Visualization - support multiple transformation persistence groups within single presentation
Added transform persistence property to Graphic3d_Group and Select3D_SensitiveEntity.
SelectMgr_ViewerSelector, Graphic3d_Layer and OpenGl_Structure have been updated
to process per-group transform persistence within picking, ZFit and rendering.

Added zoomable state to Prs3d_ArrowAspect supported by PrsDim_Dimension.

Added gp_GTrsf::SetMat4(), opposite to gp_GTrsf::GetMat4().
2021-07-23 18:31:51 +03:00
mkrylova
ad3f20c684 0032455: Data Exchange - replace OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
- replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
2021-07-23 18:28:23 +03:00
asuraven
000c21fa0c 0027814: Parallelize BRepCheck_Analyzer
Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
Add parallelization to BRepCheck_Analyzer::Perform
Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.

mutex as Handle
2021-07-23 18:15:55 +03:00
oan
f1c034f905 0032471: Mesh - Deflection of the triangulation is not recomputed for planar face
Method EstimateDeflection has been added to BRepLib in order to check and update value of deflection provided by Poly_Triangulation;
Introduction of Poly_TriangulationParameters intended to keep info about initial parameters of mesh stored by Poly_Triangulation;
BRepMesh stores user-specified parameters to Poly_Triangulation via Poly_TriangulationParameters;
Prefer initial parameters of mesh generator stored in Poly_Triangulation during check of mesh consistency.
2021-07-23 18:15:55 +03:00
mkrylova
a3b2aaefac 0032183: Visualization - implement AIS_LightSource::ProcessDragging() for rotating directional light
- Added sensitive sphere for a light source
- Implemented AIS_LightSource::ProcessDragging() interface for rotating directional light source
- Added possibility to turn on/off directional light source dragging
- Added test
2021-07-23 11:28:42 +03:00
emv
b7344f5d72 0032329: Modeling Algorithms - Refactoring of the BRepOffset_MakeOffset_1.cxx to decrease number of static methods
Refactoring of the BRepOffset_MakeOffset_1.cxx - Introduce local class BRepOffset_BuildOffsetFaces to compute splits of offset faces.

Change of tests is caused by the correction of the misprint in the code (incorrect input parameter for CheckEdgesCreatedByVertex method).
2021-07-23 11:28:42 +03:00
kgv
acab849d30 0032479: Application Framework - unnecessary API break within TDocStd_Application::Open()
Added aliases to Open() without theFilter argument for compatibility with old API.
2021-07-15 20:09:58 +03:00
oan
9ee9e5ec34 0032424: [Regression] Mesh - Slow triangulation of a simple shape.
Check links produced by splitting of an initial link by the middle point for MinSize requirement.
2021-07-15 20:05:10 +03:00
kgv
06d40093b7 0032121: Draw Harness, ViewerTest - implement -reset option for vlight command
vlight command has been revised to provide more friendly syntax.
Command now accepts light index or name as first argument.
Added arguments -enable/-disable for managing enabled state.
Added argument -reset to reset light parameters to default values.

V3d_Viewer::SetDefaultLights() now sets names "headlight" and "ambient" to created lights.
Graphic3d_TypeOfLightSource enumeration values have been renamed to avoid shortcuts.
Draw::Atof(), applied corrections to avoid explicit new/delete calls.
2021-07-12 20:50:25 +03:00
abulyche
cb7f92396f 0031047: Modeling Algorithms - BRepExtrema_DistShapeShape gives wrong result
Added map of edges to BrepClass_Edge
Added searching of vertices with high tolerance to BrepClass_Intersector.cxx
Added check for hitting a vertex with high tolerance
Added the creation of a segment for the correct work of the classifier
2021-07-09 19:16:14 +03:00
kgv
7b17aba789 0032473: Visualization, WNT_Window::ProcessMessage() - handle WM_TOUCH
WNT_Window::ProcessMessage() now redirects WM_TOUCH events to AIS_ViewController,
so that it is possible to use multitouch displays in Draw Harness on Windows platform.

_WIN32_WINNT in CMake configuration for MinGW has been raised from 0x0501 to 0x0601.
2021-07-09 19:14:39 +03:00
kgv
0f04bd99d0 0032475: Configuration, qmake - drop "-z defs" linker flag on macOS 2021-07-09 19:14:00 +03:00
jgv
d1b591e580 0031890: Modeling Algorithms - Invalid result of common fuse BOP. Intersection has failed.
Modify the method BOPTools_AlgoTools3D::DoSplitSEAMOnFace: correct processing closed non-periodic surfaces.
2021-07-09 19:14:00 +03:00
mpv
d5c71e2057 0031918: Application Framework - New binary format for fast reading part of OCAF document
Implementation of new format for quick reading and writing parts of the documents (sub-set of labels and sub-set of attributes). It consists in writing shapes and all their contents right in the TNaming_NamedShape attribute placement and skipping the shape section. New format 12 for Binary file types is assigned to this version.

Added PCDM_ReaderFilter class that could be used in Open methods of TDocStd_Application. If it is defined, it allows to read:
- into already opened document in append mode AppendMode_Protect (do not overwrite existing attributes) or AppendMode_Overwrite
- only specified sub-trees of the document using AddPath (const TCollection_AsciiString& theEntryToRead)
- only specified attributes using AddRead (const TCollection_AsciiString& theRead) where theRead could be "TDataStd_Name", for example
- to skip specified attributes read using AddSkipped (const TCollection_AsciiString& theSkipped) where theSkipped could be "TDF_Reference", for example

The current limitations:
- only in Bin format
- if shapes have in the document shared topology, loaded in "append" mode in different "load" operations, they will have no shared topology anymore

Modifications:
BinLDrivers and BinDrivers packages - modifications related to the quick part tree format flag usage, skipping shape section writing and adding labels sizes into the document to be able to pass labels during the reading quickly.
BinObjMgt_Persistent and BinObjMgt_Position - to add possibility to write directly into the stream some data just after the attribute. Before this record a data-size is recorded.
BinMXCAFDoc package modifications to write BinMXCAFDoc_LocationDriver location in the same way as shapes write location data right after the attribute (empty) data in this new format.
BinTools package: creation of ShapeReader and ShapeWriter classes with same root class ShapeSetBase with ShapeSet class. These classes allows to write/read shapes directly to the stream. If some object is already in the stream, write a reference - relative position of the duplicated object. The old format of documents is still supported by Bin_ToolsShapeSet class.
PCDM_ReaderFilter - Allows the user to create a reading filter. It contains algorithm to browse labels tree quickly, without usage of referencing by entry-strings.
TDocStd, CDF and some other packages are changed for supporting reading filters API and options.

Tests, documentation and upgrade information are also added for both issues: 31839 and 31918 related to this commit.
2021-07-09 19:13:59 +03:00
kgv
9e5e4c0c84 0032429: Coding - Warnings during compilation on macosx arm64 with option BUILD_Inspector:BOOL=ON - part 2 2021-07-06 16:46:31 +03:00
mkrylova
1f3c5058f2 0032389: Visualization, AIS_Axis - simple ray creation and displaying
- Added constructor to create axis by gp_Ax1
- Added possibility to display axis as ray
- Added function SetDisplayAspect to set required visualization parameters
2021-07-01 22:27:46 +03:00
mkrylova
9749af25ae 0032441: Draw Harness - command readstl doesn't print error message on failure
- added producing error message when passing an invalid file path
2021-07-01 22:26:10 +03:00
kgv
0770d850d6 0032465: Visualization, TKOpenGles - invalid enum on GL_RGBA16F initialization in Edge 92
GL_HALF_FLOAT_OES from OpenGL ES 2.0 extension
is now avoided within OpenGL ES 3.0+ context in favor of GL_HALF_FLOAT.

emscripten_webgl_enable_extension() is now called for all extensions
checked by OpenGl_Context::CheckExtension().
So far this doesn't solve any problem, but looks more logical and provisional.
2021-06-28 23:01:11 +03:00
kgv
16222b8cd2 0032463: Visualization - implement Image_AlienPixMap::Load() via emscripten_get_preloaded_image_data() 2021-06-27 17:32:27 +03:00
kgv
73dee81133 0032460: Coding Rules - eliminate CLang warning -Wunused-but-set-variable
Code has been adjusted to suppress -Wunused-but-set-variable warnings.

DRAWEXE.wasm, compiler flags have been moved to linker flags
to eliminiate -Wunused-command-line-argument warnings.
2021-06-24 23:47:45 +03:00
mkrylova
503374ad84 0032182: Visualization - add Select3D_SensitiveSphere
- created Select3D_SensitiveSphere class
- implemented interfaces for intersection methods
- added tests
2021-06-24 19:52:25 +03:00
kgv
c123c310df 0032459: Draw Harness, ViewerTest - fix description of vrenderparams -oit 2021-06-24 19:50:48 +03:00
kgv
91836c86eb 0032458: Draw Harness, ViewerTest - fix misprint in vaspects -drawSilhouette 2021-06-24 19:49:35 +03:00
asuraven
c9337e33a6 0029059: It is necessary to have a unique way of checking of the validity of the edge and its 2D curves
Add new class BRepLib_ValidateEdge to use for edge checking instead of functions:
- Validate() from BOPTools_AlgoTools.cxx
- Validate() from BRepCheck_Edge.cxx
- ShapeAnalysis_Edge::ComputeDeviation()
2021-06-24 19:47:49 +03:00
osa
51d4a4f9d0 0032390: Visualization, SelectMgr_FrustumBuilder - use camera instead of duplicated methods
Fix incorrect value of axis intersection with segment inside of SelectMgr_AxisIntersector::raySegmentDistance().
Move camera definition to base intersector (it is not possible to set it for axis intersector, is is not applicable).
Add method Graphic3d_Camera::SetIdentityOrientation() to set camera parameters to make current orientation matrix identity one.
Remove all matrices from selection intersectors and frustum builder and use camera instead of them.
Fix missed axis tests in vselect grid.
2021-06-22 11:17:39 +03:00
kgv
4db6d89bc6 0032429: Coding - Warnings during compilation on macosx arm64 with option BUILD_Inspector:BOOL=ON 2021-06-18 18:36:57 +03:00
kgv
690757a382 0032453: Documentation - nested multiline comments within BOPAlgo_CellsBuilder.hxx destroy Java wrapping 2021-06-18 18:35:43 +03:00
osa
168c27c69e 0032400: Visualization, TKIVtk - convert VTK camera to OCC
Add new interfaces GetEyePosition(), GetClippingRange(), GetAspectRatio() to IVTK_IView
Add ivtkviewparams command to print current parameters of view
Add ivtkcamera comand to print current camera parameters or manages camera parameters (set ortho or persp projection)
2021-06-18 18:34:02 +03:00
kgv
1790e9f28c 0032430: Coding Rules - eliminate CLang warning -Wdeprecated-copy
Introduced Standard_DELETE alias to C++11 feature "=delete".
2021-06-18 18:23:45 +03:00
bugmaster
42633ff642 0032156: Documentation, gendoc.tcl - wrong processing of 'mathjax' option 2021-06-18 18:23:45 +03:00
Natalia Ermolaeva
1aee888374 0032432: Inspectors - problems with tools test group
Adding __APPLE_ definition for libraries
2021-06-18 18:23:44 +03:00
bugmaster
50174691dc 0032404: Draw - problems with definition of cpulimit in tests
- The maximum value of cpulimit in test cases was limited to 1000 seconds (~ 17 minutes)
- cpulimit 1000 has been added to hlr/begin
2021-06-16 17:10:53 +03:00
kgv
3e6e62d861 0032438: Configuration - add batch files to build OCCT using Mingw-w64 2021-06-13 14:08:59 +03:00
kgv
902b31b6ee 0032437: Coding Rules - eliminate MinGW warning -Wmaybe-uninitialized 2021-06-13 14:08:59 +03:00
kgv
f9ab9f7f1c 0032433: Visualization, TKService - introduce Wasm_Window implementing Aspect_Window interface using Emscripten SDK
Introduced Wasm_Window implementing Aspect_Window interface.

Aspect_WindowInputListener has been extended by touch input callbacks (moved from AIS_ViewController),
which now implements redirection of single taps to UpdateMouseClick().

AIS_ViewController::FetchNavigationKeys() now requests more frames even if Delta is zero,
but navigation keys are pressed - indicated by a new flag AIS_WalkDelta::IsDefined().

Fixed missing implementation of Xw_Window::DisplayConnection() getter.
The property has been moved to the base class Aspect_Window.

Removed unused Aspect_Convert.hxx.

DRAWEXE targeting Wasm:
- added exposing of FS interface so that it is possible uploading/downloading files to/from emulated file system on JavaScript level;
- added printer redirecting messages to Module.printMessage callback accepting message gravity;
- Run_Appli() now skips std::cin when Module.noExitRuntime is set.
2021-06-12 12:36:24 +03:00
mpv
7b3a032f1e 0032299: Application Framework - Loading OCAF document saved with earlier version fails when using OCCT 7.5.1
Keeping information about the file start instead of calling tellg. This fixes problem with not-seekable streams used for XML files reading and improves performance of XML files reading (about 10%), since tellg is quite long operation.
2021-06-09 19:46:22 +03:00
mkrylova
623e54f9ac 0032417: Coding Rules - clean up public headers gp_Mat.hxx/ gp_Mat2d.hxx from internal macros
Deleted internal macros.
2021-06-09 19:40:22 +03:00
kgv
aa71e826ca 0032428: Documentation, AIS_InteractiveContext - put cross-references between MoveTo() and HighlightStyle()
Added more @sa section between methods.
Deprecated Select() methods have been moved to the section with obsolete methods.
Methods delimiter within @sa listing has been changed from '/' to ',' for proper Doxygen generation results.
2021-06-09 14:44:31 +03:00
kgv
6a920e0243 0032419: Coding Rules - revert Overlaps() methods to SelectBasics_SelectingVolumeManager as deprecated aliases
Deprecated Overlaps() methods have been moved from subclass SelectMgr_SelectingVolumeManager
to the base class SelectBasics_SelectingVolumeManager,
so that they are actually accessible within Select3D_SensitiveEntity::Matches() implementations.

Several methods have been marked as pure virtual in the base interface.
Second SelectMgr_BaseIntersector::OverlapsPolygon() has been dropped from virtual interface
as useless (trivially replaceable).
2021-06-04 19:10:46 +03:00
kgv
1b6b8afcd0 0029303: Data Exchange - add RWObj_CafWriter tool for wavefront OBJ file
Unstable test case v3d/memory/bug26538 has been adjusted.
2021-06-03 18:28:45 +03:00
zaphod
ff1f0c9ae2 0032402: Coding Rules - eliminate msvc warning C4668 (symbol is not defined as a preprocessor macro, replacing with '0' for directive)
Make preprocessor expressions consistent with respect to guard expressions.

Fixed usage of macros __QNX__, IRIX, OCCT_DEBUG, DO_INVERSE, DRAW, CHFI3D_DEB by value.
Removed obsolete hack for Sun Workshop 5.0 compiler.
2021-06-03 18:06:46 +03:00
mkrylova
d5477f8c82 0032137: Coding Rules - merge redundant .lxx files into header files within Package gp
- merged .lxx files into header files within Package gp
- fixed code style
2021-06-03 18:02:58 +03:00
kgv
5b441ee1a0 0032406: Configuration, CMake - DRAWEXE build fails on Linux with static libraries
Add missing CSF_dl, CSF_TclTkLibs to DRAWEXE dependencies (static build).
2021-05-31 16:05:43 +03:00
mkrylova
2315a04424 0032279: Draw Harness - protect incmesh from hanging on syntax error
- improved incmesh to raise exception on invalid input parameters
- added possibility to operate multiple objects
- added checking for too small values in BrepMesh algorithm
2021-05-28 18:08:30 +03:00
osa
1e4f29c5af 0032399: Configuration - correct search of VTK bin path by genconf 2021-05-27 21:09:36 +03:00
osa
18a353149e 0032385: Coding - New msvc10 warnings after integration fix for 32338 2021-05-26 20:21:34 +03:00
kgv
3738565abb 0026365: Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
Removed workaround within GeomLib_CheckCurveOnSurface.
2021-05-26 20:20:38 +03:00
Dzmitry Razmyslovich
793d165af6 0032261: Mesh - some trivial improvements for mesher
BRepMesh_Delaun::decomposeSimplePolygon(): minor change to improve code readability;
Correct test case
2021-05-26 20:09:15 +03:00
Dzmitry Razmyslovich
3326f9238c 0032261: Mesh - some trivial improvements for mesher
BRepMesh_ModelHealer::amplifyEdges use a single instance of EdgeAmplifier
2021-05-26 20:09:15 +03:00
Dzmitry Razmyslovich
ccb3502a56 0032261: Mesh - some trivial improvements for mesher
BRepMesh_GeomTool::IntSegSeg misses one case, when the result is Glued
2021-05-26 20:09:15 +03:00
osa
0038de11f4 0032388: Visualization - provide ray-picking interface with zero tolerance for rectangular frustum 2021-05-26 20:07:41 +03:00
osa
807340d924 0032387: Visualization - use interface of ray-picking for selection/highlighting for XR pose
Fixed regression of SelectMgr_ViewerSelector::SetPixelTolerance(). Removed redundant myToUpdateTolerance flag.

SelectMgr_AxisIntersector::raySegmentDistance() - fixed usage of SquareModulus() instead of Modulus().
SelectMgr_ViewerSelector::TraverseSensitives() now skips both BVHSubset_2dPersistent and BVHSubset_3dPersistent relying on Camera.

AIS_ViewController::handleXRMoveTo() now uses interface for picking by Axis explicitly
instead of emulating axis by point picking.
2021-05-26 20:06:45 +03:00
mkrylova
03c9cc86c6 0032337: Visualization - rename Overlaps() method in selection to more self-describable names
- renamed Overlaps and hasOverlap overloaded methods to self-describable names
2021-05-26 20:02:42 +03:00
kgv
df23a355c4 0032391: Draw Harness - missing syntax validation within vseldump
SelectMgr_SelectionImageFiller, SurfaceNormalFiller - pick results from SelectMgr_SortCriterion
instead of calling redundant Matches().
vseldump - added missing syntax error output on incorrect -type parameter.
2021-05-26 19:26:12 +03:00
vro
604aa3f4b3 0031920: Application Framework - speed up methods of getting label by entry and vice versa
A table for fast access to the labels by entry is implemented in OCAF document. A method TDF_Data::SetAccessByEntries(true) fills-in a table for fast access to the labels. New labels, created later will be added to the table automatically. The method TDF_Tool::Label() will search the entry in the table and then, if not found, will call the old code. Disabling of usage of the table (by calling of TDF_Data::SetAccessByEntries(false)) cleans the internal table of entries - labels. By default, the table is not used.
            This improvement is useful for large documents with a lot of labels, and if the application uses entries to get labels. The application should call TDF_Data::SetAccessByEntries(true) for a document and then, the method TDF_Tool::Label() called inside OCAF and XCAF will use the fast access to the labels and speed-up the application.
            Also, the method TDF_Tool::Entry() is improved (by MPV).

            Modified files:
            - TDF_Data.hxx and cxx: the new methods SetAccessByEntries(bool), IsAccessByEntries() and GetLabel(entry) are implemented. No need to use the method GetLabel() directly. It is called in TDF_Tool::Label().
            - TDF_Label.cxx: adding of a newly created label to the table of entries - labels.
            - TDF_Tool.cxx: the method Entry() is accelerated (by MPV) and Label() is improved to call TDF_Data::GetLabel().
            - DDF_DataCommands.cxx: a new draw-command is added SetAccessByEntry, which sets or unsets usage of the table for fast access to the labels. Usage of the draw-command is illustrated in a new test "bugs caf bug31920".

            Tests:
            - bugs caf bug31920: a new simple test to check TDF_Tool::Label() when fast access to the labels is on.

            Doc:
            - dox\upgrade\upgrade.md is extended for new information
2021-05-22 10:36:40 +03:00
jgv
f0ca3c819f 0032196: Modeling Algorithms - Invalid section curve
Modify the method IntWalk_IWalking::ComputeCloseLine: add condition for check of update of variable containing current solution
2021-05-22 10:36:40 +03:00
osa
0461e7fd03 0032338: Visualization - provide straightforward interface for ray-picking 2021-05-22 10:36:39 +03:00
osa
e1eb39d29d 0032365: Visualization - refactoring of viewer selector
Add SelectMgr_BaseIntersector class as base intersector that can have any geometry not only frustum.
Remove cached static array of selecting volumes from selecting volume manager. Keep only one the latest active selection volume.
Change initialization interface of active volume frustum inside of selecting volume manager: Init*SelectingVolume(), set required parameters, BuildSelectingVolume(). Mark existing BuildSelectingVolume() methods as deprecated.
Use SelectMgr_SelectionType instead of SelectBasics_SelectingVolumeManager::SelectionType (the last one is marked as deprecated).
Add interface GetViewRayDirection() to selecting volume manager to get view ray direction (instead of computation it as vector from near to far point).
Add interface IsScalableActiveVolume() to selecting volume manager to check possibility of scaling of current active selecting volume.
2021-05-22 10:36:39 +03:00
btokarev
77d94fd174 0032340: OCCT Documentation - highlight C++ code snippets
Added {.cpp} highlighting markers to the C++ code blocks in documentation;
Excessive tildes "~~~~~~~" in code block borders are reduced to required minimum of "~~~~" (4);
Removed obsolete space bars after code block borders;
TCL code blocks are now highlighted with {.php} markers;
Removed excessive {.cpp} highlighting markers appended to non-code blocks such as lists, reports and file content or structure examples;
Minor fixes for tests.md and draw_test_harness.md (whitespace removal and structural fix for "Where:" in code examples);
Minimum HDD space for OCCT updated in introduction.md.
2021-05-22 10:36:38 +03:00
kgv
4d67a36952 0032353: Modeling Data - Missing definition of ProjLib_ProjectOnSurface::Load() 2021-05-22 10:36:38 +03:00
kgv
c1ce84dcb3 0032292: Coding Rules - improve HLRBRep_PolyAlgo readability part 3
Use typed collections instead Handle(Standard_Transient) values.
2021-05-22 10:36:38 +03:00
mkrylova
114e7a9022 0032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add option dumping surface normals
- extended functionality to dump surface normals
- added new option to vseldump command
- added tests
2021-05-21 19:00:57 +03:00
nds
d16ecfe28e 0031362: Inspectors - MessageView plugin for message alerts
- append new MessageView plugin to display content of Message_Report;

- correct DumpJson of TDataStd array attributes to print Lower/Upper values;
- correct remove level of Message_Report to store stop time during removing all levels;
- append DumpJson for TFunction, TPrsStd attributes;
- correct DumpJson of XCAFDoc tools due to simplify performance of it;
- move AttributeInfo functionality from XDEDRAW into a static public method of XCAFDoc to call it outside;
- remove obsolete pane classes in DFBrowser plugin, now we may use DumpJSon panel to visualize this content of attributes;
- add new property panel in DFBrowser (synchronized with the same in other plugins);
- add button to switch ON DumpJson in DFBrowser(OFF by default, for better performance), also there is a context menu item in tree view;
- rename in DFBrowser "Property Panel" into "Property Panel (custom)";
- implement ViewControl_ColorSeletor and setting color in TreeModel_ItemProperties. Use only for light in VInspector now;
- implement setting false for all created AIS_Shape presentation to don't modify source TopoDS_Shape;
- remove not use VInspector_CallBack. It's possible using Message_Report/MessageView to track commands way;
- remove History panel in VInspector as not used, MessageView will be better solution for this;
- implement item and actions in VInspector for setting Lights in the view.
2021-05-18 19:23:10 +03:00
bugmaster
9a5bfc1c07 0032326: Tests - duplicated bottle.brep reference in test data 2021-05-15 12:47:44 +03:00
sshutina
d1b8120b69 0032364: Visualization - Add interface to return global filter from context 2021-05-14 20:44:00 +03:00
jgv
06392edef7 0032291: Modeling Algorithms - General Fuse produces wrong number of solids
Modify method IntWalk_IWalking::ComputeCloseLine: add new flag "isOnDegeneratedBorder" to reach the border successfully.
2021-05-14 20:43:59 +03:00
kgv
44a5aa517b 0032372: Configuration, qmake - define -Wall -Wextra flags for consistency with CMake options 2021-05-14 20:43:59 +03:00
akaftasev
8d52a74d03 0031147: Modeling Algorithms - BRepOffsetAPI_MakePipeShell null access
Added to Draw command 'setsweep ' posibility to change degmax and segmax parameter manually by '-SM' and '-DM' options
Added test
Added new condition to prevent crash
2021-05-14 20:43:58 +03:00
akaftasev
da02839efe 0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell
Added new boolean parameter to GeomLib::FuseIntervals() to select method of defining an element with close values
2021-05-14 20:43:58 +03:00
kgv
f5682e9f78 0032357: Coding Rules - eliminate GCC11 compiler warnings -Wignored-qualifiers 2021-05-12 19:59:21 +03:00
kgv
14ba0bbad7 0032351: Visualization, PrsDim_LengthDimension - add NULL checks for handling non-Line curves
Added several missing NULL-checks.
Reduced restrictions on building Edge-Edge and Edge-Vertex length dimension.
Added empty constructor for more straightforward initialization from vdimension command.
2021-05-11 19:24:10 +03:00
kgv
1220d98e7a 0032349: Visualization, TKOpenGl - move base buffer interface out from OpenGl_VertexBuffer class to OpenGl_Buffer
OpenGl_Buffer - added new class as a base for OpenGl_VertexBuffer, OpenGl_IndexBuffer, OpenGl_TextureBuffer.
OpenGl_TextureBufferArb has been renamed to OpenGl_TextureBuffer.
OpenGl_FrameBuffer - added initializers taking vec2i instead of (int,int) for dimensions.
2021-05-11 19:20:51 +03:00
jgv
11bbf75932 0032332: Modeling Algorithms - Incorrect result of ShapeUpgrade_UnifySameDomain
Method UnionPCurves of ShapeUpgrade_UnifySameDomain is modified: check of the range of new pcurves is added: if the range differs from the 3D-curve's one, the pcurves are being recomputed by projection.
2021-05-11 19:19:37 +03:00
kgv
d82eb9de24 0032270: Configuration - Removing VS 2008 from maintenance
Documentation - updated list of supported platforms.
2021-05-11 19:18:29 +03:00
luz paz
03ca365a6c 0031939: Coding - correction of spelling errors in comments [part 12]
Fix various typos via codespell.
2021-05-10 14:29:42 +03:00
luz paz
2641792e45 0031939: Coding - correction of spelling errors in comments [part 11]
Fix various typos via codespell.
2021-05-10 14:29:40 +03:00
mkrylova
43d09575e1 0032191: Tests - merge duplicated tests/v3d selection cases
- merged duplicated tests vselect cases
2021-04-30 18:43:32 +03:00
anv
2c276f91da 0032331: Visualization - Exception when trying to display some surfaces using iVtk with VTK 9
Updated memory allocation for vtkPolyData to use more suited method for VTK versions after 9.0
2021-04-30 18:42:01 +03:00
kgv
977d3d479e 0032342: Draw Harness - preload basic Tcl scripts into WebAssembly
DrawResources Tcl scripts and $tcl_library (init.tcl) are now preloaded into WebAssembly emulated filesystem for DRAWEXE.wasm.
DRAWEXE now mimics "pload" command for statically linked plugins.
2021-04-30 18:39:33 +03:00
kgv
b04cd5d587 0032341: Coding Rules - eliminate GCC11 compiler warnings -Wmaybe-uninitialized 2021-04-30 10:55:01 +03:00
dpasukhi
36fbf05b15 0032314: Data Exchange - Reading corrupted STEP files crashes
RWAxis2Placement3d:
 fixed problem with reading parameters ( if sub-entity invalid, set has-parameter to false )
2021-04-28 18:38:34 +03:00
emv
62eafa5ac7 0032088: Modeling Algorithms - Empty result of offset operation in mode "Complete" join type "Intersection"
Mark inverted edges located inside loops of invalid edges as invalid as well.
2021-04-28 18:37:28 +03:00
dpasukhi
596e783958 0031949: JT Import - some colors are lost while reading XT representation from JT file
Added checking to style of faces from SHELL and edges from WIRE
RWMesh_CafReader::fillDocument() is virtual now
2021-04-28 18:31:04 +03:00
kgv
cece953cb4 0032334: Visualization - SelectMgr_RectangularFrustum::Overlaps() does not set triangle normal in some cases
Added missing SelectBasics_PickResult::SetSurfaceNormal().
2021-04-28 18:27:56 +03:00
kgv
342bb7fd4d 0032323: Configuration - drop unused dependency from Xmu
Removed unused header Aspect_XWD.hxx.
Removed redundant includes of unused X11 extension headers.
Added missing dependency on pthread to TKDraw.

Added "-z defs" linker flag to qmake projects to detect missing library dependencies.
Removed unused CSF_MotifLibs.
2021-04-28 18:26:58 +03:00
kgv
376d374d1f 0032319: Foundation Classes, OSD_MemInfo - use mallinfo2() instead of deprecated mallinfo() 2021-04-28 18:18:26 +03:00
kgv
fd2efe5428 0032320: Documentation - mention rapidjson-dev and qtcreator within Debian packages 2021-04-23 18:47:36 +03:00
kgv
a34bddcfd6 0032315: Configuration, CMake - fix building Draw Harness plugins as static libraries
DPLUGIN() macros no more defines exported function PLUGINFACTORY when building static libraries.
DRAWEXE executable now pre-loads a set of plugins when building static libraries.
dversion - added WebAssembly info.
2021-04-23 18:46:13 +03:00
bugmaster
d0d9e9375f 0032311: Documentation - Removing obsolete tag COLS_IN_ALPHA_INDEX 2021-04-22 14:50:54 +03:00
kgv
f6651f22e6 0032313: Modeling Algorithms - Missing definition of constructor in GeomFill_NSections 2021-04-22 14:50:54 +03:00
emv
ad3dc75556 0032307: Modeling Algorithms - Empty result of offset operation in mode "Complete" Joint type "Intersection"
Make sure the vertices created by pairwise intersection of edges connected in the same vertex are unified correctly.
2021-04-22 14:50:54 +03:00
nds
b06da8f1f1 0032091: Visualization - possibility to redefine Graphic3d_TransformPers 2021-04-22 14:50:53 +03:00
kgv
e186cf152b 0032292: Coding Rules - improve HLRBRep_PolyAlgo readability part 2
Applied name conventions and dropped tabulation symbols.
2021-04-22 14:50:48 +03:00
luz paz
316ea29318 0031939: Coding - correction of spelling errors in comments [part 10]
Fix various typos via codespell.
2021-04-22 14:50:47 +03:00
kgv
b69e576af0 0032308: Configuration - make Xlib dependency optional
MACOSX_USE_GLX has been renamed to HAVE_XLIB and now configurable on Linux target.

Xw_Window.hxx now export class on non-Linux platforms.
OpenGl_Window now creates an off-screen EGL surface also in case of
window-less desktop setup (e.g. with disabled Xlib on Linux).

Draw_Window - code has been cleaned up.
Class definition has been unified across platforms when possible.
Unusued constructors have been removed.
Internal header files (MainWindow.h, init.h, etc.) have been renamed to .pxx
to avoid their unexpected distribution in "inc".
2021-04-22 14:50:46 +03:00
kgv
e8e157df45 0032306: Draw Harness, ViewerTest - move window message processing to TKService
Aspect_WindowInputListener - basic mouse/keyboard/expose input methods
have been moved out from AIS_ViewController to dedicated base interface.

Added WNT_Window::ProcessMessage()/Xw_Window::ProcessMessage() methods
redirecting Win32/X11 message to Aspect_WindowInputListener.
2021-04-17 15:14:16 +03:00
jgv
1294d5e39e 0031984: Modeling Algorithms - Sweep crashes if Bi-normal is given
Small modification in BRepFill_Sweep: to avoid exception, return status NotDone if construction of pipe surface fails.
2021-04-16 18:29:29 +03:00
jgv
93e453aa02 0032213: Modeling Algorithms - Invalid result of UnifySameDomain
Modify unification of faces: add splitting new wire into several ones.
2021-04-16 18:27:34 +03:00
kgv
57357010a8 0032301: Visualization, TKOpenGl - depth peeling is broken with OpenGl_Caps::buffersOpaqueAlpha option
OpenGl_LayerList::renderTransparent() - color mask is now set to write into Alpha channel of depth peeling FBOs.
OpenGl_View::blitBuffers() - avoid using undefined color for glClear(GL_COLOR_BUFFER_BIT) operation.
2021-04-16 18:19:49 +03:00
kgv
b907cca37e 0032304: Configuration - genproj should not override env.bat in OCC Products 2021-04-15 19:14:25 +03:00
kgv
d85cd274c4 0032302: Visualization, TKOpenGles - do not use window buffer by default
OpenGl_Caps::useSystemBuffer is now set to FALSE on both OpenGL and OpenGL ES.
OpenGl_Caps::buffersNoSwap and OpenGl_Caps::buffersOpaqueAlpha are now set to TRUE by default on WebGL.
2021-04-15 19:11:43 +03:00
kgv
87b68a0fd6 0032232: Draw Harness - make Tk dependency optional 2021-04-15 19:07:50 +03:00
nds
e76471b558 0032205: Visualization - implementing new selection scheme in context - replace extra
- implementation of additional selection scheme, mainly to deselect single selected object.
2021-04-15 19:05:56 +03:00
kgv
d37aef5ccf 0031678: Visualization - add option enabling hinting for textured fonts
Added new rendering parameter Graphic3d_RenderingParams::FontHinting
allowing to enable/disable hinting (default is no hinting preserving old behavior).

Command vrenderparams has been extended with arguments -fontHinting.
2021-04-15 19:03:52 +03:00
kgv
75e1b51170 0032292: Coding Rules - improve HLRBRep_PolyAlgo readability part 1
HLRBRep_PolyAlgo::StoreShell() - removed a couple of redundant variables (pointers to handles) and extra iterators.
Added a couple of missing NULL checks (HLRBRep_PolyAlgo::Normal() now skips CSLib::Normal() in case of no surface).
2021-04-13 20:17:03 +03:00
kgv
9e7cc3ad59 0032297: Coding Rules - merge GCPnts_UniformAbscissa.pxx into GCPnts_UniformAbscissa.cxx 2021-04-12 23:18:52 +03:00
kgv
194c71af96 0032296: Coding Rules - merge GCPnts_QuasiUniformDeflection.pxx into GCPnts_QuasiUniformDeflection.cxx 2021-04-12 23:18:52 +03:00
kgv
24579ecd6e 0032295: Coding Rules - merge GCPnts_AbscissaPoint.pxx into GCPnts_AbscissaPoint.cxx 2021-04-12 23:18:52 +03:00
kgv
de8a63e98e 0032294: Coding Rules - merge GCPnts_QuasiUniformAbscissa.pxx into GCPnts_QuasiUniformAbscissa.cxx 2021-04-12 23:16:44 +03:00
kgv
3d42fbc189 0032293: Coding Rules - merge GCPnts_UniformDeflection.pxx into GCPnts_UniformDeflection.cxx 2021-04-12 13:09:27 +03:00
kgv
a2af24d1a9 0032289: Visualization - add NCollection_Mat3 for 3x3 matrix similar to NCollection_Mat4
Introduced NCollection_Mat3 class similar to NCollection_Mat4.
Added NCollection_Mat4::operator() alias to NCollection_Mat4::Value().
Added NCollection_Mat4::Negated(), ::Subtracted(), ::Added(), ::Divided() operations.
Added a note to NCollection_Mat4::GetData() that matrix values are stored in column-major order.
Removed duplicated operator== operators from NCollection_Mat4/NCollection_Vec4/NCollection_Vec3/NCollection_Vec2 classes.

Removed obsolete and no more used matrix state fields from OpenGl_Workspace.
Removed obsoiete structure OpenGl_Matrix (replaced by OpenGl_Mat4).
OpenGl_ShaderProgram - duplicated methods have been replaced by templates.
2021-04-09 18:12:05 +03:00
kgv
c6aa2a8317 0032285: Coding Rules - get rid of generic methods in GCPnts_TangentialDeflection 2021-04-07 18:39:53 +03:00
kgv
95bdefb201 0032274: Tests - unstable snapshots from test case v3d/bugs/bug24785
Test case has been adjusted to reproduce scenario it was supposed to check.
2021-04-07 18:38:17 +03:00
ifv
c57bf5636c 0032106: Modeling Algorithms - Tolerance of General Fuse result depends on a sequence of arguments
BOPTools_AlgoTools2D::MakePCurveOnFace(...): extension of surface for projection with large tolerance is added.

test/bugs/modalg_7/bug32106 : new test case added
2021-04-07 18:37:19 +03:00
kgv
5c9493b348 0031087: Configuration - make FreeType dependency optional
Added option USE_FREETYPE to CMake configuration, enabled by default.
Added handling of HAVE_FREETYPE macros.

genproj now overrides env.bat/env.sh on template change.
2021-04-07 09:42:45 +03:00
gka
5e4f263d1c 0032264: Data Exchange - STEP exporter generates bad geometry [REGRESSION since 7.4.0]
Location of edge is applied to geom curve before analysis of vertices projections
2021-04-02 20:02:03 +03:00
kgv
ae64fe0119 0032276: Coding Rules - replace IntTools_CArray1OfReal by NCollection_Array1
IntTools_CArray1OfReal has been replaced by TColStd_Array1OfReal.
IntTools_CArray1OfInteger has been removed (unused).
2021-04-02 20:01:35 +03:00
luz paz
5e6e59146f 0031939: Coding - correction of spelling errors in comments [part 9]
Fix various typos via codespell.
2021-04-02 20:01:34 +03:00
akaftasev
00e9052bee 0031190: Modeling Algorithms - progress indication in GeomPlate is inconsistent
Added ability to display progress indicator in plate commands
Added tests
2021-04-02 20:01:34 +03:00
kgv
51c21d1fe4 0032174: Data Exchange - read.step.root.transformation parameter has reversed definition
Parameter definition has been corrected to match other Boolean parameters to map 0=OFF and 1=ON.
2021-04-02 20:01:33 +03:00
kgv
d0b8f0108f 0025845: VIS - Surface normals to be associated with polygonal source
IVtk_IShapeData::InsertCoordinate() has been replaced by IVtk_IShapeData::InsertPoint()
defining vertex position with surface normal.
IVtkVTK_ShapeData now allocates normals array within vtkPolyData.
IVtkOCC_ShapeMesher now fills in vertex positions with surfcae normals.
IVtkTools_SubPolyDataFilter has been corrected to optionally copy normals.

ivtksetboundingdraw command has been merged into "ivtksetdispmode -faceBoundaryDraw".
2021-04-02 20:01:33 +03:00
osa
cb766858b7 0032269: Visualization - update trinfo command with -lods option 2021-03-31 20:44:33 +03:00
kgv
20085dac44 0032262: Samples - JNIViewer sample compilation failure due to usage of removed aliases to Image_Format 2021-03-31 20:44:33 +03:00
kgv
cdcb843ef4 0032251: Documentation, gendoc.tcl - reference manual excludes TKIVtk and other optional modules
gendoc.tcl -refman now temporarily sets HAVE_ environment variables for including optional modules.
2021-03-31 20:44:32 +03:00
kgv
08eda8e30d 0032250: Documentation - pseudographics within gp_Trsf description is not properly escaped
Added @code tags to documentation of several classes in the package gp.
2021-03-31 20:44:31 +03:00
osa
5443dd2ffa 0032248: Visualization - load "false" deferred glTF data immediately 2021-03-31 20:44:30 +03:00
kgv
3483c64453 0032247: VIS, IVtkOCC_ShapeMesher - allow disabling auto-triangulation behavior
IVtkOCC_Shape now stores Prs3d_Drawer object used by IVtkOCC_ShapeMesher and IVtkOCC_SelectableObject.
IVtkOCC_ShapeMesher::internalBuild() made more consistent to AIS_Shape::Compute() in cleaning/triangulating shape.

Added command ivtkdefaults similar to vdefaults managing triangulation default parameters.
2021-03-31 20:44:29 +03:00
kgv
bbc5899a8c 0032242: Configuration, CMake - USE_GLES2 option does not appear in interactive configurator
USE_D3D, USE_OPENGL and USE_GLES2 options declarations have been reordered.
2021-03-27 13:46:04 +03:00
ifv
bff660919f 0032225: Modeling Data - Wrong result of extrema curve-surface
Extrema_GenExtCS.cxx: subdivision on intervals for periodic c curves is added

Extrema_FuncExtCS.hxx: access to fields mySqDist, myPoint1, myPoint2 is added

bug32225: new test case is added
2021-03-27 13:46:04 +03:00
ifv
c69e0e408f 0028196: Modeling Data - Algorithm 'Extrema_GenLocateExtPS' failed to find the extremum in a case
Extrema_GenLocateExtPS.cxx, Extrema_GenLocateExtPS.hxx:

Adjusting tolerances according to surface sizes is added.
Additional methods for searching solution are added for cases if basic method fails.

Extrema_FuncPSDist.cxx - small bug fixing.

BRepFill_TrimShellCorner.cxx - fixing regression

ChFi3d_Builder_CnCrn.cxx setting parameters for Plate algorithm to improve stability of solution

ProjLib_ComputeApproxOnPolarSurface.cxx - code optimization

Some test cases are modified according to current state of Extrema algorithm
2021-03-27 13:46:03 +03:00
kgv
6c2cf030e2 0032234: Configuration, OSD_Process::UserName() - avoid using getpwuid() unimplemented by Emscripten SDK 2021-03-27 13:46:03 +03:00
kgv
285b5189cd 0032246: Tests, Visualization - unstable test case bugs/vis/bug79 reporting memory leak
Test case has been adjusted to check memory trend after the loop.
2021-03-27 13:46:02 +03:00
osa
e816dce36e 0032086: Visualization - support deferred data loading
1) Extend Poly_Triangulation by mesh purpose, possibility to be cleared and late-load deferred data interfaces.
2) Update BRep_TFace to store list of triangulations istead of single one. And also active one. Update getter and setter of single triangulation and add new methods to interaction with whole triangulations list.
3) Update BRep_Tool to get single triangulation of face according to the input mesh purpose or whole triangulations list.
4) Update BRep_Builder to make face by not only single triangulation but whole triangulations list with specified active one.
5) Add new methods to BRepTools to interact with shape triangulations (Load/Unload/Activate/LoadAll/UnloadAllTriangulation(s))
6) Add new 'tlateload'command for shape to load/unload/activate triangulations.
7) Update 'trinfo' command by '-lods' options to print detailaed information about LODs of this shape
8) Support empty triangulations by selection. Use bounding box selection in this case.
9) Add new 'outdisplist' option to XDispaly command to print list of displayed objects to output variable but not to theDI
10) Add new '-noecho' option to vdisplay command to skip printing of displayed objects to theDI
11) Create new RWMesh_TriangulationSource as mesh data wrapper for delayed triangulation loading.
12) Create new RWMesh_TriangulationReader as base interface for reading primitive array from the buffer.
13) Cache nodes/triangles number defined in glTF file
14) Use RWMesh_TriangulationSource class as base of RWGltf_GltfLatePrimitiveArray one and RWMesh_TriangulationReader class as base of RWGltf_TriangulationReader one
15) Add possibilty to support of LODs by glTF reader. It is possible to skip data loading and load them later
16) Add new '-skiplateloading' (to skip triangulation loading), '-keeplate' (to keep information about deferred storage to load/unload triangulation later),
'-toprintdebuginfo' (to print additional debug information) options to ReadGltf command
17) Add new test of glTF late loading
2021-03-27 13:46:02 +03:00
kgv
6387996871 0032243: Tests - unexpected file artifact s.stl at the root of repository
Several test cases have been corrected to avoid creation
of temporary files s.stl, comp_nonmanifold.step, bug31301_1.stp at unexpected location.
2021-03-26 19:48:51 +03:00
kgv
0d828ac838 0032208: Tests - refactor visualization tests to cover several graphic drivers
Removed testgrids 'bugs/vis' and '3rdparty'; tests have been redistributed across other grids.
Moved testgrid 'v3d/ivtk' into dedicated 'vtk/ivtk'.

Added testgrid 'vselect' dedicated to 3D viewer picking/selection functionality
and filled with tests from 'v3d/vertex', 'v3d/face' and similar groups.

Added testgrid 'opengl' dedicated to OpenGL driver low-level functionality (GLSL programs and similar)
and filled with tests from 'v3d/glsl', 'v3d/raytrace', '3rdparty/fonts', 'bugs/vis' (portion) and similar.

Added testgrid 'opengles3' dedicated to OpenGL ES 3.0 driver low-level functionality
and reusing tests from 'opengl' testgrid.
Subgroup 'opengles3/raytrace' is disabled on Windows, as Ray-Tracing currently requires OpenGL ES 3.2.
while ANGLE library implements only OpenGL ES 3.0.

Added testgrid 'opengles2' dedicated to OpenGL ES 2.0 driver low-level functionality
and reusing a limited subset of passing tests from 'opengl' testgrid.
Currently testgrid is activated only on Windows platform when using ANGLE library
(properietary OpenGL ES drivers do not allow creation of restricted 2.0 context).

Test cases have been cleaned out to put bug description into log,
to properly load necessary plugins and to explicitly dump viewer.
2021-03-25 19:14:33 +03:00
kgv
a076535090 0032237: Visualization, TKOpenGl - fix Gouraud shading within perspective camera projection 2021-03-25 19:14:28 +03:00
kgv
1a96d253a5 0032222: Visualization, V3d_Viewer - use Graphic3d_TOSM_FRAGMENT by default instead of Graphic3d_TOSM_VERTEX 2021-03-25 19:14:27 +03:00
kgv
bbd9292784 0032230: Coding Rules - remove class headers Graphic3d_HighlightStyle.hxx deprecated since OCCT 7.2.0
Removed unused Graphic3d_HighlightStyle, Graphic3d_CTexture, Graphic3d_MapOfZLayerSettings,
Graphic3d_TypeOfComposition, Graphic3d_TypeOfComposition, V3d_Parameter, V3d_ViewPointer, SelectMgr_SequenceOfFilter.

Added missing deprecation statements to SelectBasics_SensitiveEntity, SelectMgr_EntityOwner and PrsMgr_Presentation3d.
2021-03-24 18:32:05 +03:00
kgv
ef188756a0 0032235: Foundation Classes, Message_MsgFile - force initialization of global mutex
Initialization of several global variables has been refactored to a function.
2021-03-22 11:34:52 +03:00
pdn
f7ad1e7e37 0025262: Foundation Classes - Poly package improvements
Improvements of functionality of Poly package:
* Add function to intersect a triangulation by an axis.
* Add function to intersect a triangle by an axis.
* Correct the bugs in the methods RemoveDegenerated, RemoveTriangle and ReplaceNodes of the class Poly_CoherentTriangulation.
2021-03-21 19:15:07 +03:00
jgv
0c2517292f 0032140: Modeling Algorithms - unify same domain calls crossed for opposite vectors
1. Correct unification of circular edges: avoid trying to make an axis with null magnitude.
2. New method UnionPCurves: unify existing pcurves of chain instead of projecting the curve of unified edge onto surfaces
2021-03-21 19:15:06 +03:00
kgv
b8ef513c8f 0032206: Visualization, TKOpenGl - move out OpenGL ES support to dedicated library TKOpenGles
Added TKOpenGles and TKOpenGlesTest toolkits built with HAVE_GLES2 macros.
Added CSF_OpenGlesLibs as alternative to CSF_OpenGlLibs.
2021-03-21 19:15:06 +03:00
emv
e22a91ccc9 0032199: Modeling Algorithms - BOP Cut produces invalid shape
Use section tolerance for checking the valid range.
2021-03-17 19:59:48 +03:00
kgv
b8db9379fe 0032203: Draw Harness, ViewerTest - drop dependency from OpenGL
Added TKOpenGlTest and TKD3DHostTest Draw Harness plugins.
TKOpenGlTest is automatically loaded by ViewerTest::ViewerInit().

Commands vgldebug, vvbo, vcaps and vuserdraw have been moved to TKOpenGlTest.
New command vglshaders lists GLSL programs defined by OpenGl_GraphicDriver,
previously implemented by "vshaderprog -list".

Added new command vdriver for graphic driver selection.
Removed erroneous code from command vstereo.
2021-03-17 19:56:54 +03:00
kgv
655e883cb9 0032221: Visualization, TKD3DHost - fix memory leak within D3DHost_FrameBuffer::Release()
D3DHost_FrameBuffer - added missing color texture release within FBO destruction.
OpenGl_View::RedrawImmediate() - fixed unexpected window buffer swap while rendering into offscreen myFBO.
2021-03-17 19:55:44 +03:00
kgv
9b329b9aa4 0032202: Visualization - XCAFDoc_VisMaterial::FillMaterialAspect() should copy emissive color from PBR definition 2021-03-17 19:54:55 +03:00
kgv
43eddb470f 0032217: Visualization, TKOpenGl - drop propagation of unused FFP functions
OpenGl_GlFunctions no more loads unused FFP functions.
OpenGl_GlCoreXX function tables no more defined two hierarchies with and without FFP functions,
and OpenGl_Context::coreXXback fields have been removed.
Introduced OpenGl_Context::core11ffp as more straightforward naming for obsolete FFP function set.
2021-03-17 19:53:14 +03:00
kgv
b470ebea04 0032200: Visualization, TKOpenGl - unify Phong/PBR light space calculations
Graphic3d_ShaderManager - Phong shading now uses World space calculations.
OpenGl_ShaderManager::pushLightSourceState() - fixed unnormalized direction of headlight source.
2021-03-17 19:53:13 +03:00
kgv
61a05a3658 0032198: Visualization, TKOpenGl - per-vertex lighting ignores back/front material colors
Graphic3d_ShaderManager::stdComputeLighting() now multiplies vertex color by material color.
2021-03-17 19:53:13 +03:00
kgv
941f6cae55 0032201: Visualization, TKOpenGl - unify Phong/PBR material properties getters
Graphic3d_ShaderManager::stdComputeLighting() - implementation has been adjusted
for better consistency between PBR / non-PBR.

OpenGl_Material definition has been modified to join Front/Back pair into a single uniform variable.
Common material definition now occupies 4x2 vec4 instead of 5x2 vec4.

Getters of Common material properties within Declarations.glsl
have been renamed to match PBR material syntax (e.g. take IsFront flag as function argument).
Auxliary macros (like occTextureColor()) has been renamed (like occMaterialBaseColor())
and adjusted to return material property directly instead of taking it as argument.
2021-03-17 19:53:12 +03:00
kgv
a604968547 0032207: Draw Harness, ViewerTest - explicitly close 3D Viewer windows at Tcl interpreter closure 2021-03-17 19:52:22 +03:00
kgv
114db5a5ce 0032218: Visualization - move V3d_View::ShadingModel() property to Graphic3d_RenderingParams 2021-03-17 19:41:25 +03:00
kgv
3ae8c60b87 0032219: Visualization, TKService - drop dependency from OpenGL
Visual selection has been moved out from Xw_Window constructor to OpenGl_GraphicDriver::InitContext().
Default Visual is now stored within Aspect_DisplayConnection.
2021-03-17 19:40:40 +03:00
kgv
442850c032 0032220: Configuration, Aspect_VKeySet - eliminate name collision with X11 macros
Aspect_VKeySet::KeyState::Status field has been renamed to KStatus.
2021-03-17 09:54:47 +03:00
emv
58210e5983 0032136: Modeling Algorithms - Boolean fuse fails and corrupts the argument-shape
Avoid increasing tolerance of the vertex before the check on valid range is passed.
2021-03-05 18:00:28 +03:00
kgv
19ed08fda6 0031794: Visualization - Highlighting of AIS_Shape works incorrectly when AddChild() used
PrsMgr_PresentationManager::Display(), PrsMgr_PresentationManager::Color(),
and SelectMgr_SelectionManager::Activate() now skip children in Erased state.
2021-03-05 17:49:17 +03:00
kgv
e70625d6b1 0030640: Visualization, Graphic3d_Camera - add option creating Projection matrix with [0,1] depth range
Added new property Graphic3d_Camera::IsZeroToOneDepth() and OpenGl_Caps::useZeroToOneDepth
for activating [0,1] depth range instead of [-1,1] range using glClipControl() within OpenGL 4.5+.
2021-03-05 17:41:27 +03:00
mkrylova
395d00e058 0032144: Draw Harness - add -silent option to command Close
- Extended command Close with an option -silent
- Extended command Close to handle */-ALL for closing ALL document
- Replaced catch {Close D} by Close D -silent in tests
2021-03-05 17:31:07 +03:00
kgv
d6e050ac44 0032008: Modeling Algorithms - disallow implicit copy of Extrema algorithms
Extrema_GenExtPS now prefers resizing of Array2 tables instead of managing tables by extra handles.
Removed unsafe casts to Adaptor3d_SurfacePtr/Adaptor3d_CurvePtr in Extrema classes.
Removed unsafe casts to curve adaptors in Extrema_ExtCC, Extrema_ExtCC2d classes.

Extrema_GenExtPS, Extrema_GenExtSS, Extrema_ExtCS -
copies by value are now disallowed;
several unexpected places copying the object have been fixed.

IntTools_Context - maps of void* have been replaced by typed maps.
2021-03-05 17:31:07 +03:00
mpv
6498be7036 0032109: Application Framework: Test case bugs caf bug31546 works extremely unstable
In test it should be taken into account that
  lappend listmem [meminfo h]
  checktrend $listmem 0 0 "Memory leak"
also gets memory (also about 100 bytes per iteration).
2021-03-04 19:49:35 +03:00
kgv
952a0565d7 0032192: Visualization, TKOpenGl - load OpenGL 4.6 functions within OpenGl_Context
glext.h has been updated to include latest fixes and new definitions.
2021-03-04 19:44:57 +03:00
mkrylova
e3d4b87912 0031779: Visualization, AIS_ViewController - controller should handle selection schemes
Added AIS_ViewController::MouseSelectionSchemes() property defining map of selection schemes for mouse+modifier combinations.
IsXOR flag has been replaced by AIS_SelectionScheme in interfaces.

Rubber-band selection with Shift key pressed now applies XOR selection scheme in in Draw Harness.
Command vselect has been extended to specify selection scheme by name.
2021-03-04 19:43:13 +03:00
Chris Hennes (chennes)
329e5df986 0032181: Modeling Algorithms - ChFi3d missing error checking
Throughout the ChFi3d fillet creation functions there are two sets of unchecked
errors that can result in segmentation faults when geometry-creation problems
occur.

The first is that the functions ChFi3d_cherche_* may fail to find the requested
item: they silently return without setting the required reference, which is
then accessed by the algorithms. This can be caught with a conditional at the
end of the function that throws an exception if the required item was not
found.

The second class of unchecked error is the use of BRep_Tool::CurveOnSurface,
which may fail to create the required curve, returning a null handle. In many
cases in the existing fillet code this is not checked. This can be dealt with
by checking the returned handle using IsNull() and throwing an exception
if the call did not result in valid geometry.
2021-03-04 19:42:05 +03:00
kgv
7fd4958d45 0032188: Visualization, Graphic3d_Aspects - define backface culling using Graphic3d_TypeOfBackfacingModel
Graphic3d_Aspects::ToSuppressBackFaces() bool flag has been replaced by
Graphic3d_Aspects::FaceCulling() property defined by Graphic3d_TypeOfBackfacingModel enumeration.

Graphic3d_TypeOfBackfacingModel_Auto corresponds to old ToSuppressBackFaces()==TRUE;
Graphic3d_TypeOfBackfacingModel_DoubleSided corresponds to old ToSuppressBackFaces()==FALSE;
Graphic3d_TypeOfBackfacingModel_BackCulled allows enabling back face culling regardless of Graphic3d_Group::IsClosed() flag.

XCAFDoc_VisMaterial::IsDoubleSided() bool flag has been replaced by
XCAFDoc_VisMaterial::FaceCulling() property defined by Graphic3d_TypeOfBackfacingModel enumeration.

glTF reader now maps "doubleSided" material flag into
Graphic3d_TypeOfBackfacingModel_BackCulled (forced back face culling) and
Graphic3d_TypeOfBackfacingModel_Auto (e.g. practically doubleSided as there is no closed/open info in glTF).

glTF writer by default writes materials as "doubleSided" save the Graphic3d_TypeOfBackfacingModel_BackCulled property set
(in future, extra logic might written for automatically defining singleSided materials for Solid B-Rep objects).

Removed obsolete unused types V3d_TypeOfPickCamera, V3d_TypeOfPickLight, V3d_TypeOfRepresentation, and V3d_Coordinate.
Deprecated types V3d_TypeOfBackfacingModel, V3d_TypeOfLight, and V3d_TypeOfShadingModel.
2021-03-04 19:40:23 +03:00
kgv
42ddd0028c 0032184: Visualization - remove ambiguous AIS_GlobalStatus constructor
Auxiliary AIS_GlobalStatus constructor has been removed.
AIS_InteractiveContext::setObjectStatus() no more adds
an invalid -1 mode to AIS_GlobalStatus.

Never updated property AIS_GlobalStatus::GetLayerIndex() has been removed;
AIS_InteractiveContext::SetTransformPersistence() has been corrected to use
ZLayer defined within object itself.
2021-03-04 19:39:20 +03:00
kgv
33425a46b8 0032143: Visualization - add option excluding transparent object from sorting
Added option Graphic3d_AlphaMode_MaskBlend combining Mask (no sorting)
and Blend (enable blending with background) behavior.
2021-03-04 19:38:16 +03:00
kgv
ba590cbf15 0032180: Visualization - StdSelect_BRepOwner::SetLocation() does not update selected sub-shape
StdSelect_BRepOwner::SetLocation() now propagates location to sub-shape presentation instead of invalidating it.
2021-02-27 15:36:19 +03:00
osa
bc0711a5c3 0032171: Data Exchange - RWGltf_TriangulationReader doesn't copy cached bounding box
Save cached bounding box in loaded triangulation getting it from "proxy" late-loaded object.
2021-02-26 17:31:02 +03:00
kgv
53219061ca 0032165: Visualization - remove obsolete method AIS_InteractiveContext::PurgeViewer() 2021-02-26 10:56:32 +03:00
kgv
decbff0dfd 0032161: Coding Rules - deprecate obsolete alias PrsMgr_PresentationManager3d 2021-02-26 10:56:31 +03:00
kgv
1507ccda40 0032168: Visualization - Wrong computation of screen axis in V3d_View::SetTwist method
Fixed wrong axis check.
2021-02-26 10:56:31 +03:00
kgv
478862fcc2 0032160: Coding Rules - merge AIS_InteractiveContext_*.cxx into single file
Removed redundant .lxx files from API package.

AIS_InteractiveContext_1.cxx,AIS_InteractiveContext_2.cxx,AIS_InteractiveContext_3.cxx
have been merged into AIS_InteractiveContext.cxx.
V3d_View_2.cxx,V3d_View_3.cxx,V3d_View_4.cxx have been merged into V3d_View.cxx
V3d_View_4.cxx has been merged into V3d_View.cxx.
2021-02-25 18:58:50 +03:00
kgv
39e6123e3b 0032162: Visualization - move AIS_DisplayStatus from AIS_GlobalStatus to PrsMgr_PresentableObject
AIS_DisplayStatus has been renamed to PrsMgr_DisplayStatus
and moved from AIS_GlobalStatus class field to PrsMgr_PresentableObject.

0032167: Visualization, AIS_InteractiveContext - setObjectStatus sets wrong status when AIS_DS_Erased

AIS_InteractiveContext::setObjectStatus() Fixed setting unexpected Displayed status to Erased objects.
2021-02-25 18:58:49 +03:00
kgv
79d49683d6 0032155: Tests - remove broken command OCC280
Command OCC280 and a couple of useless tests have been removed.
Test case bug349 has been updated to reproduce scenario using standard commands.
2021-02-25 18:55:30 +03:00
kgv
72ed06442e 0032154: Tests - include vglinfo into Tests Summary
Command testgrid now includes vglinfo into summary.
Command vinit has been extended by -virtual option creating an offscreen window.
Command vglinfo now splits long values into multiple lines.
Added test case v3d/glsl/glinfo dumping OpenGL context creation info.

OpenGl_Window - fixed initialization of OpenGL 4.6 Core Profile (was limited to 4.5).
2021-02-25 18:55:29 +03:00
kgv
02a2beaad9 0032153: Visualization, Graphic3d_ArrayOfPrimitives - share common allocator
Added method Graphic3d_Buffer::DefaultAllocator(), which is now used across code.
2021-02-25 18:55:28 +03:00
kgv
4bf072e4eb 0032152: Visualization - move out GLSL program generator from OpenGl_ShaderManager to Graphic3d_ShaderManager 2021-02-25 18:55:27 +03:00
kgv
4464c6b591 0032149: Draw Harness, ViewerTest - remove obsolete command vfeedback 2021-02-25 18:55:27 +03:00
kgv
9299697997 0032150: Visualization, TKOpenGl - ignore OpenGl_Caps::ffpEnable when FFP is unavailable
OpenGl_Workspace::Activate() now implicitly disables OpenGl_Caps::ffpEnable when it is unsupported.
OpenGl_AspectsSprite::build() now ignores OpenGl_Caps::pntSpritesDisable when Display Lists are unsupported.
2021-02-24 20:59:43 +03:00
kgv
93cdaa76da 0031196: Visualization, TKOpenGl - enable Ray-Tracing using OpenGL ES 3.2
OpenGl_Context now activates Ray-Tracing and arbTboRGB32 for GLES 3.2.
Removed initialization of some uniforms from GLSL code.
Fixed implicit casts within Ray-Tracing shaders.
2021-02-24 20:58:38 +03:00
kgv
127330f9d7 0032147: Documentation - drop mentioning of WOK from build_3rdparty 2021-02-20 19:00:34 +03:00
kgv
374dffea0b 0032139: Visualization - support single-precision floating point data within Poly_Triangulation
Introduced NCollection_AliasedArray collection defining a general byte array
to be aliased as array of elements of mutable type.

Poly_ArrayOfNodes specializes this interface for collecting 2d/3d points with single/double precision.
Poly_Triangulation relies on this new class for definition of 3D nodes and UV coordinates
using gp_Pnt and gp_Pnt2d by default as before.

RWGltf_CafReader now fills in triangulation using single precision by default (as stored in the file).
2021-02-20 18:58:56 +03:00
kgv
e44b849de9 0032145: Coding Rules - move GL functions loading to OpenGl_GlFunctions.cxx 2021-02-20 18:57:49 +03:00
asuraven
a13df0fee0 0031990: Coding, Draw Harness - Replace C-like pointers to function in Draw_SaveAndRestore class to virtual function
Save/Restore interface has been moved to Draw_Drawable3D base class.
Create a singleton Draw_Params class for DRAW parameters
2021-02-20 10:43:32 +03:00
dpasukhi
930b466c9b 0032087: Data Exchange, STEPCAFControl_Reader - NULL representation of shape for DGT
- Fixed problem with find a Path for the DimensionType_Location_WithPath
- Added check for the null object within FindShapeIndexForDGT
2021-02-20 10:43:17 +03:00
vro
a8b605eb5e 0032133: Modeling Data - Restriction of access to internal arrays for Poly_Triangulation, revision of API
Removed methods from Poly_Triangulation/Poly_PolygonOnTriangulation giving access to internal arrays of 2d and 3d nodes, triangles and normals.
2021-02-18 18:55:21 +03:00
kgv
008210c3e2 0032129: Visualization, TKOpenGl - shadowmap is broken for ZLayer having non-zero origin
OpenGl_LayerList::renderLayer() - fixed usage of wrong camera while rendering shadowmap,
and apply Z-Layer origin shift to shadowmap matrix while applying shadow.
2021-02-14 01:11:37 +03:00
osa
92f8ec2f01 0032099: Visualization - define OSD_FileSystem class managing opening of file streams
1) Remove unnecessary includes of "Standard_OStream.hxx" file and add it only into files where it is really used.
2) Create the base interface for a file stream provider OSD_FileSystem and its inheritor OSD_CachedFileSystem that keeping last stream to be reused for opening a stream with the same URL.
3) Use OSD_CachedFileSystem object instead of RWGltf_GltfSharedIStream during Gltf reading.
2021-02-13 11:04:19 +03:00
kgv
9ee2481598 0032124: Visualization, AIS_Shape - setting color will cause Iso Lines to appear due to misprint in Prs3d_Drawer::SetOwnLineAspects()
Fixed misprint myUIsoAspect -> myVIsoAspect.
2021-02-11 20:06:15 +03:00
emv
8d55cb22a8 0031974: Modeling Algorithms - Strange behavior of boolean operations on this BREP
Problem is fixed by #0031995. Integrating test case only.
2021-02-11 20:06:14 +03:00
mkrylova
2daa5d95a5 0031704: Visualization - add an interactive object AIS_LightSource representing a light source
Added new class AIS_LightSource representing a light source presentation.

Graphic3d_TMF_CameraPers - added new mode to Graphic3d_TransformPers
defining 3D point relative to camera Eye position
2021-02-11 20:06:14 +03:00
kgv
9779ff75fd 0032095: Tests - drop comparison in unstable perf/ncollection group
Mark performance deviations compared to STL collections as warnings instead of errors.
2021-02-11 20:06:13 +03:00
dpasukhi
830616a60b 0032119: Coding Rules - eliminate msvc warning C4800 (implicit cast to bool) after fix for 32115
Fixed incorrect comparison and forcing cast
2021-02-10 20:45:26 +03:00
kgv
e03a03fdc2 0032122: Samples - handle WASD keys in WebGL sample 2021-02-10 20:44:31 +03:00
kgv
1ff3663c91 0032118: Visualization, Graphic3d_MarkerImage::StandardMarker() - return marker with pre-defined id 2021-02-10 20:42:57 +03:00
kgv
665dc9e50b 0032117: Visualization, TKOpenGl - assert in OpenGl_AspectsSprite due to implicit destruction of existing resource
RGBA and Alpha markers are now handled independently within OpenGl_AspectsSprite::build().
2021-02-10 20:42:57 +03:00
dpasukhi
00a72254dc 0032115: Data Exchange, STEP reader - Incorrect full path to file is not caught
Fixed a checking for a non-existent step file
2021-02-06 14:09:56 +03:00
dpasukhi
0c38be8f8d 0031970: Data Exchange, STEP reader - parser syntax error messages are inaccessible
- Upgraded files using new version of WinFlexBison
 - Removed global variables within StepFile_Read.cxx
 - Upgraded error message during bison analyzing ( added a expected expression information )
 - Used 'Interface_ParamType' as argument type for the StepFile_ReadData::Argument
 for a compatibility with the StepData/StepData_StepReaderData
 - Added handling parse errors and transferring it to the StepData_StepReaderData
 - Now parsing and referencing errors save in the check and non output by default
 - Step_file's and Step_Data's output info prints according by trace level of printer
 - Removed useless location.hxx
 - Removed TraceLevel for the StepFile_Reader ( now it useless,
  it is 0 by default and newer and nowhere change )
 - Translate error message into English within StepData_StepReaderData
 - Replace "Error" word in the output messages
2021-02-05 20:35:19 +03:00
kgv
1ac837b2c2 0032114: Visualization, TKOpenGl - broken PBR LUT on OpenGL ES 2.0
Added image formats Image_Format_RGF_half/Image_Format_RGBAF_half
with manual conversion between 32-bit float and 16-bit half-float values.

PBR LUT table is now converted into GL_HALF_FLOAT_OES data format in case of OpenGL ES 2.0.
2021-02-03 18:40:34 +03:00
kgv
75642c1489 0032110: Visualization, TKOpenGl - allow incomplete PBR on OpenGL ES 2.0 without GL_EXT_shader_texture_lod
textureCube() is now used as fallback when textureCubeLod() is unavailable.
2021-02-03 18:38:50 +03:00
kgv
7106e4c8b1 0032113: Visualization, TKOpenGl - broken PBR diffuse map within OpenGl_Caps::buffersOpaqueAlpha() on OpenGL ES 2.0
Fixed enabling of alpha channel writes while baking PBR environment.
2021-02-03 18:34:25 +03:00
emv
a36a30b724 0032108: Modeling Algorithms - BRepAlgoAPI_Section is too slow
Fixed by 0029711. Integrating test case only.
2021-02-03 18:32:55 +03:00
luz paz
4551e1be75 0031939: Coding - correction of spelling errors in comments [part 8]
Fix various typos

Fixed via codespell v2.1.dev
2021-02-03 18:31:42 +03:00
kgv
8df3104cd2 0032105: Visualization, TKOpenGl - PBR flat shading GLSL program compilation error on OpenGL ES 2.0
OpenGl_ShaderManager::defaultGlslVersion() - fixed combining two extensions in header.
2021-02-03 18:28:17 +03:00
kgv
e1d17cebe2 0032101: Visualization, TKOpenGl - use GL_UNPACK_ROW_LENGTH within OpenGL ES 3.0 / WebGL 2.0
Added OpenGl_Context::hasUnpackRowLength property for using GL_UNPACK_ROW_LENGTH in runtime.
OpenGl_Texture now uses GL_UNPACK_ROW_LENGTH on OpenGL ES 3.0 when necessary.
OpenGl_Texture::InitCubeMap() now allows uploading vertically-stacked cubemaps
without GL_UNPACK_ROW_LENGTH requirement.
2021-02-03 18:26:28 +03:00
kgv
82b856b880 0032079: Coding Rules - rename AIS_KindOfInteractive enumeration values with fully-qualified name
In addition, several ViewerTest command have been cleared out from duplicated checks.
2021-01-30 20:22:29 +03:00
kgv
4ad4054c90 0032094: Visualization, TKOpenGl - OpenGl_VertexBuffer::bindAttribute() silently does nothing without active GLSL program
OpenGl_VertexBuffer::bindAttribute() now prints an error message indicating a possible VBO misuse.
2021-01-29 19:54:31 +03:00
kgv
a0073def2d 0032081: Visualization - WebGL sample errors when run in Safari browser with WebGL 1.0
"MAX_WEBGL_VERSION=2" Emscripten option is now used for building sample instead of deprecated "USE_WEBGL2=1".
2021-01-29 19:51:18 +03:00
kgv
8f8fe4a97c 0032083: Visualization, TKOpenGl - PBR rendering is unavailable on Apple A12 Bionic (iPad)
Added "#define occLight_Index(theId) 0" workaround allowing to compile
a single light source PBR shading program on OpenGL ES 2.0,
as it disallows non-constant index expressions (even trivially deducable at compile-time).

PBR lookup table is now automatically resized to RGBA format
when RG texture format is unsupported (OpenGL ES 2.0).

OpenGl_ShaderManager now allows compiling PBR shaders
using WebGL 1.0 + GL_EXT_shader_texture_lod extension.

PBR IBL baking GLSL program has been redisigned to use
if/else to avoid non-constant index expressions.
Diffuse baking implements packing float values into a temporary RGBA8 texture
as a fallback solution on WebGL 1.0 implementations supporting float textures
but not as FBO render targets.

OpenGl_PBREnvironment now uses GL_FRAMEBUFFER instead of GL_DRAW_FRAMEBUFFER
for compatibility with OpenGL ES 2.0.
2021-01-29 19:51:18 +03:00
kgv
776302d46b 0032093: Visualization, TKOpenGl - loading texture in BGR format fails in OpenGL ES
Graphic3d_TextureRoot::convertToCompatible() - fixed handling of
Image_Format_BGR and Image_Format_BGRA formats.

OpenGl_Texture - added error message for unsupported pixel format;
error messages have been extended by resource id.
OpenGl_Texture::InitCubeMap() now does not release cubemap
on mipmaps generation failure.

Image_PixMap::ImageFormatToString() - added method returning name of pixel format.
2021-01-29 19:51:17 +03:00
emv
961c002c46 0031912: Modeling Algorithms - Boolean Cut can't build resulting shape
Problem is fixed by #0032058. Integrating test case only.
2021-01-29 19:44:58 +03:00
osa
538ab5dd8a 0032078: Visualization, Poly_Triangulation - add cached bounding box.
1) Add empty constructor for Poly_Triangulation(),
2) Add Poly_Triangulation::HasGeometry() method to check that triangulation has any geometry.
3) Add possibility to cache bounding box in Poly_Triangulation and use it later in case of empty triangulation.
4) Add Poly_Triangulation::MinMax() to extends input box with bounding box of triangulation.
5) Add Poly_Triangulation::UpdateCachedMinMax() to cache min - max range of this triangulation with bounding box of nodal data.
6) Add virtual Poly_Triangulation::computeBoundingBox() to calculate bounding box of nodal data.
7) Update BRepBndLib::Add/AddOptimal/AddOBB algorithms to check empty triangulation and use cached box in this case.
8) Update BRepGProp::roughBary/surfaceProperties/volumeProperties to skip empty triangulation.
9) Remove additional myBox from RWGltf_GltfLatePrimitiveArray and some hack to save this box as nodes of base Poly_Triangulation.
10) Cache min-max range from JT file during its parsing
2021-01-27 21:21:32 +03:00
kgv
a46ab511c5 0032082: Visualization, TKOpenGl - improve formatting of error messages
Error messages in TKOpenGl package have been improved to format
GLenum values as string constants or hex values.
OpenGl_VertexBuffer::init() now logs a message with error details
instead of just returning Boolean flag.
2021-01-24 23:48:10 +03:00
jgv
8948e18df8 0031845: Modeling Algorithms - BRepOffsetAPI_MakeThickSolid fails
Multiple changes in BRepOffset_MakeOffset algorithm:
- correct fusing vertices;
- correct building intersection edges;
- correct intersecting new edges in 2D;
- correct building wire on a new face;
- correct building history.
2021-01-22 19:09:02 +03:00
mkrylova
5634c81a9b 0031547: Visualization - V3d_View creates V3d_Trihedron instance
- moved creating of V3d_View::myTrihedron from constructor to first attempt of displaying or calling it;
- moved creating of V3d_Viewer::myRGrid and V3d_Viewer::myCGrid to to first attempt of displaying or calling them;
- renamed V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive();
- redefined V3d_View::Trihedron() and V3d_Viewer::Grid() by adding new argument toCreate
for opportunity to check the existence of the objects without their recreating.
2021-01-22 19:04:25 +03:00
kgv
5de4b704fe 0032065: Samples - use MODULARIZE within WebGL sample
Fixed multitouch input.

Module is now exported with global functions hidden via MODULARIZE
as global object OccViewerModule created by createOccViewerModule().
Global Module setup has been moved to occt-webgl-viewer.js.

Use EMSCRIPTEN_KEEPALIVE attribute istead of listing C functions via EXTRA_EXPORTED_RUNTIME_METHODS.
WasmOcctView now exports static methods as Module functions using EMSCRIPTEN_BINDINGS.

Standard_ASSERT_DBGBREAK_() is now defined using emscripten_debugger().
2021-01-22 19:03:14 +03:00
dpasukhi
96049f2e3d 0032049: Data Exchange - STEP file import problems
- Added checking for null objects
- Added support to find layers according to visible attr
- Fixed problem with same names of layers:
 Now, layers are grouped by names and visibility parameter
2021-01-22 13:16:22 +03:00
ifv
b007889efd 0032058: Modeling Data - Extrema curve-surface gives wrong result for planar surface of revolunion and circle
Extrema_GenExtCS.cxx : added solution refinement, if solution seems to be "bad" according to special criteria.
Extrema_FuncExtCS.cxx : "cosmetic" modifications
BOPAlgo_PaveFiller_3.cxx : adding control of shape index to prevent exception in ShapeInfo
bugs/moddata_3/bug32058 : new test
2021-01-21 20:36:28 +03:00
kgv
fe2a8faab6 0032067: Visualization, TKOpenGl - shadowmap GLSL compilation error on WebGL 3.0
Shadowmap sampler is now passed as a dedicated argument
to occDirectionalLightShadow() to workaround strict GLSL syntax validator.
Fixed texture coordinates clamping range.

Shadow antialiasing is disabled on OpenGL ES 2.0.
2021-01-20 21:30:27 +03:00
luz paz
7b5e532f83 0031939: Coding - correction of spelling errors in comments [part 7]
Fix various typos

Fixed via codespell v2.1.dev
2021-01-20 21:27:44 +03:00
kgv
5be130de06 0032064: Coding Rules - make RWGltf_GltfJsonParser non-private 2021-01-20 21:26:36 +03:00
akaftasev
5bae0bebe4 0028026: Modeling Data - BRepTools::Clean() does not clean all triangulation from shape
Added flag for force clean triangulation and treatment for it
Command "trinfo" now show number of polygons on triangulation
2021-01-20 21:25:44 +03:00
kgv
4925946065 0032061: Data Exchange, RWGltf_CafWriter - exporting XBF file produces an invalid glTF document
Empty Nodes are now skipped while filling in Scene node map.
2021-01-20 21:24:17 +03:00
kgv
78c4e836b1 0031571: Visualization, TKOpenGl - provide depth peeling OIT option
Graphic3d_RenderTransparentMethod has been extended by Graphic3d_RTM_DEPTH_PEELING_OIT,
which is handled by OpenGl_LayerList::renderTransparent().

OpenGl_FrameBuffer::Init() now does not silently ignore unknown color attachment format and return failure.
OpenGl_FrameBuffer::InitWrapper() - added constructor wrapping existing color textures.

v3d/transparency/oit: test case added
2021-01-20 21:21:59 +03:00
asuraven
9f45d35b6b 0031136: Modeling Data - BinXCAF persistence loses normals from triangulation-only Faces
Information about normals are stored in BinOCAF, XmlOCAF, BRep and BBRep (in case of triangulation-only Faces).
Versions of formats have been changed (11 for TDocStd, 4 for BRep Shape and 3 for Binary BRep Shape)
theWithNormals parameter added to BRepTools::Write()
IsWithNormals()/SetWithNormals() function added to BRepTools_ShapeSet
-normals/-noNormals option added to StoreTriangulation DRAW command
-normals/-noNormals option added to writebrep DRAW command
Tests for writing to brep/binary brep/BinXCaf/XmlXCaf added
Test for StoreTriangulation options -normals/-noNormals added
2021-01-20 21:20:43 +03:00
aavtamon
6fab0b3428 0031172: Unexpected result of BRepTools::OuterWire()
In BRepTools::OuterWire() compare of parameters was rewritten using Precision.
The test case bug31172 has been created
2021-01-15 18:52:11 +03:00
kgv
f4e7c30785 0032056: Coding Rules - remove package MMgt and other types deprecated since OCCT 7.2.0
Removed functionality deprecated since OCCT 7.1.0:
- 0027834 built-in iterator in class SelectMgr_ViewerSelector;
- 0027900 obsolete constructor of V3d_Viewer class;
- 0027816 obsolete clipping plane setters V3d_View/PrsMgr_PresentableObject:SetClipPlanes();
- 0027860 obsolete transformation persistence methods from class PrsMgr_PresentableObject;
- 0027756 obsolete methods Prs3d_Text::Draw();
- 0024393 obsolete enum Graphic3d_ZLayerSetting;
- 0025180 obsolete method Graphic3d_Structure::Transform().

Removed functionality deprecated since OCCT 7.2.0:
- 0028832 obsolete class MMgt_TShared;
- 0026937 obsolete property Standard_Failure::Caught();
- 0028799 obsolete types defined within Quantity package;
- 0028441 obsolete nested enum Image_PixMap::ImgFormat;
- 0025695 obsolete method PrsMgr_PresentationManager::Unhighlight();
- 0028205 obsolete class MeshVS_ColorHasher;
- 0027958 obsolete methods from Prs3d_DatumAspect class;
- 0025695 obsolete class Graphic3d_HighlightStyle;
- 0027954 obsolete BRepOffsetAPI_MakeOffsetShape,BRepOffsetAPI_MakeThickSolid constructors.
2021-01-14 19:38:24 +03:00
kgv
92cc34d702 0032057: Coding Rules - eliminate CLang warning -Wunused-parameter when targeting iOS
Cocoa_Window::Cocoa_Window()/OpenGl_Context::SetSwapInterval() have been corrected to suppress warning.
2021-01-14 19:37:19 +03:00
kgv
ff6122e008 0032055: Draw Harness, ViewerTest - add more vmanipulator position adjusting options
Draw::ParseOnOffIterator() - added auxiliary wrapper over Draw::ParseOnOff() for more compact syntax.
strncasecmp() definition for msvc compilers has been moved to Standard_CString for consistency with strcasecmp().
vmanipulator command has been refactored to use more straightforward parser.

vmanipulator now accepts "-adjustPosition {0|center|location|shapeLocation}" options
adjusting position to object's AABB center (existed before), object's local transformation or TopoDS_Shape location.
2021-01-14 19:21:54 +03:00
akaftasev
607f045954 0025055: Modeling Algorithms - Incorrect shape copying in BRepBuilderAPI_Copy
Correct test case: exclude "fixshape" calls
2021-01-13 17:18:49 +03:00
kgv
be8c9f2bde 0032050: Configuration - define fallback Android API version within auxiliary batch files
Script now defines a minimal Android API version when %anNdkApiLevel% is set to empty value
as 16 for 32-bit targets and 21 for 64-bit targets.
Added clearing of destination folders.
Added better handling of errors.
2021-01-13 17:10:27 +03:00
kgv
85381cfaf2 0032048: Configuration - Extend batch files to build OCCT with Emscripten
Added option USE_RAPIDJSON.
Added option toPack creating a .7z archive.
Added option toBuildSample building WebGL sample.
Improved aborting on error.
2021-01-13 17:10:27 +03:00
kgv
c0efce7c3b 0032045: Visualization, TKOpenGl - move light source functions from OpenGl_ShaderManager.cxx to Shaders 2021-01-13 17:10:27 +03:00
kgv
d84e866973 0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light source
Graphic3d_CLight::ToCastShadows() - added new property defining if light should cast shadows (ignored by Ray-Tracing).

OpenGl_ShaderManager::stdComputeLighting() now implements shadow mapping for directional lights.
OpenGl_ShaderManager::prepareGeomMainSrc() now handles copying of arrays.
OpenGl_Context::ShadowMapTexUnit() - added property defining an offset for shadow map texture units.
OpenGl_ShadowMap - added new class storing shadow map FBO with parameters.
OpenGl_View::prepareFrameBuffers() - added resizing of shadow map FBOs.
OpenGl_View::Redraw() - added section redrawing scene into shadow map FBOs via OpenGl_View::renderShadowMap() method.

vrenderparams - added new parameters -shadowMapResolution and -shadowMapBias.
2021-01-13 17:10:26 +03:00
kgv
37f80e163c 0032042: Visualization, TKOpenGl - pre-multiply headlight flag into light source position
OpenGl_ShaderManager::pushLightSourceState() now pre-multiplies headlight transformation.
Built-in shading GLSL programs have been updated to remove special handling if headlight flag;
also removed redundant pre-normalization of light source direction
(already normalized implicitly by Graphic3d_CLight interface).

Graphic3d_CLight::SetHeadlight() now raises exception in case of ambient light type.
OpenGl_ShaderManager::SetLastView() - removed unused property.
2021-01-12 16:41:38 +03:00
kgv
0f26ed5476 0032044: Foundation Classes - NCollection_Array2::Resize() does not allocate pointer array
NCollection_Array2::Resize() has been fixed to set myDeletable before calling Allocate().
2021-01-12 16:07:23 +03:00
kgv
4b52faa56f 0032036: Visualization, TKOpenGl - broken Cubemap background on GeForce 320M
Enable GL_DEPTH_CLAMP while rendering skybox to workaround unexpected clamping issue on some GPUs.
2021-01-12 13:51:20 +03:00
dpasukhi
ab80de54da 0032028: Coding Rules, StepFile - eliminate CLang warning -Wmisleading-indentation
Regenerated the StepFile/lex.step.cxx using the latest version of WinFlexBison
- Fixed [-Wmisleading-indentation] warning
- Removed empty lines
2021-01-12 13:48:44 +03:00
luz paz
54adc5e979 0031939: Coding - correction of spelling errors in comments [part 6]
Fix various typos

Fixed via `codespell v2.1.dev
2021-01-12 13:32:43 +03:00
kgv
83746de803 0032041: Modeling Data - Access violation ExchangeUV in Geom_BezierSurface
Added missing NULL-checks to Geom_BezierSurface::ExchangeUV() and Geom_BSplineSurface::ExchangeUV().
2021-01-12 13:30:35 +03:00
kgv
cfb54c0c0a 0032040: Visualization, OpenGl_View - merge OpenGl_View_Redraw.cxx into OpenGl_View.cxx 2021-01-12 13:29:22 +03:00
kgv
4b7fee8f47 0032038: Visualization, OpenGl_View - move out framebuffer initialization from ::Redraw() to ::prepareFrameBuffers() 2021-01-12 13:29:21 +03:00
kgv
f3a53980a8 0032037: Visualization - move V3d_View::FitMinMax() to Graphic3d_Camera::FitMinMax() 2021-01-12 13:29:21 +03:00
kgv
d723356fca 0032027: Visualization, Prs3d_Drawer - unable to unset HasOwnFaceBoundaryDraw() property
Added missing Unset methods to Prs3d_Drawer properties.
2020-12-29 15:22:50 +03:00
7241 changed files with 173767 additions and 143570 deletions

4
.gitattributes vendored
View File

@@ -1,6 +1,8 @@
.gitattributes eol=lf
.gitignore eol=lf
*.txt eol=lf
*.htm eol=lf
*.html eol=lf
*.h eol=lf
*.c eol=lf
*.inl eol=lf
@@ -29,6 +31,7 @@
*.xib eol=lf
*.plist eol=lf
*.java eol=lf
*.js eol=lf
*.igs eol=lf
*.iges eol=lf
*.stp eol=lf
@@ -44,6 +47,7 @@
FILES eol=lf
PACKAGES eol=lf
EXTERNLIB eol=lf
EXTERNLIB_STATIC eol=lf
UDLIST eol=lf
tests/* eol=lf
tests/*/* eol=lf

View File

@@ -91,6 +91,16 @@ if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
endif()
if (MSVC)
set (BUILD_FORCE_RelWithDebInfo OFF CACHE BOOL "${BUILD_FORCE_RelWithDebInfo_DESCR}")
else()
set (BUILD_FORCE_RelWithDebInfo OFF)
endif()
if (BUILD_FORCE_RelWithDebInfo)
set (CMAKE_CONFIGURATION_TYPES Release Debug CACHE INTERNAL "" FORCE)
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}")
@@ -364,12 +374,28 @@ if (MSVC)
endif()
# whether use optional 3rdparty or not
if (APPLE)
set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
set (USE_TK ON CACHE BOOL "${USE_TK_DESCR}")
set (USE_FREETYPE ON CACHE BOOL "${USE_FREETYPE_DESCR}")
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
set (USE_DRACO OFF CACHE BOOL "${USE_DRACO_DESCR}")
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (WIN32 OR ANDROID OR IOS OR EMSCRIPTEN)
# no Xlib
elseif (APPLE)
set (USE_XLIB OFF CACHE BOOL "${USE_XLIB_DESCR}")
else()
set (USE_XLIB ON CACHE BOOL "${USE_XLIB_DESCR}")
endif()
if (WIN32)
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
else()
set (USE_D3D OFF)
endif()
# Enable/Disable the floating point exceptions (FPE) during runtime.
@@ -383,6 +409,15 @@ else()
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0)
endif()
# OpenGL
if (ANDROID OR IOS OR EMSCRIPTEN OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_OPENGL OFF)
set (USE_GLES2 ON)
else()
set (USE_OPENGL ON CACHE BOOL "${USE_OPENGL_DESCR}")
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
# include the patched or original list of modules
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
# list <OCCT_MODULES> will contain all modules
@@ -414,10 +449,6 @@ if (NOT DEFINED BUILD_DOC_Overview)
set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
endif()
if (NOT USE_D3D)
list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
endif()
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
@@ -427,12 +458,6 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
endif()
endforeach()
# DRAWEXE excluded when library build is static
if (NOT BUILD_SHARED_LIBS)
list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
endif()
# accumulate all used toolkits
list (REMOVE_DUPLICATES BUILD_TOOLKITS)
set (RAW_BUILD_TOOLKITS)
@@ -484,35 +509,70 @@ endif()
# search for CSF variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclTkLibs CAN_USE_TK)
OCCT_IS_PRODUCT_REQUIRED (CSF_XwLibs CAN_USE_XLIB)
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE CAN_USE_FREETYPE)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_OPENGL)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlesLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
# define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# Tcl (mandatory for Draw Harness)
if (USE_TCL)
message (STATUS "Info: TCL is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
message (STATUS "Info: TK is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
endif()
# Tk (optional for Draw Harness)
if (CAN_USE_TK)
if (USE_TK)
message (STATUS "Info: TK is used by OCCT")
add_definitions (-DHAVE_TK)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_TK")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif()
if (USE_FREETYPE)
message (STATUS "Info: Freetype is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
# Xlib
if (CAN_USE_XLIB)
if (USE_XLIB)
message (STATUS "Info: Xlib is used by OCCT")
add_definitions (-DHAVE_XLIB)
if (APPLE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
endif()
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_XLIB")
endif()
# FreeType
if (CAN_USE_FREETYPE)
if (USE_FREETYPE)
message (STATUS "Info: FreeType is used by OCCT")
add_definitions (-DHAVE_FREETYPE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_FREETYPE")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
endif()
@@ -532,25 +592,8 @@ else()
endif()
endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
endif()
# GLX
if (USE_GLX)
add_definitions (-DMACOSX_USE_GLX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
endif()
# FREEIMAGE
if (CAN_USE_FREEIMAGE)
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
if (USE_FREEIMAGE)
add_definitions (-DHAVE_FREEIMAGE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
@@ -569,8 +612,6 @@ endif()
# search for CSF_OpenVR variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
if (CAN_USE_OPENVR)
set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
if (USE_OPENVR)
add_definitions (-DHAVE_OPENVR)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/openvr")
@@ -590,8 +631,6 @@ endif()
OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
if (CAN_USE_FFMPEG)
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
if (USE_FFMPEG)
add_definitions (-DHAVE_FFMPEG)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
@@ -606,23 +645,33 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
endif()
# OpenGL
if (CAN_USE_OPENGL)
if (USE_OPENGL)
add_definitions (-DHAVE_OPENGL_EXT)
else()
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGl)
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlTest)
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_OPENGL")
endif()
# OpenGL ES 2.0
if (CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_GLES2 ON)
else()
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
if (USE_GLES2)
add_definitions (-DHAVE_GLES2)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
add_definitions (-DHAVE_GLES2_EXT)
if (NOT IOS)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
endif()
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGles)
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlesTest)
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_GLES2")
@@ -633,10 +682,19 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
else()
list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHost)
list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHostTest)
endif()
# TBB
if (NOT DEFINED ANDROID AND CAN_USE_TBB)
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
if (USE_TBB)
add_definitions (-DHAVE_TBB)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
@@ -657,8 +715,6 @@ endif()
# search for CSF_RapidJSON variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON)
if (CAN_USE_RAPIDJSON)
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
if (USE_RAPIDJSON)
add_definitions (-DHAVE_RAPIDJSON)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson")
@@ -673,10 +729,26 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
endif()
# Draco library
# search for CSF_Draco variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_Draco CAN_USE_DRACO)
if (CAN_USE_DRACO)
if (USE_DRACO)
add_definitions (-DHAVE_DRACO)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/draco")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_DRACO")
OCCT_CHECK_AND_UNSET ("INSTALL_DRACO")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_DRACO")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_DRACO")
OCCT_CHECK_AND_UNSET ("INSTALL_DRACO")
endif()
# EIGEN
if (CAN_USE_EIGEN)
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (USE_EIGEN)
add_definitions (-DHAVE_EIGEN)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
@@ -1139,6 +1211,9 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
endforeach()
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
# these macros are defined for specific tookits, not globalwise
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_OPENGL)
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_GLES2)
# export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
@@ -1192,7 +1267,7 @@ if (WIN32)
set (SET_OpenCASCADE_WITH_D3D "set (OpenCASCADE_WITH_D3D ${USE_D3D})")
endif()
if (APPLE)
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_GLX})")
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_XLIB})")
endif()
# Configure and install cmake config file

View File

@@ -1,7 +1,7 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

@@ -1,4 +1,4 @@
TModelingData TKShapeView
TModelingData TKShapeView TKMessageModel TKMessageView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw TInspectorEXE

View File

@@ -11,7 +11,6 @@ n Expr
n ExprIntrp
n FSD
n GeomAbs
n MMgt
n Message
n OSD
n PLib
@@ -198,7 +197,6 @@ t TKPrim
t TKShHealing
t TKTopAlgo
t TKXMesh
n InterfaceGraphic
n AIS
n Aspect
n DsgPrs
@@ -208,6 +206,7 @@ n Image
n Media
n MeshVS
n OpenGl
n OpenGles
n D3DHost
n Prs3d
n PrsMgr
@@ -217,6 +216,7 @@ n SelectMgr
n StdPrs
n StdSelect
n V3d
n Wasm
n WNT
n Xw
n Cocoa
@@ -225,6 +225,7 @@ r Shaders
r XRResources
t TKMeshVS
t TKOpenGl
t TKOpenGles
t TKD3DHost
t TKService
t TKV3d
@@ -327,6 +328,7 @@ n RWStepDimTol
n RWStepElement
n RWStepFEA
n RWStepGeom
n RWStepKinematics
n RWStepRepr
n RWStepShape
n RWStepVisual
@@ -346,6 +348,7 @@ n StepDimTol
n StepElement
n StepFEA
n StepGeom
n StepKinematics
n StepRepr
n StepSelect
n StepShape
@@ -403,6 +406,9 @@ n HLRTest
n MeshTest
n SWDRAW
n TObjDRAW
n OpenGlTest
n OpenGlesTest
n D3DHostTest
n ViewerTest
n XDEDRAW
n XSDRAW
@@ -414,6 +420,9 @@ t TKDCAF
t TKDraw
t TKTObjDRAW
t TKTopTest
t TKOpenGlTest
t TKOpenGlesTest
t TKD3DHostTest
t TKViewerTest
t TKXDEDRAW
t TKXSDRAW

View File

@@ -3017,7 +3017,7 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
endif()
else()
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# depend on the original target's implicity generated <targetname>_automoc target
# depend on the original target's implicitly generated <targetname>_automoc target
if (CMAKE_VERSION VERSION_LESS "3.8.0")
add_dependencies(${_unityTargetName} ${_target}_automoc)
else()

4
adm/cmake/draco.cmake Normal file
View File

@@ -0,0 +1,4 @@
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
# https://github.com/google/draco
THIRDPARTY_PRODUCT("DRACO" "draco/compression/decode.h" "CSF_Draco" "")

View File

@@ -1,3 +1,3 @@
# EGL
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlLibs" "")
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlesLibs" "")

View File

@@ -191,13 +191,13 @@ foreach (LIBRARY_NAME ${CSF_FFmpeg})
else()
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}i")
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_ABS ${3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME}} REALPATH)

View File

@@ -1,3 +1,3 @@
# OpenGL ES 2.0
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlLibs" "")
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlesLibs" "")

View File

@@ -49,22 +49,39 @@ else()
set (CSF_OpenVR)
endif()
# TCL/TK
# TCL
if (USE_TCL)
if (WIN32)
set (CSF_TclLibs "tcl86")
else()
if(APPLE)
set (CSF_TclLibs Tcl)
elseif(UNIX)
set (CSF_TclLibs "tcl8.6")
endif()
endif()
endif()
# TK
if (USE_TK)
if (WIN32)
set (CSF_TclTkLibs "tk86")
else()
if(APPLE)
set (CSF_TclTkLibs Tk)
set (CSF_TclLibs Tcl)
elseif(UNIX)
set (CSF_TclLibs "tcl8.6")
set (CSF_TclTkLibs "tk8.6")
set (CSF_TclTkLibs "tk8.6")
endif()
endif()
endif()
# Draco
if (USE_DRACO)
set (CSF_Draco "draco")
else()
set (CSF_Draco)
endif()
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")
@@ -74,12 +91,8 @@ if (WIN32)
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")
else()
set (CSF_OpenGlLibs "opengl32.lib")
endif()
set (CSF_OpenGlLibs "opengl32.lib")
set (CSF_OpenGlesLibs "libEGL libGLESv2")
else()
if (APPLE)
@@ -100,31 +113,38 @@ else()
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (IOS)
find_library (OpenGlLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
elseif (USE_GLX)
set (CSF_OpenGlLibs GL)
set (CSF_XwLibs "X11 Xext Xmu Xi")
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
elseif (USE_XLIB)
set (CSF_OpenGlLibs "GL")
set (CSF_XwLibs "X11")
else()
find_library (OpenGlLibs_LIB NAMES OpenGL)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
elseif (EMSCRIPTEN)
set (CSF_ThreadLibs "pthread rt stdc++")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_dl "dl")
elseif (ANDROID)
set (CSF_ThreadLibs "c")
set (CSF_OpenGlLibs "EGL GLESv2")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_androidlog "log")
elseif (UNIX)
set (CSF_ThreadLibs "pthread rt stdc++")
if (USE_GLES2)
set (CSF_OpenGlLibs "EGL GLESv2")
if (USE_XLIB)
set (CSF_OpenGlLibs "GL")
set (CSF_XwLibs "X11")
else()
set (CSF_OpenGlLibs "GL")
set (CSF_OpenGlLibs "GL EGL")
endif()
set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_dl "dl")
set (CSF_fontconfig "fontconfig")
if (USE_FREETYPE)
set (CSF_fontconfig "fontconfig")
endif()
endif()
endif()

View File

@@ -40,6 +40,19 @@ elseif (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
endif()
if (MSVC)
# string pooling (GF), function-level linking (Gy)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GF /Gy")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GF /Gy")
if (BUILD_FORCE_RelWithDebInfo)
# generate debug info (Zi), inline expansion level (Ob1)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /Ob1")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /Ob1")
# generate debug info (debug), OptimizeReferences=true (OPT:REF), EnableCOMDATFolding=true (OPT:ICF)
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /debug /OPT:REF /OPT:ICF")
endif()
endif()
# remove _WINDOWS flag if it exists
string (REGEX MATCH "/D_WINDOWS" IS_WINDOWSFLAG "${CMAKE_CXX_FLAGS}")
if (IS_WINDOWSFLAG)
@@ -123,7 +136,9 @@ if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
elseif(MINGW)
add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
#set (CMAKE_SYSTEM_VERSION "6.1")
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")

View File

@@ -22,7 +22,7 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS")
endif()
# parce PACKAGES file
# parse PACKAGES file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME})
@@ -39,7 +39,7 @@ set (PRECOMPILED_DEFS)
if (NOT BUILD_SHARED_LIBS)
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
if (WIN32)
if (WIN32 AND NOT EXECUTABLE_PROJECT)
list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD")
endif()
endif()
@@ -228,12 +228,21 @@ if (EXECUTABLE_PROJECT)
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
if (EMSCRIPTEN)
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
endif()
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (MSVC)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
set (aReleasePdbConf)
endif()
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug RelWithDebInfo
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
endif()
@@ -283,8 +292,12 @@ endif()
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
# parce EXTERNLIB file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
# parse EXTERNLIB file
if (CUSTOM_EXTERNLIB)
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
else()
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
endif()
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (NOT COMMENT_FOUND)
@@ -303,6 +316,13 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
add_definitions (-DHAVE_GLES2)
endif()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})
@@ -344,7 +364,7 @@ endforeach()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)
find_package (X11 COMPONENTS X11 Xext Xmu Xi)
find_package (X11 COMPONENTS X11)
if (NOT X11_FOUND)
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
endif()
@@ -376,7 +396,7 @@ else()
endif()
endif()
if (BUILD_SHARED_LIBS)
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()

View File

@@ -1,6 +1,6 @@
# tcl
if (NOT DEFINED INSTALL_TCL AND BUILD_SHARED_LIBS)
if (NOT DEFINED INSTALL_TCL)
set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
endif()
@@ -14,30 +14,30 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
endif()
if (BUILD_SHARED_LIBS)
# tcl library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
endif()
# tcl library directory
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
endif()
# tcl library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
endif()
# tcl shared library (with absolute path)
if (WIN32)
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
endif()
endif()
# tcl library directory
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
endif()
# tcl shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
# tcl shared library (with absolute path)
if (WIN32)
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
endif()
endif()
# tcl shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
endif()
# search for tcl in user defined directory
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
@@ -64,204 +64,198 @@ if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
endif()
endif()
if (BUILD_SHARED_LIBS)
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
elseif (3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
elseif (3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
endif()
endif()
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
if (BUILD_SHARED_LIBS)
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
NO_DEFAULT_PATH)
# search in another place if previous search doesn't find anything
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_DIR}/lib"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
endif()
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION "")
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
message (STATUS "Info: TCL version isn't found")
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
if (3RDPARTY_TCL_LIBRARY_VERSION)
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
else()
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
endif()
endif()
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
endif()
# search in another place if previous search doesn't find anything
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_DIR}/lib"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
endif()
# include found paths to common variables
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY_VERSION "")
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
message (STATUS "Info: TCL version isn't found")
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
if (3RDPARTY_TCL_LIBRARY_VERSION)
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
else()
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
endif()
endif()
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
endif()
endif()
# include found paths to common variables
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
endif()
if (WIN32)
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
endif()
endif()
# install tcl
if (INSTALL_TCL)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
# collect and install all dlls from tcl dll dirs
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
if (SINGLE_GENERATOR)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
install (FILES ${TCL_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
endif()
# install tcl
if (INSTALL_TCL)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
# collect and install all dlls from tcl dll dirs
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
if (SINGLE_GENERATOR)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${TCL_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()
if (TCL_TCLSH_VERSION)
# tcl is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tclX.X subdir won't be copied during the installation process.")
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
endif()
set (USED_3RDPARTY_TCL_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
if (TCL_TCLSH_VERSION)
# tcl is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tclX.X subdir won't be copied during the installation process.")
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
endif()
set (USED_3RDPARTY_TCL_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
else()
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
endif()
endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
if (TK_FOUND AND 3RDPARTY_TCL_DIR)
get_filename_component (TK_WISH_ABSOLUTE "${TK_WISH}" ABSOLUTE)
@@ -285,10 +279,3 @@ OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH)
if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY_DIR)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL_DIR)
OCCT_CHECK_AND_UNSET (INSTALL_TCL)
endif()

View File

@@ -38,6 +38,9 @@ set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
Corresponding environment variable (CSF_FPE) can be changed manually
in custom.bat/sh scripts without regeneration by CMake.")
set (BUILD_FORCE_RelWithDebInfo_DESCR
"Generate PDB files within normal Release build.")
set (BUILD_USE_PCH_DESCR
"Use precompiled headers to accelerate the build.
Precompiled headers are generated automatically by Cotire tool.")
@@ -155,12 +158,18 @@ set (3RDPARTY_DIR_DESCR
third-party product have been found - corresponding CMake variables will be specified
(VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
set (USE_TK_DESCR
"Indicates whether Tk product should be used by Draw Harness for user interface")
set (USE_FREETYPE_DESCR
"Indicates whether FreeType product should be used in OCCT for text rendering using external font files")
set (USE_FFMPEG_DESCR
"Indicates whether FFmpeg framework is used or not. FFmpeg stands for
multimedia data handling, open-source software libraries used for video encoding and decoding.")
set (USE_FREEIMAGE_DESCR
"Indicates whether Freeimage product should be used in OCCT visualization
"Indicates whether FreeImage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)")
set (USE_OPENVR_DESCR
@@ -170,13 +179,17 @@ set (USE_RAPIDJSON_DESCR
"Indicates whether RapidJSON product should be used in OCCT DataExchange
module for support of JSON-based formats like glTF")
set (USE_DRACO_DESCR
"Indicates whether Draco mesh decoding library should be used by glTF reader")
set (USE_EGL_DESCR
"Indicates whether EGL should be used in OCCT visualization
module instead of conventional OpenGL context creation APIs")
set (USE_OPENGL_DESCR
"Indicates whether OpenGL desktop should be used in OCCT visualization module")
set (USE_GLES2_DESCR
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
module instead of desktop OpenGL")
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization module")
set (USE_TBB_DESCR
"Indicates whether TBB is used or not. TBB stands for Threading Building Blocks,
@@ -189,7 +202,7 @@ ToolKit, the technology of Kitware Inc intended for general-purpose scientific
visualization. OCCT comes with a bridge between CAD data representation and
VTK by means of its dedicated VIS component (VTK Integration Services).")
set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")

View File

@@ -56,36 +56,52 @@ lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set ::CONFIG "Release"
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
# detect installed Visual Studio 2017+ instances by running vswhere.exe
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143)"
lappend ::SYS_VC_LIST "vc143"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143) UWP"
lappend ::SYS_VC_LIST "vc143-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
@@ -138,6 +154,13 @@ proc wokdep:gui:Close {} {
exit
}
proc wokdep:gui:configSuffix {} {
if { "$::CONFIG" == "Debug" } {
return "D"
}
return ""
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
@@ -148,16 +171,15 @@ proc wokdep:gui:SwitchConfig {} {
set ::CSF_OPT_LIB64 {}
set ::CSF_OPT_BIN32 {}
set ::CSF_OPT_BIN64 {}
set ::CSF_OPT_LIB32D {}
set ::CSF_OPT_LIB64D {}
set ::CSF_OPT_BIN32D {}
set ::CSF_OPT_BIN64D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:SwitchArch {} {
if { "$::ARCH" == "32" } {
wokdep:gui:Show32Bitness ::aRowIter
}
if { "$::ARCH" == "64" } {
wokdep:gui:Show64Bitness ::aRowIter
}
wokdep:gui:Show3264Bitness ::aRowIter
if { [llength [grid info .myFrame.mySave]] != 0 } {
grid forget .myFrame.mySave .myFrame.myClose
@@ -168,6 +190,16 @@ proc wokdep:gui:SwitchArch {} {
grid .myFrame.myClose -row $::aRowIter -column 6 -columnspan 2
}
# update label text and visibility
font create wokdep:gui:EmptyFont -size -1
proc wokdep:gui:SetLabelText {theLabel theText} {
set aFont TkDefaultFont
if { $theText == "" } {
set aFont wokdep:gui:EmptyFont
}
$theLabel configure -text $theText -font $aFont
}
proc wokdep:gui:UpdateList {} {
set anIncErrs {}
set anLib32Errs {}
@@ -175,7 +207,9 @@ proc wokdep:gui:UpdateList {} {
set anBin32Errs {}
set anBin64Errs {}
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_FREETYPE" == "true" } {
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_GLES2" == "true" } {
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
@@ -225,6 +259,10 @@ proc wokdep:gui:UpdateList {} {
if { "$::HAVE_RAPIDJSON" == "true" } {
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_DRACO" == "true" } {
set aDummy {}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs aDummy aDummy "draco" "draco/compression/decode.h" "draco" {"draco"}
}
if {"$::BUILD_Inspector" == "true" } {
set ::CHECK_QT "true"
@@ -238,11 +276,28 @@ proc wokdep:gui:UpdateList {} {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
.myFrame.myIncErrLbl configure -text [join $anIncErrs "\n"]
.myFrame.myLib32ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64ErrLbl configure -text [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64_ErrLbl [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32D_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64D_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32D_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64D_ErrLbl [join $anBin64Errs "\n"]
# merge duplicates
set ::CSF_OPT_LIB32 [lsort -unique $::CSF_OPT_LIB32]
set ::CSF_OPT_LIB64 [lsort -unique $::CSF_OPT_LIB64]
set ::CSF_OPT_BIN32 [lsort -unique $::CSF_OPT_BIN32]
set ::CSF_OPT_BIN64 [lsort -unique $::CSF_OPT_BIN64]
set ::CSF_OPT_LIB32D [lsort -unique $::CSF_OPT_LIB32D]
set ::CSF_OPT_LIB64D [lsort -unique $::CSF_OPT_LIB64D]
set ::CSF_OPT_BIN32D [lsort -unique $::CSF_OPT_BIN32D]
set ::CSF_OPT_BIN64D [lsort -unique $::CSF_OPT_BIN64D]
}
proc wokdep:gui:BrowseVcVars {} {
@@ -268,34 +323,20 @@ proc wokdep:gui:AddIncPath {} {
}
}
proc wokdep:gui:AddLib32Path {} {
proc wokdep:gui:AddLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB32 "$aResult"
lappend ::CSF_OPT_LIB${::ARCH}${aCfg} "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddLib64Path {} {
proc wokdep:gui:AddBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB64 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBin32Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN32 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBin64Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN64 "$aResult"
lappend ::CSF_OPT_BIN${::ARCH}${aCfg} "$aResult"
wokdep:gui:UpdateList
}
}
@@ -308,34 +349,20 @@ proc wokdep:gui:RemoveIncPath {} {
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveLib32Path {} {
set aSelIndices [.myFrame.myLib32List curselection]
proc wokdep:gui:RemoveLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myLib${::ARCH}${aCfg}_List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib32List delete [lindex $aSelIndices 0]
.myFrame.myLib${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveLib64Path {} {
set aSelIndices [.myFrame.myLib64List curselection]
proc wokdep:gui:RemoveBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myBin${::ARCH}${aCfg}_List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib64List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBin32Path {} {
set aSelIndices [.myFrame.myBin32List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin32List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBin64Path {} {
set aSelIndices [.myFrame.myBin64List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin64List delete [lindex $aSelIndices 0]
.myFrame.myBin${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
@@ -345,109 +372,73 @@ proc wokdep:gui:ResetIncPath {} {
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLib32Path {} {
set ::CSF_OPT_LIB32 {}
proc wokdep:gui:ResetLibPath {} {
set ::CSF_OPT_LIB${::ARCH} {}
set ::CSF_OPT_LIB${::ARCH}D {}
set ::CSF_OPT_BIN${::ARCH} {}
set ::CSF_OPT_BIN${::ARCH}D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLib64Path {} {
set ::CSF_OPT_LIB64 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetBin32Path {} {
set ::CSF_OPT_BIN32 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetBin64Path {} {
set ::CSF_OPT_BIN64 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:Show32Bitness { theRowIter } {
proc wokdep:gui:Show3264Bitness { theRowIter } {
upvar $theRowIter aRowIter
if { [llength [grid info .myFrame.myLib64Lbl]] != 0 } {
grid forget .myFrame.myLib64Lbl .myFrame.myLib64List .myFrame.myLib64Scrl
grid forget .myFrame.myLib64Add .myFrame.myLib64Remove .myFrame.myLib64Clear .myFrame.myLib64ErrLbl
grid forget .myFrame.myBin64Lbl .myFrame.myBin64List .myFrame.myBin64Scrl
grid forget .myFrame.myBin64Add .myFrame.myBin64Remove .myFrame.myBin64Clear .myFrame.myBin64ErrLbl
set aArchOld ""
set aCfg [wokdep:gui:configSuffix]
if { "$::ARCH" == "32" } {
set aArchOld "64"
} else {
set aArchOld "32"
}
# Additional libraries (32-bit) search paths
grid .myFrame.myLib32Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib32List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib32Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib32Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib32Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib32Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib32Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables (32-bit) search paths
grid .myFrame.myBin32Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin32List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin32Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin32Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin32Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin32Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin32Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
proc wokdep:gui:Show64Bitness { theRowIter } {
upvar $theRowIter aRowIter
if { [llength [grid info .myFrame.myLib32Lbl]] != 0 } {
grid forget .myFrame.myLib32Lbl .myFrame.myLib32List .myFrame.myLib32Scrl
grid forget .myFrame.myLib32Add .myFrame.myLib32Remove .myFrame.myLib32Clear .myFrame.myLib32ErrLbl
grid forget .myFrame.myBin32Lbl .myFrame.myBin32List .myFrame.myBin32Scrl
grid forget .myFrame.myBin32Add .myFrame.myBin32Remove .myFrame.myBin32Clear .myFrame.myBin32ErrLbl
set aCfgOld "D"
if { "$::CONFIG" == "Debug" } { set aCfgOld "" }
set aDelArch ${aArchOld}${aCfg}
if { [llength [grid info .myFrame.myLib${aDelArch}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelArch}_Lbl .myFrame.myLib${aDelArch}_List .myFrame.myLib${aDelArch}_Scrl
grid forget .myFrame.myLib${aDelArch}_Add .myFrame.myLib${aDelArch}_Remove .myFrame.myLib${aDelArch}_Clear .myFrame.myLib${aDelArch}_ErrLbl
grid forget .myFrame.myBin${aDelArch}_Lbl .myFrame.myBin${aDelArch}_List .myFrame.myBin${aDelArch}_Scrl
grid forget .myFrame.myBin${aDelArch}_Add .myFrame.myBin${aDelArch}_Remove .myFrame.myBin${aDelArch}_Clear .myFrame.myBin${aDelArch}_ErrLbl
}
set aDelCfg ${::ARCH}${aCfgOld}
if { [llength [grid info .myFrame.myLib${aDelCfg}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelCfg}_Lbl .myFrame.myLib${aDelCfg}_List .myFrame.myLib${aDelCfg}_Scrl
grid forget .myFrame.myLib${aDelCfg}_Add .myFrame.myLib${aDelCfg}_Remove .myFrame.myLib${aDelCfg}_Clear .myFrame.myLib${aDelCfg}_ErrLbl
grid forget .myFrame.myBin${aDelCfg}_Lbl .myFrame.myBin${aDelCfg}_List .myFrame.myBin${aDelCfg}_Scrl
grid forget .myFrame.myBin${aDelCfg}_Add .myFrame.myBin${aDelCfg}_Remove .myFrame.myBin${aDelCfg}_Clear .myFrame.myBin${aDelCfg}_ErrLbl
}
# Additional libraries (64-bit) search paths
grid .myFrame.myLib64Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
set aNewCfg ${::ARCH}${aCfg}
# Additional libraries search paths
grid .myFrame.myLib${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib64List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib64Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib64Add -row $aRowIter -column 6
grid .myFrame.myLib${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib${aNewCfg}_Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib64Edit -row $aRowIter -column 6
#grid .myFrame.myLib${aNewCfg}_Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64Remove -row $aRowIter -column 6
grid .myFrame.myLib${aNewCfg}_Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64Clear -row $aRowIter -column 6
grid .myFrame.myLib${aNewCfg}_Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myLib${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables (64-bit) search paths
grid .myFrame.myBin64Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
# Additional executables search paths
grid .myFrame.myBin${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin64List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin64Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin64Add -row $aRowIter -column 6
grid .myFrame.myBin${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin${aNewCfg}_Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin64Edit -row $aRowIter -column 6
#grid .myFrame.myBin${aNewCfg}_Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64Remove -row $aRowIter -column 6
grid .myFrame.myBin${aNewCfg}_Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64Clear -row $aRowIter -column 6
grid .myFrame.myBin${aNewCfg}_Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myBin${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
@@ -457,6 +448,7 @@ ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state
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
ttk::combobox .myFrame.myVsFrame.myConfigCombo -values { {Release} {Debug} } -textvariable CONFIG -state readonly -width 6
entry .myFrame.myVcEntry -textvariable VCVER -width 10
entry .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
ttk::button .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
@@ -471,6 +463,8 @@ ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling he
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
checkbutton .myFrame.myChecks.myFreeTypeCheck -offvalue "false" -onvalue "true" -variable HAVE_FREETYPE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFreeTypeLbl -text "Use FreeType"
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
@@ -491,9 +485,11 @@ ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
checkbutton .myFrame.myChecks.myDracoCheck -offvalue "false" -onvalue "true" -variable HAVE_DRACO -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myDracoLbl -text "Use Draco"
checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing"
checkbutton .myFrame.myChecks.myXLibCheck -offvalue "false" -onvalue "true" -variable HAVE_XLIB
ttk::label .myFrame.myChecks.myXLibLbl -text "Use X11 for windows drawing"
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
checkbutton .myFrame.myChecks.myVtkCheck -offvalue "false" -onvalue "true" -variable HAVE_VTK -command wokdep:gui:UpdateList
@@ -525,44 +521,84 @@ ttk::button .myFrame.myIncClear -text "Reset" -command wokdep:gui:ResetIncP
ttk::label .myFrame.myIncErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (32-bit) search paths
ttk::label .myFrame.myLib32Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32Scrl -command ".myFrame.myLib32List yview"
listbox .myFrame.myLib32List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32Scrl set"
ttk::button .myFrame.myLib32Add -text "Add" -command wokdep:gui:AddLib32Path
ttk::button .myFrame.myLib32Edit -text "Edit"
ttk::button .myFrame.myLib32Remove -text "Remove" -command wokdep:gui:RemoveLib32Path
ttk::button .myFrame.myLib32Clear -text "Reset" -command wokdep:gui:ResetLib32Path
ttk::label .myFrame.myLib32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myLib32_Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32_Scrl -command ".myFrame.myLib32_List yview"
listbox .myFrame.myLib32_List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32_Scrl set"
ttk::button .myFrame.myLib32_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32_Edit -text "Edit"
ttk::button .myFrame.myLib32_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (32-bit) search paths
ttk::label .myFrame.myLib32D_Lbl -text "Additional debug libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32D_Scrl -command ".myFrame.myLib32D_List yview"
listbox .myFrame.myLib32D_List -listvariable CSF_OPT_LIB32D -width 80 -height 5 -yscrollcommand ".myFrame.myLib32D_Scrl set"
ttk::button .myFrame.myLib32D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32D_Edit -text "Edit"
ttk::button .myFrame.myLib32D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (64-bit) search paths
ttk::label .myFrame.myLib64Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64Scrl -command ".myFrame.myLib64List yview"
listbox .myFrame.myLib64List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64Scrl set"
ttk::button .myFrame.myLib64Add -text "Add" -command wokdep:gui:AddLib64Path
ttk::button .myFrame.myLib64Edit -text "Edit"
ttk::button .myFrame.myLib64Remove -text "Remove" -command wokdep:gui:RemoveLib64Path
ttk::button .myFrame.myLib64Clear -text "Reset" -command wokdep:gui:ResetLib64Path
ttk::label .myFrame.myLib64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myLib64_Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64_Scrl -command ".myFrame.myLib64_List yview"
listbox .myFrame.myLib64_List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64_Scrl set"
ttk::button .myFrame.myLib64_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64_Edit -text "Edit"
ttk::button .myFrame.myLib64_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (64-bit) search paths
ttk::label .myFrame.myLib64D_Lbl -text "Additional debug libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64D_Scrl -command ".myFrame.myLib64D_List yview"
listbox .myFrame.myLib64D_List -listvariable CSF_OPT_LIB64D -width 80 -height 5 -yscrollcommand ".myFrame.myLib64D_Scrl set"
ttk::button .myFrame.myLib64D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64D_Edit -text "Edit"
ttk::button .myFrame.myLib64D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (32-bit) search paths
ttk::label .myFrame.myBin32Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32Scrl -command ".myFrame.myBin32List yview"
listbox .myFrame.myBin32List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32Scrl set"
ttk::button .myFrame.myBin32Add -text "Add" -command wokdep:gui:AddBin32Path
ttk::button .myFrame.myBin32Edit -text "Edit"
ttk::button .myFrame.myBin32Remove -text "Remove" -command wokdep:gui:RemoveBin32Path
ttk::button .myFrame.myBin32Clear -text "Reset" -command wokdep:gui:ResetBin32Path
ttk::label .myFrame.myBin32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myBin32_Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32_Scrl -command ".myFrame.myBin32_List yview"
listbox .myFrame.myBin32_List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32_Scrl set"
ttk::button .myFrame.myBin32_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32_Edit -text "Edit"
ttk::button .myFrame.myBin32_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (32-bit) search paths
ttk::label .myFrame.myBin32D_Lbl -text "Additional debug executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32D_Scrl -command ".myFrame.myBin32D_List yview"
listbox .myFrame.myBin32D_List -listvariable CSF_OPT_BIN32D -width 80 -height 5 -yscrollcommand ".myFrame.myBin32D_Scrl set"
ttk::button .myFrame.myBin32D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32D_Edit -text "Edit"
ttk::button .myFrame.myBin32D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (64-bit) search paths
ttk::label .myFrame.myBin64Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64Scrl -command ".myFrame.myBin64List yview"
listbox .myFrame.myBin64List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64Scrl set"
ttk::button .myFrame.myBin64Add -text "Add" -command wokdep:gui:AddBin64Path
ttk::button .myFrame.myBin64Edit -text "Edit"
ttk::button .myFrame.myBin64Remove -text "Remove" -command wokdep:gui:RemoveBin64Path
ttk::button .myFrame.myBin64Clear -text "Reset" -command wokdep:gui:ResetBin64Path
ttk::label .myFrame.myBin64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myBin64_Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64_Scrl -command ".myFrame.myBin64_List yview"
listbox .myFrame.myBin64_List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64_Scrl set"
ttk::button .myFrame.myBin64_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64_Edit -text "Edit"
ttk::button .myFrame.myBin64_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (64-bit) search paths
ttk::label .myFrame.myBin64D_Lbl -text "Additional debug executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64D_Scrl -command ".myFrame.myBin64D_List yview"
listbox .myFrame.myBin64D_List -listvariable CSF_OPT_BIN64D -width 80 -height 5 -yscrollcommand ".myFrame.myBin64D_Scrl set"
ttk::button .myFrame.myBin64D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64D_Edit -text "Edit"
ttk::button .myFrame.myBin64D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Bottom
ttk::button .myFrame.mySave -text "Save" -command wokdep:SaveCustom
@@ -573,17 +609,22 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
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" } {
incr aRowIter
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
grid .myFrame.myVsFrame.myVsCombo -row 0 -column 1 -padx 5
grid .myFrame.myVsFrame.myArchCombo -row 0 -column 2
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 3
incr aRowIter
grid .myFrame.myVcEntry -row $aRowIter -column 0
grid .myFrame.myVcVarsEntry -row $aRowIter -column 1 -columnspan 4 -sticky w
grid .myFrame.myVcBrowseBtn -row $aRowIter -column 6
incr aRowIter
} else {
grid .myFrame.myVsFrame -row $aRowIter -column 4 -sticky w
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 0
incr aRowIter
}
#
@@ -604,10 +645,10 @@ incr aRowIter
grid .myFrame.myChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myFreeTypeCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFreeTypeLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 5 -sticky w
@@ -621,16 +662,17 @@ grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myDracoCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myDracoLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
} elseif { "$::tcl_platform(os)" == "Darwin" } {
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 5 -sticky w
} else {
grid .myFrame.myChecks.myXLibCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myXLibLbl -row $aCheckRowIter -column 5 -sticky w
}
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
@@ -638,8 +680,10 @@ grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myOpenVrCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myOpenVrLbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
@@ -652,6 +696,11 @@ if { "$::tcl_platform(platform)" == "windows" } {
incr aCheckRowIter
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
# Additional headers search paths
grid .myFrame.myIncLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
@@ -668,15 +717,8 @@ incr aRowIter
grid .myFrame.myIncErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional 32-bit search paths
if { "$ARCH" == "32" } {
wokdep:gui:Show32Bitness aRowIter
}
# Additional 64-bit search paths
if { "$ARCH" == "64" } {
wokdep:gui:Show64Bitness aRowIter
}
# Additional search paths
wokdep:gui:Show3264Bitness aRowIter
# Bottom section
grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
@@ -692,6 +734,9 @@ bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
bind .myFrame.myVsFrame.myConfigCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
.myFrame.mySrchEntry configure -validate all -validatecommand {
set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]

View File

@@ -52,6 +52,10 @@ set CSF_OPT_LIB32 [list]
set CSF_OPT_LIB64 [list]
set CSF_OPT_BIN32 [list]
set CSF_OPT_BIN64 [list]
set CSF_OPT_LIB32D [list]
set CSF_OPT_LIB64D [list]
set CSF_OPT_BIN32D [list]
set CSF_OPT_BIN64D [list]
if { "$tcl_platform(pointerSize)" == "4" } {
set ARCH "32"
@@ -68,9 +72,15 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
}
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENVR HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo BUILD_Inspector}
set THE_ENV_VARIABLES { HAVE_TK HAVE_FREETYPE HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK \
HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_DRACO HAVE_OPENVR HAVE_OPENCL \
CHECK_QT4 CHECK_JDK HAVE_XLIB \
HAVE_RelWithDebInfo BUILD_Inspector }
foreach anEnvIter $THE_ENV_VARIABLES { set ${anEnvIter} "false" }
set HAVE_TK "true"
set HAVE_FREETYPE "true"
if { "$tcl_platform(os)" != "Darwin" } { set HAVE_XLIB "true" }
foreach anEnvIter $THE_ENV_VARIABLES {
set ${anEnvIter} "false"
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
@@ -78,12 +88,12 @@ foreach anEnvIter $THE_ENV_VARIABLES {
# do not export platform-specific variables
if { "$::tcl_platform(os)" == "Darwin" } {
set HAVE_GLES2 ""
} else {
set MACOSX_USE_GLX ""
}
if { "$tcl_platform(platform)" != "windows" } {
set HAVE_D3D ""
set HAVE_RelWithDebInfo ""
} else {
set HAVE_XLIB ""
}
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT } {
if { [info exists ::env(${anEnvIter})] } {
@@ -110,6 +120,35 @@ if { [info exists ::env(CSF_OPT_BIN64)] } {
set CSF_OPT_BIN64 [split "$::env(CSF_OPT_BIN64)" $::SYS_PATH_SPLITTER]
}
if { [info exists ::env(CSF_OPT_LIB32D)] } {
set CSF_OPT_LIB32D [split "$::env(CSF_OPT_LIB32D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_LIB32 {
set aPos [lsearch -exact $::CSF_OPT_LIB32D $aLibIter]
set ::CSF_OPT_LIB32D [lreplace $::CSF_OPT_LIB32D $aPos $aPos]
}
}
if { [info exists ::env(CSF_OPT_LIB64D)] } {
set CSF_OPT_LIB64D [split "$::env(CSF_OPT_LIB64D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_LIB64 {
set aPos [lsearch -exact $::CSF_OPT_LIB64D $aLibIter]
set ::CSF_OPT_LIB64D [lreplace $::CSF_OPT_LIB64D $aPos $aPos]
}
}
if { [info exists ::env(CSF_OPT_BIN32D)] } {
set CSF_OPT_BIN32D [split "$::env(CSF_OPT_BIN32D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_BIN32 {
set aPos [lsearch -exact $::CSF_OPT_BIN32D $aLibIter]
set ::CSF_OPT_BIN32D [lreplace $::CSF_OPT_BIN32D $aPos $aPos]
}
}
if { [info exists ::env(CSF_OPT_BIN64D)] } {
set CSF_OPT_BIN64D [split "$::env(CSF_OPT_BIN64D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_BIN64 {
set aPos [lsearch -exact $::CSF_OPT_BIN64D $aLibIter]
set ::CSF_OPT_BIN64D [lreplace $::CSF_OPT_BIN64D $aPos $aPos]
}
}
# Search header file in $::CSF_OPT_INC and standard paths
proc wokdep:SearchHeader {theHeader} {
# search in custom paths
@@ -310,6 +349,12 @@ proc wokdep:SearchStandardLibrary {theErrInc theErrLib32 theErrLib64 theErrBin32
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
set hasLib true
set aLibDPath [wokdep:SearchLib "$theCheckLib" "$anArchIter" "$aPath/libd"]
if { "$aLibDPath" != "" } {
lappend ::CSF_OPT_LIB${anArchIter}D "$aPath/libd"
lappend ::CSF_OPT_BIN${anArchIter}D "$aPath/bind"
}
break
}
}
@@ -1041,36 +1086,45 @@ proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
}
}
}
}
# Search binary path
if { "$::tcl_platform(platform)" == "windows" } {
foreach anArchIter {64 32} {
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
if { "$aVtkBinPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*] "$::VCVER" "$anArchIter" ]
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
if { "$aVtkBinPath" == "" } {
set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
# Try to find in lib path
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
} else {
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib" }
# We didn't find preferred binary path => search through all available VTK directories
foreach anIt $aPathList {
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$anIt/bin"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$anIt/bin"
break
} else {
# Try to find in lib path
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$anIt/lib"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$anIt/lib"
}
}
}
if { "$aVtkBinPath" == "" } {
lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
set isFound "false"
}
}
}
}
# We didn't find preferred binary path => search through inc path or among all available VTK directories
if { "$aVtkBinPath" == "" } {
# Try to find in lib path
set aPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/bin"]
if { "$aPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/bin"
} elseif { [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/lib"] != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/lib"
} else {
lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
set isFound "false"
}
}
}
}
return "$isFound"
}
@@ -1193,7 +1247,7 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
upvar $theErrBin64 anErrBin64
set isFound "true"
if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" ) } {
if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::HAVE_XLIB" != "true" ) } {
return "$isFound"
}
@@ -1272,6 +1326,18 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional libraries (32-bit) search paths"
puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
set aStringLib32d [join $::CSF_OPT_LIB32D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib32d [regsub -all "$::PRODUCTS_PATH" $aStringLib32d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug libraries (32-bit) search paths"
if { "$aStringLib32d" != "" && "$aStringLib32" != "" } {
puts $aFile "set \"CSF_OPT_LIB32D=$aStringLib32d;%CSF_OPT_LIB32%\""
} else {
puts $aFile "set \"CSF_OPT_LIB32D=$aStringLib32d\""
}
set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib64 [regsub -all "$::PRODUCTS_PATH" $aStringLib64 "%PRODUCTS_PATH%"]
@@ -1280,6 +1346,18 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional libraries (64-bit) search paths"
puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
set aStringLib64d [join $::CSF_OPT_LIB64D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib64d [regsub -all "$::PRODUCTS_PATH" $aStringLib64d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug libraries (64-bit) search paths"
if { "$aStringLib64d" != "" && "$aStringLib64" != "" } {
puts $aFile "set \"CSF_OPT_LIB64D=$aStringLib64d;%CSF_OPT_LIB64%\""
} else {
puts $aFile "set \"CSF_OPT_LIB64D=$aStringLib64d\""
}
set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin32 [regsub -all "$::PRODUCTS_PATH" $aStringBin32 "%PRODUCTS_PATH%"]
@@ -1288,6 +1366,18 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional (32-bit) search paths"
puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
set aStringBin32d [join $::CSF_OPT_BIN32D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin32d [regsub -all "$::PRODUCTS_PATH" $aStringBin32d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug (32-bit) search paths"
if { "$aStringBin32d" != "" && "$aStringBin32" != "" } {
puts $aFile "set \"CSF_OPT_BIN32D=$aStringBin32d;%CSF_OPT_BIN32%\""
} else {
puts $aFile "set \"CSF_OPT_BIN32D=$aStringBin32d\""
}
set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin64 [regsub -all "$::PRODUCTS_PATH" $aStringBin64 "%PRODUCTS_PATH%"]
@@ -1296,6 +1386,18 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional (64-bit) search paths"
puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
set aStringBin64d [join $::CSF_OPT_BIN64D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin64d [regsub -all "$::PRODUCTS_PATH" $aStringBin64d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug (64-bit) search paths"
if { "$aStringBin64d" != "" && "$aStringBin64" != "" } {
puts $aFile "set \"CSF_OPT_BIN64D=$aStringBin64d;%CSF_OPT_BIN64%\""
} else {
puts $aFile "set \"CSF_OPT_BIN64D=$aStringBin64d\""
}
close $aFile
} else {
set aCustomFilePath "./custom.sh"
@@ -1337,6 +1439,18 @@ proc wokdep:SaveCustom {} {
puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib]\""
set aStringLibD [join [set ::CSF_OPT_LIB${::ARCH}D] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLibD [regsub -all "$::PRODUCTS_PATH" $aStringLibD "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional debug libraries ($::ARCH-bit) search paths"
if { "$aStringLibD" != "" && "$aStringLib" != "" } {
puts $aFile "export CSF_OPT_LIB${::ARCH}D=\"[set aStringLibD]:\$CSF_OPT_LIB${::ARCH}\""
} else {
puts $aFile "export CSF_OPT_LIB${::ARCH}D=\"[set aStringLibD]\""
}
set aStringBin [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin [regsub -all "$::PRODUCTS_PATH" $aStringBin "\${PRODUCTS_PATH}"]
@@ -1345,6 +1459,18 @@ proc wokdep:SaveCustom {} {
puts $aFile "# Additional ($::ARCH-bit) search paths"
puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin]\""
set aStringBinD [join [set ::CSF_OPT_BIN${::ARCH}D] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBinD [regsub -all "$::PRODUCTS_PATH" $aStringBinD "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional debug ($::ARCH-bit) search paths"
if { "$aStringBinD" != "" && "$aStringBin" != "" } {
puts $aFile "export CSF_OPT_BIN${::ARCH}D=\"[set aStringBinD]:\$CSF_OPT_BIN${::ARCH}\""
} else {
puts $aFile "export CSF_OPT_BIN${::ARCH}D=\"[set aStringBinD]\""
}
close $aFile
}
puts "Configuration saved to file '$aCustomFilePath'"
@@ -1382,6 +1508,27 @@ proc wokdep:SaveCustom {} {
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
}
puts $aFile ""
puts $aFile "CONFIG(debug, debug|release) {"
puts $aFile " # Additional debug libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB${::ARCH}D] {
if { "$::PRODUCTS_PATH" != "" } {
set aLibPath [regsub -all "$::PRODUCTS_PATH" $aLibPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile " LIBS += -L\"${aLibPath}\""
}
if { "$::tcl_platform(platform)" == "windows" } {
puts $aFile ""
puts $aFile " # Additional debug DLLs search paths"
foreach aDllPath [set ::CSF_OPT_BIN${::ARCH}D] {
if { "$::PRODUCTS_PATH" != "" } {
set aDllPath [regsub -all "$::PRODUCTS_PATH" $aDllPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile " LIBS += -L\"${aDllPath}\""
}
}
puts $aFile "}"
puts $aFile ""
puts $aFile "# Additional libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {

View File

@@ -237,8 +237,10 @@ proc gendoc {args} {
}
} elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: search is not used with PDF and will be ignored."
continue
}
if {$args_values(s) != "NULL"} {
set SEARCH_MODE $args_values(s)
} else {
@@ -247,16 +249,16 @@ proc gendoc {args} {
}
} elseif {$arg_n == "mathjax"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
}
puts "Warning: MathJax is not used with PDF and will be ignored."
}
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
} else {
puts "Warning: MathJax is not used with pdf and will be ignored."
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
}
} else {
puts "\nWrong argument: $arg_n"
@@ -686,6 +688,17 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
# Write specific options
if { $docType == "REFMAN" } {
# always include optional components
set aHaveD3dBack ""
set aHaveGlesBack ""
set aHaveVtkBack ""
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
set ::env(HAVE_D3D) "true"
set ::env(HAVE_GLES2) "true"
set ::env(HAVE_VTK) "true"
# Load lists of modules scripts
if { $productsPath == "" } {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
@@ -811,6 +824,11 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
puts $doxyFile ""
# restore environment variables
set ::env(HAVE_D3D) "$aHaveD3dBack"
set ::env(HAVE_GLES2) "$aHaveGlesBack"
set ::env(HAVE_VTK) "$aHaveVtkBack"
} elseif { $docType == "OVERVIEW" } {
# Add common options for generation of Overview and User Guides

View File

@@ -129,7 +129,7 @@ proc osutils:isEqualContent { theContent1 theContent2 } {
# Auxiliary function for writing new file content only if it has been actually changed
# (e.g. to preserve file timestamp on no change).
# Useful for automatically (re)generated files.
proc osutils:writeTextFile { theFile theContent {theEol lf} } {
proc osutils:writeTextFile { theFile theContent {theEol lf} {theToBackup false} } {
if {[file exists "${theFile}"]} {
set aFileOld [open "${theFile}" rb]
fconfigure $aFileOld -translation crlf
@@ -143,6 +143,10 @@ proc osutils:writeTextFile { theFile theContent {theEol lf} } {
return false
}
if { $theToBackup == true } {
puts "Warning: file ${theFile} is updated. Old content is saved to ${theFile}.bak"
file copy -force -- "${theFile}" "${theFile}.bak"
}
file delete -force "${theFile}"
}
@@ -256,7 +260,7 @@ proc genAllResources { theSrcDir } {
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vclang" "cbp" "xcd" "pro"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vc143" "vclang" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -320,6 +324,7 @@ proc genproj {theFormat args} {
vc14 - Visual Studio 2015
vc141 - Visual Studio 2017
vc142 - Visual Studio 2019
vc143 - Visual Studio 2022
vclang - Visual Studio with ClangCL toolset
cbp - CodeBlocks
xcd - XCode
@@ -373,29 +378,28 @@ proc copy_with_warning {from to} {
# Generate auxiliary scripts for launching IDE.
proc genprojbat {theFormat thePlatform theSolution} {
set aTargetPlatformExt sh
set aTargetEol lf
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
set aTargetPlatformExt bat
set aTargetEol crlf
}
if {"$theFormat" != "cmake"} {
# copy env.bat/sh only if not yet present
if { ! [file exists "$::path/env.${aTargetPlatformExt}"] } {
set anEnvTmplFile [open "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}" "r"]
set anEnvTmpl [read $anEnvTmplFile]
close $anEnvTmplFile
if { [file exists "$::path/src/OS/FoundationClasses.tcl"] || ![file exists "$::path/env.${aTargetPlatformExt}"] } {
# generate env.bat/sh
set anEnvTmplFilePath "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}"
set anEnvTmplFile [open "$anEnvTmplFilePath" "r"]
set anEnvTmpl [read $anEnvTmplFile]
close $anEnvTmplFile
set aCasRoot ""
if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } {
set aCasRoot [relativePath "$::path" "$::THE_CASROOT"]
}
regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl
set anEnvFile [open "$::path/env.${aTargetPlatformExt}" "w"]
puts $anEnvFile $anEnvTmpl
close $anEnvFile
set aCasRoot ""
if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } {
set aCasRoot [relativePath "$::path" "$::THE_CASROOT"]
}
regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl
set aLineList [split $anEnvTmpl "\n"]
osutils:writeTextFile "$::path/env.${aTargetPlatformExt}" $aLineList $aTargetEol true
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
if { "$::BUILD_Inspector" == "true" } {
@@ -557,6 +561,7 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution }
"vc14" -
"vc141" -
"vc142" -
"vc143" -
"vclang" { OS:MKVC $anOutDir $aModules $aTools $theSolution $theFormat $isUWP}
"cbp" { OS:MKCBP $anOutDir $aModules $theSolution $thePlatform $theCmpl }
"xcd" {
@@ -759,7 +764,7 @@ proc osutils:tk:sort { tklm theSrcDir theSourceDirOther } {
return $lret
}
# close dependencies of ltk. (full wok pathes of toolkits)
# close dependencies of ltk. (full work paths of toolkits)
# The CURRENT WOK LOCATION MUST contains ALL TOOLKITS required.
# (locate not performed.)
proc osutils:tk:close { ltk theSrcDir theSourceDirOther } {
@@ -906,7 +911,7 @@ proc osutils:collectinc {theModules theSrcDir theIncPath} {
# relative anIncPath in connection with aCasRoot/$theSrcDir
set aFromBuildIncToSrcPath [relativePath "$anIncPath" "$aCasRoot/$theSrcDir"]
# create and copy short-cut header files
# create and copy shortcut header files
foreach anUnit $anUnits {
osutils:checksrcfiles ${anUnit} $theSrcDir
@@ -1011,8 +1016,8 @@ proc osutils:vcsolution:header { vcversion } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 2013\n"
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
"$vcversion" == "vc142" || "$vcversion" == "vclang" } {
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
"$vcversion" == "vc142" || "$vcversion" == "vc143" || "$vcversion" == "vclang" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
@@ -1287,6 +1292,9 @@ proc osutils:vcproj:readtemplate {theVcVer isUWP isExec} {
} elseif { $theVcVer == "vc142" } {
set aVCRTVer "vc14"
set aToolset "v142"
} elseif { $theVcVer == "vc143" } {
set aVCRTVer "vc14"
set aToolset "v143"
} elseif { $theVcVer == "vclang" } {
set aVCRTVer "vc14"
set aToolset "ClangCL"
@@ -1409,9 +1417,13 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
unset theCsfLibsMap
unset theCsfFrmsMap
set aLibsMap(CSF_FREETYPE) "freetype"
if { "$::HAVE_FREETYPE" == "true" } {
set aLibsMap(CSF_FREETYPE) "freetype"
}
set aLibsMap(CSF_TclLibs) "tcl8.6"
set aLibsMap(CSF_TclTkLibs) "tk8.6"
if { "$::HAVE_TK" == "true" } {
set aLibsMap(CSF_TclTkLibs) "tk8.6"
}
if { "$::HAVE_FREEIMAGE" == "true" } {
if { "$theOS" == "wnt" } {
set aLibsMap(CSF_FreeImagePlus) "FreeImage"
@@ -1440,6 +1452,9 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
if { "$::HAVE_LIBLZMA" == "true" } {
set aLibsMap(CSF_LIBLZMA) "liblzma"
}
if { "$::HAVE_DRACO" == "true" } {
set aLibsMap(CSF_Draco) "draco"
}
if { "$::HAVE_OPENVR" == "true" } {
set aLibsMap(CSF_OpenVR) "openvr_api"
}
@@ -1461,15 +1476,15 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
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"
}
set aLibsMap(CSF_OpenGlesLibs) "libEGL libGLESv2"
set aLibsMap(CSF_psapi) "Psapi"
set aLibsMap(CSF_d3d9) "d3d9"
# the naming is different on Windows
set aLibsMap(CSF_TclLibs) "tcl86"
set aLibsMap(CSF_TclTkLibs) "tk86"
if { "$::HAVE_TK" == "true" } {
set aLibsMap(CSF_TclTkLibs) "tk86"
}
if { "$theRelease" == "true" } {
set aLibsMap(CSF_QT) "Qt5Gui Qt5Widgets Qt5Xml Qt5Core"
} else {
@@ -1484,39 +1499,47 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
}
} else {
set aLibsMap(CSF_dl) "dl"
if { "$::HAVE_XLIB" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "GL"
} else {
set aLibsMap(CSF_OpenGlLibs) "GL EGL"
}
set aLibsMap(CSF_OpenGlesLibs) "EGL GLESv2"
if { "$theOS" == "mac" || "$theOS" == "ios" } {
set aLibsMap(CSF_objc) "objc"
set aLibsMap(CSF_objc) "objc"
set aLibsMap(CSF_OpenGlLibs) ""
set aLibsMap(CSF_OpenGlesLibs) ""
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
set aFrmsMap(CSF_OpenGlesLibs) "OpenGLES"
if { "$theOS" == "ios" } {
set aFrmsMap(CSF_Appkit) "UIKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGLES"
set aFrmsMap(CSF_Appkit) "UIKit"
} else {
set aFrmsMap(CSF_Appkit) "AppKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
set aFrmsMap(CSF_Appkit) "AppKit"
}
set aFrmsMap(CSF_IOKit) "IOKit"
set aFrmsMap(CSF_TclLibs) "Tcl"
set aLibsMap(CSF_TclLibs) ""
set aFrmsMap(CSF_TclTkLibs) "Tk"
set aLibsMap(CSF_TclTkLibs) ""
set aFrmsMap(CSF_TclLibs) "Tcl"
if { "$::HAVE_TK" == "true" } {
set aFrmsMap(CSF_TclTkLibs) "Tk"
}
set aLibsMap(CSF_QT) "QtCore QtGui"
} elseif { "$theOS" == "android" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
set aLibsMap(CSF_androidlog) "log"
} else {
set aLibsMap(CSF_fontconfig) "fontconfig"
if { "$::HAVE_FREETYPE" == "true" } {
set aLibsMap(CSF_fontconfig) "fontconfig"
}
if { "$theOS" == "qnx" } {
# CSF_ThreadLibs - pthread API is part of libc on QNX
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
} else {
set aLibsMap(CSF_ThreadLibs) "pthread rt"
set aLibsMap(CSF_OpenGlLibs) "GL"
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
if { "$::HAVE_TK" == "true" } {
set aLibsMap(CSF_TclTkLibs) "tk8.6"
}
if { "$::HAVE_XLIB" == "true" } {
set aLibsMap(CSF_XwLibs) "X11"
}
}
}
}
@@ -1671,7 +1694,7 @@ proc wokUtils:EASY:bs1 { s } {
return $r
}
# Returs for a full path the liste of n last directory part
# Returns for a full path the liste of n last directory part
# n = 1 => tail
# n = 2 => dir/file.c
# n = 3 => sdir/dir/file.c
@@ -1785,9 +1808,14 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
global path
set aHasQtDep "false"
set aTkDefines ""
foreach aCsfElem [osutils:tk:csfInExternlib "$path/$theSrcDir/${theToolKit}/EXTERNLIB"] {
if { "$aCsfElem" == "CSF_QT" } {
set aHasQtDep "true"
} elseif { "$aCsfElem" == "CSF_OpenGlLibs" } {
set aTkDefines "$aTkDefines;HAVE_OPENGL"
} elseif { "$aCsfElem" == "CSF_OpenGlesLibs" } {
set aTkDefines "$aTkDefines;HAVE_GLES2"
}
}
set theProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 0]
@@ -1822,9 +1850,9 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
# depending on VC version
regsub -all -- {__TKDEP__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] theProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] theProjTmpl
regsub -all -- {__TKDEFINES__} $theProjTmpl $aTkDefines theProjTmpl
set anIncPaths "..\\..\\..\\inc"
# set aTKDefines ""
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
@@ -2108,6 +2136,7 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
set aVCRTVer [string range $theVcVer 0 3]
regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEFINES__} $aProjTmpl "" aProjTmpl
set aFilesSection ""
set aVcFilesCxx(units) ""
@@ -2515,6 +2544,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
lappend aCmplFlags "-DOCC_CONVERT_SIGNALS"
}
lappend aCmplFlags "-Wall"
lappend aCmplFlags "-Wextra"
lappend aCmplFlags "-fexceptions"
}
lappend aCmplFlagsRelease "-DNDEBUG"

View File

@@ -16,7 +16,7 @@
# commercial license or contractual agreement.
# =======================================================================
# This script contains auxilary functions which can be used
# This script contains auxiliary functions which can be used
# in documentation generation process
# =======================================================================

View File

@@ -13,8 +13,8 @@ OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags
CONFIG += warn_on
QMAKE_CFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON = -Wall
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CXXFLAGS_WARN_ON = -Wall -Wextra
win32 {
QMAKE_CFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_WARN_ON = -W4
@@ -49,6 +49,9 @@ win32 {
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
}
} else:gcc {
# ask linker to report missing library dependencies
QMAKE_LFLAGS += -Wl,-z,defs
}
}
!CONFIG(debug, debug|release) {
@@ -153,5 +156,4 @@ win32 {
}
}
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}

View File

@@ -15,8 +15,14 @@ for (aModuleIter, aModuleList) {
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGl") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGlTest") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGles") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGlesTest") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHostTest") { 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)

View File

@@ -18,7 +18,7 @@ aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot
# CSF variables
CSF_FREETYPE = -lfreetype
HAVE_FREETYPE { CSF_FREETYPE = -lfreetype }
CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
@@ -36,7 +36,7 @@ win32 {
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_OpenGlesLibs = -llibEGL -llibGLESv2
CSF_psapi = -lPsapi
CSF_winmm = -lwinmm
CSF_d3d9 = -ld3d9
@@ -46,12 +46,12 @@ win32 {
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
CSF_OpenGlLibs = -framework OpenGL
CSF_OpenGlesLibs = -framework OpenGLES
iphoneos {
CSF_Appkit = -framework UIKit
CSF_OpenGlLibs = -framework OpenGLES
} else {
CSF_Appkit = -framework AppKit
CSF_OpenGlLibs = -framework OpenGL
}
CSF_IOKit = -framework IOKit
CSF_TclLibs = -framework Tcl
@@ -59,18 +59,23 @@ win32 {
} 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
CSF_fontconfig = -lfontconfig
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
CSF_OpenGlesLibs = -lEGL -lGLESv2
CSF_TclTkLibs = -ltk8.6
HAVE_XLIB {
CSF_OpenGlLibs = -lGL
CSF_XwLibs = -lX11
} else {
CSF_OpenGlLibs = -lGL -lEGL
}
HAVE_FREETYPE { CSF_fontconfig = -lfontconfig }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
count(aRes, 1) {
DEFINES += $$aCfgIter
!equals(aCfgIter, "HAVE_GLES2") {
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
}
@@ -103,6 +108,12 @@ for (anExternLib, anExternLibs) {
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
equals(anExternLib, "CSF_OpenGlLibs") {
DEFINES += "HAVE_OPENGL"
}
equals(anExternLib, "CSF_OpenGlesLibs") {
DEFINES += "HAVE_GLES2"
}
} else {
LIBS += -l$$anExternLib
}

View File

@@ -9,6 +9,10 @@
# - 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.
#
# Within Debian-based Linux repository Qt Creator can be installed like this:
# > sudo apt-get install qtcreator qtbase5-dev
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 3.6.1, 2016-05-19T14:46:43. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
<value type="bool" key="BindStarToLeftSpecifier">true</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">true</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">true</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">2</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabSize">2</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">occt</value>
</data>
</qtcreator>

View File

@@ -13,6 +13,7 @@ rem Paths to 3rd-party tools and libraries
set "anNdkPath="
set "aFreeType="
set "aRapidJson="
set "aDraco="
rem Build stages to perform
set "toCMake=1"
@@ -34,7 +35,9 @@ set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
rem Optional 3rd-party libraries to enable
set USE_RAPIDJSON=OFF
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
@@ -54,6 +57,11 @@ if not exist "%anNdkPath%/sources/cxx-stl/gnu-libstdc++" (
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
set "aDestDir=%aBuildRoot%\android-%aCompiler%"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aDestDir%"
)
)
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
@@ -64,6 +72,13 @@ for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (
call :cmakeGenerate "%anNdkApiLevel%" "%%s"
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
)
for /F "skip=1 delims=" %%F in ('
@@ -99,9 +114,19 @@ goto :eof
:cmakeGenerate
set "anApi=%~1"
set "anAbi=%~2"
if ["%anApi%"] == [""] (
set "anApi=21"
if ["%anAbi%"] == ["armeabi-v7a"] ( set "anApi=16" )
if ["%anAbi%"] == ["x86"] ( set "anApi=16" )
)
set "aPlatformAndCompiler=android-%anAbi%-%aCompiler%"
set "aWorkDir=%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aLogFile=%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
@@ -112,10 +137,13 @@ git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
echo Start building OCCT for %aPlatformAndCompiler%, API level %anApi%>> %aLogFile%
pushd "%aWorkDir%"
set "aFreeTypeLibName=libfreetype.so"
if exist "%aFreeType%/libs/%anAbi%/libfreetype.a" ( set "aFreeTypeLibName=libfreetype.a" )
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for Android %anAbi%, API level %anApi%...
@@ -140,14 +168,19 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/libs/%anAbi%" ^
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/libfreetype.so" ^
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/%aFreeTypeLibName%" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR_draco:PATH="%aDraco%/libs/%anAbi%" ^
"%aCasSrc%"
if errorlevel 1 (
@@ -156,7 +189,7 @@ if ["%toCMake%"] == ["1"] (
goto :eof
)
)
set aTimeGEN=%TIME%
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
@@ -178,7 +211,7 @@ if ["%toMake%"] == ["1"] (
)
type "%aLogFile%"
)
set aTimeBUILD=%TIME%
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%

View File

@@ -6,6 +6,7 @@ rem set "PATH=c:\CMake\bin;%PATH%"
rem set "anNdkPath=c:/android-ndk-r12"
rem set "aFreeType=c:/freetype-2.7.1-android"
rem set "aRapidJson=c:/rapidjson-1.1.0"
rem set "aDraco=c:/draco-1.4.1-android"
rem Uncomment to customize building steps
rem set "aBuildRoot=%~dp0..\..\work"
@@ -28,4 +29,5 @@ rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem Optional 3rd-party libraries to enable
rem set USE_RAPIDJSON=ON
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"

View File

@@ -22,6 +22,7 @@ rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
rem set BUILD_USE_PCH=OFF
rem set BUILD_FORCE_RelWithDebInfo=OFF
rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
@@ -42,5 +43,6 @@ rem set USE_FFMPEG=OFF
rem set USE_FREEIMAGE=OFF
rem set USE_GLES2=OFF
rem set USE_RAPIDJSON=OFF
rem set USE_DRACO=OFF
rem set USE_TBB=OFF
rem set USE_VTK=OFF

View File

@@ -35,6 +35,7 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
#USE_FREEIMAGE=OFF
#USE_GLES2=OFF
#USE_RAPIDJSON=OFF
#USE_DRACO=OFF
#USE_TBB=OFF
#USE_VTK=OFF

View File

@@ -12,6 +12,7 @@ set VS=14
set VSDATA=2015
set VSPLATFORM=Win64
set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "OCCT3RDPARTY="
set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_ADDITIONAL_TOOLKITS=
@@ -23,6 +24,7 @@ set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
set BUILD_WITH_DEBUG=OFF
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
set BUILD_USE_PCH=OFF
set BUILD_FORCE_RelWithDebInfo=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
@@ -36,6 +38,7 @@ set USE_FFMPEG=OFF
set USE_FREEIMAGE=OFF
set USE_GLES2=OFF
set USE_RAPIDJSON=OFF
set USE_DRACO=OFF
set USE_TBB=OFF
set USE_VTK=OFF
@@ -69,12 +72,14 @@ cmake -G "%arch_compile%" ^
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^
-D BUILD_USE_PCH:BOOL=%BUILD_USE_PCH% ^
-D BUILD_FORCE_RelWithDebInfo:BOOL=%BUILD_FORCE_RelWithDebInfo% ^
-D INSTALL_DIR:PATH="%INSTALL_DIR%" ^
-D USE_D3D:BOOL=%USE_D3D% ^
-D USE_FFMPEG:BOOL=%USE_FFMPEG% ^
-D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
-D USE_GLES2:BOOL=%USE_GLES2% ^
-D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^
-D USE_DRACO:BOOL=%USE_DRACO% ^
-D USE_TBB:BOOL=%USE_TBB% ^
-D USE_VTK:BOOL=%USE_VTK% ^
"%SrcRoot%"

View File

@@ -40,6 +40,7 @@ USE_FFMPEG=OFF
USE_FREEIMAGE=OFF
USE_GLES2=OFF
USE_RAPIDJSON=OFF
USE_DRACO=OFF
USE_TBB=OFF
USE_VTK=OFF
AUX_ARGS=
@@ -79,6 +80,7 @@ cmake -G "Unix Makefiles" \
-D USE_FREEIMAGE:BOOL=$USE_FREEIMAGE \
-D USE_GLES2:BOOL=$USE_GLES2 \
-D USE_RAPIDJSON:BOOL=$USE_RAPIDJSON \
-D USE_DRACO:BOOL=$USE_DRACO \
-D USE_TBB:BOOL=$USE_TBB \
-D USE_VTK:BOOL=$USE_VTK \
$AUX_ARGS "$SrcRoot"

View File

@@ -17,6 +17,7 @@ export aBuildRoot=work
export aFreeType=
export aFreeImage=
export aRapidJson=
export aDraco=
# build stages to perform
export toSimulator=0
@@ -34,8 +35,10 @@ export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export USE_FREETYPE=ON
export USE_FREEIMAGE=OFF
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export anAbi=arm64
@@ -110,20 +113,25 @@ if [[ $toCMake == 1 ]]; then
-D ENABLE_VISIBILITY:BOOL="TRUE" \
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
-D INSTALL_DIR:PATH="$aDestDir" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \
-D USE_RAPIDJSON:BOOL="ON" \
-D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \
-D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \
-D USE_DRACO:BOOL="$USE_DRACO" \
-D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \
-D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \
-D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \

View File

@@ -3,6 +3,7 @@ export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-ios"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-ios"
export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
# Uncomment to customize building steps
#export toSimulator=0
@@ -21,6 +22,7 @@ export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
#export BUILD_DataExchange=ON
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON
#export USE_FREEIMAGE=ON
#export IPHONEOS_DEPLOYMENT_TARGET=8.0

View File

@@ -17,6 +17,7 @@ export aBuildRoot=work
export aFreeType=
export aFreeImage=
export aRapidJson=
export aDraco=
# build stages to perform
export toCMake=1
@@ -35,6 +36,7 @@ export BUILD_Draw=ON
export USE_FREEIMAGE=ON
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbi=arm64
@@ -106,6 +108,10 @@ if [[ $toCMake == 1 ]]; then
-D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \
-D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \
-D USE_DRACO:BOOL="$USE_DRACO" \
-D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \
-D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \
-D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \

View File

@@ -3,6 +3,7 @@ export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-macos"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-macos"
export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
# Uncomment to customize building steps
#export aBuildRoot=work
@@ -20,6 +21,7 @@ export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
#export BUILD_Draw=ON
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON
#export USE_FREEIMAGE=ON
#export MACOSX_DEPLOYMENT_TARGET=10.10

267
adm/scripts/mingw_build.bat Normal file
View File

@@ -0,0 +1,267 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for Mingw-w64 platform.
rem mingw_custom.bat should be configured with paths to CMake, 3rd-parties and MinGW.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aMingwVars="
set "aFreeType="
set "aFreeImage="
set "aRapidJson="
set "aDraco="
set "aTclTk="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=0"
set "toDebug=0"
set "isStatic=0"
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_Draw=ON"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_FREEIMAGE=ON"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0mingw_custom.bat" call "%~dp0mingw_custom.bat"
if not ["%aMingwVars%"] == [""] ( call "%aMingwVars%" )
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-mingw64%aBuildTypePrefix%"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
echo Copying dependencies...
for %%i in (libstdc++-6.dll libwinpthread-1.dll libgcc_s_seh-1.dll) do (
if "%%~$PATH:i" == "" (
echo "Error: could not find %%i"
) else (
xcopy /Y "%%~$PATH:i" "%aTarget%\win64\gcc\bin"
)
)
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=mingw64%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
pushd "%aWorkDir%"
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for MinGW-w64...
cmake -G "MinGW Makefiles" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D BUILD_LIBRARY_TYPE:STRING="%aLibType%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
-D 3RDPARTY_TCL_DLL_DIR:PATH="%aTclTk%/bin" ^
-D 3RDPARTY_TK_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TK_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
-D 3RDPARTY_TK_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
-D 3RDPARTY_TK_DLL_DIR:PATH="%aTclTk%/bin" ^
-D USE_D3D:BOOL="ON" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/lib" ^
-D USE_FREEIMAGE:BOOL="%USE_FREEIMAGE%" ^
-D 3RDPARTY_FREEIMAGE_DIR:PATH="%aFreeImage%" ^
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="%aFreeImage%/include" ^
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="%aFreeImage%/lib" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^
"%aCasSrc%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -0,0 +1,29 @@
rem Environment configuration template for mingw_build.bat (to be renamed as mingw_custom.bat)
set "aCmakeBin=%ProgramW6432%\CMake\bin"
set "aFreeType=%aCasSrc%/../3rdparty/freetype-2.6.3-mingw-64"
set "aTclTk=%aCasSrc%/../3rdparty/tcltk-8.6.4-mingw-64"
set "aFreeImage=%aCasSrc%/../3rdparty/freeimage-3.17-0-mingw-64"
set "aRapidJson=%aCasSrc%/../3rdparty/rapidjson-1.1.0"
set "aDraco=%aCasSrc%/../3rdparty/draco-1.4-1-mingw-64"
set "aMingwVars=c:\mingw-8.3.0-msys2\mingwvars.bat"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=1"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "toDebug=0"
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_Draw=ON"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set "USE_FREEIMAGE=ON"

View File

@@ -4,36 +4,110 @@ rem Auxiliary script for semi-automated building of OCCT for WASM platform.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aSrcRoot=%~dp0..\.."
set "aBuildRoot=work"
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aFreeType="
set "aRapidJson="
set "aDraco="
set "aTcl="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=0"
set "toDebug=0"
set "toBuildSample=0"
set "sourceMapBase="
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_PTHREADS=OFF"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-wasm32%aBuildTypePrefix%"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
if ["%toBuildSample%"] == ["1"] (
if not exist "%aTarget%\sample" ( mkdir "%aTarget%\sample" )
xcopy /S /Y "%aDestDirSmpl%\*" "%aTarget%\sample\"
)
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
@@ -41,13 +115,34 @@ if not ["%1"] == ["-nopause"] (
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm"
set "aWorkDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aDestDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%"
set "aLogFile=%aSrcRoot%\%aBuildRoot%\build-%aPlatformAndCompiler%.log"
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toBuildSample%"] == ["1"] (
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDirSmpl%"
rmdir /S /Q %aDestDirSmpl%"
)
)
if not exist "%aWorkDirSmpl%" ( mkdir "%aWorkDirSmpl%" )
if exist "%aLogFileSmpl%" ( del "%aLogFileSmpl%" )
)
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
@@ -57,30 +152,49 @@ echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
echo --->> %aLogFile%
call emcc --version >> %aLogFile%
echo --->> %aLogFile%
pushd "%aWorkDir%"
set aTimeZERO=%TIME%
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo "Configuring OCCT for WASM..."
echo Configuring OCCT for WASM...
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
"%aSrcRoot%"
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^
-D 3RDPARTY_DRACO_LIBRARY:FILEPATH="%aDraco%/lib/libdraco.a" ^
-D USE_TK:BOOL="OFF" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTcl%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:PATH="%aTcl%/include" ^
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTcl%/lib" ^
-D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTcl%/lib/libtcl.a" ^
"%aCasSrc%"
if errorlevel 1 (
popd
@@ -88,61 +202,115 @@ if ["%toCMake%"] == ["1"] (
goto :eof
)
)
set aTimeGEN=%TIME%
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if "%toClean%"=="1" (
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if "%toMake%"=="1" (
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set aTimeBUILD=%TIME%
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if "%toMake%"=="1" (
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if "%toMake%"=="1" (
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if "%toInstall%"=="1" (
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set aTimeINSTALL=%TIME%
call :computeDuration %aTimeBUILD% %aTimeINSTALL%
if "%toInstall%"=="1" (
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeINSTALL%
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
if ["%toBuildSample%"] == ["0"] (
goto :eof
)
pushd "%aWorkDirSmpl%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDir%/lib/cmake/opencascade" ^
-D freetype_DIR:PATH="%aFreeType%/lib/cmake/freetype" ^
"%aSrcRootSmpl%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
type "%aLogFileSmpl%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof
:computeDuration
set aTimeFrom=%1
set aTimeEnd=%2
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"

View File

@@ -1,16 +1,29 @@
rem Environment configuration template for occ_build_wasm.bat (to be renamed as wasm_custom_env.bat)
set "aFreeType=%aSrcRoot%\..\3rdparty\freetype-2.7.1-wasm"
set "EMSDK_ROOT=%aSrcRoot%\..\emsdk"
rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat)
set "EMSDK_ROOT=%aCasSrc%\..\emsdk"
set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm32"
rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0"
rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32"
rem set "aCmakeBin=%ProgramW6432%\CMake\bin"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=0"
rem set "toClean=1"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "toDebug=1"
rem set "toBuildSample=1"
rem Source map base (should point to server where C++ sources will be copied)
rem enables -g4 debug building option for WebGL sample and allows navigating C++ source code within JavaScript debugger.
rem set "sourceMapBase=http://localhost:9090/"
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set "USE_PTHREADS=ON"

View File

@@ -0,0 +1,117 @@
@echo OFF
rem Auxiliary script for semi-automated building of WebGL sample.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aFreeType="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toDebug=0"
set "sourceMapBase="
set "USE_PTHREADS=OFF"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aDestDirOcct=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDirSmpl%"
rmdir /S /Q %aDestDirSmpl%"
)
)
if not exist "%aWorkDirSmpl%" ( mkdir "%aWorkDirSmpl%" )
if exist "%aLogFileSmpl%" ( del "%aLogFileSmpl%" )
pushd "%aWorkDirSmpl%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDirOcct%/lib/cmake/opencascade" ^
-D freetype_DIR:PATH="%aFreeType%/lib/cmake/freetype" ^
"%aSrcRootSmpl%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
type "%aLogFileSmpl%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof

View File

@@ -17,6 +17,8 @@ set "ARCH=64"
set "VCVARS="
set "HAVE_TBB=false"
set "HAVE_OPENCL=false"
set "HAVE_TK=true"
set "HAVE_FREETYPE=true"
set "HAVE_FREEIMAGE=false"
set "HAVE_FFMPEG=false"
set "HAVE_VTK=false"
@@ -25,6 +27,7 @@ set "HAVE_D3D=false"
set "HAVE_ZLIB=false"
set "HAVE_LIBLZMA=false"
set "HAVE_RAPIDJSON=false"
set "HAVE_DRACO=false"
set "HAVE_OPENVR=false"
set "HAVE_E57=false"
set "CSF_OPT_INC="
@@ -32,6 +35,14 @@ set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64="
set "CSF_OPT_LIB32D="
set "CSF_OPT_LIB64D="
set "CSF_OPT_BIN32D="
set "CSF_OPT_BIN64D="
set "CSF_OPT_LIB32I="
set "CSF_OPT_LIB64I="
set "CSF_OPT_BIN32I="
set "CSF_OPT_BIN64I="
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
@@ -56,9 +67,9 @@ rem Decode VCVER variable and define related ones:
rem
rem VCFMT - "vc" followed by full version number of Visual Studio toolset
rem (same as VCVER without optional suffix "-uwp")
rem VCLIB - name of folder contining binaries
rem VCLIB - name of folder containing binaries
rem (same as VCVER except without third version in number)
rem VCPROP - name of required Visual Studion Workload (starting with VS 2017)
rem VCPROP - name of required Visual Studio Workload (starting with VS 2017)
rem
rem Note that for VS before 2015 (vc14) always
rem VCFMT=VCLIB=VCVER and VCPROP=NativeDesktop
@@ -110,8 +121,12 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
@@ -126,6 +141,7 @@ if not "%DevEnvDir%" == "" (
echo vc14 = VS 2015
echo vc141 = VS 2017
echo vc142 = VS 2019
echo vc143 = VS 2022
echo vclang = VS 2019 with ClangCL toolset
exit /B
)
@@ -156,10 +172,15 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v143"
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=ClangCL"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
@@ -168,28 +189,31 @@ if /I "%VCFMT%" == "vc9" (
exit /B
)
set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%"
set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%"
set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%"
set "CSF_OPT_BIN64D=%CSF_OPT_BIN64%"
set "CSF_OPT_LIB32I=%CSF_OPT_LIB32%"
set "CSF_OPT_LIB64I=%CSF_OPT_LIB64%"
set "CSF_OPT_BIN32I=%CSF_OPT_BIN32%"
set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%"
if ["%CSF_OPT_LIB32D%"] == [""] set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%"
if ["%CSF_OPT_LIB64D%"] == [""] set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%"
if ["%CSF_OPT_BIN32D%"] == [""] set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%"
if ["%CSF_OPT_BIN64D%"] == [""] set "CSF_OPT_BIN64D=%CSF_OPT_BIN64%"
if ["%CSF_OPT_LIB32I%"] == [""] set "CSF_OPT_LIB32I=%CSF_OPT_LIB32%"
if ["%CSF_OPT_LIB64I%"] == [""] set "CSF_OPT_LIB64I=%CSF_OPT_LIB64%"
if ["%CSF_OPT_BIN32I%"] == [""] set "CSF_OPT_BIN32I=%CSF_OPT_BIN32%"
if ["%CSF_OPT_BIN64I%"] == [""] set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%"
rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
set "CSF_OPT_CMPL="
set "PRODUCTS_DEFINES="
if ["%HAVE_TBB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB" & set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL" & set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_TK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TK" & set "CSF_DEFINES=HAVE_TK;%CSF_DEFINES%"
if ["%HAVE_FREETYPE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREETYPE;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_FFMPEG%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FFMPEG" & set "CSF_DEFINES=HAVE_FFMPEG;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK" & set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2" & set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2_EXT" & set "CSF_DEFINES=HAVE_GLES2_EXT;%CSF_DEFINES%"
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D" & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%"
if ["%HAVE_DRACO%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_DRACO" & set "CSF_DEFINES=HAVE_DRACO;%CSF_DEFINES%"
if ["%HAVE_OPENVR%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENVR" & set "CSF_DEFINES=HAVE_OPENVR;%CSF_DEFINES%"
if ["%HAVE_E57%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_E57" & set "CSF_DEFINES=HAVE_E57;%CSF_DEFINES%"
@@ -199,20 +223,20 @@ if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
if not ["%PRODUCTS_DEFINES%"] == [""] set "CSF_OPT_CMPL=%CSF_OPT_CMPL% %PRODUCTS_DEFINES%"
rem ----- Colect 3rd-parties additional include paths into compiler options -----
rem ----- Collect 3rd-parties additional include paths into compiler options -----
for %%a in ("%CSF_OPT_INC:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatCmplInc %%~a
)
rem ----- Colect 3rd-parties additional library paths (32-bit) into linker options -----
rem ----- Collect 3rd-parties additional library paths (32-bit) into linker options -----
set "OPT_LIB32="
for %%a in ("%CSF_OPT_LIB32:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatLib32 %%~a
)
rem ----- Colect 3rd-parties additional library paths (64-bit) into linker options -----
rem ----- Collect 3rd-parties additional library paths (64-bit) into linker options -----
set "OPT_LIB64="
for %%a in ("%CSF_OPT_LIB64:;=";"%") do (
set "anItem=%%~a"
@@ -244,7 +268,7 @@ if ["%CASDEB%"] == ["d"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64D%;%PAT
if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32I%;%PATH%"
if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64I%;%PATH%"
rem ----- Set envoronment variables used by OCCT -----
rem ----- Set environment variables used by OCCT -----
set CSF_LANGUAGE=us
set MMGT_CLEAR=1
set "CSF_SHMessage=%CSF_OCCTResourcePath%\SHMessage"

View File

@@ -3,12 +3,16 @@
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
aSystem=`uname -s`
# Reset values
export CASROOT="__CASROOT__"
export CASDEB=""
export PRJFMT="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_TK="true";
export HAVE_FREETYPE="true";
export HAVE_FREEIMAGE="false";
export HAVE_FFMPEG="false";
export HAVE_VTK="false";
@@ -16,9 +20,13 @@ export HAVE_GLES2="false";
export HAVE_ZLIB="false";
export HAVE_LIBLZMA="false";
export HAVE_RAPIDJSON="false";
export HAVE_DRACO="false";
export HAVE_OPENVR="false";
export HAVE_E57="false";
export MACOSX_USE_GLX="false";
export HAVE_XLIB="true";
if [ "$aSystem" == "Darwin" ]; then
export HAVE_XLIB="false";
fi
export CSF_OPT_INC=""
export CSF_OPT_LIB32=""
export CSF_OPT_LIB64=""
@@ -58,7 +66,6 @@ else
export ARCH="64";
fi
aSystem=`uname -s`
if [ "$aSystem" == "Darwin" ]; then
export WOKSTATION="mac";
export ARCH="64";
@@ -100,17 +107,19 @@ export CSF_OPT_CMPL=""
# Optiona 3rd-parties should be enabled by HAVE macros
if [ "$HAVE_TBB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"; fi
if [ "$HAVE_OPENCL" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
if [ "$HAVE_TK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TK"; fi
if [ "$HAVE_FREETYPE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREETYPE"; fi
if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
if [ "$HAVE_FFMPEG" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2_EXT"; fi
if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi
if [ "$HAVE_DRACO" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_DRACO"; fi
if [ "$HAVE_OPENVR" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENVR"; fi
if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi
# Option to compile OCCT with X11 libs on Mac OS X
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
if [ "$HAVE_XLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_XLIB"; fi
# To split string into array
aDelimBack=$IFS

View File

@@ -90,7 +90,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -107,7 +107,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -138,7 +138,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
@@ -156,7 +156,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
@@ -186,7 +186,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -203,7 +203,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -234,7 +234,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
@@ -252,7 +252,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>

View File

@@ -85,7 +85,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -100,7 +100,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -130,7 +130,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
@@ -146,7 +146,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
@@ -175,7 +175,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -190,7 +190,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -219,7 +219,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
@@ -235,7 +235,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>

View File

@@ -94,6 +94,7 @@ GeomAdaptor_HCurve GeomAdaptor_Curve
GeomAdaptor_HSurface GeomAdaptor_Surface
GeomAdaptor_HSurfaceOfLinearExtrusion GeomAdaptor_SurfaceOfLinearExtrusion
GeomAdaptor_HSurfaceOfRevolution GeomAdaptor_SurfaceOfRevolution
PrsMgr_PresentationManager3d PrsMgr_PresentationManager
[tcollection]
AdvApp2Var_SequenceOfNode

View File

@@ -370,7 +370,7 @@ proc upgrade {args} {
}
}
# search and rename the indeces (old names) of @theNewNames with their values (new ones)
# search and rename the indices (old names) of @theNewNames with their values (new ones)
# processes files that have @theExtensions only in @thePath folder
proc Rename {thePath theExtensions theNewNames theCheckMode} {
upvar $theNewNames aNewNames

View File

@@ -12,7 +12,9 @@ samples/samples.md
../samples/CSharp/ReadMe.md
../samples/CSharp/ReadMe_D3D.md
../samples/qt/AndroidQt/ReadMe.md
../samples/qt/IESample/ReadMe.md
../samples/qt/OCCTOverview/ReadMe.md
../samples/qt/Tutorial/ReadMe.md
../samples/java/jniviewer/ReadMe.md
../samples/ios/UIKitSample/ReadMe.md
../samples/webgl/ReadMe.md
@@ -20,6 +22,7 @@ samples/ocaf.md
samples/ocaf_func.md
samples/draw_scripts.md
samples/novice_guide.md
tutorial/tutorial.md
build/build_upgrade.md

View File

@@ -6,6 +6,8 @@
tutorial/tutorial.md
samples/novice_guide.md
upgrade/upgrade.md
user_guides/foundation_classes/foundation_classes.md

View File

@@ -265,6 +265,18 @@ There are two types of third-party products, which are necessary to build OCCT:
* FreeImage 3.14.1 - 3.16.0;
* VTK 6.1.0.
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
**Debian-based distributives**
All 3rd-party products required for building of OCCT could be installed
from official repositories. You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev rapidjson-dev
Building is possible with C++ compliant compiler:
sudo apt-get install g++
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
@@ -439,24 +451,6 @@ Download the necessary archive from https://www.vtk.org/VTK/resources/software.h
make install
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
**Debian-based distributives**
All 3rd-party products required for building of OCCT could be installed
from official repositories. You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libfreeimage-dev libtbb-dev
To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
# you may need to add i386 if not done already by command "dpkg --add-architecture i386"
sudo apt-get install csh libstdc++6:i386 libxt6:i386 libxext6:i386 libxmu6:i386
Building is possible with C++ compliant compiler:
sudo apt-get install g++
@section build_3rdparty_macos Mac OS X
This document presents additional guidelines for building third-party products
@@ -630,4 +624,4 @@ in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment t
5. Clean temporary files
make clean
make clean

View File

@@ -3,31 +3,25 @@ Build OCCT {#build_upgrade__building_occt}
@tableofcontents
@note Before building OCCT, make sure to have all required third-party libraries installed.
Before building OCCT, make sure to have all required third-party libraries installed.
The list of required libraries depends on what OCCT modules will be used, and your preferences.
The typical minimum is **Freetype** (necessary for Visualization) and **Tcl/Tk** (for DRAW).
The typical minimum is **FreeType** (necessary for Visualization) and **Tcl/Tk** (for DRAW).
See @ref intro_req "requirements on 3rdparty libraries" for a full list.
On OS X we recommend to use native libraries.
@section build_occt_windows Windows
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to your target configuration,
from [Development Portal](https://dev.opencascade.org/resources/download/3rd-party-components).
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
@subsection build_occt_win_cmake Building with CMake tool
On Linux and macOS we recommend to use libraries maintained by distributive developers, when possible.
This article describes the **CMake**-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 2.8.12 or later*.
@section build_occt_win_cmake Building with CMake tool
@note Compared to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.x has a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool, which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive, which is a significant advantage over the legacy WOK utilities.
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and OS X in essentially the same way.
@note Before you start, make sure to have installed all 3-rd party products that you are going to use with OCCT; see @ref build_upgrade.
@subsubsection build_cmake_start Start CMake
This chapter describes the [CMake](https://cmake.org/download/)-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources.
OCCT requires CMake version 2.8.12 or later.
CMake is a tool that generates the actual project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio 2010).
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and macOS in essentially the same way.
CMake deals with three directories: source, build or binary and installation.
@@ -38,272 +32,286 @@ CMake deals with three directories: source, build or binary and installation.
The good practice is not to use the source directory as a build one.
Different configurations should be built in different build directories to avoid conflicts.
It is however possible to choose one installation directory for several configurations of OCCT (differentiated by platform, bitness, compiler and build type), for example:
d:/occt/ -- the source directory
d:/tmp/occt-build-vc10-x64 -- the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install -- the installation directory that is
able to contain several OCCT configurations
@subsubsection build_cmake_conf Configuration process
d:/occt/ - the source directory
d:/tmp/occt-build-vc10-x64 - the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install - the installation directory that is
able to contain several OCCT configurations
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory:
@subsection build_cmake_conf Configuration process
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory, and press *c* to configure:
cd d:/tmp/occt-build-vc10-x64
ccmake d:/occt
@figure{/build/build_occt/images/cmake_image000.png}
Press *c* to configure.
All actions required in the configuration process with the GUI tool will be described below.
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**.
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**:
@figure{/build/build_occt/images/cmake_image001.png}
**Note**: Each configuration of the project should be built in its own directory. When building multiple configurations it is recommended to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i> ).
@note Each configuration of the project should be built in its own directory.
When building multiple configurations it is suggested to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i>).
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process. It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process.
It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
@figure{/build/build_occt/images/cmake_image002.png}
To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
@note To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Alternatively, if you are using CMake from the command line add options `-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0`.
Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015".
File `CASROOT/samples/xaml/ReadMe.md` describes the building procedure of XAML (UWP) sample.
Alternatively, if you are using CMake from the command line add options -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 .
**Note**: Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015". File <i>d:/occt/samples/xaml/ReadMe.md</i> describes the building procedure of XAML (UWP) sample.
Once "Finish" button is pressed, the first pass of the configuration process is executed. At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
Once "Finish" button is pressed, the first pass of the configuration process is executed.
At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
@figure{/build/build_occt/images/cmake_image003.png}
The error message provides some information about these variables. This message will appear after each pass of the process until all required variables are specified correctly.
The error message provides some information about these variables.
This message will appear after each pass of the process until all required variables are specified correctly.
The change of the state of some variables can lead to the appearance of new variables. The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
The change of the state of some variables can lead to the appearance of new variables.
The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
Note: There is "grouped" option, which groups variables with a common prefix.
@note There is "grouped" option, which groups variables with a common prefix.
The following table gives the full list of environment variables used at the configuration stage:
| Variable | Type | Purpose |
|----------|------|---------|
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREEIMAGE | Boolean flag | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_RAPIDJSON | Boolean flag | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_TBB | Boolean flag | Indicates whether TBB 3rd party is used or not. TBB stands for Threading Building Blocks, the technology of Intel Corp, which comes with different mechanisms and patterns for injecting parallelism into your application. OCCT remains parallel even without TBB product |
| USE_VTK | Boolean flag | Indicates whether VTK 3rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREETYPE | Boolean | Indicates whether FreeType product should be used in OCCT for text rendering |
| USE_FREEIMAGE | Boolean | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_OPENVR | Boolean | Indicates whether OpenVR product should be used in OCCT visualization module for support of Virtual Reality |
| USE_OPENGL | Boolean | Indicates whether TKOpenGl graphic driver using OpenGL library (desktop) should be built within OCCT visualization module |
| USE_GLES2 | Boolean | Indicates whether TKOpenGles graphic driver using OpenGL ES library (embedded OpenGL) should be built within OCCT visualization module |
| USE_RAPIDJSON | Boolean | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_DRACO | Boolean | Indicates whether Draco product should be used in OCCT Data Exchange module for support of Draco compression in glTF mesh file format |
| USE_TK | Boolean | Indicates whether Tcl/Tk product should be used in OCCT Draw Harness module for user interface (in addition to Tcl, which is mandatory for Draw Harness) |
| USE_TBB | Boolean | Indicates whether TBB (Threading Building Blocks) 3rd party is used or not. Note that OCCT remains parallel even without TBB product |
| USE_VTK | Boolean | Indicates whether VTK 3rd party is used or not. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
| 3RDPARTY_FREETYPE_* | Path | Path to Freetype binaries |
| 3RDPARTY_FREETYPE_* | Path | Path to FreeType binaries |
| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to Freeimage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to FreeImage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_VTK_* | Path | Path to VTK binaries |
| BUILD_MODULE_<MODULE>| Boolean flag | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_MODULE_<MODULE>| Boolean | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_LIBRARY_TYPE | String | Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files used when linking other targets. Note that Draw Harness plugin system is incompatible with "Static" builds, and therefore it is disabled for these builds.|
| BUILD_ADDITIONAL_TOOLKITS | String | Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding *BUILD_MODUE_\<MODULE\>* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically |
| BUILD_YACCLEX | Boolean flag | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean flag | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| BUILD_SAMPLES_QT | Boolean flag | Indicates whether QT samples should be built together with OCCT. |
| BUILD_Inspector | Boolean flag | Indicates whether Inspector should be built together with OCCT. |
| BUILD_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_YACCLEX | Boolean | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| BUILD_SAMPLES_QT | Boolean | Indicates whether QT samples should be built together with OCCT. |
| BUILD_Inspector | Boolean | Indicates whether Inspector should be built together with OCCT. |
| BUILD_DOC_Overview | Boolean | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
| BUILD_WITH_DEBUG | Boolean flag | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean flag | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| BUILD_WITH_DEBUG | Boolean | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR_RESOURCE | Path | Relative path to the resources installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}) |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
| INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) |
| INSTALL_FREETYPE | Boolean flag | Indicates whether Freetype binaries should be installed into the installation directory |
| INSTALL_FREEIMAGE* | Boolean flag | Indicates whether Freeimage binaries should be installed into the installation directory |
| INSTALL_TBB | Boolean flag | Indicates whether TBB binaries should be installed into the installation directory |
| INSTALL_VTK | Boolean flag | Indicates whether VTK binaries should be installed into the installation directory |
| INSTALL_TCL | Boolean flag | Indicates whether TCL binaries should be installed into the installation directory |
| INSTALL_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
| INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) |
| INSTALL_FREETYPE | Boolean | Indicates whether FreeType binaries should be installed into the installation directory |
| INSTALL_FREEIMAGE | Boolean | Indicates whether FreeImage binaries should be installed into the installation directory |
| INSTALL_TBB | Boolean | Indicates whether TBB binaries should be installed into the installation directory |
| INSTALL_VTK | Boolean | Indicates whether VTK binaries should be installed into the installation directory |
| INSTALL_TCL | Boolean | Indicates whether TCL binaries should be installed into the installation directory |
| INSTALL_TEST_CASES | Boolean | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean | Indicates whether OCCT overview documentation should be installed into the installation directory |
**Note:** Only the forward slashes ("/") are acceptable in the CMake options defining paths.
@note Only the forward slashes ("/") are acceptable in the CMake options defining paths.
@subsubsection build_cmake_3rdparty 3rd party search mechanism
If *3RDPARTY_DIR* directory is defined, then required 3rd party binaries are sought in it, and default system folders are ignored.
If `3RDPARTY_DIR` directory is defined, then required 3rd party binaries are sought in it, and default system folders are ignored.
The procedure expects to find binary and header files of each 3rd party product in its own sub-directory: *bin*, *lib* and *include*.
The results of the search (achieved on the next pass of the configuration process) are recorded in the corresponding variables:
* *3RDPARTY_\<PRODUCT\>_DIR* -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>)
* *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR* -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>).
* *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>)
* *3RDPARTY_\<PRODUCT\>_DLL_DIR* -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
* `3RDPARTY_<PRODUCT>_DIR` -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>);
* `3RDPARTY_<PRODUCT>_LIBRARY_DIR` -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>);
* `3RDPARTY_<PRODUCT>_INCLUDE_DIR` -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>);
* `3RDPARTY_<PRODUCT>_DLL_DIR` -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
Note: each library and include directory should be children of the product directory if the last one is defined.
@note Each library and include directory should be children of the product directory if the last one is defined.
The search process is as follows:
1. Common path: *3RDPARTY_DIR*
2. Path to a particular 3rd-party library: *3RDPARTY_\<PRODUCT\>_DIR*
1. Common path: `3RDPARTY_DIR`
2. Path to a particular 3rd-party library: `3RDPARTY_<PRODUCT>_DIR`
3. Paths to headers and binaries:
1. *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR*
2. *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR*
3. *3RDPARTY_\<PRODUCT\>_DLL_DIR*
1. `3RDPARTY_<PRODUCT>_INCLUDE_DIR`
2. `3RDPARTY_<PRODUCT>_LIBRARY_DIR`
3. `3RDPARTY_<PRODUCT>_DLL_DIR`
If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step. If the search process at level 3 does not find the required files, it seeks in default places.
If a variable of any level is not defined (empty or `<variable name>-NOTFOUND`) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step.
If the search process at level 3 does not find the required files, it seeks in default places.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty) *3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables (or clear one of them) and run the configuration process again.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change `3RDPARTY_<PRODUCT>_*_DIR` variable,
clear (if they are not empty) `3RDPARTY_<PRODUCT>_DLL_DIR`, `3RDPARTY_<PRODUCT>_INCLUDE_DIR` and `3RDPARTY_<PRODUCT>_LIBRARY_DIR` variables (or clear one of them) and run the configuration process again.
At this time the search will be performed in the newly identified directory
and the result will be recorded to corresponding variables (replace old value if it is necessary).
For example, *3RDPARTY_FREETYPE_DIR* variable
At this time the search will be performed in the newly identified directory and the result will be recorded to corresponding variables (replace old value if it is necessary).
For example, `3RDPARTY_FREETYPE_DIR` variable
d:/3rdparty/freetype-2.4.10
can be changed to
can be changed to
d:/3rdparty/freetype-2.5.3
During the configuration process the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values.
During the configuration process the related variables (`3RDPARTY_FREETYPE_DLL_DIR`, `3RDPARTY_FREETYPE_INCLUDE_DIR` and `3RDPARTY_FREETYPE_LIBRARY_DIR`) will be filled with new found values.
**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names, change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
@note The names of searched libraries and header files are hard-coded.
If there is the need to change their names, change appropriate CMake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration:
`3RDPARTY_<PRODUCT>_INCLUDE` for include, `3RDPARTY_<PRODUCT>_LIB` for library and `3RDPARTY_<PRODUCT>_DLL` for shared library.
@subsubsection build_cmake_gen Projects generation
@subsection build_cmake_gen Projects generation
Once the configuration process is done, the "Generate" button is used to prepare project files for the target IDE.
In our exercise the Visual Studio solution will be automatically created in the build directory.
@subsubsection build_cmake_build Building
@subsection build_cmake_build Building
Go to the build folder, start the Visual Studio solution *OCCT.sln* and build it by clicking **Build -> Build Solution**.
@figure{/build/build_occt/images/cmake_image004.png}
By default the build solution process skips the building of the INSTALL and Overview project.
By default, the build solution process skips the building of the INSTALL and Overview projects.
When the building process is finished build:
* Overview project to generate OCCT overview documentation (if BUILD_DOC_Overview variable is checked)
* the *INSTALL* project to run **the installation process**
* *Overview* project to generate OCCT overview documentation (if `BUILD_DOC_Overview` variable is checked)
* the *INSTALL* project to run the **installation process**
For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer.
For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer.
@subsubsection build_cmake_install Installation
@subsection build_cmake_install Installation
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one. The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Normally you use the installation directory of OCCT to link against your specific application.
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one.
The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Normally you use the installation directory of OCCT to link against your specific application.
The directory structure is as follows:
data -- data files for OCCT (brep, iges, stp)
doc -- OCCT overview documentation in HTML format
inc -- header files
samples -- samples
src -- all required source files for OCCT
tests -- OCCT test suite
win32\vc10\bind -- binary files (installed 3rdparties and occt)
\libd -- libraries (installed 3rdparties and occt)
**Note:** The above example is given for debug configuration. However, it is generally safe to use the same installation directory for the release build. In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration. In particular, the binaries directory win64 will be expanded as
follows:
data - data files for OCCT (brep, iges, stp)
doc - OCCT overview documentation in HTML format
inc - header files
samples - samples
src - all required source files for OCCT
tests - OCCT test suite
win32\vc10\bind - binary files (installed 3rdparties and occt)
\libd - libraries (installed 3rdparties and occt)
@note The above example is given for debug configuration.
However, it is generally safe to use the same installation directory for the release build.
In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration.
In particular, the binaries directory win64 will be expanded as follows:
\win32\vc10\bind
\libd
\bin
\lib
If CMake installation flags are enabled for the 3rd party products (e.g. INSTALL_FREETYPE), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT. Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
If CMake installation flags are enabled for the 3rd party products (e.g. `INSTALL_FREETYPE`), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT.
Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
The installation folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*), samples (if they were installed) and overview.html (short-cut for installed OCCT overview documentation).
@subsection build_occt_win_codeblocks Building with Code::Blocks
@subsection build_occt_crossplatform_cmake Cross-compiling (Android)
This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using project files generated by OCCT legacy tool **genproj**.
It can be used as an alternative to CMake build system (see @ref build_occt_win_cmake) for all supported platforms.
This section describes the steps to build OCCT libraries for Android from a complete source package with GNU make (makefiles).
The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference: makefiles are built with mingw32-make on Windows and native GNU make on Ubuntu.
@subsubsection build_codeblocks_3rdparty Third-party libraries
Required tools (download and install if it is required):
- CMake 3.0+
- [Cross-compilation toolchain for CMake](https://github.com/taka-no-me/android-cmake)
- [Android NDK r12+](https://developer.android.com/ndk/downloads)
- GNU Make: MinGW v4.82+ for [Windows](https://www.mingw-w64.org/), GNU Make 4.0 for Ubuntu.
Before building OCCT, make sure to have all the needed third-party libraries installed, see @ref build_upgrade.
Run GUI tool provided by CMake and:
- Specify the root folder of OCCT (`$CASROOT`, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for CMake generated project files by clicking **Browse Build**.
@subsubsection build_codeblocks_conf Configuration
@figure{/build/build_occt/images/android_image001.png}
Before building it is necessary to set up build environment.
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling", and click "Next".
@figure{/build/build_occt/images/android_image002.png}
The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited directly:
- Specify a toolchain file at the next dialog to `android.toolchain.cmake`, and click "Finish".
@figure{/build/build_occt/images/android_image003.png}
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*.
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
If `ANDROID_NDK` environment variable is not defined in current OS, add cache entry `ANDROID_NDK` (entry type is `PATH`) -- path to the NDK folder ("Add Entry" button):
@figure{/build/build_occt/images/android_image004.png}
If on Windows the message is appeared:
"CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles" CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
specify `CMAKE_MAKE_PROGRAM` to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
How to configure OCCT, see @ref build_cmake_conf "Configure" section taking into account the specific configuration variables for Android:
- `ANDROID_ABI` = `armeabi-v7a`
- `ANDROID_NATIVE_API_LEVEL` = `15`
- `ANDROID_NDK_LAYOUT` is equal to `CMAKE_BUILD_TYPE` variable
- `BUILD_MODULE_Draw` = `OFF`
@figure{/build/build_occt/images/android_image006.png}
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process:
> mingw32-make
or
> make
Parallel building can be started with using `-jN` argument of "mingw32-make/make", where `N` is the number of building threads:
> mingw32-make -j4
or
> make -j4
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder:
> mingw32-make install
or
> make install
@section build_occt_genproj Building with Genproj tool
**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code::Blocks, Qt Creator (qmake), and XCode project files for building Open CASCADE Technology.
These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
The project files included in official distribution of OCCT are generated by this tool.
@note If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
**genproj** is a less flexible alternative to use of CMake build system (see @ref build_occt_win_cmake), but still has some small features useful for OCCT development.
@subsection build_genproj Configuration process
The environment is defined in the file *custom.sh* (on Linux and macOS) or *custom.bat* (on Windows) which can be edited directly:
* `ARCH` -- architecture (32 or 64), affects only `PATH` variable for execution
* `HAVE_*` -- flags to enable or disable use of optional third-party products
* `CSF_OPT_*` -- paths to search for includes and binaries of all used third-party products
* `SHORTCUT_HEADERS` -- defines method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~~
export HAVE_FREEIMAGE=false
~~~~~
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure environment interactively:
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
@subsubsection build_codeblocks_gen Projects generation
Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files:
~~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj cbp
~~~~~
The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
@subsubsection build_codeblocks_build Building
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~~
./draw.sh cbp [d]
~~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsection build_occt_genproj Building with Genproj tool
This page describes steps to build OCCT libraries from a complete source archive on Windows with <b>MS Visual C++</b> using projects generated by **genproj** tool.
It is an alternative to use of CMake build system (see @ref build_occt_win_cmake).
**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code.Blocks, and XCode project files used for building Open CASCADE Technology.
These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
The project files included in official distribution of OCCT are generated by this tool.
If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
@subsubsection build_msvc_3rdparty Third-party libraries
Before building OCCT, make sure to have all the required third-party libraries installed.
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from https://opencascade.com/content/3rd-party-components.
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
@subsubsection build_msvc_conf Configuration
If you have Visual Studio projects already available (pre-installed or generated), you can edit file *custom.bat* manually to adjust the environment:
* *VCVER* -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
* *HardLink* - hard links to headers located in *src* will be created.
* `VCVER` -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
* Add paths to includes of used third-party libraries in variable `CSF_OPT_INC`.
* Add paths to their binary libraries in variable `CSF_OPT_LIB64`.
* For optional third-party libraries, set corresponding environment variable `HAVE_<LIBRARY_NAME>` to either *false*, e.g. `export HAVE_FREEIMAGE=false`.
| VCVER | Visual Studio version | Windows Platform | Binaries folder name |
|-----------|-----------------------|----------------------------------|----------------------|
@@ -317,267 +325,85 @@ If you have Visual Studio projects already available (pre-installed or generated
| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
* *ARCH* -- architecture (32 or 64), affects only *PATH* variable for execution
* <i>HAVE_*</i> -- flags to enable or disable use of optional third-party products
* <i>CSF_OPT_*</i> -- paths to search for includes and binaries of all used third-party products
* *SHORTCUT_HEADERS* -- defines method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
That tool will analyze your environment and propose you to choose available options:
* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*).
* Type and version of project files to generate (from the list of installed ones, detected by presence of environment variables like `VS100COMNTOOLS` on Windows platform).
* Method to populate folder *inc* (short-cuts by default).
* Location of third-party libraries (usually downloaded from OCCT web site, see above).
* Path to common directory where third-party libraries are located (optional).
* Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
* Generation of PDB files within Release build ("Release with Debug info", false by default).
Below are screenshots of **genconf** tool on various platforms (Windows and Linux):
@figure{/build/build_occt/images/genconf_windows.png}
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.bat* file.
@subsubsection build_msvc_generate Projects generation
Click "Save" to store the specified configuration in *custom.bat* (Windows) or *custom.sh* (other systems) file.
@subsection build_genproj_generate Projects generation
Launch **genproj** to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by `PATH`.
If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
~~~~~
~~~~
$ genproj.bat
~~~~~
~~~~
Note that if *custom.bat* is not present, **genproj** will start **genconf** to configure environment.
@subsubsection build_msvc_build Building
@subsection build_genproj_build Building
@subsubsection build_msvc_build Visual Studio
Launch *msvc.bat* to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.
Note: the MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
The MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
Binaries are produced in *win32* or *win64* folders.
To start DRAW, launch *draw.bat*.
@section build_occt_linux Linux
@subsubsection build_codeblocks_build Code::Blocks
You may choose one of the following ways to generate, configure and build OCCT sources on Linux just keeping in mind
this platform specific:
Code::Blocks is a cross-platform IDE which can be used for building OCCT on Linux, macOS and Windows platforms.
The generated Code::Blocks project could be found within subfolder *adm/&lt;OS&gt;/cbp*.
* @ref build_occt_win_cmake "Configuration, generation and building OCCT on Windows using CMake tool"
* @ref build_occt_code_blocks "Building on Mac OS X with Code::Blocks IDE"
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
@section build_occt_crossplatform_cmake Android (cross-compiling)
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~
./draw.sh cbp [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
This article describes the steps to build OCCT libraries for Android from a complete source package
with GNU make (makefiles). The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference:
makefiles are built with mingw32-make
on Windows and native GNU make on Ubuntu.
@subsubsection build_occt_macos_xcode XCode
Required tools (download and install if it is required):
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
- GNU Make: MinGW v4.82+ for Windows (http://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
XCode is an IDE for development on macOS platform and targeting macOS and iOS platforms.
**genproj** tool comes with a legacy XCode project files generator, but CMake is a preferred way for building OCCT on macOS platform.
Run GUI tool provided by CMake.
@subsection build_occt_crossplatform_cmake_config Configuration
**Configure Tools**
- Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
@figure{/build/build_occt/images/android_image001.png}
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling"
- Click "Next"
@figure{/build/build_occt/images/android_image002.png}
- Specify a toolchain file at the next dialog by android.toolchain.cmake . It is contained by cross-compilation
toolchain for CMake
- Click "Finish"
@figure{/build/build_occt/images/android_image003.png}
If ANDROID_NDK environment variable is not defined in current OS, add cache entry ANDROID_NDK (entry type is PATH) --
path to the NDK folder ("Add Entry" button)
@figure{/build/build_occt/images/android_image004.png}
If on Windows the message is appeared: "CMake Error: CMake was unable to find a build program corresponding
to "MinGW Makefiles"
CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
specify **CMAKE_MAKE_PROGRAM** to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
**Configure OCCT**
How to configure OCCT, see "OCCT Configuration" section of @ref build_occt_win_cmake
"Configure, Generate, Build using CMake tool" taking into account the specific configuration variables for android:
- ANDROID_ABI = armeabi-v7a
- ANDROID_NATIVE_API_LEVEL = 15
- ANDROID_NDK_LAYOUT is equal to CMAKE_BUILD_TYPE variable
- **BUILD_MODULE_Draw = OFF**
@figure{/build/build_occt/images/android_image006.png}
@subsection build_occt_crossplatform_cmake_generation Generate Makefiles
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
@subsection build_occt_crossplatform_cmake_building Build Makefiles
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process.
> mingw32-make
or
> make
Parallel building can be started with using **"-jN"** argument of "mingw32-make/make", where N is the number of
building threads.
> mingw32-make -j4
or
> make -j4
@subsection build_occt_crossplatform_cmake_install Install OCCT Libraries
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder
> mingw32-make install
or
> make install
@section build_occt_macos Mac OS X
@subsection build_occt_macos_xcode Building with Xcode
This file describes steps to build OCCT libraries from sources on Mac OS X with **Xcode** projects, generated by OCCT legacy tool **genproj**.
<h2>Configuration</h2>
Before building it is necessary to set up build environment.
The environment is defined in the file *custom.sh* which can be edited directly:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC* (use colon ":" as path separator).
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~~
export HAVE_GL2PS=false
~~~~~
Alternatively, or when *custom.sh* does not exist, you can launch *genconf.sh* to configure environment interactively:
@figure{/build/build_occt/images/genconf_osx.png}
Click "Save" to store the specified configuration in *custom.sh* file.
<h2>Projects generation</h2>
Launch **genproj** tool to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
For instance, in Terminal application:
~~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj
~~~~~
<h2>Building</h2>
To start **Xcode**, launch script *xcode.sh*.
To build a certain toolkit, select it in **Scheme** drop-down list in Xcode toolbar, press **Product** in the menu and click **Build** button.
To start **XCode**, launch script *xcode.sh*.
To build a certain toolkit, select it in **Scheme** drop-down list in XCode toolbar, press **Product** in the menu and click **Build** button.
To build the entire OCCT:
* Create a new empty project (select **File -> New -> Project -> Empty project** in the menu; input the project name, e.g. *OCCT*; then click **Next** and **Create**).
* Drag and drop the *OCCT* folder in the created *OCCT* project in the Project navigator.
* Select **File -> New -> Target -> Aggregate** in the menu.
* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
<h2>Launching DRAW</h2>
To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the following steps:
To start *DRAWEXE*, which has been built with XCode on Mac OS X, perform the following steps:
1.Open Terminal application
2.Enter <i>\<OCCT_ROOT_DIR\></i>:
~~~~~
2.Enter `<OCCT_ROOT_DIR>`:
~~~~
cd \<OCCT_ROOT_DIR\>
~~~~~
~~~~
3.Run the script
~~~~~
./draw_cbp.sh xcd [d]
~~~~~
~~~~
./draw.sh xcd [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsection build_occt_code_blocks Building with Code::Blocks
This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using
project files generated by OCCT legacy tool **genproj**.
<h2>Configure</h2>
Before building it is necessary to set up build environment.
The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited
directly:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*.
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~~
export HAVE_GL2PS=false
~~~~~
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure
environment interactively:
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
<h2>Generate Projects</h2>
Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in
OCCT code affecting layout or composition of source files:
~~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj cbp
~~~~~
The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
<h2>Build</h2>
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~~
./draw_cbp.sh cbp [d]
~~~~~
Option *d* is used if OCCT has been built in **Debug** mode.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

View File

@@ -48,11 +48,11 @@ For example, method *GetCoord* returns a triple of real values and is defined fo
Camel Case style is preferred for names.
For example:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer awidthofbox; // this is bad
Standard_Integer width_of_box; // this is bad
Standard_Integer aWidthOfBox; // this is OK
~~~~~
~~~~
@subsection occt_coding_rules_2_2 Names of development units
@@ -80,9 +80,9 @@ Toolkit names are prefixed by *TK*, followed by a meaningful part of the name ex
Names of public classes and other types (structures, enums, typedefs) should match the common pattern: name of the package followed by underscore and suffix (the own name of the type):
~~~~~
~~~~{.cpp}
<package-name>_<class-name>
~~~~~
~~~~
Static methods related to the whole package are defined in the class with the same name as package (without suffix).
@@ -95,9 +95,9 @@ This rule also applies to complex types constructed by instantiation of template
Such types should be given own names using *typedef* statement, located in same-named header file.
For example, see definition in the file *TColStd_IndexedDataMapOfStringString.hxx*:
~~~~~
~~~~{.cpp}
typedef NCollection_IndexedDataMap<TCollection_AsciiString,TCollection_AsciiString,TCollection_AsciiString> TColStd_IndexedDataMapOfStringString;
~~~~~
~~~~
### Names of functions
@@ -109,7 +109,7 @@ The term **function** here is defined as:
It is preferred to start names of public methods from an upper case character and to start names of protected and private methods from a lower case character.
~~~~~{.cpp}
~~~~{.cpp}
class MyPackage_MyClass
{
@@ -123,7 +123,7 @@ private:
void setIntegerValue (const Standard_Integer theValue);
};
~~~~~
~~~~
@subsection occt_coding_rules_2_3 Names of variables
@@ -137,13 +137,13 @@ The name of a variable should not start with an underscore.
See the following examples:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer Elapsed_Time = 0; // this is bad - possible class name
Standard_Integer gp = 0; // this is bad - existing package name
Standard_Integer aGp = 0; // this is OK
Standard_Integer _KERNEL = 0; // this is bad
Standard_Integer THE_KERNEL = 0; // this is OK
~~~~~
~~~~
### Names of function parameters
@@ -151,11 +151,11 @@ The name of a function (procedure, class method) parameter should start with pre
See the following examples:
~~~~~{.cpp}
~~~~{.cpp}
void Package_MyClass::MyFunction (const gp_Pnt& p); // this is bad
void Package_MyClass::MyFunction (const gp_Pnt& theP); // this is OK
void Package_MyClass::MyFunction (const gp_Pnt& thePoint); // this is preferred
~~~~~
~~~~
### Names of class member variables
@@ -163,11 +163,11 @@ The name of a class member variable should start with prefix *my* followed by th
See the following examples:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer counter; // This is bad
Standard_Integer myC; // This is OK
Standard_Integer myCounter; // This is preferred
~~~~~
~~~~
### Names of global variables
@@ -176,18 +176,18 @@ However, as soon as a global variable is necessary, its name should be prefixed
See the following examples:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer MyPackage_myGlobalVariable = 0;
Standard_Integer MyPackage_MyClass_myGlobalVariable = 0;
~~~~~
~~~~
Static constants within the file should be written in upper-case and begin with prefix *THE_*:
~~~~~{.cpp}
~~~~{.cpp}
namespace
{
static const Standard_Real THE_CONSTANT_COEF = 3.14;
};
~~~~~
~~~~
### Names of local variables
@@ -197,12 +197,12 @@ It is preferred to prefix local variable names with *a* and *an* (or *is*, *to*
See the following example:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer theI; // this is bad
Standard_Integer i; // this is bad
Standard_Integer index; // this is bad
Standard_Integer anIndex; // this is OK
~~~~~
~~~~
### Avoid dummy names
Avoid dummy names, such as <i>i, j, k</i>. Such names are meaningless and easy to mix up.
@@ -211,7 +211,7 @@ The code becomes more and more complicated when such dummy names are used there
See the following examples for preferred style:
~~~~~{.cpp}
~~~~{.cpp}
void Average (const Standard_Real** theArray,
Standard_Integer theRowsNb,
Standard_Integer theRowLen,
@@ -227,7 +227,7 @@ void Average (const Standard_Real** theArray,
theResult /= Standard_Real(aRowsNb * aRowLen);
}
}
~~~~~
~~~~
@section occt_coding_rules_3 Formatting rules
@@ -262,7 +262,7 @@ Punctuation rules follow the rules of the English language.
* For better readability it is also recommended to surround conventional operators by a space character.
Examples:
~~~~~{.cpp}
~~~~{.cpp}
while (true) // NOT: while( true ) ...
{
DoSomething (theA, theB, theC, theD); // NOT: DoSomething(theA,theB,theC,theD);
@@ -271,7 +271,7 @@ for (anIter = 0; anIter < 10; ++anIter) // NOT: for (anIter=0;anIter<10;++anIter
{
theA = (theB + theC) * theD; // NOT: theA=(theB+theC)*theD
}
~~~~~
~~~~
### Declaration of pointers and references
@@ -281,7 +281,7 @@ Since declaration of several variables with mixed pointer types contrudicts this
Examples:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer *theVariable; // not recommended
Standard_Integer * theVariable; // not recommended
Standard_Integer* theVariable; // this is OK
@@ -295,7 +295,7 @@ Standard_Integer ** theVariable; // not recommended
Standard_Integer** theVariable; // this is OK
Standard_Integer *theA, theB, **theC; // not recommended (declare each variable independently)
~~~~~
~~~~
### Separate logical blocks
@@ -303,7 +303,7 @@ Separate logical blocks of code with one blank line and comments.
See the following example:
~~~~~{.cpp}
~~~~{.cpp}
// check arguments
Standard_Integer anArgsNb = argCount();
if (anArgsNb < 3 || isSmthInvalid)
@@ -318,7 +318,7 @@ if (anArgsNb < 3 || isSmthInvalid)
// do our job
...
...
~~~~~
~~~~
Notice that multiple blank lines should be avoided.
@@ -329,7 +329,7 @@ Each descriptive block should contain at least a function name and purpose descr
See the following example:
~~~~~{.cpp}
~~~~{.cpp}
// =======================================================================
// function : TellMeSmthGood
// purpose : Gives me good news
@@ -347,19 +347,19 @@ void TellMeSmthBad()
{
...
}
~~~~~
~~~~
### Block layout [MANDATORY]
Figure brackets <i>{ }</i> and each operator <i>(for, if, else, try, catch)</i> should be written on a dedicated line.
In general, the layout should be as follows:
~~~~~{.cpp}
~~~~{.cpp}
while (expression)
{
...
}
~~~~~
~~~~
Entering a block increases and leaving a block decreases the indentation by one tabulation.
@@ -367,7 +367,7 @@ Entering a block increases and leaving a block decreases the indentation by one
Single-line conditional operators <i>(if, while, for,</i> etc.) can be written without brackets on the following line.
~~~~~{.cpp}
~~~~{.cpp}
if (!myIsInit) return Standard_False; // bad
if (thePtr == NULL) // OK
@@ -377,7 +377,7 @@ if (!theAlgo.IsNull()) // preferred
{
DoSomething();
}
~~~~~
~~~~
Having all code in the same line is less convenient for debugging.
@@ -386,7 +386,7 @@ Having all code in the same line is less convenient for debugging.
In comparisons, put the variable (in the current context) on the left side and constant on the right side of expression.
That is, the so called "Yoda style" is to be avoided.
~~~~~{.cpp}
~~~~{.cpp}
if (NULL != thePointer) // Yoda style, not recommended
if (thePointer != NULL) // OK
@@ -398,13 +398,13 @@ if (anIter <= theNbValues) // OK
if (THE_LIMIT == theValue) // bad style (global constant vs. variable)
if (theValue == THE_LIMIT) // OK
~~~~~
~~~~
### Alignment
Use alignment wherever it enhances the readability. See the following example:
~~~~~{.cpp}
~~~~{.cpp}
MyPackage_MyClass anObject;
Standard_Real aMinimum = 0.0;
Standard_Integer aVal = theVal;
@@ -415,7 +415,7 @@ switch (aVal)
case 3:
default: computeSomethingElseYet(); break;
}
~~~~~
~~~~
### Indentation of comments
@@ -425,7 +425,7 @@ The text of the comment should be separated from the slash character by a single
See the following example:
~~~~~{.cpp}
~~~~{.cpp}
while (expression) //bad comment
{
// this is a long multi-line comment
@@ -433,7 +433,7 @@ while (expression) //bad comment
DoSomething(); // maybe, enough
DoSomethingMore(); // again
}
~~~~~
~~~~
### Early return statement
@@ -441,7 +441,7 @@ Use an early return condition rather than collect indentations.
Write like this:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer ComputeSumm (const Standard_Integer* theArray,
const Standard_Size theSize)
{
@@ -454,11 +454,11 @@ Standard_Integer ComputeSumm (const Standard_Integer* theArray,
... computing summ ...
return aSumm;
}
~~~~~
~~~~
Rather than:
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer ComputeSumm (const Standard_Integer* theArray,
const Standard_Size theSize)
{
@@ -469,7 +469,7 @@ Standard_Integer ComputeSumm (const Standard_Integer* theArray,
}
return aSumm;
}
~~~~~
~~~~
This helps to improve readability and reduce the unnecessary indentation depth.
@@ -490,7 +490,7 @@ An exception to the rule is ordering system headers generating a macros declarat
The source or header file should include only minimal set of headers necessary for compilation, without duplicates (considering nested includes).
~~~~~{.cpp}
~~~~{.cpp}
// the header file of implemented class
#include <PackageName_ClassName.hxx>
@@ -506,7 +506,7 @@ The source or header file should include only minimal set of headers necessary f
// system headers
#include <iostream>
#include <windows.h>
~~~~~
~~~~
@section occt_coding_rules_4 Documentation rules
@@ -623,7 +623,7 @@ A class with virtual function(s) ought to have a virtual destructor.
Declaration of overriding method should contains specifiers "virtual" and "override"
(using Standard_OVERRIDE alias for compatibility with old compilers).
~~~~~{.cpp}
~~~~{.cpp}
class MyPackage_BaseClass
{
@@ -641,7 +641,7 @@ public:
Standard_EXPORT virtual Standard_Boolean Perform() Standard_OVERRIDE;
};
~~~~~
~~~~
This makes class definition more clear (virtual methods become highlighted).
@@ -667,20 +667,20 @@ Avoid *goto* statement unless it is really needed.
Declare a cycle variable in the header of the *for()* statement if not used out of cycle.
~~~~~{.cpp}
~~~~{.cpp}
Standard_Real aMinDist = Precision::Infinite();
for (NCollection_Sequence<gp_Pnt>::Iterator aPntIter (theSequence);
aPntIter.More(); aPntIter.Next())
{
aMinDist = Min (aMinDist, theOrigin.Distance (aPntIter.Value()));
}
~~~~~
~~~~
### Condition statements within zero
Avoid usage of C-style comparison for non-boolean variables:
~~~~~{.cpp}
~~~~{.cpp}
void Function (Standard_Integer theValue,
Standard_Real* thePointer)
{
@@ -699,7 +699,7 @@ void Function (Standard_Integer theValue,
DoSome2();
}
}
~~~~~
~~~~
@section occt_coding_rules_7 Portability issues
@@ -791,11 +791,11 @@ In C++ use *new* and *delete* operators instead of *malloc()* and *free()*. Try
Use the same form of new and delete.
~~~~~{.cpp}
~~~~{.cpp}
aPtr1 = new TypeA[n]; ... ; delete[] aPtr1;
aPtr2 = new TypeB(); ... ; delete aPtr2;
aPtr3 = Standard::Allocate (4096); ... ; Standard::Free (aPtr3);
~~~~~
~~~~
### Methods managing dynamical allocation [MANDATORY]
@@ -805,10 +805,10 @@ Define a destructor, a copy constructor and an assignment operator for classes w
Every variable should be initialized.
~~~~~{.cpp}
~~~~{.cpp}
Standard_Integer aTmpVar1; // bad
Standard_Integer aTmpVar2 = 0; // OK
~~~~~
~~~~
Uninitialized variables might be kept only within performance-sensitive code blocks and only when their initialization is guaranteed by subsequent code.
@@ -824,12 +824,12 @@ In *operator=()* assign to all data members and check for assignment to self.
Don't check floats for equality or non-equality; check for GT, GE, LT or LE.
~~~~~{.cpp}
~~~~{.cpp}
if (Abs (theFloat1 - theFloat2) < theTolerance)
{
DoSome();
}
~~~~~
~~~~
Package *Precision* provides standard values for SI units and widely adopted by existing modeling algorithms:
@@ -872,7 +872,7 @@ Generally, try to reduce misaligned accesses since they impact the performance (
List class data members in the constructor's initialization list in the order they are declared.
~~~~~{.cpp}
~~~~{.cpp}
class MyPackage_MyClass
{
@@ -892,19 +892,19 @@ private:
Standard_Integer myPropertyB;
};
~~~~~
~~~~
### Initialization over assignment
Prefer initialization over assignment in class constructors.
~~~~~{.cpp}
~~~~{.cpp}
MyPackage_MyClass()
: myPropertyA (1) // preferred
{
myPropertyB = 2; // not recommended
}
~~~~~
~~~~
### Optimize caching
@@ -912,23 +912,23 @@ When programming procedures with extensive memory access, try to optimize them i
On x86 this code
~~~~~{.cpp}
~~~~{.cpp}
Standard_Real anArray[4096][2];
for (Standard_Integer anIter = 0; anIter < 4096; ++anIter)
{
anArray[anIter][0] = anArray[anIter][1];
}
~~~~~
~~~~
is more efficient then
~~~~~{.cpp}
~~~~{.cpp}
Standard_Real anArray[2][4096];
for (Standard_Integer anIter = 0; anIter < 4096; ++anIter)
{
anArray[0][anIter] = anArray[1][anIter];
}
~~~~~
~~~~
since linear access does not invalidate cache too often.
@@ -952,7 +952,7 @@ Command arguments should be validated before usage. The user should see a human-
Command should warn the user about unknown arguments, including cases when extra parameters have been pushed for the command with a fixed number of arguments.
~~~~~{.cpp}
~~~~{.cpp}
if (theArgsNb != 3)
{
std::cout << "Syntax error - wrong number of arguments!\n";
@@ -971,7 +971,7 @@ Command should warn the user about unknown arguments, including cases when extra
}
DBRep::Set (aResName, aFaceShape);
return 0;
~~~~~
~~~~
### Message printing
@@ -984,9 +984,9 @@ Information printed into Draw Interpreter should be well-structured to allow usa
Any command with a long list of obligatory parameters should be considered as ill-formed by design.
Optional parameters should start with flag name (with '-' prefix) and followed by its values:
~~~~~{.tcl}
~~~~{.php}
myCommand -flag1 value1 value2 -flag2 value3
~~~~~
~~~~
### Arguments parser
@@ -996,7 +996,7 @@ myCommand -flag1 value1 value2 -flag2 value3
Functions *Draw::Atof()* and *Draw::Atoi()* support expressions and read values in C-locale.
~~~~~{.cpp}
~~~~{.cpp}
Standard_Real aPosition[3] = {0.0, 0.0, 0.0};
for (Standard_Integer anArgIter = 1; anArgIter < theArgsNb; ++anArgIter)
{
@@ -1020,7 +1020,7 @@ Functions *Draw::Atof()* and *Draw::Atoi()* support expressions and read values
return 1;
}
}
~~~~~
~~~~
@section occt_coding_rules_11 Examples
@@ -1051,7 +1051,7 @@ private: //! \@name private fields
@endverbatim
~~~~~
~~~~{.cpp}
#include <Package_Class.hxx>
// ==========================================================
// function : Square
@@ -1071,11 +1071,11 @@ void Package_Class::increment()
{
++myCounter;
}
~~~~~
~~~~
### TCL script for Draw Harness
~~~~~{.tcl}
~~~~{.tcl}
# show fragments (solids) in shading with different colors
proc DisplayColored {theShape} {
set aSolids [uplevel #0 explode $theShape so]
@@ -1106,10 +1106,10 @@ vzbufftrihedron
DisplayColored c
vfit
vdump $imagedir/${casename}.png 512 512
~~~~~
~~~~
### GLSL program:
~~~~~{.fs}
~~~~{.cpp}
vec3 Ambient; //!< Ambient contribution of light sources
vec3 Diffuse; //!< Diffuse contribution of light sources
vec3 Specular; //!< Specular contribution of light sources
@@ -1149,4 +1149,4 @@ void main()
normalize (View),
Position);
}
~~~~~
~~~~

View File

@@ -152,11 +152,11 @@ The official repository contains:
Make sure to configure Git so that the user name is equal to your username
on the OCCT development portal, and set SafeCrLf option to true:
~~~~~
~~~~
> git config --global user.name "Your User Name"
> git config --global user.email your@mail.address
> git config --global your@mail.address
~~~~~
~~~~
@section occt_gitguide_3 Getting access to the repository
@@ -213,9 +213,9 @@ The official repository contains:
On Windows, you might need to start **Git Bash** command prompt window.
Use the following command to generate SSH keys:
~~~~~
~~~~
> ssh-keygen -t rsa -C "your@mail.address"
~~~~~
~~~~
The last argument is an optional comment, which can be included with the public key and used to distinguish between different keys (if you have many). The common practice is to put here your mail address or workstation name.
@@ -290,9 +290,9 @@ Click **Save** to input the key to the system.
* From command line by command:
~~~~~
~~~~
> git clone gitolite@git.dev.opencascade.org:occt <path>
~~~~~
~~~~
where <i>\<path\></i> is the path to the new folder which will be created for the repository.
@@ -314,9 +314,9 @@ Click **Save** to input the key to the system.
In the console:
~~~~~
~~~~
> git checkout -b CR12345 origin/master
~~~~~
~~~~
In TortoiseGit:
* Go to the local copy of the repository.
@@ -332,9 +332,9 @@ In TortoiseGit:
If you need to switch to another branch, use Git command checkout for that.
In the console:
~~~~~
~~~~
> git checkout CR12345
~~~~~
~~~~
In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Switch/Checkout**.
@@ -351,11 +351,11 @@ In TortoiseGit:
* In the console:
~~~~~
~~~~
> git diff
> git commit -a -m "Write meaningful commit message here"
~~~~~
~~~~
Option -a tells the command to automatically include (stage) files
that have been modified or deleted, but it will omit the new files that might have been added by you.
@@ -363,12 +363,12 @@ In TortoiseGit:
To find new unstaged files and them to commit, use commands:
~~~~~
~~~~
> git status -s
?? file1.hxx
?? file2.cxx
> git add file1.hxx file2.cxx
~~~~~
~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu <b>Git Commit -> CR…</b>:
@@ -384,9 +384,9 @@ In TortoiseGit:
* In the console:
~~~~~
~~~~
> git push "origin" CR12345:CR12345
~~~~~
~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu, TortoiseGit -> **Push**
@@ -410,9 +410,9 @@ Note that Git forbids pushing a branch if the corresponding remote branch alread
Use Git command *fetch* with option *prune* to get the update of all branches from the remote repository and to clean your local repository from the remote branches that have been deleted.
* In the console:
~~~~~
~~~~
> git fetch --prune
~~~~~
~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Fetch**. Check in **Prune** check-box.
@@ -423,9 +423,9 @@ Note that Git forbids pushing a branch if the corresponding remote branch alread
This operation is required in particular to update your local master branch when the remote master changes.
* In console:
~~~~~
~~~~
> git pull
~~~~~
~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Pull**.
@@ -436,9 +436,9 @@ Note that the local branches of your repository are the primary place, where you
Remove the local branches that you do not need any more. Note that you cannot delete the current branch. It means that you need to switch to another one (e.g. master) if the branch you are going to delete is the current one.
* In the console:
~~~~~
~~~~
> git branch -d CR12345
~~~~~
~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Git Show Log**.

File diff suppressed because it is too large Load Diff

View File

@@ -49,34 +49,34 @@ Open CASCADE Test Harness or @ref occt_user_guides__test_harness "DRAW" provides
In some cases the objects to be inspected are available in DRAW as results of DRAW commands. In other cases, however, it is necessary to inspect intermediate objects created by the debugged algorithm. To support this, DRAW provides a set of commands allowing the developer to store intermediate objects directly from the debugger stopped at some point during the program execution (usually at a breakpoint).
~~~~~
~~~~{.php}
const char* Draw_Eval (const char *theCommandStr)
~~~~~
~~~~
Evaluates a DRAW command or script.
A command is passed as a string parameter.
~~~~~
~~~~{.php}
const char* DBRep_Set (const char* theNameStr, void* theShapePtr)
~~~~~
~~~~
Sets the specified shape as a value of DRAW interpreter variable with the given name.
- *theNameStr* -- the DRAW interpreter variable name to set.
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
~~~~~
~~~~{.php}
const char* DBRep_SetComp (const char* theNameStr, void* theListPtr)
~~~~~
~~~~
Makes a compound from the specified list of shapes and sets it as a value of DRAW interpreter variable with the given name.
- *theNameStr* -- the DRAW interpreter variable name to set.
- *theListPtr* -- a pointer to *TopTools_ListOfShape* variable.
~~~~~
~~~~{.php}
const char* DrawTrSurf_Set (const char* theNameStr, void* theHandlePtr)
const char* DrawTrSurf_SetPnt (const char* theNameStr, void* thePntPtr)
const char* DrawTrSurf_SetPnt2d (const char* theNameStr, void* thePnt2dPtr)
~~~~~
~~~~
Sets the specified geometric object as a value of DRAW interpreter variable with the given name.
- *theNameStr* -- the DRAW interpreter variable name to set.
@@ -90,27 +90,27 @@ All these functions are defined in *TKDraw* toolkit and return a string indicati
The following functions are provided by *TKBRep* toolkit and can be used from debugger prompt:
~~~~~
~~~~{.php}
const char* BRepTools_Write (const char* theFileNameStr, void* theShapePtr)
~~~~~
~~~~
Saves the specified shape to a file with the given name.
- *theFileNameStr* -- the name of the file where the shape is saved.
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
~~~~~
~~~~{.php}
const char* BRepTools_Dump (void* theShapePtr)
const char* BRepTools_DumpLoc (void* theShapePtr)
~~~~~
~~~~
Dumps shape or its location to cout.
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
The following function is provided by *TKMesh* toolkit:
~~~~~
~~~~{.php}
const char* BRepMesh_Dump (void* theMeshHandlePtr, const char* theFileNameStr)
~~~~~
~~~~
Stores mesh produced in parametric space to BREP file.
- *theMeshHandlePtr* -- a pointer to *Handle(BRepMesh_DataStructureOfDelaun)* variable.
@@ -118,10 +118,10 @@ Stores mesh produced in parametric space to BREP file.
The following functions are provided by *TKTopTest* toolkit:
~~~~~
~~~~{.php}
const char* MeshTest_DrawLinks(const char* theNameStr, void* theFaceAttr)
const char* MeshTest_DrawTriangles(const char* theNameStr, void* theFaceAttr)
~~~~~
~~~~
Sets the edges or triangles from mesh data structure of type *Handle(BRepMesh_FaceAttribute)* as DRAW interpreter variables, assigning a unique name in the form "<theNameStr>_<index>" to each object.
- *theNameStr* -- the prefix to use in names of objects.
@@ -129,9 +129,9 @@ Sets the edges or triangles from mesh data structure of type *Handle(BRepMesh_Fa
The following additional function is provided by *TKGeomBase* toolkit:
~~~~~
~~~~{.php}
const char* GeomTools_Dump (void* theHandlePtr)
~~~~~
~~~~
Dump geometric object to cout.
- *theHandlePtr* -- a pointer to the geometric variable (<i>Handle</i> to *Geom_Geometry* or *Geom2d_Curve* or descendant) to be set.
@@ -174,7 +174,7 @@ It is implemented in 'vaspect' and 'boundingbox' commands.
Json output for Bnd_OBB (using command 'bounding v -obb -dumpJson'):
~~~~~
~~~~{.java}
"Bnd_OBB": {
"Center": {
"gp_XYZ": [1, 2, 3]
@@ -193,7 +193,7 @@ Json output for Bnd_OBB (using command 'bounding v -obb -dumpJson'):
"HDims[2]": 0,
"IsAABox": 1,
}
~~~~~
~~~~
@section occt_debug_vstudio Using Visual Studio debugger
@@ -206,18 +206,18 @@ When the execution is interrupted by a breakpoint, you can use this window to ca
For example, assume that you are debugging a function, where local variable *TopoDS_Edge* *anEdge1* is of interest.
The following set of commands in the Command window will save this edge to file *edge1.brep*, then put it to DRAW variable *e1* and show it maximized in the axonometric DRAW view:
~~~~~
~~~~{.php}
>? ({,,TKBRep.dll}BRepTools_Write)("d:/edge1.brep",(void*)&anEdge1)
0x04a2f234 "d:/edge1.brep"
>? ({,,TKDraw.dll}DBRep_Set)("e1",(void*)&anEdge1)
0x0369eba8 "e1"
>? ({,,TKDraw.dll}Draw_Eval)("donly e1; axo; fit")
0x029a48f0 ""
~~~~~
~~~~
For convenience it is possible to define aliases to commands in this window, for instance (here ">" is prompt provided by the command window; in the Immediate window this symbol should be entered manually):
~~~~~
~~~~{.php}
>alias deval ? ({,,TKDraw}Draw_Eval)
>alias dsetshape ? ({,,TKDraw}DBRep_Set)
>alias dsetcomp ? ({,,TKDraw}DBRep_SetComp)
@@ -229,18 +229,18 @@ For convenience it is possible to define aliases to commands in this window, for
>alias dumploc ? ({,,TKBRep}BRepTools_DumpLoc)
>alias dumpmesh ? ({,,TKMesh}BRepMesh_Dump)
>alias dumpgeom ? ({,,TKGeomBase}GeomTools_Dump)
~~~~~
~~~~
Note that aliases are stored in the Visual Studio user's preferences and it is sufficient to define them once on a workstation. With these aliases, the above example can be reproduced easier (note the space symbol after alias name!):
~~~~~
~~~~{.php}
>saveshape ("d:/edge1.brep",(void*)&anEdge1)
0x04a2f234 "d:/edge1.brep"
>dsetshape ("e1",(void*)&anEdge1)
0x0369eba8 "e1"
>deval ("donly e1; axo; fit")
0x029a48f0 ""
~~~~~
~~~~
Note that there is no guarantee that the call will succeed and will not affect the program execution, thus use this feature at your own risk. In particular, the commands interacting with window system (such as *axo*, *vinit*, etc.) are known to cause application crash when the program is built in 64-bit mode. To avoid this, it is recommended to prepare all necessary view windows in advance, and arrange these windows to avoid overlapping with the Visual Studio window, to ensure that they are visible during debug.
@@ -252,7 +252,7 @@ In Visual Studio 2005-2010 the rules for this display are defined in file *autoe
### \[AutoExpand\] section
~~~~~
~~~~{.cpp}
; Open CASCADE classes
Standard_Transient=<,t> count=<count,d>
Handle_Standard_Transient=<entity,x> count=<entity->count,d> <,t>
@@ -274,11 +274,11 @@ gp_Dir2d=<coord.x,g>, <coord.y,g>
gp_Vec2d=<coord.x,g>, <coord.y,g>
gp_Mat2d={<matrix[0][0],g>,<matrix[0][1],g>}, {<matrix[1][0],g>,<matrix[1][1],g>}
gp_Ax1=loc={<loc.coord.x,g>, <loc.coord.y,g>, <loc.coord.z,g>} vdir={<vdir.coord.x,g>, <vdir.coord.y,g>, <vdir.coord.z,g>}
~~~~~
~~~~
### \[Visualizer\] section
~~~~~
~~~~{.cpp}
; Open CASCADE classes
NCollection_Handle<*> {
@@ -342,7 +342,7 @@ Handle_TCollection_HAsciiString {
#array( expr: ((TCollection_HAsciiString*)$e.entity)->myString.mystring[$i],
size: ((TCollection_HAsciiString*)$e.entity)->myString.mylength) ) )
}
~~~~~
~~~~
In Visual Studio 2012 and later, visualizers can be put in a separate file in subdirectory *Visualizers*. See file *occt.natvis* for example.
@@ -403,7 +403,10 @@ Example of configuration steps for Ubuntu:
7. Run DRAW and perform tests as usual, keeping in mind that running with sanitizer is much heavier than normal build:
> ./draw.sh relwithdeb <br>
> Draw[]> testgrid -parallel 0
~~~~{.php}
Draw[]> testgrid -parallel 0
~~~~
Note that when running tests under sanitizers, behavior may be different.
Known problems (as of CLang 6.0) are:

View File

@@ -332,23 +332,19 @@ For more details, see @ref occt_user_guides__test_harness "Draw Test Harness Man
@section intro_req Requirements
Open CASCADE Technology is designed to be highly portable and is known to
work on wide range of platforms.
Current version is officially certified on Windows (IA-32 and x86-64),
Linux (x86-64), OS X / macOS (x86-64), Android (armv7 and x86), and
iOS (armv7, arm64) platforms.
Open CASCADE Technology is designed to be highly portable and is known to work on wide range of platforms.
Current version is officially certified on Windows (x86-64), Linux (x86-64), OS X / macOS (x86-64, arm64), Android (arm64), and iOS (arm64) platforms.
The tables below describe the recommended software configurations
for which OCCT is certified to work.
The tables below describe the recommended software configurations for which OCCT is certified to work.
@subsection intro_req_cpp C++ Compiler / IDE
| OS | Compiler |
| --------- | ----------- |
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Windows | Microsoft Visual Studio: 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
| OS X / macOS | XCode 6 or newer |
| Android | NDK r10, GNU gcc 4.8 or newer |
| Android | NDK r12, GNU gcc 4.9 or newer |
| Web | Emscripten SDK 1.39 or newer (CLang) |
1) VC++ 141 64-bit is used for regular testing and for building binary package of official release of OCCT on Windows.
@@ -368,12 +364,13 @@ https://www.opencascade.com/content/3rd-party-components
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required |
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | Optional (VR support) |
| Direct3D 9 | Windows | Visualization | Optional (integration with GUI using Direct3D) |
| FreeType 2.4.11-2.7.1 | https://sourceforge.net/projects/freetype/files/ | Visualization | Required |
| FreeImage 3.17.0+ | https://sourceforge.net/projects/freeimage/files | Visualization | Optional (support of common 2D graphic formats) |
| FreeType 2.4+ | https://www.freetype.org/download.html | Visualization | Optional (text rendering) |
| FreeImage 3.17+ | https://sourceforge.net/projects/freeimage/files | Visualization | Optional (support of common 2D graphic formats) |
| FFmpeg 3.1+ | https://www.ffmpeg.org/download.html | Visualization | Optional (video recording) |
| VTK 6.1+ | https://www.vtk.org/download/ | Visualization | Optional (VTK integration) |
| Flex 2.6.4+ and Bison 3.7.1+ | https://sourceforge.net/projects/winflexbison/ | Data Exchange | Optional (update of STEP and ExprIntrp parsers) |
| RapidJSON 1.1+ | https://rapidjson.org/ | Data Exchange | Optional (reading glTF files) |
| Draco 1.4.1+ | https://github.com/google/draco | Data Exchange | Optional (reading compressed glTF files) |
| Tcl/Tk 8.6.3+ <br> or ActiveTcl 8.6 | https://www.tcl.tk/software/tcltk/download.html <br> https://www.activestate.com/activetcl/downloads | DRAW Test Harness | Required |
| Qt Desktop: Qt 4.8.6+ <br> Android: Qt 5.3.2+ | https://www.qt.io/download/ | Samples and demos | Optional (Qt samples) |
| Doxygen 1.8.5+ | https://www.doxygen.nl/download.html | Documentation | Required |
@@ -384,14 +381,14 @@ https://www.opencascade.com/content/3rd-party-components
| Component | Requirement |
| --------- | ----------- |
| Minimum memory | 512 MB, 1 GB recommended |
| Free disk space (complete installation) | 600 MB approx. |
| Free disk space (complete installation) | 1,5 GB approx. |
On desktop, 3D viewer for optimal performance requires graphics processing unit (GPU) supporting OpenGL 3.3 or above.
Ray tracing requires OpenGL 4.0+ or OpenGL 3.3+ with *GL_ARB_texture_buffer_object_rgb32* extension.
Textures within ray tracing will be available only when *GL_ARB_bindless_texture extension* is provided by driver.
On mobile platforms, OpenGL ES 2.0+ is required for 3D viewer (OpenGL ES 3.1+ is recommended).
The ray tracing is not yet available on mobile platforms.
Ray tracing requires OpenGL ES 3.2.
Some old hardware might be unable to execute complex GLSL programs (e.g. with high number of light sources, clipping planes).
OCCT 3D Viewer, in general, supports wide range of graphics hardware - from very old to new.
@@ -646,6 +643,10 @@ on this tool.
**RapidJSON** is an Open Source JSON parser and generator for C++.
RapidJSON is optionally used by OCCT for reading glTF files (https://rapidjson.org/).
**Draco** is an Open Source JSON parser and generator for C++.
Draco is optionally used by OCCT for reading glTF files using KHR_draco_mesh_compression extension (https://github.com/google/draco).
Draco is available under Apache 2.0 license.
**DejaVu** fonts are a font family based on the Vera Fonts under a permissive license (MIT-like, https://dejavu-fonts.github.io/License.html).
DejaVu Sans (basic Latin sub-set) is used by OCCT as fallback font when no system font is available.

View File

@@ -21,7 +21,6 @@ FILE_PATTERNS = *.md *.dox
RECURSIVE = YES
SOURCE_BROWSER = NO
INLINE_SOURCES = YES
COLS_IN_ALPHA_INDEX = 5
GENERATE_DOCSET = NO
GENERATE_CHI = NO
GENERATE_QHP = NO

View File

@@ -21,7 +21,6 @@ FILE_PATTERNS = *.md *.dox
RECURSIVE = YES
SOURCE_BROWSER = NO
INLINE_SOURCES = YES
COLS_IN_ALPHA_INDEX = 5
GENERATE_DOCSET = NO
GENERATE_CHI = NO
GENERATE_QHP = NO

View File

@@ -1,4 +1,4 @@
Draw Demo Scripts {#samples__draw_scripts}
Draw: Demo Scripts {#samples__draw_scripts}
================
All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

115
dox/samples/novice_guide.md Normal file
View File

@@ -0,0 +1,115 @@
Novice Guide {#samples__novice_guide}
=======
@tableofcontents
@section diffs Modeling with OCCT: Key differences
Open CASCADE Technology (OCCT) is an object-oriented C++ framework designed for rapid production of sophisticated CAD/CAM/CAE applications.
In other words, it provides endless possibilities for raw 2D and 3D modeling in C++ environment.
Unlike end-user software, it is used by the application developers and therefore strongly differs from the most popular CAD/CAM/CAE software packages.
OCCT provides building blocks enough for modeling, editing, visualization, and data interoperability of 2D and 3D objects.
By using OCCT, users can create the objects of their desire (or edit already existing ones) using raw code commands.
It is a more complicated process than using GUI-based software, but it provides much more flexibility than even script-based manipulations that are available within existing CAD/CAM/CAE applications.
However, to fully grasp the possibilities of OCCT it is best for the user to have previous experience in C++ at least at a basic level.
@section basics Understanding the principles
If you don't have any programming skills, grasping the full magnitude of OCCT workflow is still an option.
The documentation for OCCT contains several entry points for new users.
It will not explain all OCCT classes but will help to comprehend the workflow and help start thinking in terms of Open CASCADE Technology.
The most basic workflow is described in the @ref occt__tutorial "OCCT Tutorial" - this is an excellent starting point for new users.
In this tutorial you will create a solid model step-by-step using different classes and methods.
Each step of the tutorial contains code snippets and images.
The basics involved in the modeling process are explained.
When the basics of OCCT are clear, the next logical step is to check out @ref samples "sample applications" and examine those that suit your needs.
For these, the best starting point is **OCCTOverview** located in /samples/qt subfolder of OCCT installation.
This sample provides code examples for several actions as well as visualization of these code snippets output.
The Overview interface is dynamically changing based on selected **Category** at the menu.
Additional menu buttons will appear, providing users with subcategories and relevant commands to select one of the actions.
The result will appear in the viewer window, the code will appear at the top right, and in several cases the output will be produced at the bottom right window.
@figure{sample_overview_qt_viewers.png,"Comparison of 3D and 2D viewer windows",240} height=420px
The 3D viewer window has a row of preset interface buttons to customize the visual output.
Those buttons can be grouped into three types, left to right:
- View controls: **Fit all** and **Isometric**, will center the view and reset the camera angles respectively;
- Display mode customization: **HLR,** e.g. "Hidden line removal" (works only when shading is disabled) can be turned on and off;
solid models may be displayed either in **Shading** or **Wireframe** modes. **Transparency** level may be set for models in shading mode;
- The last four buttons in a row are beautifiers enabling Ray-tracing engine and configuring it's parameters.
At the bottom left of the screen the orientation cube (trihedron) is located.
The trihedron interactively shows the position of the camera in relation to the XYZ axis of the displayed data.
The sides of the trihedron are labeled to help with orientation.
Click on a side of the box to orient the camera view along the preferred axis.
The 2D viewer window lacks most of these elements and only have **Fit all** button.
The **Geometry** category of the Overview focuses on primitive objects like dots, lines (including vectors) or planes.
These objects will appear in the viewer after the subcategory is selected.
This section will demonstrate these entities both in 2D and 3D view mode and provide basic examples of parametric creation and data analysis.
@figure{sample_overview_qt_geometry.png,"",240} height=440px
The usage of the functions shown in the Overview is described more thoroughly at the @ref occt_user_guides__modeling_data "Modeling data" section of the documentation.
Additionally, @ref occt_user_guides__modeling_algos "Modeling Algorithms" are used in more complex cases.
The **Topology** section of the Overview demonstrates the functions used in 3D operations.
Multiple use cases are provided, including different object intersections, modifying and calculations.
Some of these use cases are described in the documentation, such as @ref occt_user_guides__inspector "Inspector" usage.
@figure{sample_overview_qt_topology.png,"",240} height=440px
The subsections are grouped as shown on the screenshot before.
Most shapes and primitive objects are introduced and then followed by a set of operations and interactions.
The **Triangulation** segment allows computing the number of triangles on a shape.
This may be inspected via [Poly_Triangulation Class Reference](https://dev.opencascade.org/doc/refman/html/class_poly___triangulation.html) -
a part of the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html),
an overall Open CASCADE code guide that may be used to inspect the key points in classes and their connections.
@figure{sample_overview_qt_triangulation.png,"",240} height=440px
The triangulation uses some of Mesh-related classes - see full description at @ref occt_user_guides__mesh "Mesh" documentation section.
The **Data exchange** section provides examples of how to export and import files of several different formats.
@figure{sample_overview_qt_xde.png,"",240} height=440px
The **OCAF** section gives an introduction for the @ref intro_overview_ocaf "Open CASCADE Application Framework" functionality.
To test these functions, create an object first (box or cylinder).
After that, the object may be modified and saved. Actions are recorded and may be undone or redone.
@figure{sample_overview_qt_ocaf.png,"",240} height=440px
**Viewers** section demonstrates examples of the 2D and 3D visualization outputs.
Check @ref occt_user_guides__visualization "Visualization" section of the documentation for a detailed description.
In addition to these two samples, there are much more that might be of use to a new user based on their particular use case.
Check Readme files in the sample directories to learn more about samples compilation.
**Note:** source code for OCCTOverview is stored at 'samples/qt/OCCTOverview/src' folder in your OCCT root,
and the source code files for examples presented in subsections are stored at 'samples/OCCTOverview/code folder'.
Several utility classes that are not presented in the example window may be found in example source code files.
The overall classes introduction may be found in the @ref occt_user_guides__foundation_classes "Foundation Classes" section of the documentation.
The "Introduction" section contains short descriptions of the most massive entries in the documentation.
@section helps Additional assistance
There are several places that may be of use for new users.
The first one is [Training & E-learning](https://dev.opencascade.org/resources/trainings) page that lists available trainings and describes their specifics.
The second one is the Overview documentation (this document is a part of it) - here you can find information that suits most of the use cases.
This may seem overwhelming at first, but if you have the clear understanding of what do you seek, you will most likely find the required information.
Aside from the Overview documentation itself, the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html) is present.
Use it to check classes descriptions, dependencies and examples.
Additionally, there is a [Forum](https://dev.opencascade.org/forums) where you can contact the OCCT community and developers.

View File

@@ -1,4 +1,4 @@
OCAF Usage {#samples__ocaf}
OCAF: Usage Tutorial {#samples__ocaf}
========
## Getting Started
@@ -128,7 +128,7 @@ ad696002-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
## Implementation of Attribute Transformation in a HXX file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~
\#include <TDF_Attribute.hxx>
\#include <gp_Ax3.hxx>
@@ -223,11 +223,11 @@ private:
gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint;
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
## Implementation of Attribute Transformation in a CPP file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
\#include <MyPackage_Transformation.hxx>
//=======================================================================
@@ -526,7 +526,7 @@ Standard_OStream& MyPackage_Transformation::Dump(Standard_OStream& anOS) const
MyPackage_Transformation::MyPackage_Transformation():myType(gp_Identity){
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
## Implementation of typical actions with standard OCAF attributes.

View File

@@ -1,4 +1,4 @@
Function Mechanism Usage {#samples__ocaf_func}
OCAF: Function Mechanism {#samples__ocaf_func}
========================
Let us describe the usage of the "Function Mechanism" of Open CASCADE Application Framework on a simple example.
@@ -160,7 +160,7 @@ drivers for a function driver table with the help of *TFunction_DriverTable* cl
This is an example of the code for iteration and execution of functions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
// The scope of functions is defined.
Handle(TFunction_Scope) scope = TFunction_Scope::Set( anyLabel );
@@ -180,7 +180,7 @@ drivers for a function driver table with the help of *TFunction_DriverTable* cl
const TDF_LabelList&amp; currentFunctions = iterator.Current();
//The list of current functions is iterated.
TDF_ListIteratorOfLabelList currentterator( currentFucntions );
TDF_ListIteratorOfLabelList currentterator( currentFunctions );
for (; currentIterator.More(); currentIterator.Next())
{
// An interface for the function is created.
@@ -200,14 +200,14 @@ drivers for a function driver table with the help of *TFunction_DriverTable* cl
} // end of iteration of current functions
} // end of iteration of functions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
### Example 2: Cylinder function driver
This is an example of the code for a cylinder function driver. To make the things clearer, the methods
<i>\::Arguments()</i> and <i>\::Results()</i> from the base class are also mentioned.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
// A virtual method ::Arguments() returns a list of arguments of the function.
CylinderDriver::Arguments( TDF_LabelList&amp; args )
@@ -283,4 +283,4 @@ drivers for a function driver table with the help of *TFunction_DriverTable* cl
return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~

View File

@@ -1,176 +1,56 @@
Tutorials and Samples {#samples}
=====================
Tutorial: Modelling a Bottle
----------------------------
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
The purpose of the tutorial is not to explain all OCCT classes but
to help start thinking in terms of the Open CASCADE Technology.
- @subpage samples__tutorials
* @ref samples__novice_guide
<br>A document providing an introductory information to newcomers.
* @ref samples__draw_scripts
<br>A set of demo scripts demonstrating OCCT functionality from DRAW.
These scripts can be also considered as a tutorials on **Tcl** usage within @ref occt_user_guides__test_harness "Draw Harness".
* @ref occt__tutorial
<br>A programming tutorial teaching how to use OCCT services to model a 3D object.
See also @ref samples_qt_tutorial
* @ref samples__ocaf
<br>A set of code snippets performing typical actions with @ref occt_user_guides__ocaf "OCAF" services for newcomers.
* @ref samples__ocaf_func
<br>A simple example dedicated to the usage of "Function Mechanism" of @ref occt_user_guides__ocaf "OCCT Application Framework".
- @subpage samples__projects
* @ref samples_qt_iesample
<br>A cross-platform multi-document 3D Viewer sample with CAD import / export functionality based on **Qt Widgets** framework.
* @ref samples_qml_android_occt
<br>A cross-platform 3D Viewer sample with CAD import based on **QtQuick** framework.
* @ref samples_qt_tutorial
<br>A cross-platform sample application based on **Qt Widgets** framework and implementing @ref occt__tutorial.
* @ref samples_qt_overview
<br>A sample application interactively demonstrating OCCT C++ usage with code snippets for newcomers.
* @ref samples_mfc_standard
<br>A set of projects for Windows platform demonstrating OCCT usage based on **Microsoft Foundation Class** (**MFC**) library.
* @ref samples_csharp_occt
<br>A Multi-document 3D Viewer sample with CAD import / export functionality based on .NET and **Windows Forms** or **WPF**.
* @ref samples_csharp_direct3d
<br>3D Viewer sample wrapped into Direct3D context based on .NET and **Windows Presentation Foundation** (**WPF**).
* @ref occt_samples_webgl
<br>3D Viewer sample based on **Emscripten SDK** representing a static HTML page to be opened in Web Browser.
* @ref samples_java_android_occt
<br>3D Viewer sample with CAD import for Android mobile platform based on Android SDK and JNI layer.
* @ref occt_samples_ios_uikit
<br>3D Viewer sample for iOS platform based on Apple **UIKit** framework.
This tutorial assumes that the user has experience in using and setting up C++.
From the viewpoint of programming, Open CASCADE Technology is designed
to enhance user's C++ tools with high performance modeling classes, methods and functions.
The combination of these resources allows creating substantial applications.
@page samples__tutorials Tutorials and Demos
- @subpage samples__novice_guide
- @subpage samples__draw_scripts
- @subpage occt__tutorial
- @subpage samples__ocaf
- @subpage samples__ocaf_func
Read more about @subpage occt__tutorial
MFC
---------
Visual C++ programming samples containing 10 Visual C++ projects
illustrating how to use a particular module or functionality.
The list of MFC samples:
* Geometry
* Modeling
* Viewer2d
* Viewer3d
* ImportExport
* Ocaf
* Triangulation
* HLR
* Animation
* Convert
@figure{/samples/images/samples_mvc.png}
**Remarks:**
* MFC samples are available only on Windows platform;
* To start a sample use Open CASCADE Technology\\Samples\\Mfc\\ item of the Start\\Programs menu;
* Read carefully readme.txt to learn about launching and compilation options.
See @subpage samples_mfc_standard "Readme" for details.
Qt
---
OCCT includes several samples based on Qt application framework.
These samples are available on all supported desktop platforms.
To start a sample on Windows use Open CASCADE Technology\\Samples\\Qt\\ item of the Start\\Programs menu.
Import Export
-------------
Import Export programming sample contains 3D Viewer and Import / Export functionality.
@figure{/samples/images/samples_qt.png}
Tutorial
---------
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
The purpose of the tutorial is not to explain all OCCT classes but
to help start thinking in terms of the Open CASCADE Technology.
This tutorial assumes that the user has experience in using and setting up C++.
From the viewpoint of programming, Open CASCADE Technology is designed
to enhance user's C++ tools with high performance modeling classes, methods and functions.
The combination of these resources allows creating substantial applications.
**See also:** @ref occt__tutorial "OCCT Tutorial"
Overview
---------
The Qt application providing samples for basic usage of C++ API of various OCCT functionality.
The samples are organized in several categories according to relevant module of OCCT:
* Geometry
* Topology,
* Triangulation
* DataExchange
* OCAF
* Viewer 2d
* Viewer 3d
Each sample presents geometry view, C++ code fragment and sample output window.
@figure{/samples/images/sample_overview_qt.png}
See \subpage samples_qt_overview "Readme" for details.
C#
---
C# sample demonstrates integration of OCCT 3D Viewer and Import / Export functionality into .NET applications (using Windows Forms and WPF front ends).
@figure{/samples/images/samples_c__ie.png}
Import:
* BRep
* Iges
* Step
Export:
* Brep
* Iges
* Step
* Stl
* Vrml
See @subpage samples_csharp_occt "C# sample Readme" for details.
There is also another C# example with the same functionality, which demonstrates the integration of Direct3D Viewer into .NET applications using WPF front end.
See @subpage samples_csharp_direct3d "Direct3D C# sample Readme" for details.
Android
---------
There are two samples are representing usage OCCT framework on Android mobile platform. They represent an OCCT-based 3D-viewer with CAD import support in formats BREP, STEP and IGES: jniviewer (java) and AndroidQt (qt+qml)
jniviewer
@figure{/samples/images/samples_java_android_occt.jpg}
Java -- See @subpage samples_java_android_occt "Android Java sample Readme" for details.
AndroidQt
@figure{/samples/images/samples_qml_android_occt.jpg}
Qt -- See \subpage samples_qml_android_occt "Android Qt sample Readme" for details.
iOS
---
There is a sample demonstrating usage of OCCT on iOS with Apple UIKit framework.
@figure{/samples/images/sample_ios_uikit.png}
See @subpage occt_samples_ios_uikit "iOS sample Readme" for details.
Web
---------
WebGL Viewer sample demonstrating usage of OCCT 3D Viewer in Web browser with Emscripten SDK can be found in `samples/webgl`.
@figure{/samples/images/sample_webgl.png}
See @subpage occt_samples_webgl "WebGL sample Readme" for details.
OCAF Usage Sample
------------------
The provided set of samples dedicates to get initial knowledge about typical actions with OCAF services. It may be
useful for newcomers.
Read more about @subpage samples__ocaf
OCAF Function Mechanism Usage
-----------------------------
This simple example dedicates to the usage of "Function Mechanism" of OCCT Application Framework. It represents a "nail"
composed by a cone and two cylinders of different radius and height.
Read more about @subpage samples__ocaf_func
Draw Demo Scripts
------------------
A set of demo scripts demonsrates using OCCT functionality from DRAW. These scripts can be also considered as a
tutorials on tcl usage within Draw.
Read more about @subpage samples__draw_scripts
@page samples__projects Sample Projects
- @subpage samples_qt_iesample
- @subpage samples_qml_android_occt
- @subpage samples_qt_tutorial
- @subpage samples_qt_overview
- @subpage samples_mfc_standard
- @subpage samples_csharp_occt
- @subpage samples_csharp_direct3d
- @subpage occt_samples_webgl
- @subpage samples_java_android_occt
- @subpage occt_samples_ios_uikit

View File

@@ -811,7 +811,7 @@ The following example illustrates how to use the GF algorithm:
#### Usage of the GF algorithm on C++ level
~~~~
~~~~{.cpp}
BOPAlgo_Builder aBuilder;
// Setting arguments
TopTools_ListOfShape aLSObjects = …; // Objects
@@ -865,7 +865,7 @@ const TopoDS_Shape& aResult = aBuilder.Shape();
#### Usage of the GF algorithm on Tcl level
~~~~
~~~~{.cpp}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10
@@ -1199,7 +1199,7 @@ It is based on the General Fuse algorithm, thus all options of the General Fuse
@subsubsection specification__boolean_8_3_1 API
On the low level the Splitter algorithm is implemented in class *BOPAlgo_Splitter*. The usage of this algorithm looks as follows:
~~~~~
~~~~{.cpp}
BOPAlgo_Splitter aSplitter;
// Setting arguments and tools
TopTools_ListOfShape aLSObjects = …; // Objects
@@ -1218,12 +1218,12 @@ if (aSplitter.HasErrors()) { //check error status
}
//
const TopoDS_Shape& aResult = aSplitter.Shape(); // result of the operation
~~~~~
~~~~
@subsubsection specification__boolean_8_3_2 DRAW
The command *bsplit* implements the Splitter algorithm in DRAW. Similarly to the *bbuild* command for the General Fuse algorithm, the *bsplit* command should be used after the Pave Filler is filled.
~~~~~
~~~~{.cpp}
# s1 s2 s3 - objects
# t1 t2 t3 - tools
bclearobjects
@@ -1232,7 +1232,7 @@ baddobjects s1 s2 s3
baddtools t1 t2 t3
bfillds
bsplit result
~~~~~
~~~~
@subsection specification__boolean_8_4 Examples
@@ -1240,7 +1240,7 @@ bsplit result
Splitting a face by the set of edges:
~~~~
~~~~{.cpp}
# draw script for reproducing
bclearobjects
bcleartools
@@ -1286,7 +1286,7 @@ bsplit result
Splitting a plate by the set of cylinders:
~~~~
~~~~{.cpp}
# draw script for reproducing:
bclearobjects
bcleartools
@@ -1677,7 +1677,7 @@ Let us consider face *F1* and solid *S2* that have an intersection curve:
@figure{/specification/boolean_operations/images/boolean_image046.png,"",230}
* The result of *Cut21* operation is is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
* The result of *Cut21* operation is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
@subsubsection specification__boolean_9_4_16 Case 16: A Face and a Solid that have overlapping faces.
@@ -1695,7 +1695,7 @@ Let us consider face *F1* and solid *S2* that have overlapping faces:
@figure{/specification/boolean_operations/images/boolean_image049.png,"",230}
* The result of *Cut21* operation is is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
* The result of *Cut21* operation is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
@subsubsection specification__boolean_9_4_17 Case 17: A Face and a Solid that have overlapping edges.
@@ -1712,7 +1712,7 @@ Let us consider face *F1* and solid *S2* that have overlapping edges:
@figure{/specification/boolean_operations/images/boolean_image051.png,"",230}
* The result of *Cut21* operation is is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
* The result of *Cut21* operation is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
@subsubsection specification__boolean_9_4_18 Case 18: A Face and a Solid that have overlapping vertices.
@@ -1728,7 +1728,7 @@ Let us consider face *F1* and solid *S2* that have overlapping vertices:
@figure{/specification/boolean_operations/images/boolean_image053.png,"",230}
* The result of *Cut21* operation is is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
* The result of *Cut21* operation is not defined because the dimension of the face (2) is less than the dimension of the solid (3).
@subsubsection specification__boolean_9_4_19 Case 19: Two intersecting Solids.
@@ -2182,7 +2182,7 @@ This option is useful e.g. for building a solid from the faces of one shell or f
#### C++ Level
The usage of the algorithm on the API level:
~~~~
~~~~{.cpp}
BOPAlgo_MakerVolume aMV;
// Set the arguments
TopTools_ListOfShape aLS = …; // arguments
@@ -2206,7 +2206,7 @@ const TopoDS_Shape& aResult = aMV.Shape(); // result of the operation
#### Tcl Level
To use the algorithm in Draw the command mkvolume has been implemented. The usage of this command is following:
~~~~
~~~~{.php}
Usage: mkvolume r b1 b2 ... [-c] [-ni] [-ai]
Options:
-c - use this option to have input compounds considered as set of separate arguments (allows passing multiple arguments as one compound);
@@ -2309,7 +2309,7 @@ aResult = aCBuilder.Shape(); // the result
#### DRAW usage
The following set of new commands has been implemented to run the algorithm in DRAW Test Harness:
~~~~
~~~~{.php}
bcbuild : Initialization of the Cells Builder. Use: *bcbuild r*
bcadd : Add parts to result. Use: *bcadd r s1 (0,1) s2 (0,1) ... [-m material [-u]]*
bcaddall : Add all parts to result. Use: *bcaddall r [-m material [-u]]*
@@ -2320,7 +2320,7 @@ bcmakecontainers : Make containers from the parts added to result. Use: *bcmakec
~~~~
Here is the example of the algorithm use on the DRAW level:
~~~~
~~~~{.php}
psphere s1 15
psphere s2 15
psphere s3 15
@@ -2343,7 +2343,7 @@ bcremoveint res
@subsection specification__boolean_10c_Cells_2 Examples
The following simple example illustrates the possibilities of the algorithm working on a cylinder and a sphere intersected by a plane:
~~~~
~~~~{.php}
pcylinder c 10 30
psphere s 15
ttranslate s 0 0 30
@@ -2353,7 +2353,7 @@ mkface f p -25 30 -17 17
@figure{/specification/boolean_operations/images/cells_algorithm_001.png,"Arguments",160}
~~~~
~~~~{.php}
bclearobjects
bcleartools
baddobjects c s f
@@ -2363,7 +2363,7 @@ bcbuild r
#### 1. Common for all arguments
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 s 1 f 1
~~~~
@@ -2372,7 +2372,7 @@ bcadd res c 1 s 1 f 1
#### 2. Common between cylinder and face
~~~~
~~~~{.php}
bcremoveall
bcadd res f 1 c 1
~~~~
@@ -2381,7 +2381,7 @@ bcadd res f 1 c 1
#### 3. Common between cylinder and sphere
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 s 1
~~~~
@@ -2390,7 +2390,7 @@ bcadd res c 1 s 1
#### 4. Fuse of cylinder and sphere
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 -m 1
bcadd res s 1 -m 1
@@ -2401,7 +2401,7 @@ bcremoveint res
#### 5. Parts of the face inside solids - FUSE(COMMON(f, c), COMMON(f, s))
~~~~
~~~~{.php}
bcremoveall
bcadd res f 1 s 1 -m 1
bcadd res f 1 c 1 -m 1
@@ -2409,7 +2409,7 @@ bcadd res f 1 c 1 -m 1
@figure{/specification/boolean_operations/images/cells_algorithm_006_1.png,"Parts of the face inside solids",160}
~~~~
~~~~{.php}
bcremoveint res
~~~~
@@ -2417,7 +2417,7 @@ bcremoveint res
#### 6. Part of the face outside solids
~~~~
~~~~{.php}
bcremoveall
bcadd res f 1 c 0 s 0
~~~~
@@ -2426,7 +2426,7 @@ bcadd res f 1 c 0 s 0
#### 7. Fuse operation (impossible using standard Boolean Fuse operation)
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 -m 1
bcadd res s 1 -m 1
@@ -2788,7 +2788,7 @@ For setting the Gluing options in DRAW it is necessary to call the <i>bglue</i>
* 1 - for partial coincidence;
* 2 - for full coincidence
~~~~
~~~~{.php}
bglue 1
~~~~
@@ -2836,7 +2836,7 @@ To enable the safe processing mode for the operation in DRAW, it is necessary to
* 0 - default value, the safe mode is switched off;
* 1 - the safe mode will be switched on.
~~~~
~~~~{.php}
bnondestructive 1
~~~~
@@ -2867,7 +2867,7 @@ To enable/disable the classification of the solids in DRAW, it is necessary to c
* 0 - disabling the classification;
* 1 - default value, enabling the classification.
~~~~
~~~~{.php}
bcheckinverted 0
~~~~
@@ -2893,7 +2893,7 @@ aGF.SetUseOBB(Standard_True);
To enable/disable the usage of OBB in the operation in DRAW it is necessary to call the *buseobb* command with the appropriate value:
* 0 - disabling the usage of OBB;
* 1 - enabling the usage of OBB.
~~~~
~~~~{.php}
buseobb 1
~~~~
@@ -2919,7 +2919,7 @@ Note that messages corresponding to errors and warnings are defined in resource
These messages can be localized; for that put translated version to separate file and load it in the application by call to *Message_MsgFile::Load()* .
Here is the example of how to use this system:
~~~~~
~~~~{.php}
BOPAlgo_PaveFiller aPF;
aPF.SetArguments(...);
aPF.Perform();
@@ -2934,12 +2934,12 @@ if (aPF.HasErrors()) {
}
...
}
~~~~~
~~~~
DRAW commands executing Boolean operations output errors and warnings generated by these operations in textual form.
Additional option allows saving shapes for which warnings have been generated, as DRAW variables.
To activate this option, run command *bdrawwarnshapes* with argument 1 (or with 0 to deactivate):
~~~~
~~~~{.php}
bdrawwarnshapes 1
~~~~
@@ -2978,7 +2978,7 @@ But if the faces are fully coinciding, the result must be empty, and both faces
Example of the overlapping faces:
~~~~
~~~~{.php}
plane p 0 0 0 0 0 1
mkface f1 p -10 10 -10 10
mkface f2 p 0 20 -10 10
@@ -3005,7 +3005,7 @@ Thus, each of the input edges will be Modified into its two splits.
But in the CUT operation on the same edges, the tool edge will be Deleted from the result and, thus, will not have any Modified shapes.
Example of the intersecting edges:
~~~~
~~~~{.php}
line l1 0 0 0 1 0 0
mkedge e1 l1 -10 10
@@ -3051,7 +3051,7 @@ Two intersecting edges will both have the intersection vertices Generated from t
As for the operation with intersecting faces, consider the following example:
~~~~
~~~~{.php}
plane p1 0 0 0 0 0 1
mkface f1 p1 -10 10 -10 10
@@ -3115,7 +3115,7 @@ For controlling this possibility in DRAW the command **bsimplify** has been impl
Here is the simple example of simplification of the result of Fuse operation of two boxes:
~~~~
~~~~{.php}
bsimplify -f 1
box b1 10 10 15
@@ -3173,7 +3173,7 @@ The following example illustrates how to use General Fuse operator:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepAlgoAPI_BuilderAlgo.hxx>
@@ -3205,7 +3205,7 @@ The following example illustrates how to use General Fuse operator:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10
@@ -3231,7 +3231,7 @@ The following example illustrates how to use the Splitter operator:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepAlgoAPI_Splitter.hxx>
@@ -3265,7 +3265,7 @@ const TopoDS_Shape& aResult = aSplitter.Shape();
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
# objects
box b1 10 10 10
@@ -3297,7 +3297,7 @@ The following example illustrates how to use Common operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Common.hxx>
@@ -3336,7 +3336,7 @@ The following example illustrates how to use Common operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 7 0 4 10 10 10
@@ -3364,7 +3364,7 @@ The following example illustrates how to use Fuse operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Fuse.hxx>
@@ -3403,7 +3403,7 @@ The following example illustrates how to use Fuse operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 7 0 4 10 10 10
@@ -3431,7 +3431,7 @@ The following example illustrates how to use Cut operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Cut.hxx>
@@ -3470,7 +3470,7 @@ The following example illustrates how to use Cut operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 7 0 4 10 10 10
@@ -3499,7 +3499,7 @@ The following example illustrates how to use Section operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Section.hxx>
@@ -3538,7 +3538,7 @@ The following example illustrates how to use Section operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10

View File

@@ -35,12 +35,12 @@ Each of these methods has two arguments:
The following sample code reads a shape from ASCII file and writes it to a binary one:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Shape aShape;
if (BRepTools::Read (aShape, "source_file.txt")) {
BinTools::Write (aShape, "result_file.bin");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@section specification__brep_format_3 Format Common Structure
@@ -54,6 +54,7 @@ The following sample code reads a shape from ASCII file and writes it to a binar
* \<flag\>: = "0" | "1";
* \<int\>: It is an integer number from -2<sup>31</sup> to 2<sup>31</sup>-1 which is written in denary system;
* \<real\>: It is a real from -1.7976931348623158 @f$\cdot@f$ 10<sup>308</sup> to 1.7976931348623158 @f$\cdot@f$ 10<sup>308</sup> which is written in decimal or E form with base 10.The point is used as a delimiter of the integer and fractional parts;
* \<short real\>: It is a real from -3.402823 @f$\cdot@f$ 10<sup>38</sup> to 3.402823 @f$\cdot@f$ 10<sup>38</sup> which is written in decimal or E form with base 10.The point is used as a delimiter of the integer and fractional parts;
* \<2D point\>: = \<real\>\<_\>\<real\>;
* \<3D point\>: = \<real\>(\<_\>\<real)\><sup>2</sup>;
* \<2D direction\>: It is a \<2D point\> *x y* so that *x<sup>2</sup> + y<sup>2</sup>* = 1;
@@ -71,7 +72,7 @@ The following sample code reads a shape from ASCII file and writes it to a binar
\<content type\> = "DBRep_DrawableShape" \<_\\n\>\<_\\n\>;
\<content type\> have other values [1].
\<version\> = ("CASCADE Topology V1, (c) Matra-Datavision" | "CASCADE Topology V2, (c) Matra-Datavision")\<_\\n\>;
\<version\> = ("CASCADE Topology V1, (c) Matra-Datavision" | "CASCADE Topology V2, (c) Matra-Datavision" | "CASCADE Topology V3, (c) Open Cascade")\<_\\n\>;
The difference of the versions is described in the document.
Sections \<locations\>, \<geometry\> and \<shapes\> are described below in separate chapters of the document.
@@ -249,7 +250,7 @@ The example record is interpreted as a line which passes through a point *P*=(1
**BNF-like Definition**
~~~~
~~~~{.cpp}
<3D curve record 2> = "2" <_> <3D circle center> <_> <3D circle N> <_> <3D circle Dx> <_> <3D circle Dy> <_> <3D circle radius> <_\n>;
<3D circle center> = <3D point>;
@@ -282,7 +283,7 @@ The example record is interpreted as a circle which has its center *P*=(1, 2, 3
**BNF-like Definition**
~~~~
~~~~{.cpp}
<3D curve record 3> = "3" <_> <3D ellipse center> <_> <3D ellipse N> <_> <3D ellipse Dmaj> <_> <3D ellipse Dmin> <_> <3D ellipse Rmaj> <_> <3D ellipse Rmin> <_\n>;
<3D ellipse center> = <3D point>;
@@ -317,7 +318,7 @@ The example record is interpreted as an ellipse which has its center *P*=(1, 2,
**BNF-like Definition**
~~~~
~~~~{.cpp}
<3D curve record 4> = "4" <_> <3D parabola origin> <_> <3D parabola N> <_> <3D parabola Dx> <_> <3D parabola Dy> <_> <3D parabola focal length> <_\n>;
<3D parabola origin> = <3D point>;
@@ -351,7 +352,7 @@ The example record is interpreted as a parabola in plane which passes through a
**BNF-like Definition**
~~~~
~~~~{.cpp}
<3D curve record 5> = "5" <_> <3D hyperbola origin> <_> <3D hyperbola N> <_> <3D hyperbola Dx> <_> <3D hyperbola Dy> <_> <3D hyperbola Kx> <_> <3D hyperbola Ky> <_\n>;
<3D hyperbola origin> = <3D point>;
@@ -427,7 +428,7 @@ The example record is interpreted as a Bezier curve with a rational flag *r*=1,
**BNF-like Definition**
~~~~
~~~~{.cpp}
<3D curve record 7> = "7" <_> <3D B-spline rational flag> <_> "0" <_> <3D B-spline degree> <_>
<3D B-spline pole count> <_> <3D B-spline multiplicity knot count> <3D B-spline weight poles>
<_\n> <3D B-spline multiplicity knots> <_\n>;
@@ -491,7 +492,7 @@ The example record is interpreted as a B-spline curve with a rational flag *r*=
**BNF-like Definition**
~~~~
~~~~{.cpp}
<3D curve record 8> = "8" <_> <3D trimmed curve u min> <_> <3D trimmed curve u max> <_\n> <3D curve record>;
<3D trimmed curve u min> = <real>;
@@ -763,7 +764,7 @@ where @f$ V(v)=(5,2,0)+4 \cdot (cos(v) \cdot (1,0,0)+sin(v) \cdot (0,1,0)), V_{D
**BNF-like Definition**
~~~~
~~~~{.cpp}
<surface record 8> = "8" <_> <Bezier surface u rational flag> <_> <Bezier surface v rational flag> <_> <Bezier surface u degree> <_> <Bezier surface v degree> <_>
<Bezier surface weight poles>;
@@ -1075,7 +1076,7 @@ The example record is interpreted as a line which passes through a point *P*=(3
**BNF-like Definition**
~~~~
~~~~{.cpp}
<2D curve record 2> = "2" <_> <2D circle center> <_> <2D circle Dx> <_> <2D circle Dy> <_> <2D circle radius> <_\n>;
<2D circle center> = <2D point>;
@@ -1246,7 +1247,7 @@ The example record is interpreted as a Bezier curve with a rational flag *r*=1,
**BNF-like Definition**
~~~~
~~~~{.cpp}
<2D curve record 7> = "7" <_> <2D B-spline rational flag> <_> "0" <_> <2D B-spline degree> <_> <2D B-spline pole count> <_> <2D B-spline multiplicity knot count> <2D B-spline weight poles> <_\n> <2D B-spline multiplicity knots> <_\n>;
<2D B-spline rational flag> = <flag>;
@@ -1429,15 +1430,15 @@ The example record describes a polyline from *m*=2 nodes with a parameter prese
**BNF-like Definition**
~~~~
~~~~{.cpp}
<triangulations> = <triangulation header> <_\n> <triangulation records>;
<triangulation header> = "Triangulations" <_> <triangulation count>;
<triangulation records> = <triangulation record> ^ <triangulation count>;
<triangulation record> = <triangulation node count> <_> <triangulation triangle count> <_> <triangulation parameter presence flag> <_> <triangulation deflection> <_\n>
<triangulation nodes> [<_> <triangulation u v parameters>] <_> <triangulation triangles> <_\n>;
<triangulation record> = <triangulation node count> <_> <triangulation triangle count> <_> <triangulation parameter presence flag> [<_> <need to write normals flag>] <_> <triangulation deflection> <_\n>
<triangulation nodes> [<_> <triangulation u v parameters>] <_> <triangulation triangles> [<_> <triangulation normals>] <_\n>;
<triangulation node count> = <int>;
@@ -1445,6 +1446,8 @@ The example record describes a polyline from *m*=2 nodes with a parameter prese
<triangulation parameter presence flag> = <flag>;
<need to write normals flag> = <flag>;
<triangulation deflection> = <real>;
<triangulation nodes> = (<triangulation node> <_>) ^ <triangulation node count>;
@@ -1458,10 +1461,17 @@ The example record describes a polyline from *m*=2 nodes with a parameter prese
<triangulation triangles> = (<triangulation triangle> <_>) ^ <triangulation triangle count>;
<triangulation triangle> = <int> <_> <int> <_> <int>.
<triangulation triangle> = <int> <_> <int> <_> <int>;
<triangulation normals> = (<triangulation normal> <_>) ^ <triangulation node count> ^ 3;
<triangulation normal> = <short real>.
~~~~
**Description**
\<triangulation u v parameters\> are used in version 2 or later.
\<need to write normals flag\> and \<triangulation normals\> are used in version 3.
\<triangulation record\> describes a triangulation *T* which approximates a surface *S*. The triangulation data consist of a node count @f$ m \geq 3 @f$, a triangle count @f$ k \geq 1 @f$, a parameter presence flag *p*, a deflection @f$ d \geq 0 @f$, nodes @f$ N_{i}\; (1\leq i \leq m) @f$, parameter pairs @f$ u_{i}\; v_{i}\; (1\leq i \leq m) @f$, triangles @f$ n_{j,1}\; n_{j,2}\; n_{j,3}\; (1\leq j \leq k,\; n_{j,l} \in \left \{1,...,m \right \}\; (1\leq l\leq 3)) @f$. The parameters are present only if *p*=1. The deflection describes the triangulation deflection from the surface:
@@ -1640,7 +1650,7 @@ An example of section shapes and a whole *.brep file are given in chapter 7 @re
* @f$ f_{1} @f$ -- free;
* @f$ f_{2} @f$ -- modified;
* @f$ f_{3} @f$ -- IGNORED(version 1) \\ checked (version 2);
* @f$ f_{3} @f$ -- IGNORED(version 1 only) \\ checked (version 2 or later);
* @f$ f_{4} @f$ -- orientable;
* @f$ f_{5} @f$ -- closed;
* @f$ f_{6} @f$ -- infinite;
@@ -1775,7 +1785,7 @@ The usage of \<vertex data representation u parameter\> *U* is described belo
**BNF-like Definition**
~~~~
~~~~{.cpp}
<edge data> = <_> <edge data tolerance> <_> <edge data same parameter flag> <_> edge data same range flag> <_> <edge data degenerated flag> <_\n> <edge data representations>;
<edge data tolerance> = <real>;
@@ -1827,10 +1837,10 @@ Flags \<edge data same parameter flag\>, \<edge data same range flag\> and \<edg
\<edge data representation data 1\> describes a 3D curve.
\<edge data representation data 2\> describes a 2D curve on a surface.
\<curve values for parameter minimal and maximal values\> are used only in version 2.
\<curve values for parameter minimal and maximal values\> are used in version 2 or later.
\<edge data representation data 3\> describes a 2D curve on a closed surface.
\<curve values for parameter minimal and maximal values\> are used only in version 2.
\<curve values for parameter minimal and maximal values\> are used in version 2 or later.
\<edge data representation data 5\> describes a 3D polyline.
@@ -1845,7 +1855,7 @@ Flags \<edge data same parameter flag\>, \<edge data same range flag\> and \<edg
**BNF-like Definition**
~~~~
~~~~{.cpp}
<face data> = <face data natural restriction flag> <_> <face data tolerance> <_> <surface number> <_> <location number> <\n> ["2" <_> <triangulation number>];
<face data natural restriction flag> = <flag>;

View File

@@ -192,7 +192,7 @@ It is called **local illumination**. Based on this name there is also a global o
\f[L_{indirect} = \int\limits_H f(v, l) L_i^{indirect}(l) \cos\theta_l\, \mathrm{d}l\f]
It includes influence of light reflected or scattered from other points and environment's contribution.
It's impossible to achieve photorealistic results without this component, but is is also very difficult to compute.
It's impossible to achieve photorealistic results without this component, but it is also very difficult to compute.
While the cross point light interaction cannot be calculated in a simple way (especially in real time rendering), the environment illumination has some options to be realized via precomputational work before visualization.
But right now lets summarize the practical application of illumination model.
At this moment the output radiance is represented as:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -1,4 +1,4 @@
Tutorial {#occt__tutorial}
Modeling: Bottle Tutorial {#occt__tutorial}
=======
@tableofcontents
@@ -18,7 +18,7 @@ From a programming standpoint, Open CASCADE Technology is designed to enhance yo
To illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:
@figure{/tutorial/images/tutorial_image001.png,"",240}
@figure{/tutorial/images/tutorial_image001.png,"",240} height=350px
In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function *MakeBottle* in the distribution of Open CASCADE Technology. The function body is provided in the file samples/qt/Tutorial/src/MakeBottle.cxx.
@@ -34,7 +34,7 @@ We first define the bottle specifications as follows:
In addition, we decide that the bottle's profile (base) will be centered on the origin of the global Cartesian coordinate system.
@figure{/tutorial/images/tutorial_image002.png,"",240}
@figure{/tutorial/images/tutorial_image002.png,"",240} height=350px
This modeling requires four steps:
@@ -66,19 +66,19 @@ To choose the best class for this application, consider the following:
Since all the points you will define are only used to create the profile's curves, an object with a limited lifetime will do. Choose the *gp_Pnt* class.
To instantiate a *gp_Pnt* object, just specify the X, Y, and Z coordinates of the points in the global Cartesian coordinate system:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Pnt aPnt1(-myWidth / 2., 0, 0);
gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
gp_Pnt aPnt3(0, -myThickness / 2., 0);
gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
gp_Pnt aPnt5(myWidth / 2., 0, 0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Once your objects are instantiated, you can use methods provided by the class to access and modify its data. For example, to get the X coordinate of a point:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Standard_Real xValue1 = aPnt1.X();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB2_2 Profile: Defining the Geometry
With the help of the previously defined points, you can compute a part of the bottle's profile geometry. As shown in the figure below, it will consist of two segments and one arc.
@@ -95,15 +95,15 @@ This is because the *GC* provides two algorithm classes which are exactly what i
Both of these classes return a *Geom_TrimmedCurve* manipulated by handle. This entity represents a base curve (line or circle, in our case), limited between two of its parameter values. For example, circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a *Geom_TrimmedCurve* on C limited between 0 and M_PI/2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom_TrimmedCurve) aArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
All *GC* classes provide a casting method to obtain a result automatically with a function-like call. Note that this method will raise an exception if construction has failed. To handle possible errors more explicitly, you may use the *IsDone* and *Value* methods. For example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
GC_MakeSegment mkSeg (aPnt1, aPnt2);
Handle(Geom_TrimmedCurve) aSegment1;
if(mkSegment.IsDone()){
@@ -112,7 +112,7 @@ All *GC* classes provide a casting method to obtain a result automatically with
else {
// handle error
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB2_3 Profile: Defining the Topology
@@ -144,18 +144,18 @@ Referring to the previous table, to build the profile, you will create:
However, the *TopoDS* package provides only the data structure of the topological entities. Algorithm classes available to compute standard topological objects can be found in the *BRepBuilderAPI* package.
To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
TopoDS_Edge aEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~{.cpp}
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
~~~~
In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, aEdge1 and aEdge3 could have been computed in a simpler way:
In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, anEdge1 and anEdge3 could have been computed in a simpler way:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~{.cpp}
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
~~~~
To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWire* class. There are two ways of building a wire with this class:
@@ -164,9 +164,9 @@ To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWir
When building a wire from less than four edges, as in the present case, you can use the constructor directly as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(aEdge1, aEdge2, aEdge3);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~{.cpp}
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3);
~~~~
@subsection OCCT_TUTORIAL_SUB2_4 Profile: Completing the Profile
@@ -186,17 +186,17 @@ The first way is to define it from scratch, using its geometric definition:
* X axis is located at (0, 0, 0) - use the *gp_Pnt* class.
* X axis direction is (1, 0, 0) - use the *gp_Dir* class. A *gp_Dir* instance is created out of its X, Y and Z coordinates.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Pnt aOrigin(0, 0, 0);
gp_Dir xDir(1, 0, 0);
gp_Ax1 xAxis(aOrigin, xDir);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
The second and simplest way is to use the geometric constants defined in the gp package (origin, main directions and axis of the global coordinate system). To get the X axis, just call the *gp::OX* method:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Ax1 xAxis = gp::OX();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
As previously explained, the 3D geometric transformation is defined with the *gp_Trsf* class. There are two different ways to use this class:
@@ -205,43 +205,43 @@ As previously explained, the 3D geometric transformation is defined with the *gp
Since the simplest approach is always the best one, you should use the SetMirror method with the axis as the center of symmetry.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Trsf aTrsf;
aTrsf.SetMirror(xAxis);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
You now have all necessary data to apply the transformation with the BRepBuilderAPI_Transform class by specifying:
* the shape on which the transformation must be applied.
* the geometric transformation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
*BRepBuilderAPI_Transform* does not modify the nature of the shape: the result of the reflected wire remains a wire. But the function-like call or the *BRepBuilderAPI_Transform::Shape* method returns a *TopoDS_Shape* object:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
What you need is a method to consider the resulting reflected shape as a wire. The *TopoDS* global functions provide this kind of service by casting a shape into its real type. To cast the transformed wire, use the *TopoDS::Wire* method.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
The bottle's profile is almost finished. You have created two wires: *aWire* and *aMirroredWire*. You need to concatenate them to compute a single shape. To do this, you use the *BRepBuilderAPI_MakeWire* class as follows:
* create an instance of *BRepBuilderAPI_MakeWire*.
* add all edges of the two wires by using the *Add* method on this object.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepBuilderAPI_MakeWire mkWire;
mkWire.Add(aWire);
mkWire.Add(aMirroredWire);
TopoDS_Wire myWireProfile = mkWire.Wire();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@section sec3 Building the Body
@@ -250,7 +250,7 @@ The bottle's profile is almost finished. You have created two wires: *aWire* and
@subsection OCCT_TUTORIAL_SUB3_1 Prism the Profile
To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and to sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
| Shape | Generates |
| :----- | :----------------- |
@@ -260,15 +260,15 @@ To compute the main body of the bottle, you need to create a solid shape. The si
| Face | Solid |
| Shell | Compound of Solids |
@figure{/tutorial/images/tutorial_image007.png,"",240}
@figure{/tutorial/images/tutorial_image007.png,"",240} height=350px
Your current profile is a wire. Referring to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.
To create a face, use the *BRepBuilderAPI_MakeFace* class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, *BRepBuilderAPI_MakeFace* computes a face out of a surface and one or more wires.
When the wire lies on a plane, the surface is automatically computed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
The *BRepPrimAPI* package provides all the classes to create topological primitive constructions: boxes, cones, cylinders, spheres, etc. Among them is the *BRepPrimAPI_MakePrism* class. As specified above, the prism is defined by:
@@ -277,15 +277,15 @@ The *BRepPrimAPI* package provides all the classes to create topological primiti
You want the solid to be finite, swept along the Z axis and to be myHeight height. The vector, defined with the *gp_Vec* class on its X, Y and Z coordinates, is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Vec aPrismVec(0, 0, myHeight);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
All the necessary data to create the main body of your bottle is now available. Just apply the *BRepPrimAPI_MakePrism* class to compute the solid:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB3_2 Applying Fillets
@@ -297,7 +297,7 @@ For our purposes, we will specify that fillets must be:
* applied on all edges of the shape
* have a radius of *myThickness* / 12
@figure{/tutorial/images/tutorial_image008.png,"",240}
@figure{/tutorial/images/tutorial_image008.png,"",240} height=350px
To apply fillets on the edges of a shape, you use the *BRepFilletAPI_MakeFillet* class. This class is normally used as follows:
@@ -305,9 +305,9 @@ To apply fillets on the edges of a shape, you use the *BRepFilletAPI_MakeFillet*
* Add the fillet descriptions (an edge and a radius) using the *Add* method (you can add as many edges as you need).
* Ask for the resulting filleted shape with the *Shape* method.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepFilletAPI_MakeFillet mkFillet(myBody);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
To add the fillet description, you need to know the edges belonging to your shape. The best solution is to explore your solid to retrieve its edges. This kind of functionality is provided with the *TopExp_Explorer* class, which explores the data structure described in a *TopoDS_Shape* and extracts the sub-shapes you specifically need.
Generally, this explorer is created by providing the following information:
@@ -315,9 +315,9 @@ Generally, this explorer is created by providing the following information:
* the shape to explore
* the type of sub-shapes to be found. This information is given with the *TopAbs_ShapeEnum* enumeration.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
An explorer is usually applied in a loop by using its three main methods:
@@ -326,26 +326,26 @@ An explorer is usually applied in a loop by using its three main methods:
* *Next()* to move onto the next sub-shape to explore.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
while(anEdgeExplorer.More()){
TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
//Add edge to fillet algorithm
...
anEdgeExplorer.Next();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
In the explorer loop, you have found all the edges of the bottle shape. Each one must then be added in the *BRepFilletAPI_MakeFillet* instance with the *Add()* method. Do not forget to specify the radius of the fillet along with it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
mkFillet.Add(myThickness / 12., anEdge);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Once this is done, you perform the last step of the procedure by asking for the filleted shape.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
myBody = mkFillet.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB3_3 Adding the Neck
@@ -353,36 +353,36 @@ Once this is done, you perform the last step of the procedure by asking for the
To add a neck to the bottle, you will create a cylinder and fuse it to the body. The cylinder is to be positioned on the top face of the body with a radius of *myThickness* / 4. and a height of *myHeight* / 10.
@figure{/tutorial/images/tutorial_image009.png,"",240}
@figure{/tutorial/images/tutorial_image009.png,"",240} height=350px
To position the cylinder, you need to define a coordinate system with the *gp_Ax2* class defining a right-handed coordinate system from a point and two directions - the main (Z) axis direction and the X direction (the Y direction is computed from these two).
To align the neck with the center of the top face, being in the global coordinate system (0, 0, *myHeight*), with its normal on the global Z axis, your local coordinate system can be defined as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Pnt neckLocation(0, 0, myHeight);
gp_Dir neckAxis = gp::DZ();
gp_Ax2 neckAx2(neckLocation, neckAxis);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
To create a cylinder, use another class from the primitives construction package: the *BRepPrimAPI_MakeCylinder* class. The information you must provide is:
* the coordinate system where the cylinder will be located;
* the radius and height.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Standard_Real myNeckRadius = myThickness / 4.;
Standard_Real myNeckHeight = myHeight / 10;
BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
TopoDS_Shape myNeck = MKCylinder.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
You now have two separate parts: a main body and a neck that you need to fuse together.
The *BRepAlgoAPI* package provides services to perform Boolean operations between shapes, and especially: *common* (Boolean intersection), *cut* (Boolean subtraction) and *fuse* (Boolean union).
Use *BRepAlgoAPI_Fuse* to fuse the two shapes:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB3_4 Creating a Hollowed Solid
@@ -395,7 +395,7 @@ In Open CASCADE Technology, a hollowed solid is called a *Thick* *Solid* and is
* Create a parallel wall W2 from W1 at a distance D. If D is positive, W2 will be outside the initial solid, otherwise it will be inside.
* Compute a solid from the two walls W1 and W2.
@figure{/tutorial/images/tutorial_image010.png,"",240}
@figure{/tutorial/images/tutorial_image010.png,"",240} height=350px
To compute a thick solid, you create an instance of the *BRepOffsetAPI_MakeThickSolid* class by giving the following information:
@@ -411,11 +411,11 @@ The challenging part in this procedure is to find the face to remove from your s
To find the face with such characteristics, you will once again use an explorer to iterate on all the bottle's faces to find the appropriate one.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE) ; aFaceExplorer.More() ; aFaceExplorer.Next()){
TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
For each detected face, you need to access the geometric properties of the shape: use the *BRep_Tool* class for that. The most commonly used methods of this class are:
@@ -423,9 +423,9 @@ For each detected face, you need to access the geometric properties of the shape
* *Curve* to access the 3D curve of an edge;
* *Point* to access the 3D point of a vertex.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
As you can see, the *BRep_Tool::Surface* method returns an instance of the *Geom_Surface* class manipulated by handle. However, the *Geom_Surface* class does not provide information about the real type of the object *aSurface*, which could be an instance of *Geom_Plane*, *Geom_CylindricalSurface*, etc.
All objects manipulated by handle, like *Geom_Surface*, inherit from the *Standard_Transient* class which provides two very useful methods concerning types:
@@ -436,52 +436,51 @@ All objects manipulated by handle, like *Geom_Surface*, inherit from the *Standa
DynamicType returns the real type of the object, but you need to compare it with the existing known types to determine whether *aSurface* is a plane, a cylindrical surface or some other type.
To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, which returns the type of a class:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
//
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
If this comparison is true, you know that the *aSurface* real type is *Geom_Plane*. You can then convert it from *Geom_Surface* to *Geom_Plane* by using the *DownCast()* method provided by each class inheriting *Standard_Transient*. As its name implies, this static method is used to downcast objects to a given type with the following syntax:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Remember that the goal of all these conversions is to find the highest face of the bottle lying on a plane. Suppose that you have these two global variables:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Face faceToRemove;
Standard_Real zMax = -1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
You can easily find the plane whose origin is the biggest in Z knowing that the location of the plane is given with the *Geom_Plane::Location* method. For example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Pnt aPnt = aPlane->Location();
Standard_Real aZ = aPnt.Z();
if(aZ > zMax){
zMax = aZ;
faceToRemove = aFace;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
You have now found the top face of the neck. Your final step before creating the hollowed solid is to put this face in a list. Since more than one face can be removed from the initial solid, the *BRepOffsetAPI_MakeThickSolid* constructor takes a list of faces as arguments.
Open CASCADE Technology provides many collections for different kinds of objects: see *TColGeom* package for collections of objects from *Geom* package, *TColgp* package for collections of objects from gp package, etc.
The collection for shapes can be found in the *TopTools* package. As *BRepOffsetAPI_MakeThickSolid* requires a list, use the *TopTools_ListOfShape* class.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopTools_ListOfShape facesToRemove;
facesToRemove.Append(faceToRemove);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* MakeThickSolidByJoin method:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid aSolidMaker;
aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = aSolidMaker.Shape();
~~~~
@section sec4 Building the Threading
@@ -493,7 +492,7 @@ All the necessary data are now available so you can create your hollowed solid b
Up to now, you have learned how to create edges out of 3D curves.
You will now learn how to create an edge out of a 2D curve and a surface.
To learn this aspect of Open CASCADE Technology, you will build helicoidal profiles out of 2D curves on cylindrical surfaces. The theory is more complex than in previous steps, but applying it is very simple.
As a first step, you compute these cylindrical surfaces. You are already familiar with curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
As a first step, you compute these cylindrical surfaces. You are already familiar with the curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
* a coordinate system;
* a radius.
@@ -504,11 +503,11 @@ Using the same coordinate system *neckAx2* used to position the neck, you create
Notice that one of the cylindrical surfaces is smaller than the neck. There is a good reason for this: after the thread creation, you will fuse it with the neck. So, we must make sure that the two shapes remain in contact.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB4_2 Defining 2D Curves
@@ -564,11 +563,11 @@ To use 2D primitive geometry types of Open CASCADE Technology for defining a poi
* To define a 2D direction (unit vector) from its X and Y coordinates, use the gp_Dir2d class. The coordinates will automatically be normalized.
* To define a 2D right-handed coordinate system, use the *gp_Ax2d* class, which is computed from a point (origin of the coordinate system) and a direction - the X direction of the coordinate system. The Y direction will be automatically computed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
gp_Ax2d anAx2d(aPnt, aDir);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
You will now define the curves. As previously mentioned, these thread profiles are computed on two cylindrical surfaces. In the following figure, curves on the left define the base (on *aCyl1* surface) and the curves on the right define the top of the thread's shape (on *aCyl2* surface).
@@ -588,36 +587,36 @@ Supposing that:
Your ellipses are defined as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Standard_Real aMajor = 2. * M_PI;
Standard_Real aMinor = myNeckHeight / 10;
Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
To describe portions of curves for the arcs drawn above, you define *Geom2d_TrimmedCurve* trimmed curves out of the created ellipses and two parameters to limit them.
As the parametric equation of an ellipse is P(U) = O + (MajorRadius * cos(U) * XDirection) + (MinorRadius * sin(U) * YDirection), the ellipses need to be limited between 0 and M_PI.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
The last step consists in defining the segment, which is the same for the two profiles: a line limited by the first and the last point of one of the arcs.
To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for first derivative, D2 for the second one.
To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for the first derivative, D2 for the second one.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
gp_Pnt2d anEllipsePnt2;
anEllipse1->D0(M_PI, anEllipsePnt2);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
When creating the bottle's profile, you used classes from the *GC* package, providing algorithms to create elementary geometries.
In 2D geometry, this kind of algorithms is found in the *GCE2d* package. Class names and behaviors are similar to those in *GC*. For example, to create a 2D segment out of two points:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB4_3 Building Edges and Wires
@@ -637,28 +636,28 @@ Previously, you have built:
To compute the edges out of these curves, once again use the *BRepBuilderAPI_MakeEdge* class. One of its constructors allows you to build an edge out of a curve described in the 2D parametric space of a surface.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Now, you can create the two profiles of the threading, lying on each surface.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Remember that these wires were built out of a surface and 2D curves.
One important data item is missing as far as these wires are concerned: there is no information on the 3D curves. Fortunately, you do not need to compute this yourself, which can be a difficult task since the mathematics can be quite complex.
When a shape contains all the necessary information except 3D curves, Open CASCADE Technology provides a tool to build them automatically. In the BRepLib tool package, you can use the *BuildCurves3d* method to compute 3D curves for all the edges of a shape.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepLib::BuildCurves3d(threadingWire1);
BRepLib::BuildCurves3d(threadingWire2);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection OCCT_TUTORIAL_SUB4_4 Creating Threading
@@ -675,12 +674,12 @@ The loft function is implemented in the *BRepOffsetAPI_ThruSections* class, whic
* Use the *CheckCompatibility* method to activate (or deactivate) the option that checks whether the wires have the same number of edges. In this case, wires have two edges each, so you can deactivate this option.
* Ask for the resulting loft shape with the Shape method.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepOffsetAPI_ThruSections aTool(Standard_True);
aTool.AddWire(threadingWire1); aTool.AddWire(threadingWire2);
aTool.CheckCompatibility(Standard_False);
TopoDS_Shape myThreading = aTool.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@section sec5 Building the Resulting Compound
@@ -688,17 +687,17 @@ The loft function is implemented in the *BRepOffsetAPI_ThruSections* class, whic
You are almost done building the bottle. Use the *TopoDS_Compound* and *BRep_Builder* classes to build single shape from *myBody* and *myThreading*:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Compound aRes;
BRep_Builder aBuilder;
aBuilder.MakeCompound (aRes);
aBuilder.Add (aRes, myBody);
aBuilder.Add (aRes, myThreading);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Congratulations! Your bottle is complete. Here is the result snapshot of the Tutorial application:
@figure{/tutorial/images/tutorial_image019.png,"",320}
@figure{/tutorial/images/tutorial_image019.png,"",320} height=450px
We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at https://www.opencascade.com/content/technology-support. Our professional services can maximize the power of your Open CASCADE Technology applications.
@@ -709,7 +708,7 @@ If you want to know more and develop major projects using Open CASCADE Technolog
Complete definition of MakeBottle function (defined in the file src/MakeBottle.cxx of the Tutorial):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
TopoDS_Shape MakeBottle(const Standard_Real myWidth, const Standard_Real myHeight,
const Standard_Real myThickness)
{
@@ -796,9 +795,9 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
TopTools_ListOfShape facesToRemove;
facesToRemove.Append(faceToRemove);
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
BRepOffsetAPI_MakeThickSolid aSolidMaker;
aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = aSolidMaker.Shape();
// Threading : Create Surfaces
Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
@@ -846,5 +845,5 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
return aRes;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~

View File

@@ -39,7 +39,7 @@ Porting of user applications from an earlier OCCT version to version 6.5 require
Porting of user applications from an earlier OCCT version to version 6.5.1 requires taking into account the following major changes:
* Method *Graphic3d_Structure::Groups()* now returns *Graphic3d_SequenceOfGroup*. If this method has been used, the application code should be updated to iterate another collection type or, if *Graphic3d_HSetOfGroup* is required, to fill its own collection:
~~~~
~~~~{.cpp}
const Graphic3d_SequenceOfGroup& aGroupsSeq = theStructure.Groups();
Handle(Graphic3d_HSetOfGroup) aGroupSet = new Graphic3d_HSetOfGroup();
Standard_Integer aLen = aGroupsSeq.Length();
@@ -62,7 +62,7 @@ Porting of user applications from an earlier OCCT version to version 6.5.2 requi
* If the callback mechanism in call_togl_redraw function was used in the application code, it is necessary to revise it to take into account the new callback execution and provide a check of reason value of Aspect_GraphicCallbackStruct in callback methods to confirm that the callback code is executed at the right moment. Now the callbacks are executed before redrawing the underlayer, before redrawing the overlayer and at the end of redrawing. The information about the moment when the callback is invoked is provided with the reason value in form of an additional bit flag <i>(OCC_PRE_REDRAW, OCC_PRE_OVERLAY)</i>. The state of OpenGl changed in callback methods will not be restored automatically, which might lead to unwanted behavior in redrawing procedure.
* The print method used in the application code might need to be revised to take into account the ability to choose between print algorithms: tile and stretch. The stretch algorithm will be selected by default during porting.
* It is recommended to *BRepMesh_DiscretFactory* users, to check *BRepMesh_DiscretFactory::SetDefault()* return value to determine plugin availability / validity. *BRepMesh_DiscretFactory::Discret()* method now returns handle instead of pointer. The code should be updated in the following manner:
~~~~
~~~~{.cpp}
Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (theShape, theDeflection, theAngularToler);
if (!aMeshAlgo.IsNull()) {}
~~~~
@@ -88,7 +88,7 @@ Porting of user applications from an earlier OCCT version to version 6.5.3 requi
Porting of user applications from an earlier OCCT version to version 6.5.4 requires taking into account the following major changes:
* The code using obsolete classes *Aspect_PixMap, Xw_PixMap* and *WNT_PixMap* should be rewritten implementing class *Image_PixMap*, which is now retrieved by *ToPixMap* methods as argument. A sample code using *ToPixMap* is given below:
~~~~
~~~~{.cpp}
#include <Image_AlienPixMap.hxx>
void dump (Handle(V3d_View)& theView3D)
{
@@ -121,7 +121,7 @@ Correspondingly, the code using methods *SetAnimationModeOn(), SetAnimationModeO
* Interactive selection of 2D presentations should be set up inside *ComputeSelection()* virtual method of a custom interactive object class, using standard sensitive entities from *Select3D* package and standard or custom entity owners derived from *SelectMgr_EntityOwner* base.
Refer to the Visualization User's Guide for further details concerning OCCT 3D visualization and selection classes. See also *Viewer2D* OCCT sample application, which shows how 2D drawing can be implemented using TKV3d API.
* Run-time graphic driver library loading mechanism based on *CSF_GraphicShr* environment variable usage has been replaced by explicit linking against *TKOpenGl* library. The code sample below shows how the graphic driver should be created and initialized in the application code:
~~~~
~~~~{.cpp}
// initialize a new viewer with OpenGl graphic driver
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
new OpenGl_GraphicDriver ("TKOpenGl");
@@ -264,7 +264,7 @@ Custom Interactive Objects should implement new virtual method *SelectMgr_Select
Now the method *SelectMgr_Selection::Sensitive()* does not return *SelectBasics_SensitiveEntity*. It returns an instance of *SelectMgr_SensitiveEntity*, which belongs to a different class hierarchy (thus *DownCast()* will fail). To access base sensitive it is necessary to use method *SelectMgr_SensitiveEntity::BaseSensitive()*. For example:
~~~~
~~~~{.cpp}
Handle(SelectMgr_Selection) aSelection = anInteractiveObject->Selection (aMode);
for (aSelection->Init(); aSelection->More(); aSelection->Next())
{
@@ -286,7 +286,7 @@ The depth and distance to the center of geometry must be calculated for the 3D p
Here is an example of overlap/inclusion test for a box:
~~~~
~~~~{.cpp}
if (!theMgr.IsOverlapAllowed()) // check for inclusion
{
Standard_Boolean isInside = Standard_True;
@@ -396,7 +396,7 @@ However, due to redesign of basic mechanisms (CDL generic classes, Handles and R
WOK is not necessary anymore for building OCCT from sources, though it still can be used in a traditional way -- auxiliary files required for that are preserved.
The recommended method for building OCCT 7.x is CMake, see @ref build_occt_win_cmake.
The alternative solution is to use project files generated by OCCT legacy tool **genproj**, see @ref build_occt_genproj, @ref build_occt_win_codeblocks, and @ref build_occt_macos_xcode.
The alternative solution is to use project files generated by OCCT legacy tool **genproj**, see @ref build_occt_genproj.
@subsubsection upgrade_occt700_cdl_auto Automatic upgrade
@@ -404,26 +404,26 @@ Most of typical changes required for upgrading code for OCCT 7.0 can be done aut
This tool is a Tcl script, thus Tcl should be available on your workstation to run it.
Example:
~~~~~
~~~~{.php}
$ tclsh
% source <path_to_occt>/adm/upgrade.tcl
% upgrade -recurse -all -src=<path_to_your_sources>
~~~~~
~~~~
On Windows, the helper batch script *upgrade.bat* can be used, provided that Tcl is either available in *PATH*, or configured via *custom.bat* script (for instance, if you use OCCT installed from Windows installer package). Start it from the command prompt:
~~~~~
~~~~
cmd> <path_to_occt>\upgrade.bat -recurse -all -inc=<path_to_occt>\inc -src=<path_to_your_sources> [options]
~~~~~
~~~~
Run the upgrade tool without arguments to see the list of available options.
The upgrade tool performs the following changes in the code.
1. Replaces macro *DEFINE_STANDARD_RTTI* by *DEFINE_STANDARD_RTTIEXT*, with second argument indicating base class for the main argument class (if inheritance is recognized by the script):
~~~~~
~~~~{.cpp}
DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTIEXT(Class, Base)
~~~~~
~~~~
@note If macro *DEFINE_STANDARD_RTTI* with two arguments (used in intermediate development versions of OCCT 7.0) is found, the script will convert it to either *DEFINE_STANDARD_RTTIEXT* or *DEFINE_STANDARD_RTTI_INLINE*.
The former case is used if current file is header and source file with the same name is found in the same folder.
@@ -431,50 +431,50 @@ DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTIEXT(Class, Base)
The latter variant defines all methods for RTTI as inline, and does not require *IMPLEMENT_STANDARD_RTTIEXT* macro.
2. Replaces forward declarations of collection classes previously generated from CDL generics (defined in *TCollection* package) by inclusion of the corresponding header:
~~~~~
~~~~{.cpp}
class TColStd_Array1OfReal; -> #include <TColStd_Array1OfReal.hxx>
~~~~~
~~~~
3. Replaces underscored names of *Handle* classes by usage of a macro:
~~~~~
~~~~{.cpp}
Handle_Class -> Handle(Class)
~~~~~
~~~~
This change is not applied if the source or header file is recognized as containing the definition of Qt class with signals or slots, to avoid possible compilation errors of MOC files caused by inability of MOC to recognize macros (see https://doc.qt.io/qt-4.8/signalsandslots.html).
The file is considered as defining a Qt object if it contains strings *Q_OBJECT* and either *slots:* or *signals:*.
4. Removes forward declarations of classes with names <i>Handle(C)</i> or *Handle_C*, replacing them either by forward declaration of its argument class, or (for files defining Qt objects) <i>\#include</i> statement for a header with the name of the argument class and extension .hxx:
~~~~~
~~~~{.cpp}
class Handle(TColStd_HArray1OfReal); -> #include <TColStd_HArray1OfReal.hxx>
~~~~~
~~~~
5. Removes <i> \#includes </i> of files <i>Handle_...hxx</i> that have disappeared in OCCT 7.0:
~~~~~
~~~~{.cpp}
#include <Handle_Geom_Curve.hxx> ->
~~~~~
~~~~
6. Removes *typedef* statements that use *Handle* macro to generate the name:
~~~~~
~~~~{.cpp}
typedef NCollection_Handle<Message_Msg> Handle(Message_Msg); ->
~~~~~
~~~~
7. Converts C-style casts applied to Handles into calls to <i>DownCast()</i> method:
~~~~~
~~~~{.cpp}
((Handle(A)&)b) -> Handle(A)::DownCast(b)
(Handle(A)&)b -> Handle(A)::DownCast(b)
(*((Handle(A)*)&b)) -> Handle(A)::DownCast(b)
*((Handle(A)*)&b) -> Handle(A)::DownCast(b)
(*(Handle(A)*)&b) -> Handle(A)::DownCast(b)
~~~~~
~~~~
8. Moves <i>Handle()</i> macro out of namespace scope:
~~~~~
~~~~{.cpp}
Namespace::Handle(Class) -> Handle(Namespace::Class)
~~~~~
~~~~
9. Converts local variables of reference type, which are initialized by a temporary object returned by call to <i>DownCast()</i>, to the variables of non-reference type (to avoid using references to destroyed memory):
~~~~~
~~~~{.cpp}
const Handle(A)& a = Handle(B)::DownCast (b); -> Handle(A) a (Handle(B)::DownCast (b));
~~~~~
~~~~
10. Adds <i>\#include</i> for all classes used as argument to macro <i>STANDARD_TYPE()</i>, except for already included ones;
@@ -487,9 +487,9 @@ Namespace::Handle(Class) -> Handle(Namespace::Class)
As long as the upgrade routine runs, some information messages are sent to the standard output.
In some cases the warnings or errors like the following may appear:
~~~~~
~~~~
Error in {HEADER_FILE}: Macro DEFINE_STANDARD_RTTI used for class {CLASS_NAME} whose declaration is not found in this file, cannot fix
~~~~~
~~~~
Be sure to check carefully all reported errors and warnings, as the corresponding code will likely require manual corrections.
In some cases these messages may help you to detect errors in your code, for instance, cases where *DEFINE_STANDARD_RTTI* macro is used with incorrect class name as an argument.
@@ -506,12 +506,12 @@ The use of handle objects (construction, comparison using operators == or !=, us
For example, the following lines will fail to compile if *Geom_Line.hxx* is not included:
~~~~~
~~~~{.cpp}
Handle(Geom_Line) aLine = 0;
if (aLine != aCurve) {...}
if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)) {...}
aLine = Handle(Geom_Line)::DownCast (aCurve);
~~~~~
~~~~
Note that it is not necessary to include header of the class to declare Handle to it.
However, if you define a class *B* that uses Handle(*A*) in its fields, or contains a method returning Handle(*A*), it is advisable to have header defining *A* included in the header of *B*.
@@ -523,31 +523,31 @@ This issue appears in the compilers that do not support default arguments in tem
The problem is that operator <i> const handle<T2>& </i> is defined for any type *T2*, thus the compiler cannot make the right choice.
Example:
~~~~~
~~~~{.cpp}
void func (const Handle(Geom_Curve)&);
void func (const Handle(Geom_Surface)&);
Handle(Geom_TrimmedCurve) aCurve = new Geom_TrimmedCurve (...);
func (aCurve); // ambiguity error in VC++ 10
~~~~~
~~~~
Note that this problem can be avoided in many cases if macro *OCCT_HANDLE_NOCAST* is used, see @ref upgrade_occt700_cdl_nocast "below".
To resolve this ambiguity, change your code so that argument type should correspond exactly to the function signature.
In some cases this can be done by using the relevant type for the corresponding variable, like in the example above:
~~~~~
~~~~{.cpp}
Handle(Geom_Curve) aCurve = new Geom_TrimmedCurve (...);
~~~~~
~~~~
Other variants consist in assigning the argument to a local variable of the correct type and using the direct cast or constructor:
~~~~~
~~~~{.cpp}
const Handle(Geom_Curve)& aGCurve (aTrimmedCurve);
func (aGCurve); // OK - argument has exact type
func (static_cast(aCurve)); // OK - direct cast
func (Handle(Geom_Curve)(aCurve)); // OK - temporary handle is constructed
~~~~~
~~~~
Another possibility consists in defining additional template variant of the overloaded function causing ambiguity, and using *SFINAE* to resolve the ambiguity.
This technique can be illustrated by the definition of the template variant of method <i>IGESData_IGESWriter::Send()</i>.
@@ -558,31 +558,31 @@ As the cast of a handle to the reference to another handle to the base type has
For example:
~~~~~
~~~~{.cpp}
Handle(Geom_Geometry) aC = GC_MakeLine (p, v); // compiler error
~~~~~
~~~~
The problem is that the class *GC_MakeLine* has a user-defined conversion to <i>const Handle(Geom_TrimmedCurve)&,</i> which is not the same as the type of the local variable *aC*.
To resolve this, use method <i>Value()</i>:
~~~~~
~~~~{.cpp}
Handle(Geom_Geometry) aC = GC_MakeLine (p, v).Value(); // ok
~~~~~
~~~~
or use variable of the appropriate type:
~~~~~
~~~~{.cpp}
Handle(Geom_TrimmedCurve) aC = GC_MakeLine (p, v); // ok
~~~~~
~~~~
A similar problem appears with GCC compiler, when *const* handle to derived type is used to construct handle to base type via assignment (and in some cases in return statement), for instance:
~~~~~
~~~~{.cpp}
const Handle(Geom_Line) aLine;
Handle(Geom_Curve) c1 = aLine; // GCC error
Handle(Geom_Curve) c2 (aLine); // ok
~~~~~
~~~~
This problem is specific to GCC and it does not appear if macro *OCCT_HANDLE_NOCAST* is used, see @ref upgrade_occt700_cdl_nocast "below".
@@ -593,20 +593,20 @@ You might need to clean your code from incorrect use of macros *STANDARD_TYPE*()
1. Explicit definitions of static functions with names generated by macro *STANDARD_TYPE()*, which are artifacts of old implementation of RTTI, should be removed.
Example:
~~~~~
~~~~{.cpp}
const Handle(Standard_Type)& STANDARD_TYPE(math_GlobOptMin)
{
static Handle(Standard_Type) _atype = new Standard_Type ("math_GlobOptMin", sizeof (math_GlobOptMin));
return _atype;
}
~~~~~
~~~~
2. Incorrect location of closing parenthesis of *Handle()* macro that was not detectable in OCCT 6.x will cause a compiler error and must be corrected.
Example (note misplaced closing parenthesis):
~~~~~
~~~~{.cpp}
aBSpline = Handle( Geom2d_BSplineCurve::DownCast(BS->Copy()) );
~~~~~
~~~~
#### Use of class Standard_AncestorIterator
@@ -617,20 +617,20 @@ Class *Standard_AncestorIterator* has been removed; use method *Parent()* of *St
Handles in OCCT 7.0 do not have the operator of conversion to <i>Standard_Transient*,</i> which was present in earlier versions.
This is done to prevent possible unintended errors like this:
~~~~~
~~~~{.cpp}
Handle(Geom_Line) aLine = ...;
Handle(Geom_Surface) aSurf = ...;
...
if (aLine == aSurf) {...} // will cause a compiler error in OCCT 7.0, but not OCCT 6.x
~~~~~
~~~~
The places where this implicit cast has been used should be corrected manually.
The typical situation is when Handle is passed to stream:
~~~~~
~~~~{.cpp}
Handle(Geom_Line) aLine = ...;
os << aLine; // in OCCT 6.9.0, resolves to operator << (void*)
~~~~~
~~~~
Call method <i>get()</i> explicitly to output the address of the Handle.
@@ -639,24 +639,24 @@ Call method <i>get()</i> explicitly to output the address of the Handle.
Method *DownCast()* in OCCT 7.0 is made templated; if its argument is not a base class, "deprecated" compiler warning is generated.
This is done to prevent possible unintended errors like this:
~~~~~
~~~~{.cpp}
Handle(Geom_Surface) aSurf = ;
Handle(Geom_Line) aLine =
Handle(Geom_Line)::DownCast (aSurf); // will cause a compiler warning in OCCT 7.0, but not OCCT 6.x
~~~~~
~~~~
The places where this cast has been used should be corrected manually.
If down casting is used in a template context where the argument can have the same or unrelated type so that *DownCast()* may be not available in all cases, use C++ *dynamic_cast<>* instead, e.g.:
~~~~~
~~~~{.cpp}
template <class T>
bool CheckLine (const Handle(T) theArg)
{
Handle(Geom_Line) aLine = dynamic_cast<Geom_Line> (theArg.get());
...
}
~~~~~
~~~~
@subsubsection upgrade_occt700_cdl_runtime Possible runtime problems
@@ -671,19 +671,19 @@ This problem does not appear if macro *OCCT_HANDLE_NOCAST* is used during compil
Example:
~~~~~
~~~~{.cpp}
// note that DownCast() returns new temporary object!
const Handle(Geom_BoundedCurve)& aBC =
Handle(Geom_TrimmedCurve)::DownCast(aCurve);
aBC->Transform (T); // access violation in OCCT 7.0
~~~~~
~~~~
@subsubsection upgrade_occt700_cdl_nocast Option to avoid cast of handle to reference to base type
In OCCT 6.x and earlier versions the handle classes formed a hierarchy echoing the hierarchy of the corresponding object classes .
This automatically enabled the possibility to use the handle to a derived class in all contexts where the handle to a base class was needed, e.g. to pass it in a function by reference without copying:
~~~~
~~~~{.cpp}
Standard_Boolean GetCurve (Handle(Geom_Curve)& theCurve);
....
Handle(Geom_Line) aLine;
@@ -705,13 +705,13 @@ This implies creation of temporary objects and hence may be more expensive at ru
The code that relies on the possibility of casting to base should be amended to always use the handle of argument type in function call and to use *DownCast()* to safely convert the result to the desired type.
For instance, the code from the example below can be changed as follows:
~~~~~
~~~~{.cpp}
Handle(Geom_Line) aLine;
Handle(Geom_Curve) aCurve;
if (GetCurve (aCure) && !(aLine = Handle(Geom_Line)::DownCast (aCurve)).IsNull()) {
// use aLine safely
}
~~~~~
~~~~
@subsubsection upgrade_occt700_cdl_compat Preserving compatibility with OCCT 6.x
@@ -724,12 +724,12 @@ If you like to preserve the compatibility of your application code with OCCT ver
3. Define macros *DEFINE_STANDARD_RTTIEXT* and *DEFINE_STANDARD_RTTI_INLINE* when building with previous versions of OCCT, resolving to *DEFINE_STANDARD_RTTI* with single argument
Example:
~~~~~
~~~~{.cpp}
#if OCC_VERSION_HEX < 0x070000
#define DEFINE_STANDARD_RTTIEXT(C1,C2) DEFINE_STANDARD_RTTI(C1)
#define DEFINE_STANDARD_RTTI_INLINE(C1,C2) DEFINE_STANDARD_RTTI(C1)
#endif
~~~~~
~~~~
@subsubsection upgrade_occt700_cdl_wok Applications based on CDL and WOK
@@ -768,7 +768,7 @@ The code that used the tools provided by that package should be corrected manual
The recommended approach is to use sorting algorithms provided by STL.
For instance:
~~~~~
~~~~{.cpp}
#include <SortTools_StraightInsertionSortOfReal.hxx>
#include <SortTools_ShellSortOfReal.hxx>
#include <TCollection_CompareOfReal.hxx>
@@ -777,15 +777,15 @@ TCollection_Array1OfReal aValues = ...;
...
TCollection_CompareOfReal aCompReal;
SortTools_StraightInsertionSortOfReal::Sort(aValues, aCompReal);
~~~~~
~~~~
can be replaced by:
~~~~~
~~~~{.cpp}
#include <algorithm>
...
TCollection_Array1OfReal aValues = ...;
...
std::stable_sort (aValues.begin(), aValues.end());
~~~~~
~~~~
@subsection upgrade_occt700_2dlayers On-screen objects and ColorScale
@@ -802,7 +802,7 @@ Predefined Z-layers *Graphic3d_ZLayerId_TopOSD* and *Graphic3d_ZLayerId_BotOSD*
The property of *V3d_View* storing the global *ColorScale* object has been removed with associated methods *V3d_View::ColorScaleDisplay(), V3d_View::ColorScaleErase(), V3d_View::ColorScaleIsDisplayed()* and *V3d_View::ColorScale()* as well as the classes *V3d_ColorScale, V3d_ColorScaleLayerItem* and *Aspect_ColorScale*.
Here is an example of creating *ColorScale* using the updated API:
~~~~~
~~~~{.cpp}
Handle(AIS_ColorScale) aCS = new AIS_ColorScale();
// configuring
Standard_Integer aWidth, aHeight;
@@ -815,13 +815,13 @@ aCS->SetZLayer (Graphic3d_ZLayerId_TopOSD);
aCS->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
aCS->SetToUpdate();
theContextAIS->Display (aCS);
~~~~~
~~~~
To see how 2d objects are implemented in OCCT you can call Draw commands *vcolorscale, vlayerline* or *vdrawtext* (with <i>-2d</i> option).
Draw command *vcolorscale* now requires the name of *ColorScale* object as argument.
To display this object use command *vdisplay*. For example:
~~~~~
~~~~{.php}
pload VISUALIZATION
vinit
vcolorscale cs -demo
@@ -832,16 +832,16 @@ vsetdispmode 1
vfit
vlayerline 0 300 300 300 10
vdrawtext t "2D-TEXT" -2d -pos 0 150 0 -color red
~~~~~
~~~~
Here is a small example in C++ illustrating how to display a custom AIS object in 2d:
~~~~~
~~~~{.cpp}
Handle(AIS_InteractiveContext) aContext = ...;
Handle(AIS_InteractiveObject) anObj =...; // create an AIS object
anObj->SetZLayer(Graphic3d_ZLayerId_TopOSD); // display object in overlay
anObj->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0)); // set 2d flag, coordinate origin is set to down-left corner
aContext->Display (anObj); // display the object
~~~~~
~~~~
@subsection upgrade_occt700_userdraw UserDraw and Visual3d
@@ -879,12 +879,12 @@ The functionality previously provided by *Visual3d* package has been redesigned
Old APIs based on global callback functions for creating *UserDraw* objects and for performing custom OpenGL rendering within the view have been dropped.
*UserDraw* callbacks are no more required since *OpenGl_Group* now inherits *Graphic3d_Group* and thus can be accessed directly from *AIS_InteractiveObject*:
~~~~~
~~~~{.cpp}
//! Class implementing custom OpenGL element.
class UserDrawElement : public OpenGl_Element {};
//! Implementation of virtual method AIS_InteractiveObject::Compute().
void UserDrawObject::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
void UserDrawObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
@@ -901,12 +901,12 @@ void UserDrawObject::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrs
// invalidate bounding box of the scene
thePrsMgr->StructureManager()->Update();
}
~~~~~
~~~~
To perform a custom OpenGL code within the view, it is necessary to inherit from class *OpenGl_View*.
See the following code sample:
~~~~~
~~~~{.cpp}
//! Custom view.
class UserView : public OpenGl_View
{
@@ -953,7 +953,7 @@ public:
}
};
~~~~~
~~~~
@subsection upgrade_occt700_localcontext Deprecation of Local Context
@@ -1046,7 +1046,7 @@ Release 7.1.0 disables this functionality by default in favor of Programmable Pi
Method *V3d_View::Export()*, based on *gl2ps* library, requires fixed pipeline and will return error if used with default settings.
Applications should explicitly enable fixed pipeline by setting *OpenGl_Caps::ffpEnable* flag to TRUE within *OpenGl_GraphicDriver::ChangeOptions()* before creating the viewer to use *V3d_View::Export()*.
This method is declared as deprecated and will be removed in one of the the next OCCT releases.
This method is declared as deprecated and will be removed in one of the next OCCT releases.
The recommended way to generate a vector image of a 3D model or scene is to use an application-level solution independent from OpenGL.
@subsection upgrade_710_trsfpers Transformation persistence
@@ -1172,22 +1172,22 @@ Class *BRepOffsetAPI_MakeOffsetShape*:
* *BRepOffsetAPI_MakeOffsetShape::PerformByJoin()* - method has been added. This method is old algorithm behaviour.
The code below shows new calling procedure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepOffsetAPI_MakeOffsetShape OffsetMaker;
OffsetMaker.PerformByJoin(Shape, OffsetValue, Tolerance);
NewShape = OffsetMaker.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
Class *BRepOffsetAPI_MakeThickSolid*:
* *BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid()* - constructor with parameters has been deleted.
* *BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin()* - method has been added. This method is old algorithm behaviour.
The code below shows new calling procedure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
@subsection upgrade_720_highlight Highlight style
@@ -1317,7 +1317,7 @@ One can use this functionality in two ways:
The code example below demonstrates how to read shapes from a storage driver using *StdStorage* class.
~~~~
~~~~{.cpp}
// aDriver should be created and opened for reading
Handle(StdStorage_Data) aData;
@@ -1355,7 +1355,7 @@ if (!aRoots.IsNull())
The following code demonstrates how to write shapes in OCCT 7.2.0 using *StdStorage* class.
~~~~
~~~~{.cpp}
// Create a file driver
NCollection_Handle<Storage_BaseDriver> aFileDriver(new FSD_File());
@@ -1640,7 +1640,7 @@ The following changes have been introduced in the API of *BRepMesh_IncrementalMe
Example of usage:
Case 1 (explicit parameters):
~~~~
~~~~{.cpp}
#include <IMeshData_Status.hxx>
#include <IMeshTools_Parameters.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
@@ -1688,7 +1688,7 @@ In fact, drawing points or lines with lighting applied is a valid use case, but
As aspects for different primitive types have been merged, Graphic3d_Group does no more provide per-type aspect properties.
Existing code relying on old behavior and putting interleaved per-type aspects into single Graphic3d_Group should be updated.
For example, the following pseudo-code will not work anymore, because all *SetGroupPrimitivesAspect* calls will setup the same property:
~~~~
~~~~{.cpp}
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< overrides previous aspect
@@ -1700,7 +1700,7 @@ aGroup->AddPrimitiveArray (aTris);
~~~~
To solve the problem, the code should be modified to either put primitives into dedicated groups (preferred approach), or using *SetPrimitivesAspect* in proper order:
~~~~
~~~~{.cpp}
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
@@ -1718,7 +1718,7 @@ Decomposition of Ambient, Diffuse, Specular and Emissive properties has been eli
As result, the following methods of *Graphic3d_MaterialAspect* class have been removed: SetReflectionMode(), SetReflectionModeOn(), Ambient(), Diffuse(), Emissive(), Specular(), SetAmbient(), SetDiffuse(), SetSpecular(), SetEmissive().
Previously, computation of final value required the following code:
~~~~
~~~~{.cpp}
Graphic3d_MaterialAspect theMaterial; Quantity_Color theInteriorColor;
Graphic3d_Vec3 anAmbient (0.0f);
if (theMaterial.ReflectionMode (Graphic3d_TOR_AMBIENT))
@@ -1730,7 +1730,7 @@ if (theMaterial.ReflectionMode (Graphic3d_TOR_AMBIENT))
~~~~
New code looks like this:
~~~~
~~~~{.cpp}
Graphic3d_MaterialAspect theMaterial; Quantity_Color theInteriorColor;
Graphic3d_Vec3 anAmbient = theMaterial.AmbientColor();
if (theMaterial.MaterialType (Graphic3d_MATERIAL_ASPECT)) { anAmbient *= (Graphic3d_Vec3 )theInteriorColor; }
@@ -1751,7 +1751,7 @@ Existing code should be updated to:
Parameters of *Text* in *Graphic3d_Group* are moved into a new *Graphic3d_Text* class. *AddText* of *Graphic3d_Group* should be used instead of the previous *Text*.
The previous code:
~~~~
~~~~{.cpp}
Standard_Real x, y, z;
theAttachmentPoint.Coord(x,y,z);
theGroup->Text (theText,
@@ -1763,7 +1763,7 @@ theGroup->Text (theText,
theAspect->VerticalJustification());
~~~~
should be replaced by the new code:
~~~~
~~~~{.cpp}
Handle(Graphic3d_Text) aText = new Graphic3d_Text (theAspect->Height());
aText->SetText (theText.ToExtString());
aText->SetPosition (theAttachmentPoint);
@@ -1927,7 +1927,7 @@ The method Select3D_SensitiveEntity::NbSubElements() has been changed to be cons
@subsection upgrade_750_Booleans Changes in Boolean operations algorithm
* TreatCompound method has been moved from *BOPAlgo_Tools* to *BOPTools_AlgoTools*. Additionally, the map parameter became optional:
~~~~
~~~~{.cpp}
void BOPTools_AlgoTools::TreatCompound (const TopoDS_Shape& theS,
TopTools_ListOfShape& theLS,
TopTools_MapOfShape* theMap = NULL);
@@ -2094,25 +2094,25 @@ corresponding type of the message.
The code that used operator << for messenger, should be ported as follows.
Before the change:
~~~~~
~~~~{.cpp}
Handle(Message_Messenger) theMessenger = ...;
theMessenger << "Value = " << anInteger << Message_EndLine;
~~~~~
~~~~
After the change, single-line variant:
~~~~~
~~~~{.cpp}
Handle(Message_Messenger) theMessenger = ...;
theMessenger->SendInfo() << "Value = " << anInteger << std::endl;
~~~~~
~~~~
After the change, extended variant:
~~~~~
~~~~{.cpp}
Handle(Message_Messenger) theMessenger = ...;
Message_Messenger::StreamBuffer aSender = theMessenger->SendInfo();
aSender << "Array: [ ";
for (int i = 0; i < aNb; ++i) { aSender << anArray[i] << " "; }
aSender << "]" << std::endl; // aSender can be used further for other messages
~~~~~
~~~~
@subsection upgrade_750_message_printer Message_Printer interface change
@@ -2136,13 +2136,13 @@ provided that each thread deals with its own instance of *TDataStd_Application*
Note that neither *TDataStd_Application* nor *TDocStd_Document* is protected from concurrent access from several threads.
Such protection, if necessary, shall be implemented on the application level.
For an example, access to labels and attributes could be protected by mutex if there is a probability that different threads access the same labels / attributes:
~~~~~
~~~~{.cpp}
{
Standard_Mutex::Sentry aSentry (myMainLabelAccess);
TDF_Label aChildLab = aDocument->Main().NewChild();
TDataStd_Integer::Set(aChildLab, 0);
}
~~~~~
~~~~
@subsection upgrade_750_draw_hotkeys Draw Harness hotkeys
@@ -2179,10 +2179,10 @@ Existing code relying on old behavior, if any, shall be rewritten.
Geom_RectangularTrimmedSurface sequentially trimming in U and V directions already no longer loses the first trim.
For example:
~~~~~
~~~~{.cpp}
Handle(Geom_RectangularTrimmedSurface) ST = new Geom_RectangularTrimmedSurface (Sbase, u1, u2, Standard_True); // trim along U
Handle(Geom_RectangularTrimmedSurface) ST1 = new Geom_RectangularTrimmedSurface (ST, v1, v2, Standard_False); // trim along V
~~~~~
~~~~
gives different result.
In current version ST1 - surface trimmed only along V, U trim is removed;
After modification ST1 - surface trimmed along U and V, U trim is kept.
@@ -2202,3 +2202,94 @@ This way an application based on an old version of Open CASCADE Technology may r
@subsection upgrade_760_createdocument New OCAF document
A new OCAF document may be created only by means of the method *NewDocument()* from CDF_Application (redefined in TDocStd_Application). The methods *CreateDocument()* are deleted in all retrieval drivers.
@subsection upgrade_760_changesInStorageOfShapes Changes in storage of shapes
Information about per-vertex triangulations normals is now stored in BinOCAF and XmlOCAF document,
BRep and Binary BRep Shape formats (only in case of triangulation-only Faces, with no analytical geometry to restore normals).
Versions of formats have been changed (11 for BinOCAF, 10 for XmlOCAF, 4 for BRep Shape and 3 for Binary BRep Shape).
Files written with the new version will not be readable by applications of old versions.
@subsection upgrade_760_changesBinaryFormat Changes in storage of binary document format
All kinds of binary document formats since the new version 12 saved with support of partial reading (sub-set of labels and sub-set of attributes).
For that the shapes data structures are stored with the related NamedShape attributes in the file, not in the particular section in the start of the document.
Also, size allocated for each label is stored in the file. This allows to skip big parts of document in partial reading mode if needed.
As a result, the new binary files become some smaller, but default reading and writing of documents may take some more time (depenging on the environment), up to 15 percents slower in the worse cases.
Backward compatibility (loading of old documents in the newer version) is still fully supported, as well as writing the older versions of the document.
@subsection upgrade_occt760_poly Changes in *Poly* package and *Poly_Triangulation* class
*Poly_Triangulation* does no more provide access to internal array structures: methods Nodes(), ChangeNode(), Triangles(), ChangeTriangle(), UVNodes(), ChangeUVNode(), Normals() have been removed.
Methods of *Poly_Triangulation* for accessing individual nodal properties / triangles by index and implementing copy semantics should be used instead.
The same is applicable to *Poly_PolygonOnTriangulation* interface.
@subsection upgrade_occt760_glsl Custom GLSL programs
Accessors to standard materials have been modified within *Declarations.glsl* (*occFrontMaterial_Diffuse()* -> *occMaterial_Diffuse(bool)* and similar).
Applications defining custom GLSL programs should take into account syntax changes.
@subsection upgrade_occt760_noral_colors Nodal color modulation
Nodal color vertex attribute is now modulated in the same way as a color texture - color is multiplied by material coefficients (diffuse/ambient/specular in case of a common material definition).
Existing code defining nodal colors should be updated to:
- Use *Graphic3d_TOSM_UNLIT* shading model when lighting is not needed.
- Adjust diffuse/ambient material coefficients, which have been previously ignored.
- Remove code multiplying nodal colors, intended to compensate over-brightness due to addition of specular color from material definition, as specular component is now also modulated by a vertex color.
@subsection upgrade_occt760_tkopengles TKOpenGles library
OCCT now provides two separate toolkits - *TKOpenGl* depending on desktop OpenGL and *TKOpenGles* depending on OpenGL ES.
Both libraries can be now built simultaneously on systems providing both APIs (like desktop Linux).
Existing applications depending on OpenGL ES (mobile projects first of all) should be adjusted to link against *TKOpenGles*.
Note that both *TKOpenGl* and *TKOpenGles* keep exporting classes with the same name, so applications should not attempt to link both libraries simultaneously.
@subsection upgrade_occt760_fast_access_to_labels Fast access to OCAF label
Access to an OCAF label via its entry is accelerated. In order to activate it, call *TDF_Data::SetAccessByEntries()*.
The method *TDF_Tool::Label()*, which returns a label by an entry, becomes faster for about 10 .. 20 times.
It has sense for applications, which use an entry as a unique key to access the data in OCAF tree.
Also, the method *TDF_Tool::Entry()*, which returns an entry for a label, is accelerated as well.
@subsection upgrade_occt760_bop_progress_indicator Progress indicator in Boolean operations
Method SetProgressIndicator() has been removed due to Progress indicator mechanism refactoring.
To enable progress indicator and user break in Boolean operations user has to pass progress range as a parameter to Perform or Build method.
For example:
~~~~
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
BRepAlgoApi_Cut(S1, S2, aProgress->Start()); // method Start() creates range for usage in cut algorithm
~~~~
@subsection upgrade_occt760_change_check_to_adaptors Changes in BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces
Now the classes accept adaptors instead objects as input parameters.
*BRepLib_CheckCurveOnSurface* does no more provide access to curves, surface and parameters: methods PCurve(), PCurve2(), Surface() and Range() have been removed.
*BRepLib_CheckCurveOnSurface*: the default value of the *isMultiThread* parameter of the *Perform()* function has been changed from *true* to *false*
*GeomLib_CheckCurveOnSurface* does no more provide access to curve, surface and parameters: methods Curve(), Surface() and Range() have been removed.
*GeomLib_CheckCurveOnSurface*: the default value of the *isMultiThread* parameter of the *Perform()* function has been changed from *true* to *false*
The following functions in *GeomLib_CheckCurveOnSurface* have been modified:
~~~~{.cpp}
GeomLib_CheckCurveOnSurface(const Handle(Adaptor3d_Curve)& theCurve,
const Standard_Real theTolRange);
void Init (const Handle(Adaptor3d_Curve)& theCurve, const Standard_Real theTolRange);
void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
const Standard_Boolean isMultiThread);
~~~~
@subsection upgrade_occt760_old_bop_removed Removal of old Boolean operations algorithm (BRepAlgo_BooleanOperation)
* The method *BRepAlgo_Tool::Deboucle3D* has been removed as duplicating. The corresponding method from *BRepOffset_Tool* class has to be used instead.
* The API classes from *BRepAlgo* package performing old Boolean operations algorithm have been removed:
- *BRepAlgo_BooleanOperation*
- *BRepAlgo_Fuse*
- *BRepAlgo_Common*
- *BRepAlgo_Cut*
- *BRepAlgo_Section*
The corresponding classes from the *BRepAlgoAPI* package have to be used instead.

File diff suppressed because one or more lines are too long

View File

@@ -183,9 +183,9 @@ A variable of a type manipulated by handle which is not attached to an object is
To reference an object, we instantiate the class with one of its constructors.
For example, in C++:
~~~~~
~~~~{.cpp}
Handle(MyClass) anObject = new MyClass();
~~~~~
~~~~
In Open CASCADE Technology, the Handles are specific classes that are used to safely manipulate objects allocated in the dynamic memory by reference,
providing reference counting mechanism and automatic destruction of the object when it is not referenced.
@@ -302,15 +302,15 @@ It provides a reference counter field, inherited by all its descendant classes,
Objects of classes derived (directly or indirectly) from *Transient*, are normally allocated in dynamic memory using operator **new**, and manipulated by handle.
Handle is defined as template class *opencascade::handle<>*.
Open CASCADE Technology provides preprocessor macro *Handle()* that is historically used throughout OCCT code to name a handle:
~~~~~{.cpp}
~~~~{.cpp}
Handle(Geom_Line) aLine; // "Handle(Geom_Line)" is expanded to "opencascade::handle<Geom_Line>"
~~~~~
~~~~
In addition, for most OCCT classes additional *typedef* is defined for a handle, as the name of a class prefixed by *Handle_*.
For instance, the above example can be also coded as:
~~~~~{.cpp}
~~~~{.cpp}
Handle_Geom_Line aLine; // "Handle_Geom_Line" is typedef to "opencascade::handle<Geom_Line>"
~~~~~
~~~~
#### Using a Handle
@@ -318,9 +318,9 @@ A handle is characterized by the object it references.
Before performing any operation on a transient object, you must declare the handle.
For example, if Point and Line are two transient classes from the Geom package, you would write:
~~~~~
~~~~{.cpp}
Handle(Geom_Point) p1, p2;
~~~~~
~~~~
Declaring a handle creates a null handle that does not refer to any object.
The handle may be checked to be null by its method *IsNull()*.
To nullify a handle, use method *Nullify()*.
@@ -338,7 +338,7 @@ To enable this feature, a class declaration should include the declaration of OC
Header *Standard_Type.hxx* provides two variants of preprocessor macros facilitating this:
* Inline variant, which declares and defines RTTI methods by a single line of code:
~~~~~{.cpp}
~~~~{.cpp}
#include <Geom_Surface.hxx>
class Appli_ExtSurface : public Geom_Surface
{
@@ -346,12 +346,12 @@ class Appli_ExtSurface : public Geom_Surface
public:
DEFINE_STANDARD_RTTIEXT(Appli_ExtSurface,Geom_Surface)
};
~~~~~
~~~~
* Out-of line variant, which uses one macro in the declaration (normally in the header file), and another in the implementation (in C++ source):
In *Appli_ExtSurface.hxx* file:
~~~~~{.cpp}
~~~~{.cpp}
#include <Geom_Surface.hxx>
class Appli_ExtSurface : public Geom_Surface
{
@@ -359,13 +359,13 @@ class Appli_ExtSurface : public Geom_Surface
public:
DEFINE_STANDARD_RTTIEXT(Appli_ExtSurface,Geom_Surface)
};
~~~~~
~~~~
In *Appli_ExtSurface.cxx* file:
~~~~~{.cpp}
~~~~{.cpp}
#include <Appli_ExtSurface.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Appli_ExtSurface,Geom_Surface)
~~~~~
~~~~
These macros define method *DynamicType()* that returns a type descriptor - handle to singleton instance of the class *Standard_Type* describing the class.
The type descriptor stores the name of the class and the descriptor of its parent class.
@@ -375,12 +375,12 @@ Note that while inline version is easier to use, for widely used classes this me
To get the type descriptor for a given class type, use macro *STANDARD_TYPE()* with the name of the class as argument.
Example of usage:
~~~~~{.cpp}
~~~~{.cpp}
if (aCurve->IsKind(STANDARD_TYPE(Geom_Line))) // equivalent to "if (dynamic_cast<Geom_Line>(aCurve.get()) != 0)"
{
...
}
~~~~~
~~~~
#### Type Conformity
@@ -390,12 +390,12 @@ Thus, the dynamic type of an object (also called the actual type of an object) c
Consider the class *Geom_CartesianPoint*, a sub-class of *Geom_Point*; the rule of type conformity can be illustrated as follows:
~~~~~
~~~~{.cpp}
Handle(Geom_Point) aPnt1;
Handle(Geom_CartesianPoint) aPnt2;
aPnt2 = new Geom_CartesianPoint();
aPnt1 = aPnt2; // OK, the types are compatible
~~~~~
~~~~
The compiler sees *aPnt1* as a handle to *Geom_Point* though the actual object referenced by *aPnt1* is of the *Geom_CartesianPoint* type.
@@ -409,19 +409,19 @@ A handle can be converted explicitly into one of its sub-types if the actual typ
If this is not the case, the handle is nullified (explicit type conversion is sometimes called a "safe cast").
Consider the example below.
~~~~~~
~~~~{.cpp}
Handle(Geom_Point) aPnt1;
Handle(Geom_CartesianPoint) aPnt2, aPnt3;
aPnt2 = new Geom_CartesianPoint();
aPnt1 = aPnt2; // OK, standard assignment
aPnt3 = Handle(Geom_CartesianPoint)::DownCast (aPnt1);
// OK, the actual type of aPnt1 is Geom_CartesianPoint, although the static type of the handle is Geom_Point
~~~~~~
~~~~
If conversion is not compatible with the actual type of the referenced object, the handle which was "cast" becomes null (and no exception is raised).
So, if you require reliable services defined in a sub-class of the type seen by the handle (static type), write as follows:
~~~~~~
~~~~{.cpp}
void MyFunction (const Handle(A) & a)
{
Handle(B) b = Handle(B)::DownCast(a);
@@ -432,12 +432,12 @@ void MyFunction (const Handle(A) & a)
// the types are incompatible
}
}
~~~~~~
~~~~
Downcasting is used particularly with collections of objects of different types; however, these objects should inherit from the same root class.
For example, with a sequence of transient objects *TColStd_SequenceOfTransient* and two classes A and B that both inherit from *Standard_Transient*, you get the following syntax:
~~~~~
~~~~{.cpp}
Handle(A) a;
Handle(B) b;
Handle(Standard_Transient) t;
@@ -459,17 +459,17 @@ else
{
// the types are incompatible
}
~~~~~
~~~~
@subsubsection occt_fcug_2_2_3 Using Handles to Create Objects
To create an object which is manipulated by handle, declare the handle and initialize it with the standard C++ **new** operator, immediately followed by a call to the constructor.
The constructor can be any of those specified in the source of the class from which the object is instanced.
~~~~~
~~~~{.cpp}
Handle(Geom_CartesianPoint) aPnt;
aPnt = new Geom_CartesianPoint (0, 0, 0);
~~~~~
~~~~
Unlike for a pointer, the **delete** operator does not work on a handle; the referenced object is automatically destroyed when no longer in use.
@@ -480,7 +480,7 @@ To invoke a method which acts on the referenced object, you translate this metho
To test or to modify the state of the handle, the method is translated by the *dot* operator.
The example below illustrates how to access the coordinates of an (optionally initialized) point object:
~~~~~
~~~~{.cpp}
Handle(Geom_CartesianPoint) aCentre;
Standard_Real x, y, z;
if (aCentre.IsNull())
@@ -488,11 +488,11 @@ if (aCentre.IsNull())
aCentre = new PGeom_CartesianPoint (0, 0, 0);
}
aCentre->Coord (x, y, z);
~~~~~
~~~~
The example below illustrates how to access the type object of a Cartesian point:
~~~~~
~~~~{.cpp}
Handle(Standard_Transient) aPnt = new Geom_CartesianPoint (0., 0., 0.);
if (aPnt->DynamicType() == STANDARD_TYPE(Geom_CartesianPoint))
{
@@ -502,7 +502,7 @@ else
{
std::cout << "Type check FAILED\n";
}
~~~~~
~~~~
*Standard_NullObject* exception will be raised if a field or a method of an object is accessed via a *Null* handle.
@@ -512,9 +512,9 @@ A class method is called like a static C++ function, i.e. it is called by the na
For example, we can find the maximum degree of a Bezier curve:
~~~~~
~~~~{.cpp}
Standard_Integer aDegree = Geom_BezierCurve::MaxDegree();
~~~~~
~~~~
@subsubsection occt_fcug_2_2_5 Handle deallocation
@@ -529,7 +529,7 @@ The object is automatically deleted by the handle when reference counter becomes
The principle of allocation can be seen in the example below.
~~~~~
~~~~{.cpp}
...
{
Handle(TColStd_HSequenceOfInteger) H1 = new TColStd_HSequenceOfInteger();
@@ -549,11 +549,11 @@ The principle of allocation can be seen in the example below.
// Here, H1 has 1 reference
}
// Here, H1 has no reference and the referred TColStd_HSequenceOfInteger object is deleted.
~~~~~
~~~~
You can easily cast a reference to the handle object to <i> void* </i> by defining the following:
~~~~
~~~~{.cpp}
void* aPointer;
Handle(Some_Class) aHandle;
// Here only a pointer will be copied
@@ -701,12 +701,12 @@ The following paragraphs describe recommended approaches for using exceptions wh
#### "C++ like" Syntax
The following example:
~~~~~
~~~~{.cpp}
throw Standard_DomainError ("Cannot cope with this condition");
~~~~~
~~~~
raises an exception of *Standard_DomainError* type with the associated message "Cannot cope with this condition", the message being optional.
This exception may be caught by a handler of a *Standard_DomainError* type as follows:
~~~~~
~~~~{.cpp}
try
{
OCC_CATCH_SIGNALS
@@ -716,7 +716,7 @@ catch (const Standard_DomainError& )
{
// handle Standard_DomainError exceptions here
}
~~~~~
~~~~
#### Regular usage
@@ -734,7 +734,7 @@ For example, if you consider the *TCollection_Array1* class used with:
then, the *Value* function may be implemented as follows:
~~~~~
~~~~{.cpp}
Item TCollection_Array1::Value (Standard_Integer theIndex) const
{
// where myR1 and myR2 are the lower and upper bounds of the array
@@ -744,7 +744,7 @@ Item TCollection_Array1::Value (Standard_Integer theIndex) const
}
return myContents[theIndex];
}
~~~~~
~~~~
Here validity of the index is first verified using the Lower and Upper functions in order to protect the call.
Normally the caller ensures the index being in the valid range before calling <i>Value()</i>.
@@ -752,26 +752,26 @@ In this case the above implementation of *Value* is not optimal since the test d
It is a widely used practice to include that kind of protections in a debug build of the program and exclude in release (optimized) build.
To support this practice, the macros <i>Raise_if()</i> are provided for every OCCT exception class:
~~~~~
~~~~{.cpp}
<ErrorTypeName>_Raise_if(condition, "Error message");
~~~~~
~~~~
where *ErrorTypeName* is the exception type, *condition* is the logical expression leading to the raise of the exception, and *Error message* is the associated message.
The entire call may be removed by defining one of the preprocessor symbols *No_Exception* or <i>No_<ErrorTypeName></i> at compile-time:
~~~~~
~~~~{.cpp}
#define No_Exception // remove all raises
~~~~~
~~~~
Using this syntax, the *Value* function becomes:
~~~~~
~~~~{.cpp}
Item TCollection_Array1::Value (Standard_Integer theIndex) const
{
Standard_OutOfRange_Raise_if(theIndex < myR1 || theIndex > myR2, "index out of range in TCollection_Array1::Value");
return myContents[theIndex];
}
~~~~~
~~~~
@subsubsection occt_fcug_2_4_3 Handling an Exception
@@ -788,7 +788,7 @@ The recommended location for it is first statement after opening brace of <i>try
As an example, consider the exceptions of type *Standard_NumericError, Standard_Overflow, Standard_Underflow* and *Standard_DivideByZero*, where *Standard_NumericError* is the parent type of the three others.
~~~~~
~~~~{.cpp}
void f(1)
{
try
@@ -805,7 +805,7 @@ void f(1)
// ...
}
}
~~~~~
~~~~
Here, the first handler will catch exceptions of *Standard_Overflow* type
and the second one -- exceptions of *Standard_NumericError* type and all exceptions derived from it, including *Standard_Underflow* and *Standard_DivideByZero*.
@@ -813,7 +813,7 @@ and the second one -- exceptions of *Standard_NumericError* type and all excepti
The handlers are checked in order of appearance, from the nearest to the try block to the most distant from it, until one matches the raise expression.
For a try block, it would be a mistake to place a handler for a base exception type ahead of a handler for its derived type since that would ensure that the handler for the derived exception would never be invoked.
~~~~~
~~~~{.cpp}
void f(1)
{
int i = 0;
@@ -832,7 +832,7 @@ void f(1)
}
. . .
}
~~~~~
~~~~
The exceptions form a hierarchy tree completely separated from other user defined classes.
One exception of type *Standard_Failure* is the root of the entire exception hierarchy.
@@ -841,7 +841,7 @@ It is recommended to set up such a handler in the main routine.
The main routine of a program would look like this:
~~~~~
~~~~{.cpp}
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <iostream>
@@ -859,7 +859,7 @@ int main (int argc, char* argv[])
}
return 1;
}
~~~~~
~~~~
Though standard C++ scoping rules and syntax apply to try block and handlers, note that on some platforms Open CASCADE Technology may be compiled in compatibility mode when exceptions are emulated by long jumps (see below).
In this mode it is required that no statement precedes or follows any handler.
@@ -921,17 +921,17 @@ Foundation classes provide in the package *Plugin* a method named *Load()*, whic
That method reads the information regarding available plug-ins and their locations from the resource file *Plugin* found by environment variable *CSF_PluginDefaults*:
~~~~~
~~~~
$CSF_PluginDefaults/Plugin
~~~~~
~~~~
The *Load* method looks for the library name in the resource file or registry through its GUID, for example, on UNIX:
~~~~~
~~~~
! METADATADRIVER whose value must be OS or DM.
! FW
a148e300-5740-11d1-a904-080036aaa103.Location: libFWOSPlugin.so
~~~~~
~~~~
Then the *Load* method loads the library according to the rules of the operating system of the host machine (for example, by using environment variables such as *LD_LIBRARY_PATH* with Unix and *PATH* with Windows).
After that it invokes the *PLUGINFACTORY* method to return the object, which supports the required service.
@@ -941,13 +941,13 @@ The client may then call the functions supported by this object.
To invoke one of the services provided by the plug-in, you may call the *Plugin::Load()* global function with the *Standard_GUID* of the requested service as follows:
~~~~~{.cpp}
~~~~{.cpp}
Handle(FADriver_PartStorer)::DownCast(PlugIn::Load (yourStandardGUID));
~~~~~
~~~~
Let us take *FAFactory.hxx* and *FAFactory.cxx* as an example:
~~~~~{.cpp}
~~~~{.cpp}
#include <Standard_Macro.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Transient.hxx>
@@ -957,9 +957,9 @@ class FAFactory
public:
Standard_EXPORT static Handle(Standard_Transient) Factory (const Standard_GUID& theGUID);
};
~~~~~
~~~~
~~~~~{.cpp}
~~~~{.cpp}
#include <FAFactory.hxx>
#include <FADriver_PartRetriever.hxx>
@@ -1004,7 +1004,7 @@ Handle(Standard_Transient) FAFactory::Factory (const Standard_GUID& theGUID)
// export plugin function "PLUGINFACTORY"
PLUGIN(FAFactory)
~~~~~
~~~~
Application might also instantiate a factory by linking to the library and calling *FAFactory::Factory()* directly.
@@ -1042,14 +1042,14 @@ These definitions are now obsolete though still can be used, particularly for co
Let see an example of NCollection template class instantiation for a sequence of points in the header file *MyPackage_SequenceOfPnt.hxx* (analogue of *TColgp_SequenceOfPnt*):
~~~~~{.cpp}
~~~~{.cpp}
#include <NCollection_Sequence.hxx>
#include <gp_Pnt.hxx>
typedef NCollection_Sequence<gp_Pnt> MyPackage_SequenceOfPnt;
~~~~~
~~~~
For the case, when sequence itself should be managed by handle, auxiliary macros *DEFINE_HSEQUENCE* can be used:
~~~~~{.cpp}
~~~~{.cpp}
#include <NCollection_Sequence.hxx>
#include <NCollection_DefineHSequence.hxx>
#include <gp_Pnt.hxx>
@@ -1057,7 +1057,7 @@ typedef NCollection_Sequence<gp_Pnt> MyPackage_SequenceOfPnt;
DEFINE_HSEQUENCE(MyPackage_HSequenceOfPnt, MyPackage_SequenceOfPnt)
...
Handle(MyPackage_HSequenceOfPnt) aSeq = new MyPackage_HSequenceOfPnt();
~~~~~
~~~~
See more details about available collections in following sections.
@@ -1302,7 +1302,7 @@ The common methods of Iterator are:
Usage sample:
~~~~~{.cpp}
~~~~{.cpp}
typedef Ncollection_Sequence<gp_Pnt> MyPackage_SequenceOfPnt;
void Perform (const MyPackage_SequenceOfPnt& theSequence)
{
@@ -1312,17 +1312,17 @@ void Perform (const MyPackage_SequenceOfPnt& theSequence)
...
}
}
~~~~~
~~~~
@subsubsection occt_fcug_3_1_5 Allocators
All constructors of *NCollection* classes receive the *Allocator* object as the last parameter.
This is an object of a type managed by Handle, inheriting *NCollection_BaseAllocator*, with the following (mandatory) methods redefined:
~~~~~{.cpp}
~~~~{.cpp}
virtual void* Allocate (const size_t theSize) override;
virtual void Free (void* theAddress) override;
~~~~~
~~~~
It is used internally every time when the collection allocates memory for its item(s) and releases this memory.
The default value of this parameter (empty *Handle*) designates the use of *NCollection_BaseAllocator*, where the functions *Standard::Allocate* and *Standard::Free* are called.
@@ -1360,7 +1360,7 @@ Among the best suitable solutions there can be a pointer to an object, handled o
The bounding object may have any dimension and geometry.
The minimal interface of *TheBndType* (besides public empty and copy constructor and operator=) used in NCollection_UBTree algorithm as follows:
~~~~~{.cpp}
~~~~{.cpp}
class MyBndType
{
public:
@@ -1373,7 +1373,7 @@ public:
//! Computes the squared maximal linear extent of me (for a box it is the squared diagonal of the box).
Standard_Real SquareExtent() const;
};
~~~~~
~~~~
This interface is implemented in types of Bnd package: *Bnd_Box, Bnd_Box2d, Bnd_B2x, Bnd_B3x*.
@@ -1384,7 +1384,7 @@ The quality of a tree is better (considering the speed of searches) if objects a
Instantiation of *NCollection_UBTreeFiller* collects objects to be added, and then adds them at once to the given NCollection_UBTree instance in a random order using the Fisher-Yates algorithm.
Below is the sample code that creates an instance of *NCollection_UBTree* indexed by 2D boxes (Bnd_B2f), then a selection is performed returning the objects whose bounding boxes contain the given 2D point.
~~~~~{.cpp}
~~~~{.cpp}
typedef NCollection_UBTree<MyData, Bnd_B2f> UBTree;
typedef NCollection_List<MyData> ListOfSelected;
//! Tree Selector type
@@ -1426,7 +1426,7 @@ aTreeFiller.Fill();
MyTreeSelector aSel (aPoint2d);
aTree.Select (aSel);
const ListOfSelected& aSelected = aSel.ListAccepted();
~~~~~
~~~~
##### NCollection_CellFilter
@@ -1438,10 +1438,10 @@ while search with NCollection_UBTree provides logarithmic law access time.
Packages *TShort*, *TColGeom*, *TColGeom2d*, *TColStd*, *TColgp* provide template instantiations (typedefs) of *NCollection* templates to standard OCCT types.
Classes with *H* prefix in name are handle-based variants and inherit Standard_Transient.
~~~~~{.cpp}
~~~~{.cpp}
typedef NCollection_Array1<gp_Vec> TColgp_Array1OfVec;
typedef NCollection_Array1<TCollection_AsciiString> TColStd_Array1OfAsciiString;
~~~~~
~~~~
Packages like *TopTools* also include definitions of collections and hash functions for complex types like shapes -- *TopTools_ShapeMapHasher*, *TopTools_MapOfShape*.
@@ -1525,27 +1525,27 @@ These classes also provide a data structure to represent any expression, relatio
Vectors and matrices have arbitrary ranges which must be defined at declaration time and cannot be changed after declaration.
~~~~~{.cpp}
~~~~{.cpp}
math_Vector aVec (1, 3);
// a vector of dimension 3 with range (1..3)
math_Matrix aMat (0, 2, 0, 2);
// a matrix of dimension 3x3 with range (0..2, 0..2)
math_Vector aVec (N1, N2);
// a vector of dimension N2-N1+1 with range (N1..N2)
~~~~~
~~~~
Vector and Matrix objects use value semantics.
In other words, they cannot be shared and are copied through assignment.
~~~~~{.cpp}
~~~~{.cpp}
math_Vector aVec1 (1, 3), aVec2 (0, 2);
aVec2 = aVec1;
// aVec1 is copied into aVec2; a modification of aVec1 does not affect aVec2
~~~~~
~~~~
Vector and Matrix values may be initialized and obtained using indexes which must lie within the range definition of the vector or the matrix.
~~~~~{.cpp}
~~~~{.cpp}
math_Vector aVec (1, 3);
math_Matrix aMat (1, 3, 1, 3);
Standard_Real aValue;
@@ -1554,7 +1554,7 @@ aVec (2) = 1.0;
aValue = aVec(1);
aMat (1, 3) = 1.0;
aValue = aMat (2, 2);
~~~~~
~~~~
Some operations on Vector and Matrix objects may not be legal.
In this case an exception is raised.
@@ -1562,12 +1562,12 @@ Two standard exceptions are used:
* *Standard_DimensionError* exception is raised when two matrices or vectors involved in an operation are of incompatible dimensions.
* *Standard_RangeError* exception is raised if an access outside the range definition of a vector or of a matrix is attempted.
~~~~~~{.cpp}
~~~~{.cpp}
math_Vector aVec1 (1, 3), aVec2 (1, 2), aVec3 (0, 2);
aVec1 = aVec2; // error: Standard_DimensionError is raised
aVec1 = aVec3; // OK: ranges are not equal but dimensions are compatible
aVec1 (0) = 2.0; // error: Standard_RangeError is raised
~~~~~~
~~~~
@subsection occt_occt_fcug_4_3 Primitive Geometric Types
@@ -1649,7 +1649,7 @@ They contain:
The example below demonstrates the use of the math_Gauss class, which implements the Gauss solution for a set of linear equations.
The following definition is an extract from the header file of the class *math_Gauss*:
~~~~~~{.cpp}
~~~~{.cpp}
class math_Gauss
{
public:
@@ -1657,11 +1657,11 @@ public:
Standard_Boolean IsDone() const;
void Solve (const math_Vector& B, math_Vector& X) const;
};
~~~~~~
~~~~
Now the main program uses the math_Gauss class to solve the equations _a*x1=b1_ and _a*x2=b2_:
~~~~~{.cpp}
~~~~{.cpp}
#include <math_Vector.hxx>
#include <math_Matrix.hxx>
main()
@@ -1686,12 +1686,12 @@ main()
// StdFail_NotDone is raised
}
}
~~~~~
~~~~
The next example demonstrates the use of the *math_BissecNewton* class, which implements a combination of the Newton and Bissection algorithms to find the root of a function known to lie between two bounds.
The definition is an extract from the header file of the class *math_BissecNewton*:
~~~~~{.cpp}
~~~~{.cpp}
class math_BissecNewton
{
public:
@@ -1702,12 +1702,12 @@ public:
Standard_Boolean IsDone() const;
Standard_Real Root();
};
~~~~~
~~~~
The abstract class *math_FunctionWithDerivative* describes the services which have to be implemented for the function _f_ which is to be used by a *math_BissecNewton* algorithm.
The following definition corresponds to the header file of the abstract class *math_FunctionWithDerivative*:
~~~~~{.cpp}
~~~~{.cpp}
class math_FunctionWithDerivative
{
public:
@@ -1715,12 +1715,12 @@ public:
virtual Standard_Boolean Derivative (const Standard_Real x, Standard_Real& d) = 0;
virtual Standard_Boolean Values (const Standard_Real x, Standard_Real& f, Standard_Real& d) = 0;
};
~~~~~
~~~~
Now the test sample uses the *math_BissecNewton* class to find the root of the equation _f(x)=x**2-4_ in the interval [1.5, 2.5].
The function to solve is implemented in the class *myFunction* which inherits from the class *math_FunctionWithDerivative*, then the main program finds the required root.
~~~~~{.cpp}
~~~~{.cpp}
#include <math_BissecNewton.hxx>
#include <math_FunctionWithDerivative.hxx>
class myFunction : public math_FunctionWithDerivative
@@ -1759,7 +1759,7 @@ main()
else // no
{
}
~~~~~
~~~~
@subsection occt_occt_fcug_4_7 Precision
@@ -1796,10 +1796,10 @@ The choice of precision value for parametric space depends not only on the accur
This is because it is desirable to link parametric precision and real precision.
If you are on a curve defined by the equation *P(t)*, you would want to have equivalence between the following:
~~~~~
~~~~{.cpp}
Abs (t1 - t2) < ParametricPrecision
Distance (P(t1), P(t2)) < RealPrecision
~~~~~
~~~~
@subsubsection occt_occt_fcug_4_7_1 The Precision package
@@ -1832,7 +1832,7 @@ This method is used to compare two angles.
Its current value is *Epsilon(2 * PI)* i.e. the smallest number *x* such that *2*PI + x* is different of *2\*PI*.
It can be used to check confusion of two angles as follows:
~~~{.cpp}
~~~~{.cpp}
bool areEqualAngles (double theAngle1, double theAngle2)
{
return Abs(theAngle1 - theAngle2) < Precision::Angular();
@@ -1840,7 +1840,7 @@ bool areEqualAngles (double theAngle1, double theAngle2)
~~~
It is also possible to check parallelism of two vectors as follows:
~~~{.cpp}
~~~~{.cpp}
bool areParallelVectors (const gp_Vec& theVec1, const gp_Vec& theVec2)
{
return theVec1.IsParallel (theVec2, Precision::Angular());
@@ -1849,7 +1849,7 @@ bool areParallelVectors (const gp_Vec& theVec1, const gp_Vec& theVec2)
Note that *Precision::Angular()* can be used on both dot and cross products because for small angles the *Sine* and the *Angle* are equivalent.
So to test if two directions of type *gp_Dir* are perpendicular, it is legal to use the following code:
~~~{.cpp}
~~~~{.cpp}
bool arePerpendicular (const gp_Dir& theDir1, const gp_Dir& theDir2)
{
return Abs(theDir1 * theDir2) < Precision::Angular();
@@ -1862,7 +1862,7 @@ This method is used to test 3D distances.
The current value is *1.e-7*, in other words, 1/10 micron if the unit used is the millimeter.
It can be used to check confusion of two points as follows:
~~~{.cpp}
~~~~{.cpp}
bool areEqualPoints (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2)
{
return thePnt1.IsEqual (thePnt2, Precision::Confusion());
@@ -1870,7 +1870,7 @@ bool areEqualPoints (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2)
~~~
It is also possible to find a vector of null length:
~~~{.cpp}
~~~~{.cpp}
bool isNullVector (const gp_Vec& theVec)
{
return theVec.Magnitude() < Precision::Confusion();

View File

@@ -60,25 +60,25 @@ Administrative data, in the Global Section of the IGES file (such as the file n
@subsection occt_iges_2_3 Description of the process
@subsubsection occt_iges_2_3_1 Loading the IGES file
Before performing any other operation, you have to load the file using the syntax below.
~~~~~
~~~~{.cpp}
IGESControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile(“filename.igs”);
~~~~~
~~~~
The loading operation only loads the IGES file into computer memory; it does not translate it.
@subsubsection occt_iges_2_3_2 Checking the IGES file
This step is not obligatory. Check the loaded file with:
~~~~~
~~~~{.cpp}
Standard_Boolean ok = reader.Check(Standard_True);
~~~~~
~~~~
The variable “ok is True” is returned if no fail message was found; “ok is False” is returned if there was at least one fail message.
~~~~~
~~~~{.cpp}
reader.PrintCheckLoad (failsonly, mode);
~~~~~
~~~~
Error messages are displayed if there are invalid or incomplete IGES entities, giving you information on the cause of the error.
~~~~~
~~~~{.cpp}
Standard_Boolean failsonly = Standard_True or Standard_False;
~~~~~
~~~~
If you give True, you will see fail messages only. If you give False, you will see both fail and warning messages.
Your analysis of the file can be either message-oriented or entity-oriented. Choose your preference with *IFSelect_PrintCount mode = IFSelect_xxx*, where *xxx* can be any of the following:
@@ -98,14 +98,14 @@ manages the continuity of BSpline curves (IGES entities 106, 112 and 126) after
* 2: This option concerns IGES Spline curves only. IGES Spline curves are broken down into pieces of C2 continuity. If C2 cannot be ensured, the Spline curves will be broken down into pieces of C1 continuity.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("read.iges.bspline.continuity");
~~~~~
~~~~
Modify this value with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetIVal ("read.iges.bspline.continuity",2))
.. error ..;
~~~~~
~~~~
Default value is 1.
This parameter does not change the continuity of curves that are used in the construction of IGES BRep entities. In this case, the parameter does not influence the continuity of the resulting OCCT curves (it is ignored).
@@ -117,14 +117,14 @@ reads the precision value.
* User (1) the precision value is that of the read.precision.val parameter.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("read.precision.mode");
~~~~~
~~~~
Modify this value with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetIVal ("read.precision.mode",1))
.. error ..;
~~~~~
~~~~
Default value is *File* (0).
<h4>read.precision.val</h4>
@@ -133,14 +133,14 @@ User defined precision value. This parameter gives the precision for shape const
This value is in the measurement unit defined in the IGES file header.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Real rp = Interface_Static::RVal("read.precision.val");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetRVal ("read.precision.val",0.001))
.. error ..;
~~~~~
~~~~
Default value is 0.0001.
The value given to this parameter is a target value that is applied to *TopoDS_Vertex, TopoDS_Edge* and *TopoDS_Face* entities. The processor does its best to reach it. Under certain circumstances, the value you give may not be attached to all of the entities concerned at the end of processing. IGES-to-OCCT translation does not improve the quality of the geometry in the original IGES file. This means that the value you enter may be impossible to attain the given quality of geometry in the IGES file.
@@ -154,27 +154,27 @@ defines the mode of applying the maximum allowed tolerance. Its possible values
* *Forced(1)* maximum tolerance is used as a rigid limit, i.e. it can not be exceeded and, if this happens, tolerance is trimmed to suit the maximum-allowable value.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Integer mv = Interface_Static::IVal("read.maxprecision.mode");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetIVal ("read.maxprecision.mode",1))
.. error ..;
~~~~~
~~~~
Default value is *Preferred (0)*.
<h4>read.maxprecision.val</h4>
defines the maximum allowable tolerance (in mm) of the shape. It should be not less than the basis value of tolerance set in processor (either Resolution from the file or *read.precision.val*). Actually, the maximum between *read.maxprecision.val* and basis tolerance is used to define maximum allowed tolerance.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Real rp = Interface_Static::RVal("read.maxprecision.val");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetRVal ("read.maxprecision.val",0.1))
.. error ..;
~~~~~
~~~~
Default value is 1.
<h4>read.stdsameparameter.mode</h4>
@@ -183,14 +183,14 @@ defines the using of *BRepLib\::SameParameter*. Its possible values are:
* 1 (On) -- *BRepLib\::SameParameter* is called.
*BRepLib\::SameParameter* is used through *ShapeFix_Edge\::SameParameter*. It ensures that the resulting edge will have the lowest tolerance taking pcurves either unmodified from the IGES file or modified by *BRepLib\::SameParameter*.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Integer mv = Interface_Static::IVal("read.stdsameparameter.mode");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetIVal ("read.stdsameparameter.mode",1))
.. error ..;
~~~~~
~~~~
Deafault value is 0 (Off).
<h4>read.surfacecurve.mode</h4>
@@ -224,42 +224,42 @@ In any other case, the 2D representation is preferred to the 3D.
If either a 3D or a 2D contour is absent in the file or cannot be translated, then it is re-computed from another contour. If the translation of both 2D and 3D contours fails, the whole curve (type 141 or 142) is not translated. If this curve is used for trimming a face, the face will be translated without this trimming and will have natural restrictions.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("read.surfacecurve.mode");
~~~~~
~~~~
Modify this value with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetIVal ("read.surfacecurve.mode",3))
.. error ..;
~~~~~
~~~~
Default value is Default (0).
<h4>read.encoderegularity.angle</h4>
This parameter is used within the *BRepLib::EncodeRegularity()* function which is called for a shape read from an IGES or a STEP file at the end of translation process. This function sets the regularity flag of an edge in a shell when this edge is shared by two faces. This flag shows the continuity, which these two faces are connected with at that edge.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Real era = Interface_Static::RVal("read.encoderegularity.angle");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetRVal ("read.encoderegularity.angle",0.1))
.. error ..;
~~~~~
~~~~
Default value is 0.01.
<h4>read.iges.bspline.approxd1.mode</h4>
This parameter is obsolete (it is rarely used in real practice). If set to True, it affects the translation of bspline curves of degree 1 from IGES: these curves (which geometrically are polylines) are split by duplicated points, and the translator attempts to convert each of the obtained parts to a bspline of a higher continuity.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Real bam = Interface_Static::CVal("read.iges.bspline.approxd1.mode");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetRVal ("read.encoderegularity.angle","On"))
.. error ..;
~~~~~
~~~~
Default value is Off.
@@ -282,41 +282,41 @@ Default value is MM.
@subsubsection occt_iges_2_3_4 Selecting entities
A list of entities can be formed by invoking the method *IGESControl_Reader::GiveList*.
~~~~~
~~~~{.cpp}
Handle(TColStd_HSequenceOfTransient) list = reader.GiveList();
~~~~~
~~~~
Several predefined operators can be used to select a list of entities of a specific type.
To make a selection, use the method *IGESControl_Reader::GiveList* with the selection type in quotation marks as an argument. You can also make cumulative selections. For example, you would use the following syntax:
To make a selection, use the method *IGESControl_Reader::GiveList* with the selection type in quotation marks as an argument. You can also make cumulative selections. For example, you would use the following Syntax:
1. Requesting the faces in the file:
~~~~~
~~~~{.cpp}
faces = Reader.GiveList("iges-faces");
~~~~~
~~~~
2. Requesting the visible roots in the file:
~~~~~
~~~~{.cpp}
visibles = Reader.GiveList(iges-visible-roots);
~~~~~
~~~~
3. Requesting the visible faces:
~~~~~
~~~~{.cpp}
visfac = Reader.GiveList(iges-visible-roots,faces);
~~~~~
~~~~
Using a signature, you can define a selection dynamically, filtering the string by means of a criterion. When you request a selection using the method GiveList, you can give either a predefined selection or a selection by signature. You make your selection by signature using the predefined signature followed by your criterion in parentheses as shown in the example below. The syntaxes given are equivalent to each other.
~~~~~
~~~~{.cpp}
faces = Reader.GiveList(“xst-type(SurfaceOfRevolution)”);
faces = Reader.GiveList(“iges-type(120)”);
~~~~~
~~~~
You can also look for:
* values returned by your signature which match your criterion exactly
~~~~~
~~~~{.cpp}
faces = Reader.GiveList(“xst-type(=SurfaceOfRevolution)”);
~~~~~
~~~~
* values returned by your signature which do not contain your criterion
~~~~~
~~~~{.cpp}
faces = Reader.GiveList(“xst-type(!SurfaceOfRevolution)”);
~~~~~
~~~~
* values returned by your signature which do not exactly match your criterion.
~~~~~
~~~~{.cpp}
faces = Reader.GiveList(“xst-type(!=SurfaceOfRevolution)”);
~~~~~
~~~~
<h4>List of predefined operators that can be used:</h4>
* *xst-model-all* -- selects all entities.
@@ -329,7 +329,7 @@ faces = Reader.GiveList(“xst-type(!=SurfaceOfRevolution)”);
* *iges-visible-transf-roots* -- selects all visible and translatable roots.
* *iges-blanked-roots* -- selects all blank roots, whether translatable or not.
* *iges-blanked-transf-roots* -- selects all blank and translatable roots.
* *iges-status-independant* -- selects entities whose IGES Subordinate Status = 0.
* *iges-status-independent* -- selects entities whose IGES Subordinate Status = 0.
* *iges-bypass-group* -- selects all root entities. If a root entity is a group (402/7 or 402/9), the entities in the group are selected.
* *iges-bypass-subfigure* -- selects all root entities. If a root entity is a subfigure definition (308), the entities in the subfigure definition are selected.
* *iges-bypass-group-subfigure* -- selects all root entities. If a root entity is a group (402/7 or 402/9) or a subfigure definition (308), the entities in the group and in the subfigure definition are selected.
@@ -342,62 +342,62 @@ faces = Reader.GiveList(“xst-type(!=SurfaceOfRevolution)”);
@subsubsection occt_iges_2_3_5 Performing the IGES file translation
Perform translation according to what you want to translate:
1. Translate an entity identified by its rank with:
~~~~~
~~~~{.cpp}
Standard_Boolean ok = reader.Transfer (rank);
~~~~~
~~~~
2. Translate an entity identified by its handle with:
~~~~~
~~~~{.cpp}
Standard_Boolean ok = reader.TransferEntity (ent);
~~~~~
~~~~
3. Translate a list of entities in one operation with:
~~~~~
~~~~{.cpp}
Standard_Integer nbtrans = reader.TransferList (list);
reader.IsDone();
~~~~~
~~~~
where *nbtrans* returns the number of items in the list that produced a shape and *reader.IsDone()* indicates whether at least one entity was translated.
4. Translate a list of entities, entity by entity:
~~~~~
~~~~{.cpp}
Standard_Integer i,nb = list-Length();
for (i = 1; i <= nb; i ++) {
Handle(Standard_Transient) ent = list-Value(i);
Standard_Boolean OK = reader.TransferEntity (ent);
}
~~~~~
~~~~
5. Translate the whole file (all entities or only visible entities) with:
~~~~~
~~~~{.cpp}
Standard_Boolean onlyvisible = Standard_True or Standard_False;
reader.TransferRoots(onlyvisible)
~~~~~
~~~~
@subsubsection occt_iges_2_3_6 Getting the translation results
Each successful translation operation outputs one shape. A series of translations gives a series of shapes.
Each time you invoke *TransferEntity, Transfer* or *Transferlist*, their results are accumulated and NbShapes increases. You can clear the results (Clear function) between two translation operations, if you do not do this, the results from the next translation will be added to the accumulation. *TransferRoots* operations automatically clear all existing results before they start.
~~~~~
~~~~{.cpp}
Standard_Integer nbs = reader.NbShapes();
~~~~~
~~~~
returns the number of shapes recorded in the result.
~~~~~
~~~~{.cpp}
TopoDS_Shape shape = reader.Shape(num);,
~~~~~
~~~~
returns the result *num*, where *num* is an integer between 1 and *NbShapes*.
~~~~~
~~~~{.cpp}
TopoDS_Shape shape = reader.Shape();
~~~~~
~~~~
returns the first result in a translation operation.
~~~~~
~~~~{.cpp}
TopoDS_Shape shape = reader.OneShape();
~~~~~
~~~~
returns all results in a single shape which is:
* a null shape if there are no results,
* in case of a single result, a shape that is specific to that result,
* a compound that lists the results if there are several results.
~~~~~
~~~~{.cpp}
reader.Clear();
~~~~~
~~~~
erases the existing results.
~~~~~
~~~~{.cpp}
reader.PrintTransferInfo (failsonly, mode);
~~~~~
~~~~
displays the messages that appeared during the last invocation of *Transfer* or *TransferRoots*.
If *failsonly* is *IFSelect_FailOnly*, only fail messages will be output, if it is *IFSelect_FailAndWarn*, all messages will be output. Parameter “mode” can have *IFSelect_xxx* values where *xxx* can be:
@@ -490,25 +490,25 @@ If a *TopoDS_Face* is output, its geometrical support is a *Geom_Surface* and i
@subsection occt_iges_2_5 Messages
Messages are displayed concerning the normal functioning of the processor (transfer, loading, etc.).
You must declare an include file:
~~~~~
~~~~{.cpp}
#include \<Interface_DT.hxx\>
~~~~~
~~~~
You have the choice of the following options for messages:
~~~~~
~~~~{.cpp}
IDT_SetLevel (level);
~~~~~
~~~~
level modifies the level of messages:
* 0: no messages
* 1: raise and fail messages are displayed, as are messages concerning file access,
* 2: warnings are also displayed.
~~~~~
~~~~{.cpp}
IDT_SetFile (“tracefile.log”);
~~~~~
~~~~
prints the messages in a file,
~~~~~
~~~~{.cpp}
IDT_SetStandard();
~~~~~
~~~~
restores screen output.
@subsection occt_iges_2_6 Tolerance management
@@ -605,7 +605,7 @@ The highlighted classes produce OCCT geometry.
@subsection occt_iges_2_8 Example
~~~~~
~~~~{.cpp}
#include “IGESControl_Reader.hxx”
#include “TColStd_HSequenceOfTransient.hxx”
#include “TopoDS_Shape.hxx”
@@ -627,7 +627,7 @@ cout<<"IGES Faces: "<<nIgesFaces<<" Transferred:"<<nTransFaces<<endl;
TopoDS_Shape sh = myIgesReader.OneShape();
//and obtains the results in an OCCT shape.
}
~~~~~
~~~~
@section occt_iges_3 Writing IGES
@subsection occt_iges_3_1 Procedure
@@ -665,13 +665,13 @@ The following parameters are used for the OCCT-to-IGES translation.
* "Faces" (0): OCCT *TopoDS_Faces* will be translated into IGES 144 (Trimmed Surface) entities, no BRep entities will be written to the IGES file,
* "BRep" (1): OCCT *TopoDS_Faces* will be translated into IGES 510 (Face) entities, the IGES file will contain BRep entities.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Integer byvalue = Interface_Static::IVal("write.iges.brep.mode");
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
Interface_Static::SetIVal ("write.iges.brep.mode", 1);
~~~~~
~~~~
Default value is "Faces" (0).
* *write.convertsurface.mode* when writing to IGES in the BRep mode, this parameter indicates whether elementary surfaces (cylindrical, conical, spherical, and toroidal) are converted into corresponding IGES 5.3 entities (if the value of a parameter value is On), or written as surfaces of revolution (by default).
* *write.iges.unit:* allows choosing the unit. The default unit for Open CASCADE Technology is "MM" (millimeter). You can choose to write a file into any unit accepted by IGES.
@@ -700,46 +700,46 @@ Default value is "Faces" (0).
* *write.precision.val:* is the user precision value. This parameter gives the resolution value for an IGES file when the *write.precision.mode* parameter value is 1. It is equal to 0.0001 by default, but can take any real positive (non null) value.
Read this parameter with:
~~~~~
~~~~{.cpp}
Standard_Real rp = Interface_Static::RVal(;write.precision.val;);
~~~~~
~~~~
Modify this parameter with:
~~~~~
~~~~{.cpp}
if (!Interface_Static::SetRVal(;write.precision.val;,0.01))
.. error ..
~~~~~
~~~~
Default value is 0.0001.
<h4>write.iges.resource.name</h4> and <h4>write.iges.sequence</h4> are the same as the corresponding read.iges.\* parameters. Note that the default sequence for writing contains *DirectFaces* operator, which converts elementary surfaces based on left-hand axes (valid in CASCADE) to right-hand axes (which are valid only in IGES).
Default values :
~~~~~
~~~~{.cpp}
write.iges.resource.name - IGES,
write.iges.sequence - ToIGES.
~~~~~
~~~~
@subsubsection occt_iges_3_3_3 Performing the Open CASCADE Technology shape translation
You can perform the translation in one or several operations. Here is how you translate topological and geometrical objects:
~~~~~
~~~~{.cpp}
Standard_Boolean ok = writer.AddShape (TopoDS_Shape);
~~~~~
~~~~
*ok* is True if translation was correctly performed and False if there was at least one entity that was not translated.
~~~~~
~~~~{.cpp}
Standard_Boolean ok = writer.AddGeom (geom);
~~~~~
~~~~
where *geom* is *Handle(Geom_Curve)* or *Handle(Geom_Surface)*;
*ok* is True if the translation was correctly performed and False if there was at least one entity whose geometry was not among the allowed types.
@subsubsection occt_iges_3_3_4 Writing the IGES file
Write the IGES file with:
~~~~~
~~~~{.cpp}
Standard_Boolean ok = writer.Write ("filename.igs");
~~~~~
~~~~
to give the file name.
~~~~~
~~~~{.cpp}
Standard_Boolean ok = writer.Write (S);
~~~~~
~~~~
where *S* is *Standard_OStream*
*ok* is True if the operation was correctly performed and False if an error occurred (for instance, if the processor could not create the file).
@@ -823,7 +823,7 @@ The highlighted classes are intended to translate geometry.
@subsection occt_iges_3_7 Example
~~~~~{c++}
~~~~{.cpp}
#include <IGESControl_Controller.hxx>
#include <IGESControl_Writer.hxx>
#include <TopoDS_Shape.hxx>
@@ -839,7 +839,7 @@ Standard_Integer main()
Standard_Boolean OK = ICW.Write (;MyFile.igs;);
//writes a model to the file MyFile.igs
}
~~~~~
~~~~
@section occt_iges_4 Using XSTEPDRAW
@@ -852,7 +852,7 @@ In the description of commands, square brackets ([]) are used to indicate optio
A set of parameters for importing and exporting IGES files is defined in the XSTEP resource file. In XSTEPDRAW, these parameters can be viewed or changed using command
~~~~
~~~~{.php}
Draw> param [<parameter_name> [<value>]]
~~~~
@@ -883,15 +883,15 @@ These parameters are set by command *param* :
It is possible either only to load an IGES file into memory (i.e. to fill the model with data from the file), or to read it (i.e. to load and convert all entities to OCCT shapes).
Loading is done by the command
~~~~~
~~~~{.php}
Draw> xload <file_name>
~~~~~
~~~~
Once the file is loaded, it is possible to investigate the structure of the loaded data. To learn how to do it see @ref occt_iges_4_4 "Analyzing the transferred".
Reading of an IGES file is done by the command
~~~~~
~~~~{.php}
Draw> igesbrep <file_name> <result_shape_name> [<selection>]
~~~~~
~~~~
Here a dot can be used instead of a filename if the file is already loaded by *xload* or *igesbrep* command. In that case, only conversion of IGES entities to OCCT shapes will be done.
Command *igesbrep* will interactively ask the user to select a set of entities to be converted:
@@ -912,13 +912,13 @@ The second parameter of the *igesbrep* command defines the name of the loaded s
Instead of *igesbrep* it is possible to use commands:
~~~~~
~~~~{.php}
Draw> trimport <file_name> <result_shape_name> <selection>
~~~~~
~~~~
which outputs the result of translation of each selected entity into one shape, or
~~~~~
~~~~{.php}
Draw> trimpcomp <file_name> <result_shape_name> <selection>
~~~~~
~~~~
which outputs the result of translation of all selected entities into one shape (*TopoDS_Compound* for several entities).
An asterisk “*” can be specified instead of *selection*, it means *xst-transferrable-roots*.
@@ -940,9 +940,9 @@ The procedure of analysis of the data import can be divided into two stages:
@subsubsection occt_iges_4_4_1 Checking file contents
General statistics on the loaded data can be obtained by using command
~~~~~
~~~~{.php}
Draw> data <symbol>
~~~~~
~~~~
The information printed by this command depends on the symbol specified:
| Symbol | Output |
@@ -963,18 +963,18 @@ There is a set of special objects, which can be used to operate with the loaded
A list of these objects defined in the current session can be printed in DRAW by command
~~~~~
~~~~{.php}
Draw> listitems
~~~~~
~~~~
In the following commands if several <i>\<selection\></i> arguments are specified the results of each following selection are applied to the results of the previous one.
~~~~~
~~~~{.php}
Draw> givelist <selection_name> [<selection_name>]
~~~~~
~~~~
prints a list of loaded entities defined by selection argument.
~~~~~
~~~~{.php}
Draw> givecount <selection_name> [<selection_name>]
~~~~~
~~~~
prints a number of loaded entities defined by <i>selection</i> argument.
Three commands are used to calculate statistics on the entities in the model:
@@ -991,9 +991,9 @@ Optional <i>\<selection\></i> argument, if specified, defines a subset of entiti
| iges-levels | Calculates how much entities lie in different IGES levels |
The command:
~~~~~
~~~~{.php}
Draw> listtypes <selection_name> ...
~~~~~
~~~~
gives a list of entity types which were encountered in the last loaded file (with a number of IGES entities of each type). The list can be shown not for all entities but for a subset of them. This subset is defined by an optional selection argument.
Entities in the IGES file are numbered in the succeeding order. An entity can be identified either by its number (#) or by its label. Label is the letter D followed by the index of the first line with the data for this entity in the Directory Entry section of the IGES file. The label can be calculated on the basis of the number as D(2*# -1). For example, entity # 6 has label D11.
@@ -1006,9 +1006,9 @@ Entities in the IGES file are numbered in the succeeding order. An entity can b
@subsubsection occt_iges_4_4_2 Estimating the results of reading IGES
All of the following commands are available only after the data are converted into OCCT shapes (i.e. after command **igesbrep**).
~~~~~
~~~~{.php}
Draw> tpstat [*|?]<symbol> [<selection>]
~~~~~
~~~~
provides all statistics on the last transfer, including the list of transferred entities with mapping from IGES to OCCT types, as well as fail and warning messages. The parameter <i>\<symbol\></i> defines what information will be printed:
* G -- General statistics (list of results and messages)
* C -- Count of all warning and fail messages
@@ -1028,13 +1028,13 @@ Optional argument <i>\<selection\></i> can limit the action of the command with
To get help, run this command without arguments.
For example, to get translation ratio on IGES faces, you can use.
~~~~~
~~~~{.php}
Draw:> tpstat *l iges-faces
~~~~~
~~~~
The second version of the same command is TPSTAT (not capital spelling).
~~~~~
~~~~{.php}
Draw:> TPSTAT <symbol>
~~~~~
~~~~
Symbol can be of the following values:
* g -- General statistics (list of results and messages)
* c -- Count of all warning and fail messages
@@ -1045,37 +1045,37 @@ Symbol can be of the following values:
Sometimes the trimming contours of IGES faces (i.e., entity 141 for 143, 142 for 144) can be lost during translation due to fails.
The number of lost trims and the corresponding IGES entities can be obtained by the command:
~~~~~
~~~~{.php}
Draw> tplosttrim [<IGES_type>]
~~~~~
~~~~
It outputs the rank and DE numbers of faces that lost their trims and their numbers for each type (143, 144, 510) and their total number. If a face lost several of its trims it is output only once.
Optional parameter <i>\<IGES_type\></i> can be *TrimmedSurface, BoundedSurface* or *Face* to specify the only type of IGES faces.
For example, to get untrimmed 144 entities, use command
~~~~~
~~~~{.php}
Draw> tplosttrim TrimmedSurface
~~~~~
~~~~
To get the information on OCCT shape contents, use command
~~~~~
~~~~{.php}
Draw> statshape <shape_name>
~~~~~
~~~~
It outputs the number of each kind of shapes (vertex, edge, wire, etc.) in a shape and some geometrical data (number of C0 surfaces, curves, indirect surfaces, etc.).
Note. The number of faces is returned as a number of references. To obtain the number of single instances the standard command (from TTOPOLOGY executable) **nbshapes** can be used.
To analyze the internal validity of a shape, use command
~~~~~
~~~~{.php}
Draw> checkbrep <shape_name> <expurged_shape_name>
~~~~~
~~~~
It checks the geometry and topology of a shape for different cases of inconsistency, like self-intersecting wires or wrong orientation of trimming contours. If an error is found, it copies bad parts of the shape with the names "expurged_subshape_name _#" and generates an appropriate message. If possible, this command also tries to find IGES entities the OCCT shape was produced from.
<i>\<expurged_shape_name\></i> will contain the original shape without invalid subshapes.
To get information on tolerances of subshapes, use command
~~~~~
~~~~{.php}
Draw> tolerance <shape_name> [<min> [<max>] [<symbol>]]
~~~~~
~~~~
It outputs maximum, average and minimum values of tolerances for each kind of subshapes having tolerances or it can output tolerances of all subshapes of the whole shape.
When specifying *min* and *max* arguments this command outputs shapes with names <i>\<shape_name\>...</i> and their total number with tolerances in the range <i>[min, max]</i>.
@@ -1099,19 +1099,19 @@ Refer to @ref occt_iges_3_3_2 "Setting the translation parameters" for a descrip
| Measurement units | XSTEP.iges.unit | 1-11 (or a string value) |
Several shapes can be written in one file. To start writing a new file, enter command
~~~~~
~~~~{.php}
Draw> newmodel
~~~~~
~~~~
This command clears the *InterfaceModel* to make it empty.
~~~~~
~~~~{.php}
Draw> brepiges <shape_name_1> [<filename.igs>]
~~~~~
~~~~
Converts the specified shapes into IGES entities and puts them into the *InterfaceModel*.
~~~~~
~~~~{.php}
Draw> writeall <filename.igs>
~~~~~
~~~~
Allows writing the prepared model to a file with name *filename.igs*.
@section occt_iges_5 Reading from and writing to IGES
@@ -1121,10 +1121,10 @@ Allows writing the prepared model to a file with name *filename.igs*.
### Load an IGES file
Before performing any other operation, you must load an IGES file with:
~~~~~
~~~~{.cpp}
IGESCAFControl_Reader reader(XSDRAW::Session(), Standard_False);
IFSelect_ReturnStatus stat = reader.ReadFile(“filename.igs”);
~~~~~
~~~~
Loading the file only memorizes, but does not translate the data.
### Check the loaded IGES file
@@ -1137,64 +1137,64 @@ See the description of @ref occt_iges_2_3_3 "Setting translation parameters" abo
In addition, the following parameters can be set for XDE translation of attributes:
* For transferring colors:
~~~~~
~~~~{.cpp}
reader.SetColorMode(mode);
// mode can be Standard_True or Standard_False
~~~~~
~~~~
* For transferring names:
~~~~~
~~~~{.cpp}
reader.SetNameMode(mode);
// mode can be Standard_True or Standard_False
~~~~~
~~~~
### Translate an IGES file to XDE
The following function performs a translation of the whole document:
~~~~~
~~~~{.cpp}
Standard_Boolean ok = reader.Transfer(doc);
~~~~~
~~~~
where *doc* is a variable which contains a handle to the output document and should have a type *Handle(TDocStd_Document)*.
@subsection occt_iges_5_2 Writing to IGES
The translation from XDE to IGES can be initialized as follows:
~~~~~
~~~~{.cpp}
IGESCAFControl_Writer aWriter(XSDRAW::Session(),Standard_False);
~~~~~
~~~~
### Set parameters for translation from XDE to IGES
The following parameters can be set for translation of attributes to IGES:
* For transferring colors:
~~~~~
~~~~{.cpp}
aWriter.SetColorMode(mode);
// mode can be Standard_True or Standard_False
~~~~~
~~~~
* For transferring names:
~~~~~
~~~~{.cpp}
aWriter.SetNameMode(mode);
// mode can be Standard_True or Standard_False
~~~~~
~~~~
### Translate an XDE document to IGES
You can perform the translation of a document by calling the function:
~~~~~
~~~~{.cpp}
IFSelect_ReturnStatus aRetSt = aWriter.Transfer(doc);
~~~~~
~~~~
where "doc" is a variable which contains a handle to the input document for transferring and should have a type *Handle(TDocStd_Document)*.
### Write an IGES file
Write an IGES file with:
~~~~~
~~~~{.cpp}
IFSelect_ReturnStatus statw = aWriter.WriteFile("filename.igs");
~~~~~
~~~~
or
~~~~~
~~~~{.cpp}
IFSelect_ReturnStatus statw = writer.WriteFile (S);
~~~~~
~~~~
where S is OStream.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -1,284 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="165.36443mm"
height="99.48317mm"
viewBox="0 0 165.36443 99.48317"
version="1.1"
id="svg1643"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="dfbrowser_elements.svg">
<defs
id="defs1637" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="290.24314"
inkscape:cy="320.3071"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:showpageshadow="false"
inkscape:window-width="1246"
inkscape:window-height="857"
inkscape:window-x="371"
inkscape:window-y="37"
inkscape:window-maximized="0" />
<metadata
id="metadata1640">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(356.33698,30.17611)">
<rect
style="opacity:1;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#78943d;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4147"
width="164.83542"
height="98.95417"
x="-356.07248"
y="-29.91161"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#9bbb59;fill-opacity:1;fill-rule:evenodd;stroke:#78943d;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4157"
width="155.951"
height="20.214758"
x="-352.0733"
y="-25.674246"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#9bbb59;fill-opacity:1;fill-rule:evenodd;stroke:#78943d;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4159"
width="75.795822"
height="64.91011"
x="-352.07172"
y="-0.79434544"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#9bbb59;fill-opacity:1;fill-rule:evenodd;stroke:#78943d;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4161-4"
width="75.811562"
height="30.252827"
x="-272.04941"
y="33.729694"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#9bbb59;fill-opacity:1;fill-rule:evenodd;stroke:#78943d;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4161-4-8"
width="75.811562"
height="30.252827"
x="-272.04941"
y="-0.80220562"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.56444448;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195"
width="73.552574"
height="11.118413"
x="-347.50781"
y="-21.126072"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.36620289;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195-1"
width="30.417513"
height="11.316654"
x="-267.92496"
y="-21.225193"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.36620289;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195-1-5"
width="30.417513"
height="11.316654"
x="-231.57631"
y="-21.225193"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-259.7175"
y="-14.48304"
id="text5675"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5677"
x="-259.7175"
y="-14.48304"
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Update</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-223.04579"
y="-14.12208"
id="text5679"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5681"
x="-223.04579"
y="-14.12208"
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Search</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-325.95343"
y="-14.547463"
id="text5683"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5685"
x="-325.95343"
y="-14.547463"
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Tree Navigation</tspan></text>
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.56444448;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195-8"
width="65.570122"
height="19.385952"
x="-347.50781"
y="11.248657"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666654px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222221px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-333.31332"
y="22.090868"
id="text5683-5"
transform="scale(0.98830373,1.0118347)"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5685-3"
x="-333.31332"
y="22.090868"
style="font-size:3.83516741px;line-height:1.25;stroke-width:0.28222221px">OCAF tree view</tspan></text>
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.56444448;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195-8-0"
width="65.570122"
height="19.385952"
x="-267.68332"
y="3.9789243"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.56444448;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195-8-3-5"
width="38.7719"
height="16.820164"
x="-267.11316"
y="37.191612"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#9bbb59;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
id="rect4195-8-3"
width="38.7719"
height="16.820164"
x="-240.60002"
y="42.180641"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666654px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222221px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-252.8326"
y="13.779153"
id="text5683-5-9"
transform="scale(0.98830373,1.0118347)"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5685-3-8"
x="-252.8326"
y="13.779153"
style="font-size:3.83516741px;line-height:1.25;stroke-width:0.28222221px">Property Panel</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666654px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222221px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-231.82542"
y="51.393177"
id="text5683-5-0"
transform="scale(0.98830373,1.0118347)"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5685-3-5"
x="-231.82542"
y="51.393177"
style="font-size:3.83516741px;line-height:1.25;stroke-width:0.28222221px">3D View</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:3.38666654px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222221px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-267.25568"
y="46.086102"
id="text5683-5-1"
transform="scale(0.98830373,1.0118347)"
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\dfbrowser.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan5685-3-80"
x="-267.25568"
y="46.086102"
style="font-size:3.83516741px;line-height:1.25;stroke-width:0.28222221px">Dump View</tspan></text>
</g>
</svg>
<svg width="609" height="426" xmlns="http://www.w3.org/2000/svg">
<g id="Layer_1">
<title>Layer 1</title>
<rect stroke="#58a50b" id="svg_1" height="424.00001" width="605" y="-0.00001" x="0.5" stroke-width="4" fill="#ffffff"/>
<rect id="svg_2" height="89" width="575" y="16" x="13.5" stroke-width="4" stroke="#58a50b" fill="#66af1c"/>
<rect stroke="#58a50b" id="svg_3" height="280" width="277.99999" y="121" x="16.5" stroke-width="4" fill="#66af1c"/>
<rect stroke="#58a50b" id="svg_4" height="122" width="277.99999" y="120" x="309.5" stroke-width="4" fill="#66af1c"/>
<rect stroke="#58a50b" id="svg_5" height="140" width="277.99999" y="256" x="310.5" stroke-width="4" fill="#66af1c"/>
<rect id="svg_6" height="64" width="219" y="184" x="47.5" stroke-width="4" stroke="#58a50b" fill="#ffffff"/>
<rect id="svg_7" height="40" width="277" y="36" x="30.5" stroke-width="4" stroke="#58a50b" fill="#ffffff"/>
<rect stroke="#58a50b" id="svg_8" height="40" width="112" y="36" x="321.5" stroke-width="4" fill="#ffffff"/>
<rect stroke="#58a50b" id="svg_10" height="40" width="119" y="36" x="446.5" stroke-width="4" fill="#ffffff"/>
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_11" y="61" x="98.5" stroke-width="0" stroke="#58a50b" fill="#000000">Tree Navigation</text>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_12" y="63" x="338.5" stroke-width="0" stroke="#58a50b" fill="#000000">Update</text>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_13" y="65" x="474.5" stroke-width="0" stroke="#58a50b" fill="#ffffff">Search</text>
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_14" y="62" x="475.5" stroke-width="0" stroke="#58a50b" fill="#000000">Search</text>
<rect stroke="#58a50b" id="svg_20" height="54" width="136.99999" y="291" x="318.5" stroke-width="4" fill="#ffffff"/>
<rect stroke="#58a50b" id="svg_21" height="52" width="188" y="180" x="391.5" stroke-width="4" fill="#ffffff"/>
<rect stroke="#58a50b" id="svg_22" height="54" width="163" y="136" x="323.5" stroke-width="4" fill="#ffffff"/>
<rect stroke="#58a50b" id="svg_23" height="53" width="146" y="317" x="426.5" stroke-width="4" fill="#ffffff"/>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_27" y="170" x="338.5" stroke-width="0" stroke="#58a50b" fill="#000000">Property panel</text>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_28" y="227" x="83.5" stroke-width="0" stroke="#58a50b" fill="#000000">OCAF tree view</text>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="21" id="svg_30" y="322" x="322.5" stroke-width="0" stroke="#58a50b" fill="#000000">Dump View</text>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_31" y="352" x="459.5" stroke-width="0" stroke="#58a50b" fill="#000000">3D View</text>
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="18" id="svg_32" y="214" x="398.5" stroke-width="0" stroke="#58a50b" fill="#000000">Property panel (custom)</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,21 @@
<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg">
<g id="Layer_1">
<title>Layer 1</title>
<rect stroke="#ff56ff" id="svg_1" height="296.99999" width="297.00002" y="1.6" x="1" stroke-width="4" fill="#ffffff"/>
<rect id="svg_3" height="120" width="136" y="22.6" x="153" stroke-width="4" stroke="#ff56ff" fill="#ff56ff"/>
<rect stroke="#ff56ff" id="svg_4" height="259.99999" width="126.99999" y="18.6" x="16" stroke-width="4" fill="#ff56ff"/>
<rect stroke="#ff56ff" id="svg_5" height="122" width="131" y="155.6" x="156" stroke-width="4" fill="#ff56ff"/>
<rect stroke="#ff56ff" id="svg_6" height="41.00001" width="125" y="87.6" x="17" stroke-width="4" fill="#ffffff"/>
<rect id="svg_7" height="3" width="2" y="364.6" x="89" stroke-width="4" stroke="#ff56ff" fill="#ffffff"/>
<rect stroke="#ffffff" id="svg_8" height="41.00001" width="117" y="126.6" x="21" stroke-width="4" fill="#ffffff"/>
<rect stroke="#ff56ff" id="svg_9" height="41.00001" width="125" y="63.6" x="164" stroke-width="4" fill="#ffffff"/>
<rect stroke="#ff56ff" id="svg_10" height="64.00001" width="114.00001" y="158.6" x="159" stroke-width="4" fill="#ffffff"/>
<rect stroke="#ff56ff" id="svg_11" height="41.00001" width="101.00001" y="215.6" x="184" stroke-width="4" fill="#ffffff"/>
<text transform="matrix(0.742836 0 0 0.850555 6.17194 14.6433)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_13" y="119.6" x="24" stroke-width="0" fill="#000000">Message report</text>
<text style="cursor: move;" transform="matrix(0.742836 0 0 0.850555 6.17194 46.6433)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_14" y="118.4243" x="24" stroke-width="0" fill="#000000">tree view</text>
<text style="cursor: move;" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_15" y="90.6" x="167" stroke-width="0" stroke="#ff56ff" fill="#000000">Dump panel</text>
<text xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_16" y="245.6" x="190" stroke-width="0" stroke="#ff56ff" fill="#000000">3D View</text>
<text transform="matrix(0.784367 0 0 0.769922 36.8545 36.9383)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_17" y="181.6" x="157" stroke-width="0" fill="#000000">Property panel</text>
<text transform="matrix(0.884685 0 0 0.774516 20.9874 38.7657)" stroke="#ff56ff" xml:space="preserve" text-anchor="start" font-family="Noto Sans JP" font-size="24" id="svg_18" y="206.5113" x="176.34827" stroke-width="0" fill="#000000">(custom)</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

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