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

Compare commits

...

99 Commits

Author SHA1 Message Date
smoskvin
b079fb9877 Update version up to 7.6.3 2022-07-22 11:53:38 +03:00
kgv
608fba03ab 0033074: Visualization, TKOpenGl - PBR shader compilation error on Mesa OpenGL 3.10033074
Graphic3d_ShaderManager::getPBREnvBakingProgram() - fix setting Graphic3d_ShaderProgram::SetPBR()
before defining GLSL version via defaultGlslVersion() that relies on this property.
2022-07-22 11:53:38 +03:00
ifv
a626c346b4 0032882: Modeling Data - Extrema curve/curve cannot find all solutions (OCCT 7.6 backport)
Extrema/Extrema_GenExtCC.gxx - estimation of Lipchitz constant is improved
Extrema_GlobOptFuncCC.cxx - function value is changed

LocOpe/LocOpe_WiresOnShape.cxx - small correction to fix regression

lowalgos/extcc/bug32882 - new test case is added

some test were updated according new behavior of extrema algo
2022-07-22 11:53:38 +03:00
asuraven
1955914e73 0032744: Modeling Algorithms - Endless loop in GCPnts_UniformDeflection
fixed finish criteria in CPnts_UniformDeflection::Perform()
2022-07-20 15:53:27 +03:00
isn
a3e117be2c 0029406: Foundation Classes - gp_Ax3 fails setting direction
Avoid exception in gp_Ax3::SetDirection(), SetAxis(): check if XDir of Ax3 is parallel to newly given direction.
2022-07-20 15:53:27 +03:00
snn
459e7b77ab 0032914: Data Exchange - Some parts of compound are lost while writing STEP in nonmanifold mode
Code related to supporting of single SDR for a non-manifold group, which prevents writing all translation results except the first one, is removed.
SDRs with null used representation object are excluded from writing.
2022-07-20 15:53:27 +03:00
ifv
2fc4884b88 0031661: Modeling Data - Exception when projecting parabola or hyperbola to plane
ProjLib/ProjLib_ProjectOnPlane.cxx - formatting

0031661: Modeling Data - Algorithm crashes when projecting parabola or hyperbola to plane

ProjLib/ProjLib_ProjectOnPlane.cxx - building of analytical parabola and hyperbola is added
bugs/moddata_3/bug31661_* - new test cases are added
2022-07-20 15:53:27 +03:00
msv
1f02c1903a 0032679: Data Exchange - STEP writer loses assembly instance name
In STEPCAFControl_Writer::WriteNames, write the names of components
even if the name of the assembly is absent.

In STEPControl_ActorWrite::TransferSubShape, move assembly structure
information to the beginning of the list of results, so that CDSR
information of this assembly became preceding CDSR of any sub shapes.
2022-07-20 15:53:26 +03:00
oan
6ecfaf3ab6 0032692: Mesh - In BRepMesh_ModelPreProcessor avoid crashes with problematic topology
Improved the processing for the case where Failure flag for the meshing face is set. Specific tests added.
Check triangulation consistency even for shapes with problematic topology given that they are suitable for keeping it.
2022-07-20 15:53:26 +03:00
jgv
89ecea11d2 0032864: Modeling Algorithms - Normal projection of a wire on a cylinder produces wrong result
Minor correction in method BRepAlgo_NormalProjection::Build: correct mixed up first and last parameters of the projected curve.
2022-07-20 15:53:26 +03:00
azv
c4e1d8c918 0032915: Geom2dAPI_InterCurveCurve, The algorithm lost an intersection point.
Get rid of strange code: preliminary check of self-intersections is made on a polygonal representation of a curve, it is able to find possible intersections, but after that it filter out segments neighbor to the pair of non-intersected segments.

Test case de step_4 I1 has been marked BAD, because the self-intersection is treated correctly, but the projection algorithm generates such crooked 2D curve.

Reference data in test cases heal split_angle_advanced ZA5 and ZA6 has been updated, because those shapes have self-intersected edges, which are being detected now.
2022-07-20 12:30:42 +03:00
Charlemagne Lasse
b776f4ee07 0032929: Modeling Algorithms - Crash in PerformIntersectionAtEnd after deletion of surfdata
When creating a fillet, num is calculated via ChFi3d_IndexOfSurfData. If it
returns just the number of entries in surfdata, it can happen that this
value becomes invalid when handling the case "two faces common to the edge
are found". When both components are on an arc, there will be num removed
from the surfdata.

num would then be larger than the number of entries surfdata. The derived
num1 is therefore also incorrect. The subsequent usage of this
value will either:

* Debug build: cause an out of bounds exception in ChangeValue
  (`SeqFil.ChangeValue(num)`)
* Release build: cause a segfault when retrieving it via index num1
  (`SeqFil(num1)`)

num + num1 must be recalculated after the deletion happens to correctly
calculate the fillet.

Signed-off-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
2022-07-20 12:30:00 +03:00
Charlemagne Lasse
90e61140aa 0032930: Modeling Algorithms - Crash in PerformIntersectionAtEnd when no face was found
The PerformIntersectionAtEnd code is currently not handling all the faces
correctly. If it retrieves Face[0] as F, it can happen that the previously
ran code didn't actually retrieve any faces in this array at all.

For example when:

