Eliminated warnings about "declaration of some local variable hides previous local declaration"
// Compute geometry for this plane and edges
Standard_Boolean isInfinite1,isInfinite2;
gp_Pnt aFirstPoint1, aLastPoint1, aFirstPoint2, aLastPoint2;
- gp_Lin2d aFirstLin2d, aSecondLin2d;
if (!AIS::ComputeGeometry (aFirstEdge, aSecondEdge,
aFirstLine, aSecondLine,
TopoDS_Face aSecondFace = TopoDS::Face (mySecondShape);
gp_Dir aFirstDir, aSecondDir;
- gp_Pln aFirstPlane, aSecondPlane;
+ gp_Pln aFirstPln, aSecondPln;
Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf;
AIS_KindOfSurface aFirstSurfType, aSecondSurfType;
Standard_Real aFirstOffset, aSecondOffset;
- AIS::GetPlaneFromFace (aFirstFace, aFirstPlane,
+ AIS::GetPlaneFromFace (aFirstFace, aFirstPln,
aFirstBasisSurf,aFirstSurfType,aFirstOffset);
- AIS::GetPlaneFromFace (aSecondFace, aSecondPlane,
+ AIS::GetPlaneFromFace (aSecondFace, aSecondPln,
aSecondBasisSurf, aSecondSurfType, aSecondOffset);
if (aFirstSurfType == AIS_KOS_Plane && aSecondSurfType == AIS_KOS_Plane)
TopoDS_Face aSecondFace = TopoDS::Face (mySecondShape);
gp_Dir aFirstDir, aSecondDir;
- gp_Pln aFirstPlane, aSecondPlane;
+ gp_Pln aFirstPln, aSecondPln;
Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf;
AIS_KindOfSurface aFirstSurfType, aSecondSurfType;
Standard_Real aFirstOffset, aSecondOffset;
- AIS::GetPlaneFromFace (aFirstFace, aFirstPlane,
+ AIS::GetPlaneFromFace (aFirstFace, aFirstPln,
aFirstBasisSurf,aFirstSurfType,aFirstOffset);
- AIS::GetPlaneFromFace (aSecondFace, aSecondPlane,
+ AIS::GetPlaneFromFace (aSecondFace, aSecondPln,
aSecondBasisSurf, aSecondSurfType, aSecondOffset);
myFirstPoint = thePointOnFirstFace;
aPrimSegments->AddVertex (theSecondPoint);
aPrimSegments->AddVertex (aLineEndPoint);
- Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect();
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
}
else if (theSecondShape.ShapeType() == TopAbs_EDGE)
{
myGeometryType = GeometryType_EdgeVertex;
- Standard_Boolean isSuccess = InitEdgeVertexLength (TopoDS::Edge(theSecondShape),
- TopoDS::Vertex(theFirstShape),
- aDirAttach,
- isInfinite);
+ isSuccess = InitEdgeVertexLength (TopoDS::Edge(theSecondShape),
+ TopoDS::Vertex(theFirstShape),
+ aDirAttach,
+ isInfinite);
if (isSuccess)
{
theComputedPlane = ComputePlane (aDirAttach);
{
myDone = Standard_False;
myDegre = Deg;
- math_Matrix InvM(1, Deg+1, 1, Deg + 1);
Standard_Integer i, j, k, c, i2;
Standard_Integer classe = Deg + 1, cl1 = Deg;
Standard_Real U, dU, Coeff, Coeff2;
if (!isready) {
return;
}
- Standard_Integer i, j, k, Ci, Nincx, i2, k1, k2;
+ Standard_Integer i, j, k, Ci, i2, k1, k2;
Standard_Integer nbpol1 = nbpoles-1, Ninc1 = Ninc-1;
Standard_Real AD1, A0;
// gp_Pnt Pt;
// cas de tangence:
// ===========================================================
- Nincx = resfin-resinit+1;
+ Standard_Integer Nincx = resfin-resinit+1;
Standard_Integer deport = 0, Nincx2 = 2*Nincx;
math_IntegerVector InternalIndex(1, Nincx);
aExp.Init(aS, TopAbs_FACE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current();
- const Handle(Geom_Surface)& aS = BRep_Tool::Surface(aF);
- if (aS->Continuity() == GeomAbs_C0) {
+ Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aF);
+ if (aSurf->Continuity() == GeomAbs_C0) {
aMS.Add(aF);
}
}
Standard_Integer aDmin;
TopAbs_ShapeEnum aTmin;
TopoDS_Compound aC;
- TopoDS_Shape aSAIm, aSTIm;
BRep_Builder aBB;
TopExp_Explorer aExp;
BOPCol_DataMapOfShapeShape aDMSSA;
const BOPCol_ListOfShape& aLT=(!bFlag1) ? myArguments : myTools;
aItLS.Initialize(aLT);
for (; aItLS.More(); aItLS.Next()) {
- const TopoDS_Shape& aST=aItLS.Value();
- if (myImages.IsBound(aST)){
- const BOPCol_ListOfShape& aLSTIm=myImages.Find(aST);
+ const TopoDS_Shape& aTShape =aItLS.Value();
+ if (myImages.IsBound(aTShape)){
+ const BOPCol_ListOfShape& aLSTIm=myImages.Find(aTShape);
aItIm.Initialize(aLSTIm);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSTIm=aItIm.Value();
}
}// if (myImages.IsBound(aST)){
else {
- aExp.Init(aST, aTmin);
+ aExp.Init(aTShape, aTmin);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape aSIm=aExp.Current();
// skip degenerated edges
}
//
if (anUnUsedHoles.Extent()) {
- TopoDS_Face aFace;
aBB.MakeFace(aFace, aS, aLoc, aTol);
aMSH.Add(aFace, anUnUsedHoles);
//
//
iFlag=aVFI.Flag();
if (!iFlag) {
- TopoDS_Vertex& aVx=aVFI.Vertex();
+ TopoDS_Vertex& aVertex=aVFI.Vertex();
TopoDS_Face& aFy=aVFI.Face();
- aBB.Add(aFy, aVx);
+ aBB.Add(aFy, aVertex);
}
}
}
BOPAlgo_FillIn3DParts& aFIP=aVFIP(k);
bHasImage=aFIP.HasImage();
const TopoDS_Solid& aSolid=aFIP.Solid();
- const TopoDS_Solid& aSD=aFIP.DraftSolid();
+ const TopoDS_Solid& aSDraft =aFIP.DraftSolid();
const BOPCol_ListOfShape& aLFIN=aFIP.LFIN();
const BOPCol_ListOfShape& aLIF=aFIP.LIF();
//
}
//
if (aNbFIN || bHasImage) {
- theDraftSolids.Bind(aSolid, aSD);
+ theDraftSolids.Bind(aSolid, aSDraft);
}
}
}
BOPTools_AlgoTools::MakeNewVertex(aE1, aT1, aE2, aT2, aVnew);
// <-LXBR
{
- Standard_Integer nVS[2], iFound, k;
+ Standard_Integer nVS[2], iFound;
Standard_Real aTolVx, aTolVnew, aD2, aDT2;
BOPCol_MapOfInteger aMV;
gp_Pnt aPnew, aPx;
aTolVnew=BRep_Tool::Tolerance(aVnew);
aPnew=BRep_Tool::Pnt(aVnew);
//
- for (k=0; k<=j; ++k) {
- const TopoDS_Vertex& aVx= *(TopoDS_Vertex*)&(myDS->Shape(nVS[k]));
+ for (Standard_Integer k1=0; k1<=j; ++k1) {
+ const TopoDS_Vertex& aVx= *(TopoDS_Vertex*)&(myDS->Shape(nVS[k1]));
aTolVx=BRep_Tool::Tolerance(aVx);
aPx=BRep_Tool::Pnt(aVx);
aD2=aPnew.SquareDistance(aPx);
//
Standard_Integer nVx, iV, j, nE, iFlag, iX, i, aNb;
Standard_Real aT;
- TopoDS_Shape aV;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
const BOPCol_ListOfInteger& aFaces = aCB1->Faces();
aIt.Initialize(aLPB);
for (; aIt.More(); aIt.Next()) {
- const Handle(BOPDS_PaveBlock)& aPB = aIt.Value();
+ const Handle(BOPDS_PaveBlock)& aPBValue = aIt.Value();
//
aCB = new BOPDS_CommonBlock;
aIt1.Initialize(aLPB1);
nE = aPB2->OriginalEdge();
//
aPB2n = new BOPDS_PaveBlock;
- aPB2n->SetPave1(aPB->Pave1());
- aPB2n->SetPave2(aPB->Pave2());
- aPB2n->SetEdge(aPB->Edge());
+ aPB2n->SetPave1(aPBValue->Pave1());
+ aPB2n->SetPave2(aPBValue->Pave2());
+ aPB2n->SetEdge(aPBValue->Edge());
aPB2n->SetOriginalEdge(nE);
aCB->AddPaveBlock(aPB2n);
myDS->SetCommonBlock(aPB2n, aCB);
//
aIt.Initialize(aLPB);
for (; aIt.More(); aIt.Next()) {
- Handle(BOPDS_PaveBlock)& aPB = aIt.ChangeValue();
- const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge());
+ Handle(BOPDS_PaveBlock)& aPBChangeValue = aIt.ChangeValue();
+ const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPBChangeValue->Edge());
aTolE = BRep_Tool::Tolerance(aE);
//
IntTools_EdgeFace anEF;
anEF.SetFace(aF);
anEF.SetTolE(aTolE);
anEF.SetTolF(aTolF);
- anEF.SetRange(aPB->Pave1().Parameter(), aPB->Pave2().Parameter());
+ anEF.SetRange(aPBChangeValue->Pave1().Parameter(), aPBChangeValue->Pave2().Parameter());
anEF.SetContext(myContext);
anEF.Perform();
//
Standard_Boolean bCoinc = (aCPrts(1).Type() == TopAbs_EDGE);
if (bCoinc) {
if (bCB) {
- aCB = myDS->CommonBlock(aPB);
+ aCB = myDS->CommonBlock(aPBChangeValue);
} else {
aCB = new BOPDS_CommonBlock;
- aCB->AddPaveBlock(aPB);
- myDS->SetCommonBlock(aPB, aCB);
+ aCB->AddPaveBlock(aPBChangeValue);
+ myDS->SetCommonBlock(aPBChangeValue, aCB);
}
aCB->AddFace(nF);
//
- aMPBIn.Add(aPB);
+ aMPBIn.Add(aPBChangeValue);
}
}
}
}
//
if (bRegular) {
- Standard_Integer k, aNbVR, aNbER;
+ Standard_Integer aNbVR, aNbER;
//
aNbVR=aMVER.Extent();
for (k=1; k<=aNbVR; ++k) {
aBB.MakeCompound(aRes);
TopTools_ListIteratorOfListOfShape aIt(aLS);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aS = aIt.Value();
- aBB.Add(aRes, aS);
+ const TopoDS_Shape& aShape = aIt.Value();
+ aBB.Add(aRes, aShape);
}
//
DBRep::Set(a[1], aRes);
aBB.MakeCompound(aRes);
TopTools_ListIteratorOfListOfShape aIt(aLS);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aS = aIt.Value();
- aBB.Add(aRes, aS);
+ const TopoDS_Shape& aShape = aIt.Value();
+ aBB.Add(aRes, aShape);
}
//
DBRep::Set(a[1], aRes);
Solinv(3) = pmin;
- math_FunctionSetRoot rsnld(FinvC,toler,30);
- rsnld.Perform(FinvC,Solinv,infb,supb);
+ math_FunctionSetRoot aRsnld(FinvC,toler,30);
+ aRsnld.Perform(FinvC,Solinv,infb,supb);
- if (!rsnld.IsDone()) {
+ if (!aRsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
#endif
}
else {
// It is necessary to check the value of the function
- rsnld.Root(Solinv);
+ aRsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolesp);
}
}
if (IndexMerged.Contains(i)) continue;
TopoDS_Shell shell = TopoDS::Shell(OldShells.FindKey(i));
if (NewShell.IsNull()) {
- BRep_Builder aB;
aB.MakeShell(NewShell);
TopoDS_Iterator aItSS(shell) ;
for( ; aItSS.More(); aItSS.Next())
if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S);
- Handle(BRepCheck_Result) aRes = myMap(aVertex);
+ Handle(BRepCheck_Result) aResOfVertex = myMap(aVertex);
- if ( ! aRes.IsNull() )
+ if ( !aResOfVertex.IsNull() )
{
- aRes->SetFailStatus(aVertex);
- aRes->SetFailStatus(S);
+ aResOfVertex->SetFailStatus(aVertex);
+ aResOfVertex->SetFailStatus(S);
}
}//catch(Standard_Failure)
}//for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
{
const Standard_Real aParam = aPOnTriag->Parameters()->Value(i);
const gp_Pnt aPE(aBC.Value(aParam)),
- aPT(Nodes(anIndices(i)).Transformed(aLL));
+ aPnt(Nodes(anIndices(i)).Transformed(aLL));
- const Standard_Real aSQDist = aPE.SquareDistance(aPT);
+ const Standard_Real aSQDist = aPE.SquareDistance(aPnt);
if(aSQDist > aTol*aTol)
{
return BRepCheck_InvalidPolygonOnTriangulation;
}
//JR/Hp :
- Standard_Integer iorf = MapOfShapeOrientation.Find(Fcur) ;
- orf = (TopAbs_Orientation) iorf ;
+ Standard_Integer anOriFCur = MapOfShapeOrientation.Find(Fcur) ;
+ orf = (TopAbs_Orientation)anOriFCur;
// orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
Fcur.Orientation(orf);
}
//JR/Hp :
- Standard_Integer iorf = MapOfShapeOrientation.Find(Fcur) ;
- orf = (TopAbs_Orientation) iorf ;
+ Standard_Integer anOriFCur = MapOfShapeOrientation.Find(Fcur) ;
+ orf = (TopAbs_Orientation)anOriFCur;
// orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
Fcur.Orientation(orf);
TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(aPnt);
BRepExtrema_ExtPF ExtPF(V1,S2);
- const Standard_Integer NbExtrema = ExtPF.IsDone()? ExtPF.NbExt() : 0;
- if ( NbExtrema > 0 )
+ const Standard_Integer NbExtremaPF = ExtPF.IsDone()? ExtPF.NbExt() : 0;
+ if (NbExtremaPF > 0 )
{
// Search minimum distance Dstmin
Standard_Integer ii;
Standard_Real Dstmin = ExtPF.SquareDistance(1);
- for (ii = 2; ii <= NbExtrema; ii++)
+ for (ii = 2; ii <= NbExtremaPF; ii++)
{
const Standard_Real sDst = ExtPF.SquareDistance(ii);
if (sDst<Dstmin)
if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin-myDstRef) < myEps))
{
- for (ii = 1; ii <= NbExtrema; ii++)
+ for (ii = 1; ii <= NbExtremaPF; ii++)
{
if (fabs(Dstmin-sqrt(ExtPF.SquareDistance(ii)))<myEps)
{
TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(aPnt);
BRepExtrema_ExtPF ExtPF(V1,S1);
- const Standard_Integer NbExtrema = ExtPF.IsDone()? ExtPF.NbExt() : 0;
- if ( NbExtrema > 0 )
+ const Standard_Integer NbExtremaPF = ExtPF.IsDone()? ExtPF.NbExt() : 0;
+ if (NbExtremaPF > 0 )
{
// Search minimum distance Dstmin
Standard_Integer ii;
Standard_Real Dstmin = ExtPF.SquareDistance(1);
- for (ii = 2; ii <= NbExtrema; ii++)
+ for (ii = 2; ii <= NbExtremaPF; ii++)
{
const Standard_Real sDst = ExtPF.SquareDistance(ii);
if (sDst<Dstmin)
if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin-myDstRef) < myEps))
{
- for (ii = 1; ii <= NbExtrema; ii++)
+ for (ii = 1; ii <= NbExtremaPF; ii++)
{
if (fabs(Dstmin-sqrt(ExtPF.SquareDistance(ii)))<myEps)
{
else {// else X0
// Only solids are preserved
TopoDS_Shape theGShape;
- BRep_Builder B;
B.MakeCompound(TopoDS::Compound(theGShape));
for (; exp.More(); exp.Next()) {
B.Add(theGShape,exp.Current());
}
// Only solids are preserved
theGShape.Nullify();
- BRep_Builder B;
B.MakeCompound(TopoDS::Compound(theGShape));
for (; exp.More(); exp.Next()) {
B.Add(theGShape,exp.Current());
Standard_Real min, max, pmin, pmax;
Standard_Boolean flag2;
TopoDS_Shape Compo;
- BRep_Builder B;
B.MakeCompound(TopoDS::Compound(Compo));
for (it.Initialize(lshape); it.More(); it.Next()) {
BRepFeat::ParametricMinMax(it.Value(),C,
}
}
- TopExp_Explorer exp(mySbase, TopAbs_FACE);
- for(; exp.More(); exp.Next()) {
- const TopoDS_Face& ff = TopoDS::Face(exp.Current());
+ TopExp_Explorer anExp(mySbase, TopAbs_FACE);
+ for(; anExp.More(); anExp.Next()) {
+ const TopoDS_Face& ff = TopoDS::Face(anExp.Current());
if(ToFuse(ff, FFace)) {
TopTools_DataMapOfShapeListOfShape sl;
break;
for (itLS.Initialize(theLastShape);itLS.More();itLS.Next()) {
const TopoDS_Face& TopFace = TopoDS::Face(itLS.Value());
if (!FF.IsSame(TopFace)) {
- TopExp_Explorer ExpE;
for (ExpE.Init(FF,TopAbs_EDGE);ExpE.More() && !Found ;ExpE.Next()) {
const TopoDS_Edge& E1 = TopoDS::Edge(ExpE.Current());
TopoDS_Vertex V1,V2;
myListOfEdges.Clear();
mySlface.Clear();
- TopoDS_Shape aLocalShape = W.Oriented(TopAbs_FORWARD);
- myWire = TopoDS::Wire(aLocalShape);
+ TopoDS_Shape aLocalShapeW = W.Oriented(TopAbs_FORWARD);
+ myWire = TopoDS::Wire(aLocalShapeW);
// myWire = TopoDS::Wire(W.Oriented(TopAbs_FORWARD));
myDir = Direc;
myDir1 = Direc1;
counter++;
}
else {
- Standard_Real f, l;
Handle(Geom_Curve) cc = BRep_Tool::Curve(E, f, l);
gp_Pnt pf = BRep_Tool::Pnt(TopExp::FirstVertex(E,Standard_True));
gp_Pnt pl = myLastPnt;
SlidMap.Clear();
if(Sliding && counter1 > counter) {
- TopTools_ListIteratorOfListOfShape it;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm;
TopExp_Explorer EX2(w, TopAbs_EDGE);
Standard_Integer ii = 0;
TopoDS_Shape comp;
- BRep_Builder BB;
BB.MakeShell(TopoDS::Shell(comp));
for(; it.More(); it.Next()) {
}
}
- TopExp_Explorer exp(mySbase, TopAbs_FACE);
- for(; exp.More(); exp.Next()) {
- const TopoDS_Face& ff = TopoDS::Face(exp.Current());
+ TopExp_Explorer anExp(mySbase, TopAbs_FACE);
+ for(; anExp.More(); anExp.Next()) {
+ const TopoDS_Face& ff = TopoDS::Face(anExp.Current());
if(ToFuse(ff, FFace)) {
TopTools_DataMapOfShapeListOfShape sl;
if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace))
if(tol > myTol) myTol = tol;
}
- TopoDS_Shape aLocalShape = W.Oriented(TopAbs_FORWARD);
- myWire = TopoDS::Wire(aLocalShape);
+ TopoDS_Shape aLocalShapeW = W.Oriented(TopAbs_FORWARD);
+ myWire = TopoDS::Wire(aLocalShapeW);
// myWire = TopoDS::Wire(W.Oriented(TopAbs_FORWARD));
myPln = Plane;
myHeight1 = H1;
counter++;
}
else {
- Standard_Real f, l;
Handle(Geom_Curve) cc = BRep_Tool::Curve(E, f, l);
gp_Pnt pf = BRep_Tool::Pnt(TopExp::FirstVertex(E,Standard_True));
gp_Pnt pl = myLastPnt;
SlidMap.Clear();
if(Sliding && counter1 > counter) {
- TopTools_ListIteratorOfListOfShape it;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm;
TopExp_Explorer EX2(w, TopAbs_EDGE);
Standard_Integer ii = 0;
Handle(Geom2d_Curve) l2d = GeomAPI::To2d(ln, Plane->Pln());
Geom2dAPI_InterCurveCurve intcc(l2d, ln2d, Precision::Confusion());
TopoDS_Vertex VV; VV.Nullify();
- TopoDS_Edge ee1, ee2;
if(intcc.NbPoints() > 0) {
gp_Pnt2d P = intcc.Point(1);
BRepAlgoAPI_Cut c(BndFace, NewBndFace);
//modified by NIZNHY-PKV Fri Mar 22 16:52:57 2002 t
TopExp_Explorer exp(c.Shape(), TopAbs_WIRE);
- const TopoDS_Wire& w = TopoDS::Wire(exp.Current());
+ const TopoDS_Wire& aCurWire = TopoDS::Wire(exp.Current());
// akm 13/02/02 : we know the plane. Why not to use it?
// BRepLib_MakeFace ff(w);
- BRepLib_MakeFace ff(myPln->Pln(), w, Standard_True);
+ BRepLib_MakeFace ff(myPln->Pln(), aCurWire, Standard_True);
NewBndFace = TopoDS::Face(ff.Shape());
}
TopoDS_Shape comp;
- BRep_Builder BB;
BB.MakeShell(TopoDS::Shell(comp));
for(; it.More(); it.Next()) {
}
for (ex.Init(CurrentFace, TopAbs_EDGE); ex.More(); ex.Next()) {
- const TopoDS_Edge& e = TopoDS::Edge(ex.Current());
+ const TopoDS_Edge& aCurEdge = TopoDS::Edge(ex.Current());
- BRepExtrema_ExtPC projF(v1, e);
+ BRepExtrema_ExtPC projF(v1, aCurEdge);
if(projF.IsDone() && projF.NbExt() >=1) {
Standard_Real dist2min = RealLast();
}
}
if (index != 0) {
- if (dist2min <= BRep_Tool::Tolerance(e) * BRep_Tool::Tolerance(e)) {
- FirstEdge = e;
+ if (dist2min <= BRep_Tool::Tolerance(aCurEdge) * BRep_Tool::Tolerance(aCurEdge)) {
+ FirstEdge = aCurEdge;
break;
}
}
}
for (ex.Init(CurrentFace, TopAbs_EDGE); ex.More(); ex.Next()) {
- const TopoDS_Edge& e = TopoDS::Edge(ex.Current());
- BRepExtrema_ExtPC projF(v2, e);
+ const TopoDS_Edge& aCurEdge = TopoDS::Edge(ex.Current());
+ BRepExtrema_ExtPC projF(v2, aCurEdge);
if(projF.IsDone() && projF.NbExt() >=1) {
Standard_Real dist2min = RealLast();
}
}
if (index != 0) {
- if (dist2min <= BRep_Tool::Tolerance(e) * BRep_Tool::Tolerance(e)) {
- FirstEdge = e;
+ if (dist2min <= BRep_Tool::Tolerance(aCurEdge) * BRep_Tool::Tolerance(aCurEdge)) {
+ FirstEdge = aCurEdge;
break;
}
}
TopoDS_Vertex OnVertex;
Standard_Real intpar;
for(; ex1.More(); ex1.Next()) {
- const TopoDS_Face& f = TopoDS::Face(ex1.Current());
+ const TopoDS_Face& aCurFace = TopoDS::Face(ex1.Current());
GeomAdaptor_Curve aGAC (curve);
- inter.Init (f, aGAC, BRep_Tool::Tolerance(f));
+ inter.Init (aCurFace, aGAC, BRep_Tool::Tolerance(aCurFace));
if(!inter.More()) continue;
for(; inter.More(); inter.Next()) {
gp_Pnt thePoint = inter.Pnt();
if(!FirstVertex.IsNull()) {
gp_Pnt point = BRep_Tool::Pnt(FirstVertex);
- if(point.Distance(thePoint) <= BRep_Tool::Tolerance(f)) {
+ if(point.Distance(thePoint) <= BRep_Tool::Tolerance(aCurFace)) {
continue;
}
}
intpar = IntPar(curve, thePoint);
theEdge = E;
- theFace = f;
+ theFace = aCurFace;
B.MakeVertex(theVertex, thePoint, Precision::Confusion());
if(!FirstOK) {
if(thePoint.Distance(P2) <= Precision::Confusion()) {
}
// ---Find thepoint on an edge or a vertex of face f
- PtOnEdgeVertex(RevolRib, f, thePoint, FirstVertex, LastVertex,
+ PtOnEdgeVertex(RevolRib, aCurFace, thePoint, FirstVertex, LastVertex,
PtOnEdge,OnEdge,PtOnVertex,OnVertex);
Standard_Boolean NewVertex = Standard_False;
Standard_Real theparam = 1.e101, angle;
TopoDS_Vertex V ;
- TopoDS_Edge E, Eref, E1 , E2;
+ TopoDS_Edge E, Eref;
BRep_Builder B;
// Class BRep_Tool without fields and without Constructor :
// BRep_Tool BT;
Standard_Real Dist, dU = (U2 - U1) / ( 2*NbPoints - 1);
TColgp_Array1OfPnt2d LP(1,2*NbPoints); // tableau Longueur <-> Param
- gp_Pnt P1, P2;
- P1 = myML.Value(U1);
+ gp_Pnt aPnt1, aPnt2;
+ aPnt1 = myML.Value(U1);
for ( i = 0; i < 2*NbPoints ; i++) {
- P2 = myML.Value(U1 + i*dU);
- Dist = P1.Distance(P2);
+ aPnt2 = myML.Value(U1 + i*dU);
+ Dist = aPnt1.Distance(aPnt2);
Length += Dist;
LP(i+1) = gp_Pnt2d( Length, U1 + (i*dU));
- P1 = P2;
+ aPnt1 = aPnt2;
}
// On cherche a mettre NbPoints dans la curve.
Standard_Real Uf = ML.FirstParameter();
Standard_Real Ul = ML.LastParameter();
- Standard_Real dU = (Ul-Uf)/(NbPoints-1);
+ Standard_Real dUlf = (Ul-Uf)/(NbPoints-1);
AppDef_MultiPointConstraint MPC;
for ( i = 1; i<= NbPoints-1; i++) {
MPC = MLS.Value(i);
- U = Uf + (i-1) * dU;
+ U = Uf + (i-1) * dUlf;
P (i) = MPC.Point(1);
P1(i) = MPC.Point2d(2);
P2(i) = MPC.Point2d(3);
// initialisation
Standard_Integer NbSects=myWork.Length();
BRepTools_WireExplorer anExp;
- TopoDS_Vertex V1, V2;
Standard_Boolean allClosed = Standard_True;
Standard_Integer i,ii,ideb=1,ifin=NbSects;
if (SeqV.Length()>NbMaxV)
Standard_NoSuchObject::Raise("BRepFill::SameNumberByPolarMethod failed");
- // extremity of the first wire
- V1 = TopoDS::Vertex(SeqV.Value(1));
// loop on vertices of wire1
for (ii=1;ii<=SeqV.Length();ii++) {
if ( SeqV.Length()>NbMaxV || SeqV.Length()>SizeMap )
Standard_NoSuchObject::Raise("BRepFill::SameNumberByPolarMethod failed");
- // extremity of the first wire
- V1 = TopoDS::Vertex(SeqV.Value(1));
// next wire
const TopoDS_Wire& wire2 = TopoDS::Wire(myWork(i+1));
// parse candidate edges
Standard_Real scal1,scal2;
if ( (V1.IsSame(VVF)&&V2.IsSame(VVL)) || (V2.IsSame(VVF)&&V1.IsSame(VVL)) ) {
- Standard_Real U1 = BRep_Tool::Parameter(VVF,E);
- Standard_Real U2 = BRep_Tool::Parameter(VVL,E);
- BRepAdaptor_Curve Curve(E);
- gp_Pnt PP1 = Curve.Value(0.1*(U1+9*U2));
- gp_Pnt PP2 = Curve.Value(0.1*(9*U1+U2));
+ Standard_Real U1param = BRep_Tool::Parameter(VVF,E);
+ Standard_Real U2param = BRep_Tool::Parameter(VVL,E);
+ BRepAdaptor_Curve CurveE(E);
+ gp_Pnt PP1 = CurveE.Value(0.1*(U1param +9* U2param));
+ gp_Pnt PP2 = CurveE.Value(0.1*(9* U1param + U2param));
for (rang=i;rang>ideb;rang--) {
Transform(WithRotation, PP1,
gp_Vec NormalOfFirstPlane = FirstPlane.Axis().Direction();
for (i = ideb+1; i <= ifin; i++)
{
- const TopoDS_Wire& wire = TopoDS::Wire(myWork(i));
+ const TopoDS_Wire& aWire = TopoDS::Wire(myWork(i));
//Compute offset vector as current bary center projected on first plane
//to first bary center
gp_Pln CurPlane;
- PlaneOfWire(wire, CurPlane);
+ PlaneOfWire(aWire, CurPlane);
gp_Pnt CurBary = CurPlane.Location();
gp_Vec aVec(FirstBary, CurBary);
gp_Vec anOffsetProj = (aVec * NormalOfFirstPlane) * NormalOfFirstPlane;
BB.MakeWire(newwire);
TopTools_SequenceOfShape SeqVertices, SeqEdges;
- for (anExp.Init(wire); anExp.More(); anExp.Next())
+ for (anExp.Init(aWire); anExp.More(); anExp.Next())
{
SeqVertices.Append( anExp.CurrentVertex() );
SeqEdges.Append( anExp.Current() );
// Calculate the map to the right of the current wire.
//----------------------------------------------
BRepLib_MakeFace B(gp_Pln(0.,0.,1.,0.));
- TopoDS_Shape aLocalShape = SpineExp.Current().Reversed();
- B.Add(TopoDS::Wire(aLocalShape));
+ TopoDS_Shape aLocalShapeRev = SpineExp.Current().Reversed();
+ B.Add(TopoDS::Wire(aLocalShapeRev));
// B.Add(TopoDS::Wire(SpineExp.Current().Reversed()));
Face = B.Face();
BRepMAT2d_Explorer Exp(Face);
}
#endif
- TopoDS_Vertex VF,VL;
-
//---------------------------------------------------
// Construction of edges associated to bissectrices.
//---------------------------------------------------
//------------------------------------------------------------
// No connected face in the volevo => no parallel edge.
//------------------------------------------------------------
- TopTools_SequenceOfShape S;
+ TopTools_SequenceOfShape aSeqOfShape;
TrimEdge (CurrentEdge,
MapBis (FaceControle),
MapBis (CurrentEdge) ,
- MapVerPar(CurrentEdge) , S);
+ MapVerPar(CurrentEdge) , aSeqOfShape);
- for ( k = 1; k <= S.Length(); k++) {
- myMap(CurrentSpine)(VCF).Append(S.Value(k));
+ for ( k = 1; k <= aSeqOfShape.Length(); k++) {
+ myMap(CurrentSpine)(VCF).Append(aSeqOfShape.Value(k));
#ifdef DRAW
if (AffichEdge) {
// the number of element of the list allows to know
// if the edges have already been done (closed profile) .
if (YaFace && myMap(CurrentSpine)(VCL).Extent()<= 1) {
- TopTools_SequenceOfShape S;
+ TopTools_SequenceOfShape aSeqOfShape;
TrimEdge (CurrentEdge,
MapBis (FaceControle),
MapBis (CurrentEdge) ,
- MapVerPar(CurrentEdge) , S);
+ MapVerPar(CurrentEdge) , aSeqOfShape);
- for ( k = 1; k <= S.Length(); k++) {
- myMap(CurrentSpine)(VCL).Append(S.Value(k));
+ for ( k = 1; k <= aSeqOfShape.Length(); k++) {
+ myMap(CurrentSpine)(VCL).Append(aSeqOfShape.Value(k));
#ifdef DRAW
if (AffichEdge) {
}
//Cut of the face.
- TopTools_SequenceOfShape S;
+ TopTools_SequenceOfShape aSeqOfShape;
- TrimFace (CurrentFace, MapBis(CurrentFace), S);
+ TrimFace (CurrentFace, MapBis(CurrentFace), aSeqOfShape);
- for (Standard_Integer ii = 1; ii <= S.Length(); ii++) {
- myBuilder.Add (myShape,S.Value(ii));
- myMap(CurrentSpine)(CurrentProf).Append(S.Value(ii));
+ for (Standard_Integer ii = 1; ii <= aSeqOfShape.Length(); ii++) {
+ myBuilder.Add (myShape, aSeqOfShape.Value(ii));
+ myMap(CurrentSpine)(CurrentProf).Append(aSeqOfShape.Value(ii));
}
}
}
BRepMAT2d_LinkTopoBilo& Link,
const GeomAbs_JoinType Join)
{
- TopoDS_Shape aLocalShape = Sp.Oriented(TopAbs_FORWARD);
- mySpine = TopoDS::Face(aLocalShape);
+ TopoDS_Shape aLocalShapeOriented = Sp.Oriented(TopAbs_FORWARD);
+ mySpine = TopoDS::Face(aLocalShapeOriented);
// mySpine = TopoDS::Face(Sp.Oriented(TopAbs_FORWARD));
myProfile = Pr;
myMap.Clear();
BRepTools_WireExplorer ProfExp;
TopExp_Explorer Exp,exp1,exp2;
- TopoDS_Shape Rest;
TopTools_DataMapOfShapeListOfShape EmptyMap;
TopTools_ListOfShape EmptyList;
TopTools_DataMapOfShapeShape MapVP;
// MAJ myMap
for (Exp.Init(Base,TopAbs_EDGE); Exp.More(); Exp.Next()) {
- const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
- const TopoDS_Shape& AE = OffAnc.Ancestor(E);
+ const TopoDS_Edge& anEdge = TopoDS::Edge(Exp.Current());
+ const TopoDS_Shape& AE = OffAnc.Ancestor(anEdge);
if (!myMap.IsBound(AE)) {
myMap.Bind(AE,EmptyMap);
}
TopTools_ListOfShape L;
myMap(AE).Bind(V1,L);
}
- myMap(AE)(V1).Append(E);
+ myMap(AE)(V1).Append(anEdge);
}
First = Standard_False;
}
Loop.Perform();
Loop.WiresToFaces();
const TopTools_ListOfShape& L = Loop.NewFaces();
- TopTools_ListIteratorOfListOfShape itL(L);
+ TopTools_ListIteratorOfListOfShape anIterL(L);
// Maj of myTop and myBottom for the history
// and addition of constructed faces.
B.MakeCompound(Bouchon);
Standard_Integer j = 0;
- for (itL.Initialize(L); itL.More(); itL.Next()) {
+ for (anIterL.Initialize(L); anIterL.More(); anIterL.Next()) {
j++;
- Glue.Add(itL.Value());
- if (j ==1 && i == 0) myTop = itL.Value();
- if (j ==1 && i == 1) myBottom = itL.Value();
- B.Add(Bouchon,itL.Value());
+ Glue.Add(anIterL.Value());
+ if (j ==1 && i == 0) myTop = anIterL.Value();
+ if (j ==1 && i == 1) myBottom = anIterL.Value();
+ B.Add(Bouchon,anIterL.Value());
}
if (i == 0 && j > 1) myTop = Bouchon;
if (i == 1 && j > 1) myBottom = Bouchon;
//======================================================================
void BRepFill_Filling::BuildWires( TopTools_ListOfShape& EdgeList, TopTools_ListOfShape& WireList )
{
- TopoDS_Wire CurWire;
- TopoDS_Edge CurEdge;
TopTools_ListIteratorOfListOfShape Itl;
Standard_Integer i, j;
pos = AdC.Line().Location();
dist = AdC.Value(first2).Distance(AdC.Value(last2));
gp_Vec vec(AdC.Value(first2),AdC.Value(last2));
- gp_Dir dir(vec);
- axe = gp_Ax1(AdC.Value(first2),dir);
+ gp_Dir aDir(vec);
+ axe = gp_Ax1(AdC.Value(first2), aDir);
if (axe.IsParallel(axe1,Precision::Angular())) {
// parallel straight line
if (Abs(dist-dist1)<Precision::Confusion()) {
if ( myBis.GetType() == GeomAbs_Line) {
Standard_Real DeltaU = myBis.LastParameter() - myBis.FirstParameter();
- gp_Pnt2d P1 = ValueOnF1(myBis.FirstParameter() + 0.1*DeltaU);
- gp_Pnt2d P2 = ValueOnF1(myBis.FirstParameter() + 0.9*DeltaU);
+ gp_Pnt2d aPnt1 = ValueOnF1(myBis.FirstParameter() + 0.1*DeltaU);
+ gp_Pnt2d aPnt2 = ValueOnF1(myBis.FirstParameter() + 0.9*DeltaU);
if ( myIsoU1) {
- if ( Abs(P1.Y() - P2.Y()) < Precision::Confusion())
+ if ( Abs(aPnt1.Y() - aPnt2.Y()) < Precision::Confusion())
myKPart = 1;
}
else {
- if ( Abs(P1.X() - P2.X()) < Precision::Confusion())
+ if ( Abs(aPnt1.X() - aPnt2.X()) < Precision::Confusion())
myKPart = 1;
}
// special treatment of conic curve
if (aTrimCurve->BasisCurve()->IsKind(STANDARD_TYPE(Geom_Conic)))
{
- const Handle(Geom_Curve)& aCurve = aTrimCurve; // to avoid ambiguity
- GeomConvert_ApproxCurve anAppr (aCurve, Precision::Confusion(), GeomAbs_C1, 16, 14);
+ const Handle(Geom_Curve)& aCurveTemp = aTrimCurve; // to avoid ambiguity
+ GeomConvert_ApproxCurve anAppr (aCurveTemp, Precision::Confusion(), GeomAbs_C1, 16, 14);
if (anAppr.HasResult())
aBSCurve = anAppr.Curve();
}
const Standard_Real Alt)
{
myIsDone = Standard_False;
- TopoDS_Shape aLocalShape = Spine.Oriented(TopAbs_FORWARD);
- myWorkSpine = TopoDS::Face(aLocalShape);
+ TopoDS_Shape aLocalShapeWork = Spine.Oriented(TopAbs_FORWARD);
+ myWorkSpine = TopoDS::Face(aLocalShapeWork);
// myWorkSpine = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD));
myJoinType = Join;
myOffset = Offset ;
myMap(j).Clear();
if (MapBis.IsBound(CurrentEdge)) {
- TopTools_SequenceOfShape S;
+ TopTools_SequenceOfShape aSeqOfShape;
if (!MapBis(CurrentEdge).IsEmpty()) {
Standard_Integer IndOfE = 0;
if (myIsOpenResult)
Detromp (CurrentSpine),
MapBis (CurrentEdge) ,
MapVerPar(CurrentEdge) ,
- S, MapVV, IndOfE);
- for ( k = 1; k <= S.Length(); k++) {
- myMap(j).Append(S.Value(k));
+ aSeqOfShape, MapVV, IndOfE);
+ for ( k = 1; k <= aSeqOfShape.Length(); k++) {
+ myMap(j).Append(aSeqOfShape.Value(k));
}
}
else {
TopExp_Explorer Explo( myShape, TopAbs_EDGE );
for (; Explo.More(); Explo.Next())
{
- TopoDS_Edge E = TopoDS::Edge( Explo.Current() );
+ TopoDS_Edge anEdge = TopoDS::Edge( Explo.Current() );
TopoDS_Vertex V1, V2;
- TopExp::Vertices( E, V1, V2 );
+ TopExp::Vertices(anEdge, V1, V2 );
Handle(BRep_TVertex)& TV1 = *((Handle(BRep_TVertex)*) &(V1).TShape());
Handle(BRep_TVertex)& TV2 = *((Handle(BRep_TVertex)*) &(V2).TShape());
TopLoc_Location loc;
Standard_Real f, l;
- Handle( Geom_Curve ) theCurve = BRep_Tool::Curve( E, loc, f, l );
+ Handle( Geom_Curve ) theCurve = BRep_Tool::Curve(anEdge, loc, f, l );
theCurve = Handle( Geom_Curve )::DownCast( theCurve->Copy() );
theCurve->Transform( loc.Transformation() );
gp_Pnt f3d = theCurve->Value( f );
TopTools_SequenceOfShape ClosedWires, UnclosedWires, IsolatedWires;
Standard_Real MaxTol = 0.;
- Standard_Integer i;
BRep_Builder BB;
TopExp_Explorer Explo( mySpine, TopAbs_VERTEX );
{
TopoDS_Compound R;
BB.MakeCompound( R );
+ Standard_Integer i;
for (i = 1; i <= ClosedWires.Length(); i++)
BB.Add( R, ClosedWires(i) );
for (i = 1; i <= IsolatedWires.Length(); i++)
exuv = ExchUV(isec, ipath);
S->Bounds(UFirst, ULast, VFirst, VLast);
if (UReverse(isec, ipath)) {
- Standard_Real aux;
+ Standard_Real aux2;
if (exuv) {
- aux = VFirst; VFirst = VLast; VLast = aux;
+ aux2 = VFirst; VFirst = VLast; VLast = aux2;
}
else {
- aux = UFirst; UFirst = ULast; ULast = aux;
+ aux2 = UFirst; UFirst = ULast; ULast = aux2;
}
}
//(4.2) // General case => Tweezers
Standard_Boolean isG1;
TopoDS_Face FF;
- TopoDS_Edge E;
+ TopoDS_Edge anEdge;
for (isec=1; isec <= NbLaw+1; isec++) {
if (isec>1) isG1 =
if (isG1) {
if (ipath==NbPath+1) FF = TopoDS::Face(myFaces->Value(isec, 1));
else FF = TopoDS::Face(myFaces->Value(isec, IPath));
- E = TopoDS::Edge(myVEdges->Value(isec, IPath));
- BRepLib::EncodeRegularity(E, FF,
+ anEdge = TopoDS::Edge(myVEdges->Value(isec, IPath));
+ BRepLib::EncodeRegularity(anEdge, FF,
TopoDS::Face(myFaces->Value(isec, IPath-1)),
myTolAngular);
}
//
BOPDS_VectorOfPoint& aVP=aFFi.ChangePoints();
aNbP=aVP.Extent();
- BOPDS_VectorOfCurve& aVC=aFFi.ChangeCurves();
+ const BOPDS_VectorOfCurve& aVC=aFFi.Curves();
aNbC=aVC.Extent();
if (!aNbP && !aNbC) {
if (!theDS->HasInterfSubShapes(nF1, nF2)) {
}
//
if((nF1 == anIndex1) && (nF2 == anIndex2)) {
- const BOPDS_VectorOfCurve& aVC = aFFi.Curves();
bhassec = Standard_False;
//
for (j = 0; j < aNbC; ++j) {
Standard_Boolean isSensOK = (aDist12 > 0. && aDist23 > 0.);
if (isSensOK)
{
- Standard_Integer anEdges[3];
+ Standard_Integer anEdgeIds[3];
Standard_Boolean anEdgesOri[3];
for ( Standard_Integer aTriLinkIt = 0; aTriLinkIt < 3; ++aTriLinkIt )
{
const Standard_Integer& anEdgeInfo = anEdgesInfo[aTriLinkIt];
- anEdges[aTriLinkIt] = Abs( anEdgeInfo );
+ anEdgeIds[aTriLinkIt] = Abs( anEdgeInfo );
anEdgesOri[aTriLinkIt] = anEdgeInfo > 0;
}
- addTriangle( anEdges, anEdgesOri, aNodes );
+ addTriangle(anEdgeIds, anEdgesOri, aNodes );
}
else
{
else
myCOnS.Initialize(theEdge, theFaceAttribute->Face());
- TopLoc_Location aLoc;
const GeomAbs_CurveType aCurveType = myCOnS.GetType();
Standard_Integer aMinPntNb = (aCurveType == GeomAbs_Circle) ? 4 : 2; //OCC287
// Calculate the intersections of offset faces
// Distinction of intersection between faces // tangents.
//---------------------------------------------------------------
- TopoDS_Face F1,F2;
+ TopoDS_Face F2;
TopTools_ListIteratorOfListOfShape it;
//---------------------------------------------------------------
TopTools_DataMapOfShapeShape& Build,
TopTools_ListOfShape& Failed)
{
- TopTools_ListOfShape LInt1,LInt2;
TopTools_MapOfShape MV;
TopExp_Explorer exp;
TopoDS_Face OF,NF,WCF;
// LInt1,LInt2);
LInt1.Clear(); LInt1.Append(OE);
LInt2.Clear();
- TopAbs_Orientation O1,O2;
- BRepOffset_Tool::OrientSection(OE,CF,OF1,O1,O2);
+ TopAbs_Orientation anOri1, anOri2;
+ BRepOffset_Tool::OrientSection(OE,CF,OF1, anOri1,anOri2);
// if (mySide == TopAbs_OUT);
- O1 = TopAbs::Reverse(O1);
- LInt1.First().Orientation(O1);
+ anOri1 = TopAbs::Reverse(anOri1);
+ LInt1.First().Orientation(anOri1);
Store(CF,OF1,LInt1,LInt2);
}
}
// F is reversed it will be added in myOffC.
// and myOffC will be reversed in the final result.
//-----------------------------------------------
- TopoDS_Shape aLocalShape = F.Reversed();
- if (InSide) Loops.Init(TopoDS::Face(aLocalShape));
+ TopoDS_Shape aReversedF = F.Reversed();
+ if (InSide) Loops.Init(TopoDS::Face(aReversedF));
// if (InSide) Loops.Init(TopoDS::Face(F.Reversed()));
else Loops.Init(F);
//--------------------------------------------------------
if (Analyse.HasAncestor(CE)) {
// the stop of cups except for the connectivity stops between caps.
// if (!AsDes->HasAscendant(CE)) {
- aLocalShape = CE.Reversed();
+ TopoDS_Shape aReversedE = CE.Reversed();
if (InSide) Loops.AddConstEdge(CE);
- else Loops.AddConstEdge(TopoDS::Edge(aLocalShape));
+ else Loops.AddConstEdge(TopoDS::Edge(aReversedE));
// else Loops.AddConstEdge(TopoDS::Edge(CE.Reversed()));
}
}
if (InSide) Loops.AddConstEdge(TopoDS::Edge(CE));
else
{
- TopoDS_Shape aLocalShape = CE.Reversed();
- Loops.AddConstEdge(TopoDS::Edge(aLocalShape));
+ TopoDS_Shape aReversedE = CE.Reversed();
+ Loops.AddConstEdge(TopoDS::Edge(aReversedE));
}
// else Loops.AddConstEdge(TopoDS::Edge(CE.Reversed()));
}
const TopoDS_Shape& FI = Exp.Current();
const TopoDS_Shape& OFI = MapSF(FI).Face();
if (MES.IsBound(OFI)) {
- const TopoDS_Face& NF = TopoDS::Face(MES(OFI));
- LFE.Append(NF);
- IMOE.SetRoot(NF);
+ const TopoDS_Face& aLocalFace = TopoDS::Face(MES(OFI));
+ LFE.Append(aLocalFace);
+ IMOE.SetRoot(aLocalFace);
}
}
Standard_Real CurOffset = myOffset;
if ( myFaceOffset.IsBound(Anc.First()))
CurOffset = myFaceOffset(Anc.First());
- TopoDS_Shape aLocalShape = MapSF(Anc.First()).Generated(E);
- TopoDS_Edge EOn1 = TopoDS::Edge(aLocalShape);
- aLocalShape = MapSF(Anc.Last()).Generated(E);
- TopoDS_Edge EOn2 = TopoDS::Edge(aLocalShape);
+ TopoDS_Shape aLocalShapeGen = MapSF(Anc.First()).Generated(E);
+ TopoDS_Edge EOn1 = TopoDS::Edge(aLocalShapeGen);
+ aLocalShapeGen = MapSF(Anc.Last()).Generated(E);
+ TopoDS_Edge EOn2 = TopoDS::Edge(aLocalShapeGen);
// TopoDS_Edge EOn1 = TopoDS::Edge(MapSF(Anc.First()).Generated(E));
// TopoDS_Edge EOn2 = TopoDS::Edge(MapSF(Anc.Last()) .Generated(E));
// find if exits tangent edges in the original shape
}
else if ( Type1 == TopAbs_EDGE && Type2 == TopAbs_EDGE) {
TopTools_ListOfShape LV;
- TopExp_Explorer exp1,exp2;
+ TopExp_Explorer exp1;
for (exp1.Init(Root1,TopAbs_VERTEX); exp1.More(); exp1.Next()) {
TopExp_Explorer exp2(F2,TopAbs_EDGE);
for (exp2.Init(Root2,TopAbs_VERTEX); exp2.More(); exp2.Next()) {
{
const Standard_Real TolApex = 1.e-5;
//define the iso of singularity (u or v)
- const TopoDS_Edge& theDegEdge = TopoDS::Edge(DegEdges(1));
+ TopoDS_Edge theDegEdge = TopoDS::Edge(DegEdges(1));
Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(theDegEdge, Face, fpar, lpar);
gp_Pnt2d fp2d = aCurve->Value(fpar);
gp_Pnt2d lp2d = aCurve->Value(lpar);
}
else //DegEdges.Length() == 1
{
- const TopoDS_Edge& theDegEdge = TopoDS::Edge(DegEdges(1));
- Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(theDegEdge, Face, fpar, lpar);
if (UisoDegen)
{
if (Abs(fp2d.X() - uf1) <= Precision::Confusion())
TopTools_DataMapOfShapeShape MapSS;
// mise a jour de la map sur les vertex deja crees
- TopoDS_Shape aLocalShape = Face.Oriented(TopAbs_FORWARD);
- TopoDS_Face CurFace = TopoDS::Face(aLocalShape);
+ TopoDS_Shape aLocalShapeOriented = Face.Oriented(TopAbs_FORWARD);
+ TopoDS_Face CurFace = TopoDS::Face(aLocalShapeOriented);
// TopoDS_Face CurFace = TopoDS::Face(Face.Oriented(TopAbs_FORWARD));
TopTools_MapOfShape VonDegen;
myBuilder.Range(OE, myFace, f, l);
if (!BRep_Tool::Degenerated(E) && TheSurf->IsUClosed())
{
- TopoDS_Shape aLocalShape = E.Reversed();
+ TopoDS_Shape aLocalShapeReversedE = E.Reversed();
Handle(Geom2d_Curve) C2d_1 =
- BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalShape),CurFace,f,l);
+ BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalShapeReversedE),CurFace,f,l);
P2d1 = C2d_1->Value(BRep_Tool::Parameter(V1,E,CurFace));
P2d2 = C2d_1->Value(BRep_Tool::Parameter(V2,E,CurFace));
if (VonDegen.Contains(V1))
#endif
Handle (Geom_Curve) CI;
- TopoDS_Edge E;
TopAbs_Orientation O1,O2;
L1.Clear(); L2.Clear();
BRep_Builder B;
for (i = 1; i <= wseq.Length(); i++)
{
TopoDS_Wire aWire = TopoDS::Wire(wseq(i));
- TopTools_SequenceOfShape EdgesForConcat;
+ TopTools_SequenceOfShape aLocalEdgesForConcat;
if (aWire.Closed())
{
TopoDS_Vertex StartVertex;
TopExp::Vertices( StartEdge, V1, V2 );
StartVertex = V1;
}
- EdgesForConcat.Append( StartEdge );
+ aLocalEdgesForConcat.Append( StartEdge );
while (!Elist.IsEmpty())
{
for (itl.Initialize(Elist); itl.More(); itl.Next())
if (V1.IsSame(StartVertex))
{
StartVertex = V2;
- EdgesForConcat.Append( anEdge );
+ aLocalEdgesForConcat.Append( anEdge );
Elist.Remove(itl);
break;
}
else if (V2.IsSame(StartVertex))
{
StartVertex = V1;
- EdgesForConcat.Append( anEdge );
+ aLocalEdgesForConcat.Append( anEdge );
Elist.Remove(itl);
break;
}
}
} //end of while (!Elist.IsEmpty())
} //end of if (aWire.Closed())
- else
+ else
{
BRepTools_WireExplorer Wexp( aWire );
for (; Wexp.More(); Wexp.Next())
- EdgesForConcat.Append( Wexp.Current() );
+ aLocalEdgesForConcat.Append( Wexp.Current() );
}
TopoDS_Edge theEdge =
- AssembleEdge( pDS, cpF1, cpF2, addPCurve1, addPCurve2, EdgesForConcat );
+ AssembleEdge( pDS, cpF1, cpF2, addPCurve1, addPCurve2, aLocalEdgesForConcat );
eseq.Append( theEdge );
}
} //end of else (when TrueEdges is empty)
#endif
Handle (Geom_Curve) CI;
- TopoDS_Edge E;
TopAbs_Orientation O1,O2;
L1.Clear(); L2.Clear();
Handle (Geom_Surface) S1 = BRep_Tool::Surface(F1);
while (!YaSol && itry < 2) {
for ( Standard_Integer i = 1; i <= NbPC1 ; i++) {
- TopoDS_Shape aLocalEdge = E1.Reversed();
+ TopoDS_Shape aLocalEdgeReversedE1 = E1.Reversed();
if (i == 1) C1 = BRep_Tool::CurveOnSurface(E1,F,fl1[0],fl1[1]);
- else C1 = BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalEdge),
+ else C1 = BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalEdgeReversedE1),
F,fl1[0],fl1[1]);
// if (i == 1) C1 = BRep_Tool::CurveOnSurface(E1,F,fl1[0],fl1[1]);
// else C1 = BRep_Tool::CurveOnSurface(TopoDS::Edge(E1.Reversed()),
gp_Pnt P = S->Value(P2d.X(),P2d.Y());
TopoDS_Vertex V = BRepLib_MakeVertex(P);
V.Orientation(TopAbs_INTERNAL);
- TopoDS_Shape aLocalEdge = E1.Oriented(TopAbs_FORWARD);
- B.UpdateVertex(V,U1,TopoDS::Edge(aLocalEdge),TolConf);
- aLocalEdge = E2.Oriented(TopAbs_FORWARD);
- B.UpdateVertex(V,U2,TopoDS::Edge(aLocalEdge),TolConf);
+ TopoDS_Shape aLocalEdgeOrientedE1 = E1.Oriented(TopAbs_FORWARD);
+ B.UpdateVertex(V,U1,TopoDS::Edge(aLocalEdgeOrientedE1),TolConf);
+ aLocalEdgeOrientedE1 = E2.Oriented(TopAbs_FORWARD);
+ B.UpdateVertex(V,U2,TopoDS::Edge(aLocalEdgeOrientedE1),TolConf);
// B.UpdateVertex(V,U1,TopoDS::Edge(E1.Oriented(TopAbs_FORWARD)),TolConf);
// B.UpdateVertex(V,U2,TopoDS::Edge(E2.Oriented(TopAbs_FORWARD)),TolConf);
LV.Append(V);
BRep_Tool::Range(Ecs,f,l);
}
if (BRep_Tool::IsClosed(CE,Fforward)) {
- TopoDS_Shape aLocalShape = CE.Reversed();
+ TopoDS_Shape aLocalShapeReversedCE = CE.Reversed();
Handle(Geom2d_Curve) C2R =
- BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalShape),Fforward,f,l);
+ BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalShapeReversedCE),Fforward,f,l);
// Handle(Geom2d_Curve) C2R =
// BRep_Tool::CurveOnSurface(TopoDS::Edge(CE.Reversed()),F,f,l);
B.UpdateEdge (CE,C2,C2R,EF,BRep_Tool::Tolerance(CE));
NV1 = TopoDS::Vertex(ConstShapes(V1));
NV2 = TopoDS::Vertex(ConstShapes(V2));
- TopoDS_Shape aLocalVertex = NV1.Oriented(TopAbs_INTERNAL);
+ TopoDS_Shape aLocalVertexOrientedNV1 = NV1.Oriented(TopAbs_INTERNAL);
TopoDS_Shape aLocalEdge = NE.Oriented(TopAbs_INTERNAL);
- U1 = BRep_Tool::Parameter(TopoDS::Vertex(aLocalVertex),
+ U1 = BRep_Tool::Parameter(TopoDS::Vertex(aLocalVertexOrientedNV1),
TopoDS::Edge (aLocalEdge));
- aLocalVertex = NV2.Oriented(TopAbs_INTERNAL);
+ aLocalVertexOrientedNV1 = NV2.Oriented(TopAbs_INTERNAL);
aLocalEdge = NE.Oriented(TopAbs_FORWARD);
- U2 = BRep_Tool::Parameter
- (TopoDS::Vertex(aLocalVertex),TopoDS::Edge (aLocalEdge));
+ U2 = BRep_Tool::Parameter (TopoDS::Vertex(aLocalVertexOrientedNV1),TopoDS::Edge (aLocalEdge));
// U1 = BRep_Tool::Parameter
// (TopoDS::Vertex(NV1.Oriented(TopAbs_INTERNAL)),
// TopoDS::Edge (NE .Oriented(TopAbs_FORWARD)));
if (Abs(fpar-Seq2(j)) <= Precision::Confusion())
break;
NewE.Orientation( TopAbs_FORWARD );
- TopoDS_Shape aLocalShape = SeqVer(j).Oriented(TopAbs_FORWARD);
- BB.Add( NewE, TopoDS::Vertex( aLocalShape ) );
- aLocalShape = SeqVer(j+1).Oriented(TopAbs_REVERSED);
- BB.Add( NewE, TopoDS::Vertex( aLocalShape ) );
+ TopoDS_Shape aLocalShapeCur = SeqVer(j).Oriented(TopAbs_FORWARD);
+ BB.Add( NewE, TopoDS::Vertex( aLocalShapeCur) );
+ aLocalShapeCur = SeqVer(j+1).Oriented(TopAbs_REVERSED);
+ BB.Add( NewE, TopoDS::Vertex( aLocalShapeCur ) );
//BB.Add( NewE, TopoDS::Vertex( SeqVer(j).Oriented(TopAbs_FORWARD) ) );
//BB.Add( NewE, TopoDS::Vertex( SeqVer(j+1).Oriented(TopAbs_REVERSED) ) );
NewEdges.Append( NewE );
if (vClosed) {
TopoDS_Solid solid;
- BRep_Builder B;
B.MakeSolid(solid);
B.Add(solid, shell);
// special treatment of conic curve
if (aTrimCurve->BasisCurve()->IsKind(STANDARD_TYPE(Geom_Conic)))
{
- const Handle(Geom_Curve)& aCurve = aTrimCurve; // to avoid ambiguity
- GeomConvert_ApproxCurve anAppr (aCurve, Precision::Confusion(), GeomAbs_C1, 16, 14);
+ const Handle(Geom_Curve)& aCurveTrimmed = aTrimCurve; // to avoid ambiguity
+ GeomConvert_ApproxCurve anAppr (aCurveTrimmed, Precision::Confusion(), GeomAbs_C1, 16, 14);
if (anAppr.HasResult())
aBSCurve = anAppr.Curve();
}
Handle(Geom_BSplineSurface) surface;
Handle(Geom_BSplineCurve) BS, BS1;
Handle(Geom_TrimmedCurve) curvTrim;
- Handle(Geom_BSplineCurve) curvBS;
if (w1Point) {
jdeb++;
if (aGenSType==TopAbs_FACE){
newShell.Closed (BRep_Tool::IsClosed (newShell));
TopoDS_Shape temp = SplitShell(newShell);
- TopAbs_Orientation Or = DirectSolid(aGenS,aDirS);
+ TopAbs_Orientation ShellOri = DirectSolid(aGenS,aDirS);
Lt.Init(temp);
if(Lt.More()) Lt.Next();
if(Lt.More()){
for (Lt.Init(temp);Lt.More();Lt.Next()){
- myBuilder.Add(myShapes(iGenS,iDirS),Lt.Value(),Or);
+ myBuilder.Add(myShapes(iGenS,iDirS),Lt.Value(), ShellOri);
}
}
- else myBuilder.Add(myShapes(iGenS,iDirS),newShell,Or);
+ else myBuilder.Add(myShapes(iGenS,iDirS),newShell, ShellOri);
}
}
else if (myDirShapeTool.Type(aDirS)==TopAbs_WIRE){
L.SetDirection(gp::DY2d());
}
else{
- Standard_Real u = 0;
- if (aDirV.Index() == 2) u = myAng;
- L.SetLocation(gp_Pnt2d(u,0));
+ Standard_Real anAngleTemp = 0;
+ if (aDirV.Index() == 2) anAngleTemp = myAng;
+ L.SetLocation(gp_Pnt2d(anAngleTemp,0));
L.SetDirection(gp::DY2d());
}
Handle(Geom2d_Line) GL = new Geom2d_Line(L);
}
TopAbs_ShapeEnum wtyp = W.ShapeType();
if (wtyp != TopAbs_WIRE && wtyp != TopAbs_EDGE && wtyp != TopAbs_COMPOUND && pick) {
- Standard_Real u,v;
DBRep_DrawableShape::LastPick(W,u,v);
wtyp = W.ShapeType();
}
// returns the TrimmedSurface
// --------------------------
- Standard_Boolean Flag = Standard_True;
Handle(IGESGeom_TrimmedSurface) TrimmedSurf = new IGESGeom_TrimmedSurface;
if (BRep_Tool::NaturalRestriction(start)) {
//if face bounds and surface bounds are same, outer wire is unnecessary
- Standard_Boolean Flag = Standard_False;
- TrimmedSurf-> Init (ISurf, Flag, NULL, Tab);
+ TrimmedSurf-> Init (ISurf, Standard_False, NULL, Tab);
}
else
- TrimmedSurf-> Init (ISurf, Flag, IOuter, Tab);
+ TrimmedSurf-> Init (ISurf, Standard_True, IOuter, Tab);
res = TrimmedSurf;
SetShapeResult ( start, res );
Geom2dAdaptor_Curve G2dAC(C2d, f2d, l2d);
Handle(Geom2dAdaptor_HCurve) G2dAHC = new Geom2dAdaptor_HCurve(G2dAC);
- TopLoc_Location Loc;
- Handle(Geom_Curve) C3d = BRep_Tool::Curve(E, Loc, f3d,l3d);
if(!newE.IsNull()) {
C3d = BRep_Tool::Curve(newE, f3d, l3d);
}
}
if (!itled.More()) { // on stocke l`edge et la curve2d
Handle(Geom2d_Curve) C2dBis;
- Standard_Real f3d,l3d,f2dBis,l2dBis;
+ Standard_Real f2dBis,l2dBis;
C2d = new Geom2d_TrimmedCurve(C2d, f2d, l2d);
Geom2dAdaptor_Curve G2dAC(C2d, f2d, l2d);
Handle(Geom2dAdaptor_HCurve) G2dAHC = new Geom2dAdaptor_HCurve(G2dAC);
Geom2dAdaptor_Curve G2dACBis(C2dBis, f2dBis, l2dBis);
Handle(Geom2dAdaptor_HCurve) G2dAHCBis = new Geom2dAdaptor_HCurve(G2dACBis);
- TopLoc_Location Loc;
- Handle(Geom_Curve) C3d = BRep_Tool::Curve(E, f3d,l3d);
if(C3d.IsNull()) {
if(isConvert2d) {
Curve2d = Handle(Geom2d_Curve)::DownCast(C2d->Copy());
// Add the faces of oldShell in SH.
for (TopoDS_Iterator its(oldShell); its.More(); its.Next()) {
const TopoDS_Face Fo = TopoDS::Face(its.Value());
- TopAbs_Orientation NewO;
+ TopAbs_Orientation NewOFo;
// update the orientation of Fo in SH.
if (Rev)
- NewO = TopAbs::Reverse(MF(Fo).Orientation());
+ NewOFo = TopAbs::Reverse(MF(Fo).Orientation());
else
- NewO = MF(Fo).Orientation();
+ NewOFo = MF(Fo).Orientation();
- MF.Bind(Fo,SH.Oriented(NewO));
+ MF.Bind(Fo,SH.Oriented(NewOFo));
// B.Add (SH.Oriented(TopAbs_FORWARD),Fo.Oriented(NewO));
- TopoDS_Shape arefShape = SH.Oriented(TopAbs_FORWARD) ;
- B.Add ( arefShape ,Fo.Oriented(NewO));
+ TopoDS_Shape arefShapeFo = SH.Oriented(TopAbs_FORWARD) ;
+ B.Add ( arefShapeFo,Fo.Oriented(NewOFo));
}
// Rebind the free edges of the old shell to the new shell
//gka BUG 6491
const TopTools_ListOfShape& VOnE,
TopTools_ListOfShape& NE )
{
- TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
- TopoDS_Edge WE = TopoDS::Edge(aLocalShape);
+ TopoDS_Shape aLocalShapeOrientedE = E.Oriented(TopAbs_FORWARD);
+ TopoDS_Edge WE = TopoDS::Edge(aLocalShapeOrientedE);
// TopoDS_Edge WE = TopoDS::Edge(E.Oriented(TopAbs_FORWARD));
Standard_Real U1,U2;
if (Anc.Extent() == 2) {
const BRepOffset_ListOfInterval& L = myAnalyse.Type(E);
if (!L.IsEmpty() && L.First().Type() == OT) {
- TopoDS_Shape aLocalShape = myMapSF(Anc.First()).Generated(E);
- TopoDS_Edge EOn1 = TopoDS::Edge(aLocalShape);
- aLocalShape = myMapSF(Anc.Last()) .Generated(E);
- TopoDS_Edge EOn2 = TopoDS::Edge(aLocalShape);
+ TopoDS_Shape aLocalShapeGen = myMapSF(Anc.First()).Generated(E);
+ TopoDS_Edge EOn1 = TopoDS::Edge(aLocalShapeGen);
+ aLocalShapeGen = myMapSF(Anc.Last()) .Generated(E);
+ TopoDS_Edge EOn2 = TopoDS::Edge(aLocalShapeGen);
// TopoDS_Edge EOn1 = TopoDS::Edge(myMapSF(Anc.First()).Generated(E));
// TopoDS_Edge EOn2 = TopoDS::Edge(myMapSF(Anc.Last()) .Generated(E));
// find if exits tangent edges in the original shape
// are not actually tangent ( Cf: Approximation of lines
// of intersection that add noise.)
// ----------------------------------------------------------
- TopoDS_Vertex V1,V2;
+ TopoDS_Vertex aVertex1, aVertex2;
if ( E1f.IsNull() && !VfOnE1.IsNull() && !VfOnE2.IsNull()) {
TopTools_MapIteratorOfMapOfShape it(MapOnV1f);
for ( ; it.More(); it.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(it.Key());
if ( !E.IsNull()) {
- TopExp::Vertices(E,V1,V2);
- if ((V1.IsSame(VfOnE1) && V2.IsSame(VfOnE2)) ||
- (V2.IsSame(VfOnE1) && V1.IsSame(VfOnE2)) ) {
+ TopExp::Vertices(E, aVertex1, aVertex2);
+ if ((aVertex1.IsSame(VfOnE1) && aVertex2.IsSame(VfOnE2)) ||
+ (aVertex2.IsSame(VfOnE1) && aVertex1.IsSame(VfOnE2)) ) {
E1f = E;
break;
}
for ( ; it.More(); it.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(it.Key());
if ( !E.IsNull()) {
- TopExp::Vertices(E,V1,V2);
- if ((V1.IsSame(VlOnE1) && V2.IsSame(VlOnE2)) ||
- (V2.IsSame(VlOnE1) && V1.IsSame(VlOnE2)) ) {
+ TopExp::Vertices(E, aVertex1, aVertex2);
+ if ((aVertex1.IsSame(VlOnE1) && aVertex2.IsSame(VlOnE2)) ||
+ (aVertex2.IsSame(VlOnE1) && aVertex1.IsSame(VlOnE2)) ) {
E1l = E;
break;
}
// ---------------------------------------------------
TopTools_IndexedDataMapOfShapeListOfShape Map;
TopExp::MapShapesAndAncestors(Co,TopAbs_VERTEX,TopAbs_EDGE,Map);
-
- for ( Standard_Integer i = 1; i <= Map.Extent(); i++) {
- const TopoDS_Vertex& V = TopoDS::Vertex(Map.FindKey(i));
- if ( Map(i).Extent() != 3) continue;
+
+ for ( Standard_Integer j = 1; j <= Map.Extent(); j++) {
+ const TopoDS_Vertex& V = TopoDS::Vertex(Map.FindKey(j));
+ if ( Map(j).Extent() != 3) continue;
TopTools_ListOfShape LOE;
TopTools_ListIteratorOfListOfShape it;
- for (it.Initialize(Map(i)) ; it.More(); it.Next()) {
+ for (it.Initialize(Map(j)) ; it.More(); it.Next()) {
Standard_Boolean Reverse = Standard_True;
if ( Reverse)
LOE.Append(myMapSF(it.Value()).Generated(V).Reversed());
TopoDS_Edge OE;
if ( MapSS.IsBound(E)) { // this is an edge of cutting
OE = TopoDS::Edge(MapSS(E));
- TopoDS_Shape aLocalShape = E.Reversed();
+ TopoDS_Shape aLocalShapeReversedE = E.Reversed();
Handle(Geom2d_Curve) C2d_1 =
- BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalShape),Face,f,l);
+ BRep_Tool::CurveOnSurface(TopoDS::Edge(aLocalShapeReversedE),Face,f,l);
// Handle(Geom2d_Curve) C2d_1 =
// BRep_Tool::CurveOnSurface(TopoDS::Edge(E.Reversed()),
// Face,f,l);
}
if(BinMNaming::DocumentVersion() > 4 && BinMNaming::DocumentVersion() < 7) {
// Orientation processing - converting from old format
- Handle(TNaming_NamedShape) aNS;
- if(anAtt->Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+ Handle(TNaming_NamedShape) aNShape;
+ if(anAtt->Label().FindAttribute(TNaming_NamedShape::GetID(), aNShape)) {
//const TDF_Label& aLab = aNS->Label();
- TNaming_Iterator itL (aNS);
+ TNaming_Iterator itL (aNShape);
for (; itL.More(); itL.Next()) {
const TopoDS_Shape& S = itL.NewShape();
if (S.IsNull()) continue;
- if(aNS->Evolution() == TNaming_SELECTED) {
+ if(aNShape->Evolution() == TNaming_SELECTED) {
if (itL.More() && itL.NewShape().ShapeType() != TopAbs_VERTEX &&
!itL.OldShape().IsNull() && itL.OldShape().ShapeType() == TopAbs_VERTEX ) {//OR-N
TopAbs_Orientation OrientationToApply = itL.OldShape().Orientation();
else {
gp_Lin2d l(apoint,gp_Dir2d(Direc2.XY()-Direc1.XY()));
Handle(GccInt_Bisec) solution = new GccInt_BLine(l);
- Standard_Boolean ok;
+ Standard_Boolean isOk;
sense = Standard_False;
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration Begin
// distanceptsol = Distance(apoint,solution,
if (oncurve)
distanceptsol = Distance(apoint,solution,
tan2,tan1,LineBisVec,
- adirection,parameter,sense,ok);
+ adirection,parameter,sense, isOk);
else
distanceptsol = Distance(apoint,solution,
afirstvector,asecondvector,LineBisVec,
- adirection,parameter,sense,ok, Standard_True);
+ adirection,parameter,sense, isOk, Standard_True);
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration End
- if (ok || !oncurve) {
+ if (isOk || !oncurve) {
thesense = sense;
distancemini = distanceptsol;
}
Standard_Integer cas = 0;
- Handle(Standard_Type) type = afirstcurve->DynamicType();
+ Handle(Standard_Type) aFirstCurveType = afirstcurve->DynamicType();
- if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
+ if (aFirstCurveType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
curve = Handle(Geom2d_TrimmedCurve)::DownCast (afirstcurve)->BasisCurve();
}
else {
curve = afirstcurve;
}
- type = curve->DynamicType();
+ aFirstCurveType = curve->DynamicType();
#ifdef OCCT_DEBUG
gp_Pnt2d Point(asecondpoint->Pnt2d());
#else
asecondpoint->Pnt2d();
#endif
- if (type == STANDARD_TYPE(Geom2d_Circle)) {
+ if (aFirstCurveType == STANDARD_TYPE(Geom2d_Circle)) {
cas = 1;
Handle(Geom2d_Circle) C1 = Handle(Geom2d_Circle)::DownCast(curve);
circle = C1->Circ2d();
}
- else if (type == STANDARD_TYPE(Geom2d_Line)) {
+ else if (aFirstCurveType == STANDARD_TYPE(Geom2d_Line)) {
cas = 2;
Handle(Geom2d_Line) L1 = Handle(Geom2d_Line)::DownCast(curve);
line = L1->Lin2d();
}
}
if (!TheSol.IsNull()) {
- GccInt_IType type = TheSol->ArcType();
+ GccInt_IType aSolType = TheSol->ArcType();
Handle(Geom2d_Curve) bisectorcurve;
- if (type == GccInt_Lin) {
+ if (aSolType == GccInt_Lin) {
// ----------------------------------------------------------------------------
// If the bisectrice is a line
secondparameter);
}
- else if (type == GccInt_Cir) {
+ else if (aSolType == GccInt_Cir) {
bisectorcurve = new Geom2d_Circle(TheSol->Circle());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter+2.0*M_PI,
thesense);
}
- else if (type == GccInt_Hpr) {
+ else if (aSolType == GccInt_Hpr) {
bisectorcurve=new Geom2d_Hyperbola(TheSol->Hyperbola());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter,
Precision::Infinite());
}
- else if (type == GccInt_Ell) {
+ else if (aSolType == GccInt_Ell) {
bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
if (SolRoot.IsDone()) {
for (Standard_Integer j = 1; j <= SolRoot.NbSolutions(); j++) {
USol = SolRoot.Value(j);
- gp_Pnt2d P2 = curve2->Value(USol);
- gp_Vec2d P2P1(P1.X() - P2.X(),P1.Y() - P2.Y());
+ gp_Pnt2d P2Curve2 = curve2->Value(USol);
+ gp_Vec2d P2P1(P1.X() - P2Curve2.X(),P1.Y() - P2Curve2.Y());
Standard_Real SquareP2P1 = P2P1.SquareMagnitude();
Standard_Real N1P2P1 = N1.Dot(P2P1);
}
Blend_Status State;
- TheExtremity ptf1,ptf2;
param = Pdep;
Func.Set(param);
FuncInv.Set(OnFirst,thecur);
FuncInv.GetBounds(infb,supb);
FuncInv.GetTolerance(toler,tolesp/10);//Il vaut mieux garder un peu de marge
- math_FunctionSetRoot rsnld(FuncInv,toler,35);
+ math_FunctionSetRoot aRsnld(FuncInv,toler,35);
toler *= 10; // Mais on fait les tests correctements
// Resolution...
- rsnld.Perform(FuncInv,solrst,infb,supb);
+ aRsnld.Perform(FuncInv,solrst,infb,supb);
- if (!rsnld.IsDone()) {
+ if (!aRsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "Walking::Recadre : RSNLD not done " << endl;
#endif
recadre = Standard_False;
}
else {
- rsnld.Root(solrst);
+ aRsnld.Root(solrst);
recadre = FuncInv.IsSolution(solrst,tolesp);
}
}
#ifdef WNT
//windows is not case sensitive
- Standard_ExtCharacter echar;
//make the extension lower case
for(int i = 1; i <= xn.Length(); i++)
{
- echar = xn.Value(i);
+ Standard_ExtCharacter echar = xn.Value(i);
echar = towlower(echar);
xn.SetValue(i, echar);
}
if (e.Length() > 0) {
#ifdef WNT
//windows is not case sensitive
- Standard_ExtCharacter echar;
//make the extension lower case
for(int i = 1; i <= xe.Length(); i++)
{
- echar = xe.Value(i);
+ Standard_ExtCharacter echar = xe.Value(i);
echar = towlower(echar);
xe.SetValue(i, echar);
}
while(n<=FindRoots.NbSolutions())
{
Standard_Real ASOL=FindRoots.Value(n);
- Standard_Integer i=n-1;
- while((i>=1) && (Sol0(i)> ASOL))
+ Standard_Integer j=n-1;
+ while((j>=1) && (Sol0(j)> ASOL))
{
- Sol0(i+1)=Sol0(i);
- i--;
+ Sol0(j+1)=Sol0(j);
+ j--;
}
- Sol0(i+1)=ASOL;
+ Sol0(j+1)=ASOL;
n++;
}//end while(n
//Add limits of the domains
(theOffset * (6.0*Dr*Dr/R4 + 6.0*Dr*D2r/R4 - 15.0*Dr*Dr*Dr/R6 - D3r))));
D3Ndir.Multiply (theOffset/R);
// V2 = P" (U) :
- Standard_Real R4 = R2 * R2;
+ R4 = R2 * R2;
D2Ndir.Subtract (DNdir.Multiplied (2.0 * Dr / R2));
D2Ndir.Subtract (Ndir.Multiplied (((3.0 * Dr * Dr)/R4) - (D2r/R2)));
D2Ndir.Multiply (theOffset / R);
//We try another computation but the stability is not very good
//dixit ISG.
// V2 = P" (U) :
- Standard_Real R4 = R2 * R2;
+ R4 = R2 * R2;
D2Ndir.Subtract (DNdir.Multiplied (2.0 * Dr / R2));
D2Ndir.Add (Ndir.Multiplied (((3.0 * Dr * Dr)/R4) - (D2r/R2)));
D2Ndir.Multiply (theOffsetValue / R);
D3Ndir.Add (Ndir.Multiplied (6.0*Dr*Dr/R4 + 6.0*Dr*D2r/R4 - 15.0*Dr*Dr*Dr/R6 - D3r));
D3Ndir.Multiply (theOffsetValue/R);
// V2 = P" (U) :
- Standard_Real R4 = R2 * R2;
+ R4 = R2 * R2;
D2Ndir.Subtract (DNdir.Multiplied (2.0 * Dr / R2));
D2Ndir.Subtract (Ndir.Multiplied ((3.0 * Dr * Dr / R4) - (D2r / R2)));
D2Ndir.Multiply (theOffsetValue / R);
// Make a line parallel to segment and
// passing near the "near" point.
- gp_Vec2d d2(v2);
- gp_Lin2d line(p22, -d2);
- d2.Rotate(M_PI_2);
- line.Translate(radius * d2);
+ gp_Vec2d aD2Vec(v2);
+ gp_Lin2d line(p22, -aD2Vec);
+ aD2Vec.Rotate(M_PI_2);
+ line.Translate(radius * aD2Vec);
if (line.Distance(nearPoint) > radius)
- line.Translate(-2.0 * radius * d2);
+ line.Translate(-2.0 * radius * aD2Vec);
// Make a circle of radius of the arc +/- fillet radius.
gp_Ax2d axes(pc1, gp::DX2d());
if (OE1 == TopAbs_REVERSED) {
vec1.Reverse();
} // if (OE1 ...
- Standard_Real cross = vec1*vec;
- Standard_Boolean Sense = cross > 0.;
+ Standard_Boolean Sense = ( vec1*vec ) > 0.;
if (U1 > Vv1 && U1 > 2.*M_PI) {
ElCLib::AdjustPeriodic(0.,2.*M_PI,Precision::Confusion(),U1,Vv1);
} // if (U1 ...
aValid2 = !IsRadiusIntersected(myCurve1, myStart1, myEnd1, aCenter, aProj.Point(a), Standard_False);
// checking the right parameter
- Standard_Real aParam = aProj.Parameter(a);
- while(myCurve2->IsPeriodic() && aParam < myStart2)
- aParam += myCurve2->Period();
+ Standard_Real aParamProj = aProj.Parameter(a);
+ while(myCurve2->IsPeriodic() && aParamProj < myStart2)
+ aParamProj += myCurve2->Period();
const Standard_Real d = aProj.Distance(a);
- thePoint->appendValue(d * d - myRadius * myRadius, (aParam >= myStart2 && aParam <= myEnd2 && aValid2));
+ thePoint->appendValue(d * d - myRadius * myRadius, (aParamProj >= myStart2 && aParamProj <= myEnd2 && aValid2));
if (Abs(d - myRadius) < Precision::Confusion())
- thePoint->setParam2(aParam);
+ thePoint->setParam2(aParamProj);
}
}
Stripe->OrientationOnFace1(),
Stripe->OrientationOnFace2(),
RC);
- const Handle(Adaptor3d_HSurface)& HSon1 = HS1; // to avoid ambiguity
- const Handle(Adaptor3d_HSurface)& HSon2 = HS2; // to avoid ambiguity
- I1->Initialize(HSon1);
- I2->Initialize(HSon2);
+ const Handle(Adaptor3d_HSurface)& HSon1new = HS1; // to avoid ambiguity
+ const Handle(Adaptor3d_HSurface)& HSon2new = HS2; // to avoid ambiguity
+ I1->Initialize(HSon1new);
+ I2->Initialize(HSon2new);
if(PerformFirstSection(Spine,HGuide,Choix,HS1,HS2,
I1,I2,w,SolDep,Pos1,Pos2)){
P1.SetCoord(SolDep(1),SolDep(2));
Standard_Real spinefin = LastParameter();
Standard_Integer nbed = ifin - ideb + 1;
- Standard_Integer biddeb = ideb, bidfin = ifin;
+ Standard_Integer bidfin = ifin;
Handle(Law_Composite) loi = new Law_Composite();
Law_Laws& list = loi->ChangeLaws();
if(IsPeriodic()){
if(deb < 0 && ideb > ifin) bidfin += len;
else if(fin > LastParameter(len) && ideb > ifin) bidfin += len;
- nbed = bidfin - biddeb + 1;
+ nbed = bidfin - ideb + 1;
}
TColStd_Array1OfInteger ind(1,nbed);
Standard_Integer j = 1;
- for(Standard_Integer i = biddeb; i <= bidfin; i++){
+ for(Standard_Integer i = ideb; i <= bidfin; i++){
ind(j++) = ((i - 1)%len) + 1;
}
//IFV begin
if(solrst.NbSegments() <= 0) {
if(mySFunc.FunctionType() == Contap_ContourStd) {
- const Handle(Adaptor3d_HSurface)& Surf = mySFunc.Surface();
- if(Adaptor3d_HSurfaceTool::GetType(Surf) == GeomAbs_Torus) {
- gp_Torus aTor = Adaptor3d_HSurfaceTool::Torus(Surf);
+ const Handle(Adaptor3d_HSurface)& SurfToCheck = mySFunc.Surface();
+ if(Adaptor3d_HSurfaceTool::GetType(SurfToCheck) == GeomAbs_Torus) {
+ gp_Torus aTor = Adaptor3d_HSurfaceTool::Torus(SurfToCheck);
gp_Dir aTorDir = aTor.Axis().Direction();
gp_Dir aProjDir = mySFunc.Direction();
// Faces
Handle(Poly_Triangulation) Tr;
- TopLoc_Location l;
+ TopLoc_Location aTempLoc;
TopLoc_Location loc;
DBRep_ListIteratorOfListOfFace itf(myFaces);
const Handle(DBRep_Face)& F = itf.Value();
dis.SetColor(F->Color());
- const Handle(Geom_Surface)& S = BRep_Tool::Surface(F->Face(),l);
+ Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F->Face(), aTempLoc);
- if (!S.IsNull()) {
+ if (!aSurf.IsNull()) {
Standard_Boolean restriction = Standard_False;
- if(S->IsUPeriodic() || S->IsVPeriodic()) {
+ if(aSurf->IsUPeriodic() || aSurf->IsVPeriodic()) {
Standard_Real SU1 = 0., SU2 = 0., SV1 = 0., SV2 = 0.;
Standard_Real FU1 = 0., FU2 = 0., FV1 = 0., FV2 = 0.;
- S->Bounds(SU1,SU2,SV1,SV2);
+ aSurf->Bounds(SU1,SU2,SV1,SV2);
BRepTools::UVBounds (F->Face(),FU1,FU2,FV1,FV2);
- if(S->IsUPeriodic()) {
+ if(aSurf->IsUPeriodic()) {
if(FU1 < SU1 || FU1 > SU2)
restriction = Standard_True;
if(!restriction && (FU2 < SU1 || FU2 > SU2))
restriction = Standard_True;
}
- if(!restriction && S->IsVPeriodic()) {
+ if(!restriction && aSurf->IsVPeriodic()) {
if(FV1 < SV1 || FV1 > SV2)
restriction = Standard_True;
if(!restriction && (FV2 < SV1 || FV2 > SV2))
// trace des eventuelles triangulations.
//=====================================
- if (S.IsNull() || mytriangulations) {
+ if (aSurf.IsNull() || mytriangulations) {
Tr = BRep_Tool::Triangulation(F->Face(), loc);
if (!Tr.IsNull()) {
Display(Tr, loc.Transformation(), dis);
// display geometrical curve if exists.
Standard_Boolean isgeom = BRep_Tool::IsGeometric(E->Edge());
- Standard_Real U1,U2;
+ Standard_Real aCheckU1, aCheckU2;
if (isgeom) {
// check the range (to report bad edges)
- BRep_Tool::Range(E->Edge(),U1,U2);
- if (U2 < U1) {
+ BRep_Tool::Range(E->Edge(), aCheckU1, aCheckU2);
+ if (aCheckU2 < aCheckU1) {
// bad orientation
cout << "DBRep_DrawableShape : Bad parameters on edge."<<endl;
BRepTools::Dump(E->Edge(),cout);
if (myDispOr) {
// display an arrow at the end
- gp_Pnt P;
+ gp_Pnt aPnt;
gp_Vec V;
- C.D1(l,P,V);
+ C.D1(l, aPnt,V);
gp_Pnt2d p1,p2;
- dis.Project(P,p1);
- P.Translate(V);
- dis.Project(P,p2);
+ dis.Project(aPnt,p1);
+ aPnt.Translate(V);
+ dis.Project(aPnt,p2);
gp_Vec2d v(p1,p2);
if (v.Magnitude() > gp::Resolution()) {
Standard_Real L = 20 / dis.Zoom();
else {
// Polygone sur triangulation:
- Handle(Poly_Triangulation) Tr;
+ Handle(Poly_Triangulation) PolyTr;
Handle(Poly_PolygonOnTriangulation) Poly;
- BRep_Tool::PolygonOnTriangulation(E->Edge(), Poly, Tr, loc);
+ BRep_Tool::PolygonOnTriangulation(E->Edge(), Poly, PolyTr, loc);
if (!Poly.IsNull()) {
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
- const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
+ const TColgp_Array1OfPnt& Nodes = PolyTr->Nodes();
for (i=Indices.Lower()+1; i<=Indices.Upper(); i++) {
dis.Draw(Nodes(Indices(i-1)).Transformed(loc),
Nodes(Indices(i)).Transformed(loc));
{
TopTools_MapOfShape View;
TopExp_Explorer ShapeExplorer (ShapeIn, KindOfShape);
- TopTools_ListOfShape Shapes;
for (; ShapeExplorer.More(); ShapeExplorer.Next ()) {
const TopoDS_Shape& Root = ShapeExplorer.Current ();
if (!View.Add(Root)) continue;
}
const TopoDS_Shape& aResult = aMakePrism.Shape();
- BRepCheck_Analyzer aCheck(aResult);
- if (!aCheck.IsValid(aResult)) {
+ BRepCheck_Analyzer aCheckAnalyzer(aResult);
+ if (!aCheckAnalyzer.IsValid(aResult)) {
aFunction->SetFailure(RESULT_NOT_VALID);
#ifdef OCCT_DEBUG
Standard_CString aFileName = "PrismResult.brep";
return -1;
}
const TopoDS_Shape aResult = aMakeRevol.Shape();
- BRepCheck_Analyzer aCheck(aResult);
- if (!aCheck.IsValid(aResult)) {
+ BRepCheck_Analyzer aCheckAnalyzer(aResult);
+ if (!aCheckAnalyzer.IsValid(aResult)) {
aFunction->SetFailure(RESULT_NOT_VALID);
return -1;
}
return -1;
}
const TopoDS_Shape aResult = aMakeRevol.Shape();
- BRepCheck_Analyzer aCheck(aResult);
- if (!aCheck.IsValid(aResult)) {
+ BRepCheck_Analyzer aCheckAnalyzer(aResult);
+ if (!aCheckAnalyzer.IsValid(aResult)) {
aFunction->SetFailure(RESULT_NOT_VALID);
return -1;
}
if(StartShape.ShapeType() != TopAbs_FACE) {
TopoDS_Iterator it(StartShape);
for (; it.More(); it.Next()) {
- TNaming_Builder Builder(theResultLabel.NewChild());
- Builder.Generated(it.Value());
+ TNaming_Builder aBuilder(theResultLabel.NewChild());
+ aBuilder.Generated(it.Value());
}
}
} else {
if(EndShape.ShapeType() != TopAbs_FACE) {
TopoDS_Iterator it(EndShape);
for (; it.More(); it.Next()) {
- TNaming_Builder Builder(theResultLabel.NewChild());
- Builder.Generated(it.Value());
+ TNaming_Builder aBuilder(theResultLabel.NewChild());
+ aBuilder.Generated(it.Value());
}
}
} else {
// Pre-compute curve sample points.
TColgp_HArray1OfPnt aCurvPnts (0, mytsample);
- Standard_Real aCU = aMinTUV(1);
- for (Standard_Integer aCUI = 0; aCUI <= mytsample; aCUI++, aCU += aStepCU)
- aCurvPnts.SetValue (aCUI, C.Value (aCU));
+ Standard_Real aCU1 = aMinTUV(1);
+ for (Standard_Integer aCUI = 0; aCUI <= mytsample; aCUI++, aCU1 += aStepCU)
+ aCurvPnts.SetValue (aCUI, C.Value (aCU1));
PSO_Particle* aParticle = aParticles.GetWorstParticle();
// Select specified number of particles from pre-computed set of samples
Standard_Real aSV = aMinTUV(3);
for (Standard_Integer aSVI = 0; aSVI <= myvsample; aSVI++, aSV += aStepSV)
{
- Standard_Real aCU = aMinTUV(1);
- for (Standard_Integer aCUI = 0; aCUI <= mytsample; aCUI++, aCU += aStepCU)
+ Standard_Real aCU2 = aMinTUV(1);
+ for (Standard_Integer aCUI = 0; aCUI <= mytsample; aCUI++, aCU2 += aStepCU)
{
Standard_Real aSqDist = mySurfPnts->Value(aSUI, aSVI).SquareDistance(aCurvPnts.Value(aCUI));
if (aSqDist < aParticle->Distance)
{
- aParticle->Position[0] = aCU;
+ aParticle->Position[0] = aCU2;
aParticle->Position[1] = aSU;
aParticle->Position[2] = aSV;
- aParticle->BestPosition[0] = aCU;
+ aParticle->BestPosition[0] = aCU2;
aParticle->BestPosition[1] = aSU;
aParticle->BestPosition[2] = aSV;
PasU = (PasU - U0) / (myusample - 1);
U0 = U0/2. + myumin;
myUParams = new TColStd_HArray1OfReal(1,myusample );
- Standard_Integer NoU;
Standard_Real U = U0;
for ( NoU = 1 ; NoU <= myusample; NoU++, U += PasU)
myUParams->SetValue(NoU, U);
V0 = V0/2. + myvmin;
myVParams = new TColStd_HArray1OfReal(1,myvsample );
- Standard_Integer NoV;
Standard_Real V = V0;
for ( NoV = 1, V = V0; NoV <= myvsample; NoV++, V += PasV)
if(GHGt->IsInProfile(k, i)) {
Standard_Real m = 0.; // m = M(k,i)
- const FEmTool_ListOfVectors& L = G.Value(k);
+ const FEmTool_ListOfVectors& aL = G.Value(k);
- for(Iter.Initialize(L); Iter.More(); Iter.Next()) {
+ for(Iter.Initialize(aL); Iter.More(); Iter.Next()) {
const Handle(TColStd_HArray1OfReal)& a = Iter.Value();
for(j = a->Lower(); j <= a->Upper(); j++) m += qi(j) * a->Value(j); // scalar product of
}
else {
FEmTool_ListIteratorOfListOfVectors Iter(L);
- Standard_Integer i;
Standard_Real s1 = 0, s2 = 0;
Handle(TColStd_HArray1OfReal) Aux1, Aux2;
for(i=1; Iter.More(); Iter.Next(), i++) {
Handle(PLib_HermitJacobi) theBase = new PLib_HermitJacobi(WDeg, ConstraintOrder);
FEmTool_ElementsOfRefMatrix Elem = FEmTool_ElementsOfRefMatrix(theBase, DerOrder);
Standard_Integer maxDegree = WDeg+1;
- math_IntegerVector Order(1,1,Min(4*(maxDegree/2+1),math::GaussPointsMax()));
+ math_IntegerVector anOrder(1,1,Min(4*(maxDegree/2+1),math::GaussPointsMax()));
math_Vector Lower(1,1,-1.), Upper(1,1,1.);
- math_GaussSetIntegration anInt(Elem, Lower, Upper, Order);
+ math_GaussSetIntegration anInt(Elem, Lower, Upper, anOrder);
MatrixElemts = anInt.Value();
}
Standard_Integer maxDegree = WDeg+1;
- math_IntegerVector Order(1,1,Min(4*(maxDegree/2+1),math::GaussPointsMax()));
+ math_IntegerVector anOrder(1,1,Min(4*(maxDegree/2+1),math::GaussPointsMax()));
math_Vector Lower(1,1,-1.), Upper(1,1,1.);
- math_GaussSetIntegration anInt(Elem, Lower, Upper, Order);
+ math_GaussSetIntegration anInt(Elem, Lower, Upper, anOrder);
MatrixElemts = anInt.Value();
}
FEmTool_ElementsOfRefMatrix Elem = FEmTool_ElementsOfRefMatrix(theBase, DerOrder);
Standard_Integer maxDegree = WDeg+1;
- math_IntegerVector Order(1,1,Min(4*(maxDegree/2+1),math::GaussPointsMax()));
+ math_IntegerVector anOrder(1,1,Min(4*(maxDegree/2+1),math::GaussPointsMax()));
math_Vector Lower(1,1,-1.), Upper(1,1,1.);
- math_GaussSetIntegration anInt(Elem, Lower, Upper, Order);
+ math_GaussSetIntegration anInt(Elem, Lower, Upper, anOrder);
MatrixElemts = anInt.Value();
}
}
NewBS -> InsertKnots(NKnots->Array1(), NMults->Array1(), 1.e-10);
- Handle(TColgp_HArray1OfPnt2d) NPoles =
+ Handle(TColgp_HArray1OfPnt2d) NewNPoles =
new TColgp_HArray1OfPnt2d(1, NewBS->NbPoles());
- NewBS -> Poles( NPoles->ChangeArray1() );
+ NewBS -> Poles(NewNPoles->ChangeArray1() );
NewBS -> Multiplicities( NMults->ChangeArray1() );
NewBS -> Knots( NKnots->ChangeArray1() );
Handle(TColStd_HArray1OfReal) FKnots =
new TColStd_HArray1OfReal (1, NewBS->NbPoles() + Degree+1);
NewBS -> KnotSequence( FKnots->ChangeArray1());
- Poles = NPoles;
+ Poles = NewNPoles;
Mults = NMults;
Knots = NKnots;
Flatknots = FKnots;
}
NewBS -> InsertKnots(NKnots->Array1(), NMults->Array1(), 1.e-10);
- Handle(TColgp_HArray1OfPnt2d) NPoles =
+ Handle(TColgp_HArray1OfPnt2d) NewNPoles =
new TColgp_HArray1OfPnt2d(1, NewBS->NbPoles());
- NewBS -> Poles( NPoles->ChangeArray1() );
+ NewBS -> Poles(NewNPoles->ChangeArray1() );
NewBS -> Multiplicities( NMults->ChangeArray1() );
NewBS -> Knots( NKnots->ChangeArray1() );
Handle(TColStd_HArray1OfReal) FKnots =
new TColStd_HArray1OfReal (1, NewBS->NbPoles() + Degree+1);
NewBS -> KnotSequence( FKnots->ChangeArray1());
- Poles = NPoles;
+ Poles = NewNPoles;
Mults = NMults;
Knots = NKnots;
Flatknots = FKnots;
}
if(!periodic && yatrou) return 2;
if(periodic && yatrou){
- Standard_Boolean vraitrou = 0, debut = 0;
+ Standard_Boolean vraitrou = 0, aLocalDebut = 0;
for(Standard_Integer i = sp->NbEdges(); i > yatrou; i--){
TopoDS_Edge cured = sp->Edges(i);
if(isinlist(cured,E)){
if(vraitrou) return 2;
newsp->PutInFirst(cured);
}
- else if(debut) vraitrou = 1;
- debut = 1;
+ else if(aLocalDebut) vraitrou = 1;
+ aLocalDebut = 1;
}
}
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// =======================================================
#ifdef OCCT_DEBUG
- gp_Dir2d dc1(center1.XY()-Center.XY());
+ gp_Dir2d aDC1(center1.XY()-Center.XY());
#endif
gp_Dir2d dc2(origin2.XY()-Center.XY());
Standard_Real distcc1 = Center.Distance(center1);
ElCLib::D1(Ufirst(1),L1,point1,Tan1);
Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
gp_Vec2d Tan3(OnLine.Direction().XY());
- gp_Pnt2d point3(OnLine.Location().XY()+Ufirst(3)*Tan3.XY());
- Standard_Real dist1 = point3.Distance(point1);
- Standard_Real dist2 = point3.Distance(point2);
+ gp_Pnt2d point3new(OnLine.Location().XY()+Ufirst(3)*Tan3.XY());
+ Standard_Real dist1 = point3new.Distance(point1);
+ Standard_Real dist2 = point3new.Distance(point2);
if ( Abs(dist1-dist2)/2. <= Tol) {
- cirsol = gp_Circ2d(gp_Ax2d(point3,dirx),(dist1+dist2)/2.);
+ cirsol = gp_Circ2d(gp_Ax2d(point3new,dirx),(dist1+dist2)/2.);
Standard_Real normetan2 = Tan2.Magnitude();
- gp_Vec2d Vec1(point1,point3);
- gp_Vec2d Vec2(point2,point3);
+ gp_Vec2d Vec1(point1,point3new);
+ gp_Vec2d Vec2(point2,point3new);
Standard_Real normevec2 = Vec2.Magnitude();
Standard_Real angle2;
if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) {
angle2 = Vec2.Angle(Tan2);
}
else { angle2 = 0.; }
- Standard_Real pscal=point3.XY().Dot(gp_XY(-L1.Direction().Y(),
+ Standard_Real pscal=point3new.XY().Dot(gp_XY(-L1.Direction().Y(),
L1.Direction().X()));
if (Qualified1.IsUnqualified() ||
(Qualified1.IsOutside() && pscal <= 0.) ||
pnttg2sol = point2;
pararg2 = Ufirst(2);
par2sol = ElCLib::Parameter(cirsol,pnttg2sol);
- pntcen = point3;
+ pntcen = point3new;
parcen3 = Ufirst(3);
WellDone = Standard_True;
}
Geom2dGcc_CurveTool::D1(Cu1,Ufirst(1),point1,Tan1);
Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
gp_Vec2d Tan3(OnLine.Direction().XY());
- gp_Pnt2d point3(OnLine.Location().XY()+Ufirst(3)*Tan3.XY());
- Standard_Real dist1 = point3.Distance(point1);
- Standard_Real dist2 = point3.Distance(point2);
+ gp_Pnt2d point3new(OnLine.Location().XY()+Ufirst(3)*Tan3.XY());
+ Standard_Real dist1 = point3new.Distance(point1);
+ Standard_Real dist2 = point3new.Distance(point2);
if ( Abs(dist1-dist2)/2. <= Tol) {
- cirsol = gp_Circ2d(gp_Ax2d(point3,dirx),(dist1+dist2)/2.);
+ cirsol = gp_Circ2d(gp_Ax2d(point3new,dirx),(dist1+dist2)/2.);
Standard_Real normetan1 = Tan1.Magnitude();
Standard_Real normetan2 = Tan2.Magnitude();
- gp_Vec2d Vec1(point1,point3);
- gp_Vec2d Vec2(point2,point3);
+ gp_Vec2d Vec1(point1,point3new);
+ gp_Vec2d Vec2(point2,point3new);
Standard_Real normevec1 = Vec1.Magnitude();
Standard_Real normevec2 = Vec2.Magnitude();
Standard_Real angle1,angle2;
pnttg2sol = point2;
pararg2 = Ufirst(2);
par2sol = ElCLib::Parameter(cirsol,pnttg2sol);
- pntcen = point3;
+ pntcen = point3new;
parcen3 = Ufirst(3);
WellDone = Standard_True;
}
Func.Value(Ufirst,Umin);
if (Root.IsDone()) {
Root.Root(Ufirst);
- gp_Pnt2d point1,point3;
+ gp_Pnt2d point1new,point3new;
gp_Vec2d Tan1,Tan3;
- Geom2dGcc_CurveTool::D1(Cu1,Ufirst(1),point1,Tan1);
- ElCLib::D1(Ufirst(2),OnLine,point3,Tan3);
- Standard_Real dist1 = point3.Distance(point1);
- Standard_Real dist2 = point3.Distance(Point2);
+ Geom2dGcc_CurveTool::D1(Cu1,Ufirst(1),point1new,Tan1);
+ ElCLib::D1(Ufirst(2),OnLine,point3new,Tan3);
+ Standard_Real dist1 = point3new.Distance(point1new);
+ Standard_Real dist2 = point3new.Distance(Point2);
if ( Abs(dist1-dist2)/2. <= Tol) {
- cirsol = gp_Circ2d(gp_Ax2d(point3,dirx),(dist1+dist2)/2.);
+ cirsol = gp_Circ2d(gp_Ax2d(point3new,dirx),(dist1+dist2)/2.);
Standard_Real normetan1 = Tan1.Magnitude();
- gp_Vec2d Vec1(point1,point3);
+ gp_Vec2d Vec1(point1new,point3new);
Standard_Real normevec1 = Vec1.Magnitude();
Standard_Real angle1;
if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) {
(Qualified1.IsEnclosed() && angle1 <= 0.)) {
qualifier1 = Qualified1.Qualifier();
qualifier2 = GccEnt_noqualifier;
- pnttg1sol = point1;
+ pnttg1sol = point1new;
pararg1 = Ufirst(1);
par1sol = ElCLib::Parameter(cirsol,pnttg1sol);
pnttg2sol = Point2;
pararg2 = Ufirst(2);
par2sol = ElCLib::Parameter(cirsol,pnttg2sol);
- pntcen = point3;
+ pntcen = point3new;
parcen3 = Ufirst(3);
WellDone = Standard_True;
}
Func.Value(Ufirst,Umin);
if (Root.IsDone()) {
Root.Root(Ufirst);
- gp_Pnt2d point1,point2;
+ gp_Pnt2d point1new,point2new;
gp_Vec2d Tan1,Tan2;
- ElCLib::D1(Ufirst(1),L1,point1,Tan1);
- Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2,Tan2);
+ ElCLib::D1(Ufirst(1),L1,point1new,Tan1);
+ Geom2dGcc_CurveTool::D1(Cu2,Ufirst(2),point2new,Tan2);
#ifdef OCCT_DEBUG
gp_Vec2d Tan3(-Sin(Ufirst(3)),Cos(Ufirst(3)));
#endif
point3 = ElCLib::Value(Ufirst(3),OnCirc);
- Standard_Real dist1 = point3.Distance(point1);
- Standard_Real dist2 = point3.Distance(point2);
+ Standard_Real dist1 = point3.Distance(point1new);
+ Standard_Real dist2 = point3.Distance(point2new);
if ( Abs(dist1-dist2)/2. <= Tol) {
cirsol = gp_Circ2d(gp_Ax2d(point3,dirx),(dist1+dist2)/2.);
Standard_Real normetan2 = Tan2.Magnitude();
- gp_Vec2d Vec1(point1,point3);
- gp_Vec2d Vec2(point2,point3);
+ gp_Vec2d Vec1(point1new,point3);
+ gp_Vec2d Vec2(point2new,point3);
Standard_Real normevec2 = Vec2.Magnitude();
Standard_Real angle2;
if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) {
(Qualified2.IsEnclosed() && angle2 <= 0.)) {
qualifier1 = Qualified1.Qualifier();
qualifier2 = Qualified2.Qualifier();
- pnttg1sol = point1;
+ pnttg1sol = point1new;
pararg1 = Ufirst(1);
par1sol = ElCLib::Parameter(cirsol,pnttg1sol);
- pnttg2sol = point2;
+ pnttg2sol = point2new;
pararg2 = Ufirst(2);
par2sol = ElCLib::Parameter(cirsol,pnttg2sol);
pntcen = point3;
Func.Value(Ufirst,Umin);
if (Root.IsDone()) {
Root.Root(Ufirst);
- gp_Pnt2d point1,point3;
+ gp_Pnt2d point1new,point3new;
gp_Vec2d Tan1,Tan3;
- Geom2dGcc_CurveTool::D1(Cu1,Ufirst(1),point1,Tan1);
- ElCLib::D1(Ufirst(2),OnCirc,point3,Tan3);
- Standard_Real dist1 = point3.Distance(point1);
- Standard_Real dist2 = point3.Distance(Point2);
+ Geom2dGcc_CurveTool::D1(Cu1,Ufirst(1),point1new,Tan1);
+ ElCLib::D1(Ufirst(2),OnCirc,point3new,Tan3);
+ Standard_Real dist1 = point3new.Distance(point1new);
+ Standard_Real dist2 = point3new.Distance(Point2);
if ( Abs(dist1-dist2)/2. <= Tol) {
- cirsol = gp_Circ2d(gp_Ax2d(point3,dirx),(dist1+dist2)/2.);
+ cirsol = gp_Circ2d(gp_Ax2d(point3new,dirx),(dist1+dist2)/2.);
Standard_Real normetan1 = Tan1.Magnitude();
- gp_Vec2d Vec1(point1,point3);
+ gp_Vec2d Vec1(point1new,point3new);
Standard_Real normevec1 = Vec1.Magnitude();
Standard_Real angle1;
if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) {
(Qualified1.IsEnclosed() && angle1 <= 0.)) {
qualifier1 = Qualified1.Qualifier();
qualifier2 = GccEnt_noqualifier;
- pnttg1sol = point1;
+ pnttg1sol = point1new;
pararg1 = Ufirst(1);
par1sol = ElCLib::Parameter(cirsol,pnttg1sol);
pnttg2sol = Point2;
pararg2 = 0.;
par2sol = ElCLib::Parameter(cirsol,pnttg2sol);
- pntcen = point3;
+ pntcen = point3new;
parcen3 = Ufirst(3);
WellDone = Standard_True;
}
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C1),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C1),thelast);
#ifdef OCCT_DEBUG
- IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol,
+ IntRes2d_Domain D2C1(Geom2dGcc_CurveToolGeo::Value(C1,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C1,lastparam),lastparam,Tol);
#else
Geom2dGcc_CurveToolGeo::Value(C1,firstparam);
firstparam = Max(Geom2dGcc_CurveToolGeo::FirstParameter(C2),thefirst);
lastparam = Min(Geom2dGcc_CurveToolGeo::LastParameter(C2),thelast);
#ifdef OCCT_DEBUG
- IntRes2d_Domain D2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
+ IntRes2d_Domain D2C2(Geom2dGcc_CurveToolGeo::Value(C2,firstparam),firstparam,Tol,
Geom2dGcc_CurveToolGeo::Value(C2,lastparam),lastparam,Tol);
#else
Geom2dGcc_CurveToolGeo::Value(C2,firstparam);
if (Qualified1.IsUnqualified() ||
(Qualified1.IsOutside() && pscal <= 0.) ||
(Qualified1.IsEnclosed() && pscal >= 0.)) {
- Standard_Real pscal=centre.XY().Dot(gp_XY(-L1.Direction().Y(),
- L1.Direction().X()));
gp_Vec2d Tan1(L1.Direction().XY());
gp_Vec2d Tan2(L2.Direction().XY());
Standard_Real normetan1 = Tan1.Magnitude();
else if ( S == GeomAbs_C2) Cont = 2;
else if ( S == GeomAbs_C3) Cont = 3;
else Cont = myBspl->Degree();
- Standard_Integer FirstIndex = myBspl->FirstUKnotIndex();
- Standard_Integer LastIndex = myBspl->LastUKnotIndex();
Standard_Integer Degree = myBspl->Degree();
Standard_Integer NbKnots = myBspl->NbKnots();
TColStd_Array1OfInteger Mults (1, NbKnots);
else if ( S == GeomAbs_C2) Cont = 2;
else if ( S == GeomAbs_C3) Cont = 3;
else Cont = myBspl->Degree();
- Standard_Integer FirstIndex = myBspl->FirstUKnotIndex();
- Standard_Integer LastIndex = myBspl->LastUKnotIndex();
Standard_Integer Degree = myBspl->Degree();
Standard_Integer NbKnots = myBspl->NbKnots();
TColStd_Array1OfInteger Mults (1, NbKnots);
Handle(Geom_Surface) Surf = Strim->BasisSurface();
UFirst = U1; ULast = U2; VFirst = V1; VLast = V2;
if (Surf->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
- Handle(Geom_OffsetSurface) OffsetSur =
+ Handle(Geom_OffsetSurface) OffsetSurBasis =
Handle(Geom_OffsetSurface)::DownCast(Surf);
- S = OffsetSur->Surface();
+ S = OffsetSurBasis->Surface();
if (!S.IsNull()) {
Surf = S;
}
}
if (Surf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
- Handle(Geom_RectangularTrimmedSurface) Strim = new
+ Handle(Geom_RectangularTrimmedSurface) aStrim = new
(Geom_RectangularTrimmedSurface) (Surf,
UFirst, ULast,
VFirst, VLast);
- return SurfaceToBSplineSurface(Strim);
+ return SurfaceToBSplineSurface(aStrim);
}
if (Surf->IsKind(STANDARD_TYPE(Geom_Plane))) {
E.DerivTX(DN, myAngle, D2EDTDX); // d2E/dtdx
math_Vector D2SDT2(1,3,0); // d2s/dt2
- math_Matrix T(1,3,1,3,0);
- D2EDX2.Multiply(DSDT,T);
+ math_Matrix aT(1,3,1,3,0);
+ D2EDX2.Multiply(DSDT,aT);
// resolution du syst. lin.
math_Gauss Ga1 (DEDX);
if (Ga1.IsDone())
{
- Ga1.Solve ( -T*DSDT - 2*D2EDTDX*DSDT - D2EDT2 , D2SDT2);
+ Ga1.Solve ( -aT*DSDT - 2*D2EDTDX*DSDT - D2EDT2 , D2SDT2);
gp_Vec2d d2p (D2SDT2(2), D2SDT2(3)); // surface
gp_Vec2d d2q (D2SDT2(1), 0); // courbe
D2Poles2d.SetValue(1, d2p);
Standard_Real aMidKnot = 0.;
for (i = 1; i <= theCurves.Length(); i++)
{
- Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(theCurves(i));
- aMidKnot += C->Knot(j);
+ Handle(Geom_BSplineCurve) Ctemp = Handle(Geom_BSplineCurve)::DownCast(theCurves(i));
+ aMidKnot += Ctemp->Knot(j);
}
aMidKnot /= theCurves.Length();
NewKnots(j) = aMidKnot;
for (i = 1; i <= theCurves.Length(); i++)
{
- Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(theCurves(i));
- C->SetKnots(NewKnots);
+ Handle(Geom_BSplineCurve) Cres = Handle(Geom_BSplineCurve)::DownCast(theCurves(i));
+ Cres->SetKnots(NewKnots);
}
}
D2Px(1, Ordre), D2Py(1, Ordre), D2W(1, Ordre);
Standard_Integer ii;
- Standard_Real aux, daux, b, b2, c, c2, bpr, bsc;
+ Standard_Real daux, b, b2, c, c2, bpr, bsc;
gp_Vec V1(Center, FirstPnt), V1Prim, V1Secn, V2;
// Calcul des transformations
+ 2*betaprim * tan_b * dtan_b;
b2 = tan_b - beta;
b += beta / (3*b2);
- aux = betaprim*tan_b - beta*dtan_b;
+ Standard_Real aux = betaprim*tan_b - beta*dtan_b;
bpr += aux / (3*b2*b2);
daux = betasecn*tan_b - beta*d2tan_b;
bsc += (daux - 2*aux*betaprim*tan_b*tan_b/b2)/(3*b2*b2);
if (Intersector.IsDone())
{
Standard_Real w;
- gp_Pnt P;
Standard_Real aDist;
for (ii=1; ii<=Intersector.NbPoints(); ii++)
{
w = Intersector.Point(ii).W();
- P = Path->Value( w );
+ P = Path->Value( w );
aDist = P.Distance( TheAxe.Location() );
if (aDist < DistCenter)
{
ProjLib_CompProjectedCurve Projector(hsur, Curv, myTol3d/10, myTol3d/10);
- Standard_Real Udeb, Ufin, ProjUdeb, ProjUfin;
- Udeb = Curv->FirstParameter();
- Ufin = Curv->LastParameter();
+ Standard_Real UdebCheck, UfinCheck, ProjUdeb, ProjUfin;
+ UdebCheck = Curv->FirstParameter();
+ UfinCheck = Curv->LastParameter();
Projector.Bounds( 1, ProjUdeb, ProjUfin );
if (Projector.NbCurves() != 1 ||
- Abs( Udeb-ProjUdeb ) > Precision::PConfusion() ||
- Abs( Ufin-ProjUfin ) > Precision::PConfusion())
+ Abs( UdebCheck -ProjUdeb ) > Precision::PConfusion() ||
+ Abs( UfinCheck -ProjUfin ) > Precision::PConfusion())
{
if (Projector.IsSinglePnt(1, P2d))
{
Standard_Real u1,v1,u2,v2;
mySurfInit->Bounds(u1,v1,u2,v2);
- GeomAdaptor_Surface Surf(mySurfInit);
- myTolU = Surf.UResolution(myTol3d);
- myTolV = Surf.VResolution(myTol3d);
- myProj.Initialize(Surf,u1,v1,u2,v2,
+ GeomAdaptor_Surface aSurfInit(mySurfInit);
+ myTolU = aSurfInit.UResolution(myTol3d);
+ myTolV = aSurfInit.VResolution(myTol3d);
+ myProj.Initialize(aSurfInit,u1,v1,u2,v2,
myTolU,myTolV);
//======================================================================
// Projection des courbes
//======================================================================
- Standard_Integer i;
Standard_Boolean Ok = Standard_True;
- for (i = 1; i <= NTLinCont; i++)
+ for (Standard_Integer i = 1; i <= NTLinCont; i++)
if(myLinCont->Value(i)->Curve2dOnSurf().IsNull())
{
Handle( Geom2d_Curve ) Curve2d = ProjectCurve( myLinCont->Value(i)->Curve3d() );
myTolU,myTolV);
Ok = Standard_True;
- for (i = 1; i <= NTLinCont; i++)
+ for (Standard_Integer i = 1; i <= NTLinCont; i++)
{
Handle( Geom2d_Curve ) Curve2d = ProjectCurve( myLinCont->Value(i)->Curve3d() );
if (Curve2d.IsNull())
mySurfInit = myPlanarSurfInit;
mySurfInit->Bounds(u1,v1,u2,v2);
- GeomAdaptor_Surface Surf(mySurfInit);
- myTolU = Surf.UResolution(myTol3d);
- myTolV = Surf.VResolution(myTol3d);
- myProj.Initialize(Surf,u1,v1,u2,v2,
+ GeomAdaptor_Surface SurfNew(mySurfInit);
+ myTolU = SurfNew.UResolution(myTol3d);
+ myTolV = SurfNew.VResolution(myTol3d);
+ myProj.Initialize(SurfNew,u1,v1,u2,v2,
myTolU,myTolV);
- for (i = 1; i <= NTLinCont; i++)
+ for (Standard_Integer i = 1; i <= NTLinCont; i++)
myLinCont->ChangeValue(i)->
SetCurve2dOnSurf(ProjectCurve( myLinCont->Value(i)->Curve3d() ) );
}
else { // Project the points
- for ( i=1;i<=NTPntCont;i++) {
+ for (Standard_Integer i=1; i<=NTPntCont; i++) {
gp_Pnt P;
myPntCont->Value(i)->D0(P);
myPntCont->ChangeValue(i)->SetPnt2dOnSurf(ProjectPoint(P));
//======================================================================
// Projection des points
//======================================================================
- for ( i=1;i<=NTPntCont;i++) {
+ for (Standard_Integer i=1;i<=NTPntCont;i++) {
if (! myPntCont->Value(i)->HasPnt2dOnSurf()) {
gp_Pnt P;
myPntCont->Value(i)->D0(P);
{ Standard_Real coin;
Standard_Real Tol= 100 * myTol3d;
Standard_Real A1;
- gp_Pnt2d P1,P2;
+ gp_Pnt2d P1temp,P2temp;
gp_Vec2d V1,V2;
- myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1, V1);
- myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2, V2);
+ myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1temp, V1);
+ myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2temp, V2);
A1 = V1.Angle(V2);
if (A1>(M_PI/2))
A1= M_PI - A1;
Standard_Real coin;
Standard_Real Tol= 100 * myTol3d;
Standard_Real A1;
- gp_Pnt2d P1,P2;
+ gp_Pnt2d P1temp,P2temp;
gp_Vec2d V1,V2;
- myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1, V1);
- myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2, V2);
+ myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1temp, V1);
+ myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2temp, V2);
A1 = V1.Angle( V2 );
if (A1 > M_PI/2)
A1= M_PI - A1;
Standard_Integer NTPntCont=myPntCont->Length();
Standard_Integer Tang, i;
// gp_Vec V1,V2,V3,V4,V5,V6,V7,V8,V9,V10;
- gp_Vec V1,V2,V3,V4;
// Chargement des points de contraintes ponctuel
for (i=1;i<=NTPntCont;i++) {
myPlate.Load(PC);
Tang = Min(myPntCont->Value(i)->Order(), OrderMax);
if (Tang==1) {// ==1
+ gp_Vec V1,V2,V3,V4;
myPntCont->Value(i)->D1(PP,V1,V2);
mySurfInit->D1(P2d.Coord(1),P2d.Coord(2),PP,V3,V4);
Plate_D1 D1final(V1.XYZ(),V2.XYZ());
dout << mark;
- for (Standard_Integer i = 2; i<=Nb; i++) {
+ for (Standard_Integer j = 2; j<=Nb; j++) {
dout.Select(id,XX,YY,b);
- Points(i) = gp_Pnt2d( ((Standard_Real)XX)/zoom,
+ Points(j) = gp_Pnt2d( ((Standard_Real)XX)/zoom,
((Standard_Real)YY)/zoom );
- mark = new Draw_Marker2D( Points(i), Draw_X, Draw_vert);
+ mark = new Draw_Marker2D( Points(j), Draw_X, Draw_vert);
dout << mark;
}
}
AppDef_MultiPointConstraint mpc(1,0);
MPC->ChangeArray1().Init(mpc);
for (i=1; i<=ThePoints.Length(); i++) {
- AppDef_MultiPointConstraint mpc(1,0);
- mpc.SetPoint(1, ThePoints.Value(i));
- MPC->SetValue(i, mpc);
+ AppDef_MultiPointConstraint aLocalMpc(1,0);
+ aLocalMpc.SetPoint(1, ThePoints.Value(i));
+ MPC->SetValue(i, aLocalMpc);
}
}
if (!DBs.IsNull())
DBs->FindPole( x, y, d, 5, Index);
else {
- Handle(DrawTrSurf_BezierCurve2d) DBz =
+ Handle(DrawTrSurf_BezierCurve2d) DBz2d =
Handle(DrawTrSurf_BezierCurve2d)::DownCast(D);
- if( !DBz.IsNull())
- DBz->FindPole( x, y, d, 5, Index);
+ if( !DBz2d.IsNull())
+ DBz2d->FindPole( x, y, d, 5, Index);
else {
- Handle(DrawTrSurf_BSplineCurve2d) DBs =
+ Handle(DrawTrSurf_BSplineCurve2d) DBs2d =
Handle(DrawTrSurf_BSplineCurve2d)::DownCast(D);
- if (!DBs.IsNull())
- DBs->FindPole( x, y, d, 5, Index);
+ if (!DBs2d.IsNull())
+ DBs2d->FindPole( x, y, d, 5, Index);
else
return 1;
}
myFEOutLine = myFaceItr1.OutLine ();
myFEInternal = myFaceItr1.Internal ();
myFEDouble = myFaceItr1.Double ();
- HLRBRep_EdgeData* ed = &(myEData(myFE));
+ HLRBRep_EdgeData* EDataFE1 = &(myEData(myFE));
if (!myFEDouble &&
(myFEOri == TopAbs_FORWARD ||
myFEOri == TopAbs_REVERSED)) {
- myFEGeom = &(ed->ChangeGeometry());
- const HLRBRep_Curve& EC = ed->Geometry();
+ myFEGeom = &(EDataFE1->ChangeGeometry());
+ const HLRBRep_Curve& EC = EDataFE1->Geometry();
p = EC.Parameter3d((EC.LastParameter () +
EC.FirstParameter()) / 2);
if (HLRBRep_EdgeFaceTool::UVPoint(p,myFEGeom,iFaceGeom,pu,pv)) {
myFaceItr1.MoreEdge();
myFaceItr1.NextEdge()) {
myFE = myFaceItr1.Edge();
- HLRBRep_EdgeData* ed = &(myEData(myFE));
- if (!fd->Simple()) ed->AutoIntersectionDone(Standard_False);
- HLRAlgo::DecodeMinMax(ed->MinMax(),
+ HLRBRep_EdgeData* EDataFE2 = &(myEData(myFE));
+ if (!fd->Simple()) EDataFE2->AutoIntersectionDone(Standard_False);
+ HLRAlgo::DecodeMinMax(EDataFE2->MinMax(),
(Standard_Address)EdgeMin,
(Standard_Address)EdgeMax);
if (myFaceItr1.BeginningOfWire())
Exp.Next()) {
Standard_Integer ie = Edges.FindIndex(Exp.Current());
if (ie != 0) {
- HLRBRep_EdgeData& ed = DS->EDataArray().ChangeValue(ie);
- if (!ed.Used()) {
- DrawEdge(visible,Standard_False,typ,ed,Result,added,In3d);
- ed.Used(Standard_True);
+ HLRBRep_EdgeData& EDataIE = DS->EDataArray().ChangeValue(ie);
+ if (!EDataIE.Used()) {
+ DrawEdge(visible,Standard_False,typ, EDataIE,Result,added,In3d);
+ EDataIE.Used(Standard_True);
}
}
}
DrawFace(visible,typ,iface,DS,Result,added,In3d);
if (typ >= 3) {
- HLRBRep_EdgeData* ed = &(DS->EDataArray().ChangeValue(e1 - 1));
+ HLRBRep_EdgeData* EDataE11 = &(DS->EDataArray().ChangeValue(e1 - 1));
for (Standard_Integer ie = e1; ie <= e2; ie++) {
- ed++;
- if (!ed->Used()) {
- DrawEdge(visible,Standard_False,typ,*ed,Result,added,In3d);
- ed->Used(Standard_True);
+ EDataE11++;
+ if (!EDataE11->Used()) {
+ DrawEdge(visible,Standard_False,typ,*EDataE11,Result,added,In3d);
+ EDataE11->Used(Standard_True);
}
}
}
*/
//-- ======================================================================
if(nf>2) {
- Standard_Integer i,ir,j,l;
+ Standard_Integer i,ir,k,l;
Standard_Integer rra;
l=(nf>>1)+1;
ir=nf;
}
}
i=l;
- j=l+l;
- while(j<=ir) {
- if(j<ir) {
- if(Val(Index(j)) > Val(Index(j+1)))
- j++;
- else if(Val(Index(j)) == Val(Index(j+1))) {
- if(Size(Index(j)) > Size(Index(j+1)))
- j++;
+ k=l+l;
+ while(k<=ir) {
+ if(k<ir) {
+ if(Val(Index(k)) > Val(Index(k+1)))
+ k++;
+ else if(Val(Index(k)) == Val(Index(k+1))) {
+ if(Size(Index(k)) > Size(Index(k+1)))
+ k++;
}
}
- if(Val(rra) > Val(Index(j))) {
- Index(i)=Index(j);
- i=j;
- j<<=1;
+ if(Val(rra) > Val(Index(k))) {
+ Index(i)=Index(k);
+ i=k;
+ k<<=1;
}
- else if((Val(rra) == Val(Index(j))) && (Size(rra) > Size(Index(j)))) {
- Index(i)=Index(j);
- i=j;
- j<<=1;
+ else if((Val(rra) == Val(Index(k))) && (Size(rra) > Size(Index(k)))) {
+ Index(i)=Index(k);
+ i=k;
+ k<<=1;
}
else {
- j=ir+1;
+ k=ir+1;
}
}
Index(i)=rra;
if (ShapeMap1.Add(E)) {
Standard_Integer e = myEMap.FindIndex(E);
ES(e) = iShell;
- Standard_Integer i = EF.FindIndex(E);
- if (i > 0) {
- TopTools_ListOfShape& LS = EF(i);
+ Standard_Integer anIndexE = EF.FindIndex(E);
+ if (anIndexE > 0) {
+ TopTools_ListOfShape& LS = EF(anIndexE);
InitBiPointsWithConnexity(e,E,List,PID,LS,Standard_True);
}
else {
Nod11Indices = Nod12Indices;
Nod11RValues = Nod12RValues;
i1p2 = Pol1(iPol);
- const Handle(HLRAlgo_PolyInternalNode)* pi1p2 =
+ const Handle(HLRAlgo_PolyInternalNode)* pi1p2iPol =
&(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
- Nod12Indices = (*pi1p2)->Indices();
- Nod12RValues = (*pi1p2)->RValues();
+ Nod12Indices = (*pi1p2iPol)->Indices();
+ Nod12RValues = (*pi1p2iPol)->RValues();
#ifdef OCCT_DEBUG
if (DoError) {
if (Nod11NrmX*Nod12NrmX +
const TColStd_Array1OfInteger& Pol1 = HPol[0]->Nodes();
const TColStd_Array1OfInteger& Pol2 = HPol[1]->Nodes();
const Handle(TColStd_HArray1OfReal)& par = HPol[0]->Parameters();
- Standard_Integer nbPol = Pol1.Upper();
+ Standard_Integer nbPol1 = Pol1.Upper();
Standard_Address TData1 = &pid1->TData();
Standard_Address PISeg1 = &pid1->PISeg();
Standard_Address PINod1 = &pid1->PINod();
&(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(1 )));
Nod11Indices = (*pi1p1)->Indices();
Nod11RValues = (*pi1p1)->RValues();
- const Handle(HLRAlgo_PolyInternalNode)* pi1p2 =
- &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(nbPol)));
- Nod12Indices = (*pi1p2)->Indices();
- Nod12RValues = (*pi1p2)->RValues();
+ const Handle(HLRAlgo_PolyInternalNode)* pi1p2nbPol1 =
+ &(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(nbPol1)));
+ Nod12Indices = (*pi1p2nbPol1)->Indices();
+ Nod12RValues = (*pi1p2nbPol1)->RValues();
const Handle(HLRAlgo_PolyInternalNode)* pi2p1 =
&(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(1 )));
Nod21Indices = (*pi2p1)->Indices();
Nod21RValues = (*pi2p1)->RValues();
const Handle(HLRAlgo_PolyInternalNode)* pi2p2 =
- &(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(nbPol)));
+ &(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(nbPol1)));
Nod22Indices = (*pi2p2)->Indices();
Nod22RValues = (*pi2p2)->RValues();
Nod11Flag |= NMskVert;
Nod21Flag |= NMskVert;
Nod22Flag |= NMskVert;
- for (iPol = 1; iPol <= nbPol; iPol++) {
+ for (iPol = 1; iPol <= nbPol1; iPol++) {
const Handle(HLRAlgo_PolyInternalNode)* pi1pA =
&(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
Standard_Address Nod1AIndices = (*pi1pA)->Indices();
Nod12Flag |= NMskEdge;
Nod22Flag |= NMskEdge;
TIMultiply(XTI2,YTI2,ZTI2);
- if (Pol1(1) == Pol1(nbPol) && myPC.IsPeriodic())
+ if (Pol1(1) == Pol1(nbPol1) && myPC.IsPeriodic())
U2 = U2 - myPC.Period();
- if (nbPol == 2 && BRep_Tool::Degenerated(E)) {
+ if (nbPol1 == 2 && BRep_Tool::Degenerated(E)) {
CheckDegeneratedSegment(Nod11Indices,Nod11RValues,
Nod12Indices,Nod12RValues);
CheckDegeneratedSegment(Nod21Indices,Nod21RValues,
Nod22Indices,Nod22RValues);
UpdateAroundNode(Pol1(1 ),Nod11Indices,TData1,PISeg1,PINod1);
- UpdateAroundNode(Pol1(nbPol),Nod12Indices,TData1,PISeg1,PINod1);
+ UpdateAroundNode(Pol1(nbPol1),Nod12Indices,TData1,PISeg1,PINod1);
UpdateAroundNode(Pol2(1 ),Nod21Indices,TData2,PISeg2,PINod2);
- UpdateAroundNode(Pol2(nbPol),Nod22Indices,TData2,PISeg2,PINod2);
+ UpdateAroundNode(Pol2(nbPol1),Nod22Indices,TData2,PISeg2,PINod2);
}
else {
- for (iPol = 2; iPol <= nbPol; iPol++) {
+ for (iPol = 2; iPol <= nbPol1; iPol++) {
i1p1 = i1p2;
Nod11Indices = Nod12Indices;
Nod11RValues = Nod12RValues;
Nod21Indices = Nod22Indices;
Nod21RValues = Nod22RValues;
i1p2 = Pol1(iPol);
- const Handle(HLRAlgo_PolyInternalNode)* pi1p2 =
+ const Handle(HLRAlgo_PolyInternalNode)* pi1p2iPol =
&(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
- Nod12Indices = (*pi1p2)->Indices();
- Nod12RValues = (*pi1p2)->RValues();
+ Nod12Indices = (*pi1p2iPol)->Indices();
+ Nod12RValues = (*pi1p2iPol)->RValues();
i2p2 = Pol2(iPol);
- const Handle(HLRAlgo_PolyInternalNode)* pi2p2 =
+ const Handle(HLRAlgo_PolyInternalNode)* pi2p2iPol =
&(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(iPol)));
- Nod22Indices = (*pi2p2)->Indices();
- Nod22RValues = (*pi2p2)->RValues();
+ Nod22Indices = (*pi2p2iPol)->Indices();
+ Nod22RValues = (*pi2p2iPol)->RValues();
#ifdef OCCT_DEBUG
if (DoError) {
if (Nod11NrmX*Nod12NrmX +
TTMa[2][0] = ttma.Value(3,1);
TTMa[2][1] = ttma.Value(3,2);
TTMa[2][2] = ttma.Value(3,3);
- Standard_Integer nbPol = Pol.Upper();
+ Standard_Integer nbPol1 = Pol.Upper();
const gp_XYZ& P1 = Pol(1).XYZ();
X2 = P1.X();
Y2 = P1.Y();
ZTI2 = Z2;
TIMultiply(XTI2,YTI2,ZTI2);
- for (Standard_Integer iPol = 2; iPol <= nbPol; iPol++) {
+ for (Standard_Integer jPol = 2; jPol <= nbPol1; jPol++) {
X1 = X2;
Y1 = Y2;
Z1 = Z2;
XTI1 = XTI2;
YTI1 = YTI2;
ZTI1 = ZTI2;
- const gp_XYZ& P2 = Pol(iPol).XYZ();
+ const gp_XYZ& P2 = Pol(jPol).XYZ();
X2 = P2.X();
Y2 = P2.Y();
Z2 = P2.Z();
continue;
ne++;
Standard_Integer ie = EM.FindIndex(E);
- TopAbs_Orientation orient = E.Orientation();
+ TopAbs_Orientation anOrientE = E.Orientation();
Standard_Boolean Int = TopDS.IsIntLFaceEdge(F,E);
Standard_Boolean Iso = TopDS.IsIsoLFaceEdge(F,E);
Standard_Boolean Out = TopDS.IsOutLFaceEdge(F,E);
Standard_Boolean Dbl = BRepTools::IsReallyClosed(TopoDS::Edge(E),theFace);
- fd.SetWEdge(nw, ne, ie, orient, Out, Int, Dbl, Iso);
+ fd.SetWEdge(nw, ne, ie, anOrientE, Out, Int, Dbl, Iso);
}
}
DS->FaceMap().Add(theFace);
if (typ >= 3) {
iCB = 1;
e2 = 0;
- HLRBRep_EdgeData* ed = &(DS->EDataArray().ChangeValue(0));
- ed++;
+ HLRBRep_EdgeData* anEdgeData = &(DS->EDataArray().ChangeValue(0));
+ anEdgeData++;
- for (Standard_Integer ie = 1; ie <= ne; ie++) {
- if (!ed->Used()) {
- DrawEdge(D,Standard_False,typ,nCB,ie,e2,iCB,*ed);
- ed->Used(Standard_True);
+ for (Standard_Integer i = 1; i <= ne; i++) {
+ if (!anEdgeData->Used()) {
+ DrawEdge(D,Standard_False,typ,nCB,i,e2,iCB,*anEdgeData);
+ anEdgeData->Used(Standard_True);
}
- ed++;
+ anEdgeData++;
}
}
}
B.Range(E,first,last);
if (!C2d.IsNull()) {
- BRep_Builder B;
B.UpdateEdge(E,C2d,F,BRep_Tool::Tolerance(F));
}
for (Standard_Integer IDom = 1; IDom <= NbDom; IDom++) {
const HatchGen_Domain& Dom = Hatcher.Domain (IndH, IDom);
- Standard_Real U1 = Dom.HasFirstPoint() ?
+ Standard_Real U11 = Dom.HasFirstPoint() ?
Dom.FirstPoint().Parameter() : VMin - Infinite;
- Standard_Real U2 = Dom.HasSecondPoint() ?
+ Standard_Real U21 = Dom.HasSecondPoint() ?
Dom.SecondPoint().Parameter() : VMax + Infinite;
- IsoLine->D0 (U1, P);
+ IsoLine->D0 (U11, P);
Surface.D0 (P.X(), P.Y(), P1);
- IsoLine->D0 (U2, P);
+ IsoLine->D0 (U21, P);
Surface.D0 (P.X(), P.Y(), P2);
if (Dom.HasFirstPoint()) { // Iso U - Premier point
const HatchGen_PointOnHatching& PntH = Dom.FirstPoint();
}
if(!V1U.IsNull() && !V2U.IsNull())
HLRTopoBRep_FaceIsoLiner::MakeIsoLine
- (F,IsoLine,V1U,V2U,U1,U2,Tolerance,DS);
+ (F,IsoLine,V1U,V2U,U11,U21,Tolerance,DS);
}
}
for (Standard_Integer IDom = 1; IDom <= NbDom; IDom++) {
const HatchGen_Domain& Dom = Hatcher.Domain (IndH, IDom);
- Standard_Real U1 = Dom.HasFirstPoint() ?
+ Standard_Real U12 = Dom.HasFirstPoint() ?
Dom.FirstPoint().Parameter() : VMin - Infinite;
- Standard_Real U2 = Dom.HasSecondPoint() ?
+ Standard_Real U22 = Dom.HasSecondPoint() ?
Dom.SecondPoint().Parameter() : VMax + Infinite;
- IsoLine->D0 (U1, P);
+ IsoLine->D0 (U12, P);
Surface.D0 (P.X(), P.Y(), P1);
- IsoLine->D0 (U2, P);
+ IsoLine->D0 (U22, P);
Surface.D0 (P.X(), P.Y(), P2);
if (Dom.HasFirstPoint()) { // Iso V - Premier point
const HatchGen_PointOnHatching& PntH = Dom.FirstPoint();
}
if(!V1V.IsNull() && !V2V.IsNull())
HLRTopoBRep_FaceIsoLiner::MakeIsoLine
- (F,IsoLine,V1V,V2V,U1,U2,Tolerance,DS);
+ (F,IsoLine,V1V,V2V,U12,U22,Tolerance,DS);
}
}
IFSelect_SessionDumper::IFSelect_SessionDumper ()
{
- Handle(IFSelect_BasicDumper) bid;
if (!cefait)
{ cefait = 1; Handle(IFSelect_BasicDumper) bid = new IFSelect_BasicDumper; }
else thenext = thefirst;
{
theSTool->AddShape( aSimpleShape, Standard_False, Standard_False );
TopoDS_Compound aNewShape;
- BRep_Builder aB;
aB.MakeCompound(aNewShape);
aB.Add(aNewShape, aSimpleShape);
aB.Add(aNewShape,aCompShape);
cout << "Warning: IGESToBRep_IGESBoundary: Curves " << i - 1 << " and " << i << " cannot be connected" << endl;
#endif
Gsewd3d = new ShapeExtend_WireData;
- for (Standard_Integer i = 1; i <= len3d; i++) {
+ for (Standard_Integer j = 1; j <= len3d; j++) {
if (usescurve)
- Gsewd3d->Add (scurve3d->Edge (i));
+ Gsewd3d->Add (scurve3d->Edge (j));
else {
TopoDS_Shape Sh =
- TC.TransferTopoCurve (Handle(IGESData_IGESEntity)::DownCast (seq3d->Value (i)));
+ TC.TransferTopoCurve (Handle(IGESData_IGESEntity)::DownCast (seq3d->Value (j)));
if (!Sh.IsNull()) Gsewd3d->Add (Sh);
}
}
ReverseCurves3d(Gsewd3d);
}
Gsewd2d = new ShapeExtend_WireData;
- for (Standard_Integer i = 1; i <= len2d; i++) {
- TopoDS_Shape Sh = TC.Transfer2dTopoCurve (Handle(IGESData_IGESEntity)::DownCast (seq2d->Value (i)),
+ for (Standard_Integer k = 1; k <= len2d; k++) {
+ TopoDS_Shape Sh = TC.Transfer2dTopoCurve (Handle(IGESData_IGESEntity)::DownCast (seq2d->Value (k)),
myface, mytrsf, myuFact);
if (!Sh.IsNull()) Gsewd2d->Add (Sh);
}
XPoly = st->XPolynomial(USeg, VSeg);
YPoly = st->YPolynomial(USeg, VSeg);
ZPoly = st->ZPolynomial(USeg, VSeg);
- Standard_Real ParamU, ParamV;
ParamU = 1.;
for (i=Coef.LowerRow(); i<=Coef.UpperRow(); i++) {
ParamV = 1.;
PLib::CoefficientsPoles(Coef,PLib::NoWeights2(),BzPole,PLib::NoWeights2());
// C0 check and correction for poles lying on isoparametrics U=0 & V=0
- Standard_Integer iBs = BsPole.LowerRow() + (USeg-1)*DegreeU;
- Standard_Integer jBs = BsPole.LowerCol();
+ Standard_Integer iBsPole = BsPole.LowerRow() + (USeg-1)*DegreeU;
+ Standard_Integer jBsPole = BsPole.LowerCol();
iBz = BzPole.LowerRow();
for (jBz=BzPole.LowerCol(); jBz<=BzPole.UpperCol(); jBz++) {
- if (!BzPole.Value(iBz,jBz).IsEqual(BsPole.Value(iBs,jBs), epsgeom)) {
+ if (!BzPole.Value(iBz,jBz).IsEqual(BsPole.Value(iBsPole,jBsPole), epsgeom)) {
wasC0=Standard_False;
gp_Pnt MidPoint;
Standard_Real XCoord =
- 0.5 * (BzPole.Value(iBz,jBz).X() + BsPole.Value(iBs,jBs).X());
+ 0.5 * (BzPole.Value(iBz,jBz).X() + BsPole.Value(iBsPole,jBsPole).X());
Standard_Real YCoord =
- 0.5 * (BzPole.Value(iBz,jBz).Y() + BsPole.Value(iBs,jBs).Y());
+ 0.5 * (BzPole.Value(iBz,jBz).Y() + BsPole.Value(iBsPole,jBsPole).Y());
Standard_Real ZCoord =
- 0.5 * (BzPole.Value(iBz,jBz).Z() + BsPole.Value(iBs,jBs).Z());
+ 0.5 * (BzPole.Value(iBz,jBz).Z() + BsPole.Value(iBsPole,jBsPole).Z());
MidPoint.SetCoord(XCoord, YCoord, ZCoord);
- BsPole.SetValue(iBs, jBs++, MidPoint);
+ BsPole.SetValue(iBsPole, jBsPole++, MidPoint);
}
else {
- BsPole.SetValue(iBs, jBs++, BzPole.Value(iBz,jBz));
+ BsPole.SetValue(iBsPole, jBsPole++, BzPole.Value(iBz,jBz));
}
}
// Other poles (no check about C0) :
- iBs++;
- jBs = BsPole.LowerCol();
+ iBsPole++;
+ jBsPole = BsPole.LowerCol();
for (iBz=BzPole.LowerRow()+1; iBz<=BzPole.UpperRow(); iBz++) {
for (jBz=BzPole.LowerCol(); jBz<=BzPole.UpperCol(); jBz++)
- BsPole.SetValue(iBs, jBs++, BzPole.Value(iBz,jBz));
- iBs++;
- jBs = BsPole.LowerCol();
+ BsPole.SetValue(iBsPole, jBsPole++, BzPole.Value(iBz,jBz));
+ iBsPole++;
+ jBsPole = BsPole.LowerCol();
}
}
XPoly = st->XPolynomial(USeg, VSeg);
YPoly = st->YPolynomial(USeg, VSeg);
ZPoly = st->ZPolynomial(USeg, VSeg);
- Standard_Real ParamU, ParamV;
ParamU = 1.;
for (i=Coef.LowerRow(); i<=Coef.UpperRow(); i++) {
ParamV = 1.;
XPoly = st->XPolynomial(USeg, VSeg);
YPoly = st->YPolynomial(USeg, VSeg);
ZPoly = st->ZPolynomial(USeg, VSeg);
- Standard_Real ParamU, ParamV;
ParamU = 1.;
for (i=Coef.LowerRow(); i<=Coef.UpperRow(); i++) {
ParamV = 1.;
if((!ResultIsAPoint) && (Pos1a!=IntRes2d_Middle || Pos2a!=IntRes2d_Middle)) {
- IntRes2d_Transition T1b,T2b;
if(ProdVectTan>=TOLERANCE_ANGULAIRE) { //&&&&&&&&&&&&&&
T1b.SetValue(Standard_False,Pos1b,IntRes2d_Out);
T2b.SetValue(Standard_False,Pos2b,IntRes2d_In);
PtSeg1.SetValues(ElCLib::Value(U2,L2),U1,U2,T1a,T2a,Standard_False);
if((Pos1b!=IntRes2d_Middle || Pos2b!=IntRes2d_Middle)) {
- IntRes2d_Transition T1b,T2b;
if(ProdVectTan>=TOLERANCE_ANGULAIRE) {
T1b.SetValue(Standard_False,Pos1b,IntRes2d_Out);
T2b.SetValue(Standard_False,Pos2b,IntRes2d_In);
//======================================================================
void IntImpParGen_Intersector::And_Domaine_Objet1_Intersections(const ImpTool& TheImpTool,
- const ParCurve& TheParCurve,
- const IntRes2d_Domain& TheImpCurveDomain,
- const IntRes2d_Domain& TheParCurveDomain,
- Standard_Integer& NbResultats,
- TColStd_Array1OfReal& Inter2_And_Domain2,
- TColStd_Array1OfReal& Inter1,
- TColStd_Array1OfReal& Resultat1,
- TColStd_Array1OfReal& Resultat2,
- const Standard_Real EpsNul) const {
-
-
- Standard_Integer Nb_Bornes_Intersection=NbResultats;
- NbResultats=0;
-
- for(Standard_Integer i=1; i<=Nb_Bornes_Intersection; i+=2) {
- Standard_Real param1=Inter1.Value(i);
- Standard_Real param2=Inter1.Value(i+1);
-
- Standard_Integer indice_1=i;
- Standard_Integer indice_2=i+1;
-
- if(param1>param2) {
- Standard_Real t=param1; param1=param2; param2=t;
- indice_1=i+1;
- indice_2=i;
+ const ParCurve& TheParCurve,
+ const IntRes2d_Domain& TheImpCurveDomain,
+ const IntRes2d_Domain& TheParCurveDomain,
+ Standard_Integer& NbResultats,
+ TColStd_Array1OfReal& Inter2_And_Domain2,
+ TColStd_Array1OfReal& Inter1,
+ TColStd_Array1OfReal& Resultat1,
+ TColStd_Array1OfReal& Resultat2,
+ const Standard_Real EpsNul) const {
+
+
+ Standard_Integer Nb_Bornes_Intersection = NbResultats;
+ NbResultats = 0;
+
+ for (Standard_Integer i = 1; i <= Nb_Bornes_Intersection; i += 2) {
+ Standard_Real param1 = Inter1.Value(i);
+ Standard_Real param2 = Inter1.Value(i + 1);
+
+ Standard_Integer indice_1 = i;
+ Standard_Integer indice_2 = i + 1;
+
+ if (param1>param2) {
+ Standard_Real t = param1; param1 = param2; param2 = t;
+ indice_1 = i + 1;
+ indice_2 = i;
}
- gp_Pnt2d Pt1=TheImpTool.Value(param1);
- gp_Pnt2d Pt2=TheImpTool.Value(param2);
+ gp_Pnt2d Pt1 = TheImpTool.Value(param1);
+ gp_Pnt2d Pt2 = TheImpTool.Value(param2);
gp_Pnt2d Pt;
- Standard_Boolean IsOnTheImpCurveDomain1=Standard_True;
+ Standard_Boolean IsOnTheImpCurveDomain1 = Standard_True;
- Standard_Boolean IsOnTheImpCurveDomain2=Standard_True;
+ Standard_Boolean IsOnTheImpCurveDomain2 = Standard_True;
//--------------------------------------------------------------------
- if(TheImpCurveDomain.HasFirstPoint()) {
- if(param1<TheImpCurveDomain.FirstParameter()) {
- if(Pt1.Distance(TheImpCurveDomain.FirstPoint())
- > TheImpCurveDomain.FirstTolerance()) {
- IsOnTheImpCurveDomain1=Standard_False;
- }
+ if (TheImpCurveDomain.HasFirstPoint()) {
+ if (param1<TheImpCurveDomain.FirstParameter()) {
+ if (Pt1.Distance(TheImpCurveDomain.FirstPoint())
+ > TheImpCurveDomain.FirstTolerance()) {
+ IsOnTheImpCurveDomain1 = Standard_False;
+ }
}
}
- if(IsOnTheImpCurveDomain1 && TheImpCurveDomain.HasLastPoint()) {
- if(param1>TheImpCurveDomain.LastParameter()) {
- if(Pt1.Distance(TheImpCurveDomain.LastPoint())
- > TheImpCurveDomain.FirstTolerance()) {
- IsOnTheImpCurveDomain1=Standard_False;
- }
+ if (IsOnTheImpCurveDomain1 && TheImpCurveDomain.HasLastPoint()) {
+ if (param1>TheImpCurveDomain.LastParameter()) {
+ if (Pt1.Distance(TheImpCurveDomain.LastPoint())
+ > TheImpCurveDomain.FirstTolerance()) {
+ IsOnTheImpCurveDomain1 = Standard_False;
+ }
}
}
//--------------------------------------------------------------------
- if(TheImpCurveDomain.HasFirstPoint()) {
- if(param2<TheImpCurveDomain.FirstParameter()) {
- if(Pt2.Distance(TheImpCurveDomain.FirstPoint())
- > TheImpCurveDomain.FirstTolerance()) {
- IsOnTheImpCurveDomain2=Standard_False;
- }
+ if (TheImpCurveDomain.HasFirstPoint()) {
+ if (param2<TheImpCurveDomain.FirstParameter()) {
+ if (Pt2.Distance(TheImpCurveDomain.FirstPoint())
+ > TheImpCurveDomain.FirstTolerance()) {
+ IsOnTheImpCurveDomain2 = Standard_False;
+ }
}
}
- if(IsOnTheImpCurveDomain2 && TheImpCurveDomain.HasLastPoint()) {
- if(param2>TheImpCurveDomain.LastParameter()) {
- if(Pt2.Distance(TheImpCurveDomain.LastPoint())
- > TheImpCurveDomain.FirstTolerance()) {
- IsOnTheImpCurveDomain2=Standard_False;
- }
+ if (IsOnTheImpCurveDomain2 && TheImpCurveDomain.HasLastPoint()) {
+ if (param2>TheImpCurveDomain.LastParameter()) {
+ if (Pt2.Distance(TheImpCurveDomain.LastPoint())
+ > TheImpCurveDomain.FirstTolerance()) {
+ IsOnTheImpCurveDomain2 = Standard_False;
+ }
}
}
- if(IsOnTheImpCurveDomain1) {
+ if (IsOnTheImpCurveDomain1) {
//------------------------------------------------------------------
//--- la borne 1 est sur le domaine --
NbResultats++;
- Resultat1.SetValue(NbResultats,Inter1.Value(indice_1));
- Resultat2.SetValue(NbResultats,Inter2_And_Domain2.Value(indice_1));
+ Resultat1.SetValue(NbResultats, Inter1.Value(indice_1));
+ Resultat2.SetValue(NbResultats, Inter2_And_Domain2.Value(indice_1));
//--- la borne2 est aussi sur le domaine ---
- if(IsOnTheImpCurveDomain2) {
- NbResultats++;
- Resultat1.SetValue(NbResultats,Inter1.Value(indice_2));
- Resultat2.SetValue(NbResultats,Inter2_And_Domain2.Value(indice_2));
+ if (IsOnTheImpCurveDomain2) {
+ NbResultats++;
+ Resultat1.SetValue(NbResultats, Inter1.Value(indice_2));
+ Resultat2.SetValue(NbResultats, Inter2_And_Domain2.Value(indice_2));
}
else {
- //--- Borne1 sur domaine et Borne 2 Hors Domaine ---
- Standard_Real t;
- NbResultats++;
- t=TheImpCurveDomain.LastParameter();
- Resultat1.SetValue(NbResultats,t);
-// Standard_Real popResult = FindV(t,Pt,TheImpTool,TheParCurve,
-// TheParCurveDomain,
-// Inter2_And_Domain2.Value(indice_1),
-// Inter2_And_Domain2.Value(indice_2),
-// EpsNul);
-//
-// Resultat2.SetValue(NbResultats,popResult);
- Resultat2.SetValue(NbResultats,
- IntImpParGen_Intersector::FindV(t,Pt,TheImpTool,TheParCurve,
- TheParCurveDomain,
- Inter2_And_Domain2.Value(indice_1),
- Inter2_And_Domain2.Value(indice_2),
- EpsNul));
+ //--- Borne1 sur domaine et Borne 2 Hors Domaine ---
+ Standard_Real t;
+ NbResultats++;
+ t = TheImpCurveDomain.LastParameter();
+ Resultat1.SetValue(NbResultats, t);
+ // Standard_Real popResult = FindV(t,Pt,TheImpTool,TheParCurve,
+ // TheParCurveDomain,
+ // Inter2_And_Domain2.Value(indice_1),
+ // Inter2_And_Domain2.Value(indice_2),
+ // EpsNul);
+ //
+ // Resultat2.SetValue(NbResultats,popResult);
+ Resultat2.SetValue(NbResultats,
+ IntImpParGen_Intersector::FindV(t, Pt, TheImpTool, TheParCurve,
+ TheParCurveDomain,
+ Inter2_And_Domain2.Value(indice_1),
+ Inter2_And_Domain2.Value(indice_2),
+ EpsNul));
}
}
else { //======= la borne1 n est pas sur le domaine ========
- if(IsOnTheImpCurveDomain2) {
- Standard_Real t;
- NbResultats++;
- t=TheImpCurveDomain.FirstParameter();
-
- Resultat1.SetValue(NbResultats,t);
- Resultat2.SetValue(NbResultats,
- IntImpParGen_Intersector::FindV(t,Pt,TheImpTool,TheParCurve,
- TheParCurveDomain,
- Inter2_And_Domain2.Value(indice_1),
- Inter2_And_Domain2.Value(indice_2),
- EpsNul));
-
- NbResultats++;
- Resultat1.SetValue(NbResultats,Inter1.Value(indice_2));
- Resultat2.SetValue(NbResultats,Inter2_And_Domain2.Value(indice_2));
+ if (IsOnTheImpCurveDomain2) {
+ Standard_Real t;
+ NbResultats++;
+ t = TheImpCurveDomain.FirstParameter();
+
+ Resultat1.SetValue(NbResultats, t);
+ Resultat2.SetValue(NbResultats,
+ IntImpParGen_Intersector::FindV(t, Pt, TheImpTool, TheParCurve,
+ TheParCurveDomain,
+ Inter2_And_Domain2.Value(indice_1),
+ Inter2_And_Domain2.Value(indice_2),
+ EpsNul));
+
+ NbResultats++;
+ Resultat1.SetValue(NbResultats, Inter1.Value(indice_2));
+ Resultat2.SetValue(NbResultats, Inter2_And_Domain2.Value(indice_2));
}
else { //====== la borne2 et la borne1 sont hors domaine =====
- if(param1<TheImpCurveDomain.FirstParameter()
- && param2>TheImpCurveDomain.LastParameter()) {
- Standard_Real t;
- NbResultats++;
- t=TheImpCurveDomain.FirstParameter();
- Resultat1.SetValue(NbResultats,t);
- Resultat2.SetValue(NbResultats,
- IntImpParGen_Intersector::FindV(t,Pt,TheImpTool,TheParCurve,
- TheParCurveDomain,
- Inter2_And_Domain2.Value(indice_1),
- Inter2_And_Domain2.Value(indice_2),
- EpsNul));
-
-
-
- NbResultats++;
- t=TheImpCurveDomain.LastParameter();
- Resultat1.SetValue(NbResultats,t);
- Resultat2.SetValue(NbResultats,
- IntImpParGen_Intersector::FindV(t,Pt,TheImpTool,TheParCurve,
- TheParCurveDomain,
- Inter2_And_Domain2.Value(indice_1),
- Inter2_And_Domain2.Value(indice_2),
- EpsNul));
-
- }
+ if (param1<TheImpCurveDomain.FirstParameter()
+ && param2>TheImpCurveDomain.LastParameter()) {
+ Standard_Real t;
+ NbResultats++;
+ t = TheImpCurveDomain.FirstParameter();
+ Resultat1.SetValue(NbResultats, t);
+ Resultat2.SetValue(NbResultats,
+ IntImpParGen_Intersector::FindV(t, Pt, TheImpTool, TheParCurve,
+ TheParCurveDomain,
+ Inter2_And_Domain2.Value(indice_1),
+ Inter2_And_Domain2.Value(indice_2),
+ EpsNul));
+
+
+
+ NbResultats++;
+ t = TheImpCurveDomain.LastParameter();
+ Resultat1.SetValue(NbResultats, t);
+ Resultat2.SetValue(NbResultats,
+ IntImpParGen_Intersector::FindV(t, Pt, TheImpTool, TheParCurve,
+ TheParCurveDomain,
+ Inter2_And_Domain2.Value(indice_1),
+ Inter2_And_Domain2.Value(indice_2),
+ EpsNul));
+
+ }
}
}
}
//======================================================================
//-- C o n s t r u c t e u r s e t P e r f o r m
IntImpParGen_Intersector::IntImpParGen_Intersector() {
- done=Standard_False;
+ done = Standard_False;
}
//----------------------------------------------------------------------
//--
IntImpParGen_Intersector::IntImpParGen_Intersector(const ImpTool& TheImpTool,
- const IntRes2d_Domain& TheImpCurveDomain,
- const ParCurve& TheParCurve,
- const IntRes2d_Domain& TheParCurveDomain,
- const Standard_Real TolConf,
- const Standard_Real Tol) {
- Perform(TheImpTool,TheImpCurveDomain,TheParCurve,TheParCurveDomain,TolConf,Tol);
+ const IntRes2d_Domain& TheImpCurveDomain,
+ const ParCurve& TheParCurve,
+ const IntRes2d_Domain& TheParCurveDomain,
+ const Standard_Real TolConf,
+ const Standard_Real Tol) {
+ Perform(TheImpTool, TheImpCurveDomain, TheParCurve, TheParCurveDomain, TolConf, Tol);
}
//----------------------------------------------------------------------
//--
void IntImpParGen_Intersector::Perform(const ImpTool& TheImpTool,
- const IntRes2d_Domain& TheImpCurveDomain,
- const ParCurve& TheParCurve,
- const IntRes2d_Domain& TheParCurveDomain,
- const Standard_Real TolConf,
- const Standard_Real Tol) {
+ const IntRes2d_Domain& TheImpCurveDomain,
+ const ParCurve& TheParCurve,
+ const IntRes2d_Domain& TheParCurveDomain,
+ const Standard_Real TolConf,
+ const Standard_Real Tol) {
- Standard_Integer i,nb_segments_solution, nb_points_solution;
- Standard_Real param1,param2,EpsX, EpsNul, EpsDist;
-
- IntRes2d_Transition Trans1,Trans2;
- gp_Pnt2d pt1,pt2;
- gp_Vec2d Tan1,Tan2,Norm1,Norm2;
- IntRes2d_Position Pos1,Pos2;
+ Standard_Integer i, nb_segments_solution, nb_points_solution;
+ Standard_Real param1, param2, EpsX, EpsNul, EpsDist;
+
+ IntRes2d_Transition Trans1, Trans2;
+ gp_Pnt2d pt1, pt2;
+ gp_Vec2d Tan1, Tan2, Norm1, Norm2;
+ IntRes2d_Position Pos1, Pos2;
//----------------------------------------------
//-- On teste apres appel aux maths si les bornes
//-- des domaines sont des solutions
//--
- Standard_Boolean HeadOnImp =Standard_False;
- Standard_Boolean HeadOnPar =Standard_False;
- Standard_Boolean EndOnImp =Standard_False;
- Standard_Boolean EndOnPar =Standard_False;
+ Standard_Boolean HeadOnImp = Standard_False;
+ Standard_Boolean HeadOnPar = Standard_False;
+ Standard_Boolean EndOnImp = Standard_False;
+ Standard_Boolean EndOnPar = Standard_False;
this->ResetFields();
- IntImpParGen_MyImpParTool TheImpParTool(TheImpTool,TheParCurve);
+ IntImpParGen_MyImpParTool TheImpParTool(TheImpTool, TheParCurve);
- if (! (TheParCurveDomain.HasFirstPoint() &&
- TheParCurveDomain.HasLastPoint())) {
+ if (!(TheParCurveDomain.HasFirstPoint() &&
+ TheParCurveDomain.HasLastPoint())) {
Standard_ConstructionError::Raise("Domaine sur courbe incorrect");
- }
-
+ }
+
Standard_Integer nb_echantillons = ParTool::NbSamples(TheParCurve,
- TheParCurveDomain.FirstParameter(),
- TheParCurveDomain.LastParameter());
+ TheParCurveDomain.FirstParameter(),
+ TheParCurveDomain.LastParameter());
EpsX = EPSX;
- if(EpsX>1.0e-10) EpsX = 1.0e-10;
- EpsNul=(TolConf<=1.0e-10)? 1.0e-10: TolConf;
- EpsDist=(Tol<=1.0e-10)? 1.0e-10: Tol;
-
- Standard_Real Tolerance_Angulaire=EpsDist;
-
+ if (EpsX>1.0e-10) EpsX = 1.0e-10;
+ EpsNul = (TolConf <= 1.0e-10) ? 1.0e-10 : TolConf;
+ EpsDist = (Tol <= 1.0e-10) ? 1.0e-10 : Tol;
+ Standard_Real Tolerance_Angulaire = EpsDist;
- if((TheParCurveDomain.LastParameter() - TheParCurveDomain.FirstParameter()) < 100.0*EpsX) {
+
+
+ if ((TheParCurveDomain.LastParameter() - TheParCurveDomain.FirstParameter()) < 100.0*EpsX) {
EpsX = (TheParCurveDomain.LastParameter() - TheParCurveDomain.FirstParameter())*0.01;
}
- math_FunctionSample Sample2(TheParCurveDomain.FirstParameter(),
- TheParCurveDomain.LastParameter(),
- nb_echantillons);
-
- math_FunctionAllRoots Sol(TheImpParTool,
- Sample2,
- EpsX,
- EpsDist,
- EpsNul);
-
- if(!Sol.IsDone()) {done = Standard_False; return; }
-
- nb_segments_solution=Sol.NbIntervals();
- nb_points_solution=Sol.NbPoints();
-
- //--------------------------------------------------------------------
+ math_FunctionSample Sample2(TheParCurveDomain.FirstParameter(),
+ TheParCurveDomain.LastParameter(),
+ nb_echantillons);
+
+ math_FunctionAllRoots Sol(TheImpParTool,
+ Sample2,
+ EpsX,
+ EpsDist,
+ EpsNul);
+
+ if (!Sol.IsDone()) { done = Standard_False; return; }
+
+ nb_segments_solution = Sol.NbIntervals();
+ nb_points_solution = Sol.NbPoints();
+
+ //--------------------------------------------------------------------
//-- T r a i t e m e n t d e s P o i n t s S o l u t i o n s
- for(i=1; i<=nb_points_solution; i++) {
+ for (i = 1; i <= nb_points_solution; i++) {
gp_Pnt2d Pt;
- param2=Sol.GetPoint(i);
- param1=FindU(param2,Pt,TheParCurve,TheImpTool);
-
- if(TheImpCurveDomain.IsClosed()) {
- param1 = IntImpParGen::NormalizeOnDomain( param1
- ,TheImpCurveDomain);
+ param2 = Sol.GetPoint(i);
+ param1 = FindU(param2, Pt, TheParCurve, TheImpTool);
+
+ if (TheImpCurveDomain.IsClosed()) {
+ param1 = IntImpParGen::NormalizeOnDomain(param1
+ , TheImpCurveDomain);
}
-
- Standard_Boolean IsOnTheImpCurveDomain=Standard_True;
- if(TheImpCurveDomain.HasFirstPoint()) {
- if(param1<TheImpCurveDomain.FirstParameter()) {
- if(Pt.Distance(TheImpCurveDomain.FirstPoint())
- > TheImpCurveDomain.FirstTolerance()) {
- IsOnTheImpCurveDomain=Standard_False;
- }
+
+ Standard_Boolean IsOnTheImpCurveDomain = Standard_True;
+ if (TheImpCurveDomain.HasFirstPoint()) {
+ if (param1<TheImpCurveDomain.FirstParameter()) {
+ if (Pt.Distance(TheImpCurveDomain.FirstPoint())
+ > TheImpCurveDomain.FirstTolerance()) {
+ IsOnTheImpCurveDomain = Standard_False;
+ }
}
}
- if(IsOnTheImpCurveDomain && TheImpCurveDomain.HasLastPoint()) {
- if(param1>TheImpCurveDomain.LastParameter()) {
- if(Pt.Distance(TheImpCurveDomain.LastPoint())
- > TheImpCurveDomain.FirstTolerance()) {
- IsOnTheImpCurveDomain=Standard_False;
- }
+ if (IsOnTheImpCurveDomain && TheImpCurveDomain.HasLastPoint()) {
+ if (param1>TheImpCurveDomain.LastParameter()) {
+ if (Pt.Distance(TheImpCurveDomain.LastPoint())
+ > TheImpCurveDomain.FirstTolerance()) {
+ IsOnTheImpCurveDomain = Standard_False;
+ }
}
}
-
- if(IsOnTheImpCurveDomain) {
- TheImpTool.D2(param1,pt1,Tan1,Norm1);
- ParTool::D2(TheParCurve,param2,pt2,Tan2,Norm2);
-
- IntImpParGen::DeterminePosition(Pos1,TheImpCurveDomain,pt1,param1);
- IntImpParGen::DeterminePosition(Pos2,TheParCurveDomain,pt2,param2);
-
- if(Pos1==IntRes2d_End) EndOnImp = Standard_True;
- else if(Pos1==IntRes2d_Head) HeadOnImp = Standard_True;
- if(Pos2==IntRes2d_End) EndOnPar = Standard_True;
- else if(Pos2==IntRes2d_Head) HeadOnPar = Standard_True;
- IntImpParGen::DetermineTransition(Pos1,Tan1,Norm1,Trans1,
- Pos2,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
+ if (IsOnTheImpCurveDomain) {
+ TheImpTool.D2(param1, pt1, Tan1, Norm1);
+ ParTool::D2(TheParCurve, param2, pt2, Tan2, Norm2);
- IntRes2d_IntersectionPoint IP(pt1,param1,param2
- ,Trans1,Trans2
- ,ReversedParameters());
+ IntImpParGen::DeterminePosition(Pos1, TheImpCurveDomain, pt1, param1);
+ IntImpParGen::DeterminePosition(Pos2, TheParCurveDomain, pt2, param2);
+
+ if (Pos1 == IntRes2d_End) EndOnImp = Standard_True;
+ else if (Pos1 == IntRes2d_Head) HeadOnImp = Standard_True;
+ if (Pos2 == IntRes2d_End) EndOnPar = Standard_True;
+ else if (Pos2 == IntRes2d_Head) HeadOnPar = Standard_True;
+
+ IntImpParGen::DetermineTransition(Pos1, Tan1, Norm1, Trans1,
+ Pos2, Tan2, Norm2, Trans2,
+ Tolerance_Angulaire);
+
+ IntRes2d_IntersectionPoint IP(pt1, param1, param2
+ , Trans1, Trans2
+ , ReversedParameters());
Insert(IP);
}
- }
+ }
//-- F i n d u T r a i t e m e n t d e s P t s S o l.
//-- -->2N segments si la courbe en U est fermee
//--
- TColStd_Array1OfReal Inter2_and_Domaine2(1,2+8*nb_segments_solution);
- TColStd_Array1OfReal Inter1(1,2+8*nb_segments_solution);
+ TColStd_Array1OfReal Inter2_and_Domaine2(1, 2 + 8 * nb_segments_solution);
+ TColStd_Array1OfReal Inter1(1, 2 + 8 * nb_segments_solution);
+
+ Standard_Integer nb_segments_crees = 0;
- Standard_Integer nb_segments_crees=0;
+ for (Standard_Integer j2 = 1, j = 1; j <= nb_segments_solution; j++, j2 += 2) {
+ Standard_Real param2_inf, param2_sup;
+ Standard_Real param1_inf, param1_sup;
+ gp_Pnt2d Ptemp;
- for (Standard_Integer j2=1,j=1;j<=nb_segments_solution;j++,j2+=2) {
- Standard_Real param2_inf,param2_sup;
- Standard_Real param1_inf,param1_sup;
- gp_Pnt2d Ptemp;
-
- Sol.GetInterval(j,param2_inf,param2_sup);
+ Sol.GetInterval(j, param2_inf, param2_sup);
param1_inf=FindU(param2_inf,Ptemp,TheParCurve,TheImpTool);
param1_sup=FindU(param2_sup,Ptemp,TheParCurve,TheImpTool);
//----------------------------------------------------------------------
//-- C o u r b e I m p l i c i t e F e r m e e
- if(TheImpCurveDomain.IsClosed()) {
+ if (TheImpCurveDomain.IsClosed()) {
- gp_Pnt2d Ptemp;
- gp_Vec2d T1,T2,N1,N2;
- Standard_Real param1_origine,param1_fin;
+ gp_Vec2d T1, T2, N1, N2;
+ Standard_Real param1_origine, param1_fin;
- TheImpCurveDomain.EquivalentParameters(param1_origine,param1_fin);
- Standard_Real Periode=param1_fin-param1_origine;
+ TheImpCurveDomain.EquivalentParameters(param1_origine, param1_fin);
+ Standard_Real Periode = param1_fin - param1_origine;
- while(param1_inf<param1_origine) { param1_inf+=Periode; }
- while(param1_sup<param1_origine) { param1_sup+=Periode; }
+ while (param1_inf<param1_origine) { param1_inf += Periode; }
+ while (param1_sup<param1_origine) { param1_sup += Periode; }
ParTool::D2(TheParCurve,param2_inf,Ptemp,T2,N2);
TheImpTool.D2(param1_inf,Ptemp,T1,N1);
- if(T1.Magnitude()<=gp::Resolution()) T1=N1;
- if(T2.Magnitude()<=gp::Resolution()) T2=N2;
+ if (T1.Magnitude() <= gp::Resolution()) T1 = N1;
+ if (T2.Magnitude() <= gp::Resolution()) T2 = N2;
- if(T1.Dot(T2) >=0.0) {
- //--- param1_inf designe un point entrant (et T1 est vers la matiere)
- if(param1_inf>=param1_sup) { param1_sup+=Periode; }
+ if (T1.Dot(T2) >= 0.0) {
+ //--- param1_inf designe un point entrant (et T1 est vers la matiere)
+ if (param1_inf >= param1_sup) { param1_sup += Periode; }
}
else { //--- param1_inf : point sortant (et T1 est Hors matiere)
- if(param1_inf<=param1_sup) { param1_inf+=Periode; }
+ if (param1_inf <= param1_sup) { param1_inf += Periode; }
}
//--- On cree un nouveau segment decale de Periode
//-- Exemple de Pb : Domaine PI/4 PI/2 et intervalle 0,PI
//--
//
- if(TheImpCurveDomain.LastParameter()
- > ((param1_inf>param1_sup)? (param1_sup+Periode):
- (param1_inf+Periode))) {
- Inter2_and_Domaine2.SetValue(j2,param2_inf);
- Inter1.SetValue(j2,param1_inf+Periode);
-
- Inter2_and_Domaine2.SetValue(j2+1,param2_sup);
- Inter1.SetValue(j2+1,param1_sup+Periode);
- j2+=2;
- nb_segments_crees++;
+ if (TheImpCurveDomain.LastParameter()
+ > ((param1_inf>param1_sup) ? (param1_sup + Periode) :
+ (param1_inf + Periode))) {
+ Inter2_and_Domaine2.SetValue(j2, param2_inf);
+ Inter1.SetValue(j2, param1_inf + Periode);
+
+ Inter2_and_Domaine2.SetValue(j2 + 1, param2_sup);
+ Inter1.SetValue(j2 + 1, param1_sup + Periode);
+ j2 += 2;
+ nb_segments_crees++;
}
-
- if(TheImpCurveDomain.FirstParameter()
- <((param1_inf<param1_sup)? (param1_sup-Periode): (param1_inf-Periode))) {
- Inter2_and_Domaine2.SetValue(j2,param2_inf);
- Inter1.SetValue(j2,param1_inf-Periode);
-
- Inter2_and_Domaine2.SetValue(j2+1,param2_sup);
- Inter1.SetValue(j2+1,param1_sup-Periode);
- j2+=2;
- nb_segments_crees++;
+
+ if (TheImpCurveDomain.FirstParameter()
+ <((param1_inf<param1_sup) ? (param1_sup - Periode) : (param1_inf - Periode))) {
+ Inter2_and_Domaine2.SetValue(j2, param2_inf);
+ Inter1.SetValue(j2, param1_inf - Periode);
+
+ Inter2_and_Domaine2.SetValue(j2 + 1, param2_sup);
+ Inter1.SetValue(j2 + 1, param1_sup - Periode);
+ j2 += 2;
+ nb_segments_crees++;
}
}
//-- F i n C o u r b e I m p l i c i t e F e r m e e
//----------------------------------------------------------------------
- Inter2_and_Domaine2.SetValue(j2,param2_inf);
- Inter1.SetValue(j2,param1_inf);
-
- Inter2_and_Domaine2.SetValue(j2+1,param2_sup);
- Inter1.SetValue(j2+1,param1_sup);
- }
-
+ Inter2_and_Domaine2.SetValue(j2, param2_inf);
+ Inter1.SetValue(j2, param1_inf);
+
+ Inter2_and_Domaine2.SetValue(j2 + 1, param2_sup);
+ Inter1.SetValue(j2 + 1, param1_sup);
+ }
+
//------------------------------------------------------------------
//-- INTER2_DOMAINE2 : Intersection AND CurveDomain : Function of PARAM2
//-- INTER1 : Intersection AND CurveDomain : Function of PARAM1
//------------------------------------------------------------------
//--
- TColStd_Array1OfReal Resultat1(1,2+(1+nb_segments_solution)*2);
- TColStd_Array1OfReal Resultat2(1,2+(1+nb_segments_solution)*2);
- nb_segments_solution+=nb_segments_crees;
- Standard_Integer NbResultats=nb_segments_solution*2;
+ TColStd_Array1OfReal Resultat1(1, 2 + (1 + nb_segments_solution) * 2);
+ TColStd_Array1OfReal Resultat2(1, 2 + (1 + nb_segments_solution) * 2);
+ nb_segments_solution += nb_segments_crees;
+ Standard_Integer NbResultats = nb_segments_solution * 2;
And_Domaine_Objet1_Intersections(TheImpTool,
- TheParCurve,
- TheImpCurveDomain,
- TheParCurveDomain,
- NbResultats,
- Inter2_and_Domaine2,Inter1,
- Resultat1,Resultat2,EpsNul);
+ TheParCurve,
+ TheImpCurveDomain,
+ TheParCurveDomain,
+ NbResultats,
+ Inter2_and_Domaine2, Inter1,
+ Resultat1, Resultat2, EpsNul);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//Calcule_Toutes_Transitions(NbResultats,
//~~~~~ D acces aux methodes Protected APPEND
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
- IntRes2d_Position Pos1,Pos2;
- IntRes2d_Transition Trans1,Trans2;
- gp_Vec2d Tan1,Tan2,Norm1,Norm2;
- gp_Pnt2d Pt1_on1,Pt2_on1,Pt1_on2,Pt2_on2;
- Standard_Real Param1_on1,Param2_on1,Param1_on2,Param2_on2;
-
- Standard_Real Dist_Mini_ImpCurve=EPSNUL;
- Standard_Real Tolerance_Angulaire=Dist_Mini_ImpCurve;
-
-
- for(Standard_Integer i=1; i<=NbResultats ; i+=2) {
- Standard_Integer ip1=i+1;
- Standard_Boolean OnlyOnePoint=Standard_False;
-
- Param1_on1=Resultat1.Value(i);
- Param1_on2=Resultat2.Value(i);
- Param2_on1=Resultat1.Value(ip1);
- Param2_on2=Resultat2.Value(ip1);
-
- Pt1_on1=TheImpTool.Value(Param1_on1);
- Pt2_on1=TheImpTool.Value(Param2_on1);
- Pt1_on2=ParTool::Value(TheParCurve,Param1_on2);
- Pt2_on2=ParTool::Value(TheParCurve,Param2_on2);
-
- if(!TheImpCurveDomain.IsClosed()) {
- if( Pt1_on1.Distance(Pt2_on1) <= Dist_Mini_ImpCurve ) {
- if( Pt1_on2.Distance(Pt2_on2) <= Dist_Mini_ImpCurve ) {
- OnlyOnePoint=Standard_True;
- }
- }
- }
-
- Param1_on1=IntImpParGen::NormalizeOnDomain(Param1_on1,TheImpCurveDomain);
- Param1_on2=IntImpParGen::NormalizeOnDomain(Param1_on2,TheParCurveDomain);
+ gp_Pnt2d Pt1_on1, Pt2_on1, Pt1_on2, Pt2_on2;
+ Standard_Real Param1_on1, Param2_on1, Param1_on2, Param2_on2;
+
+ Standard_Real Dist_Mini_ImpCurve = EPSNUL;
+ Standard_Real ToleranceAngulaireDistMini = Dist_Mini_ImpCurve;
+
+
+ for (Standard_Integer k = 1; k <= NbResultats; k += 2) {
+ Standard_Integer ip1 = k + 1;
+ Standard_Boolean OnlyOnePoint = Standard_False;
+
+ Param1_on1 = Resultat1.Value(k);
+ Param1_on2 = Resultat2.Value(k);
+ Param2_on1 = Resultat1.Value(ip1);
+ Param2_on2 = Resultat2.Value(ip1);
+
+ Pt1_on1 = TheImpTool.Value(Param1_on1);
+ Pt2_on1 = TheImpTool.Value(Param2_on1);
+ Pt1_on2 = ParTool::Value(TheParCurve, Param1_on2);
+ Pt2_on2 = ParTool::Value(TheParCurve, Param2_on2);
+
+ if (!TheImpCurveDomain.IsClosed()) {
+ if (Pt1_on1.Distance(Pt2_on1) <= Dist_Mini_ImpCurve) {
+ if (Pt1_on2.Distance(Pt2_on2) <= Dist_Mini_ImpCurve) {
+ OnlyOnePoint = Standard_True;
+ }
+ }
+ }
+
+ Param1_on1 = IntImpParGen::NormalizeOnDomain(Param1_on1, TheImpCurveDomain);
+ Param1_on2 = IntImpParGen::NormalizeOnDomain(Param1_on2, TheParCurveDomain);
TheImpTool.D2(Param1_on1,Pt1_on1,Tan1,Norm1);
ParTool::D2(TheParCurve,Param1_on2,Pt1_on2,Tan2,Norm2);
-
+
IntImpParGen::DeterminePosition(Pos1,TheImpCurveDomain,Pt1_on1,Param1_on1);
IntImpParGen::DeterminePosition(Pos2,TheParCurveDomain,Pt1_on2,Param1_on2);
else if(Pos1==IntRes2d_Head) HeadOnImp = Standard_True;
if(Pos2==IntRes2d_End) EndOnPar = Standard_True;
else if(Pos2==IntRes2d_Head) HeadOnPar = Standard_True;
-
+
IntImpParGen::DetermineTransition(Pos1,Tan1,Norm1,Trans1,
Pos2,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
-
+ ToleranceAngulaireDistMini);
+
//============== Detection du cas : L intersection est en bout
//============== sur les 2 domaines
-
+
if(Pos1!=IntRes2d_Middle && Pos2!=IntRes2d_Middle) {
- Standard_Real m=0.5*(Pt1_on1.X() + Pt1_on2.X());
- Pt1_on1.SetX(m);
- m=0.5*(Pt1_on1.Y() + Pt1_on2.Y());
- Pt1_on1.SetY(m);
+ Standard_Real m = 0.5*(Pt1_on1.X() + Pt1_on2.X());
+ Pt1_on1.SetX(m);
+ m = 0.5*(Pt1_on1.Y() + Pt1_on2.Y());
+ Pt1_on1.SetY(m);
}
IntRes2d_IntersectionPoint new_p1(Pt1_on1
,Trans1,Trans2
,ReversedParameters());
if(!OnlyOnePoint) {
- IntRes2d_IntersectionPoint new_p2;
+ IntRes2d_IntersectionPoint new_p2;
- Param2_on1=IntImpParGen::NormalizeOnDomain(Param2_on1,TheImpCurveDomain);
- Param2_on2=IntImpParGen::NormalizeOnDomain(Param2_on2,TheParCurveDomain);
+ Param2_on1 = IntImpParGen::NormalizeOnDomain(Param2_on1, TheImpCurveDomain);
+ Param2_on2 = IntImpParGen::NormalizeOnDomain(Param2_on2, TheParCurveDomain);
TheImpTool.D2(Param2_on1,Pt2_on1,Tan1,Norm1);
ParTool::D2(TheParCurve,Param2_on2,Pt2_on2,Tan2,Norm2);
-
+
IntImpParGen::DeterminePosition(Pos1,TheImpCurveDomain,Pt2_on1,Param2_on1);
IntImpParGen::DeterminePosition(Pos2,TheParCurveDomain,Pt2_on2,Param2_on2);
-
+
if(Pos1==IntRes2d_End) EndOnImp = Standard_True;
else if(Pos1==IntRes2d_Head) HeadOnImp = Standard_True;
if(Pos2==IntRes2d_End) EndOnPar = Standard_True;
IntImpParGen::DetermineTransition(Pos1,Tan1,Norm1,Trans1,
Pos2,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
-
-
- //============== Detection du cas : L intersection est en bout
- //============== sur les 2 domaines
-
+ ToleranceAngulaireDistMini);
+
+
+ //============== Detection du cas : L intersection est en bout
+ //============== sur les 2 domaines
+
if(Pos1!=IntRes2d_Middle && Pos2!=IntRes2d_Middle) {
- Standard_Real m=0.5*(Pt2_on1.X() + Pt2_on2.X() );
- Pt2_on1.SetX(m);
- m=0.5*(Pt2_on1.Y() + Pt2_on2.Y());
- Pt2_on1.SetY(m);
- }
+ Standard_Real m = 0.5*(Pt2_on1.X() + Pt2_on2.X());
+ Pt2_on1.SetX(m);
+ m = 0.5*(Pt2_on1.Y() + Pt2_on2.Y());
+ Pt2_on1.SetY(m);
+ }
- new_p2.SetValues(Pt2_on1,Param2_on1,Param2_on2
+ new_p2.SetValues(Pt2_on1, Param2_on1, Param2_on2
,Trans1,Trans2
,ReversedParameters());
Standard_Boolean segopposite=((Tan1.Dot(Tan2) < 0.0)?
- Standard_True : Standard_False);
-
- IntRes2d_IntersectionSegment new_seg(new_p1,new_p2
- ,segopposite
- ,ReversedParameters());
- Append(new_seg);
+ Standard_True : Standard_False);
+
+ IntRes2d_IntersectionSegment new_seg(new_p1, new_p2
+ , segopposite
+ , ReversedParameters());
+ Append(new_seg);
}
else {
- Insert(new_p1);
+ Insert(new_p1);
}
}
} //~~~~~~~~~~~~ Fin du corps de la fonction Calc...Transitions~~~~~~~~~~
-
- //-------------------------------------------
- //-- On teste les points en bouts solutions
- //--
- if(!HeadOnImp && TheImpCurveDomain.HasFirstPoint()) {
- if(!HeadOnPar) {
- if(TheImpCurveDomain.FirstPoint().Distance(TheParCurveDomain.FirstPoint())
- <= Max(TheImpCurveDomain.FirstTolerance(),TheParCurveDomain.FirstTolerance())) {
- param1 = TheImpCurveDomain.FirstParameter();
- param2 = TheParCurveDomain.FirstParameter();
- TheImpTool.D2(param1,pt1,Tan1,Norm1);
- ParTool::D2(TheParCurve,param2,pt2,Tan2,Norm2);
- IntImpParGen::DetermineTransition(IntRes2d_Head,Tan1,Norm1,Trans1,
- IntRes2d_Head,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
- IntRes2d_IntersectionPoint IP(TheImpCurveDomain.FirstPoint(),
- param1,param2,
- Trans1,Trans2,
- ReversedParameters());
- Insert(IP);
+
+ //-------------------------------------------
+ //-- On teste les points en bouts solutions
+ //--
+ if (!HeadOnImp && TheImpCurveDomain.HasFirstPoint()) {
+ if (!HeadOnPar) {
+ if (TheImpCurveDomain.FirstPoint().Distance(TheParCurveDomain.FirstPoint())
+ <= Max(TheImpCurveDomain.FirstTolerance(), TheParCurveDomain.FirstTolerance())) {
+ param1 = TheImpCurveDomain.FirstParameter();
+ param2 = TheParCurveDomain.FirstParameter();
+ TheImpTool.D2(param1, pt1, Tan1, Norm1);
+ ParTool::D2(TheParCurve, param2, pt2, Tan2, Norm2);
+ IntImpParGen::DetermineTransition(IntRes2d_Head, Tan1, Norm1, Trans1,
+ IntRes2d_Head, Tan2, Norm2, Trans2,
+ Tolerance_Angulaire);
+ IntRes2d_IntersectionPoint IP(TheImpCurveDomain.FirstPoint(),
+ param1, param2,
+ Trans1, Trans2,
+ ReversedParameters());
+ Insert(IP);
}
}
- if(!EndOnPar) {
- if(TheImpCurveDomain.FirstPoint().Distance(TheParCurveDomain.LastPoint())
- <= Max(TheImpCurveDomain.FirstTolerance(),TheParCurveDomain.LastTolerance())) {
- param1 = TheImpCurveDomain.FirstParameter();
- param2 = TheParCurveDomain.LastParameter();
- TheImpTool.D2(param1,pt1,Tan1,Norm1);
- ParTool::D2(TheParCurve,param2,pt2,Tan2,Norm2);
- IntImpParGen::DetermineTransition(IntRes2d_Head,Tan1,Norm1,Trans1,
- IntRes2d_End ,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
- IntRes2d_IntersectionPoint IP(TheImpCurveDomain.FirstPoint(),
- param1,param2,
- Trans1,Trans2,
- ReversedParameters());
- Insert(IP);
+ if (!EndOnPar) {
+ if (TheImpCurveDomain.FirstPoint().Distance(TheParCurveDomain.LastPoint())
+ <= Max(TheImpCurveDomain.FirstTolerance(), TheParCurveDomain.LastTolerance())) {
+ param1 = TheImpCurveDomain.FirstParameter();
+ param2 = TheParCurveDomain.LastParameter();
+ TheImpTool.D2(param1, pt1, Tan1, Norm1);
+ ParTool::D2(TheParCurve, param2, pt2, Tan2, Norm2);
+ IntImpParGen::DetermineTransition(IntRes2d_Head, Tan1, Norm1, Trans1,
+ IntRes2d_End, Tan2, Norm2, Trans2,
+ Tolerance_Angulaire);
+ IntRes2d_IntersectionPoint IP(TheImpCurveDomain.FirstPoint(),
+ param1, param2,
+ Trans1, Trans2,
+ ReversedParameters());
+ Insert(IP);
}
}
}
-
- if(!EndOnImp && TheImpCurveDomain.HasLastPoint()) {
- if(!HeadOnPar) {
- if(TheImpCurveDomain.LastPoint().Distance(TheParCurveDomain.FirstPoint())
- <= Max(TheImpCurveDomain.LastTolerance(),TheParCurveDomain.FirstTolerance())) {
- param1 = TheImpCurveDomain.LastParameter();
- param2 = TheParCurveDomain.FirstParameter();
- TheImpTool.D2(param1,pt1,Tan1,Norm1);
- ParTool::D2(TheParCurve,param2,pt2,Tan2,Norm2);
- IntImpParGen::DetermineTransition(IntRes2d_End,Tan1,Norm1,Trans1,
- IntRes2d_Head,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
- IntRes2d_IntersectionPoint IP(TheImpCurveDomain.LastPoint(),
- param1,param2,
- Trans1,Trans2,
- ReversedParameters());
- Insert(IP);
+
+ if (!EndOnImp && TheImpCurveDomain.HasLastPoint()) {
+ if (!HeadOnPar) {
+ if (TheImpCurveDomain.LastPoint().Distance(TheParCurveDomain.FirstPoint())
+ <= Max(TheImpCurveDomain.LastTolerance(), TheParCurveDomain.FirstTolerance())) {
+ param1 = TheImpCurveDomain.LastParameter();
+ param2 = TheParCurveDomain.FirstParameter();
+ TheImpTool.D2(param1, pt1, Tan1, Norm1);
+ ParTool::D2(TheParCurve, param2, pt2, Tan2, Norm2);
+ IntImpParGen::DetermineTransition(IntRes2d_End, Tan1, Norm1, Trans1,
+ IntRes2d_Head, Tan2, Norm2, Trans2,
+ Tolerance_Angulaire);
+ IntRes2d_IntersectionPoint IP(TheImpCurveDomain.LastPoint(),
+ param1, param2,
+ Trans1, Trans2,
+ ReversedParameters());
+ Insert(IP);
}
}
- if(!EndOnPar) {
- if(TheImpCurveDomain.LastPoint().Distance(TheParCurveDomain.LastPoint())
- <= Max(TheImpCurveDomain.LastTolerance(),TheParCurveDomain.LastTolerance())) {
- param1 = TheImpCurveDomain.LastParameter();
- param2 = TheParCurveDomain.LastParameter();
- TheImpTool.D2(param1,pt1,Tan1,Norm1);
- ParTool::D2(TheParCurve,param2,pt2,Tan2,Norm2);
- IntImpParGen::DetermineTransition(IntRes2d_End,Tan1,Norm1,Trans1,
- IntRes2d_End,Tan2,Norm2,Trans2,
- Tolerance_Angulaire);
- IntRes2d_IntersectionPoint IP(TheImpCurveDomain.LastPoint(),
- param1,param2,
- Trans1,Trans2,
- ReversedParameters());
- Insert(IP);
+ if (!EndOnPar) {
+ if (TheImpCurveDomain.LastPoint().Distance(TheParCurveDomain.LastPoint())
+ <= Max(TheImpCurveDomain.LastTolerance(), TheParCurveDomain.LastTolerance())) {
+ param1 = TheImpCurveDomain.LastParameter();
+ param2 = TheParCurveDomain.LastParameter();
+ TheImpTool.D2(param1, pt1, Tan1, Norm1);
+ ParTool::D2(TheParCurve, param2, pt2, Tan2, Norm2);
+ IntImpParGen::DetermineTransition(IntRes2d_End, Tan1, Norm1, Trans1,
+ IntRes2d_End, Tan2, Norm2, Trans2,
+ Tolerance_Angulaire);
+ IntRes2d_IntersectionPoint IP(TheImpCurveDomain.LastPoint(),
+ param1, param2,
+ Trans1, Trans2,
+ ReversedParameters());
+ Insert(IP);
}
}
}
- done=Standard_True;
+ done = Standard_True;
}
Standard_Real IntImpParGen_Intersector::FindU(const Standard_Real parameter
- ,gp_Pnt2d& point
- ,const ParCurve& TheParCurve
- ,const ImpTool& TheImpTool) const
+ , gp_Pnt2d& point
+ , const ParCurve& TheParCurve
+ , const ImpTool& TheImpTool) const
{
- point=ParTool::Value(TheParCurve,parameter);
+ point = ParTool::Value(TheParCurve, parameter);
return(TheImpTool.FindParameter(point));
}
Standard_Real IntImpParGen_Intersector::FindV(const Standard_Real parameter
- ,gp_Pnt2d& point
- ,const ImpTool& TheImpTool
- ,const ParCurve& TheParCurve
- ,const IntRes2d_Domain& TheParCurveDomain
- ,const Standard_Real V0
- ,const Standard_Real V1
- ,const Standard_Real Tolerance) const
+ , gp_Pnt2d& point
+ , const ImpTool& TheImpTool
+ , const ParCurve& TheParCurve
+ , const IntRes2d_Domain& TheParCurveDomain
+ , const Standard_Real V0
+ , const Standard_Real V1
+ , const Standard_Real Tolerance) const
{
- point=TheImpTool.Value(parameter);
- if(TheParCurveDomain.IsClosed()) {
+ point = TheImpTool.Value(parameter);
+ if (TheParCurveDomain.IsClosed()) {
Standard_Real V = ProjectOnPCurveTool::FindParameter(TheParCurve,
- point,
- Tolerance);
- return(IntImpParGen::NormalizeOnDomain(V,TheParCurveDomain));
+ point,
+ Tolerance);
+ return(IntImpParGen::NormalizeOnDomain(V, TheParCurveDomain));
}
else {
Standard_Real VV0 = V0;
Standard_Real VV1 = V1;
- if(V1<V0) { VV0 = V1; VV1 = V0; }
+ if (V1<V0) { VV0 = V1; VV1 = V0; }
//-- ??????????????????????????????????????????????????????????????????????
//-- Modif le 15 Septembre 1992 : On Teste le parametre retourne
//--??????????????????????????????????????????????????????????????????????
Standard_Real X = ProjectOnPCurveTool::FindParameter(TheParCurve,
- point,
- VV0,VV1,Tolerance);
- if(X>VV1) X=VV1; else if(X<VV0) X=VV0;
+ point,
+ VV0, VV1, Tolerance);
+ if (X>VV1) X = VV1; else if (X<VV0) X = VV0;
return(X);
}
}
case IntPatch_Analytic :
{
Handle(IntPatch_ALine) alin (Handle(IntPatch_ALine)::DownCast (lin));
- Standard_Boolean ok = alin->FindParameter(Psurf,para);
- if (ok) {
+ Standard_Boolean FindIsOk = alin->FindParameter(Psurf,para);
+ if (FindIsOk) {
pt = alin->Value(para);
dist = Psurf.Distance(pt);
if (dist< distmin) {
// Standard_Real anpara=para;
//#endif
gp_Pnt CopiePsurf=Psurf;
- Standard_Boolean ok=IntersectionWithAnArc(CopiePsurf,alin,para,thearc,theparamonarc,thepointonarc,QuadSurf,lower,upper,dist);
+ Standard_Boolean IntersectIsOk=IntersectionWithAnArc(CopiePsurf,alin,para,thearc,theparamonarc,thepointonarc,QuadSurf,lower,upper,dist);
//--printf("\nIntersectionWithAnArc %d \n Psurf(%g,%g,%g)->(%g,%g,%g) dist=%g\n para(%g)->(%g)\n paraonarc(%g)->(%g)",
//-- ok,Psurf.X(),Psurf.Y(),Psurf.Z(),thepointonarc.X(),thepointonarc.Y(),thepointonarc.Z(),dist,
//-- anpara,para,theparameteronarc,theparamonarc);
dist = CopiePsurf.Distance(Psurf);
- if(ok) {
+ if(IntersectIsOk) {
if(dist<Tol) {
theparameteronarc = theparamonarc;
Psurf = thepointonarc;
if(anError > anErrorPrev)
{//Method diverges. Keep the best result
- const Standard_Real aSinU1 = sin(aMainVarPrev),
- aCosU1 = cos(aMainVarPrev),
- aSinU2 = sin(aU2Prev),
- aCosU2 = cos(aU2Prev);
- aMSum -= (theCoeffs.mVecA1*aCosU1 +
- theCoeffs.mVecB1*aSinU1 +
- theCoeffs.mVecA2*aCosU2 +
- theCoeffs.mVecB2*aSinU2 +
+ const Standard_Real aSinU1Last = sin(aMainVarPrev),
+ aCosU1Last = cos(aMainVarPrev),
+ aSinU2Last = sin(aU2Prev),
+ aCosU2Last = cos(aU2Prev);
+ aMSum -= (theCoeffs.mVecA1*aCosU1Last +
+ theCoeffs.mVecB1*aSinU1Last +
+ theCoeffs.mVecA2*aCosU2Last +
+ theCoeffs.mVecB2*aSinU2Last +
theCoeffs.mVecD);
const Standard_Real aSQNorm = aMSum.Norm2();
return (aSQNorm < aTol2);
{
anU1 = anU1crit[i];
- for(Standard_Integer i = 0; i < aNbWLines; i++)
+ for(Standard_Integer j = 0; j < aNbWLines; j++)
{
- aWLFindStatus[i] = WLFStatus_Broken;
- anUexpect[i] = anU1;
+ aWLFindStatus[j] = WLFStatus_Broken;
+ anUexpect[j] = anU1;
}
break;
if(!CylCylComputeParameters(anUl, i, anEquationCoeffs, anU2t))
continue;
- const Standard_Real aDU = Abs(anU2t - aCurU2);
- if(aDU < aDelta)
+ const Standard_Real aDU2 = Abs(anU2t - aCurU2);
+ if(aDU2 < aDelta)
{
- aDelta = aDU;
+ aDelta = aDU2;
anIndex = i;
}
}
}
const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
- const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
- const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
+ const IntSurf_PntOn2S& aPntFW1 = aWLine1->Point(1);
+ const IntSurf_PntOn2S& aPntLW1 = aWLine1->Point(aNbPntsWL1);
for(Standard_Integer aNPt = 1; aNPt <= theSPnt.Length(); aNPt++)
{
const IntSurf_PntOn2S aPntCur = theSPnt.Value(aNPt).PntOn2S();
- if( aPntCur.IsSame(aPntFWL1, Precision::Confusion()) ||
- aPntCur.IsSame(aPntLWL1, Precision::Confusion()))
+ if( aPntCur.IsSame(aPntFW1, Precision::Confusion()) ||
+ aPntCur.IsSame(aPntLW1, Precision::Confusion()))
{
theSPnt.Remove(aNPt);
aNPt--;
PntInit=NbSamplesV+1;
//To provide recursion I associate a point with three edges
for(Standard_Integer BoucleMeshU=1; BoucleMeshU<NbSamplesU-1; BoucleMeshU++){
- for(Standard_Integer BoucleMeshV=1; BoucleMeshV<NbSamplesV-1;BoucleMeshV++){
+ for(BoucleMeshV=1; BoucleMeshV<NbSamplesV-1;BoucleMeshV++){
TEdges[CpteurTabEdges].SetFirstPoint(PntInit); // U V
TEdges[CpteurTabEdges].SetSecondPoint(PntInit+1); // U V+1
TEdges[CpteurTabEdges].SetFirstTriangle((NbSamplesV-1)*2*(BoucleMeshU-1)+BoucleMeshV*2+1);
//The criterion of refining for surface2 depends on the size of Be1
//As it is known that this criterion should be minimized,
//the smallest side of the bounding box is taken
- Standard_Real x0,x1,y0,y1,z0,z1;
MyBox1.Get(x0,y0,z0,x1,y1,z1);
Standard_Real dx=Abs(x1-x0);
Standard_Real dy=Abs(y1-y0);
//The criterion of refining for surface1 depends on the size of Be2
//As this criterion should be minimized,
//the smallest side of the bounding box is taken
- Standard_Real x0,x1,y0,y1,z0,z1;
MyBox2.Get(x0,y0,z0,x1,y1,z1);
Standard_Real dx=Abs(x1-x0);
Standard_Real dy=Abs(y1-y0);
Milieu.Middle( MySurface,P3, P1);
- gp_Pnt PtXYZ = (MySurface)->Value( Milieu.U(), Milieu.V());
- IntPolyh_Point MilieuReel(PtXYZ.X(), PtXYZ.Y(), PtXYZ.Z(), Milieu.U(), Milieu.V());
+ gp_Pnt PtXYZMilieu = (MySurface)->Value( Milieu.U(), Milieu.V());
+ IntPolyh_Point MilieuReel(PtXYZMilieu.X(), PtXYZMilieu.Y(), PtXYZMilieu.Z(), Milieu.U(), Milieu.V());
Fleche = sqrt(Milieu.SquareDistance(MilieuReel));
}
}
{
Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2;
Standard_Boolean theflag=Standard_False;
- Standard_Integer aNbExt, i, iLower ;
+ Standard_Integer aNbExt, iLower;
aCP.Range1(aTF, aTL);
if(aNbExt > 0) {
iLower=1;
- for (i=1; i<=aNbExt; i++) {
+ for (Standard_Integer i=1; i<=aNbExt; i++) {
aDist2=anExtrema.SquareDistance(i);
if (aDist2 < aMinDist2) {
aMinDist2=aDist2;
anExactIntersector.Perform(aCurve, aSurface);
if(anExactIntersector.IsDone()) {
- Standard_Integer i = 0;
-
- for(i = 1; i <= anExactIntersector.NbPoints(); i++) {
+ for(Standard_Integer i = 1; i <= anExactIntersector.NbPoints(); i++) {
const IntCurveSurface_IntersectionPoint& aPoint = anExactIntersector.Point(i);
if((aPoint.W() >= aTF) && (aPoint.W() <= aTL)) {
degenerated = Standard_True;
for (Standard_Integer i=0; i <= NBSTEPS; i++)
{
- Standard_Real u = pfbid + i * du / NBSTEPS;
- gp_Pnt P3db = C3d.Value (u);
+ Standard_Real U = pfbid + i * du / NBSTEPS;
+ gp_Pnt P3db = C3d.Value (U);
Standard_Real aR2 = P3da.SquareDistance (P3db);
if (aR2 > aPrec2) {
degenerated = Standard_False;
myListOfPnts.Clear(); // to use LineConstructor
}
//
- const Standard_Integer aNbLin = myIntersector.NbLines();
- for (Standard_Integer i=1; i <= aNbLin; ++i) {
+ const Standard_Integer aNbLinIntersector = myIntersector.NbLines();
+ for (Standard_Integer i=1; i <= aNbLinIntersector; ++i) {
MakeCurve(i, dom1, dom2);
}
//
if (bReverse) {
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
- const Standard_Integer aNbLin=mySeqOfCurve.Length();
- for (Standard_Integer i=1; i<=aNbLin; ++i)
+ const Standard_Integer aNbLinSeqOfCurve =mySeqOfCurve.Length();
+ for (Standard_Integer i=1; i<=aNbLinSeqOfCurve; ++i)
{
IntTools_Curve& aIC=mySeqOfCurve(i);
aC2D1=aIC.FirstCurve2d();
theASurf1->D1(theU1, theV1, aPt1, aD1u, aD1v);
theASurf2->D1(theU2, theV2, aPt2, aD2U, aD2V);
- gp_Vec aP12(aPt1, aPt2);
- aGradFu = -aP12.Dot(aD1u);
- aGradFv = -aP12.Dot(aD1v);
- aGradFU = aP12.Dot(aD2U);
- aGradFV = aP12.Dot(aD2V);
+ gp_Vec aPt12(aPt1, aPt2);
+ aGradFu = -aPt12.Dot(aD1u);
+ aGradFv = -aPt12.Dot(aD1v);
+ aGradFU = aPt12.Dot(aD2U);
+ aGradFV = aPt12.Dot(aD2V);
aSTEPuv = theStep0U1V1;
aStepUV = theStep0U2V2;
}
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Append");
if (theval.IsNull()) { theval = ent; return; }
- Handle(Interface_EntityCluster) ec =
+ Handle(Interface_EntityCluster) aValEC =
Handle(Interface_EntityCluster)::DownCast(theval);
- if (!ec.IsNull()) ec->Append(ent); // EntityCluster
+ if (!aValEC.IsNull()) aValEC->Append(ent); // EntityCluster
else { // reste InterfaceEntity ...
Handle(Interface_EntityCluster) ec = new Interface_EntityCluster(theval);
ec->Append(ent);
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Add");
if (theval.IsNull()) { theval = ent; return; }
- Handle(Interface_EntityCluster) ec =
+ Handle(Interface_EntityCluster) aValEC =
Handle(Interface_EntityCluster)::DownCast(theval);
- if (!ec.IsNull()) { // EntityCluster
- if (ec->IsLocalFull()) theval = new Interface_EntityCluster(ent,ec);
- else ec->Append (ent);
+ if (!aValEC.IsNull()) { // EntityCluster
+ if (aValEC->IsLocalFull()) theval = new Interface_EntityCluster(ent, aValEC);
+ else aValEC->Append (ent);
} else { // reste InterfaceEntity ...
Handle(Interface_EntityCluster) ec = new Interface_EntityCluster(theval);
ec->Append(ent);
InsertKnots( Knots, Mults, Eps);
if (periodic) { // set the origine at NewU1
- Standard_Integer index = 0;
+ Standard_Integer index0 = 0;
BSplCLib::LocateParameter(deg,knots->Array1(),mults->Array1(),
U1,periodic,knots->Lower(),knots->Upper(),
- index,U);
- if ( Abs(knots->Value(index+1)-U) < Eps)
- index++;
- SetOrigin(index);
+ index0,U);
+ if ( Abs(knots->Value(index0+1)-U) < Eps)
+ index0++;
+ SetOrigin(index0);
SetNotPeriodic();
}
while (!(mapV.Contains(VL) || Bords.Contains(VL))) {
Standard_Integer ind = theMapVE.FindIndex(VL);
- TopTools_ListIteratorOfListOfShape itl(theMapVE(ind));
- for (; itl.More(); itl.Next()) {
- if (!mapE.Contains(itl.Value())) {
+ TopTools_ListIteratorOfListOfShape anIterl(theMapVE(ind));
+ for (; anIterl.More(); anIterl.Next()) {
+ if (!mapE.Contains(anIterl.Value())) {
break;
}
}
- if (!itl.More()) {
+ if (!anIterl.More()) {
Standard_ConstructionError::Raise();
}
- const TopoDS_Edge& theEdge = TopoDS::Edge(itl.Value());
+ const TopoDS_Edge& theEdge = TopoDS::Edge(anIterl.Value());
TopoDS_Vertex Vf,Vl;
TopExp::Vertices(theEdge,Vf,Vl);
mapV.Add(VL);
}
}
orface = exp.Current().Orientation();
- TopoDS_Shape aLocalFace = fac.EmptyCopied();
- newface = TopoDS::Face(aLocalFace);
+ TopoDS_Shape aLocalFaceEmptyCopied = fac.EmptyCopied();
+ newface = TopoDS::Face(aLocalFaceEmptyCopied);
// newface = TopoDS::Face(fac.EmptyCopied());
newface.Orientation(TopAbs_FORWARD);
S = BRep_Tool::Surface(fac);
includeinw = Standard_True;
}
else {
- Standard_Boolean includeinw = Standard_False;
+ Standard_Boolean isIncludedInW = Standard_False;
if (exp2.More()) {
for (exp2.ReInit(); exp2.More(); exp2.Next()) {
if (!toRemove.Contains(exp2.Current())) {
exp4.More(); exp4.Next()) {
if (exp4.Current().IsSame(VF) ||
exp4.Current().IsSame(VL)) {
- includeinw = Standard_True;
+ isIncludedInW = Standard_True;
break;
}
}
- if (includeinw) {
+ if (isIncludedInW) {
break;
}
}
if (myIsTrans) {
// m-a-j des descendants
- TopExp_Explorer exp;
- for (exp.Init(myBase,TopAbs_EDGE);exp.More();exp.Next()) {
- const TopoDS_Edge& edg = TopoDS::Edge(exp.Current());
+ TopExp_Explorer anExp;
+ for (anExp.Init(myBase,TopAbs_EDGE); anExp.More(); anExp.Next()) {
+ const TopoDS_Edge& edg = TopoDS::Edge(anExp.Current());
const TopoDS_Edge& edgbis = TopoDS::Edge(Modif.ModifiedShape(edg));
if (!edgbis.IsSame(edg) && myMap.IsBound(edgbis)) {
myMap.Bind(edg,myMap(edgbis));
if (myIsTrans) {
// m-a-j des descendants
- TopExp_Explorer exp;
- for (exp.Init(myBase,TopAbs_EDGE);exp.More();exp.Next()) {
- const TopoDS_Edge& edg = TopoDS::Edge(exp.Current());
+ TopExp_Explorer anExp;
+ for (anExp.Init(myBase,TopAbs_EDGE); anExp.More(); anExp.Next()) {
+ const TopoDS_Edge& edg = TopoDS::Edge(anExp.Current());
const TopoDS_Edge& edgbis = TopoDS::Edge(Modif.ModifiedShape(edg));
if (!edgbis.IsSame(edg) && myMap.IsBound(edgbis)) {
myMap.Bind(edg,myMap(edgbis));
if (myIsTrans) {
// m-a-j des descendants
- TopExp_Explorer exp;
- for (exp.Init(myBase,TopAbs_EDGE);exp.More();exp.Next()) {
- const TopoDS_Edge& edg = TopoDS::Edge(exp.Current());
+ TopExp_Explorer anExp;
+ for (anExp.Init(myBase,TopAbs_EDGE); anExp.More(); anExp.Next()) {
+ const TopoDS_Edge& edg = TopoDS::Edge(anExp.Current());
const TopoDS_Edge& edgbis = TopoDS::Edge(Modif.ModifiedShape(edg));
if (!edgbis.IsSame(edg) && myMap.IsBound(edgbis)) {
myMap.Bind(edg,myMap(edgbis));
if (myIsTrans) {
// m-a-j des descendants
- TopExp_Explorer exp;
- for (exp.Init(myBase,TopAbs_EDGE);exp.More();exp.Next()) {
- const TopoDS_Edge& edg = TopoDS::Edge(exp.Current());
+ TopExp_Explorer anExp;
+ for (anExp.Init(myBase,TopAbs_EDGE); anExp.More(); anExp.Next()) {
+ const TopoDS_Edge& edg = TopoDS::Edge(anExp.Current());
const TopoDS_Edge& edgbis = TopoDS::Edge(Modif.ModifiedShape(edg));
if (!edgbis.IsSame(edg) && myMap.IsBound(edgbis)) {
myMap.Bind(edg,myMap(edgbis));
while (!alldone) {
TopoDS_Wire Wnew;
B.MakeWire(Wnew);
- TopoDS_Shape aLocalShape = ledg.First();
- const TopoDS_Edge& edg = TopoDS::Edge(aLocalShape);
+ TopoDS_Shape aLocalShapeCur = ledg.First();
+ const TopoDS_Edge& edg = TopoDS::Edge(aLocalShapeCur);
// const TopoDS_Edge& edg = TopoDS::Edge(ledg.First());
TopoDS_Vertex VFirst,VLast;
if (edg.Orientation() == TopAbs_FORWARD) {
TopoDS_Edge aNextEdge;
if (nbPoss == 1) {
aNextEdge = TopoDS::Edge (PossE.FindKey (1));
- TopoDS_Shape aLocalFace = FaceRef.Oriented(wfirst.Orientation());
+ TopoDS_Shape aLocalFaceTemp = FaceRef.Oriented(wfirst.Orientation());
C2d = BRep_Tool::CurveOnSurface(aNextEdge,
- TopoDS::Face(aLocalFace), f, l);
- Standard_Real dpar = (l - f)*0.01;
+ TopoDS::Face(aLocalFaceTemp), f, l);
+ Standard_Real dparnew = (l - f)*0.01;
if (aNextEdge.Orientation() == TopAbs_FORWARD) {
C2d->D1(l,plast,dlast);
if (dlast.Magnitude() < gp::Resolution())
{
- gp_Pnt2d PrevPnt = C2d->Value(l - dpar);
+ gp_Pnt2d PrevPnt = C2d->Value(l - dparnew);
dlast.SetXY(plast.XY() - PrevPnt.XY());
}
}
C2d->D1(f,plast,dlast);
if (dlast.Magnitude() < gp::Resolution())
{
- gp_Pnt2d NextPnt = C2d->Value(f + dpar);
+ gp_Pnt2d NextPnt = C2d->Value(f + dparnew);
dlast.SetXY(NextPnt.XY() - plast.XY());
}
dlast.Reverse();
}
else if (nbPoss > 1) {
// Faire choix en U,V...
- TopoDS_Shape aLocalFace = FaceRef.Oriented(wfirst.Orientation());
+ TopoDS_Shape aLocalFaceTemp = FaceRef.Oriented(wfirst.Orientation());
- ChoixUV(LastEdge, TopoDS::Face(aLocalFace), PossE,
+ ChoixUV(LastEdge, TopoDS::Face(aLocalFaceTemp), PossE,
aNextEdge, plast, dlast, toll);
}
EA1 = Elt1->EndArc();
if ( EA1 != SA1 ) {
- Handle(MAT_BasicElt) E1 = EA1->FirstElement ();
- Handle(MAT_BasicElt) E2 = EA1->SecondElement();
- Handle(MAT_BasicElt) E3 = SA1->FirstElement ();
- Handle(MAT_BasicElt) E4 = SA1->SecondElement();
+ E1 = EA1->FirstElement ();
+ E2 = EA1->SecondElement();
+ E3 = SA1->FirstElement ();
+ E4 = SA1->SecondElement();
Standard_Boolean OnFig = (EA1->FirstNode() ->OnBasicElt() ||
EA1->SecondNode()->OnBasicElt() ||
}
}
}
-
+
// check of free nodes
Standard_Integer aNbNodes = aT->NbNodes();
- for (Standard_Integer i = 1; i <= aNbNodes; i++)
- if ( ! aUsedNodes.Contains(i) )
+ for (Standard_Integer k = 1; k <= aNbNodes; k++)
+ if ( ! aUsedNodes.Contains(k) )
{
myFreeNodeFaces.Append (iF);
- myFreeNodeNums.Append (i);
+ myFreeNodeNums.Append (k);
}
}
}
Standard_Integer anUpper = anIndices.Upper();
Standard_Integer aPrevNode = -1;
- for (Standard_Integer i = aLower; i <= anUpper; ++i)
+ for (Standard_Integer j = aLower; j <= anUpper; ++j)
{
- Standard_Integer aNodeIdx = anIndices.Value(i);
- if (i != aLower)
+ Standard_Integer aNodeIdx = anIndices.Value(j);
+ if (j != aLower)
{
BRepMesh_Edge aLink(aPrevNode, aNodeIdx, BRepMesh_Frontier);
aBoundaryEdgeMap.Add(aLink);
const Poly_Triangle& aTri = aTris(aTriIndx);
Standard_Integer aTriNodes[3] = { aTri.Value(1), aTri.Value(2), aTri.Value(3)};
- for (Standard_Integer i = 1; i <= 3; ++i)
+ for (Standard_Integer j = 1; j <= 3; ++j)
{
- Standard_Integer aLastId = aTriNodes[i % 3];
- Standard_Integer aFirstId = aTriNodes[i - 1];
+ Standard_Integer aLastId = aTriNodes[j % 3];
+ Standard_Integer aFirstId = aTriNodes[j - 1];
BRepMesh_Edge aLink(aFirstId, aLastId, BRepMesh_Free);
if (!aBoundaryEdgeMap.Contains(aLink))
Quantity_Color aNColor;
Standard_Boolean isValid = Standard_True;
- Standard_Integer i;
if (myUseTexture)
{
- for (i = 1; i <= NbNodes && isValid; ++i)
- isValid = myTextureCoords.IsBound (aNodes (i));
+ for (Standard_Integer k = 1; k <= NbNodes && isValid; ++k)
+ isValid = myTextureCoords.IsBound (aNodes (k));
}
else
{
- for (i = 1; i <= NbNodes && isValid; ++i)
- isValid = GetColor (aNodes (i), aNColor);
+ for (Standard_Integer k = 1; k <= NbNodes && isValid; ++k)
+ isValid = GetColor (aNodes (k), aNColor);
}
if (!isValid)
Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
- const Standard_ShortReal aDelta = 0.1f;
NCollection_Vec4<Standard_Real> aColor (Standard_Real (theColor.rgb[0]),
Standard_Real (theColor.rgb[1]),
Standard_Real (theColor.rgb[2]),
}
case Aspect_TOM_BALL:
{
- const Standard_ShortReal aDelta = 0.1f;
NCollection_Vec4<Standard_Real> aColor (Standard_Real (theColor.rgb[0]),
Standard_Real (theColor.rgb[1]),
Standard_Real (theColor.rgb[2]),
}
if(theDocument.IsNull()) {
- Standard_SStream aMsg;
- aMsg << "could not find any document in this file" << (char) 0;
+ Standard_SStream anErrorMsg;
+ anErrorMsg << "could not find any document in this file" << (char) 0;
myReaderStatus = PCDM_RS_NoDocument;
- Standard_Failure::Raise(aMsg);
+ Standard_Failure::Raise(anErrorMsg);
}
Handle(Standard_Persistent) theObject=theDocument->Object();
Handle(PCDM_Document) thePDocument = Handle(PCDM_Document)::DownCast (theObject);
{
//Search for exact boundary point
Tol = Min(myTolU, myTolV);
- gp_Vec2d D;
- d1(Triple.X(), Triple.Y(), Triple.Z(), D, myCurve, mySurface);
- Tol /= Max(Abs(D.X()), Abs(D.Y()));
+ gp_Vec2d aD;
+ d1(Triple.X(), Triple.Y(), Triple.Z(), aD, myCurve, mySurface);
+ Tol /= Max(Abs(aD.X()), Abs(aD.Y()));
if(!ExactBound(Triple, t - Step, Tol,
myTolU, myTolV, myCurve, mySurface))
for(i = 1; i <= myNbCurves; i++)
for(j = 1; j <= mySequence->Value(i)->Length(); j++)
{
- gp_Pnt POnC, POnS, Triple;
+ gp_Pnt POnC, POnS, aTriple;
Standard_Real Distance;
- Triple = mySequence->Value(i)->Value(j);
- myCurve->D0(Triple.X(), POnC);
- mySurface->D0(Triple.Y(), Triple.Z(), POnS);
+ aTriple = mySequence->Value(i)->Value(j);
+ myCurve->D0(aTriple.X(), POnC);
+ mySurface->D0(aTriple.Y(), aTriple.Z(), POnS);
Distance = POnC.Distance(POnS);
if (myMaxDistance->Value(i) < Distance)
myMaxDistance->ChangeValue(i) = Distance;
Extrema_ExtPS aExtPS(thePoint, mySurface->Surface(), myTolU, myTolV);
if (aExtPS.IsDone() && aExtPS.NbExt())
{
- Standard_Integer i, Nend, imin = 1;
+ Standard_Integer k, Nend, imin = 1;
// Search for the nearest solution which is also a normal projection
Nend = aExtPS.NbExt();
- for(i = 2; i <= Nend; i++)
- if (aExtPS.SquareDistance(i) < aExtPS.SquareDistance(imin))
- imin = i;
+ for(k = 2; k <= Nend; k++)
+ if (aExtPS.SquareDistance(k) < aExtPS.SquareDistance(imin))
+ imin = k;
const Extrema_POnSurf& POnS = aExtPS.Point(imin);
Standard_Real ParU,ParV;
POnS.Parameter(ParU, ParV);
}
}
if(!myProjIsDone && uperiod) {
- Standard_Real Uinf, Usup, Uaux;
- Uinf = Surf->Surface().FirstUParameter();
- Usup = Surf->Surface().LastUParameter();
- if((Usup - U0) > (U0 - Uinf))
- Uaux = 2*Uinf - U0 + uperiod;
+ Standard_Real aUinf, aUsup, Uaux;
+ aUinf = Surf->Surface().FirstUParameter();
+ aUsup = Surf->Surface().LastUParameter();
+ if((aUsup - U0) > (U0 - aUinf))
+ Uaux = 2*aUinf - U0 + uperiod;
else
- Uaux = 2*Usup - U0 - uperiod;
+ Uaux = 2*aUsup - U0 - uperiod;
Extrema_GenLocateExtPS locext(pntproj,
Surf->Surface(),
Uaux, V0, TolU, TolV);
if (locext.SquareDistance() < DistTol3d * DistTol3d) { //OCC217
//if (locext.SquareDistance() < Tol3d * Tol3d) {
(locext.Point()).Parameter(u,v);
- if((Usup - U0) > (U0 - Uinf))
+ if((aUsup - U0) > (U0 - aUinf))
usens--;
else
usens++;
}
}
if(!myProjIsDone && vperiod) {
- Standard_Real Vinf, Vsup, Vaux;
- Vinf = Surf->Surface().FirstVParameter();
- Vsup = Surf->Surface().LastVParameter();
- if((Vsup - V0) > (V0 - Vinf))
- Vaux = 2*Vinf - V0 + vperiod;
+ Standard_Real aVinf, aVsup, Vaux;
+ aVinf = Surf->Surface().FirstVParameter();
+ aVsup = Surf->Surface().LastVParameter();
+ if((aVsup - V0) > (V0 - aVinf))
+ Vaux = 2*aVinf - V0 + vperiod;
else
- Vaux = 2*Vsup - V0 - vperiod;
+ Vaux = 2*aVsup - V0 - vperiod;
Extrema_GenLocateExtPS locext(pntproj,
Surf->Surface(),
U0, Vaux, TolU, TolV) ;
if (locext.SquareDistance() < DistTol3d * DistTol3d) { //OCC217
//if (locext.SquareDistance() < Tol3d * Tol3d) {
(locext.Point()).Parameter(u,v);
- if((Vsup - V0) > (V0 - Vinf))
+ if((aVsup - V0) > (V0 - aVinf))
vsens--;
else
vsens++;
Extrema_ExtPS ext(pntproj, Surf->Surface(), TolU, TolV) ;
if (ext.IsDone()) {
Dist2Min = ext.SquareDistance(1);
- Standard_Integer GoodValue = 1;
+ Standard_Integer aGoodValue = 1;
for ( j = 2 ; j <= ext.NbExt() ; j++ )
if( Dist2Min > ext.SquareDistance(j)) {
Dist2Min = ext.SquareDistance(j);
- GoodValue = j;
+ aGoodValue = j;
}
if (Dist2Min < DistTol3d * DistTol3d) {
//if (Dist2Min < Tol3d * Tol3d) {
- (ext.Point(GoodValue)).Parameter(u,v);
+ (ext.Point(aGoodValue)).Parameter(u,v);
if(uperiod) {
if((U0 - u) > (2*uperiod/3)) {
usens++;
Standard_True);
if(Fit.IsAllApproximated()) {
- Standard_Integer i;
+ Standard_Integer j;
Standard_Integer NbCurves = Fit.NbMultiCurves();
Standard_Integer MaxDeg = 0;
// To transform the MultiCurve into BSpline, it is required that all
// Bezier constituing it have the same degree -> Calculation of MaxDeg
Standard_Integer NbPoles = 1;
- for (i = 1; i <= NbCurves; i++) {
- Standard_Integer Deg = Fit.Value(i).Degree();
+ for (j = 1; j <= NbCurves; j++) {
+ Standard_Integer Deg = Fit.Value(j).Degree();
MaxDeg = Max ( MaxDeg, Deg);
}
BSplCLib::IncreaseDegree( MaxDeg, Poles2d, PLib::NoWeights(),
TempPoles, PLib::NoWeights());
//update of tops of the PCurve
- for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) {
- Poles.SetValue( Compt, TempPoles( j));
+ for (Standard_Integer k = 1 ; k <= MaxDeg + 1; k++) {
+ Poles.SetValue( Compt, TempPoles( k));
Compt++;
}
}
else {
//update of tops of the PCurve
- for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) {
- Poles.SetValue( Compt, Poles2d( j));
+ for (Standard_Integer k = 1 ; k <= MaxDeg + 1; k++) {
+ Poles.SetValue( Compt, Poles2d( k));
Compt++;
}
}
else if ( Xc.IsNormal(Yc,Precision::Angular())) {
myType = GeomAbs_Parabola;
Standard_Real F = Parab.Focal() / Xc.Magnitude();
- gp_Parab Parab = gp_Parab( gp_Ax2(P,Xc^Yc,Xc), F);
+ gp_Parab aParab = gp_Parab( gp_Ax2(P,Xc^Yc,Xc), F);
Handle(Geom_Parabola) GeomParabolaPtr =
- new Geom_Parabola(Parab) ;
+ new Geom_Parabola(aParab) ;
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
GeomAdaptor_Curve aGACurve(GeomParabolaPtr);
myResult = new GeomAdaptor_HCurve(aGACurve);
gp_Vec Xc = ProjectVec(myPlane,myDirection,gp_Vec(AxeRef.XDirection()));
gp_Vec Yc = ProjectVec(myPlane,myDirection,gp_Vec(AxeRef.YDirection()));
gp_Pnt P = ProjectPnt(myPlane,myDirection,AxeRef.Location());
- Standard_Real R1 = Hypr.MajorRadius();
- Standard_Real R2 = Hypr.MinorRadius();
+ Standard_Real aR1 = Hypr.MajorRadius();
+ Standard_Real aR2 = Hypr.MinorRadius();
gp_Dir Z = myPlane.Direction();
if ( Xc.Magnitude() < Precision::Confusion()) {
myType = GeomAbs_Hyperbola;
gp_Dir X = gp_Dir(Yc) ^ Z;
- Hypr = gp_Hypr(gp_Ax2( P, Z, X), 0., R2 * Yc.Magnitude());
+ Hypr = gp_Hypr(gp_Ax2( P, Z, X), 0., aR2 * Yc.Magnitude());
GeomHyperbolaPtr =
new Geom_Hyperbola(Hypr) ;
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
else if ( Yc.Magnitude() < Precision::Confusion()) {
myType = GeomAbs_Hyperbola;
Hypr =
- gp_Hypr(gp_Ax2(P, Z, gp_Dir(Xc)), R1 * Xc.Magnitude(), 0.);
+ gp_Hypr(gp_Ax2(P, Z, gp_Dir(Xc)), aR1 * Xc.Magnitude(), 0.);
GeomHyperbolaPtr =
new Geom_Hyperbola(Hypr) ;
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
else if ( Xc.IsNormal(Yc,Precision::Angular())) {
myType = GeomAbs_Hyperbola;
Hypr = gp_Hypr( gp_Ax2( P, gp_Dir( Xc ^ Yc), gp_Dir( Xc)),
- R1 * Xc.Magnitude(), R2 * Yc.Magnitude() );
+ aR1 * Xc.Magnitude(), aR2 * Yc.Magnitude() );
GeomHyperbolaPtr =
new Geom_Hyperbola(Hypr) ;
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
}
TopAbs_ShapeEnum wtyp = W.ShapeType();
if (wtyp != TopAbs_WIRE && wtyp != TopAbs_EDGE && pick) {
- Standard_Real u,v;
- DBRep_DrawableShape::LastPick(W,u,v);
+ Standard_Real aTempU, aTempV;
+ DBRep_DrawableShape::LastPick(W, aTempU, aTempV);
wtyp = W.ShapeType();
}
if (wtyp != TopAbs_WIRE && wtyp != TopAbs_EDGE) {
(Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
- ShapeExtend_Status status = ShapeExtend_FAIL1;
+ status = ShapeExtend_FAIL1;
if(advWA->StatusSelfIntersection(status))
status = ShapeExtend_FAIL2;
Handle(Geom_Line) qLine = cpLine; // constructor from const pointer -- could be made explicit...
// check whether compiler will destroy reference to temporary handle
- Handle(Geom_Curve)& aTmpRef (Handle(Geom_Line)::DownCast (aCurve2));
+ const Handle(Geom_Curve)& aTmpRef (Handle(Geom_Line)::DownCast (aCurve2));
CHECK(theDI, ! aTmpRef.IsNull(), "local reference of handle to base type to temporary handle object");
Handle(Geom_Surface) aSurf;
const TopoDS_Shape& Result = MS.Shape();
const TopAbs_ShapeEnum& ResType = ShapeType(Result);
if(ResType == TopAbs_COMPOUND || ResType >= TopAbs_FACE) return Standard_False;
- TopTools_ListOfShape aList;
TopExp_Explorer anExp(Result, TopAbs_FACE);
for(;anExp.More();anExp.Next()) {
const TopoDS_Shape& Result = MS.Shape();
const TopAbs_ShapeEnum& ResType = ShapeType(Result);
if(ResType == TopAbs_COMPOUND || ResType >= TopAbs_FACE) return;
- TopTools_ListOfShape aList;
TopExp_Explorer anExp(Result, TopAbs_FACE);
for(;anExp.More();anExp.Next()) {
Standard_Integer nbj3 = data->NbParams(data->ParamNumber(nsub3,1));
aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi3, 1, nbj3);
for (Standard_Integer i3 = 1; i3 <= nbi3; i3 ++) {
- Standard_Integer nsi3;
- if (data->ReadSubList (nsub3,i3,"sub-part(control_points_list)",ach,nsi3)) {
+ Standard_Integer nsi3temp;
+ if (data->ReadSubList (nsub3,i3,"sub-part(control_points_list)",ach,nsi3temp)) {
Standard_Integer nsi3 = data->ParamNumber(nsub3,i3);
for (Standard_Integer j3 =1; j3 <= nbj3; j3 ++) {
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
Standard_Integer nbj13 = data->NbParams(data->ParamNumber(nsub13,1));
aWeightsData = new TColStd_HArray2OfReal (1,nbi13,1,nbj13);
for (Standard_Integer i13 = 1; i13 <= nbi13; i13 ++) {
- Standard_Integer nsi13;
- if (data->ReadSubList (nsub13,i13,"sub-part(weights_data)",ach,nsi13)) {
+ Standard_Integer nsi13temp;
+ if (data->ReadSubList (nsub13,i13,"sub-part(weights_data)",ach,nsi13temp)) {
Standard_Integer nsi13 = data->ParamNumber(nsub13,i13);
for (Standard_Integer j13 =1; j13 <= nbj13; j13 ++) {
//szv#4:S4163:12Mar99 `Standard_Boolean stat13 =` not needed
if(!DimCharR.IsNull()) {
Handle(StepShape_ShapeDimensionRepresentation) SDimR = DimCharR->Representation();
if(!SDimR.IsNull() && SDimR->NbItems()>0) {
- Handle(StepRepr_RepresentationItem) RI = SDimR->ItemsValue(1);
- Handle(StepRepr_ValueRange) VR = Handle(StepRepr_ValueRange)::DownCast(RI);
+ Handle(StepRepr_RepresentationItem) aRI = SDimR->ItemsValue(1);
+ Handle(StepRepr_ValueRange) VR = Handle(StepRepr_ValueRange)::DownCast(aRI);
if(!VR.IsNull()) {
aName = VR->Name();
//StepRepr_CompoundItemDefinition CID = VR->ItemElement();
if ( TransientListBinder.IsNull() && S.ShapeType() == TopAbs_COMPOUND)
{
for ( TopoDS_Iterator it(S); it.More(); it.Next() ) {
- Handle(StepRepr_RepresentationItem) item = STEPConstruct::FindEntity ( FP, it.Value(), L );
- if ( item.IsNull() ) continue;
+ Handle(StepRepr_RepresentationItem) aLocalItem = STEPConstruct::FindEntity ( FP, it.Value(), L );
+ if (aLocalItem.IsNull() ) continue;
nres++;
- seqRI.Append ( item );
+ seqRI.Append (aLocalItem);
}
}
else
Model->AddEntity(VR);
Handle(StepShape_ShapeDimensionRepresentation) SDimR =
new StepShape_ShapeDimensionRepresentation;
- Handle(StepRepr_HArray1OfRepresentationItem) HARI =
+ Handle(StepRepr_HArray1OfRepresentationItem) aHARI =
new StepRepr_HArray1OfRepresentationItem(1,1);
- HARI->SetValue(1,VR);
- SDimR->Init(aName,HARI,RC);
+ aHARI->SetValue(1,VR);
+ SDimR->Init(aName,aHARI,RC);
Model->AddWithRefs(SDimR);
Handle(StepShape_DimensionalCharacteristicRepresentation) DimCharR =
new StepShape_DimensionalCharacteristicRepresentation;
if(!Recognize(sr))
return shbinder;
isBound = Standard_False;
- Standard_Integer i,nb = sr->NbItems();
+ Standard_Integer nb = sr->NbItems();
// Used in XSAlgo::AlgoContainer()->ProcessShape (ssv; 13.11.2010)
Standard_Integer nbTPitems = TP->NbMapped();
Handle(Message_Messenger) sout = TP->Messenger();
myNMTool.SetActive(!isManifold && isNMMode);
// [END] Proceed with non-manifold topology (ssv; 12.11.2010)
- for (i = 1; i <= nb && PS.More(); i ++,PS.Next()) {
+ for (Standard_Integer i = 1; i <= nb && PS.More(); i ++,PS.Next()) {
//for (i = 1; i <= nb ; i ++) {
#ifdef TRANSLOG
if (TP->TraceLevel() > 2)
// Make compound to store closed Shells
TopoDS_Compound compWithClosings;
brepBuilder.MakeCompound(compWithClosings);
-
+
// Attempt to close Shells one-by-one
for (Standard_Integer i = 1; i <= shellClosingsMap.Extent(); i++) {
TopoDS_Shell adjustedShell = this->closeIDEASShell( TopoDS::Shell( shellClosingsMap.FindKey(i) ),
// NOTE: aNMBinder is connected now with this SDR. It will be added to the resulting
// binder in the end of this invocation of TransferShape
for (Standard_Integer i = 1; i <= aNMItemsNb; i++) {
- Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper( FP, RepItemSeq->Value(i) );
- TransferShape(mapper, sdr, FP, NonManifoldGroup, Standard_False);
+ Handle(TransferBRep_ShapeMapper) aMapper = TransferBRep::ShapeMapper( FP, RepItemSeq->Value(i) );
+ TransferShape(aMapper, sdr, FP, NonManifoldGroup, Standard_False);
}
// Nothing else needed for pure non-manifold topology, return
const Interface_Graph& graph = WS()->Graph();
TColStd_MapOfAsciiString aMapUnits[3];
- Standard_Integer i =1;
- for( ; i <= nbroots; i++)
+ for(Standard_Integer i = 1; i <= nbroots; i++)
{
Handle(Standard_Transient) anEnt = theroots(i);
Standard_Integer num = graph.EntityNumber(anEnt);
Handle(Interface_InterfaceModel) aModel = WS()->Model();
if(aModel.IsNull())
return;
- Standard_Integer i = 1, nb = aModel->NbEntities();
- for( ; i <= nb; i++)
+ Standard_Integer nb = aModel->NbEntities();
+ for(Standard_Integer i = 1; i <= nb; i++)
{
Handle(Standard_Transient) anEnt = aModel->Value(i);
Handle(StepRepr_RepresentationContext) aRepCont = Handle(StepRepr_RepresentationContext)::DownCast(anEnt);
isInGeomSet = Standard_True;
}
if(isInGeomSet) {
- Interface_EntityIterator subs = G.Shareds(start);
- subs.Start();
- Standard_Boolean isSome = subs.More();
- for (; subs.More(); subs.Next())
- explored.AddItem (subs.Value());
+ Interface_EntityIterator aSubsShareds = G.Shareds(start);
+ aSubsShareds.Start();
+ Standard_Boolean isSome = aSubsShareds.More();
+ for (; aSubsShareds.More(); aSubsShareds.Next())
+ explored.AddItem (aSubsShareds.Value());
return isSome;
} else
return Standard_False;
Message_Msg doneMsg("FixEdge.SameParameter.MSG0");
// Start progress scope (no need to check if progress exists -- it is safe)
- Message_ProgressSentry aPSentry(theProgress, "Fixing same parameter problem", 0, 2, 1);
+ Message_ProgressSentry aPSentryForSameParam(theProgress, "Fixing same parameter problem", 0, 2, 1);
{
// Start progress scope (no need to check if progress exists -- it is safe)
}
// Switch to "Update tolerances" step
- aPSentry.Next();
+ aPSentryForSameParam.Next();
{
// Start progress scope (no need to check if progress exists -- it is safe)
TopAbs_State stPoint = clas.Perform (unp,Standard_False);
if(stPoint == TopAbs_ON || stPoint == TopAbs_UNKNOWN) {
- TopoDS_Edge ed = TopoDS::Edge ( ew.Value() );
- Standard_Real cf, cl;
- Handle(Geom2d_Curve) cw = BRep_Tool::CurveOnSurface ( ed, pf, cf, cl );
+ TopoDS_Edge anEdge = TopoDS::Edge ( ew.Value() );
+ Standard_Real aCF, aCL;
+ Handle(Geom2d_Curve) aCW = BRep_Tool::CurveOnSurface ( anEdge, pf, aCF, aCL);
// handle tangential case (ON)
while ( stPoint == TopAbs_ON || stPoint == TopAbs_UNKNOWN ) {
- stPoint = clas.Perform ( cw->Value(cl), Standard_False );
+ stPoint = clas.Perform (aCW->Value(aCL), Standard_False );
if ( ! ew.More() ) break;
ew.Next();
if ( ! ew.More() ) break;
if(edge.Orientation() !=TopAbs_FORWARD &&
edge.Orientation() !=TopAbs_REVERSED)
continue;
- Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface ( edge, pf, cf, cl );
- if ( ! c2d.IsNull() ) cw = c2d;
+ Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface ( edge, pf, aCF, aCL );
+ if ( ! c2d.IsNull() ) aCW = c2d;
}
}
TopAbs_State stInfin = clas.PerformInfinitePoint();
const TopTools_ListOfShape& IntWires = MapWires.Find(wire);
TopTools_ListIteratorOfListOfShape liter(IntWires);
for( ; liter.More(); liter.Next()) {
- TopoDS_Shape aShape = tmpFace.EmptyCopied();
- TopoDS_Face aFace = TopoDS::Face ( aShape );
+ TopoDS_Shape aShapeEmptyCopied = tmpFace.EmptyCopied();
+ TopoDS_Face aFace = TopoDS::Face ( aShapeEmptyCopied);
aFace.Orientation ( TopAbs_FORWARD );
B.Add (aFace,liter.Value());
BRepTopAdaptor_FClass2d clas (aFace,::Precision::PConfusion());
// compose their shells in lists associated with non-small solids' shells
// which they should be merged to
TopTools_DataMapOfShapeListOfShape aShellsToMerge, aShellsToAdd;
- TopTools_ListIteratorOfListOfShape aSolidIter (aSmallSolids);
- while (aSolidIter.More())
+ TopTools_ListIteratorOfListOfShape aSmallIter(aSmallSolids);
+ while (aSmallIter.More())
{
- const TopoDS_Shape& aSmallSolid = aSolidIter.Value();
+ const TopoDS_Shape& aSmallSolid = aSmallIter.Value();
// find a non-small solid's shell having greatest sum area of
// all faces shared with the current small solid
theContext->Remove (aSmallSolid);
SendWarning ( aSmallSolid, Message_Msg( "ShapeFix.FixSmallSolid.MSG1" ));
- aSmallSolids.Remove (aSolidIter);
+ aSmallSolids.Remove (aSmallIter);
}
else
- aSolidIter.Next();
+ aSmallIter.Next();
}
// stop if no solids can be merged
++aShapesNb;
// Open progress indication scope for sub-shape fixing
- Message_ProgressSentry aPSentry(theProgress, "Fixing sub-shape", 0, aShapesNb, 1);
- for ( TopoDS_Iterator anIter(S); anIter.More() && aPSentry.More(); anIter.Next(), aPSentry.Next() )
+ Message_ProgressSentry aPSentrySubShape(theProgress, "Fixing sub-shape", 0, aShapesNb, 1);
+ for ( TopoDS_Iterator anIter(S); anIter.More() && aPSentrySubShape.More(); anIter.Next(), aPSentrySubShape.Next() )
{
myShape = anIter.Value();
if ( Perform(theProgress) )
status = Standard_True;
}
- if ( !aPSentry.More() )
+ if ( !aPSentrySubShape.More() )
return Standard_False; // aborted execution
myFixSameParameterMode = savFixSameParameterMode;
if ( NeedFix(myFixShellMode) )
{
// Start progress scope (no need to check if progress exists -- it is safe)
- Message_ProgressSentry aPSentry(theProgress, "Fixing shell", 0, aNbShells, 1);
+ Message_ProgressSentry aPSentryFixShell(theProgress, "Fixing shell", 0, aNbShells, 1);
// Fix shell by shell using ShapeFix_Shell tool
- for ( TopExp_Explorer aExpSh(S, TopAbs_SHELL); aExpSh.More() && aPSentry.More(); aExpSh.Next(), aPSentry.Next() )
+ for ( TopExp_Explorer aExpSh(S, TopAbs_SHELL); aExpSh.More() && aPSentryFixShell.More(); aExpSh.Next(), aPSentryFixShell.Next() )
{
TopoDS_Shape sh = aExpSh.Current();
}
// Halt algorithm in case of user's abort
- if ( !aPSentry.More() )
+ if ( !aPSentryFixShell.More() )
return Standard_False;
}
else
BRep_Builder aB;
TopoDS_Compound aComp;
aB.MakeCompound(aComp);
- Message_ProgressSentry aPSentry(theProgress, "Creating solid",
+ Message_ProgressSentry aPSentryCreatingSolid(theProgress, "Creating solid",
0, aMapSolids.Extent(), 1);
- for(Standard_Integer i =1; (i <= aMapSolids.Extent()) && (aPSentry.More());
- i++, aPSentry.Next())
+ for(Standard_Integer i =1; (i <= aMapSolids.Extent()) && (aPSentryCreatingSolid.More());
+ i++, aPSentryCreatingSolid.Next())
{
TopoDS_Shape aResSh =aMapSolids.FindKey(i);
if(aResShape.ShapeType() == TopAbs_SHELL && myCreateOpenSolidMode) {
aB.Add(aComp,aResSh);
}
- if ( !aPSentry.More() )
+ if ( !aPSentryCreatingSolid.More() )
return Standard_False; // aborted execution
Context()->Replace(aResShape,aComp);
}
isOk = IsMergingPossible(edge1, edge2, Tol, DegEdgeVrt);
if (!isOk)
{
- SubSequenceOfEdges SubSeq;
- SubSeq.SeqsEdges.Append(edge2);
- SeqOfSubSeqOfEdges.Append(SubSeq);
+ SubSequenceOfEdges aSubSeq;
+ aSubSeq.SeqsEdges.Append(edge2);
+ SeqOfSubSeqOfEdges.Append(aSubSeq);
}
else
SeqOfSubSeqOfEdges.ChangeLast().SeqsEdges.Append(edge2);
void StepData_Field::SetEntity
(const Standard_Integer num, const Handle(Standard_Transient)& val)
{
- DeclareAndCast(TColStd_HArray1OfTransient,ht,theany);
- if (!ht.IsNull()) { ht->SetValue (num,val); return; }
+ DeclareAndCast(TColStd_HArray1OfTransient,aHt,theany);
+ if (!aHt.IsNull()) { aHt->SetValue (num,val); return; }
DeclareAndCast(TColStd_HArray1OfInteger,hi,theany);
if (!hi.IsNull()) {
Standard_Integer low = hi->Lower(), up = hi->Upper();
TopTools_DataMapOfOrientedShapeShape aMap;
Standard_Integer Up(0);
TopAbs_ShapeEnum aStopType(TopAbs_COMPOUND);
- TopoDS_Iterator it(Selection);
- for(;it.More(); it.Next()) {
- const TopoDS_Shape& aS = it.Value();
+ TopoDS_Iterator anIter(Selection);
+ for(; anIter.More(); anIter.Next()) {
+ const TopoDS_Shape& aS = anIter.Value();
if(aS.ShapeType() > aStopType)
aStopType = aS.ShapeType();
Up++;
if(num1 == num2 && num2)
return Context;
else {
- TopoDS_Iterator it(CompShape);
+ TopoDS_Iterator anIt(CompShape);
Standard_Integer n(0);
TopoDS_Shape aCmp;
- for(;it.More();it.Next()) {
+ for(; anIt.More(); anIt.Next()) {
n++;
- aCmp = it.Value();
+ aCmp = anIt.Value();
}
if(n == 1) {
#ifdef OCCT_DEBUG_FSET
indxW = (Index & 0x000F0000) >> 16;
nbW = (Index & 0x00F00000) >> 20;
indxF = (Index & 0x0F000000) >> 24;
- Standard_Integer i(1);
+ Standard_Integer k(1);
TopoDS_Shape aS;
TopTools_ListIteratorOfListOfShape itl(aListOfAnc);
- for(;itl.More();itl.Next(),i++) {
- if(indxF == i) {
+ for(;itl.More();itl.Next(),k++) {
+ if(indxF == k) {
aS = itl.Value();
break;
}
TNaming_NamingTool::BuildDescendants (Stop, Forbiden);
TNaming_NamingTool::CurrentShape (Valid,Forbiden,A,MS);
- TopoDS_Shape S;
+ TopoDS_Shape aShape;
Standard_Boolean isSplit(Standard_False);
if (!MS.IsEmpty ()) {
if (MS.Extent() == 1) {
- S = MS (1);
+ aShape = MS (1);
}
else {
isSplit = Standard_True;
- S = MakeShape(MS);
+ aShape = MakeShape(MS);
#ifdef OCCT_DEBUG_OR
for(Standard_Integer anItMS = 1; anItMS <= MS.Extent(); anItMS++) {
TCollection_AsciiString aNam("OR_Selection_");
}
TNaming_Builder B(L);
- if(S.IsNull())
+ if(aShape.IsNull())
return Standard_False;
#ifdef OCCT_DEBUG_OR
DbgTools_Write(S, "Orientation_S.brep");
TopTools_ListOfShape aSList;
// tmp. solution
- if(S.ShapeType() == TopAbs_COMPOUND && !isSplit) {
- TopoDS_Iterator it(S);
+ if(aShape.ShapeType() == TopAbs_COMPOUND && !isSplit) {
+ TopoDS_Iterator it(aShape);
for(;it.More();it.Next())
aSList.Append(it.Value());
} //
Standard_Boolean found(Standard_False);
TopoDS_Iterator it(itw.Value());
for(int i=1;it.More();it.Next(),i++) {
- if(i == Index && it.Value().IsSame(S)) {
+ if(i == Index && it.Value().IsSame(aShape)) {
CS = it.Value();
found = Standard_True;
#ifdef OCCT_DEBUG_OR
if(found) break;
}
} else
- CS = FindSubShapeInAncestor(S, AS);
+ CS = FindSubShapeInAncestor(aShape, AS);
// <=== end 21.10.2009
#ifdef OCCT_DEBUG_OR
cout << "ORIENTATION: Selection" <<" TShape = " <<CS.TShape() <<" Orientation = " << CS.Orientation() <<endl;
if(!CS.IsNull()) {
B.Select(CS, CS);
} else {
- if(!Aggregation(S, AS, B))
+ if(!Aggregation(aShape, AS, B))
return Standard_False;
}
}
} else {
const TopoDS_Shape AS = MakeShape(MSC);
- const TopoDS_Shape& CS = FindSubShapeInAncestor(S, AS);
+ const TopoDS_Shape& CS = FindSubShapeInAncestor(aShape, AS);
if(!CS.IsNull()) {
B.Select(CS, CS);
} else {
- if(!Aggregation(S, AS, B))
+ if(!Aggregation(aShape, AS, B))
return Standard_False;
}
}
}
}
else { // > 1
- for(Standard_Integer i = Arr->LowerRow();i <= Arr->UpperRow();i++) {
- const TopoDS_Shape& S = Arr->Value(i,1);
- const TopoDS_Shape& AC = Arr->Value(i,2);
+ for(Standard_Integer k = Arr->LowerRow();k <= Arr->UpperRow();k++) {
+ const TopoDS_Shape& S = Arr->Value(k,1);
+ const TopoDS_Shape& AC = Arr->Value(k,2);
if(S.ShapeType() != TopAbs_COMPOUND) {
const TopoDS_Shape& CS = FindSubShapeInAncestor(S, AC);
if(!CS.IsNull()) {
{
Standard_Boolean aResult(Standard_False);
if(!ValidArgs(Args)) return aResult;
- TopTools_IndexedMapOfShape MS;
- TDF_LabelMap Forbiden;
+ TopTools_IndexedMapOfShape aMapOfSh;
+ TDF_LabelMap aForbiden;
if (Args.Extent() < 1 )
Standard_ConstructionError::Raise("TNaming_Name::Solve");
const Handle(TNaming_NamedShape)& A = Args.First();
- TNaming_NamingTool::CurrentShape (Valid,Forbiden,A,MS);
- if (MS.Extent() != 1) return aResult;
- const TopoDS_Shape& aCF = MS (1);
+ TNaming_NamingTool::CurrentShape (Valid,aForbiden,A, aMapOfSh);
+ if (aMapOfSh.Extent() != 1) return aResult;
+ const TopoDS_Shape& aCF = aMapOfSh(1);
#ifdef OCCT_DEBUG_WIN
cout <<"MS Extent = " <<MS.Extent() <<endl;
DbgTools_Write(aCF, "Context_Face.brep");
ArgsE.Assign(Args);
ArgsE.RemoveFirst();
// fill Map with edges
- TNaming_ListIteratorOfListOfNamedShape it(ArgsE);
+ TNaming_ListIteratorOfListOfNamedShape anIter(ArgsE);
TopTools_IndexedMapOfShape MS;
TDF_LabelMap Forbiden;
TNaming_NamingTool::BuildDescendants (Stop, Forbiden);//fill Forbidden
- TNaming_NamingTool::CurrentShape (Valid, Forbiden,it.Value(),MS); // fill MS with last modifications of the first additional argument
+ TNaming_NamingTool::CurrentShape (Valid, Forbiden, anIter.Value(),MS); // fill MS with last modifications of the first additional argument
TopoDS_Shape CS = MakeShape(MS);
TNaming_ShapesSet aSet(CS,TopAbs_EDGE);//fill internal map of shapeset by shapes of the specified type
DbgTools_Write(CS, aNam.ToCString());
Standard_Integer ii = 2;
#endif
- it.Next();
- for (; it.More(); it.Next()) {
+ anIter.Next();
+ for (; anIter.More(); anIter.Next()) {
#ifdef OCCT_DEBUG_WIN
TDF_Tool::Entry(it.Value()->Label(), entry);
#endif
MS.Clear();
- TNaming_NamingTool::CurrentShape (Valid, Forbiden,it.Value(),MS);// fill MS with last modifications of the it.Value()
+ TNaming_NamingTool::CurrentShape (Valid, Forbiden,anIter.Value(),MS);// fill MS with last modifications of the it.Value()
CS = MakeShape(MS);
TNaming_ShapesSet OS(CS,TopAbs_EDGE);
aSet.Add(OS); //concatenate both shapesets
Standard_Boolean aResult(Standard_False);
if(!ValidArgs(Args))
return aResult;
- TopTools_IndexedMapOfShape MS;
- TDF_LabelMap Forbiden;
+ TopTools_IndexedMapOfShape aMapOfSh;
+ TDF_LabelMap aForbiden;
if (Args.Extent() < 1 )
Standard_ConstructionError::Raise("TNaming_Name::Solve");
const Handle(TNaming_NamedShape)& A = Args.First();
- TNaming_NamingTool::CurrentShape (Valid,Forbiden,A,MS);
- if (MS.Extent() != 1) return aResult;
- const TopoDS_Shape& aCSO = MS (1);
+ TNaming_NamingTool::CurrentShape (Valid,aForbiden,A, aMapOfSh);
+ if (aMapOfSh.Extent() != 1) return aResult;
+ const TopoDS_Shape& aCSO = aMapOfSh(1);
#ifdef OCCT_DEBUG_SHELL
cout <<"MS Extent = " <<MS.Extent() <<endl;
DbgTools_Write(aCSO, "Context_Solid.brep");
ArgsF.Assign(Args);
ArgsF.RemoveFirst();
// fill Map with faces
- TNaming_ListIteratorOfListOfNamedShape it(ArgsF);
+ TNaming_ListIteratorOfListOfNamedShape anIter(ArgsF);
TopTools_IndexedMapOfShape MS;
TDF_LabelMap Forbiden;
TNaming_NamingTool::BuildDescendants (Stop, Forbiden);//fill Forbidden
- TNaming_NamingTool::CurrentShape (Valid, Forbiden,it.Value(),MS); // fill MS with last modifications of the first additional argument
+ TNaming_NamingTool::CurrentShape (Valid, Forbiden, anIter.Value(),MS); // fill MS with last modifications of the first additional argument
TopoDS_Shape CS = MakeShape(MS);
TNaming_ShapesSet aSet(CS,TopAbs_FACE);//fill internal map of shapeset by shapes of the specified type
#ifdef OCCT_DEBUG_SHELL
TCollection_AsciiString entry;
- TDF_Tool::Entry(it.Value()->Label(), entry);
+ TDF_Tool::Entry(anIter.Value()->Label(), entry);
TCollection_AsciiString Nam("Arg_");
TCollection_AsciiString aNam = Nam + entry + "_" + "2.brep";
DbgTools_Write(CS, aNam.ToCString());
Standard_Integer ii = 2;
#endif
- it.Next();
- for (; it.More(); it.Next()) {
+ anIter.Next();
+ for (; anIter.More(); anIter.Next()) {
#ifdef OCCT_DEBUG_SHELL
- TDF_Tool::Entry(it.Value()->Label(), entry);
+ TDF_Tool::Entry(anIter.Value()->Label(), entry);
#endif
MS.Clear();
- TNaming_NamingTool::CurrentShape (Valid, Forbiden,it.Value(),MS);// fill MS with last modifications of the it.Value()
+ TNaming_NamingTool::CurrentShape (Valid, Forbiden,anIter.Value(),MS);// fill MS with last modifications of the it.Value()
CS = MakeShape(MS);
TNaming_ShapesSet OS(CS,TopAbs_FACE);
aSet.Add(OS); //concatenate both shapesets
MS.Remove(exp.Current());
}
} else {
- TColStd_MapIteratorOfMapOfInteger itm(aView);
- for(;itm.More();itm.Next()) {
- TopAbs_ShapeEnum aType = (TopAbs_ShapeEnum)itm.Key();
- for (exp.Init(Res,aType) ; exp.More(); exp.Next()) {
+ TColStd_MapIteratorOfMapOfInteger aMapIter(aView);
+ for(; aMapIter.More(); aMapIter.Next()) {
+ TopAbs_ShapeEnum aCurType = (TopAbs_ShapeEnum)aMapIter.Key();
+ for (exp.Init(Res, aCurType) ; exp.More(); exp.Next()) {
if (MS.Contains(exp.Current())) {
MS.Remove(exp.Current());
}
const Standard_Boolean BNProblem)
{
- Handle(TNaming_NamedShape) NS;
+ Handle(TNaming_NamedShape) aNamedShape;
if (KeepOrientation) {
#ifdef OCCT_DEBUG_INNS
cout <<"KeepOR = 1: "; Print_Entry(F);
theName.Type(TNaming_ORIENTATION);
theName.Orientation(S.Orientation());
- if (!TNaming_Selector::IsIdentified (F, S, NS, Geom))
- NS = TNaming_Naming::Name(Naming->Label(),S,Context,Geom,0);
- theName.Append (NS);
+ if (!TNaming_Selector::IsIdentified (F, S, aNamedShape, Geom))
+ aNamedShape = TNaming_Naming::Name(Naming->Label(),S,Context,Geom,0);
+ theName.Append (aNamedShape);
#ifdef MDTV_OR
cout << " Sel Label ==> "; Print_Entry(NS->Label());
#endif
if(S.ShapeType() == TopAbs_COMPOUND && Arr->Length() > 1) {
// N arguments: to be optimized to avoid duplication of the same Context shape
for(Standard_Integer i = Arr->Lower(); i <= Arr->Upper(); i++) {
- NS = TNaming_Naming::Name(Naming->Label(), Arr->Value(i), Context, Geom, 1, aBNproblem);
- theName.Append (NS);
+ aNamedShape = TNaming_Naming::Name(Naming->Label(), Arr->Value(i), Context, Geom, 1, aBNproblem);
+ theName.Append (aNamedShape);
}
} else {
- NS = TNaming_Naming::Name(Naming->Label(),UC,Context, Geom, 1, aBNproblem);
- theName.Append (NS);
+ aNamedShape = TNaming_Naming::Name(Naming->Label(),UC,Context, Geom, 1, aBNproblem);
+ theName.Append (aNamedShape);
#ifdef MDTV_OR
cout << " Cont Label ==> "; Print_Entry(NS->Label());
#endif
TNaming_Scope MDF;
BuildScope (MDF,Context,F);
Naming->GetName().Solve(Naming->Label(),MDF.GetValid());
- Naming->Label().FindAttribute(TNaming_NamedShape::GetID(),NS);
- theName.ContextLabel(NS->Label());
- if (Geom) return NS;
- if(NS.IsNull()) {
+ Naming->Label().FindAttribute(TNaming_NamedShape::GetID(), aNamedShape);
+ theName.ContextLabel(aNamedShape->Label());
+ if (Geom) return aNamedShape;
+ if(aNamedShape.IsNull()) {
cout <<" %%% WARNING: TNaming_Naming::Name: FAILED"<<endl;
return BuildNS (F,S, TNaming_UNKNOWN);
}
- if (!Geom && TestSolution(MDF,NS,S)) return NS;
+ if (!Geom && TestSolution(MDF, aNamedShape,S)) return aNamedShape;
cout <<" %%% WARNING: TNaming_Naming::Name: FAILED"<<endl;
// Naming n is unsatisfactory
return BuildNS (F,S, TNaming_UNKNOWN);
}
} else
- if (TNaming_Selector::IsIdentified (F, S, NS, Geom))
- return NS;
+ if (TNaming_Selector::IsIdentified (F, S, aNamedShape, Geom))
+ return aNamedShape;
}
//------------------------------------------------------------
FindGenerated(NS, aS, aList);
Ident.NextArg();
while(Ident.MoreArgs()) {
- const TopoDS_Shape& aS = Ident.ShapeArg();
- FindGenerated(NS, aS, aList);
+ const TopoDS_Shape& aShape = Ident.ShapeArg();
+ FindGenerated(NS, aShape, aList);
Ident.NextArg();
}
const TopoDS_Shape& aC = MS (1);
BRep_ListIteratorOfListOfCurveRepresentation itcr(TTE1->Curves());
BRep_ListOfCurveRepresentation& lcr = TTE2->ChangeCurves();
lcr.Clear();
- Handle(BRep_CurveRepresentation) CR;
Handle(BRep_GCurve) GC;
Standard_Real f, l;
TopTools_ListOfShape splits;
SheToSo.MakeSolids(so,splits);
- BRep_Builder BB;
- TopoDS_Compound CC; BB.MakeCompound(CC);
+ BRep_Builder aBBuilder;
+ TopoDS_Compound aCompound; aBBuilder.MakeCompound(aCompound);
Standard_Integer nSo = 0;
TopTools_ListIteratorOfListOfShape itSo(splits);
for (; itSo.More(); itSo.Next()) {
const TopoDS_Shape& spli = itSo.Value();
- BB.Add(CC,spli);
+ aBBuilder.Add(aCompound,spli);
nSo++;
}
di<<"so gives "<<nSo<<" new solids"<<"\n";
di<<"resulting compound is cmp"<<"\n";
TCollection_AsciiString aa = TCollection_AsciiString("cmp");
- FUN_draw(aa,CC);
+ FUN_draw(aa, aCompound);
}
return 0;
}
}
const TopOpeBRepDS_ListOfInterference& lie1 = BDS.ShapeInterferences(e1);
- TopOpeBRepDS_ListIteratorOfListOfInterference it1(lie1);
- for (; it1.More(); it1.Next()){
- const Handle(TopOpeBRepDS_Interference)& I1 = it1.Value();
+ TopOpeBRepDS_ListIteratorOfListOfInterference iter1(lie1);
+ for (; iter1.More(); iter1.Next()){
+ const Handle(TopOpeBRepDS_Interference)& I1 = iter1.Value();
Standard_Integer S1 = I1->Support(); TopOpeBRepDS_Kind ST1 = I1->SupportType();
if (ST1 != TopOpeBRepDS_EDGE) continue;
const TopoDS_Edge& e2 = TopoDS::Edge(BDS.Shape(S1));
TopoDS_Shape S1 = aS1;
TopoDS_Shape S2 = aS2;
- TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
- BDS.AddShape(S1,1);
- BDS.AddShape(S2,2);
+ TopOpeBRepDS_DataStructure& BDS1 = HDS->ChangeDS();
+ BDS1.AddShape(S1,1);
+ BDS1.AddShape(S2,2);
TopoDS_Shape lFF1, lFF2;
Standard_Boolean isFFsamdom = Standard_False;
unfill = Standard_False;
}
if (unfill) {
- TopOpeBRepDS_DataStructure& BDS = HDS->ChangeDS();
+ TopOpeBRepDS_DataStructure& BDS2 = HDS->ChangeDS();
if(!lFF1.IsNull() && !lFF2.IsNull())
- BDS.UnfillShapesSameDomain(lFF1,lFF2);
+ BDS2.UnfillShapesSameDomain(lFF1,lFF2);
}
}
isFFsamdom = Standard_True;
myShapeIntersector2d.ChangeEdgesIntersector().SetFaces(gs1,gs2);
lFF1 = gs1; lFF2 = gs2;
- BDS.FillShapesSameDomain(gs1,gs2);
+ BDS1.FillShapesSameDomain(gs1,gs2);
}
else if ((t1 == TopAbs_EDGE) && (t2 == TopAbs_EDGE)) {
TopOpeBRep_EdgesIntersector& EE = myShapeIntersector2d.ChangeEdgesIntersector();
if (!ok)
return;//nyiRaise
- Handle(Geom_Surface) S1 = BRep_Tool::Surface(myFace1);
- Standard_Boolean apex = FUN_tool_onapex(uv2,S1);
+ Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(myFace1);
+ Standard_Boolean apex = FUN_tool_onapex(uv2, aSurf1);
if (apex) {
TopoDS_Vertex vf,vl; TopExp::Vertices(myEdge1,vf,vl);
gp_Pnt ptf = BRep_Tool::Pnt(vf); Standard_Real df = pt2.Distance(ptf);
GeomTools_CurveSet::PrintCurve(NC,cout);
cout<<"--- nouvelle PCurve : "<<endl;
GeomTools_Curve2dSet::PrintCurve2d(PC2on1,cout);
- Handle(Geom_Surface) S1 = BRep_Tool::Surface(myFace1);
+ Handle(Geom_Surface) aS1 = BRep_Tool::Surface(myFace1);
cout<<"--- sur surface : "<<endl;
- GeomTools_SurfaceSet::PrintSurface(S1,cout);
+ GeomTools_SurfaceSet::PrintSurface(aS1,cout);
cout<<endl;
}
#endif
gp_Pnt pt2 = BRep_Tool::Pnt(v2);
gp_Pnt2d uv2; Standard_Real d; Standard_Boolean ok = FUN_tool_projPonF(pt2,F1,uv2,d);
if (!ok) return;//nyiRaise
- Handle(Geom_Surface) S1 = BRep_Tool::Surface(F1);
- Standard_Boolean apex = FUN_tool_onapex(uv2,S1);
+ Handle(Geom_Surface) aS1 = BRep_Tool::Surface(F1);
+ Standard_Boolean apex = FUN_tool_onapex(uv2,aS1);
if (apex) {
TopoDS_Vertex vf,vl; TopExp::Vertices(myEdge1,vf,vl);
gp_Pnt ptf = BRep_Tool::Pnt(vf); Standard_Real df = pt2.Distance(ptf);
cout<<"------------ projection de curve"<<endl;
cout<<"--- Curve : "<<endl;GeomTools_CurveSet::PrintCurve(NC,cout);
cout<<"--- nouvelle PCurve : "<<endl;GeomTools_Curve2dSet::PrintCurve2d(PC2on1,cout);
- Handle(Geom_Surface) S1 = BRep_Tool::Surface(F1);
- cout<<"--- sur surface : "<<endl;GeomTools_SurfaceSet::PrintSurface(S1,cout);
+ Handle(Geom_Surface) aS1 = BRep_Tool::Surface(F1);
+ cout<<"--- sur surface : "<<endl;GeomTools_SurfaceSet::PrintSurface(aS1,cout);
cout<<endl;
}
#endif
// lastonentre && onsort,
// first VP is first walking point (PIfound == 1.0),
// current VP is the second one on walking and not the last.
- const Handle(TopOpeBRepDS_Interference)& I = DSCIL.First();
- const TopOpeBRepDS_Transition& lasttransLine = I->Transition();
+ const Handle(TopOpeBRepDS_Interference)& anI = DSCIL.First();
+ const TopOpeBRepDS_Transition& lasttransLine = anI->Transition();
// xpu12-12-97 : line is built on only 2 vp,
// DSCIL->First() == DSCIL->Last()
// lasttransLine = DSCIL's first transition
addEPI = Standard_True;
}
else { // EPIfound
- TopAbs_Orientation otransEdge = transEdge.Orientation(TopAbs_IN);
+ TopAbs_Orientation anOtransEdge = transEdge.Orientation(TopAbs_IN);
Standard_Boolean opporifound,memorifound; opporifound = memorifound = Standard_False;
TopOpeBRepDS_ListOfInterference loIfound;
// - il n'en existe pas deja une d'orientation identique a TransEdge
for (; PI.More(); PI.Next()){
TopAbs_Orientation oEPI = PI.Value()->Transition().Orientation(TopAbs_IN);
- if (!memorifound) memorifound = ( oEPI == otransEdge );
- if (!opporifound) opporifound = ( oEPI == TopAbs::Complement(otransEdge) );
+ if (!memorifound) memorifound = ( oEPI == anOtransEdge);
+ if (!opporifound) opporifound = ( oEPI == TopAbs::Complement(anOtransEdge) );
addEPI = (opporifound && ! memorifound);
if (addEPI) break;
}
#ifdef OCCT_DEBUG
Standard_Boolean trc = Standard_False;
if (trc) {
- for (Standard_Integer i = 1; i <= 2; i++)
- cout<<"B("<<i<<") = ("<<UV(i,1)<<" "<<UV(i,3)<<" "<<UV(i,2)<<" "<<UV(i,4)<<")"<<endl;
+ for (Standard_Integer j = 1; j <= 2; j++)
+ cout<<"B("<<j<<") = ("<<UV(j,1)<<" "<<UV(j,3)<<" "<<UV(j,2)<<" "<<UV(j,4)<<")"<<endl;
}
#endif
TopTools_ListOfShape lw; lw.Assign(lS);
mapgreasma.Clear();
- TopTools_ListIteratorOfListOfShape itw(lS);
- for (; itw.More(); itw.Next()) mapgreasma.Bind(itw.Value(),null);
+ TopTools_ListIteratorOfListOfShape anIterW(lS);
+ for (; anIterW.More(); anIterW.Next()) mapgreasma.Bind(anIterW.Value(),null);
Standard_Integer nw = lw.Extent();
if (nw <= 1) return Standard_True;
for (; exv.More(); exv.Next()){
const TopoDS_Vertex& v = TopoDS::Vertex(exv.Current());
#ifdef OCCT_DEBUG
- Standard_Integer iE = STATIC_PURGE_mapeds.Add(E);
- (void)iE; // avoid warning
+ Standard_Integer aniE = STATIC_PURGE_mapeds.Add(E);
+ (void)aniE; // avoid warning
#ifdef DRAW
if (trc) {TCollection_AsciiString bb = TCollection_AsciiString("v"); FUN_tool_draw(bb,v,iv);}
#endif
if (mapcl.Contains(E)) continue; // do NOT check connexity on closing edges
// xpu090399 cto016E1
- TopOpeBRepTool_C2DF E2d; Standard_Boolean isb = UVRep(E,E2d);
- if (!isb) return Standard_False; // NYIRAISE
+ TopOpeBRepTool_C2DF E2d; Standard_Boolean isB2 = UVRep(E,E2d);
+ if (!isB2) return Standard_False; // NYIRAISE
Standard_Real tttolE = BRep_Tool::Tolerance(E);
Standard_Real tttuvE = Max(Tol(1,tttolE),Tol(2,tttolE));
if (e.IsSame(E)) continue;
if (M_INTERNAL(oe) || M_EXTERNAL(oe)) continue;
- Standard_Boolean isb = myERep2d.IsBound(e);
- if (!isb) {FUN_RaiseError(); return Standard_False;}
- const TopOpeBRepTool_C2DF& C2DF = myERep2d.Find(e);
+ Standard_Boolean isBound = myERep2d.IsBound(e);
+ if (!isBound) {FUN_RaiseError(); return Standard_False;}
+ const TopOpeBRepTool_C2DF& aC2DF = myERep2d.Find(e);
TopTools_Array1OfShape ves(1,2); TopOpeBRepTool_TOOL::Vertices(e,ves);
for (Standard_Integer ive = 1; ive <=2; ive++) {
Standard_Boolean samev = ve.IsSame(vE);
if (!samev) continue;
- Standard_Real pare = TopOpeBRepTool_TOOL::ParE(ive,e); gp_Pnt2d UVve = TopOpeBRepTool_TOOL::UVF(pare,C2DF);
+ Standard_Real pare = TopOpeBRepTool_TOOL::ParE(ive,e); gp_Pnt2d UVve = TopOpeBRepTool_TOOL::UVF(pare,aC2DF);
#ifdef OCCT_DEBUG
if (trc) {cout<<" ve("<<ive<<")";FUN_tool_trace(UVve);}
#endif
TopExp_Explorer exv(E, TopAbs_VERTEX);
for (; exv.More(); exv.Next()){
const TopoDS_Vertex& v = TopoDS::Vertex(exv.Current());
- Standard_Boolean isb = myVEds.IsBound(v);
- if (!isb) return Standard_False;
+ Standard_Boolean isBoundV = myVEds.IsBound(v);
+ if (!isBoundV) return Standard_False;
TopTools_ListOfShape& loe = myVEds.ChangeFind(v);
TopTools_ListIteratorOfListOfShape ite(loe);
while (ite.More()) {
// prequesitory : All edges have already been splitted, there is no
// internal vertex on edge, except for internal edge.
TopAbs_Orientation oAnc = Fanc.Orientation();
- TopoDS_Shape aLocalShape = Fanc.Oriented(TopAbs_FORWARD);
- TopoDS_Face aFace = TopoDS::Face(aLocalShape);
+ TopoDS_Shape aLocalShapeFromFace = Fanc.Oriented(TopAbs_FORWARD);
+ TopoDS_Face aFace = TopoDS::Face(aLocalShapeFromFace);
// TopoDS_Face aFace = TopoDS::Face(Fanc.Oriented(TopAbs_FORWARD));
FSplits.Clear();
TopTools_MapIteratorOfMapOfShape itc(myedstoconnect);
for (; itc.More(); itc.Next()){
const TopoDS_Shape& e = itc.Key();
- Standard_Boolean isb = mymapeFs.IsBound(e);
+ Standard_Boolean isBound = mymapeFs.IsBound(e);
// all ancestor faces of <e> have been stored
- if (!isb) {myedstoconnect.Remove(e); continue;}
+ if (!isBound) {myedstoconnect.Remove(e); continue;}
const TopTools_ListOfShape& lof = mymapeFs.Find(e); Standard_Integer nf = lof.Extent();
if (nf == 0) {myedstoconnect.Remove(e); mymapeFs.UnBind(e);
direct = toto.Direct();
}
Standard_Real prod = axis.Dot(tg0);
- Standard_Boolean maxAcurv = FUN_nullprodv(1-Abs(prod));
+ Standard_Boolean isMaxAcurv = FUN_nullprodv(1-Abs(prod));
Standard_Boolean nullcurv = FUN_nullprodv(prod);
Standard_Real prod2 = ngS.Dot(tg0);
if (cyl || cone) nullcurv = nullcurv || FUN_nullprodv(1-Abs(prod2));
if (nullcurv) {curv = 0.; curvdone = Standard_True;}
- if (maxAcurv) {
+ if (isMaxAcurv) {
GeomLProp_SLProps slprops(S,uv0.X(),uv0.Y(),2,Precision::Confusion());
Standard_Boolean curdef = slprops.IsCurvatureDefined();
if (curdef) {
gp_Vec tge; Standard_Boolean ok = TopOpeBRepTool_TOOL::TggeomE(par,ed,tge);
if (!ok) return Standard_False;
gp_Vec ngf = FUN_tool_nggeomF(uv,fa);
- Standard_Real prod = tge.Dot(ngf);
- Standard_Boolean etgf = Abs(prod) < tola;
+ Standard_Real aProdDot = tge.Dot(ngf);
+ Standard_Boolean etgf = Abs(aProdDot) < tola;
if (!etgf) return Standard_True;
BRepAdaptor_Surface bs(fa);
Standard_Real dot = dxx.Dot(dxx1);
if (dot < 0.) continue;
- gp_Vec2d dxx; Standard_Real dd=0;
- if (inU) {dd = o2d1.X()-o2d.X(); dxx = gp_Vec2d(dd,0.);}
- else {dd = o2d1.Y()-o2d.Y(); dxx = gp_Vec2d(0.,dd);}
+ gp_Vec2d aDxx; Standard_Real dd=0;
+ if (inU) {dd = o2d1.X()-o2d.X(); aDxx = gp_Vec2d(dd,0.);}
+ else {dd = o2d1.Y()-o2d.Y(); aDxx = gp_Vec2d(0.,dd);}
if (Abs(dd)<tolx) return Standard_False;
- TopOpeBRepTool_TOOL::TrslUVModifE(dxx,FFOR,E); //FUN_tool_ttranslate(dxx,FFOR,E);
+ TopOpeBRepTool_TOOL::TrslUVModifE(aDxx,FFOR,E); //FUN_tool_ttranslate(dxx,FFOR,E);
} // ex(FFOR)
return Standard_False;
}
if (quadE && quadES) { // should return INT/EXT
TopAbs_State sta = TopAbs_UNKNOWN;
Standard_Integer mkt = FUN_mkT2dquad(curvE,curvES);
- Standard_Boolean ok = FUN_mkT2dquad(myE,mypb,mypa,mypE, myES,mypES, mkt,xxES,myfactor,sta);
- if (ok) {
+ Standard_Boolean isOK = FUN_mkT2dquad(myE,mypb,mypa,mypE, myES,mypES, mkt,xxES,myfactor,sta);
+ if (isOK) {
Stb = Sta = sta;
return Standard_True;
}
ok = FUN_mkT3dquad(myE,mypb,mypa,mypE, myFS,myuv, tgE,ntFS, mkt,myfactor,sta);
if (ok) {
if (hasES) {
- gp_Dir xxES; Standard_Boolean ok = TopOpeBRepTool_TOOL::XX(myuv,myFS, mypES,myES, xxES);
- if (!ok) return Standard_False;
+ gp_Dir xxES; Standard_Boolean isOK = TopOpeBRepTool_TOOL::XX(myuv,myFS, mypES,myES, xxES);
+ if (!isOK) return Standard_False;
Stb = FUN_stawithES(tgE,xxES,BEFORE,sta);
Sta = FUN_stawithES(tgE,xxES,AFTER,sta);
}
Standard_Real alpha = M_PI / aDivision;
LineAttrib->SetColor (myTenthColor);
myGroup->SetGroupPrimitivesAspect (LineAttrib);
- Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2*nbpnts);
+ Handle(Graphic3d_ArrayOfSegments) aPrims1 = new Graphic3d_ArrayOfSegments(2*nbpnts);
const gp_Pnt p0(0., 0., -myOffSet);
for (Standard_Integer i=1; i<=nbpnts; i++) {
- aPrims->AddVertex(p0);
- aPrims->AddVertex(Cos(alpha*i)*myRadius, Sin(alpha*i)*myRadius, -myOffSet);
+ aPrims1->AddVertex(p0);
+ aPrims1->AddVertex(Cos(alpha*i)*myRadius, Sin(alpha*i)*myRadius, -myOffSet);
}
- myGroup->AddPrimitiveArray(aPrims, Standard_False);
+ myGroup->AddPrimitiveArray(aPrims1, Standard_False);
// circles
nbpnts = 2 * Division + 1;
myGroup->SetGroupPrimitivesAspect (LineAttrib);
Standard_Integer n, np;
const Standard_Integer nbl = aSeqTenth.Length() / nbpnts;
- Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(aSeqTenth.Length(),nbl);
+ Handle(Graphic3d_ArrayOfPolylines) aPrims2 = new Graphic3d_ArrayOfPolylines(aSeqTenth.Length(),nbl);
for (np = 1, n=0; n<nbl; n++) {
- aPrims->AddBound(nbpnts);
+ aPrims2->AddBound(nbpnts);
for (Standard_Integer i=0; i<nbpnts; i++, np++)
- aPrims->AddVertex(aSeqTenth(np));
+ aPrims2->AddVertex(aSeqTenth(np));
}
- myGroup->AddPrimitiveArray(aPrims, Standard_False);
+ myGroup->AddPrimitiveArray(aPrims2, Standard_False);
}
if (aSeqLines.Length())
{
myGroup->SetPrimitivesAspect (LineAttrib);
Standard_Integer n, np;
const Standard_Integer nbl = aSeqLines.Length() / nbpnts;
- Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(aSeqLines.Length(),nbl);
+ Handle(Graphic3d_ArrayOfPolylines) aPrims3 = new Graphic3d_ArrayOfPolylines(aSeqLines.Length(),nbl);
for (np = 1, n=0; n<nbl; n++) {
- aPrims->AddBound(nbpnts);
+ aPrims3->AddBound(nbpnts);
for (Standard_Integer i=0; i<nbpnts; i++, np++)
- aPrims->AddVertex(aSeqLines(np));
+ aPrims3->AddVertex(aSeqLines(np));
}
- myGroup->AddPrimitiveArray(aPrims, Standard_False);
+ myGroup->AddPrimitiveArray(aPrims3, Standard_False);
}
myGroup->SetMinMaxValues(-myRadius, -myRadius, 0.0, myRadius, myRadius, 0.0);
Nor = gp_Dir(eqPlan);
else
Nor = gp_Dir(0., 0., 1.);
-
- Standard_Integer j = (i - PointsOfArray.Lower()) * 3;
- Normals->SetValue(j + 1, (Standard_ShortReal)Nor.X());
- Normals->SetValue(j + 2, (Standard_ShortReal)Nor.Y());
- Normals->SetValue(j + 3, (Standard_ShortReal)Nor.Z());
+
+ Standard_Integer k = (i - PointsOfArray.Lower()) * 3;
+ Normals->SetValue(k + 1, (Standard_ShortReal)Nor.X());
+ Normals->SetValue(k + 2, (Standard_ShortReal)Nor.Y());
+ Normals->SetValue(k + 3, (Standard_ShortReal)Nor.Z());
}
delete pc;
}
else
{
- Standard_CString aName = anOriginObjectName.ToCString();
- TopoDS_Shape aTDShape = DBRep::Get (aName);
+ Standard_CString aOriginName = anOriginObjectName.ToCString();
+ TopoDS_Shape aTDShape = DBRep::Get (aOriginName);
if (aTDShape.IsNull())
{
std::cout << "vconnect error: object " << anOriginObjectName << " doesn't exist\n";
}
else
{
- Standard_CString aName = anOriginObjectName.ToCString();
- TopoDS_Shape aTDShape = DBRep::Get (aName);
+ Standard_CString aOriginName = anOriginObjectName.ToCString();
+ TopoDS_Shape aTDShape = DBRep::Get (aOriginName);
if (aTDShape.IsNull())
{
std::cout << "vconnect error: object " << anOriginObjectName << " doesn't exist\n";
{
if (GetMapOfAIS().IsBound1 (anIter.Value()))
{
- TCollection_AsciiString aName = GetMapOfAIS().Find1 (anIter.Value());
- std::cout << aCounter << ") " << aName << " (" << anIter.Value()->DynamicType()->Name() << ")";
+ TCollection_AsciiString aCuurrentName = GetMapOfAIS().Find1 (anIter.Value());
+ std::cout << aCounter << ") " << aCuurrentName << " (" << anIter.Value()->DynamicType()->Name() << ")";
}
std::cout << aCounter << ") " << anIter.Value()->DynamicType()->Name();
}
else if (aParam.IsEqual ("-arrow"))
{
- TCollection_AsciiString aParam (theArgVec[++anIt]);
- aParam.LowerCase();
+ TCollection_AsciiString aLocalParam(theArgVec[++anIt]);
+ aLocalParam.LowerCase();
- if (aParam == "external") { theAspect->SetArrowOrientation (Prs3d_DAO_External); }
- if (aParam == "internal") { theAspect->SetArrowOrientation (Prs3d_DAO_Internal); }
- if (aParam == "fit") { theAspect->SetArrowOrientation (Prs3d_DAO_Fit); }
+ if (aLocalParam == "external") { theAspect->SetArrowOrientation (Prs3d_DAO_External); }
+ if (aLocalParam == "internal") { theAspect->SetArrowOrientation (Prs3d_DAO_Internal); }
+ if (aLocalParam == "fit") { theAspect->SetArrowOrientation (Prs3d_DAO_Fit); }
}
else if (aParam.IsEqual ("-arrowlength") || aParam.IsEqual ("-arlen"))
{
}
else if (aParam.IsEqual ("-extension"))
{
- TCollection_AsciiString aParam (theArgVec[++anIt]);
- if (!aParam.IsRealValue())
+ TCollection_AsciiString aLocalParam(theArgVec[++anIt]);
+ if (!aLocalParam.IsRealValue())
{
std::cerr << "Error: extension size for dimension should be real value.\n";
return 1;
}
- theAspect->SetExtensionSize (Draw::Atof (aParam.ToCString()));
+ theAspect->SetExtensionSize (Draw::Atof (aLocalParam.ToCString()));
}
else if (aParam.IsEqual ("-plane"))
{
}
else if (aParam.IsEqual ("-flyout"))
{
- TCollection_AsciiString aParam (theArgVec[++anIt]);
- if (!aParam.IsRealValue())
+ TCollection_AsciiString aLocalParam(theArgVec[++anIt]);
+ if (!aLocalParam.IsRealValue())
{
std::cerr << "Error: flyout for dimension should be real value.\n";
return 1;
}
- theRealParams.Bind ("flyout", Draw::Atof (aParam.ToCString()));
+ theRealParams.Bind ("flyout", Draw::Atof (aLocalParam.ToCString()));
}
else if (aParam.IsEqual ("-value"))
{
- TCollection_AsciiString aParam (theArgVec[++anIt]);
- if (!aParam.IsRealValue())
+ TCollection_AsciiString aLocalParam(theArgVec[++anIt]);
+ if (!aLocalParam.IsRealValue())
{
std::cerr << "Error: dimension value for dimension should be real value.\n";
return 1;
}
- theRealParams.Bind ("value", Draw::Atof (aParam.ToCString()));
+ theRealParams.Bind ("value", Draw::Atof (aLocalParam.ToCString()));
}
else if (aParam.IsEqual ("-modelunits"))
{
- TCollection_AsciiString aParam (theArgVec[++anIt]);
+ TCollection_AsciiString aLocalParam(theArgVec[++anIt]);
- theStringParams.Bind ("modelunits", aParam);
+ theStringParams.Bind ("modelunits", aLocalParam);
}
else if (aParam.IsEqual ("-dispunits"))
{
- TCollection_AsciiString aParam (theArgVec[++anIt]);
+ TCollection_AsciiString aLocalParam(theArgVec[++anIt]);
- theStringParams.Bind ("dispunits", aParam);
+ theStringParams.Bind ("dispunits", aLocalParam);
}
else
{
// Change name of current active window
if (!ViewerTest::CurrentView().IsNull())
{
- TCollection_AsciiString aTitle("3D View - ");
- aTitle = aTitle
+ TCollection_AsciiString anActiveWindowTitle("3D View - ");
+ anActiveWindowTitle = anActiveWindowTitle
+ ViewerTest_myViews.Find2 (ViewerTest::CurrentView());
- SetWindowTitle (ViewerTest::CurrentView()->Window(), aTitle.ToCString());
+ SetWindowTitle (ViewerTest::CurrentView()->Window(), anActiveWindowTitle.ToCString());
}
// Create viewer
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
return 1;
}
- TCollection_AsciiString anArg (theArgVec[anArgIter + 1]);
- if (!anArg.IsIntegerValue())
+ TCollection_AsciiString aFontArg(theArgVec[anArgIter + 1]);
+ if (!aFontArg.IsIntegerValue())
{
std::cout << "Error: HeightFont value should be integer!\n";
return 1;
}
- aTextHeight = anArg.IntegerValue();
+ aTextHeight = aFontArg.IntegerValue();
anArgIter += 1;
}
else if (aFlag == "-textpos")
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
return 1;
}
- TCollection_AsciiString anArg (theArgVec[++anArgIter]);
- anArg.LowerCase();
- if (anArg == "none")
+ TCollection_AsciiString aTextPosArg(theArgVec[++anArgIter]);
+ aTextPosArg.LowerCase();
+ if (aTextPosArg == "none")
{
aLabPosition = Aspect_TOCSP_NONE;
}
- else if (anArg == "left")
+ else if (aTextPosArg == "left")
{
aLabPosition = Aspect_TOCSP_LEFT;
}
- else if (anArg == "right")
+ else if (aTextPosArg == "right")
{
aLabPosition = Aspect_TOCSP_RIGHT;
}
- else if (anArg == "center")
+ else if (aTextPosArg == "center")
{
aLabPosition = Aspect_TOCSP_CENTER;
}
else
{
- std::cout << "Error: unknown position '" << anArg << "'!\n";
+ std::cout << "Error: unknown position '" << aTextPosArg << "'!\n";
return 1;
}
}
{
for (ishape = 1; ishape < nb_shapes; ishape++) // start with second shape
{
- Voxel_BoolDS& voxels = ((Voxel_BoolDS*)myVoxels)[ishape];
- if (voxels.Get(ix, iy, iz))
+ Voxel_BoolDS& anOtherVoxels = ((Voxel_BoolDS*)myVoxels)[ishape];
+ if (anOtherVoxels.Get(ix, iy, iz))
{
myCollisions.Set(ix, iy, iz, Standard_True);
if (!myHasCollisions)
ElSLib::Parameters(plane, pc, uc, vc);
p2dc.SetCoord(uc, vc);
- gp_Vec2d v2dct(p2dc, p2dt);
- dv = v2dct.Magnitude() - Precision::Confusion();
+ gp_Vec2d aVec2dct1(p2dc, p2dt);
+ dv = aVec2dct1.Magnitude() - Precision::Confusion();
Lv.SetLocation(p2dc);
- Lv.SetDirection(v2dct);
+ Lv.SetDirection(aVec2dct1);
// Side 1:
if (mayIntersect(p2d1, p2d2, p2dc, p2dt))
ElSLib::Parameters(plane, pc, uc, vc);
p2dc.SetCoord(uc, vc);
- gp_Vec2d v2dct(p2dc, p2dt);
- dv = v2dct.Magnitude() - Precision::Confusion();
+ gp_Vec2d aVec2dct2(p2dc, p2dt);
+ dv = aVec2dct2.Magnitude() - Precision::Confusion();
Lv.SetLocation(p2dc);
- Lv.SetDirection(v2dct);
+ Lv.SetDirection(aVec2dct2);
// Side 1:
if (mayIntersect(p2d1, p2d2, p2dc, p2dt))
gp_Vec v2(center, p3);
// First, test overlap in the {x,y,z}-directions
- double min,max;
+ double aMin,aMax;
// Find min, max of the triangle in x-direction, and test for overlap in X
- FINDMINMAX(v0.X(), v1.X(), v2.X(), min, max);
- if(min>extents.X() || max<-extents.X()) return false;
+ FINDMINMAX(v0.X(), v1.X(), v2.X(), aMin, aMax);
+ if(aMin>extents.X() || aMax<-extents.X()) return false;
// Same for Y
- FINDMINMAX(v0.Y(), v1.Y(), v2.Y(), min, max);
- if(min>extents.Y() || max<-extents.Y()) return false;
+ FINDMINMAX(v0.Y(), v1.Y(), v2.Y(), aMin, aMax);
+ if(aMin>extents.Y() || aMax<-extents.Y()) return false;
// Same for Z
- FINDMINMAX(v0.Z(), v1.Z(), v2.Z(), min, max);
- if(min>extents.Z() || max<-extents.Z()) return false;
+ FINDMINMAX(v0.Z(), v1.Z(), v2.Z(), aMin, aMax);
+ if(aMin>extents.Z() || aMax<-extents.Z()) return false;
// 2) Test if the box intersects the plane of the triangle
// compute plane equation of triangle: normal*x+d=0
const Standard_Integer ix = itrix.Value();
const Standard_Integer iy = itriy.Value();
const Standard_Integer iz = itriz.Value();
- const Standard_Integer value = itrvalues.Value();
+ const Standard_Integer aValue = itrvalues.Value();
- Set(ix, iy, iz, (value ? Standard_True : Standard_False));
+ Set(ix, iy, iz, (aValue ? Standard_True : Standard_False));
UnSplit(ix, iy, iz);
}
{
for (i = 0; i < (int)myNbPolygons; i++)
{
- const Standard_Integer * arrNodes;
- if (Polygon(i, arrNodes) == 3 &&
- arrNodes[0] >= 0 &&
- arrNodes[0] < nNodes &&
- arrNodes[1] < nNodes &&
- arrNodes[2] < nNodes) // check to avoid previously skipped faces
+ const Standard_Integer * anArrNodes;
+ if (Polygon(i, anArrNodes) == 3 &&
+ anArrNodes[0] >= 0 &&
+ anArrNodes[0] < nNodes &&
+ anArrNodes[1] < nNodes &&
+ anArrNodes[2] < nNodes) // check to avoid previously skipped faces
{
const Standard_Integer * arrIndice;
if (IndiceNormals(i, arrIndice) == 3) {
for (Standard_Integer j = 0; j < 3; j++) {
const gp_XYZ& aNormal = myNormals->Normal (arrIndice[j]);
- Standard_Integer anInd = (mapNodeId(arrNodes[j]) - 1) * 3 + 1;
+ Standard_Integer anInd = (mapNodeId(anArrNodes[j]) - 1) * 3 + 1;
Normals->SetValue (anInd + 0, Standard_ShortReal (aNormal.X()));
Normals->SetValue (anInd + 1, Standard_ShortReal (aNormal.Y()));
Normals->SetValue (anInd + 2, Standard_ShortReal (aNormal.Z()));
if( aSeq.Value(i).FindAttribute(XCAFDoc_GeomTolerance::GetID(),aGeomTolerance))
{
theGeomToleranceObjectSequence.Append(aGeomTolerance->GetObject());
- TDF_LabelSequence aSeq;
- if(myDimTolTool->GetDatumOfTolerLabels(aGeomTolerance->Label(), aSeq))
+ TDF_LabelSequence aLocalSeq;
+ if(myDimTolTool->GetDatumOfTolerLabels(aGeomTolerance->Label(), aLocalSeq))
{
- for(Standard_Integer i = 1; i <= aSeq.Length(); i++)
+ for(Standard_Integer j = 1; j <= aLocalSeq.Length(); j++)
{
Handle(XCAFDoc_Datum) aDatum;
- if(aSeq.Value(i).FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
+ if(aLocalSeq.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
{
theDatumSequence.Append(aDatum->GetObject());
theMap.Bind(theGeomToleranceObjectSequence.Last(), theDatumSequence.Last());
Handle(TDataStd_TreeNode) aRootNode, aLabNode;
if (!RootL.FindAttribute (aRefGuid, aRootNode)) {
- Handle(TDataStd_TreeNode) aRootNode = TDataStd_TreeNode::Set (RootL, aRefGuid);
+ Handle(TDataStd_TreeNode) aRootNodeNew = TDataStd_TreeNode::Set (RootL, aRefGuid);
Handle(TDataStd_TreeNode) aLNode = TDataStd_TreeNode::Set (DocL, aRefGuid);
- aLNode->SetFather (aRootNode);
- aRootNode->SetFirst (aLNode);
+ aLNode->SetFather (aRootNodeNew);
+ aRootNodeNew->SetFirst (aLNode);
}
}
{
const TopoDS_Compound& aComp = aStyleGroupIter.Value();
TopoDS_Iterator aShapeIter (aComp);
- TopoDS_Shape aShape = aShapeIter.Value();
+ TopoDS_Shape aShapeCur = aShapeIter.Value();
aShapeIter.Next();
if (aShapeIter.More())
{
- aShape = aComp;
+ aShapeCur = aComp;
}
- Handle(AIS_ColoredDrawer) aDrawer = CustomAspects (aShape);
+ Handle(AIS_ColoredDrawer) aDrawer = CustomAspects (aShapeCur);
const XCAFPrs_Style& aStyle = aStyleGroupIter.Key();
aDrawer->SetHidden (!aStyle.IsVisible());
Handle(XCAFDoc_GraphNode) aNode;
if(aGDTs.Value(j).FindAttribute(XCAFDoc::DatumTolRefGUID(), aNode) && aNode->NbChildren() > 0)
{
- for(Standard_Integer i = 1; i<=aNode->NbChildren(); i++)
+ for(Standard_Integer k = 1; k<=aNode->NbChildren(); k++)
{
Handle(XCAFDoc_Datum) aDatum;
- if(aNode->GetChild(i)->Label().FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
+ if(aNode->GetChild(k)->Label().FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
{
- TCollection_AsciiString Entry;
- TDF_Tool::Entry(aNode->GetChild(i)->Label(), Entry);
- di << "\n \t \t " << Entry;
+ TCollection_AsciiString anEntry;
+ TDF_Tool::Entry(aNode->GetChild(k)->Label(), anEntry);
+ di << "\n \t \t " << anEntry;
di << " Datum";
}
}
for(;;) {
char aValueChar[32];
Sprintf(aValueChar, "%.15g", anArr1.Value(j));
- TCollection_AsciiString aValueStr(aValueChar);
- aValueStr2 += aValueStr;
+ TCollection_AsciiString aValueStr3(aValueChar);
+ aValueStr2 += aValueStr3;
if (j >= anArr1.Upper()) break;
aValueStr2 += ' ';
j++;
Direction, Dy);
}
else if (Cons == Ninc) { // il n'y a plus rien a faire...
- for(Standard_Integer i = Direction.Lower(); i <= Direction.Upper(); i++) {
+ for(i = Direction.Lower(); i <= Direction.Upper(); i++) {
Direction(i) = 0;
}
Dy = 0;