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

Compare commits

..

69 Commits

Author SHA1 Message Date
vpa
af989e9d1d Draft implementation of LOD API in OCCT:
- implemented interfaces for LOD at OpenGl, Graphic3d and MeshVS levels;
- added LOD managers at Graphic3d and OpenGl levels;
- simple mechanism of LOD switching is implemented in LOD manager;
- distance to COG metric is temporarily used;
- the metric could be redefined using custom LOD selectors;
- LODs are added to MeshVS_Mesh in Compute method and are listed as its data sources;
- added commands meshgenlod and meshlod to generate LODs for mesh and its topological representation
  and bind them to its OpenGl structures.
2015-12-08 10:18:27 +03:00
abv
92efcf78a6 0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
Automatic restore of IMPLEMENT_STANDARD_RTTIEXT macro (upgrade -rtti)
2015-12-04 14:15:06 +03:00
abv
f5f4ebd07b 0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- manual
Restored possibility to have out-of-line implementation of DynamicCast() and STANDART_TYPE():
- Macro STANDARD_TYPE() now resolves to function get_type_descriptor() of the class
- Macro DEFINE_STANDARD_RTTI is replaced by two variants:
  - DEFINE_STANDARD_RTTI_INLINE works as before, defining DynamicCast() and get_type_descriptor() as inline functions
  - DEFINE_STANDARD_RTTIEXT declares DynamicCast() and get_type_descriptor() as exported
- Macro IMPLEMENT_STANDARD_RTTIEXT provides definition of DynamicCast() and get_type_descriptor() for a class

Upgrade script amended to replace DEFINE_STANDARD_RTTI by pair of DEFINE_STANDARD_RTTIEXT / IMPLEMENT_STANDARD_RTTIEXT if source file with the same name as header is found in the same folder, and by DEFINE_STANDARD_RTTI_INLINE if either source is not found or class is defined in the source (i.e. not in header)

Upgrade tool improved to recognize include statements with path prefix, like #include <occt/gp_Pnt.hxx>
Code corrected to eliminate warnings reported by upgrade tool.
Template of CXX file for testing upgrade tool added.

Documentation of upgrade procedure updated.
2015-12-04 13:57:58 +03:00
ika
6595eee796 0026859: Export of GDT from XCAF to STEP
Export/Import:
Add export of dimensions, geometric tolerances and datums, according to AP242.
Add missing STEP entities.
Corrections.

XCAF:
Add new attributes to Datum object: DatumTargetNumber.
Supplement enum XCAFDimTolObjects_GeomToleranceZoneModif.
Corrections.

Test cases:
gdt export A1
gdt export A2
gdt export A3
gdt export A4
gdt export A5
2015-12-04 13:16:58 +03:00
nbv
4e14c88f77 0026431: Can't cut a sphere from a cylinder
This branch contains fixes for 26675 and 26431 bugs.

1. Normalization has been eliminated.
2. Interfaces of AppDef_Compute::Parametrization(...) and BRepAlgo_BooleanOperations::SetApproxParameters() methods have been changed.
3. Overloaded methods for ApproxInt_Approx::SetParameters(...), TopOpeBRepTool_GeomTool::GetTolerances(...) and TopOpeBRepTool_GeomTool::SetTolerances(...) have been removed (because some fields of these classes are not used more).
4. Comments for some methods have been changed in BRepApprox_TheMultiLineOfApprox.hxx and GeomInt_TheMultiLineOfWLApprox.hxx files.
5. Some fields have been deleted from ApproxInt_MultiLine class. Kept members have become constant.
6. Interface of ksection DRAW-command has been changed.
7. Now, 2dintersect DRAW-command prints information about found segments.
8. Some code fragments have been rewritten to make them easier.
9. Algorithm of splitting WLine, which goes through pole of sphere has been improved.
10. Improve approximation algorithm in order to it will compute correct 2D- and 3D-tangent at the end of bezier constraints (including case when curve goes through or finishes on singular points).
11. Interface of IntPatch_WLine::Dump(...) method has been corrected.
12. Some methods for working with Walking-line are made more universal (available for both GeomInt and IntTools packages).
13. Problem in BRepLib::SameParameter(...) method has been fixed (see corresponding comment).
14. Small correction in Draft package.
15. Any outputs in IntPatch_Intersection::Dump(...) method have become disabled because they are useless. If anybody need in this outputs he/she will correct this method himself/herself.

Adjusting some test cases according to their new behavior.
Creation of new test cases.

----------------------------------------------------------------------------------------------------------------------------

Some explanation of new behavior of some test cases:

 1. Regressions:

a) blend simple X4
The problem is described in the issue #0026740. According to this description,  the result on the current MASTER seems to be wrong indeed.

b) boolean bcommon_complex C7 and boolean bcut_complex Q1
These test case use same shapes with different Boolean operation (COMMON and CUT). They are already BAD (on the MASTER). Now, some sub-shapes have become not-shared, simply. In my opinion, we shall apply new behavior of these tests.

c) boolean bsection M3
The problem described in the issue #0026777 exists even on the current MASTER.

d) boolean bsection M9
The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=26815#c47546. Here, we have really regression in the picture.

e) boolean bsection N2

The problem is described in issue #0026814.

f) boolean volumemaker G1

The problem is described in issue #26020.

g) bugs modalg_1 bug1255 (and bug1255_1)

The problem is described in issue #26815.

h) bugs modalg_2 bug5805_18, bugs modalg_2 bug5805_42, bugs modalg_2 bug5805_46

The problem is described in issue #25925.

i) bugs modalg_3 bug602

The problem is describes in issue #602.

j) bugs modalg_5 bug24915

The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=25929#c48565. It is not fixed by this issue.

k) bugs modalg_5 bug25838

The main reason is described in issue #0026816.

----------------------------------------------------------------------------
2. Improvements:

a) boolean volumemaker F9
b) bugs modalg_1 bug10160_3
c) bugs modalg_2 bug22557
d) bugs modalg_5 bug25319_1 (_2)
e) draft angle G2
f) offset shape A1
g) offset with_intersect_80 N7
2015-12-04 13:15:04 +03:00
aml
f44aa19760 0025929: Make Approx_ComputeLine algorithm adaptive
Adaptive partition algorithm of WLine is implemented and used in ApproxInt_Approx.gxx file.
Refactoring of ApproxInt_Approx class.
Test cases are updated to the new behaviour.

Filtering algorithm improved.
2015-12-04 13:12:09 +03:00
abv
600f8c7f47 CSF_TBB added for toolkits that need to link to TBB 2015-12-04 13:03:51 +03:00
ski
0e617b05e7 0026902: Configuration, CMake - tests is not installed after definition INSTALL_OCCT_TEST_CASES option
Variables responsible for installation of tests and samples were renamed
2015-12-04 13:03:47 +03:00
mgn
586db386eb 0026922: Huge performance issue writing data to the output stream
Test case for issue CR26922

Correction of literal (char to string)
2015-12-04 13:03:41 +03:00
kgv
cc6852f3e9 0026940: Visualization, TKOpenGl - capping plane should be applied to connected structures
OpenGl_Structure::Render(), OpenGl_CappingAlgo::RenderCapping() - render
groups of instanced and this structure in the same manner
using ::renderGeometry() and ::renderClosedGeometry() instead of ::DrawGroups().
Skip capping algo for structures without groups of closed primitives.
2015-12-04 13:03:28 +03:00
azv
d660a72aca 0026838: Using GeomEvaluators for calculation of values of curves
1. Implemented evaluators for 2D and 3D offset curves
2. Removed obsolete namespace CSLib_Offset

Update of UDLIST (adding no-cdl-pack Geom2dEvaluator)

Update TKG2d/CMakeLists.txt after rebase

Correction compilation in debug mode
2015-11-27 11:49:40 +03:00
apl
badc9305ae 0026658: Unexpected selection in the context using a selection filter.
Method AIS_LocalContext::ClearOutdatedSelection() fixed. Now it chooses "mylastindex" value from list of filtered detected owners. The topmost detected owner will be highlighted if the current detected owner was cleared as outdated.

BUC26658 command to check the bug fix in DRAW.

append a test script to automatically check the bug in DRAW.

warnings correction.
2015-11-27 10:20:34 +03:00
apl
97f937cc55 0026792: Visualization, Graphic3d - Z-fit support for transform persistence is missing after removing Visual3d_View
Add missing code for z-fit support for zoom, rotate persistent object.
Fixed wrong statement that should enable frustum culling optimization for zoom, rotate persistent object.
Fixed BVH_LinearBuilder.lxx to correctly control number of items in leaf node for a case of items with equal bounding boxes.
Added non-regression test case for z-clipping of transform persistent objects.
2015-11-27 10:18:12 +03:00
azv
c8b5b3d89e 0023620: Follow up of 0022939 - make Bezier curve/surface evaluation thread-safe
1. Remove cache from Geom_BezierCurve, Geom2d_BezierCurve and Geom_BezierSurface
2. Add cache for Bezier curves into GeomAdaptor_Curve, Geom2dAdaptor_Curve and GeomAdaptor_Surface
3. Update comments in corresponding cache classes
4. Avoid frequent down-casting to B-splines in adaptors
2015-11-27 10:08:50 +03:00
azv
525ec87c53 0026914: [Regression 7.0alpha] Hang in surface approximation
Change a constructor of evaluator for offset surfaces

Test-case for issue #26914
2015-11-27 10:08:45 +03:00
ika
5371131494 0026451: Crash importing STeP file
Add check for NULL.
2015-11-27 10:08:40 +03:00
kgv
b128c89231 0026915: Visualization - return Handle from Graphic3d_CView::FBOCreate() instead of a pointer
OpenGl_View::FBO() - use copy Handle constructor for compatibility.
2015-11-27 10:08:35 +03:00
osa
6bd94e0de9 0026348: Visualization, TKOpenGl - eliminate invalid NULL checks for transformation matrix
Graphic3d_CStructure::Transformation - use Graphic3d_Mat4 instead of plain arrays.
Drop duplicating field OpenGl_Structure::myTransformation (copy of Graphic3d_CStructure::Transformation).
Drop unused property Graphic3d_CStructure::Composition and Graphic3d_Structure::Composition().
2015-11-27 10:08:30 +03:00
vro
f486f64d86 0026005: Problem with transient TFunction_Logbook 2015-11-27 10:08:24 +03:00
azv
8156ddddc7 0026897: BRepBuilderAPI_Copy does not copy polygons
1. Implemented copying for 3D polygons and polygons on surfaces
2. Added test case bugs/modalg_6/bug26897
2015-11-27 10:08:18 +03:00
isk
fbef84f9eb 0026891: Visualization, TKOpenGl - define more texture types within OpenGl_TextureFormatSelector 2015-11-27 10:08:13 +03:00
vpa
95081657f1 0026905: Visualization - cosmetic fixes in selection methods of AIS_InteractiveContext
- selection mode in AIS_InteractiveContext::AddOrRemoveSelected is corrected;
- AIS_InteractiveContext::IsSelected returns object's state instead of global status.
2015-11-27 10:08:08 +03:00
azv
6a2ee09493 0026871: [Regression in 6.9.0] Projecting a curve hangs inside Approx_FitAndDivide2d
Fix checking of B-spline parametrization speed

Test case for issue CR26871
2015-11-27 10:08:03 +03:00
nbv
ce48b00930 0026884: Cylinder/Cylinder intersection algorithm throws an exception
Check, if cylinder axes are parallel is made more carefully.
This check is brought to conformity with check if axes are parallel (see constructor AxeOperator::AxeOperator(...) in IntAna_QuadQuadGeo.cxx file)

Test case for issue CR26884
2015-11-26 12:05:36 +03:00
rkv
c16915c713 0026625: Possible wrong use of vtkSmartPointer<T> in IVtkVTK_ShapeData.cxx
Use vtkSmartPointer<XXX>::New() instead of XXX::New() when initializing fields of vtkSmartPointer<XXX> types.
2015-11-26 12:02:09 +03:00
aba
4d147bf2a7 0025549: Visualization - do not crash on attempt to display the Angle dimension between two parallel lines
- Handle cases of 0 and Pi angle depending on lines in edges and end points

Draw arcs in accordance with input normal for minimum angle, check correctness of input circle parameters
2015-11-26 11:59:30 +03:00
bugmaster
bd485d9691 Redirection of generation reference documentation from source files 2015-11-24 16:36:34 +03:00
bugmaster
31dfc19fcb Copy env.bat file from adm/templates 2015-11-24 16:11:22 +03:00
abv
79104795a1 0026912: CLang 3.6.2 compiler warning [-Winconsistent-missing-override] 2015-11-23 14:58:23 +03:00
ibs
4d8eca1dce 0026911: Configuration, CMake - strips symbol information from the binary in release configuration if the compiler is a variant of gcc
add strip flag when the compiler is a variant of gcc
2015-11-23 14:48:20 +03:00
ibs
a082e7d07b 0026861: Configuration, CMake - enable -Wall warnings when using CLang
-Wall warning option added for CLang compiler
2015-11-23 13:40:49 +03:00
ibs
e713baee32 0026903: Configuration, CMake - 3rdparty search algorithms should have the same logic
the search algorithms fitted with one logic.

3rdparty_dir is not specified by-default
3rdparty_<name>_dir has higher priority than 3rdparty_dir

frameworks are considered on Mac OS;

CMake - continue method (cmake version >= 3.2) removed

vtk installation disabled

Mac OS X - link /usr/X11/lib if X11 library is linked

FILES parsing optimized

search X11 package for every time when it used on MAC

CSF_XwLibs used by a toolkit using Tk

break a package processing if all the files from FILES file have been processed
2015-11-23 13:40:43 +03:00
ibs
d94d80e529 0026865: Configuration, CMake - ensure consistency between FILES and actual content of inc and src folders
headers from inc folder are being checked for using in further building process
parse FILES file to collect header files for inc folder

during cleaning inc folder, do not remove the headers with name not containing their package name

FILES is parsed not only for headers files

Warning is emitted when a file in folder is not involved to corresponding FILES file
lex and yacc file added StepFile/FILES file

Small correction
2015-11-23 13:39:52 +03:00
ibs
fb3267c7b8 0026880: Configuration, CMake - platform dependent code is not generated
several misprints fixed (upper case, sorting of empty list, empty parent directory)

CMake should consider CSF_ variables from EXTERNLIB file for each toolkit

CSF_ variables are defined in occt_csf for each OS
redundant CSF removed

Conflicts:
src/TKG3d/CMakeLists.txt
2015-11-23 13:39:47 +03:00
ibs
d3ff0ff227 0026858: Configuration - cmake wrong detected TK folder
regex template for 3rdparty folder changed
the sensitive case of comparison of two folders fixed
2015-11-20 13:29:03 +03:00
abv
8fcb8c0700 0000670: Problem with the Print method.
Test for issue #670 corrected to avoid unpredictable behavior
2015-11-19 15:31:21 +03:00
rkv
95e05159d6 0026179: Coding rules - eliminate -Wdeprecated-declarations CLang warnings on tmpnam() usage
Make a temporary file using BuildTemporary() in "/tmp" folder on Linux or using "TEMP" environment variable on Windows.
Use the new OSD_File::Capture() method for standard output redirection.
2015-11-19 15:31:17 +03:00
emv
9b7f3f83c0 0025926: 3D offset in mode "Complete" with Join type "Intersection"
Extension for colliding cases (Limited to work on planar cases only).

Test cases for issue CR25926

Update of test-cases according to the new behavior
2015-11-19 15:27:42 +03:00
isk
b40693b0c2 0026890: Foundation Classes, TKernel - define OSD_OpenStream for std::ifstream 2015-11-19 15:25:19 +03:00
pdn
e71669c6e5 0026664: Triangulating a very small polygon fails
Parameter for adaptive computation of minimal 2D meshing precision added in BRepMesh_IncrementalMesh API.
Corresponding option -adaptive added in DRAW command

All meshing parameters are collected in structure, BRepMesh_FastDiscret::Parameters, which is now used to define and manipulate parameters of the algorithm.
2015-11-19 15:21:10 +03:00
azv
6b84c3f7db 0026252: GeomAdaptor_Surface should use inner adaptor to calculate values of complex surfaces
* Implement GeomEvaluator package
* Inject evaluators to GeomAdaptor_Surface to calculate values of complex surfaces
* Inject evaluators to Geom_Surface classes to calculate values for offset surfaces, surfaces of revolution and surfaces of extrusion
* Move Adaptor3d_SurfaceOfLinearExtrusion and Adaptor3d_SurfaceOfRevolution to GeomAdaptor and unify calculation of their values and derivatives
* Code optimizations
* Update test cases

Update of test-cases according to the new behavior
2015-11-19 14:50:54 +03:00
ibs
6e4dfbecee 0026869: Documentation - simplify "Building with CMake and ADT on Android" article
ADT using removed. GNU make using added

Small corrections of title and image in documentation.
2015-11-19 14:46:54 +03:00
ski
41ec04dbbd 0026247: Too huge binaries are produced for Android platform using MinGW
Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE and CMAKE_C_FLAGS_RELEASE to optimize size of binaries
2015-11-19 14:37:46 +03:00
abv
4525373bf3 0026872: Coding - pointless instantiations of local variables in BinTools
Instantiations of local stringstream variables used in error handling moved from upper function scope to places where they are actually needed
2015-11-19 14:33:29 +03:00
vpa
eece3af2e2 0026870: Visualization - deactivated selections are not updated after object's re-computation
- update status in SelectMgr_SelectionManager::RecomputeSelection:
  1) is set to full for all selections;
  2) is switched to none only if selection was actually recomputed;
- test case for issue #26870
2015-11-19 14:31:48 +03:00
isk
75c262a97a 0026790: Visualization, TKOpenGl - apply view resolution to the line width in OpenGl_Context::SetLineWidth()
Add ResolutionRatio() method in the Graphic3d_RenderingParams.
Add SetResolutionRatio() method in the OpenGl_Context.
2015-11-19 14:29:31 +03:00
ibs
ad77956498 0026867: Configuration - update any comparison including __cplusplus macro to remove one
__cplusplus >= 201103L replaced with __QNX__ macro
2015-11-19 14:27:06 +03:00
jgv
420f79f8bc 0026681: BRepPrimAPI_MakeRevol creates faulty shape
Correction according to remarks

More precise processing of non-SameParameter edges

Correction of mistake

Test cases for issue CR26681
2015-11-19 14:22:54 +03:00
kgv
d2eddacc8f 0026862: Configuration - avoid usage of 3rd-party headers within OpenGl_View and D3DHost_View
Move Font_FTFont::Rect structure into dedicated header Font_FTFont.
D3DHost_View, OpenGl_Font, Font_TextFormatter - use forward declarations.

Fix regressions after #0024776

OpenGl_View::IsInvalidated() - fix misprint.
D3DHost_View::Redraw() - assign myFBO before rendering.
D3DHost_FrameBuffer::Init() - fix always zero viewport.
2015-11-19 14:18:00 +03:00
ifv
2651bfde07 0024890: Result of uniform scaling is invalid
Test case for issue CR24890
2015-11-19 14:15:15 +03:00
nbv
ec7ed71c18 Current MASTER is not built if OCCT_DEBUG macros is enabled 2015-11-13 14:49:25 +03:00
bugmaster
d5f0e4adb9 Cosmetic correction 2015-11-12 14:43:38 +03:00
aba
1c078d3b39 0026056: AIS_LengthDimension can not build dimension for face-edge or edge-face
- Correct AIS_LengthDimension::InitEdgeFaceLength() method to support face-edge and edge-face cases
- Correct test command to support face-edge and edge-face input geomerty without custom plane
2015-11-12 13:03:13 +03:00
ifv
a144d7770f 0026857: Documentation for methods Geom_BSplineSurface::SetU(V)NotPeriodic is wrong 2015-11-12 11:26:52 +03:00
emv
b1682e23b2 0026855: Draw commands to debug Boolean Operations Algorithm
The commands to debug BOA.
These commands should serve only debug purposes and should not be used in tests.

Removing old implementation of the duplicated bopnews command.
2015-11-12 11:23:31 +03:00
isk
832ae82d0a 0026821: Visualization - define default Rendering Parameters for Interactive Context
Define default Rendering Parameters within V3d_Viewer.
New instances of V3d_View use default Rendering Parameters.
2015-11-12 11:18:05 +03:00
emv
338434c75a 0026798: Boolean operations: keep desired cells and boundaries in the result
The algorithm is based on the General Fuse algorithm (GFA). The result of
GFA is all split parts of the Arguments.

The purpose of this algorithm is to provide the result with the content of:
1. Cells (parts) defined by the user;
2. Internal boundaries defined by the user.

In other words the algorithm should provide the possibility for the user
to add or remove any part to (from) result and remove any internal boundaries
between parts.

Requirements for the Data:
All the requirements of GFA for the DATA are inherited in this algorithm.
Plus all the arguments should have the same dimension.

Results:
The result of the algorithm is compound containing selected parts of
the basic type (VERTEX, EDGE, FACE or SOLID). The default result
is empty compound. It is possible to add any split part to the result
by using the methods AddToRessult() and AddAllToResult().
It is also possible to remove any part from the result by using methods
RemoveFromResult() and RemoveAllFromResult().
The method RemoveAllFromResult() is also suitable for clearing the result.

To remove Internal boundaries it is necessary to set the same material to the
parts between which the boundaries should be removed and call the method
RemoveInternalBoundaries(). The material should not be equal to 0, as this is
default material value. The boundaries between parts with this value
will not be removed.
One part cannot be added with the different materials.
It is also possible to remove the boundaries during combining the result.
To do this it is necessary to set the material for parts (not equal to 0)
and set the flag bUpdate to TRUE.
BUT for the arguments of the types FACE or EDGE it is recommended
to remove the boundaries in the end when the result is completely built.
It will help to avoid self-intersections in the result.

It is possible to create typed Containers from the parts added to result by using
method MakeContainers(). The type of the containers will depend on the type of
the arguments: WIRES for EEDGE, SHELLS for FACES and COMPSOLIDS for SOLIDS.
The result will be compound containing containers.
Adding of the parts to such result will not update containers. The result
compound will contain the containers and new added parts (of basic type).
Removing of the parts from such result may affect some containers if the
the parts that should be removed is in container. In this case this container
will be rebuilt without that part.

History:
The algorithm supports history information. This information available through
the methods IsDeleted() and Modified(). In DRAW Test Harness it is available
through the same commands as for Boolean Operations (bmodified and bisdeleted).

Examples:
1. API
BOPAlgo_CellsBuilder aCBuilder;
BOPCol_ListOfShape aLS = ...; // arguments
/* parallel or single mode (the default value is FALSE)*/
Standard_Boolean bRunParallel = Standard_False;
/* fuzzy option (default value is 0)*/
Standard_Real aTol = 0.0;
//
aCBuilder.SetArguments(aLS);
aCBuilder.SetRunParallel(bRunParallel);
aCBuilder.SetFuzzyValue(aTol);
//
aCBuilder.Perform();
if (aCBuilder.ErrorStatus()) { // check error status
  return;
}
/* empty compound, as nothing has been added yet */
const TopoDS_Shape& aRes = aCBuilder.Shape();
/* all split parts */
const TopoDS_Shape& aRes = aCBuilder.GetAllParts();
//
BOPCol_ListOfShape aLSToTake = ...; // parts of these arguments will be taken into result
BOPCol_ListOfShape aLSToAvoid = ...; // parts of these arguments will not be taken into result
//
/* defines the material common for the cells, i.e.
   the boundaries between cells with the same material
   will be removed.
   By default it is set to 0. Thus, to remove some boundary
   the value of this variable should not be equal to 0 */
Standard_Integer iMaterial = ...;
/* defines whether to update the result right now or not */
Standard_Boolean bUpdate = ...;
// adding to result
aCBuilder.AddToResult(aLSToTake, aLSToAvoid, iMaterial, bUpdate);
aR = aCBuilder.Shape(); // the result
// removing of the boundaries
aCBuilder.RemoveInternalBoundaries();

// removing from result
aCBuilder.AddAllToResult();
aCBuilder.RemoveFromResult(aLSToTake, aLSToAvoid);
aR = aCBuilder.Shape(); // the result

2. DRAW Test Harness
psphere s1 15
psphere s2 15
psphere s3 15
ttranslate s1 0 0 10
ttranslate s2 20 0 10
ttranslate s3 10 0 0

bclearobjects; bcleartools
baddobjects s1 s2 s3
bfillds
# rx will contain all split parts
bcbuild rx
# add to result the part that is common for all three spheres
bcadd res s1 1 s2 1 s3 1 -m 1
# add to result the part that is common only for first and third shperes
bcadd res s1 1 s2 0 s3 1 -m 1
# remove internal boundaries
bcremoveint res

Added history support for Generated shapes (created in ShapeUpgrade_UnifySameDomain).

Methods AddToResult and RemoveFromResult have been documented in more details to clarify the procedure of adding and removing parts.

Adding external library to use ShapeUpgrade_UnifySameDomain.

Test-cases for issue #26798
2015-11-12 11:15:39 +03:00
azv
5201d3e66c 0026255: Adaptor3d_OffsetCurve is misleading
1. Rename Adaptor3d_OffsetCurve to Adaptor2d_OffsetCurve and relative classes
2. Remove redundant class Geom2dGcc_CurveToolGeo
2015-11-12 10:45:14 +03:00
afv
de6273a31f 0026603: Problem with maximization and normalization document windows in Qt samples with Qt 5.x 2015-11-12 10:13:17 +03:00
abv
f2139a7f0f 0026780: Coding rules - eliminate warnings on Linux and Mac
Fixed a few remaining warnings found by GCC, CLang, and VC++ 14 (recent changes)
2015-11-11 09:43:26 +03:00
abv
7dc2c1656a 0026854: Use -Wextra with GCC
Added option -Wextra for GCC compilation
2015-11-09 15:04:56 +03:00
abv
6fab2d4f64 0025078: Coding rules - eliminate GCC warning -Wclobbered
GCC warning -Wclobbered suppressed in Standard_ErrorHandler.hxx when OCC_CONVERT_SIGNALS or NO_CXX_EXCEPTIONS are used
2015-11-09 15:04:55 +03:00
abv
04e9307054 0026852: Coding - compiler warnings issued by GCC 5.2.1
Compiler warnings eliminated:
- BRepAlgo_DSAccess: avoid copying of local list
- IntPatch, IntTools: initialize "possibly used uninitialized" variables by zeros
- Intf: slight refactoring
- OSD_signal: suppress unused argument
- OpenGL: add missing initializers in structures
- STEPConstruct_GDTProperty: correct function signature to pass output parameters by reference
2015-11-09 15:04:54 +03:00
rkv
3d18f1e038 0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
TestTopOpeDraw_Displayer::GetTol(), GetPar() - pass assigned parameters by reference.
TopOpeBRep_vprdeg.cxx, TopOpeBRep_FacesFiller::ProcessVPondgE() - remove commented code, comment inactive code.
2015-11-09 15:04:53 +03:00
abv
5d88fd549c 0026850: Replace nested instantiations of TCollection generic classes by NCollection templates
Remaining instantiations of NCollection generics are converted to NCollection templates; unused and duplicates removed
2015-11-09 15:04:07 +03:00
abv
487bf1ceaa 0024567: Coding rules - eliminate GCC warning -Wignored-qualifiers
Redundant const qualifiers of return types of functions returning values are removed
2015-11-07 21:40:52 +03:00
abv
cda9a0d4c2 0026843: New warning during compilation OCCT on MacOS
Remove unused (and not implemented) methods in OSD package: IsDivisible(), GetExponent(), GetMantissa(), AvailableMemory()
2015-11-07 21:40:18 +03:00
rkv
d48df25df1 0026780: Coding rules - eliminate warnings on Linux and Mac
Avoid warnings by means of ifdef/ifndef or removing unused code.
2015-11-07 21:37:19 +03:00
abv
c9246067a1 0026178: Coding rules - eliminate -Wtautological-pointer-compare CLang warnings in Standard_ErrorHandler
Tautological comparisons removed; buffer initialized by zeros; LXX files merged to HXX; descriptions added
2015-11-06 07:54:57 +03:00
5579 changed files with 45931 additions and 35561 deletions

View File