* "if (nface==3)" is true
  - "if (!findonf1)" is true (doesn't assign any faces to this array)
  - "if (!findonf2)" is true (doesn't assign any faces to this array)
  - "if (state == ChFiDS_OnSame)" is not true (because it is
    ChFiDS_AllSame)
  - "if (findonf1 && !isOnSame1)" cannot be true (see above, but would
    handle faces)
  - "if (findonf2 && !isOnSame2)" cannot be true (see above, but would
    handle faces)
  - "if (isOnSame2)" is false (but would also handle faces)

Since no faces were assigned here, F would be a NULL face. As result, the
function will crash when trying to access the Surface behind the face via
`BRep_Tool::Surface(F);`.

While the best approach would be to identify the implementation bug in the
algorithm behind PerformIntersectionAtEnd, a check + exception is used
instead because the actual algorithm is not known.

Signed-off-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
2022-07-20 12:29:07 +03:00
Charlemagne Lasse
19a49b8e74 0032931: Modeling Algorithms - Crash in ChFi3d_IsInFront when no face was found
The ChFi3d_IsInFront code is currently not handling all the combinations
correctly. For example, if `if(fd1->IndexOfS2() == fd2->IndexOfS2())` is
true, it can happen that the `TopoDS::Face(DStr.Shape(fd1->Index(jf1)))`
returns a Face with entity == NULL. The subsequent usage of this NULL face
in `BRep_Tool::Parameters( Vtx, face )` will then cause a segfault.

While the best approach would be to identify the implementation bug in the
algorithm behind PChFi3d_IsInFron, a check + exception is used instead
because the actual algorithm is not known.

Signed-off-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
2022-07-20 12:26:58 +03:00
azv
fd29020f87 0033028: Standard_ConstructionError while using ShapeUpgrade_UnifySameDomain
Additional check if the sequence of circular edges is a closed chain.
2022-07-20 12:24:17 +03:00
oan
c4ca00a26f 0033060: [Regression to 7.4.0] Mesh - Sub-precisional links provoke failure on face
Slightly increase exact resolution so to cover links with approximate length equal to resolution itself on sub-resolution differences.
2022-07-20 12:22:51 +03:00
kgv
507ead3c5a 0032991: Visualization, TKOpenGl - OpenGl_Window::Resize() ignores window virtual flag on macOS
Added handling of Aspect_Window::IsVirtual() flag on macOS platform (7.6.x backport).
2022-06-13 10:13:53 +03:00
kgv
77003e1894 0032990: Configuration - compilation errors since Emscripten 3.1.11 due to time_t redefined long->int
Add std::is_same filter to IsEqual(time_t, time_t) definition.
2022-05-30 13:44:29 +03:00
ifv
4931fcd8a9 0032973: Modeling Algorithms - Regression in BRepExtrema_DistShapeShape compared with 7.5
BRepExtrema/BRepExtrema_ExtCF.cxx - set correct using BRepAdaptor_Curve in Extrema
tests/bugs/modalg_8/bug32973 - new test case added
2022-05-22 15:04:17 +03:00
kgv
1c96596ae7 Update version up to 7.6.3dev 2022-04-29 11:24:40 +03:00
jgv
bb368e271e 0032721: Modeling Algorithms - BOP wrong results on a cone and an extrusion
1. Modify method IntPatch_ALineToWLine::MakeWLine: add correction of end points of each line on 2 surfaces if an end point is a pole on a surface.
2. Modify method IntPatch_WLine::ComputeVertexParameters: adjust a point on curve to corresponding vertex the following way: set 3D point as the point of the vertex and 2D points as the points of the point on curve.
2022-04-26 12:59:16 +03:00
ifv
04ecb233f2 0032701: Modeling Algorithms - 2d curve has bending near the degenerated edge of the face
ApproxInt_Approx, ApproxInt_KnotTools, BRepApprox_Approx,
GeomInt_IntSS, IntTools_FaceFace:
  Analysis of curvature is added for adjusting ParametrizationType

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

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

Approx_SameParameter.cxx - adding control against big values.

BOPAlgo_PaveFiller_6.cxx - adjusting position of faces before intersection
2022-04-26 12:50:31 +03:00
smoskvin
dbfb0666b2 Update version up to 7.6.2 2022-04-23 16:04:01 +03:00
mpv
c74b60ab81 0032870: Tests - bugs/caf/bug31918_1 is unstable
# Make the compared values more stable.
2022-04-22 17:45:08 +03:00
mpv
3d41db2138 0032870: Tests - bugs/caf/bug31918_1 is unstable
Improved the test stability: created 10 iterations of measurements and take the minimum to
minimize the affect of other processes and threads; increased the compare range of
the quarter and the whole of the document load.
2022-04-22 17:44:42 +03:00
jgv
43764346a1 0032814: Modeling algorithms - Unifysamedom produces invalid result
Minor correction in ShapeUpgrade_UnifySameDomain::IntUnifyFaces: correct collecting splitting vertices in the new wire
2022-04-22 11:21:54 +03:00
vro
3c61e8f7e0 0032796: Modeling Data - Calculation of distance between two circles crashes
Modified:
- Extrema_ExtCC.cxx, the method PrepareParallelResult() - angular tolerance is increased.

Added:
- A test: lowalgos extcc bug32796
2022-04-22 11:21:30 +03:00
Chris Hennes
da9cb57f57 0031585: Access Violation while creating fillet - ChiFi3d_Builder::PerformIntersectionAtEnd
There is one case in PerformIntersectionAtEnd that did not test whether
an array access exceeded the length of the array, in rare cases
resulting in a segmentation fault. That error-handling behavior is
replaced by the exception code used elsewhere in the function. For
consistency, the code is copied exactly as implemented elsewhere. This
code has the same effect as that proposed by the bug submitter.
2022-04-22 11:20:39 +03:00
knosulko
60490a5c19 0032767: Mesh - incorrect splitting of edges of seams leading to hang [since OCCT 7.4.0]
- fix step by parameter of the edge while split curve in case of seam edges
2022-04-22 11:18:39 +03:00
aml
2b5fcf89b2 0032810: Coding - missing Standard_EXPORT in Standard_ErrorHandler 2022-04-22 11:18:34 +03:00
azv
99ee8eb9d3 0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0
Use precision depending on radii of participating circles.
2022-04-12 10:08:06 +03:00
azv
b9a5469aa1 0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0
Improve tolerance criteria to check values of extremas for equality: use multiplier, which depends on the value, instead of magic number
2022-04-07 08:10:54 +03:00
kgv
c004c09c9e 0032912: Visualization - crash when displaying an OBJ file with missing texture file
Fix NULL dereference within Graphic3d_TextureRoot::convertToCompatible() due to wrong order of checks.
2022-04-07 08:06:59 +03:00
azv
f15afeb84b 0032066: Modeling Algorithms - Incorrect result of Boolean CUT operation
Do not limit the normalization factor of the highly anisotropic parametric space when filtering start points in the algorithm of walking line construction.
Additionally check the knots are in the increasing orders when merging two B-spline curves
2022-03-20 22:18:11 +03:00
jgv
488b78ed3c 0032719: Modelling Algorithms - UnifySameDomain result has incorrect triangulation
Correct method ShapeUpgrade_UnifySameDomain::UnionPCurves: reparametrize unified pcurves to fit the new range of 3D-curve.
2022-03-20 22:17:38 +03:00
jgv
6faa1bd160 0032715: Modelling Algorithms - UnifySameDomain does incomplete union
Add the case of closed, smooth but not periodic surface (unification of faces lying on it if the flag "myConcatBSplines" is true - modify the underlying surface to make it periodic).
2022-02-18 19:54:05 +03:00
vro
00be1552ed 0032840: Application Framework, copying of a scaled shape fails
A flag not to raise an exception is set for a copying shape. A reason: if a shape is already in the model, the user should have an opportunity to copy it.

Modified files:
TNaming_CopyShape.cxx, the method Translate(). A false-flag is used on copying of location of the shape.
2022-02-18 19:53:17 +03:00
kgv
a2bacd54f4 Update version up to 7.6.2dev 2022-02-07 12:03:52 +03:00
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
1690 changed files with 11786 additions and 7689 deletions

View File

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

View File

@@ -63,30 +63,45 @@ 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
@@ -175,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 {}
@@ -251,16 +276,18 @@ proc wokdep:gui:UpdateList {} {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
.myFrame.myIncErrLbl configure -text [join $anIncErrs "\n"]
.myFrame.myLib32_ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64_ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32_ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64_ErrLbl configure -text [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
.myFrame.myLib32D_ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64D_ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32D_ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64D_ErrLbl configure -text [join $anBin64Errs "\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]

View File

@@ -236,9 +236,11 @@ proc gendoc {args} {
return -1
}
} elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] == -1 } {
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"

View File

@@ -260,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
@@ -324,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
@@ -560,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" {
@@ -1014,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"
@@ -1290,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"

View File

@@ -38,6 +38,7 @@ 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"
@@ -59,9 +60,14 @@ 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=-debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
@@ -159,6 +165,7 @@ if ["%toCMake%"] == ["1"] (
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-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" ^
@@ -256,6 +263,7 @@ 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" ^

View File

@@ -24,5 +24,6 @@ rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "USE_RAPIDJSON=OFF"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set "USE_PTHREADS=ON"

View File

@@ -21,6 +21,8 @@ set "toInstall=1"
set "toDebug=0"
set "sourceMapBase="
set "USE_PTHREADS=OFF"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
@@ -30,9 +32,14 @@ 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=-debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
@@ -64,6 +71,7 @@ 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" ^

View File

@@ -121,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" (
@@ -137,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
)
@@ -167,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

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

@@ -3,29 +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
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.
@@ -36,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 |
|-----------|-----------------------|----------------------------------|----------------------|
@@ -315,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)
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.
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.
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.:
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~
export HAVE_FREEIMAGE=false
./draw.sh cbp [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
Alternatively, or when *custom.sh* does not exist, you can launch *genconf.sh* to configure environment interactively:
@subsubsection build_occt_macos_xcode XCode
@figure{/build/build_occt/images/genconf_osx.png}
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.
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_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.
<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

@@ -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

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.

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

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:
@@ -145,16 +145,16 @@ However, the *TopoDS* package provides only the data structure of the topologica
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);
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);
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:
@@ -165,7 +165,7 @@ 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);
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3);
~~~~
@@ -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,7 +260,7 @@ 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.
@@ -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:
@@ -353,7 +353,7 @@ 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:
@@ -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:
@@ -438,7 +438,6 @@ To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, w
~~~~{.cpp}
if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
//
}
~~~~
@@ -478,9 +477,9 @@ The collection for shapes can be found in the *TopTools* package. As *BRepOffset
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();
BRepOffsetAPI_MakeThickSolid aSolidMaker;
aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = aSolidMaker.Shape();
~~~~
@@ -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.
@@ -604,7 +603,7 @@ As the parametric equation of an ellipse is P(U) = O + (MajorRadius * cos(U) * X
~~~~
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}
gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
@@ -698,7 +697,7 @@ You are almost done building the bottle. Use the *TopoDS_Compound* and *BRep_Bui
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.
@@ -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);

View File

@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 KiB

