mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
13
src/Geom2dAPI/FILES
Normal file
13
src/Geom2dAPI/FILES
Normal file
@@ -0,0 +1,13 @@
|
||||
Geom2dAPI_ExtremaCurveCurve.cxx
|
||||
Geom2dAPI_ExtremaCurveCurve.hxx
|
||||
Geom2dAPI_ExtremaCurveCurve.lxx
|
||||
Geom2dAPI_InterCurveCurve.cxx
|
||||
Geom2dAPI_InterCurveCurve.hxx
|
||||
Geom2dAPI_InterCurveCurve.lxx
|
||||
Geom2dAPI_Interpolate.cxx
|
||||
Geom2dAPI_Interpolate.hxx
|
||||
Geom2dAPI_PointsToBSpline.cxx
|
||||
Geom2dAPI_PointsToBSpline.hxx
|
||||
Geom2dAPI_ProjectPointOnCurve.cxx
|
||||
Geom2dAPI_ProjectPointOnCurve.hxx
|
||||
Geom2dAPI_ProjectPointOnCurve.lxx
|
@@ -1,107 +0,0 @@
|
||||
-- Created on: 1994-03-23
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
package Geom2dAPI
|
||||
|
||||
---Purpose: The Geom2dAPI package provides an Application
|
||||
-- Programming Interface for the Geometry.
|
||||
--
|
||||
-- The API is a set of classes aiming to provide :
|
||||
--
|
||||
-- * High level and simple calls for the most common
|
||||
-- operations.
|
||||
--
|
||||
-- * Keeping an access on the low-level
|
||||
-- implementation of high-level calls.
|
||||
--
|
||||
--
|
||||
-- The API provides classes to call the algorithmes
|
||||
-- of the Geometry
|
||||
--
|
||||
-- * The constructors of the classes provides the
|
||||
-- different constructions methods.
|
||||
--
|
||||
-- * The class keeps as fields the different tools
|
||||
-- used by the algorithmes
|
||||
--
|
||||
-- * The class provides a casting method to get
|
||||
-- automatically the result with a function-like
|
||||
-- call.
|
||||
--
|
||||
-- For example to evaluate the distance <D> between a
|
||||
-- point <P> and a curve <C>, one can writes :
|
||||
--
|
||||
-- D = Geom2dAPI_ProjectPointOnCurve(P,C);
|
||||
--
|
||||
-- or
|
||||
--
|
||||
-- Geom2dAPI_ProjectPointOnCurve PonC(P,C);
|
||||
-- D = PonC.LowerDistance();
|
||||
--
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Geom2d,
|
||||
gp,
|
||||
TColgp,
|
||||
Extrema,
|
||||
Geom2dAdaptor,
|
||||
Geom2dInt,
|
||||
GeomAbs,
|
||||
TColStd,
|
||||
Quantity,
|
||||
Approx,
|
||||
StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- This classes provides algo to evaluate the distance between
|
||||
-- points and curves, curves and curves.
|
||||
------------------------------------------------------------------
|
||||
|
||||
class ProjectPointOnCurve;
|
||||
|
||||
class ExtremaCurveCurve;
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- This classes provides algo to evaluate a curve passing through
|
||||
-- an array of points.
|
||||
------------------------------------------------------------------
|
||||
|
||||
--- Approximation:
|
||||
--
|
||||
class PointsToBSpline;
|
||||
|
||||
|
||||
--- Interpolation:
|
||||
--
|
||||
class Interpolate;
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- This classes provides algo to evaluate an intersection between
|
||||
-- two 2d-Curves.
|
||||
------------------------------------------------------------------
|
||||
|
||||
class InterCurveCurve;
|
||||
|
||||
|
||||
end Geom2dAPI;
|
@@ -1,182 +0,0 @@
|
||||
-- Created on: 1994-03-23
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
class ExtremaCurveCurve from Geom2dAPI
|
||||
|
||||
---Purpose: Describes functions for computing all the extrema
|
||||
-- between two 2D curves.
|
||||
-- An ExtremaCurveCurve algorithm minimizes or
|
||||
-- maximizes the distance between a point on the first
|
||||
-- curve and a point on the second curve. Thus, it
|
||||
-- computes the start point and end point of
|
||||
-- perpendiculars common to the two curves (an
|
||||
-- intersection point is not an extremum except where
|
||||
-- the two curves are tangential at this point).
|
||||
-- Solutions consist of pairs of points, and an extremum
|
||||
-- is considered to be a segment joining the two points of a solution.
|
||||
-- An ExtremaCurveCurve object provides a framework for:
|
||||
-- - defining the construction of the extrema,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the results.
|
||||
-- Warning
|
||||
-- In some cases, the nearest points between two
|
||||
-- curves do not correspond to one of the computed
|
||||
-- extrema. Instead, they may be given by:
|
||||
-- - a limit point of one curve and one of the following:
|
||||
-- - its orthogonal projection on the other curve,
|
||||
-- - a limit point of the other curve; or
|
||||
-- - an intersection point between the two curves.
|
||||
|
||||
uses
|
||||
Curve from Geom2d,
|
||||
Curve from Geom2dAdaptor,
|
||||
ExtCC2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create(C1 , C2 : Curve from Geom2d;
|
||||
U1min, U1max : Parameter from Quantity;
|
||||
U2min, U2max : Parameter from Quantity)
|
||||
---Purpose: Computes the extrema between
|
||||
-- - the portion of the curve C1 limited by the two
|
||||
-- points of parameter (U1min,U1max), and
|
||||
-- - the portion of the curve C2 limited by the two
|
||||
-- points of parameter (U2min,U2max).
|
||||
-- Warning
|
||||
-- Use the function NbExtrema to obtain the number
|
||||
-- of solutions. If this algorithm fails, NbExtrema returns 0.
|
||||
returns ExtremaCurveCurve from Geom2dAPI;
|
||||
|
||||
|
||||
--------------------------------------------
|
||||
-- on ne peut pas utiliser le constructeur vide
|
||||
-- car n existe pas dans Geom2dExtrema_ExtCC
|
||||
--------------------------------------------
|
||||
-- Init(me : in out;
|
||||
-- C1 , C2 : Curve from Geom2d;
|
||||
-- U1min, U1max : Parameter from Quantity;
|
||||
-- U2min, U2max : Parameter from Quantity)
|
||||
-- is static;
|
||||
|
||||
|
||||
NbExtrema(me)
|
||||
---Purpose: Returns the number of extrema computed by this algorithm.
|
||||
-- Note: if this algorithm fails, NbExtrema returns 0.
|
||||
returns Integer from Standard
|
||||
---C++: alias "Standard_EXPORT operator Standard_Integer() const;"
|
||||
is static;
|
||||
|
||||
|
||||
Points(me; Index : Integer from Standard;
|
||||
P1, P2 : out Pnt2d from gp )
|
||||
---Purpose: Returns the points P1 on the first curve and P2 on
|
||||
-- the second curve, which are the ends of the
|
||||
-- extremum of index Index computed by this algorithm.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [
|
||||
-- 1,NbExtrema ], where NbExtrema is the
|
||||
-- number of extrema computed by this algorithm.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Parameters(me; Index : Integer from Standard;
|
||||
U1, U2 : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters U1 of the point on the first
|
||||
-- curve and U2 of the point on the second curve, which
|
||||
-- are the ends of the extremum of index Index
|
||||
-- computed by this algorithm.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [
|
||||
-- 1,NbExtrema ], where NbExtrema is the
|
||||
-- number of extrema computed by this algorithm.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Distance(me; Index : Integer from Standard)
|
||||
returns Length from Quantity
|
||||
---Purpose: Computes the distance between the end points of the
|
||||
-- extremum of index Index computed by this algorithm.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [
|
||||
-- 1,NbExtrema ], where NbExtrema is the
|
||||
-- number of extrema computed by this algorithm.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
|
||||
NearestPoints(me; P1, P2 : out Pnt2d from gp)
|
||||
---Purpose: Returns the points P1 on the first curve and P2 on
|
||||
-- the second curve, which are the ends of the shortest
|
||||
-- extremum computed by this algorithm.
|
||||
-- Exceptions StdFail_NotDone if this algorithm fails.
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistanceParameters(me; U1, U2 : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters U1 of the point on the first
|
||||
-- curve and U2 of the point on the second curve, which
|
||||
-- are the ends of the shortest extremum computed by this algorithm.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if this algorithm fails.
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistance(me)
|
||||
---Purpose: Computes the distance between the end points of the
|
||||
-- shortest extremum computed by this algorithm.
|
||||
-- Exceptions - StdFail_NotDone if this algorithm fails.
|
||||
returns Length from Quantity
|
||||
---C++: alias "Standard_EXPORT operator Standard_Real() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Extrema(me)
|
||||
---Level: Advanced
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
returns ExtCC2d from Extrema
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIsDone: Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtCC : ExtCC2d from Extrema;
|
||||
myC1 : Curve from Geom2dAdaptor;
|
||||
myC2 : Curve from Geom2dAdaptor;
|
||||
|
||||
end ExtremaCurveCurve;
|
@@ -14,28 +14,28 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Geom2dAPI_ExtremaCurveCurve.ixx>
|
||||
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Extrema_ExtCC2d.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAPI_ExtremaCurveCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Geom2dAPI_ExtremaCurveCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Geom2dAPI_ExtremaCurveCurve::Geom2dAPI_ExtremaCurveCurve()
|
||||
//{
|
||||
//}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Geom2dAPI_ExtremaCurveCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Geom2dAPI_ExtremaCurveCurve::Geom2dAPI_ExtremaCurveCurve
|
||||
(const Handle(Geom2d_Curve)& C1,
|
||||
const Handle(Geom2d_Curve)& C2,
|
||||
|
159
src/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.hxx
Normal file
159
src/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.hxx
Normal file
@@ -0,0 +1,159 @@
|
||||
// Created on: 1994-03-23
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Geom2dAPI_ExtremaCurveCurve_HeaderFile
|
||||
#define _Geom2dAPI_ExtremaCurveCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtCC2d.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class Geom2d_Curve;
|
||||
class gp_Pnt2d;
|
||||
class Extrema_ExtCC2d;
|
||||
|
||||
|
||||
//! Describes functions for computing all the extrema
|
||||
//! between two 2D curves.
|
||||
//! An ExtremaCurveCurve algorithm minimizes or
|
||||
//! maximizes the distance between a point on the first
|
||||
//! curve and a point on the second curve. Thus, it
|
||||
//! computes the start point and end point of
|
||||
//! perpendiculars common to the two curves (an
|
||||
//! intersection point is not an extremum except where
|
||||
//! the two curves are tangential at this point).
|
||||
//! Solutions consist of pairs of points, and an extremum
|
||||
//! is considered to be a segment joining the two points of a solution.
|
||||
//! An ExtremaCurveCurve object provides a framework for:
|
||||
//! - defining the construction of the extrema,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the results.
|
||||
//! Warning
|
||||
//! In some cases, the nearest points between two
|
||||
//! curves do not correspond to one of the computed
|
||||
//! extrema. Instead, they may be given by:
|
||||
//! - a limit point of one curve and one of the following:
|
||||
//! - its orthogonal projection on the other curve,
|
||||
//! - a limit point of the other curve; or
|
||||
//! - an intersection point between the two curves.
|
||||
class Geom2dAPI_ExtremaCurveCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Computes the extrema between
|
||||
//! - the portion of the curve C1 limited by the two
|
||||
//! points of parameter (U1min,U1max), and
|
||||
//! - the portion of the curve C2 limited by the two
|
||||
//! points of parameter (U2min,U2max).
|
||||
//! Warning
|
||||
//! Use the function NbExtrema to obtain the number
|
||||
//! of solutions. If this algorithm fails, NbExtrema returns 0.
|
||||
Standard_EXPORT Geom2dAPI_ExtremaCurveCurve(const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const Quantity_Parameter U1min, const Quantity_Parameter U1max, const Quantity_Parameter U2min, const Quantity_Parameter U2max);
|
||||
|
||||
//! Returns the number of extrema computed by this algorithm.
|
||||
//! Note: if this algorithm fails, NbExtrema returns 0.
|
||||
Standard_EXPORT Standard_Integer NbExtrema() const;
|
||||
Standard_EXPORT operator Standard_Integer() const;
|
||||
|
||||
//! Returns the points P1 on the first curve and P2 on
|
||||
//! the second curve, which are the ends of the
|
||||
//! extremum of index Index computed by this algorithm.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [
|
||||
//! 1,NbExtrema ], where NbExtrema is the
|
||||
//! number of extrema computed by this algorithm.
|
||||
Standard_EXPORT void Points (const Standard_Integer Index, gp_Pnt2d& P1, gp_Pnt2d& P2) const;
|
||||
|
||||
//! Returns the parameters U1 of the point on the first
|
||||
//! curve and U2 of the point on the second curve, which
|
||||
//! are the ends of the extremum of index Index
|
||||
//! computed by this algorithm.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [
|
||||
//! 1,NbExtrema ], where NbExtrema is the
|
||||
//! number of extrema computed by this algorithm.
|
||||
Standard_EXPORT void Parameters (const Standard_Integer Index, Quantity_Parameter& U1, Quantity_Parameter& U2) const;
|
||||
|
||||
//! Computes the distance between the end points of the
|
||||
//! extremum of index Index computed by this algorithm.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [
|
||||
//! 1,NbExtrema ], where NbExtrema is the
|
||||
//! number of extrema computed by this algorithm.
|
||||
Standard_EXPORT Quantity_Length Distance (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the points P1 on the first curve and P2 on
|
||||
//! the second curve, which are the ends of the shortest
|
||||
//! extremum computed by this algorithm.
|
||||
//! Exceptions StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT void NearestPoints (gp_Pnt2d& P1, gp_Pnt2d& P2) const;
|
||||
|
||||
//! Returns the parameters U1 of the point on the first
|
||||
//! curve and U2 of the point on the second curve, which
|
||||
//! are the ends of the shortest extremum computed by this algorithm.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT void LowerDistanceParameters (Quantity_Parameter& U1, Quantity_Parameter& U2) const;
|
||||
|
||||
//! Computes the distance between the end points of the
|
||||
//! shortest extremum computed by this algorithm.
|
||||
//! Exceptions - StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT Quantity_Length LowerDistance() const;
|
||||
Standard_EXPORT operator Standard_Real() const;
|
||||
|
||||
const Extrema_ExtCC2d& Extrema() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtCC2d myExtCC;
|
||||
Geom2dAdaptor_Curve myC1;
|
||||
Geom2dAdaptor_Curve myC2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Geom2dAPI_ExtremaCurveCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Geom2dAPI_ExtremaCurveCurve_HeaderFile
|
@@ -1,182 +0,0 @@
|
||||
-- Created on: 1994-03-24
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
class InterCurveCurve from Geom2dAPI
|
||||
|
||||
---Purpose: This class implements methods for computing
|
||||
-- - the intersections between two 2D curves,
|
||||
-- - the self-intersections of a 2D curve.
|
||||
-- Using the InterCurveCurve algorithm allows to get the following results:
|
||||
-- - intersection points in the case of cross intersections,
|
||||
-- - intersection segments in the case of tangential intersections,
|
||||
-- - nothing in the case of no intersections.
|
||||
uses
|
||||
Curve from Geom2d,
|
||||
Pnt2d from gp,
|
||||
GInter from Geom2dInt
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NullObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Create an empty intersector. Use the
|
||||
-- function Init for further initialization of the intersection
|
||||
-- algorithm by curves or curve.
|
||||
---Level: Public
|
||||
returns InterCurveCurve from Geom2dAPI;
|
||||
|
||||
|
||||
Create(C1 : Curve from Geom2d;
|
||||
C2 : Curve from Geom2d;
|
||||
Tol : Real from Standard = 1.0e-6)
|
||||
---Purpose: Creates an object and computes the
|
||||
-- intersections between the curves C1 and C2.
|
||||
returns InterCurveCurve from Geom2dAPI;
|
||||
|
||||
|
||||
Create(C1 : Curve from Geom2d;
|
||||
Tol : Real from Standard = 1.0e-6)
|
||||
---Purpose:
|
||||
-- Creates an object and computes self-intersections of the curve C1.
|
||||
-- Tolerance value Tol, defaulted to 1.0e-6, defines the precision of
|
||||
-- computing the intersection points.
|
||||
-- In case of a tangential intersection, Tol also defines the
|
||||
-- size of intersection segments (limited portions of the curves)
|
||||
-- where the distance between all points from two curves (or a curve
|
||||
-- in case of self-intersection) is less than Tol.
|
||||
-- Warning
|
||||
-- Use functions NbPoints and NbSegments to obtain the number of
|
||||
-- solutions. If the algorithm finds no intersections NbPoints and
|
||||
-- NbSegments return 0.
|
||||
returns InterCurveCurve from Geom2dAPI;
|
||||
|
||||
|
||||
Init( me : in out;
|
||||
C1 : Curve from Geom2d;
|
||||
C2 : Curve from Geom2d;
|
||||
Tol : Real from Standard = 1.0e-6)
|
||||
---Purpose: Initializes an algorithm with the
|
||||
-- given arguments and computes the intersections between the curves C1. and C2.
|
||||
is static;
|
||||
|
||||
|
||||
Init( me : in out;
|
||||
C1 : Curve from Geom2d;
|
||||
Tol : Real from Standard = 1.0e-6)
|
||||
---Purpose: Initializes an algorithm with the
|
||||
-- given arguments and computes the self-intersections of the curve C1.
|
||||
-- Tolerance value Tol, defaulted to 1.0e-6, defines the precision of
|
||||
-- computing the intersection points. In case of a tangential
|
||||
-- intersection, Tol also defines the size of intersection segments
|
||||
-- (limited portions of the curves) where the distance between all
|
||||
-- points from two curves (or a curve in case of self-intersection) is less than Tol.
|
||||
-- Warning
|
||||
-- Use functions NbPoints and NbSegments to obtain the number
|
||||
-- of solutions. If the algorithm finds no intersections NbPoints
|
||||
-- and NbSegments return 0.
|
||||
is static;
|
||||
|
||||
|
||||
NbPoints(me)
|
||||
returns Integer from Standard
|
||||
---Purpose: Returns the number of intersection-points in case of cross intersections.
|
||||
-- NbPoints returns 0 if no intersections were found.
|
||||
is static;
|
||||
|
||||
|
||||
Point(me; Index : Integer from Standard)
|
||||
returns Pnt2d from gp
|
||||
---Purpose: Returns the intersection point of index Index.
|
||||
-- Intersection points are computed in case of cross intersections with a
|
||||
-- precision equal to the tolerance value assigned at the time of
|
||||
-- construction or in the function Init (this value is defaulted to 1.0e-6).
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if index is not in the range [ 1,NbPoints ], where
|
||||
-- NbPoints is the number of computed intersection points
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
NbSegments(me)
|
||||
returns Integer from Standard
|
||||
---Purpose: Returns the number of tangential intersections.
|
||||
-- NbSegments returns 0 if no intersections were found
|
||||
is static;
|
||||
|
||||
|
||||
Segment(me; Index : Integer from Standard;
|
||||
Curve1, Curve2 : in out Curve from Geom2d)
|
||||
---Purpose: Use this syntax only to get
|
||||
-- solutions of tangential intersection between two curves.
|
||||
-- Output values Curve1 and Curve2 are the intersection segments on the
|
||||
-- first curve and on the second curve accordingly. Parameter Index
|
||||
-- defines a number of computed solution.
|
||||
-- An intersection segment is a portion of an initial curve limited
|
||||
-- by two points. The distance from each point of this segment to the
|
||||
-- other curve is less or equal to the tolerance value assigned at the
|
||||
-- time of construction or in function Init (this value is defaulted to 1.0e-6).
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
-- where NbSegments is the number of computed tangential intersections.
|
||||
-- Standard_NullObject if the algorithm is initialized for the
|
||||
-- computing of self-intersections on a curve.
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NullObject from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Segment(me; Index : Integer from Standard;
|
||||
Curve1 : in out Curve from Geom2d)
|
||||
---Purpose: Use this syntax to get solutions of
|
||||
-- tangential intersections only in case of a self-intersected curve.
|
||||
-- Output value Curve1 is the intersection segment of the curve
|
||||
-- defined by number Index. An intersection segment is a
|
||||
-- portion of the initial curve limited by two points. The distance
|
||||
-- between each point of this segment to another portion of the curve is
|
||||
-- less or equal to the tolerance value assigned at the time of
|
||||
-- construction or in the function Init (this value is defaulted to 1.0e-6).
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
-- where NbSegments is the number of computed tangential intersections.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Intersector(me)
|
||||
---Purpose: return the algorithmic object from Intersection.
|
||||
---Level: Advanced
|
||||
returns GInter from Geom2dInt
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
myIsDone : Boolean from Standard;
|
||||
myCurve1 : Curve from Geom2d;
|
||||
myCurve2 : Curve from Geom2d;
|
||||
myIntersector : GInter from Geom2dInt;
|
||||
|
||||
end InterCurveCurve;
|
@@ -14,21 +14,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Geom2dAPI_InterCurveCurve.ixx>
|
||||
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAPI_InterCurveCurve.hxx>
|
||||
#include <Geom2dInt_GInter.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <IntRes2d_IntersectionSegment.hxx>
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Geom2dAPI_InterCurveCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Geom2dAPI_InterCurveCurve::Geom2dAPI_InterCurveCurve()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
166
src/Geom2dAPI/Geom2dAPI_InterCurveCurve.hxx
Normal file
166
src/Geom2dAPI/Geom2dAPI_InterCurveCurve.hxx
Normal file
@@ -0,0 +1,166 @@
|
||||
// Created on: 1994-03-24
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Geom2dAPI_InterCurveCurve_HeaderFile
|
||||
#define _Geom2dAPI_InterCurveCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Geom2dInt_GInter.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Geom2d_Curve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NullObject;
|
||||
class gp_Pnt2d;
|
||||
class Geom2dInt_GInter;
|
||||
|
||||
|
||||
//! This class implements methods for computing
|
||||
//! - the intersections between two 2D curves,
|
||||
//! - the self-intersections of a 2D curve.
|
||||
//! Using the InterCurveCurve algorithm allows to get the following results:
|
||||
//! - intersection points in the case of cross intersections,
|
||||
//! - intersection segments in the case of tangential intersections,
|
||||
//! - nothing in the case of no intersections.
|
||||
class Geom2dAPI_InterCurveCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Create an empty intersector. Use the
|
||||
//! function Init for further initialization of the intersection
|
||||
//! algorithm by curves or curve.
|
||||
Standard_EXPORT Geom2dAPI_InterCurveCurve();
|
||||
|
||||
//! Creates an object and computes the
|
||||
//! intersections between the curves C1 and C2.
|
||||
Standard_EXPORT Geom2dAPI_InterCurveCurve(const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const Standard_Real Tol = 1.0e-6);
|
||||
|
||||
|
||||
//! Creates an object and computes self-intersections of the curve C1.
|
||||
//! Tolerance value Tol, defaulted to 1.0e-6, defines the precision of
|
||||
//! computing the intersection points.
|
||||
//! In case of a tangential intersection, Tol also defines the
|
||||
//! size of intersection segments (limited portions of the curves)
|
||||
//! where the distance between all points from two curves (or a curve
|
||||
//! in case of self-intersection) is less than Tol.
|
||||
//! Warning
|
||||
//! Use functions NbPoints and NbSegments to obtain the number of
|
||||
//! solutions. If the algorithm finds no intersections NbPoints and
|
||||
//! NbSegments return 0.
|
||||
Standard_EXPORT Geom2dAPI_InterCurveCurve(const Handle(Geom2d_Curve)& C1, const Standard_Real Tol = 1.0e-6);
|
||||
|
||||
//! Initializes an algorithm with the
|
||||
//! given arguments and computes the intersections between the curves C1. and C2.
|
||||
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const Standard_Real Tol = 1.0e-6);
|
||||
|
||||
//! Initializes an algorithm with the
|
||||
//! given arguments and computes the self-intersections of the curve C1.
|
||||
//! Tolerance value Tol, defaulted to 1.0e-6, defines the precision of
|
||||
//! computing the intersection points. In case of a tangential
|
||||
//! intersection, Tol also defines the size of intersection segments
|
||||
//! (limited portions of the curves) where the distance between all
|
||||
//! points from two curves (or a curve in case of self-intersection) is less than Tol.
|
||||
//! Warning
|
||||
//! Use functions NbPoints and NbSegments to obtain the number
|
||||
//! of solutions. If the algorithm finds no intersections NbPoints
|
||||
//! and NbSegments return 0.
|
||||
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C1, const Standard_Real Tol = 1.0e-6);
|
||||
|
||||
//! Returns the number of intersection-points in case of cross intersections.
|
||||
//! NbPoints returns 0 if no intersections were found.
|
||||
Standard_EXPORT Standard_Integer NbPoints() const;
|
||||
|
||||
//! Returns the intersection point of index Index.
|
||||
//! Intersection points are computed in case of cross intersections with a
|
||||
//! precision equal to the tolerance value assigned at the time of
|
||||
//! construction or in the function Init (this value is defaulted to 1.0e-6).
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if index is not in the range [ 1,NbPoints ], where
|
||||
//! NbPoints is the number of computed intersection points
|
||||
Standard_EXPORT gp_Pnt2d Point (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the number of tangential intersections.
|
||||
//! NbSegments returns 0 if no intersections were found
|
||||
Standard_EXPORT Standard_Integer NbSegments() const;
|
||||
|
||||
//! Use this syntax only to get
|
||||
//! solutions of tangential intersection between two curves.
|
||||
//! Output values Curve1 and Curve2 are the intersection segments on the
|
||||
//! first curve and on the second curve accordingly. Parameter Index
|
||||
//! defines a number of computed solution.
|
||||
//! An intersection segment is a portion of an initial curve limited
|
||||
//! by two points. The distance from each point of this segment to the
|
||||
//! other curve is less or equal to the tolerance value assigned at the
|
||||
//! time of construction or in function Init (this value is defaulted to 1.0e-6).
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
//! where NbSegments is the number of computed tangential intersections.
|
||||
//! Standard_NullObject if the algorithm is initialized for the
|
||||
//! computing of self-intersections on a curve.
|
||||
Standard_EXPORT void Segment (const Standard_Integer Index, Handle(Geom2d_Curve)& Curve1, Handle(Geom2d_Curve)& Curve2) const;
|
||||
|
||||
//! Use this syntax to get solutions of
|
||||
//! tangential intersections only in case of a self-intersected curve.
|
||||
//! Output value Curve1 is the intersection segment of the curve
|
||||
//! defined by number Index. An intersection segment is a
|
||||
//! portion of the initial curve limited by two points. The distance
|
||||
//! between each point of this segment to another portion of the curve is
|
||||
//! less or equal to the tolerance value assigned at the time of
|
||||
//! construction or in the function Init (this value is defaulted to 1.0e-6).
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
//! where NbSegments is the number of computed tangential intersections.
|
||||
Standard_EXPORT void Segment (const Standard_Integer Index, Handle(Geom2d_Curve)& Curve1) const;
|
||||
|
||||
//! return the algorithmic object from Intersection.
|
||||
const Geom2dInt_GInter& Intersector() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom2d_Curve) myCurve1;
|
||||
Handle(Geom2d_Curve) myCurve2;
|
||||
Geom2dInt_GInter myIntersector;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Geom2dAPI_InterCurveCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Geom2dAPI_InterCurveCurve_HeaderFile
|
@@ -1,158 +0,0 @@
|
||||
-- Created on: 1994-08-18
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
class Interpolate from Geom2dAPI
|
||||
|
||||
---Purpose: This class is used to interpolate a BsplineCurve
|
||||
-- passing through an array of points, with a C2
|
||||
-- Continuity if tangency is not requested at the point.
|
||||
-- If tangency is requested at the point the continuity will
|
||||
-- be C1. If Perodicity is requested the curve will be closed
|
||||
-- and the junction will be the first point given. The curve will than be only C1
|
||||
-- The curve is defined by a table of points through which it passes, and if required
|
||||
-- by a parallel table of reals which gives the value of the parameter of each point through
|
||||
-- which the resulting BSpline curve passes, and by vectors tangential to these points.
|
||||
-- An Interpolate object provides a framework for: defining the constraints of the BSpline curve,
|
||||
-- - implementing the interpolation algorithm, and consulting the results.
|
||||
|
||||
--
|
||||
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Vec2d from gp,
|
||||
Array1OfPnt2d from TColgp,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
Array1OfVec2d from TColgp,
|
||||
HArray1OfBoolean from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
HArray1OfVec2d from TColgp,
|
||||
BSplineCurve from Geom2d
|
||||
|
||||
raises
|
||||
NotDone from StdFail,
|
||||
ConstructionError from Standard
|
||||
is
|
||||
|
||||
Create(Points : HArray1OfPnt2d from TColgp ;
|
||||
PeriodicFlag : Boolean from Standard ;
|
||||
Tolerance : Real)
|
||||
---Purpose: Tolerance is to check if the points are not too close to one an other
|
||||
-- It is also used to check if the tangent vector is not too small.
|
||||
-- There should be at least 2 points
|
||||
-- if PeriodicFlag is True then the curve will be periodic.
|
||||
|
||||
returns Interpolate from Geom2dAPI
|
||||
|
||||
raises ConstructionError from Standard ;
|
||||
|
||||
Create(Points : HArray1OfPnt2d from TColgp ;
|
||||
Parameters : HArray1OfReal from TColStd;
|
||||
PeriodicFlag : Boolean from Standard;
|
||||
Tolerance : Real)
|
||||
---Purpose: if PeriodicFlag is True then the curve will be periodic
|
||||
-- Warning:
|
||||
-- There should be as many parameters as there are points
|
||||
-- except if PeriodicFlag is True : then there should be one more
|
||||
-- parameter to close the curve
|
||||
|
||||
returns Interpolate from Geom2dAPI
|
||||
|
||||
raises ConstructionError from Standard ;
|
||||
Load(me : in out;
|
||||
InitialTangent : Vec2d from gp;
|
||||
FinalTangent : Vec2d from gp)
|
||||
---Purpose: Assigns this constrained BSpline curve to be
|
||||
-- tangential to vectors InitialTangent and FinalTangent
|
||||
-- at its first and last points respectively (i.e.
|
||||
-- the first and last points of the table of
|
||||
-- points through which the curve passes, as
|
||||
-- defined at the time of initialization).
|
||||
|
||||
is static ;
|
||||
|
||||
Load(me : in out;
|
||||
Tangents : Array1OfVec2d from TColgp ;
|
||||
TangentFlags : HArray1OfBoolean from TColStd)
|
||||
is static;
|
||||
---Purpose: Assigns this constrained BSpline curve to be
|
||||
-- tangential to vectors defined in the table Tangents,
|
||||
-- which is parallel to the table of points
|
||||
-- through which the curve passes, as
|
||||
-- defined at the time of initialization. Vectors
|
||||
-- in the table Tangents are defined only if
|
||||
-- the flag given in the parallel table
|
||||
-- TangentFlags is true: only these vectors
|
||||
-- are set as tangency constraints.
|
||||
|
||||
|
||||
ClearTangents(me : in out) ;
|
||||
---Purpose: Clears all tangency constraints on this
|
||||
-- constrained BSpline curve (as initialized by the function Load).
|
||||
|
||||
Perform(me : in out) ;
|
||||
---Purpose: Computes the constrained BSpline curve. Use the function IsDone to verify that the
|
||||
-- computation is successful, and then the function Curve to obtain the result.
|
||||
|
||||
Curve(me)
|
||||
returns BSplineCurve from Geom2d
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator Handle(Geom2d_BSplineCurve)() const;"
|
||||
---Purpose: Returns the computed BSpline curve. Raises StdFail_NotDone if the interpolation fails.
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
IsDone(me)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
--- Purpose: Returns true if the constrained BSpline curve is successfully constructed.
|
||||
-- Note: in this case, the result is given by the function Curve.
|
||||
|
||||
PerformNonPeriodic(me : in out)
|
||||
---Purpose: Interpolates in a non periodic fashion
|
||||
is private ;
|
||||
|
||||
PerformPeriodic(me : in out)
|
||||
---Purpose: Interpolates in a C1 periodic fashion
|
||||
|
||||
is private ;
|
||||
|
||||
fields
|
||||
|
||||
myTolerance : Real from Standard ;
|
||||
-- the 3D tolerance to check for degenerate points
|
||||
myPoints : HArray1OfPnt2d from TColgp ;
|
||||
-- the points to interpolates
|
||||
myIsDone : Boolean from Standard ;
|
||||
-- the algorithm did complete OK if Standard_True
|
||||
myCurve : BSplineCurve from Geom2d ;
|
||||
-- the interpolated curve
|
||||
myTangents : HArray1OfVec2d from TColgp ;
|
||||
-- the tangents only defined at slot i if
|
||||
-- myTangenFlags->Value(i) is Standard_True
|
||||
myTangentFlags : HArray1OfBoolean from TColStd ;
|
||||
-- the flags defining the tangents
|
||||
myParameters : HArray1OfReal from TColStd ;
|
||||
-- the parameters used for the cubic interpolation
|
||||
myPeriodic : Boolean from Standard ;
|
||||
-- if Standard_True the curve will be periodic
|
||||
myTangentRequest : Boolean from Standard ;
|
||||
-- Tangents are given if True False otherwise
|
||||
|
||||
end Interpolate;
|
@@ -16,22 +16,23 @@
|
||||
|
||||
// 8-Aug-95 : xab : interpolation uses BSplCLib::Interpolate
|
||||
|
||||
#include <Geom2dAPI_Interpolate.ixx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <PLib.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2dAPI_Interpolate.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <PLib.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_Array1OfBoolean.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean CheckPoints(const TColgp_Array1OfPnt2d& PointArray,
|
||||
const Standard_Real Tolerance)
|
||||
{
|
||||
|
141
src/Geom2dAPI/Geom2dAPI_Interpolate.hxx
Normal file
141
src/Geom2dAPI/Geom2dAPI_Interpolate.hxx
Normal file
@@ -0,0 +1,141 @@
|
||||
// Created on: 1994-08-18
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Geom2dAPI_Interpolate_HeaderFile
|
||||
#define _Geom2dAPI_Interpolate_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColgp_HArray1OfVec2d.hxx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColgp_Array1OfVec2d.hxx>
|
||||
class Geom2d_BSplineCurve;
|
||||
class StdFail_NotDone;
|
||||
class Standard_ConstructionError;
|
||||
class gp_Vec2d;
|
||||
|
||||
|
||||
//! This class is used to interpolate a BsplineCurve
|
||||
//! passing through an array of points, with a C2
|
||||
//! Continuity if tangency is not requested at the point.
|
||||
//! If tangency is requested at the point the continuity will
|
||||
//! be C1. If Perodicity is requested the curve will be closed
|
||||
//! and the junction will be the first point given. The curve will than be only C1
|
||||
//! The curve is defined by a table of points through which it passes, and if required
|
||||
//! by a parallel table of reals which gives the value of the parameter of each point through
|
||||
//! which the resulting BSpline curve passes, and by vectors tangential to these points.
|
||||
//! An Interpolate object provides a framework for: defining the constraints of the BSpline curve,
|
||||
//! - implementing the interpolation algorithm, and consulting the results.
|
||||
class Geom2dAPI_Interpolate
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Tolerance is to check if the points are not too close to one an other
|
||||
//! It is also used to check if the tangent vector is not too small.
|
||||
//! There should be at least 2 points
|
||||
//! if PeriodicFlag is True then the curve will be periodic.
|
||||
Standard_EXPORT Geom2dAPI_Interpolate(const Handle(TColgp_HArray1OfPnt2d)& Points, const Standard_Boolean PeriodicFlag, const Standard_Real Tolerance);
|
||||
|
||||
//! if PeriodicFlag is True then the curve will be periodic
|
||||
//! Warning:
|
||||
//! There should be as many parameters as there are points
|
||||
//! except if PeriodicFlag is True : then there should be one more
|
||||
//! parameter to close the curve
|
||||
Standard_EXPORT Geom2dAPI_Interpolate(const Handle(TColgp_HArray1OfPnt2d)& Points, const Handle(TColStd_HArray1OfReal)& Parameters, const Standard_Boolean PeriodicFlag, const Standard_Real Tolerance);
|
||||
|
||||
//! Assigns this constrained BSpline curve to be
|
||||
//! tangential to vectors InitialTangent and FinalTangent
|
||||
//! at its first and last points respectively (i.e.
|
||||
//! the first and last points of the table of
|
||||
//! points through which the curve passes, as
|
||||
//! defined at the time of initialization).
|
||||
Standard_EXPORT void Load (const gp_Vec2d& InitialTangent, const gp_Vec2d& FinalTangent);
|
||||
|
||||
//! Assigns this constrained BSpline curve to be
|
||||
//! tangential to vectors defined in the table Tangents,
|
||||
//! which is parallel to the table of points
|
||||
//! through which the curve passes, as
|
||||
//! defined at the time of initialization. Vectors
|
||||
//! in the table Tangents are defined only if
|
||||
//! the flag given in the parallel table
|
||||
//! TangentFlags is true: only these vectors
|
||||
//! are set as tangency constraints.
|
||||
Standard_EXPORT void Load (const TColgp_Array1OfVec2d& Tangents, const Handle(TColStd_HArray1OfBoolean)& TangentFlags);
|
||||
|
||||
//! Clears all tangency constraints on this
|
||||
//! constrained BSpline curve (as initialized by the function Load).
|
||||
Standard_EXPORT void ClearTangents();
|
||||
|
||||
//! Computes the constrained BSpline curve. Use the function IsDone to verify that the
|
||||
//! computation is successful, and then the function Curve to obtain the result.
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
//! Returns the computed BSpline curve. Raises StdFail_NotDone if the interpolation fails.
|
||||
Standard_EXPORT const Handle(Geom2d_BSplineCurve)& Curve() const;
|
||||
Standard_EXPORT operator Handle(Geom2d_BSplineCurve)() const;
|
||||
|
||||
//! Returns true if the constrained BSpline curve is successfully constructed.
|
||||
//! Note: in this case, the result is given by the function Curve.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Interpolates in a non periodic fashion
|
||||
Standard_EXPORT void PerformNonPeriodic();
|
||||
|
||||
//! Interpolates in a C1 periodic fashion
|
||||
Standard_EXPORT void PerformPeriodic();
|
||||
|
||||
|
||||
Standard_Real myTolerance;
|
||||
Handle(TColgp_HArray1OfPnt2d) myPoints;
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom2d_BSplineCurve) myCurve;
|
||||
Handle(TColgp_HArray1OfVec2d) myTangents;
|
||||
Handle(TColStd_HArray1OfBoolean) myTangentFlags;
|
||||
Handle(TColStd_HArray1OfReal) myParameters;
|
||||
Standard_Boolean myPeriodic;
|
||||
Standard_Boolean myTangentRequest;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Geom2dAPI_Interpolate_HeaderFile
|
@@ -1,262 +0,0 @@
|
||||
-- Created on: 1994-03-23
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
class PointsToBSpline from Geom2dAPI
|
||||
|
||||
---Purpose: This class is used to approximate a BsplineCurve
|
||||
-- passing through an array of points, with a given
|
||||
-- Continuity.
|
||||
-- Describes functions for building a 2D BSpline
|
||||
-- curve which approximates a set of points.
|
||||
-- A PointsToBSpline object provides a framework for:
|
||||
-- - defining the data of the BSpline curve to be built,
|
||||
-- - implementing the approximation algorithm, and
|
||||
-- - consulting the results
|
||||
|
||||
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Array1OfPnt2d from TColgp,
|
||||
Shape from GeomAbs,
|
||||
BSplineCurve from Geom2d,
|
||||
ParametrizationType from Approx
|
||||
raises
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is
|
||||
Create
|
||||
---Purpose: Constructs an empty approximation algorithm.
|
||||
-- Use an Init function to define and build the BSpline curve.
|
||||
returns PointsToBSpline from Geom2dAPI;
|
||||
|
||||
Create(Points : Array1OfPnt2d from TColgp;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-6)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point. The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from Geom2dAPI;
|
||||
|
||||
Create(YValues : Array1OfReal from TColStd;
|
||||
X0 : Real from Standard;
|
||||
DX : Real from Standard;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-6)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point. Of coordinates :
|
||||
--
|
||||
-- X = X0 + DX * (i-YValues.Lower())
|
||||
-- Y = YValues(i)
|
||||
--
|
||||
-- With i in the range YValues.Lower(), YValues.Upper()
|
||||
--
|
||||
-- The BSpline will be parametrized from t = X0 to
|
||||
-- X0 + DX * (YValues.Upper() - YValues.Lower())
|
||||
--
|
||||
-- And will satisfy X(t) = t
|
||||
--
|
||||
-- The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from Geom2dAPI;
|
||||
|
||||
|
||||
Create(Points : Array1OfPnt2d from TColgp;
|
||||
ParType : ParametrizationType from Approx;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point. The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from Geom2dAPI;
|
||||
|
||||
Create(Points : Array1OfPnt2d from TColgp;
|
||||
Parameters : Array1OfReal from TColStd;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point, which parameters are given by the
|
||||
-- array <Parameters>.
|
||||
-- The resulting BSpline will have the following
|
||||
-- properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from Geom2dAPI
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
|
||||
Create(Points : Array1OfPnt2d from TColgp;
|
||||
Weight1 : Real from Standard;
|
||||
Weight2 : Real from Standard;
|
||||
Weight3 : Real from Standard;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point using variational smoothing algorithm,
|
||||
-- which tries to minimize additional criterium:
|
||||
-- Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
---Level: Public
|
||||
returns PointsToBSpline from Geom2dAPI;
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt2d from TColgp;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-6)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point. The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Init(me : in out;
|
||||
YValues : Array1OfReal from TColStd;
|
||||
X0 : Real from Standard;
|
||||
DX : Real from Standard;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-6)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point. Of coordinates :
|
||||
--
|
||||
-- X = X0 + DX * (i-YValues.Lower())
|
||||
-- Y = YValues(i)
|
||||
--
|
||||
-- With i in the range YValues.Lower(), YValues.Upper()
|
||||
--
|
||||
-- The BSpline will be parametrized from t = X0 to
|
||||
-- X0 + DX * (YValues.Upper() - YValues.Lower())
|
||||
--
|
||||
-- And will satisfy X(t) = t
|
||||
--
|
||||
-- The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt2d from TColgp;
|
||||
ParType : ParametrizationType from Approx;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point. The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt2d from TColgp;
|
||||
Parameters : Array1OfReal from TColStd;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point, which parameters are given by the
|
||||
-- array <Parameters>.
|
||||
-- The resulting BSpline will have the following
|
||||
-- properties:
|
||||
-- 1- his degree will be in the range [Degmin,Degmax]
|
||||
-- 2- his continuity will be at least <Continuity>
|
||||
-- 3- the distance from the point <Points> to the
|
||||
-- BSpline will be lower to Tol2D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt2d from TColgp;
|
||||
Weight1 : Real from Standard;
|
||||
Weight2 : Real from Standard;
|
||||
Weight3 : Real from Standard;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol2D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximate a BSpline Curve passing through an
|
||||
-- array of Point using variational smoothing algorithm,
|
||||
-- which tries to minimize additional criterium:
|
||||
-- Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Curve(me)
|
||||
---Purpose: Returns the approximate BSpline Curve
|
||||
---Level: Public
|
||||
returns BSplineCurve from Geom2d
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator Handle(Geom2d_BSplineCurve)() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
IsDone(me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
fields
|
||||
myIsDone : Boolean from Standard;
|
||||
myCurve : BSplineCurve from Geom2d;
|
||||
|
||||
|
||||
end PointsToBSpline;
|
@@ -14,26 +14,27 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Geom2dAPI_PointsToBSpline.ixx>
|
||||
|
||||
#include <AppDef_BSplineCompute.hxx>
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <AppDef_MultiPointConstraint.hxx>
|
||||
#include <AppDef_Variational.hxx>
|
||||
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2dAPI_PointsToBSpline.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <AppDef_MultiPointConstraint.hxx>
|
||||
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
|
||||
#include <AppDef_Variational.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Geom2dAPI_PointsToBSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Geom2dAPI_PointsToBSpline::Geom2dAPI_PointsToBSpline()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
199
src/Geom2dAPI/Geom2dAPI_PointsToBSpline.hxx
Normal file
199
src/Geom2dAPI/Geom2dAPI_PointsToBSpline.hxx
Normal file
@@ -0,0 +1,199 @@
|
||||
// Created on: 1994-03-23
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Geom2dAPI_PointsToBSpline_HeaderFile
|
||||
#define _Geom2dAPI_PointsToBSpline_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Approx_ParametrizationType.hxx>
|
||||
class Geom2d_BSplineCurve;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
|
||||
|
||||
//! This class is used to approximate a BsplineCurve
|
||||
//! passing through an array of points, with a given
|
||||
//! Continuity.
|
||||
//! Describes functions for building a 2D BSpline
|
||||
//! curve which approximates a set of points.
|
||||
//! A PointsToBSpline object provides a framework for:
|
||||
//! - defining the data of the BSpline curve to be built,
|
||||
//! - implementing the approximation algorithm, and
|
||||
//! - consulting the results
|
||||
class Geom2dAPI_PointsToBSpline
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty approximation algorithm.
|
||||
//! Use an Init function to define and build the BSpline curve.
|
||||
Standard_EXPORT Geom2dAPI_PointsToBSpline();
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point. The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT Geom2dAPI_PointsToBSpline(const TColgp_Array1OfPnt2d& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-6);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point. Of coordinates :
|
||||
//!
|
||||
//! X = X0 + DX * (i-YValues.Lower())
|
||||
//! Y = YValues(i)
|
||||
//!
|
||||
//! With i in the range YValues.Lower(), YValues.Upper()
|
||||
//!
|
||||
//! The BSpline will be parametrized from t = X0 to
|
||||
//! X0 + DX * (YValues.Upper() - YValues.Lower())
|
||||
//!
|
||||
//! And will satisfy X(t) = t
|
||||
//!
|
||||
//! The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT Geom2dAPI_PointsToBSpline(const TColStd_Array1OfReal& YValues, const Standard_Real X0, const Standard_Real DX, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-6);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point. The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT Geom2dAPI_PointsToBSpline(const TColgp_Array1OfPnt2d& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-3);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point, which parameters are given by the
|
||||
//! array <Parameters>.
|
||||
//! The resulting BSpline will have the following
|
||||
//! properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT Geom2dAPI_PointsToBSpline(const TColgp_Array1OfPnt2d& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-3);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point using variational smoothing algorithm,
|
||||
//! which tries to minimize additional criterium:
|
||||
//! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
Standard_EXPORT Geom2dAPI_PointsToBSpline(const TColgp_Array1OfPnt2d& Points, const Standard_Real Weight1, const Standard_Real Weight2, const Standard_Real Weight3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point. The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt2d& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-6);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point. Of coordinates :
|
||||
//!
|
||||
//! X = X0 + DX * (i-YValues.Lower())
|
||||
//! Y = YValues(i)
|
||||
//!
|
||||
//! With i in the range YValues.Lower(), YValues.Upper()
|
||||
//!
|
||||
//! The BSpline will be parametrized from t = X0 to
|
||||
//! X0 + DX * (YValues.Upper() - YValues.Lower())
|
||||
//!
|
||||
//! And will satisfy X(t) = t
|
||||
//!
|
||||
//! The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT void Init (const TColStd_Array1OfReal& YValues, const Standard_Real X0, const Standard_Real DX, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-6);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point. The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt2d& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-3);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point, which parameters are given by the
|
||||
//! array <Parameters>.
|
||||
//! The resulting BSpline will have the following
|
||||
//! properties:
|
||||
//! 1- his degree will be in the range [Degmin,Degmax]
|
||||
//! 2- his continuity will be at least <Continuity>
|
||||
//! 3- the distance from the point <Points> to the
|
||||
//! BSpline will be lower to Tol2D
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt2d& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-3);
|
||||
|
||||
//! Approximate a BSpline Curve passing through an
|
||||
//! array of Point using variational smoothing algorithm,
|
||||
//! which tries to minimize additional criterium:
|
||||
//! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt2d& Points, const Standard_Real Weight1, const Standard_Real Weight2, const Standard_Real Weight3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol2D = 1.0e-3);
|
||||
|
||||
//! Returns the approximate BSpline Curve
|
||||
Standard_EXPORT const Handle(Geom2d_BSplineCurve)& Curve() const;
|
||||
Standard_EXPORT operator Handle(Geom2d_BSplineCurve)() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom2d_BSplineCurve) myCurve;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Geom2dAPI_PointsToBSpline_HeaderFile
|
@@ -1,191 +0,0 @@
|
||||
-- Created on: 1994-03-23
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
class ProjectPointOnCurve from Geom2dAPI
|
||||
---Purpose:
|
||||
-- This class implements methods for computing all the orthogonal
|
||||
-- projections of a 2D point onto a 2D curve.
|
||||
|
||||
uses
|
||||
Curve from Geom2d,
|
||||
Curve from Geom2dAdaptor,
|
||||
ExtPC2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
Create
|
||||
---Purpose: Constructs an empty projector algorithm. Use an Init
|
||||
-- function to define the point and the curve on which it is going to work.
|
||||
returns ProjectPointOnCurve from Geom2dAPI;
|
||||
|
||||
|
||||
Create(P : Pnt2d from gp;
|
||||
Curve : Curve from Geom2d)
|
||||
---Purpose: Create the projection of a point <P> on a curve
|
||||
-- <Curve>
|
||||
---Level: Public
|
||||
returns ProjectPointOnCurve from Geom2dAPI;
|
||||
|
||||
|
||||
Create(P : Pnt2d from gp;
|
||||
Curve : Curve from Geom2d;
|
||||
Umin, Usup : Parameter from Quantity)
|
||||
---Purpose: Create the projection of a point <P> on a curve
|
||||
-- <Curve> limited by the two points of parameter Umin and Usup.
|
||||
-- Warning
|
||||
-- Use the function NbPoints to obtain the number of solutions. If
|
||||
-- projection fails, NbPoints returns 0.
|
||||
returns ProjectPointOnCurve from Geom2dAPI;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt2d from gp;
|
||||
Curve : Curve from Geom2d)
|
||||
---Purpose: Initializes this algorithm with the given arguments, and
|
||||
-- computes the orthogonal projections of a point <P> on a curve <Curve>
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt2d from gp;
|
||||
Curve : Curve from Geom2d;
|
||||
Umin, Usup : Parameter from Quantity)
|
||||
---Purpose: Initializes this algorithm with the given arguments, and
|
||||
-- computes the orthogonal projections of the point P onto the portion
|
||||
-- of the curve Curve limited by the two points of parameter Umin and Usup.
|
||||
is static;
|
||||
|
||||
|
||||
NbPoints(me)
|
||||
---Purpose: return the number of of computed
|
||||
-- orthogonal projectionn points.
|
||||
returns Integer from Standard
|
||||
---C++: alias "Standard_EXPORT operator Standard_Integer() const;"
|
||||
is static;
|
||||
|
||||
|
||||
Point(me; Index : Integer from Standard)
|
||||
returns Pnt2d from gp
|
||||
---Purpose: Returns the orthogonal projection
|
||||
-- on the curve. Index is a number of a computed point.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
-- NbPoints is the number of solution points.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Parameter(me; Index : Integer from Standard)
|
||||
returns Parameter from Quantity
|
||||
---Purpose: Returns the parameter on the curve
|
||||
-- of a point which is the orthogonal projection. Index is a number of a
|
||||
-- computed projected point.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
-- NbPoints is the number of solution points.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Parameter(me; Index : Integer from Standard;
|
||||
U : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameter on the curve
|
||||
-- of a point which is the orthogonal projection. Index is a number of a
|
||||
-- computed projected point.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
-- NbPoints is the number of solution points
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
Distance(me; Index : Integer from Standard)
|
||||
returns Length from Quantity
|
||||
---Purpose: Computes the distance between the
|
||||
-- point and its computed orthogonal projection on the curve. Index is a
|
||||
-- number of computed projected point.
|
||||
-- Exceptions
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
-- NbPoints is the number of solution points.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
NearestPoint(me)
|
||||
returns Pnt2d from gp
|
||||
---Purpose: Returns the nearest orthogonal projection of the point on the curve.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if this algorithm fails.
|
||||
---C++: alias "Standard_EXPORT operator gp_Pnt2d() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistanceParameter(me)
|
||||
returns Parameter from Quantity
|
||||
---Purpose: Returns the parameter on the curve
|
||||
-- of the nearest orthogonal projection of the point.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if this algorithm fails.
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistance(me)
|
||||
---Purpose: Computes the distance between the
|
||||
-- point and its nearest orthogonal projection on the curve.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if this algorithm fails.
|
||||
returns Length from Quantity
|
||||
---C++: alias "Standard_EXPORT operator Standard_Real() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Extrema(me)
|
||||
---Purpose: return the algorithmic object from Extrema
|
||||
---Level: Advanced
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
returns ExtPC2d from Extrema
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIsDone: Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtPC : ExtPC2d from Extrema;
|
||||
myC : Curve from Geom2dAdaptor;
|
||||
|
||||
end ProjectPointOnCurve;
|
@@ -14,16 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Geom2dAPI_ProjectPointOnCurve.ixx>
|
||||
|
||||
#include <Extrema_ExtPC2d.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
|
||||
#include <Geom2dAPI_ProjectPointOnCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Geom2dAPI_ProjectPointOnCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Geom2dAPI_ProjectPointOnCurve::Geom2dAPI_ProjectPointOnCurve()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
157
src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.hxx
Normal file
157
src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.hxx
Normal file
@@ -0,0 +1,157 @@
|
||||
// Created on: 1994-03-23
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Geom2dAPI_ProjectPointOnCurve_HeaderFile
|
||||
#define _Geom2dAPI_ProjectPointOnCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtPC2d.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class gp_Pnt2d;
|
||||
class Geom2d_Curve;
|
||||
class Extrema_ExtPC2d;
|
||||
|
||||
|
||||
|
||||
//! This class implements methods for computing all the orthogonal
|
||||
//! projections of a 2D point onto a 2D curve.
|
||||
class Geom2dAPI_ProjectPointOnCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty projector algorithm. Use an Init
|
||||
//! function to define the point and the curve on which it is going to work.
|
||||
Standard_EXPORT Geom2dAPI_ProjectPointOnCurve();
|
||||
|
||||
//! Create the projection of a point <P> on a curve
|
||||
//! <Curve>
|
||||
Standard_EXPORT Geom2dAPI_ProjectPointOnCurve(const gp_Pnt2d& P, const Handle(Geom2d_Curve)& Curve);
|
||||
|
||||
//! Create the projection of a point <P> on a curve
|
||||
//! <Curve> limited by the two points of parameter Umin and Usup.
|
||||
//! Warning
|
||||
//! Use the function NbPoints to obtain the number of solutions. If
|
||||
//! projection fails, NbPoints returns 0.
|
||||
Standard_EXPORT Geom2dAPI_ProjectPointOnCurve(const gp_Pnt2d& P, const Handle(Geom2d_Curve)& Curve, const Quantity_Parameter Umin, const Quantity_Parameter Usup);
|
||||
|
||||
//! Initializes this algorithm with the given arguments, and
|
||||
//! computes the orthogonal projections of a point <P> on a curve <Curve>
|
||||
Standard_EXPORT void Init (const gp_Pnt2d& P, const Handle(Geom2d_Curve)& Curve);
|
||||
|
||||
//! Initializes this algorithm with the given arguments, and
|
||||
//! computes the orthogonal projections of the point P onto the portion
|
||||
//! of the curve Curve limited by the two points of parameter Umin and Usup.
|
||||
Standard_EXPORT void Init (const gp_Pnt2d& P, const Handle(Geom2d_Curve)& Curve, const Quantity_Parameter Umin, const Quantity_Parameter Usup);
|
||||
|
||||
//! return the number of of computed
|
||||
//! orthogonal projectionn points.
|
||||
Standard_EXPORT Standard_Integer NbPoints() const;
|
||||
Standard_EXPORT operator Standard_Integer() const;
|
||||
|
||||
//! Returns the orthogonal projection
|
||||
//! on the curve. Index is a number of a computed point.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
//! NbPoints is the number of solution points.
|
||||
Standard_EXPORT gp_Pnt2d Point (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the parameter on the curve
|
||||
//! of a point which is the orthogonal projection. Index is a number of a
|
||||
//! computed projected point.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
//! NbPoints is the number of solution points.
|
||||
Standard_EXPORT Quantity_Parameter Parameter (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the parameter on the curve
|
||||
//! of a point which is the orthogonal projection. Index is a number of a
|
||||
//! computed projected point.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
//! NbPoints is the number of solution points
|
||||
Standard_EXPORT void Parameter (const Standard_Integer Index, Quantity_Parameter& U) const;
|
||||
|
||||
//! Computes the distance between the
|
||||
//! point and its computed orthogonal projection on the curve. Index is a
|
||||
//! number of computed projected point.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
//! NbPoints is the number of solution points.
|
||||
Standard_EXPORT Quantity_Length Distance (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the nearest orthogonal projection of the point on the curve.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT gp_Pnt2d NearestPoint() const;
|
||||
Standard_EXPORT operator gp_Pnt2d() const;
|
||||
|
||||
//! Returns the parameter on the curve
|
||||
//! of the nearest orthogonal projection of the point.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT Quantity_Parameter LowerDistanceParameter() const;
|
||||
|
||||
//! Computes the distance between the
|
||||
//! point and its nearest orthogonal projection on the curve.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT Quantity_Length LowerDistance() const;
|
||||
Standard_EXPORT operator Standard_Real() const;
|
||||
|
||||
//! return the algorithmic object from Extrema
|
||||
const Extrema_ExtPC2d& Extrema() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtPC2d myExtPC;
|
||||
Geom2dAdaptor_Curve myC;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Geom2dAPI_ProjectPointOnCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Geom2dAPI_ProjectPointOnCurve_HeaderFile
|
Reference in New Issue
Block a user