-// File: ChFiDS_Spine.cxx
-// Created: Thu Nov 18 12:36:53 1993
-// Author: Isabelle GRIGNON
-// <isg@zerox>
-// Modified by isg, Thu Mar 17 09:21:31 1994
+// Created on: 1993-11-18
+// Created by: Isabelle GRIGNON
+// Copyright (c) 1993-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.
+// Modified by isg, Thu Mar 17 09:21:31 1994
-#include <ChFiDS_Spine.ixx>
+#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Curve.hxx>
+#include <ChFiDS_ErrorStatus.hxx>
#include <ChFiDS_HElSpine.hxx>
-#include <ChFiDS_ErrorStatus.hxx>
#include <ChFiDS_ListIteratorOfListOfHElSpine.hxx>
-#include <GCPnts_AbscissaPoint.hxx>
-#include <TopExp.hxx>
-#include <BRep_Tool.hxx>
+#include <ChFiDS_Spine.hxx>
#include <ElCLib.hxx>
+#include <GCPnts_AbscissaPoint.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
#include <Precision.hxx>
+#include <Standard_Type.hxx>
+#include <TopExp.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : ChFiDS_Spine
//purpose :
//=======================================================================
-
ChFiDS_Spine::ChFiDS_Spine():
splitdone(Standard_False),
tolesp(Precision::Confusion()),
Handle(ChFiDS_HElSpine) ChFiDS_Spine::ElSpine(const Standard_Real W) const
{
- ChFiDS_ListIteratorOfListOfHElSpine It(elspines);
- for (; It.More(); It.Next()) {
- Handle(ChFiDS_HElSpine) cur = It.Value();
- Standard_Real uf = cur->FirstParameter();
- Standard_Real ul = cur->LastParameter();
- if(uf <= W && W <= ul) return cur;
- }
- return Handle(ChFiDS_HElSpine)();
+ if (elspines.Extent() == 1)
+ return elspines.First();
+ else
+ {
+ ChFiDS_ListIteratorOfListOfHElSpine It(elspines);
+ for (; It.More(); It.Next()) {
+ Handle(ChFiDS_HElSpine) cur = It.Value();
+ Standard_Real uf = cur->FirstParameter();
+ Standard_Real ul = cur->LastParameter();
+ if(uf <= W && W <= ul) return cur;
+ }
+ return Handle(ChFiDS_HElSpine)();
+ }
}
//=======================================================================
void ChFiDS_Spine::SetFirstParameter(const Standard_Real Par)
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if(Par >= Precision::Confusion())
cout<<"Interior extension at the start of guideline"<<endl;
if(IsPeriodic())
void ChFiDS_Spine::SetLastParameter(const Standard_Real Par)
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Real lll = abscissa->Value(abscissa->Upper());
if((Par - lll) <= -Precision::Confusion())
cout<<"Interior extension at the end of guideline"<<endl;
{
if(IsPeriodic()) Standard_Failure::Raise
("No extension by tangent on periodic contours");
-#ifdef DEB
+#ifdef OCCT_DEBUG
if(W >= Precision::Confusion())
cout<<"Interior extension at start of the guideline"<<endl;
#endif
if(IsPeriodic()) Standard_Failure::Raise
("No extension by tangent periodic contours");
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Real L = W - abscissa->Value(abscissa->Upper());
if(L <= -Precision::Confusion())
cout<<"Interior extension at the end of guideline"<<endl;
void ChFiDS_Spine::Load()
{
if(!abscissa.IsNull()){
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"new load of CE"<<endl;
#endif
}