View File

@@ -1,8 +1,9 @@
OCCT CSharp sample {#samples_csharp_occt}
.NET: Import/Export (C#|C++/CLI|WinForms|WPF) {#samples_csharp_occt}
==================
This sample demonstrates how to use OCCT libraries in <b>.Net</b> application
written using **CSharp** and **Windows Forms** or **Windows Presentation Foundation** (WPF).
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
The connection between .Net and OCCT (C++) level is provided by proxy library
**OCCProxy**, written in C++/CLI. The proxy library contains a single *ref* class
@@ -14,6 +15,8 @@ Both applications provide the same functionality as the standard OCCT Import/Exp
The first project is called *IE_WinForms* and uses Windows Forms for GUI.
The second application is called *IE_WPF_WinForms* and uses Windows Presentation Foundation.
@figure{samples_c__ie.png}
Note a few important details:
- OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class;

View File

@@ -1,8 +1,9 @@
Direct3D CSharp sample {#samples_csharp_direct3d}
==================
.NET: D3D/OpenGL Viewer (C#|C++/CLI|WPF) {#samples_csharp_direct3d}
==================
This sample demonstrates how to use OCCT and DirectX libraries in <b>.Net</b> application
written using **CSharp** and **Windows Presentation Foundation** (WPF).
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraries,
**OCCProxy** and **D3DProxy**, written in C++/CLI. The proxy library **OCCProxy** contains a single

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -311,7 +311,7 @@ void OcafSamples::ModifyBoxOcafSample()
Handle(TFunction_Function) aFunction;
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
{
myResult << "Object cannot be modify.";
myResult << "Object cannot be modified.";
return;
}
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute
@@ -413,7 +413,7 @@ void OcafSamples::ModifyCylinderOcafSample()
Handle(TFunction_Function) aFunction;
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
{
myResult << "Object cannot be modify.";
myResult << "Object cannot be modified.";
return;
}
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute

View File

@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.2)
project(glfw-occt-demo)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/adm/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
@@ -24,15 +26,14 @@ source_group ("Sources" FILES
find_package(OpenGL REQUIRED)
# Open CASCADE Technology
find_package(OpenCASCADE REQUIRED NO_DEFAULT_PATH)
if (OpenCASCADE_FOUND)
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR})
LINK_DIRECTORIES(${OpenCASCADE_LIBRARY_DIR})
find_package (OpenCASCADE REQUIRED)
if (NOT OpenCASCADE_FOUND)
message (FATAL_ERROR "coult not find OpenCASCADE, please set OpenCASCADE_DIR variable" )
else()
message (WARNING "Could not find OpenCASCADE, please set OpenCASCADE_DIR variable." )
set (OCCT_LIBRARY_DIR)
set (OCCT_BIN_DIR)
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_INSTALL_PREFIX}\"" )
message (STATUS "OpenCASCADE_INCLUDE_DIR=${OpenCASCADE_INCLUDE_DIR}")
message (STATUS "OpenCASCADE_LIBRARY_DIR=${OpenCASCADE_LIBRARY_DIR}")
INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR})
endif()
SET(OpenCASCADE_LIBS

View File

@@ -55,7 +55,7 @@ GlfwOcctWindow::GlfwOcctWindow (int theWidth, int theHeight, const TCollection_A
myYBottom = myYTop + aHeight;
#if !defined(_WIN32) && !defined(__APPLE__)
myDisplay = new Aspect_DisplayConnection (glfwGetX11Display());
myDisplay = new Aspect_DisplayConnection ((Aspect_XDisplay* )glfwGetX11Display());
#endif
}
}

View File

