-// File: BRepBlend_RstRstLineBuilder.cxx
-// Created: Fri Jan 24 10:39:44 1997
-// Author: Jacques GOUSSARD
-// Author: Laurent BOURESCHE
-// <lbo@pomalox.paris1.matra-dtv.fr>
-
-#include <stdio.h>
-
-#include <BRepBlend_RstRstLineBuilder.ixx>
+// Created on: 1997-01-24
+// Created by: Laurent BOURESCHE
+// Copyright (c) 1997-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#include <Adaptor2d_HCurve2d.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <Adaptor3d_HVertex.hxx>
+#include <Adaptor3d_TopolTool.hxx>
+#include <Blend_CurvPointFuncInv.hxx>
+#include <Blend_Point.hxx>
+#include <Blend_RstRstFunction.hxx>
+#include <Blend_SurfCurvFuncInv.hxx>
#include <BRepBlend_BlendTool.hxx>
-#include <TopAbs.hxx>
-#include <IntSurf.hxx>
-#include <math_FunctionSetRoot.hxx>
-#include <gp_Pnt2d.hxx>
+#include <BRepBlend_Extremity.hxx>
+#include <BRepBlend_Line.hxx>
+#include <BRepBlend_RstRstLineBuilder.hxx>
#include <gp_Pnt.hxx>
-#include <gp_Vec2d.hxx>
+#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
+#include <gp_Vec2d.hxx>
+#include <IntSurf.hxx>
+#include <IntSurf_Transition.hxx>
+#include <math_FunctionSetRoot.hxx>
+#include <TopAbs.hxx>
-#ifdef DEB
+#include <stdio.h>
+#ifdef OCCT_DEBUG
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
static Standard_Integer IndexOfSection = 0;
extern Standard_Boolean Blend_GettraceDRAWSECT();
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
//-----------------------------------------------------
// For debug : visualisation of the section
static Standard_Boolean BBPP(const Standard_Real param,
cout<<"dy estimated : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
}
}
-
+#endif
//-----------------------------------------------------
static void Drawsect(const Standard_Real param,
if (State != Blend_OK) {
return;
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
Standard_Boolean recadp1, recadp2, recadrst1, recadrst2;
Standard_Real wp1, wp2, wrst1, wrst2;
-#ifndef DEB
Blend_Status State = Blend_OnRst12;
Standard_Real trst11 = 0., trst12 = 0., trst21 = 0., trst22 = 0.;
-#else
- Blend_Status State;
- Standard_Real trst11, trst12, trst21, trst22;
-#endif
math_Vector infbound(1, 2), supbound(1, 2), tolerance(1, 2);
math_Vector solinvp1(1, 2), solinvp2(1, 2), solinvrst1(1, 3), solinvrst2(1, 3);
Handle(Adaptor3d_HVertex) Vtxp1, Vtxp2, Vtxrst1, Vtxrst2, Vtxc;
if (sens* (parprec - Bound) >= -tolgui) {
return;
}
-#ifndef DEB
Blend_Status State = Blend_OnRst12;
Standard_Real trst11 = 0., trst12 = 0., trst21 = 0., trst22 = 0.;
-#else
- Blend_Status State;
- Standard_Real trst11, trst12, trst21, trst22;
-#endif
- TopAbs_State situonc1, situonc2;
- Blend_DecrochStatus decroch;
+ TopAbs_State situonc1 = TopAbs_UNKNOWN, situonc2 = TopAbs_UNKNOWN;
+ Blend_DecrochStatus decroch = Blend_NoDecroch;
Standard_Boolean Arrive, recadp1, recadp2, recadrst1, recadrst2, echecrecad;
Standard_Real wp1, wp2, wrst1, wrst2;
math_Vector infbound(1, 2), supbound(1, 2);
while (!Arrive) {
Standard_Boolean bonpoint = 1;
-#if 0
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
//debdebdebdebdebdeb
Func.Set(param);
rsnld.Perform(Func, parinit, infbound, supbound);
}
else{
// reframing failed. Leave with PointsConfondus
+#ifdef OCCT_DEBUG
cout<<"reframing failed"<<endl;
+#endif
State = Blend_SamePoints;
}
}
switch (State) {
case Blend_OK :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
previousP.ParameterOnC2(),
previousP.Parameter(), tolesp);
Arrive = Standard_True;
+#ifdef OCCT_DEBUG
if (line->NbPoints()>=2) {
// Show that there is a stop during processing
cout<<"No more advancement in the processing"<<endl;
}
+#endif
}
else {
param = parprec + sens * stepw; // there is no risk to exceed Bound.
case Blend_StepTooSmall :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param,Func);
}
case Blend_OnRst1 :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
case Blend_OnRst2 :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
case Blend_OnRst12 :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
case Blend_SamePoints :
{
// Stop
+#ifdef OCCT_DEBUG
cout << " Mixed points in the processing" << endl;
+#endif
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
Arrive = Standard_True;
}
break;
-#ifndef DEB
default:
break;
-#endif
}
if (Arrive) {
if (sens > 0.) {
math_FunctionSetRoot rsnld(Finv, toler, 30);
rsnld.Perform(Finv, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
math_FunctionSetRoot rsnld(Finv, toler, 30);
rsnld.Perform(Finv, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
math_FunctionSetRoot rsnld(FinvP, toler, 30);
rsnld.Perform(FinvP, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
rsnld.Root(Solinv);
math_FunctionSetRoot rsnld(FinvP, toler, 30);
rsnld.Perform(FinvP, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
rsnld.Root(Solinv);
else {
Extrem.SetVertex(Vtx);
while (Iter->More()) {
-//#ifndef DEB
Handle(Adaptor2d_HCurve2d) arc = Iter->Value();
-//#else
-// Handle(Adaptor2d_HCurve2d)& arc = Iter->Value();
-//#endif
if (arc != Arc) {
Iter->Initialize(arc);
Iter->InitVertexIterator();
if(!prevpointistangent){
prevTg = previousP.TangentOnC1();
}
- Standard_Real Norme, curNorme;
-#ifndef DEB
+ Standard_Real Norme;
Standard_Real prevNorme = 0.;
-#else
- Standard_Real prevNorme;
-#endif
gp_Vec Corde(prevP, Psurf);
Norme = Corde.SquareMagnitude();
- if (!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp * tolesp) {
if (!prevpointistangent) {
prevTg = previousP.TangentOnC2();
}
- Standard_Real Norme, curNorme;
-#ifndef DEB
+ Standard_Real Norme;
Standard_Real prevNorme = 0.;
-#else
- Standard_Real prevNorme;
-#endif
gp_Vec Corde(prevP, Psurf);
Norme = Corde.SquareMagnitude();
- if (!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp * tolesp){
gp_Vec tgrst1, tgrst2;
gp_Vec2d tg2drst1, tg2drst2;
Blend_Status StateRst1, StateRst2;
-#ifndef DEB
IntSurf_TypeTrans trarst1 = IntSurf_Undecided, trarst2 = IntSurf_Undecided;
-#else
- IntSurf_TypeTrans trarst1, trarst2;
-#endif
Blend_Point curpoint;
if (Func.IsSolution(sol, tolesp)) {