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

Compare commits

..

38 Commits

Author SHA1 Message Date
ssv-occSolvers
d6dfeac244 Add documentation on XDE basics.
Documentation.


Add documentation on XDE basics.


Add documentation on XDE basics.
2017-08-23 22:23:07 +03:00
ssv
51bb1b8d6d 0029032: Provide XDE interface for exploration of assembly structure
Add assembly graph exploration tool with unit tests.
2017-08-22 16:27:26 +03:00
apv
cba287d62a Update of tests database
Test for 0025930: thickness of spherical cap is invalid
Test for 0025939: SIGSEGV in MakeThickSolid
Test for 0025940: MakeThickSolid creates C0 continuous edges
Test for 0026604: GeomFill_Pipe doesn't fit given bounds
Test for 0026655: ChFi3d_Builder algorithm fails to build fillets if some input edges connect with seam edges
Test for 0026697: BRepFeat_MakePrism returns empty compound
Test for 0026716: Mesher cannot create a mesh of brep model due to ShapeFix_Wire::FixShifted()
Test for 0026735: Adjacent perpendicular edges are detected as overlapped by DRAW command checkoverlap.
Test for 0026793: General Fuse algorithm produces incorrect result
Test for 0026795: Unable to perform General Fuse operation on the attached faces
Test for 0026842: bopsection result does not contain any edges.
Test for 0026882: Edge/Edge intersection algorithm produces incorrect result
Test for 0026883: Wrong result of Boolean Operation
Test for 0026889: Very poor mesh result from shape
Test for 0026928: Edges are meshed too coarsly
Test for 0026933: Section works unstably due to incorrect work of the method IsExistingPaveBlock
Test for 0026943: Wrong projection of helix on cylinder by ShapeConstruct_ProjectCurveOnSurface
Test for 0026957: Unify same domain operation is slow for multiple shells
Test for 0026978: Interactive selection is insensitive to swept shell
Test for 0027004: ShapeUpgrade_UnifySameDomain produces invalid result
Test for 0026280: Mechanism 'ShapeFix' is unable to heal a shape
Test for 0026282: Mechanism 'ShapeFix' has errors revealed by wire tool 'FixTails'
Test for 0026291: BRepMesh produces mesh with gap on the attached shape
Test for 0026382: BRepMesh produces internal nodes outside the face interior
Test for 0027453: Wrongly meshed surface
Test for 0027524: The command checkshape does not find the maximal deviation between curves representations
Test for 0026225: Wrong result of chamfer in case of coinciding bound of chamfer's surface with bound of a face
Test for 0026295: Sweep fails with BRepFill_ContactOnBorder
Test for 0026374: GeomFill_Profiler fails to unify BSplines if one has knot distance less than PConf
Test for 0026558: Failing to build isoline for offset surface
Test for 0026563: Boolean cut operation in new API multi-tool mode performs fuse instead of cut
Test for 0026568: Exception when creating pipe
Test for 0027419: Incorrect result of Edge/Face intersection
Test for 0027469: Regression vs 6.9.1: Wrong result of Edge/Face intersection
Test for 0027471: Wrong result of pipe
Test for 0027472: Wrong result of cut
Test for 0027614: Sewing returns result with too high tolerance
Test for 0026154: Visualization - v3d viewer grid disappears due to automatic z-fit
Test for 0026174: Loss of color after the second write of file (iges).
2017-08-18 12:13:40 +03:00
apn
fe6c26dc50 0029010: Launch custom.bat in samples before calling general environment
Replace calling custom.bat and general env.bat in samples.
2017-08-18 12:13:27 +03:00
nds
9294c8f774 0028631: Modeling Algorithms - Crash while building a 2D circle tangent to another circle and passing through its center
Code correction includes also:
- extending GccEnt to have GccEnt_Position conversion to string value and backward;
- new GeometryTest_DrawableQualifiedCurve2d DRAW object to wrap GccEnt_QualifiedCirc/GccEnt_QualifiedLin.
  It is a DrawTrSurf_Curve2d with GccEnt_Position visualized in orange color.
- qcircle/qline DRAW command to create instance of GeometryTest_DrawableQualifiedCurve2d
- circ2d3Tan DRAW command to wrap GccAna_Circ2d3Tan taking qcircle/qline/point arguments.
2017-08-17 22:21:32 +03:00
kgv
905b0e3175 0028527: Visualization, AIS_InteractiveContext - custom selection presentation is never removed from View 2017-08-17 22:21:31 +03:00
emv
a743814be9 0029000: Update documentation of Boolean operations according to the new Error/Warning reporting system
The documentation of Boolean Component has been updated - calls to ErrorStatus() method have been replaced with calls to HasErrors() method.
2017-08-17 22:21:30 +03:00
abv
efe9d99730 0029009: Configuration - provide a way to get visual dif of SVG images
New helper script svgdiff.bat is added in adm folder.
It can be used for enabling visual diff for SVG images in TortouseGit; see Git guide for details.
2017-08-17 22:21:29 +03:00
abv
471a2ca0bf 0028959: Configuration, genproj - provide warning on update of scripts in root folder (msvc.bat etc.)
When updating files msvc.bat and draw.bat/sh in the root folder by copying template from adm/templates, procedure genproj will give a warning (unless the files are already the same); if the target file is newer, its copy is saved with additional extension .bak.
2017-08-17 22:21:16 +03:00
vro
f97095fada 0028972: A not useful message is printed on copying of data in OCAF 2017-08-17 15:49:17 +03:00
abv
22e7073865 0027561: Since OCCT 7.0.0, exporting a curve to STL creates a file that results in an endless loop when read
Add check for empty triangulation when writing STL file to report error instead of creation of empty file.