@@ -0,0 +1,157 @@
# This script finds OpenCASCADE Technology libraries.
# The script requires:
# OpenCASCADE_DIR - root OCCT folder or folder with CMake configuration files
#
# Script will define the following variables on success:
# OpenCASCADE_FOUND - package is successfully found
# OpenCASCADE_INCLUDE_DIR - directory with headers
# OpenCASCADE_LIBRARY_DIR - directory with libraries for linker
# OpenCASCADE_BINARY_DIR - directory with DLLs
include(FindPackageHandleStandardArgs)
# MY_PLATFORM variable
math (EXPR MY_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
if (WIN32)
set (MY_PLATFORM "win${MY_BITNESS}")
elseif(APPLE)
set (MY_PLATFORM "mac")
else()
set (MY_PLATFORM "lin")
endif()
# MY_PLATFORM_AND_COMPILER variable
if (MSVC)
if (MSVC90)
set (MY_COMPILER vc9)
elseif (MSVC10)
set (MY_COMPILER vc10)
elseif (MSVC11)
set (MY_COMPILER vc11)
elseif (MSVC12)
set (MY_COMPILER vc12)
elseif (MSVC14)
set (MY_COMPILER vc14)
else()
set (MY_COMPILER vc15)
message (WARNING "Unknown msvc version. $$MY_COMPILER is used")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
set (MY_COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (MY_COMPILER gcc)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (MY_COMPILER clang)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (MY_COMPILER icc)
else()
set (MY_COMPILER ${CMAKE_GENERATOR})
string (REGEX REPLACE " " "" COMPILER ${MY_COMPILER})
endif()
set (MY_PLATFORM_AND_COMPILER "${MY_PLATFORM}/${MY_COMPILER}")
set (OpenCASCADE_DIR "" CACHE PATH "Path to Open CASCADE libraries.")
# default paths
set (OpenCASCADE_INCLUDE_DIR "${OpenCASCADE_DIR}/inc")
set (OpenCASCADE_LIBRARY_DIR "${OpenCASCADE_DIR}/${MY_PLATFORM_AND_COMPILER}/lib")
set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_DIR}/${MY_PLATFORM_AND_COMPILER}/bin")
# complete list of OCCT Toolkits (copy-paste from adm/UDLIST, since installed OCCT does not include UDLIST)
set (OpenCASCADE_TKLIST "")
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKernel TKMath) # FoundationClasses
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKG2d TKG3d TKGeomBase TKBRep) # ModelingData
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing) # ModelingAlgorithms
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost) # Visualization
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF) # ApplicationFramework
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh) # DataExchange
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKDraw TKViewerTest) # Draw
# validate location of OCCT libraries and headers
set (OpenCASCADE_INCLUDE_DIR_FOUND)
set (OpenCASCADE_LIBRARY_DIR_FOUND)
set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND)
set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND)
set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND)
if (EXISTS "${OpenCASCADE_INCLUDE_DIR}/Standard.hxx")
set (OpenCASCADE_INCLUDE_DIR_FOUND ON)
endif()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DIR_FOUND ON)
elseif (NOT WIN32 AND EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DIR_FOUND ON)
set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND ON)
elseif (NOT WIN32 AND EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND ON)
set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
elseif (OpenCASCADE_LIBRARY_DIR_FOUND)
message (STATUS "Only release OpenCASCADE libraries have been found")
endif()
if (NOT OpenCASCADE_LIBRARY_DIR_FOUND AND OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND)
set (OpenCASCADE_LIBRARY_DIR_FOUND ON)
message (WARNING "Only debug OpenCASCADE libraries have been found")
endif()
if (WIN32)
if (EXISTS "${OpenCASCADE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND ON)
endif()
if (EXISTS "${OpenCASCADE_BINARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND ON)
endif()
else()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND ON)
endif()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND ON)
endif()
endif()
if (OpenCASCADE_INCLUDE_DIR_FOUND AND OpenCASCADE_LIBRARY_DIR_FOUND)
set (OpenCASCADE_FOUND ON)
set (OpenCASCADE_INSTALL_PREFIX ${OpenCASCADE_DIR})
# Define OCCT toolkits so that CMake can put absolute paths to linker;
# the library existance is not checked here, since modules can be disabled.
foreach (aLibIter ${OpenCASCADE_TKLIST})
add_library (${aLibIter} SHARED IMPORTED)
set_property (TARGET ${aLibIter} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${OpenCASCADE_IMPLIB_SUFFIX}")
if (OpenCASCADE_SHAREDLIB_RELEASE_FOUND)
if (WIN32)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
endif()
if (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND)
set_property (TARGET ${aLibIter} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${OpenCASCADE_IMPLIB_SUFFIX}")
if (OpenCASCADE_SHAREDLIB_DEBUG_FOUND)
if (WIN32)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
endif()
endif()
endforeach()
else()
# fallback searching for CMake configs
if (NOT "${OpenCASCADE_DIR}" STREQUAL "")
set (anOcctDirBak "${OpenCASCADE_DIR}")
find_package (OpenCASCADE CONFIG QUIET PATHS "${OpenCASCADE_DIR}" NO_DEFAULT_PATH)
set (OpenCASCADE_DIR "${anOcctDirBak}" CACHE PATH "Path to Open CASCADE libraries." FORCE)
else()
find_package (OpenCASCADE CONFIG QUIET)
endif()
endif()

View File

@@ -1,12 +1,15 @@
OCCT sample for iOS {#occt_samples_ios_uikit}
iOS: 3D Viewer (Objective-C++|UIKit) {#occt_samples_ios_uikit}
==================
UIKitSample consists of the Open CASCADE 3D Viewer which provides import of STEP files and toolbar with three buttons.
The sample could be found within OCCT repository in folder `/samples/ios/UIKitSample/`.
The first and second buttons serve for import hardcoded STEP files. The third button displays "About" dialog.
The viewer supports zoom, pan and rotate actions. The viewer supports selection of solids as well.
@figure{sample_ios_uikit.png}
Installation and configuration:
1. Make sure you are running Mac OS version 10.12.1 or above and properly installed XCode version 8.1 or above.
2. Install Open CASCADE Technology (OCCT) and build static libraries for desired device or/and simulator on your workstation.

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -1,7 +1,8 @@
OCCT JniViewer sample for Android {#samples_java_android_occt}
Android: 3D Viewer (Java|C++|Android SDK|JNI) {#samples_java_android_occt}
==================
This sample demonstrates simple way of using OCCT libraries in Android application written using Java.
The sample could be found within OCCT repository in folder `/samples/java/jniviewer/`.
The connection between Java and OCCT (C++) level is provided by proxy library, libTKJniSample.so, written in C++ with exported JNI methods of Java class OcctJniRenderer.
The proxy library contains single C++ class OcctJni_Viewer encapsulating OCCT viewer and providing functionality to manipulate this viewer
@@ -13,6 +14,8 @@ and the code can be programmed on Java level similarly to C++ one.
See description of OCCT Java Wrapper in Advanced Samples and Tools on OCCT web site at
https://www.opencascade.com/content/advanced-samples-and-tools
@figure{samples_java_android_occt.jpg}
Install Android Studio 4.0+ and install building tools (check Tools -> SDK Manager):
- Android SDK (API level 21 or higher).
- Android SDK build tools.

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -27,7 +27,7 @@ CSelectionDialog::CSelectionDialog (CHLRDoc* aDoc,CWnd* pParent /*=NULL*/)
myDoc = aDoc;
myIsDisplayed = false;
//{{AFX_DATA_INIT(CSelectionDialog)
m_Algo = 0;
m_Algo = 1;
m_DisplayMode = 0;
m_NbIsos = 2;
m_DrawHiddenLine = TRUE;

View File

@@ -1,6 +1,21 @@
MFC samples {#samples_mfc_standard}
MFC: OCCT Samples (C++|MFC) {#samples_mfc_standard}
==========
Visual C++ programming samples for Windows platform containing illustrating how to use a particular module or functionality, including the following MFC samples:
* Geometry
* Modeling
* Viewer2d
* Viewer3d
* ImportExport
* Ocaf
* Triangulation
* HLR
* Animation
* Convert
@figure{samples_mvc.png}
1. Contents
-----------------------

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -1,12 +1,15 @@
OCCT AndroidQt sample for Android {#samples_qml_android_occt}
Qt: 3D Viewer (C++|QtQuick|QML) {#samples_qml_android_occt}
==================
This sample demonstrates a simple way of using OCCT libraries in Android application written using Qt/Qml.
The sample could be found within OCCT repository in folder `/samples/qt/AndroidQt/`.
The connection between Qt/Qml and OCCT (C++) level is provided by proxy library, libAndroidQt.so, written in C++.
The proxy library contains single C++ class AndroidQt encapsulating OCCT viewer and providing functionality to manipulate this viewer
and to import OCCT shapes from supported format of CAD file (BREP).
@figure{samples_qml_android_occt.jpg}
Requirements for building sample:
* Java Development Kit 1.7 or higher
* Qt 5.3 or higher

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -95,6 +95,7 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent )
myCurZoom = 0;
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_NativeWindow);
myDefaultGestures = myMouseGestureMap;
myCurrentMode = CurAction3d_Nothing;
@@ -106,8 +107,6 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent )
setBackgroundRole( QPalette::NoRole );//NoBackground );
// set focus policy to threat QContextMenuEvent from keyboard
setFocusPolicy( Qt::StrongFocus );
setAttribute( Qt::WA_PaintOnScreen );
setAttribute( Qt::WA_NoSystemBackground );
init();
}

View File

@@ -0,0 +1,10 @@
Qt: Import/Export (C++|Qt Widgets) {#samples_qt_iesample}
==========
OCCT includes several samples based on Qt application framework.
These samples are available on all supported desktop platforms.
This Import Export programming sample contains 3D Viewer and Import / Export functionality.
The sample could be found within OCCT repository in folder `/samples/qt/IESample/`.
@figure{samples_qt.png}

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -1,6 +1,22 @@
Qt OCCT Overview samples {#samples_qt_overview}
Qt: OCCT Overview (C++|Qt Widgets) {#samples_qt_overview}
==========
The Overview Qt application provides code snippets 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.
This sample is described in the @ref samples__novice_guide "Novice guide" for new users.
@figure{sample_overview_qt.png}
1. Contents
-----------------------

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

@@ -0,0 +1,11 @@
Qt: Bottle Tutorial (C++|Qt Widgets) {#samples_qt_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"

View File

@@ -8,6 +8,8 @@
#include <TopoDS_Shape.hxx>
#include <AIS_Shape.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
TopoDS_Shape
MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness);
@@ -23,6 +25,17 @@ DocumentTut::~DocumentTut()
void DocumentTut::onMakeBottle()
{
Handle(AIS_InteractiveContext) aCtx = getContext();
for (V3d_ListOfView::Iterator aViewIter (aCtx->CurrentViewer()->ActiveViews()); aViewIter.More(); aViewIter.Next())
{
const Handle(V3d_View)& aView = aViewIter.Value();
Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams();
aParams.RenderResolutionScale = 2.0f;
}
const Handle(Prs3d_Drawer)& aDefDrawer = aCtx->DefaultDrawer();
aDefDrawer->SetIsoOnTriangulation (true);
QApplication::setOverrideCursor( Qt::WaitCursor );
TopoDS_Shape aBottle=MakeBottle(50,70,30);
Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);

View File

@@ -77,5 +77,8 @@ if (NOT "${SOURCE_MAP_BASE}" STREQUAL "")
endif()
endif()
install(FILES occt-webgl-sample.html DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX})
if (CMAKE_CXX_FLAGS MATCHES "-pthread")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.worker.js DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()

View File

@@ -1,4 +1,4 @@
OCCT WebGL Viewer sample {#occt_samples_webgl}
WebGL: 3D Viewer (JavaScript|C++|WebAssembly) {#occt_samples_webgl}
==================
This sample demonstrates simple way of using OCCT libraries in Web application written in C++ and translated into WebAssembly module using Emscripten SDK (emsdk):
@@ -6,6 +6,9 @@ https://emscripten.org/
Sample consists of the Open CASCADE 3D Viewer with a button for opening a model in BREP format.
The sample requires a WebGL 2.0 capable browser supporting WebAssembly 1.0 (Wasm).
The sample could be found within OCCT repository in folder `/samples/webgl/`.
@figure{sample_webgl.png,"",240} height=408px
Installation and configuration:
1. Install Emscripten SDK and activate minimal configuration (Python, Java and CLang) following *emsdk* documentation. Activate also MinGW when building sample on Windows host.

View File

@@ -185,12 +185,16 @@ void WasmOcctView::initWindow()
emscripten_set_resize_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onResizeCallback);
emscripten_set_mousedown_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback);
// bind these events to window to track mouse movements outside of canvas
//emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback);
//emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback);
//emscripten_set_mouseleave_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onMouseCallback);
emscripten_set_mousemove_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onMouseCallback);
emscripten_set_dblclick_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_click_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseenter_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseleave_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_wheel_callback (aTargetId, this, toUseCapture, onWheelCallback);
emscripten_set_touchstart_callback (aTargetId, this, toUseCapture, onTouchCallback);
@@ -198,9 +202,12 @@ void WasmOcctView::initWindow()
emscripten_set_touchmove_callback (aTargetId, this, toUseCapture, onTouchCallback);
emscripten_set_touchcancel_callback(aTargetId, this, toUseCapture, onTouchCallback);
//emscripten_set_keypress_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyCallback);
emscripten_set_keydown_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyDownCallback);
emscripten_set_keyup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyUpCallback);
//emscripten_set_keypress_callback (aTargetId, this, toUseCapture, onKeyCallback);
emscripten_set_keydown_callback (aTargetId, this, toUseCapture, onKeyDownCallback);
emscripten_set_keyup_callback (aTargetId, this, toUseCapture, onKeyUpCallback);
//emscripten_set_focus_callback (aTargetId, this, toUseCapture, onFocusCallback);
//emscripten_set_focusin_callback (aTargetId, this, toUseCapture, onFocusCallback);
emscripten_set_focusout_callback (aTargetId, this, toUseCapture, onFocusCallback);
}
// ================================================================
@@ -474,6 +481,21 @@ EM_BOOL WasmOcctView::onResizeEvent (int theEventType, const EmscriptenUiEvent*
return EM_TRUE;
}
//! Update canvas bounding rectangle.
EM_JS(void, jsUpdateBoundingClientRect, (), {
Module._myCanvasRect = Module.canvas.getBoundingClientRect();
});
//! Get canvas bounding top.
EM_JS(int, jsGetBoundingClientTop, (), {
return Math.round(Module._myCanvasRect.top);
});
//! Get canvas bounding left.
EM_JS(int, jsGetBoundingClientLeft, (), {
return Math.round(Module._myCanvasRect.left);
});
// ================================================================
// Function : onMouseEvent
// Purpose :
@@ -486,6 +508,18 @@ EM_BOOL WasmOcctView::onMouseEvent (int theEventType, const EmscriptenMouseEvent
}
Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window());
if (theEventType == EMSCRIPTEN_EVENT_MOUSEMOVE
|| theEventType == EMSCRIPTEN_EVENT_MOUSEUP)
{
// these events are bound to EMSCRIPTEN_EVENT_TARGET_WINDOW, and coordinates should be converted
jsUpdateBoundingClientRect();
EmscriptenMouseEvent anEvent = *theEvent;
anEvent.targetX -= jsGetBoundingClientLeft();
anEvent.targetY -= jsGetBoundingClientTop();
aWindow->ProcessMouseEvent (*this, theEventType, &anEvent);
return EM_FALSE;
}
return aWindow->ProcessMouseEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE;
}
@@ -557,6 +591,24 @@ bool WasmOcctView::navigationKeyModifierSwitch (unsigned int theModifOld,
return hasActions;
}
// ================================================================
// Function : onFocusEvent
// Purpose :
// ================================================================
EM_BOOL WasmOcctView::onFocusEvent (int theEventType, const EmscriptenFocusEvent* theEvent)
{
if (myView.IsNull()
|| (theEventType != EMSCRIPTEN_EVENT_FOCUS
&& theEventType != EMSCRIPTEN_EVENT_FOCUSIN // about to receive focus
&& theEventType != EMSCRIPTEN_EVENT_FOCUSOUT))
{
return EM_FALSE;
}
Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window());
return aWindow->ProcessFocusEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE;
}
// ================================================================
// Function : onKeyDownEvent
// Purpose :

View File

@@ -181,6 +181,9 @@ private:
//! Key up event.
EM_BOOL onKeyUpEvent (int theEventType, const EmscriptenKeyboardEvent* theEvent);
//! Focus change event.
EM_BOOL onFocusEvent (int theEventType, const EmscriptenFocusEvent* theEvent);
//! @name Emscripten callbacks (static functions)
private:
@@ -205,6 +208,9 @@ private:
static EM_BOOL onKeyUpCallback (int theEventType, const EmscriptenKeyboardEvent* theEvent, void* theView)
{ return ((WasmOcctView* )theView)->onKeyUpEvent (theEventType, theEvent); }
static EM_BOOL onFocusCallback (int theEventType, const EmscriptenFocusEvent* theEvent, void* theView)
{ return ((WasmOcctView* )theView)->onFocusEvent (theEventType, theEvent); }
private:
//! Register hot-keys for specified Action.

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -42,6 +42,11 @@ function updateCanvasSize()
window.onresize = updateCanvasSize;
updateCanvasSize();
// capture keyboard input on mouse click
occViewerCanvas.tabIndex = -1;
occViewerCanvas.onclick = (theEvent) => { occViewerCanvas.focus() };
occViewerCanvas.focus();
//! Check browser support.
function isWasmSupported()
{
@@ -78,6 +83,7 @@ fileInput.onchange = function()
OccViewerModule.openFromMemory (aFile.name, aDataBuffer, aDataArray.length, true);
//OccViewerModule._free (aDataBuffer); will be freed by called method
OccViewerModule.displayGround (true);
occViewerCanvas.focus();
};
aReader.readAsArrayBuffer(aFile);
};

