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

Compare commits

..

19 Commits

Author SHA1 Message Date
nbv
c2fd3dc272 0023675: P-curves of a face are out of the domain of the face.
Analyzing of 2D-curves' boundaries.
Tolerance range computing was changed.

1. Function Validate(...) returns BRepCheck_Status.
2. For faces, whose pcurves is out of domain, status BRepCheck_OutOfSurfaceBoundary is returned.
3. For edges, which is out of face's boundary, status BRepCheck_PCurveIsOutOfDomainFace is returned.
4. Print warning, if status is not defined.
5. BRepCheck_Face::SetStatus(...) and BRepCheck_Wire::SetStatus(...) functions added.
6. ShapeFix::RefineFace(...) function and it draw-commands (ffixpcu and sfixpcu) are added. Command "ffixpcu" fixes a face with BRepCheck_OutOfSurfaceBoundary status. Command "sfixpcu" fixes a shape, which contains a face with BRepCheck_OutOfSurfaceBoundary status.
7. Trimming algorithm for surfaces changed (ForceTrim method is added).
8. Small correction of output of "checkshape" command result.
9. MinMax() and RealMod() functions are added.
10. Fixing of some shapes from test base.

Faces, which based on periodic or closed surfaces, are not controlled.
2014-04-03 12:08:15 +04:00
mkv
dd8f1b191b Update of test cases for Debug 2014-03-28 16:02:51 +04:00
abv
900f72291b 0024765: Compile errors on Mac OS X with GCC 4.2
Sequence replaced by handle in map, to avoid involvement of copy constructor (private)
2014-03-28 15:55:26 +04:00
szy
2cb0e21313 0024535: Bad type cast in TDocStd_Document::Update()
Eliminating of GCC compiler warning on breakage of C pointer aliasing rules.
2014-03-28 15:55:25 +04:00
kgv
b64d84be99 0024752: Visualization - inherit OpenGl_Group from Graphic3d_Group
Graphic3d_Group is now abstract class and should be instantiated
using Graphic3d_Structure::NewGroup() method.
Graphic3d_CGroup has been removed.

The groups list is no more duplicated within Graphic3d_Structure and OpenGl_Structure.
Removed unused/duplicated fields from Graphic3d_Group.

Prs3d_Presentation - remove redundnant field myCurrentGroup.
PrsMgr_Presentation3d::Erase(), ::Clear() - avoid possible NULL dereference.
OpenGl_GraphicDriver/Graphic3d_GraphicDriver - group management methods have been removed
(moved to Graphic3d_CStructure and Graphic3d_Group interfaces).

Graphic3d_Group::GroupPrimitivesAspect() - copy IsEmission flag
Fix wrong iterator
Fix compilation issues
2014-03-28 15:55:24 +04:00
emv
6b1fe48c8a 0024751: Performance improvements in the Edge/Edge intersection algorithm
Added new static method PointBoxDistance() to compute distance between point and bounding box.
Removed method IntTools_EdgeEdge::FindRoughRanges().
Test cases for issue CR24751
2014-03-28 15:55:21 +04:00
jgv
9ba2c30f1a 0024738: BRepOffsetAPI_MakePipe algorithm fails on circular path and section (the case where result is part of sphere)
Test case for issue CR24738
2014-03-28 15:55:20 +04:00
nbv
b9cd9e62c3 0024684: Command fixshape hangs up on the attached shape
Algorithm of seeking of any internal point into given face is corrected.
Test case for issue CR24684
2014-03-28 15:55:18 +04:00
abv
07b5cb8f23 0024758: Sample DRAW scripts for demonstrating sweeping algorithm
Two scripts added:
samples/tcl/drill.tcl: creates model of a twist drill bit
samples/tcl/cutter.tcl: creates simplified model of a milling cutter
Added test cases bugs/modalg_5/bug24758_1 bug24758_2
2014-03-28 15:55:17 +04:00
jgv
15173a087b 0024633: Incorrect projection of a curve on a surface
Test cases for issue CR24633
2014-03-28 15:55:16 +04:00
szy
3497d55234 0024565: MgtBRep persistence bug
Fix of the persistence bug (exception with message "Persistant CurveRep is Null").
Creating new draw command for testing CR24565
Revert license header corruption
Correction for new draw command OCC24565
Test case for issue CR24565
2014-03-28 15:55:14 +04:00
pkv
505abfb89f 0024639: Parallelization FillDS part of BO
Modifications to avoid compilation errors
2014-03-28 15:55:13 +04:00
duv
ca1028006d 0024354: TKOpenGl - location modification of multi-connected shape has no effect when object is drawn by GLSL program 2014-03-28 15:55:11 +04:00
kgv
30194ce331 0024745: Needless inheritance of OSD_MemInfo from Standard_Transient 2014-03-27 16:38:24 +04:00
abv
bbd47d8f35 0024748: Remove unused instantiations of collection classes
Removed:
- packages PColPGeom, PColPGeom2d
- in Geom package: classes SequenceOfBoundedSurface, (H)SequenceOfSurface
- in TColGeom package: classes Array1OfBoundedCurve, (H)Array1OfBoundedSurface, HArray1OfBoundedCurve, (H)Array2OfBoundedSurface, (H)Array2OfBSplineSurface, HArray2OfBezierSurface, (H)SequenceOfBoundedSurface, HSequenceOfSurface
- in TColGeom2d package: classes (H)Array1OfGeometry, (H)Array1OfBoundedCurve, HSequenceOfGeometry
2014-03-27 16:37:21 +04:00
dln
a104bb8fe2 0024734: Convertation of the generic classes to the non-generic. Part 4
Generic classes "LProp_FuncCurExt", "LProp_FuncCurNul" and "LProp_NumericCurInf" from "LProp" package converted to the non-generic classes and moved to the "Geom2dLProp" package. Therefore names of this classes were changed to "Geom2dLProp_FuncCurExt", "Geom2dLProp_FuncCurNul" and "Geom2dLProp_NumericCurInf".
Generic class "Sweep_LinearRegularSweep" from "Sweep" package converted to the non-generic classes and moved to the "BRepSweep" package. Therefore name of this class was changed to "BRepSweep_NumLinearRegularSweep". Also 2 internal classes of "BRepSweep_NumLinearRegularSweep" moved to "BRepSweep.cdl".
Generic classes "Primitives_Wedge" and "Primitives_OneAxis" from "Primitives" package converted to the non-generic classes and moved to the "BRepPrim" package. Therefore names of this classes were changed to "BRepPrim_GWedge" and "BRepPrim_OneAxis". Also enum "Direction" moved to BRepPrim. Therefore all "Primitives" package was deleted.
And some other minor changes were done.

Internal classes Array2OfShapes and SequenceOfShapes from BRepSweep_NumLinearRegularSweep replaced to Array2OfShape and SequenceOfShape from TopTools.
2014-03-27 16:30:38 +04:00
dln
04f7bd75e3 0024683: Convertation of the generic classes to the non-generic. Part 1
Generic classes from "BRepApprox" package:
    "BRepApprox_ApproxLineGen" and "BRepApprox_SurfaceToolGen" converted to the non-generic classes "BRepApprox_ApproxLine" and "BRepApprox_SurfaceTool".
Generic classes from "BRepBlend" package:
    "BRepBlend_HCurve3dToolGen" and "BRepBlend_HCurve2dToolGen" converted to the non-generic classes "BRepBlend_HCurve3dTool" and "BRepBlend_HCurve2dTool".
Generic classes from "Blend" package:
    "Blend_Extremity", "Blend_Line" and "Blend_PointOnRst" moved to the corresponding non-generic classes "BRepBlend_Extremity", "BRepBlend_Line" and "BRepBlend_PointOnRst" to "BRepBlend" package.

And some other minor changes were done.
Field "myPntOn2S" was deleted from "BRepApprox_ApproxLine" class. Therefore BRepApprox_ApproxLine::Point(...) method was a little changed.
2014-03-27 16:26:13 +04:00
mkv
0a58bfe2c3 Update test cases for debug mode 2014-03-21 16:16:29 +04:00
ibs
630ab8c7fe 0024549: Faulty shape after IGES translation with xstep.cascade.unit set to M
pcurve as line isn't created to avoid incorrect parameterization
Test case for issue CR24549

Test cases were corrected according to their new behavior
2014-03-21 16:11:31 +04:00
251 changed files with 8289 additions and 7027 deletions

View File

@@ -171,7 +171,6 @@ p MAT
p MAT2d p MAT2d
p NLPlate p NLPlate
p Plate p Plate
p Primitives
p ShapeAlgo p ShapeAlgo
p ShapeAnalysis p ShapeAnalysis
p ShapeBuild p ShapeBuild
@@ -273,8 +272,6 @@ p ObjMgt
p PBRep p PBRep
p PCDM p PCDM
p PCDMShape p PCDMShape
p PColPGeom
p PColPGeom2d
p PColStd p PColStd
p PColgp p PColgp
p PCollection p PCollection

87
samples/tcl/cutter.tcl Normal file
View File

@@ -0,0 +1,87 @@
# Sample: creation of milling cutter
pload MODELING VISUALIZATION
# parameters
dset R 10. ;# outer radius
dset H 20. ;# height of the spiral part
dset a 0.5*pi ;# total angle of spiral rotation
# make profile
circle outer 0 0 0 0 0 1 R
circle inner 0 0 0 0 0 1 R-2
circle round 3 6 0 0 0 1 5
polyline cut -2 0 0 -2 R+1 0 0.5 R+1 0 -1 0 0 -2 0 0
proc _curvetoface {name} {
uplevel #0 mkedge $name $name
uplevel #0 wire $name $name
uplevel #0 mkface $name p0 $name
}
plane p0
_curvetoface outer
_curvetoface inner
_curvetoface round
mkface cut p0 cut
bcommon teeth cut round
bcommon teeth teeth outer
tcopy inner profile
set nbteeths 25
for {set i 0} {$i < $nbteeths} {incr i} {
fuse profile profile teeth
trotate teeth 0 0 0 0 0 1 360./$nbteeths
}
# sweep profile along curved shape
polyline sp 0 0 0 0 0 H
cylinder ss 0 0 0 0 0 1 1 0 0 R
vertex v1 R 0 0
vertex v2 R 0 H
line ll 0 0 a H
trim ll ll 0 sqrt(a*a+H*H)
trotate v2 0 0 0 0 0 1 180.*a/pi
mkedge ee ll ss v1 v2
wire gg ee
donly profile sp gg
explode profile w
tcopy profile_1 profile_2
tcopy profile_1 profile_3
tscale profile_1 0 0 0 1./(R-2)
ttranslate profile_2 0 0 H/2
tscale profile_2 0 0 H/2 4./(R-2)
ttranslate profile_3 0 0 H
tscale profile_3 0 0 H 3./(R-2)
mksweep sp
setsweep -G gg 0 0
addsweep profile_1
addsweep profile_2
addsweep profile_3
vclear
buildsweep base -S
# make a shank
plane p1 0 0 H 0 0 1
pcylinder shank p1 1.4 H
plane p2 0 0 H+1 0 0 1
pcylinder sh2 p2 1.5 H-1
bfuse shank shank sh2
bfuse cutter base shank
# check result
checkshape cutter
# show result
incmesh cutter 0.01
vdisplay cutter
vsetdispmode cutter 1
incmesh profile_1 0.01; vdisplay profile_1
vfit

144
samples/tcl/drill.tcl Normal file
View File

@@ -0,0 +1,144 @@
# Sample: creation of simple twist drill bit
pload MODELING VISUALIZATION
# drill parameters (some terms taken from http://www.drill-bits.cn/drill-bits-quality.asp)
dset R 4. ;# outer radius
dset D 2*R ;# diameter
dset Rr 3.5 ;# chisel radius (outer radius minus body clearance)
dset b 1. ;# web thickness (approximate)
dset d b/2
dset H 80. ;# height of the spiral part
dset a 3.*pi ;# total angle of spiral rotation
dset sigma 118 ;# point angle, in degrees
# Create section profile by sequence of Boolean operations
# on simple planar objects
puts "Creating the drill section profile..."
polyline rectangle1 d -R 0 R -R 0 -d R 0 -R R 0 d -R 0
circle circle1 0 0 0 0 0 1 R
mkedge circle1 circle1
wire circle1 circle1
circle circle2 0 0 0 0 0 1 Rr
mkedge circle2 circle2
wire circle2 circle2
plane p0
mkface rectangle1 p0 rectangle1
mkface circle1 p0 circle1
mkface circle2 p0 circle2
bcommon sec rectangle1 circle1
# note use of 'fuse' instead of 'bfuse' -- we need to get single face
fuse sec sec circle2
# Construct flute profile so as to have cutting lip straight after sharpening.
# Here we need to take into account spiral shift of the flute edge
# along the point length -- the way to do that is to make spiral
# from the desired cutting lip edge and then intersect it by plane
polyline lip d -d/2 0 d -R -R/tan(sigma/2*pi/180)
polyline sp 0 0 0 0 0 H
cylinder cc 0 0 0 0 0 1 0 -4 0 4
line ll 0 0 a 80
trim ll ll 0 sqrt(a*a+H*H)
vertex v1 0 -R 0
vertex v2 0 -R H
trotate v2 0 0 0 0 0 1 180.*a/pi
mkedge ee ll cc v1 v2
wire gg ee
mksweep sp
setsweep -G gg 0 0
addsweep lip
buildsweep spiral -S
mkface f0 p0 -R R -R R
bsection sflute spiral f0
# here we rely on that section curve is parameterized from 0 to 1
# and directed as cutting lip edge;
# note that this can change if intersection algorithm is modified
explode sflute e
mkcurve cflute sflute_1
cvalue cflute 0. x0 y0 z0
cvalue cflute 1. x1 y1 z1
vertex vf0 x0 y0 z0
vertex vf1 x1 y1 z1
# -- variant: replace curve by arc with start at x0,y0,z0 and end at x1,y1,z1,
# -- such that tanget at start point is along Y
#dset Rflute ((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0))/(2*(x1-x0))
#circle aflute x0+Rflute y0 0 0 0 1 Rflute
#mkedge sflute_1 aflute vf0 vf1
# make rounding in the flute; use circle with radius Rr/2
circle cround x0+Rr/2 y0 0 0 0 1 Rr/2
vertex vf3 x0+Rr y0 0
mkedge sflute_2 cround vf3 vf0
vertex vf2 R -R 0
edge sflute_3 vf3 vf2
edge sflute_4 vf2 vf1
wire w2 sflute_1 sflute_2 sflute_3 sflute_4
mkface flute p0 w2
# cut flute from profile
bcut sec sec flute
trotate flute 0 0 0 0 0 1 180.
bcut sec sec flute
donly sec
# sweep profile to get a drill body
puts "Sweeping the profile..."
mksweep sp
setsweep -G gg 0 0
explode sec w
addsweep sec_1
buildsweep base -S
# sharpen the drill (see http://tool-land.ru/zatochka-sverla.php)
puts "Sharpening..."
dset theta a*R/H*sin((90-sigma/2)*pi/180)
plane ax1 d 1.9*D "H+1.9*D/tan(pi/180.*sigma/2.)" 0 -1 -1
pcone sh1 ax1 0 100*sin((sigma-90)/2*pi/180.) 100
trotate sh1 0 0 0 0 0 1 -theta*180/pi
tcopy sh1 sh2
trotate sh2 0 0 0 0 0 1 180
box sh -D/2 -D/2 72 D D 20
bcommon qq sh1 sh2
bcut sharpener sh qq
bcut body base sharpener
# make a shank
puts "Making a shank..."
plane pl2 0 0 -40 0 0 1
pcylinder shank pl2 4 40
pcone transit R 0 R
plane pl3 0 0 -40 0 0 -0.5
pcone tail pl3 R 0 0.5
bfuse shank shank tail
bfuse shank shank transit
bfuse drill body shank
# check result
checkshape drill
# show result
puts "Displaying result..."
incmesh drill 0.01
vdisplay drill
vsetdispmode drill 1
vfit
# show section and sweep path
ttranslate sec_1 0 0 H; trotate sec_1 0 0 0 0 0 1 a*180/pi; incmesh gg 0.01; vdisplay gg sec_1

View File

@@ -727,20 +727,23 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode,
// Workaround for issue 23115: Need to update also groups, because their // Workaround for issue 23115: Need to update also groups, because their
// face aspect ALWAYS overrides the structure's. // face aspect ALWAYS overrides the structure's.
const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups(); const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
Standard_Integer aGroupIndex = 1, aGroupNb = aGroups.Length(); for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
for ( ; aGroupIndex <= aGroupNb; aGroupIndex++ ) { {
Handle(Graphic3d_Group) aGrp = aGroups.Value(aGroupIndex); Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
if ( !aGrp.IsNull() && aGrp->IsGroupPrimitivesAspectSet(Graphic3d_ASPECT_FILL_AREA) ) { if (aGrp.IsNull()
Handle(Graphic3d_AspectFillArea3d) aFaceAsp = new Graphic3d_AspectFillArea3d(); || !aGrp->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
Handle(Graphic3d_AspectLine3d) aLineAsp = new Graphic3d_AspectLine3d(); {
Handle(Graphic3d_AspectMarker3d) aPntAsp = new Graphic3d_AspectMarker3d(); continue;
Handle(Graphic3d_AspectText3d) aTextAsp = new Graphic3d_AspectText3d();
// TODO: Add methods for retrieving individual aspects from Graphic3d_Group
aGrp->GroupPrimitivesAspect(aLineAsp, aTextAsp, aPntAsp, aFaceAsp);
aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits);
// TODO: Issue 23118 - This line kills texture data in the group...
aGrp->SetGroupPrimitivesAspect(aFaceAsp);
} }
Handle(Graphic3d_AspectFillArea3d) aFaceAsp = new Graphic3d_AspectFillArea3d();
Handle(Graphic3d_AspectLine3d) aLineAsp = new Graphic3d_AspectLine3d();
Handle(Graphic3d_AspectMarker3d) aPntAsp = new Graphic3d_AspectMarker3d();
Handle(Graphic3d_AspectText3d) aTextAsp = new Graphic3d_AspectText3d();
// TODO: Add methods for retrieving individual aspects from Graphic3d_Group
aGrp->GroupPrimitivesAspect(aLineAsp, aTextAsp, aPntAsp, aFaceAsp);
aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits);
aGrp->SetGroupPrimitivesAspect(aFaceAsp);
} }
} }
} }

View File

@@ -21,6 +21,7 @@ class PaveFiller from BOPAlgo
uses uses
Pnt from gp, Pnt from gp,
ShapeEnum from TopAbs,
Vertex from TopoDS, Vertex from TopoDS,
Face from TopoDS, Face from TopoDS,
Edge from TopoDS, Edge from TopoDS,
@@ -140,6 +141,11 @@ is
thePB:out PaveBlock from BOPDS) thePB:out PaveBlock from BOPDS)
is protected; is protected;
FillShrunkData(me:out;
theType1: ShapeEnum from TopAbs;
theType2: ShapeEnum from TopAbs)
is protected;
PerformVerticesEE(me:out; PerformVerticesEE(me:out;
theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theAllocator:out BaseAllocator from BOPCol) theAllocator:out BaseAllocator from BOPCol)

View File

@@ -21,6 +21,9 @@
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_TBB.hxx>
#include <BOPInt_Context.hxx> #include <BOPInt_Context.hxx>
#include <BOPDS_Iterator.hxx> #include <BOPDS_Iterator.hxx>
@@ -31,20 +34,110 @@
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
//=======================================================================
//class : BOPAlgo_VertexEdgeEdge
//purpose :
//=======================================================================
class BOPAlgo_VertexEdge {
public:
BOPAlgo_VertexEdge()
: myIV(-1), myIE(-1), myIVx(-1), myFlag(-1), myT(-1.) {
};
//
~BOPAlgo_VertexEdge(){
};
//
void SetIndices(const Standard_Integer nV,
const Standard_Integer nE,
const Standard_Integer nVx) {
myIV=nV;
myIE=nE;
myIVx=nVx;
}
//
void Indices(Standard_Integer& nV,
Standard_Integer& nE,
Standard_Integer& nVx) const {
nV=myIV;
nE=myIE;
nVx=myIVx;
}
//
void SetVertex(const TopoDS_Vertex& aV) {
myV=aV;
}
//
const TopoDS_Vertex& Vertex()const {
return myV;
}
//
void SetEdge(const TopoDS_Edge& aE) {
myE=aE;
}
//
const TopoDS_Edge& Edge()const {
return myE;
}
//
Standard_Integer Flag()const {
return myFlag;
}
//
Standard_Real Parameter()const {
return myT;
}
//
void SetContext(const Handle(BOPInt_Context)& aContext) {
myContext=aContext;
}
//
const Handle(BOPInt_Context)& Context()const {
return myContext;
}
//
void Perform() {
myFlag=myContext->ComputeVE (myV, myE, myT);
};
//
protected:
Standard_Integer myIV;
Standard_Integer myIE;
Standard_Integer myIVx;
Standard_Integer myFlag;
Standard_Real myT;
TopoDS_Vertex myV;
TopoDS_Edge myE;
Handle(BOPInt_Context) myContext;
};
//=======================================================================
typedef BOPCol_NCVector
<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
//
typedef BOPCol_TBBContextFunctor
<BOPAlgo_VertexEdge,
BOPAlgo_VectorOfVertexEdge,
Handle_BOPInt_Context,
BOPInt_Context> BOPAlgo_VertexEdgeFunctor;
//
typedef BOPCol_TBBContextCnt
<BOPAlgo_VertexEdgeFunctor,
BOPAlgo_VectorOfVertexEdge,
Handle_BOPInt_Context> BOPAlgo_VertexEdgeCnt;
//
//======================================================================= //=======================================================================
// function: PerformVE // function: PerformVE
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPAlgo_PaveFiller::PerformVE() void BOPAlgo_PaveFiller::PerformVE()
{ {
Standard_Boolean bJustAdd; Standard_Boolean bJustAdd;
Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i; Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i, k, aNbVE;;
Standard_Real aT, aTolE, aTolV; Standard_Real aT, aTolE, aTolV;
BOPDS_Pave aPave; BOPDS_Pave aPave;
BOPDS_PassKey aPK; BOPDS_PassKey aPK;
BOPDS_MapOfPassKey aMPK; BOPDS_MapOfPassKey aMPK;
BRep_Builder aBB; BRep_Builder aBB;
BOPAlgo_VectorOfVertexEdge aVVE;
// //
myErrorStatus=0; myErrorStatus=0;
// //
@@ -92,8 +185,27 @@
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape())); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx))); const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx)));
// //
iFlag=myContext->ComputeVE (aV, aE, aT); BOPAlgo_VertexEdge& aVESolver=aVVE.Append1();
//
aVESolver.SetIndices(nV, nE, nVx);
aVESolver.SetVertex(aV);
aVESolver.SetEdge(aE);
//
}// myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
//
aNbVE=aVVE.Extent();
//=============================================================
BOPAlgo_VertexEdgeCnt::Perform(myRunParallel, aVVE, myContext);
//=============================================================
//
for (k=0; k < aNbVE; ++k) {
const BOPAlgo_VertexEdge& aVESolver=aVVE(k);
iFlag=aVESolver.Flag();
if (!iFlag) { if (!iFlag) {
aVESolver.Indices(nV, nE, nVx);
aT=aVESolver.Parameter();
const TopoDS_Vertex& aV=aVESolver.Vertex();
const TopoDS_Edge& aE=aVESolver.Edge();
// 1 // 1
i=aVEs.Append()-1; i=aVEs.Append()-1;
BOPDS_InterfVE& aVE=aVEs(i); BOPDS_InterfVE& aVE=aVEs(i);
@@ -117,5 +229,5 @@
BRepBndLib::Add(aV, aBoxDS); BRepBndLib::Add(aV, aBoxDS);
} }
} }
}//for (; myIterator->More(); myIterator->Next()) { }//for (k=0; k < aNbVE; ++k) {
} }

View File

@@ -98,60 +98,18 @@ class BOPAlgo_EdgeEdge : public IntTools_EdgeEdge {
Handle(BOPDS_PaveBlock) myPB2; Handle(BOPDS_PaveBlock) myPB2;
}; };
// //
typedef BOPCol_NCVector<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge; //=======================================================================
typedef BOPCol_NCVector
<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
// //
typedef BOPCol_TBBFunctor
<BOPAlgo_EdgeEdge,
BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeFunctor;
//
typedef BOPCol_TBBCnt
<BOPAlgo_EdgeEdgeFunctor,
BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeCnt;
// //
//=======================================================================
//class : BOPAlgo_EdgeEdgeFunctor
//purpose :
//=======================================================================
class BOPAlgo_EdgeEdgeFunctor {
protected:
BOPAlgo_VectorOfEdgeEdge* myPVEE;
//
public:
//
BOPAlgo_EdgeEdgeFunctor(BOPAlgo_VectorOfEdgeEdge& aVEE)
: myPVEE(&aVEE) {
}
//
void operator()( const flexible_range<Standard_Integer>& aBR ) const{
Standard_Integer i, iBeg, iEnd;
//
BOPAlgo_VectorOfEdgeEdge& aVEE=*myPVEE;
//
iBeg=aBR.begin();
iEnd=aBR.end();
for(i=iBeg; i!=iEnd; ++i) {
BOPAlgo_EdgeEdge& aEE=aVEE(i);
//
aEE.Perform();
}
}
};
//=======================================================================
//class : BOPAlgo_EdgeEdgeCnt
//purpose :
//=======================================================================
class BOPAlgo_EdgeEdgeCnt {
public:
//-------------------------------
// Perform
Standard_EXPORT
static void Perform(const Standard_Boolean bRunParallel,
BOPAlgo_VectorOfEdgeEdge& aVEdgeEdge) {
//
BOPAlgo_EdgeEdgeFunctor aEEF(aVEdgeEdge);
Standard_Integer aNbEE=aVEdgeEdge.Extent();
//
if (bRunParallel) {
flexible_for(flexible_range<Standard_Integer>(0,aNbEE), aEEF);
}
else {
aEEF.operator()(flexible_range<Standard_Integer>(0,aNbEE));
}
}
};
//======================================================================= //=======================================================================
// function: PerformEE // function: PerformEE
// purpose: // purpose:
@@ -162,6 +120,8 @@ void BOPAlgo_PaveFiller::PerformEE()
// //
myErrorStatus=0; myErrorStatus=0;
// //
FillShrunkData(TopAbs_EDGE, TopAbs_EDGE);
//
myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE); myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
iSize=myIterator->ExpectedLength(); iSize=myIterator->ExpectedLength();
if (!iSize) { if (!iSize) {
@@ -214,10 +174,7 @@ void BOPAlgo_PaveFiller::PerformEE()
// //
Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue(); Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue();
if (!aPB1->HasShrunkData()) { if (!aPB1->HasShrunkData()) {
FillShrunkData(aPB1); continue;
if (myWarningStatus) {
continue;
}
} }
aPB1->ShrunkData(aTS11, aTS12, aBB1); aPB1->ShrunkData(aTS11, aTS12, aBB1);
// //
@@ -227,10 +184,7 @@ void BOPAlgo_PaveFiller::PerformEE()
// //
Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue(); Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
if (!aPB2->HasShrunkData()) { if (!aPB2->HasShrunkData()) {
FillShrunkData(aPB2); continue;
if (myWarningStatus) {
continue;
}
} }
aPB2->ShrunkData(aTS21, aTS22, aBB2); aPB2->ShrunkData(aTS21, aTS22, aBB2);
// //
@@ -744,7 +698,8 @@ void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
nE=thePB->OriginalEdge(); nE=thePB->OriginalEdge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
// //
aSR.SetData(aE, aT1, aT2, aV1, aV2, myContext); aSR.SetContext(myContext);
aSR.SetData(aE, aT1, aT2, aV1, aV2);
// //
aSR.Perform(); aSR.Perform();
iErr=aSR.ErrorStatus(); iErr=aSR.ErrorStatus();

View File

@@ -34,6 +34,9 @@
#include <Geom_Surface.hxx> #include <Geom_Surface.hxx>
#include <Geom2d_Curve.hxx> #include <Geom2d_Curve.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_TBB.hxx>
#include <BOPTools_AlgoTools.hxx> #include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx> #include <BOPTools_AlgoTools2D.hxx>
@@ -52,14 +55,101 @@
#include <BOPDS_MapOfPaveBlock.hxx> #include <BOPDS_MapOfPaveBlock.hxx>
#include <BOPDS_Curve.hxx> #include <BOPDS_Curve.hxx>
static void UpdateVertices(const TopoDS_Edge& aE, static void UpdateVertices(const TopoDS_Edge& aE,
const TopoDS_Face& aF); const TopoDS_Face& aF);
//=======================================================================
//class : BOPAlgo_SplitEdge
//purpose :
//=======================================================================
class BOPAlgo_SplitEdge {
public:
BOPAlgo_SplitEdge() {
myT1=0.;
myT2=0.;
}
//
~BOPAlgo_SplitEdge() {
}
//
void SetData(const TopoDS_Edge& aE,
const TopoDS_Vertex& aV1,
const Standard_Real aT1,
const TopoDS_Vertex& aV2,
const Standard_Real aT2) {
myE=aE;
myV1=aV1;
myT1=aT1;
myV2=aV2;
myT2=aT2;
myESp=aE;
}
//
void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) {
myPB=aPB;
}
//
Handle(BOPDS_PaveBlock)& PaveBlock() {
return myPB;
}
//
void SetCommonBlock(const Handle(BOPDS_CommonBlock)& aCB) {
myCB=aCB;
}
//
Handle(BOPDS_CommonBlock)& CommonBlock() {
return myCB;
}
//
const TopoDS_Edge& SplitEdge() const {
return myESp;
}
//
const Bnd_Box Box() {
return myBox;
}
//
void Perform () {
BOPTools_AlgoTools::MakeSplitEdge(myE,
myV1, myT1,
myV2, myT2,
myESp);
BRepBndLib::Add(myESp, myBox);
}
//
protected:
// ->
TopoDS_Edge myE;
TopoDS_Vertex myV1;
Standard_Real myT1;
TopoDS_Vertex myV2;
Standard_Real myT2;
// <->
Handle(BOPDS_PaveBlock) myPB;
Handle(BOPDS_CommonBlock) myCB;
// <-
TopoDS_Edge myESp;
Bnd_Box myBox;
};
//
//=======================================================================
typedef BOPCol_NCVector
<BOPAlgo_SplitEdge> BOPAlgo_VectorOfSplitEdge;
//
typedef BOPCol_TBBFunctor
<BOPAlgo_SplitEdge,
BOPAlgo_VectorOfSplitEdge> BOPAlgo_SplitEdgeFunctor;
//
typedef BOPCol_TBBCnt
<BOPAlgo_SplitEdgeFunctor,
BOPAlgo_VectorOfSplitEdge> BOPAlgo_SplitEdgeCnt;
//
//======================================================================= //=======================================================================
// function: MakeSplitEdges // function: MakeSplitEdges
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPAlgo_PaveFiller::MakeSplitEdges() void BOPAlgo_PaveFiller::MakeSplitEdges()
{ {
Standard_Integer aNbPBP; Standard_Integer aNbPBP;
// //
@@ -72,26 +162,20 @@ static void UpdateVertices(const TopoDS_Edge& aE,
} }
// //
Standard_Boolean bCB, bV1, bV2; Standard_Boolean bCB, bV1, bV2;
Standard_Integer i, nE, nV1, nV2, nSp, aNbPB; Standard_Integer i, nE, nV1, nV2, nSp, aNbPB, aNbVBSE, k;
Standard_Real aT1, aT2; Standard_Real aT1, aT2;
Handle(NCollection_IncAllocator) aAllocator;
BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBCB; BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBCB;
Handle(BOPDS_PaveBlock) aPB, aPBx; Handle(BOPDS_PaveBlock) aPB;
//-----------------------------------------------------scope f BOPDS_MapOfPaveBlock aMPB(100);
// TopoDS_Vertex aV1, aV2;
aAllocator=new NCollection_IncAllocator(); TopoDS_Edge aE;
// BOPAlgo_VectorOfSplitEdge aVBSE;
BOPDS_MapOfPaveBlock aMPB(100,aAllocator);
// //
for (i=0; i<aNbPBP; ++i) { for (i=0; i<aNbPBP; ++i) {
BOPDS_ListOfPaveBlock& aLPB=aPBP(i); BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
// //
aNbPB=aLPB.Extent(); aNbPB=aLPB.Extent();
//DEBf
if (aNbPB) {
aPBx=aLPB.First();
}
//DEBt
if (aNbPB==1) { if (aNbPB==1) {
aPB=aLPB.First(); aPB=aLPB.First();
aPB->Indices(nV1, nV2); aPB->Indices(nV1, nV2);
@@ -120,23 +204,57 @@ static void UpdateVertices(const TopoDS_Edge& aE,
aPB->Indices(nV1, nV2); aPB->Indices(nV1, nV2);
aPB->Range(aT1, aT2); aPB->Range(aT1, aT2);
// //
nSp = SplitEdge(nE, nV1, aT1, nV2, aT2); aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
aE.Orientation(TopAbs_FORWARD);
// //
aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
aV1.Orientation(TopAbs_FORWARD);
//
aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
aV2.Orientation(TopAbs_REVERSED);
//
BOPAlgo_SplitEdge& aBSE=aVBSE.Append1();
//
aBSE.SetData(aE, aV1, aT1, aV2, aT2);
aBSE.SetPaveBlock(aPB);
if (bCB) { if (bCB) {
aCB->SetEdge(nSp); aBSE.SetCommonBlock(aCB);
} }
else { }
aPB->SetEdge(nSp); } // for (; aItPB.More(); aItPB.Next()) {
} } // for (i=0; i<aNbPBP; ++i) {
}// if (aMPB.Add(aPB)) {
}// for (; aItPB.More(); aItPB.Next()) {
}// for (i=0; i<aNbPBP; ++i) {
// //
//-----------------------------------------------------scope t aNbVBSE=aVBSE.Extent();
aMPB.Clear(); //======================================================
aAllocator.Nullify(); BOPAlgo_SplitEdgeCnt::Perform(myRunParallel, aVBSE);
//======================================================
//
BOPDS_ShapeInfo aSI;
//
aSI.SetShapeType(TopAbs_EDGE);
//
for (k=0; k < aNbVBSE; ++k) {
BOPAlgo_SplitEdge& aBSE=aVBSE(k);
//
const TopoDS_Edge& aSp=aBSE.SplitEdge();
const Bnd_Box& aBox=aBSE.Box();
//
Handle(BOPDS_PaveBlock) aPBk=aBSE.PaveBlock();
Handle(BOPDS_CommonBlock)& aCBk=aBSE.CommonBlock();
//
aSI.SetShape(aSp);
aSI.ChangeBox()=aBox;
//
nSp=myDS->Append(aSI);
//
if (!aCBk.IsNull()) {
aCBk->SetEdge(nSp);
}
else {
aPBk->SetEdge(nSp);
}
}
} }
//======================================================================= //=======================================================================
// function: SplitEdge // function: SplitEdge
// purpose: // purpose:
@@ -173,12 +291,11 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE,
nSp=myDS->Append(aSI); nSp=myDS->Append(aSI);
return nSp; return nSp;
} }
//======================================================================= //=======================================================================
// function: MakePCurves // function: MakePCurves
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPAlgo_PaveFiller::MakePCurves() void BOPAlgo_PaveFiller::MakePCurves()
{ {
Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI; Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB; BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
@@ -262,12 +379,11 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE,
} }
} }
} }
//======================================================================= //=======================================================================
// function: RefineFaceInfoOn // function: RefineFaceInfoOn
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPAlgo_PaveFiller::RefineFaceInfoOn() void BOPAlgo_PaveFiller::RefineFaceInfoOn()
{ {
Standard_Integer aNbPBP; Standard_Integer aNbPBP;
// //
@@ -304,13 +420,13 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE,
}//for (i=0; i<aNbPBP; ++i) { }//for (i=0; i<aNbPBP; ++i) {
myDS->RefineFaceInfoOn(); myDS->RefineFaceInfoOn();
} }
//======================================================================= //=======================================================================
//function : UpdateVertices //function : UpdateVertices
//purpose : update tolerances of vertices comparing extremities of //purpose : update tolerances of vertices comparing extremities of
// 3d and 2d curves // 3d and 2d curves
//======================================================================= //=======================================================================
void UpdateVertices(const TopoDS_Edge& aE, const TopoDS_Face& aF) void UpdateVertices(const TopoDS_Edge& aE,
const TopoDS_Face& aF)
{ {
Standard_Integer j; Standard_Integer j;
Standard_Real aT[2], aUx, aVx, aTolV2, aD2, aD; Standard_Real aT[2], aUx, aVx, aTolV2, aD2, aD;

View File

@@ -0,0 +1,179 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-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 <BOPAlgo_PaveFiller.ixx>
//
#include <Bnd_Box.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_MapOfInteger.hxx>
#include <BOPCol_TBB.hxx>
#include <BOPDS_ShapeInfo.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BOPDS_Iterator.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
#include <BOPInt_ShrunkRange.hxx>
//=======================================================================
//class : BOPAlgo_ShrunkRange
//purpose :
//=======================================================================
class BOPAlgo_ShrunkRange : public BOPInt_ShrunkRange {
public:
BOPAlgo_ShrunkRange()
: BOPInt_ShrunkRange(),
myWarningStatus(0) {
}
//
virtual ~BOPAlgo_ShrunkRange() {
}
//
void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) {
myPB=aPB;
}
//
Handle(BOPDS_PaveBlock)& PaveBlock() {
return myPB;
}
//
virtual void Perform() {
//
myWarningStatus=0;
//
BOPInt_ShrunkRange::Perform();
if (myErrorStatus) {
myWarningStatus=1;
}
}
//
Standard_Integer WarningStatus() const {
return myWarningStatus;
}
//
protected:
Standard_Integer myWarningStatus;
Handle(BOPDS_PaveBlock) myPB;
};
//
//=======================================================================
typedef BOPCol_NCVector
<BOPAlgo_ShrunkRange> BOPAlgo_VectorOfShrunkRange;
//
typedef BOPCol_TBBContextFunctor
<BOPAlgo_ShrunkRange,
BOPAlgo_VectorOfShrunkRange,
Handle_BOPInt_Context,
BOPInt_Context> BOPAlgo_ShrunkRangeFunctor;
//
typedef BOPCol_TBBContextCnt
<BOPAlgo_ShrunkRangeFunctor,
BOPAlgo_VectorOfShrunkRange,
Handle_BOPInt_Context> BOPAlgo_ShrunkRangeCnt;
//
//=======================================================================
// function: FillShrunkData
// purpose:
//=======================================================================
void BOPAlgo_PaveFiller::FillShrunkData(const TopAbs_ShapeEnum aType1,
const TopAbs_ShapeEnum aType2)
{
Standard_Integer iSize;
//
myErrorStatus=0;
//
myIterator->Initialize(aType1, aType2);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
Standard_Boolean bJustAdd;
Standard_Integer i, iEnd, nS[2], nE, nV1, nV2, aNbVSD, k, iWrn;
Standard_Real aT1, aT2, aTS1, aTS2;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
BOPCol_MapOfInteger aMI;
BOPAlgo_VectorOfShrunkRange aVSD;
//
iEnd=(aType2==TopAbs_EDGE) ? 2 : 1;
//
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nS[0], nS[1], bJustAdd);
if(bJustAdd) {
continue;
}
//
for (i=0; i<iEnd; ++i) {
nE=nS[i];
if (!aMI.Add(nE)) {
continue;
}
//
const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
if (aSIE.HasFlag()){
continue;
}
//
BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
aItLPB.Initialize(aLPB);
for (; aItLPB.More(); aItLPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.ChangeValue();
if (aPB->HasShrunkData()) {
continue;
}
//
// FillShrunkData(aPB);
aPB->Indices(nV1, nV2);
aPB->Range(aT1, aT2);
//
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
//
const TopoDS_Vertex& aV1=
(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
//
const TopoDS_Vertex& aV2=
(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
//
BOPAlgo_ShrunkRange& aSD=aVSD.Append1();
//
aSD.SetPaveBlock(aPB);
aSD.SetData(aE, aT1, aT2, aV1, aV2);
}
}
}
//
aNbVSD=aVSD.Extent();
//=============================================================
BOPAlgo_ShrunkRangeCnt::Perform(myRunParallel, aVSD, myContext);
//=============================================================
//
for (k=0; k < aNbVSD; ++k) {
BOPAlgo_ShrunkRange& aSD=aVSD(k);
iWrn=aSD.WarningStatus();
if (iWrn==1) {
continue;
}
//
Handle(BOPDS_PaveBlock)& aPB=aSD.PaveBlock();
aSD.ShrunkRange(aTS1, aTS2);
const Bnd_Box& aBox=aSD.BndBox();
//
aPB->SetShrunkData(aTS1, aTS2, aBox);
}
}

View File

@@ -16,3 +16,4 @@ BOPAlgo_ListOfCheckResult.hxx
BOPAlgo_Builder_2Cnt.hxx BOPAlgo_Builder_2Cnt.hxx
BOPAlgo_CheckerSI_1.cxx BOPAlgo_CheckerSI_1.cxx
BOPAlgo_PaveFiller_9.cxx

View File

@@ -43,7 +43,7 @@ using namespace tbb;
template <class Type> class serial_range { template <class Type> class serial_range {
public: public:
serial_range(const Type& aBegin, serial_range(const Type& aBegin,
const Type& aEnd) const Type& aEnd)
: myBegin(aBegin), myEnd(aEnd) { : myBegin(aBegin), myEnd(aEnd) {
} }
// //
@@ -72,5 +72,149 @@ static void serial_for( const Range& range, const Body& body ) {
body.operator()(range); body.operator()(range);
}; };
#endif // not HAVE_TBB #endif // not HAVE_TBB
//
// 2. Implementation of Functors/Starters
//
// 2.1. Pure version
//
//=======================================================================
//class : BOPCol_TBBFunctor
//purpose :
//=======================================================================
template <class TypeSolver,
class TypeSolverVector> class BOPCol_TBBFunctor {
public:
BOPCol_TBBFunctor(TypeSolverVector& aV)
: myPV(&aV) {
}
//
~BOPCol_TBBFunctor() {
}
//
void operator()( const flexible_range<Standard_Size>& aBR ) const{
Standard_Size i, iBeg, iEnd;
//
TypeSolverVector& aV=*myPV;
//
iBeg=aBR.begin();
iEnd=aBR.end();
for(i=iBeg; i!=iEnd; ++i) {
TypeSolver& aSolver=aV(i);
//
aSolver.Perform();
}
}
//
protected:
TypeSolverVector* myPV;
};
//=======================================================================
//class : BOPCol_TBBCnt
//purpose :
//=======================================================================
template <class TypeFunctor,
class TypeSolverVector> class BOPCol_TBBCnt {
public:
//-------------------------------
// Perform
Standard_EXPORT
static void Perform(const Standard_Boolean bRunParallel,
TypeSolverVector& aV) {
//
TypeFunctor aFunctor(aV);
Standard_Size aNb=aV.Extent();
//
if (bRunParallel) {
flexible_for(flexible_range<Standard_Size>(0,aNb), aFunctor);
}
else {
aFunctor.operator()(flexible_range<Standard_Size>(0,aNb));
}
}
};
//
// 2.2. Context dependent version
//
#include <Standard_Macro.hxx>
//=======================================================================
//class : BOPCol_TBBContextFunctor
//purpose :
//=======================================================================
template <class TypeSolver,
class TypeSolverVector,
class TypeContext,
typename TN> class BOPCol_TBBContextFunctor {
public:
BOPCol_TBBContextFunctor(TypeSolverVector& aV)
: myPV(&aV) {
}
//
~BOPCol_TBBContextFunctor() {
}
//
void SetContext(TypeContext& aCtx) {
myContext=aCtx;
}
//
void operator()( const flexible_range<Standard_Size>& aBR ) const{
Standard_Size i, iBeg, iEnd;
TypeContext aCtx;
//
if (myContext.IsNull()) {
aCtx=new TN
(NCollection_BaseAllocator::CommonBaseAllocator());
}
else {
aCtx=myContext;
}
//
TypeSolverVector& aV=*myPV;
//
iBeg=aBR.begin();
iEnd=aBR.end();
for(i=iBeg; i!=iEnd; ++i) {
TypeSolver& aSolver=aV(i);
//
aSolver.SetContext(aCtx);
aSolver.Perform();
}
}
//
protected:
TypeSolverVector* myPV;
TypeContext myContext;
//
};
//=======================================================================
//class : BOPCol_TBBContextCnt
//purpose :
//=======================================================================
template <class TypeFunctor,
class TypeSolverVector,
class TypeContext> class BOPCol_TBBContextCnt {
public:
//-------------------------------
// Perform
Standard_EXPORT
static void Perform(const Standard_Boolean bRunParallel,
TypeSolverVector& aV,
TypeContext& aCtx) {
//
TypeFunctor aFunctor(aV);
Standard_Size aNb=aV.Extent();
//
if (bRunParallel) {
flexible_for(flexible_range<Standard_Size>(0,aNb), aFunctor);
}
else {
aFunctor.SetContext(aCtx);
aFunctor.operator()(flexible_range<Standard_Size>(0,aNb));
}
}
};
#endif #endif

View File

@@ -14,10 +14,10 @@
class ShrunkRange from BOPInt class ShrunkRange from BOPInt
---Purpose: ---Purpose:
--- The class provides the computation of --- The class provides the computation of
--- a working (shrunk) range [t1, t2] for --- a working (shrunk) range [t1, t2] for
--- the 3D-curve of the edge. --- the 3D-curve of the edge.
uses uses
Box from Bnd, Box from Bnd,
@@ -29,49 +29,56 @@ uses
is is
Create Create
returns ShrunkRange from BOPInt; returns ShrunkRange from BOPInt;
---C++: alias "Standard_EXPORT virtual ~BOPInt_ShrunkRange();"
SetData (me:out; SetData (me:out;
aE : Edge from TopoDS; aE : Edge from TopoDS;
aT1 : Real from Standard; aT1 : Real from Standard;
aT2 : Real from Standard; aT2 : Real from Standard;
aV1 : Vertex from TopoDS; aV1 : Vertex from TopoDS;
aV2 : Vertex from TopoDS; aV2 : Vertex from TopoDS);
ICtx: Context from BOPInt);
SetContext(me:out;
aCtx: Context from BOPInt);
Context(me)
returns Context from BOPInt;
---C++: return const &
SetShrunkRange(me:out; SetShrunkRange(me:out;
aT1 : Real from Standard; aT1 : Real from Standard;
aT2 : Real from Standard); aT2 : Real from Standard);
ShrunkRange(me; ShrunkRange(me;
aT1 :out Real from Standard; aT1 :out Real from Standard;
aT2 :out Real from Standard); aT2 :out Real from Standard);
BndBox (me) BndBox (me)
returns Box from Bnd; returns Box from Bnd;
---C++: return const & ---C++: return const &
Edge (me) Edge (me)
returns Edge from TopoDS; returns Edge from TopoDS;
---C++: return const & ---C++: return const &
Perform(me:out); Perform(me:out);
ErrorStatus(me) ErrorStatus(me)
returns Integer from Standard; returns Integer from Standard;
---Purpose: ---Purpose:
--- Returns code of computing shrunk range --- Returns code of computing shrunk range
--- completion --- completion
--- 0 - means successful completion --- 0 - means successful completion
--- 1 - nothing has been done --- 1 - nothing has been done
--- 2 - initial range is out of edge's range --- 2 - initial range is out of edge's range
--- 3 - first boundary of initial range is more than --- 3 - first boundary of initial range is more than
--- last boundary --- last boundary
--- 4 - projection of first vertex failed --- 4 - projection of first vertex failed
--- 5 - projection of second vertex failed --- 5 - projection of second vertex failed
--- 6 - shrunk range can not be computed --- 6 - shrunk range can not be computed
--- shrunk range is setted to initial range --- shrunk range is setted to initial range
--- ---
fields fields
myEdge : Edge from TopoDS is protected; myEdge : Edge from TopoDS is protected;

View File

@@ -42,30 +42,50 @@
myErrorStatus=1; myErrorStatus=1;
} }
//======================================================================= //=======================================================================
//function : ~
//purpose :
//=======================================================================
BOPInt_ShrunkRange::~BOPInt_ShrunkRange ()
{
}
//=======================================================================
//function : SetData //function : SetData
//purpose : //purpose :
//======================================================================= //=======================================================================
void BOPInt_ShrunkRange::SetData(const TopoDS_Edge& aE, void BOPInt_ShrunkRange::SetData(const TopoDS_Edge& aE,
const Standard_Real aT1, const Standard_Real aT1,
const Standard_Real aT2, const Standard_Real aT2,
const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV1,
const TopoDS_Vertex& aV2, const TopoDS_Vertex& aV2)
const Handle(BOPInt_Context)& aCtx)
{ {
myEdge=aE; myEdge=aE;
myV1=aV1; myV1=aV1;
myV2=aV2; myV2=aV2;
myT1=aT1; myT1=aT1;
myT2=aT2; myT2=aT2;
//myRange=aR;
myCtx=aCtx;
myErrorStatus=1; myErrorStatus=1;
} }
//======================================================================= //=======================================================================
//function : SetContext
//purpose :
//=======================================================================
void BOPInt_ShrunkRange::SetContext(const Handle(BOPInt_Context)& aCtx)
{
myCtx=aCtx;
}
//=======================================================================
//function : Context
//purpose :
//=======================================================================
const Handle(BOPInt_Context)& BOPInt_ShrunkRange::Context()const
{
return myCtx;
}
//=======================================================================
//function : Edge //function : Edge
//purpose : //purpose :
//======================================================================= //=======================================================================
const TopoDS_Edge& BOPInt_ShrunkRange::Edge() const const TopoDS_Edge& BOPInt_ShrunkRange::Edge() const
{ {
return myEdge; return myEdge;
} }
@@ -73,8 +93,8 @@
//function : ShrunkRange //function : ShrunkRange
//purpose : //purpose :
//======================================================================= //=======================================================================
void BOPInt_ShrunkRange::ShrunkRange(Standard_Real& aT1, void BOPInt_ShrunkRange::ShrunkRange(Standard_Real& aT1,
Standard_Real& aT2) const Standard_Real& aT2) const
{ {
aT1=myTS1; aT1=myTS1;
aT2=myTS2; aT2=myTS2;
@@ -83,7 +103,7 @@
//function : BndBox //function : BndBox
//purpose : //purpose :
//======================================================================= //=======================================================================
const Bnd_Box& BOPInt_ShrunkRange::BndBox() const const Bnd_Box& BOPInt_ShrunkRange::BndBox() const
{ {
return myBndBox; return myBndBox;
} }
@@ -91,7 +111,7 @@
//function : ErrorStatus //function : ErrorStatus
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer BOPInt_ShrunkRange::ErrorStatus() const Standard_Integer BOPInt_ShrunkRange::ErrorStatus() const
{ {
return myErrorStatus; return myErrorStatus;
} }
@@ -100,8 +120,8 @@
//function : SetShrunkRange //function : SetShrunkRange
//purpose : //purpose :
//======================================================================= //=======================================================================
void BOPInt_ShrunkRange::SetShrunkRange(const Standard_Real aT1, void BOPInt_ShrunkRange::SetShrunkRange(const Standard_Real aT1,
const Standard_Real aT2) const Standard_Real aT2)
{ {
myTS1=aT1; myTS1=aT1;
myTS2=aT2; myTS2=aT2;
@@ -114,9 +134,10 @@
//function : Perform //function : Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void BOPInt_ShrunkRange::Perform() void BOPInt_ShrunkRange::Perform()
{ {
Standard_Real aCF, aCL, aTolE, aTolV1, aTolV2, t1, t11, t1C, t2, t12, t2C; Standard_Real aCF, aCL, aTolE, aTolV1;
Standard_Real aTolV2, t1, t11, t1C, t2, t12, t2C;
Standard_Real aCoeff1, aCoeff2, aTol1, aTol2, dt1, dt2, aR, anEps; Standard_Real aCoeff1, aCoeff2, aTol1, aTol2, dt1, dt2, aR, anEps;
Standard_Integer pri; Standard_Integer pri;
Standard_Boolean bInf1, bInf2, bAppr; Standard_Boolean bInf1, bInf2, bAppr;
@@ -155,7 +176,7 @@
return; return;
} }
// //
bAppr = (fabs(t2 - t1) > 100) ? Standard_False : Standard_True; bAppr = !(fabs(t2 - t1) > 100);
if (fabs(t2 - t1) < anEps) { if (fabs(t2 - t1) < anEps) {
myErrorStatus=7; myErrorStatus=7;
return; return;
@@ -426,8 +447,7 @@
} }
} }
} // else { } // else {
//
if (t1C>t2){ if (t1C>t2){
t1C=0.5*(t2+t1); t1C=0.5*(t2+t1);
t2C=t1C+0.1*(t2-t1C); t2C=t1C+0.1*(t2-t1C);

View File

@@ -104,10 +104,11 @@ static
// function: MakeConnexityBlocks // function: MakeConnexityBlocks
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeConnexityBlocks (const TopoDS_Shape& theS, void BOPTools_AlgoTools::MakeConnexityBlocks
const TopAbs_ShapeEnum theType1, (const TopoDS_Shape& theS,
const TopAbs_ShapeEnum theType2, const TopAbs_ShapeEnum theType1,
BOPCol_ListOfShape& theLCB) const TopAbs_ShapeEnum theType2,
BOPCol_ListOfShape& theLCB)
{ {
Standard_Integer aNbF, aNbAdd, aNbAdd1, i; Standard_Integer aNbF, aNbAdd, aNbAdd1, i;
BRep_Builder aBB; BRep_Builder aBB;
@@ -203,7 +204,9 @@ void BOPTools_AlgoTools::OrientFacesOnShell (TopoDS_Shape& aShell)
// //
BOPTools_AlgoTools::MakeContainer(TopAbs_SHELL, aShellNew); BOPTools_AlgoTools::MakeContainer(TopAbs_SHELL, aShellNew);
// //
BOPTools::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aEFMap); BOPTools::MapShapesAndAncestors(aShell,
TopAbs_EDGE, TopAbs_FACE,
aEFMap);
aNbE=aEFMap.Extent(); aNbE=aEFMap.Extent();
// //
// One seam edge in aEFMap contains 2 equivalent faces. // One seam edge in aEFMap contains 2 equivalent faces.
@@ -334,18 +337,15 @@ TopAbs_Orientation Orientation(const TopoDS_Edge& anE,
} }
return anOr; return anOr;
} }
////////////
//======================================================================= //=======================================================================
// function: MakeConnexityBlock. // function: MakeConnexityBlock.
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeConnexityBlock (BOPCol_ListOfShape& theLFIn, void BOPTools_AlgoTools::MakeConnexityBlock
BOPCol_IndexedMapOfShape& theMEAvoid, (BOPCol_ListOfShape& theLFIn,
BOPCol_ListOfShape& theLCB, BOPCol_IndexedMapOfShape& theMEAvoid,
const Handle(NCollection_BaseAllocator)& theAllocator) BOPCol_ListOfShape& theLCB,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ {
Standard_Integer aNbF, aNbAdd1, aNbAdd, i; Standard_Integer aNbF, aNbAdd1, aNbAdd, i;
TopExp_Explorer aExp; TopExp_Explorer aExp;
@@ -422,10 +422,11 @@ void BOPTools_AlgoTools::MakeConnexityBlock (BOPCol_ListOfShape& theLFIn,
// function: ComputeStateByOnePoint // function: ComputeStateByOnePoint
// purpose: // purpose:
//======================================================================= //=======================================================================
TopAbs_State BOPTools_AlgoTools::ComputeStateByOnePoint(const TopoDS_Shape& theS, TopAbs_State BOPTools_AlgoTools::ComputeStateByOnePoint
const TopoDS_Solid& theRef, (const TopoDS_Shape& theS,
const Standard_Real theTol, const TopoDS_Solid& theRef,
Handle(BOPInt_Context)& theContext) const Standard_Real theTol,
Handle(BOPInt_Context)& theContext)
{ {
TopAbs_State aState; TopAbs_State aState;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@@ -447,11 +448,12 @@ TopAbs_State BOPTools_AlgoTools::ComputeStateByOnePoint(const TopoDS_Shape& theS
// function: ComputeState // function: ComputeState
// purpose: // purpose:
//======================================================================= //=======================================================================
TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Face& theF, TopAbs_State BOPTools_AlgoTools::ComputeState
const TopoDS_Solid& theRef, (const TopoDS_Face& theF,
const Standard_Real theTol, const TopoDS_Solid& theRef,
BOPCol_IndexedMapOfShape& theBounds, const Standard_Real theTol,
Handle(BOPInt_Context)& theContext) BOPCol_IndexedMapOfShape& theBounds,
Handle(BOPInt_Context)& theContext)
{ {
TopAbs_State aState; TopAbs_State aState;
TopExp_Explorer aExp; TopExp_Explorer aExp;
@@ -470,7 +472,8 @@ TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Face& theF,
// //
if (!theBounds.Contains(aSE)) { if (!theBounds.Contains(aSE)) {
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aSE)); const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aSE));
aState=BOPTools_AlgoTools::ComputeState(aE, theRef, theTol, theContext); aState=BOPTools_AlgoTools::ComputeState(aE, theRef, theTol,
theContext);
return aState; return aState;
} }
if (aE1.IsNull()) { if (aE1.IsNull()) {
@@ -479,8 +482,10 @@ TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Face& theF,
} }
// !!<- process edges that are all on theRef // !!<- process edges that are all on theRef
if (!aE1.IsNull()) { if (!aE1.IsNull()) {
BOPTools_AlgoTools3D::PointNearEdge(aE1, theF, aP2D, aP3D, theContext); BOPTools_AlgoTools3D::PointNearEdge(aE1, theF,
aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol, theContext); aP2D, aP3D, theContext);
aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol,
theContext);
} }
// //
return aState; return aState;
@@ -489,26 +494,29 @@ TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Face& theF,
// function: ComputeState // function: ComputeState
// purpose: // purpose:
//======================================================================= //=======================================================================
TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Vertex& theV, TopAbs_State BOPTools_AlgoTools::ComputeState
const TopoDS_Solid& theRef, (const TopoDS_Vertex& theV,
const Standard_Real theTol, const TopoDS_Solid& theRef,
Handle(BOPInt_Context)& theContext) const Standard_Real theTol,
Handle(BOPInt_Context)& theContext)
{ {
TopAbs_State aState; TopAbs_State aState;
gp_Pnt aP3D; gp_Pnt aP3D;
// //
aP3D=BRep_Tool::Pnt(theV); aP3D=BRep_Tool::Pnt(theV);
aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol, theContext); aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol,
theContext);
return aState; return aState;
} }
//======================================================================= //=======================================================================
// function: ComputeState // function: ComputeState
// purpose: // purpose:
//======================================================================= //=======================================================================
TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Edge& theE, TopAbs_State BOPTools_AlgoTools::ComputeState
const TopoDS_Solid& theRef, (const TopoDS_Edge& theE,
const Standard_Real theTol, const TopoDS_Solid& theRef,
Handle(BOPInt_Context)& theContext) const Standard_Real theTol,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Real aT1, aT2, aT = 0.; Standard_Real aT1, aT2, aT = 0.;
TopAbs_State aState; TopAbs_State aState;
@@ -547,7 +555,8 @@ TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Edge& theE,
aC3D->D0(aT, aP3D); aC3D->D0(aT, aP3D);
} }
// //
aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol, theContext); aState=BOPTools_AlgoTools::ComputeState(aP3D, theRef, theTol,
theContext);
// //
return aState; return aState;
} }
@@ -555,10 +564,11 @@ TopAbs_State BOPTools_AlgoTools::ComputeState(const TopoDS_Edge& theE,
// function: ComputeState // function: ComputeState
// purpose: // purpose:
//======================================================================= //=======================================================================
TopAbs_State BOPTools_AlgoTools::ComputeState(const gp_Pnt& theP, TopAbs_State BOPTools_AlgoTools::ComputeState
const TopoDS_Solid& theRef, (const gp_Pnt& theP,
const Standard_Real theTol, const TopoDS_Solid& theRef,
Handle(BOPInt_Context)& theContext) const Standard_Real theTol,
Handle(BOPInt_Context)& theContext)
{ {
TopAbs_State aState; TopAbs_State aState;
// //
@@ -633,7 +643,8 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
break; break;
} }
// //
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF1, theContext); iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF1,
theContext);
break; break;
} }
// //
@@ -643,7 +654,8 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
// //
if (aF2.IsSame(aF1) && BRep_Tool::IsClosed(aE, aF1)) { if (aF2.IsSame(aF1) && BRep_Tool::IsClosed(aE, aF1)) {
// treat as it was for 1 face // treat as it was for 1 face
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2, theContext); iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aF1, aF2,
theContext);
break; break;
} }
} }
@@ -653,7 +665,8 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
return iRet; // it can not be so return iRet; // it can not be so
} }
else { // aNbF=2,4,6,8,... else { // aNbF=2,4,6,8,...
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF, theContext); iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF,
theContext);
break; break;
} }
}//for(; aExp.More(); aExp.Next()) { }//for(; aExp.More(); aExp.Next()) {
@@ -675,7 +688,8 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
// //
BOPTools::MapShapes(theSolid, TopAbs_EDGE, aBounds); BOPTools::MapShapes(theSolid, TopAbs_EDGE, aBounds);
// //
aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid, theTol, aBounds, theContext); aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid,
theTol, aBounds, theContext);
// //
iRet=(aState==TopAbs_IN)? 1 : 0; iRet=(aState==TopAbs_IN)? 1 : 0;
// //
@@ -685,10 +699,11 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
//function : IsInternalFace //function : IsInternalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer BOPTools_AlgoTools::IsInternalFace(const TopoDS_Face& theFace, Standard_Integer BOPTools_AlgoTools::IsInternalFace
const TopoDS_Edge& theEdge, (const TopoDS_Face& theFace,
BOPCol_ListOfShape& theLF, const TopoDS_Edge& theEdge,
Handle(BOPInt_Context)& theContext) BOPCol_ListOfShape& theLF,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Integer aNbF, iRet; Standard_Integer aNbF, iRet;
// //
@@ -698,7 +713,8 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace(const TopoDS_Face& theFace,
if (aNbF==2) { if (aNbF==2) {
const TopoDS_Face& aF1=(*(TopoDS_Face*)(&theLF.First())); const TopoDS_Face& aF1=(*(TopoDS_Face*)(&theLF.First()));
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&theLF.Last())); const TopoDS_Face& aF2=(*(TopoDS_Face*)(&theLF.Last()));
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2, theContext); iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2,
theContext);
return iRet; return iRet;
} }
// //
@@ -714,7 +730,8 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace(const TopoDS_Face& theFace,
// //
const TopoDS_Face& aF1=(*(TopoDS_Face*)(&aCSFF.Shape1())); const TopoDS_Face& aF1=(*(TopoDS_Face*)(&aCSFF.Shape1()));
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aCSFF.Shape2())); const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aCSFF.Shape2()));
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2, theContext); iRet=BOPTools_AlgoTools::IsInternalFace(theFace, theEdge, aF1, aF2,
theContext);
if (iRet) { if (iRet) {
return iRet; return iRet;
} }
@@ -813,7 +830,8 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
aPL->Bounds(aUmin, aUsup, aVmin, aVsup); aPL->Bounds(aUmin, aUsup, aVmin, aVsup);
aProjPL.Init(aPL, aUmin, aUsup, aVmin, aVsup); aProjPL.Init(aPL, aUmin, aUsup, aVmin, aVsup);
// //
GetFaceDir(theE1, theF1, aPx, aT, aDTgt, aDN1, aDBF, theContext, aProjPL); GetFaceDir(theE1, theF1, aPx, aT, aDTgt, aDN1, aDBF, theContext,
aProjPL);
// //
aDTF=aDN1^aDBF; aDTF=aDN1^aDBF;
// //
@@ -825,7 +843,8 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aCS.Shape2())); const TopoDS_Face& aF2=(*(TopoDS_Face*)(&aCS.Shape2()));
// //
aDTgt2 = (aE2.Orientation()==aOr) ? aDTgt : aDTgt.Reversed(); aDTgt2 = (aE2.Orientation()==aOr) ? aDTgt : aDTgt.Reversed();
GetFaceDir(aE2, aF2, aPx, aT, aDTgt2, aDN2, aDBF2, theContext, aProjPL); GetFaceDir(aE2, aF2, aPx, aT, aDTgt2, aDN2, aDBF2, theContext,
aProjPL);
//Angle //Angle
aAngle=AngleWithRef(aDBF, aDBF2, aDTF); aAngle=AngleWithRef(aDBF, aDBF2, aDTF);
// //
@@ -888,9 +907,10 @@ Standard_Boolean BOPTools_AlgoTools::GetEdgeOff(const TopoDS_Edge& theE1,
//function : AreFacesSameDomain //function : AreFacesSameDomain
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain(const TopoDS_Face& theF1, Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain
const TopoDS_Face& theF2, (const TopoDS_Face& theF1,
Handle(BOPInt_Context)& theContext) const TopoDS_Face& theF2,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
Standard_Integer iErr; Standard_Integer iErr;
@@ -922,7 +942,8 @@ Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain(const TopoDS_Face& theF1
aTolF2=BRep_Tool::Tolerance(aF2); aTolF2=BRep_Tool::Tolerance(aF2);
aTol=aTolF1+aTolF2; aTol=aTolF1+aTolF2;
// //
iErr = BOPTools_AlgoTools3D::PointInFace(aF1, aP, aP2D, theContext); iErr = BOPTools_AlgoTools3D::PointInFace(aF1, aP, aP2D,
theContext);
if (!iErr) { if (!iErr) {
bFlag=theContext->IsValidPointForFace(aP, aF2, aTol); bFlag=theContext->IsValidPointForFace(aP, aF2, aTol);
} }
@@ -934,9 +955,10 @@ Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain(const TopoDS_Face& theF1
//function : CheckSameGeom //function : CheckSameGeom
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::CheckSameGeom(const TopoDS_Face& theF1, Standard_Boolean BOPTools_AlgoTools::CheckSameGeom
const TopoDS_Face& theF2, (const TopoDS_Face& theF1,
Handle(BOPInt_Context)& theContext) const TopoDS_Face& theF2,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Real aTolF1, aTolF2, aTol; Standard_Real aTolF1, aTolF2, aTol;
@@ -1009,9 +1031,10 @@ Standard_Integer BOPTools_AlgoTools::Sense (const TopoDS_Face& theF1,
// function: IsSplitToReverse // function: IsSplitToReverse
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Shape& theSp, Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
const TopoDS_Shape& theSr, (const TopoDS_Shape& theSp,
Handle(BOPInt_Context)& theContext) const TopoDS_Shape& theSr,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@@ -1043,9 +1066,10 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Shape& theSp,
//function :IsSplitToReverse //function :IsSplitToReverse
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Face& theFSp, Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
const TopoDS_Face& theFSr, (const TopoDS_Face& theFSp,
Handle(BOPInt_Context)& theContext) const TopoDS_Face& theFSr,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Boolean bRet, bFound, bInFace; Standard_Boolean bRet, bFound, bInFace;
Standard_Real aT1, aT2, aT, aU, aV, aScPr; Standard_Real aT1, aT2, aT, aU, aV, aScPr;
@@ -1084,7 +1108,8 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Face& theFSp,
Standard_Integer iErr; Standard_Integer iErr;
gp_Pnt2d aP2DFSp; gp_Pnt2d aP2DFSp;
// //
iErr=BOPTools_AlgoTools3D::PointInFace(theFSp, aPFSp, aP2DFSp, theContext); iErr=BOPTools_AlgoTools3D::PointInFace(theFSp, aPFSp, aP2DFSp,
theContext);
if (iErr) { if (iErr) {
return bRet; return bRet;
} }
@@ -1098,7 +1123,9 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Face& theFSp,
else { else {
BRep_Tool::Range(aESp, aT1, aT2); BRep_Tool::Range(aESp, aT1, aT2);
aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2); aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2);
BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aESp, theFSp, aT, aPFSp, aDNFSp, theContext); BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aESp, theFSp, aT,
aPFSp, aDNFSp,
theContext);
} }
// //
// Parts of theContext->ComputeVS(..) // Parts of theContext->ComputeVS(..)
@@ -1132,9 +1159,10 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Face& theFSp,
//function :IsSplitToReverse //function :IsSplitToReverse
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse(const TopoDS_Edge& aEF1, Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
const TopoDS_Edge& aEF2, (const TopoDS_Edge& aEF1,
Handle(BOPInt_Context)& theContext) const TopoDS_Edge& aEF2,
Handle(BOPInt_Context)& theContext)
{ {
Standard_Boolean bRet, bIsDegenerated; Standard_Boolean bRet, bIsDegenerated;
// //
@@ -1322,7 +1350,8 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE,
aTolE=BRep_Tool::Tolerance(aE); aTolE=BRep_Tool::Tolerance(aE);
// //
const Handle(Geom_Curve)& aC3DE=BRep_Tool::Curve(aE, aT1, aT2); const Handle(Geom_Curve)& aC3DE=BRep_Tool::Curve(aE, aT1, aT2);
Handle(Geom_TrimmedCurve)aC3DETrim=new Geom_TrimmedCurve(aC3DE, aT1, aT2); Handle(Geom_TrimmedCurve)aC3DETrim=
new Geom_TrimmedCurve(aC3DE, aT1, aT2);
// //
for (i=0; i<2; ++i) { for (i=0; i<2; ++i) {
bPC = !i ? bPC1 : bPC2; bPC = !i ? bPC1 : bPC2;
@@ -1350,10 +1379,12 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE,
} }
// //
if (aC3DE->IsPeriodic()) { if (aC3DE->IsPeriodic()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA); BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D,
aC2DA);
} }
else { else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D,
aC2DA);
} }
// //
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE); aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
@@ -1376,7 +1407,8 @@ void BOPTools_AlgoTools::MakeEdge(const IntTools_Curve& theIC,
Standard_Real aTolV; Standard_Real aTolV;
BRep_Builder aBB; BRep_Builder aBB;
// //
BOPTools_AlgoTools::MakeSectEdge (theIC, theV1, theT1, theV2, theT2, theE); BOPTools_AlgoTools::MakeSectEdge (theIC, theV1, theT1, theV2, theT2,
theE);
// //
aBB.UpdateEdge(theE, theTolR3D); aBB.UpdateEdge(theE, theTolR3D);
// //
@@ -1486,9 +1518,10 @@ void BOPTools_AlgoTools::MakeVertex(BOPCol_ListOfShape& aLV,
//function : GetEdgeOnFace //function : GetEdgeOnFace
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::GetEdgeOnFace(const TopoDS_Edge& theE1, Standard_Boolean BOPTools_AlgoTools::GetEdgeOnFace
const TopoDS_Face& theF2, (const TopoDS_Edge& theE1,
TopoDS_Edge& theE2) const TopoDS_Face& theF2,
TopoDS_Edge& theE2)
{ {
Standard_Boolean bFound; Standard_Boolean bFound;
TopoDS_Iterator aItF, aItW; TopoDS_Iterator aItF, aItW;
@@ -1639,10 +1672,11 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
// function: IsBlockInOnFace // function: IsBlockInOnFace
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace (const IntTools_Range& aShrR, Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace
const TopoDS_Face& aF, (const IntTools_Range& aShrR,
const TopoDS_Edge& aE1, const TopoDS_Face& aF,
Handle(BOPInt_Context)& aContext) const TopoDS_Edge& aE1,
Handle(BOPInt_Context)& aContext)
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
Standard_Real f1, l1, ULD, VLD; Standard_Real f1, l1, ULD, VLD;
@@ -1729,8 +1763,9 @@ Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace (const IntTools_Range& aShr
//function : IsMicroEdge //function : IsMicroEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPTools_AlgoTools::IsMicroEdge(const TopoDS_Edge& aE, Standard_Boolean BOPTools_AlgoTools::IsMicroEdge
const Handle(BOPInt_Context)& aCtx) (const TopoDS_Edge& aE,
const Handle(BOPInt_Context)& aCtx)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer iErr; Standard_Integer iErr;
@@ -1755,7 +1790,8 @@ Standard_Boolean BOPTools_AlgoTools::IsMicroEdge(const TopoDS_Edge& aE,
} }
// //
BOPInt_ShrunkRange aSR; BOPInt_ShrunkRange aSR;
aSR.SetData(aE, aT1, aT2, aV1, aV2, aCtx); aSR.SetContext(aCtx);
aSR.SetData(aE, aT1, aT2, aV1, aV2);
aSR.Perform(); aSR.Perform();
iErr=aSR.ErrorStatus(); iErr=aSR.ErrorStatus();
bRet = !(iErr==0); bRet = !(iErr==0);
@@ -1785,7 +1821,8 @@ void GetFaceDir(const TopoDS_Edge& aE,
// //
gp_Pnt aPx; gp_Pnt aPx;
if (!FindPointInFace(aE, aF, aP, aDB, aPx, theContext, aProjPL)) { if (!FindPointInFace(aE, aF, aP, aDB, aPx, theContext, aProjPL)) {
BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx, aDN, theContext); BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx,
aDN, theContext);
aProjPL.Perform(aPx); aProjPL.Perform(aPx);
aPx = aProjPL.NearestPoint(); aPx = aProjPL.NearestPoint();
gp_Vec aVec(aP, aPx); gp_Vec aVec(aP, aPx);
@@ -1882,8 +1919,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Edge& aE,
//function : IsOpenShell //function : IsOpenShell
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer i, aNbE, aNbF; Standard_Integer i, aNbE, aNbF;
@@ -1909,7 +1945,7 @@ Standard_Boolean
const TopoDS_Shape& aF=aItLS.Value(); const TopoDS_Shape& aF=aItLS.Value();
aOrF=aF.Orientation(); aOrF=aF.Orientation();
if (aOrF==TopAbs_INTERNAL || aOrF==TopAbs_EXTERNAL) { if (aOrF==TopAbs_INTERNAL || aOrF==TopAbs_EXTERNAL) {
continue; continue;
} }
++aNbF; ++aNbF;
} }

View File

@@ -40,8 +40,9 @@ static
// function: UpdateVertex // function: UpdateVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Vertex& aVF, void BOPTools_AlgoTools::UpdateVertex
const TopoDS_Vertex& aNewVertex) (const TopoDS_Vertex& aVF,
const TopoDS_Vertex& aNewVertex)
{ {
Standard_Real aTolVF, aTolNewVertex, aDist, aDTol=1.e-12, aNewTol; Standard_Real aTolVF, aTolNewVertex, aDist, aDTol=1.e-12, aNewTol;
// //
@@ -63,9 +64,9 @@ static
// function: UpdateVertex // function: UpdateVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Edge& aE, void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Edge& aE,
const Standard_Real aT, const Standard_Real aT,
const TopoDS_Vertex& aV) const TopoDS_Vertex& aV)
{ {
Standard_Real aTolV, aDist, aDTol=1.e-12, aFirst, aLast; Standard_Real aTolV, aDist, aDTol=1.e-12, aFirst, aLast;
gp_Pnt aPc; gp_Pnt aPc;
@@ -86,9 +87,9 @@ static
// function: UpdateVertex // function: UpdateVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::UpdateVertex (const IntTools_Curve& aC, void BOPTools_AlgoTools::UpdateVertex (const IntTools_Curve& aC,
const Standard_Real aT, const Standard_Real aT,
const TopoDS_Vertex& aV) const TopoDS_Vertex& aV)
{ {
Standard_Real aTolV, aDist, aDTol=1.e-12; Standard_Real aTolV, aDist, aDTol=1.e-12;
gp_Pnt aPc; gp_Pnt aPc;
@@ -108,12 +109,12 @@ static
// function: MakeSectEdge // function: MakeSectEdge
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC, void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC,
const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV1,
const Standard_Real aP1, const Standard_Real aP1,
const TopoDS_Vertex& aV2, const TopoDS_Vertex& aV2,
const Standard_Real aP2, const Standard_Real aP2,
TopoDS_Edge& aNewEdge) TopoDS_Edge& aNewEdge)
{ {
Handle(Geom_Curve) aC=aIC.Curve (); Handle(Geom_Curve) aC=aIC.Curve ();
@@ -133,23 +134,19 @@ static
// function: MakeSplitEdge // function: MakeSplitEdge
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE, void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE,
const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV1,
const Standard_Real aP1, const Standard_Real aP1,
const TopoDS_Vertex& aV2, const TopoDS_Vertex& aV2,
const Standard_Real aP2, const Standard_Real aP2,
TopoDS_Edge& aNewEdge) TopoDS_Edge& aNewEdge)
{ {
Standard_Real f, l, aTol; Standard_Real aTol;//f, l,
Handle(Geom_Curve) aC=BRep_Tool::Curve (aE, f, l);
aTol=BRep_Tool::Tolerance(aE); aTol=BRep_Tool::Tolerance(aE);
// //
// MakeEdge is used for chechking all input data only
BRepBuilderAPI_MakeEdge aMakeEdge(aC, aV1, aV2, aP1, aP2);
//ZZ const TopoDS_Edge& E1=TopoDS::Edge(aMakeEdge.Shape());
TopoDS_Edge E=aE; TopoDS_Edge E=aE;
E.EmptyCopy(); E.EmptyCopy();
//
BRep_Builder BB; BRep_Builder BB;
BB.Add (E, aV1); BB.Add (E, aV1);
BB.Add (E, aV2); BB.Add (E, aV2);
@@ -162,9 +159,9 @@ static
// function: MakeNewVertex // function: MakeNewVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Vertex& aV1, void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Vertex& aV1,
const TopoDS_Vertex& aV2, const TopoDS_Vertex& aV2,
TopoDS_Vertex& aNewVertex) TopoDS_Vertex& aNewVertex)
{ {
gp_Pnt aPnt1=BRep_Tool::Pnt(aV1); gp_Pnt aPnt1=BRep_Tool::Pnt(aV1);
Standard_Real aTol1=BRep_Tool::Tolerance(aV1); Standard_Real aTol1=BRep_Tool::Tolerance(aV1);
@@ -190,9 +187,9 @@ static
// function: MakeNewVertex // function: MakeNewVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeNewVertex(const gp_Pnt& aP, void BOPTools_AlgoTools::MakeNewVertex(const gp_Pnt& aP,
const Standard_Real aTol, const Standard_Real aTol,
TopoDS_Vertex& aNewVertex) TopoDS_Vertex& aNewVertex)
{ {
BRep_Builder aBB; BRep_Builder aBB;
aBB.MakeVertex (aNewVertex, aP, aTol); aBB.MakeVertex (aNewVertex, aP, aTol);
@@ -202,11 +199,11 @@ static
// function: MakeNewVertex // function: MakeNewVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1, void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1,
const Standard_Real aParm1, const Standard_Real aParm1,
const TopoDS_Edge& aE2, const TopoDS_Edge& aE2,
const Standard_Real aParm2, const Standard_Real aParm2,
TopoDS_Vertex& aNewVertex) TopoDS_Vertex& aNewVertex)
{ {
Standard_Real aTol1, aTol2, aMaxTol, aDist; Standard_Real aTol1, aTol2, aMaxTol, aDist;
gp_Pnt aPnt1, aPnt2; gp_Pnt aPnt1, aPnt2;
@@ -233,10 +230,10 @@ static
// function: MakeNewVertex // function: MakeNewVertex
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1, void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1,
const Standard_Real aParm1, const Standard_Real aParm1,
const TopoDS_Face& aF1, const TopoDS_Face& aF1,
TopoDS_Vertex& aNewVertex) TopoDS_Vertex& aNewVertex)
{ {
Standard_Real aTol1, aTol2, aMaxTol, delta=1.e-12; Standard_Real aTol1, aTol2, aMaxTol, delta=1.e-12;
gp_Pnt aPnt; gp_Pnt aPnt;
@@ -257,9 +254,9 @@ static
// function: PointOnEdge // function: PointOnEdge
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::PointOnEdge(const TopoDS_Edge& aE, void BOPTools_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
const Standard_Real aParm, const Standard_Real aParm,
gp_Pnt& aPnt) gp_Pnt& aPnt)
{ {
Standard_Real f, l; Standard_Real f, l;
Handle(Geom_Curve) C1=BRep_Tool::Curve(aE, f, l); Handle(Geom_Curve) C1=BRep_Tool::Curve(aE, f, l);
@@ -270,10 +267,10 @@ static
//function : CorrectRange //function : CorrectRange
//purpose : //purpose :
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE1, void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE1,
const TopoDS_Edge& aE2, const TopoDS_Edge& aE2,
const IntTools_Range& aSR, const IntTools_Range& aSR,
IntTools_Range& aNewSR) IntTools_Range& aNewSR)
{ {
Standard_Integer i; Standard_Integer i;
Standard_Real aRes, aTolE1, aTolE2, aTF, aTL, dT; Standard_Real aRes, aTolE1, aTolE2, aTF, aTL, dT;
@@ -342,10 +339,10 @@ static
//function : CorrectRange //function : CorrectRange
//purpose : //purpose :
//======================================================================= //=======================================================================
void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE, void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE,
const TopoDS_Face& aF, const TopoDS_Face& aF,
const IntTools_Range& aSR, const IntTools_Range& aSR,
IntTools_Range& aNewSR) IntTools_Range& aNewSR)
{ {
Standard_Integer i; Standard_Integer i;
Standard_Real aRes, aTolF, aTF, aTL, dT; Standard_Real aRes, aTolF, aTF, aTL, dT;
@@ -408,7 +405,7 @@ static
//function : Dimension //function : Dimension
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer BOPTools_AlgoTools::Dimension(const TopoDS_Shape& theS) Standard_Integer BOPTools_AlgoTools::Dimension(const TopoDS_Shape& theS)
{ {
Standard_Integer i, iRet, iRx0 = 0, iRx = 0; Standard_Integer i, iRet, iRx0 = 0, iRx = 0;
TopAbs_ShapeEnum aTS; TopAbs_ShapeEnum aTS;
@@ -462,8 +459,8 @@ static
//function : TreatCompound //function : TreatCompound
//purpose : //purpose :
//======================================================================= //=======================================================================
void TreatCompound(const TopoDS_Shape& theC1, void TreatCompound(const TopoDS_Shape& theC1,
BOPCol_ListOfShape& theLSX) BOPCol_ListOfShape& theLSX)
{ {
Standard_Integer aNbC1; Standard_Integer aNbC1;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;

View File

@@ -232,11 +232,13 @@ is
UpdateEdge(me; E : Edge from TopoDS; UpdateEdge(me; E : Edge from TopoDS;
C1,C2 : Curve from Geom2d; C1,C2 : Curve from Geom2d;
F : Face from TopoDS; F : Face from TopoDS;
Tol : Real); Tol : Real;
theContinuity : Shape from GeomAbs = GeomAbs_C0);
---C++: inline ---C++: inline
---Purpose: Sets pcurves for the edge on the closed face. If ---Purpose: Sets pcurves (with theContinuity) for the edge on
-- <C1> or <C2> is a null handle, remove any existing -- the closed face.
-- If <C1> or <C2> is a null handle, remove any existing
-- pcurve. -- pcurve.
UpdateEdge(me; E : Edge from TopoDS; UpdateEdge(me; E : Edge from TopoDS;
@@ -248,7 +250,20 @@ is
---Purpose: Sets a pcurve for the edge on the face. ---Purpose: Sets a pcurve for the edge on the face.
-- If <C> is a null handle, remove any existing pcurve. -- If <C> is a null handle, remove any existing pcurve.
UpdateEdge(me; E : Edge from TopoDS; UpdateEdge(me; E : Edge from TopoDS;
C : Curve from Geom2d;
newSurf : Surface from Geom;
newL : Location from TopLoc;
theFace : Face from TopoDS;
Tol : Real from Standard);
---Purpose: Sets a pcurve for the edge on the face.
-- If <C> is a null handle, remove any existing pcurve.
-- New edge will be in the face <theFace>, which
-- based on surface newSurf. Old surface must be
-- deleted from <theFace> later.
UpdateEdge(me; E : Edge from TopoDS;
C : Curve from Geom2d; C : Curve from Geom2d;
S : Surface from Geom; S : Surface from Geom;
L : Location from TopLoc; L : Location from TopLoc;
@@ -263,11 +278,27 @@ is
C1,C2 : Curve from Geom2d; C1,C2 : Curve from Geom2d;
S : Surface from Geom; S : Surface from Geom;
L : Location from TopLoc; L : Location from TopLoc;
Tol : Real); Tol : Real from Standard;
theContinuity : Shape from GeomAbs = GeomAbs_C0);
---Purpose: Sets pcurves (with theContinuity) for the edge on the
-- closed surface.
-- If <C1> or <C2> is a null handle, remove any existing
-- pcurve.
UpdateEdge(me; E : Edge from TopoDS;
C1,C2 : Curve from Geom2d;
newSurf : Surface from Geom;
newL : Location from TopLoc;
theFace : Face from TopoDS;
Tol : Real from Standard);
---Purpose: Sets pcurves for the edge on the closed surface. ---Purpose: Sets pcurves for the edge on the closed surface.
-- <C1> or <C2> is a null handle, remove any existing -- If <C1> or <C2> is a null handle, remove any
-- pcurve. -- existing pcurve.
-- New edge will be in the face <theFace>, which
-- based on surface newSurf. Old surface must be
-- deleted from <theFace> later.
UpdateEdge(me; E : Edge from TopoDS; UpdateEdge(me; E : Edge from TopoDS;
C1,C2 : Curve from Geom2d; C1,C2 : Curve from Geom2d;

View File

@@ -228,7 +228,8 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C1,
const Handle(Geom2d_Curve)& C2, const Handle(Geom2d_Curve)& C2,
const Handle(Geom_Surface)& S, const Handle(Geom_Surface)& S,
const TopLoc_Location& L) const TopLoc_Location& L,
const GeomAbs_Shape theContinuity = GeomAbs_C0)
{ {
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr); BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr; Handle(BRep_CurveRepresentation) cr;
@@ -254,7 +255,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
if ( !C1.IsNull() && !C2.IsNull() ) { if ( !C1.IsNull() && !C2.IsNull() ) {
Handle(BRep_CurveOnClosedSurface) COS = Handle(BRep_CurveOnClosedSurface) COS =
new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0); new BRep_CurveOnClosedSurface(C1,C2,S,L,theContinuity);
// test if there is already a range // test if there is already a range
if (!GC.IsNull()) { if (!GC.IsNull()) {
COS->SetRange(f,l); COS->SetRange(f,l);
@@ -275,7 +276,8 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
const Handle(Geom_Surface)& S, const Handle(Geom_Surface)& S,
const TopLoc_Location& L, const TopLoc_Location& L,
const gp_Pnt2d& Pf, const gp_Pnt2d& Pf,
const gp_Pnt2d& Pl) const gp_Pnt2d& Pl,
const GeomAbs_Shape theContinuity = GeomAbs_C0)
{ {
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr); BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr; Handle(BRep_CurveRepresentation) cr;
@@ -301,7 +303,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
if ( !C1.IsNull() && !C2.IsNull() ) { if ( !C1.IsNull() && !C2.IsNull() ) {
Handle(BRep_CurveOnClosedSurface) COS = Handle(BRep_CurveOnClosedSurface) COS =
new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0); new BRep_CurveOnClosedSurface(C1,C2,S,L,theContinuity);
// test if there is already a range // test if there is already a range
if (!GC.IsNull()) { if (!GC.IsNull()) {
COS->SetRange(f,l); COS->SetRange(f,l);
@@ -338,6 +340,167 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
} }
} }
//=======================================================================
//function : UpdateCurves
//purpose : Insert two pcurves <C1,C2> on surface <newSurf> with
// location <newL> in the list of curve representations <lcr>.
// Deletes curves, which belong to <oldSurf> because <oldSurf>
// will not be used later (presumably).
// Remove the pcurves on <S> from <lcr> if <C1> or <C2> is null
//=======================================================================
static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
const Handle(Geom2d_Curve)& C1,
const Handle(Geom2d_Curve)& C2,
const Handle(Geom_Surface)& newSurf,
const TopLoc_Location& newL,
const Handle(Geom_Surface)& oldSurf,
const TopLoc_Location oldL,
const GeomAbs_Shape theContinuity = GeomAbs_C0)
{
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_GCurve) GC;
Standard_Real aFirst = 0.0, aLast = 0.0;
Standard_Boolean rangeFound = Standard_False;
Standard_Boolean isModified = Standard_False;
while (itcr.More())
{
Handle(BRep_CurveRepresentation) cr = itcr.Value();
GC = Handle(BRep_GCurve)::DownCast(cr);
if ( !GC.IsNull() )
{
GC->Range(aFirst, aLast);
Standard_Boolean undefined = (Precision::IsPositiveInfinite(aLast) ||
Precision::IsNegativeInfinite(aFirst));
if (!undefined)
{
rangeFound = Standard_True;
}
Standard_Boolean cond = Standard_False;
cond = cond || GC->IsCurveOnSurface(oldSurf, oldL);
if(!cond)
{
if(GC->IsCurveOnClosedSurface())
{
Handle(BRep_CurveOnSurface) aCS = Handle(BRep_CurveOnSurface)::DownCast(GC);
cond = aCS->IsCurveOnSurface(oldSurf, oldL);
}
}
if (cond)
{
lcr.Remove(itcr);
isModified = Standard_True;
}
else
{
itcr.Next();
}
}//if ( !GC.IsNull() )
else
{
if (cr->IsPolygonOnSurface(oldSurf, oldL))
{
lcr.Remove(itcr);
isModified = Standard_True;
}
else
{
itcr.Next();
}
}
}
if ( !C1.IsNull() && !C2.IsNull() ) {
Handle(BRep_CurveOnClosedSurface) COS =
new BRep_CurveOnClosedSurface(C1,C2,newSurf,newL,theContinuity);
// test if there is already a range
if (rangeFound) {
COS->SetRange(aFirst,aLast);
}
lcr.Append(COS);
}
}
//=======================================================================
//function : UpdateCurves
//purpose : Insert the pcurve <C> on surface <newSurf> with
// location <newL> in the list of curve representations <lcr>.
// Remove the pcurves on <oldSurf> from <lcr> if <C> is null
//=======================================================================
static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& newSurf,
const TopLoc_Location& newL,
const Handle(Geom_Surface)& oldSurf,
const TopLoc_Location oldL)
{
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
Standard_Real f = 0.0, l = 0.0;
Standard_Boolean rangeFound = Standard_False;
// search the range of the 3d curve
// and remove any existing representation
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
if (!GC.IsNull()) {
if (GC->IsCurve3D()) {
GC->Range(f, l);
Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
Precision::IsNegativeInfinite(f));
if (!undefined) {
rangeFound = Standard_True;
}
}
if (GC->IsCurveOnSurface(oldSurf,oldL))
{
GC->Range(f, l);
Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
Precision::IsNegativeInfinite(f));
if (!undefined)
{
rangeFound = Standard_True;
}
// remove existing curve on surface
// cr is used to keep a reference on the curve representation
// this avoid deleting it as its content may be referenced by C or S
cr = itcr.Value();
lcr.Remove(itcr);
}
else {
itcr.Next();
}
}
else {
itcr.Next();
}
}
if (! C.IsNull()) {
Handle(BRep_CurveOnSurface) COS = new BRep_CurveOnSurface(C,newSurf,newL);
// test if there is already a range
if (rangeFound) {
COS->SetRange(f,l);
}
lcr.Append(COS);
}
}
static void UpdatePoints(BRep_ListOfPointRepresentation& lpr, static void UpdatePoints(BRep_ListOfPointRepresentation& lpr,
Standard_Real p, Standard_Real p,
const Handle(Geom_Curve)& C, const Handle(Geom_Curve)& C,
@@ -573,6 +736,33 @@ void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
TE->Modified(Standard_True); TE->Modified(Standard_True);
} }
//=======================================================================
//function : UpdateEdge
//purpose :
//=======================================================================
void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& newSurf,
const TopLoc_Location& newL,
const TopoDS_Face& theFace,
const Standard_Real Tol) const
{
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
const TopLoc_Location l = newL.Predivided(E.Location());
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &theFace.TShape());
const TopLoc_Location &L = theFace.Location() * TF->Location();
const Handle(Geom_Surface) &S = TF->Surface();
//BRep_Tool::Degenerated(E);
UpdateCurves(TE->ChangeCurves(),
C, newSurf, l, S,
L.Predivided(E.Location()));
TE->UpdateTolerance(Tol);
TE->Modified(Standard_True);
}
//======================================================================= //=======================================================================
//function : UpdateEdge //function : UpdateEdge
@@ -607,12 +797,13 @@ void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
const Handle(Geom2d_Curve)& C2, const Handle(Geom2d_Curve)& C2,
const Handle(Geom_Surface)& S, const Handle(Geom_Surface)& S,
const TopLoc_Location& L, const TopLoc_Location& L,
const Standard_Real Tol) const const Standard_Real Tol,
const GeomAbs_Shape theContinuity) const
{ {
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape()); const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
const TopLoc_Location l = L.Predivided(E.Location()); const TopLoc_Location l = L.Predivided(E.Location());
UpdateCurves(TE->ChangeCurves(),C1,C2,S,l); UpdateCurves(TE->ChangeCurves(),C1,C2,S,l,theContinuity);
if (!C1.IsNull() && !C2.IsNull()) if (!C1.IsNull() && !C2.IsNull())
TE->Closed(C1->IsClosed() && C2->IsClosed()); TE->Closed(C1->IsClosed() && C2->IsClosed());
@@ -894,6 +1085,36 @@ void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
TE->Modified(Standard_True); TE->Modified(Standard_True);
} }
//=======================================================================
//function : UpdateEdge
//purpose :
//=======================================================================
void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
const Handle(Geom2d_Curve)& C1,
const Handle(Geom2d_Curve)& C2,
const Handle(Geom_Surface)& newSurf,
const TopLoc_Location& newL,
const TopoDS_Face& theFace,
const Standard_Real Tol) const
{
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
const TopLoc_Location l = newL.Predivided(E.Location());
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &theFace.TShape());
const TopLoc_Location &L = theFace.Location() * TF->Location();
const Handle(Geom_Surface) &S = TF->Surface();
UpdateCurves(TE->ChangeCurves(),
C1,C2,newSurf,l,S,
L.Predivided(E.Location()));
if (!C1.IsNull() && !C2.IsNull())
TE->Closed(C1->IsClosed() && C2->IsClosed());
TE->UpdateTolerance(Tol);
TE->Modified(Standard_True);
}
//======================================================================= //=======================================================================
//function : Continuity //function : Continuity

View File

@@ -140,10 +140,11 @@ inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C1,
const Handle(Geom2d_Curve)& C2, const Handle(Geom2d_Curve)& C2,
const TopoDS_Face& F, const TopoDS_Face& F,
const Standard_Real Tol) const const Standard_Real Tol,
const GeomAbs_Shape theContinuity) const
{ {
TopLoc_Location l; TopLoc_Location l;
UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol); UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol, theContinuity);
} }

View File

@@ -36,16 +36,9 @@ uses
is is
generic class ApproxLineGen; class ApproxLine;
class ApproxLine instantiates ApproxLineGen from BRepApprox class SurfaceTool;
(BSplineCurve from Geom,
BSplineCurve from Geom2d);
generic class SurfaceToolGen;
class SurfaceTool instantiates SurfaceToolGen from BRepApprox
(Surface from BRepAdaptor);
class Approx instantiates Approx from ApproxInt class Approx instantiates Approx from ApproxInt
(Surface from BRepAdaptor, (Surface from BRepAdaptor,

View File

@@ -14,42 +14,40 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class ApproxLineGen from BRepApprox class ApproxLine from BRepApprox inherits TShared from MMgt
(TheCurve as any;
TheCurve2d as any)
inherits TShared from MMgt
uses uses
PntOn2S from IntSurf, PntOn2S from IntSurf,
LineOn2S from IntSurf LineOn2S from IntSurf,
BSplineCurve from Geom,
BSplineCurve from Geom2d
is is
Create(CurveXYZ: TheCurve; Create(CurveXYZ: BSplineCurve from Geom;
CurveUV1: TheCurve2d; CurveUV1: BSplineCurve from Geom2d;
CurveUV2: TheCurve2d) CurveUV2: BSplineCurve from Geom2d)
returns mutable ApproxLineGen from BRepApprox; returns mutable ApproxLine from BRepApprox;
Create(lin: LineOn2S from IntSurf; Tang: Boolean from Standard) Create(lin: LineOn2S from IntSurf; Tang: Boolean from Standard)
returns mutable ApproxLineGen from BRepApprox; returns mutable ApproxLine from BRepApprox;
NbPnts(me) NbPnts(me)
returns Integer from Standard returns Integer from Standard
is static; is static;
Point(me: mutable; Index: Integer from Standard) Point(me: mutable; Index: Integer from Standard)
returns PntOn2S from IntSurf returns PntOn2S from IntSurf
is static; is static;
fields fields
curvxyz : TheCurve; myCurveXYZ : BSplineCurve from Geom;
curvuv1 : TheCurve2d; myCurveUV1 : BSplineCurve from Geom2d;
curvuv2 : TheCurve2d; myCurveUV2 : BSplineCurve from Geom2d;
pnton2s : PntOn2S from IntSurf; myLineOn2S : LineOn2S from IntSurf;
linon2s : LineOn2S from IntSurf;
end ApproxLineGen from BRepApprox; end ApproxLine from BRepApprox;

View File

@@ -14,33 +14,35 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <BRepApprox_ApproxLine.ixx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
//======================================================================= //=======================================================================
//function : BRepApprox_ApproxLineGen //function : BRepApprox_ApproxLine
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepApprox_ApproxLineGen::BRepApprox_ApproxLineGen BRepApprox_ApproxLine::BRepApprox_ApproxLine
(const TheCurve& CurveXYZ, (const Handle(Geom_BSplineCurve)& CurveXYZ,
const TheCurve2d& CurveUV1, const Handle(Geom2d_BSplineCurve)& CurveUV1,
const TheCurve2d& CurveUV2) const Handle(Geom2d_BSplineCurve)& CurveUV2)
{ {
curvxyz = CurveXYZ; myCurveXYZ = CurveXYZ;
curvuv1 = CurveUV1; myCurveUV1 = CurveUV1;
curvuv2 = CurveUV2; myCurveUV2 = CurveUV2;
} }
//======================================================================= //=======================================================================
//function : BRepApprox_ApproxLineGen //function : BRepApprox_ApproxLine
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepApprox_ApproxLineGen::BRepApprox_ApproxLineGen BRepApprox_ApproxLine::BRepApprox_ApproxLine
(const Handle(IntSurf_LineOn2S)& lin, (const Handle(IntSurf_LineOn2S)& lin,
const Standard_Boolean ) const Standard_Boolean )
:linon2s(lin) :myLineOn2S(lin)
{ {
} }
@@ -49,15 +51,15 @@ BRepApprox_ApproxLineGen::BRepApprox_ApproxLineGen
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer BRepApprox_ApproxLineGen::NbPnts() const Standard_Integer BRepApprox_ApproxLine::NbPnts() const
{ {
if(!curvxyz.IsNull()) if(!myCurveXYZ.IsNull())
return(curvxyz->NbPoles()); return(myCurveXYZ->NbPoles());
if(!curvuv1.IsNull()) if(!myCurveUV1.IsNull())
return(curvuv1->NbPoles()); return(myCurveUV1->NbPoles());
if(!curvuv2.IsNull()) if(!myCurveUV2.IsNull())
return(curvuv2->NbPoles()); return(myCurveUV2->NbPoles());
return(linon2s->NbPoints()); return(myLineOn2S->NbPoints());
} }
//======================================================================= //=======================================================================
@@ -65,27 +67,24 @@ Standard_Integer BRepApprox_ApproxLineGen::NbPnts() const
//purpose : //purpose :
//======================================================================= //=======================================================================
IntSurf_PntOn2S BRepApprox_ApproxLineGen::Point IntSurf_PntOn2S BRepApprox_ApproxLine::Point(const Standard_Integer Index)
(const Standard_Integer Index)
{ {
if(!linon2s.IsNull()) { if(!myLineOn2S.IsNull()) {
if(linon2s->NbPoints()) { if(myLineOn2S->NbPoints()) {
return(linon2s->Value(Index)); return(myLineOn2S->Value(Index));
} }
} }
gp_Pnt2d P1,P2; gp_Pnt2d P1,P2;
gp_Pnt P; gp_Pnt P;
if(!curvxyz.IsNull()) if(!myCurveXYZ.IsNull())
P = curvxyz->Pole(Index); P = myCurveXYZ->Pole(Index);
if(!curvuv1.IsNull()) if(!myCurveUV1.IsNull())
P1 = curvuv1->Pole(Index); P1 = myCurveUV1->Pole(Index);
if(!curvuv2.IsNull()) if(!myCurveUV2.IsNull())
P2 = curvuv2->Pole(Index); P2 = myCurveUV2->Pole(Index);
pnton2s.SetValue(P, IntSurf_PntOn2S aPntOn2S;
P1.X(), aPntOn2S.SetValue(P, P1.X(), P1.Y(), P2.X(), P2.Y());
P1.Y(),
P2.X(), return aPntOn2S;
P2.Y());
return(pnton2s);
} }

View File

@@ -14,9 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class SurfaceToolGen from BRepApprox class SurfaceTool from BRepApprox
(TheSurface as any)
uses uses
@@ -35,7 +33,8 @@ uses
HSurface from Adaptor3d, HSurface from Adaptor3d,
HCurve from Adaptor3d, HCurve from Adaptor3d,
Ax1 from gp, Ax1 from gp,
Dir from gp Dir from gp,
Surface from BRepAdaptor
raises raises
@@ -44,48 +43,48 @@ raises
is is
FirstUParameter(myclass; S: TheSurface) FirstUParameter(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
FirstVParameter(myclass; S: TheSurface) FirstVParameter(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
LastUParameter(myclass; S: TheSurface) LastUParameter(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
LastVParameter(myclass; S: TheSurface) LastVParameter(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
NbUIntervals(myclass; S: TheSurface; NbUIntervals(myclass; S: Surface from BRepAdaptor;
Sh : Shape from GeomAbs) Sh : Shape from GeomAbs)
---C++: inline ---C++: inline
returns Integer from Standard; returns Integer from Standard;
NbVIntervals(myclass; S: TheSurface; NbVIntervals(myclass; S: Surface from BRepAdaptor;
Sh : Shape from GeomAbs) Sh : Shape from GeomAbs)
---C++: inline ---C++: inline
returns Integer from Standard; returns Integer from Standard;
UIntervals(myclass; S : TheSurface; UIntervals(myclass; S : Surface from BRepAdaptor;
T : in out Array1OfReal from TColStd; T : in out Array1OfReal from TColStd;
Sh : Shape from GeomAbs); Sh : Shape from GeomAbs);
---C++: inline ---C++: inline
VIntervals(myclass; S : TheSurface; VIntervals(myclass; S : Surface from BRepAdaptor;
T : in out Array1OfReal from TColStd; T : in out Array1OfReal from TColStd;
Sh : Shape from GeomAbs) ; Sh : Shape from GeomAbs) ;
---C++: inline ---C++: inline
UTrim(myclass; S : TheSurface; UTrim(myclass; S : Surface from BRepAdaptor;
First, Last, Tol : Real) First, Last, Tol : Real)
---C++: inline ---C++: inline
returns HSurface from Adaptor3d returns HSurface from Adaptor3d
@@ -93,7 +92,7 @@ is
OutOfRange from Standard; OutOfRange from Standard;
---Purpose: If <First> >= <Last> ---Purpose: If <First> >= <Last>
VTrim(myclass; S : TheSurface; VTrim(myclass; S : Surface from BRepAdaptor;
First, Last, Tol : Real) First, Last, Tol : Real)
---C++: inline ---C++: inline
returns HSurface from Adaptor3d returns HSurface from Adaptor3d
@@ -102,62 +101,62 @@ is
---Purpose: If <First> >= <Last> ---Purpose: If <First> >= <Last>
IsUClosed(myclass; S: TheSurface) IsUClosed(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Boolean from Standard; returns Boolean from Standard;
IsVClosed(myclass; S: TheSurface) IsVClosed(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Boolean from Standard; returns Boolean from Standard;
IsUPeriodic(myclass; S: TheSurface) IsUPeriodic(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Boolean from Standard; returns Boolean from Standard;
UPeriod(myclass; S: TheSurface) UPeriod(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
IsVPeriodic(myclass; S: TheSurface) IsVPeriodic(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Boolean from Standard; returns Boolean from Standard;
VPeriod(myclass; S: TheSurface) VPeriod(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
Value(myclass; S : TheSurface; Value(myclass; S : Surface from BRepAdaptor;
u,v : Real from Standard) u,v : Real from Standard)
---C++: inline ---C++: inline
returns Pnt from gp; returns Pnt from gp;
D0(myclass; S : TheSurface; D0(myclass; S : Surface from BRepAdaptor;
u,v : Real from Standard; u,v : Real from Standard;
P : out Pnt from gp); P : out Pnt from gp);
---C++: inline ---C++: inline
D1(myclass; S : TheSurface; D1(myclass; S : Surface from BRepAdaptor;
u,v : Real from Standard; u,v : Real from Standard;
P : out Pnt from gp; P : out Pnt from gp;
D1u,D1v: out Vec from gp); D1u,D1v: out Vec from gp);
---C++: inline ---C++: inline
D2(myclass; S : TheSurface; D2(myclass; S : Surface from BRepAdaptor;
u,v : Real from Standard; u,v : Real from Standard;
P : out Pnt from gp; P : out Pnt from gp;
D1U,D1V,D2U,D2V,D2UV: out Vec from gp); D1U,D1V,D2U,D2V,D2UV: out Vec from gp);
---C++: inline ---C++: inline
D3(myclass; S : TheSurface; D3(myclass; S : Surface from BRepAdaptor;
u,v : Real from Standard; u,v : Real from Standard;
P : out Pnt from gp; P : out Pnt from gp;
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV: out Vec from gp); D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV: out Vec from gp);
---C++: inline ---C++: inline
DN(myclass; S : TheSurface; DN(myclass; S : Surface from BRepAdaptor;
u,v : Real from Standard; u,v : Real from Standard;
Nu,Nv : Integer from Standard) Nu,Nv : Integer from Standard)
---C++: inline ---C++: inline
@@ -165,58 +164,58 @@ is
UResolution(myclass; S:TheSurface; R3d: Real from Standard) UResolution(myclass; S:Surface from BRepAdaptor; R3d: Real from Standard)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
VResolution(myclass; S:TheSurface; R3d: Real from Standard) VResolution(myclass; S:Surface from BRepAdaptor; R3d: Real from Standard)
---C++: inline ---C++: inline
returns Real from Standard; returns Real from Standard;
GetType(myclass; S: TheSurface) GetType(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns SurfaceType from GeomAbs; returns SurfaceType from GeomAbs;
Plane(myclass; S: TheSurface) Plane(myclass; S: Surface from BRepAdaptor)
---C++: inline ---C++: inline
returns Pln from gp; returns Pln from gp;
Cylinder(myclass; S : TheSurface) returns Cylinder from gp Cylinder(myclass; S : Surface from BRepAdaptor) returns Cylinder from gp
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
Cone(myclass; S : TheSurface) returns Cone from gp Cone(myclass; S : Surface from BRepAdaptor) returns Cone from gp
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
Torus(myclass; S : TheSurface) returns Torus from gp Torus(myclass; S : Surface from BRepAdaptor) returns Torus from gp
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
Sphere(myclass; S : TheSurface) returns Sphere from gp Sphere(myclass; S : Surface from BRepAdaptor) returns Sphere from gp
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
Bezier(myclass; S : TheSurface) returns BezierSurface from Geom Bezier(myclass; S : Surface from BRepAdaptor) returns BezierSurface from Geom
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
BSpline(myclass; S : TheSurface) returns BSplineSurface from Geom BSpline(myclass; S : Surface from BRepAdaptor) returns BSplineSurface from Geom
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
AxeOfRevolution(myclass; S: TheSurface) returns Ax1 from gp AxeOfRevolution(myclass; S: Surface from BRepAdaptor) returns Ax1 from gp
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
Direction(myclass; S: TheSurface) returns Dir from gp Direction(myclass; S: Surface from BRepAdaptor) returns Dir from gp
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
BasisCurve(myclass; S:TheSurface) returns HCurve from Adaptor3d BasisCurve(myclass; S:Surface from BRepAdaptor) returns HCurve from Adaptor3d
raises NoSuchObject from Standard; raises NoSuchObject from Standard;
---C++: inline ---C++: inline
@@ -224,17 +223,17 @@ is
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
NbSamplesU(myclass; S : TheSurface) returns Integer from Standard; NbSamplesU(myclass; S : Surface from BRepAdaptor) returns Integer from Standard;
NbSamplesV(myclass; S : TheSurface) returns Integer from Standard; NbSamplesV(myclass; S : Surface from BRepAdaptor) returns Integer from Standard;
NbSamplesU(myclass; S : TheSurface; u1,u2: Real from Standard) returns Integer from Standard; NbSamplesU(myclass; S : Surface from BRepAdaptor; u1,u2: Real from Standard) returns Integer from Standard;
NbSamplesV(myclass; S : TheSurface; v1,v2: Real from Standard) returns Integer from Standard; NbSamplesV(myclass; S : Surface from BRepAdaptor; v1,v2: Real from Standard) returns Integer from Standard;
end SurfaceToolGen from BRepApprox ; end SurfaceTool from BRepApprox ;

View File

@@ -14,27 +14,26 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include TheSurface_hxx #include "BRepApprox_SurfaceTool.ixx"
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceToolGen::NbSamplesU (const TheSurface&)
{ {
return(10); return(10);
} }
Standard_Integer BRepApprox_SurfaceToolGen::NbSamplesV (const TheSurface&) Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&)
{ {
return(10); return(10);
} }
Standard_Integer BRepApprox_SurfaceToolGen::NbSamplesU (const TheSurface&, Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&,
const Standard_Real, const Standard_Real,
const Standard_Real) const Standard_Real)
{ {
return(10); return(10);
} }
Standard_Integer BRepApprox_SurfaceToolGen::NbSamplesV (const TheSurface&, Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&,
const Standard_Real, const Standard_Real,
const Standard_Real) const Standard_Real)
{ {

View File

@@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include TheSurface_hxx
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
@@ -29,44 +28,42 @@
#include <Adaptor3d_HSurface.hxx> #include <Adaptor3d_HSurface.hxx>
#include <Adaptor3d_HCurve.hxx> #include <Adaptor3d_HCurve.hxx>
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastVParameter();}
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Real BRepApprox_SurfaceToolGen::FirstUParameter(const TheSurface& Surf){ return Surf.FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceToolGen::FirstVParameter(const TheSurface& Surf){ return Surf.FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceToolGen::LastUParameter(const TheSurface& Surf){ return Surf.LastUParameter();}
inline Standard_Real BRepApprox_SurfaceToolGen::LastVParameter(const TheSurface& Surf){ return Surf.LastVParameter();}
inline Standard_Integer BRepApprox_SurfaceToolGen::NbUIntervals(const TheSurface& Surf,
const GeomAbs_Shape S){ const GeomAbs_Shape S){
return Surf.NbUIntervals(S); return Surf.NbUIntervals(S);
} }
inline Standard_Integer BRepApprox_SurfaceToolGen::NbVIntervals(const TheSurface& Surf, inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S){ const GeomAbs_Shape S){
return Surf.NbVIntervals(S); return Surf.NbVIntervals(S);
} }
inline void BRepApprox_SurfaceToolGen::UIntervals(const TheSurface& Surf, inline void BRepApprox_SurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab, TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){ const GeomAbs_Shape S){
Surf.UIntervals(Tab,S); Surf.UIntervals(Tab,S);
} }
inline void BRepApprox_SurfaceToolGen::VIntervals(const TheSurface& Surf, inline void BRepApprox_SurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab, TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){ const GeomAbs_Shape S){
Surf.VIntervals(Tab,S); Surf.VIntervals(Tab,S);
} }
inline Handle_Adaptor3d_HSurface BRepApprox_SurfaceToolGen::UTrim(const TheSurface& Surf, inline Handle_Adaptor3d_HSurface BRepApprox_SurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F, const Standard_Real F,
const Standard_Real L, const Standard_Real L,
const Standard_Real Tol) { const Standard_Real Tol) {
return Surf.UTrim(F,L,Tol); return Surf.UTrim(F,L,Tol);
} }
inline Handle_Adaptor3d_HSurface BRepApprox_SurfaceToolGen::VTrim(const TheSurface& Surf, inline Handle_Adaptor3d_HSurface BRepApprox_SurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F, const Standard_Real F,
const Standard_Real L, const Standard_Real L,
const Standard_Real Tol) { const Standard_Real Tol) {
@@ -76,44 +73,44 @@ inline Handle_Adaptor3d_HSurface BRepApprox_SurfaceToolGen::VTrim(const TheSurfa
inline Standard_Boolean BRepApprox_SurfaceToolGen::IsUClosed(const TheSurface& S) inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
{ {
return S.IsUClosed(); return S.IsUClosed();
} }
inline Standard_Boolean BRepApprox_SurfaceToolGen::IsVClosed(const TheSurface& S) inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
{ {
return S.IsVClosed(); return S.IsVClosed();
} }
inline Standard_Boolean BRepApprox_SurfaceToolGen::IsUPeriodic(const TheSurface& S) inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
{ {
return S.IsUPeriodic(); return S.IsUPeriodic();
} }
inline Standard_Real BRepApprox_SurfaceToolGen::UPeriod(const TheSurface& S) inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
{ {
return S.UPeriod(); return S.UPeriod();
} }
inline Standard_Boolean BRepApprox_SurfaceToolGen::IsVPeriodic(const TheSurface& S) inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
{ {
return S.IsVPeriodic(); return S.IsVPeriodic();
} }
inline Standard_Real BRepApprox_SurfaceToolGen::VPeriod(const TheSurface& S) inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
{ {
return S.VPeriod(); return S.VPeriod();
} }
inline gp_Pnt BRepApprox_SurfaceToolGen::Value(const TheSurface& S, inline gp_Pnt BRepApprox_SurfaceTool::Value(const BRepAdaptor_Surface& S,
const Standard_Real U, const Standard_Real U,
const Standard_Real V ) const Standard_Real V )
{ {
return S.Value(U,V); return S.Value(U,V);
} }
inline void BRepApprox_SurfaceToolGen::D0(const TheSurface& S, inline void BRepApprox_SurfaceTool::D0(const BRepAdaptor_Surface& S,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
gp_Pnt& P) gp_Pnt& P)
@@ -121,7 +118,7 @@ inline void BRepApprox_SurfaceToolGen::D0(const TheSurface& S,
S.D0(U,V,P); S.D0(U,V,P);
} }
inline void BRepApprox_SurfaceToolGen::D1(const TheSurface& S, inline void BRepApprox_SurfaceTool::D1(const BRepAdaptor_Surface& S,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
gp_Pnt& P, gp_Pnt& P,
@@ -131,7 +128,7 @@ inline void BRepApprox_SurfaceToolGen::D1(const TheSurface& S,
S.D1(U,V,P,D1U,D1V); S.D1(U,V,P,D1U,D1V);
} }
inline void BRepApprox_SurfaceToolGen::D2(const TheSurface& S, inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
gp_Pnt& P, gp_Pnt& P,
@@ -144,7 +141,7 @@ inline void BRepApprox_SurfaceToolGen::D2(const TheSurface& S,
S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV); S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
} }
inline void BRepApprox_SurfaceToolGen::D3(const TheSurface& S, inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
gp_Pnt& P, gp_Pnt& P,
@@ -161,7 +158,7 @@ inline void BRepApprox_SurfaceToolGen::D3(const TheSurface& S,
S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV); S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
} }
inline gp_Vec BRepApprox_SurfaceToolGen::DN(const TheSurface& S, inline gp_Vec BRepApprox_SurfaceTool::DN(const BRepAdaptor_Surface& S,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const Standard_Integer Nu, const Standard_Integer Nu,
@@ -170,66 +167,66 @@ inline gp_Vec BRepApprox_SurfaceToolGen::DN(const TheSurface& S,
return S.DN(U,V,Nu,Nv); return S.DN(U,V,Nu,Nv);
} }
inline Standard_Real BRepApprox_SurfaceToolGen::UResolution(const TheSurface& S, inline Standard_Real BRepApprox_SurfaceTool::UResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d) const Standard_Real R3d)
{ {
return S.UResolution(R3d); return S.UResolution(R3d);
} }
inline Standard_Real BRepApprox_SurfaceToolGen::VResolution(const TheSurface& S, inline Standard_Real BRepApprox_SurfaceTool::VResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d) const Standard_Real R3d)
{ {
return S.VResolution(R3d); return S.VResolution(R3d);
} }
inline GeomAbs_SurfaceType BRepApprox_SurfaceToolGen::GetType(const TheSurface& S ) inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const BRepAdaptor_Surface& S )
{ {
return S.GetType(); return S.GetType();
} }
inline gp_Pln BRepApprox_SurfaceToolGen::Plane(const TheSurface& S) inline gp_Pln BRepApprox_SurfaceTool::Plane(const BRepAdaptor_Surface& S)
{ {
return S.Plane(); return S.Plane();
} }
inline gp_Cylinder BRepApprox_SurfaceToolGen::Cylinder(const TheSurface& S) inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
{ {
return S.Cylinder(); return S.Cylinder();
} }
inline gp_Cone BRepApprox_SurfaceToolGen::Cone(const TheSurface& S) inline gp_Cone BRepApprox_SurfaceTool::Cone(const BRepAdaptor_Surface& S)
{ {
return S.Cone(); return S.Cone();
} }
inline gp_Sphere BRepApprox_SurfaceToolGen::Sphere(const TheSurface& S) inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const BRepAdaptor_Surface& S)
{ {
return S.Sphere(); return S.Sphere();
} }
inline gp_Torus BRepApprox_SurfaceToolGen::Torus(const TheSurface& S) inline gp_Torus BRepApprox_SurfaceTool::Torus(const BRepAdaptor_Surface& S)
{ {
return S.Torus(); return S.Torus();
} }
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceToolGen::Bezier(const TheSurface& S) { inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const BRepAdaptor_Surface& S) {
return(S.Bezier()); return(S.Bezier());
} }
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceToolGen::BSpline(const TheSurface& S) { inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const BRepAdaptor_Surface& S) {
return(S.BSpline()); return(S.BSpline());
} }
inline gp_Ax1 BRepApprox_SurfaceToolGen::AxeOfRevolution(const TheSurface& S) { inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S) {
return(S.AxeOfRevolution()); return(S.AxeOfRevolution());
} }
inline gp_Dir BRepApprox_SurfaceToolGen::Direction(const TheSurface& S) { inline gp_Dir BRepApprox_SurfaceTool::Direction(const BRepAdaptor_Surface& S) {
return(S.Direction()); return(S.Direction());
} }
inline Handle(Adaptor3d_HCurve) BRepApprox_SurfaceToolGen::BasisCurve(const TheSurface& S) { inline Handle(Adaptor3d_HCurve) BRepApprox_SurfaceTool::BasisCurve(const BRepAdaptor_Surface& S) {
return(S.BasisCurve()); return(S.BasisCurve());
} }

View File

@@ -27,14 +27,12 @@ uses Blend, BlendFunc, AppBlend, Approx, Adaptor3d,Adaptor2d,
is is
generic class HCurveToolGen; class PointOnRst;
generic class HCurve2dToolGen; class Extremity;
class Line;
class HCurveTool instantiates HCurveToolGen from BRepBlend ( class HCurveTool;
HCurve from Adaptor3d); class HCurve2dTool;
class HCurve2dTool instantiates HCurve2dToolGen from BRepBlend (
HCurve2d from Adaptor2d);
class BlendTool; class BlendTool;
@@ -62,29 +60,9 @@ is
alias ChAsymInv is ChAsymInv from BlendFunc; alias ChAsymInv is ChAsymInv from BlendFunc;
class PointOnRst instantiates PointOnRst from Blend
(HCurve2d from Adaptor2d);
class SequenceOfPointOnRst instantiates Sequence from TCollection class SequenceOfPointOnRst instantiates Sequence from TCollection
(PointOnRst from BRepBlend); (PointOnRst from BRepBlend);
class Extremity instantiates Extremity from Blend
(HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend);
class Line instantiates Line from Blend
(HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend,
Extremity from BRepBlend);
class Walking instantiates Walking from Blend class Walking instantiates Walking from Blend
(HVertex from Adaptor3d, (HVertex from Adaptor3d,
HCurve2d from Adaptor2d, HCurve2d from Adaptor2d,

View File

@@ -14,20 +14,16 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class Extremity from Blend class Extremity from BRepBlend
(TheVertex as any;
TheArc as any;
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc)
TheSequenceOfPointOnRst as any)
---Purpose: ---Purpose:
uses Pnt from gp, uses Pnt from gp,
Vec from gp, Vec from gp,
Transition from IntSurf Transition from IntSurf,
HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend
raises DomainError from Standard, raises DomainError from Standard,
OutOfRange from Standard OutOfRange from Standard
@@ -36,28 +32,28 @@ is
Create Create
returns Extremity from Blend; returns Extremity from BRepBlend;
Create(P: Pnt from gp; Create(P: Pnt from gp;
U,V,Param: Real from Standard; Tol: Real from Standard) U,V,Param: Real from Standard; Tol: Real from Standard)
---Purpose: Creates an extremity on a surface ---Purpose: Creates an extremity on a surface
returns Extremity from Blend; returns Extremity from BRepBlend;
Create(P: Pnt from gp; Create(P: Pnt from gp;
U,V,Param: Real from Standard; Tol: Real from Standard; U,V,Param: Real from Standard; Tol: Real from Standard;
Vtx: TheVertex) Vtx: HVertex from Adaptor3d)
---Purpose: Creates an extremity on a surface. This extremity matches ---Purpose: Creates an extremity on a surface. This extremity matches
-- the vertex <Vtx>. -- the vertex <Vtx>.
returns Extremity from Blend; returns Extremity from BRepBlend;
Create(P: Pnt from gp; Create(P: Pnt from gp;
W, Param: Real from Standard; Tol: Real from Standard) W, Param: Real from Standard; Tol: Real from Standard)
---Purpose: Creates an extremity on a curve ---Purpose: Creates an extremity on a curve
returns Extremity from Blend; returns Extremity from BRepBlend;
SetValue(me: in out; P: Pnt from gp; SetValue(me: in out; P: Pnt from gp;
@@ -69,7 +65,7 @@ is
SetValue(me: in out; P: Pnt from gp; SetValue(me: in out; P: Pnt from gp;
U,V,Param: Real from Standard; U,V,Param: Real from Standard;
Tol: Real from Standard; Vtx: TheVertex) Tol: Real from Standard; Vtx: HVertex from Adaptor3d)
---Purpose: Set the values for an extremity on a surface.This ---Purpose: Set the values for an extremity on a surface.This
-- extremity matches the vertex <Vtx>. -- extremity matches the vertex <Vtx>.
is static; is static;
@@ -132,12 +128,12 @@ is
-- methods for an extremity on a surface -- methods for an extremity on a surface
SetVertex(me: in out; V: TheVertex) SetVertex(me: in out; V: HVertex from Adaptor3d)
---Purpose: Set the values for an extremity on a curve. ---Purpose: Set the values for an extremity on a curve.
is static; is static;
AddArc(me: in out; A: TheArc; Param: Real from Standard; AddArc(me: in out; A: HCurve2d from Adaptor2d; Param: Real from Standard;
TLine, TArc: Transition from IntSurf) TLine, TArc: Transition from IntSurf)
---Purpose: Sets the values of a point which is on the arc ---Purpose: Sets the values of a point which is on the arc
@@ -171,7 +167,7 @@ is
---Purpose: Returns the vertex when IsVertex returns Standard_True. ---Purpose: Returns the vertex when IsVertex returns Standard_True.
returns any TheVertex returns any HVertex from Adaptor3d
---C++: inline ---C++: inline
---C++: return const& ---C++: return const&
@@ -200,7 +196,7 @@ is
---Purpose: ---Purpose:
returns any ThePointOnRst returns any PointOnRst from BRepBlend
---C++: inline ---C++: inline
---C++: return const& ---C++: return const&
@@ -225,8 +221,8 @@ is
is static; is static;
fields fields
vtx : TheVertex; vtx : HVertex from Adaptor3d;
seqpt : TheSequenceOfPointOnRst; seqpt : SequenceOfPointOnRst from BRepBlend;
pt : Pnt from gp; pt : Pnt from gp;
tang : Vec from gp; tang : Vec from gp;
param : Real from Standard; param : Real from Standard;

View File

@@ -12,7 +12,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
Blend_Extremity::Blend_Extremity (): #include <BRepBlend_Extremity.ixx>
#include <BRepBlend_PointOnRst.hxx>
BRepBlend_Extremity::BRepBlend_Extremity ():
pt(gp_Pnt(0,0,0)), pt(gp_Pnt(0,0,0)),
tang(gp_Vec(0,0,0)), tang(gp_Vec(0,0,0)),
param(0.0), u(0.0), v(0.0), tol(0.0), param(0.0), u(0.0), v(0.0), tol(0.0),
@@ -20,7 +23,7 @@ Blend_Extremity::Blend_Extremity ():
{ {
} }
Blend_Extremity::Blend_Extremity (const gp_Pnt& P, BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const Standard_Real Param, const Standard_Real Param,
@@ -33,12 +36,12 @@ Blend_Extremity::Blend_Extremity (const gp_Pnt& P,
} }
Blend_Extremity::Blend_Extremity (const gp_Pnt& P, BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const Standard_Real Param, const Standard_Real Param,
const Standard_Real Tol, const Standard_Real Tol,
const TheVertex& Vtx) : const Handle(Adaptor3d_HVertex)& Vtx) :
vtx(Vtx),pt(P), vtx(Vtx),pt(P),
tang(gp_Vec(0,0,0)), tang(gp_Vec(0,0,0)),
param(Param),u(U),v(V),tol(Tol),isvtx(Standard_True), param(Param),u(U),v(V),tol(Tol),isvtx(Standard_True),
@@ -46,7 +49,7 @@ Blend_Extremity::Blend_Extremity (const gp_Pnt& P,
{} {}
Blend_Extremity::Blend_Extremity (const gp_Pnt& P, BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
const Standard_Real W, const Standard_Real W,
const Standard_Real Param, const Standard_Real Param,
const Standard_Real Tol) : const Standard_Real Tol) :
@@ -57,7 +60,7 @@ Blend_Extremity::Blend_Extremity (const gp_Pnt& P,
{} {}
void Blend_Extremity::SetValue (const gp_Pnt& P, void BRepBlend_Extremity::SetValue (const gp_Pnt& P,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const Standard_Real Param, const Standard_Real Param,
@@ -73,12 +76,12 @@ void Blend_Extremity::SetValue (const gp_Pnt& P,
} }
void Blend_Extremity::SetValue (const gp_Pnt& P, void BRepBlend_Extremity::SetValue (const gp_Pnt& P,
const Standard_Real U, const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const Standard_Real Param, const Standard_Real Param,
const Standard_Real Tol, const Standard_Real Tol,
const TheVertex& Vtx) const Handle(Adaptor3d_HVertex)& Vtx)
{ {
pt = P; pt = P;
u = U; u = U;
@@ -90,7 +93,7 @@ void Blend_Extremity::SetValue (const gp_Pnt& P,
seqpt.Clear(); seqpt.Clear();
} }
void Blend_Extremity::SetValue (const gp_Pnt& P, void BRepBlend_Extremity::SetValue (const gp_Pnt& P,
const Standard_Real W, const Standard_Real W,
const Standard_Real Param, const Standard_Real Param,
const Standard_Real Tol) const Standard_Real Tol)
@@ -104,17 +107,17 @@ void Blend_Extremity::SetValue (const gp_Pnt& P,
} }
void Blend_Extremity::SetVertex (const TheVertex& V) void BRepBlend_Extremity::SetVertex (const Handle(Adaptor3d_HVertex)& V)
{ {
isvtx = Standard_True; isvtx = Standard_True;
vtx = V; vtx = V;
} }
void Blend_Extremity::AddArc (const TheArc& A, void BRepBlend_Extremity::AddArc (const Handle(Adaptor2d_HCurve2d)& A,
const Standard_Real Param, const Standard_Real Param,
const IntSurf_Transition& TLine, const IntSurf_Transition& TLine,
const IntSurf_Transition& TArc) const IntSurf_Transition& TArc)
{ {
seqpt.Append(ThePointOnRst(A,Param,TLine,TArc)); seqpt.Append(BRepBlend_PointOnRst(A,Param,TLine,TArc));
} }

View File

@@ -14,71 +14,71 @@
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
inline const gp_Pnt& Blend_Extremity::Value () const inline const gp_Pnt& BRepBlend_Extremity::Value () const
{ {
return pt; return pt;
} }
inline void Blend_Extremity::SetTangent(const gp_Vec& Tangent) inline void BRepBlend_Extremity::SetTangent(const gp_Vec& Tangent)
{ {
hastang = Standard_True; hastang = Standard_True;
tang = Tangent; tang = Tangent;
} }
inline Standard_Boolean Blend_Extremity::HasTangent () const inline Standard_Boolean BRepBlend_Extremity::HasTangent () const
{ {
return hastang; return hastang;
} }
inline const gp_Vec& Blend_Extremity::Tangent () const inline const gp_Vec& BRepBlend_Extremity::Tangent () const
{ {
if (!hastang) {Standard_DomainError::Raise();} if (!hastang) {Standard_DomainError::Raise();}
return tang; return tang;
} }
inline void Blend_Extremity::Parameters(Standard_Real& U, inline void BRepBlend_Extremity::Parameters(Standard_Real& U,
Standard_Real& V) const Standard_Real& V) const
{ {
U = u; U = u;
V = v; V = v;
} }
inline Standard_Real Blend_Extremity::Tolerance() const inline Standard_Real BRepBlend_Extremity::Tolerance() const
{ {
return tol; return tol;
} }
inline Standard_Boolean Blend_Extremity::IsVertex() const inline Standard_Boolean BRepBlend_Extremity::IsVertex() const
{ {
return isvtx; return isvtx;
} }
inline const TheVertex& Blend_Extremity::Vertex () const inline const Handle_Adaptor3d_HVertex& BRepBlend_Extremity::Vertex () const
{ {
if (!isvtx) {Standard_DomainError::Raise();} if (!isvtx) {Standard_DomainError::Raise();}
return vtx; return vtx;
} }
inline Standard_Integer Blend_Extremity::NbPointOnRst () const inline Standard_Integer BRepBlend_Extremity::NbPointOnRst () const
{ {
return seqpt.Length(); return seqpt.Length();
} }
inline const ThePointOnRst& Blend_Extremity::PointOnRst inline const BRepBlend_PointOnRst& BRepBlend_Extremity::PointOnRst
(const Standard_Integer Index) const (const Standard_Integer Index) const
{ {
return seqpt(Index); return seqpt(Index);
} }
inline Standard_Real Blend_Extremity::Parameter() const inline Standard_Real BRepBlend_Extremity::Parameter() const
{ {
return u; return u;
} }
inline Standard_Real Blend_Extremity::ParameterOnGuide() const inline Standard_Real BRepBlend_Extremity::ParameterOnGuide() const
{ {
return param; return param;

View File

@@ -14,22 +14,22 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class HCurve2dToolGen from BRepBlend ( class HCurve2dTool from BRepBlend
CurveGen as any)
uses uses
Array1OfReal from TColStd, Array1OfReal from TColStd,
Shape from GeomAbs, Shape from GeomAbs,
CurveType from GeomAbs, CurveType from GeomAbs,
Vec2d from gp, Vec2d from gp,
Pnt2d from gp, Pnt2d from gp,
Circ2d from gp, Circ2d from gp,
Elips2d from gp, Elips2d from gp,
Hypr2d from gp, Hypr2d from gp,
Parab2d from gp, Parab2d from gp,
Lin2d from gp, Lin2d from gp,
BezierCurve from Geom2d, BezierCurve from Geom2d,
BSplineCurve from Geom2d BSplineCurve from Geom2d,
HCurve2d from Adaptor2d
raises raises
@@ -43,12 +43,12 @@ is
-- Global methods - Apply to the whole curve. -- Global methods - Apply to the whole curve.
-- --
FirstParameter(myclass; C: CurveGen) returns Real FirstParameter(myclass; C: HCurve2d from Adaptor2d) returns Real
---C++: inline ---C++: inline
; ;
LastParameter(myclass; C: CurveGen) returns Real LastParameter(myclass; C: HCurve2d from Adaptor2d) returns Real
---C++: inline ---C++: inline
; ;
@@ -72,18 +72,18 @@ is
-- use the method Trim(). -- use the method Trim().
Continuity(myclass; C: CurveGen) returns Shape from GeomAbs Continuity(myclass; C: HCurve2d from Adaptor2d) returns Shape from GeomAbs
---Purpose: ---Purpose:
---C++: inline ---C++: inline
; ;
NbIntervals(myclass; C: CurveGen; S : Shape from GeomAbs) returns Integer NbIntervals(myclass; C: HCurve2d from Adaptor2d; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity ---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(myclass) >= <S> -- <S>. May be one if Continuity(myclass) >= <S>
---C++: inline ---C++: inline
; ;
Intervals(myclass; C: CurveGen; T : in out Array1OfReal from TColStd; Intervals(myclass; C: HCurve2d from Adaptor2d; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs) S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals ---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>. -- of continuity <S>.
@@ -95,31 +95,31 @@ is
---C++: inline ---C++: inline
; ;
IsClosed(myclass; C: CurveGen) returns Boolean IsClosed(myclass; C: HCurve2d from Adaptor2d) returns Boolean
---C++: inline ---C++: inline
; ;
IsPeriodic(myclass; C: CurveGen) returns Boolean IsPeriodic(myclass; C: HCurve2d from Adaptor2d) returns Boolean
---C++: inline ---C++: inline
; ;
Period(myclass; C: CurveGen) returns Real Period(myclass; C: HCurve2d from Adaptor2d) returns Real
raises raises
DomainError from Standard -- if the curve is not periodic DomainError from Standard -- if the curve is not periodic
---C++: inline ---C++: inline
; ;
Value(myclass; C: CurveGen; U : Real) returns Pnt2d from gp Value(myclass; C: HCurve2d from Adaptor2d; U : Real) returns Pnt2d from gp
--- Purpose : Computes the point of parameter U on the curve. --- Purpose : Computes the point of parameter U on the curve.
---C++: inline ---C++: inline
; ;
D0 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp) D0 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp)
--- Purpose : Computes the point of parameter U on the curve. --- Purpose : Computes the point of parameter U on the curve.
---C++: inline ---C++: inline
; ;
D1 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp) D1 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
--- Purpose : Computes the point of parameter U on the curve with its --- Purpose : Computes the point of parameter U on the curve with its
-- first derivative. -- first derivative.
raises raises
@@ -129,7 +129,7 @@ is
---C++: inline ---C++: inline
; ;
D2 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp) D2 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
--- Purpose : --- Purpose :
-- Returns the point P of parameter U, the first and second -- Returns the point P of parameter U, the first and second
-- derivatives V1 and V2. -- derivatives V1 and V2.
@@ -140,7 +140,7 @@ is
---C++: inline ---C++: inline
; ;
D3 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp) D3 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
--- Purpose : --- Purpose :
-- Returns the point P of parameter U, the first, the second -- Returns the point P of parameter U, the first, the second
-- and the third derivative. -- and the third derivative.
@@ -151,7 +151,7 @@ is
---C++: inline ---C++: inline
; ;
DN (myclass; C: CurveGen; U : Real; N : Integer) returns Vec2d from gp DN (myclass; C: HCurve2d from Adaptor2d; U : Real; N : Integer) returns Vec2d from gp
--- Purpose : --- Purpose :
-- The returned vector gives the value of the derivative for the -- The returned vector gives the value of the derivative for the
-- order of derivation N. -- order of derivation N.
@@ -164,13 +164,13 @@ is
---C++: inline ---C++: inline
; ;
Resolution(myclass; C: CurveGen; R3d : Real) returns Real Resolution(myclass; C: HCurve2d from Adaptor2d; R3d : Real) returns Real
---Purpose : Returns the parametric resolution corresponding ---Purpose : Returns the parametric resolution corresponding
-- to the real space resolution <R3d>. -- to the real space resolution <R3d>.
---C++: inline ---C++: inline
; ;
GetType(myclass; C: CurveGen) returns CurveType from GeomAbs GetType(myclass; C: HCurve2d from Adaptor2d) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current ---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola, -- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve. -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
@@ -182,43 +182,43 @@ is
-- the corresponding type. -- the corresponding type.
-- --
Line(myclass; C: CurveGen) returns Lin2d from gp Line(myclass; C: HCurve2d from Adaptor2d) returns Lin2d from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Circle(myclass; C: CurveGen) returns Circ2d from gp Circle(myclass; C: HCurve2d from Adaptor2d) returns Circ2d from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Ellipse(myclass; C: CurveGen) returns Elips2d from gp Ellipse(myclass; C: HCurve2d from Adaptor2d) returns Elips2d from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Hyperbola(myclass; C: CurveGen) returns Hypr2d from gp Hyperbola(myclass; C: HCurve2d from Adaptor2d) returns Hypr2d from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Parabola(myclass; C: CurveGen) returns Parab2d from gp Parabola(myclass; C: HCurve2d from Adaptor2d) returns Parab2d from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Bezier(myclass; C: CurveGen) returns BezierCurve from Geom2d Bezier(myclass; C: HCurve2d from Adaptor2d) returns BezierCurve from Geom2d
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
BSpline(myclass; C: CurveGen) returns BSplineCurve from Geom2d BSpline(myclass; C: HCurve2d from Adaptor2d) returns BSplineCurve from Geom2d
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
@@ -228,9 +228,9 @@ is
NbSamples(myclass; C: CurveGen; U0,U1: Real from Standard) NbSamples(myclass; C: HCurve2d from Adaptor2d; U0,U1: Real from Standard)
returns Integer from Standard; returns Integer from Standard;
end HCurve2dToolGen; end HCurve2dTool;

View File

@@ -14,7 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include CurveGen_hxx #include <BRepBlend_HCurve2dTool.ixx>
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx> #include <GeomAbs_Shape.hxx>
#include <Geom2d_BezierCurve.hxx> #include <Geom2d_BezierCurve.hxx>
@@ -24,7 +25,7 @@
//============================================================ //============================================================
Standard_Integer BRepBlend_HCurve2dToolGen::NbSamples (const CurveGen& C, Standard_Integer BRepBlend_HCurve2dTool::NbSamples (const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U0, const Standard_Real U0,
const Standard_Real U1) { const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType(); GeomAbs_CurveType typC = C->GetType();

View File

@@ -14,8 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx> #include <GeomAbs_Shape.hxx>
@@ -33,59 +31,59 @@
#include <TColStd_Array1OfReal.hxx> #include <TColStd_Array1OfReal.hxx>
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::FirstParameter (const CurveGen& C) { inline Standard_Real BRepBlend_HCurve2dTool::FirstParameter (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->FirstParameter()); return(C->FirstParameter());
} }
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::LastParameter (const CurveGen& C) { inline Standard_Real BRepBlend_HCurve2dTool::LastParameter (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->LastParameter()); return(C->LastParameter());
} }
//============================================================ //============================================================
inline GeomAbs_Shape BRepBlend_HCurve2dToolGen::Continuity (const CurveGen& C) { inline GeomAbs_Shape BRepBlend_HCurve2dTool::Continuity (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Continuity()); return(C->Continuity());
} }
//============================================================ //============================================================
inline Standard_Integer BRepBlend_HCurve2dToolGen::NbIntervals(const CurveGen& C,const GeomAbs_Shape Sh) { inline Standard_Integer BRepBlend_HCurve2dTool::NbIntervals(const Handle(Adaptor2d_HCurve2d)& C,const GeomAbs_Shape Sh) {
return(C->NbIntervals(Sh)); return(C->NbIntervals(Sh));
} }
//============================================================ //============================================================
inline void BRepBlend_HCurve2dToolGen::Intervals(const CurveGen& C, inline void BRepBlend_HCurve2dTool::Intervals(const Handle(Adaptor2d_HCurve2d)& C,
TColStd_Array1OfReal& Tab, TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh) { const GeomAbs_Shape Sh) {
C->Intervals(Tab,Sh); C->Intervals(Tab,Sh);
} }
//============================================================ //============================================================
inline Standard_Boolean BRepBlend_HCurve2dToolGen::IsClosed(const CurveGen& C) { inline Standard_Boolean BRepBlend_HCurve2dTool::IsClosed(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->IsClosed()); return(C->IsClosed());
} }
//============================================================ //============================================================
inline Standard_Boolean BRepBlend_HCurve2dToolGen::IsPeriodic(const CurveGen& C) { inline Standard_Boolean BRepBlend_HCurve2dTool::IsPeriodic(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->IsPeriodic()); return(C->IsPeriodic());
} }
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::Period(const CurveGen& C) { inline Standard_Real BRepBlend_HCurve2dTool::Period(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Period()); return(C->Period());
} }
//============================================================ //============================================================
inline gp_Pnt2d BRepBlend_HCurve2dToolGen::Value (const CurveGen& C, inline gp_Pnt2d BRepBlend_HCurve2dTool::Value (const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U) { const Standard_Real U) {
return(C->Value(U)); return(C->Value(U));
} }
//============================================================ //============================================================
inline void BRepBlend_HCurve2dToolGen::D0(const CurveGen& C, inline void BRepBlend_HCurve2dTool::D0(const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P) { gp_Pnt2d& P) {
C->D0(U,P); C->D0(U,P);
} }
//============================================================ //============================================================
inline void BRepBlend_HCurve2dToolGen::D1 (const CurveGen& C, inline void BRepBlend_HCurve2dTool::D1 (const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& T) { gp_Vec2d& T) {
C->D1(U,P,T); C->D1(U,P,T);
} }
//============================================================ //============================================================
inline void BRepBlend_HCurve2dToolGen::D2 (const CurveGen& C, inline void BRepBlend_HCurve2dTool::D2 (const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& T, gp_Vec2d& T,
@@ -94,7 +92,7 @@ inline void BRepBlend_HCurve2dToolGen::D2 (const CurveGen& C,
C->D2(U,P,T,N); C->D2(U,P,T,N);
} }
//============================================================ //============================================================
inline void BRepBlend_HCurve2dToolGen::D3 (const CurveGen& C, inline void BRepBlend_HCurve2dTool::D3 (const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V1, gp_Vec2d& V1,
@@ -104,47 +102,47 @@ inline void BRepBlend_HCurve2dToolGen::D3 (const CurveGen& C,
C->D3(U,P,V1,V2,V3); C->D3(U,P,V1,V2,V3);
} }
//============================================================ //============================================================
inline gp_Vec2d BRepBlend_HCurve2dToolGen::DN (const CurveGen& C, inline gp_Vec2d BRepBlend_HCurve2dTool::DN (const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real U, const Standard_Real U,
const Standard_Integer N) { const Standard_Integer N) {
return(C->DN(U,N)); return(C->DN(U,N));
} }
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::Resolution(const CurveGen& C, inline Standard_Real BRepBlend_HCurve2dTool::Resolution(const Handle(Adaptor2d_HCurve2d)& C,
const Standard_Real R3d) { const Standard_Real R3d) {
return(C->Resolution(R3d)); return(C->Resolution(R3d));
} }
//============================================================ //============================================================
inline GeomAbs_CurveType BRepBlend_HCurve2dToolGen::GetType(const CurveGen& C) { inline GeomAbs_CurveType BRepBlend_HCurve2dTool::GetType(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->GetType()); return(C->GetType());
} }
//============================================================ //============================================================
inline gp_Lin2d BRepBlend_HCurve2dToolGen::Line (const CurveGen& C) { inline gp_Lin2d BRepBlend_HCurve2dTool::Line (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Line()); return(C->Line());
} }
//============================================================ //============================================================
inline gp_Circ2d BRepBlend_HCurve2dToolGen::Circle (const CurveGen& C) { inline gp_Circ2d BRepBlend_HCurve2dTool::Circle (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Circle()); return(C->Circle());
} }
//============================================================ //============================================================
inline gp_Elips2d BRepBlend_HCurve2dToolGen::Ellipse (const CurveGen& C) { inline gp_Elips2d BRepBlend_HCurve2dTool::Ellipse (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Ellipse()); return(C->Ellipse());
} }
//============================================================ //============================================================
inline gp_Parab2d BRepBlend_HCurve2dToolGen::Parabola (const CurveGen& C) { inline gp_Parab2d BRepBlend_HCurve2dTool::Parabola (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Parabola()); return(C->Parabola());
} }
//============================================================ //============================================================
inline gp_Hypr2d BRepBlend_HCurve2dToolGen::Hyperbola (const CurveGen& C) { inline gp_Hypr2d BRepBlend_HCurve2dTool::Hyperbola (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Hyperbola()); return(C->Hyperbola());
} }
//============================================================ //============================================================
inline Handle(Geom2d_BezierCurve) BRepBlend_HCurve2dToolGen::Bezier (const CurveGen& C) { inline Handle(Geom2d_BezierCurve) BRepBlend_HCurve2dTool::Bezier (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Bezier()); return(C->Bezier());
} }
//============================================================ //============================================================
inline Handle(Geom2d_BSplineCurve) BRepBlend_HCurve2dToolGen::BSpline (const CurveGen& C) { inline Handle(Geom2d_BSplineCurve) BRepBlend_HCurve2dTool::BSpline (const Handle(Adaptor2d_HCurve2d)& C) {
return(C->BSpline()); return(C->BSpline());
} }
//============================================================ //============================================================

View File

@@ -14,8 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class HCurveToolGen from BRepBlend ( class HCurveTool from BRepBlend
CurveGen as any)
uses uses
Array1OfReal from TColStd, Array1OfReal from TColStd,
@@ -29,7 +28,8 @@ uses
Parab from gp, Parab from gp,
Lin from gp, Lin from gp,
BezierCurve from Geom, BezierCurve from Geom,
BSplineCurve from Geom BSplineCurve from Geom,
HCurve from Adaptor3d
raises raises
@@ -43,12 +43,12 @@ is
-- Global methods - Apply to the whole curve. -- Global methods - Apply to the whole curve.
-- --
FirstParameter(myclass; C: CurveGen) returns Real FirstParameter(myclass; C: HCurve from Adaptor3d) returns Real
---C++: inline ---C++: inline
; ;
LastParameter(myclass; C: CurveGen) returns Real LastParameter(myclass; C: HCurve from Adaptor3d) returns Real
---C++: inline ---C++: inline
; ;
@@ -72,18 +72,18 @@ is
-- use the method Trim(). -- use the method Trim().
Continuity(myclass; C: CurveGen) returns Shape from GeomAbs Continuity(myclass; C: HCurve from Adaptor3d) returns Shape from GeomAbs
---Purpose: ---Purpose:
---C++: inline ---C++: inline
; ;
NbIntervals(myclass; C: CurveGen; S : Shape from GeomAbs) returns Integer NbIntervals(myclass; C: HCurve from Adaptor3d; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity ---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(myclass) >= <S> -- <S>. May be one if Continuity(myclass) >= <S>
---C++: inline ---C++: inline
; ;
Intervals(myclass; C: CurveGen; T : in out Array1OfReal from TColStd; Intervals(myclass; C: HCurve from Adaptor3d; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs) S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals ---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>. -- of continuity <S>.
@@ -95,31 +95,31 @@ is
---C++: inline ---C++: inline
; ;
IsClosed(myclass; C: CurveGen) returns Boolean IsClosed(myclass; C: HCurve from Adaptor3d) returns Boolean
---C++: inline ---C++: inline
; ;
IsPeriodic(myclass; C: CurveGen) returns Boolean IsPeriodic(myclass; C: HCurve from Adaptor3d) returns Boolean
---C++: inline ---C++: inline
; ;
Period(myclass; C: CurveGen) returns Real Period(myclass; C: HCurve from Adaptor3d) returns Real
raises raises
DomainError from Standard -- if the curve is not periodic DomainError from Standard -- if the curve is not periodic
---C++: inline ---C++: inline
; ;
Value(myclass; C: CurveGen; U : Real) returns Pnt from gp Value(myclass; C: HCurve from Adaptor3d; U : Real) returns Pnt from gp
--- Purpose : Computes the point of parameter U on the curve. --- Purpose : Computes the point of parameter U on the curve.
---C++: inline ---C++: inline
; ;
D0 (myclass; C: CurveGen; U : Real; P : out Pnt from gp) D0 (myclass; C: HCurve from Adaptor3d; U : Real; P : out Pnt from gp)
--- Purpose : Computes the point of parameter U on the curve. --- Purpose : Computes the point of parameter U on the curve.
---C++: inline ---C++: inline
; ;
D1 (myclass; C: CurveGen; U : Real; P : out Pnt from gp ; V : out Vec from gp) D1 (myclass; C: HCurve from Adaptor3d; U : Real; P : out Pnt from gp ; V : out Vec from gp)
--- Purpose : Computes the point of parameter U on the curve with its --- Purpose : Computes the point of parameter U on the curve with its
-- first derivative. -- first derivative.
raises raises
@@ -129,7 +129,7 @@ is
---C++: inline ---C++: inline
; ;
D2 (myclass; C: CurveGen; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp) D2 (myclass; C: HCurve from Adaptor3d; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
--- Purpose : --- Purpose :
-- Returns the point P of parameter U, the first and second -- Returns the point P of parameter U, the first and second
-- derivatives V1 and V2. -- derivatives V1 and V2.
@@ -140,7 +140,7 @@ is
---C++: inline ---C++: inline
; ;
D3 (myclass; C: CurveGen; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp) D3 (myclass; C: HCurve from Adaptor3d; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
--- Purpose : --- Purpose :
-- Returns the point P of parameter U, the first, the second -- Returns the point P of parameter U, the first, the second
-- and the third derivative. -- and the third derivative.
@@ -151,7 +151,7 @@ is
---C++: inline ---C++: inline
; ;
DN (myclass; C: CurveGen; U : Real; N : Integer) returns Vec from gp DN (myclass; C: HCurve from Adaptor3d; U : Real; N : Integer) returns Vec from gp
--- Purpose : --- Purpose :
-- The returned vector gives the value of the derivative for the -- The returned vector gives the value of the derivative for the
-- order of derivation N. -- order of derivation N.
@@ -164,13 +164,13 @@ is
---C++: inline ---C++: inline
; ;
Resolution(myclass; C: CurveGen; R3d : Real) returns Real Resolution(myclass; C: HCurve from Adaptor3d; R3d : Real) returns Real
---Purpose : Returns the parametric resolution corresponding ---Purpose : Returns the parametric resolution corresponding
-- to the real space resolution <R3d>. -- to the real space resolution <R3d>.
---C++: inline ---C++: inline
; ;
GetType(myclass; C: CurveGen) returns CurveType from GeomAbs GetType(myclass; C: HCurve from Adaptor3d) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current ---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola, -- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve. -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
@@ -182,43 +182,43 @@ is
-- the corresponding type. -- the corresponding type.
-- --
Line(myclass; C: CurveGen) returns Lin from gp Line(myclass; C: HCurve from Adaptor3d) returns Lin from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Circle(myclass; C: CurveGen) returns Circ from gp Circle(myclass; C: HCurve from Adaptor3d) returns Circ from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Ellipse(myclass; C: CurveGen) returns Elips from gp Ellipse(myclass; C: HCurve from Adaptor3d) returns Elips from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Hyperbola(myclass; C: CurveGen) returns Hypr from gp Hyperbola(myclass; C: HCurve from Adaptor3d) returns Hypr from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Parabola(myclass; C: CurveGen) returns Parab from gp Parabola(myclass; C: HCurve from Adaptor3d) returns Parab from gp
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
Bezier(myclass; C: CurveGen) returns BezierCurve from Geom Bezier(myclass; C: HCurve from Adaptor3d) returns BezierCurve from Geom
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
; ;
BSpline(myclass; C: CurveGen) returns BSplineCurve from Geom BSpline(myclass; C: HCurve from Adaptor3d) returns BSplineCurve from Geom
raises raises
NoSuchObject from Standard NoSuchObject from Standard
---C++: inline ---C++: inline
@@ -228,9 +228,9 @@ is
NbSamples(myclass; C: CurveGen; U0,U1: Real from Standard) NbSamples(myclass; C: HCurve from Adaptor3d; U0,U1: Real from Standard)
returns Integer from Standard; returns Integer from Standard;
end HCurveToolGen; end HCurveTool;

View File

@@ -14,7 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include CurveGen_hxx #include <BRepBlend_HCurveTool.ixx>
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx> #include <GeomAbs_Shape.hxx>
#include <Geom_BezierCurve.hxx> #include <Geom_BezierCurve.hxx>
@@ -24,7 +25,7 @@
//============================================================ //============================================================
Standard_Integer BRepBlend_HCurveToolGen::NbSamples (const CurveGen& C, Standard_Integer BRepBlend_HCurveTool::NbSamples (const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U0, const Standard_Real U0,
const Standard_Real U1) { const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType(); GeomAbs_CurveType typC = C->GetType();

View File

@@ -14,8 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx> #include <GeomAbs_Shape.hxx>
@@ -33,59 +31,59 @@
#include <TColStd_Array1OfReal.hxx> #include <TColStd_Array1OfReal.hxx>
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurveToolGen::FirstParameter (const CurveGen& C) { inline Standard_Real BRepBlend_HCurveTool::FirstParameter (const Handle(Adaptor3d_HCurve)& C) {
return(C->FirstParameter()); return(C->FirstParameter());
} }
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurveToolGen::LastParameter (const CurveGen& C) { inline Standard_Real BRepBlend_HCurveTool::LastParameter (const Handle(Adaptor3d_HCurve)& C) {
return(C->LastParameter()); return(C->LastParameter());
} }
//============================================================ //============================================================
inline GeomAbs_Shape BRepBlend_HCurveToolGen::Continuity (const CurveGen& C) { inline GeomAbs_Shape BRepBlend_HCurveTool::Continuity (const Handle(Adaptor3d_HCurve)& C) {
return(C->Continuity()); return(C->Continuity());
} }
//============================================================ //============================================================
inline Standard_Integer BRepBlend_HCurveToolGen::NbIntervals(const CurveGen& C,const GeomAbs_Shape Sh) { inline Standard_Integer BRepBlend_HCurveTool::NbIntervals(const Handle(Adaptor3d_HCurve)& C,const GeomAbs_Shape Sh) {
return(C->NbIntervals(Sh)); return(C->NbIntervals(Sh));
} }
//============================================================ //============================================================
inline void BRepBlend_HCurveToolGen::Intervals(const CurveGen& C, inline void BRepBlend_HCurveTool::Intervals(const Handle(Adaptor3d_HCurve)& C,
TColStd_Array1OfReal& Tab, TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh) { const GeomAbs_Shape Sh) {
C->Intervals(Tab,Sh); C->Intervals(Tab,Sh);
} }
//============================================================ //============================================================
inline Standard_Boolean BRepBlend_HCurveToolGen::IsClosed(const CurveGen& C) { inline Standard_Boolean BRepBlend_HCurveTool::IsClosed(const Handle(Adaptor3d_HCurve)& C) {
return(C->IsClosed()); return(C->IsClosed());
} }
//============================================================ //============================================================
inline Standard_Boolean BRepBlend_HCurveToolGen::IsPeriodic(const CurveGen& C) { inline Standard_Boolean BRepBlend_HCurveTool::IsPeriodic(const Handle(Adaptor3d_HCurve)& C) {
return(C->IsPeriodic()); return(C->IsPeriodic());
} }
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurveToolGen::Period(const CurveGen& C) { inline Standard_Real BRepBlend_HCurveTool::Period(const Handle(Adaptor3d_HCurve)& C) {
return(C->Period()); return(C->Period());
} }
//============================================================ //============================================================
inline gp_Pnt BRepBlend_HCurveToolGen::Value (const CurveGen& C, inline gp_Pnt BRepBlend_HCurveTool::Value (const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U) { const Standard_Real U) {
return(C->Value(U)); return(C->Value(U));
} }
//============================================================ //============================================================
inline void BRepBlend_HCurveToolGen::D0(const CurveGen& C, inline void BRepBlend_HCurveTool::D0(const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt& P) { gp_Pnt& P) {
C->D0(U,P); C->D0(U,P);
} }
//============================================================ //============================================================
inline void BRepBlend_HCurveToolGen::D1 (const CurveGen& C, inline void BRepBlend_HCurveTool::D1 (const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& T) { gp_Vec& T) {
C->D1(U,P,T); C->D1(U,P,T);
} }
//============================================================ //============================================================
inline void BRepBlend_HCurveToolGen::D2 (const CurveGen& C, inline void BRepBlend_HCurveTool::D2 (const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& T, gp_Vec& T,
@@ -94,7 +92,7 @@ inline void BRepBlend_HCurveToolGen::D2 (const CurveGen& C,
C->D2(U,P,T,N); C->D2(U,P,T,N);
} }
//============================================================ //============================================================
inline void BRepBlend_HCurveToolGen::D3 (const CurveGen& C, inline void BRepBlend_HCurveTool::D3 (const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& V1, gp_Vec& V1,
@@ -104,47 +102,47 @@ inline void BRepBlend_HCurveToolGen::D3 (const CurveGen& C,
C->D3(U,P,V1,V2,V3); C->D3(U,P,V1,V2,V3);
} }
//============================================================ //============================================================
inline gp_Vec BRepBlend_HCurveToolGen::DN (const CurveGen& C, inline gp_Vec BRepBlend_HCurveTool::DN (const Handle(Adaptor3d_HCurve)& C,
const Standard_Real U, const Standard_Real U,
const Standard_Integer N) { const Standard_Integer N) {
return(C->DN(U,N)); return(C->DN(U,N));
} }
//============================================================ //============================================================
inline Standard_Real BRepBlend_HCurveToolGen::Resolution(const CurveGen& C, inline Standard_Real BRepBlend_HCurveTool::Resolution(const Handle(Adaptor3d_HCurve)& C,
const Standard_Real R3d) { const Standard_Real R3d) {
return(C->Resolution(R3d)); return(C->Resolution(R3d));
} }
//============================================================ //============================================================
inline GeomAbs_CurveType BRepBlend_HCurveToolGen::GetType(const CurveGen& C) { inline GeomAbs_CurveType BRepBlend_HCurveTool::GetType(const Handle(Adaptor3d_HCurve)& C) {
return(C->GetType()); return(C->GetType());
} }
//============================================================ //============================================================
inline gp_Lin BRepBlend_HCurveToolGen::Line (const CurveGen& C) { inline gp_Lin BRepBlend_HCurveTool::Line (const Handle(Adaptor3d_HCurve)& C) {
return(C->Line()); return(C->Line());
} }
//============================================================ //============================================================
inline gp_Circ BRepBlend_HCurveToolGen::Circle (const CurveGen& C) { inline gp_Circ BRepBlend_HCurveTool::Circle (const Handle(Adaptor3d_HCurve)& C) {
return(C->Circle()); return(C->Circle());
} }
//============================================================ //============================================================
inline gp_Elips BRepBlend_HCurveToolGen::Ellipse (const CurveGen& C) { inline gp_Elips BRepBlend_HCurveTool::Ellipse (const Handle(Adaptor3d_HCurve)& C) {
return(C->Ellipse()); return(C->Ellipse());
} }
//============================================================ //============================================================
inline gp_Parab BRepBlend_HCurveToolGen::Parabola (const CurveGen& C) { inline gp_Parab BRepBlend_HCurveTool::Parabola (const Handle(Adaptor3d_HCurve)& C) {
return(C->Parabola()); return(C->Parabola());
} }
//============================================================ //============================================================
inline gp_Hypr BRepBlend_HCurveToolGen::Hyperbola (const CurveGen& C) { inline gp_Hypr BRepBlend_HCurveTool::Hyperbola (const Handle(Adaptor3d_HCurve)& C) {
return(C->Hyperbola()); return(C->Hyperbola());
} }
//============================================================ //============================================================
inline Handle(Geom_BezierCurve) BRepBlend_HCurveToolGen::Bezier (const CurveGen& C) { inline Handle(Geom_BezierCurve) BRepBlend_HCurveTool::Bezier (const Handle(Adaptor3d_HCurve)& C) {
return(C->Bezier()); return(C->Bezier());
} }
//============================================================ //============================================================
inline Handle(Geom_BSplineCurve) BRepBlend_HCurveToolGen::BSpline (const CurveGen& C) { inline Handle(Geom_BSplineCurve) BRepBlend_HCurveTool::BSpline (const Handle(Adaptor3d_HCurve)& C) {
return(C->BSpline()); return(C->BSpline());
} }
//============================================================ //============================================================

View File

@@ -14,21 +14,13 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class Line from Blend
(TheVertex as any;
TheArc as any;
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc)
TheSequenceOfPointOnRst as any;
TheExtremity as any) -- as Extremity from Blend (TheVertex,TheArc,
-- ThePointOnRst,TheSequenceOfPointOnRst)
class Line from BRepBlend inherits TShared from MMgt
inherits TShared from MMgt
uses Point from Blend, uses Point from Blend,
SequenceOfPoint from Blend, SequenceOfPoint from Blend,
Extremity from BRepBlend,
TypeTrans from IntSurf TypeTrans from IntSurf
@@ -39,7 +31,7 @@ is
Create Create
returns mutable Line from Blend; returns mutable Line from BRepBlend;
@@ -101,7 +93,7 @@ is
is static; is static;
SetStartPoints(me: mutable; StartPt1,StartPt2: TheExtremity) SetStartPoints(me: mutable; StartPt1,StartPt2: Extremity from BRepBlend)
---Purpose: Sets the values of the start points for the line. ---Purpose: Sets the values of the start points for the line.
---C++: inline ---C++: inline
@@ -109,7 +101,7 @@ is
is static; is static;
SetEndPoints(me: mutable; EndPt1,EndPt2: TheExtremity) SetEndPoints(me: mutable; EndPt1,EndPt2: Extremity from BRepBlend)
---Purpose: Sets tne values of the end points for the line. ---Purpose: Sets tne values of the end points for the line.
@@ -180,7 +172,7 @@ is
---Purpose: Returns the start point on S1. ---Purpose: Returns the start point on S1.
returns TheExtremity returns Extremity from BRepBlend
---C++: inline ---C++: inline
---C++: return const& ---C++: return const&
@@ -191,7 +183,7 @@ is
---Purpose: Returns the start point on S2 ---Purpose: Returns the start point on S2
returns TheExtremity returns Extremity from BRepBlend
---C++: inline ---C++: inline
---C++: return const& ---C++: return const&
@@ -202,7 +194,7 @@ is
---Purpose: Returns the end point on S1. ---Purpose: Returns the end point on S1.
returns TheExtremity returns Extremity from BRepBlend
---C++: inline ---C++: inline
---C++: return const& ---C++: return const&
@@ -213,7 +205,7 @@ is
---Purpose: Returns the point on S2. ---Purpose: Returns the point on S2.
returns TheExtremity returns Extremity from BRepBlend
---C++: inline ---C++: inline
---C++: return const& ---C++: return const&
@@ -235,10 +227,10 @@ fields
seqpt : SequenceOfPoint from Blend; seqpt : SequenceOfPoint from Blend;
tras1 : TypeTrans from IntSurf; tras1 : TypeTrans from IntSurf;
tras2 : TypeTrans from IntSurf; tras2 : TypeTrans from IntSurf;
stp1 : TheExtremity; stp1 : Extremity from BRepBlend;
stp2 : TheExtremity; stp2 : Extremity from BRepBlend;
endp1 : TheExtremity; endp1 : Extremity from BRepBlend;
endp2 : TheExtremity; endp2 : Extremity from BRepBlend;
hass1 : Boolean from Standard; hass1 : Boolean from Standard;
hass2 : Boolean from Standard; hass2 : Boolean from Standard;
end; end;

View File

@@ -12,13 +12,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
Blend_Line::Blend_Line (): #include <BRepBlend_Line.ixx>
BRepBlend_Line::BRepBlend_Line ():
tras1(IntSurf_Undecided),tras2(IntSurf_Undecided), tras1(IntSurf_Undecided),tras2(IntSurf_Undecided),
hass1(Standard_False),hass2(Standard_False) hass1(Standard_False),hass2(Standard_False)
{} {}
void Blend_Line::Clear () void BRepBlend_Line::Clear ()
{ {
seqpt.Clear(); seqpt.Clear();
hass1 = Standard_False; hass1 = Standard_False;
@@ -27,7 +29,7 @@ void Blend_Line::Clear ()
tras2 = IntSurf_Undecided; tras2 = IntSurf_Undecided;
} }
void Blend_Line::Set(const IntSurf_TypeTrans TranS1, void BRepBlend_Line::Set(const IntSurf_TypeTrans TranS1,
const IntSurf_TypeTrans TranS2) const IntSurf_TypeTrans TranS2)
{ {
hass1 = Standard_True; hass1 = Standard_True;
@@ -36,7 +38,7 @@ void Blend_Line::Set(const IntSurf_TypeTrans TranS1,
tras2 = TranS2; tras2 = TranS2;
} }
void Blend_Line::Set(const IntSurf_TypeTrans Trans) void BRepBlend_Line::Set(const IntSurf_TypeTrans Trans)
{ {
hass1 = Standard_True; hass1 = Standard_True;
hass2 = Standard_False; hass2 = Standard_False;

View File

@@ -16,87 +16,87 @@
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
inline void Blend_Line::Append(const Blend_Point& P) inline void BRepBlend_Line::Append(const Blend_Point& P)
{ {
seqpt.Append(P); seqpt.Append(P);
} }
inline void Blend_Line::Prepend(const Blend_Point& P) inline void BRepBlend_Line::Prepend(const Blend_Point& P)
{ {
seqpt.Prepend(P); seqpt.Prepend(P);
} }
inline void Blend_Line::InsertBefore(const Standard_Integer Index, inline void BRepBlend_Line::InsertBefore(const Standard_Integer Index,
const Blend_Point& P) const Blend_Point& P)
{ {
seqpt.InsertBefore(Index, P); seqpt.InsertBefore(Index, P);
} }
inline void Blend_Line::Remove(const Standard_Integer FromIndex, inline void BRepBlend_Line::Remove(const Standard_Integer FromIndex,
const Standard_Integer ToIndex) const Standard_Integer ToIndex)
{ {
seqpt.Remove(FromIndex,ToIndex); seqpt.Remove(FromIndex,ToIndex);
} }
inline void Blend_Line::SetStartPoints(const TheExtremity& StartPtOnS1, inline void BRepBlend_Line::SetStartPoints(const BRepBlend_Extremity& StartPtOnS1,
const TheExtremity& StartPtOnS2) const BRepBlend_Extremity& StartPtOnS2)
{ {
stp1 = StartPtOnS1; stp1 = StartPtOnS1;
stp2 = StartPtOnS2; stp2 = StartPtOnS2;
} }
inline void Blend_Line::SetEndPoints(const TheExtremity& EndPtOnS1, inline void BRepBlend_Line::SetEndPoints(const BRepBlend_Extremity& EndPtOnS1,
const TheExtremity& EndPtOnS2) const BRepBlend_Extremity& EndPtOnS2)
{ {
endp1 = EndPtOnS1; endp1 = EndPtOnS1;
endp2 = EndPtOnS2; endp2 = EndPtOnS2;
} }
inline Standard_Integer Blend_Line::NbPoints () const inline Standard_Integer BRepBlend_Line::NbPoints () const
{ {
return seqpt.Length(); return seqpt.Length();
} }
inline const Blend_Point& Blend_Line::Point(const Standard_Integer Index) const inline const Blend_Point& BRepBlend_Line::Point(const Standard_Integer Index) const
{ {
return seqpt(Index); return seqpt(Index);
} }
inline IntSurf_TypeTrans Blend_Line::TransitionOnS1 () const inline IntSurf_TypeTrans BRepBlend_Line::TransitionOnS1 () const
{ {
if (!hass1) {Standard_DomainError::Raise();} if (!hass1) {Standard_DomainError::Raise();}
return tras1; return tras1;
} }
inline IntSurf_TypeTrans Blend_Line::TransitionOnS2 () const inline IntSurf_TypeTrans BRepBlend_Line::TransitionOnS2 () const
{ {
if (!hass2) {Standard_DomainError::Raise();} if (!hass2) {Standard_DomainError::Raise();}
return tras2; return tras2;
} }
inline const TheExtremity& Blend_Line::StartPointOnFirst() const inline const BRepBlend_Extremity& BRepBlend_Line::StartPointOnFirst() const
{ {
return stp1; return stp1;
} }
inline const TheExtremity& Blend_Line::StartPointOnSecond() const inline const BRepBlend_Extremity& BRepBlend_Line::StartPointOnSecond() const
{ {
return stp2; return stp2;
} }
inline const TheExtremity& Blend_Line::EndPointOnFirst() const inline const BRepBlend_Extremity& BRepBlend_Line::EndPointOnFirst() const
{ {
return endp1; return endp1;
} }
inline const TheExtremity& Blend_Line::EndPointOnSecond() const inline const BRepBlend_Extremity& BRepBlend_Line::EndPointOnSecond() const
{ {
return endp2; return endp2;
} }
inline IntSurf_TypeTrans Blend_Line::TransitionOnS () const inline IntSurf_TypeTrans BRepBlend_Line::TransitionOnS () const
{ {
if (!hass1) {Standard_DomainError::Raise();} if (!hass1) {Standard_DomainError::Raise();}
return tras1; return tras1;

View File

@@ -14,8 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class PointOnRst from Blend class PointOnRst from BRepBlend
(TheArc as any)
---Purpose: Definition of an intersection point between a line ---Purpose: Definition of an intersection point between a line
@@ -24,7 +23,8 @@ generic class PointOnRst from Blend
-- the Value method) and logical informations. -- the Value method) and logical informations.
uses Transition from IntSurf uses Transition from IntSurf,
HCurve2d from Adaptor2d
raises DomainError from Standard raises DomainError from Standard
@@ -35,21 +35,21 @@ is
---Purpose: Empty constructor. ---Purpose: Empty constructor.
returns PointOnRst from Blend; returns PointOnRst from BRepBlend;
Create( A: TheArc; Param: Real from Standard; Create( A: HCurve2d from Adaptor2d; Param: Real from Standard;
TLine, TArc: Transition from IntSurf) TLine, TArc: Transition from IntSurf)
---Purpose: Creates the PointOnRst on the arc A, at parameter Param, ---Purpose: Creates the PointOnRst on the arc A, at parameter Param,
-- with the transition TLine on the walking line, and -- with the transition TLine on the walking line, and
-- TArc on the arc A. -- TArc on the arc A.
returns PointOnRst from Blend; returns PointOnRst from BRepBlend;
SetArc(me: in out; A: TheArc; Param: Real from Standard; SetArc(me: in out; A: HCurve2d from Adaptor2d; Param: Real from Standard;
TLine, TArc: Transition from IntSurf) TLine, TArc: Transition from IntSurf)
---Purpose: Sets the values of a point which is on the arc ---Purpose: Sets the values of a point which is on the arc
@@ -65,7 +65,7 @@ is
---Purpose: Returns the arc of restriction containing the ---Purpose: Returns the arc of restriction containing the
-- vertex. -- vertex.
returns any TheArc returns any HCurve2d from Adaptor2d
---C++: return const& ---C++: return const&
---C++: inline ---C++: inline
@@ -109,7 +109,7 @@ is
fields fields
arc : TheArc; arc : HCurve2d from Adaptor2d;
traline : Transition from IntSurf; traline : Transition from IntSurf;
traarc : Transition from IntSurf; traarc : Transition from IntSurf;
prm : Real from Standard; prm : Real from Standard;

View File

@@ -12,10 +12,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
Blend_PointOnRst::Blend_PointOnRst () {} #include <BRepBlend_PointOnRst.ixx>
BRepBlend_PointOnRst::BRepBlend_PointOnRst () {}
Blend_PointOnRst::Blend_PointOnRst(const TheArc& A, BRepBlend_PointOnRst::BRepBlend_PointOnRst(const Handle(Adaptor2d_HCurve2d)& A,
const Standard_Real Param, const Standard_Real Param,
const IntSurf_Transition& TLine, const IntSurf_Transition& TLine,
const IntSurf_Transition& TArc): const IntSurf_Transition& TArc):
@@ -23,7 +25,7 @@ Blend_PointOnRst::Blend_PointOnRst(const TheArc& A,
arc(A),traline(TLine),traarc(TArc),prm(Param) arc(A),traline(TLine),traarc(TArc),prm(Param)
{} {}
void Blend_PointOnRst::SetArc(const TheArc& A, void BRepBlend_PointOnRst::SetArc(const Handle(Adaptor2d_HCurve2d)& A,
const Standard_Real Param, const Standard_Real Param,
const IntSurf_Transition& TLine, const IntSurf_Transition& TLine,
const IntSurf_Transition& TArc) const IntSurf_Transition& TArc)

View File

@@ -14,22 +14,22 @@
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
inline const TheArc& Blend_PointOnRst::Arc () const inline const Handle_Adaptor2d_HCurve2d& BRepBlend_PointOnRst::Arc () const
{ {
return arc; return arc;
} }
inline const IntSurf_Transition& Blend_PointOnRst::TransitionOnLine () const inline const IntSurf_Transition& BRepBlend_PointOnRst::TransitionOnLine () const
{ {
return traline; return traline;
} }
inline const IntSurf_Transition& Blend_PointOnRst::TransitionOnArc () const inline const IntSurf_Transition& BRepBlend_PointOnRst::TransitionOnArc () const
{ {
return traarc; return traarc;
} }
inline Standard_Real Blend_PointOnRst::ParameterOnArc () const inline Standard_Real BRepBlend_PointOnRst::ParameterOnArc () const
{ {
return prm; return prm;
} }

View File

@@ -69,6 +69,7 @@ is
FreeEdge, FreeEdge,
InvalidMultiConnexity, InvalidMultiConnexity,
InvalidRange, InvalidRange,
PCurveIsOutOfDomainFace,
-- for wires -- for wires
@@ -78,6 +79,7 @@ is
-- for faces -- for faces
NoSurface, NoSurface,
OutOfSurfaceBoundary,
InvalidWire, InvalidWire,
RedundantWire, RedundantWire,
IntersectingWires, IntersectingWires,

View File

@@ -175,7 +175,15 @@ void BRepCheck::Print(const BRepCheck_Status stat,
case BRepCheck_CheckFail: case BRepCheck_CheckFail:
OS << "BRepCheck_CheckFail\n"; OS << "BRepCheck_CheckFail\n";
break; break;
case BRepCheck_PCurveIsOutOfDomainFace:
OS << "BRepCheck_PCurveIsOutOfDomainFace\n";
break;
case BRepCheck_OutOfSurfaceBoundary:
OS << "BRepCheck_OutOfSurfaceBoundary\n";
break;
default: default:
OS << "BRepCheck::Print(...): Undefined status!\n";
break; break;
} }
} }

View File

@@ -103,15 +103,17 @@ void BRepCheck_Analyzer::Put(const TopoDS_Shape& S,
void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S) void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
{ {
for(TopoDS_Iterator theIterator(S);theIterator.More();theIterator.Next()) { for(TopoDS_Iterator theIterator(S);theIterator.More();theIterator.Next())
Perform(theIterator.Value()); Perform(theIterator.Value());
}
// //
TopAbs_ShapeEnum styp; TopAbs_ShapeEnum styp;
TopExp_Explorer exp; TopExp_Explorer exp;
// //
styp = S.ShapeType(); styp = S.ShapeType();
switch (styp) {
switch (styp)
{
case TopAbs_VERTEX: case TopAbs_VERTEX:
// modified by NIZHNY-MKK Wed May 19 16:56:16 2004.BEGIN // modified by NIZHNY-MKK Wed May 19 16:56:16 2004.BEGIN
// There is no need to check anything. // There is no need to check anything.
@@ -121,39 +123,44 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
// modified by NIZHNY-MKK Wed May 19 16:56:23 2004.END // modified by NIZHNY-MKK Wed May 19 16:56:23 2004.END
break; break;
case TopAbs_EDGE: { case TopAbs_EDGE:
{
// Modified by skv - Tue Apr 27 11:38:08 2004 Begin // Modified by skv - Tue Apr 27 11:38:08 2004 Begin
// There is no need to check anything except vertices on single edge. // There is no need to check anything except vertices on single edge.
// if (myShape.IsSame(S)) { // if (myShape.IsSame(S)) {
// myMap(S)->Blind(); // myMap(S)->Blind();
// } // }
// Modified by skv - Tue Apr 27 11:38:09 2004 End // Modified by skv - Tue Apr 27 11:38:09 2004 End
TopTools_MapOfShape MapS;
for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next()) { TopTools_MapOfShape MapS;
const TopoDS_Shape& aVertex = exp.Current(); for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
try { {
OCC_CATCH_SIGNALS const TopoDS_Shape& aVertex = exp.Current();
if (MapS.Add(aVertex)) { try
myMap(aVertex)->InContext(S); {
} OCC_CATCH_SIGNALS
} if (MapS.Add(aVertex))
catch(Standard_Failure) { myMap(aVertex)->InContext(S);
}
catch(Standard_Failure)
{
#ifdef DEB #ifdef DEB
cout<<"BRepCheck_Analyzer : "; cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout); Standard_Failure::Caught()->Print(cout);
cout<<endl; cout<<endl;
#endif #endif
if ( ! myMap(S).IsNull() ) { if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S); myMap(S)->SetFailStatus(S);
}
Handle(BRepCheck_Result) aRes = myMap(aVertex); Handle(BRepCheck_Result) aRes = myMap(aVertex);
if ( ! aRes.IsNull() ) {
aRes->SetFailStatus(aVertex); if ( ! aRes.IsNull() )
aRes->SetFailStatus(S); {
} aRes->SetFailStatus(aVertex);
} aRes->SetFailStatus(S);
} }
}//catch(Standard_Failure)
}//for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
} }
break; break;
case TopAbs_WIRE: case TopAbs_WIRE:
@@ -171,257 +178,234 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
case TopAbs_FACE: case TopAbs_FACE:
{ {
TopTools_MapOfShape MapS; TopTools_MapOfShape MapS;
for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next()) { for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
try { {
OCC_CATCH_SIGNALS try
if (MapS.Add(exp.Current())) { {
myMap(exp.Current())->InContext(S); OCC_CATCH_SIGNALS
} if (MapS.Add(exp.Current()))
} myMap(exp.Current())->InContext(S);
catch(Standard_Failure) { }
catch(Standard_Failure)
{
#ifdef DEB #ifdef DEB
cout<<"BRepCheck_Analyzer : "; cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout); Standard_Failure::Caught()->Print(cout);
cout<<endl; cout<<endl;
#endif #endif
if ( ! myMap(S).IsNull() ) { if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S); myMap(S)->SetFailStatus(S);
}
Handle(BRepCheck_Result) aRes = myMap(exp.Current()); Handle(BRepCheck_Result) aRes = myMap(exp.Current());
if ( ! aRes.IsNull() )
{
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}//catch(Standard_Failure)
}//for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
if ( ! aRes.IsNull() ) {
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}
}
Standard_Boolean performwire = Standard_True; Standard_Boolean performwire = Standard_True;
Standard_Boolean isFaceOutBoundary = Standard_False;
MapS.Clear(); MapS.Clear();
for (exp.Init(S,TopAbs_EDGE);exp.More(); exp.Next()) { for (exp.Init(S,TopAbs_EDGE);exp.More(); exp.Next())
try { {
OCC_CATCH_SIGNALS try
if (MapS.Add(exp.Current())) { {
Handle(BRepCheck_Result)& res = myMap(exp.Current()); OCC_CATCH_SIGNALS
res->InContext(S); if (MapS.Add(exp.Current()))
if (performwire) { {
for (res->InitContextIterator(); Handle(BRepCheck_Result)& res = myMap(exp.Current());
res->MoreShapeInContext(); res->InContext(S);
res->NextShapeInContext()) { if (performwire)
if(res->ContextualShape().IsSame(S)) { {
break; for (res->InitContextIterator();
} res->MoreShapeInContext();
} res->NextShapeInContext())
BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape()); {
for (; itl.More(); itl.Next()) { if(res->ContextualShape().IsSame(S))
BRepCheck_Status ste = itl.Value(); break;
if (ste == BRepCheck_NoCurveOnSurface || }
ste == BRepCheck_InvalidCurveOnSurface ||
ste == BRepCheck_InvalidRange || BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape());
ste == BRepCheck_InvalidCurveOnClosedSurface) { for (; itl.More(); itl.Next())
performwire = Standard_False; {
break; BRepCheck_Status ste = itl.Value();
} if (ste == BRepCheck_NoCurveOnSurface ||
} ste == BRepCheck_InvalidCurveOnSurface ||
} ste == BRepCheck_InvalidRange ||
} ste == BRepCheck_InvalidCurveOnClosedSurface)
} {
catch(Standard_Failure) { performwire = Standard_False;
break;
}
if(ste == BRepCheck_PCurveIsOutOfDomainFace)
{
isFaceOutBoundary = Standard_True;
break;
}
}//for (; itl.More(); itl.Next())
}//if (performwire)
}//if (MapS.Add(exp.Current()))
}
catch(Standard_Failure)
{
#ifdef DEB #ifdef DEB
cout<<"BRepCheck_Analyzer : "; cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout); Standard_Failure::Caught()->Print(cout);
cout<<endl; cout<<endl;
#endif #endif
if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S);
if ( ! myMap(S).IsNull() ) { Handle(BRepCheck_Result) aRes = myMap(exp.Current());
myMap(S)->SetFailStatus(S);
} if ( ! aRes.IsNull() )
Handle(BRepCheck_Result) aRes = myMap(exp.Current()); {
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}//catch(Standard_Failure)
}//for (exp.Init(S,TopAbs_EDGE);exp.More(); exp.Next())
if ( ! aRes.IsNull() ) {
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}
}
Standard_Boolean orientofwires = performwire; Standard_Boolean orientofwires = performwire;
for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next()) { for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
try { {
OCC_CATCH_SIGNALS try
Handle(BRepCheck_Result)& res = myMap(exp.Current()); {
res->InContext(S); OCC_CATCH_SIGNALS
if (orientofwires) { Handle(BRepCheck_Result)& res = myMap(exp.Current());
for (res->InitContextIterator(); res->InContext(S);
res->MoreShapeInContext(); if (orientofwires)
res->NextShapeInContext()) { {
if(res->ContextualShape().IsSame(S)) { for (res->InitContextIterator();
break; res->MoreShapeInContext();
} res->NextShapeInContext())
} {
BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape()); if(res->ContextualShape().IsSame(S))
for (; itl.More(); itl.Next()) { break;
BRepCheck_Status ste = itl.Value(); }
if (ste != BRepCheck_NoError) {
orientofwires = Standard_False; BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape());
break; for (; itl.More(); itl.Next())
} {
} BRepCheck_Status ste = itl.Value();
} if (ste != BRepCheck_NoError)
} {
catch(Standard_Failure) { orientofwires = Standard_False;
break;
}
}
}//if (orientofwires)
}
catch(Standard_Failure)
{
#ifdef DEB #ifdef DEB
cout<<"BRepCheck_Analyzer : "; cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout); Standard_Failure::Caught()->Print(cout);
cout<<endl; cout<<endl;
#endif #endif
if ( ! myMap(S).IsNull() ) { if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S); myMap(S)->SetFailStatus(S);
}
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
if ( ! aRes.IsNull() ) { Handle(BRepCheck_Result) aRes = myMap(exp.Current());
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}
}
try { if ( ! aRes.IsNull() )
{
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}
}//for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
try
{
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (performwire) { if (performwire)
if (orientofwires) { {
Handle(BRepCheck_Face)::DownCast(myMap(S))-> if (isFaceOutBoundary)
OrientationOfWires(Standard_True);// on enregistre Handle(BRepCheck_Face)::DownCast(myMap(S))->
} SetStatus(BRepCheck_OutOfSurfaceBoundary);
// else { else if (orientofwires)
// Handle(BRepCheck_Face)::DownCast(myMap(S))-> Handle(BRepCheck_Face)::DownCast(myMap(S))->
// IntersectWires(Standard_True); // on enregistre OrientationOfWires(Standard_True);// on enregistre
// } else
else { Handle(BRepCheck_Face)::DownCast(myMap(S))->
Handle(BRepCheck_Face)::DownCast(myMap(S))->SetUnorientable(); SetUnorientable();
} }//if (performwire)
} else
else { Handle(BRepCheck_Face)::DownCast(myMap(S))->
Handle(BRepCheck_Face)::DownCast(myMap(S))->SetUnorientable(); SetUnorientable();
}
} }
catch(Standard_Failure) { catch(Standard_Failure)
{
#ifdef DEB #ifdef DEB
cout<<"BRepCheck_Analyzer : "; cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout); Standard_Failure::Caught()->Print(cout);
cout<<endl; cout<<endl;
#endif #endif
if ( ! myMap(S).IsNull() ) { if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S); {
} myMap(S)->SetFailStatus(S);
}
for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next()) { for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
Handle(BRepCheck_Result) aRes = myMap(exp.Current()); {
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
if ( ! aRes.IsNull() ) { if ( ! aRes.IsNull() )
aRes->SetFailStatus(exp.Current()); {
aRes->SetFailStatus(S); aRes->SetFailStatus(exp.Current());
myMap(S)->SetFailStatus(exp.Current()); aRes->SetFailStatus(S);
} myMap(S)->SetFailStatus(exp.Current());
} }
} }//for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
}//catch(Standard_Failure)
} }
break; break;
case TopAbs_SHELL: case TopAbs_SHELL:
//modified by NIZNHY-PKV Mon Oct 13 14:23:53 2008f //modified by NIZNHY-PKV Mon Oct 13 14:23:53 2008f
/* {
Standard_Boolean VerifyOrientation, bFlag;
//
VerifyOrientation = Standard_True;
//
exp.Init(S,TopAbs_FACE);
for (; exp.More(); exp.Next()) {
const TopoDS_Shape& aF=exp.Current();
try {
OCC_CATCH_SIGNALS
bFlag= !(Handle(BRepCheck_Face)::DownCast(myMap(aF))->IsUnorientable());
VerifyOrientation = (VerifyOrientation && bFlag);
}
catch(Standard_Failure) {
#ifdef DEB
cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout);
cout<<endl;
#endif
if ( ! myMap(S).IsNull() ) {
myMap(S)->SetFailStatus(S);
}
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
if ( ! aRes.IsNull() ) {
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}
} //
try {
OCC_CATCH_SIGNALS
if (VerifyOrientation) {
Handle(BRepCheck_Shell)::DownCast(myMap(S))->Orientation(Standard_True);
}
else {
Handle(BRepCheck_Shell)::DownCast(myMap(S))->SetUnorientable();
}
}
catch(Standard_Failure) {
#ifdef DEB
cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout);
cout<<endl;
#endif
if ( ! myMap(S).IsNull() ) {
myMap(S)->SetFailStatus(S);
}
exp.Init(S,TopAbs_FACE);
for (; exp.More(); exp.Next()) {
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
if ( ! aRes.IsNull() ) {
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
myMap(S)->SetFailStatus(exp.Current());
}
}
}
}
*/
//modified by NIZNHY-PKV Mon Oct 13 14:24:04 2008t //modified by NIZNHY-PKV Mon Oct 13 14:24:04 2008t
break; break;
//
case TopAbs_SOLID: { case TopAbs_SOLID:
exp.Init(S,TopAbs_SHELL); {
for (; exp.More(); exp.Next()) { exp.Init(S,TopAbs_SHELL);
const TopoDS_Shape& aShell=exp.Current(); for (; exp.More(); exp.Next())
try { {
OCC_CATCH_SIGNALS const TopoDS_Shape& aShell=exp.Current();
myMap(aShell)->InContext(S); try
} {
catch(Standard_Failure) { OCC_CATCH_SIGNALS
myMap(aShell)->InContext(S);
}
catch(Standard_Failure)
{
#ifdef DEB #ifdef DEB
cout<<"BRepCheck_Analyzer : "; cout<<"BRepCheck_Analyzer : ";
Standard_Failure::Caught()->Print(cout); Standard_Failure::Caught()->Print(cout);
cout<<endl; cout<<endl;
#endif #endif
if ( ! myMap(S).IsNull() ) { if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S); {
} myMap(S)->SetFailStatus(S);
// }
Handle(BRepCheck_Result) aRes = myMap(aShell);
if (!aRes.IsNull() ) { //
aRes->SetFailStatus(exp.Current()); Handle(BRepCheck_Result) aRes = myMap(aShell);
aRes->SetFailStatus(S); if (!aRes.IsNull() )
} {
} aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}//catch(Standard_Failure)
}//for (; exp.More(); exp.Next())
} }
} break;//case TopAbs_SOLID
break;//case TopAbs_SOLID
default: default:
break; break;
}//switch (styp) { }//switch (styp) {

View File

@@ -58,12 +58,14 @@
#include <Precision.hxx> #include <Precision.hxx>
//modified by NIZNHY-PKV Thu May 05 09:01:57 2011f
static static
Standard_Boolean Validate(const Adaptor3d_Curve&, BRepCheck_Status Validate(const Adaptor3d_Curve&,
const Adaptor3d_CurveOnSurface&, const Adaptor3d_CurveOnSurface&,
const Standard_Real, const Standard_Real,
const Standard_Boolean); const Standard_Boolean,
const Standard_Boolean theSurfIsUPeriodic,
const Standard_Boolean theSurfIsVPeriodic);
static static
void PrintProblematicPoint(const gp_Pnt&, void PrintProblematicPoint(const gp_Pnt&,
const Standard_Real, const Standard_Real,
@@ -77,13 +79,9 @@ static
static static
Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS); Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS);
//static Standard_Boolean Validate(const Adaptor3d_Curve&,
// const Adaptor3d_Curve&,
// const Standard_Real,
// const Standard_Boolean);
//modified by NIZNHY-PKV Thu May 05 09:02:01 2011t //modified by NIZNHY-PKV Thu May 05 09:02:01 2011t
#define NCONTROL 23 static const Standard_Integer aNbControl = 23;
//======================================================================= //=======================================================================
//function : BRepCheck_Edge //function : BRepCheck_Edge
@@ -213,9 +211,9 @@ void BRepCheck_Edge::Minimum()
void BRepCheck_Edge::InContext(const TopoDS_Shape& S) void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
{ {
if (myMap.IsBound(S)) { if (myMap.IsBound(S))
return; return;
}
BRepCheck_ListOfStatus thelist; BRepCheck_ListOfStatus thelist;
myMap.Bind(S, thelist); myMap.Bind(S, thelist);
BRepCheck_ListOfStatus& lst = myMap(S); BRepCheck_ListOfStatus& lst = myMap(S);
@@ -224,191 +222,238 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape)); Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape));
TopAbs_ShapeEnum styp = S.ShapeType(); TopAbs_ShapeEnum styp = S.ShapeType();
// for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) {
TopExp_Explorer exp(S,TopAbs_EDGE) ; TopExp_Explorer exp(S,TopAbs_EDGE) ;
for ( ; exp.More(); exp.Next()) { for ( ; exp.More(); exp.Next())
if (exp.Current().IsSame(myShape)) { {
if (exp.Current().IsSame(myShape))
break; break;
}
} }
if (!exp.More()) {
if (!exp.More())
{
BRepCheck::Add(lst,BRepCheck_SubshapeNotInShape); BRepCheck::Add(lst,BRepCheck_SubshapeNotInShape);
return; return;
} }
switch (styp) { switch (styp)
case TopAbs_FACE: {
if (!myCref.IsNull()) { case TopAbs_FACE:
if (myCref.IsNull())
break;
Standard_Boolean SameParameter = TE->SameParameter(); {
Standard_Boolean SameRange = TE->SameRange(); Standard_Boolean SameParameter = TE->SameParameter();
// Modified by skv - Tue Apr 27 11:48:13 2004 Begin Standard_Boolean SameRange = TE->SameRange();
if (!SameParameter || !SameRange) {
if (!SameParameter)
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
if (!SameRange)
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
return; if (!SameParameter || !SameRange)
{
if (!SameParameter)
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
if (!SameRange)
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
return;
}//if (!SameParameter || !SameRange)
const Standard_Real First = myHCurve->FirstParameter();
const Standard_Real Last = myHCurve->LastParameter();
Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &S.TShape());
const TopLoc_Location& Floc = S.Location();
const TopLoc_Location& TFloc = TF->Location();
const Handle(Geom_Surface)& Su = TF->Surface();
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
Standard_Boolean pcurvefound = Standard_False;
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
while (itcr.More())
{
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L))
{
pcurvefound = Standard_True;
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
Standard_Real f,l;
GC->Range(f,l);
if (fabs(f-First) > Precision::PConfusion() ||
fabs(l-Last) > Precision::PConfusion())
{
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
if (myGctrl)
{
Handle(Geom_Surface) Sb = cr->Surface();
{
Standard_Real U1Su, U2Su, V1Su, V2Su;
Standard_Real U1Sb, U2Sb, V1Sb, V2Sb;
Standard_Boolean isTrimU = Standard_False, isTrimV = Standard_False;
if(Su->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
{
Handle(Geom_RectangularTrimmedSurface) TS =
Handle(Geom_RectangularTrimmedSurface)::DownCast(Su);
TS->GetTrimmedFlags(isTrimU, isTrimV);
}
Su->Bounds(U1Su, U2Su, V1Su, V2Su);
Sb = Handle(Geom_Surface)::DownCast
(Su->Transformed((Floc * TFloc).Transformation()));
Sb->Bounds(U1Sb, U2Sb, V1Sb, V2Sb);
Standard_Boolean isUtr = ((Abs(U1Su - U1Sb) + Abs(U2Su - U2Sb)) > Precision::PConfusion()),
isVtr = ((Abs(V1Su - V1Sb) + Abs(V2Su - V2Sb)) > Precision::PConfusion());
if(isUtr || isVtr)
{
Handle(Geom_Surface) St = Handle(Geom_RectangularTrimmedSurface)::DownCast(Sb)->BasisSurface();
Sb = new Geom_RectangularTrimmedSurface(St, isTrimU || isUtr, isVtr || isTrimV, U1Su, U2Su, V1Su, V2Su);
}
}
Handle(Geom2d_Curve) PC = cr->PCurve();
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
BRepCheck_Status aStatus = Validate(myHCurve->Curve(),ACS,Tol,SameParameter,
Sb->IsUPeriodic(),Sb->IsVPeriodic());
if(aStatus == BRepCheck_PCurveIsOutOfDomainFace)
BRepCheck::Add(lst,BRepCheck_PCurveIsOutOfDomainFace);
else if(aStatus == BRepCheck_InvalidCurveOnSurface)
{
if (cr->IsCurveOnClosedSurface())
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
else
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
else if(aStatus != BRepCheck_NoError)
BRepCheck::Add(lst,aStatus);
if (cr->IsCurveOnClosedSurface())
{
GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
ACS.Load(GAHS); // sans doute inutile
ACS.Load(GHPC); // meme remarque...
aStatus = Validate(myHCurve->Curve(),ACS,Tol,SameParameter,
Sb->IsUPeriodic(),Sb->IsVPeriodic());
if(aStatus == BRepCheck_PCurveIsOutOfDomainFace)
BRepCheck::Add(lst,BRepCheck_PCurveIsOutOfDomainFace);
else if(aStatus == BRepCheck_InvalidCurveOnSurface)
{
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
if (SameParameter)
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
else if(aStatus != BRepCheck_NoError)
BRepCheck::Add(lst,aStatus);
}//if (cr->IsCurveOnClosedSurface())
}//if (myGctrl)
}//if (cr != myCref && cr->IsCurveOnSurface(Su,L))
itcr.Next();
}//while (itcr.More())
if (!pcurvefound)
{
Handle(Geom_Plane) P;
Handle(Standard_Type) dtyp = Su->DynamicType();
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
{
P = Handle(Geom_Plane)::DownCast
(Handle(Geom_RectangularTrimmedSurface)::
DownCast(Su)->BasisSurface());
}
else
P = Handle(Geom_Plane)::DownCast(Su);
if (P.IsNull()) // not a plane
BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
else
{
// on fait la projection a la volee, comme BRep_Tool plan en position
if (myGctrl)
{
P = Handle(Geom_Plane)::DownCast(
P->Transformed((Floc * TFloc).Transformation()));// eap occ332
//on projette Cref sur ce plan
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
// Dub - Normalement myHCurve est une GeomAdaptor_HCurve
GeomAdaptor_Curve& Gac =
Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
Handle(Geom_Curve) C3d = Gac.Curve();
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
P, P->Position().Direction(),Standard_True);
Handle(GeomAdaptor_HCurve) aHCurve =
new GeomAdaptor_HCurve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,
myHCurve->FirstParameter(),
myHCurve->LastParameter());
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
BRepCheck_Status aStatus = Validate(myHCurve->Curve(),ACS,Tol,
Standard_True, P->IsUPeriodic(),P->IsVPeriodic()); // voir dub...
if (aStatus != BRepCheck_NoError)
BRepCheck::Add(lst,aStatus);
}//if (myGctrl)
}//else of "if (P.IsNull())" condition
}//if (!pcurvefound)
break;
} }
// Modified by skv - Tue Apr 27 11:48:14 2004 End case TopAbs_SOLID:
Standard_Real First = myHCurve->FirstParameter(); {
Standard_Real Last = myHCurve->LastParameter(); // on verifie que l`edge est bien connectee 2 fois (pas de bord libre)
Standard_Integer nbconnection = 0;
Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &S.TShape()); //TopExp_Explorer exp;
const TopLoc_Location& Floc = S.Location(); for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next())
const TopLoc_Location& TFloc = TF->Location(); {
const Handle(Geom_Surface)& Su = TF->Surface(); const TopoDS_Face& fac = TopoDS::Face(exp.Current());
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location()); TopExp_Explorer exp2;
Standard_Boolean pcurvefound = Standard_False;
for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next())
{
if (exp2.Current().IsSame(myShape))
nbconnection++;
}//for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next())
}//for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next())
if (nbconnection < 2 && !TE->Degenerated())
BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
else if (nbconnection > 2)
{
BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
}
else
BRepCheck::Add(myMap(S),BRepCheck_NoError);
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
pcurvefound = Standard_True;
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
Standard_Real f,l;
GC->Range(f,l);
// gka OCC
// Modified by skv - Tue Apr 27 11:50:35 2004 Begin
// if (SameRange && (fabs(f-First) > Precision::PConfusion() || fabs(l-Last)> Precision::PConfusion())) { //f != First || l != Last)) { gka OCC
if (fabs(f-First) > Precision::PConfusion() ||
fabs(l-Last) > Precision::PConfusion()) {
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// if (SameParameter) {
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// }
}
// Modified by skv - Tue Apr 27 11:50:37 2004 End
if (myGctrl) {
Handle(Geom_Surface) Sb = cr->Surface();
Sb = Handle(Geom_Surface)::DownCast
// (Su->Transformed(L.Transformation()));
(Su->Transformed(/*L*/(Floc * TFloc).Transformation()));
Handle(Geom2d_Curve) PC = cr->PCurve();
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
Standard_Boolean ok =
Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
if (!ok) {
if (cr->IsCurveOnClosedSurface()) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
}
else {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
}
// Modified by skv - Tue Apr 27 11:53:00 2004 Begin
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// if (SameParameter) {
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// }
// Modified by skv - Tue Apr 27 11:53:01 2004 End
}
if (cr->IsCurveOnClosedSurface()) {
GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
ACS.Load(GAHS); // sans doute inutile
ACS.Load(GHPC); // meme remarque...
ok = Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
if (!ok) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
// Modified by skv - Tue Apr 27 11:53:20 2004 Begin
if (SameParameter) {
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
// Modified by skv - Tue Apr 27 11:53:23 2004 End
}
}
}
}
itcr.Next();
} }
break;
if (!pcurvefound) { default:
Handle(Geom_Plane) P; break;
Handle(Standard_Type) dtyp = Su->DynamicType(); }//switch (styp)
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
P = Handle(Geom_Plane)::DownCast
(Handle(Geom_RectangularTrimmedSurface)::
DownCast(Su)->BasisSurface());
}
else {
P = Handle(Geom_Plane)::DownCast(Su);
}
if (P.IsNull()) { // not a plane
BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
}
else { // on fait la projection a la volee, comme BRep_Tool
// plan en position
if (myGctrl) {
P = Handle(Geom_Plane)::
DownCast(P->Transformed(/*L*/(Floc * TFloc).Transformation()));// eap occ332
//on projette Cref sur ce plan
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
// Dub - Normalement myHCurve est une GeomAdaptor_HCurve if (myMap(S).IsEmpty())
GeomAdaptor_Curve& Gac =
Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
Handle(Geom_Curve) C3d = Gac.Curve();
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
P, P->Position().Direction(),
Standard_True);
Handle(GeomAdaptor_HCurve) aHCurve =
new GeomAdaptor_HCurve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_HCurve) GHPC =
new Geom2dAdaptor_HCurve(PC,
myHCurve->FirstParameter(),
myHCurve->LastParameter());
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
Standard_Boolean ok = Validate(myHCurve->Curve(),ACS,
Tol,Standard_True); // voir dub...
if (!ok) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
}
}
}
}
}
break;
case TopAbs_SOLID:
{
// on verifie que l`edge est bien connectee 2 fois (pas de bord libre)
Standard_Integer nbconnection = 0;
//TopExp_Explorer exp;
for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next()) {
const TopoDS_Face& fac = TopoDS::Face(exp.Current());
TopExp_Explorer exp2;
for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next()) {
if (exp2.Current().IsSame(myShape)) {
nbconnection++;
}
}
}
if (nbconnection < 2 && !TE->Degenerated()) {
BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
}
else if (nbconnection > 2) {
BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
}
else {
BRepCheck::Add(myMap(S),BRepCheck_NoError);
}
}
break;
default:
break;
}
if (myMap(S).IsEmpty()) {
myMap(S).Append(BRepCheck_NoError); myMap(S).Append(BRepCheck_NoError);
}
} }
@@ -530,8 +575,8 @@ Standard_Real BRepCheck_Edge::Tolerance()
Standard_Real dist2, tol2, tolCal=0., prm; Standard_Real dist2, tol2, tolCal=0., prm;
gp_Pnt center, othP; gp_Pnt center, othP;
Standard_Integer i; Standard_Integer i;
for (i= 0; i< NCONTROL; i++) { for (i= 0; i< aNbControl; i++) {
prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1); prm = ((aNbControl-1-i)*First + i*Last)/(aNbControl-1);
tol2=dist2=0.; tol2=dist2=0.;
center=(*(Handle(Adaptor3d_HCurve)*)&theRep(1))->Value(prm); center=(*(Handle(Adaptor3d_HCurve)*)&theRep(1))->Value(prm);
for (iRep=2; iRep<=nbRep; iRep++) { for (iRep=2; iRep<=nbRep; iRep++) {
@@ -550,73 +595,382 @@ Standard_Real BRepCheck_Edge::Tolerance()
//======================================================================= //=======================================================================
//function : Validate //function : Validate
//purpose : //purpose :
//Remark : If the original surface is not periodic in U or V direction
// (for example, rectangular trimmed on periodic surface),
// the surface that <Adaptor3d_CurveOnSurface> contains
// can be periodic.
// To use true values of flags, the parameters
// <theSurfIsUPeriodic> and <theSurfIsVPeriodic> have been added.
//======================================================================= //=======================================================================
Standard_Boolean Validate(const Adaptor3d_Curve& CRef, BRepCheck_Status Validate (const Adaptor3d_Curve& CRef,
const Adaptor3d_CurveOnSurface& Other, const Adaptor3d_CurveOnSurface& Other,
const Standard_Real Tol, const Standard_Real Tol,
const Standard_Boolean SameParameter) const Standard_Boolean SameParameter,
const Standard_Boolean theSurfIsUPeriodic,
const Standard_Boolean theSurfIsVPeriodic)
{ {
Standard_Boolean Status, proj; BRepCheck_Status Status = BRepCheck_NoError;
Standard_Real aPC, First, Last, Error; const Standard_Real aPC = Precision::PConfusion(),
gp_Pnt problematic_point ; First = CRef.FirstParameter(),
// Last = CRef.LastParameter();
Status = Standard_True;
Error = 0.; const Standard_Boolean proj = (!SameParameter ||
First = CRef.FirstParameter(); fabs(Other.FirstParameter()-First) > aPC ||
Last = CRef.LastParameter(); fabs(Other.LastParameter()-Last) > aPC);
//
aPC=Precision::PConfusion(); if (!proj)
proj = (!SameParameter || {
fabs(Other.FirstParameter()-First) > aPC ||
fabs( Other.LastParameter()-Last) > aPC);
if (!proj) {
Standard_Integer i;
Standard_Real Tol2, prm, dD;
gp_Pnt pref, pother;
//modified by NIZNHY-PKV Thu May 05 09:06:41 2011f //modified by NIZNHY-PKV Thu May 05 09:06:41 2011f
//OCC22428 //OCC22428
dD=Prec(CRef, Other);//3.e-15; const Standard_Real dD = Prec(CRef, Other);//3.e-15;
Tol2=Tol+dD; Standard_Real Tol2=Tol+dD;
Tol2=Tol2*Tol2; Tol2=Tol2*Tol2;
//Tol2=Tol*Tol; //Tol2=Tol*Tol;
//modified by NIZNHY-PKV Thu May 05 09:06:47 2011t //modified by NIZNHY-PKV Thu May 05 09:06:47 2011t
for (i = 0; i< NCONTROL; ++i) { const Standard_Real uf = Other.GetSurface()->FirstUParameter ();
prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1); const Standard_Real ul = Other.GetSurface()->LastUParameter ();
pref = CRef.Value(prm); const Standard_Real vf = Other.GetSurface()->FirstVParameter();
pother = Other.Value(prm); const Standard_Real vl = Other.GetSurface()->LastVParameter();
if (pref.SquareDistance(pother) > Tol2) {
problematic_point = pref ; //These values are used for estimation of toleranves of
Status = Standard_False; //"plane-like" surfaces
Error = pref.Distance(pother); const Standard_Real aDeltaU = (ul - uf);
PrintProblematicPoint(problematic_point, Error, Tol); const Standard_Real aDeltaV = (vl - vf);
return Status;
//goto FINISH ; //(for Rectangular trimmed surface for example)
const Standard_Boolean isBaseSurfUPeriodic = Other.GetSurface()->IsUPeriodic() && !theSurfIsUPeriodic;
const Standard_Boolean isBaseSurfVPeriodic = Other.GetSurface()->IsVPeriodic() && !theSurfIsVPeriodic;
const Standard_Boolean isUPeriodic = isBaseSurfUPeriodic || theSurfIsUPeriodic;
const Standard_Boolean isVPeriodic = isBaseSurfVPeriodic || theSurfIsVPeriodic;
const Standard_Boolean isUClosedOrPeriodic = Other.GetSurface()->IsUClosed() || theSurfIsUPeriodic;
const Standard_Boolean isVClosedOrPeriodic = Other.GetSurface()->IsVClosed() || theSurfIsVPeriodic;
const Standard_Real UResSt =Other.GetSurface()->UResolution(Tol);
const Standard_Real VResSt =Other.GetSurface()->VResolution(Tol);
// if(isUClosedOrPeriodic)
// {
// const Standard_Real aF = Other.GetCurve()->Value(First).X();
// const Standard_Real aL = Other.GetCurve()->Value(Last).X();
// const Standard_Real aDim = theSurfIsUPeriodic ?
// Other.GetSurface()->UPeriod() :
// aDeltaU;
//
// if(Abs(aL - aF) - aDim > 2 * UResSt)
// {
//#ifdef DEB
// cout << endl << "----\nFunction Validate(...); file: "
// "BRepCheck_Edge.cxx" << endl;
// if(theSurfIsUPeriodic)
// cout << "The surface is U-periodic." << endl;
// else
// cout << "The surface is U-closed." << endl;
//
// cout << "P1.X() = " << aF << "; P2.X() = " << aL << endl;
// cout << "Surface dimension D = " << aDim <<
// ". (P2.X() - P1.X()) > D." << "\n-----" << endl;
//#endif
// Status = BRepCheck_PCurveIsOutOfDomainFace;
// return Status;
// }//if(aL - aF - aT > 2* URes)
// }//if(theSurfIsUPeriodic)
//
// if(isVClosedOrPeriodic)
// {
// const Standard_Real aF = Other.GetCurve()->Value(First).Y();
// const Standard_Real aL = Other.GetCurve()->Value(Last).Y();
// const Standard_Real aDim = theSurfIsVPeriodic ?
// Other.GetSurface()->VPeriod() :
// aDeltaV;
//
// if(Abs(aL - aF) - aDim > 2 * VResSt)
// {
//#ifdef DEB
// cout << endl << "----\nFunction Validate(...); file: "
// "RepCheck_Edge.cxx" << endl;
// if(theSurfIsVPeriodic)
// cout << "The surface is V-periodic." << endl;
// else
// cout << "The surface is V-closed." << endl;
//
// cout << "P1.Y() = " << aF << "; P2.Y() = " << aL << endl;
// cout << "Surface dimension D = " << aDim <<
// ". (P2.Y() - P1.Y()) > D." << "\n-----" << endl;
//#endif
// Status = BRepCheck_PCurveIsOutOfDomainFace;
// return Status;
// }//if(aL - aF - aT > 2* VRes)
// }//if(theSurfIsVPeriodic)
Standard_Real aCriticalParameterU = First,
aCriticalParameterV = First;
Standard_Real aDeltaUmax = 0.0,
aDeltaVmax = 0.0;
Standard_Real dUmaxU = 0.0, dUmaxV = 0.0;
Standard_Real dVmaxU = 0.0, dVmaxV = 0.0;
Standard_Boolean isIntoBoundaries = Standard_True;
for (Standard_Integer i = 0; i < aNbControl; ++i)
{
const Standard_Real prm = ((aNbControl-1-i)*First + i*Last)/(aNbControl-1);
const gp_Pnt pref = CRef.Value(prm);
const gp_Pnt pother = Other.Value(prm);
if (pref.SquareDistance(pother) > Tol2)
{
const gp_Pnt problematic_point(pref) ;
Status = BRepCheck_InvalidCurveOnSurface;
const Standard_Real Error = pref.Distance(pother);
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
} }
}
} const gp_Pnt2d CP = Other.GetCurve()->Value(prm);
else {
if(isUClosedOrPeriodic && isVClosedOrPeriodic)
continue;
const Standard_Real u = Max(uf, Min(CP.X(), ul));
const Standard_Real v = Max(vf, Min(CP.Y(), vl));
const Standard_Boolean isUbound = ((uf <= CP.X()) && (CP.X() <= ul)) || isUClosedOrPeriodic,
isVbound = ((vf <= CP.Y()) && (CP.Y() <= vl)) || isVClosedOrPeriodic;
//Point CP is in surface boundary.
if(isUbound && isVbound)
continue;
isIntoBoundaries = Standard_False;
//Values of overrun of surface boundaries
const Standard_Real dUpar = (isUPeriodic || isUbound) ? 0.0 : CP.X() - u,
dVpar = (isVPeriodic || isVbound) ? 0.0 : CP.Y() - v;
if(Abs(dUpar) > aDeltaUmax)
{
aCriticalParameterU = prm;
aDeltaUmax = Abs(dUpar);
dUmaxU = dUpar;
dUmaxV = dVpar;
}
if(Abs(dVpar) > aDeltaVmax)
{
aCriticalParameterV = prm;
aDeltaVmax = Abs(dVpar);
dVmaxU = dUpar;
dVmaxV = dVpar;
}
}//for (i = 0; i< aNbControl; ++i)
if(!isIntoBoundaries)
{
// Max U(V) resolution is calculated from condition:
// |S'|*dU > aCoeff*(0.5*|S"|dU*dU), it means that
// first order differential of surface >> second order one
const Standard_Real aCoeff = 10.;
//Value to check modulus of derivatives against zero
const Standard_Real eps = 1.e-16;
//Value for estimation Max resolution if |S"| < eps
const Standard_Real aFactor = 10.;
for(Standard_Integer anIndex = 0; anIndex < 2; anIndex++)
{
const Standard_Real aParam = !anIndex ? aCriticalParameterU : aCriticalParameterV;
const Standard_Real du = !anIndex ? dUmaxU : dUmaxV;
const Standard_Real dv = !anIndex ? dVmaxU : dVmaxV;
const gp_Pnt2d CP = Other.GetCurve()->Value(aParam);
const Standard_Real u = Max(uf, Min(CP.X(), ul));
const Standard_Real v = Max(vf, Min(CP.Y(), vl));
gp_Pnt aPref;
gp_Vec aDSdu, aDSdv, aD2Sdu2, aD2Sdv2, aD2Sdudv;
Other.GetSurface()->D2(u, v, aPref, aDSdu, aDSdv, aD2Sdu2, aD2Sdv2, aD2Sdudv);
Standard_Real UResMax = 0.0, VResMax = 0.0;
const Standard_Real aModDSdu = aDSdu.Magnitude();
const Standard_Real aModDSdv = aDSdv.Magnitude();
const Standard_Real aModD2Sdu2 = aD2Sdu2.Magnitude();
const Standard_Real aModD2Sdv2 = aD2Sdv2.Magnitude();
if(aModDSdu > eps)
{
if(aModD2Sdu2 > aModDSdu / aCoeff)
{
UResMax = aModDSdu / (.5 * aCoeff * aModD2Sdu2);
}
else
{
//Surface seems to be "plane-like" in U direction
UResMax = aDeltaU / aFactor;
}
}
else
{
UResMax = aFactor * UResSt;
}
if(aModDSdv > eps)
{
if(aModD2Sdv2 > aModDSdv / aCoeff)
{
VResMax = aModDSdv / (5. * aModD2Sdv2);
}
else
{
//Surface seems to be "plane-like" in V direction
VResMax = aDeltaV / aFactor;
}
}
else
{
VResMax = aFactor * VResSt;
}
const Standard_Real anURes = isBaseSurfUPeriodic ? UResSt : UResMax,
aVRes = isBaseSurfVPeriodic ? VResSt : VResMax;
const Standard_Boolean isUbound = ((uf - anURes <= CP.X()) && (CP.X() <= ul + anURes)) || isUClosedOrPeriodic,
isVbound = ((vf - aVRes <= CP.Y()) && (CP.Y() <= vl + aVRes)) || isVClosedOrPeriodic;
if(isUbound && isVbound)
continue;
#ifdef DEB
if(!isUbound)
{
cout << endl << "----\nFunction Validate(...); file: "
"BRepCheck_Edge.cxx" << endl;
if(isBaseSurfUPeriodic)
cout << "RTS from U-periodic" << endl;
else if(theSurfIsUPeriodic)
cout << "U-periodic surface" << endl;
else if(isUClosedOrPeriodic)
cout << "U-closed surface" << endl;
cout << "Point(prm = " << aParam << "): (" <<
CP.X() << "; " << CP.Y() <<")." << endl;
cout << "u = (" << uf << ")...(" << ul << "). "
"Delta = " << Max(uf - CP.X(),CP.X()-ul) << " Tol3D = " << Tol <<
". URes = " << anURes << "\n-----" << endl;
}
if(!isVbound)
{
cout << endl << "----\nFunction Validate(...); file: "
"BRepCheck_Edge.cxx" << endl;
if(isBaseSurfVPeriodic)
cout << "RTS from V-periodic" << endl;
else if(theSurfIsVPeriodic)
cout << "V-periodic surface" << endl;
else if(isVClosedOrPeriodic)
cout << "V-closed surface" << endl;
cout << "Point(prm = " << aParam << "): (" <<
CP.X() << "; " << CP.Y() <<")." << endl;
cout << "v = (" << vf << ")...(" << vl << "). "
"Delta = " << Max(vf - CP.Y(),CP.Y()-vl) << " Tol3D = " << Tol <<
". VRes = " << aVRes << "\n-----" << endl;
}
#endif
//Expected and real point
gp_Pnt aPe, aPf;
//1st degree estimation
aPe.SetXYZ(gp_XYZ(aPref.X() + (aDSdu.X()*du+aDSdv.X()*dv),
aPref.Y() + (aDSdu.Y()*du+aDSdv.Y()*dv),
aPref.Z() + (aDSdu.Z()*du+aDSdv.Z()*dv)));
Other.GetSurface()->D0(CP.X(), CP.Y(), aPf);
const Standard_Real aTol = Tol2;
Standard_Real dist = aPe.SquareDistance(aPf);
if(dist < aTol)
continue;
#ifdef DEB
cout << endl << "++++\nFunction Validate(...); file: "
"BRepCheck_Edge.cxx (1st degree)" << endl;
cout << "Exp. point: (" << aPe.X() << ", " << aPe.Y() << ", " <<
aPe.Z() << ")." << endl;
cout << "Real point: (" << aPf.X() << ", " << aPf.Y() << ", " <<
aPf.Z() << ")." << endl;
cout << "dist**2 = " << dist <<
"; Tol = " << aTol << "\n-----" << endl;
#endif
const Standard_Real dUpar2 = du*du;
const Standard_Real dVpar2 = dv*dv;
const Standard_Real dUVpar = du*dv;
//2nd degree estimation
aPe.SetXYZ(gp_XYZ(aPe.X() + (aD2Sdu2.X()*dUpar2 +
2.0*aD2Sdudv.X()*dUVpar + aD2Sdv2.X()*dVpar2)/2.0,
aPe.Y() + (aD2Sdu2.Y()*dUpar2 +
2.0*aD2Sdudv.Y()*dUVpar + aD2Sdv2.Y()*dVpar2)/2.0,
aPe.Z() + (aD2Sdu2.Z()*dUpar2 +
2.0*aD2Sdudv.Z()*dUVpar + aD2Sdv2.Z()*dVpar2)/2.0));
dist = aPe.SquareDistance(aPf);
if(dist > aTol)
{
#ifdef DEB
cout << endl << "++++\nFunction Validate(...); file: "
"BRepCheck_Edge.cxx (2nd degree)" << endl;
cout << "Exp. point: (" << aPe.X() << ", " << aPe.Y() << ", " <<
aPe.Z() << ")." << endl;
cout << "Real point: (" << aPf.X() << ", " << aPf.Y() << ", " <<
aPf.Z() << ")." << endl;
cout << "dist**2 = " << dist <<
"; Tol = " << aTol << "\n-----" << endl;
#endif
Status = BRepCheck_PCurveIsOutOfDomainFace;
return Status;
}
}//for(Standard_Integer anIndex = 0; anIndex < 2; anIndex++)
}//if(!isIntoBoundaries)
}//if (!proj)
else
{
Extrema_LocateExtPC refd,otherd; Extrema_LocateExtPC refd,otherd;
Standard_Real OFirst = Other.FirstParameter(); Standard_Real OFirst = Other.FirstParameter();
Standard_Real OLast = Other.LastParameter(); Standard_Real OLast = Other.LastParameter();
gp_Pnt pd = CRef.Value(First); gp_Pnt pd = CRef.Value(First);
gp_Pnt pdo = Other.Value(OFirst); gp_Pnt pdo = Other.Value(OFirst);
Standard_Real distt = pd.SquareDistance(pdo); Standard_Real distt = pd.SquareDistance(pdo);
if (distt > Tol*Tol) {
problematic_point = pd ; if (distt > Tol*Tol)
Status = Standard_False ; {
Error = Sqrt(distt); const gp_Pnt problematic_point(pd);
Status = BRepCheck_InvalidCurveOnSurface ;
const Standard_Real Error = Sqrt(distt);
PrintProblematicPoint(problematic_point, Error, Tol); PrintProblematicPoint(problematic_point, Error, Tol);
return Status; return Status;
//goto FINISH ; //goto FINISH ;
} }
pd = CRef.Value(Last); pd = CRef.Value(Last);
pdo = Other.Value(OLast); pdo = Other.Value(OLast);
distt = pd.SquareDistance(pdo); distt = pd.SquareDistance(pdo);
if (distt > Tol*Tol) {
problematic_point = pd ; if (distt > Tol*Tol)
Status = Standard_False ; {
Error = Sqrt(distt); const gp_Pnt problematic_point(pd);
Status = BRepCheck_InvalidCurveOnSurface ;
const Standard_Real Error = Sqrt(distt);
PrintProblematicPoint(problematic_point, Error, Tol); PrintProblematicPoint(problematic_point, Error, Tol);
return Status; return Status;
//goto FINISH ; //goto FINISH ;
@@ -624,57 +978,50 @@ Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
refd.Initialize(CRef,First,Last,CRef.Resolution(Tol)); refd.Initialize(CRef,First,Last,CRef.Resolution(Tol));
otherd.Initialize(Other,OFirst,OLast,Other.Resolution(Tol)); otherd.Initialize(Other,OFirst,OLast,Other.Resolution(Tol));
for (Standard_Integer i = 2; i< NCONTROL-1; i++) {
Standard_Real rprm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1); for (Standard_Integer i = 2; i< aNbControl-1; i++)
{
Standard_Real rprm = ((aNbControl-1-i)*First + i*Last)/(aNbControl-1);
gp_Pnt pref = CRef.Value(rprm); gp_Pnt pref = CRef.Value(rprm);
Standard_Real oprm = ((NCONTROL-1-i)*OFirst + i*OLast)/(NCONTROL-1); Standard_Real oprm = ((aNbControl-1-i)*OFirst + i*OLast)/(aNbControl-1);
gp_Pnt pother = Other.Value(oprm); gp_Pnt pother = Other.Value(oprm);
refd.Perform(pother,rprm); refd.Perform(pother,rprm);
if (!refd.IsDone() || refd.SquareDistance() > Tol * Tol) {
problematic_point = pref ; if (!refd.IsDone() || refd.SquareDistance() > Tol * Tol)
Status = Standard_False ; {
if (refd.IsDone()) { const gp_Pnt problematic_point(pref);
Error = sqrt (refd.SquareDistance()); Status = BRepCheck_InvalidCurveOnSurface ;
}
else { const Standard_Real Error = refd.IsDone() ?
Error = RealLast(); sqrt (refd.SquareDistance()) :
} RealLast();
PrintProblematicPoint(problematic_point, Error, Tol);
return Status; PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
//goto FINISH ; //goto FINISH ;
} }
otherd.Perform(pref,oprm); otherd.Perform(pref,oprm);
if (!otherd.IsDone() || otherd.SquareDistance() > Tol * Tol) {
problematic_point = pref ; if (!otherd.IsDone() || otherd.SquareDistance() > Tol * Tol)
Status = Standard_False ; {
if (otherd.IsDone()) { const gp_Pnt problematic_point(pref);
Error = sqrt (otherd.SquareDistance()); Status = BRepCheck_InvalidCurveOnSurface ;
}
else { const Standard_Real Error = otherd.IsDone() ?
Error = RealLast(); sqrt (otherd.SquareDistance()) :
} RealLast();
PrintProblematicPoint(problematic_point, Error, Tol);
return Status; PrintProblematicPoint(problematic_point, Error, Tol);
//goto FINISH ; return Status;
//goto FINISH ;
} }
} }
} }
//FINISH :
/*
#ifdef DEB
if (! Status) {
cout << " **** probleme de SameParameter au point :" << endl;
cout << " " << problematic_point.Coord(1) << " "
<< problematic_point.Coord(2) << " "
<< problematic_point.Coord(3) << endl ;
cout << " Erreur detectee :" << Error << " Tolerance :" << Tol << endl;
}
#endif
*/
return Status ; return Status ;
} }
//======================================================================= //=======================================================================
//function : Prec //function : Prec
//purpose : //purpose :

View File

@@ -66,6 +66,13 @@ is
is static; is static;
SetStatus(me: mutable;
theStatus:Status from BRepCheck)
--- Purpose: Sets status of Face;
is static;
IsUnorientable(me) IsUnorientable(me)

View File

@@ -494,6 +494,15 @@ void BRepCheck_Face::SetUnorientable()
BRepCheck::Add(myMap(myShape),BRepCheck_UnorientableShape); BRepCheck::Add(myMap(myShape),BRepCheck_UnorientableShape);
} }
//=======================================================================
//function : SetStatus
//purpose :
//=======================================================================
void BRepCheck_Face::SetStatus(const BRepCheck_Status theStatus)
{
BRepCheck::Add(myMap(myShape),theStatus);
}
//======================================================================= //=======================================================================
//function : IsUnorientable //function : IsUnorientable

View File

@@ -384,7 +384,7 @@ Standard_Boolean IsDistanceIn3DTolerance (const BRepAdaptor_Surface& /*aFaceSurf
#ifdef DEB #ifdef DEB
cout << endl; cout << endl;
cout << "--------Function IsDistanceIn3DTolerance(...)----------" << endl; cout << "--------Function IsDistanceIn3DTolerance(...)----------" << endl;
cout << "--- BRepCheck Wire: Closed3d -> Error" << endl; cout << "--- BRepCheck Wire: Not closed in 3D" << endl;
cout << "--- Dist (" << Dist << ") > Tol3d (" << aTol3d << ")" << endl; cout << "--- Dist (" << Dist << ") > Tol3d (" << aTol3d << ")" << endl;
cout << "Pnt1(" << thePnt_f.X() << "; " << thePnt_f.Y() << "; " << thePnt_f.Z() << ")" << endl; cout << "Pnt1(" << thePnt_f.X() << "; " << thePnt_f.Y() << "; " << thePnt_f.Z() << ")" << endl;
cout << "Pnt2(" << thePnt_l.X() << "; " << thePnt_l.Y() << "; " << thePnt_l.Z() << ")" << endl; cout << "Pnt2(" << thePnt_l.X() << "; " << thePnt_l.Y() << "; " << thePnt_l.Z() << ")" << endl;
@@ -422,7 +422,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
{ {
cout << endl; cout << endl;
cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl; cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl;
cout << "--- BRepCheck Wire: Not closed in 2d" << endl; cout << "--- BRepCheck Wire: Not closed in 2D" << endl;
cout << "*****************************************************" << endl; cout << "*****************************************************" << endl;
cout << "*dumin = " << dumin << "; dumax = " << dumax << endl; cout << "*dumin = " << dumin << "; dumax = " << dumax << endl;
cout << "* dvmin = " << dvmin << "; dvmax = " << dvmax << endl; cout << "* dvmin = " << dvmin << "; dvmax = " << dvmax << endl;
@@ -471,7 +471,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
{ {
cout << endl; cout << endl;
cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl; cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl;
cout << "--- BRepCheck Wire: Not closed in 2d" << endl; cout << "--- BRepCheck Wire: Not closed in 2D" << endl;
cout << "*****************************************************" << endl; cout << "*****************************************************" << endl;
cout << "* Dist = " << Dist << " > Tol2d = " << aTol2d << endl; cout << "* Dist = " << Dist << " > Tol2d = " << aTol2d << endl;
cout << "*****************************************************" << endl; cout << "*****************************************************" << endl;
@@ -1209,6 +1209,135 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
} }
} }
//-- --------------------------------------------------------
//-- Check maximum yawn between 2 edges
//--
//-- Check distance from edges to the curve joining
//-- the point of intersection with vertex (if exists)
if (localok == Standard_False && !CommonVertices.IsEmpty()) {
#ifdef DEB
cout << "\n------------------------------------------------------\n" <<endl;
cout << "\n--- BRepCheck Wire: AutoIntersection Phase1 -> Erreur \n" <<endl;
#endif
Standard_Real distauvtxleplusproche,VParaOnEdge1,VParaOnEdge2;
gp_Pnt VertexLePlusProche;
//
VParaOnEdge1 =0.;
VParaOnEdge2 =0.;
distauvtxleplusproche=RealLast();
//Find the nearest common vertex
itl.Initialize( CommonVertices );
for (; itl.More(); itl.Next()) {
Standard_Real disptvtx;
gp_Pnt p3dvtt;
//
const TopoDS_Vertex& vtt = TopoDS::Vertex(itl.Value());
p3dvtt = BRep_Tool::Pnt(vtt);
disptvtx = P3d.Distance(p3dvtt);
if (disptvtx < distauvtxleplusproche) {
VertexLePlusProche = p3dvtt;
distauvtxleplusproche = disptvtx;
VParaOnEdge1 = BRep_Tool::Parameter(vtt,E1);
VParaOnEdge2 = BRep_Tool::Parameter(vtt,E2);
}
// eap: case of closed edge
else if (IsEqual(distauvtxleplusproche, disptvtx)) {
Standard_Real newVParaOnEdge1 = BRep_Tool::Parameter(vtt,E1);
Standard_Real newVParaOnEdge2 = BRep_Tool::Parameter(vtt,E2);
if (Abs(IP_ParamOnFirst - VParaOnEdge1) + Abs(IP_ParamOnSecond - VParaOnEdge2)
>
Abs(IP_ParamOnFirst - newVParaOnEdge1) + Abs(IP_ParamOnSecond - newVParaOnEdge2)) {
VertexLePlusProche = p3dvtt;
VParaOnEdge1 = newVParaOnEdge1;
VParaOnEdge2 = newVParaOnEdge2;
}
}
}
//Patch: extraordinar situation (e.g. tolerance(v) == 0.)
// Modified by skv - Wed Jul 23 12:28:11 2003 OCC1764 Begin
// if (VertexLePlusProche.Distance( P3d ) <= gp::Resolution())
if (VertexLePlusProche.Distance(P3d) <= gp::Resolution() ||
VertexLePlusProche.Distance(P3d2) <= gp::Resolution()) {
// Modified by skv - Wed Jul 23 12:28:12 2003 OCC1764 End
localok = Standard_True;
}
else {
gp_Lin Lig( VertexLePlusProche, gp_Vec(VertexLePlusProche,P3d) );
Standard_Real du1 = 0.1*(IP_ParamOnFirst -VParaOnEdge1);
Standard_Real du2 = 0.1*(IP_ParamOnSecond-VParaOnEdge2);
Standard_Real maxd1 = 0., maxd2 = 0.;
Standard_Integer k;
localok = Standard_True;
Standard_Real tole1 = BRep_Tool::Tolerance(E1);
for (k = 2; localok && k < 9; k++) {
Standard_Real u = VParaOnEdge1 + k*du1; // check if it works
gp_Pnt P1;
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
if (!ConS.IsNull()) {
P1 = ConS->Value(u);
P1.Transform(L.Transformation());
}
else {
gp_Pnt2d aP2d = C1.Value(u);
P1 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
Standard_Real d1 = Lig.Distance(P1);
if (d1 > maxd1) {
maxd1 = d1;
}
if (d1 > tole1*2.0){
localok = Standard_False;
}
}
//-- same for edge2
// Modified by skv - Wed Jul 23 12:22:20 2003 OCC1764 Begin
gp_Dir aTmpDir(P3d2.XYZ().Subtracted(VertexLePlusProche.XYZ()));
Lig.SetDirection(aTmpDir);
// Modified by skv - Wed Jul 23 12:22:23 2003 OCC1764 End
Standard_Real tole2 = BRep_Tool::Tolerance(E2);
for (k = 2; localok && k < 9; k++) {
Standard_Real u = VParaOnEdge2 + k*du2; // check if it works
gp_Pnt P2;
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
if (!ConS2.IsNull()) {
P2 = ConS2->Value(u);
P2.Transform(L2.Transformation());
}
else {
gp_Pnt2d aP2d = C2.Value(u);
P2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
Standard_Real d2 = Lig.Distance(P2);
if (d2 > maxd2) {
maxd2 = d2;
}
if (d2 > tole2*2.0){
localok = Standard_False;
}
}
#ifdef DEB
if(localok) {
printf("--- BRepCheck Wire: AutoIntersection Phase2 -> Bon \n");
printf("--- distance Point Vertex : %10.7g (tol %10.7g)\n",distauvtxleplusproche,tolvtt);
printf("--- Erreur Max sur E1 : %10.7g Tol_Edge:%10.7g\n",maxd1,tole1);
printf("--- Erreur Max sur E2 : %10.7g Tol_Edge:%10.7g\n",maxd2,tole2);
fflush(stdout);
}
else {
printf("--- BRepCheck Wire: AutoIntersection Phase2 -> Erreur \n");
printf("--- distance Point Vertex : %10.7g (tol %10.7g)\n",distauvtxleplusproche,tolvtt);
printf("--- Erreur Max sur E1 : %10.7g Tol_Edge:%10.7g\n",maxd1,tole1);
printf("--- Erreur Max sur E2 : %10.7g Tol_Edge:%10.7g\n",maxd2,tole2);
fflush(stdout);
}
#endif
} //end of else (construction of the line Lig)
} //end of if (localok == Standard_False && !CommonVertices.IsEmpty())
// //
if(localok==Standard_False) { if(localok==Standard_False) {
retE1=E1; retE1=E1;

View File

@@ -174,7 +174,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
} }
} }
if (APointExist) while (APointExist)
{ {
ParamInit *= 0.41234; ParamInit *= 0.41234;
u_ = P.X() + ParamInit* T.X(); u_ = P.X() + ParamInit* T.X();
@@ -190,7 +190,12 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
BRepAdaptor_Surface s; BRepAdaptor_Surface s;
s.Initialize (face, Standard_False); s.Initialize (face, Standard_False);
s.D1 (u_, v_, APoint_, theVecD1U, theVecD1V); s.D1 (u_, v_, APoint_, theVecD1U, theVecD1V);
return Standard_True;
if(theVecD1U.CrossMagnitude(theVecD1V) > gp::Resolution())
return Standard_True;
if(ParamInit < Precision::PConfusion())
return Standard_False;
} }
} }
return Standard_False; return Standard_False;

View File

@@ -1435,13 +1435,17 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
// Associate 2d // Associate 2d
Handle(Geom2d_Line) L; Handle(Geom2d_Line) L;
TopLoc_Location Loc; TopLoc_Location Loc;
Standard_Real Umin, Umax, Vmin, Vmax;
S->Bounds(Umin, Umax, Vmin, Vmax);
if (isUiso) { if (isUiso) {
gp_Pnt2d P(ValIso, 0); //gp_Pnt2d P(ValIso, 0);
gp_Pnt2d P( ValIso, Vmin - Iso->FirstParameter() );
gp_Vec2d V(0., 1.); gp_Vec2d V(0., 1.);
L = new (Geom2d_Line) (P, V); L = new (Geom2d_Line) (P, V);
} }
else { else {
gp_Pnt2d P(0., ValIso); //gp_Pnt2d P(0., ValIso);
gp_Pnt2d P( Umin -Iso->FirstParameter() , ValIso );
gp_Vec2d V(1., 0.); gp_Vec2d V(1., 0.);
L = new (Geom2d_Line) (P, V); L = new (Geom2d_Line) (P, V);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -41,20 +41,18 @@ uses
gp, gp,
Geom2d, Geom2d,
Geom, Geom,
Primitives,
TopoDS, TopoDS,
BRep BRep
is is
enumeration Direction is
---Purpose:
XMin, XMax, YMin, YMax, ZMin, ZMax
end Direction;
class Builder; class Builder;
deferred class OneAxis instantiates OneAxis from Primitives( deferred class OneAxis;
Shell from TopoDS,
Face from TopoDS,
Wire from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Builder from BRepPrim);
class Revolution; class Revolution;
@@ -66,13 +64,7 @@ is
class Torus; class Torus;
class GWedge instantiates Wedge from Primitives( class GWedge;
Shell from TopoDS,
Face from TopoDS,
Wire from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Builder from BRepPrim);
class Wedge; class Wedge;

View File

@@ -14,13 +14,8 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class Wedge from Primitives( class GWedge from BRepPrim
TheShell as any;
TheFace as any;
TheWire as any;
TheEdge as any;
TheVertex as any;
TheBuilder as any)
---Purpose: A wedge is defined by : ---Purpose: A wedge is defined by :
-- --
@@ -45,21 +40,27 @@ generic class Wedge from Primitives(
uses uses
Direction from Primitives, Direction from BRepPrim,
Ax2 from gp, Ax2 from gp,
Pln from gp, Pln from gp,
Lin from gp, Lin from gp,
Pnt from gp Pnt from gp,
Shell from TopoDS,
Face from TopoDS,
Wire from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Builder from BRepPrim
raises raises
DomainError, DomainError,
OutOfRange OutOfRange
is is
Create(B : TheBuilder; Axes : Ax2 from gp; dx, dy, dz : Real) Create(B : Builder from BRepPrim; Axes : Ax2 from gp; dx, dy, dz : Real)
returns Wedge from Primitives returns GWedge from BRepPrim
---Purpose: Creates a Wedge algorithm. <Axes> is the axis ---Purpose: Creates a GWedge algorithm. <Axes> is the axis
-- system for the primitive. -- system for the primitive.
-- --
-- XMin, YMin, ZMin are set to 0 -- XMin, YMin, ZMin are set to 0
@@ -72,9 +73,9 @@ is
-- dx,dy,dz should be positive -- dx,dy,dz should be positive
raises DomainError; raises DomainError;
Create(B : TheBuilder; Axes : Ax2 from gp; dx, dy, dz, ltx : Real) Create(B : Builder from BRepPrim; Axes : Ax2 from gp; dx, dy, dz, ltx : Real)
returns Wedge from Primitives returns GWedge from BRepPrim
---Purpose: Creates a Wedge primitive. <Axes> is the axis ---Purpose: Creates a GWedge primitive. <Axes> is the axis
-- system for the primitive. -- system for the primitive.
-- --
-- XMin, YMin, ZMin are set to 0 -- XMin, YMin, ZMin are set to 0
@@ -88,10 +89,10 @@ is
-- ltx should not be negative -- ltx should not be negative
raises DomainError; raises DomainError;
Create(B : TheBuilder; Axes : Ax2 from gp; xmin, ymin, zmin, z2min, x2min, Create(B : Builder from BRepPrim; Axes : Ax2 from gp; xmin, ymin, zmin, z2min, x2min,
xmax, ymax, zmax, z2max, x2max : Real) xmax, ymax, zmax, z2max, x2max : Real)
returns Wedge from Primitives returns GWedge from BRepPrim
---Purpose: Create a Wedge primitive. <Axes> is the axis ---Purpose: Create a GWedge primitive. <Axes> is the axis
-- system for the primitive. -- system for the primitive.
-- --
-- all the fields are set to the corresponding value -- all the fields are set to the corresponding value
@@ -143,80 +144,80 @@ is
---Purpose: Returns X2Max value from <me>. ---Purpose: Returns X2Max value from <me>.
is static; is static;
Open(me : in out; d1 : Direction from Primitives) Open(me : in out; d1 : Direction from BRepPrim)
---Purpose: Opens <me> in <d1> direction. A face and its edges ---Purpose: Opens <me> in <d1> direction. A face and its edges
-- or vertices are said nonexistant. -- or vertices are said nonexistant.
raises DomainError raises DomainError
is static; is static;
Close(me : in out; d1 : Direction from Primitives) Close(me : in out; d1 : Direction from BRepPrim)
---Purpose: Closes <me> in <d1> direction. A face and its ---Purpose: Closes <me> in <d1> direction. A face and its
-- edges or vertices are said existant. -- edges or vertices are said existant.
raises DomainError raises DomainError
is static; is static;
IsInfinite(me; d1 : Direction from Primitives) IsInfinite(me; d1 : Direction from BRepPrim)
---Purpose: Returns True if <me> is open in <d1> direction. ---Purpose: Returns True if <me> is open in <d1> direction.
returns Boolean; returns Boolean;
Shell(me : in out) returns TheShell Shell(me : in out) returns Shell from TopoDS
---Purpose: Returns the Shell containing the Faces of <me>. ---Purpose: Returns the Shell containing the Faces of <me>.
-- --
---C++: return const & ---C++: return const &
is static; is static;
HasFace(me; d1 : Direction from Primitives) HasFace(me; d1 : Direction from BRepPrim)
---Purpose: Returns True if <me> has a Face in <d1> direction. ---Purpose: Returns True if <me> has a Face in <d1> direction.
returns Boolean; returns Boolean;
Face(me : in out; d1 : Direction from Primitives) returns TheFace Face(me : in out; d1 : Direction from BRepPrim) returns Face from TopoDS
---Purpose: Returns the Face of <me> located in <d1> direction. ---Purpose: Returns the Face of <me> located in <d1> direction.
-- --
---C++: return const & ---C++: return const &
raises DomainError raises DomainError
is static; is static;
Plane(me : in out; d1 : Direction from Primitives) returns Pln from gp Plane(me : in out; d1 : Direction from BRepPrim) returns Pln from gp
---Purpose: Returns the plane of the Face of <me> located in ---Purpose: Returns the plane of the Face of <me> located in
-- <d1> direction. -- <d1> direction.
raises DomainError raises DomainError
is static; is static;
HasWire(me; d1 : Direction from Primitives) HasWire(me; d1 : Direction from BRepPrim)
---Purpose: Returns True if <me> has a Wire in <d1> direction. ---Purpose: Returns True if <me> has a Wire in <d1> direction.
returns Boolean; returns Boolean;
Wire(me : in out; d1 : Direction from Primitives) returns TheWire Wire(me : in out; d1 : Direction from BRepPrim) returns Wire from TopoDS
---Purpose: Returns the Wire of <me> located in <d1> direction. ---Purpose: Returns the Wire of <me> located in <d1> direction.
-- --
---C++: return const & ---C++: return const &
raises DomainError raises DomainError
is static; is static;
HasEdge(me; d1, d2 : Direction from Primitives) HasEdge(me; d1, d2 : Direction from BRepPrim)
---Purpose: Returns True if <me> has an Edge in <d1><d2> direction. ---Purpose: Returns True if <me> has an Edge in <d1><d2> direction.
returns Boolean; returns Boolean;
Edge(me : in out; d1, d2 : Direction from Primitives) returns TheEdge Edge(me : in out; d1, d2 : Direction from BRepPrim) returns Edge from TopoDS
---Purpose: Returns the Edge of <me> located in <d1><d2> direction. ---Purpose: Returns the Edge of <me> located in <d1><d2> direction.
-- --
---C++: return const & ---C++: return const &
raises DomainError raises DomainError
is static; is static;
Line(me : in out; d1, d2 : Direction from Primitives) returns Lin from gp Line(me : in out; d1, d2 : Direction from BRepPrim) returns Lin from gp
---Purpose: Returns the line of the Edge of <me> located in ---Purpose: Returns the line of the Edge of <me> located in
-- <d1><d2> direction. -- <d1><d2> direction.
raises DomainError raises DomainError
is static; is static;
HasVertex(me; d1, d2, d3 : Direction from Primitives) HasVertex(me; d1, d2, d3 : Direction from BRepPrim)
---Purpose: Returns True if <me> has a Vertex in <d1><d2><d3> ---Purpose: Returns True if <me> has a Vertex in <d1><d2><d3>
-- direction. -- direction.
returns Boolean; returns Boolean;
Vertex(me : in out; d1, d2, d3 : Direction from Primitives) Vertex(me : in out; d1, d2, d3 : Direction from BRepPrim)
returns TheVertex returns Vertex from TopoDS
---Purpose: Returns the Vertex of <me> located in <d1><d2><d3> ---Purpose: Returns the Vertex of <me> located in <d1><d2><d3>
-- direction. -- direction.
-- --
@@ -224,7 +225,7 @@ is
raises DomainError raises DomainError
is static; is static;
Point(me : in out; d1, d2, d3 : Direction from Primitives) Point(me : in out; d1, d2, d3 : Direction from BRepPrim)
returns Pnt from gp returns Pnt from gp
---Purpose: Returns the point of the Vertex of <me> located in ---Purpose: Returns the point of the Vertex of <me> located in
-- <d1><d2><d3> direction. -- <d1><d2><d3> direction.
@@ -232,7 +233,7 @@ is
is static; is static;
fields fields
myBuilder : TheBuilder; myBuilder : Builder from BRepPrim;
myAxes : Ax2 from gp; myAxes : Ax2 from gp;
XMin : Real; XMin : Real;
@@ -248,10 +249,10 @@ fields
-- the Topology -- the Topology
myShell : TheShell; myShell : Shell from TopoDS;
ShellBuilt : Boolean; ShellBuilt : Boolean;
myVertices : TheVertex [8]; myVertices : Vertex from TopoDS [8];
-- 0 : xmin ymin zmin -- 0 : xmin ymin zmin
-- 1 : xmax ymin zmin -- 1 : xmax ymin zmin
-- 2 : xmin ymax zmin -- 2 : xmin ymax zmin
@@ -262,7 +263,7 @@ fields
-- 7 : xmax ymax zmax -- 7 : xmax ymax zmax
VerticesBuilt : Boolean [8]; VerticesBuilt : Boolean [8];
myEdges : TheEdge [12]; myEdges : Edge from TopoDS [12];
-- 0 : xmin ymin -- 0 : xmin ymin
-- 1 : xmax ymin -- 1 : xmax ymin
-- 2 : xmin ymax -- 2 : xmin ymax
@@ -277,7 +278,7 @@ fields
-- 11 : zmax xmax -- 11 : zmax xmax
EdgesBuilt : Boolean [12]; EdgesBuilt : Boolean [12];
myWires : TheWire [6]; myWires : Wire from TopoDS [6];
-- 0 : xmin -- 0 : xmin
-- 1 : xmax -- 1 : xmax
-- 2 : ymin -- 2 : ymin
@@ -286,7 +287,7 @@ fields
-- 5 : zmax -- 5 : zmax
WiresBuilt : Boolean [6]; WiresBuilt : Boolean [6];
myFaces : TheFace [6]; myFaces : Face from TopoDS [6];
-- 0 : xmin -- 0 : xmin
-- 1 : xmax -- 1 : xmax
-- 2 : ymin -- 2 : ymin
@@ -303,4 +304,4 @@ fields
-- 4 : zmin -- 4 : zmin
-- 5 : zmax -- 5 : zmax
end Wedge; end GWedge;

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <BRepPrim_GWedge.ixx>
#include <Precision.hxx> #include <Precision.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
@@ -21,6 +23,14 @@
#include <ElSLib.hxx> #include <ElSLib.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRepPrim_Builder.hxx>
#include <BRepPrim_Direction.hxx>
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
#include <Standard_OutOfRange.hxx> #include <Standard_OutOfRange.hxx>
@@ -45,41 +55,41 @@ static const Standard_Integer tab[6][6] = {{-1,-1, 0, 1, 8, 9},
{ 9,11, 5, 7,-1,-1}}; { 9,11, 5, 7,-1,-1}};
//======================================================================= //=======================================================================
//function : Primitives_Wedge_NumDir1 //function : BRepPrim_Wedge_NumDir1
//purpose : when giving a direction return the range of the face //purpose : when giving a direction return the range of the face
//======================================================================= //=======================================================================
static Standard_Integer Primitives_Wedge_NumDir1 static Standard_Integer BRepPrim_Wedge_NumDir1
(const Primitives_Direction d1) { return num[d1]; } (const BRepPrim_Direction d1) { return num[d1]; }
//======================================================================= //=======================================================================
//function : Primitives_Wedge_NumDir2 //function : BRepPrim_Wedge_NumDir2
//purpose : when giving two directions return the range of the edge //purpose : when giving two directions return the range of the edge
//======================================================================= //=======================================================================
static Standard_Integer Primitives_Wedge_NumDir2 static Standard_Integer BRepPrim_Wedge_NumDir2
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2) const BRepPrim_Direction d2)
{ {
Standard_Integer i1 = Primitives_Wedge_NumDir1(d1); Standard_Integer i1 = BRepPrim_Wedge_NumDir1(d1);
Standard_Integer i2 = Primitives_Wedge_NumDir1(d2); Standard_Integer i2 = BRepPrim_Wedge_NumDir1(d2);
if ( i1/2 == i2/2 ) Standard_DomainError::Raise(); if ( i1/2 == i2/2 ) Standard_DomainError::Raise();
return tab[i1][i2]; return tab[i1][i2];
} }
//======================================================================= //=======================================================================
//function : Primitives_Wedge_NumDir3 //function : BRepPrim_Wedge_NumDir3
//purpose : when giving three directions return the range of the vertex //purpose : when giving three directions return the range of the vertex
//======================================================================= //=======================================================================
static Standard_Integer Primitives_Wedge_NumDir3 static Standard_Integer BRepPrim_Wedge_NumDir3
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2, const BRepPrim_Direction d2,
const Primitives_Direction d3) const BRepPrim_Direction d3)
{ {
Standard_Integer i1 = Primitives_Wedge_NumDir1(d1); Standard_Integer i1 = BRepPrim_Wedge_NumDir1(d1);
Standard_Integer i2 = Primitives_Wedge_NumDir1(d2); Standard_Integer i2 = BRepPrim_Wedge_NumDir1(d2);
Standard_Integer i3 = Primitives_Wedge_NumDir1(d3); Standard_Integer i3 = BRepPrim_Wedge_NumDir1(d3);
if (( i1/2 == i2/2 ) || if (( i1/2 == i2/2 ) ||
( i2/2 == i3/2 ) || ( i2/2 == i3/2 ) ||
( i3/2 == i1/2 )) Standard_DomainError::Raise(); ( i3/2 == i1/2 )) Standard_DomainError::Raise();
@@ -87,11 +97,11 @@ static Standard_Integer Primitives_Wedge_NumDir3
} }
//======================================================================= //=======================================================================
//function : Primitives_Wedge_Check //function : BRepPrim_Wedge_Check
//purpose : raise Standard_DomainError if something was built //purpose : raise Standard_DomainError if something was built
//======================================================================= //=======================================================================
static void Primitives_Wedge_Check(const Standard_Boolean V[], static void BRepPrim_Wedge_Check(const Standard_Boolean V[],
const Standard_Boolean E[], const Standard_Boolean E[],
const Standard_Boolean W[], const Standard_Boolean W[],
const Standard_Boolean F[]) const Standard_Boolean F[])
@@ -108,11 +118,11 @@ static void Primitives_Wedge_Check(const Standard_Boolean V[],
} }
//======================================================================= //=======================================================================
//function : Primitives_Wedge_Init //function : BRepPrim_Wedge_Init
//purpose : Set arrays to Standard_False //purpose : Set arrays to Standard_False
//======================================================================= //=======================================================================
static void Primitives_Wedge_Init(Standard_Boolean& S, static void BRepPrim_Wedge_Init(Standard_Boolean& S,
Standard_Boolean V[], Standard_Boolean V[],
Standard_Boolean E[], Standard_Boolean E[],
Standard_Boolean W[], Standard_Boolean W[],
@@ -131,11 +141,11 @@ static void Primitives_Wedge_Init(Standard_Boolean& S,
} }
//======================================================================= //=======================================================================
//function : Primitives_Wedge //function : BRepPrim_GWedge
//purpose : build a box //purpose : build a box
//======================================================================= //=======================================================================
Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B,
const gp_Ax2& Axes, const gp_Ax2& Axes,
const Standard_Real dx, const Standard_Real dx,
const Standard_Real dy, const Standard_Real dy,
@@ -158,16 +168,16 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B,
( dy <= Precision::Confusion() ) || ( dy <= Precision::Confusion() ) ||
( dz <= Precision::Confusion() ) ) ( dz <= Precision::Confusion() ) )
Standard_DomainError::Raise(); Standard_DomainError::Raise();
Primitives_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt); WiresBuilt,FacesBuilt);
} }
//======================================================================= //=======================================================================
//function : Primitives_Wedge //function : BRepPrim_GWedge
//purpose : build a STEP wedge //purpose : build a STEP wedge
//======================================================================= //=======================================================================
Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B,
const gp_Ax2& Axes, const gp_Ax2& Axes,
const Standard_Real dx, const Standard_Real dx,
const Standard_Real dy, const Standard_Real dy,
@@ -192,16 +202,16 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B,
( dz <= Precision::Confusion() ) || ( dz <= Precision::Confusion() ) ||
( ltx < 0 ) ) ( ltx < 0 ) )
Standard_DomainError::Raise(); Standard_DomainError::Raise();
Primitives_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt); WiresBuilt,FacesBuilt);
} }
//======================================================================= //=======================================================================
//function : Primitives_Wedge //function : BRepPrim_GWedge
//purpose : build a wedge by giving all the fields //purpose : build a wedge by giving all the fields
//======================================================================= //=======================================================================
Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B,
const gp_Ax2& Axes, const gp_Ax2& Axes,
const Standard_Real xmin, const Standard_Real xmin,
const Standard_Real ymin, const Standard_Real ymin,
@@ -233,7 +243,7 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B,
( Z2Max-Z2Min < 0 ) || ( Z2Max-Z2Min < 0 ) ||
( X2Max-X2Min < 0 ) ) ( X2Max-X2Min < 0 ) )
Standard_DomainError::Raise(); Standard_DomainError::Raise();
Primitives_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt); WiresBuilt,FacesBuilt);
} }
@@ -244,27 +254,27 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B,
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
gp_Ax2 Primitives_Wedge::Axes () const { return myAxes; } gp_Ax2 BRepPrim_GWedge::Axes () const { return myAxes; }
Standard_Real Primitives_Wedge::GetXMin () const { return XMin; } Standard_Real BRepPrim_GWedge::GetXMin () const { return XMin; }
Standard_Real Primitives_Wedge::GetYMin () const { return YMin; } Standard_Real BRepPrim_GWedge::GetYMin () const { return YMin; }
Standard_Real Primitives_Wedge::GetZMin () const { return ZMin; } Standard_Real BRepPrim_GWedge::GetZMin () const { return ZMin; }
Standard_Real Primitives_Wedge::GetZ2Min () const { return Z2Min; } Standard_Real BRepPrim_GWedge::GetZ2Min () const { return Z2Min; }
Standard_Real Primitives_Wedge::GetX2Min () const { return X2Min; } Standard_Real BRepPrim_GWedge::GetX2Min () const { return X2Min; }
Standard_Real Primitives_Wedge::GetXMax () const { return XMax; } Standard_Real BRepPrim_GWedge::GetXMax () const { return XMax; }
Standard_Real Primitives_Wedge::GetYMax () const { return YMax; } Standard_Real BRepPrim_GWedge::GetYMax () const { return YMax; }
Standard_Real Primitives_Wedge::GetZMax () const { return ZMax; } Standard_Real BRepPrim_GWedge::GetZMax () const { return ZMax; }
Standard_Real Primitives_Wedge::GetZ2Max () const { return Z2Max; } Standard_Real BRepPrim_GWedge::GetZ2Max () const { return Z2Max; }
Standard_Real Primitives_Wedge::GetX2Max () const { return X2Max; } Standard_Real BRepPrim_GWedge::GetX2Max () const { return X2Max; }
//======================================================================= //=======================================================================
//function : Open //function : Open
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
void Primitives_Wedge::Open (const Primitives_Direction d1) void BRepPrim_GWedge::Open (const BRepPrim_Direction d1)
{ {
Primitives_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); BRepPrim_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt);
myInfinite[Primitives_Wedge_NumDir1(d1)] = Standard_True; myInfinite[BRepPrim_Wedge_NumDir1(d1)] = Standard_True;
} }
//======================================================================= //=======================================================================
@@ -272,10 +282,10 @@ void Primitives_Wedge::Open (const Primitives_Direction d1)
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
void Primitives_Wedge::Close (const Primitives_Direction d1) void BRepPrim_GWedge::Close (const BRepPrim_Direction d1)
{ {
Primitives_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); BRepPrim_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt);
myInfinite[Primitives_Wedge_NumDir1(d1)] = Standard_False; myInfinite[BRepPrim_Wedge_NumDir1(d1)] = Standard_False;
} }
//======================================================================= //=======================================================================
@@ -283,30 +293,30 @@ void Primitives_Wedge::Close (const Primitives_Direction d1)
//purpose : true if it is open in the given direction //purpose : true if it is open in the given direction
//======================================================================= //=======================================================================
Standard_Boolean Primitives_Wedge::IsInfinite (const Primitives_Direction d1) const Standard_Boolean BRepPrim_GWedge::IsInfinite (const BRepPrim_Direction d1) const
{ return myInfinite[Primitives_Wedge_NumDir1(d1)]; } { return myInfinite[BRepPrim_Wedge_NumDir1(d1)]; }
//======================================================================= //=======================================================================
//function : Shell //function : Shell
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheShell& Primitives_Wedge::Shell() { const TopoDS_Shell& BRepPrim_GWedge::Shell() {
if (!ShellBuilt) { if (!ShellBuilt) {
myBuilder.MakeShell(myShell); myBuilder.MakeShell(myShell);
if (HasFace(Primitives_XMin)) if (HasFace(BRepPrim_XMin))
myBuilder.AddShellFace(myShell,Face(Primitives_XMin)); myBuilder.AddShellFace(myShell,Face(BRepPrim_XMin));
if (HasFace(Primitives_XMax)) if (HasFace(BRepPrim_XMax))
myBuilder.AddShellFace(myShell,Face(Primitives_XMax)); myBuilder.AddShellFace(myShell,Face(BRepPrim_XMax));
if (HasFace(Primitives_YMin)) if (HasFace(BRepPrim_YMin))
myBuilder.AddShellFace(myShell,Face(Primitives_YMin)); myBuilder.AddShellFace(myShell,Face(BRepPrim_YMin));
if (HasFace(Primitives_YMax)) if (HasFace(BRepPrim_YMax))
myBuilder.AddShellFace(myShell,Face(Primitives_YMax)); myBuilder.AddShellFace(myShell,Face(BRepPrim_YMax));
if (HasFace(Primitives_ZMin)) if (HasFace(BRepPrim_ZMin))
myBuilder.AddShellFace(myShell,Face(Primitives_ZMin)); myBuilder.AddShellFace(myShell,Face(BRepPrim_ZMin));
if (HasFace(Primitives_ZMax)) if (HasFace(BRepPrim_ZMax))
myBuilder.AddShellFace(myShell,Face(Primitives_ZMax)); myBuilder.AddShellFace(myShell,Face(BRepPrim_ZMax));
myBuilder.CompleteShell(myShell); myBuilder.CompleteShell(myShell);
ShellBuilt = Standard_True; ShellBuilt = Standard_True;
@@ -319,10 +329,10 @@ const TheShell& Primitives_Wedge::Shell() {
//purpose : true if the face exist in one direction //purpose : true if the face exist in one direction
//======================================================================= //=======================================================================
Standard_Boolean Primitives_Wedge::HasFace (const Primitives_Direction d1) const Standard_Boolean BRepPrim_GWedge::HasFace (const BRepPrim_Direction d1) const
{ {
Standard_Boolean state = !myInfinite[Primitives_Wedge_NumDir1(d1)]; Standard_Boolean state = !myInfinite[BRepPrim_Wedge_NumDir1(d1)];
if ( d1 == Primitives_YMax ) state = state && ( Z2Max != Z2Min ) if ( d1 == BRepPrim_YMax ) state = state && ( Z2Max != Z2Min )
&& ( X2Max != X2Min ); && ( X2Max != X2Min );
return state; return state;
} }
@@ -332,10 +342,10 @@ Standard_Boolean Primitives_Wedge::HasFace (const Primitives_Direction d1) const
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pln Primitives_Wedge::Plane(const Primitives_Direction d1) gp_Pln BRepPrim_GWedge::Plane(const BRepPrim_Direction d1)
{ {
Standard_Integer i = Primitives_Wedge_NumDir1(d1); Standard_Integer i = BRepPrim_Wedge_NumDir1(d1);
gp_Dir D; gp_Dir D;
gp_Vec VX = myAxes.XDirection(); gp_Vec VX = myAxes.XDirection();
@@ -422,11 +432,11 @@ gp_Pln Primitives_Wedge::Plane(const Primitives_Direction d1)
//purpose : the face in one direction //purpose : the face in one direction
//======================================================================= //=======================================================================
const TheFace& Primitives_Wedge::Face const TopoDS_Face& BRepPrim_GWedge::Face
(const Primitives_Direction d1) (const BRepPrim_Direction d1)
{ {
Standard_Integer i = Primitives_Wedge_NumDir1(d1); Standard_Integer i = BRepPrim_Wedge_NumDir1(d1);
if (!FacesBuilt[i]) { if (!FacesBuilt[i]) {
gp_Pln P = Plane(d1); gp_Pln P = Plane(d1);
@@ -436,33 +446,33 @@ const TheFace& Primitives_Wedge::Face
// pcurves // pcurves
Primitives_Direction dd1 = Primitives_ZMin, dd2 = Primitives_YMax, BRepPrim_Direction dd1 = BRepPrim_ZMin, dd2 = BRepPrim_YMax,
dd3 = Primitives_ZMax,dd4 = Primitives_YMin; dd3 = BRepPrim_ZMax,dd4 = BRepPrim_YMin;
switch (i/2) { switch (i/2) {
case 0 : case 0 :
// XMin XMax // XMin XMax
dd1 = Primitives_ZMin; dd1 = BRepPrim_ZMin;
dd2 = Primitives_YMax; dd2 = BRepPrim_YMax;
dd3 = Primitives_ZMax; dd3 = BRepPrim_ZMax;
dd4 = Primitives_YMin; dd4 = BRepPrim_YMin;
break; break;
case 1 : case 1 :
// YMin YMax // YMin YMax
dd1 = Primitives_XMin; dd1 = BRepPrim_XMin;
dd2 = Primitives_ZMax; dd2 = BRepPrim_ZMax;
dd3 = Primitives_XMax; dd3 = BRepPrim_XMax;
dd4 = Primitives_ZMin; dd4 = BRepPrim_ZMin;
break; break;
case 2 : case 2 :
// ZMin ZMax // ZMin ZMax
dd1 = Primitives_YMin; dd1 = BRepPrim_YMin;
dd2 = Primitives_XMax; dd2 = BRepPrim_XMax;
dd3 = Primitives_YMax; dd3 = BRepPrim_YMax;
dd4 = Primitives_XMin; dd4 = BRepPrim_XMin;
break; break;
}; };
@@ -476,7 +486,7 @@ const TheFace& Primitives_Wedge::Face
ElSLib::Parameters(P,L.Location(),U,V); ElSLib::Parameters(P,L.Location(),U,V);
DU = L.Direction() * DX; DU = L.Direction() * DX;
DV = L.Direction() * DY; DV = L.Direction() * DY;
myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd4)], myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd4)],
myFaces[i], myFaces[i],
gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV)));
} }
@@ -485,7 +495,7 @@ const TheFace& Primitives_Wedge::Face
ElSLib::Parameters(P,L.Location(),U,V); ElSLib::Parameters(P,L.Location(),U,V);
DU = L.Direction() * DX; DU = L.Direction() * DX;
DV = L.Direction() * DY; DV = L.Direction() * DY;
myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd3)], myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd3)],
myFaces[i], myFaces[i],
gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV)));
} }
@@ -495,7 +505,7 @@ const TheFace& Primitives_Wedge::Face
ElSLib::Parameters(P,L.Location(),U,V); ElSLib::Parameters(P,L.Location(),U,V);
DU = L.Direction() * DX; DU = L.Direction() * DX;
DV = L.Direction() * DY; DV = L.Direction() * DY;
myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd2)], myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd2)],
myFaces[i], myFaces[i],
gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV)));
} }
@@ -505,7 +515,7 @@ const TheFace& Primitives_Wedge::Face
ElSLib::Parameters(P,L.Location(),U,V); ElSLib::Parameters(P,L.Location(),U,V);
DU = L.Direction() * DX; DU = L.Direction() * DX;
DV = L.Direction() * DY; DV = L.Direction() * DY;
myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd1)], myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd1)],
myFaces[i], myFaces[i],
gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV)));
} }
@@ -524,37 +534,37 @@ const TheFace& Primitives_Wedge::Face
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
Standard_Boolean Primitives_Wedge::HasWire (const Primitives_Direction d1) const Standard_Boolean BRepPrim_GWedge::HasWire (const BRepPrim_Direction d1) const
{ {
Standard_Integer i = Primitives_Wedge_NumDir1(d1); Standard_Integer i = BRepPrim_Wedge_NumDir1(d1);
if (myInfinite[i]) return Standard_False; if (myInfinite[i]) return Standard_False;
Primitives_Direction dd1 = Primitives_XMin,dd2 = Primitives_YMax,dd3 = Primitives_XMax ,dd4 = Primitives_ZMin; BRepPrim_Direction dd1 = BRepPrim_XMin,dd2 = BRepPrim_YMax,dd3 = BRepPrim_XMax ,dd4 = BRepPrim_ZMin;
switch (i/2) { switch (i/2) {
case 0 : case 0 :
// XMin XMax // XMin XMax
dd1 = Primitives_ZMin; dd1 = BRepPrim_ZMin;
dd2 = Primitives_YMax; dd2 = BRepPrim_YMax;
dd3 = Primitives_ZMax; dd3 = BRepPrim_ZMax;
dd4 = Primitives_YMin; dd4 = BRepPrim_YMin;
break; break;
case 1 : case 1 :
// YMin YMax // YMin YMax
dd1 = Primitives_XMin; dd1 = BRepPrim_XMin;
dd2 = Primitives_ZMax; dd2 = BRepPrim_ZMax;
dd3 = Primitives_XMax; dd3 = BRepPrim_XMax;
dd4 = Primitives_ZMin; dd4 = BRepPrim_ZMin;
break; break;
case 2 : case 2 :
// ZMin ZMax // ZMin ZMax
dd1 = Primitives_YMin; dd1 = BRepPrim_YMin;
dd2 = Primitives_XMax; dd2 = BRepPrim_XMax;
dd3 = Primitives_YMax; dd3 = BRepPrim_YMax;
dd4 = Primitives_XMin; dd4 = BRepPrim_XMin;
break; break;
#ifndef DEB #ifndef DEB
default: default:
@@ -571,12 +581,12 @@ Standard_Boolean Primitives_Wedge::HasWire (const Primitives_Direction d1) const
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
const TheWire& Primitives_Wedge::Wire const TopoDS_Wire& BRepPrim_GWedge::Wire
(const Primitives_Direction d1) (const BRepPrim_Direction d1)
{ {
Standard_Integer i = Primitives_Wedge_NumDir1(d1); Standard_Integer i = BRepPrim_Wedge_NumDir1(d1);
Primitives_Direction dd1 = Primitives_XMin,dd2 = Primitives_YMax,dd3 = Primitives_XMax ,dd4 = Primitives_ZMin; BRepPrim_Direction dd1 = BRepPrim_XMin,dd2 = BRepPrim_YMax,dd3 = BRepPrim_XMax ,dd4 = BRepPrim_ZMin;
if (!WiresBuilt[i]) { if (!WiresBuilt[i]) {
@@ -584,26 +594,26 @@ const TheWire& Primitives_Wedge::Wire
case 0 : case 0 :
// XMin XMax // XMin XMax
dd1 = Primitives_ZMin; dd1 = BRepPrim_ZMin;
dd2 = Primitives_YMax; dd2 = BRepPrim_YMax;
dd3 = Primitives_ZMax; dd3 = BRepPrim_ZMax;
dd4 = Primitives_YMin; dd4 = BRepPrim_YMin;
break; break;
case 1 : case 1 :
// YMin YMax // YMin YMax
dd1 = Primitives_XMin; dd1 = BRepPrim_XMin;
dd2 = Primitives_ZMax; dd2 = BRepPrim_ZMax;
dd3 = Primitives_XMax; dd3 = BRepPrim_XMax;
dd4 = Primitives_ZMin; dd4 = BRepPrim_ZMin;
break; break;
case 2 : case 2 :
// ZMin ZMax // ZMin ZMax
dd1 = Primitives_YMin; dd1 = BRepPrim_YMin;
dd2 = Primitives_XMax; dd2 = BRepPrim_XMax;
dd3 = Primitives_YMax; dd3 = BRepPrim_YMax;
dd4 = Primitives_XMin; dd4 = BRepPrim_XMin;
break; break;
default: default:
break; break;
@@ -633,12 +643,12 @@ const TheWire& Primitives_Wedge::Wire
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
Standard_Boolean Primitives_Wedge::HasEdge (const Primitives_Direction d1, Standard_Boolean BRepPrim_GWedge::HasEdge (const BRepPrim_Direction d1,
const Primitives_Direction d2) const const BRepPrim_Direction d2) const
{ {
Standard_Boolean state = !(myInfinite[Primitives_Wedge_NumDir1(d1)] || Standard_Boolean state = !(myInfinite[BRepPrim_Wedge_NumDir1(d1)] ||
myInfinite[Primitives_Wedge_NumDir1(d2)]); myInfinite[BRepPrim_Wedge_NumDir1(d2)]);
Standard_Integer i = Primitives_Wedge_NumDir2(d1,d2); Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2);
if ( i == 6 || i == 7 ) state = state && ( X2Max != X2Min ); if ( i == 6 || i == 7 ) state = state && ( X2Max != X2Min );
else if ( i == 1 || i == 3 ) state = state && ( Z2Max != Z2Min ); else if ( i == 1 || i == 3 ) state = state && ( Z2Max != Z2Min );
return state; return state;
@@ -649,13 +659,13 @@ Standard_Boolean Primitives_Wedge::HasEdge (const Primitives_Direction d1,
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
gp_Lin Primitives_Wedge::Line gp_Lin BRepPrim_GWedge::Line
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2) const BRepPrim_Direction d2)
{ {
if (!HasEdge(d1,d2)) Standard_DomainError::Raise(); if (!HasEdge(d1,d2)) Standard_DomainError::Raise();
Standard_Integer i = Primitives_Wedge_NumDir2(d1,d2); Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2);
Standard_Real X =0., Y =0., Z =0.; Standard_Real X =0., Y =0., Z =0.;
@@ -790,33 +800,33 @@ gp_Lin Primitives_Wedge::Line
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
const TheEdge& Primitives_Wedge::Edge const TopoDS_Edge& BRepPrim_GWedge::Edge
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2) const BRepPrim_Direction d2)
{ {
if (!HasEdge(d1,d2)) Standard_DomainError::Raise(); if (!HasEdge(d1,d2)) Standard_DomainError::Raise();
Standard_Integer i = Primitives_Wedge_NumDir2(d1,d2); Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2);
if (!EdgesBuilt[i]) { if (!EdgesBuilt[i]) {
Primitives_Direction dd1 = Primitives_XMin ,dd2 = Primitives_XMax; BRepPrim_Direction dd1 = BRepPrim_XMin ,dd2 = BRepPrim_XMax;
switch (i/4) { switch (i/4) {
case 0 : case 0 :
dd1 = Primitives_ZMin; dd1 = BRepPrim_ZMin;
dd2 = Primitives_ZMax; dd2 = BRepPrim_ZMax;
break; break;
case 1 : case 1 :
dd1 = Primitives_XMin; dd1 = BRepPrim_XMin;
dd2 = Primitives_XMax; dd2 = BRepPrim_XMax;
break; break;
case 2 : case 2 :
dd1 = Primitives_YMin; dd1 = BRepPrim_YMin;
dd2 = Primitives_YMax; dd2 = BRepPrim_YMax;
break; break;
default: default:
@@ -871,27 +881,27 @@ const TheEdge& Primitives_Wedge::Edge
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
Standard_Boolean Primitives_Wedge::HasVertex Standard_Boolean BRepPrim_GWedge::HasVertex
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2, const BRepPrim_Direction d2,
const Primitives_Direction d3) const const BRepPrim_Direction d3) const
{ return !(myInfinite[Primitives_Wedge_NumDir1(d1)] || { return !(myInfinite[BRepPrim_Wedge_NumDir1(d1)] ||
myInfinite[Primitives_Wedge_NumDir1(d2)] || myInfinite[BRepPrim_Wedge_NumDir1(d2)] ||
myInfinite[Primitives_Wedge_NumDir1(d3)]); } myInfinite[BRepPrim_Wedge_NumDir1(d3)]); }
//======================================================================= //=======================================================================
//function : Point //function : Point
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
gp_Pnt Primitives_Wedge::Point gp_Pnt BRepPrim_GWedge::Point
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2, const BRepPrim_Direction d2,
const Primitives_Direction d3) const BRepPrim_Direction d3)
{ {
if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise(); if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise();
Standard_Integer i = Primitives_Wedge_NumDir3(d1,d2,d3); Standard_Integer i = BRepPrim_Wedge_NumDir3(d1,d2,d3);
Standard_Real X =0., Y =0., Z =0.; Standard_Real X =0., Y =0., Z =0.;
@@ -959,14 +969,14 @@ gp_Pnt Primitives_Wedge::Point
//purpose : trivial //purpose : trivial
//======================================================================= //=======================================================================
const TheVertex& Primitives_Wedge::Vertex const TopoDS_Vertex& BRepPrim_GWedge::Vertex
(const Primitives_Direction d1, (const BRepPrim_Direction d1,
const Primitives_Direction d2, const BRepPrim_Direction d2,
const Primitives_Direction d3) const BRepPrim_Direction d3)
{ {
if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise(); if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise();
Standard_Integer i = Primitives_Wedge_NumDir3(d1,d2,d3); Standard_Integer i = BRepPrim_Wedge_NumDir3(d1,d2,d3);
if (!VerticesBuilt[i]) { if (!VerticesBuilt[i]) {

View File

@@ -14,13 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
deferred generic class OneAxis from Primitives( deferred class OneAxis from BRepPrim
TheShell as any;
TheFace as any;
TheWire as any;
TheEdge as any;
TheVertex as any;
TheBuilder as any)
---Purpose: Algorithm to build primitives with one axis of ---Purpose: Algorithm to build primitives with one axis of
-- revolution. -- revolution.
@@ -59,8 +53,14 @@ deferred generic class OneAxis from Primitives(
uses uses
Ax2 from gp, Ax2 from gp,
Pnt2d from gp Pnt2d from gp,
Shell from TopoDS,
Face from TopoDS,
Wire from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Builder from BRepPrim
raises raises
DomainError, DomainError,
@@ -70,7 +70,7 @@ is
Delete(me:out) is virtual ; Delete(me:out) is virtual ;
---C++: alias ~ ---C++: alias ~
Initialize(B : TheBuilder; Initialize(B : Builder from BRepPrim;
A : Ax2 from gp; A : Ax2 from gp;
VMin, VMax : Real from Standard); VMin, VMax : Real from Standard);
---Purpose: Creates a OneAxis algorithm. <B> is used to build ---Purpose: Creates a OneAxis algorithm. <B> is used to build
@@ -120,7 +120,7 @@ is
-- They should be redefined in inherited classes -- They should be redefined in inherited classes
-- --
MakeEmptyLateralFace(me) returns TheFace MakeEmptyLateralFace(me) returns Face from TopoDS
---Purpose: Returns a face with no edges. The surface is the ---Purpose: Returns a face with no edges. The surface is the
-- lateral surface with normals pointing outward. The -- lateral surface with normals pointing outward. The
-- U parameter is the angle with the origin on the X -- U parameter is the angle with the origin on the X
@@ -128,13 +128,13 @@ is
-- meridian. -- meridian.
is deferred; is deferred;
MakeEmptyMeridianEdge(me; Ang : Real) returns TheEdge MakeEmptyMeridianEdge(me; Ang : Real) returns Edge from TopoDS
---Purpose: Returns an edge with a 3D curve made from the ---Purpose: Returns an edge with a 3D curve made from the
-- meridian in the XZ plane rotated by <Ang> around -- meridian in the XZ plane rotated by <Ang> around
-- the Z-axis. Ang may be 0 or myAngle. -- the Z-axis. Ang may be 0 or myAngle.
is deferred; is deferred;
SetMeridianPCurve(me; E : in out TheEdge; F : TheFace) SetMeridianPCurve(me; E : in out Edge from TopoDS; F : Face from TopoDS)
---Purpose: Sets the parametric curve of the edge <E> in the ---Purpose: Sets the parametric curve of the edge <E> in the
-- face <F> to be the 2d representation of the -- face <F> to be the 2d representation of the
-- meridian. -- meridian.
@@ -199,7 +199,7 @@ is
-- --
-- the shell -- the shell
Shell(me : in out) returns TheShell Shell(me : in out) returns Shell from TopoDS
---Purpose: Returns the Shell containing all the Faces of the ---Purpose: Returns the Shell containing all the Faces of the
-- primitive. -- primitive.
-- --
@@ -208,14 +208,14 @@ is
-- the Faces -- the Faces
LateralFace(me : in out) returns TheFace LateralFace(me : in out) returns Face from TopoDS
---Purpose: Returns the lateral Face. It is oriented toward ---Purpose: Returns the lateral Face. It is oriented toward
-- the outside of the primitive. -- the outside of the primitive.
-- --
---C++: return const & ---C++: return const &
is static; is static;
TopFace(me : in out) returns TheFace TopFace(me : in out) returns Face from TopoDS
---Purpose: Returns the top planar Face. It is Oriented ---Purpose: Returns the top planar Face. It is Oriented
-- toward the +Z axis (outside). -- toward the +Z axis (outside).
-- --
@@ -223,7 +223,7 @@ is
raises DomainError -- if !HasTop() raises DomainError -- if !HasTop()
is static; is static;
BottomFace(me : in out) returns TheFace BottomFace(me : in out) returns Face from TopoDS
---Purpose: Returns the Bottom planar Face. It is Oriented ---Purpose: Returns the Bottom planar Face. It is Oriented
-- toward the -Z axis (outside). -- toward the -Z axis (outside).
-- --
@@ -231,7 +231,7 @@ is
raises DomainError -- if !HasBottom() raises DomainError -- if !HasBottom()
is static; is static;
StartFace(me : in out) returns TheFace StartFace(me : in out) returns Face from TopoDS
---Purpose: Returns the Face starting the slice, it is ---Purpose: Returns the Face starting the slice, it is
-- oriented toward the exterior of the primitive. -- oriented toward the exterior of the primitive.
-- --
@@ -239,7 +239,7 @@ is
raises DomainError -- if !HasSides() raises DomainError -- if !HasSides()
is static; is static;
EndFace(me : in out) returns TheFace EndFace(me : in out) returns Face from TopoDS
---Purpose: Returns the Face ending the slice, it is oriented ---Purpose: Returns the Face ending the slice, it is oriented
-- toward the exterior of the primitive. -- toward the exterior of the primitive.
-- --
@@ -249,14 +249,14 @@ is
-- Wires -- Wires
LateralWire(me : in out) returns TheWire LateralWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire in the lateral face. ---Purpose: Returns the wire in the lateral face.
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if VMinInfinite() && VMaxInfinite() raises DomainError -- if VMinInfinite() && VMaxInfinite()
is static; is static;
LateralStartWire(me : in out) returns TheWire LateralStartWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire in the lateral face with the ---Purpose: Returns the wire in the lateral face with the
-- start edge. -- start edge.
-- --
@@ -264,7 +264,7 @@ is
raises DomainError -- if ! (VMinInfinite() && VMaxInfinite()) raises DomainError -- if ! (VMinInfinite() && VMaxInfinite())
is static; is static;
LateralEndWire(me : in out) returns TheWire LateralEndWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire with in lateral face with the end ---Purpose: Returns the wire with in lateral face with the end
-- edge. -- edge.
-- --
@@ -272,28 +272,28 @@ is
raises DomainError -- if ! (VMinInfinite() && VMaxInfinite()) raises DomainError -- if ! (VMinInfinite() && VMaxInfinite())
is static; is static;
TopWire(me : in out) returns TheWire TopWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire in the top face. ---Purpose: Returns the wire in the top face.
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if !HasTop() raises DomainError -- if !HasTop()
is static; is static;
BottomWire(me : in out) returns TheWire BottomWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire in the bottom face. ---Purpose: Returns the wire in the bottom face.
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if !HasBottom() raises DomainError -- if !HasBottom()
is static; is static;
StartWire(me : in out) returns TheWire StartWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire in the start face. ---Purpose: Returns the wire in the start face.
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if !HasSides() raises DomainError -- if !HasSides()
is static; is static;
AxisStartWire(me : in out) returns TheWire AxisStartWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the wire in the start face with the ---Purpose: Returns the wire in the start face with the
-- AxisEdge. -- AxisEdge.
-- --
@@ -301,14 +301,14 @@ is
raises DomainError -- if !HasSides() ! (VMinInfinite() && VMaxInfinite()) raises DomainError -- if !HasSides() ! (VMinInfinite() && VMaxInfinite())
is static; is static;
EndWire(me : in out) returns TheWire EndWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the Wire in the end face. ---Purpose: Returns the Wire in the end face.
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if !HasSides() raises DomainError -- if !HasSides()
is static; is static;
AxisEndWire(me : in out) returns TheWire AxisEndWire(me : in out) returns Wire from TopoDS
---Purpose: Returns the Wire in the end face with the ---Purpose: Returns the Wire in the end face with the
-- AxisEdge. -- AxisEdge.
-- --
@@ -319,7 +319,7 @@ is
-- Edges -- Edges
AxisEdge(me : in out) returns TheEdge AxisEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the Edge built along the Axis and oriented ---Purpose: Returns the Edge built along the Axis and oriented
-- on +Z of the Axis. -- on +Z of the Axis.
-- --
@@ -327,20 +327,20 @@ is
raises DomainError -- if ! (MeridianOnAxis(VMin) || MeridianOnAxis(VMax)) raises DomainError -- if ! (MeridianOnAxis(VMin) || MeridianOnAxis(VMax))
is static; is static;
StartEdge(me : in out) returns TheEdge StartEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the Edge at angle 0. ---Purpose: Returns the Edge at angle 0.
-- --
---C++: return const & ---C++: return const &
is static; is static;
EndEdge(me : in out) returns TheEdge EndEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the Edge at angle Angle. If !HasSides() ---Purpose: Returns the Edge at angle Angle. If !HasSides()
-- the StartEdge and the EndEdge are the same edge. -- the StartEdge and the EndEdge are the same edge.
-- --
---C++: return const & ---C++: return const &
is static; is static;
StartTopEdge(me : in out) returns TheEdge StartTopEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the linear Edge between start Face and top ---Purpose: Returns the linear Edge between start Face and top
-- Face. -- Face.
-- --
@@ -348,7 +348,7 @@ is
raises DomainError -- if ! (HasTop() && HasSides()) raises DomainError -- if ! (HasTop() && HasSides())
is static; is static;
StartBottomEdge(me : in out) returns TheEdge StartBottomEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the linear Edge between start Face and ---Purpose: Returns the linear Edge between start Face and
-- bottom Face. -- bottom Face.
-- --
@@ -356,7 +356,7 @@ is
raises DomainError -- if ! (HasBottom() && HasSides()) raises DomainError -- if ! (HasBottom() && HasSides())
is static; is static;
EndTopEdge(me : in out) returns TheEdge EndTopEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the linear Edge between end Face and top ---Purpose: Returns the linear Edge between end Face and top
-- Face. -- Face.
-- --
@@ -364,7 +364,7 @@ is
raises DomainError -- if ! (HasTop() && HasSides()) raises DomainError -- if ! (HasTop() && HasSides())
is static; is static;
EndBottomEdge(me : in out) returns TheEdge EndBottomEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the linear Edge between end Face and ---Purpose: Returns the linear Edge between end Face and
-- bottom Face. -- bottom Face.
-- --
@@ -372,7 +372,7 @@ is
raises DomainError -- if ! (HasBottom() && HasSides()) raises DomainError -- if ! (HasBottom() && HasSides())
is static; is static;
TopEdge(me : in out) returns TheEdge TopEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the edge at VMax. If MeridianClosed() the ---Purpose: Returns the edge at VMax. If MeridianClosed() the
-- TopEdge and the BottomEdge are the same edge. -- TopEdge and the BottomEdge are the same edge.
-- --
@@ -380,7 +380,7 @@ is
raises DomainError -- if VMaxInfinite() raises DomainError -- if VMaxInfinite()
is static; is static;
BottomEdge(me : in out) returns TheEdge BottomEdge(me : in out) returns Edge from TopoDS
---Purpose: Returns the edge at VMin. If MeridianClosed() the ---Purpose: Returns the edge at VMin. If MeridianClosed() the
-- TopEdge and the BottomEdge are the same edge. -- TopEdge and the BottomEdge are the same edge.
-- --
@@ -390,14 +390,14 @@ is
-- Vertices -- Vertices
AxisTopVertex(me : in out) returns TheVertex AxisTopVertex(me : in out) returns Vertex from TopoDS
---Purpose: Returns the Vertex at the Top altitude on the axis. ---Purpose: Returns the Vertex at the Top altitude on the axis.
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if !MeridianOnAxis(VMax) raises DomainError -- if !MeridianOnAxis(VMax)
is static; is static;
AxisBottomVertex(me : in out) returns TheVertex AxisBottomVertex(me : in out) returns Vertex from TopoDS
---Purpose: Returns the Vertex at the Bottom altitude on the ---Purpose: Returns the Vertex at the Bottom altitude on the
-- axis. -- axis.
-- --
@@ -405,28 +405,28 @@ is
raises DomainError -- if !MeridianOnAxis(VMin) raises DomainError -- if !MeridianOnAxis(VMin)
is static; is static;
TopStartVertex(me : in out) returns TheVertex TopStartVertex(me : in out) returns Vertex from TopoDS
---Purpose: Returns the vertex (0,VMax) ---Purpose: Returns the vertex (0,VMax)
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if VMaxInfinite() raises DomainError -- if VMaxInfinite()
is static; is static;
TopEndVertex(me : in out) returns TheVertex TopEndVertex(me : in out) returns Vertex from TopoDS
---Purpose: Returns the vertex (angle,VMax) ---Purpose: Returns the vertex (angle,VMax)
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if VMaxInfinite() raises DomainError -- if VMaxInfinite()
is static; is static;
BottomStartVertex(me : in out) returns TheVertex BottomStartVertex(me : in out) returns Vertex from TopoDS
---Purpose: Returns the vertex (0,VMin) ---Purpose: Returns the vertex (0,VMin)
-- --
---C++: return const & ---C++: return const &
raises DomainError -- if VMinInfinite() raises DomainError -- if VMinInfinite()
is static; is static;
BottomEndVertex(me : in out) returns TheVertex BottomEndVertex(me : in out) returns Vertex from TopoDS
---Purpose: Returns the vertex (angle,VMax) ---Purpose: Returns the vertex (angle,VMax)
-- --
---C++: return const & ---C++: return const &
@@ -434,7 +434,7 @@ is
is static; is static;
fields fields
myBuilder : TheBuilder is protected; myBuilder : Builder from BRepPrim is protected;
myAxes : Ax2 from gp; myAxes : Ax2 from gp;
myAngle : Real from Standard; myAngle : Real from Standard;
@@ -444,10 +444,10 @@ fields
-- the Topology -- the Topology
myShell : TheShell; myShell : Shell from TopoDS;
ShellBuilt : Boolean; ShellBuilt : Boolean;
myVertices : TheVertex [6]; myVertices : Vertex from TopoDS [6];
-- 0 : Vertex on top of the axis -- 0 : Vertex on top of the axis
-- 1 : on bottom of the axis -- 1 : on bottom of the axis
-- 2 : top, start -- 2 : top, start
@@ -456,7 +456,7 @@ fields
-- 5 : bottom, end -- 5 : bottom, end
VerticesBuilt : Boolean [6]; VerticesBuilt : Boolean [6];
myEdges : TheEdge [9]; myEdges : Edge from TopoDS [9];
-- 0 : Edge on the Axis -- 0 : Edge on the Axis
-- 1 : Start Edge -- 1 : Start Edge
-- 2 : End Edge -- 2 : End Edge
@@ -468,7 +468,7 @@ fields
-- 8 : Bottom -- 8 : Bottom
EdgesBuilt : Boolean [9]; EdgesBuilt : Boolean [9];
myWires : TheWire [9]; myWires : Wire from TopoDS [9];
-- 0 : wire Lateral -- 0 : wire Lateral
-- 1 : Lateral Start -- 1 : Lateral Start
-- 2 : Lateral End -- 2 : Lateral End
@@ -480,7 +480,7 @@ fields
-- 8 : Axis End -- 8 : Axis End
WiresBuilt : Boolean [9]; WiresBuilt : Boolean [9];
myFaces : TheFace [5]; myFaces : Face from TopoDS [5];
-- 0 : Lateral Face -- 0 : Lateral Face
-- 1 : Top -- 1 : Top
-- 2 : Bottom -- 2 : Bottom

View File

@@ -14,8 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <BRepPrim_OneAxis.ixx>
#include <Precision.hxx> #include <Precision.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRepPrim_Builder.hxx>
#include <BRepPrim_Direction.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Lin2d.hxx> #include <gp_Lin2d.hxx>
#include <gp_Circ2d.hxx> #include <gp_Circ2d.hxx>
@@ -68,11 +78,11 @@
#define FEND 4 #define FEND 4
//======================================================================= //=======================================================================
//function : Primitives_OneAxis_Check //function : BRepPrim_OneAxis_Check
//purpose : raise Standard_DomainError if something was built //purpose : raise Standard_DomainError if something was built
//======================================================================= //=======================================================================
static void Primitives_OneAxis_Check(const Standard_Boolean V[], static void BRepPrim_OneAxis_Check(const Standard_Boolean V[],
const Standard_Boolean E[], const Standard_Boolean E[],
const Standard_Boolean W[], const Standard_Boolean W[],
const Standard_Boolean F[]) const Standard_Boolean F[])
@@ -89,11 +99,11 @@ static void Primitives_OneAxis_Check(const Standard_Boolean V[],
} }
//======================================================================= //=======================================================================
//function : Primitives_OneAxis //function : BRepPrim_OneAxis
//purpose : //purpose :
//======================================================================= //=======================================================================
Primitives_OneAxis::Primitives_OneAxis(const TheBuilder& B, BRepPrim_OneAxis::BRepPrim_OneAxis(const BRepPrim_Builder& B,
const gp_Ax2& A, const gp_Ax2& A,
const Standard_Real VMin, const Standard_Real VMin,
const Standard_Real VMax) : const Standard_Real VMax) :
@@ -119,7 +129,7 @@ Primitives_OneAxis::Primitives_OneAxis(const TheBuilder& B,
} }
void Primitives_OneAxis::Delete() void BRepPrim_OneAxis::Delete()
{} {}
//======================================================================= //=======================================================================
@@ -127,7 +137,7 @@ void Primitives_OneAxis::Delete()
//purpose : //purpose :
//======================================================================= //=======================================================================
void Primitives_OneAxis::SetMeridianOffset(const Standard_Real O) void BRepPrim_OneAxis::SetMeridianOffset(const Standard_Real O)
{ {
myMeridianOffset = O; myMeridianOffset = O;
} }
@@ -137,47 +147,47 @@ void Primitives_OneAxis::SetMeridianOffset(const Standard_Real O)
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Ax2& Primitives_OneAxis::Axes () const const gp_Ax2& BRepPrim_OneAxis::Axes () const
{ {
return myAxes; return myAxes;
} }
void Primitives_OneAxis::Axes (const gp_Ax2& A) void BRepPrim_OneAxis::Axes (const gp_Ax2& A)
{ {
Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt);
myAxes = A; myAxes = A;
} }
Standard_Real Primitives_OneAxis::Angle () const Standard_Real BRepPrim_OneAxis::Angle () const
{ {
return myAngle; return myAngle;
} }
void Primitives_OneAxis::Angle (const Standard_Real A) void BRepPrim_OneAxis::Angle (const Standard_Real A)
{ {
Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt);
myAngle = A; myAngle = A;
} }
Standard_Real Primitives_OneAxis::VMin () const Standard_Real BRepPrim_OneAxis::VMin () const
{ {
return myVMin; return myVMin;
} }
void Primitives_OneAxis::VMin (const Standard_Real V) void BRepPrim_OneAxis::VMin (const Standard_Real V)
{ {
Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt);
myVMin = V; myVMin = V;
} }
Standard_Real Primitives_OneAxis::VMax () const Standard_Real BRepPrim_OneAxis::VMax () const
{ {
return myVMax; return myVMax;
} }
void Primitives_OneAxis::VMax (const Standard_Real V) void BRepPrim_OneAxis::VMax (const Standard_Real V)
{ {
Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt);
myVMax = V; myVMax = V;
} }
@@ -186,7 +196,7 @@ void Primitives_OneAxis::VMax (const Standard_Real V)
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::MeridianOnAxis Standard_Boolean BRepPrim_OneAxis::MeridianOnAxis
(const Standard_Real V) const (const Standard_Real V) const
{ {
return Abs(MeridianValue(V).X()) < Precision::Confusion(); return Abs(MeridianValue(V).X()) < Precision::Confusion();
@@ -197,7 +207,7 @@ Standard_Boolean Primitives_OneAxis::MeridianOnAxis
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::MeridianClosed() const Standard_Boolean BRepPrim_OneAxis::MeridianClosed() const
{ {
if (VMaxInfinite()) return Standard_False; if (VMaxInfinite()) return Standard_False;
if (VMinInfinite()) return Standard_False; if (VMinInfinite()) return Standard_False;
@@ -210,7 +220,7 @@ Standard_Boolean Primitives_OneAxis::MeridianClosed() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::VMaxInfinite() const Standard_Boolean BRepPrim_OneAxis::VMaxInfinite() const
{ {
return Precision::IsPositiveInfinite(myVMax); return Precision::IsPositiveInfinite(myVMax);
} }
@@ -220,7 +230,7 @@ Standard_Boolean Primitives_OneAxis::VMaxInfinite() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::VMinInfinite() const Standard_Boolean BRepPrim_OneAxis::VMinInfinite() const
{ {
return Precision::IsNegativeInfinite(myVMin); return Precision::IsNegativeInfinite(myVMin);
} }
@@ -230,7 +240,7 @@ Standard_Boolean Primitives_OneAxis::VMinInfinite() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::HasTop() const Standard_Boolean BRepPrim_OneAxis::HasTop() const
{ {
if (VMaxInfinite()) return Standard_False; if (VMaxInfinite()) return Standard_False;
if (MeridianClosed()) return Standard_False; if (MeridianClosed()) return Standard_False;
@@ -243,7 +253,7 @@ Standard_Boolean Primitives_OneAxis::HasTop() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::HasBottom() const Standard_Boolean BRepPrim_OneAxis::HasBottom() const
{ {
if (VMinInfinite()) return Standard_False; if (VMinInfinite()) return Standard_False;
if (MeridianClosed()) return Standard_False; if (MeridianClosed()) return Standard_False;
@@ -256,7 +266,7 @@ Standard_Boolean Primitives_OneAxis::HasBottom() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Primitives_OneAxis::HasSides() const Standard_Boolean BRepPrim_OneAxis::HasSides() const
{ {
return 2*M_PI - myAngle > Precision::Angular(); return 2*M_PI - myAngle > Precision::Angular();
} }
@@ -266,7 +276,7 @@ Standard_Boolean Primitives_OneAxis::HasSides() const
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheShell& Primitives_OneAxis::Shell() const TopoDS_Shell& BRepPrim_OneAxis::Shell()
{ {
if (!ShellBuilt) { if (!ShellBuilt) {
myBuilder.MakeShell(myShell); myBuilder.MakeShell(myShell);
@@ -292,7 +302,7 @@ const TheShell& Primitives_OneAxis::Shell()
//purpose : build the lateral face //purpose : build the lateral face
//======================================================================= //=======================================================================
const TheFace& Primitives_OneAxis::LateralFace () const TopoDS_Face& BRepPrim_OneAxis::LateralFace ()
{ {
// do it if not done // do it if not done
if (!FacesBuilt[FLATERAL]) { if (!FacesBuilt[FLATERAL]) {
@@ -365,13 +375,13 @@ const TheFace& Primitives_OneAxis::LateralFace ()
//purpose : build and return the TopFace //purpose : build and return the TopFace
//======================================================================= //=======================================================================
const TheFace& Primitives_OneAxis::TopFace () const TopoDS_Face& BRepPrim_OneAxis::TopFace ()
{ {
// do it if not done // do it if not done
if (!FacesBuilt[FTOP]) { if (!FacesBuilt[FTOP]) {
Standard_DomainError_Raise_if(!HasTop(), Standard_DomainError_Raise_if(!HasTop(),
"Primitives_OneAxis::TopFace:No top face"); "BRepPrim_OneAxis::TopFace:No top face");
// make the empty face by translating the axes // make the empty face by translating the axes
Standard_Real z = MeridianValue(myVMax).Y(); Standard_Real z = MeridianValue(myVMax).Y();
@@ -405,13 +415,13 @@ const TheFace& Primitives_OneAxis::TopFace ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheFace& Primitives_OneAxis::BottomFace () const TopoDS_Face& BRepPrim_OneAxis::BottomFace ()
{ {
// do it if not done // do it if not done
if (!FacesBuilt[FBOTTOM]) { if (!FacesBuilt[FBOTTOM]) {
Standard_DomainError_Raise_if(!HasBottom(), Standard_DomainError_Raise_if(!HasBottom(),
"Primitives_OneAxis::BottomFace:No bottom face"); "BRepPrim_OneAxis::BottomFace:No bottom face");
// make the empty face by translating the axes // make the empty face by translating the axes
Standard_Real z = MeridianValue(myVMin).Y(); Standard_Real z = MeridianValue(myVMin).Y();
@@ -446,13 +456,13 @@ const TheFace& Primitives_OneAxis::BottomFace ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheFace& Primitives_OneAxis::StartFace () const TopoDS_Face& BRepPrim_OneAxis::StartFace ()
{ {
// do it if not done // do it if not done
if (!FacesBuilt[FSTART]) { if (!FacesBuilt[FSTART]) {
Standard_DomainError_Raise_if(!HasSides(), Standard_DomainError_Raise_if(!HasSides(),
"Primitives_OneAxes::StartFace:No side faces"); "BRepPrim_OneAxes::StartFace:No side faces");
// build the empty face, perpendicular to myTool.Axes() // build the empty face, perpendicular to myTool.Axes()
gp_Ax2 axes(myAxes.Location(),myAxes.YDirection().Reversed(),myAxes.XDirection()); gp_Ax2 axes(myAxes.Location(),myAxes.YDirection().Reversed(),myAxes.XDirection());
@@ -489,13 +499,13 @@ const TheFace& Primitives_OneAxis::StartFace ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheFace& Primitives_OneAxis::EndFace () const TopoDS_Face& BRepPrim_OneAxis::EndFace ()
{ {
// do it if not done // do it if not done
if (!FacesBuilt[FEND]) { if (!FacesBuilt[FEND]) {
Standard_DomainError_Raise_if(!HasSides(), Standard_DomainError_Raise_if(!HasSides(),
"Primitives_OneAxes::EndFace:No side faces"); "BRepPrim_OneAxes::EndFace:No side faces");
// build the empty face, perpendicular to myTool.Axes() // build the empty face, perpendicular to myTool.Axes()
gp_Ax2 axes(myAxes.Location(),myAxes.YDirection().Reversed(),myAxes.XDirection()); gp_Ax2 axes(myAxes.Location(),myAxes.YDirection().Reversed(),myAxes.XDirection());
@@ -533,7 +543,7 @@ const TheFace& Primitives_OneAxis::EndFace ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::LateralWire () const TopoDS_Wire& BRepPrim_OneAxis::LateralWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WLATERAL]) { if (!WiresBuilt[WLATERAL]) {
@@ -560,7 +570,7 @@ const TheWire& Primitives_OneAxis::LateralWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::LateralStartWire () const TopoDS_Wire& BRepPrim_OneAxis::LateralStartWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WLATERALSTART]) { if (!WiresBuilt[WLATERALSTART]) {
@@ -582,7 +592,7 @@ const TheWire& Primitives_OneAxis::LateralStartWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::LateralEndWire () const TopoDS_Wire& BRepPrim_OneAxis::LateralEndWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WLATERALEND]) { if (!WiresBuilt[WLATERALEND]) {
@@ -603,13 +613,13 @@ const TheWire& Primitives_OneAxis::LateralEndWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::TopWire () const TopoDS_Wire& BRepPrim_OneAxis::TopWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WTOP]) { if (!WiresBuilt[WTOP]) {
Standard_DomainError_Raise_if(!HasTop(), Standard_DomainError_Raise_if(!HasTop(),
"Primitives_OneAxis::TopWire: no top"); "BRepPrim_OneAxis::TopWire: no top");
myBuilder.MakeWire(myWires[WTOP]); myBuilder.MakeWire(myWires[WTOP]);
@@ -630,13 +640,13 @@ const TheWire& Primitives_OneAxis::TopWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::BottomWire () const TopoDS_Wire& BRepPrim_OneAxis::BottomWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WBOTTOM]) { if (!WiresBuilt[WBOTTOM]) {
Standard_DomainError_Raise_if(!HasBottom(), Standard_DomainError_Raise_if(!HasBottom(),
"Primitives_OneAxis::BottomWire: no bottom"); "BRepPrim_OneAxis::BottomWire: no bottom");
myBuilder.MakeWire(myWires[WBOTTOM]); myBuilder.MakeWire(myWires[WBOTTOM]);
@@ -658,13 +668,13 @@ const TheWire& Primitives_OneAxis::BottomWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::StartWire () const TopoDS_Wire& BRepPrim_OneAxis::StartWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WSTART]) { if (!WiresBuilt[WSTART]) {
Standard_DomainError_Raise_if(!HasSides(), Standard_DomainError_Raise_if(!HasSides(),
"Primitives_OneAxes::StartWire:no sides"); "BRepPrim_OneAxes::StartWire:no sides");
myBuilder.MakeWire(myWires[WSTART]); myBuilder.MakeWire(myWires[WSTART]);
@@ -692,22 +702,22 @@ const TheWire& Primitives_OneAxis::StartWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::AxisStartWire () const TopoDS_Wire& BRepPrim_OneAxis::AxisStartWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WAXISSTART]) { if (!WiresBuilt[WAXISSTART]) {
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!HasSides(), (!HasSides(),
"Primitives_OneAxes::AxisStartWire:no sides"); "BRepPrim_OneAxes::AxisStartWire:no sides");
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!VMaxInfinite() || !VMinInfinite(), (!VMaxInfinite() || !VMinInfinite(),
"Primitives_OneAxes::AxisStartWire:not infinite"); "BRepPrim_OneAxes::AxisStartWire:not infinite");
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(MeridianClosed(), (MeridianClosed(),
"Primitives_OneAxes::AxisStartWire:meridian closed"); "BRepPrim_OneAxes::AxisStartWire:meridian closed");
myBuilder.MakeWire(myWires[WAXISSTART]); myBuilder.MakeWire(myWires[WAXISSTART]);
@@ -725,13 +735,13 @@ const TheWire& Primitives_OneAxis::AxisStartWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::EndWire () const TopoDS_Wire& BRepPrim_OneAxis::EndWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WEND]) { if (!WiresBuilt[WEND]) {
Standard_DomainError_Raise_if(!HasSides(), Standard_DomainError_Raise_if(!HasSides(),
"Primitives_OneAxes::EndWire:no sides"); "BRepPrim_OneAxes::EndWire:no sides");
myBuilder.MakeWire(myWires[WEND]); myBuilder.MakeWire(myWires[WEND]);
@@ -757,22 +767,22 @@ const TheWire& Primitives_OneAxis::EndWire ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheWire& Primitives_OneAxis::AxisEndWire () const TopoDS_Wire& BRepPrim_OneAxis::AxisEndWire ()
{ {
// do it if not done // do it if not done
if (!WiresBuilt[WAXISEND]) { if (!WiresBuilt[WAXISEND]) {
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!HasSides(), (!HasSides(),
"Primitives_OneAxes::AxisEndWire:no sides"); "BRepPrim_OneAxes::AxisEndWire:no sides");
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!VMaxInfinite() || !VMinInfinite(), (!VMaxInfinite() || !VMinInfinite(),
"Primitives_OneAxes::AxisEndWire:not infinite"); "BRepPrim_OneAxes::AxisEndWire:not infinite");
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(MeridianClosed(), (MeridianClosed(),
"Primitives_OneAxes::AxisEndWire:meridian closed"); "BRepPrim_OneAxes::AxisEndWire:meridian closed");
myBuilder.MakeWire(myWires[WAXISEND]); myBuilder.MakeWire(myWires[WAXISEND]);
@@ -789,15 +799,15 @@ const TheWire& Primitives_OneAxis::AxisEndWire ()
//purpose : make the edge on the axis, oriented +Z //purpose : make the edge on the axis, oriented +Z
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::AxisEdge () const TopoDS_Edge& BRepPrim_OneAxis::AxisEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[EAXIS]) { if (!EdgesBuilt[EAXIS]) {
Standard_DomainError_Raise_if(!HasSides(), Standard_DomainError_Raise_if(!HasSides(),
"Primitives_OneAxis::AxisEdge:no sides"); "BRepPrim_OneAxis::AxisEdge:no sides");
Standard_DomainError_Raise_if(MeridianClosed(), Standard_DomainError_Raise_if(MeridianClosed(),
"Primitives_OneAxis::AxisEdge:closed"); "BRepPrim_OneAxis::AxisEdge:closed");
// build the empty edge. // build the empty edge.
myBuilder.MakeEdge(myEdges[EAXIS],gp_Lin(myAxes.Axis())); myBuilder.MakeEdge(myEdges[EAXIS],gp_Lin(myAxes.Axis()));
@@ -821,7 +831,7 @@ const TheEdge& Primitives_OneAxis::AxisEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::StartEdge () const TopoDS_Edge& BRepPrim_OneAxis::StartEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[ESTART]) { if (!EdgesBuilt[ESTART]) {
@@ -871,7 +881,7 @@ const TheEdge& Primitives_OneAxis::StartEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::EndEdge () const TopoDS_Edge& BRepPrim_OneAxis::EndEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[EEND]) { if (!EdgesBuilt[EEND]) {
@@ -921,14 +931,14 @@ const TheEdge& Primitives_OneAxis::EndEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::StartTopEdge () const TopoDS_Edge& BRepPrim_OneAxis::StartTopEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[ETOPSTART]) { if (!EdgesBuilt[ETOPSTART]) {
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!HasTop() || !HasSides(), (!HasTop() || !HasSides(),
"Primitives_OneAxis::StartTopEdge:no sides or no top"); "BRepPrim_OneAxis::StartTopEdge:no sides or no top");
// build the empty Edge // build the empty Edge
gp_Vec V = myAxes.Direction(); gp_Vec V = myAxes.Direction();
@@ -953,14 +963,14 @@ const TheEdge& Primitives_OneAxis::StartTopEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::StartBottomEdge () const TopoDS_Edge& BRepPrim_OneAxis::StartBottomEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[EBOTSTART]) { if (!EdgesBuilt[EBOTSTART]) {
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!HasBottom() || !HasSides(), (!HasBottom() || !HasSides(),
"Primitives_OneAxis::StartBottomEdge:no sides or no top"); "BRepPrim_OneAxis::StartBottomEdge:no sides or no top");
// build the empty Edge // build the empty Edge
gp_Vec V = myAxes.Direction(); gp_Vec V = myAxes.Direction();
@@ -985,14 +995,14 @@ const TheEdge& Primitives_OneAxis::StartBottomEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::EndTopEdge () const TopoDS_Edge& BRepPrim_OneAxis::EndTopEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[ETOPEND]) { if (!EdgesBuilt[ETOPEND]) {
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!HasTop() || !HasSides(), (!HasTop() || !HasSides(),
"Primitives_OneAxis::EndTopEdge:no sides or no top"); "BRepPrim_OneAxis::EndTopEdge:no sides or no top");
// build the empty Edge // build the empty Edge
gp_Vec V = myAxes.Direction(); gp_Vec V = myAxes.Direction();
@@ -1019,7 +1029,7 @@ const TheEdge& Primitives_OneAxis::EndTopEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::EndBottomEdge () const TopoDS_Edge& BRepPrim_OneAxis::EndBottomEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[EBOTEND]) { if (!EdgesBuilt[EBOTEND]) {
@@ -1027,7 +1037,7 @@ const TheEdge& Primitives_OneAxis::EndBottomEdge ()
Standard_DomainError_Raise_if Standard_DomainError_Raise_if
(!HasBottom() || !HasSides(), (!HasBottom() || !HasSides(),
"Primitives_OneAxis::EndBottomEdge:no sides or no bottom"); "BRepPrim_OneAxis::EndBottomEdge:no sides or no bottom");
// build the empty Edge // build the empty Edge
gp_Vec V = myAxes.Direction(); gp_Vec V = myAxes.Direction();
@@ -1054,7 +1064,7 @@ const TheEdge& Primitives_OneAxis::EndBottomEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::TopEdge () const TopoDS_Edge& BRepPrim_OneAxis::TopEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[ETOP]) { if (!EdgesBuilt[ETOP]) {
@@ -1108,7 +1118,7 @@ const TheEdge& Primitives_OneAxis::TopEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheEdge& Primitives_OneAxis::BottomEdge () const TopoDS_Edge& BRepPrim_OneAxis::BottomEdge ()
{ {
// do it if not done // do it if not done
if (!EdgesBuilt[EBOTTOM]) { if (!EdgesBuilt[EBOTTOM]) {
@@ -1163,7 +1173,7 @@ const TheEdge& Primitives_OneAxis::BottomEdge ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheVertex& Primitives_OneAxis::AxisTopVertex () const TopoDS_Vertex& BRepPrim_OneAxis::AxisTopVertex ()
{ {
// do it if not done // do it if not done
if (!VerticesBuilt[VAXISTOP]) { if (!VerticesBuilt[VAXISTOP]) {
@@ -1177,9 +1187,9 @@ const TheVertex& Primitives_OneAxis::AxisTopVertex ()
else { else {
Standard_DomainError_Raise_if(MeridianClosed(), Standard_DomainError_Raise_if(MeridianClosed(),
"Primitives_OneAxis::AxisTopVertex"); "BRepPrim_OneAxis::AxisTopVertex");
Standard_DomainError_Raise_if(VMaxInfinite(), Standard_DomainError_Raise_if(VMaxInfinite(),
"Primitives_OneAxis::AxisTopVertex"); "BRepPrim_OneAxis::AxisTopVertex");
gp_Vec V = myAxes.Direction(); gp_Vec V = myAxes.Direction();
V.Multiply(MeridianValue(myVMax).Y()); V.Multiply(MeridianValue(myVMax).Y());
@@ -1198,7 +1208,7 @@ const TheVertex& Primitives_OneAxis::AxisTopVertex ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheVertex& Primitives_OneAxis::AxisBottomVertex () const TopoDS_Vertex& BRepPrim_OneAxis::AxisBottomVertex ()
{ {
// do it if not done // do it if not done
if (!VerticesBuilt[VAXISBOT]) { if (!VerticesBuilt[VAXISBOT]) {
@@ -1212,9 +1222,9 @@ const TheVertex& Primitives_OneAxis::AxisBottomVertex ()
else { else {
Standard_DomainError_Raise_if(MeridianClosed(), Standard_DomainError_Raise_if(MeridianClosed(),
"Primitives_OneAxis::AxisBottomVertex"); "BRepPrim_OneAxis::AxisBottomVertex");
Standard_DomainError_Raise_if(VMinInfinite(), Standard_DomainError_Raise_if(VMinInfinite(),
"Primitives_OneAxis::AxisBottomVertex"); "BRepPrim_OneAxis::AxisBottomVertex");
gp_Vec V = myAxes.Direction(); gp_Vec V = myAxes.Direction();
V.Multiply(MeridianValue(myVMin).Y()); V.Multiply(MeridianValue(myVMin).Y());
@@ -1233,7 +1243,7 @@ const TheVertex& Primitives_OneAxis::AxisBottomVertex ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheVertex& Primitives_OneAxis::TopStartVertex () const TopoDS_Vertex& BRepPrim_OneAxis::TopStartVertex ()
{ {
// do it if not done // do it if not done
if (!VerticesBuilt[VTOPSTART]) { if (!VerticesBuilt[VTOPSTART]) {
@@ -1270,7 +1280,7 @@ const TheVertex& Primitives_OneAxis::TopStartVertex ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheVertex& Primitives_OneAxis::TopEndVertex () const TopoDS_Vertex& BRepPrim_OneAxis::TopEndVertex ()
{ {
// do it if not done // do it if not done
if (!VerticesBuilt[VTOPEND]) { if (!VerticesBuilt[VTOPEND]) {
@@ -1309,7 +1319,7 @@ const TheVertex& Primitives_OneAxis::TopEndVertex ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheVertex& Primitives_OneAxis::BottomStartVertex () const TopoDS_Vertex& BRepPrim_OneAxis::BottomStartVertex ()
{ {
// do it if not done // do it if not done
if (!VerticesBuilt[VBOTSTART]) { if (!VerticesBuilt[VBOTSTART]) {
@@ -1346,7 +1356,7 @@ const TheVertex& Primitives_OneAxis::BottomStartVertex ()
//purpose : //purpose :
//======================================================================= //=======================================================================
const TheVertex& Primitives_OneAxis::BottomEndVertex () const TopoDS_Vertex& BRepPrim_OneAxis::BottomEndVertex ()
{ {
// do it if not done // do it if not done
if (!VerticesBuilt[VBOTEND]) { if (!VerticesBuilt[VBOTEND]) {

View File

@@ -1,164 +0,0 @@
// Copyright (c) 1999-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.
#ifndef _BRepPrim_OneAxis_HeaderFile
#define _BRepPrim_OneAxis_HeaderFile
#include <BRepPrim_Builder.hxx>
#include <gp_Ax2.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
class Standard_DomainError;
class Standard_OutOfRange;
class TopoDS_Shell;
class TopoDS_Face;
class TopoDS_Wire;
class TopoDS_Edge;
class TopoDS_Vertex;
class BRepPrim_Builder;
class gp_Ax2;
class gp_Pnt2d;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class BRepPrim_OneAxis {
public:
DEFINE_STANDARD_ALLOC
// Methods PUBLIC
//
Standard_EXPORT virtual void Delete() ;
Standard_EXPORT virtual ~BRepPrim_OneAxis()
//Standard_EXPORT virtual ~()
{
Delete();
}
Standard_EXPORT void SetMeridianOffset(const Standard_Real MeridianOffset = 0) ;
Standard_EXPORT const gp_Ax2& Axes() const;
Standard_EXPORT void Axes(const gp_Ax2& A) ;
Standard_EXPORT Standard_Real Angle() const;
Standard_EXPORT void Angle(const Standard_Real A) ;
Standard_EXPORT Standard_Real VMin() const;
Standard_EXPORT void VMin(const Standard_Real V) ;
Standard_EXPORT Standard_Real VMax() const;
Standard_EXPORT void VMax(const Standard_Real V) ;
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const = 0;
Standard_EXPORT virtual TopoDS_Edge MakeEmptyMeridianEdge(const Standard_Real Ang) const = 0;
Standard_EXPORT virtual void SetMeridianPCurve(TopoDS_Edge& E,const TopoDS_Face& F) const = 0;
Standard_EXPORT virtual gp_Pnt2d MeridianValue(const Standard_Real V) const = 0;
Standard_EXPORT virtual Standard_Boolean MeridianOnAxis(const Standard_Real V) const;
Standard_EXPORT virtual Standard_Boolean MeridianClosed() const;
Standard_EXPORT virtual Standard_Boolean VMaxInfinite() const;
Standard_EXPORT virtual Standard_Boolean VMinInfinite() const;
Standard_EXPORT virtual Standard_Boolean HasTop() const;
Standard_EXPORT virtual Standard_Boolean HasBottom() const;
Standard_EXPORT virtual Standard_Boolean HasSides() const;
Standard_EXPORT const TopoDS_Shell& Shell() ;
Standard_EXPORT const TopoDS_Face& LateralFace() ;
Standard_EXPORT const TopoDS_Face& TopFace() ;
Standard_EXPORT const TopoDS_Face& BottomFace() ;
Standard_EXPORT const TopoDS_Face& StartFace() ;
Standard_EXPORT const TopoDS_Face& EndFace() ;
Standard_EXPORT const TopoDS_Wire& LateralWire() ;
Standard_EXPORT const TopoDS_Wire& LateralStartWire() ;
Standard_EXPORT const TopoDS_Wire& LateralEndWire() ;
Standard_EXPORT const TopoDS_Wire& TopWire() ;
Standard_EXPORT const TopoDS_Wire& BottomWire() ;
Standard_EXPORT const TopoDS_Wire& StartWire() ;
Standard_EXPORT const TopoDS_Wire& AxisStartWire() ;
Standard_EXPORT const TopoDS_Wire& EndWire() ;
Standard_EXPORT const TopoDS_Wire& AxisEndWire() ;
Standard_EXPORT const TopoDS_Edge& AxisEdge() ;
Standard_EXPORT const TopoDS_Edge& StartEdge() ;
Standard_EXPORT const TopoDS_Edge& EndEdge() ;
Standard_EXPORT const TopoDS_Edge& StartTopEdge() ;
Standard_EXPORT const TopoDS_Edge& StartBottomEdge() ;
Standard_EXPORT const TopoDS_Edge& EndTopEdge() ;
Standard_EXPORT const TopoDS_Edge& EndBottomEdge() ;
Standard_EXPORT const TopoDS_Edge& TopEdge() ;
Standard_EXPORT const TopoDS_Edge& BottomEdge() ;
Standard_EXPORT const TopoDS_Vertex& AxisTopVertex() ;
Standard_EXPORT const TopoDS_Vertex& AxisBottomVertex() ;
Standard_EXPORT const TopoDS_Vertex& TopStartVertex() ;
Standard_EXPORT const TopoDS_Vertex& TopEndVertex() ;
Standard_EXPORT const TopoDS_Vertex& BottomStartVertex() ;
Standard_EXPORT const TopoDS_Vertex& BottomEndVertex() ;
protected:
// Methods PROTECTED
//
Standard_EXPORT BRepPrim_OneAxis(const BRepPrim_Builder& B,const gp_Ax2& A,const Standard_Real VMin,const Standard_Real VMax);
// Fields PROTECTED
//
BRepPrim_Builder myBuilder;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
gp_Ax2 myAxes;
Standard_Real myAngle;
Standard_Real myVMin;
Standard_Real myVMax;
Standard_Real myMeridianOffset;
TopoDS_Shell myShell;
Standard_Boolean ShellBuilt;
TopoDS_Vertex myVertices[6];
Standard_Boolean VerticesBuilt[6];
TopoDS_Edge myEdges[9];
Standard_Boolean EdgesBuilt[9];
TopoDS_Wire myWires[9];
Standard_Boolean WiresBuilt[9];
TopoDS_Face myFaces[5];
Standard_Boolean FacesBuilt[5];
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -1,71 +0,0 @@
# Copyright (c) 1999-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.
proc BRepPrim_Replace:AdmFileType {} {
return "dbadmfile";
}
proc BRepPrim_Replace:OutputDirTypeName {} {
return "dbtmpfile";
}
proc BRepPrim_Replace:HandleInputFile { ID } {
scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name
switch $name {
BRepPrim_OneAxis.hxx {return 1;}
default {
return 0;
}
}
}
proc BRepPrim_Replace:Execute { unit args } {
global tcl_interactive
set tcl_interactive 1
package require Wokutils
msgprint -i -c "BRepPrim_Replace:Execute" "Copying of BRepPrim includes"
if { [wokparam -e %Station $unit] != "wnt" } {
set copycmd "cp -p "
set replstr "/"
} {
set copycmd "cmd /c copy"
set replstr "\\\\\\\\"
}
foreach file $args {
scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name
regsub ".hxx" $name ".hxx" sourcename
set source [woklocate -p BRepPrim:source:$sourcename [wokinfo -N $unit]]
set vistarget [woklocate -p BRepPrim:pubinclude:$name [wokinfo -N $unit]]
set target [wokinfo -p pubinclude:$name $unit]
regsub -all "/" " $source $target" $replstr TheArgs
msgprint -i -c "BRepPrim_Replace:Execute" "Copy $source to $target"
if { [file exist $target] && [wokparam -e %Station] != "wnt" } {
eval exec "chmod u+w $target"
}
eval exec "$copycmd $TheArgs"
}
return 0;
}

View File

@@ -1,26 +0,0 @@
-- Created by: JR
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-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.
@ifnotdefined ( %BRepPrim_WOKSteps_EDL) then
@set %BRepPrim_WOKSteps_EDL = "";
@string %WOKSteps_XcppGroup += " xcpp.repl ";
@set %WOKSteps_xcpp_repl = "*BRepPrim_Replace(xcpp.header)";
@set %BRepPrim_UseSourceInclude = "";
@endif;

View File

@@ -1,3 +0,0 @@
BRepPrim_OneAxis.hxx
BRepPrim_Replace.tcl
BRepPrim_WOKSteps.edl

View File

@@ -17,7 +17,7 @@
#include <BRepPrimAPI_MakeBox.ixx> #include <BRepPrimAPI_MakeBox.ixx>
#include <BRepBuilderAPI.hxx> #include <BRepBuilderAPI.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <Primitives_Direction.hxx> #include <BRepPrim_Direction.hxx>
inline gp_Pnt pmin(const gp_Pnt& p, inline gp_Pnt pmin(const gp_Pnt& p,
@@ -171,7 +171,7 @@ BRepPrimAPI_MakeBox::operator TopoDS_Solid()
const TopoDS_Face& BRepPrimAPI_MakeBox::BottomFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::BottomFace () {
return myWedge.Face (Primitives_ZMin); return myWedge.Face (BRepPrim_ZMin);
} }
@@ -183,7 +183,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::BottomFace () {
const TopoDS_Face& BRepPrimAPI_MakeBox::BackFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::BackFace () {
return myWedge.Face (Primitives_XMin); return myWedge.Face (BRepPrim_XMin);
} }
@@ -194,7 +194,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::BackFace () {
const TopoDS_Face& BRepPrimAPI_MakeBox::FrontFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::FrontFace () {
return myWedge.Face (Primitives_XMax); return myWedge.Face (BRepPrim_XMax);
} }
@@ -205,7 +205,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::FrontFace () {
const TopoDS_Face& BRepPrimAPI_MakeBox::LeftFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::LeftFace () {
return myWedge.Face (Primitives_YMin); return myWedge.Face (BRepPrim_YMin);
} }
@@ -216,7 +216,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::LeftFace () {
const TopoDS_Face& BRepPrimAPI_MakeBox::RightFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::RightFace () {
return myWedge.Face (Primitives_YMax); return myWedge.Face (BRepPrim_YMax);
} }
@@ -227,7 +227,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::RightFace () {
const TopoDS_Face& BRepPrimAPI_MakeBox::TopFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::TopFace () {
return myWedge.Face (Primitives_ZMax); return myWedge.Face (BRepPrim_ZMax);
} }

View File

@@ -47,18 +47,7 @@ is
class Iterator; class Iterator;
---Purpose: Iterator on the subShapes of a shape. ---Purpose: Iterator on the subShapes of a shape.
deferred class NumLinearRegularSweep;
deferred class NumLinearRegularSweep
instantiates LinearRegularSweep from Sweep(
Shape from TopoDS, -- Resulting topological objects.
Shape from TopoDS, -- Generating Shape.
NumShape from Sweep, -- Directing Wire.
Builder from BRepSweep,
Tool from BRepSweep, -- GenTool
NumShapeTool from Sweep, -- DirTool
Iterator from BRepSweep, -- Resulting objects Iterator
Iterator from BRepSweep, -- GenIterator
NumShapeIterator from Sweep); -- DirSubEdgeIterator
deferred class Trsf; deferred class Trsf;
--- This class is inherited from LinearRegularSweep to implement --- This class is inherited from LinearRegularSweep to implement

View File

@@ -14,33 +14,23 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
deferred generic class LinearRegularSweep from Sweep ( deferred class NumLinearRegularSweep from BRepSweep
TheShape as any; -- resulting topological objects.
TheGenShape as any; -- Generating topological objects.
TheDirShape as any; -- Directing topological objects.
TheBuilder as any;
TheGenShapeTool as any;
TheDirShapeTool as any;
TheShapeIterator as any;
TheGenShapeIterator as any;
TheDirShapeIterator as any)
---Purpose: This a generic class is used to build Sweept ---Purpose: This a generic class is used to build Sweept
-- primitives with a generating "shape" and a -- primitives with a generating "shape" and a
-- directing "line". -- directing "line".
-- --
-- The indexation and type analysis services required -- The indexation and type analysis services required
-- for the generatrix are given by <TheGenShapeTool>. -- for the generatrix are given by <Tool from BRepSweep>.
-- --
-- The indexation and type analysis services required -- The indexation and type analysis services required
-- for the directrix are given by <TheDirShapeTool>. -- for the directrix are given by <NumShapeTool from Sweep>.
-- --
-- The iteration services required for the generatrix -- The iteration services required for the generatrix
-- are given by <TheGenShapeIterator>. -- are given by <Iterator from BRepSweep>.
-- --
-- The iteration services required for the directrix -- The iteration services required for the directrix
-- are given by <TheDirShapeIterator>. -- are given by <NumShapeIterator from Sweep>.
-- --
-- The topology is like a grid of shapes. Each shape -- The topology is like a grid of shapes. Each shape
-- of the grid must be addressable without confusion -- of the grid must be addressable without confusion
@@ -67,7 +57,16 @@ deferred generic class LinearRegularSweep from Sweep (
uses uses
Orientation from TopAbs, Orientation from TopAbs,
Array2OfBoolean from TColStd Array2OfBoolean from TColStd,
Shape from TopoDS,
NumShape from Sweep,
Builder from BRepSweep,
Tool from BRepSweep,
NumShapeTool from Sweep,
Iterator from BRepSweep,
NumShapeIterator from Sweep,
Array2OfShape from TopTools,
SequenceOfShape from TopTools
raises raises
@@ -76,12 +75,6 @@ raises
RangeError from Standard, RangeError from Standard,
DomainError from Standard DomainError from Standard
-- Nested classes
class Array2OfShapes
instantiates Array2 from TCollection (TheShape);
class SequenceOfShapes
instantiates Sequence from TCollection (TheShape);
is is
@@ -91,10 +84,10 @@ is
Delete(me:out) is virtual ; Delete(me:out) is virtual ;
---C++: alias ~ ---C++: alias ~
Initialize(aBuilder : TheBuilder; Initialize(aBuilder : Builder from BRepSweep;
aGenShape : TheGenShape; aGenShape : Shape from TopoDS;
aDirWire : TheDirShape); aDirWire : NumShape from Sweep);
---Purpose: Creates a LinearRegularSweep. <aBuilder> gives ---Purpose: Creates a NumLinearRegularSweep. <aBuilder> gives
-- basic topological services. -- basic topological services.
@@ -103,61 +96,61 @@ is
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MakeEmptyVertex(me : in out; aGenV: TheGenShape; aDirV: TheDirShape) MakeEmptyVertex(me : in out; aGenV: Shape from TopoDS; aDirV: NumShape from Sweep)
returns TheShape returns Shape from TopoDS
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its ---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
-- geometric part, but without subcomponents. -- geometric part, but without subcomponents.
is deferred; is deferred;
MakeEmptyDirectingEdge(me: in out; aGenV: TheGenShape; aDirE: TheDirShape) MakeEmptyDirectingEdge(me: in out; aGenV: Shape from TopoDS; aDirE: NumShape from Sweep)
returns TheShape returns Shape from TopoDS
---Purpose: Builds the edge addressed by [aGenV,aDirE], with its ---Purpose: Builds the edge addressed by [aGenV,aDirE], with its
-- geometric part, but without subcomponents. -- geometric part, but without subcomponents.
is deferred; is deferred;
MakeEmptyGeneratingEdge(me: in out; aGenE: TheGenShape; aDirV: TheDirShape) MakeEmptyGeneratingEdge(me: in out; aGenE: Shape from TopoDS; aDirV: NumShape from Sweep)
returns TheShape returns Shape from TopoDS
---Purpose: Builds the edge addressed by [aGenE,aDirV], with its ---Purpose: Builds the edge addressed by [aGenE,aDirV], with its
-- geometric part, but without subcomponents. -- geometric part, but without subcomponents.
is deferred; is deferred;
SetParameters(me : in out; SetParameters(me : in out;
aNewFace : TheShape; aNewFace : Shape from TopoDS;
aNewVertex : in out TheShape; aNewVertex : in out Shape from TopoDS;
aGenF : TheGenShape; aGenF : Shape from TopoDS;
aGenV : TheGenShape; aGenV : Shape from TopoDS;
aDirV : TheDirShape) aDirV : NumShape from Sweep)
---Purpose: Sets the parameters of the new vertex on the new ---Purpose: Sets the parameters of the new vertex on the new
-- face. The new face and new vertex where generated -- face. The new face and new vertex where generated
-- from aGenF, aGenV and aDirV . -- from aGenF, aGenV and aDirV .
is deferred; is deferred;
SetDirectingParameter(me : in out; SetDirectingParameter(me : in out;
aNewEdge : TheShape; aNewEdge : Shape from TopoDS;
aNewVertex : in out TheShape; aNewVertex : in out Shape from TopoDS;
aGenV : TheGenShape; aGenV : Shape from TopoDS;
aDirE : TheDirShape; aDirE : NumShape from Sweep;
aDirV : TheDirShape) aDirV : NumShape from Sweep)
---Purpose: Sets the parameter of the new vertex on the new ---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated -- edge. The new edge and new vertex where generated
-- from aGenV aDirE, and aDirV. -- from aGenV aDirE, and aDirV.
is deferred; is deferred;
SetGeneratingParameter(me : in out; SetGeneratingParameter(me : in out;
aNewEdge : TheShape; aNewEdge : Shape from TopoDS;
aNewVertex : in out TheShape; aNewVertex : in out Shape from TopoDS;
aGenE : TheGenShape; aGenE : Shape from TopoDS;
aGenV : TheGenShape; aGenV : Shape from TopoDS;
aDirV : TheDirShape) aDirV : NumShape from Sweep)
---Purpose: Sets the parameter of the new vertex on the new ---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated -- edge. The new edge and new vertex where generated
-- from aGenE, aGenV and aDirV . -- from aGenE, aGenV and aDirV .
is deferred; is deferred;
MakeEmptyFace(me : in out; MakeEmptyFace(me : in out;
aGenS : TheGenShape; aGenS : Shape from TopoDS;
aDirS : TheDirShape) aDirS : NumShape from Sweep)
returns TheShape returns Shape from TopoDS
---Purpose: Builds the face addressed by [aGenS,aDirS], with ---Purpose: Builds the face addressed by [aGenS,aDirS], with
-- its geometric part, but without subcomponents. The -- its geometric part, but without subcomponents. The
-- couple aGenS, aDirS can be a "generating face and -- couple aGenS, aDirS can be a "generating face and
@@ -166,11 +159,11 @@ is
is deferred; is deferred;
SetPCurve(me : in out; SetPCurve(me : in out;
aNewFace : TheShape; aNewFace : Shape from TopoDS;
aNewEdge : in out TheShape; aNewEdge : in out Shape from TopoDS;
aGenF : TheGenShape; aGenF : Shape from TopoDS;
aGenE : TheGenShape; aGenE : Shape from TopoDS;
aDirV : TheDirShape; aDirV : NumShape from Sweep;
orien : Orientation from TopAbs) orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The ---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using -- new edge and the new face were generated using
@@ -178,11 +171,11 @@ is
is deferred; is deferred;
SetGeneratingPCurve(me : in out; SetGeneratingPCurve(me : in out;
aNewFace : TheShape; aNewFace : Shape from TopoDS;
aNewEdge : in out TheShape; aNewEdge : in out Shape from TopoDS;
aGenE : TheGenShape; aGenE : Shape from TopoDS;
aDirE : TheDirShape; aDirE : NumShape from Sweep;
aDirV : TheDirShape; aDirV : NumShape from Sweep;
orien : Orientation from TopAbs) orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The ---Purpose: Sets the PCurve for a new edge on a new face. The
@@ -191,11 +184,11 @@ is
is deferred; is deferred;
SetDirectingPCurve(me : in out; SetDirectingPCurve(me : in out;
aNewFace : TheShape; aNewFace : Shape from TopoDS;
aNewEdge : in out TheShape; aNewEdge : in out Shape from TopoDS;
aGenE : TheGenShape; aGenE : Shape from TopoDS;
aGenV : TheGenShape; aGenV : Shape from TopoDS;
aDirE : TheDirShape; aDirE : NumShape from Sweep;
orien : Orientation from TopAbs) orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The ---Purpose: Sets the PCurve for a new edge on a new face. The
@@ -204,8 +197,8 @@ is
is deferred; is deferred;
DirectSolid(me : in out; DirectSolid(me : in out;
aGenS : TheGenShape; aGenS : Shape from TopoDS;
aDirS : TheDirShape) aDirS : NumShape from Sweep)
returns Orientation from TopAbs returns Orientation from TopAbs
---Purpose: Returns the Orientation of the shell in the solid ---Purpose: Returns the Orientation of the shell in the solid
-- generated by the face aGenS with the edge aDirS. -- generated by the face aGenS with the edge aDirS.
@@ -214,11 +207,11 @@ is
is deferred; is deferred;
GGDShapeIsToAdd (me; GGDShapeIsToAdd (me;
aNewShape : TheShape; aNewShape : Shape from TopoDS;
aNewSubShape : TheShape; aNewSubShape : Shape from TopoDS;
aGenS : TheGenShape; aGenS : Shape from TopoDS;
aSubGenS : TheGenShape; aSubGenS : Shape from TopoDS;
aDirS : TheDirShape) aDirS : NumShape from Sweep)
returns Boolean from Standard returns Boolean from Standard
---Purpose: Returns true if aNewSubShape (addressed by ---Purpose: Returns true if aNewSubShape (addressed by
-- aSubGenS and aDirS) must be added in aNewShape -- aSubGenS and aDirS) must be added in aNewShape
@@ -226,11 +219,11 @@ is
is deferred; is deferred;
GDDShapeIsToAdd (me; GDDShapeIsToAdd (me;
aNewShape : TheShape; aNewShape : Shape from TopoDS;
aNewSubShape : TheShape; aNewSubShape : Shape from TopoDS;
aGenS : TheGenShape; aGenS : Shape from TopoDS;
aDirS : TheDirShape; aDirS : NumShape from Sweep;
aSubDirS : TheDirShape) aSubDirS : NumShape from Sweep)
returns Boolean from Standard returns Boolean from Standard
---Purpose: Returns true if aNewSubShape (addressed by ---Purpose: Returns true if aNewSubShape (addressed by
-- aGenS and aSubDirS) must be added in aNewShape -- aGenS and aSubDirS) must be added in aNewShape
@@ -239,11 +232,11 @@ is
SeparatedWires (me; SeparatedWires (me;
aNewShape : TheShape; aNewShape : Shape from TopoDS;
aNewSubShape : TheShape; aNewSubShape : Shape from TopoDS;
aGenS : TheGenShape; aGenS : Shape from TopoDS;
aSubGenS : TheGenShape; aSubGenS : Shape from TopoDS;
aDirS : TheDirShape) aDirS : NumShape from Sweep)
returns Boolean from Standard returns Boolean from Standard
---Purpose: In some particular cases the topology of a ---Purpose: In some particular cases the topology of a
-- generated face must be composed of independant -- generated face must be composed of independant
@@ -252,8 +245,8 @@ is
is deferred; is deferred;
SplitShell (me; aNewShape : TheShape) SplitShell (me; aNewShape : Shape from TopoDS)
returns TheShape returns Shape from TopoDS
---Purpose: In some particular cases the topology of a ---Purpose: In some particular cases the topology of a
-- generated Shell must be composed of independant -- generated Shell must be composed of independant
-- closed Shells, in this case this function returns -- closed Shells, in this case this function returns
@@ -264,7 +257,7 @@ is
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Method coding the continuities on the edges between 2 faces -- Method coding the continuities on the edges between 2 faces
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SetContinuity(me : in out; aGenS : TheGenShape; aDirS : TheDirShape) SetContinuity(me : in out; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
---Purpose: Called to propagate the continuity of every vertex ---Purpose: Called to propagate the continuity of every vertex
-- between two edges of the generating wire aGenS on -- between two edges of the generating wire aGenS on
-- the generated edge and faces. -- the generated edge and faces.
@@ -279,7 +272,7 @@ is
-- Shapes -- Shapes
-- """""" -- """"""
HasShape(me; aGenS : TheGenShape; aDirS : TheDirShape) HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
returns Boolean from Standard returns Boolean from Standard
---Purpose: Returns true if aDirS and aGenS addresses a ---Purpose: Returns true if aDirS and aGenS addresses a
-- resulting Shape. In some specific cases the shape -- resulting Shape. In some specific cases the shape
@@ -287,46 +280,46 @@ is
-- function returns false. -- function returns false.
is deferred; is deferred;
Shape(me: in out; aGenS : TheGenShape; aDirS : TheDirShape) Shape(me: in out; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by aDirS and ---Purpose: Returns the resulting Shape indexed by aDirS and
-- aGenS. -- aGenS.
is static; is static;
Shape(me: in out; aGenS : TheGenShape) Shape(me: in out; aGenS : Shape from TopoDS)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by myDirWire ---Purpose: Returns the resulting Shape indexed by myDirWire
-- and aGenS. -- and aGenS.
is static; is static;
Shape(me: in out) Shape(me: in out)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by myDirWire ---Purpose: Returns the resulting Shape indexed by myDirWire
-- and myGenShape. -- and myGenShape.
is static; is static;
FirstShape(me: in out) FirstShape(me: in out)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the first ---Purpose: Returns the resulting Shape indexed by the first
-- Vertex of myDirWire and myGenShape. -- Vertex of myDirWire and myGenShape.
is static; is static;
LastShape(me: in out) LastShape(me: in out)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the last ---Purpose: Returns the resulting Shape indexed by the last
-- Vertex of myDirWire and myGenShape. -- Vertex of myDirWire and myGenShape.
is static; is static;
FirstShape(me: in out; aGenS : TheGenShape) FirstShape(me: in out; aGenS : Shape from TopoDS)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the first ---Purpose: Returns the resulting Shape indexed by the first
-- Vertex of myDirWire and aGenS. -- Vertex of myDirWire and aGenS.
is static; is static;
LastShape(me: in out; aGenS : TheGenShape) LastShape(me: in out; aGenS : Shape from TopoDS)
returns TheShape returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the last ---Purpose: Returns the resulting Shape indexed by the last
-- Vertex of myDirWire and aGenS. -- Vertex of myDirWire and aGenS.
is static; is static;
@@ -339,25 +332,25 @@ fields
-- Topology builder. -- Topology builder.
myBuilder : TheBuilder is protected; myBuilder : Builder from BRepSweep is protected;
-- Generating shape -- Generating shape
myGenShape : TheGenShape is protected; myGenShape : Shape from TopoDS is protected;
-- Directing line -- Directing line
myDirWire : TheDirShape is protected; myDirWire : NumShape from Sweep is protected;
-- shape tools. -- shape tools.
myGenShapeTool : TheGenShapeTool is protected; myGenShapeTool : Tool from BRepSweep is protected;
myDirShapeTool : TheDirShapeTool is protected; myDirShapeTool : NumShapeTool from Sweep is protected;
-- Array of built objects (NbGShapes,NbDShapes). -- Array of built objects (NbGShapes,NbDShapes).
myShapes : Array2OfShapes is protected; myShapes : Array2OfShape from TopTools is protected;
-- Array of built objects flags (NbGShapes,NbDShapes). -- Array of built objects flags (NbGShapes,NbDShapes).
myBuiltShapes : Array2OfBoolean from TColStd is protected; myBuiltShapes : Array2OfBoolean from TColStd is protected;
end LinearRegularSweep; end NumLinearRegularSweep;

View File

@@ -14,23 +14,34 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <BRepSweep_NumLinearRegularSweep.ixx>
#include <Standard_RangeError.hxx> #include <Standard_RangeError.hxx>
#include <Standard_NoSuchObject.hxx> #include <Standard_NoSuchObject.hxx>
#include <Standard_NoMoreObject.hxx> #include <Standard_NoMoreObject.hxx>
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
#include <TopoDS_Shape.hxx>
#include <Sweep_NumShape.hxx>
#include <BRepSweep_Builder.hxx>
#include <BRepSweep_Tool.hxx>
#include <Sweep_NumShapeTool.hxx>
#include <BRepSweep_Iterator.hxx>
#include <Sweep_NumShapeIterator.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopAbs_Orientation.hxx> #include <TopAbs_Orientation.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
//======================================================================= //=======================================================================
//function : Sweep_LinearRegularSweep //function : BRepSweep_NumLinearRegularSweep
//purpose : Create a Regular Sweep. //purpose : Create a Regular Sweep.
//======================================================================= //=======================================================================
Sweep_LinearRegularSweep::Sweep_LinearRegularSweep BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep
(const TheBuilder& aBuilder, (const BRepSweep_Builder& aBuilder,
const TheGenShape& aGenShape, const TopoDS_Shape& aGenShape,
const TheDirShape& aDirShape): const Sweep_NumShape& aDirShape):
myBuilder(aBuilder), myBuilder(aBuilder),
myGenShape(aGenShape), myGenShape(aGenShape),
@@ -51,7 +62,7 @@ Sweep_LinearRegularSweep::Sweep_LinearRegularSweep
myBuiltShapes.Init(Standard_False); myBuiltShapes.Init(Standard_False);
} }
void Sweep_LinearRegularSweep::Delete() void BRepSweep_NumLinearRegularSweep::Delete()
{} {}
//======================================================================= //=======================================================================
@@ -59,11 +70,11 @@ void Sweep_LinearRegularSweep::Delete()
//purpose : Returns the global Shape. //purpose : Returns the global Shape.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::Shape () TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape ()
{ {
if (HasShape(myGenShape,myDirWire)) return Shape(myGenShape,myDirWire); if (HasShape(myGenShape,myDirWire)) return Shape(myGenShape,myDirWire);
else { else {
TheShape bidon; TopoDS_Shape bidon;
return bidon; return bidon;
} }
} }
@@ -74,12 +85,12 @@ TheShape Sweep_LinearRegularSweep::Shape ()
//purpose : Returns the Shape generated with aGenS. //purpose : Returns the Shape generated with aGenS.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS) TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS)
{ {
if (myGenShapeTool.Index(aGenS) != 0 && if (myGenShapeTool.Index(aGenS) != 0 &&
HasShape(aGenS,myDirWire)) return Shape(aGenS,myDirWire); HasShape(aGenS,myDirWire)) return Shape(aGenS,myDirWire);
else { else {
TheShape bidon; TopoDS_Shape bidon;
return bidon; return bidon;
} }
} }
@@ -90,18 +101,18 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS)
//purpose : Returns the Shape indexed by the arguments. //purpose : Returns the Shape indexed by the arguments.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
const TheDirShape& aDirS) const Sweep_NumShape& aDirS)
{ {
Standard_Integer iGenS = myGenShapeTool.Index(aGenS); Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
Standard_Integer iDirS = myDirShapeTool.Index(aDirS); Standard_Integer iDirS = myDirShapeTool.Index(aDirS);
if (!myBuiltShapes(iGenS,iDirS)){ if (!myBuiltShapes(iGenS,iDirS)){
TheShape newShape; TopoDS_Shape newShape;
TheGenShape bGenS,cGenS,subGenS,subsubGenS; TopoDS_Shape bGenS,cGenS,subGenS,subsubGenS;
TheDirShape bDirS,subDirS; Sweep_NumShape bDirS,subDirS;
TheGenShapeIterator It; BRepSweep_Iterator It;
TheDirShapeIterator Kt; Sweep_NumShapeIterator Kt;
TheShapeIterator Lt; BRepSweep_Iterator Lt;
TopAbs_Orientation Or,Pr; TopAbs_Orientation Or,Pr;
if (myDirShapeTool.Type(aDirS)==TopAbs_VERTEX){ if (myDirShapeTool.Type(aDirS)==TopAbs_VERTEX){
//Ici on construit les "planchers" du Shape. //Ici on construit les "planchers" du Shape.
@@ -162,14 +173,14 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS,
aGenS,subGenS,aDirS,Or); aGenS,subGenS,aDirS,Or);
} }
else if(subGenSType==TopAbs_WIRE){ else if(subGenSType==TopAbs_WIRE){
TheGenShapeIterator Jt; BRepSweep_Iterator Jt;
cGenS = subGenS; cGenS = subGenS;
myGenShapeTool.SetOrientation(cGenS,TopAbs_FORWARD); myGenShapeTool.SetOrientation(cGenS,TopAbs_FORWARD);
for (Jt.Init(cGenS);Jt.More();Jt.Next()){ for (Jt.Init(cGenS);Jt.More();Jt.Next()){
subsubGenS = Jt.Value(); subsubGenS = Jt.Value();
Pr = Jt.Orientation(); Pr = Jt.Orientation();
if(HasShape(subsubGenS,aDirS)){ if(HasShape(subsubGenS,aDirS)){
TheShape newsubEdge = Shape(subsubGenS,aDirS); TopoDS_Shape newsubEdge = Shape(subsubGenS,aDirS);
SetPCurve(myShapes(iGenS,iDirS),newsubEdge, SetPCurve(myShapes(iGenS,iDirS),newsubEdge,
aGenS,subsubGenS,aDirS,Pr); aGenS,subsubGenS,aDirS,Pr);
} }
@@ -187,8 +198,8 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS,
else if (myDirShapeTool.Type(aDirS)==TopAbs_EDGE){ else if (myDirShapeTool.Type(aDirS)==TopAbs_EDGE){
//Ici on construit les murs du Shape. //Ici on construit les murs du Shape.
TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS); TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS);
TheShape newWire,newShell; TopoDS_Shape newWire,newShell;
Sweep_SequenceOfShapes WireSeq; TopTools_SequenceOfShape WireSeq;
Standard_Boolean sepwires = Standard_False; Standard_Boolean sepwires = Standard_False;
switch (aGenSType){ switch (aGenSType){
case TopAbs_VERTEX : case TopAbs_VERTEX :
@@ -242,7 +253,7 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS,
if (SeparatedWires(myShapes(iGenS,iDirS),newShape, if (SeparatedWires(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){ aGenS,subGenS,aDirS)){
sepwires = Standard_True; sepwires = Standard_True;
TheShape wi; TopoDS_Shape wi;
myBuilder.MakeWire(wi); myBuilder.MakeWire(wi);
myBuilder.Add(wi,newShape,Or); myBuilder.Add(wi,newShape,Or);
WireSeq.Append(wi); WireSeq.Append(wi);
@@ -326,7 +337,7 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS,
SetContinuity(aGenS,aDirS); SetContinuity(aGenS,aDirS);
} }
if (aGenSType==TopAbs_FACE){ if (aGenSType==TopAbs_FACE){
TheShape temp = SplitShell(newShell); TopoDS_Shape temp = SplitShell(newShell);
TopAbs_Orientation Or = DirectSolid(aGenS,aDirS); TopAbs_Orientation Or = DirectSolid(aGenS,aDirS);
Lt.Init(temp); Lt.Init(temp);
if(Lt.More()) Lt.Next(); if(Lt.More()) Lt.Next();
@@ -390,9 +401,9 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS,
//purpose : Returns the Shape indexed by the arguments. //purpose : Returns the Shape indexed by the arguments.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::FirstShape () TopoDS_Shape BRepSweep_NumLinearRegularSweep::FirstShape ()
{ {
TheShape result; TopoDS_Shape result;
if (myDirShapeTool.HasFirstVertex()){ if (myDirShapeTool.HasFirstVertex()){
if(HasShape(myGenShape,myDirShapeTool.FirstVertex())) if(HasShape(myGenShape,myDirShapeTool.FirstVertex()))
result = Shape(myGenShape,myDirShapeTool.FirstVertex()); result = Shape(myGenShape,myDirShapeTool.FirstVertex());
@@ -406,9 +417,9 @@ TheShape Sweep_LinearRegularSweep::FirstShape ()
//purpose : Returns the Shape indexed by the arguments. //purpose : Returns the Shape indexed by the arguments.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::LastShape () TopoDS_Shape BRepSweep_NumLinearRegularSweep::LastShape ()
{ {
TheShape result; TopoDS_Shape result;
if (myDirShapeTool.HasLastVertex()){ if (myDirShapeTool.HasLastVertex()){
if(HasShape(myGenShape,myDirShapeTool.LastVertex())) if(HasShape(myGenShape,myDirShapeTool.LastVertex()))
result = Shape(myGenShape,myDirShapeTool.LastVertex()); result = Shape(myGenShape,myDirShapeTool.LastVertex());
@@ -422,9 +433,9 @@ TheShape Sweep_LinearRegularSweep::LastShape ()
//purpose : Returns the Shape indexed by the arguments. //purpose : Returns the Shape indexed by the arguments.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::FirstShape (const TheGenShape& aGenS) TopoDS_Shape BRepSweep_NumLinearRegularSweep::FirstShape (const TopoDS_Shape& aGenS)
{ {
TheShape result; TopoDS_Shape result;
if (myDirShapeTool.HasFirstVertex()){ if (myDirShapeTool.HasFirstVertex()){
if(HasShape(aGenS,myDirShapeTool.FirstVertex())) if(HasShape(aGenS,myDirShapeTool.FirstVertex()))
result = Shape(aGenS,myDirShapeTool.FirstVertex()); result = Shape(aGenS,myDirShapeTool.FirstVertex());
@@ -438,9 +449,9 @@ TheShape Sweep_LinearRegularSweep::FirstShape (const TheGenShape& aGenS)
//purpose : Returns the Shape indexed by the arguments. //purpose : Returns the Shape indexed by the arguments.
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::LastShape (const TheGenShape& aGenS) TopoDS_Shape BRepSweep_NumLinearRegularSweep::LastShape (const TopoDS_Shape& aGenS)
{ {
TheShape result; TopoDS_Shape result;
if (myDirShapeTool.HasLastVertex()){ if (myDirShapeTool.HasLastVertex()){
if(HasShape(aGenS,myDirShapeTool.LastVertex())) if(HasShape(aGenS,myDirShapeTool.LastVertex()))
result = Shape(aGenS,myDirShapeTool.LastVertex()); result = Shape(aGenS,myDirShapeTool.LastVertex());
@@ -453,7 +464,7 @@ TheShape Sweep_LinearRegularSweep::LastShape (const TheGenShape& aGenS)
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Sweep_LinearRegularSweep::Closed()const Standard_Boolean BRepSweep_NumLinearRegularSweep::Closed()const
{ {
return myDirWire.Closed(); return myDirWire.Closed();
} }
@@ -463,9 +474,9 @@ Standard_Boolean Sweep_LinearRegularSweep::Closed()const
//purpose : //purpose :
//======================================================================= //=======================================================================
TheShape Sweep_LinearRegularSweep::SplitShell(const TheShape& aNewShape)const TopoDS_Shape BRepSweep_NumLinearRegularSweep::SplitShell(const TopoDS_Shape& aNewShape)const
{ {
TheShape comp; TopoDS_Shape comp;
myBuilder.MakeCompound(comp); myBuilder.MakeCompound(comp);
myBuilder.Add(comp,aNewShape); myBuilder.Add(comp,aNewShape);
return comp; return comp;

View File

@@ -1,135 +0,0 @@
// Copyright (c) 1999-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.
#ifndef _BRepSweep_NumLinearRegularSweep_HeaderFile
#define _BRepSweep_NumLinearRegularSweep_HeaderFile
#include <BRepSweep_Builder.hxx>
#include <TopoDS_Shape.hxx>
#include <Sweep_NumShape.hxx>
#include <BRepSweep_Tool.hxx>
#include <Sweep_NumShapeTool.hxx>
#include <BRepSweep_Array2OfShapesOfNumLinearRegularSweep.hxx>
#include <TColStd_Array2OfBoolean.hxx>
#include <BRepSweep_SequenceNodeOfSequenceOfShapesOfNumLinearRegularSweep.hxx>
#include <TopAbs_Orientation.hxx>
class Standard_NoMoreObject;
class Standard_NoSuchObject;
class Standard_RangeError;
class Standard_DomainError;
class TopoDS_Shape;
class Sweep_NumShape;
class BRepSweep_Builder;
class BRepSweep_Tool;
class Sweep_NumShapeTool;
class BRepSweep_Iterator;
class Sweep_NumShapeIterator;
class BRepSweep_Array2OfShapesOfNumLinearRegularSweep;
class BRepSweep_SequenceOfShapesOfNumLinearRegularSweep;
class BRepSweep_SequenceNodeOfSequenceOfShapesOfNumLinearRegularSweep;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class BRepSweep_NumLinearRegularSweep {
public:
DEFINE_STANDARD_ALLOC
// Methods PUBLIC
//
Standard_EXPORT virtual void Delete() ;
Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep()
{
Delete();
}
Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex(const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirV) = 0;
Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge(const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirE) = 0;
Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge(const TopoDS_Shape& aGenE,const Sweep_NumShape& aDirV) = 0;
Standard_EXPORT virtual void SetParameters(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewVertex,const TopoDS_Shape& aGenF,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirV) = 0;
Standard_EXPORT virtual void SetDirectingParameter(const TopoDS_Shape& aNewEdge,TopoDS_Shape& aNewVertex,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirE,const Sweep_NumShape& aDirV) = 0;
Standard_EXPORT virtual void SetGeneratingParameter(const TopoDS_Shape& aNewEdge,TopoDS_Shape& aNewVertex,const TopoDS_Shape& aGenE,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirV) = 0;
Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) = 0;
Standard_EXPORT virtual void SetPCurve(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewEdge,const TopoDS_Shape& aGenF,const TopoDS_Shape& aGenE,const Sweep_NumShape& aDirV,const TopAbs_Orientation orien) = 0;
Standard_EXPORT virtual void SetGeneratingPCurve(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewEdge,const TopoDS_Shape& aGenE,const Sweep_NumShape& aDirE,const Sweep_NumShape& aDirV,const TopAbs_Orientation orien) = 0;
Standard_EXPORT virtual void SetDirectingPCurve(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewEdge,const TopoDS_Shape& aGenE,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirE,const TopAbs_Orientation orien) = 0;
Standard_EXPORT virtual TopAbs_Orientation DirectSolid(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) = 0;
Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd(const TopoDS_Shape& aNewShape,const TopoDS_Shape& aNewSubShape,const TopoDS_Shape& aGenS,const TopoDS_Shape& aSubGenS,const Sweep_NumShape& aDirS) const = 0;
Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd(const TopoDS_Shape& aNewShape,const TopoDS_Shape& aNewSubShape,const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS,const Sweep_NumShape& aSubDirS) const = 0;
Standard_EXPORT virtual Standard_Boolean SeparatedWires(const TopoDS_Shape& aNewShape,const TopoDS_Shape& aNewSubShape,const TopoDS_Shape& aGenS,const TopoDS_Shape& aSubGenS,const Sweep_NumShape& aDirS) const = 0;
Standard_EXPORT virtual TopoDS_Shape SplitShell(const TopoDS_Shape& aNewShape) const;
Standard_EXPORT virtual void SetContinuity(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) = 0;
Standard_EXPORT virtual Standard_Boolean HasShape(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) const = 0;
Standard_EXPORT TopoDS_Shape Shape(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) ;
Standard_EXPORT TopoDS_Shape Shape(const TopoDS_Shape& aGenS) ;
Standard_EXPORT TopoDS_Shape Shape() ;
Standard_EXPORT TopoDS_Shape FirstShape() ;
Standard_EXPORT TopoDS_Shape LastShape() ;
Standard_EXPORT TopoDS_Shape FirstShape(const TopoDS_Shape& aGenS) ;
Standard_EXPORT TopoDS_Shape LastShape(const TopoDS_Shape& aGenS) ;
Standard_EXPORT Standard_Boolean Closed() const;
protected:
// Methods PROTECTED
//
Standard_EXPORT BRepSweep_NumLinearRegularSweep(const BRepSweep_Builder& aBuilder,const TopoDS_Shape& aGenShape,const Sweep_NumShape& aDirWire);
// Fields PROTECTED
//
BRepSweep_Builder myBuilder;
TopoDS_Shape myGenShape;
Sweep_NumShape myDirWire;
BRepSweep_Tool myGenShapeTool;
Sweep_NumShapeTool myDirShapeTool;
BRepSweep_Array2OfShapesOfNumLinearRegularSweep myShapes;
TColStd_Array2OfBoolean myBuiltShapes;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -1,71 +0,0 @@
# Copyright (c) 1999-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.
proc BRepSweep_Replace:AdmFileType {} {
return "dbadmfile";
}
proc BRepSweep_Replace:OutputDirTypeName {} {
return "dbtmpfile";
}
proc BRepSweep_Replace:HandleInputFile { ID } {
scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name
switch $name {
BRepSweep_NumLinearRegularSweep.hxx {return 1;}
default {
return 0;
}
}
}
proc BRepSweep_Replace:Execute { unit args } {
global tcl_interactive
set tcl_interactive 1
package require Wokutils
msgprint -i -c "BRepSweep_Replace:Execute" "Copying of BRepSweep includes"
if { [wokparam -e %Station $unit] != "wnt" } {
set copycmd "cp -p "
set replstr "/"
} {
set copycmd "cmd /c copy"
set replstr "\\\\\\\\"
}
foreach file $args {
scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name
regsub ".hxx" $name ".hxx" sourcename
set source [woklocate -p BRepSweep:source:$sourcename [wokinfo -N $unit]]
set vistarget [woklocate -p BRepSweep:pubinclude:$name [wokinfo -N $unit]]
set target [wokinfo -p pubinclude:$name $unit]
regsub -all "/" " $source $target" $replstr TheArgs
msgprint -i -c "BRepSweep_Replace:Execute" "Copy $source to $target"
if { [file exist $target] && [wokparam -e %Station $unit] != "wnt" } {
eval exec "chmod u+w $target"
}
eval exec "$copycmd $TheArgs"
}
return 0;
}

View File

@@ -1,24 +0,0 @@
-- Created by: JR
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-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.
@ifnotdefined ( %BRepSweep_WOKSteps_EDL) then
@set %BRepSweep_WOKSteps_EDL = "";
@string %WOKSteps_XcppGroup += " xcpp.repl ";
@set %WOKSteps_xcpp_repl = "*BRepSweep_Replace(xcpp.header)";
@endif;

View File

@@ -1,3 +0,0 @@
BRepSweep_NumLinearRegularSweep.hxx
BRepSweep_WOKSteps.edl
BRepSweep_Replace.tcl

View File

@@ -76,6 +76,12 @@
# include <strings.h> # include <strings.h>
#endif #endif
//Number of BRepCheck_Statuses in BRepCheck_Status.hxx file
//(BRepCheck_NoError is not considered, i.e. general status
//is smaller by one specified in file)
static const Standard_Integer NumberOfStatus = 35;
static char* checkfaultyname = NULL; static char* checkfaultyname = NULL;
Standard_EXPORT void BRepTest_CheckCommands_SetFaultyName(const char* name) Standard_EXPORT void BRepTest_CheckCommands_SetFaultyName(const char* name)
{ {
@@ -511,40 +517,46 @@ static void FillProblems(const BRepCheck_Status stat,
NbProblems->SetValue(14,NbProblems->Value(14)+1); break; NbProblems->SetValue(14,NbProblems->Value(14)+1); break;
case BRepCheck_InvalidRange: case BRepCheck_InvalidRange:
NbProblems->SetValue(15,NbProblems->Value(15)+1); break; NbProblems->SetValue(15,NbProblems->Value(15)+1); break;
case BRepCheck_EmptyWire: case BRepCheck_PCurveIsOutOfDomainFace:
NbProblems->SetValue(16,NbProblems->Value(16)+1); break; NbProblems->SetValue(16,NbProblems->Value(16)+1); break;
case BRepCheck_RedundantEdge: case BRepCheck_EmptyWire:
NbProblems->SetValue(17,NbProblems->Value(17)+1); break; NbProblems->SetValue(17,NbProblems->Value(17)+1); break;
case BRepCheck_SelfIntersectingWire: case BRepCheck_RedundantEdge:
NbProblems->SetValue(18,NbProblems->Value(18)+1); break; NbProblems->SetValue(18,NbProblems->Value(18)+1); break;
case BRepCheck_NoSurface: case BRepCheck_SelfIntersectingWire:
NbProblems->SetValue(19,NbProblems->Value(19)+1); break; NbProblems->SetValue(19,NbProblems->Value(19)+1); break;
case BRepCheck_InvalidWire: case BRepCheck_NoSurface:
NbProblems->SetValue(20,NbProblems->Value(20)+1); break; NbProblems->SetValue(20,NbProblems->Value(20)+1); break;
case BRepCheck_RedundantWire: case BRepCheck_OutOfSurfaceBoundary:
NbProblems->SetValue(21,NbProblems->Value(21)+1); break; NbProblems->SetValue(21,NbProblems->Value(21)+1); break;
case BRepCheck_IntersectingWires: case BRepCheck_InvalidWire:
NbProblems->SetValue(22,NbProblems->Value(22)+1); break; NbProblems->SetValue(22,NbProblems->Value(22)+1); break;
case BRepCheck_InvalidImbricationOfWires: case BRepCheck_RedundantWire:
NbProblems->SetValue(23,NbProblems->Value(23)+1); break; NbProblems->SetValue(23,NbProblems->Value(23)+1); break;
case BRepCheck_EmptyShell: case BRepCheck_IntersectingWires:
NbProblems->SetValue(24,NbProblems->Value(24)+1); break; NbProblems->SetValue(24,NbProblems->Value(24)+1); break;
case BRepCheck_RedundantFace: case BRepCheck_InvalidImbricationOfWires:
NbProblems->SetValue(25,NbProblems->Value(25)+1); break; NbProblems->SetValue(25,NbProblems->Value(25)+1); break;
case BRepCheck_UnorientableShape: case BRepCheck_EmptyShell:
NbProblems->SetValue(26,NbProblems->Value(26)+1); break; NbProblems->SetValue(26,NbProblems->Value(26)+1); break;
case BRepCheck_NotClosed: case BRepCheck_RedundantFace:
NbProblems->SetValue(27,NbProblems->Value(27)+1); break; NbProblems->SetValue(27,NbProblems->Value(27)+1); break;
case BRepCheck_NotConnected: case BRepCheck_UnorientableShape:
NbProblems->SetValue(28,NbProblems->Value(28)+1); break; NbProblems->SetValue(28,NbProblems->Value(28)+1); break;
case BRepCheck_SubshapeNotInShape: case BRepCheck_NotClosed:
NbProblems->SetValue(29,NbProblems->Value(29)+1); break; NbProblems->SetValue(29,NbProblems->Value(29)+1); break;
case BRepCheck_BadOrientation: case BRepCheck_NotConnected:
NbProblems->SetValue(30,NbProblems->Value(30)+1); break; NbProblems->SetValue(30,NbProblems->Value(30)+1); break;
case BRepCheck_BadOrientationOfSubshape: case BRepCheck_SubshapeNotInShape:
NbProblems->SetValue(31,NbProblems->Value(31)+1); break; NbProblems->SetValue(31,NbProblems->Value(31)+1); break;
case BRepCheck_CheckFail: case BRepCheck_BadOrientation:
NbProblems->SetValue(32,NbProblems->Value(32)+1); break; NbProblems->SetValue(32,NbProblems->Value(32)+1); break;
case BRepCheck_BadOrientationOfSubshape:
NbProblems->SetValue(33,NbProblems->Value(33)+1); break;
case BRepCheck_InvalidToleranceValue:
NbProblems->SetValue(34,NbProblems->Value(34)+1); break;
case BRepCheck_CheckFail:
NbProblems->SetValue(35,NbProblems->Value(35)+1); break;
default: default:
break; break;
} }
@@ -670,8 +682,9 @@ void StructuralDump(Draw_Interpretor& theCommands,
theCommands<<" Check Count"<<"\n"; theCommands<<" Check Count"<<"\n";
theCommands<<" ------------------------------------------------"<<"\n"; theCommands<<" ------------------------------------------------"<<"\n";
Handle(TColStd_HArray1OfInteger) NbProblems = new TColStd_HArray1OfInteger(1,32); Handle(TColStd_HArray1OfInteger) NbProblems = new
for(i=1; i<=32; i++) NbProblems->SetValue(i,0); TColStd_HArray1OfInteger(1,NumberOfStatus);
for(i=1; i<=NumberOfStatus; i++) NbProblems->SetValue(i,0);
Handle(TopTools_HSequenceOfShape) sl,slv,sle,slw,slf,sls,slo; Handle(TopTools_HSequenceOfShape) sl,slv,sle,slw,slf,sls,slo;
sl = new TopTools_HSequenceOfShape(); sl = new TopTools_HSequenceOfShape();
theMap.Clear(); theMap.Clear();
@@ -724,55 +737,64 @@ void StructuralDump(Draw_Interpretor& theCommands,
theCommands<<" Invalid Range ............................ "<<NbProblems->Value(15)<<"\n"; theCommands<<" Invalid Range ............................ "<<NbProblems->Value(15)<<"\n";
//cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl; //cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
if(NbProblems->Value(16)>0) if(NbProblems->Value(16)>0)
theCommands<<" Empty Wire ............................... "<<NbProblems->Value(16)<<"\n"; theCommands<<" pcurve is out of domain face.............. "<<NbProblems->Value(16)<<"\n";
//cout<<" Empty Wire ............................... "<<NbProblems->Value(16)<<endl; //cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
if(NbProblems->Value(17)>0) if(NbProblems->Value(17)>0)
theCommands<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<"\n"; theCommands<<" Empty Wire ............................... "<<NbProblems->Value(17)<<"\n";
//cout<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<endl; //cout<<" Empty Wire ............................... "<<NbProblems->Value(16)<<endl;
if(NbProblems->Value(18)>0) if(NbProblems->Value(18)>0)
theCommands<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<"\n"; theCommands<<" Redundant Edge ........................... "<<NbProblems->Value(18)<<"\n";
//cout<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<endl; //cout<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<endl;
if(NbProblems->Value(19)>0) if(NbProblems->Value(19)>0)
theCommands<<" No Surface ............................... "<<NbProblems->Value(19)<<"\n"; theCommands<<" Self Intersecting Wire ................... "<<NbProblems->Value(19)<<"\n";
//cout<<" No Surface ............................... "<<NbProblems->Value(19)<<endl; //cout<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<endl;
if(NbProblems->Value(20)>0) if(NbProblems->Value(20)>0)
theCommands<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<"\n"; theCommands<<" No Surface ............................... "<<NbProblems->Value(20)<<"\n";
//cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl; //cout<<" No Surface ............................... "<<NbProblems->Value(19)<<endl;
if(NbProblems->Value(21)>0) if(NbProblems->Value(21)>0)
theCommands<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<"\n"; theCommands<<" Face is out of it surface boundary........ "<<NbProblems->Value(21)<<"\n";
//cout<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<endl; //cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
if(NbProblems->Value(22)>0) if(NbProblems->Value(22)>0)
theCommands<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<"\n"; theCommands<<" Invalid Wire ............................. "<<NbProblems->Value(22)<<"\n";
//cout<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<endl; //cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
if(NbProblems->Value(23)>0) if(NbProblems->Value(23)>0)
theCommands<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<"\n"; theCommands<<" Redundant Wire ........................... "<<NbProblems->Value(23)<<"\n";
//cout<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<endl; //cout<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<endl;
if(NbProblems->Value(24)>0) if(NbProblems->Value(24)>0)
theCommands<<" Empty Shell .............................. "<<NbProblems->Value(24)<<"\n"; theCommands<<" Intersecting Wires ....................... "<<NbProblems->Value(24)<<"\n";
//cout<<" Empty Shell .............................. "<<NbProblems->Value(24)<<endl; //cout<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<endl;
if(NbProblems->Value(25)>0) if(NbProblems->Value(25)>0)
theCommands<<" Redundant Face ........................... "<<NbProblems->Value(25)<<"\n"; theCommands<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(25)<<"\n";
//cout<<" Redundant Face ........................... "<<NbProblems->Value(25)<<endl; //cout<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<endl;
if(NbProblems->Value(26)>0) if(NbProblems->Value(26)>0)
theCommands<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<"\n"; theCommands<<" Empty Shell .............................. "<<NbProblems->Value(26)<<"\n";
//cout<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<endl; //cout<<" Empty Shell .............................. "<<NbProblems->Value(24)<<endl;
if(NbProblems->Value(27)>0) if(NbProblems->Value(27)>0)
theCommands<<" Not Closed ............................... "<<NbProblems->Value(27)<<"\n"; theCommands<<" Redundant Face ........................... "<<NbProblems->Value(27)<<"\n";
//cout<<" Not Closed ............................... "<<NbProblems->Value(27)<<endl; //cout<<" Redundant Face ........................... "<<NbProblems->Value(25)<<endl;
if(NbProblems->Value(28)>0) if(NbProblems->Value(28)>0)
theCommands<<" Not Connected ............................ "<<NbProblems->Value(28)<<"\n"; theCommands<<" Unorientable Shape ....................... "<<NbProblems->Value(28)<<"\n";
//cout<<" Not Connected ............................ "<<NbProblems->Value(28)<<endl; //cout<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<endl;
if(NbProblems->Value(29)>0) if(NbProblems->Value(29)>0)
theCommands<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<"\n"; theCommands<<" Not Closed ............................... "<<NbProblems->Value(29)<<"\n";
//cout<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<endl; //cout<<" Not Closed ............................... "<<NbProblems->Value(27)<<endl;
if(NbProblems->Value(30)>0) if(NbProblems->Value(30)>0)
theCommands<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<"\n"; theCommands<<" Not Connected ............................ "<<NbProblems->Value(30)<<"\n";
//cout<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<endl; //cout<<" Not Connected ............................ "<<NbProblems->Value(28)<<endl;
if(NbProblems->Value(31)>0) if(NbProblems->Value(31)>0)
theCommands<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<"\n"; theCommands<<" Subshape not in Shape .................... "<<NbProblems->Value(31)<<"\n";
//cout<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<endl; //cout<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<endl;
if(NbProblems->Value(32)>0) if(NbProblems->Value(32)>0)
theCommands<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<"\n"; theCommands<<" Bad Orientation .......................... "<<NbProblems->Value(32)<<"\n";
//cout<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<endl;
if(NbProblems->Value(33)>0)
theCommands<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(33)<<"\n";
//cout<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<endl;
if(NbProblems->Value(34)>0)
theCommands<<" Invalid tolerance......................... "<<NbProblems->Value(34)<<"\n";
//cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
if(NbProblems->Value(35)>0)
theCommands<<" checkshape failure........................ "<<NbProblems->Value(35)<<"\n";
//cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl; //cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
//cout<<" ------------------------------------------------"<<endl; //cout<<" ------------------------------------------------"<<endl;

View File

@@ -55,12 +55,6 @@ is
class Point; class Point;
generic class Extremity;
generic class PointOnRst;
generic class Line;
generic class Walking; generic class Walking;
generic class CSWalking; generic class CSWalking;

View File

@@ -25,15 +25,10 @@ generic class CSWalking from Blend
TheCurveTool as any; TheCurveTool as any;
TheTopolTool as Transient; TheTopolTool as Transient;
TheBlendTool as any; TheBlendTool as any;
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc) ThePointOnRst as any;
TheSeqPointOnRst as any; TheSeqPointOnRst as any;
TheExtremity as any; -- as Extremity from Blend(TheVertex,TheArc, TheExtremity as any;
-- ThePointOnRst,TheSeqPointOnRst) TheLine as Transient)
TheLine as Transient) -- as Line from Blend(TheVertex,TheArc,
-- ThePointOnRst,TheSeqPointOnRst,
-- TheExtremity)
---Purpose: ---Purpose:

View File

@@ -25,14 +25,10 @@ generic class Walking from Blend
TheCurveTool as any; TheCurveTool as any;
TheTopolTool as Transient; TheTopolTool as Transient;
TheBlendTool as any; TheBlendTool as any;
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc) ThePointOnRst as any;
TheSeqPointOnRst as any; TheSeqPointOnRst as any;
TheExtremity as any; -- as Extremity from Blend(TheVertex,TheArc, TheExtremity as any;
-- ThePointOnRst,TheSeqPointOnRst) TheLine as Transient)
TheLine as Transient) -- as Line from Blend(TheVertex,TheArc,
-- ThePointOnRst,TheSeqPointOnRst,
-- TheExtremity)
---Purpose: ---Purpose:

View File

@@ -63,24 +63,6 @@ exception UndefinedValue inherits DomainError from Standard;
class HSequenceOfBSplineSurface class HSequenceOfBSplineSurface
instantiates HSequence from TCollection (BSplineSurface from Geom, instantiates HSequence from TCollection (BSplineSurface from Geom,
SequenceOfBSplineSurface from Geom); SequenceOfBSplineSurface from Geom);
-- class SequenceOfBoundedSurface
-- instantiates Sequence from TCollection (BoundedSurface from Geom);
class SequenceOfSurface
instantiates Sequence from TCollection (Surface from Geom);
class HSequenceOfSurface
instantiates HSequence from TCollection (Surface from Geom,
SequenceOfSurface from Geom);
-- class HSequenceOfBoundedSurface
-- instantiates HSequence from TCollection (BoundedSurface from Geom,
-- SequenceOfBoundedSurface from Geom);
-- class SequenceNodeOfSequenceOfSurface
-- instantiates SeqNode from TCollection (Surface from Geom);
-- class HSequenceOfSurface
-- instantiates HSequence from TCollection (Surface from Geom,
-- SequenceOfSurface from Geom);
---Group: Geometric entities ---Group: Geometric entities

View File

@@ -80,6 +80,29 @@ is
raises ConstructionError; raises ConstructionError;
Create (S : Surface from Geom;
isUTrim, isVTrim : Boolean;
U1, U2, V1, V2 : Real)
returns mutable RectangularTrimmedSurface
---Purpose :
-- The U parametric direction of the surface is oriented from U1
-- to U2. The V parametric direction of the surface is oriented
-- from V1 to V2.
-- These two directions define the orientation of the surface
-- (normal). By default in this case the surface has the same
-- orientation as the basis surface S.
-- isUTrim and isVTrim arguments determine, if it is necessary to
-- trim S surface along corresponding direction.
-- The returned surface is not closed and not periodic.
-- ConstructionError Raised if
-- S is not periodic in the UDirection and U1 or U2 are out of the
-- bounds of S.
-- S is not periodic in the VDirection and V1 or V2 are out of the
-- bounds of S.
-- U1 = U2 or V1 = V2
raises ConstructionError;
Create (S : Surface from Geom; Create (S : Surface from Geom;
Param1, Param2 : Real; Param1, Param2 : Real;
@@ -110,6 +133,36 @@ is
-- Param1 or Param2 are out of the bounds of S. -- Param1 or Param2 are out of the bounds of S.
-- Param1 = Param2 -- Param1 = Param2
SetUTrim (me : mutable; U1, U2 : Real)
---Purpose : Sets boundaries of basisSurf in U1 and U2
-- along U-direction.
-- For periodic surface boundary values can be changed
-- algorithmically.
raises ConstructionError;
---Purpose : Raised if
-- The BasisSurface is not periodic in the U-direction and U1 or U2
-- are out of the bounds of the BasisSurface.
-- U1 = U2
SetVTrim (me : mutable; V1, V2 : Real)
---Purpose : Sets boundaries of basisSurf in V1 and V2
-- along V-direction.
-- For periodic surface boundary values can be changed
-- algorithmically.
raises ConstructionError;
---Purpose : Raised if
-- The BasisSurface is not periodic in the V-direction and V1 or V2
-- are out of the bounds of the BasisSurface.
-- V1 = V2
ForceTrim(me : mutable;
U1, U2, V1, V2 : Real;
UTrim, VTrim : Boolean = Standard_True);
---Purpose : For periodic surface this method changes
-- (if it is necessary) U2 and V2, so that 0 < U2 - U1 < T and
-- 0 < V2 - V1 < T (where T is the period).
-- If surface is not periodic, boundaries do not chenge.
-- After that it trims basisSurf in new boundaries.
SetTrim (me : mutable; SetTrim (me : mutable;
U1, U2, V1, V2 : Real; U1, U2, V1, V2 : Real;
@@ -362,6 +415,10 @@ is
Copy (me) returns mutable like me; Copy (me) returns mutable like me;
---Purpose: Creates a new object which is a copy of this patch. ---Purpose: Creates a new object which is a copy of this patch.
GetTrimmedFlags(me; isUtrimmed,isVtrimmed : in out Boolean from Standard);
---Purpose: Allows to get <isutrimmed> and <isvtrimmed> members values.
fields fields
basisSurf : Surface from Geom; basisSurf : Surface from Geom;

View File

@@ -83,6 +83,45 @@ Handle(Geom_Geometry) Geom_RectangularTrimmedSurface::Copy () const {
return S; return S;
} }
//=======================================================================
//function : Geom_RectangularTrimmedSurface
//purpose :
//=======================================================================
Geom_RectangularTrimmedSurface::Geom_RectangularTrimmedSurface(
const Handle(Geom_Surface)& S,
const Standard_Boolean isUTrim,
const Standard_Boolean isVTrim,
const Standard_Real U1,
const Standard_Real U2,
const Standard_Real V1,
const Standard_Real V2): utrim1(U1),
vtrim1(V1),
utrim2(U2),
vtrim2(V2),
isutrimmed (isUTrim),
isvtrimmed (isVTrim)
{
// kill trimmed basis surfaces
Handle(Geom_RectangularTrimmedSurface) T =
Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
if (!T.IsNull())
basisSurf = Handle(Surface)::DownCast(T->BasisSurface()->Copy());
else
basisSurf = Handle(Surface)::DownCast(S->Copy());
Handle(Geom_OffsetSurface) O =
Handle(Geom_OffsetSurface)::DownCast(basisSurf);
if (!O.IsNull())
{
Handle(Geom_RectangularTrimmedSurface) S2 =
new Geom_RectangularTrimmedSurface( O->BasisSurface(),U1,U2, V1, V2, isUTrim, isVTrim);
Handle(Geom_OffsetSurface) OS = new Geom_OffsetSurface(S2, O->Offset());
basisSurf = Handle(Surface)::DownCast(OS);
}
ForceTrim( U1, U2, V1, V2, isUTrim, isVTrim);
}
//======================================================================= //=======================================================================
//function : Geom_RectangularTrimmedSurface //function : Geom_RectangularTrimmedSurface
@@ -164,6 +203,172 @@ Geom_RectangularTrimmedSurface::Geom_RectangularTrimmedSurface (
SetTrim(Param1, Param2, UTrim, Sense); SetTrim(Param1, Param2, UTrim, Sense);
} }
//=======================================================================
//function : SetUTrim
//purpose :
//=======================================================================
void Geom_RectangularTrimmedSurface::SetUTrim(const Standard_Real theU1,
const Standard_Real theU2)
{
const Standard_Real Udeb = utrim1, Ufin = utrim2;
utrim1 = theU1;
utrim2 = theU2;
if ( utrim1 == utrim2)
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::U1==U2");
if (basisSurf->IsUPeriodic())
{
ElCLib::AdjustPeriodic(Udeb, Ufin,
Min(Abs(utrim2-utrim1)/2,Precision::PConfusion()), utrim1, utrim2);
}//if (basisSurf->IsUPeriodic())
else
{
if (utrim1 > utrim2)
{
//change some places of theUTrim1 and theUTrim2
Standard_Real ut = utrim1;
utrim1 = utrim2;
utrim2 = ut;
}
if ( (Udeb-utrim1 > Precision::PConfusion()) ||
(utrim2-Ufin > Precision::PConfusion()))
{
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::Uparameters out of range");
}
}
}
//=======================================================================
//function : SetVTrim
//purpose :
//=======================================================================
void Geom_RectangularTrimmedSurface::SetVTrim(const Standard_Real theV1,
const Standard_Real theV2)
{
const Standard_Real Vdeb = vtrim1, Vfin = vtrim2;
vtrim1 = theV1;
vtrim2 = theV2;
if ( vtrim1 == vtrim2)
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::V1==V2");
if (basisSurf->IsVPeriodic())
{
ElCLib::AdjustPeriodic(Vdeb, Vfin,
Min(Abs(vtrim2-vtrim1)/2,Precision::PConfusion()),vtrim1, vtrim2);
}//if (basisSurf->IsVPeriodic())
else
{
if (vtrim1 > vtrim2)
{
Standard_Real vt = vtrim1;
vtrim1 = vtrim2;
vtrim2 = vt;
}
if ( (Vdeb-vtrim1 > Precision::PConfusion()) ||
(vtrim2-Vfin > Precision::PConfusion()))
{
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::V parameters out of range");
}
}
}
//=======================================================================
//function : ForceTrim
//purpose :
//=======================================================================
void Geom_RectangularTrimmedSurface::ForceTrim(const Standard_Real theU1,
const Standard_Real theU2,
const Standard_Real theV1,
const Standard_Real theV2,
const Standard_Boolean isUTrim,
const Standard_Boolean isVTrim)
{
basisSurf->Bounds(utrim1, utrim2, vtrim1, vtrim2);
isutrimmed = isUTrim;
isvtrimmed = isVTrim;
// Trimming along U-Direction
if (isutrimmed)
{
utrim1 = theU1;
utrim2 = theU2;
if((utrim1 > utrim2) || !(basisSurf->IsUPeriodic()))
{
//Standard_ConstructionError::Raise
// ("Geom_RectangularTrimmedSurface::ForceTrim(...). "
// "utrim1 > utrim2");
SetUTrim(theU1,theU2);
}
else
{
const Standard_Real aTolPeriodicFactor = 1.0e-7;
const Standard_Real aT = basisSurf->UPeriod();
const Standard_Real aTol = aTolPeriodicFactor * aT;
if(utrim2 - utrim1 - aT > 2.0*aTol)
{
Standard_Integer n = RealToInt((utrim2 - utrim1)/aT);
utrim2 -= (n * aT);
if(utrim2 - utrim1 < aTol)
utrim2 += aT;
}
//if(utrim2 - utrim1 < aTol)
// Standard_ConstructionError::Raise
// ("Geom_RectangularTrimmedSurface::SetTrim(...)."
// "ERROR in adjust U-parameter!");
}
}
// Trimming along V-Direction
if (isvtrimmed)
{
vtrim1 = theV1;
vtrim2 = theV2;
if ((vtrim1 > vtrim2) || !(basisSurf->IsVPeriodic()))
{
//Standard_ConstructionError::Raise
// ("Geom_RectangularTrimmedSurface::ForceTrim(...). "
// "vtrim1 > vtrim2");
SetVTrim(theV1,theV2);
}
else
{
const Standard_Real aTolPeriodicFactor = 1.0e-7;
const Standard_Real aT = basisSurf->VPeriod();
const Standard_Real aTol = aTolPeriodicFactor * aT;
if(vtrim2 - vtrim1 - aT > 2.0*aTol)
{
Standard_Integer n = RealToInt((vtrim2 - vtrim1)/aT);
vtrim2 -= (n * aT);
if(vtrim2 - vtrim1 < aTol)
vtrim2 += aT;
}
//if(vtrim2 - vtrim1 < aTol)
// Standard_ConstructionError::Raise
// ("Geom_RectangularTrimmedSurface::SetTrim(...)."
// "ERROR in adjust V-parameter!");
}
}
}
//======================================================================= //=======================================================================
//function : SetTrim //function : SetTrim
@@ -217,107 +422,36 @@ void Geom_RectangularTrimmedSurface::SetTrim (const Standard_Real Param1,
//purpose : //purpose :
//======================================================================= //=======================================================================
void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1, void Geom_RectangularTrimmedSurface::SetTrim(
const Standard_Real U2, const Standard_Real theU1,
const Standard_Real V1, const Standard_Real theU2,
const Standard_Real V2, const Standard_Real theV1,
const Standard_Boolean UTrim, const Standard_Real theV2,
const Standard_Boolean VTrim, const Standard_Boolean isUTrim,
const Standard_Boolean USense, const Standard_Boolean isVTrim,
const Standard_Boolean VSense) { const Standard_Boolean isUSense,
const Standard_Boolean isVSense)
{
Standard_Boolean UsameSense = !(isUSense && (theU1 > theU2));
Standard_Boolean VsameSense = !(isVSense && (theV1 > theV2));
Standard_Boolean UsameSense = Standard_True; basisSurf->Bounds(utrim1, utrim2, vtrim1, vtrim2);
Standard_Boolean VsameSense = Standard_True;
Standard_Real Udeb, Ufin, Vdeb, Vfin;
basisSurf->Bounds(Udeb, Ufin, Vdeb, Vfin); isutrimmed = isUTrim;
isvtrimmed = isVTrim;
// Trimming the U-Direction // Trimming the U-Direction
isutrimmed = UTrim; if (isutrimmed)
if (!UTrim) { SetUTrim(theU1,theU2);
utrim1 = Udeb;
utrim2 = Ufin;
}
else {
if ( U1 == U2)
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::U1==U2");
if (basisSurf->IsUPeriodic()) {
UsameSense = USense;
// set uTrim1 in the range Udeb , Ufin
// set uTrim2 in the range uTrim1 , uTrim1 + Period()
utrim1 = U1;
utrim2 = U2;
ElCLib::AdjustPeriodic(Udeb, Ufin,
Min(Abs(utrim2-utrim1)/2,Precision::PConfusion()),
utrim1, utrim2);
}
else {
if (U1 < U2) {
UsameSense = USense;
utrim1 = U1;
utrim2 = U2;
}
else {
UsameSense = !USense;
utrim1 = U2;
utrim2 = U1;
}
if ((Udeb-utrim1 > Precision::PConfusion()) ||
(utrim2-Ufin > Precision::PConfusion()))
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::U parameters out of range");
}
}
// Trimming the V-Direction // Trimming the V-Direction
isvtrimmed = VTrim; if (isvtrimmed)
if (!VTrim) { SetVTrim(theV1,theV2);
vtrim1 = Vdeb;
vtrim2 = Vfin;
}
else {
if ( V1 == V2)
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::V1==V2");
if (basisSurf->IsVPeriodic()) { if (!UsameSense)
VsameSense = VSense; UReverse();
if (!VsameSense)
// set vTrim1 in the range Vdeb , Vfin VReverse();
// set vTrim2 in the range vTrim1 , vTrim1 + Period()
vtrim1 = V1;
vtrim2 = V2;
ElCLib::AdjustPeriodic(Vdeb, Vfin,
Min(Abs(vtrim2-vtrim1)/2,Precision::PConfusion()),
vtrim1, vtrim2);
}
else {
if (V1 < V2) {
VsameSense = VSense;
vtrim1 = V1;
vtrim2 = V2;
}
else {
VsameSense = !VSense;
vtrim1 = V2;
vtrim2 = V1;
}
if ((Vdeb-vtrim1 > Precision::PConfusion()) ||
(vtrim2-Vfin > Precision::PConfusion()))
Standard_ConstructionError::Raise
("Geom_RectangularTrimmedSurface::V parameters out of range");
}
}
if (!UsameSense) UReverse();
if (!VsameSense) VReverse();
} }
@@ -662,3 +796,12 @@ gp_GTrsf2d Geom_RectangularTrimmedSurface::ParametricTransformation
return basisSurf->ParametricTransformation(T); return basisSurf->ParametricTransformation(T);
} }
//=======================================================================
//function : GetTrimmedFlags
//purpose :
//=======================================================================
void Geom_RectangularTrimmedSurface::GetTrimmedFlags(Standard_Boolean& isU, Standard_Boolean& isV) const
{
isU = isutrimmed;
isV = isvtrimmed;
}

View File

@@ -30,20 +30,19 @@ is
class Curve2dTool; class Curve2dTool;
class CLProps2d from Geom2dLProp class CLProps2d from Geom2dLProp instantiates
instantiates CLProps from LProp(Curve from Geom2d, CLProps from LProp(Curve from Geom2d,
Vec2d from gp, Vec2d from gp,
Pnt2d from gp, Pnt2d from gp,
Dir2d from gp, Dir2d from gp,
Curve2dTool from Geom2dLProp); Curve2dTool from Geom2dLProp);
class CurAndInf2d; class CurAndInf2d;
private class NumericCurInf2d instantiates NumericCurInf from LProp( private class FuncCurExt;
Curve from Geom2d, private class FuncCurNul;
Vec2d from gp, class NumericCurInf2d;
Pnt2d from gp, ---Purpose: Computes the locals extremas of curvature and the
Dir2d from gp, -- inflections of a bounded curve in 2d.
Curve2dTool from Geom2dLProp);
end Geom2dLProp; end Geom2dLProp;

View File

@@ -14,16 +14,17 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
private generic class FuncCurExt from LProp (Curve as any; private class FuncCurExt from Geom2dLProp inherits FunctionWithDerivative from math
Vec as any; -- as Vec or Vec2d
Pnt as any; -- as Pnt or Pnt2d
Dir as any; -- as Dir or Dir2d Vec
Tool as any) -- as Tool(Curve, Pnt, Vec)
inherits FunctionWithDerivative from math
---Purpose: Function used to find the extremas of curvature in 2d. ---Purpose: Function used to find the extremas of curvature in 2d.
uses Curve from Geom2d,
Vec2d from gp,
Pnt2d from gp,
Dir2d from gp,
Curve2dTool from Geom2dLProp
is is
Create ( C : Curve ; Tol : Real) returns FuncCurExt from LProp; Create ( C : Curve from Geom2d ; Tol : Real) returns FuncCurExt from Geom2dLProp;
Value (me : in out; X : Real; F : out Real) Value (me : in out; X : Real; F : out Real)
---Purpose: Returns the value for the variable <X>. ---Purpose: Returns the value for the variable <X>.
@@ -44,7 +45,7 @@ is
returns Boolean; returns Boolean;
fields fields
theCurve : Curve; theCurve : Curve from Geom2d;
epsX : Real from Standard; epsX : Real from Standard;
end FuncCurExt; end FuncCurExt;

View File

@@ -14,6 +14,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dLProp_FuncCurExt.ixx>
#include <gp_Pnt2d.hxx>
#include <Geom2dLProp_Curve2dTool.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <Precision.hxx> #include <Precision.hxx>
@@ -21,9 +26,9 @@
//function : //function :
// purpose : // purpose :
//============================================================================= //=============================================================================
LProp_FuncCurExt::LProp_FuncCurExt(const Curve& C, Geom2dLProp_FuncCurExt::Geom2dLProp_FuncCurExt(const Handle(Geom2d_Curve)& C,
const Standard_Real Tol) const Standard_Real Tol)
:theCurve(C) :theCurve(C)
{ {
epsX = Tol; epsX = Tol;
} }
@@ -33,13 +38,13 @@ LProp_FuncCurExt::LProp_FuncCurExt(const Curve& C,
// purpose : KC = (V1^V2.Z) / ||V1||^3 avec V1 tangente etV2 derivee seconde. // purpose : KC = (V1^V2.Z) / ||V1||^3 avec V1 tangente etV2 derivee seconde.
// F = d KC/ dU. // F = d KC/ dU.
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurExt::Value (const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurExt::Value (const Standard_Real X,
Standard_Real& F) Standard_Real& F)
{ {
Pnt P1; gp_Pnt2d P1;
Vec V1,V2,V3; gp_Vec2d V1,V2,V3;
Tool::D3(theCurve,X,P1,V1,V2,V3); Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3);
Standard_Real CPV1V2 = V1.Crossed(V2); Standard_Real CPV1V2 = V1.Crossed(V2);
Standard_Real CPV1V3 = V1.Crossed(V3); Standard_Real CPV1V3 = V1.Crossed(V3);
Standard_Real V1V2 = V1.Dot(V2); Standard_Real V1V2 = V1.Dot(V2);
@@ -60,8 +65,8 @@ Standard_Boolean LProp_FuncCurExt::Value (const Standard_Real X,
//function : Derivative //function : Derivative
// purpose : // purpose :
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurExt::Derivative(const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurExt::Derivative(const Standard_Real X,
Standard_Real& D) Standard_Real& D)
{ {
Standard_Real F; Standard_Real F;
return Values (X,F,D) ; return Values (X,F,D) ;
@@ -71,14 +76,14 @@ Standard_Boolean LProp_FuncCurExt::Derivative(const Standard_Real X,
//function : Values //function : Values
// purpose : // purpose :
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurExt::Values (const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurExt::Values (const Standard_Real X,
Standard_Real& F, Standard_Real& F,
Standard_Real& D) Standard_Real& D)
{ {
Standard_Real F2; Standard_Real F2;
Standard_Real Dx= epsX/100.; Standard_Real Dx= epsX/100.;
if (X+Dx > Tool::LastParameter(theCurve)) {Dx = - Dx;} if (X+Dx > Geom2dLProp_Curve2dTool::LastParameter(theCurve)) {Dx = - Dx;}
Value (X,F); Value (X,F);
Value (X+Dx,F2); Value (X+Dx,F2);
@@ -93,14 +98,14 @@ Standard_Boolean LProp_FuncCurExt::Values (const Standard_Real X,
// purpose : Teste si le parametere coorespond a un minimum du rayon de courbure // purpose : Teste si le parametere coorespond a un minimum du rayon de courbure
// par comparaison avec un point voisin. // par comparaison avec un point voisin.
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurExt::IsMinKC (const Standard_Real X) const Standard_Boolean Geom2dLProp_FuncCurExt::IsMinKC (const Standard_Real X) const
{ {
Pnt P1; gp_Pnt2d P1;
Vec V1,V2,V3; gp_Vec2d V1,V2,V3;
Standard_Real Dx= epsX; Standard_Real Dx= epsX;
Standard_Real KC,KP; Standard_Real KC,KP;
Tool::D3(theCurve,X,P1,V1,V2,V3); Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3);
Standard_Real CPV1V2 = V1.Crossed(V2); Standard_Real CPV1V2 = V1.Crossed(V2);
Standard_Real V1V1 = V1.SquareMagnitude(); Standard_Real V1V1 = V1.SquareMagnitude();
Standard_Real NV1 = Sqrt(V1V1); Standard_Real NV1 = Sqrt(V1V1);
@@ -110,9 +115,9 @@ Standard_Boolean LProp_FuncCurExt::IsMinKC (const Standard_Real X) const
KC = CPV1V2/V13; KC = CPV1V2/V13;
if (X+Dx > Tool::LastParameter(theCurve)) {Dx = - Dx;} if (X+Dx > Geom2dLProp_Curve2dTool::LastParameter(theCurve)) {Dx = - Dx;}
Tool::D3(theCurve,X+Dx,P1,V1,V2,V3); Geom2dLProp_Curve2dTool::D3(theCurve,X+Dx,P1,V1,V2,V3);
CPV1V2 = V1.Crossed(V2); CPV1V2 = V1.Crossed(V2);
V1V1 = V1.SquareMagnitude(); V1V1 = V1.SquareMagnitude();
NV1 = Sqrt(V1V1); NV1 = Sqrt(V1V1);

View File

@@ -14,16 +14,18 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
private generic class FuncCurNul from LProp (Curve as any; private class FuncCurNul from Geom2dLProp inherits FunctionWithDerivative from math
Vec as any; -- as Vec or Vec2d
Pnt as any; -- as Pnt or Pnt2d
Dir as any; -- as Dir or Dir2d Vec
Tool as any) -- as Tool(Curve, Pnt, Vec)
inherits FunctionWithDerivative from math
---Purpose: Function used to find the inflections in 2d. ---Purpose: Function used to find the inflections in 2d.
uses
Curve from Geom2d,
Vec2d from gp,
Pnt2d from gp,
Dir2d from gp,
Curve2dTool from Geom2dLProp
is is
Create ( C : Curve) returns FuncCurNul from LProp; Create ( C : Curve from Geom2d) returns FuncCurNul from Geom2dLProp;
Value (me : in out; X : Real; F : out Real) Value (me : in out; X : Real; F : out Real)
---Purpose: Returns the value for the variable <X>. ---Purpose: Returns the value for the variable <X>.
@@ -39,7 +41,7 @@ is
returns Boolean; returns Boolean;
fields fields
theCurve : Curve; theCurve : Curve from Geom2d;
end FuncCurNul; end FuncCurNul;

View File

@@ -14,6 +14,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dLProp_FuncCurNul.ixx>
#include <gp_Pnt2d.hxx>
#include <Geom2dLProp_Curve2dTool.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <Precision.hxx> #include <Precision.hxx>
@@ -21,7 +26,7 @@
//function : //function :
// purpose : // purpose :
//============================================================================= //=============================================================================
LProp_FuncCurNul::LProp_FuncCurNul(const Curve& C) Geom2dLProp_FuncCurNul::Geom2dLProp_FuncCurNul(const Handle(Geom2d_Curve)& C)
:theCurve(C) :theCurve(C)
{ {
} }
@@ -30,7 +35,7 @@ LProp_FuncCurNul::LProp_FuncCurNul(const Curve& C)
//function : Value //function : Value
// purpose : F = (V1^V2.Z)/||V1||*||V2|| // purpose : F = (V1^V2.Z)/||V1||*||V2||
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurNul::Value (const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurNul::Value (const Standard_Real X,
Standard_Real& F) Standard_Real& F)
{ {
Standard_Real D; Standard_Real D;
@@ -41,7 +46,7 @@ Standard_Boolean LProp_FuncCurNul::Value (const Standard_Real X,
//function : Derivative //function : Derivative
// purpose : // purpose :
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurNul::Derivative(const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurNul::Derivative(const Standard_Real X,
Standard_Real& D) Standard_Real& D)
{ {
Standard_Real F; Standard_Real F;
@@ -52,13 +57,13 @@ Standard_Boolean LProp_FuncCurNul::Derivative(const Standard_Real X,
//function : Values //function : Values
// purpose : F = (V1^V2.Z)/||V1||*||V2|| // purpose : F = (V1^V2.Z)/||V1||*||V2||
//============================================================================= //=============================================================================
Standard_Boolean LProp_FuncCurNul::Values (const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurNul::Values (const Standard_Real X,
Standard_Real& F, Standard_Real& F,
Standard_Real& D) Standard_Real& D)
{ {
Pnt P1; gp_Pnt2d P1;
Vec V1,V2,V3; gp_Vec2d V1,V2,V3;
Tool::D3(theCurve,X,P1,V1,V2,V3); Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3);
Standard_Real CP1 = V1.Crossed(V2); Standard_Real CP1 = V1.Crossed(V2);
Standard_Real CP2 = V1.Crossed(V3); Standard_Real CP2 = V1.Crossed(V3);
Standard_Real V1V2 = V1.Dot(V2); Standard_Real V1V2 = V1.Dot(V2);

View File

@@ -14,34 +14,33 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class NumericCurInf from LProp (Curve as any; class NumericCurInf2d from Geom2dLProp
Vec as any; -- as Vec or Vec2d
Pnt as any; -- as Pnt or Pnt2d
Dir as any; -- as Dir or Dir2d Vec
Tool as any) -- as Tool(Curve, Pnt, Vec)
---Purpose: Computes the locals extremas of curvature and the ---Purpose: Computes the locals extremas of curvature and the
-- inflections of a bounded curve in 2d. -- inflections of a bounded curve in 2d.
uses uses
CurAndInf from LProp CurAndInf from LProp,
Curve from Geom2d,
private class FCurExt instantiates FuncCurExt from LProp (Curve,Vec,Pnt,Dir,Tool); Vec2d from gp,
private class FCurNul instantiates FuncCurNul from LProp (Curve,Vec,Pnt,Dir,Tool); Pnt2d from gp,
Dir2d from gp,
Curve2dTool from Geom2dLProp
is is
Create; Create;
PerformCurExt (me : in out; C : Curve; Result : in out CurAndInf) PerformCurExt (me : in out; C : Curve from Geom2d; Result : in out CurAndInf)
---Purpose: Computes the locals extremas of curvature. ---Purpose: Computes the locals extremas of curvature.
is static; is static;
PerformInf (me : in out; C : Curve; Result : in out CurAndInf) PerformInf (me : in out; C : Curve from Geom2d; Result : in out CurAndInf)
---Purpose: Computes the inflections. ---Purpose: Computes the inflections.
is static; is static;
PerformCurExt (me : in out; PerformCurExt (me : in out;
C : Curve ; C : Curve from Geom2d ;
UMin : Real; UMin : Real;
UMax : Real; UMax : Real;
Result : in out CurAndInf) Result : in out CurAndInf)
@@ -50,7 +49,7 @@ is
is static; is static;
PerformInf (me : in out; PerformInf (me : in out;
C : Curve ; C : Curve from Geom2d ;
UMin : Real; UMin : Real;
UMax : Real; UMax : Real;
Result : in out CurAndInf) Result : in out CurAndInf)
@@ -65,4 +64,4 @@ is
fields fields
isDone : Boolean from Standard; isDone : Boolean from Standard;
end NumericCurInf; end NumericCurInf2d;

View File

@@ -14,6 +14,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dLProp_NumericCurInf2d.ixx>
#include <Geom2dLProp_FuncCurExt.hxx>
#include <Geom2dLProp_FuncCurNul.hxx>
#include <Geom2dLProp_Curve2dTool.hxx>
#include <math_FunctionRoots.hxx> #include <math_FunctionRoots.hxx>
#include <math_BracketedRoot.hxx> #include <math_BracketedRoot.hxx>
#include <Precision.hxx> #include <Precision.hxx>
@@ -22,26 +28,26 @@
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
LProp_NumericCurInf::LProp_NumericCurInf() Geom2dLProp_NumericCurInf2d::Geom2dLProp_NumericCurInf2d()
{ {
} }
//======================================================================= //=======================================================================
//function : PerformCurExt //function : PerformCurExt
//purpose : //purpose :
//======================================================================= //=======================================================================
void LProp_NumericCurInf::PerformCurExt (const Curve& C,LProp_CurAndInf& Result) void Geom2dLProp_NumericCurInf2d::PerformCurExt (const Handle(Geom2d_Curve)& C,LProp_CurAndInf& Result)
{ {
PerformCurExt(C,Tool::FirstParameter(C),Tool::LastParameter(C),Result); PerformCurExt(C,Geom2dLProp_Curve2dTool::FirstParameter(C),Geom2dLProp_Curve2dTool::LastParameter(C),Result);
} }
//======================================================================= //=======================================================================
//function : PerformCurExt //function : PerformCurExt
//purpose : //purpose :
//======================================================================= //=======================================================================
void LProp_NumericCurInf::PerformCurExt (const Curve& C, void Geom2dLProp_NumericCurInf2d::PerformCurExt (const Handle(Geom2d_Curve)& C,
const Standard_Real UMin, const Standard_Real UMin,
const Standard_Real UMax, const Standard_Real UMax,
LProp_CurAndInf& Result) LProp_CurAndInf& Result)
{ {
isDone = Standard_True; isDone = Standard_True;
@@ -51,7 +57,7 @@ void LProp_NumericCurInf::PerformCurExt (const Curve& C,
// la premiere recherce se fait avec une tolerance assez grande // la premiere recherce se fait avec une tolerance assez grande
// car la derivee de la fonction est estimee assez grossierement. // car la derivee de la fonction est estimee assez grossierement.
LProp_FCurExt F(C,EpsH); Geom2dLProp_FuncCurExt F(C,EpsH);
Standard_Integer NbSamples = 100; Standard_Integer NbSamples = 100;
Standard_Boolean SolType; Standard_Boolean SolType;
@@ -62,9 +68,9 @@ void LProp_NumericCurInf::PerformCurExt (const Curve& C,
Standard_Real Param = SolRoot.Value(j); Standard_Real Param = SolRoot.Value(j);
// la solution est affinee. // la solution est affinee.
math_BracketedRoot BS (F, math_BracketedRoot BS (F,
Param - EpsH, Param - EpsH,
Param + EpsH, Param + EpsH,
Tol); Tol);
if (BS.IsDone()) {Param = BS.Root();} if (BS.IsDone()) {Param = BS.Root();}
SolType = F.IsMinKC(Param); SolType = F.IsMinKC(Param);
Result.AddExtCur(Param,SolType); Result.AddExtCur(Param,SolType);
@@ -79,22 +85,22 @@ void LProp_NumericCurInf::PerformCurExt (const Curve& C,
//function : PerformInf //function : PerformInf
//purpose : //purpose :
//======================================================================= //=======================================================================
void LProp_NumericCurInf::PerformInf(const Curve& C,LProp_CurAndInf& Result) void Geom2dLProp_NumericCurInf2d::PerformInf(const Handle(Geom2d_Curve)& C,LProp_CurAndInf& Result)
{ {
PerformInf(C,Tool::FirstParameter(C),Tool::LastParameter(C),Result); PerformInf(C,Geom2dLProp_Curve2dTool::FirstParameter(C),Geom2dLProp_Curve2dTool::LastParameter(C),Result);
} }
//======================================================================= //=======================================================================
//function : PerformInf //function : PerformInf
//purpose : //purpose :
//======================================================================= //=======================================================================
void LProp_NumericCurInf::PerformInf(const Curve& C, void Geom2dLProp_NumericCurInf2d::PerformInf(const Handle(Geom2d_Curve)& C,
const Standard_Real UMin, const Standard_Real UMin,
const Standard_Real UMax, const Standard_Real UMax,
LProp_CurAndInf& Result) LProp_CurAndInf& Result)
{ {
isDone = Standard_True; isDone = Standard_True;
LProp_FCurNul F(C); Geom2dLProp_FuncCurNul F(C);
Standard_Real EpsX = 1.e-6; Standard_Real EpsX = 1.e-6;
Standard_Real EpsF = 1.e-6; Standard_Real EpsF = 1.e-6;
Standard_Integer NbSamples = 30; Standard_Integer NbSamples = 30;
@@ -115,7 +121,7 @@ void LProp_NumericCurInf::PerformInf(const Curve& C,
//function : IsDone //function : IsDone
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean LProp_NumericCurInf::IsDone() const Standard_Boolean Geom2dLProp_NumericCurInf2d::IsDone() const
{ {
return isDone; return isDone;
} }

View File

@@ -31,6 +31,7 @@
#include <gp_GTrsf.hxx> #include <gp_GTrsf.hxx>
#include <gp_Mat.hxx> #include <gp_Mat.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
#include <gp_Sphere.hxx>
#include <TColgp_Array1OfPnt.hxx> #include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array2OfPnt.hxx> #include <TColgp_Array2OfPnt.hxx>
@@ -59,6 +60,7 @@
#include <Geom_SphericalSurface.hxx> #include <Geom_SphericalSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx> #include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_RectangularTrimmedSurface.hxx> #include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Approx_SweepApproximation.hxx> #include <Approx_SweepApproximation.hxx>
#include <AdvApprox_PrefAndRec.hxx> #include <AdvApprox_PrefAndRec.hxx>
@@ -67,6 +69,7 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <ElSLib.hxx>
//======================================================================= //=======================================================================
//class : GeomFill_Sweep_Eval //class : GeomFill_Sweep_Eval
@@ -844,24 +847,32 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
SError = error; SError = error;
Centre.BaryCenter(1.0, C.Location(), 1.0); Centre.BaryCenter(1.0, C.Location(), 1.0);
gp_Ax3 AxisOfSphere(Centre, DN, DS); gp_Ax3 AxisOfSphere(Centre, DN, DS);
S = new (Geom_SphericalSurface) gp_Sphere theSphere( AxisOfSphere, (RotRadius + C.Radius())/2 );
(AxisOfSphere, (RotRadius + C.Radius())/2 ); S = new Geom_SphericalSurface(theSphere);
// Pour les spheres on ne peut pas controler le parametre // Pour les spheres on ne peut pas controler le parametre
// V (donc U car myExchUV = Standard_True) // V (donc U car myExchUV = Standard_True)
// Il faut donc modifier UFirst, ULast... // Il faut donc modifier UFirst, ULast...
if (C.Position().Direction(). Standard_Real fpar = AC.FirstParameter();
IsOpposite(AxisOfSphere.YDirection(), 0.1) ) { Standard_Real lpar = AC.LastParameter();
Handle(Geom_Curve) theSection = new Geom_TrimmedCurve(Section, fpar, lpar);
theSection->Transform(Tf2);
gp_Pnt FirstPoint = theSection->Value(theSection->FirstParameter());
gp_Pnt LastPoint = theSection->Value(theSection->LastParameter());
Standard_Real UfirstOnSec, VfirstOnSec, UlastOnSec, VlastOnSec;
ElSLib::Parameters(theSphere, FirstPoint, UfirstOnSec, VfirstOnSec);
ElSLib::Parameters(theSphere, LastPoint, UlastOnSec, VlastOnSec);
if (VfirstOnSec < VlastOnSec)
{
f = VfirstOnSec;
l = VlastOnSec;
}
else
{
// L'orientation parametrique est inversee // L'orientation parametrique est inversee
l = 2*M_PI - UFirst; f = VlastOnSec;
f = 2*M_PI - ULast; l = VfirstOnSec;
isUReversed = Standard_True; isUReversed = Standard_True;
} }
// On calcul le "glissement" parametrique.
Standard_Real rot;
rot = C.Position().XDirection().AngleWithRef
(AxisOfSphere.XDirection(), AxisOfSphere.YDirection());
f -= rot;
l -= rot;
if ( (f >= -M_PI/2) && (l <= M_PI/2)) { if ( (f >= -M_PI/2) && (l <= M_PI/2)) {
Ok = Standard_True; Ok = Standard_True;

View File

@@ -523,8 +523,15 @@ static void Print(const Handle(Geom_RectangularTrimmedSurface)& S,
if (compact) if (compact)
OS << RECTANGULAR << " "; OS << RECTANGULAR << " ";
else else
{
OS << "RectangularTrimmedSurface"; OS << "RectangularTrimmedSurface";
Standard_Boolean isUtr, isVtr;
S->GetTrimmedFlags(isUtr, isVtr);
OS << " (uTrim = " << isUtr << ", vTrim = " << isVtr << ")";
}
Standard_Real U1,U2,V1,V2; Standard_Real U1,U2,V1,V2;
S->Bounds(U1,U2,V1,V2); S->Bounds(U1,U2,V1,V2);
if (!compact) OS << "\nParameters : "; if (!compact) OS << "\nParameters : ";

View File

@@ -1,5 +1,7 @@
Graphic3d_CGroup.cxx Graphic3d_CAspectFillArea.hxx
Graphic3d_CGroup.hxx Graphic3d_CAspectLine.hxx
Graphic3d_CAspectMarker.hxx
Graphic3d_CAspectText.hxx
Graphic3d_CStructure.cxx Graphic3d_CStructure.cxx
Graphic3d_CStructure.hxx Graphic3d_CStructure.hxx
Graphic3d_CStructure_Handle.hxx Graphic3d_CStructure_Handle.hxx
@@ -25,12 +27,7 @@ Graphic3d_CView.cxx
Graphic3d_CView.hxx Graphic3d_CView.hxx
Graphic3d_CGraduatedTrihedron.cxx Graphic3d_CGraduatedTrihedron.cxx
Graphic3d_CGraduatedTrihedron.hxx Graphic3d_CGraduatedTrihedron.hxx
Graphic3d_Structure.pxx Graphic3d_Structure.lxx
Graphic3d_Group.pxx
Graphic3d_Group_1.cxx
Graphic3d_Group_2.cxx
Graphic3d_Group_8.cxx
Graphic3d_Group_10.cxx
Graphic3d_Structure.pxx Graphic3d_Structure.pxx
Graphic3d_ShaderObject.hxx Graphic3d_ShaderObject.hxx
Graphic3d_ShaderObject.cxx Graphic3d_ShaderObject.cxx
@@ -49,7 +46,6 @@ Graphic3d.edl
Graphic3d_CMPLRS.edl Graphic3d_CMPLRS.edl
Graphic3d_WOKSteps.edl Graphic3d_WOKSteps.edl
Graphic3d_PrimitiveArray.hxx Graphic3d_PrimitiveArray.hxx
Graphic3d_Group_13.cxx
Graphic3d_TransModeFlags.hxx Graphic3d_TransModeFlags.hxx
Graphic3d_CTransPersStruct.hxx Graphic3d_CTransPersStruct.hxx
Graphic3d_CTransPersStruct.cxx Graphic3d_CTransPersStruct.cxx
@@ -71,6 +67,7 @@ Graphic3d_MarkerImage_Handle.hxx
Graphic3d_ClipPlane.hxx Graphic3d_ClipPlane.hxx
Graphic3d_ClipPlane.cxx Graphic3d_ClipPlane.cxx
Graphic3d_ClipPlane_Handle.hxx Graphic3d_ClipPlane_Handle.hxx
Graphic3d_SequenceOfGroup.hxx
Graphic3d_SequenceOfHClipPlane.hxx Graphic3d_SequenceOfHClipPlane.hxx
Graphic3d_SequenceOfHClipPlane_Handle.hxx Graphic3d_SequenceOfHClipPlane_Handle.hxx
Graphic3d_Camera.cxx Graphic3d_Camera.cxx

View File

@@ -94,9 +94,6 @@ is
exception MaterialDefinitionError inherits OutOfRange; exception MaterialDefinitionError inherits OutOfRange;
---Category: Exceptions ---Category: Exceptions
exception PickIdDefinitionError inherits OutOfRange;
---Category: Exceptions
exception PlotterDefinitionError inherits OutOfRange; exception PlotterDefinitionError inherits OutOfRange;
---Category: The exceptions ---Category: The exceptions
@@ -358,14 +355,17 @@ is
---Purpose: Defines the C structure ---Purpose: Defines the C structure
---Category: Imported types ---Category: Imported types
imported CGroup; imported CAspectFillArea;
---Purpose: Defines the C structure <agroup> imported CAspectMarker;
---Category: Imported types imported CAspectLine;
imported CAspectText;
imported CStructure; imported CStructure;
---Purpose: Defines the C structure <astructure> ---Purpose: Defines the C structure <astructure>
---Category: Imported types ---Category: Imported types
pointer CStructurePtr to CStructure from Graphic3d;
imported CStructure_Handle; imported CStructure_Handle;
imported CLight; imported CLight;
@@ -474,7 +474,7 @@ is
---Purpose: Grouping text attributes. ---Purpose: Grouping text attributes.
---Category: Classes ---Category: Classes
class Group; deferred class Group;
---Purpose: For grouping together primitives in a structure ---Purpose: For grouping together primitives in a structure
---Category: Classes ---Category: Classes
@@ -486,6 +486,8 @@ is
---Purpose: Graphic object. ---Purpose: Graphic object.
---Category: Classes ---Category: Classes
pointer StructurePtr to Structure from Graphic3d;
deferred class GraphicDriver; deferred class GraphicDriver;
---Purpose: Defines a graphic driver for 3d interface ---Purpose: Defines a graphic driver for 3d interface
@@ -524,23 +526,8 @@ is
(Address from Standard); (Address from Standard);
---Category: Instantiated classes ---Category: Instantiated classes
class SetOfGroup instantiates imported SequenceOfGroup;
Set from TCollection (Group from Graphic3d);
---Category: Instantiated classes
class HSetOfGroup instantiates
HSet from TCollection
(Group from Graphic3d, SetOfGroup);
---Category: Instantiated classes
class SequenceOfGroup instantiates
Sequence from TCollection (Group from Graphic3d);
---Category: Instantiated classes
class HSequenceOfGroup instantiates
HSequence from TCollection
(Group from Graphic3d, SequenceOfGroup from Graphic3d);
---Category: Instantiated classes ---Category: Instantiated classes
class MapOfStructure instantiates class MapOfStructure instantiates

View File

@@ -80,6 +80,11 @@ is
--- default type of marker. --- default type of marker.
---C++: return const & ---C++: return const &
SetMarkerImage (me : mutable;
theImage : MarkerImage_Handle from Graphic3d);
---Level: Public
---Purpose: Set marker's image texture.
SetBitMap (me: mutable; SetBitMap (me: mutable;
theWidth : Integer from Standard; theWidth : Integer from Standard;
theHeight : Integer from Standard; theHeight : Integer from Standard;

View File

@@ -84,6 +84,15 @@ const Handle(Graphic3d_MarkerImage)& Graphic3d_AspectMarker3d::GetMarkerImage()
return myMarkerImage; return myMarkerImage;
} }
// =======================================================================
// function : SetMarkerImage
// purpose :
// =======================================================================
void Graphic3d_AspectMarker3d::SetMarkerImage (const Handle(Graphic3d_MarkerImage)& theImage)
{
myMarkerImage = theImage;
}
// ======================================================================= // =======================================================================
// function : SetBitMap // function : SetBitMap
// purpose : // purpose :

View File

@@ -12,23 +12,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _Graphic3d_CGroup_HeaderFile #ifndef _Graphic3d_CAspectFillArea_HeaderFile
#define _Graphic3d_CGroup_HeaderFile #define _Graphic3d_CAspectFillArea_HeaderFile
#include <Aspect_TypeOfMarker.hxx>
#include <InterfaceGraphic_Visual3d.hxx> #include <InterfaceGraphic_Visual3d.hxx>
#include <Graphic3d_CTexture.hxx> #include <Graphic3d_CTexture.hxx>
#include <Graphic3d_MarkerImage_Handle.hxx>
#include <Graphic3d_ShaderProgram_Handle.hxx> #include <Graphic3d_ShaderProgram_Handle.hxx>
class Graphic3d_CStructure; class Graphic3d_CAspectFillArea
class CALL_DEF_CONTEXTFILLAREA
{ {
public: public:
CALL_DEF_CONTEXTFILLAREA() Graphic3d_CAspectFillArea()
: IsDef (0), : IsDef (0),
IsSet (0), IsSet (0),
Style (0), Style (0),
@@ -42,19 +38,17 @@ public:
PolygonOffsetFactor (0.0f), PolygonOffsetFactor (0.0f),
PolygonOffsetUnits (0.0f) PolygonOffsetUnits (0.0f)
{ {
memset(&IntColor,0,sizeof(IntColor)); memset (&IntColor, 0, sizeof(IntColor));
memset(&BackIntColor,0,sizeof(BackIntColor)); memset (&BackIntColor, 0, sizeof(BackIntColor));
memset(&EdgeColor,0,sizeof(EdgeColor)); memset (&EdgeColor, 0, sizeof(EdgeColor));
memset(&Front,0,sizeof(Front)); memset (&Front, 0, sizeof(Front));
memset(&Back,0,sizeof(Back)); memset (&Back, 0, sizeof(Back));
} }
public: public:
int IsDef; int IsDef;
int IsSet; int IsSet;
int Style; int Style;
CALL_DEF_COLOR IntColor; CALL_DEF_COLOR IntColor;
@@ -82,52 +76,9 @@ public:
float PolygonOffsetUnits; float PolygonOffsetUnits;
Handle(Graphic3d_ShaderProgram) ShaderProgram; Handle(Graphic3d_ShaderProgram) ShaderProgram;
};
class CALL_DEF_CONTEXTMARKER
{
public:
CALL_DEF_CONTEXTMARKER()
: IsDef (0),
IsSet (0),
MarkerType (Aspect_TOM_POINT),
Scale (0),
MarkerImage (NULL)
{
memset(&Color,0,sizeof(Color));
}
public:
Standard_Integer IsDef;
Standard_Integer IsSet;
CALL_DEF_COLOR Color;
Aspect_TypeOfMarker MarkerType;
Standard_ShortReal Scale;
Handle(Graphic3d_MarkerImage) MarkerImage;
Handle(Graphic3d_ShaderProgram) ShaderProgram;
}; };
class Graphic3d_CGroup typedef Graphic3d_CAspectFillArea CALL_DEF_CONTEXTFILLAREA;
{
public: #endif // _Graphic3d_CAspectFillArea_HeaderFile
void* ptrGroup;
CALL_DEF_CONTEXTLINE ContextLine;
CALL_DEF_CONTEXTFILLAREA ContextFillArea;
CALL_DEF_CONTEXTMARKER ContextMarker;
CALL_DEF_CONTEXTTEXT ContextText;
Graphic3d_CStructure* Struct;
CALL_DEF_PICKID PickId;
};
const Handle(Standard_Type)& TYPE(Graphic3d_CGroup);
#endif // Graphic3d_CGroup_HeaderFile

View File

@@ -12,21 +12,26 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef GROUP_PXX_INCLUDED #ifndef _Graphic3d_CAspectLine_HeaderFile
#define GROUP_PXX_INCLUDED #define _Graphic3d_CAspectLine_HeaderFile
#include <Graphic3d_Structure.pxx> #include <InterfaceGraphic_Visual3d.hxx>
#include <Graphic3d_CTexture.hxx>
#include <Graphic3d_ShaderProgram_Handle.hxx>
// groups identifiers : possible range class Graphic3d_CAspectLine
#define Group_IDMIN 100 {
// /2 pour eviter les problemes d'overflow public:
#define Group_IDMAX INT_MAX/2
#define MyIsEmpty MyCBitFields.bool1 int IsDef;
#define MyContainsFacet MyCBitFields.bool2 int IsSet;
#define MyNotUsed1 MyCBitFields.bool3 CALL_DEF_COLOR Color;
#define MyNotUsed2 MyCBitFields.bool4 int LineType;
float Width;
Handle(Graphic3d_ShaderProgram) ShaderProgram;
#define MyStructure ((Graphic3d_Structure *) MyPtrStructure) };
#endif typedef Graphic3d_CAspectLine CALL_DEF_CONTEXTLINE;
#endif // _Graphic3d_CAspectLine_HeaderFile

View File

@@ -0,0 +1,52 @@
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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.
#ifndef _Graphic3d_CAspectMarker_HeaderFile
#define _Graphic3d_CAspectMarker_HeaderFile
#include <Aspect_TypeOfMarker.hxx>
#include <InterfaceGraphic_Visual3d.hxx>
#include <Graphic3d_CTexture.hxx>
#include <Graphic3d_MarkerImage_Handle.hxx>
#include <Graphic3d_ShaderProgram_Handle.hxx>
class Graphic3d_CAspectMarker
{
public:
Graphic3d_CAspectMarker()
: IsDef (0),
IsSet (0),
MarkerType (Aspect_TOM_POINT),
Scale (0),
MarkerImage (NULL)
{
memset (&Color, 0, sizeof(Color));
}
public:
Standard_Integer IsDef;
Standard_Integer IsSet;
CALL_DEF_COLOR Color;
Aspect_TypeOfMarker MarkerType;
Standard_ShortReal Scale;
Handle(Graphic3d_MarkerImage) MarkerImage;
Handle(Graphic3d_ShaderProgram) ShaderProgram;
};
typedef Graphic3d_CAspectMarker CALL_DEF_CONTEXTMARKER;
#endif // _Graphic3d_AspectMarker_HeaderFile

View File

@@ -0,0 +1,44 @@
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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.
#ifndef _Graphic3d_CAspectText_HeaderFile
#define _Graphic3d_CAspectText_HeaderFile
#include <InterfaceGraphic_Visual3d.hxx>
#include <Graphic3d_CTexture.hxx>
#include <Graphic3d_ShaderProgram_Handle.hxx>
class Graphic3d_CAspectText
{
public:
int IsDef;
int IsSet;
const char* Font;
float Space;
float Expan;
CALL_DEF_COLOR Color;
int Style;
int DisplayType;
CALL_DEF_COLOR ColorSubTitle;
int TextZoomable;
float TextAngle;
int TextFontAspect;
Handle(Graphic3d_ShaderProgram) ShaderProgram;
};
typedef Graphic3d_CAspectText CALL_DEF_CONTEXTTEXT;
#endif // _Graphic3d_CAspectText_HeaderFile

View File

@@ -16,7 +16,8 @@
#define _Graphic3d_CStructure_HeaderFile #define _Graphic3d_CStructure_HeaderFile
#include <Graphic3d_CStructure_Handle.hxx> #include <Graphic3d_CStructure_Handle.hxx>
#include <Graphic3d_CGroup.hxx> #include <Graphic3d_Group.hxx>
#include <Graphic3d_SequenceOfGroup.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx> #include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <Graphic3d_TypeOfComposition.hxx> #include <Graphic3d_TypeOfComposition.hxx>
#include <Graphic3d_Vec3.hxx> #include <Graphic3d_Vec3.hxx>
@@ -37,6 +38,12 @@ public:
return myGraphicDriver; return myGraphicDriver;
} }
//! @return graphic groups
const Graphic3d_SequenceOfGroup& Groups() const
{
return myGroups;
}
//! @return associated clip planes //! @return associated clip planes
const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const const Graphic3d_SequenceOfHClipPlane& ClipPlanes() const
{ {
@@ -71,11 +78,18 @@ public:
const Standard_Boolean theToCreate) = 0; const Standard_Boolean theToCreate) = 0;
//! Highlight structure using boundary box //! Highlight structure using boundary box
virtual void HighlightWithBndBox (const Standard_Boolean theToCreate) = 0; virtual void HighlightWithBndBox (const Handle(Graphic3d_Structure)& theStruct,
const Standard_Boolean theToCreate) = 0;
//! Create shadow link to this structure //! Create shadow link to this structure
virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const = 0; virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const = 0;
//! Create new group within this structure
virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theStruct) = 0;
//! Remove group from this structure
virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) = 0;
public: public:
int Id; int Id;
@@ -111,6 +125,7 @@ protected:
protected: protected:
Handle(Graphic3d_GraphicDriver) myGraphicDriver; Handle(Graphic3d_GraphicDriver) myGraphicDriver;
Graphic3d_SequenceOfGroup myGroups;
Graphic3d_SequenceOfHClipPlane myClipPlanes; Graphic3d_SequenceOfHClipPlane myClipPlanes;
public: public:

View File

@@ -59,7 +59,7 @@ uses
AspectFillArea3d from Graphic3d, AspectFillArea3d from Graphic3d,
HorizontalTextAlignment from Graphic3d, HorizontalTextAlignment from Graphic3d,
CBitFields20 from Graphic3d, CBitFields20 from Graphic3d,
CGroup from Graphic3d, Group from Graphic3d,
CLight from Graphic3d, CLight from Graphic3d,
CPick from Graphic3d, CPick from Graphic3d,
CPlane from Graphic3d, CPlane from Graphic3d,
@@ -135,49 +135,6 @@ is
is deferred; is deferred;
---Purpose: call_togl_inquireview ---Purpose: call_togl_inquireview
-------------------------------------
-- Category: Group management methods
-------------------------------------
ClearGroup ( me : mutable;
ACGroup : CGroup from Graphic3d )
is deferred;
---Purpose: call_togl_cleargroup
FaceContextGroup ( me : mutable;
ACGroup : CGroup from Graphic3d;
NoInsert : Integer from Standard )
is deferred;
---Purpose: call_togl_facecontextgroup
Group ( me : mutable;
ACGroup : in out CGroup from Graphic3d )
is deferred;
---Purpose: call_togl_group
LineContextGroup ( me : mutable;
ACGroup : CGroup from Graphic3d;
NoInsert : Integer from Standard )
is deferred;
---Purpose: call_togl_linecontextgroup
MarkerContextGroup ( me : mutable;
ACGroup : CGroup from Graphic3d;
NoInsert : Integer from Standard )
is deferred;
---Purpose: call_togl_markercontextgroup
RemoveGroup ( me : mutable;
ACGroup : CGroup from Graphic3d )
is deferred;
---Purpose: call_togl_removegroup
TextContextGroup ( me : mutable;
ACGroup : CGroup from Graphic3d;
NoInsert : Integer from Standard )
is deferred;
---Purpose: call_togl_textcontextgroup
----------------------------------------- -----------------------------------------
-- Category: Structure management methods -- Category: Structure management methods
----------------------------------------- -----------------------------------------
@@ -336,86 +293,11 @@ is
is deferred; is deferred;
---Purpose: ---Purpose:
SetStencilTestOptions ( me : mutable;
theCGroup : CGroup from Graphic3d;
theIsEnabled: Boolean from Standard)
is deferred;
---Purpose: sets the stencil test to theIsEnabled state;
SetFlippingOptions (me : mutable;
theCGroup : CGroup from Graphic3d;
theIsEnabled: Boolean from Standard;
theRefPlane : Ax2 from gp)
is deferred;
---Purpose: sets the flipping to theIsEnabled state for the given graphic group.
----------------------------------------
-- Category: Methods to create Text
-- for Purpose : see Graphic3d_Group.cdl
----------------------------------------
Text ( me : mutable;
ACGroup : CGroup from Graphic3d;
AText : CString from Standard;
APoint : Vertex from Graphic3d;
AHeight : Real from Standard;
AAngle : PlaneAngle from Quantity;
ATp : TextPath from Graphic3d;
AHta : HorizontalTextAlignment from Graphic3d;
AVta : VerticalTextAlignment from Graphic3d;
EvalMinMax : Boolean from Standard = Standard_True )
is deferred;
---Purpose: call_togl_text
Text ( me : mutable;
ACGroup : CGroup from Graphic3d;
AText : CString from Standard;
APoint : Vertex from Graphic3d;
AHeight : Real from Standard;
EvalMinMax : Boolean from Standard = Standard_True )
is deferred;
---Purpose: call_togl_text
Text ( me : mutable;
ACGroup : CGroup from Graphic3d;
AText : ExtendedString from TCollection;
APoint : Vertex from Graphic3d;
AHeight : Real from Standard;
AAngle : PlaneAngle from Quantity;
ATp : TextPath from Graphic3d;
AHta : HorizontalTextAlignment from Graphic3d;
AVta : VerticalTextAlignment from Graphic3d;
EvalMinMax : Boolean from Standard = Standard_True )
is deferred;
---Purpose: call_togl_text
Text ( me : mutable;
ACGroup : CGroup from Graphic3d;
AText : ExtendedString from TCollection;
APoint : Vertex from Graphic3d;
AHeight : Real from Standard;
EvalMinMax : Boolean from Standard = Standard_True )
is deferred;
---Purpose: call_togl_text
---------------------------------------- ----------------------------------------
---Category: Methods to create Triangle ---Category: Methods to create Triangle
-- for Purpose : see Graphic3d_Group.cdl -- for Purpose : see Graphic3d_Group.cdl
---------------------------------------- ----------------------------------------
PrimitiveArray( me : mutable;
ACGroup : CGroup from Graphic3d;
parray : PrimitiveArray from Graphic3d;
EvalMinMax : Boolean from Standard = Standard_True )
is deferred;
---Purpose: call_togl_parray
UserDraw( me : mutable;
ACGroup : CGroup from Graphic3d;
AUserDraw : CUserDraw from Graphic3d )
is deferred;
---Purpose: call_togl_userdraw
EnableVBO( me : mutable; EnableVBO( me : mutable;
status : Boolean from Standard ) status : Boolean from Standard )
is deferred; is deferred;
@@ -814,10 +696,6 @@ is
AComment : CString from Standard; AComment : CString from Standard;
AValue : Boolean from Standard ); AValue : Boolean from Standard );
PrintCGroup ( me;
ACGroup : CGroup from Graphic3d;
AField : Integer from Standard );
PrintCLight ( me; PrintCLight ( me;
ACLight : CLight from Graphic3d; ACLight : CLight from Graphic3d;
AField : Integer from Standard ); AField : Integer from Standard );

View File

@@ -61,16 +61,6 @@ void Graphic3d_GraphicDriver::PrintBoolean (const Standard_CString AComment, con
} }
void Graphic3d_GraphicDriver::PrintCGroup (const Graphic3d_CGroup& ACGroup, const Standard_Integer AField) const {
if (AField) {
cout << "\tstruct id " << ACGroup.Struct->Id << "\n";
cout << "\tgroup\n";
cout << flush;
}
}
void Graphic3d_GraphicDriver::PrintCLight (const Graphic3d_CLight& theCLight, void Graphic3d_GraphicDriver::PrintCLight (const Graphic3d_CLight& theCLight,
const Standard_Integer theField) const const Standard_Integer theField) const
{ {

View File

@@ -14,12 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
-- 27/09/97 ; PCT : add manual control of textures deferred class Group from Graphic3d inherits TShared
-- 11/97 ; CAL : ajout polyline par 2 points
-- 16/06/2000 : ATS: Study G005 - Group store presentations of it's objects in field
-- MyListOfPArray to avoid deletion of handle-manipulating
-- primitives.
class Group from Graphic3d inherits TShared
---Version: ---Version:
@@ -73,11 +68,16 @@ class Group from Graphic3d inherits TShared
AspectMarker3d from Graphic3d, AspectMarker3d from Graphic3d,
AspectText3d from Graphic3d, AspectText3d from Graphic3d,
AspectFillArea3d from Graphic3d, AspectFillArea3d from Graphic3d,
CAspectLine from Graphic3d,
CAspectFillArea from Graphic3d,
CAspectMarker from Graphic3d,
CAspectText from Graphic3d,
CStructurePtr from Graphic3d,
HorizontalTextAlignment from Graphic3d, HorizontalTextAlignment from Graphic3d,
CBitFields4 from Graphic3d, CBitFields4 from Graphic3d,
CGroup from Graphic3d,
GraphicDriver from Graphic3d, GraphicDriver from Graphic3d,
Structure from Graphic3d, Structure from Graphic3d,
StructurePtr from Graphic3d,
TextPath from Graphic3d, TextPath from Graphic3d,
Vector from Graphic3d, Vector from Graphic3d,
Array1OfVertex from Graphic3d, Array1OfVertex from Graphic3d,
@@ -93,11 +93,11 @@ class Group from Graphic3d inherits TShared
raises raises
GroupDefinitionError from Graphic3d, GroupDefinitionError from Graphic3d,
PickIdDefinitionError from Graphic3d,
OutOfRange from Standard OutOfRange from Standard
is is
Create ( AStructure : Structure from Graphic3d ) Initialize (theStructure : Structure from Graphic3d)
returns mutable Group from Graphic3d; returns mutable Group from Graphic3d;
---Level: Public ---Level: Public
---Purpose: Creates a group in the structure <AStructure>. ---Purpose: Creates a group in the structure <AStructure>.
@@ -108,7 +108,7 @@ class Group from Graphic3d inherits TShared
Clear ( me : mutable; Clear ( me : mutable;
theUpdateStructureMgr : Boolean from Standard = Standard_True ) theUpdateStructureMgr : Boolean from Standard = Standard_True )
is static; is virtual;
---Level: Public ---Level: Public
---Purpose: Supress all primitives and attributes of <me>. ---Purpose: Supress all primitives and attributes of <me>.
-- To clear group without update in Graphic3d_StructureManager -- To clear group without update in Graphic3d_StructureManager
@@ -119,6 +119,22 @@ class Group from Graphic3d inherits TShared
-- cross-reference); -- cross-reference);
---Category: Methods to modify the class definition ---Category: Methods to modify the class definition
UpdateAspectLine ( me : mutable;
theIsGlobal : Boolean from Standard )
is deferred;
UpdateAspectFace ( me : mutable;
theIsGlobal : Boolean from Standard )
is deferred;
UpdateAspectMarker ( me : mutable;
theIsGlobal : Boolean from Standard )
is deferred;
UpdateAspectText ( me : mutable;
theIsGlobal : Boolean from Standard )
is deferred;
Destroy ( me : mutable ) Destroy ( me : mutable )
is static; is static;
---Level: Public ---Level: Public
@@ -264,7 +280,7 @@ class Group from Graphic3d inherits TShared
AHta : HorizontalTextAlignment from Graphic3d; AHta : HorizontalTextAlignment from Graphic3d;
AVta : VerticalTextAlignment from Graphic3d; AVta : VerticalTextAlignment from Graphic3d;
EvalMinMax : Boolean from Standard = Standard_True ) EvalMinMax : Boolean from Standard = Standard_True )
is static; is virtual;
---Level: Public ---Level: Public
---Purpose: Creates the string <AText> at position <APoint>. ---Purpose: Creates the string <AText> at position <APoint>.
-- The 3D point of attachment is projected. The text is -- The 3D point of attachment is projected. The text is
@@ -350,9 +366,9 @@ class Group from Graphic3d inherits TShared
--------------------------------------- ---------------------------------------
AddPrimitiveArray( me : mutable; AddPrimitiveArray( me : mutable;
elem : ArrayOfPrimitives from Graphic3d; thePrim : ArrayOfPrimitives from Graphic3d;
EvalMinMax: Boolean from Standard = Standard_True ); theToEvalMinMax : Boolean from Standard = Standard_True ) is virtual;
---Level: Public ---Level: Public
---Purpose: Adds an array of primitives for display ---Purpose: Adds an array of primitives for display
Marker ( me : mutable; Marker ( me : mutable;
@@ -362,24 +378,23 @@ class Group from Graphic3d inherits TShared
---Level: Public ---Level: Public
---Purpose: Creates a primitive array with single marker using AddPrimitiveArray(). ---Purpose: Creates a primitive array with single marker using AddPrimitiveArray().
UserDraw ( me : mutable; UserDraw ( me : mutable;
AnObject : Address from Standard; theObject : Address from Standard;
EvalMinMax : Boolean from Standard = Standard_True; theToEvalMinMax : Boolean from Standard = Standard_True;
ContainsFacet: Boolean from Standard = Standard_False theContainsFacet : Boolean from Standard = Standard_False )
) is virtual;
---Level: Public ---Level: Public
---Purpose: Creates an UserDraw primitive ---Purpose: Creates a UserDraw primitive using obsolete API.
-- Category: Methods to create UserDraw
-- Warning: Raises GroupDefinitionError if ...
raises GroupDefinitionError from Graphic3d is static;
SetStencilTestOptions (me : mutable; SetStencilTestOptions (me : mutable;
theIsEnabled: Boolean from Standard); theIsEnabled: Boolean from Standard)
is deferred;
---Purpose: sets the stencil test to theIsEnabled state; ---Purpose: sets the stencil test to theIsEnabled state;
SetFlippingOptions (me : mutable; SetFlippingOptions (me : mutable;
theIsEnabled : Boolean from Standard; theIsEnabled : Boolean from Standard;
theRefPlane : Ax2 from gp); theRefPlane : Ax2 from gp)
is deferred;
---Purpose: sets the flipping to theIsEnabled state. ---Purpose: sets the flipping to theIsEnabled state.
---------------------------- ----------------------------
@@ -494,30 +509,25 @@ class Group from Graphic3d inherits TShared
-- Reminder : A group is defined in a structure -- Reminder : A group is defined in a structure
-- It acts as the smallest editable entity. -- It acts as the smallest editable entity.
-- the associated C structure -- the state of the different contexts for primitives
MyCGroup : CGroup from Graphic3d; myCBitFields : CBitFields4 from Graphic3d is protected;
-- the graphic driver used -- the structure contains the group
MyGraphicDriver : GraphicDriver from Graphic3d; myStructure : StructurePtr from Graphic3d is protected;
-- the state of the different contexts for primitives -- the min-max
MyCBitFields : CBitFields4 from Graphic3d; myBounds : CBounds from Graphic3d is protected;
-- the structure contains the group ContextLine : CAspectLine from Graphic3d is protected;
MyPtrStructure : Address from Standard; ContextFillArea : CAspectFillArea from Graphic3d is protected;
ContextMarker : CAspectMarker from Graphic3d is protected;
ContextText : CAspectText from Graphic3d is protected;
-- the min-max -- temporary field - to be removed
MyBounds : CBounds from Graphic3d; myListOfPArray : ListOfPArray from Graphic3d is protected;
MyListOfPArray : ListOfPArray from Graphic3d; friends
MyMarkArray : HArray1OfByte from TColStd; class Structure from Graphic3d
MyMarkWidth : Integer from Standard;
MyMarkHeight : Integer from Standard;
friends end Group;
Remove from class Structure from Graphic3d
( me : mutable; AGroup : Group from Graphic3d )
end Group;

File diff suppressed because it is too large Load Diff

View File

@@ -1,104 +0,0 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-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.
//-Version
//-Design Declaration des variables specifiques aux groupes
// de primitives
//-Warning Un groupe est defini dans une structure
// Il s'agit de la plus petite entite editable
//-References
//-Language C++ 2.0
//-Declarations
// for the class
#include <Graphic3d_Group.jxx>
#include <Graphic3d_Group.pxx>
//-Methods, in order
void Graphic3d_Group::Clear (Standard_Boolean theUpdateStructureMgr)
{
if (IsDeleted ()) return;
MyCGroup.ContextLine.IsSet = 0,
MyCGroup.ContextText.IsSet = 0,
MyCGroup.ContextMarker.IsSet = 0,
MyCGroup.ContextFillArea.IsSet = 0;
MyCGroup.ContextLine.IsDef = 0,
MyCGroup.ContextText.IsDef = 0,
MyCGroup.ContextMarker.IsDef = 0,
MyCGroup.ContextFillArea.IsDef = 0;
MyCGroup.PickId.IsDef = 0,
MyCGroup.PickId.IsSet = 0,
MyCGroup.PickId.Value = 0;
MyBounds.XMin = ShortRealLast (),
MyBounds.YMin = ShortRealLast (),
MyBounds.ZMin = ShortRealLast ();
MyBounds.XMax = ShortRealFirst (),
MyBounds.YMax = ShortRealFirst (),
MyBounds.ZMax = ShortRealFirst ();
if (MyContainsFacet) MyStructure->GroupsWithFacet (-1);
MyContainsFacet = Standard_False,
MyIsEmpty = Standard_True;
MyGraphicDriver->ClearGroup (MyCGroup);
// clear method could be used on Graphic3d_Structure destruction,
// and its structure manager could be already destroyed, in that
// case we don't need to update it;
if (theUpdateStructureMgr)
Update ();
}
void Graphic3d_Group::Destroy ()
{
// tell graphics driver to clear internal resources of the group
if (!IsEmpty () && !MyGraphicDriver.IsNull ())
MyGraphicDriver->ClearGroup (MyCGroup);
}
void Graphic3d_Group::Remove ()
{
if (IsDeleted ()) return;
MyGraphicDriver->RemoveGroup (MyCGroup);
MyStructure->Remove (this);
MyCGroup.ptrGroup = NULL;
Update ();
MyBounds.XMin = ShortRealLast (),
MyBounds.YMin = ShortRealLast (),
MyBounds.ZMin = ShortRealLast ();
MyBounds.XMax = ShortRealFirst (),
MyBounds.YMax = ShortRealFirst (),
MyBounds.ZMax = ShortRealFirst ();
if (MyContainsFacet) MyStructure->GroupsWithFacet (-1);
MyContainsFacet = Standard_False,
MyIsEmpty = Standard_True;
}

View File

@@ -1,156 +0,0 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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.
//-Version
//-Design Declaration des variables specifiques aux groupes
// de primitives
//-Warning Un groupe est defini dans une structure
// Il s'agit de la plus petite entite editable
//-References
//-Language C++ 2.0
//-Declarations
// for the class
#include <Graphic3d_Group.jxx>
#include <Graphic3d_Group.pxx>
#include <TCollection_AsciiString.hxx>
//-Methods, in order
void Graphic3d_Group::Text (
const Standard_CString AText,
const Graphic3d_Vertex& APoint,
const Standard_Real AHeight,
const Quantity_PlaneAngle AAngle,
const Graphic3d_TextPath ATp,
const Graphic3d_HorizontalTextAlignment AHta,
const Graphic3d_VerticalTextAlignment AVta,
const Standard_Boolean EvalMinMax
)
{
if (IsDeleted ()) return;
MyIsEmpty = Standard_False;
// Min-Max Update
if (EvalMinMax) {
Standard_ShortReal X, Y, Z;
APoint.Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = X;
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
if (X > MyBounds.XMax) MyBounds.XMax = X;
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
}
MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
Update ();
}
void Graphic3d_Group::Text (
const Standard_CString AText,
const Graphic3d_Vertex& APoint,
const Standard_Real AHeight,
const Standard_Boolean EvalMinMax
)
{
if (IsDeleted ()) return;
MyIsEmpty = Standard_False;
// Min-Max Update
if (EvalMinMax) {
Standard_ShortReal X, Y, Z;
APoint.Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = X;
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
if (X > MyBounds.XMax) MyBounds.XMax = X;
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
}
MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
Update ();
}
void Graphic3d_Group::Text (
const TCollection_ExtendedString& AText,
const Graphic3d_Vertex& APoint,
const Standard_Real AHeight,
const Quantity_PlaneAngle AAngle,
const Graphic3d_TextPath ATp,
const Graphic3d_HorizontalTextAlignment AHta,
const Graphic3d_VerticalTextAlignment AVta,
const Standard_Boolean EvalMinMax
)
{
if (IsDeleted ()) return;
MyIsEmpty = Standard_False;
// Min-Max Update
if (EvalMinMax) {
Standard_ShortReal X, Y, Z;
APoint.Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = X;
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
if (X > MyBounds.XMax) MyBounds.XMax = X;
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
}
MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
Update ();
}
void Graphic3d_Group::Text (
const TCollection_ExtendedString& AText,
const Graphic3d_Vertex& APoint,
const Standard_Real AHeight,
const Standard_Boolean EvalMinMax
)
{
if (IsDeleted ()) return;
MyIsEmpty = Standard_False;
// Min-Max Update
if (EvalMinMax) {
Standard_ShortReal X, Y, Z;
APoint.Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = X;
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
if (X > MyBounds.XMax) MyBounds.XMax = X;
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
}
MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
Update ();
}

View File

@@ -1,124 +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_Group.jxx>
#include <Graphic3d_Group.pxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <gp_Pnt.hxx>
// =======================================================================
// function : AddPrimitiveArray
// purpose :
// =======================================================================
void Graphic3d_Group :: AddPrimitiveArray ( const Handle(Graphic3d_ArrayOfPrimitives)& elem,const Standard_Boolean EvalMinMax )
{
if (IsDeleted () ) return;
if( !elem->IsValid() ) return;
if( !MyContainsFacet &&
(elem->Type() != Graphic3d_TOPA_POLYLINES) &&
(elem->Type() != Graphic3d_TOPA_SEGMENTS) &&
(elem->Type() != Graphic3d_TOPA_POINTS) ) {
MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
}
MyIsEmpty = Standard_False;
MyListOfPArray.Append(elem);
// Min-Max Update
if (EvalMinMax) {
Standard_Real x,y,z;
for (int k=1; k<=elem->VertexNumber() ; k++) {
elem->Vertice(k,x,y,z);
if (x < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal(x);
if (y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal(y);
if (z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal(z);
if (x > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal(x);
if (y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal(y);
if (z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal(z);
}
}
MyGraphicDriver->PrimitiveArray(MyCGroup, elem->Array());
Update ();
}
// =======================================================================
// function : Marker
// purpose :
// =======================================================================
void Graphic3d_Group::Marker (const Graphic3d_Vertex& thePoint,
const Standard_Boolean theToEvalMinMax)
{
Handle(Graphic3d_ArrayOfPoints) aPoints = new Graphic3d_ArrayOfPoints (1);
aPoints->AddVertex (thePoint.X(), thePoint.Y(), thePoint.Z());
AddPrimitiveArray (aPoints, theToEvalMinMax);
}
// =======================================================================
// function : UserDraw
// purpose :
// =======================================================================
void Graphic3d_Group :: UserDraw ( const Standard_Address AnObject,
const Standard_Boolean EvalMinMax,
const Standard_Boolean ContainsFacet )
{
if (IsDeleted ()) return;
// Without this modification, the group assumes the primitive contains
// no polygons and does not require the Z-buffer for display.
if (!MyContainsFacet && ContainsFacet) {
MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
}
MyIsEmpty = Standard_False;
Graphic3d_CUserDraw AUserDraw;
AUserDraw.Data = AnObject;
AUserDraw.Bounds = ( EvalMinMax? &MyBounds : NULL );
MyGraphicDriver->UserDraw (MyCGroup, AUserDraw);
Update ();
}
// =======================================================================
// function : SetFlippingOptions
// purpose :
// =======================================================================
void Graphic3d_Group::SetFlippingOptions (const Standard_Boolean theIsEnabled,
const gp_Ax2& theRefPlane)
{
MyGraphicDriver->SetFlippingOptions (MyCGroup, theIsEnabled, theRefPlane);
}
// =======================================================================
// function : SetStencilTestOptions
// purpose :
// =======================================================================
void Graphic3d_Group::SetStencilTestOptions (const Standard_Boolean theIsEnabled)
{
MyGraphicDriver->SetStencilTestOptions (MyCGroup, theIsEnabled);
}

View File

@@ -1,117 +0,0 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-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.
//-Version
//-Design Declaration of variables specific to groups
// of primitives
//-Warning A group is defined in a structure
// This is the smallest editable entity
//-References
//-Language C++ 2.0
//-Declarations
// for the class
#include <Graphic3d_Group.jxx>
#include <Graphic3d_Group.pxx>
#include <Graphic3d_StructureManager.hxx>
// Structures are necessairy for interfacing with routines c
// Routines C should be declared externally
//-Methods, in order
Standard_Boolean Graphic3d_Group::IsDeleted () const {
return ( (MyCGroup.ptrGroup == NULL) || (MyStructure->IsDeleted ()) );
}
Standard_Boolean Graphic3d_Group::ContainsFacet () const {
return (MyContainsFacet);
}
Standard_Boolean Graphic3d_Group::IsEmpty () const {
if (IsDeleted ()) return (Standard_True);
Standard_ShortReal RL = ShortRealLast ();
Standard_ShortReal RF = ShortRealFirst ();
Standard_Boolean Result = ((MyBounds.XMin == RL) && (MyBounds.YMin == RL) &&
(MyBounds.ZMin == RL) && (MyBounds.XMax == RF) &&
(MyBounds.YMax == RF) && (MyBounds.ZMax == RF));
if (Result != MyIsEmpty)
cout << "MyIsEmpty != IsEmpty ()\n" << flush;
return (Result);
}
void Graphic3d_Group::SetMinMaxValues (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real ZMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real ZMax) {
MyBounds.XMin = Standard_ShortReal (XMin);
MyBounds.YMin = Standard_ShortReal (YMin);
MyBounds.ZMin = Standard_ShortReal (ZMin);
MyBounds.XMax = Standard_ShortReal (XMax);
MyBounds.YMax = Standard_ShortReal (YMax);
MyBounds.ZMax = Standard_ShortReal (ZMax);
}
void Graphic3d_Group::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
MinMaxCoord (XMin, YMin, ZMin, XMax, YMax, ZMax);
}
Handle(Graphic3d_Structure) Graphic3d_Group::Structure () const {
return MyStructure;
}
void Graphic3d_Group::MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
if (IsEmpty ()) {
// Empty Group
XMin = YMin = ZMin = ShortRealFirst ();
XMax = YMax = ZMax = ShortRealLast ();
}
else {
XMin = Standard_Real (MyBounds.XMin);
YMin = Standard_Real (MyBounds.YMin);
ZMin = Standard_Real (MyBounds.ZMin);
XMax = Standard_Real (MyBounds.XMax);
YMax = Standard_Real (MyBounds.YMax);
ZMax = Standard_Real (MyBounds.ZMax);
}
}
void Graphic3d_Group::Update () const {
if (IsDeleted ()) return;
if ( (MyStructure->StructureManager ())->UpdateMode () == Aspect_TOU_ASAP )
(MyStructure->StructureManager ())->Update ();
}

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