STL reader has been improved to properly handle case of empty or small files, and Ascii files without EOL at the end.
2017-08-17 15:49:11 +03:00
kgv
d21ddc4f17 0029007: Visualization, AIS_InteractiveContext - the method for accessing Detected owners iterator is missing
Added new method AIS_InteractiveContext::DetectedCurrentOwner().
AIS_InteractiveContext header has been restructured (methods moved into groups)
and description has been cleaned up.
2017-08-17 15:48:44 +03:00
kgv
51004f1cf9 0027381: Visualization - update description of method AIS_InteractiveContext::SetPixelTolerance() 2017-08-17 15:48:36 +03:00
abv
0ef598d064 0028249: Upgrade Guide - mention need to use option -std=c++0x when using GCC 2017-08-17 15:48:29 +03:00
mkv
fbd0023f75 0028967: Boolean cut fails the first time, works the second time 2017-08-17 15:48:22 +03:00
emv
2783b13ce6 0028893: BOP cut produces result with artifacts consisting of tools parts 2017-08-17 15:48:15 +03:00
kgv
cee2b5567d 0028323: Documentation - explain highlighting logic of AIS_InteractiveObject in the upgrade guide 2017-08-17 15:48:04 +03:00
abv
d7a28edad2 0028225: MFC sample on OCAF uses old-style definition of a Handle-class
Obsolete approach to definition of OCCT RTTI in sample classes generated by WOK from CDL is replaced by usage of standard macros
2017-08-17 15:47:58 +03:00
emv
7337535943 0028892: BOPAlgo_PaveFiller returns status "error: 11" in draw or raises exception in app on the given shapes set
Boolean Operations algorithm - Added processing of the untouched edges (without edge set) in the UpdatePaveBlocks method.

IntCurvesFace_Intersector algorithm - Avoid calculation of the number of sample points on the surfaces with too small UV ranges.
2017-08-17 15:47:50 +03:00
razmyslovich
359cdde7ed 0027358: ShapeAnalysis_Curve::GetSamplePoints iteration logic isn't robust
The iterating logic in ShapeAnalysis_Curve::GetSamplePoints() is made more robust: instead of iterative incrementing parameter by adding step, parameter at each point is calculated independently from index.
This avoids possible accumulation of numeric errors, and ensures that generated points are equally spaced and their quantity is respected in all cases.
2017-08-17 15:47:39 +03:00
skl
2bc6f71528 0028715: Invalid shape produced by reading of attached STEP file. Regression from OCCT-6.9.1 to OCCT-7.0.0.
Corrections: to use fixed shape as result in the non-manifold mode was made.

Regression was due to using modified initial shape as result in the previous version OCCT. At present initial shape is not modified during ShapeProcessing. Therefore modification to use fixed result was made.

Additionally using of nonManifold flag is added to ShapeProcessing.
2017-08-17 15:47:32 +03:00
apv
a2456ed88a 0026516: Creating revolved shapes fails in some cases 2017-08-17 15:47:25 +03:00
mkv
98f5d739e3 0026776: Bad result of section algorithm 2017-08-17 15:47:08 +03:00
apv
dfdfa61fb5 Update of tests database
Test for 0023838: Standard_OutOfRange in Geom_OffsetSurface::LocalDN (called by BRepFill_PipeShell)
Test for 0023866: GccAna_Circ2d3Tan does not find a circle
Test for 0023925: BRepFeat_SplitShape produces invalid shape
Test for 0023942: Pipe algorithms unrobust to number rounding
Test for 0025385: steep increase in tolerance by intersection
Test for 0025395: SIGSEGV in BRepOffsetAPI_MakeThickSolid
Test for 0025458: can a sweep be used to create 1-fold tori (using a closed wire as path)
Test for 0025478: Fillets can not touch
Test for 0025481: Edge must not contain obsolete curve representations
Test for 0025515: Boolean operation become worse for unknown reason.
Test for 0025521: Fillet creates shell with bad orientation of SubShape
Test for 0025551: BRepMesh can produce internal nodes outside the face interior based on distorted BSpline surface
Test for 0025586: Poor mesh quality, or failure of meshing for closed extruded surfaces with holes
Test for 0025626: Loft of ellipses shows wrinkle near seam edge
Test for 0025628: BRepMesh fails to mesh face with open wire, considered as correct by checkshape
Test for 0025693: Wire of BSplines fails bopcheck
Test for 0025730: result of MakeThickSolid aborts the BOPCheck in Geom_OffsetSurface::SetD0
Test for 0025738: BRepMesh fails to produce correct mesh for the face
Test for 0025776: HLR returns intersecting edges in OutLineV of helical sweep
Test for 0025798: BRepFeat_SplitShape returns invalid result
Test for 0025817: crescent face is not meshed
Test for 0025827: BRepMesh does not synchronize parameters of glued vertices on small edges
Test for 0025837: Bad triangulation when IGES loaded in meters
Test for 0025852: Text to BRep algorithm produces bad faces for circled symbols
Test for 0025856: BRepOffsetAPI_ThruSections returns an invalid shape if one wire contains degenerated edges
Test for 0025879: result of blend fails the bopcheck
Test for 0025967: Shape Healing fails to correct a face with missing poles and pcurves
Test for 0026052: Missing pcurves are computed incorrectly on two connected faces laying on the same surface
Test for 0025061: BRepMesh should skip internal wires with self intersections to produce mesh for the shape anyway
Test for 0024490: Computed surface properties differ substantially depending on NaturalRestriction flag
Test for 0024568: Split shape produces an invalid result
Test for 0024692: fuseedge corruption of spherical edge
Test for 0024772: Intersection of cylinder and cone produces incorrect results
Test for 0024954: BRepBuilderAPI_MakeFace adds wire with aribitary orientation
Test for 0025104: Prism from BSpline curve can not be chamfered
Test for 0025206: Fillet creates edge with C0 continuity
Test for 0025979: fillet creates faces with non-closed wires
Test for 0025983: Fusion of sweep and its mirror invalid
Test for 0025994: Boolean fuse result in invalid result.
Test for 0026034: Result of revolution aborts the bopcheck if translated
Test for 0026077: nurbsconvert of psphere fails the bopargcheck
Test for 0025989: toridial surface gets damaged in STEP export
2017-08-10 13:56:12 +03:00
Thomas Krijnen
d37ac0c26e 0028983: Configuration - HAVE_NO_DLL causes compilation to fail on MSVC 2017-08-10 13:56:10 +03:00
emv
a318d719e7 0028982: 2D offset creates faulty result from wire
Protection of the Edge/Edge intersection algorithm (IntTools_EdgeEdge) from incomplete type conversion due to presence of the Trimmed curves by using Adaptors for getting typed curves instead of direct casting.