View File

@@ -53,7 +53,6 @@ class TCollection_ExtendedString;
class Prs3d_LineAspect;
class Prs3d_BasicAspect;
class TopoDS_Shape;
class SelectMgr_EntityOwner;
class SelectMgr_Filter;
//! The Interactive Context allows you to manage graphic behavior and selection of Interactive Objects in one or more viewers.

View File

@@ -22,9 +22,7 @@
#include <SelectMgr_SelectableObject.hxx>
class AIS_InteractiveContext;
class Graphic3d_MaterialAspect;
class Prs3d_BasicAspect;
class Bnd_Box;
class V3d_View;
//! Defines a class of objects with display and selection services.

View File

@@ -257,27 +257,29 @@ Standard_Boolean AIS_LightSource::ProcessDragging (const Handle(AIS_InteractiveC
{
case AIS_DragAction_Start:
{
myStartTransform = theDragFrom;
myLocTrsfStart = LocalTransformation();
return Standard_True;
}
case AIS_DragAction_Update:
{
theCtx->MainSelector()->Pick (myStartTransform.x(), myStartTransform.y(), theView);
mySensSphere->ResetLastDetectedPoint();
SetLocalTransformation (myLocTrsfStart);
theCtx->MainSelector()->Pick (theDragFrom.x(), theDragFrom.y(), theView);
gp_Pnt aStartPosition = mySensSphere->LastDetectedPoint();
mySensSphere->ResetLastDetectedPoint();
theCtx->MainSelector()->Pick (theDragTo.x(), theDragTo.y(), theView);
gp_Pnt aCurrPosition = mySensSphere->LastDetectedPoint();
if (aCurrPosition.X() != RealLast() && aStartPosition.Distance (aCurrPosition) > Precision::Confusion())
if (aCurrPosition.X() != RealLast()
&& aStartPosition.Distance (aCurrPosition) > Precision::Confusion())
{
gp_Quaternion aQRot;
aQRot.SetRotation (gp_Vec (gp_Pnt (0, 0, 0), aStartPosition), gp_Vec (gp_Pnt (0, 0, 0), aCurrPosition));
gp_Trsf aTrsf;
aTrsf.SetRotation (aQRot);
SetLocalTransformation (myLocTrsfStart * aTrsf);
myLocTrsfStart = LocalTransformation();
myStartTransform = theDragTo;
theOwner->Selectable()->ClearDynamicHighlight (theCtx->MainPrsMgr());
theCtx->HilightWithColor (this, Handle(Prs3d_Drawer)(), false);
const Standard_Integer aHiMod = HasHilightMode() ? HilightMode() : 0;
theOwner->UpdateHighlightTrsf (theCtx->CurrentViewer(), theCtx->MainPrsMgr(), aHiMod);
}
return Standard_True;
}
@@ -475,7 +477,7 @@ void AIS_LightSource::updateLightLocalTransformation()
// =======================================================================
void AIS_LightSource::setLocalTransformation (const Handle(TopLoc_Datum3D)& theTrsf)
{
const gp_Trsf aTrsf = theTrsf->Transformation();
const gp_Trsf aTrsf = !theTrsf.IsNull() ? theTrsf->Transformation() : gp_Trsf();
switch (myLightSource->Type())
{
case Graphic3d_TypeOfLightSource_Ambient:

View File

@@ -20,7 +20,6 @@
#include <Graphic3d_CLight.hxx>
#include <SelectMgr_EntityOwner.hxx>
class Prs3d_ShadingAspect;
class Select3D_SensitiveSphere;
//! Interactive object for a light source.
@@ -260,7 +259,6 @@ protected:
Aspect_TypeOfMarker myCodirMarkerType; //!< icon of arrow co-directional to camera direction (look from)
Aspect_TypeOfMarker myOpposMarkerType; //!< icon of arrow opposite to camera direction (look at)
Graphic3d_Vec2i myStartTransform; //!< position of starting transformation
gp_Trsf myLocTrsfStart; //!< object transformation before transformation
Standard_Real mySize; //!< presentation size
Standard_Integer myNbArrows; //!< number of directional light arrows

View File

@@ -24,7 +24,6 @@
class Geom_Plane;
class Geom_Axis2Placement;
class gp_Pnt;
//! Constructs plane datums to be used in construction of
//! composite shapes.

View File

@@ -41,7 +41,6 @@ class AIS_InteractiveContext;
class AIS_Point;
class AIS_RubberBand;
class AIS_XRTrackedDevice;
class Graphic3d_Camera;
class SelectMgr_EntityOwner;
class V3d_View;
class WNT_HIDSpaceMouse;
@@ -442,10 +441,13 @@ public: //! @name resize events
virtual void ProcessInput() Standard_OVERRIDE {}
//! Handle focus event.
//! Default implementation does nothing.
//! Default implementation resets cached input state (pressed keys).
virtual void ProcessFocus (bool theIsActivated) Standard_OVERRIDE
{
(void )theIsActivated;
if (!theIsActivated)
{
ResetViewInput();
}
}
//! Handle window close event.

View File

@@ -27,13 +27,13 @@
#include <Prs3d_Text.hxx>
#include <Prs3d_ToolDisk.hxx>
#include <Prs3d_ToolSphere.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
#include <V3d.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCube, AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCubeOwner, SelectMgr_EntityOwner)
IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArray)
namespace
{
@@ -56,46 +56,48 @@ namespace
}
}
//! Simple sensitive element for picking by point only.
class AIS_ViewCubeSensitive : public Select3D_SensitivePrimitiveArray
//=======================================================================
//function : AIS_ViewCubeSensitive
//purpose :
//=======================================================================
AIS_ViewCubeSensitive::AIS_ViewCubeSensitive (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(Graphic3d_ArrayOfTriangles)& theTris)
: Select3D_SensitivePrimitiveArray (theOwner)
{
DEFINE_STANDARD_RTTI_INLINE(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArray)
public:
//! Constructor.
AIS_ViewCubeSensitive (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(Graphic3d_ArrayOfTriangles)& theTris)
: Select3D_SensitivePrimitiveArray (theOwner)
InitTriangulation (theTris->Attributes(), theTris->Indices(), TopLoc_Location());
}
//=======================================================================
//function : Matches
//purpose :
//=======================================================================
Standard_Boolean AIS_ViewCubeSensitive::Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
{
return isValidRay (theMgr) && Select3D_SensitivePrimitiveArray::Matches (theMgr, thePickResult);
}
//=======================================================================
//function : isValidRay
//purpose :
//=======================================================================
bool AIS_ViewCubeSensitive::isValidRay (const SelectBasics_SelectingVolumeManager& theMgr) const
{
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
{
InitTriangulation (theTris->Attributes(), theTris->Indices(), TopLoc_Location());
// disallow rectangular selection
return false;
}
//! Checks whether element overlaps current selecting volume.
virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) Standard_OVERRIDE
if (AIS_ViewCubeOwner* anOwner = dynamic_cast<AIS_ViewCubeOwner* >(myOwnerId.get()))
{
return isValidRay (theMgr)
&& Select3D_SensitivePrimitiveArray::Matches (theMgr, thePickResult);
const Standard_Real anAngleToler = 10.0 * M_PI / 180.0;
const gp_Dir aRay = theMgr.GetViewRayDirection();
const gp_Dir aDir = V3d::GetProjAxis (anOwner->MainOrientation());
return !aRay.IsNormal (aDir, anAngleToler);
}
//! Checks if picking ray can be used for detection.
bool isValidRay (const SelectBasics_SelectingVolumeManager& theMgr) const
{
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
{
// disallow rectangular selection
return false;
}
if (AIS_ViewCubeOwner* anOwner = dynamic_cast<AIS_ViewCubeOwner* >(myOwnerId.get()))
{
const Standard_Real anAngleToler = 10.0 * M_PI / 180.0;
const gp_Dir aRay = theMgr.GetViewRayDirection();
const gp_Dir aDir = V3d::GetProjAxis (anOwner->MainOrientation());
return !aRay.IsNormal (aDir, anAngleToler);
}
return true;
}
};
return true;
}
//=======================================================================
//function : IsBoxSide

View File

@@ -24,6 +24,7 @@
#include <Prs3d_TextAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <V3d_TypeOfOrientation.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
class AIS_AnimationCamera;
class AIS_ViewCubeOwner;
@@ -724,4 +725,25 @@ protected:
};
//! Simple sensitive element for picking by point only.
class AIS_ViewCubeSensitive : public Select3D_SensitivePrimitiveArray
{
DEFINE_STANDARD_RTTIEXT(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArray)
public:
//! Constructor.
Standard_EXPORT AIS_ViewCubeSensitive (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(Graphic3d_ArrayOfTriangles)& theTris);
//! Checks whether element overlaps current selecting volume.
Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
protected:
//! Checks if picking ray can be used for detection.
Standard_EXPORT bool isValidRay (const SelectBasics_SelectingVolumeManager& theMgr) const;
};
#endif // _AIS_ViewCube_HeaderFile