@@ -34,7 +34,7 @@ project (OCCT)
# Solution folder property
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
set (INSTALL_OCCT_TEST_CASES OFF CACHE BOOL "${INSTALL_OCCT_TEST_CASES_DESCR}")
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
# check this variable and set if it's required
if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
@@ -48,7 +48,7 @@ if (OCCT_ALGO_EXTENDED_OUTPUT)
endif()
# copy samples to install directory
set (INSTALL_OCCT_SAMPLES OFF CACHE BOOL "${INSTALL_OCCT_SAMPLES_DESCR}")
set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}")
# install dir of the built project
set (INSTALL_DIR "" CACHE PATH "${INSTALL_DIR_DESCR}" )
@@ -86,6 +86,11 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
BUILD_MODULE (${OCCT_MODULE})
endforeach()
if (ANDROID AND BUILD_MODULE_Draw)
message (STATUS "Info. Draw module is turned off due to it is not supported on Android")
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
endif()
# Overview
set (BUILD_DOC_OcctOverview OFF CACHE BOOL "${BUILD_DOC_OcctOverview_DESCR}")
@@ -133,7 +138,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH)
list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
if (NOT "${CAN_REBUILD_PDC_FOR_TKMATH}" STREQUAL "-1" OR NOT "${CAN_REBUILD_PDC_FOR_STEPFILE}" STREQUAL "-1")
if (NOT ${CAN_REBUILD_PDC_FOR_TKMATH} EQUAL -1 OR NOT ${CAN_REBUILD_PDC_FOR_STEPFILE} EQUAL -1)
set (REBUILD_PLATFORM_DEPENDENT_CODE OFF CACHE BOOL "${REBUILD_PLATFORM_DEPENDENT_CODE_DESCR}")
else()
OCCT_CHECK_AND_UNSET (REBUILD_PLATFORM_DEPENDENT_CODE)
@@ -141,23 +146,13 @@ endif()
if (NOT DEFINED 3RDPARTY_DIR)
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
endif()
# search for 3rdparty dir
if ("${3RDPARTY_DIR}" STREQUAL "")
if (DEFINED ENV{3RDPARTY_DIR})
set (3RDPARTY_DIR "$ENV{3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/../")
# in version 6.7.0 and above, occt parent directory contains 3rdparties
get_filename_component (3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/../" ABSOLUTE)
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
endif()
get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
endif()
# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
if ("${USE_TCL}" STREQUAL ON)
if (USE_TCL)
message (STATUS "Info: TCL is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
@@ -174,7 +169,7 @@ endif()
# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
if ("${USE_FREETYPE}" STREQUAL ON)
if (USE_FREETYPE)
message (STATUS "Info: Freetype is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
else()
@@ -190,7 +185,7 @@ if (USE_VTK)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
OCCT_CHECK_AND_UNSET ("INSTALL_VTK")
#OCCT_CHECK_AND_UNSET ("INSTALL_VTK")
endif()
# D3D
@@ -368,19 +363,23 @@ if ("${INSTALL_DIR}" STREQUAL "")
message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}")
endif()
message (STATUS "\nInfo: Collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
# collect all the headers to <binary dir>/inc folder
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_DIR}")
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/samples")
if (INSTALL_OCCT_SAMPLES)
if (INSTALL_SAMPLES)
OCCT_INSTALL_FILE_OR_DIR ("samples" "${INSTALL_DIR}")
endif()
if (INSTALL_OCCT_TEST_CASES)
if (INSTALL_TEST_CASES)
OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_DIR}")
endif()
@@ -476,6 +475,9 @@ foreach(RESOURCE ${RESOURCES})
endif()
endforeach()
# define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# include patched toolkit projects or original ones
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}")

View File

@@ -67,6 +67,7 @@ n GeomLProp
n GeomLib
n GeomProjLib
n GeomTools
n GeomEvaluator
n Hermit
n IntAna
n IntAna2d
@@ -430,3 +431,4 @@ n IVtkTools
t TKIVtk
n IVtkDraw
t TKIVtkDraw
n Geom2dEvaluator

View File

@@ -1,113 +1,103 @@
#
##
if(3RDPARTY_MACRO_ALREADY_INCLUDED)
return()
endif()
set(3RDPARTY_MACRO_ALREADY_INCLUDED 1)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEBUG)
# define 3RDPARTY_${PRODUCT_NAME}_DIR variable is it isn't defined
if (NOT DEFINED INSTALL_${PRODUCT_NAME})
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "${INSTALL_${PRODUCT_NAME}_DESCR}")
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DIR)
set (3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME}")
endif()
# search for product directory inside 3RDPARTY_DIR directory
if (NOT 3RDPARTY_${PRODUCT_NAME}_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" "${PRODUCT_NAME}" ${PRODUCT_NAME}_DIR_NAME)
if (${PRODUCT_NAME}_DIR_NAME)
message (STATUS "Info: ${PRODUCT_NAME}: ${${PRODUCT_NAME}_DIR_NAME} folder is used")
set (3RDPARTY_${PRODUCT_NAME}_DIR "${3RDPARTY_DIR}/${${PRODUCT_NAME}_DIR_NAME}" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify product folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_${PRODUCT_NAME}_DIR PATH "The directory containing ${PRODUCT_NAME}")
if (NOT 3RDPARTY_${PRODUCT_NAME}_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" ${PRODUCT_NAME} ${PRODUCT_NAME}_DIR_NAME)
if (${PRODUCT_NAME}_DIR_NAME)
set (3RDPARTY_${PRODUCT_NAME}_DIR "${3RDPARTY_DIR}/${${PRODUCT_NAME}_DIR_NAME}" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
endif()
endif()
else()
#set (3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
endif()
if (NOT DEFINED INSTALL_${PRODUCT_NAME})
message (STATUS "${INSTALL_${PRODUCT_NAME}_DESCR}")
if (NOT "${INSTALL_${PRODUCT_NAME}_DESCR}" STREQUAL "")
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "${INSTALL_${PRODUCT_NAME}_DESCR}")
else()
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "Is ${PRODUCT_NAME} required to be copied into install directory")
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE PATH "the path of ${HEADER_NAME}")
endif()
# search for include directory
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing the headers of the ${PRODUCT_NAME}" FORCE)
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} PATHS
"${3RDPARTY_${PRODUCT_NAME}_DIR}/include"
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_HEADER}
NO_DEFAULT_PATH)
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME})
endif()
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing the headers of the ${PRODUCT_NAME}" FORCE)
endif()
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
elseif (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
get_filename_component(3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_TMP "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
if (NOT "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" STREQUAL "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_TMP}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
endif()
endif()
# search for library
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME} PATHS
"${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}"
"${3RDPARTY_${PRODUCT_NAME}_DIR}/lib"
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_LIB}
NO_DEFAULT_PATH)
# second search if previous one do not find anything
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME})
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} library" FORCE)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library")
endif()
# library path
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} library" FORCE)
endif()
# search for shared library (just for win case)
if (WIN32)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
endif()
endif()
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
elseif (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
get_filename_component(3RDPARTY_${PRODUCT_NAME}_DLL_DIR_TMP "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
if (NOT "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" STREQUAL "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_TMP}")
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
if (WIN32)
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library")
endif()
endif()
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_${PRODUCT_NAME}_DIR
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR PATH "the path to ${PRODUCT_NAME}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY FILEPATH "the path to ${PRODUCT_NAME} library")
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR PATH "The directory containing ${PRODUCT_NAME} library")
endif()
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL FILEPATH "the path to ${PRODUCT_NAME} shared library")
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR PATH "The directory containing ${PRODUCT_NAME} shared library")
endif()
endif()
endif()
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
# header
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME}" PATHS
"${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}"
"${3RDPARTY_${PRODUCT_NAME}_DIR}/bin"
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_DLL}
NO_DEFAULT_PATH)
# set 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "the path to ${HEADER_NAME}" FORCE)
# second search if previous one do not find anything
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME}")
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
endif()
# shared library path
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATHS ${3RDPARTY_${PRODUCT_NAME}_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
@@ -115,16 +105,79 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The path to ${HEADER_NAME}" FORCE)
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
# library
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
set (${PRODUCT_NAME}_PATH_SUFFIXES lib)
if (ANDROID)
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} libs/${ANDROID_ABI})
endif()
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY NAMES ${LIBRARY_NAME}
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
endif()
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
endif()
# shared library
if (WIN32)
if (3RDPARTY_${PRODUCT_NAME}_DLL OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
# set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} shared library" FORCE)
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
find_library (3RDPARTY_${PRODUCT_NAME}_DLL NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES bin
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${PRODUCT_NAME}_DLL NAMES ${LIBRARY_NAME} PATH_SUFFIXES bin)
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
endif()
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)

View File

@@ -9,7 +9,7 @@ endif()
# BISON_EXECUTABLE is required by BISON_TARGET macro and should be defined
set (BISON_EXECUTABLE "${3RDPARTY_BISON_EXECUTABLE}" CACHE FILEPATH "path to the bison executable" FORCE)
find_package (Bison)
find_package (BISON)
if (BISON_FOUND)
set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)

View File