Test case for the issue.
2017-08-09 18:11:03 +03:00
emv
9d8e074451 0027876: Draw mkoffset does not work
Updating the documentation for the Draw command *mkoffset*.
2017-08-08 18:17:41 +03:00
kgv
cd1918d6b7 0028980: Coding rules - suppress GCC compiler warnings -Warray-bounds within AdvApp2Var 2017-08-08 18:15:13 +03:00
kgv
7379f4424d 0028979: Coding rules - eliminate GCC compiler warnings -Wstrict-aliasing within Graphic3d_ArrayOfPrimitives.lxx 2017-08-08 18:13:51 +03:00
kgv
fdb8a039b4 0028978: Coding rules - suppress GCC compiler warnings -Warray-bounds within NCollection_Array1 2017-08-08 18:11:47 +03:00
aml
1428d37a1a 0028974: Test cases for STL reader/writer
Add new test grid for STL read/write.
2017-08-08 18:10:17 +03:00
kgv
e40d1acc28 0028975: Draw Harness - DBRep_DrawableShape::display() throws exception while displaying shape without free edges in Debug mode 2017-08-08 18:07:37 +03:00
vro
095e90a2c5 0028973: Undo/Redo changes the order of some attributes 2017-08-08 18:04:37 +03:00
kgv
e2c4ce4869 0028971: Configuration - fix compatibility with glibc 2.26+ due to xlocale.h removal 2017-08-08 17:45:40 +03:00
apv
b101eb1ff0 0025023: Check fails after cut operation 2017-08-08 17:44:01 +03:00
nbv
fc935b4f6b 0028944: Cannot find section between two faces
Test case has been created because the problem is not reproduced on the current version of OCCT.
2017-08-08 17:40:57 +03:00
abv
f7b6063134 0028112: Exception during offset computation
Methods D0, D1, D2, D3, DN of the class GeomEvaluator_OffsetSurface are extended by additional tweak to compensate failure of normal calculation in degenerated points on triangular surfaces.
If the point where normal has failed to calculate is located on parametric boundary of the base surface, one more attempt is made with the point shifted towards interior by Precision::PConfusion().
2017-08-03 17:52:51 +03:00
szy
e16302cee1 0028946: Exception on Undo.
//Added additional command ForgetAtt and test case E1 to test issue 28946.
2017-08-02 18:12:09 +03:00
333 changed files with 8650 additions and 4106 deletions

View File

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