View File

@@ -29,9 +29,6 @@
#include <Standard_Handle.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class gp_Pnt2d;
class gp_Vec2d;
class Geom2d_BezierCurve;

View File

@@ -29,9 +29,6 @@
#include <TColStd_Array1OfReal.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_CurveType.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class gp_Pnt2d;
class gp_Dir2d;
class gp_Lin2d;

View File

@@ -23,10 +23,6 @@
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_NoSuchObject;
class Standard_DomainError;
class Standard_OutOfRange;
class Standard_TypeMismatch;
class gp_Pnt2d;
class gp_Vec2d;
class gp_Lin2d;

View File

@@ -29,9 +29,6 @@
#include <TColStd_Array1OfReal.hxx>
#include <GeomAbs_CurveType.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class gp_Pnt;
class gp_Vec;
class Geom_BezierCurve;

View File

@@ -21,7 +21,6 @@
#include <gp_Pnt2d.hxx>
#include <TopAbs_Orientation.hxx>
class gp_Pnt2d;
class Adaptor3d_HVertex;
DEFINE_STANDARD_HANDLE(Adaptor3d_HVertex, Standard_Transient)

View File

@@ -34,8 +34,6 @@
#include <TColGeom_HArray1OfSurface.hxx>
#include <AdvApp2Var_EvaluatorFunc2Var.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class AdvApprox_Cutting;
class AdvApp2Var_Criterion;
class Geom_BSplineSurface;

View File

@@ -17,8 +17,8 @@
| de l'approximation a deux variables
| a utiliser dans AdvApp2Var
|--------------------------------------------------------------*/
#ifndef ApproxF2var_HeaderFile
#define ApproxF2var_HeaderFile
#ifndef AdvApp2Var_ApproxF2var_HeaderFile
#define AdvApp2Var_ApproxF2var_HeaderFile
#include <Standard_Macro.hxx>
#include <AdvApp2Var_Data_f2c.hxx>

View File

