-class POnSurf from Extrema inherits Storable from Standard
+class POnSurf from Extrema
---Purpose: Definition of a point on surface.
uses Pnt from gp
is
Create returns POnSurf;
---Purpose: Creation of an indefinite point on surface.
+ ---C++: inline
Create (U,V: Real; P: Pnt) returns POnSurf;
---Purpose: Creation of a point on surface with parameter
-- values on the surface and a Pnt from gp.
+ ---C++: inline
Value (me) returns Pnt
---Purpose: Returns the 3d point.
// and conditions governing the rights and limitations under the License.
#include <Extrema_POnSurf.ixx>
-
-Extrema_POnSurf::Extrema_POnSurf () {}
-
-Extrema_POnSurf::Extrema_POnSurf ( const Standard_Real U, const Standard_Real V, const gp_Pnt& P)
-{
- myU = U;
- myV = V;
- myP = P;
-}
-
// and conditions governing the rights and limitations under the License.
+inline Extrema_POnSurf::Extrema_POnSurf () {}
+
+inline Extrema_POnSurf::Extrema_POnSurf (const Standard_Real U,
+ const Standard_Real V,
+ const gp_Pnt& P) :
+ myU (U), myV (V), myP (P)
+{
+}
+
inline void Extrema_POnSurf::Parameter ( Standard_Real& U, Standard_Real& V) const
{
U = myU;
#include <IntPatch_GLine.hxx>
#include <IntPatch_ALineToWLine.hxx>
#include <IntPatch_IType.hxx>
+#include <NCollection_IncAllocator.hxx>
+#include <NCollection_List.hxx>
+#include <NCollection_LocalArray.hxx>
+#include <NCollection_StdAllocator.hxx>
+#include <vector>
#include <AppParCurves_MultiBSpCurve.hxx>
const GeomInt_LineConstructor& theLConstructor,
IntPatch_SequenceOfLine& theNewLines)
{
+ typedef NCollection_List<Standard_Integer> ListOfInteger;
+ //have to use std::vector, not NCollection_Vector in order to use copy constructor of
+ //ListOfInteger which will be created with specific allocator instance
+ typedef std::vector<ListOfInteger, NCollection_StdAllocator<
+ ListOfInteger> > ArrayOfListOfInteger;
+
Standard_Boolean bIsPrevPointOnBoundary, bIsCurrentPointOnBoundary;
Standard_Integer nblines, aNbPnts, aNbParts, pit, i, j, aNbListOfPointIndex;
Standard_Real aTol, umin, umax, vmin, vmax;
- TColStd_ListOfInteger aListOfPointIndex;
+
+ //an inc allocator, it will contain wasted space (upon list's Clear()) but it should
+ //still be faster than the standard allocator, and wasted memory should not be
+ //significant and will be limited by time span of this function;
+ //this is a separate allocator from the anIncAlloc below what provides better data
+ //locality in the latter (by avoiding wastes which will only be in anIdxAlloc)
+ Handle(NCollection_IncAllocator) anIdxAlloc = new NCollection_IncAllocator();
+ ListOfInteger aListOfPointIndex (anIdxAlloc);
+
//GeomAPI_ProjectPointOnSurf aPrj1, aPrj2;
ProjectPointOnSurf aPrj1, aPrj2;
Handle(Geom_Surface) aSurf1, aSurf2;
return Standard_False;
}
//
- TColStd_Array1OfListOfInteger anArrayOfLines(1, aNbPnts);
- TColStd_Array1OfInteger anArrayOfLineType(1, aNbPnts);
+ Handle(NCollection_IncAllocator) anIncAlloc = new NCollection_IncAllocator();
+ NCollection_StdAllocator<ListOfInteger> anAlloc (anIncAlloc);
+ const ListOfInteger aDummy (anIncAlloc); //empty list to be copy constructed from
+ ArrayOfListOfInteger anArrayOfLines (aNbPnts + 1, aDummy, anAlloc);
+
+ NCollection_LocalArray<Standard_Integer> anArrayOfLineTypeArr (aNbPnts + 1);
+ Standard_Integer* anArrayOfLineType = anArrayOfLineTypeArr;
//
nblines = 0;
aTol = Precision::Confusion();
if(!aListOfPointIndex.IsEmpty()) {
nblines++;
- anArrayOfLines.SetValue(nblines, aListOfPointIndex);
- anArrayOfLineType.SetValue(nblines, bIsPrevPointOnBoundary);
+ anArrayOfLines[nblines] = aListOfPointIndex;
+ anArrayOfLineType[nblines] = bIsPrevPointOnBoundary;
aListOfPointIndex.Clear();
}
bIsPrevPointOnBoundary = bIsCurrentPointOnBoundary;
aNbListOfPointIndex=aListOfPointIndex.Extent();
if(aNbListOfPointIndex) {
nblines++;
- anArrayOfLines.SetValue(nblines, aListOfPointIndex);
- anArrayOfLineType.SetValue(nblines, bIsPrevPointOnBoundary);
+ anArrayOfLines[nblines] = aListOfPointIndex;
+ anArrayOfLineType[nblines] = bIsPrevPointOnBoundary;
aListOfPointIndex.Clear();
}
//
// Correct wlines.begin
Standard_Integer aLineType;
TColStd_Array1OfListOfInteger anArrayOfLineEnds(1, nblines);
- Handle(IntSurf_LineOn2S) aSeqOfPntOn2S = new IntSurf_LineOn2S();
+ Handle(IntSurf_LineOn2S) aSeqOfPntOn2S = new IntSurf_LineOn2S (new NCollection_IncAllocator());
//
for(i = 1; i <= nblines; i++) {
- aLineType=anArrayOfLineType.Value(i);
+ aLineType=anArrayOfLineType[i];
if(aLineType) {
continue;
}
//
- const TColStd_ListOfInteger& aListOfIndex = anArrayOfLines.Value(i);
+ const ListOfInteger& aListOfIndex = anArrayOfLines[i];
if(aListOfIndex.Extent() < 2) {
continue;
}
continue;
}
//
- aLineTypeNeib=anArrayOfLineType.Value(aneighbourindex);
+ aLineTypeNeib=anArrayOfLineType[aneighbourindex];
if(!aLineTypeNeib){
continue;
}
//
- const TColStd_ListOfInteger& aNeighbour = anArrayOfLines.Value(aneighbourindex);
+ const ListOfInteger& aNeighbour = anArrayOfLines[aneighbourindex];
Standard_Integer anIndex = (!j) ? aNeighbour.Last() : aNeighbour.First();
const IntSurf_PntOn2S& aPoint = theWLine->Point(anIndex);
// check if need use derivative.begin .end [absence]
Handle(IntSurf_LineOn2S) aLineOn2S = new IntSurf_LineOn2S();
//
for(i = 1; i <= nblines; i++) {
- if(anArrayOfLineType.Value(i) != 0) {
+ if(anArrayOfLineType[i] != 0) {
continue;
}
- const TColStd_ListOfInteger& aListOfIndex = anArrayOfLines.Value(i);
+ const ListOfInteger& aListOfIndex = anArrayOfLines[i];
if(aListOfIndex.Extent() < 2) {
continue;
const IntSurf_PntOn2S& aP = aSeqOfPntOn2S->Value(aListOfFLIndex.First());
aLineOn2S->Add(aP);
}
- TColStd_ListIteratorOfListOfInteger anIt(aListOfIndex);
+ ListOfInteger::Iterator anIt(aListOfIndex);
for(; anIt.More(); anIt.Next()) {
const IntSurf_PntOn2S& aP = theWLine->Point(anIt.Value());
Standard_Boolean bIsEndOfLine = Standard_True;
if(aneighbour <= nblines) {
- const TColStd_ListOfInteger& aListOfNeighbourIndex = anArrayOfLines.Value(aneighbour);
+ const ListOfInteger& aListOfNeighbourIndex = anArrayOfLines[aneighbour];
- if((anArrayOfLineType.Value(aneighbour) != 0) &&
+ if((anArrayOfLineType[aneighbour] != 0) &&
(aListOfNeighbourIndex.IsEmpty())) {
bIsEndOfLine = Standard_False;
}
if(bIsFirstInside && bIsLastInside) {
// append inside points between ifprm and ilprm
- TColStd_ListIteratorOfListOfInteger anIt(aListOfIndex);
+ ListOfInteger::Iterator anIt(aListOfIndex);
for(; anIt.More(); anIt.Next()) {
if((anIt.Value() < ifprm) || (anIt.Value() > ilprm))
if(bIsFirstInside) {
// append points from ifprm to last point + boundary point
- TColStd_ListIteratorOfListOfInteger anIt(aListOfIndex);
+ ListOfInteger::Iterator anIt(aListOfIndex);
for(; anIt.More(); anIt.Next()) {
if(anIt.Value() < ifprm)
Standard_Boolean bIsEndOfLine = Standard_True;
if(aneighbour <= nblines) {
- const TColStd_ListOfInteger& aListOfNeighbourIndex = anArrayOfLines.Value(aneighbour);
+ const ListOfInteger& aListOfNeighbourIndex = anArrayOfLines[aneighbour];
- if((anArrayOfLineType.Value(aneighbour) != 0) &&
+ if((anArrayOfLineType[aneighbour] != 0) &&
(aListOfNeighbourIndex.IsEmpty())) {
bIsEndOfLine = Standard_False;
}
const IntSurf_PntOn2S& aP = aSeqOfPntOn2S->Value(aListOfFLIndex.First());
aLineOn2S->Add(aP);
}
- TColStd_ListIteratorOfListOfInteger anIt(aListOfIndex);
+ ListOfInteger::Iterator anIt(aListOfIndex);
for(; anIt.More(); anIt.Next()) {
if(anIt.Value() > ilprm)
//
if ((ilprm-ifprm)==1) {
for(i = 1; i <= nblines; i++) {
- aLineType=anArrayOfLineType.Value(i);
+ aLineType=anArrayOfLineType[i];
if(aLineType) {
continue;
}
//
- const TColStd_ListOfInteger& aListOfIndex = anArrayOfLines.Value(i);
+ const ListOfInteger& aListOfIndex = anArrayOfLines[i];
aNbPoints=aListOfIndex.Extent();
if(aNbPoints==1) {
aIndex=aListOfIndex.First();
Standard_Integer i;
myBox.SetVoid();
Standard_Integer n=NbPoints();
- Standard_Real eps = myError;
+ const Standard_Real eps_2 = myError * myError;
gp_Pnt2d P1, P2;
if (n >= 3) {
if (i >= 3) {
gp_XY V13 = P3.XY() - P1.XY();
gp_XY V12 = P2.XY() - P1.XY();
- Standard_Real d13 = V13.Modulus(), d;
- if (d13 > eps)
- d = V13.CrossMagnitude(V12) / d13;
+ Standard_Real d13_2 = V13.SquareModulus(), d_2;
+ if (d13_2 > eps_2)
+ d_2 = V13.CrossSquareMagnitude(V12) / d13_2;
else
- d = eps;
- if (d > myError) {
+ d_2 = eps_2;
+ if (d_2 > myError * myError) {
// try to compute deflection more precisely using parabola interpolation
gp_XY V23 = P3.XY() - P2.XY();
Standard_Real d12 = V12.Modulus(), d23 = V23.Modulus();
Standard_Real d2 = Abs (A2*xt2 + B2*yt2 + C2);
if (d2 > d1) d1 = d2;
// select min deflection from linear and parabolic ones
- if (d1 < d) d = d1;
+ if (d1 * d1 < d_2) d_2 = d1 * d1;
}
- if (d > myError) myError=d;
+ if (d_2 > myError * myError) myError=Sqrt(d_2);
}
P1 = P2; P2 = P3;
}
--- /dev/null
+IntSurf_Allocator.hxx
+IntSurf_SequenceOfPntOn2S.hxx
class PntOn2S;
- class SequenceOfPntOn2S instantiates Sequence from TCollection
- (PntOn2S from IntSurf);
-
+ imported Allocator;
+
+ imported SequenceOfPntOn2S;
+
class Couple;
class SequenceOfCouple instantiates Sequence from TCollection
--- /dev/null
+// Copyright (c) 2013-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef IntSurf_Allocator_HeaderFile
+#define IntSurf_Allocator_HeaderFile
+
+#include <NCollection_BaseAllocator.hxx>
+
+typedef Handle_NCollection_BaseAllocator IntSurf_Allocator;
+
+#endif
inherits TShared from MMgt
-uses PntOn2S from IntSurf,
+uses Allocator from IntSurf,
+ PntOn2S from IntSurf,
SequenceOfPntOn2S from IntSurf
raises OutOfRange from Standard
is
- Create
+ Create (theAllocator: Allocator from IntSurf = 0)
returns mutable LineOn2S from IntSurf;
#include <IntSurf_LineOn2S.ixx>
-IntSurf_LineOn2S::IntSurf_LineOn2S ()
+IntSurf_LineOn2S::IntSurf_LineOn2S (const IntSurf_Allocator& theAllocator) :
+ mySeq (theAllocator)
{}
--- /dev/null
+// Copyright (c) 2013-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef IntSurf_SequenceOfPntOn2S_HeaderFile
+#define IntSurf_SequenceOfPntOn2S_HeaderFile
+
+#include <IntSurf_PntOn2S.hxx>
+#include <NCollection_Sequence.hxx>
+
+typedef NCollection_Sequence<IntSurf_PntOn2S> IntSurf_SequenceOfPntOn2S;
+
+#endif
IntWalk_PWalking_2.gxx
IntWalk_PWalking_3.gxx
IntWalk_PWalking_4.gxx
+IntWalk_VectorOfInteger.hxx
+IntWalk_VectorOfWalkingData.hxx
--algorithme cheminement/resolution
generic class IWalking, TheIWLine, SequenceOfIWLine;
+
+ imported VectorOfWalkingData;
+ ---Purpose: Defines a dynamic vector of work data.
+
+ imported VectorOfInteger;
+ ---Purpose: Defines a dynamic vector of integer.
--algorithme/resolution pour un cheminement sur intersection entre
-- because no marching points where found to stop
-- beware : the directions are not oriented.
-uses Couple from IntSurf,
+uses Allocator from IntSurf,
+ Couple from IntSurf,
SequenceOfCouple from IntSurf,
PntOn2S from IntSurf,
LineOn2S from IntSurf,
is
- Create
+ Create (theAllocator: Allocator from IntSurf = 0)
returns mutable IWLine;
#include <IntSurf_Couple.hxx>
-IntWalk_IWLine::IntWalk_IWLine()
+IntWalk_IWLine::IntWalk_IWLine (const IntSurf_Allocator& theAllocator) :
+ line (new IntSurf_LineOn2S (theAllocator)),
+ closed (Standard_False),
+ hasFirst (Standard_False), hasLast (Standard_False),
+ firstIndex (-1), lastIndex (-1),
+ indextg (-1),
+ istgtbeg (Standard_False), istgtend (Standard_False)
{
- line = new IntSurf_LineOn2S ();
- closed=hasFirst=hasLast=istgtbeg=istgtend=Standard_False;
- indextg=-1;
}
void IntWalk_IWLine::Reverse()
SequenceOfInteger from TColStd,
SequenceOfReal from TColStd,
StatusDeflection from IntWalk,
+ VectorOfInteger from IntWalk,
+ VectorOfWalkingData from IntWalk,
Vec from gp,
Dir2d from gp,
PntOn2S from IntSurf
Psol : in out PntOn2S from IntSurf)
is static protected;
+
+ Clear (me: in out) is static protected;
+ ---Purpose: Clears up internal containers
fields
epsilon : Real from Standard;
reversed : Boolean from Standard;
- ustart1 : SequenceOfReal from TColStd;
- vstart1 : SequenceOfReal from TColStd;
- nbMultiplicities : SequenceOfInteger from TColStd;
- etat1 : SequenceOfInteger from TColStd;
- ustart2 : SequenceOfReal from TColStd;
- vstart2 : SequenceOfReal from TColStd;
- etat2 : SequenceOfInteger from TColStd;
+ wd1 : VectorOfWalkingData from IntWalk;
+ wd2 : VectorOfWalkingData from IntWalk;
+ nbMultiplicities : VectorOfInteger from IntWalk;
Um : Real from Standard; -- Min U de la surf
UM : Real from Standard; -- Max U de la surf
Vm : Real from Standard; -- Min V de la surf
#endif
+#include <NCollection_IncAllocator.hxx>
#include <Precision.hxx>
IntWalk_IWalking::IntWalk_IWalking (const Standard_Real Epsilon,
pas(Increment),
tolerance(1,2),
epsilon(Epsilon*Epsilon),
+ wd1 (IntWalk_VectorOfWalkingData::allocator_type (new NCollection_IncAllocator)),
+ wd2 (wd1.get_allocator()),
+ nbMultiplicities (wd1.get_allocator()),
NbPointsConfondusConsecutifs(0),
EpsilonSembleTropGrand(0)
{
}
+
+//=======================================================================
+//function : Reset
+//purpose : Clears NCollection_Vector-based containers and adds
+// dummy data to maintain start index of 1 and consistent with
+// previous TCollection_Sequence-based implementation and other
+// used TCollection-based containers
+//=======================================================================
+
+void IntWalk_IWalking::Clear()
+{
+ wd1.clear();
+ wd2.clear();
+ IntWalk_WalkingData aDummy;
+ aDummy.etat = -10;
+ aDummy.ustart = aDummy.vstart = 0.;
+ wd1.push_back (aDummy);
+ wd2.push_back (aDummy);
+ nbMultiplicities.clear();
+ nbMultiplicities.push_back (-1);
+
+ done = Standard_False;
+ seqAjout.Clear();
+ lines.Clear();
+}
// ***************************************************************************
// etat1=12 pas tangent,pas passant
{
Standard_Integer I;
- ThePointOfPath PathPnt;
Standard_Boolean Rajout = Standard_False;
Standard_Integer nbPnts1 = Pnts1.Length();
Standard_Integer nbPnts2 = Pnts2.Length();
Standard_Real U,V;
- done = Standard_False;
-
- ustart1.Clear();
- vstart1.Clear();
- etat1.Clear();
- nbMultiplicities.Clear();
- ustart2.Clear();
- vstart2.Clear();
- etat2.Clear();
- seqAjout.Clear();
- lines.Clear();
+ Clear();
reversed = Reversed;
TColStd_SequenceOfReal Vmult;
Standard_Integer decal=0;
+ wd1.reserve (nbPnts1+decal);
+ nbMultiplicities.reserve (nbPnts1+decal);
for (I=1;I <= nbPnts1+decal; I++) {
- PathPnt = Pnts1.Value(I-decal);
- etat1.Append(1);
+ const ThePointOfPath& PathPnt = Pnts1.Value(I-decal);
+ IntWalk_WalkingData aWD1;
+ aWD1.etat = 1;
if (!ThePointOfPathTool::IsPassingPnt(PathPnt))
- etat1(I) = 11;
+ aWD1.etat = 11;
if (!ThePointOfPathTool::IsTangent(PathPnt))
- etat1(I) = etat1(I) + 1;
-
- Standard_Integer etat1I=etat1(I);
- //-- cout<<" \n Etat1("<<I<<") = "<<etat1I<<endl;
- if(etat1I==2) { //-- lbr le 15 fev 99
- etat1(I)=11;
-
- ThePointOfPathTool::Value2d(PathPnt, U,V);
- ustart1.Append(U);
- vstart1.Append(V);
- nbMultiplicities.Append(ThePointOfPathTool::Multiplicity(PathPnt));
-
- for (Standard_Integer J = 1; J <= nbMultiplicities(I); J++) {
- ThePointOfPathTool::Parameters(PathPnt, J, U , V);
- Umult.Append(U);
- Vmult.Append(V);
- }
- }
-
- else {
- ThePointOfPathTool::Value2d(PathPnt, U,V);
- ustart1.Append(U);
- vstart1.Append(V);
- nbMultiplicities.Append(ThePointOfPathTool::Multiplicity(PathPnt));
-
- for (Standard_Integer J = 1; J <= nbMultiplicities(I); J++) {
- ThePointOfPathTool::Parameters(PathPnt, J, U , V);
- Umult.Append(U);
- Vmult.Append(V);
- }
+ ++aWD1.etat;
+
+ if(aWD1.etat==2) { //-- lbr le 15 fev 99
+ aWD1.etat=11;
+ }
+
+ ThePointOfPathTool::Value2d(PathPnt, aWD1.ustart, aWD1.vstart);
+ wd1.push_back (aWD1);
+ Standard_Integer aNbMult = ThePointOfPathTool::Multiplicity(PathPnt);
+ nbMultiplicities.push_back(aNbMult);
+
+ for (Standard_Integer J = 1; J <= aNbMult; J++) {
+ ThePointOfPathTool::Parameters(PathPnt, J, U, V);
+ Umult.Append(U);
+ Vmult.Append(V);
}
}
-
+ wd2.reserve (nbPnts2);
for (I = 1; I <= nbPnts2; I++) {
- etat2.Append(13);
- ThePointOfLoopTool::Value2d(Pnts2.Value(I), U,V);
- ustart2.Append(U);
- vstart2.Append(V);
+ IntWalk_WalkingData aWD2;
+ aWD2.etat = 13;
+ ThePointOfLoopTool::Value2d(Pnts2.Value(I), aWD2.ustart, aWD2.vstart);
+ wd2.push_back (aWD2);
}
tolerance(1) = ThePSurfaceTool::UResolution(Caro,Precision::Confusion());
// calcul de toutes les lignes fermees
if (nbPnts2 != 0) ComputeCloseLine(Umult,Vmult,Pnts1,Pnts2,Func,Rajout);
for (I = 1; I <= nbPnts1; I++) {
- if (etat1(I) >0) seqSingle.Append(Pnts1(I));
+ if (wd1[I].etat >0) seqSingle.Append(Pnts1(I));
}
done = Standard_True;
}
{
Standard_Integer I;
- ThePointOfPath PathPnt;
Standard_Boolean Rajout = Standard_False;
Standard_Integer nbPnts1 = Pnts1.Length();
Standard_Real U,V;
- done = Standard_False;
-
- ustart1.Clear();
- vstart1.Clear();
- etat1.Clear();
- nbMultiplicities.Clear();
- ustart2.Clear();
- vstart2.Clear();
- etat2.Clear();
- seqAjout.Clear();
- lines.Clear();
reversed = Reversed;
TColStd_SequenceOfReal Umult;
TColStd_SequenceOfReal Vmult;
+ wd1.reserve (nbPnts1);
for (I=1;I <= nbPnts1; I++) {
- PathPnt = Pnts1.Value(I);
- etat1.Append(1);
- if (!ThePointOfPathTool::IsPassingPnt(PathPnt)) etat1(I) = 11;
- if (!ThePointOfPathTool::IsTangent(PathPnt)) etat1(I) = etat1(I) + 1;
- ThePointOfPathTool::Value2d(PathPnt, U,V);
- ustart1.Append(U);
- vstart1.Append(V);
- nbMultiplicities.Append(ThePointOfPathTool::Multiplicity(PathPnt));
-
- for (Standard_Integer J = 1; J <= nbMultiplicities(I); J++) {
- ThePointOfPathTool::Parameters(PathPnt, J, U , V);
+ const ThePointOfPath& PathPnt = Pnts1.Value(I);
+ IntWalk_WalkingData aWD1;
+ aWD1.etat = 1;
+ if (!ThePointOfPathTool::IsPassingPnt(PathPnt)) aWD1.etat = 11;
+ if (!ThePointOfPathTool::IsTangent(PathPnt)) ++aWD1.etat;
+ ThePointOfPathTool::Value2d(PathPnt, aWD1.ustart, aWD1.vstart);
+ wd1.push_back (aWD1);
+ Standard_Integer aNbMult = ThePointOfPathTool::Multiplicity(PathPnt);
+ nbMultiplicities.push_back(aNbMult);
+
+ for (Standard_Integer J = 1; J <= aNbMult; J++) {
+ ThePointOfPathTool::Parameters(PathPnt, J, U, V);
Umult.Append(U);
Vmult.Append(V);
}
if (nbPnts1 != 0) ComputeOpenLine(Umult,Vmult,Pnts1,Func,Rajout);
for (I = 1; I <= nbPnts1; I++) {
- if (etat1(I) >0) seqSingle.Append(Pnts1(I));
+ if (wd1[I].etat >0) seqSingle.Append(Pnts1(I));
}
done = Standard_True;
}
// l espace UV.
{
Standard_Real Up, Vp, Du, Dv, Dup, Dvp, Utest,Vtest;
- Standard_Integer i, j, k, N, ind;
+ Standard_Integer j, N, ind;
Standard_Real tolu = tolerance(1);
Standard_Real tolv = tolerance(2);
Standard_Real tolu2 = 10.*tolerance(1);
previousPoint.ParametersOnS1(Up,Vp);
}
- for (i = 1; i <= etat2.Length(); i++) {
- if (etat2(i) > 0) {
+ for (size_t i = 1; i < wd2.size(); i++) {
+ if (wd2[i].etat > 0) {
// debug jag 05.04.94
-// if ((Up-ustart2(i))*(UV(1)-ustart2(i)) +
-// (Vp-vstart2(i))*(UV(2)-vstart2(i)) <= 0)
- Utest = ustart2(i);
- Vtest = vstart2(i);
+// if ((Up-wd2[i].ustart)*(UV(1)-wd2[i].ustart) +
+// (Vp-wd2[i].vstart)*(UV(2)-wd2[i].vstart) <= 0)
+ Utest = wd2[i].ustart;
+ Vtest = wd2[i].vstart;
Du = UV(1)-Utest;
Dv = UV(2)-Vtest;
if ((Abs(Du) < tolu2 && Abs(Dv) < tolv2) ||
(Abs(Dup) < tolu2 && Abs(Dvp) < tolv2)) {
- etat2(i) = -etat2(i);
+ wd2[i].etat = -wd2[i].etat;
}
else {
Standard_Real DDu = (UV(1)-Up);
if(DD1<=DDD) {
Standard_Real DD2 = Dup*Dup+Dvp*Dvp;
if(DD2<=DDD && ((Du*Dup) + (Dv*Dvp*tolu/tolv) <= 0.)) {
- etat2(i) = -etat2(i);
+ wd2[i].etat = -wd2[i].etat;
}
}
}
for (l = 1; l <= 2 && !Arrive; l++) {
Standard_Boolean isToCheck;
- for (i = 1; i <= etat1.Length(); i++) {
+ for (size_t i = 1; i < wd1.size(); i++) {
if (l == 1)
- isToCheck = (etat1(i) > 0);
+ isToCheck = (wd1[i].etat > 0);
else
- isToCheck = (etat1(i) < 0);
+ isToCheck = (wd1[i].etat < 0);
if (isToCheck) {
// Modified by Sergey KHROMOV - Tue Nov 20 11:03:16 2001 End
// debug jag voir avec isg
- Utest = ustart1(i);
- Vtest = vstart1(i);
+ Utest = wd1[i].ustart;
+ Vtest = wd1[i].vstart;
Dup = Up - Utest;
Dvp = Vp - Vtest;
if (Abs(Dup) >= tolu || Abs(Dvp) >= tolv) {
UV(2) = Vtest;
*/
}
- else if (nbMultiplicities(i) > 0 && i_candidates.IsEmpty()) {
+ else if (nbMultiplicities[i] > 0 && i_candidates.IsEmpty()) {
N=0;
- for (k = 1; k < i; k++) {
- N+=nbMultiplicities(k);
+ for (size_t k = 1; k < i; k++) {
+ N+=nbMultiplicities[k];
}
- for (j = N + 1; j <= N + nbMultiplicities(i); j++) {
+ for (j = N + 1; j <= N + nbMultiplicities[i]; j++) {
if (((Up-Umult(j))*(UV(1)-Umult(j)) +
(Vp-Vmult(j))*(UV(2)-Vmult(j)) < 0) ||
(Abs(UV(1)-Umult(j)) < tolu &&
}
}
}
- } //end of for (i = 1; i <= etat1.Length(); i++)
+ } //end of for (i = 1; i < wd1.size(); i++)
if (!i_candidates.IsEmpty())
{
Standard_Real MinSqDist = RealLast();
Irang = i_candidates(ind);
}
Arrive = Standard_True;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
}
} //end of for (l = 1; l <= 2 && !Arrive; l++)
return Arrive;
Standard_Real dPreviousCurrent = (Up-UV1)*(Up-UV1)+(Vp-UV2)*(Vp-UV2);
- for (k = 1; k <= etat2.Length(); k++) {
- if (etat2(k) > 0) {
- Utest = ustart2(k);
- Vtest = vstart2(k);
+ for (k = 1; k < (int)wd2.size(); k++) {
+ if (wd2[k].etat > 0) {
+ Utest = wd2[k].ustart;
+ Vtest = wd2[k].vstart;
Utest/=deltau;
Vtest/=deltav;
&& (UV2mVtest<tolv2 && UV2mVtest>-tolv2)) {
if(Index!=k) {
//-- cout<<"* etat2 : ("<<k<<")"<<endl;
- etat2(k)=-etat2(k); //-- marque le point comme point de passage
+ wd2[k].etat=-wd2[k].etat; //-- marque le point comme point de passage
}
else { //-- Index == k
//-- cout<<"* Arrive"<<endl;
if( (Abs(UpmUtest)<tolu && Abs(VpmVtest)<tolv)) {
if(Index != k ) {
//-- cout<<"** etat2 : ("<<k<<")"<<endl;
- etat2(k) = -etat2(k);
+ wd2[k].etat = -wd2[k].etat;
}
}
else if(Scal<0 && (dPreviousStart+dCurrentStart < dPreviousCurrent)) {
}
else {
//-- cout<<"*** etat2 : ("<<k<<")"<<endl;
- etat2(k) = -etat2(k); // marque le point point de passage
+ wd2[k].etat = -wd2[k].etat; // marque le point point de passage
}
}
else if(k!=Index) {
if(dPreviousStart < dPreviousCurrent*0.25) {
- etat2(k) = -etat2(k); // marque le point point de passage
+ wd2[k].etat = -wd2[k].etat; // marque le point point de passage
//-- cout<<"**** etat2 : ("<<k<<")"<<endl;
}
else {
if(dCurrentStart < dPreviousCurrent*0.25) {
//-- cout<<"***** etat2 : ("<<k<<")"<<endl;
- etat2(k) = -etat2(k); // marque le point point de passage
+ wd2[k].etat = -wd2[k].etat; // marque le point point de passage
}
else {
Standard_Real UMidUtest = 0.5*(UV1+Up)-Utest;
if(dMiddleStart < dPreviousCurrent*0.5) {
//-- cout<<"*********** etat2 : ("<<k<<")"<<endl;
- etat2(k) = -etat2(k); // marque le point point de passage
+ wd2[k].etat = -wd2[k].etat; // marque le point point de passage
}
}
}
// test de passage sur points passant.
Irang =0;
- for (i = 1; i <= etat1.Length(); i++) {
- if (etat1(i) > 0 && etat1(i) < 11) { //test des points passant
- Utest = ustart1(i);
- Vtest = vstart1(i);
+ for (i = 1; i < (int)wd1.size(); i++) {
+ if (wd1[i].etat > 0 && wd1[i].etat < 11) { //test des points passant
+ Utest = wd1[i].ustart;
+ Vtest = wd1[i].vstart;
Utest/=deltau;
Vtest/=deltav;
if (((Up-Utest) * (UV1-Utest) + (Vp-Vtest) * (UV2-Vtest) < 0) ||
(Abs(UV1-Utest) < tolu && Abs(UV2-Vtest) < tolv))
Irang = i;
- else if (nbMultiplicities(i) > 0) {
+ else if (nbMultiplicities[i] > 0) {
N=0;
- for (k = 1; k < i; k++) N = N + nbMultiplicities(k);
- for (Standard_Integer j = N + 1; j <= N + nbMultiplicities(i); j++) {
+ for (k = 1; k < i; k++) N = N + nbMultiplicities[k];
+ for (Standard_Integer j = N + 1; j <= N + nbMultiplicities[i]; j++) {
Standard_Real Umultj = Umult(j)/deltau;
Standard_Real Vmultj = Vmult(j)/deltav;
if (((Up-Umultj)*(UV1-Umultj) +
Irang =0;
- for (Standard_Integer i = 1; i <= etat1.Length(); i++) {
- if (etat1(i) < 0) {
+ for (Standard_Integer i = 1; i < (int)wd1.size(); i++) {
+ if (wd1[i].etat < 0) {
N=0; // rang dans UVMult.
- if (nbMultiplicities(i) > 0) {
+ if (nbMultiplicities[i] > 0) {
for (Standard_Integer k = 1; k < i; k++)
- N+=nbMultiplicities(k);
+ N+=nbMultiplicities[k];
}
if (!reversed) {
Line->Value(1).ParametersOnS2(Up,Vp);
Line->Value(j).ParametersOnS1(Uc,Vc);
}
- Scal = (Up-ustart1(i)) * (Uc-ustart1(i)) +
- (Vp-vstart1(i)) * (Vc-vstart1(i));
+ Scal = (Up-wd1[i].ustart) * (Uc-wd1[i].ustart) +
+ (Vp-wd1[i].vstart) * (Vc-wd1[i].vstart);
// si on a trouve un point d arret : on arrete la ligne sur ce point.
if (Scal < 0) {
Line->Cut(j); nbp= Line->NbPoints();
Irang = i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
}
- else if (Abs(Uc-ustart1(i)) < tolerance(1) &&
- Abs(Vc-vstart1(i)) < tolerance(2) ) {
+ else if (Abs(Uc-wd1[i].ustart) < tolerance(1) &&
+ Abs(Vc-wd1[i].vstart) < tolerance(2) ) {
Line->Cut(j); nbp= Line->NbPoints();
Irang=i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
}
- else if (nbMultiplicities(i) > 0) {
- for (Standard_Integer k = N+1; k <= N + nbMultiplicities(i); k++) {
+ else if (nbMultiplicities[i] > 0) {
+ for (Standard_Integer k = N+1; k <= N + nbMultiplicities[i]; k++) {
Scal = (Up-Umult(k)) * (Uc-Umult(k)) +
(Vp-Vmult(k)) * (Vc-Vmult(k));
if (Scal < 0) {
Line->Cut(j); nbp= Line->NbPoints();
Irang=i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
break;
}
Abs(Vc-Vmult(k)) < tolerance(2)) {
Line->Cut(j); nbp= Line->NbPoints();
Irang=i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
break;
}
// point calcule.
// il n y aura pas besoin de "Cuter"
- Scal = (Up-ustart1(i)) * (UV(1)-ustart1(i)) +
- // (Vp-ustart1(i)) * (UV(2)-vstart1(i));
+ Scal = (Up-wd1[i].ustart) * (UV(1)-wd1[i].ustart) +
+ // (Vp-wd1[i].vstart) * (UV(2)-wd1[i].vstart);
// modified by NIZHNY-MKK Fri Oct 27 12:29:41 2000
- (Vp-vstart1(i)) * (UV(2)-vstart1(i));
+ (Vp-wd1[i].vstart) * (UV(2)-wd1[i].vstart);
if (Scal < 0) {
Irang = i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
}
- else if (Abs(UV(1)-ustart1(i)) < tolerance(1) &&
- Abs(UV(2)-vstart1(i)) < tolerance(2)) {
+ else if (Abs(UV(1)-wd1[i].ustart) < tolerance(1) &&
+ Abs(UV(2)-wd1[i].vstart) < tolerance(2)) {
Irang=i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
}
- else if (nbMultiplicities(i) > 0) {
- for (Standard_Integer j = N+1; j <= N+nbMultiplicities(i); j++) {
+ else if (nbMultiplicities[i] > 0) {
+ for (Standard_Integer j = N+1; j <= N+nbMultiplicities[i]; j++) {
Scal = (Up-Umult(j)) * (UV(1)-Umult(j)) +
(Vp-Vmult(j)) * (UV(2)-Vmult(j));
if (Scal < 0) {
Irang=i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
break;
}
else if (Abs(UV(1)-Umult(j)) < tolerance(1) &&
Abs(UV(2)-Vmult(j)) < tolerance(2)) {
Irang=i;
- UV(1) = ustart1(Irang);
- UV(2) = vstart1(Irang);
+ UV(1) = wd1[Irang].ustart;
+ UV(2) = wd1[Irang].vstart;
Found = Standard_True;
break;
}
-#ifndef DEB
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-#endif
+#include <NCollection_IncAllocator.hxx>
+#include <NCollection_LocalArray.hxx>
+
// modified by NIZHNY-MKK Thu Nov 2 15:07:26 2000.BEGIN
-static Standard_Boolean TestPassedSolutionWithNegativeState(const TColStd_SequenceOfInteger& etat,
+static Standard_Boolean TestPassedSolutionWithNegativeState(const IntWalk_VectorOfWalkingData& wd,
const TColStd_SequenceOfReal& Umult,
const TColStd_SequenceOfReal& Vmult,
- const TColStd_SequenceOfReal& ustart,
- const TColStd_SequenceOfReal& vstart,
const Standard_Real& prevUp,
const Standard_Real& prevVp,
- const TColStd_SequenceOfInteger& nbMultiplicities,
+ const IntWalk_VectorOfInteger& nbMultiplicities,
const math_Vector& tolerance,
TheIWFunction& sp,
math_Vector& UV,
Standard_Integer nbPath = Pnts1.Length();
// modified by NIZHNY-MKK Fri Oct 27 12:32:34 2000.BEGIN
- TColStd_SequenceOfInteger movementdirectioninfo;
- for (I = 1; I <= nbPath; I++) {
- movementdirectioninfo.Append(0);
+ NCollection_LocalArray<Standard_Integer> movementdirectioninfoarr (nbPath + 1);
+ Standard_Integer* movementdirectioninfo = movementdirectioninfoarr;
+ for (I = 0; I <= nbPath; I++) {
+ movementdirectioninfo[I] = 0;
}
// modified by NIZHNY-MKK Fri Oct 27 12:32:38 2000.END
for (I = 1; I <= nbPath; I++) {
//start point of the progression
- // if (etat1(I) > 11) {
+ // if (wd1[I].etat > 11) {
// modified by NIZHNY-MKK Fri Oct 27 12:33:37 2000.BEGIN
- if ((etat1(I) > 11) || ((etat1(I) < -11) && (movementdirectioninfo(I)!=0))) {
+ if ((wd1[I].etat > 11) || ((wd1[I].etat < -11) && (movementdirectioninfo[I]!=0))) {
// modified by NIZHNY-MKK Fri Oct 27 12:33:43 2000.END
PathPnt = Pnts1.Value(I);
- CurrentLine = new IntWalk_TheIWLine ();
+ CurrentLine = new IntWalk_TheIWLine (new NCollection_IncAllocator());
CurrentLine->SetTangencyAtBegining(Standard_False);
Tgtend = Standard_False;
CurrentLine->AddStatusFirst(Standard_False, Standard_True, I, PathPnt);
- UVap(1) = ustart1(I);
- UVap(2) = vstart1(I);
+ UVap(1) = wd1[I].ustart;
+ UVap(2) = wd1[I].vstart;
MakeWalkingPoint(11, UVap(1), UVap(2), Func, previousPoint);
previousd3d = Func.Direction3d();
previousd2d = Func.Direction2d();
CurrentLine->AddPoint(previousPoint);
// modified by NIZHNY-MKK Fri Oct 27 12:34:32 2000.BEGIN
- if(movementdirectioninfo(I) !=0) {
- if(movementdirectioninfo(I) < 0) {
+ if(movementdirectioninfo[I] !=0) {
+ if(movementdirectioninfo[I] < 0) {
StepSign = -1;
CurrentLine->SetTangentVector(previousd3d.Reversed(),1);
} else {
// modified by NIZHNY-MKK Fri Oct 27 12:34:37 2000.END
// Modified by Sergey KHROMOV - Tue Nov 20 10:41:45 2001 Begin
- etat1(I) = - abs(etat1(I));
- movementdirectioninfo(I) = (movementdirectioninfo(I)==0) ? StepSign : 0;
+ wd1[I].etat = - abs(wd1[I].etat);
+ movementdirectioninfo[I] = (movementdirectioninfo[I]==0) ? StepSign : 0;
// Modified by Sergey KHROMOV - Tue Nov 20 10:41:56 2001 End
// first step of advancement
Standard_Real d2dx = Abs(previousd2d.X());
else {
previousPoint.ParametersOnS1(prevUp, prevVp);
}
- Arrive = TestPassedSolutionWithNegativeState(etat1, Umult, Vmult, ustart1, vstart1, prevUp, prevVp,
+ Arrive = TestPassedSolutionWithNegativeState(wd1, Umult, Vmult, prevUp, prevVp,
nbMultiplicities, tolerance, Func, UVap, N);
if(Arrive) {
Cadre = Standard_False;
// point of stop given at input
PathPnt = Pnts1.Value(N);
- Standard_Integer etat1N=etat1(N);
+ Standard_Integer etat1N=wd1[N].etat;
// modified by NIZHNY-MKK Thu Nov 2 15:09:51 2000.BEGIN
// if (etat1N < 11) { // passing point that is a stop
if (Abs(etat1N) < 11) { // passing point that is a stop
AddPointInCurrentLine(N,PathPnt,CurrentLine);
if ((etat1N != 1 && etat1N != 11)) {
// modified by NIZHNY-MKK Fri Oct 27 12:43:05 2000.BEGIN
- // etat1(N)= - etat1N;
- etat1(N)= - Abs(etat1N);
- movementdirectioninfo(N) = (movementdirectioninfo(N)==0) ? StepSign : 0;
- if(Arrive && movementdirectioninfo(N)!=0) {
+ // wd1[N].etat= - wd1[N].etat;
+ wd1[N].etat = - Abs(etat1N);
+ movementdirectioninfo[N] = (movementdirectioninfo[N]==0) ? StepSign : 0;
+ if(Arrive && movementdirectioninfo[N]!=0) {
IndexOfPathPointDoNotCheck = N;
}
CurrentLine->SetTangencyAtEnd(Tgtend);
lines.Append(CurrentLine);
// modified by NIZHNY-MKK Fri Oct 27 12:59:29 2000.BEGIN
- movementdirectioninfo(I)=0;
- if(etat1(I) > 0)
+ movementdirectioninfo[I]=0;
+ if(wd1[I].etat > 0)
// modified by NIZHNY-MKK Fri Oct 27 12:59:42 2000.END
- etat1(I)=-etat1(I);
+ wd1[I].etat=-wd1[I].etat;
//-- lbr le 5 juin 97 (Pb ds Contap)
for(Standard_Integer av=1; av<=nbPath; av++) {
// modified by NIZHNY-MKK Fri Oct 27 13:00:22 2000.BEGIN
- // if (etat1(av) > 11) {
- if ((etat1(av) > 11) ||
+ // if (wd1[av].etat > 11) {
+ if ((wd1[av].etat > 11) ||
((av!=I) &&
(av!=IndexOfPathPointDoNotCheck) &&
- (etat1(av) < -11) &&
- (movementdirectioninfo(av)!=0))) {
+ (wd1[av].etat < -11) &&
+ (movementdirectioninfo[av]!=0))) {
// modified by NIZHNY-MKK Fri Oct 27 13:00:26 2000.END
- Standard_Real Uav=ustart1(av);
- Standard_Real Vav=vstart1(av);
+ Standard_Real Uav=wd1[av].ustart;
+ Standard_Real Vav=wd1[av].vstart;
Standard_Real Uavp,Vavp;
const IntSurf_PntOn2S &avP=CurrentLine->Value(CurrentLine->NbPoints());
if (!reversed) {
Uav*=0.001; Vav*=0.001;
if(Abs(Uav)<tolerance(1) && Abs(Vav)<tolerance(2)) {
// modified by NIZHNY-MKK Fri Oct 27 13:01:38 2000.BEGIN
- // etat1(av)=-etat1(av);
- if(etat1(av) < 0) {
- movementdirectioninfo(av) = 0;
+ // wd1[av].etat=-wd1[av].etat;
+ if(wd1[av].etat < 0) {
+ movementdirectioninfo[av] = 0;
} else {
- etat1(av)=-etat1(av);
- movementdirectioninfo(av) = StepSign;
+ wd1[av].etat=-wd1[av].etat;
+ movementdirectioninfo[av] = StepSign;
}
// modified by NIZHNY-MKK Fri Oct 27 13:01:42 2000.END
CurrentLine->AddStatusLast(Standard_True, av, Pnts1.Value(av));
else {
avPP.ParametersOnS1(Uavp,Vavp);
}
- Uav=ustart1(av);
- Vav=vstart1(av);
+ Uav=wd1[av].ustart;
+ Vav=wd1[av].vstart;
Uav-=Uavp;
Vav-=Vavp;
Uav*=0.001; Vav*=0.001;
if(Abs(Uav)<tolerance(1) && Abs(Vav)<tolerance(2)) {
// modified by NIZHNY-MKK Fri Oct 27 13:02:49 2000.BEGIN
- // etat1(av)=-etat1(av);
- if(etat1(av) < 0) {
- movementdirectioninfo(av) = 0;
+ // wd1[av].etat=-wd1[av].etat;
+ if(wd1[av].etat < 0) {
+ movementdirectioninfo[av] = 0;
} else {
- etat1(av)=-etat1(av);
- movementdirectioninfo(av) = -StepSign;
+ wd1[av].etat=-wd1[av].etat;
+ movementdirectioninfo[av] = -StepSign;
}
// modified by NIZHNY-MKK Fri Oct 27 13:02:52 2000.END
//-- cout<<"\n Debug ? lbr ds IntWalk_IWalking_3.gxx"<<endl;
}
// modified by NIZHNY-MKK Thu Nov 2 15:07:53 2000.BEGIN
-static Standard_Boolean TestPassedSolutionWithNegativeState(const TColStd_SequenceOfInteger& etat,
+static Standard_Boolean TestPassedSolutionWithNegativeState(const IntWalk_VectorOfWalkingData& wd,
const TColStd_SequenceOfReal& Umult,
const TColStd_SequenceOfReal& Vmult,
- const TColStd_SequenceOfReal& ustart,
- const TColStd_SequenceOfReal& vstart,
const Standard_Real& prevUp,
const Standard_Real& prevVp,
- const TColStd_SequenceOfInteger& nbMultiplicities,
+ const IntWalk_VectorOfInteger& nbMultiplicities,
const math_Vector& tolerance,
TheIWFunction& sp,
math_Vector& UV,
Standard_Real tolu = tolerance(1);
Standard_Real tolv = tolerance(2);
Standard_Integer i, j, k, N;
- for (i = 1; i <= etat.Length(); i++) {
- if (etat(i) < -11) {
+ for (i = 1; i < (int)wd.size(); i++) {
+ if (wd[i].etat < -11) {
// debug jag see with isg
- Utest = ustart(i);
- Vtest = vstart(i);
+ Utest = wd[i].ustart;
+ Vtest = wd[i].vstart;
Dup = prevUp - Utest;
Dvp = prevVp - Vtest;
if (Abs(Dup) >= tolu || Abs(Dvp) >= tolv) {
UV(1) = Utest;
UV(2) = Vtest;
}
- else if (nbMultiplicities(i) > 0) {
+ else if (nbMultiplicities[i] > 0) {
N=0;
for (k = 1; k < i; k++) {
- N+=nbMultiplicities(k);
+ N+=nbMultiplicities[k];
}
- for (j = N + 1; j <= N + nbMultiplicities(i); j++) {
+ for (j = N + 1; j <= N + nbMultiplicities[i]; j++) {
if (((prevUp-Umult(j))*(UV(1)-Umult(j)) +
(prevVp-Vmult(j))*(UV(2)-Vmult(j)) < 0) ||
(Abs(UV(1)-Umult(j)) < tolu &&
// and conditions governing the rights and limitations under the License.
-
-#ifndef DEB
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-#endif
+#include <NCollection_IncAllocator.hxx>
void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
const TColStd_SequenceOfReal& Vmult,
Standard_Integer nbLoop = Pnts2.Length();
for (I = 1;I<=nbLoop;I++) {
- if (etat2(I) > 12) { // start point of closed line
+ if (wd2[I].etat > 12) { // start point of closed line
LoopPnt = Pnts2.Value(I);
previousPoint.SetValue(ThePointOfLoopTool::Value3d(LoopPnt),reversed,
- ustart2(I),vstart2(I));
+ wd2[I].ustart,wd2[I].vstart);
previousd3d = ThePointOfLoopTool::Direction3d(LoopPnt);
previousd2d = ThePointOfLoopTool::Direction2d(LoopPnt);
- CurrentLine = new IntWalk_TheIWLine ();
+ CurrentLine = new IntWalk_TheIWLine (new NCollection_IncAllocator());
CurrentLine->AddPoint(previousPoint);
CurrentLine->SetTangentVector(previousd3d,1);
Tgtbeg = Standard_False;
Tgtend = Standard_False;
- Uvap(1) = ustart2(I);
- Uvap(2) = vstart2(I);
+ Uvap(1) = wd2[I].ustart;
+ Uvap(2) = wd2[I].vstart;
StepSign = 1;
else {
Tgtend = lines.Value(-N)->IsTangentAtBegining();
}
- Arrive = (etat2(I) == 12);
+ Arrive = (wd2[I].etat == 12);
}
}
Tgtend = Func.IsTangent(); // jag 940616
N = -N;
}
- Arrive = (etat2(I) == 12); // the line is open
+ Arrive = (wd2[I].etat == 12); // the line is open
}
}
Status = TestDeflection(Func, Arrive,Uvap,StatusPrecedent,
}
else { // open
- etat2(I) = 12; // declare it open
+ wd2[I].etat = 12; // declare it open
Tgtbeg = Tgtend;
Tgtend = Standard_False;
ArretAjout = Standard_False;
Arrive = Standard_False;
break;
}
- if (etat2(I) >12) { //the line should become open
- etat2(I) = 12; //declare it open
+ if (wd2[I].etat >12) { //the line should become open
+ wd2[I].etat = 12; //declare it open
ArretAjout = Standard_False;
OpenLine(0,Psol,Pnts1,Func,CurrentLine);
StepSign = -1;
}
}
else if (Arrive) {
- if (etat2(I) > 12) { //line closed good case
+ if (wd2[I].etat > 12) { //line closed good case
CurrentLine->AddStatusFirstLast(Standard_True,
Standard_False,Standard_False);
CurrentLine->AddPoint(CurrentLine->Value(1));
}
}
else if (Status == IntWalk_ArretSurPoint) {
- if (etat2(I) >12) { //line should become open
- etat2(I) = 12; //declare it open
+ if (wd2[I].etat >12) { //line should become open
+ wd2[I].etat = 12; //declare it open
Tgtbeg = Standard_True;
Tgtend = Standard_False;
N= -lines.Length()-1;
CurrentLine->SetTangencyAtEnd(Tgtend);
lines.Append(CurrentLine);
- etat2(I)=-etat2(I); //mark point as processed
+ wd2[I].etat=-wd2[I].etat; //mark point as processed
}
} //end of processing of start point
} //end of all start points
IntSurf_PntOn2S Psol;
Psol.SetValue(ThePointOfPathTool::Value3d(PathPnt),
- reversed,ustart1(N),vstart1(N));
+ reversed,wd1[N].ustart,wd1[N].vstart);
CurrentLine->AddPoint(Psol);
}
--- /dev/null
+// Created on: 2013-0603
+// Created by: Roman LYGIN
+// Copyright (c) 2013-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef IntWalk_VectorOfInteger_HeaderFile
+#define IntWalk_VectorOfInteger_HeaderFile
+
+#include <vector>
+#include <NCollection_StdAllocator.hxx>
+
+typedef std::vector<Standard_Integer, NCollection_StdAllocator<Standard_Integer> >
+ IntWalk_VectorOfInteger;
+
+#endif
--- /dev/null
+// Created on: 2013-0603
+// Created by: Roman LYGIN
+// Copyright (c) 2013-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef IntWalk_VectorOfWalkingData_HeaderFile
+#define IntWalk_VectorOfWalkingData_HeaderFile
+
+#include <vector>
+#include <NCollection_StdAllocator.hxx>
+
+struct IntWalk_WalkingData
+{
+ Standard_Real ustart;
+ Standard_Real vstart;
+ Standard_Integer etat;
+};
+
+typedef std::vector<IntWalk_WalkingData, NCollection_StdAllocator<IntWalk_WalkingData> >
+ IntWalk_VectorOfWalkingData;
+
+#endif
Bnd_Box2d bSO;
Bnd_Box2d bST;
- Standard_Integer iObje1, iObje2;
+ Standard_Integer iObje1, iObje2, n1 = nbso, n2 = Obje2.NbSegments();
+ Standard_Real d1 = Obje1.DeflectionOverEstimation(),
+ d2 = Obje2.DeflectionOverEstimation();
gp_Pnt2d p1b, p1e, p2b, p2e;
- for (iObje1=1; iObje1<=Obje1.NbSegments(); iObje1++)
+ for (iObje1=1; iObje1<=n1; iObje1++)
{
bSO.SetVoid();
Obje1.Segment(iObje1,p1b,p1e);
bSO.Add(p1b);
bSO.Add(p1e);
- bSO.Enlarge(Obje1.DeflectionOverEstimation());
+ bSO.Enlarge(d1);
if (!Obje2.Bounding().IsOut(bSO)) {
- for (iObje2=1; iObje2<=Obje2.NbSegments(); iObje2++) {
+ for (iObje2=1; iObje2<=n2; iObje2++) {
bST.SetVoid();
Obje2.Segment(iObje2,p2b,p2e);
bST.Add(p2b);
bST.Add(p2e);
- bST.Enlarge(Obje2.DeflectionOverEstimation());
+ bST.Enlarge(d2);
if (!bSO.IsOut(bST))
Intersect(iObje1, iObje2, p1b, p1e, p2b, p2e);
}
Bnd_Box2d bSO;
Bnd_Box2d bST;
- Standard_Integer iObje1, iObje2;
+ Standard_Integer iObje1, iObje2, n = Obje.NbSegments();
+ Standard_Real d = Obje.DeflectionOverEstimation();
gp_Pnt2d p1b, p1e, p2b, p2e;
- for (iObje1=1; iObje1<=Obje.NbSegments(); iObje1++) {
+ for (iObje1=1; iObje1<=n; iObje1++) {
bSO.SetVoid();
Obje.Segment(iObje1,p1b,p1e);
bSO.Add(p1b);
bSO.Add(p1e);
- bSO.Enlarge(Obje.DeflectionOverEstimation());
+ bSO.Enlarge(d);
if (!Obje.Bounding().IsOut(bSO)) {
- for (iObje2=iObje1+1;iObje2<=Obje.NbSegments();iObje2++){
+ for (iObje2=iObje1+1;iObje2<=n;iObje2++){
bST.SetVoid();
Obje.Segment(iObje2,p2b,p2e);
bST.Add(p2b);
bST.Add(p2e);
- bST.Enlarge(Obje.DeflectionOverEstimation());
+ bST.Enlarge(d);
if (!bSO.IsOut(bST))
Intersect(iObje1, iObje2, p1b, p1e, p2b, p2e);
}
// On considere <nbseg> points sur [uMin,uMax]
// Quel est le plus proche. Et quel est le nouvel intervalle
// (il ne peut pas deborder l ancien)
- Standard_Real u, dist, delta = (nbseg == 0)? 0 : (uMax-uMin)/nbseg; //szv#4:S4163:12Mar99 anti-exception
+ Standard_Real u, dist2, delta = (nbseg == 0)? 0 : (uMax-uMin)/nbseg; //szv#4:S4163:12Mar99 anti-exception
+ Standard_Real distmin2 = distmin * distmin;
+ Standard_Boolean aHasChanged = Standard_False;
for (Standard_Integer i = 0; i <= nbseg; i ++) {
u = uMin + (delta * i);
gp_Pnt PU = AC.Value (u);
- dist = PU.Distance (P3D);
- if (dist < distmin) { distmin = dist; proj = PU; param = u; }
+ dist2 = PU.SquareDistance (P3D);
+ if (dist2 < distmin2) { distmin2 = dist2; proj = PU; param = u; aHasChanged = Standard_True; }
}
-
+ if (aHasChanged)
+ distmin = Sqrt (distmin2);
#ifdef DEBUG
cout<<"ShapeAnalysis_Geom:Project, param="<<param<<" -> distmin="<<distmin<<endl;
#endif
+puts "TODO ?OCC7287 ALL: Tcl Exception: Memory leak detected"
+puts "TODO ?OCC7287 ALL: TEST INCOMPLETE"
puts "============"
puts "OCC7287"
puts "============"
puts "TODO CR23096 ALL: TPSTAT : Faulty"
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
puts "TODO CR23096 ALL: LABELS : Faulty"
-
+puts "TODO ?CR23096 ALL: CHECKSHAPE : Faulty"
+puts "TODO ?CR23096 ALL: Error : 5 differences with reference data found"
set filename BUC60291.igs
# !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 Mandriva2010: Error : 2 differences with reference data found :"
+puts "TODO ?CR23096 ALL: Error : 1 differences with reference data found :"
puts "TODO CR23096 Mandriva2010: STATSHAPE : Faulty"
set LinuxDiff 2