@@ -8,29 +8,27 @@ if (NOT DEFINED 3RDPARTY_FREETYPE_DIR)
set (3RDPARTY_FREETYPE_DIR "" CACHE PATH "The directory containing freetype")
endif()
# store ENV{FREETYPE_DIR}
SET (CACHED_FREETYPE_DIR $ENV{FREETYPE_DIR})
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
if (NOT ENV{FREETYPE_DIR})
# search for freetype in user defined directory
if (NOT 3RDPARTY_FREETYPE_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" FREETYPE FREETYPE_DIR_NAME)
# specify freetype folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_FREETYPE_DIR PATH "The directory containing freetype")
if (NOT 3RDPARTY_FREETYPE_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" FREETYPE FREETYPE_DIR_NAME)
if (FREETYPE_DIR_NAME)
set (3RDPARTY_FREETYPE_DIR "${3RDPARTY_DIR}/${FREETYPE_DIR_NAME}" CACHE PATH "The directory containing freetype" FORCE)
endif()
endif()
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
endif()
else()
#set (3RDPARTY_FREETYPE_DIR "" CACHE PATH "The directory containing freetype" FORCE)
endif()
# define required freetype variables
if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "" CACHE FILEPATH "the path of ft2build.h")
endif()
@@ -39,173 +37,257 @@ if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "" CACHE FILEPATH "the path of freetype2")
endif()
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY OR NOT 3RDPARTY_FREETYPE_LIBRARY_DIR)
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library")
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY OR NOT 3RDPARTY_FREETYPE_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY_DIR)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE FILEPATH "The directory containing freetype library")
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library")
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL OR NOT 3RDPARTY_FREETYPE_DLL_DIR)
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library")
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL OR NOT 3RDPARTY_FREETYPE_DLL_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
endif()
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL_DIR)
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE FILEPATH "The directory containing freetype shared library")
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE PATH "The directory containing freetype shared library")
endif()
endif()
find_package(Freetype)
# check 3RDPARTY_FREETYPE_ paths for consistency with specified 3RDPARTY_FREETYPE_DIR
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build FILEPATH "the path to ft2build.h")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "the path to ftheader.h")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_LIBRARY FILEPATH "the path to freetype library")
# ft2build header
if (FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${FREETYPE_INCLUDE_DIR_ft2build}")
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "${FREETYPE_INCLUDE_DIR_ft2build}" CACHE FILEPATH "the path of ft2build.h" FORCE)
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_LIBRARY_DIR PATH "The directory containing freetype library")
endif()
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_DLL FILEPATH "the path to freetype shared library")
if (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
get_filename_component (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL}" PATH)
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE PATH "The directory containing freetype shared library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_DLL_DIR PATH "The directory containing freetype shared library")
endif()
endif()
endif()
if (NOT FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
# cmake (version is < 3.0) doesn't find ftheader.h of freetype (version is >= 2.5.1)
# do search taking into account freetype structure of 2.5.1 version
find_path (FREETYPE_INCLUDE_DIR_freetype2 NAMES
freetype/config/ftheader.h
config/ftheader.h
HINTS
ENV FREETYPE_DIR
PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
PATH_SUFFIXES include/freetype2 include freetype2
NO_DEFAULT_PATH)
find_path (FREETYPE_INCLUDE_DIR_freetype2 NAMES freetype/config/ftheader.h config/ftheader.h)
elseif (FREETYPE_INCLUDE_DIR_freetype2 OR EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
# the FIRST step in search for freetype library and header folders (built-in search engine)
# execute built-in search engine to seek freetype
set (IS_BUILTIN_SEARCH_REQUIRED OFF)
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
set (IS_BUILTIN_SEARCH_REQUIRED ON)
elseif (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
set (IS_BUILTIN_SEARCH_REQUIRED ON)
elseif (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
set (IS_BUILTIN_SEARCH_REQUIRED ON)
#elseif (WIN32)
#if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
# set (IS_BUILTIN_SEARCH_REQUIRED ON)
#endif()
endif()
if (IS_BUILTIN_SEARCH_REQUIRED)
# use 3RDPARTY_FREETYPE_DIR if it is specified for freetype search
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
get_filename_component (3RDPARTY_FREETYPE_DIR_ABS "${3RDPARTY_FREETYPE_DIR}" ABSOLUTE)
get_filename_component (FREETYPE_INCLUDE_DIR_freetype2_ABS "${FREETYPE_INCLUDE_DIR_freetype2}" ABSOLUTE)
set (CACHED_FREETYPE_DIR $ENV{FREETYPE_DIR})
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
endif()
string (REGEX MATCH "${3RDPARTY_FREETYPE_DIR_ABS}" DOES_PATH_CONTAIN "${FREETYPE_INCLUDE_DIR_freetype2_ABS}")
find_package(Freetype)
if (NOT DOES_PATH_CONTAIN) # if cmake found freetype2 at different place from 3RDPARTY_FREETYPE_DIR
# search for freetype2 in 3RDPARTY_FREETYPE_DIR and if it will be found - replace freetyp2 path by new one
set (TMP_FREETYPE2 "TMP_FREETYPE2-NOTFOUND" CACHE FILEPATH "" FORCE)
find_path (TMP_FREETYPE2 NAMES freetype/config/ftheader.h config/ftheader.h
PATHS "${3RDPARTY_FREETYPE_DIR}"
PATH_SUFFIXES include/freetype2 include freetype2
NO_DEFAULT_PATH)
# restore ENV{FREETYPE_DIR}
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
set (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
endif()
if (TMP_FREETYPE2 OR NOT EXISTS "${TMP_FREETYPE2}")
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${TMP_FREETYPE2}" CACHE FILEPATH "the path of freetype2" FORCE)
# check the found paths for consistency with specified 3RDPARTY_FREETYPE_DIR
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_ft2build FILEPATH "the path to ft2build.h")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "the path to ftheader.h")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY FILEPATH "freetype library")
endif()
# hide and remove TMP_FREETYPE2
mark_as_advanced (TMP_FREETYPE2)
unset (TMP_FREETYPE2)
endif()
# assign the found paths to corresponding 3RDPARTY_FREETYPE_ variables
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
if (FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${FREETYPE_INCLUDE_DIR_ft2build}")
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "${FREETYPE_INCLUDE_DIR_ft2build}" CACHE FILEPATH "the path to ft2build.h" FORCE)
endif()
endif()
endif()
# return ENV{FREETYPE_DIR}
SET (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
# freetype2 header
if (FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${FREETYPE_INCLUDE_DIR_freetype2}" CACHE FILEPATH "the path of freetype2" FORCE)
endif()
endif()
if (NOT 3RDPARTY_FREETYPE_LIBRARY_DIR)
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
elseif (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_DIR_TMP "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
if (NOT "${3RDPARTY_FREETYPE_LIBRARY_DIR}" STREQUAL "${3RDPARTY_FREETYPE_LIBRARY_DIR_TMP}")
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
endif()
endif()
if (WIN32)
if (NOT 3RDPARTY_FREETYPE_DLL_DIR)
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
elseif (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
get_filename_component(3RDPARTY_FREETYPE_DLL_DIR_TMP "${3RDPARTY_FREETYPE_DLL}" PATH)
if (NOT "${3RDPARTY_FREETYPE_DLL_DIR}" STREQUAL "${3RDPARTY_FREETYPE_DLL_DIR_TMP}")
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
if (FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${FREETYPE_INCLUDE_DIR_freetype2}" CACHE FILEPATH "the path to ftheader.h" FORCE)
endif()
endif()
endif()
# freetype library
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
if (NOT 3RDPARTY_FREETYPE_LIBRARY)
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "freetype library" FORCE)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "The path to freetype library" FORCE)
endif()
endif()
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE FILEPATH "The directory containing freetype library" FORCE)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
else()
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library" FORCE)
endif()
endif()
# the SECOND step in search for freetype library and header folders (additional search algorithms)
# ft2build.h
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
set (FT2BUILD_NAMES ft2build.h config/ft2build.h freetype/config/ft2build.h)
# set 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build-NOTFOUND" CACHE FILEPATH "the path to ft2build.h" FORCE)
# cmake (version < 3.0) doesn't find ft2build.h of freetype (version is >= 2.5.1)
# do search taking into account freetype structure of 2.5.1 version
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build NAMES ${FT2BUILD_NAMES}
PATHS ${3RDPARTY_FREETYPE_DIR}
PATH_SUFFIXES include freetype2 include/freetype2
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build NAMES ${FT2BUILD_NAMES}
PATHS /usr/X11R6 /usr/local/X11R6 /usr/local/X11 /usr/freeware
PATH_SUFFIXES include/freetype2 include freetype2
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "" CACHE FILEPATH "the path to ft2build.h" FORCE)
endif()
# ftheader.h
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
set (FTHEADER_NAMES ftheader.h config/ftheader.h freetype/config/ftheader.h)
# set 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2-NOTFOUND" CACHE FILEPATH "the path to ftheader.h" FORCE)
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 NAMES ${FTHEADER_NAMES}
HINTS ${3RDPARTY_FREETYPE_DIR}
PATH_SUFFIXES include/freetype2 include freetype2
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 NAMES ${FTHEADER_NAMES}
PATHS /usr/X11R6 /usr/local/X11R6 /usr/local/X11 /usr/freeware
PATH_SUFFIXES include/freetype2 include freetype2
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "" CACHE FILEPATH "the path to ftheader.h" FORCE)
endif()
# freetype library
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
set (FREETYPE_PATH_SUFFIXES lib)
if (ANDROID)
set (FREETYPE_PATH_SUFFIXES ${FREETYPE_PATH_SUFFIXES} libs/${ANDROID_ABI})
endif()
if (WIN32)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
# set 3RDPARTY_FREETYPE_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_LIBRARY
set (3RDPARTY_FREETYPE_LIBRARY "3RDPARTY_FREETYPE_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to freetype library" FORCE)
if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
get_filename_component (FREETYPE_LIBRARY_PARENT_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" PATH) # parent of the library directory
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
find_library (3RDPARTY_FREETYPE_LIBRARY freetype
PATHS "${3RDPARTY_FREETYPE_LIBRARY_DIR}" "${3RDPARTY_FREETYPE_DIR}"
PATH_SUFFIXES ${FREETYPE_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_FREETYPE_LIBRARY freetype
PATH_SUFFIXES ${FREETYPE_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
set (3RDPARTY_FREETYPE_DLL "3RDPARTY_FREETYPE_DLL-NOTFOUND" CACHE FILEPATH "freetype shared library" FORCE)
find_library (3RDPARTY_FREETYPE_DLL freetype PATHS "${FREETYPE_LIBRARY_PARENT_DIR}/bin" NO_DEFAULT_PATH)
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
else()
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library" FORCE)
endif()
endif()
if (3RDPARTY_FREETYPE_LIBRARY_DIR AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_LIBRARY_DIR)
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "The path to freetype library" FORCE)
endif()
# freetype shared library
if (WIN32)
if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
# set 3RDPARTY_FREETYPE_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_DLL
set (3RDPARTY_FREETYPE_DLL "3RDPARTY_FREETYPE_DLL-NOTFOUND" CACHE FILEPATH "The path to freetype shared library" FORCE)
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
find_library (3RDPARTY_FREETYPE_DLL freetype
PATHS "${3RDPARTY_FREETYPE_DIR}"
PATH_SUFFIXES bin
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_FREETYPE_DLL freetype
PATH_SUFFIXES bin)
endif()
if (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
get_filename_component (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL}" PATH)
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE FILEPATH "The directory containing freetype shared library" FORCE)
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
else()
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE PATH "The directory containing freetype shared library" FORCE)
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
endif()
endif()
endif()
if (NOT 3RDPARTY_FREETYPE_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE FILEPATH "The directory containing freetype library" FORCE)
endif()
if (WIN32)
if (NOT 3RDPARTY_FREETYPE_DLL_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE FILEPATH "The directory containing shared freetype library" FORCE)
endif()
endif()
# include found paths to common variables
if (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
endif()
if (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
endif()
if (3RDPARTY_FREETYPE_LIBRARY)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_LIBRARY_DIR)
endif()
if (WIN32)
if (3RDPARTY_FREETYPE_DLL OR EXISTS "${3RDPARTY_FREETYPE_DLL}")
if (3RDPARTY_FREETYPE_DLL_DIR OR EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_FREETYPE_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_DLL_DIR)
endif()
endif()
# install instructions
if (INSTALL_FREETYPE)
OCCT_MAKE_OS_WITH_BITNESS()
@@ -220,21 +302,21 @@ if (INSTALL_FREETYPE)
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
else()
get_filename_component(ABS_PATH ${3RDPARTY_FREETYPE_LIBRARY} REALPATH)
get_filename_component(FREETYPELIB ${3RDPARTY_FREETYPE_LIBRARY} NAME)
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_ABS ${3RDPARTY_FREETYPE_LIBRARY} REALPATH)
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_NAME ${3RDPARTY_FREETYPE_LIBRARY} NAME)
install (FILES "${ABS_PATH}"
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
RENAME ${FREETYPELIB}.6)
install (FILES "${ABS_PATH}"
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
RENAME ${FREETYPELIB}.6)
install (FILES "${ABS_PATH}"
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
RENAME ${FREETYPELIB}.6)
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
endif()
set (USED_3RDPARTY_FREETYPE_DIR "")
@@ -252,4 +334,4 @@ OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)

122
adm/cmake/occt_csf.cmake Normal file
View File

@@ -0,0 +1,122 @@
# CSF variables definition
if(CSFS_ALREADY_INCLUDED)
return()
endif()
set(CSFS_ALREADY_INCLUDED 1)
if (NOT DEFINED USE_TCL)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
endif()
if (USE_TCL)
if ("${3RDPARTY_TCL_LIBRARY_VERSION}" STREQUAL "")
message (STATUS "Warning. TCL version has not been specified by CSF_TclLibs defining thus it will be used as 8.6")
set (3RDPARTY_TCL_LIBRARY_VERSION "8.6")
endif()
if ("${3RDPARTY_TK_LIBRARY_VERSION}" STREQUAL "")
message (STATUS "Warning. TK version has not been specified by CSF_TclTkLibs defining thus it will be used as 8.6")
set (3RDPARTY_TK_LIBRARY_VERSION "8.6")
endif()
endif()
if (USE_VTK AND NOT 3RDPARTY_VTK_REQUIRED_LIBRARIES)
message (WARNING "CSF_VTK specification: VTK libraries are not defined")
endif()
if (USE_TBB)
set (CSF_TBB "tbb tbbmalloc")
else()
set (CSF_TBB)
endif()
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")
set (CSF_user32 "user32.lib")
set (CSF_wsock32 "wsock32.lib")
set (CSF_AviLibs "ws2_32.lib vfw32.lib")
set (CSF_OpenGlLibs "opengl32.lib glu32.lib")
if (USE_TCL)
set (CSF_TclLibs "tcl${3RDPARTY_TCL_LIBRARY_VERSION}.lib")
set (CSF_TclTkLibs "tk${3RDPARTY_TK_LIBRARY_VERSION}.lib")
endif()
if (USE_VTK)
set (CSF_VTK "${3RDPARTY_VTK_REQUIRED_LIBRARIES}")
else()
set (CSF_VTK)
endif()
else()
if (APPLE)
set (CSF_objc "objc")
# frameworks
find_library (Appkit_LIB NAMES Appkit)
set (CSF_Appkit ${Appkit_LIB})
find_library (IOKit_LIB NAMES IOKit)
set (CSF_IOKit ${IOKit_LIB})
OCCT_CHECK_AND_UNSET (Appkit_LIB)
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (USE_GLX)
set (CSF_OpenGlLibs GL)
set (CSF_XwLibs "X11 Xext Xmu Xi")
else()
find_library (OpenGlLibs_LIB NAMES OpenGL)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
if (USE_TCL)
set (CSF_TclTkLibs Tk)
set (CSF_TclLibs Tcl)
endif()
elseif (ANDROID)
set (CSF_ThreadLibs "c")
set (CSF_OpenGlLibs "EGL GLESv2")
elseif (UNIX)
set (CSF_ThreadLibs "pthread rt")
set (CSF_OpenGlLibs "GLU GL")
set (CSF_XwLibs "X11 Xext Xmu Xi")
if (USE_TCL)
set (CSF_TclLibs "tcl${3RDPARTY_TCL_LIBRARY_VERSION}")
set (CSF_TclTkLibs "tk${3RDPARTY_TK_LIBRARY_VERSION}")
endif()
endif()
if (USE_FREETYPE)
set (CSF_FREETYPE "freetype")
else()
set (CSF_FREETYPE)
endif()
if (USE_FREEIMAGE)
set (CSF_FreeImagePlus "freeimage")
else()
set (CSF_FreeImagePlus)
endif()
if (NOT DEFINED ANDROID)
if (USE_GL2PS)
set (CSF_GL2PS "gl2ps")
else()
set (CSF_GL2PS)
endif()
endif()
if (USE_VTK)
set (CSF_VTK "${3RDPARTY_VTK_REQUIRED_LIBRARIES}")
else()
set (CSF_VTK)
endif()
endif()

View File

@@ -1,3 +1,10 @@
##
if(FLAGS_ALREADY_INCLUDED)
return()
endif()
set(FLAGS_ALREADY_INCLUDED 1)
if (MSVC)
add_definitions(/fp:precise)
@@ -75,20 +82,26 @@ endif()
# generate a single response file which enlist all of the object files
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
# increase compiler warnings level (-W4 for MSVC, -Wall for GCC)
# increase compiler warnings level (-W4 for MSVC, -Wextra for GCC)
if (MSVC)
if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif()
if (DEFINED CMAKE_COMPILER_IS_GNUCXX OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
endif()
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")

View File

@@ -1,4 +1,11 @@
#
##
if(OCCT_MACROS_ALREADY_INCLUDED)
return()
endif()
set(OCCT_MACROS_ALREADY_INCLUDED 1)
macro (OCCT_CHECK_AND_UNSET VARNAME)
if (DEFINED ${VARNAME})
unset (${VARNAME} CACHE)
@@ -91,15 +98,14 @@ function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
foreach (ORIGIN_FILE ${ORIGIN_FILES})
# check for existence of patched version of current file
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}")
if (NOT APPLY_OCCT_PATCH_DIR OR NOT EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
else()
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
if (EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
continue()
if (NOT EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
endif()
endif()
# append origin version if patched one is not found
list (APPEND FOUND_FILES ${ORIGIN_FILE})
endforeach()
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
@@ -111,16 +117,11 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
string (TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME)
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}")
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
@@ -140,9 +141,7 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
endforeach()
if (LOCAL_RESULT)
list (LENGTH "${LOCAL_RESULT}" LOC_LEN)
math (EXPR LAST_ELEMENT_INDEX "${LOC_LEN}-1")
list (GET LOCAL_RESULT ${LAST_ELEMENT_INDEX} DUMMY)
list (GET LOCAL_RESULT -1 DUMMY)
set (${RESULT} ${DUMMY} PARENT_SCOPE)
endif()
endfunction()
@@ -178,7 +177,7 @@ macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME
endmacro()
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS)
set (OCCT_SOURCE_DIRS)
set (OCCT_USED_PACKAGES)
# consider patched header.in template
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
@@ -189,43 +188,124 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
set (ROOT_OCCT_DIR ${CMAKE_SOURCE_DIR})
foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
# append parent folder
list (APPEND OCCT_SOURCE_DIRS ${OCCT_USED_TOOLKIT})
# append all required package folders
set (OCCT_USED_TOOLKIT_DEPS)
set (OCCT_TOOLKIT_PACKAGES)
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_USED_TOOLKIT_DEPS)
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_USED_TOOLKIT_DEPS)
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
endif()
foreach (OCCT_USED_TOOLKIT_DEP ${OCCT_USED_TOOLKIT_DEPS})
list (APPEND OCCT_SOURCE_DIRS ${OCCT_USED_TOOLKIT_DEP})
endforeach()
list (APPEND OCCT_USED_PACKAGES ${OCCT_TOOLKIT_PACKAGES})
endforeach()
foreach (OCCT_SOURCE_DIR ${OCCT_SOURCE_DIRS})
# get all header files from each src folder
file (GLOB OCCT_HEADER_FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_SOURCE_DIR}/*.[hgl]xx" "${CMAKE_SOURCE_DIR}/src/${OCCT_SOURCE_DIR}/*.h")
install (FILES ${OCCT_HEADER_FILES} DESTINATION "${INSTALL_DIR}/inc")
list (REMOVE_DUPLICATES OCCT_USED_PACKAGES)
# create new file including found header
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
endforeach()
set (OCCT_HEADER_FILES_COMPLETE)
set (OCCT_HEADER_FILE_NAMES_NOT_IN_FILES)
set (OCCT_HEADER_FILE_WITH_PROPER_NAMES)
# consider pathed the source files
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_SOURCE_DIR}")
file (GLOB PATCHED_OCCT_HEADER_FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_SOURCE_DIR}/*.[hgl]xx" "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_SOURCE_DIR}/*.h")
install (FILES ${PATCHED_OCCT_HEADER_FILES} DESTINATION "${INSTALL_DIR}/inc")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info. \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
# create new patched file including found header
foreach (OCCT_HEADER_FILE ${PATCHED_OCCT_HEADER_FILES})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
if (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
# emit warnings if there is unprocessed headers
file (GLOB OCCT_ALL_FILES_IN_DIR "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/*.*")
foreach (OCCT_FILE_IN_DIR ${OCCT_ALL_FILES_IN_DIR})
get_filename_component (OCCT_FILE_IN_DIR_NAME ${OCCT_FILE_IN_DIR} NAME)
set (OCCT_FILE_IN_DIR_STATUS OFF)
if (${ALL_FILES_NB} LESS 0)
break()
endif()
foreach (FILE_INDEX RANGE ${ALL_FILES_NB})
list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME)
if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}")
set (OCCT_FILE_IN_DIR_STATUS ON)
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
# collect header files with name that does not contain its package one
string (FIND "${OCCT_FILE_NAME}" "${OCCT_PACKAGE}_" FOUND_INDEX)
if (NOT ${FOUND_INDEX} EQUAL 0)
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
endif()
endif()
# remove found element from list
list (REMOVE_AT OCCT_ALL_FILE_NAMES ${FILE_INDEX})
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" ) # decrement number
break()
endif()
endforeach()
if (NOT OCCT_FILE_IN_DIR_STATUS)
message (STATUS "Warning. ${OCCT_FILE_IN_DIR} is not involved into ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${OCCT_FILE_NAME})
endif()
endif()
endforeach()
else()
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}")
endif()
endforeach()
# create new file including found header
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info. \(${CURRENT_TIME}\) Create header-links in inc folder...")
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
endforeach()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/inc")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info. \(${CURRENT_TIME}\) Checking headers in inc folder...")
file (GLOB OCCT_HEADER_FILES_OLD "${ROOT_TARGET_OCCT_DIR}/inc/*")
foreach (OCCT_HEADER_FILE_OLD ${OCCT_HEADER_FILES_OLD})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE_OLD} NAME)
string (REGEX MATCH "^[a-zA-Z0-9]+" PACKAGE_NAME "${HEADER_FILE_NAME}")
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not presented in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
else()
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is presented in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()
else()
set (IS_HEADER_FOUND -1)
if (NOT "${OCCT_HEADER_FILE_WITH_PROPER_NAMES}" STREQUAL "")
list (FIND OCCT_HEADER_FILE_WITH_PROPER_NAMES ${HEADER_FILE_NAME} IS_HEADER_FOUND)
endif()
if (${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. \(${PACKAGE_NAME}\) ${OCCT_HEADER_FILE_OLD} is not used and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()
endforeach()
endmacro()
@@ -401,3 +481,22 @@ function (OCCT_VERSION OCCT_VERSION_VAR)
set (${OCCT_VERSION_VAR} "${OCCT_VERSION_LOCALVAR}" PARENT_SCOPE)
endfunction()
macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH)
set (THE_ROOT_PATH "${${THE_ROOT_PATH_NAME}}")
set (THE_BEING_CHECKED_PATH "${${THE_BEING_CHECKED_PATH_NAME}}")
if (THE_BEING_CHECKED_PATH OR EXISTS "${THE_BEING_CHECKED_PATH}")
get_filename_component (THE_ROOT_PATH_ABS "${THE_ROOT_PATH}" ABSOLUTE)
get_filename_component (THE_BEING_CHECKED_PATH_ABS "${THE_BEING_CHECKED_PATH}" ABSOLUTE)
string (REGEX MATCH "${THE_ROOT_PATH_ABS}" DOES_PATH_CONTAIN "${THE_BEING_CHECKED_PATH_ABS}")
if (NOT DOES_PATH_CONTAIN) # if cmake found the being checked path at different place from THE_ROOT_PATH_ABS
set (${THE_BEING_CHECKED_PATH_NAME} "" CACHE ${THE_VAR_TYPE} "${THE_MESSAGE_OF_BEING_CHECKED_PATH}" FORCE)
endif()
else()
set (${THE_BEING_CHECKED_PATH_NAME} "" CACHE ${THE_VAR_TYPE} "${THE_MESSAGE_OF_BEING_CHECKED_PATH}" FORCE)
endif()
endmacro()

View File

@@ -1,163 +1,204 @@
# script for each OCCT toolkit
# parce PACKAGES file
if ("${PROJECT_NAME}" STREQUAL DRAWEXE)
set (USED_PACKAGES DRAWEXE)
else()
FILE_TO_LIST ("src/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
endif()
set (PRECOMPILED_DEFS)
# Get all used packages from toolkit
foreach (OCCT_PACKAGE ${TOOLKIT_MODULES})
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE}_DLL")
endif()
# ${OCCT_SOURCE_DIR}/src/${OCCT_PACKAGE}
set (SOURCE_FILES)
set (HEADER_FILES)
# Generate Flex and Bison files
if (${REBUILD_PLATFORM_DEPENDENT_CODE})
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
list (SORT SOURCE_FILES_FLEX)
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
list (SORT SOURCE_FILES_BISON)
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.c)
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.c)
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMP_DIR}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMP_DIR}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME}")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
endif()
endforeach()
endif()
endif()
# header files
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
else()
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
endif()
foreach (OCCT_PACKAGE ${USED_PACKAGES})
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
if(APPLE)
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
# TKService contains platform-dependent packages: Xw and WNT
if ((WIN32 AND "${OCCT_PACKAGE}" STREQUAL "Xw") OR (NOT WIN32 AND "${OCCT_PACKAGE}" STREQUAL "WNT"))
# do nothing
else()
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE}_DLL")
endif()
set (SOURCE_FILES)
set (HEADER_FILES)
# Generate Flex and Bison files
if (${REBUILD_PLATFORM_DEPENDENT_CODE})
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.c)
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.c)
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME}")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
endif()
endforeach()
endif()
endif()
# header files
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
else()
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
endif()
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
if(APPLE)
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
endif()
foreach(HEADER_FILE ${HEADER_FILES})
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
list (APPEND USED_INCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
else()
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
endif()
endforeach()
foreach(SOURCE_FILE ${SOURCE_FILES})
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
list (APPEND USED_SRCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
else()
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
endif()
endforeach()
endif()
foreach(HEADER_FILE ${HEADER_FILES})
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
list (APPEND USED_INCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
else()
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
endif()
endforeach()
foreach(SOURCE_FILE ${SOURCE_FILES})
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
list (APPEND USED_SRCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
else()
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
endif()
endforeach()
endforeach()
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
# Get from toolkits EXTERNLIB all used libs
OCCT_TOOLKIT_DEP (${PROJECT_NAME} ${PROJECT_NAME}_DEPS)
foreach (PROJECT_DEP ${${PROJECT_NAME}_DEPS})
IS_OCCT_TOOLKIT (${PROJECT_DEP} OCCT_MODULES FOUND_TOOLKIT)
if ("${FOUND_TOOLKIT}" STREQUAL "ON")
list (APPEND USED_LIBS "${PROJECT_DEP}")
if ("${PROJECT_NAME}" STREQUAL "DRAWEXE")
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Release
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS RelWithDebInfo
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini"
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Debug
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind"
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
if (MSVC)
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
endif()
endif()
set (CURRENT_MODULE)
foreach (OCCT_MODULE ${OCCT_MODULES})
list (FIND ${OCCT_MODULE}_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
set (CURRENT_MODULE ${OCCT_MODULE})
endif()
endforeach()
# Create project for toolkit
list (FIND BUILD_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
if ("${BUILD_TOOLKITS}" STREQUAL "" OR NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
if (CURRENT_MODULE)
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}")
endif()
foreach (OCCT_MODULE ${OCCT_MODULES})
list (FIND ${OCCT_MODULE}_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
set (CURRENT_MODULE ${OCCT_MODULE})
endif()
endforeach()
if ("${PROJECT_NAME}" STREQUAL "DRAWEXE")
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
# parce EXTERNLIB file
FILE_TO_LIST ("src/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
if (NOT "${TK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Release
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS RelWithDebInfo
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini"
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
install (TARGETS ${PROJECT_NAME}
CONFIGURATIONS Debug
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind"
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
if (MSVC)
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
if ("${CSF_FOUND}" STREQUAL "")
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "${CURRENT_CSF}" STREQUAL "")
# prepare a list from a string with whitespaces
separate_arguments (CURRENT_CSF)
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
endif()
endif()
endif()
endforeach()
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}")
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
target_link_libraries (${PROJECT_NAME} ${USED_LIBS})
endif()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)
find_package (X11 COMPONENTS X11 Xext Xmu Xi)
if (NOT X11_FOUND)
message (STATUS "Warning. X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
endif()
endif()
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})

View File

@@ -9,55 +9,6 @@ if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
endif()
# tbb include directory
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of the tbb")
endif()
# tbb library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TBB_LIBRARY OR NOT 3RDPARTY_TBB_LIBRARY_DIR)
set (3RDPARTY_TBB_LIBRARY "" CACHE FILEPATH "tbb library" FORCE)
endif()
# tbb library directory
if (NOT DEFINED 3RDPARTY_TBB_LIBRARY_DIR)
set (3RDPARTY_TBB_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tbb library")
endif()
# tbb malloc library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TBBMALLOC_LIBRARY OR NOT 3RDPARTY_TBBMALLOC_LIBRARY_DIR)
set (3RDPARTY_TBBMALLOC_LIBRARY "" CACHE FILEPATH "tbb malloc library" FORCE)
endif()
# tbb malloc library directory
if (NOT DEFINED 3RDPARTY_TBBMALLOC_LIBRARY_DIR)
set (3RDPARTY_TBBMALLOC_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tbb malloc library")
endif()
# tbb shared library (with absolute path)
if (WIN32)
if (NOT DEFINED 3RDPARTY_TBB_DLL OR NOT 3RDPARTY_TBB_DLL_DIR)
set (3RDPARTY_TBB_DLL "" CACHE FILEPATH "tbb shared library" FORCE)
endif()
endif()
# tbb shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TBB_DLL_DIR)
set (3RDPARTY_TBB_DLL_DIR "" CACHE FILEPATH "The directory containing tbb shared library")
endif()
# tbb malloc shared library (with absolute path)
if (WIN32)
if (NOT DEFINED 3RDPARTY_TBBMALLOC_DLL OR NOT 3RDPARTY_TBBMALLOC_DLL_DIR)
set (3RDPARTY_TBBMALLOC_DLL "" CACHE FILEPATH "tbb malloc shared library" FORCE)
endif()
endif()
# tbb malloc shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TBBMALLOC_DLL_DIR)
set (3RDPARTY_TBBMALLOC_DLL_DIR "" CACHE FILEPATH "The directory containing tbb malloc shared library")
endif()
if (MSVC)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
@@ -66,184 +17,260 @@ endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# search for product directory inside 3RDPARTY_DIR directory
if (NOT 3RDPARTY_TBB_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" "TBB" TBB_DIR_NAME)
if (TBB_DIR_NAME)
message (STATUS "Info: TBB: ${TBB_DIR_NAME} folder is used")
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
# specify TBB folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_TBB_DIR PATH "The directory containing tbb")
if (NOT 3RDPARTY_TBB_DIR OR NOT EXISTS "${3RDPARTY_TBB_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
endif()
endif()
endif()
OCCT_MAKE_COMPILER_BITNESS()
if (${COMPILER_BITNESS} STREQUAL 32)
set (TBB_ARCH_NAME ia32)
else()
set (TBB_ARCH_NAME intel64)
#set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing TBB" FORCE)
endif()
# search for include directory in defined 3rdparty directory
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
# check 3RDPARTY_TBB_INCLUDE_DIR for consictency with specified 3RDPARTY_TBB_DIR
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_TBB_INCLUDE_DIR PATH "The directory containing headers of the TBB")
endif()
# tbb.h
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing the headers of tbb" FORCE)
find_path (3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include" NO_DEFAULT_PATH)
find_path (3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
set (HEADER_NAMES tbb.h tbb/tbb.h)
# set 3RDPARTY_TBB_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_TBB_INCLUDE_DIR
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to tbb.h" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_TBB_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE FILEPATH "The directory containing the headers of tbb" FORCE)
endif()
OCCT_MAKE_COMPILER_SHORT_NAME()
# TBB_COMPILER_FOLER
#if (WIN32)
set (TBB_COMPILER_FOLER ${COMPILER})
#else()
# set (TBB_COMPILER_FOLER ${COMPILER})
#endif()
# search for tbb and tbb malloc library in defined 3rdparty directory
foreach (LIBRARY_NAME TBB TBBMALLOC)
if (NOT WIN32)
file (GLOB TBB_SUBDIRS RELATIVE ${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/ ${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/*)
list (SORT TBB_SUBDIRS)
list (REVERSE TBB_SUBDIRS)
list (LENGTH TBB_SUBDIRS TBB_SUBDIRS_LENGTH)
set (TBB_SUBDIR_FIRST "")
if (${TBB_SUBDIRS_LENGTH})
list (GET TBB_SUBDIRS 0 TBB_SUBDIR_FIRST)
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${TBB_SUBDIR_FIRST}")
endif()
endif()
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${LIBRARY_NAME} library" FORCE)
elseif (3RDPARTY_${LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
get_filename_component(3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR_TMP "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}" PATH)
if (NOT "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}" STREQUAL "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR_TMP}")
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${LIBRARY_NAME} library" FORCE)
endif()
endif()
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "3RDPARTY_${LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of ${LIBRARY_NAME}" FORCE)
string (TOLOWER "${LIBRARY_NAME}" lower_LIBRARY_NAME)
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${lower_LIBRARY_NAME} PATHS
"${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}"
"${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
NO_DEFAULT_PATH)
# second search if previous one do not find anything
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${LIBRARY_NAME})
endif()
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}")
get_filename_component(3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}" PATH)
endif()
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBRARY_NAME} library" FORCE)
# search for dll in defined 3rdparty directory (just for win case)
if (WIN32)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL_DIR)
set (3RDPARTY_${LIBRARY_NAME}_DLL "" CACHE FILEPATH "${LIBRARY_NAME} shared library" FORCE)
elseif (3RDPARTY_${LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
get_filename_component(3RDPARTY_${LIBRARY_NAME}_DLL_DIR_TMP "${3RDPARTY_${LIBRARY_NAME}_DLL}" PATH)
if (NOT "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}" STREQUAL "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR_TMP}")
set (3RDPARTY_${LIBRARY_NAME}_DLL "" CACHE FILEPATH "${LIBRARY_NAME} shared library" FORCE)
endif()
endif()
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
set (3RDPARTY_${LIBRARY_NAME}_DLL "3RDPARTY_${LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of ${LIBRARY_NAME}" FORCE)
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME} PATHS
"${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}"
"${3RDPARTY_TBB_DIR}/bin/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
NO_DEFAULT_PATH)
# second search if previous one do not find anything
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME})
endif()
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}")
get_filename_component(3RDPARTY_${LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBRARY_NAME} shared library" FORCE)
endif()
endif() # end dll search
endforeach() # end tbb / tbbmalloc
# include found paths to common variables
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
foreach (LIBRARY_NAME TBB TBBMALLOC)
if (3RDPARTY_${LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR)
# common steps for tbb and tbbmalloc
macro (TBB_PRODUCT_SEARCH PRODUCT_NAME)
string (TOLOWER ${PRODUCT_NAME} lower_PRODUCT_NAME)
# define required tbb/tbbmalloc variables
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library")
endif()
if (WIN32)
if (3RDPARTY_${LIBRARY_NAME}_DLL OR EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBRARY_NAME}_DLL_DIR)
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
endif()
endif()
endforeach()
# install tbb
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
else()
get_filename_component(TBBLIB ${3RDPARTY_TBB_LIBRARY} NAME)
get_filename_component(TBBMALLOCLIB ${3RDPARTY_TBBMALLOC_LIBRARY} NAME)
install (FILES ${3RDPARTY_TBB_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
RENAME ${TBBLIB}.2)
install (FILES ${3RDPARTY_TBB_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
RENAME ${TBBLIB}.2)
install (FILES ${3RDPARTY_TBB_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
RENAME ${TBBLIB}.2)
install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
RENAME ${TBBMALLOCLIB}.2)
install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
RENAME ${TBBMALLOCLIB}.2)
install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
RENAME ${TBBMALLOCLIB}.2)
if (WIN32 AND NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library")
endif()
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_TBB_DIR
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY FILEPATH "the path to ${PRODUCT_NAME} library")
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR PATH "The directory containing ${PRODUCT_NAME} library")
endif()
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_DLL FILEPATH "the path to ${PRODUCT_NAME} shared library")
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR PATH "The directory containing ${PRODUCT_NAME} shared library")
endif()
endif()
endif()
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
if (${COMPILER_BITNESS} EQUAL 32)
set (${PRODUCT_NAME}_ARCH_NAME ia32)
else()
set (${PRODUCT_NAME}_ARCH_NAME intel64)
endif()
# tbb/tbbmalloc library
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
set (PRODUCT_PATH_SUFFIXES lib ${lower_PRODUCT_NAME})
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/lib/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/lib/${${PRODUCT_NAME}_ARCH_NAME}")
file (GLOB ${PRODUCT_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/lib/${${PRODUCT_NAME}_ARCH_NAME}/*")
if (${PRODUCT_NAME}_COMPILER_LIST)
list (GET ${PRODUCT_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES lib ${lower_PRODUCT_NAME} lib/${${PRODUCT_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
set (PRODUCT_PATH_SUFFIXES lib ${lower_PRODUCT_NAME} lib/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER})
endif()
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${lower_PRODUCT_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${lower_PRODUCT_NAME}
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
endif()
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
endif()
# tbb/tbbmalloc shared library
if (WIN32)
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
set (PRODUCT_PATH_SUFFIXES bin)
# set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/bin/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/bin/${${PRODUCT_NAME}_ARCH_NAME}")
file (GLOB ${PRODUCT_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/bin/${${PRODUCT_NAME}_ARCH_NAME}/*")
if (${PRODUCT_NAME}_COMPILER_LIST)
list (GET ${PRODUCT_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES bin bin/${${PRODUCT_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
set (PRODUCT_PATH_SUFFIXES bin bin/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER})
endif()
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_library (3RDPARTY_${PRODUCT_NAME}_DLL ${lower_PRODUCT_NAME}
PATHS "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${PRODUCT_NAME}_DLL ${lower_PRODUCT_NAME} PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES})
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
endif()
endif()
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
endif()
endif()
# install tbb/tbbmalloc
if (INSTALL_${PRODUCT_NAME})
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
else()
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
endif()
endif()
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL)
endmacro()
TBB_PRODUCT_SEARCH (TBB)
TBB_PRODUCT_SEARCH (TBBMALLOC)
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the library directory for using by the executable
@@ -253,5 +280,3 @@ else()
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
endif()
endif()
mark_as_advanced (3RDPARTY_TBB_LIBRARY 3RDPARTY_TBBMALLOC_LIBRARY 3RDPARTY_TBB_DLL 3RDPARTY_TBBMALLOC_DLL)

View File

@@ -77,7 +77,7 @@ endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
@@ -142,7 +142,7 @@ endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
@@ -247,10 +247,15 @@ endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
if (TK_FOUND AND 3RDPARTY_TCL_DIR)
get_filename_component (3RDPARTY_TK_WISH_DIR "${TK_WISH}" PATH)
get_filename_component (3RDPARTY_TK_WISH_DIR_PARENT "${3RDPARTY_TK_WISH_DIR}" PATH)
if ("${3RDPARTY_TK_WISH_DIR_PARENT}" STREQUAL "${3RDPARTY_TCL_DIR}")
get_filename_component (TK_WISH_ABSOLUTE "${TK_WISH}" ABSOLUTE)
get_filename_component (3RDPARTY_TCL_DIR_ABSOLUTE "${3RDPARTY_TCL_DIR}" ABSOLUTE)
string (FIND "${TK_WISH_ABSOLUTE}" "${3RDPARTY_TCL_DIR_ABSOLUTE}" THE_SAME_FOLDER)
if (${THE_SAME_FOLDER} EQUAL 0)
set (3RDPARTY_TCLTK_DIR "${3RDPARTY_TCL_DIR}")
message (STATUS "Info. TK is used from TCL folder: ${3RDPARTY_TCLTK_DIR}")
endif()
endif()

View File

@@ -24,8 +24,8 @@ These include messages on internal errors and special cases encountered, timing
# install variables
set (INSTALL_DIR_DESCR
"The place where built OCCT libraries, headers, test cases (INSTALL_OCCT_TEST_CASES variable),
samples (INSTALL_OCCT_SAMPLES_DESCR variable) and certain 3rdparties (INSTALL_GL2PS, INSTALL_TBB and
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),
samples (INSTALL_SAMPLES_DESCR variable) and certain 3rdparties (INSTALL_GL2PS, INSTALL_TBB and
other similar variables) will be placed during the installation process (building INSTALL project)")
macro (INSTALL_MESSAGE INSTALL_TARGET_VARIABLE INSTALL_TARGET_STRING)
@@ -34,8 +34,8 @@ set (${INSTALL_TARGET_VARIABLE}_DESCR
project) into the installation directory (INSTALL_DIR variable)")
endmacro()
INSTALL_MESSAGE (INSTALL_OCCT_SAMPLES "OCCT samples")
INSTALL_MESSAGE (INSTALL_OCCT_TEST_CASES "non-regression OCCT test scripts")
INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples")
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
INSTALL_MESSAGE (INSTALL_DOC_OcctOverview "OCCT overview documentation (HTML format)")
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
INSTALL_MESSAGE (INSTALL_FREEIMAGEPLUS "FreeImagePlus binaries")
@@ -44,7 +44,7 @@ INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
INSTALL_MESSAGE (INSTALL_TCL "TCL binaries")
INSTALL_MESSAGE (INSTALL_TK "TK binaries")
INSTALL_MESSAGE (INSTALL_VTK "VTK binaries ")
#INSTALL_MESSAGE (INSTALL_VTK "VTK binaries ")
# build variables
macro (BUILD_MODULE_MESSAGE BUILD_MODULE_TARGET_VARIABLE BUILD_MODULE_TARGET_STRING)

View File

@@ -1,183 +1,207 @@
# vtk
if (NOT DEFINED INSTALL_VTK)
set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
endif()
#if (NOT DEFINED INSTALL_VTK)
# set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
#endif()
# vtk directory
if (NOT DEFINED 3RDPARTY_VTK_DIR)
set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing vtk")
set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing VTK")
endif()
set (3RDPARTY_VTK_REQUIRED_LIBRARIES vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonMath
vtkCommonTransforms
vtkRenderingCore
vtkRenderingFreeType
vtkRenderingFreeTypeOpenGL
vtkRenderingOpenGL
vtkFiltersGeneral
vtkIOCore
vtkIOImage
vtkImagingCore
vtkInteractionStyle)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify VTK folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_VTK_DIR PATH "The directory containing VTK")
if (NOT 3RDPARTY_VTK_DIR OR NOT EXISTS "${3RDPARTY_VTK_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" VTK VTK_DIR_NAME)
if (VTK_DIR_NAME)
set (3RDPARTY_VTK_DIR "${3RDPARTY_DIR}/${VTK_DIR_NAME}" CACHE PATH "The directory containing VTK" FORCE)
endif()
endif()
else()
#set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing VTK" FORCE)
endif()
# vtk include directory
if (NOT DEFINED 3RDPARTY_VTK_INCLUDE_DIR)
set (3RDPARTY_VTK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of vtk")
set (3RDPARTY_VTK_INCLUDE_DIR "" CACHE PATH "The directory containing headers of VTK")
endif()
# vtk library directory
if (NOT DEFINED 3RDPARTY_VTK_LIBRARY_DIR)
set (3RDPARTY_VTK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing vtk library")
set (3RDPARTY_VTK_LIBRARY_DIR "" CACHE PATH "The directory containing VTK libraries")
endif()
# vtk dll directory
if (WIN32 AND NOT DEFINED 3RDPARTY_VTK_DLL_DIR)
set (3RDPARTY_VTK_DLL_DIR "" CACHE FILEPATH "The directory containing VTK dll")
set (3RDPARTY_VTK_DLL_DIR "" CACHE PATH "The directory containing VTK shared libraries")
endif()
# search for vtk in user defined directory
if (NOT 3RDPARTY_VTK_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" vtk VTK_DIR_NAME)
if (VTK_DIR_NAME)
set (3RDPARTY_VTK_DIR "${3RDPARTY_DIR}/${VTK_DIR_NAME}" CACHE PATH "The directory containing vtk product" FORCE)
# check 3RDPARTY_VTK_ paths for consistency with specified 3RDPARTY_VTK_DIR
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_VTK_DIR 3RDPARTY_VTK_INCLUDE_DIR PATH "The directory containing headers of VTK")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_VTK_DIR 3RDPARTY_VTK_LIBRARY_DIR PATH "The directory containing VTK libraries")
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_VTK_DIR 3RDPARTY_VTK_DLL_DIR PATH "The directory containing VTK shared library")
endif()
endif()
# find installed vtk
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (CACHED_VTK_DIR $ENV{VTK_DIR})
set (ENV{VTK_DIR} "${3RDPARTY_VTK_DIR}")
endif()
find_package(VTK QUIET)
# find native vtk
if (NOT VTK_FOUND)
find_package(VTK QUIET PATHS "${3RDPARTY_VTK_DIR}")
endif()
if (NOT VTK_FOUND AND NOT 3RDPARTY_VTK_DIR OR NOT EXISTS "${3RDPARTY_VTK_DIR}")
message(SEND_ERROR "VTK not found. Set the 3RDPARTY_VTK_DIR cmake cache entry to the directory containing VTK.")
set (3RDPARTY_VTK_DIR "3RDPARTY_VTK_DIR-NOTFOUND" CACHE PATH "The directory containing vtk product" FORCE)
endif()
set(VTK_VERSION "")
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
get_filename_component(3RDPARTY_VTK_DIR_NAME "${3RDPARTY_VTK_DIR}" NAME)
string(REGEX MATCH "^VTK-([0-9].[0-9])" VTK_VERSION "${3RDPARTY_VTK_DIR_NAME}")
set(VTK_VERSION "${CMAKE_MATCH_1}")
if (NOT 3RDPARTY_VTK_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_DIR}/include/vtk-${VTK_VERSION}" CACHE FILEPATH "The directory containing includes of VTK" FORCE)
endif()
if (NOT 3RDPARTY_VTK_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_VTK_LIBRARY_DIR}")
if(EXISTS "${3RDPARTY_VTK_DIR}/lib")
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_DIR}/lib" CACHE FILEPATH "The directory containing libs of VTK" FORCE)
elseif (EXISTS "${3RDPARTY_VTK_DIR}/lib")
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_DIR}/lib" CACHE FILEPATH "The directory containing libs of VTK" FORCE)
endif()
endif()
if(3RDPARTY_VTK_LIBRARY_DIR)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_VTK_LIBRARY_DIR}")
endif()
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
endif()
# vtk libraries
# lib
set (VTK_LIBRARY_NAMES vtkCommonCore-${VTK_VERSION}.lib vtkCommonDataModel-${VTK_VERSION}.lib vtkCommonExecutionModel-${VTK_VERSION}.lib
vtkCommonMath-${VTK_VERSION}.lib vtkCommonTransforms-${VTK_VERSION}.lib vtkRenderingCore-${VTK_VERSION}.lib
vtkRenderingOpenGL-${VTK_VERSION}.lib vtkFiltersGeneral-${VTK_VERSION}.lib vtkIOCore-${VTK_VERSION}.lib
vtkIOImage-${VTK_VERSION}.lib vtkImagingCore-${VTK_VERSION}.lib vtkInteractionStyle-${VTK_VERSION}.lib )
if (VTK_FOUND)
#dll
set (VTK_DLL_NAMES vtkCommonComputationalGeometry-${VTK_VERSION}.dll
vtkCommonCore-${VTK_VERSION}.dll
vtkCommonDataModel-${VTK_VERSION}.dll
vtkCommonExecutionModel-${VTK_VERSION}.dll
vtkCommonMath-${VTK_VERSION}.dll
vtkCommonMisc-${VTK_VERSION}.dll
vtkCommonSystem-${VTK_VERSION}.dll
vtkCommonTransforms-${VTK_VERSION}.dll
vtkDICOMParser-${VTK_VERSION}.dll
vtkFiltersCore-${VTK_VERSION}.dll
vtkFiltersExtraction-${VTK_VERSION}.dll
vtkFiltersGeneral-${VTK_VERSION}.dll
vtkFiltersGeometry-${VTK_VERSION}.dll
vtkFiltersSources-${VTK_VERSION}.dll
vtkFiltersStatistics-${VTK_VERSION}.dll
vtkIOCore-${VTK_VERSION}.dll
vtkIOImage-${VTK_VERSION}.dll
vtkImagingCore-${VTK_VERSION}.dll
vtkImagingFourier-${VTK_VERSION}.dll
vtkImagingHybrid-${VTK_VERSION}.dll
vtkInteractionStyle-${VTK_VERSION}.dll
vtkRenderingCore-${VTK_VERSION}.dll
vtkRenderingOpenGL-${VTK_VERSION}.dll
vtkalglib-${VTK_VERSION}.dll
vtkjpeg-${VTK_VERSION}.dll
vtkmetaio-${VTK_VERSION}.dll
vtkpng-${VTK_VERSION}.dll
vtksys-${VTK_VERSION}.dll
vtktiff-${VTK_VERSION}.dll
vtkzlib-${VTK_VERSION}.dll )
# add compiler flags, preprocessor definitions, include and link dirs
include (${VTK_USE_FILE})
# search for dll directory
if (WIN32)
if (NOT 3RDPARTY_VTK_DLL_DIR OR NOT EXISTS "${3RDPARTY_VTK_DLL_DIR}")
if(EXISTS "${3RDPARTY_VTK_DIR}/bin")
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DIR}/bin" CACHE FILEPATH "The directory containing dll of VTK" FORCE)
elseif (EXISTS "${3RDPARTY_VTK_DIR}/bind")
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DIR}/bind" CACHE FILEPATH "The directory containing dll of VTK" FORCE)
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND ON)
if (VTK_LIBRARIES)
set (3RDPARTY_VTK_INCLUDE_DIRS)
set (3RDPARTY_VTK_LIBRARY_DIRS)
set (3RDPARTY_VTK_DLL_DIRS)
foreach (VTK_REQUIRED_LIBRARY ${3RDPARTY_VTK_REQUIRED_LIBRARIES})
list (FIND VTK_LIBRARIES ${VTK_REQUIRED_LIBRARY} FOUND_INDEX)
if (${FOUND_INDEX} EQUAL -1)
message (WARNING "VTK: required ${VTK_REQUIRED_LIBRARY} library is not found")
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND OFF)
else()
# get paths from corresponding variables
if (${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS}")
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS}")
endif()
if (${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS}")
endif()
if (${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
if (NOT WIN32)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
endif()
endif()
# get paths from corresponding properties
get_property (TARGET_VTK_IMPORT_CONFS TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_CONFIGURATIONS)
if (TARGET_VTK_IMPORT_CONFS)
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# todo: choose configuration in connection with the build type
#if (CMAKE_BUILD_TYPE)
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
# endforeach()
#endif()
get_property (TARGET_PROPERTY_IMP_PATH TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
endif()
get_property (TARGET_PROPERTY_LOCATION_PATH TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
if (WIN32)
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
else()
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
endif()
endif()
endif()
endif()
endforeach()
else()
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND OFF)
endif()
if (ALL_REQUIRED_VTK_LIBRARIES_FOUND)
if (3RDPARTY_VTK_INCLUDE_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_VTK_INCLUDE_DIRS)
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIRS})
list (GET 3RDPARTY_VTK_INCLUDE_DIRS 0 3RDPARTY_VTK_INCLUDE_DIR)
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_INCLUDE_DIR}" CACHE PATH "The directory containing headers of VTK" FORCE)
endif()
if (3RDPARTY_VTK_LIBRARY_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_VTK_LIBRARY_DIRS)
list (APPEND 3RDPARTY_LIBRARY_DIRS ${3RDPARTY_VTK_LIBRARY_DIRS})
list (GET 3RDPARTY_VTK_LIBRARY_DIRS 0 3RDPARTY_VTK_LIBRARY_DIR)
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_LIBRARY_DIR}" CACHE PATH "The directory containing VTK libraries" FORCE)
endif()
if (WIN32)
if (3RDPARTY_VTK_DLL_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_VTK_DLL_DIRS)
list (APPEND 3RDPARTY_DLL_DIRS ${3RDPARTY_VTK_DLL_DIRS})
list (GET 3RDPARTY_VTK_DLL_DIRS 0 3RDPARTY_VTK_DLL_DIR)
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DLL_DIR}" CACHE PATH "The directory containing VTK shared libraries" FORCE)
endif()
endif()
endif()
if (3RDPARTY_VTK_DLL_DIR OR EXISTS "${3RDPARTY_VTK_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_VTK_DLL_DIR}")
endif()
endif()
OCCT_CHECK_AND_UNSET(VTK_DIR)
endif()
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
endif()
if (INSTALL_VTK)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if(3RDPARTY_VTK_DLL_DIR AND EXISTS "${3RDPARTY_VTK_DLL_DIR}")
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
foreach(VTK_DLL_NAME ${VTK_DLL_NAMES})
set (3RDPARTY_VTK_DLL "3RDPARTY_VTK_DLL-NOTFOUND" CACHE FILEPATH "VTK shared library" FORCE)
find_library(3RDPARTY_VTK_DLL "${VTK_DLL_NAME}" PATHS "${3RDPARTY_VTK_DLL_DIR}" NO_DEFAULT_PATH)
if (NOT 3RDPARTY_VTK_DLL OR NOT EXISTS "${3RDPARTY_VTK_DLL}")
list (APPEND 3RDPARTY_NOT_INCLUDED "${3RDPARTY_VTK_DLL}")
else()
install (FILES ${3RDPARTY_VTK_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (FILES ${3RDPARTY_VTK_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (FILES ${3RDPARTY_VTK_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
endif()
endforeach()
OCCT_CHECK_AND_UNSET(3RDPARTY_VTK_DLL)
endif()
else ()
foreach(VTK_DLL_NAME ${VTK_DLL_NAMES})
string(REPLACE ".dll" ".so.1" VTK_DLL_NAME "${VTK_DLL_NAME}")
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
RENAME "lib${VTK_DLL_NAME}")
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
RENAME "lib${VTK_DLL_NAME}")
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
RENAME "lib${VTK_DLL_NAME}")
endforeach()
endif()
set (USED_3RDPARTY_VTK_DIR "")
if (3RDPARTY_VTK_LIBRARY_DIR AND EXISTS "${3RDPARTY_VTK_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS ${3RDPARTY_VTK_LIBRARY_DIR})
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_DLL_DIR})
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_LIBRARY_DIR)
endif()
if (WIN32)
if (3RDPARTY_VTK_DLL_DIR OR EXISTS "${3RDPARTY_VTK_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS ${3RDPARTY_VTK_DLL_DIR})
else()
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_LIBRARY_DIR})
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_DLL_DIR)
endif()
endif()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_DLL_DIR})
else()
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_LIBRARY_DIR})
endif()
mark_as_advanced (VTK_INCLUDE_DIRS VTK_LIBRARY_DIRS VTK_DIR)

View File

@@ -731,7 +731,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
puts $doxyFile "DOT_PATH = $graphvizPath"
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetIncDir $productsPath]"
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
# list of files to generate
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]

View File

@@ -22,7 +22,6 @@ set "HAVE_TBB=false"
set "HAVE_OPENCL=false"
set "HAVE_FREEIMAGE=false"
set "HAVE_GL2PS=false"
set "HAVE_OPENCL=false"
set "HAVE_VTK=false"
set "HAVE_D3D=false"
set "CSF_OPT_INC="

View File

@@ -477,6 +477,77 @@ proc ConvertTColFwd {thePackagePath theHeaderExtensions} {
}
}
# try to find source file corresponding to the specified header and either
# inject macro IMPLEMENT_STANDARD_RTTIEXT in it, or check it already present,
# and depending on this, return suffix to be used for corresponding macro
# DEFINE_STANDARD_RTTI... (either inline or out-of-line variant)
proc DefineExplicitRtti {hxxfile class base theSourceExtensions} {
# if current file is not a header (by extension), exit with "inline" variant
# (there is no need to bother with out-of-line instantiations for local class)
set ext [string range [file extension $hxxfile] 1 end]
if { [lsearch -exact [split $theSourceExtensions ,] $ext] >=0 } {
return "_INLINE"
}
# try to find source file with the same name but source-type extension
# in the same folder
set filename [file rootname $hxxfile]
foreach ext [split $theSourceExtensions ,] {
# puts "Checking ${filename}.$ext"
if { ! [file readable ${filename}.$ext] } { continue }
# check the file content
set aFileContent [ReadFileToList ${filename}.$ext aFileRawContent aEOL]
# try to find existing macro IMPLEMENT_STANDARD_RTTIEXT and check that
# it is consistent
foreach line $aFileContent {
if { [regexp "^\\s*IMPLEMENT_STANDARD_RTTIEXT\\s*\\(\\s*$class\\s*,\\s*(\[A-Za-z0-9_\]+)\\s*\\)" $line res impl_base] } {
# implementation is in place, just report warning if second argument
# is different
if { $base != $impl_base } {
logwarn "Warning in ${filename}.$ext: second argument of macro"
logwarn " IMPLEMENT_STANDARD_RTTIEXT($class,$impl_base)"
logwarn " is not the same as detected base class, $base"
}
return "EXT"
}
}
# inject a new macro before the first non-empty, non-comment, and
# non-preprocessor line
set aNewFileContent {}
set injected 0
set inc_found 0
foreach line $aFileContent {
if { ! $injected } {
# add macro before first non-empty line after #includes
if { [regexp {^\s*$} $line] } {
} elseif { [regexp {^\s*\#\s*include} $line] } {
set inc_found 1
} elseif { $inc_found } {
set injected 1
lappend aNewFileContent "IMPLEMENT_STANDARD_RTTIEXT($class,$base)"
if { ! [regexp "^IMPLEMENT_" $line] } {
lappend aNewFileContent ""
}
}
}
lappend aNewFileContent $line
}
if { ! $injected } {
lappend aNewFileContent "IMPLEMENT_STANDARD_RTTIEXT($class,$base)"
}
SaveListToFile ${filename}.$ext $aNewFileContent $aEOL
return "EXT"
}
logwarn "Warning in ${hxxfile}: cannot find corresponding source file,"
logwarn " will use inline version of DEFINE_STANDARD_RTTI"
return "_INLINE"
}
# Parse source files and:
#
# - add second argument to macro DEFINE_STANDARD_RTTI specifying first base
@@ -521,13 +592,14 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
# find all instances of DEFINE_STANDARD_RTTI with single or two arguments
set index 0
set pattern_rtti {^(\s*DEFINE_STANDARD_RTTI\s*)\(\s*([A-Za-z_0-9,\s]+)\s*\)}
set pattern_rtti {^(\s*DEFINE_STANDARD_RTTI)([_A-Z]+)?\s*\(\s*([A-Za-z_0-9,\s]+)\s*\)}
while { [regexp -start $index -indices -lineanchor $pattern_rtti \
$aProcessedFileContent location start clist] } {
$aProcessedFileContent location start suffix clist] } {
set index [lindex $location 1]
set start [eval string range \$aProcessedFileContent $start]
set clist [split [eval string range \$aProcessedFileContent $clist] ,]
set start [eval string range \$aProcessedFileContent $start]
set suffix [eval string range \$aProcessedFileContent $suffix]
set clist [split [eval string range \$aProcessedFileContent $clist] ,]
if { [llength $clist] == 1 } {
set class [string trim [lindex $clist 0]]
@@ -538,7 +610,8 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
logwarn "macro DEFINE_STANDARD_RTTI is changed assuming it inherits $inherits($class), please check!"
}
set change_flag 1
ReplaceSubString aProcessedFileContent $location "${start}($class, $inherits($class))" index
ReplaceSubString aProcessedFileContent $location \
"${start}EXT($class,$inherits($class))" index
}
} else {
logwarn "Error in $aProcessedFile: Macro DEFINE_STANDARD_RTTI used for class $class whose declaration is not found in this file, cannot fix"
@@ -548,12 +621,19 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
set base [string trim [lindex $clist 1]]
if { ! [info exists inherits($class)] } {
logwarn "Warning in $aProcessedFile: Macro DEFINE_STANDARD_RTTI used for class $class whose declaration is not found in this file"
} elseif { $base != $inherits($class) } {
} elseif { $base != $inherits($class) && ! [info exists inherits($class,multiple)] } {
logwarn "Warning in $aProcessedFile: Second argument in macro DEFINE_STANDARD_RTTI for class $class is $base while $class seems to inherit from $inherits($class)"
if { ! $theCheckMode && ! [info exists inherits($class,multiple)] } {
set change_flag 1
ReplaceSubString aProcessedFileContent $location "${start}($class, $inherits($class))" index
}
}
# convert intermediate version of macro DEFINE_STANDARD_RTTI
# with two arguments to either _INLINE or EXT variant
if { ! $theCheckMode && "$suffix" == "" } {
set change_flag 1
# try to inject macro IMPLEMENT_STANDARD_RTTIEXT in the
# corresponding source file (or check it already present),
# and depending on this, use either inline or out-of-line variant
set rtti_suffix [DefineExplicitRtti $aProcessedFile $class $base $theSourceExtensions]
ReplaceSubString aProcessedFileContent $location \
"${start}${rtti_suffix}($class,$base)" index
}
}
}
@@ -578,8 +658,12 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
set index 0
set first_newline \n\n
set pattern_implement {\\?\n\s*IMPLEMENT_(DOWNCAST|STANDARD_[A-Z_]+|HARRAY1|HARRAY2|HUBTREE|HEBTREE|HSEQUENCE)\s*\([A-Za-z0-9_ ,]*\)\s*;?}
while { [regexp -start $index -indices -lineanchor $pattern_implement $aProcessedFileContent location] } {
while { [regexp -start $index -indices -lineanchor $pattern_implement $aProcessedFileContent location macro] } {
set index [lindex $location 1]
# macro IMPLEMENT_STANDARD_RTTIEXT is retained
if { [eval string range \$aProcessedFileContent $macro] == "STANDARD_RTTIEXT" } {
continue
}
if { ! $theCheckMode } {
set change_flag 1
ReplaceSubString aProcessedFileContent $location $first_newline index
@@ -594,7 +678,7 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
# find all uses of macro STANDARD_TYPE and method DownCast and ensure that
# argument class is explicitly included
set pattern_incbeg {\s*#\s*include\s*[\"<]\s*}
set pattern_incbeg {\s*#\s*include\s*[\"<]\s*([A-Za-z0-9_/]*/)?}
set pattern_incend {[.][a-zA-Z]+\s*[\">]}
set index 0
set addtype {}
@@ -622,7 +706,9 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
if { ! $theCheckMode } {
set addinc ""
foreach type $addtype {
append addinc "\n#include <$type.hxx>"
if { "$aProcessedFileName" != "$type.hxx" } {
append addinc "\n#include <$type.hxx>"
}
}
if { [regexp -indices ".*\n${pattern_incbeg}\[A-Za-z0-9_/\]+${pattern_incend}" $aProcessedFileContent location] } {
set change_flag 1
@@ -649,6 +735,7 @@ proc ConvertHandle {theTargetPath theIncPaths theCheckMode theExtensions} {
# iterate by header files
foreach aHeader [glob -nocomplain -type f -directory $theTargetPath *.{$theExtensions}] {
set aCurrentHeaderName [file tail $aHeader]
# skip gxx files, as names Handle_xxx used there are in most cases
# placeholders of the argument types substituted by #define
@@ -682,8 +769,9 @@ proc ConvertHandle {theTargetPath theIncPaths theCheckMode theExtensions} {
set anUpdatedHeaderContent {}
set pattern_handle {\mHandle_([A-Za-z0-9_]+)}
foreach line $aHeaderContent {
# do not touch #include and #if... statements
if { [regexp {\s*\#\s*include} $line] || [regexp {\s*\#\s*if} $line] } {
# do not touch typedefs, #include, and #if... statements
if { [regexp {^\s*typedef} $line] ||
[regexp {^\s*\#\s*include} $line] || [regexp {^\s*\#\s*if} $line] } {
lappend anUpdatedHeaderContent $line
continue
}
@@ -763,8 +851,8 @@ proc ConvertHandle {theTargetPath theIncPaths theCheckMode theExtensions} {
} else {
# replace by forward declaration of a class or its include unless
# it is already declared or included
if { ! [regexp "^\s*\#\s*include\s*\[\<\"\]\s*$aForwardDeclHandledClass\s*\[\>\"\]" $aHeaderContent] } {
if { $isQObject } {
if { ! [regexp "\#\\s*include\\s*\[\<\"\]\\s*(\[A-Za-z0-9_/\]*/)?$aForwardDeclHandledClass\[.\]hxx\\s*\[\>\"\]" $aHeaderContent] } {
if { $isQObject && "$aCurrentHeaderName" != "${aForwardDeclHandledClass}.hxx" } {
lappend anUpdatedHeaderContent "#include <${aForwardDeclHandledClass}.hxx>"
if { ! [SearchForFile $theIncPaths ${aForwardDeclHandledClass}.hxx] } {
loginfo "Warning: include ${aForwardDeclHandledClass}.hxx added in $aHeader, assuming it exists and defines Handle_$aForwardDeclHandledClass"
@@ -946,7 +1034,10 @@ proc ConvertCStyleHandleCast {pkpath theExtensions theCheckMode} {
while { [regexp -start $index -indices -lineanchor $pattern_refcast0 $hxx location class var] } {
set index [lindex $location 1]
logwarn "Warning in $afile: C-style cast: [eval string range \$hxx $location]"
set var [eval string range \$hxx $var]
if { "$var" != "const" && "$var" != "Standard_OVERRIDE" } {
logwarn "Warning in $afile: C-style cast: [eval string range \$hxx $location]"
}
}
# replace const Handle(A)& a = Handle(B)::DownCast (b); by
@@ -1081,10 +1172,11 @@ proc ReadFileToList {theFilePath theFileContent theFileEOL} {
regsub -all {$aFileEOL} $aFileContent "\n" aFileContent
}
set aList {}
foreach aLine [split $aFileContent "\n"] {
lappend aList [string trimright $aLine]
}
set aList [split $aFileContent "\n"]
# set aList {}
# foreach aLine [split $aFileContent "\n"] {
# lappend aList [string trimright $aLine]
# }
return $aList
}
@@ -1154,6 +1246,8 @@ proc SaveListToFile {theFilePath theData {theEOL "auto"}} {
fconfigure $aFile -translation binary
puts -nonewline $aFile [join $theData $anUsedEol]
close $aFile
loginfo "File $theFilePath modified"
}
# collect all subdirs of theBaseDir

View File

@@ -0,0 +1,67 @@
// This is sample C++ file intended for testing and verifyig automatic upgrade
// script. Copy it with extension .cxx and apply upgrade procedure to see
// the result, as follows:
// > upgrade.bat -src=./adm -inc=./src -recurse -all
// Include of Geom_Line.hxx and Geom_Plane.hxx should be added below
#include <gp.hxx>
//========================================================================
// OCCT 7.0
//========================================================================
//------------------------------------------------------------------------
// Option -rtti
//------------------------------------------------------------------------
// Should be replaced by <Standard_Type.hxx>
#include <Standard_DefineHandle.hxx>
class A_0
{
}
class B_1 :
public A_0
{
// second argument "A_0" should be added
DEFINE_STANDARD_RTTI(B_1)
};
class C_2 : public Standard_Transient, B_1
{
// second argument "Standard_Transient" should be added
DEFINE_STANDARD_RTTI(C_2)
};
void for_rtti ()
{
Handle(Geom_Curve) aCurve = new Geom_Line (gp::Origin(), gp::DZ());
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (aCurve);
}
// should be removed
IMPLEMENT_DOWNCAST(A)
IMPLEMENT_STANDARD_RTTIEXT(A, B)
//------------------------------------------------------------------------
// Option -fwd
//------------------------------------------------------------------------
// force safe mode used for Qt objects
Q_OBJECT
slots:
// these includes should be recognized as corresponding to forward declarations
#include <occt/TColStd_HArray1OfReal.hxx>
// these declarations should be just removed
class Handle(TColStd_HArray1OfReal);
// should be replaced by include of corresponding header
class TColStd_Array1OfReal;
class Handle(Geom_Curve);
// check that trailing spaces at the following line are preserved
void ff();

View File

@@ -1,19 +1,21 @@
Building with CMake and ADT for Android {#occt_dev_guides__building_android}
Building with CMake for Android {#occt_dev_guides__building_android}
===================
@tableofcontents
This file describes the steps to build OCCT libraries from a complete source package
with following tools:
- Generation of eclipse project files
- 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
- Make: MinGW v4.82+ for Windows, GNU Make vXX for Linux. http://sourceforge.net/projects/mingw/files/
- Building eclipse project files of OCCT
- Android Developer Tools (ADT) v22+ https://developer.android.com/sdk/index.html
This article describes the steps to build OCCT libraries for Android from a complete source package
with GNU make (makefiles) on Windows 7 and Ubuntu 15.10.
## Generation of eclipse project files
The steps on Windows and Ubuntu 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.
## Generation of makefiles
Run GUI tool provided by CMake: cmake-gui
### Tools configuration
@@ -22,21 +24,23 @@ Run GUI tool provided by CMake: cmake-gui
@figure{/dev_guides/building/android/images/android_image001.png}
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project. -
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "Eclipse CDT4 - MinGW MakeFiles" item from the list
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling"
- Click "Next"
@figure{/dev_guides/building/android/images/android_image002.png}
- Specify the Toolchain file at next dialog by android.toolchain.cmake is contained by cross-compilation toolchain for CMake
- Specify a toolchain file at the next dialog by android.toolchain.cmake . It is contained by cross-compilation toolchain for CMake
- Click "Finish"
@figure{/dev_guides/building/android/images/android_image003.png}
Add cache entry ANDROID_NDK - path (entry type is PATH) to the NDK folder ("Add Entry" button)
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{/dev_guides/building/android/images/android_image004.png}
if there is message "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."
Define CMAKE_MAKE_PROGRAM variable with the file path to mingw32-make executable.
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{/dev_guides/building/android/images/android_image005.png}
### OCCT Configuration
@@ -45,27 +49,36 @@ How to configure OCCT, see "OCCT Configuration" section of @ref occt_dev_guides_
taking into account the specific configuration variables for android:
- ANDROID_ABI = armeabi-v7a
- ANDROID_NATIVE_API_LEVEL = 15
- ANDROID_NDK_LAYOUT is equal to BUILD_CONFIGURATION variable
- CMAKE_ECLIPSE_VERSION is equal to installed eclipse version (e.g., 4.2)
Configure parallel building:
- CMAKE_ECLIPSE_MAKE_ARGUMENTS = -jN where N = your numbers of CPU cores (threads)
- ANDROID_NDK_LAYOUT is equal to CMAKE_BUILD_TYPE variable
- **BUILD_MODULE_Draw = OFF**
@figure{/dev_guides/building/android/images/android_image006.png}
### Generation of eclipse projects files
### Generation of makefiles
Click **Generate** button and wait until the generation process is finished.
Then the eclipse project files will appear in the build folder (e.g. <i> D:/android-build-eclipse-api-15 </i>).
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
## Building eclipse project files of OCCT
## Building makefiles of OCCT
- Open eclipse (downloaded ADT bundle contains it)
@figure{/dev_guides/building/android/images/android_image007.png}
- Import "Existing project into Workspace"
@figure{/dev_guides/building/android/images/android_image008.png}
@figure{/dev_guides/building/android/images/android_image009.png}
- Build ALL
@figure{/dev_guides/building/android/images/android_image010.png}
When the building process has finished, libraries are located in \<build folder\>/out (e.g. <i> D:/android-build-eclipse-api-15/out </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
## Install built OCCT libraries
Type "mingw32-make/make" with argument "install" to place the libraries
to the install folder (see "OCCT Configuration" section of @ref occt_dev_guides__building_cmake "Building with CMake")
> mingw32-make install
or
> make install

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -17,7 +17,7 @@ you need to:
2. Build using your preferred build tool.
- \subpage occt_dev_guides__building_automake "Building on Linux with Autotools"
- \subpage occt_dev_guides__building_cmake "Building with CMake (cross-platform)"
- \subpage occt_dev_guides__building_android "Building with CMake and ADT for Android (cross-platform)"
- \subpage occt_dev_guides__building_android "Building with CMake for Android (cross-platform)"
- \subpage occt_dev_guides__building_code_blocks "Building on Mac OS X with Code::Blocks"
- \subpage occt_dev_guides__building_msvc "Building on Windows with MS Visual Studio"
- \subpage occt_dev_guides__building_xcode "Building on Mac OS X with Xcode"

View File

@@ -117,8 +117,8 @@ The following table enumerates the full list of environment variables used at co
| 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_OCCT_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_OCCT_SAMPLES | Boolean flag | Indicates whether OCCT samples 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_SAMPLES | Boolean flag | Indicates whether OCCT samples should be installed into the installation directory |
| INSTALL_DOC_OcctOverview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
**Note:** In those CMake options defining paths only the forward slashes ("/") are acceptable.

View File

@@ -86,7 +86,7 @@ Alternative solution is to use legacy generator of project files (extracted from
@subsubsection upgrade_occt700_cdl_auto Automatic upgrade
Most of typical changes required for upgrading code to use OCCT 7.0 can be done automatically using the *upgrade* tool included in OCCT 7.0.
Most of typical changes required for upgrading code for OCCT 7.0 can be done automatically using the *upgrade* tool included in OCCT 7.0.
This tool is a Tcl script, thus Tcl should be available on your workstation to run it.
Example:
@@ -106,11 +106,16 @@ Run upgrade tool without arguments to see the list of available options.
Upgrade tool performs the following changes in the code.
1. Adds second argument to macro DEFINE_STANDARD_RTTI indicating base class for its argument class (if inheritance is recognized by the script):
1. Replaces macro DEFINE_STANDARD_RTTI by DEFINE_STANDARD_RTTIEXT, with second argument indicating base class for the main argument class (if inheritance is recognized by the script):
~~~~~
DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTI(Class, Base)
DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTIEXT(Class, Base)
~~~~~
@note If macro DEFINE_STANDARD_RTTI with two arguments (used in intermediate development versions of OCCT 7.0) is found, the script will convert it to either DEFINE_STANDARD_RTTIEXT or DEFINE_STANDARD_RTTI_INLINE.
The former case is used if current file is header and source file with the same name is found in the same folder.
In this case, macro IMPLEMENT_STANDARD_RTTI is injected in the corresponding source file.
The latter variant defines all methods for RTTI as inline, and does not require IMPLEMENT_STANDARD_RTTIEXT macro.
2. Replaces forward declarations of collection classes previously generated from CDL generics (defined in TCollection package) by \#include of corresponding header:
~~~~~
class TColStd_Array1OfReal; -> #include <TColStd_Array1OfReal.hxx>
@@ -159,9 +164,11 @@ Namespace::Handle(Class) -> Handle(Namespace::Class)
10. Adds \#include for all classes used as argument to macro STANDARD_TYPE(), except of already included ones;
11. Removes uses of obsolete macros IMPLEMENT_DOWNCAST() and IMPLEMENT_STANDARD_*().
11. Removes uses of obsolete macros IMPLEMENT_DOWNCAST and IMPLEMENT_STANDARD_*, except IMPLEMENT_STANDARD_RTTIEXT.
> If you plan to keep compatibility of your code with older versions of OCCT, add option "-compat" to avoid the latter change. See also @ref upgrade_occt700_cdl_compat.
@note If you plan to keep compatibility of your code with older versions of OCCT, add option "-compat" to avoid the latter change. See also @ref upgrade_occt700_cdl_compat.
.
As long as the upgrade routine runs, some information messages are sent to the standard output.
In some cases the warnings or errors like the following may appear:
@@ -171,7 +178,7 @@ In some cases the warnings or errors like the following may appear:
~~~~~
Be sure to check carefully all reported errors and warnings, as corresponding places likely will require manual corrections.
In some cases these messages may help you to detect errors in your code, for instance, cases where DEFINE_STANDARD_RTTI macro passes invalid class name as an argument.
In some cases these messages may help you to detect errors in your code, for instance, cases where DEFINE_STANDARD_RTTI macro is used with incorrect class name as an argument.
@subsubsection upgrade_occt700_cdl_compiler Possible compiler errors
@@ -323,16 +330,17 @@ aBC->Transform (T); // access violation in OCCT 7.0
If you like to preserve compatibility of your application code with OCCT versions 6.x even after upgrade to 7.0, consider the following suggestions:
1. When running automatic upgrade tool, add option *-compat*.
1. If your code used sequences of macros IMPLEMENT_STANDARD_... generated by WOK, replace them by single macro IMPLEMENT_STANDARD_RTTIEXT
2. In order to overcome incompatibility of macro DEFINE_STANDARD_RTTI which has additional argument in OCCT 7.0, you can replace (after upgrade) its use in your code by your own version-dependent macro, which resolves to either 6.x or 7.x version.
2. When running automatic upgrade tool, add option *-compat*.
3. Define macros DEFINE_STANDARD_RTTIEXT and DEFINE_STANDARD_RTTI_INLINE when building with previous versions of OCCT, resolving to DEFINE_STANDARD_RTTI with single argument
Example:
~~~~~
#if OCC_VERSION_HEX < 0x070000
#define DEFINE_STANDARD_RTTI_COMPAT(C1,C2) DEFINE_STANDARD_RTTI(C1)
#else
#define DEFINE_STANDARD_RTTI_COMPAT(C1,C2) DEFINE_STANDARD_RTTI(C1,C2)
#define DEFINE_STANDARD_RTTIEXT(C1,C2) DEFINE_STANDARD_RTTI(C1)
#define DEFINE_STANDARD_RTTI_INLINE(C1,C2) DEFINE_STANDARD_RTTI(C1)
#endif
~~~~~

View File

@@ -7,6 +7,8 @@ SET "OLD_PATH=%PATH%"
if exist "%~dp0env.bat" (
call "%~dp0env.bat"
) else (
type "%~dp0adm\templates\env.bat" | findstr /i /v "__CASROOT__" > "%~dp0env.bat"
)
set "TCL_EXEC=tclsh.exe"

View File

@@ -9,6 +9,9 @@ anOldDyLd="$DYLD_LIBRARY_PATH"
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
if [ ! -e "${aScriptPath}/env.sh" ]; then
cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
fi
aSystem=`uname -s`
aTarget="$1"

View File

@@ -530,7 +530,7 @@ public:
theRed=255;
theGreen=255;
theBlue=255;
Handle_AIS_InteractiveObject aCurrent ;
Handle(AIS_InteractiveObject) aCurrent ;
Quantity_Color anObjCol;
myAISContext()->InitCurrent();
if (!myAISContext()->MoreCurrent())
@@ -716,7 +716,7 @@ public:
/// <summary>
///Get AISContext
/// </summary>
Handle_AIS_InteractiveContext GetContext(void)
Handle(AIS_InteractiveContext) GetContext(void)
{
return myAISContext();
}
@@ -841,8 +841,8 @@ public:
return false;
}
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
Handle_AIS_Shape anIS = Handle_AIS_Shape::DownCast(anIO);
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast(anIO);
return BRepTools::Write (anIS->Shape(), (Standard_CString)theFileName) != Standard_False;
}
@@ -857,8 +857,8 @@ public:
STEPControl_Writer aWriter;
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
aStatus = aWriter.Transfer( aShape , aType );
if ( aStatus != IFSelect_RetDone )
@@ -888,8 +888,8 @@ public:
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
aWriter.AddShape ( aShape );
}
@@ -910,8 +910,8 @@ public:
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
if ( aShape.IsNull() )
{
@@ -939,8 +939,8 @@ public:
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
if ( aShape.IsNull() )
{
@@ -1030,8 +1030,8 @@ public:
private:
// fields
NCollection_Haft<Handle_V3d_Viewer> myViewer;
NCollection_Haft<Handle_V3d_View> myView;
NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
NCollection_Haft<Handle_OpenGl_GraphicDriver> myGraphicDriver;
NCollection_Haft<Handle(V3d_Viewer)> myViewer;
NCollection_Haft<Handle(V3d_View)> myView;
NCollection_Haft<Handle(AIS_InteractiveContext)> myAISContext;
NCollection_Haft<Handle(OpenGl_GraphicDriver)> myGraphicDriver;
};

View File

@@ -693,7 +693,7 @@ public:
/// <summary>
///Get AISContext
/// </summary>
Handle_AIS_InteractiveContext GetContext()
Handle(AIS_InteractiveContext) GetContext()
{
return myAISContext();
}
@@ -965,9 +965,9 @@ public:
private:
NCollection_Haft<Handle_V3d_Viewer> myViewer;
NCollection_Haft<Handle_V3d_View> myView;
NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
NCollection_Haft<Handle_D3DHost_GraphicDriver> myGraphicDriver;
NCollection_Haft<Handle(V3d_Viewer)> myViewer;
NCollection_Haft<Handle(V3d_View)> myView;
NCollection_Haft<Handle(AIS_InteractiveContext)> myAISContext;
NCollection_Haft<Handle(D3DHost_GraphicDriver)> myGraphicDriver;
};

View File

@@ -18,7 +18,6 @@
#include <android/log.h>
IMPLEMENT_STANDARD_HANDLE (OcctJni_MsgPrinter, Message_Printer)
IMPLEMENT_STANDARD_RTTIEXT(OcctJni_MsgPrinter, Message_Printer)
// =======================================================================

View File

@@ -53,7 +53,7 @@ private:
public:
DEFINE_STANDARD_RTTI(OcctJni_MsgPrinter)
DEFINE_STANDARD_RTTIEXT(OcctJni_MsgPrinter,Message_Printer)
};

View File

@@ -13,5 +13,4 @@
#include <OcctJni_Window.hxx>
IMPLEMENT_STANDARD_HANDLE (OcctJni_Window, Aspect_Window)
IMPLEMENT_STANDARD_RTTIEXT(OcctJni_Window, Aspect_Window)

View File

@@ -97,7 +97,7 @@ private:
public:
DEFINE_STANDARD_RTTI(OcctJni_Window)
DEFINE_STANDARD_RTTIEXT(OcctJni_Window,Aspect_Window)
};

View File

@@ -153,7 +153,7 @@ static TCollection_AsciiString Comment(Standard_Real Step,
"GeomAPI_PointsToBSplineSurface aPTBS;" EOL
"aPTBS.Init(aZPoints,aX0,aXStep,aY0,aYStep," EOL
" DegMin,DegMax,Continuity,Tolerance);" EOL
"Handle_Geom_BSplineSurface aSurface = aPTBS.Surface();" EOL EOL EOL
"Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();" EOL EOL EOL
);
return aText;
@@ -165,7 +165,7 @@ static TCollection_AsciiString Comment(Standard_Real Step,
// Purpose :
//================================================================
Handle_Geom_BSplineSurface Approx_Presentation::CreateBSplineSurface(TColStd_Array2OfReal& aZPoints,
Handle(Geom_BSplineSurface) Approx_Presentation::CreateBSplineSurface(TColStd_Array2OfReal& aZPoints,
Standard_Real theXStep,
Standard_Real theYStep,
Standard_Integer Count)
@@ -175,7 +175,7 @@ Handle_Geom_BSplineSurface Approx_Presentation::CreateBSplineSurface(TColStd_Arr
GeomAPI_PointsToBSplineSurface aPTBS;
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
Handle_Geom_BSplineSurface aSurface = aPTBS.Surface();
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
return aSurface;
}
@@ -192,12 +192,12 @@ Standard_Boolean Approx_Presentation::DrawModifyBSplineSurface(TColStd_Array2OfR
Standard_Integer theIndexX,
Standard_Integer theIndexY,
Standard_Real theDeflection,
Handle_AIS_InteractiveObject& aMovePnt,
Handle_AIS_InteractiveObject& aObj,
Handle(AIS_InteractiveObject)& aMovePnt,
Handle(AIS_InteractiveObject)& aObj,
Standard_Integer Count)
{
Handle_AIS_InteractiveObject auxObj;
Handle(AIS_InteractiveObject) auxObj;
Standard_Real aX0 = -300, aY0 = -200;
Standard_Real aLastZ = aZPoints(theIndexX,theIndexY);
aZPoints(theIndexX,theIndexY) += 100*theDeflection;
@@ -216,7 +216,7 @@ Standard_Boolean Approx_Presentation::DrawModifyBSplineSurface(TColStd_Array2OfR
aZPoints(theIndexX,theIndexY) = aLastZ;
Handle_Geom_BSplineSurface aSurface = aPTBS.Surface();
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
auxObj = drawSurface(aSurface);
getAISContext()->Erase(aObj);
@@ -275,7 +275,7 @@ void Approx_Presentation::sample1()
aText += (
"aPTB.Init(aCurvePoint,DegMin,DegMax,Continuity,Tolerance);" EOL
"Handle_Geom_BSplineCurve aCurve = aPTB.Curve();" EOL
"Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();" EOL
);
setResultTitle("Creating approximations of curves");
@@ -295,7 +295,7 @@ void Approx_Presentation::sample1()
GeomAPI_PointsToBSpline aPTB;
Handle_AIS_InteractiveObject aIndexPnt [2],aObj;
Handle(AIS_InteractiveObject) aIndexPnt [2],aObj;
Standard_Integer aIndex[2] = {9,13};
Standard_Real aDeflection[2] = {-1.5,2};
@@ -313,7 +313,7 @@ void Approx_Presentation::sample1()
if(WAIT_A_LITTLE) return;
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
Handle_Geom_BSplineCurve aCurve = aPTB.Curve();
Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();
aObj = drawCurve(aCurve);
for( i = 0 ; i < 2 ; i++)
@@ -367,7 +367,7 @@ void Approx_Presentation::sample2()
TColgp_Array2OfPnt aPnt(1,4,1,4);
Handle_AIS_InteractiveObject aShowPnt[4][4],aObj,aMovePnt;
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
@@ -404,7 +404,7 @@ void Approx_Presentation::sample2()
aText = Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
setResultText(aText.ToCString());
Handle_Geom_BSplineSurface aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
aObj = drawSurface(aSurface);
Standard_Boolean aBool;
if(WAIT_A_LITTLE) return ;
@@ -452,7 +452,7 @@ void Approx_Presentation::sample3()
TColgp_Array2OfPnt aPnt(1,4,1,4);
Handle_AIS_InteractiveObject aShowPnt[4][4],aObj,aMovePnt;
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
@@ -491,7 +491,7 @@ void Approx_Presentation::sample3()
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
setResultText(aText.ToCString());
Handle_Geom_BSplineSurface aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
aObj = drawSurface(aSurface);
Standard_Boolean aBool;
if(WAIT_A_LITTLE) return ;
@@ -540,7 +540,7 @@ void Approx_Presentation::sample4()
TColgp_Array2OfPnt aPnt(1,5,1,5);
Handle_AIS_InteractiveObject aShowPnt[5][5],aObj,aMovePnt;
Handle(AIS_InteractiveObject) aShowPnt[5][5],aObj,aMovePnt;
Standard_Integer aColLength = aZPoints.ColLength();
Standard_Integer aRowLength = aZPoints.RowLength();
@@ -579,7 +579,7 @@ void Approx_Presentation::sample4()
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
setResultText(aText.ToCString());
Handle_Geom_BSplineSurface aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
aObj = drawSurface(aSurface);
Standard_Boolean aBool;
if(WAIT_A_LITTLE) return ;

View File

@@ -32,11 +32,11 @@ private:
Standard_Boolean DrawModifyBSplineSurface(TColStd_Array2OfReal& ,
Standard_Real ,Standard_Real ,
Standard_Integer ,Standard_Integer ,
Standard_Real,Handle_AIS_InteractiveObject&,
Handle_AIS_InteractiveObject&,
Standard_Real,Handle(AIS_InteractiveObject)&,
Handle(AIS_InteractiveObject)&,
Standard_Integer);
Handle_Geom_BSplineSurface CreateBSplineSurface(TColStd_Array2OfReal& ,
Handle(Geom_BSplineSurface) CreateBSplineSurface(TColStd_Array2OfReal& ,
Standard_Real ,Standard_Real,
Standard_Integer);

View File

@@ -84,7 +84,7 @@ Standard_Boolean Chamfers_Presentation::createDiverseChamferOnBox(
Standard_Real d1, // chamfer on edge 1
Standard_Real d2, // chamfer on edge 2
Standard_Real d3, // chamfer on edge 3
Handle_AIS_InteractiveObject& thePrevShape)// for smoth drawing
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
// we display the new shape first, then erase the previous one
{
// initializing a class that builds chamfer
@@ -202,7 +202,7 @@ Standard_Boolean Chamfers_Presentation::createChamferOnBox(
TopoDS_Solid& aBox,
Standard_Real theDistA, // distance along first face
Standard_Real theDistB, // distance along second face
Handle_AIS_InteractiveObject& thePrevShape)// for smoth drawing
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
// we display the new shape first, then erase the previous one
{
// initializing a class that builds chamfer
@@ -287,7 +287,7 @@ Standard_Boolean Chamfers_Presentation::createFilletOnBox(
TopoDS_Solid& aBox,
Standard_Real theRad, // radius of fillet
ChFi3d_FilletShape theFShape, // shape of fillet
Handle_AIS_InteractiveObject& thePrevObj) // to erase
Handle(AIS_InteractiveObject)& thePrevObj) // to erase
// the previous shape
{
// initializing a class that builds fillet
@@ -612,7 +612,7 @@ void Chamfers_Presentation::sampleBoxFillet()
Standard_Real a = BOX_SIDE_LEN;
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
Handle_AIS_InteractiveObject aPrevObj = new AIS_Shape(aBox);
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aBox);
getAISContext()->Display(aPrevObj, Standard_False);
COCCDemoDoc::Fit();

View File

@@ -12,7 +12,7 @@
#include <OCCDemo_Presentation.h>
#include <ChFi3d_FilletShape.hxx>
class Handle_AIS_InteractiveObject;
class AIS_InteractiveObject;
class TopoDS_Solid;
class Chamfers_Presentation : public OCCDemo_Presentation
@@ -29,15 +29,15 @@ public:
private:
Standard_Boolean createChamferOnBox(
TopoDS_Solid&, Standard_Real, Standard_Real,
Handle_AIS_InteractiveObject&);
Handle(AIS_InteractiveObject)&);
Standard_Boolean createDiverseChamferOnBox(
TopoDS_Solid&, Standard_Real, Standard_Real,
Standard_Real, Handle_AIS_InteractiveObject&);
Standard_Real, Handle(AIS_InteractiveObject)&);
Standard_Boolean createFilletOnBox(
TopoDS_Solid&, Standard_Real, ChFi3d_FilletShape,
Handle_AIS_InteractiveObject&);
Handle(AIS_InteractiveObject)&);
// Sample functions
void sampleBoxChamfer();

View File

@@ -11,28 +11,25 @@
#include <Prs3d_ArrowAspect.hxx>
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTI(ISession_Curve,AIS_InteractiveObject)
//
// Foreach ancestors, we add a IMPLEMENT_STANDARD_SUPERTYPE and
// a IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY macro.
// We must respect the order: from the direct ancestor class
// to the base class.
//
IMPLEMENT_STANDARD_TYPE(ISession_Curve)
IMPLEMENT_STANDARD_SUPERTYPE(AIS_InteractiveObject)
IMPLEMENT_STANDARD_SUPERTYPE(SelectMgr_SelectableObject)
IMPLEMENT_STANDARD_SUPERTYPE(PrsMgr_PresentableObject)
IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared)
IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient)
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(AIS_InteractiveObject)
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(SelectMgr_SelectableObject)
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(PrsMgr_PresentableObject)
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared)
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient)
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
IMPLEMENT_STANDARD_TYPE_END(ISession_Curve)
#ifdef _DEBUG
#undef THIS_FILE

View File

@@ -20,7 +20,7 @@ class ISession_Curve : public AIS_InteractiveObject
public:
ISession_Curve(const Handle(Geom_Curve)& aCurve);
virtual ~ISession_Curve();
DEFINE_STANDARD_RTTI(ISession_Curve)
DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;

View File

@@ -77,8 +77,8 @@ static Standard_Boolean fixParam(Standard_Real& theParam)
// Purpose : displays a given geometric surface in 3d viewer
// (creates a finite face and displays it)
//================================================================
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
(const Handle_Geom_Surface& theSurface,
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
(const Handle(Geom_Surface)& theSurface,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
@@ -89,7 +89,7 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
fixParam(v1);
fixParam(v2);
Handle_AIS_Shape aGraphicSurface =
Handle(AIS_Shape) aGraphicSurface =
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
@@ -110,8 +110,8 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
// Function : DrawCurve
// Purpose : displays a given curve 3d
//================================================================
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawCurve
(const Handle_Geom_Curve& theCurve,
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
(const Handle(Geom_Curve)& theCurve,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
@@ -135,8 +135,8 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawCurve
// Function : DrawCurve
// Purpose : displays a given curve 2d
//================================================================
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawCurve
(const Handle_Geom2d_Curve& theCurve,
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
(const Handle(Geom2d_Curve)& theCurve,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay,
const gp_Ax2& aPosition)
@@ -163,7 +163,7 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawCurve
// Function : drawPoint
// Purpose : displays a given point
//================================================================
Handle_AIS_Point OCCDemo_Presentation::drawPoint
Handle(AIS_Point) OCCDemo_Presentation::drawPoint
(const gp_Pnt& aPnt,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
@@ -185,7 +185,7 @@ Handle_AIS_Point OCCDemo_Presentation::drawPoint
// (segment of line starting at thePnt with the arrow at the end,
// the length of segment is the length of the vector)
//================================================================
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawVector
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
(const gp_Pnt& thePnt,
const gp_Vec& theVec,
const Quantity_Color& theColor,
@@ -217,11 +217,11 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawVector
}
Handle_AIS_Shape OCCDemo_Presentation::drawShape
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
(const TopoDS_Shape& theShape,const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
Handle_AIS_Shape aGraphicShape = new AIS_Shape(theShape);
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
getAISContext()->SetMaterial(aGraphicShape, Graphic3d_NOM_PLASTIC, toDisplay);
getAISContext()->SetColor (aGraphicShape, theColor, toDisplay);
@@ -237,12 +237,12 @@ Handle_AIS_Shape OCCDemo_Presentation::drawShape
return aGraphicShape;
}
Handle_AIS_Shape OCCDemo_Presentation::drawShape
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
(const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial,
const Standard_Boolean toDisplay)
{
Handle_AIS_Shape aGraphicShape = new AIS_Shape(theShape);
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
getAISContext()->SetMaterial(aGraphicShape, theMaterial, toDisplay);
if (toDisplay) {

View File

@@ -14,10 +14,10 @@
#define WAIT_A_SECOND WaitForInput(1000)
#include <OCCDemoDoc.h>
class Handle_AIS_InteractiveObject;
class Handle_Geom_Surface;
class Handle_Geom_Curve;
class Handle_Geom2d_Curve;
class AIS_InteractiveObject;
class Geom_Surface;
class Geom_Curve;
class Geom2d_Curve;
class Quantity_Color;
class OCCDemo_Presentation
@@ -63,8 +63,8 @@ public:
protected:
// Methods to call from a derivable class
void setName (const char* theName) {myName = CString(theName);}
Handle_AIS_InteractiveContext getAISContext() const {return myDoc->GetAISContext();}
Handle_V3d_Viewer getViewer() const {return myDoc->GetViewer();}
Handle(AIS_InteractiveContext) getAISContext() const {return myDoc->GetAISContext();}
Handle(V3d_Viewer) getViewer() const {return myDoc->GetViewer();}
void setResultTitle (const char* theTitle) {myDoc->GetResultDialog()->SetTitle(theTitle);}
void setResultText (const char* theText) {myDoc->GetResultDialog()->SetText(theText);}
Standard_CString GetDataDir() {return myDoc->GetDataDir();}
@@ -72,45 +72,45 @@ protected:
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
// Waits for a user input or a period of time has been elapsed
Handle_AIS_InteractiveObject drawSurface (const Handle_Geom_Surface& theSurface,
Handle(AIS_InteractiveObject) drawSurface (const Handle(Geom_Surface)& theSurface,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_LEMONCHIFFON3),
const Standard_Boolean toDisplay = Standard_True);
// creates a finite face based on the given geometric surface
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_InteractiveObject drawCurve (const Handle_Geom_Curve& theCurve,
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom_Curve)& theCurve,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
const Standard_Boolean toDisplay = Standard_True);
// creates an ISession_Curve based on the given geometric curve
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_InteractiveObject drawCurve (const Handle_Geom2d_Curve& theCurve,
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom2d_Curve)& theCurve,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
const Standard_Boolean toDisplay = Standard_True,
const gp_Ax2& aPosition = gp::XOY());
// converts a given curve to 3d using aPosition and calls the previous method
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given point
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_InteractiveObject drawVector (const gp_Pnt& thePnt,
Handle(AIS_InteractiveObject) drawVector (const gp_Pnt& thePnt,
const gp_Vec& theVec,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_YELLOW),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given vector
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape
// with material PLASTIC and a given color
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material

View File

@@ -23,7 +23,7 @@ class COCCDemoApp : public CWinApp
{
public:
COCCDemoApp();
Handle_Graphic3d_WNTGraphicDevice GetGraphicDevice() const
Handle(Graphic3d_WNTGraphicDevice) GetGraphicDevice() const
{ return myGraphicDevice; } ;
// Overrides
@@ -42,7 +42,7 @@ public:
DECLARE_MESSAGE_MAP()
private:
Handle_Graphic3d_WNTGraphicDevice myGraphicDevice;
Handle(Graphic3d_WNTGraphicDevice) myGraphicDevice;
};

View File

@@ -15,8 +15,8 @@ class OCCDemo_Presentation;
class COCCDemoDoc : public CDocument
{
public:
Handle_V3d_Viewer GetViewer() const { return myViewer; };
Handle_AIS_InteractiveContext GetAISContext() const { return myAISContext; };
Handle(V3d_Viewer) GetViewer() const { return myViewer; };
Handle(AIS_InteractiveContext) GetAISContext() const { return myAISContext; };
CResultDialog* GetResultDialog () {return &myCResultDialog;}
Standard_CString GetDataDir() {return myDataDir;}
@@ -71,8 +71,8 @@ protected:
DECLARE_MESSAGE_MAP()
private:
Handle_V3d_Viewer myViewer;
Handle_AIS_InteractiveContext myAISContext;
Handle(V3d_Viewer) myViewer;
Handle(AIS_InteractiveContext) myAISContext;
OCCDemo_Presentation *myPresentation;
CResultDialog myCResultDialog;
BOOL myShowResult;

View File

@@ -103,8 +103,8 @@ private:
private:
enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
Handle_V3d_View myView;
Handle_Graphic3d_GraphicDriver myGraphicDriver;
Handle(V3d_View) myView;
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
View3D_CurrentAction myCurrentMode;
VisMode myVisMode;
Standard_Integer myXmin;

View File

@@ -88,7 +88,7 @@ void Convert_Presentation::DoSample()
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
// Purpose :
//================================================================
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle_Geom_Surface theSurface,
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurface,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
@@ -97,7 +97,7 @@ void Convert_Presentation::drawSurfaceAndItsBSpline(Handle_Geom_Surface theSurfa
aTitle += " to BSpline surface";
theText += EOL
" Handle_Geom_BSplineSurface aBSplineSurface = " EOL
" Handle(Geom_BSplineSurface) aBSplineSurface = " EOL
" GeomConvert::SurfaceToBSplineSurface(aSurface);" EOL;
setResultTitle (aTitle.ToCString());
@@ -107,7 +107,7 @@ void Convert_Presentation::drawSurfaceAndItsBSpline(Handle_Geom_Surface theSurfa
if (WAIT_A_LITTLE) return;
Handle_Geom_BSplineSurface aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
Handle(Geom_BSplineSurface) aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
_ASSERTE(!aBSplineSurface.IsNull());
@@ -118,7 +118,7 @@ void Convert_Presentation::drawSurfaceAndItsBSpline(Handle_Geom_Surface theSurfa
// Function : Convert_Presentation::drawCurveAndItsBSpline
// Purpose :
//================================================================
void Convert_Presentation::drawCurveAndItsBSpline(Handle_Geom_Curve theCurve,
void Convert_Presentation::drawCurveAndItsBSpline(Handle(Geom_Curve) theCurve,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
@@ -127,7 +127,7 @@ void Convert_Presentation::drawCurveAndItsBSpline(Handle_Geom_Curve theCurve,
aTitle += " to BSpline curve";
theText += EOL
" Handle_Geom_BSplineCurve aBSpline = " EOL
" Handle(Geom_BSplineCurve) aBSpline = " EOL
" GeomConvert::CurveToBSplineCurve(aCurve);" EOL;
setResultTitle (aTitle.ToCString());
@@ -137,7 +137,7 @@ void Convert_Presentation::drawCurveAndItsBSpline(Handle_Geom_Curve theCurve,
if (WAIT_A_LITTLE) return;
Handle_Geom_BSplineCurve aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);
Handle(Geom_BSplineCurve) aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);
drawCurve (aBSpline, BSplineColor);
}
@@ -157,7 +157,7 @@ void Convert_Presentation::sampleCircle()
gp_Dir aDir (1,0,0);
gp_Ax2 aAxis (aOrigin, aDir);
Standard_Real aRadius = 300;
Handle_Geom_Circle aCurve = new Geom_Circle (aAxis, aRadius);
Handle(Geom_Circle) aCurve = new Geom_Circle (aAxis, aRadius);
TCollection_AsciiString aText (
" gp_Pnt aOrigin (0,0,0);" EOL

View File

@@ -10,8 +10,8 @@
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class Handle_Geom_Curve;
class Handle_Geom_Surface;
class Geom_Curve;
class Geom_Surface;
class Quantity_Color;
@@ -38,10 +38,10 @@ private:
void sampleConicalSurface();
void sampleSphericalSurface();
void drawCurveAndItsBSpline (Handle_Geom_Curve theCurve,
void drawCurveAndItsBSpline (Handle(Geom_Curve) theCurve,
const Standard_CString theName, TCollection_AsciiString& theText);
void drawSurfaceAndItsBSpline (Handle_Geom_Surface theSurface,
void drawSurfaceAndItsBSpline (Handle(Geom_Surface) theSurface,
const Standard_CString theName, TCollection_AsciiString& theText);
private:

View File

@@ -196,14 +196,14 @@ void DCA_Presentation::sampleParabola()
if(WAIT_A_LITTLE) return;
Handle_Geom_Line aFocalLenLin = new Geom_Line(gce_MakeLin(aPointParab, gp_Dir(0,0,1)));
Handle_Geom_TrimmedCurve aTrim = new Geom_TrimmedCurve(aFocalLenLin, -aFocalLength/2, aFocalLength/2);
Handle(Geom_Line) aFocalLenLin = new Geom_Line(gce_MakeLin(aPointParab, gp_Dir(0,0,1)));
Handle(Geom_TrimmedCurve) aTrim = new Geom_TrimmedCurve(aFocalLenLin, -aFocalLength/2, aFocalLength/2);
drawCurve(aTrim);
if(WAIT_A_LITTLE) return;
Handle_Geom_Parabola aParabola = new Geom_Parabola(aParab);
Handle_Geom_TrimmedCurve aParabTrimmed =
Handle(Geom_Parabola) aParabola = new Geom_Parabola(aParab);
Handle(Geom_TrimmedCurve) aParabTrimmed =
new Geom_TrimmedCurve(aParabola,-300,300,Standard_True);
drawCurve(aParabTrimmed);
@@ -218,8 +218,8 @@ void DCA_Presentation::sampleParabola()
if(WAIT_A_LITTLE) return;
Handle_Geom_Parabola aParabola1 = new Geom_Parabola(aParab1);
Handle_Geom_TrimmedCurve aParabTrimmed1 = new Geom_TrimmedCurve(aParabola1,-300,300,Standard_True);
Handle(Geom_Parabola) aParabola1 = new Geom_Parabola(aParab1);
Handle(Geom_TrimmedCurve) aParabTrimmed1 = new Geom_TrimmedCurve(aParabola1,-300,300,Standard_True);
drawCurve(aParabTrimmed1);
}
//================================================================
@@ -283,8 +283,8 @@ void DCA_Presentation::sampleHyperbola()
if(WAIT_A_LITTLE) return;
Handle_Geom_Hyperbola aHyperbola1 = new Geom_Hyperbola(aHypr1);
Handle_Geom_TrimmedCurve aHyprTrimmed =
Handle(Geom_Hyperbola) aHyperbola1 = new Geom_Hyperbola(aHypr1);
Handle(Geom_TrimmedCurve) aHyprTrimmed =
new Geom_TrimmedCurve(aHyperbola1,-3,4,Standard_True);
drawCurve(aHyprTrimmed);
@@ -305,23 +305,23 @@ void DCA_Presentation::sampleHyperbola()
if(WAIT_A_LITTLE) return;
//output of display MajorRadius (yellow color)
Handle_Geom_Line aLine = new Geom_Line(gce_MakeLin(aPointHypr1,aPointHypr2));
Handle_Geom_TrimmedCurve aTrimmed1 =
Handle(Geom_Line) aLine = new Geom_Line(gce_MakeLin(aPointHypr1,aPointHypr2));
Handle(Geom_TrimmedCurve) aTrimmed1 =
new Geom_TrimmedCurve(aLine, 0, aPointHypr1.Distance(aPointHypr2));
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_YELLOW));
if(WAIT_A_LITTLE) return;
//output of display MinorRadius (yellow color)
Handle_Geom_Line aLine1 = new Geom_Line(gce_MakeLin(aPointHypr3, gp_Dir(0,-1,0)));
Handle_Geom_TrimmedCurve aTrimmed2 = new Geom_TrimmedCurve(aLine1, 0,100);
Handle(Geom_Line) aLine1 = new Geom_Line(gce_MakeLin(aPointHypr3, gp_Dir(0,-1,0)));
Handle(Geom_TrimmedCurve) aTrimmed2 = new Geom_TrimmedCurve(aLine1, 0,100);
drawCurve(aTrimmed2,Quantity_Color(Quantity_NOC_YELLOW));
if(WAIT_A_LITTLE) return;
//output hyperbola
Handle_Geom_Hyperbola aHyperbola2 = new Geom_Hyperbola(aHypr2);
Handle_Geom_TrimmedCurve aHyprTrimmed1 =
Handle(Geom_Hyperbola) aHyperbola2 = new Geom_Hyperbola(aHypr2);
Handle(Geom_TrimmedCurve) aHyprTrimmed1 =
new Geom_TrimmedCurve(aHyperbola2,-2,2,Standard_True);
drawCurve(aHyprTrimmed1);
}
@@ -396,8 +396,8 @@ void DCA_Presentation::sampleCircle()
if(WAIT_A_LITTLE) return;
//output radius
Handle_Geom_Line aLine = new Geom_Line(gce_MakeLin (aCenterPoint,gp_Dir(0,0,1)));
Handle_Geom_TrimmedCurve aTrimmed = new Geom_TrimmedCurve(aLine,0,300);
Handle(Geom_Line) aLine = new Geom_Line(gce_MakeLin (aCenterPoint,gp_Dir(0,0,1)));
Handle(Geom_TrimmedCurve) aTrimmed = new Geom_TrimmedCurve(aLine,0,300);
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
@@ -519,16 +519,16 @@ void DCA_Presentation::sampleEllipse()
gp_Lin aLine1 = aMakeLin1.Value();
//output MajorRadius
Handle_Geom_Line aLineMajorRadius = new Geom_Line(aLine);
Handle_Geom_TrimmedCurve aTrimmed =
Handle(Geom_Line) aLineMajorRadius = new Geom_Line(aLine);
Handle(Geom_TrimmedCurve) aTrimmed =
new Geom_TrimmedCurve(aLineMajorRadius,0,120);
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output MinorRadius
Handle_Geom_Line aLineMinorrRadius = new Geom_Line(aLine1);
Handle_Geom_TrimmedCurve aTrimmed1 =
Handle(Geom_Line) aLineMinorrRadius = new Geom_Line(aLine1);
Handle(Geom_TrimmedCurve) aTrimmed1 =
new Geom_TrimmedCurve(aLineMinorrRadius,0,300);
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
@@ -588,8 +588,8 @@ void DCA_Presentation::samplePlane()
if(WAIT_A_LITTLE) return;
Handle_Geom_Plane aPln = new Geom_Plane(aPlane);
Handle_Geom_RectangularTrimmedSurface aPlnTrimmed =
Handle(Geom_Plane) aPln = new Geom_Plane(aPlane);
Handle(Geom_RectangularTrimmedSurface) aPlnTrimmed =
new Geom_RectangularTrimmedSurface(aPln,-300,300,-300,300,Standard_True,Standard_True);
drawSurface(aPlnTrimmed);
@@ -604,8 +604,8 @@ void DCA_Presentation::samplePlane()
if(WAIT_A_LITTLE) return;
Handle_Geom_Plane aPln1 = new Geom_Plane(aPlane1);
Handle_Geom_RectangularTrimmedSurface aPlnTrimmed1 =
Handle(Geom_Plane) aPln1 = new Geom_Plane(aPlane1);
Handle(Geom_RectangularTrimmedSurface) aPlnTrimmed1 =
new Geom_RectangularTrimmedSurface(aPln1,-200,300,-200,300,Standard_True,Standard_True);
drawSurface(aPlnTrimmed1);
@@ -693,14 +693,14 @@ void DCA_Presentation::sampleCylindricalSurface()
gp_Dir aDir1(0,0,1);
gce_MakeLin aMakeLin(aCenterPoint,aDir1);
gp_Lin aLin = aMakeLin.Value();
Handle_Geom_Line aLine = new Geom_Line(aLin);
Handle_Geom_TrimmedCurve aTrimmed = new Geom_TrimmedCurve(aLine,-100,0);
Handle(Geom_Line) aLine = new Geom_Line(aLin);
Handle(Geom_TrimmedCurve) aTrimmed = new Geom_TrimmedCurve(aLine,-100,0);
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
// output cylinder
Handle_Geom_CylindricalSurface aCylSurface =
Handle(Geom_CylindricalSurface) aCylSurface =
new Geom_CylindricalSurface(aCyl);
Handle_Geom_RectangularTrimmedSurface aCylTrimmed =
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed =
new Geom_RectangularTrimmedSurface(aCylSurface,0,2*PI,-200,300,Standard_True,Standard_True);
drawSurface(aCylTrimmed);
if(WAIT_A_LITTLE) return;
@@ -716,14 +716,14 @@ void DCA_Presentation::sampleCylindricalSurface()
drawVector(aCylinderPoint2,gp_Vec(aCylinderPoint2,aCylinderPoint3)*3,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output radius
Handle_Geom_Line aLine1 = new Geom_Line(gce_MakeLin(aCylinderPoint1,aDir1));
Handle_Geom_TrimmedCurve aTrimmed1 = new Geom_TrimmedCurve(aLine1,-80,0);
Handle(Geom_Line) aLine1 = new Geom_Line(gce_MakeLin(aCylinderPoint1,aDir1));
Handle(Geom_TrimmedCurve) aTrimmed1 = new Geom_TrimmedCurve(aLine1,-80,0);
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output cylinder
Handle_Geom_CylindricalSurface aCylSurface1 =
Handle(Geom_CylindricalSurface) aCylSurface1 =
new Geom_CylindricalSurface(aCyl1);
Handle_Geom_RectangularTrimmedSurface aCylTrimmed1 =
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed1 =
new Geom_RectangularTrimmedSurface(aCylSurface1,0,2*PI,-300,100,Standard_True,Standard_True);
drawSurface(aCylTrimmed1);
if(WAIT_A_LITTLE) return;
@@ -731,17 +731,17 @@ void DCA_Presentation::sampleCylindricalSurface()
//METHOD 3.(output of dispay)
//output base cylinder
Handle_Geom_CylindricalSurface aCylSurf = new Geom_CylindricalSurface(aCylinder);
Handle_Geom_RectangularTrimmedSurface aCylTrimmed2 =
Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aCylinder);
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed2 =
new Geom_RectangularTrimmedSurface(aCylSurf,0,2*PI,-200,200,Standard_True,Standard_True);
drawSurface(aCylTrimmed2 ,Quantity_Color(Quantity_NOC_WHITE));
//output point
drawPoint(aCylinderPoint4);
if(WAIT_A_LITTLE) return;
//output cylinder
Handle_Geom_CylindricalSurface aCylSurface2 =
Handle(Geom_CylindricalSurface) aCylSurface2 =
new Geom_CylindricalSurface(aCyl2);
Handle_Geom_RectangularTrimmedSurface aCylTrimmed3 =
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed3 =
new Geom_RectangularTrimmedSurface(aCylSurface2,0,2*PI,-200,200,Standard_True,Standard_True);
drawSurface(aCylTrimmed3);
if(WAIT_A_LITTLE) return;
@@ -753,9 +753,9 @@ void DCA_Presentation::sampleCylindricalSurface()
drawCurve(new Geom_Circle(aCirc),Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output cylinder
Handle_Geom_CylindricalSurface aCylSurface3 =
Handle(Geom_CylindricalSurface) aCylSurface3 =
new Geom_CylindricalSurface(aCyl3);
Handle_Geom_RectangularTrimmedSurface aCylTrimmed4 =
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed4 =
new Geom_RectangularTrimmedSurface(aCylSurface3,0,2*PI,-200,200,Standard_True,Standard_True);
drawSurface(aCylTrimmed4);
}
@@ -800,8 +800,8 @@ void DCA_Presentation::sampleToroidalSurface()
if(WAIT_A_LITTLE) return;
//output MajorRadius
Handle_Geom_Line R1 = new Geom_Line(gce_MakeLin(aCenterPoint, gp_Dir(0,1,0)));
Handle_Geom_TrimmedCurve aTrimmedR1 = new Geom_TrimmedCurve(R1,0,MajorRadius);
Handle(Geom_Line) R1 = new Geom_Line(gce_MakeLin(aCenterPoint, gp_Dir(0,1,0)));
Handle(Geom_TrimmedCurve) aTrimmedR1 = new Geom_TrimmedCurve(R1,0,MajorRadius);
drawCurve(aTrimmedR1, Quantity_Color(Quantity_NOC_WHITE));
drawCurve(new Geom_Circle(anAx3.Ax2(), MajorRadius));
@@ -809,7 +809,7 @@ void DCA_Presentation::sampleToroidalSurface()
// output MinorRadius as a circle
gp_Ax2 aMinorRadAx(aTrimmedR1->EndPoint(), gp_Dir(0,0,1));
Handle_Geom_Circle aMinorRadCirc = new Geom_Circle(aMinorRadAx, MinorRadius);
Handle(Geom_Circle) aMinorRadCirc = new Geom_Circle(aMinorRadAx, MinorRadius);
drawCurve(aMinorRadCirc);
if(WAIT_A_LITTLE) return;
@@ -915,28 +915,28 @@ void DCA_Presentation::sampleConicalSurface()
gp_Dir aDir1(0,1,0);
//output first radius
Handle_Geom_Line aLine = new Geom_Line(gce_MakeLin(aConePnt,aDir1));
Handle_Geom_TrimmedCurve aTrimmed = new Geom_TrimmedCurve(aLine,0,100);
Handle(Geom_Line) aLine = new Geom_Line(gce_MakeLin(aConePnt,aDir1));
Handle(Geom_TrimmedCurve) aTrimmed = new Geom_TrimmedCurve(aLine,0,100);
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
//output second radius
Handle_Geom_Line aLine1 = new Geom_Line(gce_MakeLin(aConePnt1,aDir1));
Handle_Geom_TrimmedCurve aTrimmed1 = new Geom_TrimmedCurve(aLine1,0,50);
Handle(Geom_Line) aLine1 = new Geom_Line(gce_MakeLin(aConePnt1,aDir1));
Handle(Geom_TrimmedCurve) aTrimmed1 = new Geom_TrimmedCurve(aLine1,0,50);
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output ruling of cone
Handle_Geom_Line aLine2 = new Geom_Line(gce_MakeLin(aConePnt,aConePnt1));
Handle_Geom_TrimmedCurve aTrimmed2 =
Handle(Geom_Line) aLine2 = new Geom_Line(gce_MakeLin(aConePnt,aConePnt1));
Handle(Geom_TrimmedCurve) aTrimmed2 =
new Geom_TrimmedCurve(aLine2,0,aConePnt.Distance(aConePnt1));
drawCurve(aTrimmed2,Quantity_Color(Quantity_NOC_RED));
if(WAIT_A_LITTLE) return;
//output cone
Handle_Geom_ConicalSurface aConSurface1 = new Geom_ConicalSurface(aCone1);
Handle_Geom_RectangularTrimmedSurface aConTrimmed1 =
Handle(Geom_ConicalSurface) aConSurface1 = new Geom_ConicalSurface(aCone1);
Handle(Geom_RectangularTrimmedSurface) aConTrimmed1 =
new Geom_RectangularTrimmedSurface(aConSurface1,0,2*PI,-50,450,Standard_True,Standard_True);
drawSurface(aConTrimmed1);
@@ -955,18 +955,18 @@ void DCA_Presentation::sampleConicalSurface()
if(WAIT_A_LITTLE) return;
//output of first radius
Handle_Geom_Line aLineR1 = new Geom_Line(gce_MakeLin (aConePnt,aDir1));
Handle_Geom_TrimmedCurve aTrimmedR1 = new Geom_TrimmedCurve(aLineR1,0,Radius1);
Handle(Geom_Line) aLineR1 = new Geom_Line(gce_MakeLin (aConePnt,aDir1));
Handle(Geom_TrimmedCurve) aTrimmedR1 = new Geom_TrimmedCurve(aLineR1,0,Radius1);
drawCurve(aTrimmedR1,Quantity_Color(Quantity_NOC_WHITE));
//output of second radius
Handle_Geom_Line aLineR2 = new Geom_Line(gce_MakeLin (aConePnt2,aDir1));
Handle_Geom_TrimmedCurve aTrimmedR2 = new Geom_TrimmedCurve(aLineR2,0,Radius2);
Handle(Geom_Line) aLineR2 = new Geom_Line(gce_MakeLin (aConePnt2,aDir1));
Handle(Geom_TrimmedCurve) aTrimmedR2 = new Geom_TrimmedCurve(aLineR2,0,Radius2);
drawCurve(aTrimmedR2,Quantity_Color(Quantity_NOC_WHITE));
//output cone
Handle_Geom_ConicalSurface aConSurface2 = new Geom_ConicalSurface(aCone2);
Handle_Geom_RectangularTrimmedSurface aConTrimmed2 =
Handle(Geom_ConicalSurface) aConSurface2 = new Geom_ConicalSurface(aCone2);
Handle(Geom_RectangularTrimmedSurface) aConTrimmed2 =
new Geom_RectangularTrimmedSurface(aConSurface2,0,2*PI,-120,400,Standard_True,Standard_True);
drawSurface(aConTrimmed2);
@@ -981,13 +981,13 @@ void DCA_Presentation::sampleConicalSurface()
if(WAIT_A_LITTLE) return;
//output radius
Handle_Geom_Line aLine3 = new Geom_Line(gce_MakeLin (aCenterPoint,aDir1));
Handle_Geom_TrimmedCurve aTrimmed3 = new Geom_TrimmedCurve(aLine3,0,70);
Handle(Geom_Line) aLine3 = new Geom_Line(gce_MakeLin (aCenterPoint,aDir1));
Handle(Geom_TrimmedCurve) aTrimmed3 = new Geom_TrimmedCurve(aLine3,0,70);
drawCurve(aTrimmed3 ,Quantity_Color(Quantity_NOC_WHITE));
//output cone
Handle_Geom_ConicalSurface aConSurface3 = new Geom_ConicalSurface(aCone3);
Handle_Geom_RectangularTrimmedSurface aConTrimmed =
Handle(Geom_ConicalSurface) aConSurface3 = new Geom_ConicalSurface(aCone3);
Handle(Geom_RectangularTrimmedSurface) aConTrimmed =
new Geom_RectangularTrimmedSurface(aConSurface3,0,2*PI,-300,300,Standard_True,Standard_True);
drawSurface(aConTrimmed);
@@ -1011,30 +1011,30 @@ void DCA_Presentation::sampleConicalSurface()
if(WAIT_A_LITTLE) return;
//output ruling of cone
Handle_Geom_Line aLine4 = new Geom_Line(gce_MakeLin (aPoint_3,aPoint_4));
Handle_Geom_TrimmedCurve aTrimmed4 =
Handle(Geom_Line) aLine4 = new Geom_Line(gce_MakeLin (aPoint_3,aPoint_4));
Handle(Geom_TrimmedCurve) aTrimmed4 =
new Geom_TrimmedCurve(aLine4,0,aPoint_3.Distance(aPoint_4));
drawCurve(aTrimmed4 ,Quantity_Color(Quantity_NOC_RED));
if(WAIT_A_LITTLE) return;
//output first radius
Handle_Geom_Line aLine5 = new Geom_Line(gce_MakeLin (aPoint_3,aDir1));
Handle_Geom_TrimmedCurve aTrimmed5 = new Geom_TrimmedCurve(aLine5,0,50);
Handle(Geom_Line) aLine5 = new Geom_Line(gce_MakeLin (aPoint_3,aDir1));
Handle(Geom_TrimmedCurve) aTrimmed5 = new Geom_TrimmedCurve(aLine5,0,50);
drawCurve(aTrimmed5 ,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output second radius
Handle_Geom_Line aLine6 = new Geom_Line(gce_MakeLin (aPoint_4,aDir1));
Handle_Geom_TrimmedCurve aTrimmed6 = new Geom_TrimmedCurve(aLine6,0,60);
Handle(Geom_Line) aLine6 = new Geom_Line(gce_MakeLin (aPoint_4,aDir1));
Handle(Geom_TrimmedCurve) aTrimmed6 = new Geom_TrimmedCurve(aLine6,0,60);
drawCurve(aTrimmed6 ,Quantity_Color(Quantity_NOC_WHITE));
if(WAIT_A_LITTLE) return;
//output cone
Handle_Geom_ConicalSurface aConSurface4 = new Geom_ConicalSurface(aCone4);
Handle_Geom_RectangularTrimmedSurface aConTrimmed4 =
Handle(Geom_ConicalSurface) aConSurface4 = new Geom_ConicalSurface(aCone4);
Handle(Geom_RectangularTrimmedSurface) aConTrimmed4 =
new Geom_RectangularTrimmedSurface(aConSurface4,0,2*PI,-300,300,Standard_True,Standard_True);
drawSurface(aConTrimmed4);

View File

@@ -199,7 +199,7 @@ void Extrema_Presentation::sampleCurveSur()
TCollection_AsciiString aText(
" // the curve - first object for finding the extrema." EOL
" Handle(Geom_Curve) aCurve;" EOL
" Handle_TColgp_HArray1OfPnt aPoles = new TColgp_HArray1OfPnt(1, 4);" EOL EOL
" Handle(TColgp_HArray1OfPnt) aPoles = new TColgp_HArray1OfPnt(1, 4);" EOL EOL
" // points to build the curves" EOL
" Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}}; " EOL EOL
@@ -239,7 +239,7 @@ void Extrema_Presentation::sampleCurveSur()
// the curve - first object for finding the extrema.
Handle(Geom_Curve) aCurve;
Handle_TColgp_HArray1OfPnt aPoles = new TColgp_HArray1OfPnt(1, 4);
Handle(TColgp_HArray1OfPnt) aPoles = new TColgp_HArray1OfPnt(1, 4);
// points to build the curves
Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}};
@@ -429,7 +429,7 @@ void Extrema_Presentation::sampleShellShell()
" for (Standard_Integer j=0; j < 3; j++)" EOL
" aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);" EOL EOL
" Handle_Geom_BezierSurface aSurface = new Geom_BezierSurface(aSurPoles);" EOL EOL
" Handle(Geom_BezierSurface) aSurface = new Geom_BezierSurface(aSurPoles);" EOL EOL
" // creating a TopoDS_Shell from Geom_Surface" EOL
" TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);" EOL EOL
@@ -473,7 +473,7 @@ void Extrema_Presentation::sampleShellShell()
for (Standard_Integer j=0; j < 3; j++)
aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);
Handle_Geom_BezierSurface aSurface = new Geom_BezierSurface(aSurPoles);
Handle(Geom_BezierSurface) aSurface = new Geom_BezierSurface(aSurPoles);
// creating a TopoDS_Shell from Geom_Surface
TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);
@@ -535,10 +535,10 @@ void Extrema_Presentation::doShapeShapeExtrema(const TopoDS_Shape& theShape1,
{
displayExtemaEdge(anExtrema.PointOnShape1(i), anExtrema.PointOnShape2(i));
Handle_AIS_Shape aSupportShape1 = new AIS_Shape(anExtrema.SupportOnShape1(i));
Handle(AIS_Shape) aSupportShape1 = new AIS_Shape(anExtrema.SupportOnShape1(i));
aSupportShape1->SetMaterial(Graphic3d_NOM_PLASTIC);
aSupportShape1->SetColor(Quantity_NOC_GRAY97);
Handle_AIS_Shape aSupportShape2 = new AIS_Shape(anExtrema.SupportOnShape2(i));
Handle(AIS_Shape) aSupportShape2 = new AIS_Shape(anExtrema.SupportOnShape2(i));
aSupportShape2->SetMaterial(Graphic3d_NOM_PLASTIC);
aSupportShape2->SetColor(Quantity_NOC_GRAY97);
getAISContext()->Display(aSupportShape1, Standard_False);

View File

@@ -241,7 +241,7 @@ Standard_Boolean GProps_Presentation::GProps(GProp_GProps& aProps,
if (WAIT_A_SECOND) return Standard_False;
Handle_AIS_Point aPointIO = drawPoint(
Handle(AIS_Point) aPointIO = drawPoint(
aCenterOfMass, MAIN_ELEMS_COLOR, Standard_False);
aPointIO->UnsetMarker();
aPointIO->SetMarker(Aspect_TOM_O);
@@ -265,7 +265,7 @@ Standard_Boolean GProps_Presentation::GProps(GProp_GProps& aProps,
}
// display the cirle with radius = aRadiusOfGyration
Handle_Geom_Circle aCirc = new Geom_Circle(anInertialCoordSys, aRadiusOfGyration);
Handle(Geom_Circle) aCirc = new Geom_Circle(anInertialCoordSys, aRadiusOfGyration);
drawCurve(aCirc, CUSTOM_INERTIAL_ELEMS_COLOR);
return Standard_True;
@@ -327,7 +327,7 @@ void GProps_Presentation::samplePoints()
//if (WAIT_A_SECOND) return;
Handle_AIS_Point aPointIO = drawPoint(
Handle(AIS_Point) aPointIO = drawPoint(
aBaryCentre, MAIN_ELEMS_COLOR, Standard_False);
aPointIO->SetMarker(Aspect_TOM_STAR);
getAISContext()->Display(aPointIO);
@@ -373,7 +373,7 @@ void GProps_Presentation::sampleCurves()
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
// edge 2 is a bezier curve that starts in edge1's end point
Handle_Geom_BezierCurve aCurve = new Geom_BezierCurve(aPoints);
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve(aPoints);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aCurve);
// edge 1 is a linear edge between 2 points
@@ -575,9 +575,9 @@ void GProps_Presentation::sampleSystem()
for (Standard_Integer i=0; i < nPoints; i++)
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
Handle_Geom_BezierCurve aCurve = new Geom_BezierCurve(aPoints);
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve(aPoints);
gp_Ax1 anAxis(aPoints(1), gp_Dir(0,1,0));
Handle_Geom_SurfaceOfRevolution aSurface = new Geom_SurfaceOfRevolution(aCurve, anAxis);
Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aCurve, anAxis);
TopoDS_Solid aSolid = BRepBuilderAPI_MakeSolid(BRepBuilderAPI_MakeShell(aSurface));
TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(gp_Pnt(5*k, 2*k, 0), gp_Pnt(12*k, 7*k, 0));
@@ -595,8 +595,8 @@ void GProps_Presentation::sampleSystem()
aBuilder.Perform(aWing1, Standard_True);
TopoDS_Face aWing2 = TopoDS::Face(aBuilder.Shape());
Handle_Geom_Circle aCirc = new Geom_Circle(gp_Ax2(gp_Pnt(3*k, 11*k, 0), gp_Dir(0,-0.2,0.8)), (12-3)*k);
Handle_Geom_TrimmedCurve aTrimCirc = new Geom_TrimmedCurve(aCirc, -PI/2, PI/2);
Handle(Geom_Circle) aCirc = new Geom_Circle(gp_Ax2(gp_Pnt(3*k, 11*k, 0), gp_Dir(0,-0.2,0.8)), (12-3)*k);
Handle(Geom_TrimmedCurve) aTrimCirc = new Geom_TrimmedCurve(aCirc, -PI/2, PI/2);
TopoDS_Edge aSpoiler = BRepBuilderAPI_MakeEdge(aTrimCirc);
TopoDS_Edge anArrow = BRepBuilderAPI_MakeEdge(gp_Pnt(3*k, 0, 0), gp_Pnt(3*k, -5*k, 0));

View File

@@ -95,7 +95,7 @@ void GeomConstraints_Presentation::DoSample()
// Function creating Surface,BSPline,Bezier and 2dBSpline Curves
//=========================================================================================
static Handle_Geom_BSplineCurve createBSplineCurve(const Standard_Integer nPoles,
static Handle(Geom_BSplineCurve) createBSplineCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][3])
{
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
@@ -111,7 +111,7 @@ static Handle_Geom_BSplineCurve createBSplineCurve(const Standard_Integer nPoles
}
static Handle_Geom_BezierCurve createBezierCurve(const Standard_Integer nPoles,
static Handle(Geom_BezierCurve) createBezierCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][3])
{
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
@@ -123,7 +123,7 @@ static Handle_Geom_BezierCurve createBezierCurve(const Standard_Integer nPoles,
return aBCurve;
}
static Handle_Geom2d_BSplineCurve battenCurve(const Standard_Real& theAngle1,
static Handle(Geom2d_BSplineCurve) battenCurve(const Standard_Real& theAngle1,
const Standard_Real& theAngle2)
{
//define points
@@ -149,10 +149,10 @@ static Handle_Geom2d_BSplineCurve battenCurve(const Standard_Real& theAngle1,
}
static Handle_Geom_Surface createSurface(
static Handle(Geom_Surface) createSurface(
const Standard_Integer endBound,
TColgp_Array1OfPnt& thePoint,
const Handle_Geom_Plane& thePlane)
const Handle(Geom_Plane)& thePlane)
{
Standard_Integer Degree = 3;
Standard_Integer NbPtsOnCur = 10;
@@ -630,7 +630,7 @@ void GeomConstraints_Presentation::sample3()
}
aFile.close();
Handle_AIS_InteractiveObject anIO,aNewIO;
Handle(AIS_InteractiveObject) anIO,aNewIO;
for(Standard_Integer j = 1; j <= int(aSize / 20); j++)
{

View File

@@ -168,9 +168,9 @@ void Glue_Presentation::sampleCylinder()
TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,0,0),gp_Pnt(24,15,0));
TopoDS_Edge e5 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,15,0),gp_Pnt(0,15,0));
TopoDS_Edge e6 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,15,0),gp_Pnt(0,0,0));
Handle_Geom_Circle e2C = new Geom_Circle(gp_Ax2(gp_Pnt(12,0,0), gp_Dir(0,0,1)), 7);
Handle(Geom_Circle) e2C = new Geom_Circle(gp_Ax2(gp_Pnt(12,0,0), gp_Dir(0,0,1)), 7);
e2C->Rotate(gp_Ax1(gp_Pnt(12,0,0),gp_Dir(0,0,1)),PI);
Handle_Geom_TrimmedCurve e2A = new Geom_TrimmedCurve(e2C, PI, 2*PI);
Handle(Geom_TrimmedCurve) e2A = new Geom_TrimmedCurve(e2C, PI, 2*PI);
TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(e2A);
BRepBuilderAPI_MakeWire wireMaker(e1,e2,e3,e4);
@@ -311,7 +311,7 @@ void Glue_Presentation::sampleMoreBoxes()
// Purpose : display a shape in wire frame mode
//================================================================
Standard_Boolean Glue_Presentation::drawShapeWf(TopoDS_Shape& aShape,
Handle_AIS_InteractiveObject& io)
Handle(AIS_InteractiveObject)& io)
{
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
getAISContext()->SetDisplayMode(io, AIS_WireFrame, Standard_False);
@@ -325,7 +325,7 @@ Standard_Boolean Glue_Presentation::drawShapeWf(TopoDS_Shape& aShape,
// Purpose : display a shape in shaded mode
//================================================================
Standard_Boolean Glue_Presentation::drawShapeSh(TopoDS_Shape& aShape,
Handle_AIS_InteractiveObject& io)
Handle(AIS_InteractiveObject)& io)
{
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
getAISContext()->SetDisplayMode(io, AIS_Shaded, Standard_False);
@@ -346,7 +346,7 @@ Standard_Boolean Glue_Presentation::displayShapesFaces(TopoDS_Shape& aShape1,
TopTools_ListOfShape& aEdges1,
TopTools_ListOfShape& aEdges2)
{
Handle_AIS_Shape io1,io2,io3,io4,io5,io6;
Handle(AIS_Shape) io1,io2,io3,io4,io5,io6;
if (!drawShapeSh(aShape1, io1)) return Standard_False;
if (!drawShapeSh(aShape2, io2)) return Standard_False;

View File

@@ -13,8 +13,8 @@
class GProp_Glue;
class TCollection_AsciiString;
class TopoDS_Shape;
class Handle_AIS_InteractiveObject;
class TopTools_ListOfShape;
class AIS_InteractiveObject;
#include <TopTools_ListOfShape.hxx>
class Glue_Presentation : public OCCDemo_Presentation
{
@@ -37,10 +37,10 @@ private:
TopTools_ListOfShape&, TopTools_ListOfShape&);
// display a given shape in wire frame mode
Standard_Boolean drawShapeWf(TopoDS_Shape&,Handle_AIS_InteractiveObject&);
Standard_Boolean drawShapeWf(TopoDS_Shape&,Handle(AIS_InteractiveObject)&);
// display a given shape in shaded mode
Standard_Boolean drawShapeSh(TopoDS_Shape&,Handle_AIS_InteractiveObject&);
Standard_Boolean drawShapeSh(TopoDS_Shape&,Handle(AIS_InteractiveObject)&);
void sampleBoxes();
void sampleCylinder();

View File

@@ -78,11 +78,11 @@ void HLR_Presentation::DoSample()
// Purpose : returns Prs3d_Projector object created corresponding
// to the current view parameters
//================================================================
Handle_Prs3d_Projector HLR_Presentation::Projector(gp_Trsf& theTrsf)
Handle(Prs3d_Projector) HLR_Presentation::Projector(gp_Trsf& theTrsf)
{
// retrieve view parameters for creation of Prs3d_Projector object
getViewer()->InitActiveViews();
Handle_V3d_View aView = getViewer()->ActiveView();
Handle(V3d_View) aView = getViewer()->ActiveView();
Standard_Real aProjVecX, aProjVecY, aProjVecZ;
aView->Proj(aProjVecX, aProjVecY, aProjVecZ);
@@ -93,7 +93,7 @@ Handle_Prs3d_Projector HLR_Presentation::Projector(gp_Trsf& theTrsf)
Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;
// create a projector object
Handle_Prs3d_Projector aProjector = new Prs3d_Projector(Standard_False, 0.0,
Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0,
aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);
gp_Pnt At (aPntX,aPntY,aPntZ);
@@ -122,14 +122,14 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
" // initializing aShape ..." EOL
"" EOL
" // Build The algorithm object" EOL
" Handle_HLRBRep_Algo myAlgo = new HLRBRep_Algo();" EOL
" Handle(HLRBRep_Algo) myAlgo = new HLRBRep_Algo();" EOL
" " EOL
" // Add Shapes into the algorithm" EOL
" Standard_Real nbIso = 5; // number of isolines to display" EOL
" myAlgo->Add(aShape, nbIso);" EOL
"" EOL
" // create a projector object" EOL
" Handle_V3d_View aView;" EOL
" Handle(V3d_View) aView;" EOL
" // initializing V3d_View ..." EOL
" " EOL
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
@@ -141,7 +141,7 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
"" EOL
" // create a projector object" EOL
" Handle_Prs3d_Projector aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
" Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
" " EOL
" // Set The Projector" EOL
@@ -189,7 +189,7 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
" Isolines - YELLOW" EOL);
// Build The algorithm object
Handle_HLRBRep_Algo myAlgo = new HLRBRep_Algo();
Handle(HLRBRep_Algo) myAlgo = new HLRBRep_Algo();
// Add Shapes into the algorithm
myAlgo->Add(aShape, nbIso);
@@ -234,7 +234,7 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
TopoDS_Shape OutLineHCompound = aHLRToShape.OutLineHCompound();
TopoDS_Shape IsoLineHCompound = aHLRToShape.IsoLineHCompound();
Handle_AIS_Shape aShapeIO = drawShape(aShape);
Handle(AIS_Shape) aShapeIO = drawShape(aShape);
if (WAIT_A_SECOND) return Standard_False;
@@ -268,13 +268,13 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
" // triangulating aShape with BRepMesh::Mesh" EOL
"" EOL
" // Build The algorithm object" EOL
" Handle_HLRBRep_PolyAlgo myPolyAlgo = new HLRBRep_PolyAlgo();" EOL
" Handle(HLRBRep_PolyAlgo) myPolyAlgo = new HLRBRep_PolyAlgo();" EOL
" " EOL
" // Add Shapes into the algorithm" EOL
" myPolyAlgo->Load(aShape);" EOL
"" EOL
" // create a projector object" EOL
" Handle_V3d_View aView;" EOL
" Handle(V3d_View) aView;" EOL
" // initializing V3d_View ..." EOL
" " EOL
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
@@ -286,7 +286,7 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
"" EOL
" // create a projector object" EOL
" Handle_Prs3d_Projector aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
" Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
" " EOL
" // Set The Projector" EOL
@@ -328,7 +328,7 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
" Isolines - YELLOW" EOL);
// Build The algorithm object
Handle_HLRBRep_PolyAlgo myPolyAlgo = new HLRBRep_PolyAlgo();
Handle(HLRBRep_PolyAlgo) myPolyAlgo = new HLRBRep_PolyAlgo();
// Add Shapes into the algorithm
myPolyAlgo->Load(aShape);
@@ -367,7 +367,7 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
TopoDS_Shape RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound();
TopoDS_Shape OutLineHCompound = aPolyHLRToShape.OutLineHCompound();
Handle_AIS_Shape aShapeIO = drawShape(aShape);
Handle(AIS_Shape) aShapeIO = drawShape(aShape);
if (WAIT_A_SECOND) return Standard_False;
@@ -409,7 +409,7 @@ Standard_Boolean HLR_Presentation::drawHLR(TopoDS_Shape& aVShape,
aVShape.Location(aLoc);
// create a look for a line according to aColor and aLineType
Handle_AIS_Shape anIO = drawShape(aVShape, aColor, Standard_False);
Handle(AIS_Shape) anIO = drawShape(aVShape, aColor, Standard_False);
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_SOLID);
getAISContext()->Display(anIO, HShapeIsNull);
@@ -420,7 +420,7 @@ Standard_Boolean HLR_Presentation::drawHLR(TopoDS_Shape& aVShape,
aHShape.Location(aLoc);
// create a look for a line according to aColor and aLineType
Handle_AIS_Shape anIO = drawShape(aHShape, aColor, Standard_False);
Handle(AIS_Shape) anIO = drawShape(aHShape, aColor, Standard_False);
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_DASH);
getAISContext()->Display(anIO);
@@ -464,7 +464,7 @@ void HLR_Presentation::sampleTorus()
Standard_Real MinorRadius = 10;
//make torus
Handle_Geom_ToroidalSurface aTorSurface = new Geom_ToroidalSurface(anAx3, MajorRadius, MinorRadius);
Handle(Geom_ToroidalSurface) aTorSurface = new Geom_ToroidalSurface(anAx3, MajorRadius, MinorRadius);
TopoDS_Shell aShape = BRepBuilderAPI_MakeShell(aTorSurface);
Standard_Integer nbIso = 3;

View File

@@ -11,7 +11,7 @@
#include <OCCDemo_Presentation.h>
class TopoDS_Shape;
class Handle_Prs3d_Projector;
class Prs3d_Projector;
class gp_Trsf;
class TopLoc_Location;
@@ -28,7 +28,7 @@ public:
// one phase of iterations
private:
Handle_Prs3d_Projector Projector(gp_Trsf& theTrsf);
Handle(Prs3d_Projector) Projector(gp_Trsf& theTrsf);
Standard_Boolean HLR(const TopoDS_Shape&, const Standard_Integer nbIso);
Standard_Boolean PolyHLR(const TopoDS_Shape&);
Standard_Boolean drawHLR(TopoDS_Shape&, TopoDS_Shape&, const TopLoc_Location&,

View File

@@ -70,7 +70,7 @@ void Interpol_Presentation::DoSample()
// Output : vectors theTan, theNewTan.
// Returns : false if failed, true if ok.
//================================================================
static Standard_Boolean calculateNewTangent(const Handle_Geom_BSplineCurve& anInterpolationCurve,
static Standard_Boolean calculateNewTangent(const Handle(Geom_BSplineCurve)& anInterpolationCurve,
gp_Pnt aPointOnCurve, gp_Vec& theTan, gp_Vec& theNewTan,
Standard_Real angle)
{
@@ -128,7 +128,7 @@ void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
" aNoPeriodInterpolate.Perform();" EOL
" // check results" EOL
" if (!aNoPeriodInterpolate.IsDone()) return;" EOL
" Handle_Geom_BSplineCurve anInterpolationCurve = aNoPeriodInterpolate.Curve();" EOL EOL
" Handle(Geom_BSplineCurve) anInterpolationCurve = aNoPeriodInterpolate.Curve();" EOL EOL
" //===================================" EOL
" // Creating a constrained interpolation curve" EOL
@@ -183,9 +183,9 @@ void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
aNoPeriodInterpolate.Perform();
// check results
if (!aNoPeriodInterpolate.IsDone()) return;
Handle_Geom_BSplineCurve anInterpolationCurve = aNoPeriodInterpolate.Curve();
Handle(Geom_BSplineCurve) anInterpolationCurve = aNoPeriodInterpolate.Curve();
Handle_AIS_InteractiveObject aShowCurve = drawCurve(anInterpolationCurve);
Handle(AIS_InteractiveObject) aShowCurve = drawCurve(anInterpolationCurve);
if (WAIT_A_SECOND) return;
//===================================
@@ -197,7 +197,7 @@ void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
Standard_Real scaleVec = 1;
aCopyFlags->Init(Standard_False);
Handle_AIS_InteractiveObject aShowTan;
Handle(AIS_InteractiveObject) aShowTan;
for (i = indexes.Lower(); i <= indexes.Upper(); i++)
{
gp_Pnt aPoint = aPnts->Value(indexes(i));

View File

@@ -11,10 +11,10 @@
#include <OCCDemo_Presentation.h>
class Handle_Geom_BSplineCurve;
class Handle_TColgp_HArray1OfPnt;
class TColStd_Array1OfInteger;
class TColStd_Array1OfReal;
class Geom_BSplineCurve;
#include <TColgp_HArray1OfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
class Interpol_Presentation : public OCCDemo_Presentation
{

View File

@@ -70,7 +70,7 @@ void Intersections_Presentation::DoSample()
//////////////////////////////////////////////////////////////////////
static Handle_Geom2d_BSplineCurve create2dBSplineCurve(const Standard_Integer thePoles,
static Handle(Geom2d_BSplineCurve) create2dBSplineCurve(const Standard_Integer thePoles,
const Standard_Real theCoords[][2])
{
TColgp_Array1OfPnt2d thePoints(1, thePoles);
@@ -86,7 +86,7 @@ static Handle_Geom2d_BSplineCurve create2dBSplineCurve(const Standard_Integer th
}
static Handle_Geom_BSplineSurface createBSplineSurface(const Standard_Real theZCoords[],
static Handle(Geom_BSplineSurface) createBSplineSurface(const Standard_Real theZCoords[],
const Standard_Real theXStep,
const Standard_Real theYStep,
const Standard_Real theXBound,

View File

@@ -145,7 +145,7 @@ void LProps_Presentation::sampleBezierSurface()
sizeof(aPoints)/(sizeof(Standard_Real)*2), aPoints);
}
void LProps_Presentation::showCurveLProps (Handle_Geom_Curve theCurve,
void LProps_Presentation::showCurveLProps (Handle(Geom_Curve) theCurve,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[])
@@ -283,7 +283,7 @@ void LProps_Presentation::showCurveLProps (Handle_Geom_Curve theCurve,
}
}
void LProps_Presentation::showSurfaceLProps (Handle_Geom_Surface theSurface,
void LProps_Presentation::showSurfaceLProps (Handle(Geom_Surface) theSurface,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[][2])

View File

@@ -31,13 +31,13 @@ private:
void samplePBSpline();
void sampleBezierSurface();
void showCurveLProps (Handle_Geom_Curve theCurve,
void showCurveLProps (Handle(Geom_Curve) theCurve,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[]);
// Draws the curve, shows local properties and updates the result dialog
void showSurfaceLProps (Handle_Geom_Surface theSurface,
void showSurfaceLProps (Handle(Geom_Surface) theSurface,
const Standard_CString theName,
const Standard_Integer theNbPoints,
const Standard_Real thePoints[][2]);

View File

@@ -316,7 +316,7 @@ void Offset2d_Presentation::sampleWire2()
drawAndOffsetWire (aWire, aName, aText);
}
void Offset2d_Presentation::drawAndOffsetCurve2d (Handle_Geom2d_Curve theCurve,
void Offset2d_Presentation::drawAndOffsetCurve2d (Handle(Geom2d_Curve) theCurve,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
@@ -339,7 +339,7 @@ void Offset2d_Presentation::drawAndOffsetCurve2d (Handle_Geom2d_Curve theCurve,
getViewer()->ActiveView()->Update();
// Make offset curves
Handle_AIS_InteractiveObject aObj;
Handle(AIS_InteractiveObject) aObj;
for (int i=1; i <= SampleDescrs[myIndex].nNeg; i++)
{
if (WAIT_A_LITTLE)
@@ -381,7 +381,7 @@ void Offset2d_Presentation::drawAndOffsetWire(const TopoDS_Wire& theWire,
setResultText (theText.ToCString());
// Display theWire
Handle_AIS_InteractiveObject aObj = new AIS_Shape (theWire);
Handle(AIS_InteractiveObject) aObj = new AIS_Shape (theWire);
getAISContext()->SetColor (aObj, CurveColor);
getAISContext()->Display (aObj);
getViewer()->InitActiveViews();

View File

@@ -36,7 +36,7 @@ private:
void sampleWire1();
void sampleWire2();
void drawAndOffsetCurve2d (Handle_Geom2d_Curve theCurve,
void drawAndOffsetCurve2d (Handle(Geom2d_Curve) theCurve,
const Standard_CString theName,
TCollection_AsciiString& theText);
void drawAndOffsetWire (const TopoDS_Wire& theWire,

View File

@@ -78,7 +78,7 @@ void PointOnCurve_Presentation::DoSample()
// Purpose : creating a BSpline Curve
//================================================================
static Handle_Geom_BSplineCurve CreateCurve()
static Handle(Geom_BSplineCurve) CreateCurve()
{
Standard_Real aCoords[][3] =
{
@@ -196,7 +196,7 @@ void PointOnCurve_Presentation::sample1()
gce_MakeLin aLin(aPoint1, aPoint2);
Standard_Real aParam = aPoint1.Distance(aPoint2);
Handle_Geom_TrimmedCurve aSeg = new Geom_TrimmedCurve(new Geom_Line(aLin), 0, aParam);
Handle(Geom_TrimmedCurve) aSeg = new Geom_TrimmedCurve(new Geom_Line(aLin), 0, aParam);
drawCurve(aSeg, Quantity_NOC_GREEN1);
}
if (WAIT_A_LITTLE) return;

View File

@@ -10,7 +10,7 @@
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class Handle_Geom_Curve;
class Geom_Curve;
class PointOnCurve_Presentation : public OCCDemo_Presentation
{
@@ -18,8 +18,8 @@ public:
// Construction
PointOnCurve_Presentation();
private:
Handle_AIS_InteractiveObject PointOnCurve_Presentation::DrawCurve (
Handle_Geom_Curve theCurve, Quantity_NameOfColor theColor);
Handle(AIS_InteractiveObject) PointOnCurve_Presentation::DrawCurve (
Handle(Geom_Curve) theCurve, Quantity_NameOfColor theColor);
public:
// Iteration on samples

View File

@@ -73,7 +73,7 @@ Projection_Presentation::Projection_Presentation()
// Function : createCurve
// Purpose : returns a BSpline curve with 10 poles
//================================================================
static Handle_Geom_BSplineCurve createCurve()
static Handle(Geom_BSplineCurve) createCurve()
{
Standard_Real aCoords[][3] = {{-6,3,0},{-5,1,0},{-4,0,0},{-2,1,0},{-1,-1,0},
{0,-1,0},{1,0,0},{2,2,0},{3,1,0},{4,0,0}};
@@ -95,7 +95,7 @@ static Handle_Geom_BSplineCurve createCurve()
// Function : createSurface
// Purpose : returns a BSpline Surface with 8 poles
//================================================================
static Handle_Geom_BSplineSurface createSurface()
static Handle(Geom_BSplineSurface) createSurface()
{
// define points array
TColgp_Array2OfPnt aPoints (1,2,1,4);
@@ -244,7 +244,7 @@ void Projection_Presentation::sample2()
" gp_Dir aDir(0,0,1);" EOL
" gp_Ax3 anAx3(aCenterPoint, aDir);" EOL
" Standard_Real Radius = 300;" EOL
" Handle_Geom_CylindricalSurface aCylSurface =" EOL
" Handle(Geom_CylindricalSurface) aCylSurface =" EOL
" new Geom_CylindricalSurface(anAx3, Radius);" EOL
"" EOL
" // projection of a point onto a surface" EOL
@@ -277,7 +277,7 @@ void Projection_Presentation::sample2()
gp_Dir aDir(0,0,1);
gp_Ax3 anAx3(aCenterPoint, aDir);
Standard_Real Radius = 300;
Handle_Geom_CylindricalSurface aCylSurface =
Handle(Geom_CylindricalSurface) aCylSurface =
new Geom_CylindricalSurface(anAx3, Radius);
// projection of a point onto a surface
@@ -314,7 +314,7 @@ void Projection_Presentation::sample2()
if(WAIT_A_LITTLE) return;
// output cylindrical surface
Handle_Geom_RectangularTrimmedSurface aCylTrimmed =
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed =
new Geom_RectangularTrimmedSurface(aCylSurface,0,2*PI,-200,300,Standard_True,Standard_True);
drawSurface(aCylTrimmed);
@@ -352,21 +352,21 @@ void Projection_Presentation::sample3()
" // define a planar surface" EOL
" gp_Pnt aPlanePnt(0,0,-100);" EOL
" gp_Dir aPlaneDir(0,0,1);" EOL
" Handle_Geom_Plane aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);" EOL
" Handle(Geom_Plane) aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);" EOL
"" EOL
" // create a cylindrical surface" EOL
" gp_Pnt aCylPnt(-100,0,550);" EOL
" gp_Dir aCylDir(0,1,0);" EOL
" gp_Ax3 anAx3(aCylPnt, aCylDir);" EOL
" Standard_Real aRadius = 800;" EOL
" Handle_Geom_CylindricalSurface aCylSurface = " EOL
" Handle(Geom_CylindricalSurface) aCylSurface = " EOL
" new Geom_CylindricalSurface(anAx3, aRadius);" EOL
"" EOL
" // Projection of a curve onto a planar surface" EOL
" Handle_Geom_Curve aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);" EOL
" Handle(Geom_Curve) aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);" EOL
"" EOL
" // Projection of a curve onto a cylindrical surface" EOL
" Handle_Geom_Curve aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);" EOL
" Handle(Geom_Curve) aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);" EOL
);
// create BSpline curve
@@ -378,21 +378,21 @@ void Projection_Presentation::sample3()
// define a planar surface
gp_Pnt aPlanePnt(0,0,-100);
gp_Dir aPlaneDir(0,0,1);
Handle_Geom_Plane aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);
Handle(Geom_Plane) aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);
// create a cylindrical surface
gp_Pnt aCylPnt(-100,0,550);
gp_Dir aCylDir(0,1,0);
gp_Ax3 anAx3(aCylPnt, aCylDir);
Standard_Real aRadius = 800;
Handle_Geom_CylindricalSurface aCylSurface =
Handle(Geom_CylindricalSurface) aCylSurface =
new Geom_CylindricalSurface(anAx3, aRadius);
// Projection of a curve onto a planar surface
Handle_Geom_Curve aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);
Handle(Geom_Curve) aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);
// Projection of a curve onto a cylindrical surface
Handle_Geom_Curve aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);
Handle(Geom_Curve) aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);
// ===== output ===========
// output original curve
@@ -417,7 +417,7 @@ void Projection_Presentation::sample3()
getAISContext()->Erase(aProjCurveIO, Standard_False);
// output the second surface - cylindrical surface
Handle_Geom_RectangularTrimmedSurface aCylTrimmed =
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed =
new Geom_RectangularTrimmedSurface(aCylSurface,PI/2,-PI/2,-450,550,Standard_True,Standard_True);
Handle(AIS_InteractiveObject) aCylIO = drawSurface(
aCylTrimmed, Quantity_Color(Quantity_NOC_YELLOW), Standard_False);

View File

@@ -98,7 +98,7 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
" TopLoc_Location aLocation;" EOL
"" EOL
" // takes the triangulation of the face aFace" EOL
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL
" Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL
"" EOL
" if(!aTr.IsNull())" EOL
" { " EOL
@@ -224,7 +224,7 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
" TopoDS_Face aFace;" EOL
" B.MakeFace(aFace, aSurf, Precision::Confusion());" EOL
" B.Add(aFace, aWire);" EOL
" Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);" EOL
" Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);" EOL
" sfs->Perform();" EOL
" TopoDS_Shape aFixedFace = sfs->Shape();" EOL
" if (aFixedFace.IsNull()) " EOL
@@ -251,7 +251,7 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
TopLoc_Location aLocation;
// takes the triangulation of the face aFace
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);
if(!aTr.IsNull())
{
@@ -377,14 +377,14 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
TopoDS_Face aFace;
B.MakeFace(aFace, aSurf, Precision::Confusion());
B.Add(aFace, aWire);
Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);
sfs->Perform();
TopoDS_Shape aFixedFace = sfs->Shape();
if (aFixedFace.IsNull())
return;
// output surface, make it half transparent
Handle_AIS_InteractiveObject aSurfIO = drawSurface(
Handle(AIS_InteractiveObject) aSurfIO = drawSurface(
aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
aSurfIO->SetTransparency(0.5);
getAISContext()->Display(aSurfIO, Standard_False);

View File

@@ -76,7 +76,7 @@ void Sweep_Presentation::DoSample()
// Auxiliary functions
//////////////////////////////////////////////////////////////////////
static Handle_Geom_Curve mkBezierCurve(const Standard_Integer nPoles,
static Handle(Geom_Curve) mkBezierCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][3],
const Standard_Real aScale = 1,
const gp_XYZ& aShift = gp_XYZ(0,0,0))
@@ -90,7 +90,7 @@ static Handle_Geom_Curve mkBezierCurve(const Standard_Integer nPoles,
return new Geom_BezierCurve (aPoles);
}
static Handle_Geom_Curve mkPBSplineCurve(const Standard_Integer nPoles,
static Handle(Geom_Curve) mkPBSplineCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][3],
const Standard_Real aScale = 1,
const gp_XYZ& aShift = gp_XYZ(0,0,0))
@@ -111,7 +111,7 @@ static Handle_Geom_Curve mkPBSplineCurve(const Standard_Integer nPoles,
return new Geom_BSplineCurve (aPoles, aKnots, aMults, 3, Standard_True);
}
static Handle_Geom2d_Curve mk2dBezierCurve(const Standard_Integer nPoles,
static Handle(Geom2d_Curve) mk2dBezierCurve(const Standard_Integer nPoles,
const Standard_Real theCoords[][2],
const Standard_Real aScale = 1,
const gp_XY& aShift = gp_XY(0,0))
@@ -139,7 +139,7 @@ static TopoDS_Wire mkPolygonWire(const Standard_Integer nPoints,
return aPol.Wire();
}
static Handle_Geom_Curve mkCurve1()
static Handle(Geom_Curve) mkCurve1()
{
Standard_Real aCoords[][3] = {
{0,0,0},{0,0,10},{0,10,10},{0,10,20}
@@ -148,7 +148,7 @@ static Handle_Geom_Curve mkCurve1()
return mkBezierCurve (nPoles, aCoords);
}
static Handle_Geom_Curve mkCurve2()
static Handle(Geom_Curve) mkCurve2()
{
Standard_Real aCoords[][3] = {
{0,0,0},{10,0,0},{20,10,12},{25,30,20},{50,40,50}
@@ -157,7 +157,7 @@ static Handle_Geom_Curve mkCurve2()
return mkBezierCurve (nPoles, aCoords);
}
static Handle_Geom_Curve mkCurve3()
static Handle(Geom_Curve) mkCurve3()
{
Standard_Real aCoords[][3] = {
{50,40,50},{70,30,30},{90,20,20},{100,50,0}
@@ -166,7 +166,7 @@ static Handle_Geom_Curve mkCurve3()
return mkBezierCurve (nPoles, aCoords);
}
static Handle_Geom2d_Curve mk2dCurve1()
static Handle(Geom2d_Curve) mk2dCurve1()
{
Standard_Real aCoords[][2] = {
{0,0},{0.3,0},{0.1,0.5},{0.3,0.6},{0.6,0.5}
@@ -175,7 +175,7 @@ static Handle_Geom2d_Curve mk2dCurve1()
return mk2dBezierCurve (nPoles, aCoords);
}
static Handle_Geom_Surface mkSurface1()
static Handle(Geom_Surface) mkSurface1()
{
Standard_Real aCoords[3][3][3] = {
{{-10,-10,-30},{-10,50,40},{-10,70,-20}},
@@ -292,9 +292,9 @@ static TopoDS_Wire mkWire9()
}
Handle_AIS_InteractiveObject Sweep_Presentation::drawCurveOnSurface
(const Handle_Geom2d_Curve& aC2d,
const Handle_Geom_Surface& aSurf,
Handle(AIS_InteractiveObject) Sweep_Presentation::drawCurveOnSurface
(const Handle(Geom2d_Curve)& aC2d,
const Handle(Geom_Surface)& aSurf,
const Quantity_Color& aColor)
{
Handle(Geom2dAdaptor_HCurve) aHC = new Geom2dAdaptor_HCurve(aC2d);

View File

@@ -10,8 +10,8 @@
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class Handle_Geom2d_Curve;
class Handle_Geom_Surface;
class Geom2d_Curve;
class Geom_Surface;
class Sweep_Presentation : public OCCDemo_Presentation
{
@@ -24,9 +24,9 @@ public:
virtual void DoSample();
// one phase of iterations
Handle_AIS_InteractiveObject drawCurveOnSurface
(const Handle_Geom2d_Curve& aC2d,
const Handle_Geom_Surface& aSurf,
Handle(AIS_InteractiveObject) drawCurveOnSurface
(const Handle(Geom2d_Curve)& aC2d,
const Handle(Geom_Surface)& aSurf,
const Quantity_Color& aColor);
private:

View File

@@ -123,7 +123,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
" TopLoc_Location aLocation;" EOL EOL
" // takes the triangulation of the face aFace:" EOL
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL EOL
" Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL EOL
" if(!aTr.IsNull()) // if this triangulation is not NULL" EOL
" { " EOL
@@ -161,7 +161,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
" if(!aEdge.IsNull()) // if this edge is not NULL" EOL
" {" EOL
" // takes the polygon associated to the edge aEdge:" EOL
" Handle_Poly_PolygonOnTriangulation aPol = " EOL
" Handle(Poly_PolygonOnTriangulation) aPol = " EOL
" BRep_Tool::PolygonOnTriangulation(aEdge,aTr,aEdge.Location());" EOL EOL
" if(!aPol.IsNull()) // if this polygon is not NULL" EOL
@@ -197,7 +197,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
Standard_Integer aNumOfNodes = 0;
Standard_Integer aNumOfTriangles = 0;
Handle_AIS_InteractiveObject aShowEdge,aShowFace,aShowShape;
Handle(AIS_InteractiveObject) aShowEdge,aShowFace,aShowShape;
TopExp_Explorer aExpFace,aExpEdge;
@@ -208,7 +208,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());
TopLoc_Location aLocation;
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);
if(!aTr.IsNull())
{
@@ -232,7 +232,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
if(!aEdge.IsNull())
{
Handle_Poly_PolygonOnTriangulation aPol =
Handle(Poly_PolygonOnTriangulation) aPol =
BRep_Tool::PolygonOnTriangulation(aEdge,aTr,aEdge.Location());
if(!aPol.IsNull())

View File

@@ -83,7 +83,7 @@ void Textures_Presentation::Init()
{
// initialize v3d_view so it displays textures well
getViewer()->InitActiveViews();
Handle_V3d_View aView = getViewer()->ActiveView();
Handle(V3d_View) aView = getViewer()->ActiveView();
aView->SetSurfaceDetail(V3d_TEX_ALL);
aView->SetSize(ZVIEW_SIZE);
@@ -95,7 +95,7 @@ void Textures_Presentation::Init()
" // aShape = ..." EOL
"" EOL
" // create a textured presentation object for aShape" EOL
" Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);" EOL
" Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);" EOL
"" EOL
" TCollection_AsciiString aTFileName;" EOL
"" EOL
@@ -142,12 +142,12 @@ void Textures_Presentation::Init()
//================================================================
void Textures_Presentation::lightsOnOff(Standard_Boolean isOn)
{
static Handle_V3d_Light aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
static Handle_V3d_Light aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
static Handle_V3d_Light aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
static Handle_V3d_Light aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
static Handle_V3d_Light aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
static Handle_V3d_Light aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
static Handle(V3d_Light) aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
static Handle(V3d_Light) aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
static Handle(V3d_Light) aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
static Handle(V3d_Light) aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
static Handle(V3d_Light) aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
static Handle(V3d_Light) aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
if (isOn)
{
@@ -184,7 +184,7 @@ Standard_Boolean Textures_Presentation::displayTextured(const TopoDS_Shape& aSha
Standard_Integer nRepeat)
{
// create a textured presentation object for aShape
Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);
Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);
// load texture from file if it is not an integer value
// integer value indicates a number of texture in predefined textures enumeration
@@ -209,7 +209,7 @@ Standard_Boolean Textures_Presentation::displayTextured(const TopoDS_Shape& aSha
{
lightsOnOff(Standard_False);
Handle_AIS_Shape aAisShape = drawShape(aShape/*, Quantity_NOC_WHITE*/);
Handle(AIS_Shape) aAisShape = drawShape(aShape/*, Quantity_NOC_WHITE*/);
if (WAIT_A_SECOND) return Standard_False;
getAISContext()->Erase(aAisShape, Standard_False);
}
@@ -391,7 +391,7 @@ void Textures_Presentation::samplePredefTexture2()
Standard_Real aXStep = 250, aYStep = 250;
Standard_Real aXBound = -450, aYBound = -300;
Handle_Geom_BSplineSurface aSurface =
Handle(Geom_BSplineSurface) aSurface =
GeomAPI_PointsToBSplineSurface(aZPoints,aXBound,aXStep,aYBound,aYStep,3,8);
TopoDS_Face aShape = BRepBuilderAPI_MakeFace(aSurface);

View File

@@ -70,7 +70,7 @@ void TexturesExt_Presentation::Init()
{
// initialize v3d_view so it displays TexturesExt well
getViewer()->InitActiveViews();
Handle_V3d_View aView = getViewer()->ActiveView();
Handle(V3d_View) aView = getViewer()->ActiveView();
aView->SetSurfaceDetail(V3d_TEX_ALL);
aView->SetSize(ZVIEW_SIZE);
@@ -82,7 +82,7 @@ void TexturesExt_Presentation::Init()
" // aShape = ..." EOL
"" EOL
" // create a textured presentation object for aShape" EOL
" Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);" EOL
" Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);" EOL
"" EOL
" TCollection_AsciiString aTFileName;" EOL
"" EOL
@@ -124,7 +124,7 @@ void TexturesExt_Presentation::Init()
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
// is loaded.
//================================================================
Handle_AIS_TexturedShape TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
Handle(AIS_TexturedShape) TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
TCollection_AsciiString aTFileName,
Standard_Real toScaleU,
Standard_Real toScaleV,
@@ -134,7 +134,7 @@ Handle_AIS_TexturedShape TexturesExt_Presentation::Texturize(const TopoDS_Shape&
Standard_Real originV)
{
// create a textured presentation object for aShape
Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);
Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);
// load texture from file if it is not an integer value
// integer value indicates a number of texture in predefined TexturesExt enumeration
@@ -190,12 +190,12 @@ Standard_Boolean TexturesExt_Presentation::loadShape(TopoDS_Shape& aShape,
//================================================================
void TexturesExt_Presentation::lightsOnOff(Standard_Boolean isOn)
{
static Handle_V3d_Light aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
static Handle_V3d_Light aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
static Handle_V3d_Light aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
static Handle_V3d_Light aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
static Handle_V3d_Light aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
static Handle_V3d_Light aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
static Handle(V3d_Light) aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
static Handle(V3d_Light) aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
static Handle(V3d_Light) aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
static Handle(V3d_Light) aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
static Handle(V3d_Light) aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
static Handle(V3d_Light) aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
if (isOn)
{
@@ -238,14 +238,14 @@ void TexturesExt_Presentation::sampleBottle()
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
// display original shape in shaded display mode
Handle_AIS_Shape aShapeIO = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
Handle(AIS_Shape) aShapeIO = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
getAISContext()->SetDisplayMode(aShapeIO, AIS_Shaded, Standard_False);
DISP(aShapeIO);
Handle_AIS_TexturedShape aTFace1 = Texturize(aFaces(16), "carrelage1.gif", 1, 1, 3, 2);
Handle(AIS_TexturedShape) aTFace1 = Texturize(aFaces(16), "carrelage1.gif", 1, 1, 3, 2);
DISP(aTFace1);
Handle_AIS_TexturedShape aTFace2 = Texturize(aFaces(21), "carrelage1.gif", 1, 1, 3, 2);
Handle(AIS_TexturedShape) aTFace2 = Texturize(aFaces(21), "carrelage1.gif", 1, 1, 3, 2);
DISP(aTFace2);
getViewer()->Update();
@@ -267,7 +267,7 @@ void TexturesExt_Presentation::sampleTerrain()
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
// TopLoc_Location aLoc;
// Handle_Geom_Surface aSur = BRep_Tool::Surface(TopoDS::Face(aFaces(1)), aLoc);
// Handle(Geom_Surface) aSur = BRep_Tool::Surface(TopoDS::Face(aFaces(1)), aLoc);
// Standard_Real u1,u2,v1,v2;
// aSur->Bounds(u1,u2,v1,v2);
// gp_Pnt aPnt = aSur->Value(u1, v1);

View File

@@ -12,7 +12,7 @@
#include <OCCDemo_Presentation.h>
class TopoDS_Shape;
class TCollection_AsciiString;
class Handle_AIS_TexturedShape;
class AIS_TexturedShape;
class TexturesExt_Presentation : public OCCDemo_Presentation
{
@@ -32,7 +32,7 @@ private:
// filename can also be an integer value ("2", "5", etc.), in this case
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
// is loaded.
Handle_AIS_TexturedShape Texturize(
Handle(AIS_TexturedShape) Texturize(
const TopoDS_Shape& aShape, TCollection_AsciiString aTFileName,
Standard_Real toScaleU=1.0, Standard_Real toScaleV=1.0,
Standard_Real toRepeatU=1.0, Standard_Real toRepeatV=1.0,

View File

@@ -77,7 +77,7 @@ void ThruSections_Presentation::DoSample()
// purpose:
//////////////////////////////////////////////////////////////////////
static Handle_Geom_BSplineCurve CreateCurve(Standard_Real aCoords[][3],Standard_Integer nPoles)
static Handle(Geom_BSplineCurve) CreateCurve(Standard_Real aCoords[][3],Standard_Integer nPoles)
{
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
@@ -192,7 +192,7 @@ void ThruSections_Presentation::sample1()
//====================================================================
Handle_AIS_InteractiveObject aShow1,aShow2,aShowWire;
Handle(AIS_InteractiveObject) aShow1,aShow2,aShowWire;
// this data used for building a shape through sections:
Standard_Boolean IsSolid,IsRuled;
@@ -374,7 +374,7 @@ void ThruSections_Presentation::sample2()
//====================================================================
Handle_AIS_InteractiveObject aShow1,aShow2,aShowWire1,aShowWire2,aShowWire3;
Handle(AIS_InteractiveObject) aShow1,aShow2,aShowWire1,aShowWire2,aShowWire3;
// this data used for building a shape through sections:
const Standard_Boolean IsSolid = Standard_False;
@@ -403,8 +403,8 @@ void ThruSections_Presentation::sample2()
Standard_Integer aSize3 = sizeof(aCoords3)/(sizeof(Standard_Real)*3);
// creates curves:
Handle_Geom_BSplineCurve aCurve1 = CreateCurve(aCoords1,aSize1);
Handle_Geom_BSplineCurve aCurve2 = CreateCurve(aCoords2,aSize2);
Handle(Geom_BSplineCurve) aCurve1 = CreateCurve(aCoords1,aSize1);
Handle(Geom_BSplineCurve) aCurve2 = CreateCurve(aCoords2,aSize2);
// creates wires based on the curves:
TopoDS_Wire aW1 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(aCurve1));

View File

@@ -10,7 +10,7 @@
#endif // _MSC_VER > 1000
#include <OCCDemo_Presentation.h>
class TopTools_SequenceOfShape;
#include <TopTools_SequenceOfShape.hxx>
//class TCollection_AsciiString;
class ThruSections_Presentation : public OCCDemo_Presentation

View File

@@ -126,10 +126,10 @@ static TopoDS_Shape CreateRevolShape()
gp_Ax1 anAxis = gp_Ax1(gp_Pnt(0,0,0),gp::DY());
GC_MakeSegment aSegment(gp_Pnt(0,-8*SCALE,0),gp_Pnt(0,-8*SCALE,2*SCALE));
Handle_Geom_TrimmedCurve aLine = aSegment.Value();
Handle_Geom_SurfaceOfRevolution aSurface1 = new Geom_SurfaceOfRevolution(aLine, anAxis);
Handle_Geom_SurfaceOfRevolution aSurface2 = new Geom_SurfaceOfRevolution(aCurve1, anAxis);
Handle_Geom_SurfaceOfRevolution aSurface3 = new Geom_SurfaceOfRevolution(aCurve2, anAxis);
Handle(Geom_TrimmedCurve) aLine = aSegment.Value();
Handle(Geom_SurfaceOfRevolution) aSurface1 = new Geom_SurfaceOfRevolution(aLine, anAxis);
Handle(Geom_SurfaceOfRevolution) aSurface2 = new Geom_SurfaceOfRevolution(aCurve1, anAxis);
Handle(Geom_SurfaceOfRevolution) aSurface3 = new Geom_SurfaceOfRevolution(aCurve2, anAxis);
BRep_Builder aBuilder;
TopoDS_Compound aShape;
@@ -214,10 +214,10 @@ static TopoDS_Shape CreateBSplnShape()
GeomAPI_PointsToBSplineSurface aPTBS;
aPTBS.Init(aZPoints1,aX0,aXStep,aY0,aYStep,3,10,GeomAbs_C3,0.3*SCALE);
Handle_Geom_BSplineSurface aSurface1 = aPTBS.Surface();
Handle(Geom_BSplineSurface) aSurface1 = aPTBS.Surface();
aPTBS.Init(aZPoints2,aX0,aXStep,aY0,aYStep,3,10,GeomAbs_C3,0.3*SCALE);
Handle_Geom_BSplineSurface aSurface2 = aPTBS.Surface();
Handle(Geom_BSplineSurface) aSurface2 = aPTBS.Surface();
TopoDS_Face aFace1,aFace2;
aFace1 = BRepBuilderAPI_MakeFace (aSurface1);
@@ -251,7 +251,7 @@ void TopLProps_Presentation::sample1()
if (aEdge.IsNull()) return;
//show:
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
if(WAIT_A_SECOND) return;
drawShape(aEdge,Quantity_NOC_RED);
if(WAIT_A_SECOND) return;
@@ -281,9 +281,9 @@ void TopLProps_Presentation::sample2()
if (aFace.IsNull()) return;
//show:
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
if(WAIT_A_SECOND) return;
Handle_AIS_InteractiveObject aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
Handle(AIS_InteractiveObject) aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
getAISContext()->SetDisplayMode(aShowFace,AIS_WireFrame);
getAISContext()->Display(aShowFace);
if(WAIT_A_SECOND) return;
@@ -324,7 +324,7 @@ void TopLProps_Presentation::sample3()
Standard_Integer aNbPoints = sizeof(aPoints)/sizeof(Standard_Real);
//show:
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
if(WAIT_A_SECOND) return;
drawShape(aEdge,Quantity_NOC_RED);
@@ -367,9 +367,9 @@ void TopLProps_Presentation::sample4()
Standard_Integer aNbPoints = sizeof(aPoints)/(sizeof(Standard_Real)*2);
//show:
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
if(WAIT_A_SECOND) return;
Handle_AIS_InteractiveObject aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
Handle(AIS_InteractiveObject) aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
getAISContext()->SetDisplayMode(aShowFace,AIS_WireFrame);
getAISContext()->Display(aShowFace);
if(WAIT_A_SECOND) return;
@@ -439,7 +439,7 @@ void TopLProps_Presentation::showEdgeLProps(TopoDS_Edge& theEdge,
setResultText (aText.ToCString());
BRepAdaptor_Curve anAdapCurve (theEdge) ;
Handle_AIS_InteractiveObject aObjs[7];
Handle(AIS_InteractiveObject) aObjs[7];
Standard_Integer maxOrder = 3;
Standard_Real aResol = gp::Resolution();
BRepLProp_CLProps aLProps (anAdapCurve,maxOrder,aResol);

View File

@@ -44,18 +44,18 @@ public:
Standard_EXPORT GeoAlgo_Sol(const Standard_CString aGroundName);
Standard_EXPORT void Build(const Standard_CString aGroundName) ;
Standard_EXPORT void Build(const TColgp_SequenceOfXYZ& aSeqofPoints) ;
Standard_EXPORT Handle_Geom_BSplineSurface Surface() const;
Standard_EXPORT Handle(Geom_BSplineSurface) Surface() const;
Standard_EXPORT Standard_Boolean IsDone() const;
private:
// Methods PRIVATE
//
Standard_EXPORT Handle_Geom_BSplineSurface Read(const Standard_CString aGroundName) ;
Standard_EXPORT Handle(Geom_BSplineSurface) Read(const Standard_CString aGroundName) ;
// Fields PRIVATE
//
Handle_Geom_BSplineSurface myGround;
Handle(Geom_BSplineSurface) myGround;
Standard_Boolean myIsDone;
};

View File

@@ -1119,7 +1119,7 @@ void CGeometryDoc::OnCreateSol()
TopoDS_Face aface = BRepBuilderAPI_MakeFace(GeomSol, Precision::Confusion());
if (!BRepAlgo::IsValid(aface))
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate surface is not valid!", L"CasCade Error", MB_ICONERROR);
Handle_AIS_Shape anAISShape=new AIS_Shape(aface);
Handle(AIS_Shape) anAISShape=new AIS_Shape(aface);
myAISContext->Display(anAISShape, Standard_False);
Fit();
}
@@ -1211,7 +1211,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
" TopLoc_Location aLocation;\n"
"\n"
" // takes the triangulation of the face aFace\n"
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);\n"
" Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);\n"
"\n"
" if(!aTr.IsNull())\n"
" { \n"
@@ -1337,7 +1337,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
" TopoDS_Face aFace;\n"
" B.MakeFace(aFace, aSurf, Precision::Confusion());\n"
" B.Add(aFace, aWire);\n"
" Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);\n"
" Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);\n"
" sfs->Perform();\n"
" TopoDS_Shape aFixedFace = sfs->Shape();\n"
" if (aFixedFace.IsNull()) \n"
@@ -1364,7 +1364,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
TopLoc_Location aLocation;
// takes the triangulation of the face aFace
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);
if(!aTr.IsNull())
{
@@ -1492,14 +1492,14 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
TopoDS_Face aFace;
B.MakeFace(aFace, aSurf, Precision::Confusion());
B.Add(aFace, aWire);
Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);
sfs->Perform();
TopoDS_Shape aFixedFace = sfs->Shape();
if (aFixedFace.IsNull())
return;
// output surface, make it half transparent
Handle_AIS_InteractiveObject aSurfIO = drawSurface(
Handle(AIS_InteractiveObject) aSurfIO = drawSurface(
aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
aSurfIO->SetTransparency(0.5);
myAISContext->Display(aSurfIO,Standard_False);
@@ -1517,8 +1517,8 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
drawShape(aFixedFace);
}
Handle_AIS_InteractiveObject CGeometryDoc::drawSurface
(const Handle_Geom_Surface& theSurface,
Handle(AIS_InteractiveObject) CGeometryDoc::drawSurface
(const Handle(Geom_Surface)& theSurface,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
{
@@ -1529,7 +1529,7 @@ Handle_AIS_InteractiveObject CGeometryDoc::drawSurface
fixParam(v1);
fixParam(v2);
Handle_AIS_Shape aGraphicSurface =
Handle(AIS_Shape) aGraphicSurface =
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
@@ -1569,7 +1569,7 @@ Standard_Boolean CGeometryDoc::WaitForInput (unsigned long aMilliSeconds)
return Standard_False;
}
Handle_AIS_Point CGeometryDoc::drawPoint
Handle(AIS_Point) CGeometryDoc::drawPoint
(const gp_Pnt& aPnt,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay)
@@ -1586,12 +1586,12 @@ Handle_AIS_Point CGeometryDoc::drawPoint
return aGraphicPoint;
}
Handle_AIS_Shape CGeometryDoc::drawShape
Handle(AIS_Shape) CGeometryDoc::drawShape
(const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial,
const Standard_Boolean toDisplay)
{
Handle_AIS_Shape aGraphicShape = new AIS_Shape(theShape);
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
myAISContext->SetMaterial(aGraphicShape, theMaterial, toDisplay);
if (toDisplay)

View File

@@ -30,26 +30,26 @@ public:
void DragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
void InputEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
void MoveEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
void ShiftMoveEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
void ShiftDragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
void ShiftInputEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
void Popup2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
const Handle(V3d_View)& aView );
//-------------------- 3D -------------------//
@@ -61,21 +61,21 @@ public:
const Standard_Integer theMouseY,
const Handle(V3d_View)& theView);
Handle_AIS_InteractiveObject drawSurface
(const Handle_Geom_Surface& theSurface,
Handle(AIS_InteractiveObject) drawSurface
(const Handle(Geom_Surface)& theSurface,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay);
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
// Waits for a user input or a period of time has been elapsed
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given point
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material
@@ -224,16 +224,16 @@ public:
int Current;
void Minimize3D();
void Minimize2D();
Handle_V3d_Viewer GetViewer2D() { return myViewer2D; };
Handle_AIS_InteractiveContext& GetISessionContext() { return myAISContext2D; };
Handle(V3d_Viewer) GetViewer2D() { return myViewer2D; };
Handle(AIS_InteractiveContext)& GetISessionContext() { return myAISContext2D; };
BOOL FitMode;
public:
CResultDialog myCResultDialog;
private:
Handle_V3d_Viewer myViewer2D;
Handle_AIS_InteractiveContext myAISContext2D;
Handle(V3d_Viewer) myViewer2D;
Handle(AIS_InteractiveContext) myAISContext2D;
};

View File

@@ -8,11 +8,10 @@
#include <TColStd_Array1OfReal.hxx>
#include <Geom2d_BSplineCurve.hxx>
IMPLEMENT_STANDARD_HANDLE(ISession2D_Curve,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
ISession2D_Curve::ISession2D_Curve(const Handle_Geom2d_Curve aGeom2dCurve,
ISession2D_Curve::ISession2D_Curve(const Handle(Geom2d_Curve) aGeom2dCurve,
const Aspect_TypeOfLine aTypeOfLine,
const Aspect_WidthOfLine aWidthOfLine,
const Standard_Integer aColorIndex)

View File

@@ -15,7 +15,7 @@
#include <Standard_IStream.hxx>
#include <Standard_CString.hxx>
class TColGeom2d_HSequenceOfCurve;
#include <TColGeom2d_HSequenceOfCurve.hxx>
class PrsMgr_PresentationManager2d;
class Graphic2d_GraphicObject;
class SelectMgr_Selection;
@@ -33,7 +33,7 @@ public:
//
ISession2D_Curve
(const Handle_Geom2d_Curve aGeom2dCurve,
(const Handle(Geom2d_Curve) aGeom2dCurve,
const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID,
const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM,
const Standard_Integer aColorIndex = 4);
@@ -59,7 +59,7 @@ public:
inline Standard_Real GetDiscretisation() const;
inline void SetDiscretisation(const Standard_Real aNewDiscretisation) ;
DEFINE_STANDARD_RTTI(ISession2D_Curve,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
private:
@@ -70,7 +70,7 @@ private:
// Fields PRIVATE
//
Handle_Geom2d_Curve myGeom2dCurve;
Handle(Geom2d_Curve) myGeom2dCurve;
Aspect_TypeOfLine myTypeOfLine;
Aspect_WidthOfLine myWidthOfLine;
Standard_Integer myColorIndex;

View File

@@ -7,7 +7,6 @@
#include "ISession_Curve.h"
#include <StdPrs_PoleCurve.hxx>
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
#ifdef _DEBUG

View File

@@ -20,7 +20,7 @@ public:
ISession_Curve(Handle(Geom_Curve)& aCurve);
virtual ~ISession_Curve();
DEFINE_STANDARD_RTTI(ISession_Curve,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
private:

View File

@@ -13,7 +13,6 @@
static char THIS_FILE[]=__FILE__;
#endif
IMPLEMENT_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
//////////////////////////////////////////////////////////////////////

View File

@@ -26,7 +26,7 @@ public:
ISession_Direction (const gp_Pnt2d& aPnt2d,const gp_Vec2d& aVec2d);
virtual ~ISession_Direction();
DEFINE_STANDARD_RTTI(ISession_Direction,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
private:

View File

@@ -12,7 +12,7 @@
static char THIS_FILE[]=__FILE__;
//#define new DEBUG_NEW
#endif
IMPLEMENT_STANDARD_HANDLE(ISession_Point,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject)
//////////////////////////////////////////////////////////////////////

View File

@@ -22,7 +22,7 @@ public:
ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
ISession_Point(const gp_Pnt& aPoint);
virtual ~ISession_Point();
DEFINE_STANDARD_RTTI(ISession_Point,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject)
private :

View File

@@ -15,7 +15,7 @@
static char THIS_FILE[]=__FILE__;
//#define new DEBUG_NEW
#endif
IMPLEMENT_STANDARD_HANDLE(ISession_Surface,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject)
//////////////////////////////////////////////////////////////////////

View File

@@ -20,7 +20,7 @@ public:
ISession_Surface(Handle(Geom_Surface)& aSurface);
virtual ~ISession_Surface();
DEFINE_STANDARD_RTTI(ISession_Surface,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject)
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0);

View File

@@ -11,7 +11,7 @@
static char THIS_FILE[]=__FILE__;
//#define new DEBUG_NEW
#endif
IMPLEMENT_STANDARD_HANDLE(ISession_Text,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Text,AIS_InteractiveObject)
//////////////////////////////////////////////////////////////////////

View File

@@ -69,7 +69,7 @@ inline Quantity_Factor GetScale() const;
inline void SetScale (const Quantity_Factor aNewScale) ;
DEFINE_STANDARD_RTTI(ISession_Text,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession_Text,AIS_InteractiveObject)
private:

View File

@@ -10,7 +10,6 @@
static char THIS_FILE[]=__FILE__;
#endif
IMPLEMENT_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
#include "DsgPrs_LengthPresentation.hxx"

View File

@@ -24,7 +24,7 @@ public:
ISession_Direction(const gp_Pnt& aPnt,const gp_Pnt& aPnt2);
ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec);
DEFINE_STANDARD_RTTI(ISession_Direction,AIS_InteractiveObject)
DEFINE_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
private:

View File

@@ -4721,7 +4721,7 @@ void CModelingDoc::OnStopStop()
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate face is not valid!", L"CasCade Error", MB_ICONERROR);
myAISContext->CloseLocalContext();
myState = -1;
Handle_AIS_Shape anAISShape = new AIS_Shape(aface);
Handle(AIS_Shape) anAISShape = new AIS_Shape(aface);
myAISContext->SetColor(anAISShape,Quantity_NOC_AZURE);
myAISContext->SetMaterial(anAISShape,Graphic3d_NOM_SILVER);
myAISContext->SetDisplayMode(anAISShape,1);
@@ -5017,7 +5017,7 @@ void CModelingDoc::InputEvent(const Standard_Integer /*x*/,
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate surface is not valid!!!", L"CasCade Error", MB_ICONERROR);
}
Handle_AIS_Shape anAISShape=new AIS_Shape(theFace);
Handle(AIS_Shape) anAISShape=new AIS_Shape(theFace);
myAISContext->SetColor(anAISShape,Quantity_NOC_BLUE1);
myAISContext->SetMaterial(anAISShape,Graphic3d_NOM_SILVER);
myAISContext->SetDisplayMode(anAISShape,1);

View File

@@ -195,7 +195,7 @@ void CViewer2dDoc::OnBUTTONTestLine()
TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(gp_Pnt(10*i,10*j+5,0.), gp_Pnt(10*i,10*j,0.));
TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3,E4);
TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
Handle_AIS_Shape aRect = new AIS_Shape(F);
Handle(AIS_Shape) aRect = new AIS_Shape(F);
//set attributes of boundaries
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
Handle(Prs3d_LineAspect) aLineAttrib =
@@ -280,7 +280,7 @@ void CViewer2dDoc::OnBUTTONTestRect()
TopoDS_Edge E13 = BRepBuilderAPI_MakeEdge(gp_Pnt(42.5,93.,0.), gp_Pnt(0.,68.,0.));
TopoDS_Edge E14 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,68.,0.), gp_Pnt(40.,0.,0.));
TopoDS_Wire W1 = BRepBuilderAPI_MakeWire(E11,E12,E13,E14);
Handle_AIS_Shape aRect1 = new AIS_Shape(W1);
Handle(AIS_Shape) aRect1 = new AIS_Shape(W1);
myAISContext->Display(aRect1);
myAISContext->SetColor(aRect1,Quantity_NOC_YELLOW);
@@ -290,7 +290,7 @@ void CViewer2dDoc::OnBUTTONTestRect()
TopoDS_Edge E23 = BRepBuilderAPI_MakeEdge(gp_Pnt(112.5,93.,0.), gp_Pnt(70.,68.,0.));
TopoDS_Edge E24 = BRepBuilderAPI_MakeEdge(gp_Pnt(70.,68.,0.), gp_Pnt(110.,0.,0.));
TopoDS_Wire W2 = BRepBuilderAPI_MakeWire(E21,E22,E23,E24);
Handle_AIS_Shape aRect2 = new AIS_Shape(W2);
Handle(AIS_Shape) aRect2 = new AIS_Shape(W2);
myAISContext->Display(aRect2);
myAISContext->SetColor(aRect2,Quantity_NOC_YELLOW);
myAISContext->Activate(aRect2,2);

View File

@@ -76,7 +76,7 @@ END_MESSAGE_MAP()
void DlgAttributes::OnColor()
{
Handle_AIS_InteractiveObject Current ;
Handle(AIS_InteractiveObject) Current ;
Quantity_Color CSFColor ;
COLORREF MSColor ;

View File

@@ -73,7 +73,7 @@ protected:
void SetMaterial (Graphic3d_NameOfMaterial Material);
private:
Handle_AIS_InteractiveContext myAISContext;
Handle(AIS_InteractiveContext) myAISContext;
CResultDialog* myCResultDialog;
};

View File

@@ -10,7 +10,6 @@
#include <Prs3d_Drawer.hxx>
#include <Prs3d_ArrowAspect.hxx>
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
#ifdef _DEBUG

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