@@ -12,8 +12,8 @@
// commercial license or contractual agreement.
// AdvApp2Var_Data_f2c.hxx
#ifndef Data_f2c_HeaderFile
#define Data_f2c_HeaderFile
#ifndef AdvApp2Var_Data_f2c_HeaderFile
#define AdvApp2Var_Data_f2c_HeaderFile
#ifndef F2CTYPE_DEFINED
typedef int integer;

View File

@@ -28,7 +28,6 @@
#include <GeomAbs_IsoType.hxx>
#include <Standard_Real.hxx>
#include <TColStd_HArray1OfReal.hxx>
class Standard_NoSuchObject;
class AdvApp2Var_Iso;
class AdvApp2Var_Node;

View File

@@ -26,7 +26,6 @@
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
class Standard_NoSuchObject;
class AdvApp2Var_Patch;

View File

@@ -37,8 +37,6 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class AdvApprox_Cutting;

View File

@@ -25,7 +25,6 @@
#include <Standard_Real.hxx>
#include <AdvApprox_Cutting.hxx>
#include <Standard_Boolean.hxx>
class Standard_DomainError;

View File

@@ -33,8 +33,6 @@
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class PLib_JacobiPolynomial;
class Standard_OutOfRange;
class Standard_ConstructionError;
//! Approximate a function on an intervall [First,Last]

View File

@@ -29,9 +29,6 @@
#include <TColStd_Array1OfInteger.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
class StdFail_NotDone;
class Standard_DomainError;
class Standard_OutOfRange;
//! Bspline approximation of a surface.

View File

@@ -12,8 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef math_ContMatrices_HeaderFile
#define math_ContMatrices_HeaderFile
#ifndef AppCont_ContMatrices_HeaderFile
#define AppCont_ContMatrices_HeaderFile
#include <math_Vector.hxx>
#include <Standard_Real.hxx>

View File

@@ -31,9 +31,6 @@
#include <math_Vector.hxx>
class FEmTool_ElementaryCriterion;
class FEmTool_Curve;
class Standard_NotImplemented;
class Standard_DomainError;
class AppDef_MultiLine;
class math_Matrix;

View File

@@ -28,9 +28,6 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_ConstructionError;
class Standard_DimensionError;
class Standard_OutOfRange;
class AppDef_MultiPointConstraint;

View File

@@ -27,9 +27,6 @@
#include <TColgp_HArray1OfVec.hxx>
#include <TColgp_HArray1OfVec2d.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class Standard_DimensionError;
class gp_Vec;
class gp_Vec2d;

View File

@@ -28,8 +28,6 @@
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_NotImplemented;
class Standard_DomainError;
class FEmTool_Curve;
class math_Matrix;

View File

@@ -35,14 +35,6 @@
#include <math_Vector.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_SmoothCriterion;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_DomainError;
class Standard_ConstructionError;
class StdFail_NotDone;
class gp_VectorWithNullMagnitude;
class AppDef_MultiLine;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class FEmTool_Curve;
class FEmTool_Assembly;

View File

@@ -26,23 +26,6 @@
#include <Standard_Real.hxx>
#include <math_IntegerVector.hxx>
class math_Matrix;
class AppParCurves_MultiPoint;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class AppParCurves_ConstraintCouple;
class AppParCurves_LeastSquare;
class AppParCurves_ResolConstraint;
class AppParCurves_Function;
class AppParCurves_BSpFunction;
class AppParCurves_Gradient;
class AppParCurves_Gradient_BFGS;
class AppParCurves_ParLeastSquare;
class AppParCurves_ResConstraint;
class AppParCurves_ParFunction;
class AppParCurves_BSpGradient;
class AppParCurves_BSpGradient_BFGS;
class AppParCurves_BSpParLeastSquare;
class AppParCurves_BSpParFunction;
//! Parallel Approximation in n curves.

View File

@@ -30,10 +30,6 @@
#include <TColStd_Array1OfInteger.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_ConstructionError;
class AppParCurves_MultiCurve;
class gp_Pnt;
class gp_Pnt2d;
class gp_Vec;

View File

@@ -28,9 +28,6 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_ConstructionError;
class AppParCurves_MultiPoint;
class gp_Pnt;
class gp_Pnt2d;

View File

@@ -27,8 +27,6 @@
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_Transient;
class Standard_OutOfRange;
class Standard_DimensionError;
class gp_Pnt;
class gp_Pnt2d;

View File

@@ -25,7 +25,6 @@
#include <Standard_Boolean.hxx>
#include <AppParCurves_SequenceOfMultiCurve.hxx>
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;

View File