31
adm/svgdiff.bat Normal file
View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

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

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

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

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -174,16 +174,26 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
if (nbsu > aMaxSamples) nbsu = aMaxSamples;
if (nbsv > aMaxSamples) nbsv = aMaxSamples;
if (Max(dU, dV) > Min(dU, dV) * aTresh)
{
aMinSamples = 10;
nbsu = (Standard_Integer)(Sqrt(dU / dV) * aMaxSamples);
if (nbsu < aMinSamples) nbsu = aMinSamples;
nbsv = aMaxSamples2 / nbsu;
if (nbsv < aMinSamples)
if (dU > gp::Resolution() && dV > gp::Resolution()) {
if (Max(dU, dV) > Min(dU, dV) * aTresh)
{
nbsv = aMinSamples;
nbsu = aMaxSamples2 / aMinSamples;
aMinSamples = 10;
nbsu = (Standard_Integer)(Sqrt(dU / dV) * aMaxSamples);
if (nbsu < aMinSamples) nbsu = aMinSamples;
nbsv = aMaxSamples2 / nbsu;
if (nbsv < aMinSamples)
{
nbsv = aMinSamples;
nbsu = aMaxSamples2 / aMinSamples;
}
}
}
else {
if (dU < gp::Resolution()) {
nbsu = 1;
}
if (dV < gp::Resolution()) {
nbsv = 1;
}
}

View File

@@ -1371,18 +1371,17 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC,
case GeomAbs_OffsetCurve : {
const Handle(Geom_OffsetCurve)& anOffsetCurve = Handle(Geom_OffsetCurve)::DownCast(aCurve);
const Handle(Geom_Curve)& aBasisCurve = anOffsetCurve->BasisCurve();
const GeomAbs_CurveType aBCType = GeomAdaptor_Curve(aBasisCurve).GetType();
GeomAdaptor_Curve aGBasisCurve(aBasisCurve);
const GeomAbs_CurveType aBCType = aGBasisCurve.GetType();
if (aBCType == GeomAbs_Line) {
break;
}
else if (aBCType == GeomAbs_Circle) {
aResCoeff = 1. / (2 * (anOffsetCurve->Offset() +
Handle(Geom_Circle)::DownCast (aBasisCurve)->Circ().Radius()));
aResCoeff = 1. / (2 * (anOffsetCurve->Offset() + aGBasisCurve.Circle().Radius()));
break;
}
else if (aBCType == GeomAbs_Ellipse) {
aResCoeff = 1. / (anOffsetCurve->Offset() +
Handle(Geom_Ellipse)::DownCast (aBasisCurve)->MajorRadius());
aResCoeff = 1. / (anOffsetCurve->Offset() + aGBasisCurve.Ellipse().MajorRadius());
break;
}
}

View File

@@ -212,7 +212,18 @@ public:
myDeletable (Standard_False)
{
Standard_RangeError_Raise_if (theUpper < theLower, "NCollection_Array1::Create");
myData = (TheItemType *) &theBegin - theLower;
#if (defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
// gcc emits -Warray-bounds warning when NCollection_Array1 is initialized
// from local array with lower index 1 (so that (&theBegin - 1) points out of array bounds).
// NCollection_Array1 initializes myData with a shift to avoid this shift within per-element access.
// It is undesired changing this logic, and -Warray-bounds is not useful here.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
myData = (TheItemType *) &theBegin - theLower;
#if (defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#pragma GCC diagnostic pop
#endif
}
//! Initialise the items with theValue

View File

@@ -223,12 +223,14 @@ public:
Standard_EXPORT virtual void UnsetAttributes();
//! Returns the hilight attributes settings.
//! When not NULL, overrides both Prs3d_TypeOfHighlight_LocalSelected and Prs3d_TypeOfHighlight_Selected defined within AIS_InteractiveContext.
const Handle(Prs3d_Drawer)& HilightAttributes() const { return myHilightDrawer; }
//! Initializes the hilight drawing tool theDrawer.
virtual void SetHilightAttributes(const Handle(Prs3d_Drawer)& theDrawer) { myHilightDrawer = theDrawer; }
//! Returns the hilight attributes settings.
//! When not NULL, overrides both Prs3d_TypeOfHighlight_LocalDynamic and Prs3d_TypeOfHighlight_Dynamic defined within AIS_InteractiveContext.
const Handle(Prs3d_Drawer)& DynamicHilightAttributes() const { return myDynHilightDrawer; }
//! Initializes the dynamic hilight drawing tool.

View File

@@ -80,6 +80,9 @@ namespace
//! Creates Poly_Triangulation from collected data
Handle(Poly_Triangulation) GetTriangulation()
{
if (myTriangles.IsEmpty())
return Handle(Poly_Triangulation)();
Handle(Poly_Triangulation) aPoly = new Poly_Triangulation (myNodes.Length(), myTriangles.Length(), Standard_False);
for (Standard_Integer aNodeIter = 0; aNodeIter < myNodes.Size(); ++aNodeIter)
{
@@ -109,10 +112,9 @@ Handle(Poly_Triangulation) RWStl::ReadFile (const Standard_CString theFile,
const Handle(Message_ProgressIndicator)& theProgress)
{
Reader aReader;
if (!aReader.Read (theFile, theProgress))
{
return Handle(Poly_Triangulation)();
}
aReader.Read (theFile, theProgress);
// note that returned bool value is ignored intentionally -- even if something went wrong,
// but some data have been read, we at least will return these data
return aReader.GetTriangulation();
}
@@ -209,10 +211,15 @@ Handle(Poly_Triangulation) RWStl::ReadAscii (const OSD_Path& theFile,
//function : Write
//purpose :
//=============================================================================
Standard_Boolean RWStl::WriteBinary (const Handle(Poly_Triangulation)& aMesh,
Standard_Boolean RWStl::WriteBinary (const Handle(Poly_Triangulation)& theMesh,
const OSD_Path& thePath,
const Handle(Message_ProgressIndicator)& theProgInd)
{
if (theMesh.IsNull() || theMesh->NbTriangles() <= 0)
{
return Standard_False;
}
TCollection_AsciiString aPath;
thePath.SystemName (aPath);
@@ -222,7 +229,7 @@ Standard_Boolean RWStl::WriteBinary (const Handle(Poly_Triangulation)& aMesh,
return Standard_False;
}
Standard_Boolean isOK = writeBinary (aMesh, aFile, theProgInd);
Standard_Boolean isOK = writeBinary (theMesh, aFile, theProgInd);
fclose (aFile);
return isOK;
@@ -236,6 +243,11 @@ Standard_Boolean RWStl::WriteAscii (const Handle(Poly_Triangulation)& theMesh,
const OSD_Path& thePath,
const Handle(Message_ProgressIndicator)& theProgInd)
{
if (theMesh.IsNull() || theMesh->NbTriangles() <= 0)
{
return Standard_False;
}
TCollection_AsciiString aPath;
thePath.SystemName (aPath);

View File

@@ -138,9 +138,15 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
std::streampos theEnd = aStream.tellg();
aStream.seekg (0, aStream.beg);
while (!aStream.eof() && !aStream.bad())
// binary STL files cannot be shorter than 134 bytes
// (80 bytes header + 4 bytes facet count + 50 bytes for one facet);
// thus assume files shorter than 134 as Ascii without probing
// (probing may bring stream to fail state if EOF is reached)
bool isAscii = ((size_t)theEnd < THE_STL_MIN_FILE_SIZE || IsAscii (aStream));
while (aStream.good())
{
if (IsAscii (aStream))
if (isAscii)
{
if (!ReadAscii (aStream, theEnd, theProgress))
{
@@ -156,7 +162,7 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
}
aStream >> std::ws; // skip any white spaces
}
return !aStream.bad();
return ! aStream.fail();
}
//==============================================================================
@@ -169,10 +175,10 @@ Standard_Boolean RWStl_Reader::IsAscii (Standard_IStream& theStream)
// read first 134 bytes to detect file format
char aBuffer[THE_STL_MIN_FILE_SIZE];
std::streamsize aNbRead = theStream.read (aBuffer, THE_STL_MIN_FILE_SIZE).gcount();
if (!theStream)
if (! theStream)
{
Message::DefaultMessenger()->Send ("Error: Cannot read file", Message_Fail);
return false;
return true;
}
// put back the read symbols
@@ -240,7 +246,8 @@ Standard_Boolean RWStl_Reader::ReadAscii (Standard_IStream& theStream,
// use method seekpos() to get true 64-bit offset to enable
// handling of large files (VS 2010 64-bit)
const int64_t aStartPos = GETPOS(theStream.tellg());
const int64_t aEndPos = (theUntilPos > 0 ? GETPOS(theUntilPos) : std::numeric_limits<int64_t>::max());
// Note: 1 is added to theUntilPos to be sure to read the last symbol (relevant for files without EOL at the end)
const int64_t aEndPos = (theUntilPos > 0 ? 1 + GETPOS(theUntilPos) : std::numeric_limits<int64_t>::max());
// skip header "solid ..."
theStream.ignore (aEndPos - aStartPos, '\n');

View File

@@ -47,6 +47,7 @@
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_CartesianTransformationOperator3d.hxx>
#include <StepGeom_Direction.hxx>
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
#include <StepGeom_GeometricRepresentationItem.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
@@ -823,18 +824,30 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
nsh ++;
}
}
// [BEGIN] Proceed with non-manifold topology (ssv; 12.11.2010)
if (!isManifold) {
Handle(Standard_Transient) info;
// IMPORTANT: any fixing on non-manifold topology must be done after the shape is transferred from STEP
TopoDS_Shape fixedResult =
XSAlgo::AlgoContainer()->ProcessShape( comp, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", info,
TP->GetProgress() );
TP->GetProgress(), Standard_True);
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
if (fixedResult.ShapeType() == TopAbs_COMPOUND)
{
comp = TopoDS::Compound(fixedResult);
}
else
{
comp.Nullify();
B.MakeCompound(comp);
B.Add(comp, fixedResult);
}
BRep_Builder brepBuilder;
// [BEGIN] Try to close OPEN Shells in I-DEAS case (ssv; 17.11.2010)
@@ -874,20 +887,19 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
// [BEGIN] Reconstruct Solids from Closed Shells (ssv; 15.11.2010)
TopoDS_Compound reconstComp;
brepBuilder.MakeCompound(reconstComp);
TopoDS_Iterator it(comp);
for ( ; it.More(); it.Next() ) {
TopoDS_Shape aSubShape = it.Value();
if ( aSubShape.ShapeType() == TopAbs_SHELL && aSubShape.Closed() ) {
TopoDS_Solid nextSolid;
brepBuilder.MakeSolid(nextSolid);
brepBuilder.Add(nextSolid, aSubShape);
brepBuilder.Add(reconstComp, nextSolid);
}
else if (aSubShape.ShapeType() == TopAbs_SHELL)
brepBuilder.Add(reconstComp, aSubShape);
TopExp_Explorer exp(comp, TopAbs_SHELL);
for (; exp.More(); exp.Next())
{
TopoDS_Shape aSubShape = exp.Current();
if (aSubShape.ShapeType() == TopAbs_SHELL && aSubShape.Closed()) {
TopoDS_Solid nextSolid;
brepBuilder.MakeSolid(nextSolid);
brepBuilder.Add(nextSolid, aSubShape);
brepBuilder.Add(reconstComp, nextSolid);
}
else if (aSubShape.ShapeType() == TopAbs_SHELL)
brepBuilder.Add(reconstComp, aSubShape);
}
comp = reconstComp;
// [END] Reconstruct Solids from Closed Shells (ssv; 15.11.2010)
}
@@ -896,6 +908,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
if (nsh == 0) shbinder.Nullify();
else if (nsh == 1) shbinder = new TransferBRep_ShapeBinder (OneResult);
else shbinder = new TransferBRep_ShapeBinder (comp);
PrepareUnits ( oldSRContext, TP ); //:S4136
TP->Bind(sr, shbinder);

View File

@@ -378,6 +378,32 @@ Handle(Prs3d_Presentation) SelectMgr_SelectableObject::GetSelectPresentation (co
return mySelectionPrs;
}
//=======================================================================
//function : ErasePresentations
//purpose :
//=======================================================================
void SelectMgr_SelectableObject::ErasePresentations (Standard_Boolean theToRemove)
{
if (!mySelectionPrs.IsNull())
{
mySelectionPrs->Erase();
if (theToRemove)
{
mySelectionPrs->Clear();
mySelectionPrs.Nullify();
}
}
if (!myHilightPrs.IsNull())
{
myHilightPrs->Erase();
if (theToRemove)
{
myHilightPrs->Clear();
myHilightPrs.Nullify();
}
}
}
//=======================================================================
//function : SetZLayer
//purpose :

View File

@@ -168,7 +168,10 @@ public:
Standard_EXPORT Handle(Prs3d_Presentation) GetHilightPresentation (const Handle(PrsMgr_PresentationManager3d)& TheMgr);
Standard_EXPORT Handle(Prs3d_Presentation) GetSelectPresentation (const Handle(PrsMgr_PresentationManager3d)& TheMgr);
//! Removes presentations returned by GetHilightPresentation() and GetSelectPresentation().
Standard_EXPORT virtual void ErasePresentations (Standard_Boolean theToRemove);
//! Set Z layer ID and update all presentations of the selectable object.
//! The layers mechanism allows drawing objects in higher layers in overlay of objects in lower layers.
Standard_EXPORT virtual void SetZLayer (const Graphic3d_ZLayerId theLayerId) Standard_OVERRIDE;
@@ -219,14 +222,15 @@ protected:
SelectMgr_SequenceOfSelection myselections;
Handle(SelectMgr_EntityOwner) myAssemblyOwner;
Handle(Prs3d_Presentation) mySelectionPrs;
Handle(Prs3d_Presentation) myHilightPrs;
Standard_Boolean myAutoHilight;
private:
Standard_Integer mycurrent;
Handle(Prs3d_Presentation) mySelectionPrs;
Handle(Prs3d_Presentation) myHilightPrs;
Standard_Integer myGlobalSelMode;
};
#endif // _SelectMgr_SelectableObject_HeaderFile

View File

@@ -18,9 +18,10 @@
// purpose :
//=======================================================================
SelectMgr_ToleranceMap::SelectMgr_ToleranceMap()
: myLargestKey (-1),
myCustomTolerance (-1)
{
myLargestKey = -1;
myCustomTolerance = -1;
//
}
//=======================================================================
@@ -38,24 +39,23 @@ SelectMgr_ToleranceMap::~SelectMgr_ToleranceMap()
//=======================================================================
void SelectMgr_ToleranceMap::Add (const Standard_Integer& theTolerance)
{
if (myTolerances.IsBound (theTolerance))
if (Standard_Integer* aFreq = myTolerances.ChangeSeek (theTolerance))
{
Standard_Integer& aFreq = myTolerances.ChangeFind (theTolerance);
aFreq++;
if (aFreq == 1 && theTolerance != myLargestKey)
++(*aFreq);
if (*aFreq == 1 && theTolerance != myLargestKey)
{
myLargestKey = Max (theTolerance, myLargestKey);
}
return;
}
myTolerances.Bind (theTolerance, 1);
if (myTolerances.Extent() == 1)
{
myLargestKey = theTolerance;
}
else
{
if (myTolerances.IsEmpty())
{
myTolerances.Bind (theTolerance, 1);
myLargestKey = theTolerance;
return;
}
myTolerances.Bind (theTolerance, 1);
myLargestKey = Max (theTolerance, myLargestKey);
}
}
@@ -66,18 +66,22 @@ void SelectMgr_ToleranceMap::Add (const Standard_Integer& theTolerance)
//=======================================================================
void SelectMgr_ToleranceMap::Decrement (const Standard_Integer& theTolerance)
{
if (myTolerances.IsBound (theTolerance))
Standard_Integer* aFreq = myTolerances.ChangeSeek (theTolerance);
if (aFreq == NULL)
{
Standard_Integer& aFreq = myTolerances.ChangeFind (theTolerance);
aFreq--;
return;
}
if (Abs (theTolerance - myLargestKey) < Precision::Confusion() && aFreq == 0)
--(*aFreq);
if (theTolerance == myLargestKey
&& *aFreq == 0)
{
myLargestKey = 0;
for (NCollection_DataMap<Standard_Integer, Standard_Integer>::Iterator anIter (myTolerances); anIter.More(); anIter.Next())
{
myLargestKey = 0;
for (NCollection_DataMap<Standard_Integer, Standard_Integer>::Iterator anIter (myTolerances); anIter.More(); anIter.Next())
if (anIter.Value() != 0)
{
if (anIter.Value() != 0)
myLargestKey = Max (myLargestKey, anIter.Key());
myLargestKey = Max (myLargestKey, anIter.Key());
}
}
}

View File

@@ -1070,9 +1070,8 @@ Standard_Boolean ShapeAnalysis_Curve::GetSamplePoints (const Handle(Geom_Curve)&
GeomAdaptor_Curve GAC(curve);
Standard_Real step = ( last - first ) / (Standard_Real)( nbp - 1 );
Standard_Real par = first, stop = last - 0.5 * step;
for ( ; par < stop; par += step )
seq.Append(GAC.Value(par));
for (Standard_Integer i = 0; i < nbp - 1; ++i)
seq.Append(GAC.Value(first + step * i));
seq.Append(GAC.Value(last));
return Standard_True;
}
@@ -1093,9 +1092,8 @@ Standard_Boolean ShapeAnalysis_Curve::GetSamplePoints (const Handle(Geom2d_Curve
//-- Attention aux bsplines rationnelles de degree 3. (bouts de cercles entre autres)
if (nbs > 2) nbs*=4;
Standard_Real step = ( last - first ) / (Standard_Real)( nbs - 1 );
Standard_Real par = first, stop = last - 0.5 * step;
for ( ; par < stop; par += step )
seq.Append(C.Value(par));
for (Standard_Integer i = 0; i < nbs - 1; ++i)
seq.Append(C.Value(first + step * i));
seq.Append(C.Value(last));
return Standard_True;
/*

View File

@@ -243,6 +243,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
aPSentry.Next();
myResult = Context()->Apply(S);
if ( NeedFix(myFixSameParameterMode) )
{
SameParameter(myResult, Standard_False, theProgress);
@@ -269,6 +270,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
}
}
}
myResult = Context()->Apply(myResult);
if ( !fft.IsNull() )

View File

@@ -70,6 +70,7 @@ ShapeFix_Shell::ShapeFix_Shell()
myFixOrientationMode = -1;
myFixFace = new ShapeFix_Face;
myNbShells =0;
myNonManifold = Standard_False;
}
//=======================================================================
@@ -84,6 +85,7 @@ ShapeFix_Shell::ShapeFix_Shell(const TopoDS_Shell& shape)
myFixOrientationMode = -1;
myFixFace = new ShapeFix_Face;
Init(shape);
myNonManifold = Standard_False;
}
//=======================================================================
@@ -138,9 +140,10 @@ Standard_Boolean ShapeFix_Shell::Perform(const Handle(Message_ProgressIndicator)
if ( !aPSentry.More() )
return Standard_False;
}
TopoDS_Shape newsh = Context()->Apply(myShell);
if ( NeedFix ( myFixOrientationMode) )
FixFaceOrientation(TopoDS::Shell(newsh));
FixFaceOrientation(TopoDS::Shell(newsh), Standard_True, myNonManifold);
TopoDS_Shape aNewsh = Context()->Apply (newsh);
ShapeAnalysis_Shell aSas;
@@ -853,7 +856,10 @@ static void CreateClosedShell(TopTools_SequenceOfShape& OpenShells,
// purpose :
//=======================================================================
Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,const Standard_Boolean isAccountMultiConex,const Standard_Boolean NonManifold)
Standard_Boolean ShapeFix_Shell::FixFaceOrientation(
const TopoDS_Shell& shell,
const Standard_Boolean isAccountMultiConex,
const Standard_Boolean NonManifold)
{
//myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
Standard_Boolean done = Standard_False;
@@ -1101,6 +1107,7 @@ void ShapeFix_Shell::SetMaxTolerance (const Standard_Real maxtol)
ShapeFix_Root::SetMaxTolerance ( maxtol );
myFixFace->SetMaxTolerance ( maxtol );
}
//=======================================================================
//function : NbShells
//purpose :
@@ -1110,3 +1117,13 @@ Standard_Integer ShapeFix_Shell::NbShells() const
{
return myNbShells;
}
//=======================================================================
//function : SetNonManifoldFlag
//purpose :
//=======================================================================
void ShapeFix_Shell::SetNonManifoldFlag(const Standard_Boolean isNonManifold)
{
myNonManifold = isNonManifold;
}

View File

@@ -73,7 +73,10 @@ public:
//! If this mode is equal to Standard_True one non-manifold will be created from shell
//! contains multishared edges. Else if this mode is equal to Standard_False only
//! manifold shells will be created. By default - Standard_False.
Standard_EXPORT Standard_Boolean FixFaceOrientation (const TopoDS_Shell& shell, const Standard_Boolean isAccountMultiConex = Standard_True, const Standard_Boolean NonManifold = Standard_False);
Standard_EXPORT Standard_Boolean FixFaceOrientation (
const TopoDS_Shell& shell,
const Standard_Boolean isAccountMultiConex = Standard_True,
const Standard_Boolean NonManifold = Standard_False);
//! Returns fixed shell (or subset of oriented faces).
Standard_EXPORT TopoDS_Shell Shell();
@@ -114,7 +117,8 @@ public:
//! FixFaceOrientation, by default True.
Standard_Integer& FixOrientationMode();
//! Sets NonManifold flag
Standard_EXPORT virtual void SetNonManifoldFlag(const Standard_Boolean isNonManifold);
DEFINE_STANDARD_RTTIEXT(ShapeFix_Shell,ShapeFix_Root)
@@ -129,7 +133,7 @@ protected:
Standard_Integer myFixFaceMode;
Standard_Integer myFixOrientationMode;
Standard_Integer myNbShells;
Standard_Boolean myNonManifold;
private:

View File

@@ -716,7 +716,8 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True );
sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 );
sfs->FixShellTool()->FixOrientationMode() = ctx->IntegerVal ( "FixFaceOrientationMode", -1 );
sfs->FixShellTool()->SetNonManifoldFlag(ctx->IsNonManifold());
sfs->FixShellTool()->FixOrientationMode() = ctx->IntegerVal("FixFaceOrientationMode", -1);
//parameters for ShapeFix_Face
sff->FixWireMode() = ctx->IntegerVal ( "FixWireMode", -1 );

View File

@@ -38,7 +38,8 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeProcess_ShapeContext,ShapeProcess_Context)
//=======================================================================
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const Standard_CString file,
const Standard_CString seq)
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE)
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE),
myNonManifold(Standard_False)
{
}
@@ -50,7 +51,8 @@ ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const Standard_CString fil
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const TopoDS_Shape &S,
const Standard_CString file,
const Standard_CString seq)
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE)
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE),
myNonManifold(Standard_False)
{
Init ( S );
}

View File

@@ -126,7 +126,17 @@ public:
//! Prints statistics on Shape Processing onto the current Messenger.
Standard_EXPORT void PrintStatistics() const;
//! Set NonManifold flag
Standard_EXPORT void SetNonManifold(Standard_Boolean theNonManifold)
{
myNonManifold = theNonManifold;
}
//! Get NonManifold flag
Standard_EXPORT Standard_Boolean IsNonManifold()
{
return myNonManifold;
}
DEFINE_STANDARD_RTTIEXT(ShapeProcess_ShapeContext,ShapeProcess_Context)
@@ -144,7 +154,7 @@ private:
TopTools_DataMapOfShapeShape myMap;
Handle(ShapeExtend_MsgRegistrator) myMsg;
TopAbs_ShapeEnum myUntil;
Standard_Boolean myNonManifold;
};

View File

@@ -32,7 +32,7 @@ namespace
CLocalePtr()
#ifdef HAVE_XLOCALE_H
: myLocale (newlocale (LC_ALL_MASK, "C", NULL))
#elif defined(_WIN32) && !defined(__MINGW32__)
#elif defined(_MSC_VER)
: myLocale (_create_locale (LC_ALL, "C"))
#else
: myLocale (NULL)
@@ -43,7 +43,7 @@ namespace
{
#ifdef HAVE_XLOCALE_H
freelocale (myLocale);
#elif defined(_WIN32) && !defined(__MINGW32__)
#elif defined(_MSC_VER)
_free_locale (myLocale);
#endif
}

View File

@@ -35,7 +35,8 @@
#endif
#endif // ifndef HAVE_LOCALE_H
#ifdef HAVE_XLOCALE_H
#if defined(HAVE_XLOCALE_H) && !(defined(__GLIBC__) && (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 24))
// xlocale.h is actually a non-standard header file; glibc 2.26 has removed it altogether (all definition comes from locale.h)
#include <xlocale.h>
#endif
@@ -65,7 +66,7 @@ public:
#ifdef HAVE_XLOCALE_H
typedef locale_t clocale_t;
#elif defined(_WIN32) && !defined(__MINGW32__)
#elif defined(_MSC_VER)
typedef _locale_t clocale_t;
#else
typedef void* clocale_t;
@@ -78,7 +79,7 @@ public:
private:
void* myPrevLocale; //!< previous locale, platform-dependent pointer!
#ifdef _WIN32
#ifdef _MSC_VER
int myPrevTLocaleState; //!< previous thread-locale state, MSVCRT-specific
#endif

View File

@@ -63,7 +63,7 @@ Standard_Integer HashCodes (const Standard_CString Value,
#ifdef __APPLE__
// There are a lot of *_l functions availalbe on Mac OS X - we use them
#define SAVE_TL()
#elif defined(_WIN32) && !defined(__MINGW32__)
#elif defined(_MSC_VER)
// MSVCRT has equivalents with slightly different syntax
#define SAVE_TL()
#define strtod_l(thePtr, theNextPtr, theLocale) _strtod_l(thePtr, theNextPtr, theLocale)

View File

@@ -72,23 +72,7 @@
#define Standard_ENABLE_DEPRECATION_WARNINGS
#endif
//======================================================
// Windows-specific definitions
//======================================================
# if defined(_WIN32) && !defined(HAVE_NO_DLL)
# ifndef Standard_EXPORT
# define Standard_EXPORT __declspec( dllexport )
// For global variables :
# define Standard_EXPORTEXTERN __declspec( dllexport ) extern
# define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
# endif /* Standard_EXPORT */
# ifndef Standard_IMPORT
# define Standard_IMPORT __declspec( dllimport ) extern
# define Standard_IMPORTC extern "C" __declspec( dllimport )
# endif /* Standard_IMPORT */
# ifdef _WIN32
// We must be careful including windows.h: it is really poisonous stuff!
// The most annoying are #defines of many identifiers that you could use in
@@ -132,10 +116,30 @@
#define NOIME NOIME
#endif
#endif
# if defined(_WIN32) && !defined(HAVE_NO_DLL)
//======================================================
// Windows-specific definitions
//======================================================
# ifndef Standard_EXPORT
# define Standard_EXPORT __declspec( dllexport )
// For global variables :
# define Standard_EXPORTEXTERN __declspec( dllexport ) extern
# define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
# endif /* Standard_EXPORT */
# ifndef Standard_IMPORT
# define Standard_IMPORT __declspec( dllimport ) extern
# define Standard_IMPORTC extern "C" __declspec( dllimport )
# endif /* Standard_IMPORT */
# else /* UNIX */
//======================================================
// UNIX definitions
// UNIX / static library definitions
//======================================================
# ifndef Standard_EXPORT

View File

@@ -26,4 +26,3 @@ StdSelect_TypeOfResult.hxx
StdSelect_TypeOfSelectionImage.hxx
StdSelect_ViewerSelector3d.cxx
StdSelect_ViewerSelector3d.hxx
StdSelect_ViewerSelector3d.lxx

View File

@@ -50,7 +50,7 @@ public:
Standard_EXPORT void SetPixelTolerance (const Standard_Integer theTolerance);
//! Returns the pixel tolerance.
inline Standard_Integer PixelTolerance() const;
Standard_Integer PixelTolerance() const { return myTolerances.Tolerance(); }
//! Picks the sensitive entity at the pixel coordinates of
//! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
@@ -114,6 +114,4 @@ protected:
DEFINE_STANDARD_HANDLE(StdSelect_ViewerSelector3d, SelectMgr_ViewerSelector)
#include <StdSelect_ViewerSelector3d.lxx>
#endif

View File

@@ -49,8 +49,11 @@ Standard_Boolean StlAPI_Writer::Write (const TopoDS_Shape& theShape,
{
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (TopoDS::Face (anExpSF.Current()), aLoc);
aNbNodes += aTriangulation->NbNodes();
aNbTriangles += aTriangulation->NbTriangles();
if (! aTriangulation.IsNull())
{
aNbNodes += aTriangulation->NbNodes ();
aNbTriangles += aTriangulation->NbTriangles ();
}
}
// create temporary triangulation

View File

@@ -161,13 +161,7 @@ void TDF_CopyLabel::Perform()
myIsDone = Standard_False;
if(mySL.Data()->Root().IsDifferent(myTL.Data()->Root()) && //TDF_Data is not the same
!TDF_Tool::IsSelfContained(mySL, myFilter)) return; //source label isn't self-contained
else {
#ifdef OCCT_DEBUG
cout << "THE SAME Data" <<endl;
#endif
}
//TDF_Data of the source and target labels are the same
Standard_Boolean extReferers =
ExternalReferences(mySL, myMapOfExt, myFilter);

View File

@@ -42,5 +42,5 @@ TDF_DefaultDeltaOnRemoval::TDF_DefaultDeltaOnRemoval
void TDF_DefaultDeltaOnRemoval::Apply()
{
Label().AddAttribute(Attribute());
Label().AddAttribute(Attribute(), Standard_True);
}

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