@@ -173,8 +173,17 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
{
Standard_Real t = IntToReal(i) / IntToReal(nbp);
Standard_Real u = first * (1.0 - t) + last * t;
gp_Pnt Pc3d = c3d->Value(u);
gp_Pnt Pcons = cons.Value(u);
gp_Pnt Pc3d, Pcons;
try
{
Pc3d = c3d->Value(u);
Pcons = cons.Value(u);
}
catch (Standard_Failure const&)
{
d2 = Precision::Infinite();
break;
}
if (Precision::IsInfinite(Pcons.X()) ||
Precision::IsInfinite(Pcons.Y()) ||
Precision::IsInfinite(Pcons.Z()))

View File

@@ -44,9 +44,6 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_OStream.hxx>
class Approx_SweepFunction;
class StdFail_NotDone;
class Standard_DomainError;
class Standard_OutOfRange;
class AdvApprox_Cutting;

View File

@@ -31,8 +31,6 @@
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <GeomAbs_Shape.hxx>
class Standard_NotImplemented;
class Standard_OutOfRange;
class gp_Pnt;

View File

@@ -91,7 +91,7 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline,
//function : Parameters
//purpose :
//=======================================================================
static void Parameters(const ApproxInt_TheMultiLine& Line,
void ApproxInt_Approx::Parameters(const ApproxInt_TheMultiLine& Line,
const Standard_Integer firstP,
const Standard_Integer lastP,
const Approx_ParametrizationType Par,

View File

@@ -26,6 +26,8 @@
#include <Precision.hxx>
#include <NCollection_Vector.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <GeomInt_WLApprox.hxx>
#include <GeomInt_TheMultiLineOfWLApprox.hxx>
// (Sqrt(5.0) - 1.0) / 4.0
//static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282;
@@ -88,6 +90,94 @@ static Standard_Real EvalCurv(const Standard_Real dim,
return curv;
}
//=======================================================================
//function : BuildCurvature
//purpose :
//=======================================================================
void ApproxInt_KnotTools::BuildCurvature(
const NCollection_LocalArray<Standard_Real>& theCoords,
const Standard_Integer theDim,
const math_Vector& thePars,
TColStd_Array1OfReal& theCurv,
Standard_Real& theMaxCurv)
{
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
Standard_Real Val[21], Par[3], Res[21];
Standard_Integer i, j, m, ic;
Standard_Integer dim = theDim;
//
theMaxCurv = 0.;
if (theCurv.Length() < 3)
{
theCurv.Init(0.);
return;
}
i = theCurv.Lower();
for (j = 0; j < 3; ++j)
{
Standard_Integer k = i + j;
ic = (k - theCurv.Lower()) * dim;
Standard_Integer l = dim*j;
for (m = 0; m < dim; ++m)
{
Val[l + m] = theCoords[ic + m];
}
Par[j] = thePars(k);
}
PLib::EvalLagrange(Par[0], 2, 2, dim, *Val, *Par, *Res);
//
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
//
if (theCurv(i) > theMaxCurv)
{
theMaxCurv = theCurv(i);
}
//
for (i = theCurv.Lower() + 1; i < theCurv.Upper(); ++i)
{
for (j = 0; j < 3; ++j)
{
Standard_Integer k = i + j - 1;
ic = (k - theCurv.Lower()) * dim;
Standard_Integer l = dim*j;
for (m = 0; m < dim; ++m)
{
Val[l + m] = theCoords[ic + m];
}
Par[j] = thePars(k);
}
PLib::EvalLagrange(Par[1], 2, 2, dim, *Val, *Par, *Res);
//
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
if (theCurv(i) > theMaxCurv)
{
theMaxCurv = theCurv(i);
}
}
//
i = theCurv.Upper();
for (j = 0; j < 3; ++j)
{
Standard_Integer k = i + j - 2;
ic = (k - theCurv.Lower()) * dim;
Standard_Integer l = dim*j;
for (m = 0; m < dim; ++m)
{
Val[l + m] = theCoords[ic + m];
}
Par[j] = thePars(k);
}
PLib::EvalLagrange(Par[2], 2, 2, dim, *Val, *Par, *Res);
//
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
if (theCurv(i) > theMaxCurv)
{
theMaxCurv = theCurv(i);
}
}
//=======================================================================
//function : ComputeKnotInds
//purpose :
@@ -100,75 +190,10 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
//I: Create discrete curvature.
NCollection_Sequence<Standard_Integer> aFeatureInds;
TColStd_Array1OfReal aCurv(thePars.Lower(), thePars.Upper());
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
Standard_Real Val[21], Par[3], Res[21];
Standard_Integer i, j, m, ic;
Standard_Real aMaxCurv = 0.;
Standard_Integer dim = theDim;
//
i = aCurv.Lower();
for(j = 0; j < 3; ++j)
{
Standard_Integer k = i+j;
ic = (k - aCurv.Lower()) * dim;
Standard_Integer l = dim*j;
for(m = 0; m < dim; ++m)
{
Val[l + m] = theCoords[ic + m];
}
Par[j] = thePars(k);
}
PLib::EvalLagrange(Par[0], 2, 2, dim, *Val, *Par, *Res);
//
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
//
if(aCurv(i) > aMaxCurv)
{
aMaxCurv = aCurv(i);
}
//
for(i = aCurv.Lower()+1; i < aCurv.Upper(); ++i)
{
for(j = 0; j < 3; ++j)
{
Standard_Integer k = i+j-1;
ic = (k - aCurv.Lower()) * dim;
Standard_Integer l = dim*j;
for(m = 0; m < dim; ++m)
{
Val[l + m] = theCoords[ic + m];
}
Par[j] = thePars(k);
}
PLib::EvalLagrange(Par[1], 2, 2, dim, *Val, *Par, *Res);
//
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
if(aCurv(i) > aMaxCurv)
{
aMaxCurv = aCurv(i);
}
}
//
i = aCurv.Upper();
for(j = 0; j < 3; ++j)
{
Standard_Integer k = i+j-2;
ic = (k - aCurv.Lower()) * dim;
Standard_Integer l = dim*j;
for(m = 0; m < dim; ++m)
{
Val[l + m] = theCoords[ic + m];
}
Par[j] = thePars(k);
}
PLib::EvalLagrange(Par[2], 2, 2, dim, *Val, *Par, *Res);
//
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
if(aCurv(i) > aMaxCurv)
{
aMaxCurv = aCurv(i);
}
BuildCurvature(theCoords, theDim, thePars, aCurv, aMaxCurv);
//
Standard_Integer i, j, dim = theDim;
#ifdef APPROXINT_KNOTTOOLS_DEBUG
std::cout << "Discrete curvature array is" << std::endl;
for(i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
@@ -627,3 +652,172 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
#endif
}
//=======================================================================
//function : MaxParamRatio
//purpose :
//=======================================================================
static Standard_Real MaxParamRatio(const math_Vector& thePars)
{
Standard_Integer i;
Standard_Real aMaxRatio = 0.;
//
for (i = thePars.Lower() + 1; i < thePars.Upper(); ++i)
{
Standard_Real aRat = (thePars(i + 1) - thePars(i)) / (thePars(i) - thePars(i - 1));
if (aRat < 1.)
aRat = 1. / aRat;
aMaxRatio = Max(aMaxRatio, aRat);
}
return aMaxRatio;
}
//=======================================================================
//function : DefineParType
//purpose :
//=======================================================================
Approx_ParametrizationType ApproxInt_KnotTools::DefineParType(
const Handle(IntPatch_WLine)& theWL,
const Standard_Integer theFpar, const Standard_Integer theLpar,
const Standard_Boolean theApproxXYZ,
const Standard_Boolean theApproxU1V1,
const Standard_Boolean theApproxU2V2
)
{
if (theLpar - theFpar == 1)
return Approx_IsoParametric;
const Standard_Integer nbp3d = theApproxXYZ ? 1 : 0,
nbp2d = (theApproxU1V1 ? 1 : 0) + (theApproxU2V2 ? 1 : 0);
GeomInt_TheMultiLineOfWLApprox aTestLine(theWL, nbp3d, nbp2d, theApproxU1V1, theApproxU2V2,
0., 0., 0., 0., 0., 0., 0., theApproxU1V1, theFpar, theLpar);
TColgp_Array1OfPnt aTabPnt3d(1, Max(1, nbp3d));
TColgp_Array1OfPnt2d aTabPnt2d(1, Max(1, nbp2d));
TColgp_Array1OfPnt aPntXYZ(theFpar, theLpar);
TColgp_Array1OfPnt2d aPntU1V1(theFpar, theLpar);
TColgp_Array1OfPnt2d aPntU2V2(theFpar, theLpar);
Standard_Integer i, j;
for (i = theFpar; i <= theLpar; ++i)
{
if (nbp3d != 0 && nbp2d != 0) aTestLine.Value(i, aTabPnt3d, aTabPnt2d);
else if (nbp2d != 0) aTestLine.Value(i, aTabPnt2d);
else if (nbp3d != 0) aTestLine.Value(i, aTabPnt3d);
//
if (nbp3d > 0)
{
aPntXYZ(i) = aTabPnt3d(1);
}
if (nbp2d > 1)
{
aPntU1V1(i) = aTabPnt2d(1);
aPntU2V2(i) = aTabPnt2d(2);
}
else if (nbp2d > 0)
{
if (theApproxU1V1)
{
aPntU1V1(i) = aTabPnt2d(1);
}
else
{
aPntU2V2(i) = aTabPnt2d(1);
}
}
}
Standard_Integer aDim = 0;
if (theApproxXYZ)
aDim += 3;
if (theApproxU1V1)
aDim += 2;
if (theApproxU2V2)
aDim += 2;
Standard_Integer aLength = theLpar - theFpar + 1;
NCollection_LocalArray<Standard_Real> aCoords(aLength * aDim);
for (i = theFpar; i <= theLpar; ++i)
{
j = (i - theFpar) * aDim;
if (theApproxXYZ)
{
aCoords[j] = aPntXYZ.Value(i).X();
++j;
aCoords[j] = aPntXYZ.Value(i).Y();
++j;
aCoords[j] = aPntXYZ.Value(i).Z();
++j;
}
if (theApproxU1V1)
{
aCoords[j] = aPntU1V1.Value(i).X();
++j;
aCoords[j] = aPntU1V1.Value(i).Y();
++j;
}
if (theApproxU2V2)
{
aCoords[j] = aPntU2V2.Value(i).X();
++j;
aCoords[j] = aPntU2V2.Value(i).Y();
++j;
}
}
//Analysis of curvature
const Standard_Real aCritRat = 500.;
const Standard_Real aCritParRat = 100.;
math_Vector aPars(theFpar, theLpar);
Approx_ParametrizationType aParType = Approx_ChordLength;
GeomInt_WLApprox::Parameters(aTestLine, theFpar, theLpar, aParType, aPars);
TColStd_Array1OfReal aCurv(aPars.Lower(), aPars.Upper());
Standard_Real aMaxCurv = 0.;
BuildCurvature(aCoords, aDim, aPars, aCurv, aMaxCurv);
if (aMaxCurv < Precision::PConfusion()
|| Precision::IsPositiveInfinite(aMaxCurv))
{
//Linear case
return aParType;
}
Standard_Real aMidCurv = 0.;
Standard_Real eps = Epsilon(1.);
j = 0;
for (i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
{
if (aMaxCurv - aCurv(i) < eps)
{
continue;
}
++j;
aMidCurv += aCurv(i);
}
if (j > 1)
{
aMidCurv /= j;
}
if (aMidCurv <= eps)
return aParType;
Standard_Real aRat = aMaxCurv / aMidCurv;
if (aRat > aCritRat)
{
if(aRat > 5.*aCritRat)
aParType = Approx_Centripetal;
else
{
Standard_Real aParRat = MaxParamRatio(aPars);
if (aParRat > aCritParRat)
aParType = Approx_Centripetal;
}
}
return aParType;
}

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