mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +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:
28
src/GeomAPI/FILES
Normal file
28
src/GeomAPI/FILES
Normal file
@@ -0,0 +1,28 @@
|
||||
GeomAPI.cxx
|
||||
GeomAPI.hxx
|
||||
GeomAPI_ExtremaCurveCurve.cxx
|
||||
GeomAPI_ExtremaCurveCurve.hxx
|
||||
GeomAPI_ExtremaCurveCurve.lxx
|
||||
GeomAPI_ExtremaCurveSurface.cxx
|
||||
GeomAPI_ExtremaCurveSurface.hxx
|
||||
GeomAPI_ExtremaCurveSurface.lxx
|
||||
GeomAPI_ExtremaSurfaceSurface.cxx
|
||||
GeomAPI_ExtremaSurfaceSurface.hxx
|
||||
GeomAPI_ExtremaSurfaceSurface.lxx
|
||||
GeomAPI_IntCS.cxx
|
||||
GeomAPI_IntCS.hxx
|
||||
GeomAPI_Interpolate.cxx
|
||||
GeomAPI_Interpolate.hxx
|
||||
GeomAPI_IntSS.cxx
|
||||
GeomAPI_IntSS.hxx
|
||||
GeomAPI_IntSS.lxx
|
||||
GeomAPI_PointsToBSpline.cxx
|
||||
GeomAPI_PointsToBSpline.hxx
|
||||
GeomAPI_PointsToBSplineSurface.cxx
|
||||
GeomAPI_PointsToBSplineSurface.hxx
|
||||
GeomAPI_ProjectPointOnCurve.cxx
|
||||
GeomAPI_ProjectPointOnCurve.hxx
|
||||
GeomAPI_ProjectPointOnCurve.lxx
|
||||
GeomAPI_ProjectPointOnSurf.cxx
|
||||
GeomAPI_ProjectPointOnSurf.hxx
|
||||
GeomAPI_ProjectPointOnSurf.lxx
|
@@ -1,146 +0,0 @@
|
||||
-- Created on: 1994-03-17
|
||||
-- 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 GeomAPI
|
||||
|
||||
---Purpose: The GeomAPI package provides an Application
|
||||
-- Programming Interface for the Geometry.
|
||||
--
|
||||
-- The API is a set of classes and methods 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 = GeomAPI_ProjectPointOnCurve(P,C);
|
||||
--
|
||||
-- or
|
||||
--
|
||||
-- GeomAPI_ProjectPointOnCurve PonC(P,C);
|
||||
-- D = PonC.LowerDistance();
|
||||
--
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Geom,
|
||||
Geom2d,
|
||||
gp,
|
||||
TColgp,
|
||||
TColStd,
|
||||
GeomAdaptor,
|
||||
GeomInt,
|
||||
IntCurveSurface,
|
||||
Extrema,
|
||||
GeomAbs,
|
||||
Quantity,
|
||||
StdFail,
|
||||
Approx
|
||||
|
||||
|
||||
is
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- Those classes provide algo to evaluate the distance between
|
||||
-- points curves and surfaces.
|
||||
------------------------------------------------------------------
|
||||
|
||||
class ProjectPointOnCurve;
|
||||
|
||||
class ProjectPointOnSurf;
|
||||
|
||||
class ExtremaCurveCurve;
|
||||
|
||||
class ExtremaCurveSurface;
|
||||
|
||||
class ExtremaSurfaceSurface;
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- Those classes provide algo to evaluate a curve or a surface
|
||||
-- passing through
|
||||
-- an array of points.
|
||||
------------------------------------------------------------------
|
||||
|
||||
--- Approximation:
|
||||
--
|
||||
class PointsToBSpline;
|
||||
|
||||
class PointsToBSplineSurface;
|
||||
|
||||
--- Interpolation:
|
||||
--
|
||||
class Interpolate;
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- Those classes provide algo to intersect two surfaces
|
||||
-- and to intersect a curve and a surface
|
||||
------------------------------------------------------------------
|
||||
|
||||
class IntSS;
|
||||
|
||||
class IntCS;
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- Those methods are used to switch 3d and 2d curves
|
||||
------------------------------------------------------------------
|
||||
|
||||
To2d(C : Curve from Geom; P : Pln from gp) returns Curve from Geom2d;
|
||||
---Purpose: This function builds (in the
|
||||
-- parametric space of the plane P) a 2D curve equivalent to the 3D curve
|
||||
-- C. The 3D curve C is considered to be located in the plane P.
|
||||
-- Warning
|
||||
-- The 3D curve C must be of one of the following types:
|
||||
-- - a line
|
||||
-- - a circle
|
||||
-- - an ellipse
|
||||
-- - a hyperbola
|
||||
-- - a parabola
|
||||
-- - a Bezier curve
|
||||
-- - a BSpline curve
|
||||
-- Exceptions Standard_NoSuchObject if C is not a defined type curve.
|
||||
|
||||
|
||||
To3d(C : Curve from Geom2d; P : Pln from gp) returns Curve from Geom;
|
||||
---Purpose: Builds a 3D curve equivalent to the 2D curve C
|
||||
-- described in the parametric space defined by the local
|
||||
-- coordinate system of plane P.
|
||||
-- The resulting 3D curve is of the same nature as that of the curve C.
|
||||
|
||||
end GeomAPI;
|
@@ -14,37 +14,37 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI.ixx>
|
||||
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor.hxx>
|
||||
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <GeomAdaptor.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAPI.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : To2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomAPI::To2d(const Handle(Geom_Curve)& C,
|
||||
const gp_Pln& P)
|
||||
{
|
||||
|
134
src/GeomAPI/GeomAPI.hxx
Normal file
134
src/GeomAPI/GeomAPI.hxx
Normal file
@@ -0,0 +1,134 @@
|
||||
// Created on: 1994-03-17
|
||||
// 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 _GeomAPI_HeaderFile
|
||||
#define _GeomAPI_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
class Geom2d_Curve;
|
||||
class Geom_Curve;
|
||||
class gp_Pln;
|
||||
class GeomAPI_ProjectPointOnCurve;
|
||||
class GeomAPI_ProjectPointOnSurf;
|
||||
class GeomAPI_ExtremaCurveCurve;
|
||||
class GeomAPI_ExtremaCurveSurface;
|
||||
class GeomAPI_ExtremaSurfaceSurface;
|
||||
class GeomAPI_PointsToBSpline;
|
||||
class GeomAPI_PointsToBSplineSurface;
|
||||
class GeomAPI_Interpolate;
|
||||
class GeomAPI_IntSS;
|
||||
class GeomAPI_IntCS;
|
||||
|
||||
|
||||
//! The GeomAPI package provides an Application
|
||||
//! Programming Interface for the Geometry.
|
||||
//!
|
||||
//! The API is a set of classes and methods 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 = GeomAPI_ProjectPointOnCurve(P,C);
|
||||
//!
|
||||
//! or
|
||||
//!
|
||||
//! GeomAPI_ProjectPointOnCurve PonC(P,C);
|
||||
//! D = PonC.LowerDistance();
|
||||
class GeomAPI
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! This function builds (in the
|
||||
//! parametric space of the plane P) a 2D curve equivalent to the 3D curve
|
||||
//! C. The 3D curve C is considered to be located in the plane P.
|
||||
//! Warning
|
||||
//! The 3D curve C must be of one of the following types:
|
||||
//! - a line
|
||||
//! - a circle
|
||||
//! - an ellipse
|
||||
//! - a hyperbola
|
||||
//! - a parabola
|
||||
//! - a Bezier curve
|
||||
//! - a BSpline curve
|
||||
//! Exceptions Standard_NoSuchObject if C is not a defined type curve.
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) To2d (const Handle(Geom_Curve)& C, const gp_Pln& P);
|
||||
|
||||
//! Builds a 3D curve equivalent to the 2D curve C
|
||||
//! described in the parametric space defined by the local
|
||||
//! coordinate system of plane P.
|
||||
//! The resulting 3D curve is of the same nature as that of the curve C.
|
||||
Standard_EXPORT static Handle(Geom_Curve) To3d (const Handle(Geom2d_Curve)& C, const gp_Pln& P);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class GeomAPI_ProjectPointOnCurve;
|
||||
friend class GeomAPI_ProjectPointOnSurf;
|
||||
friend class GeomAPI_ExtremaCurveCurve;
|
||||
friend class GeomAPI_ExtremaCurveSurface;
|
||||
friend class GeomAPI_ExtremaSurfaceSurface;
|
||||
friend class GeomAPI_PointsToBSpline;
|
||||
friend class GeomAPI_PointsToBSplineSurface;
|
||||
friend class GeomAPI_Interpolate;
|
||||
friend class GeomAPI_IntSS;
|
||||
friend class GeomAPI_IntCS;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_HeaderFile
|
@@ -1,243 +0,0 @@
|
||||
-- Created on: 1994-03-18
|
||||
-- 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 GeomAPI
|
||||
---Purpose: Describes functions for computing all the extrema
|
||||
-- between two 3D 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 start and end points of perpendiculars
|
||||
-- common to the two curves (an intersection point is
|
||||
-- not an extremum unless 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 Geom,
|
||||
Curve from GeomAdaptor,
|
||||
ExtCC from Extrema,
|
||||
Pnt from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity
|
||||
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Constructs an empty algorithm for computing
|
||||
-- extrema between two curves. Use an Init function
|
||||
-- to define the curves on which it is going to work.
|
||||
returns ExtremaCurveCurve from GeomAPI;
|
||||
|
||||
|
||||
Create(C1 , C2 : Curve from Geom)
|
||||
---Purpose: Computes the extrema between the curves C1 and C2.
|
||||
returns ExtremaCurveCurve from GeomAPI;
|
||||
|
||||
|
||||
Create(C1 , C2 : Curve from Geom;
|
||||
U1min, U1max : Parameter from Quantity;
|
||||
U2min, U2max : Parameter from Quantity)
|
||||
---Purpose: Computes 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 GeomAPI;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
C1 , C2 : Curve from Geom)
|
||||
---Purpose: Initializes this algorithm with the given arguments
|
||||
-- and computes the extrema between the curves C1 and C2
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
C1 , C2 : Curve from Geom;
|
||||
U1min, U1max : Parameter from Quantity;
|
||||
U2min, U2max : Parameter from Quantity)
|
||||
---Purpose: Initializes this algorithm with the given arguments
|
||||
-- and 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.
|
||||
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 Pnt 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 Pnt 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.
|
||||
---C++: alias "Standard_EXPORT operator Standard_Real() const;"
|
||||
returns Length from Quantity
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Extrema(me)
|
||||
---Purpose: return the algorithmic object from Extrema
|
||||
---Level: Advanced
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
returns ExtCC from Extrema
|
||||
is static;
|
||||
|
||||
TotalNearestPoints(me : in out; P1, P2 : out Pnt from gp )
|
||||
---Purpose: set in <P1> and <P2> the couple solution points
|
||||
-- such a the distance [P1,P2] is the minimum. taking in account
|
||||
-- extremity points of curves.
|
||||
---Level: Public
|
||||
returns Boolean from Standard
|
||||
-- returns "true" if it is possible to compute points and "false"
|
||||
-- if such points do not exist, for ex. - infinite parallel lines
|
||||
is static;
|
||||
|
||||
TotalLowerDistanceParameters(me : in out; U1, U2 : out Parameter from Quantity)
|
||||
---Purpose: set in <U1> and <U2> the parameters of the couple
|
||||
-- solution points which represents the total nearest
|
||||
-- solution.
|
||||
---Level: Public
|
||||
returns Boolean from Standard
|
||||
-- returns "true" if it is possible to compute points and "false"
|
||||
-- if such points do not exist, for ex. - infinite parallel lines
|
||||
is static;
|
||||
|
||||
TotalLowerDistance(me : in out)
|
||||
---Purpose: return the distance of the total nearest couple solution
|
||||
-- point.
|
||||
---Level: Public
|
||||
returns Length from Quantity
|
||||
raises
|
||||
NotDone from StdFail
|
||||
---Purpose: if <myExtCC> is not done
|
||||
is static;
|
||||
|
||||
TotalPerform(me : in out)
|
||||
is static private;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIsDone: Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtCC : ExtCC from Extrema;
|
||||
myC1 : Curve from GeomAdaptor;
|
||||
myC2 : Curve from GeomAdaptor;
|
||||
|
||||
-- Fields to compute total min. dist with extremities of curves
|
||||
myTotalExt : Boolean from Standard; -- indicate that total extr.
|
||||
-- has been computed
|
||||
myIsInfinite : Boolean from Standard; -- infinite extremity points
|
||||
myTotalDist : Real from Standard; -- total min. dist
|
||||
myTotalPoints : Pnt[2];
|
||||
myTotalPars : Real[2];
|
||||
|
||||
end ExtremaCurveCurve;
|
@@ -14,19 +14,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_ExtremaCurveCurve.ixx>
|
||||
|
||||
#include <Extrema_ExtCC.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
//#include <Extrema_POnCurv.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//#include <Extrema_POnCurv.hxx>
|
||||
//=======================================================================
|
||||
//function : GeomAPI_ExtremaCurveCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAPI_ExtremaCurveCurve::GeomAPI_ExtremaCurveCurve()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
203
src/GeomAPI/GeomAPI_ExtremaCurveCurve.hxx
Normal file
203
src/GeomAPI/GeomAPI_ExtremaCurveCurve.hxx
Normal file
@@ -0,0 +1,203 @@
|
||||
// Created on: 1994-03-18
|
||||
// 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 _GeomAPI_ExtremaCurveCurve_HeaderFile
|
||||
#define _GeomAPI_ExtremaCurveCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtCC.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class Geom_Curve;
|
||||
class gp_Pnt;
|
||||
class Extrema_ExtCC;
|
||||
|
||||
|
||||
//! Describes functions for computing all the extrema
|
||||
//! between two 3D 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 start and end points of perpendiculars
|
||||
//! common to the two curves (an intersection point is
|
||||
//! not an extremum unless 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 GeomAPI_ExtremaCurveCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty algorithm for computing
|
||||
//! extrema between two curves. Use an Init function
|
||||
//! to define the curves on which it is going to work.
|
||||
Standard_EXPORT GeomAPI_ExtremaCurveCurve();
|
||||
|
||||
//! Computes the extrema between the curves C1 and C2.
|
||||
Standard_EXPORT GeomAPI_ExtremaCurveCurve(const Handle(Geom_Curve)& C1, const Handle(Geom_Curve)& C2);
|
||||
|
||||
//! Computes 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 GeomAPI_ExtremaCurveCurve(const Handle(Geom_Curve)& C1, const Handle(Geom_Curve)& C2, const Quantity_Parameter U1min, const Quantity_Parameter U1max, const Quantity_Parameter U2min, const Quantity_Parameter U2max);
|
||||
|
||||
//! Initializes this algorithm with the given arguments
|
||||
//! and computes the extrema between the curves C1 and C2
|
||||
Standard_EXPORT void Init (const Handle(Geom_Curve)& C1, const Handle(Geom_Curve)& C2);
|
||||
|
||||
//! Initializes this algorithm with the given arguments
|
||||
//! and 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 void Init (const Handle(Geom_Curve)& C1, const Handle(Geom_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_Pnt& P1, gp_Pnt& 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_Pnt& P1, gp_Pnt& 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;
|
||||
|
||||
//! return the algorithmic object from Extrema
|
||||
const Extrema_ExtCC& Extrema() const;
|
||||
|
||||
//! set in <P1> and <P2> the couple solution points
|
||||
//! such a the distance [P1,P2] is the minimum. taking in account
|
||||
//! extremity points of curves.
|
||||
Standard_EXPORT Standard_Boolean TotalNearestPoints (gp_Pnt& P1, gp_Pnt& P2);
|
||||
|
||||
//! set in <U1> and <U2> the parameters of the couple
|
||||
//! solution points which represents the total nearest
|
||||
//! solution.
|
||||
Standard_EXPORT Standard_Boolean TotalLowerDistanceParameters (Quantity_Parameter& U1, Quantity_Parameter& U2);
|
||||
|
||||
//! return the distance of the total nearest couple solution
|
||||
//! point.
|
||||
//! if <myExtCC> is not done
|
||||
Standard_EXPORT Quantity_Length TotalLowerDistance();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void TotalPerform();
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtCC myExtCC;
|
||||
GeomAdaptor_Curve myC1;
|
||||
GeomAdaptor_Curve myC2;
|
||||
Standard_Boolean myTotalExt;
|
||||
Standard_Boolean myIsInfinite;
|
||||
Standard_Real myTotalDist;
|
||||
gp_Pnt myTotalPoints[2];
|
||||
Standard_Real myTotalPars[2];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GeomAPI_ExtremaCurveCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_ExtremaCurveCurve_HeaderFile
|
@@ -1,215 +0,0 @@
|
||||
-- Created on: 1994-03-18
|
||||
-- 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 ExtremaCurveSurface from GeomAPI
|
||||
|
||||
---Purpose: Describes functions for computing all the extrema
|
||||
-- between a curve and a surface.
|
||||
-- An ExtremaCurveSurface algorithm minimizes or
|
||||
-- maximizes the distance between a point on the curve
|
||||
-- and a point on the surface. Thus, it computes start
|
||||
-- and end points of perpendiculars common to the
|
||||
-- curve and the surface (an intersection point is not an
|
||||
-- extremum except where the curve and the surface
|
||||
-- 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 ExtremaCurveSurface 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 a curve
|
||||
-- and a surface do not correspond to one of the
|
||||
-- computed extrema. Instead, they may be given by:
|
||||
-- - a point of a bounding curve of the surface and one of the following:
|
||||
-- - its orthogonal projection on the curve,
|
||||
-- - a limit point of the curve; or
|
||||
-- - a limit point of the curve and its projection on the surface; or
|
||||
-- - an intersection point between the curve and the surface.
|
||||
|
||||
uses
|
||||
Curve from Geom,
|
||||
Surface from Geom,
|
||||
ExtCS from Extrema,
|
||||
Pnt from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity
|
||||
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Constructs an empty algorithm for computing
|
||||
-- extrema between a curve and a surface. Use an
|
||||
-- Init function to define the curve and the surface on
|
||||
-- which it is going to work.
|
||||
returns ExtremaCurveSurface from GeomAPI;
|
||||
|
||||
|
||||
Create(Curve : Curve from Geom;
|
||||
Surface : Surface from Geom)
|
||||
---Purpose: Computes the extrema distances between the
|
||||
-- curve <C> and the surface <S>.
|
||||
---Level: Public
|
||||
returns ExtremaCurveSurface from GeomAPI;
|
||||
|
||||
|
||||
Create(Curve : Curve from Geom;
|
||||
Surface : Surface from Geom;
|
||||
Wmin, Wmax : Parameter from Quantity;
|
||||
Umin, Umax : Parameter from Quantity;
|
||||
Vmin, Vmax : Parameter from Quantity)
|
||||
---Purpose: Computes the extrema distances between the
|
||||
-- curve <C> and the surface <S>. The solution
|
||||
-- point are computed in the domain [Wmin,Wmax] of
|
||||
-- the curve and in the domain [Umin,Umax]
|
||||
-- [Vmin,Vmax] of the surface.
|
||||
-- Warning
|
||||
-- Use the function NbExtrema to obtain the number
|
||||
-- of solutions. If this algorithm fails, NbExtrema returns 0.
|
||||
returns ExtremaCurveSurface from GeomAPI;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Curve : Curve from Geom;
|
||||
Surface : Surface from Geom)
|
||||
---Purpose: Computes the extrema distances between the
|
||||
-- curve <C> and the surface <S>.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Curve : Curve from Geom;
|
||||
Surface : Surface from Geom;
|
||||
Wmin, Wmax : Parameter from Quantity;
|
||||
Umin, Umax : Parameter from Quantity;
|
||||
Vmin, Vmax : Parameter from Quantity)
|
||||
---Purpose: Computes the extrema distances between the
|
||||
-- curve <C> and the surface <S>. The solution
|
||||
-- point are computed in the domain [Wmin,Wmax] of
|
||||
-- the curve and in the domain [Umin,Umax]
|
||||
-- [Vmin,Vmax] of the surface.
|
||||
-- Warning
|
||||
-- Use the function NbExtrema to obtain the number
|
||||
-- of solutions. If this algorithm fails, NbExtrema returns 0.
|
||||
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 Pnt from gp )
|
||||
---Purpose: Returns the points P1 on the curve and P2 on the
|
||||
-- surface, 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;
|
||||
W : out Parameter from Quantity;
|
||||
U, V : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters W of the point on the curve,
|
||||
-- and (U,V) of the point on the surface, 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; PC, PS : out Pnt from gp)
|
||||
---Purpose: Returns the points PC on the curve and PS on the
|
||||
-- surface, 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; W : out Parameter from Quantity;
|
||||
U, V : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters W of the point on the curve
|
||||
-- and (U,V) of the point on the surface, 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)
|
||||
---Purpose: Returns the algorithmic object from Extrema
|
||||
---Level: Advanced
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
returns ExtCS from Extrema
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIsDone: Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtCS : ExtCS from Extrema;
|
||||
|
||||
|
||||
end ExtremaCurveSurface;
|
@@ -14,21 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_ExtremaCurveSurface.ixx>
|
||||
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <Extrema_ExtCS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAPI_ExtremaCurveSurface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_ExtremaCurveSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAPI_ExtremaCurveSurface::GeomAPI_ExtremaCurveSurface()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
180
src/GeomAPI/GeomAPI_ExtremaCurveSurface.hxx
Normal file
180
src/GeomAPI/GeomAPI_ExtremaCurveSurface.hxx
Normal file
@@ -0,0 +1,180 @@
|
||||
// Created on: 1994-03-18
|
||||
// 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 _GeomAPI_ExtremaCurveSurface_HeaderFile
|
||||
#define _GeomAPI_ExtremaCurveSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtCS.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class Geom_Curve;
|
||||
class Geom_Surface;
|
||||
class gp_Pnt;
|
||||
class Extrema_ExtCS;
|
||||
|
||||
|
||||
//! Describes functions for computing all the extrema
|
||||
//! between a curve and a surface.
|
||||
//! An ExtremaCurveSurface algorithm minimizes or
|
||||
//! maximizes the distance between a point on the curve
|
||||
//! and a point on the surface. Thus, it computes start
|
||||
//! and end points of perpendiculars common to the
|
||||
//! curve and the surface (an intersection point is not an
|
||||
//! extremum except where the curve and the surface
|
||||
//! 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 ExtremaCurveSurface 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 a curve
|
||||
//! and a surface do not correspond to one of the
|
||||
//! computed extrema. Instead, they may be given by:
|
||||
//! - a point of a bounding curve of the surface and one of the following:
|
||||
//! - its orthogonal projection on the curve,
|
||||
//! - a limit point of the curve; or
|
||||
//! - a limit point of the curve and its projection on the surface; or
|
||||
//! - an intersection point between the curve and the surface.
|
||||
class GeomAPI_ExtremaCurveSurface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty algorithm for computing
|
||||
//! extrema between a curve and a surface. Use an
|
||||
//! Init function to define the curve and the surface on
|
||||
//! which it is going to work.
|
||||
Standard_EXPORT GeomAPI_ExtremaCurveSurface();
|
||||
|
||||
//! Computes the extrema distances between the
|
||||
//! curve <C> and the surface <S>.
|
||||
Standard_EXPORT GeomAPI_ExtremaCurveSurface(const Handle(Geom_Curve)& Curve, const Handle(Geom_Surface)& Surface);
|
||||
|
||||
//! Computes the extrema distances between the
|
||||
//! curve <C> and the surface <S>. The solution
|
||||
//! point are computed in the domain [Wmin,Wmax] of
|
||||
//! the curve and in the domain [Umin,Umax]
|
||||
//! [Vmin,Vmax] of the surface.
|
||||
//! Warning
|
||||
//! Use the function NbExtrema to obtain the number
|
||||
//! of solutions. If this algorithm fails, NbExtrema returns 0.
|
||||
Standard_EXPORT GeomAPI_ExtremaCurveSurface(const Handle(Geom_Curve)& Curve, const Handle(Geom_Surface)& Surface, const Quantity_Parameter Wmin, const Quantity_Parameter Wmax, const Quantity_Parameter Umin, const Quantity_Parameter Umax, const Quantity_Parameter Vmin, const Quantity_Parameter Vmax);
|
||||
|
||||
//! Computes the extrema distances between the
|
||||
//! curve <C> and the surface <S>.
|
||||
Standard_EXPORT void Init (const Handle(Geom_Curve)& Curve, const Handle(Geom_Surface)& Surface);
|
||||
|
||||
//! Computes the extrema distances between the
|
||||
//! curve <C> and the surface <S>. The solution
|
||||
//! point are computed in the domain [Wmin,Wmax] of
|
||||
//! the curve and in the domain [Umin,Umax]
|
||||
//! [Vmin,Vmax] of the surface.
|
||||
//! Warning
|
||||
//! Use the function NbExtrema to obtain the number
|
||||
//! of solutions. If this algorithm fails, NbExtrema returns 0.
|
||||
Standard_EXPORT void Init (const Handle(Geom_Curve)& Curve, const Handle(Geom_Surface)& Surface, const Quantity_Parameter Wmin, const Quantity_Parameter Wmax, const Quantity_Parameter Umin, const Quantity_Parameter Umax, const Quantity_Parameter Vmin, const Quantity_Parameter Vmax);
|
||||
|
||||
//! 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 curve and P2 on the
|
||||
//! surface, 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_Pnt& P1, gp_Pnt& P2) const;
|
||||
|
||||
//! Returns the parameters W of the point on the curve,
|
||||
//! and (U,V) of the point on the surface, 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& W, Quantity_Parameter& U, Quantity_Parameter& V) 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 PC on the curve and PS on the
|
||||
//! surface, which are the ends of the shortest extremum computed by this algorithm.
|
||||
//! Exceptions - StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT void NearestPoints (gp_Pnt& PC, gp_Pnt& PS) const;
|
||||
|
||||
//! Returns the parameters W of the point on the curve
|
||||
//! and (U,V) of the point on the surface, 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& W, Quantity_Parameter& U, Quantity_Parameter& V) 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;
|
||||
|
||||
//! Returns the algorithmic object from Extrema
|
||||
const Extrema_ExtCS& Extrema() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtCS myExtCS;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GeomAPI_ExtremaCurveSurface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_ExtremaCurveSurface_HeaderFile
|
@@ -1,220 +0,0 @@
|
||||
-- Created on: 1994-03-18
|
||||
-- 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 ExtremaSurfaceSurface from GeomAPI
|
||||
|
||||
---Purpose: Describes functions for computing all the extrema
|
||||
-- between two surfaces.
|
||||
-- An ExtremaSurfaceSurface algorithm minimizes or
|
||||
-- maximizes the distance between a point on the first
|
||||
-- surface and a point on the second surface. Results
|
||||
-- are start and end points of perpendiculars common to the two surfaces.
|
||||
-- Solutions consist of pairs of points, and an extremum
|
||||
-- is considered to be a segment joining the two points of a solution.
|
||||
-- An ExtremaSurfaceSurface 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 the two
|
||||
-- surfaces do not correspond to one of the computed
|
||||
-- extrema. Instead, they may be given by:
|
||||
-- - a point of a bounding curve of one surface and one of the following:
|
||||
-- - its orthogonal projection on the other surface,
|
||||
-- - a point of a bounding curve of the other surface; or
|
||||
-- - any point on intersection curves between the two surfaces.
|
||||
|
||||
uses
|
||||
Surface from Geom,
|
||||
ExtSS from Extrema,
|
||||
Pnt from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity
|
||||
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Constructs an empty algorithm for computing
|
||||
-- extrema between two surfaces. Use an Init function
|
||||
-- to define the surfaces on which it is going to work.
|
||||
returns ExtremaSurfaceSurface from GeomAPI;
|
||||
|
||||
|
||||
Create(S1 : Surface from Geom;
|
||||
S2 : Surface from Geom)
|
||||
---Purpose: Computes the extrema distances between the
|
||||
-- surfaces <S1> and <S2>
|
||||
---Level: Public
|
||||
returns ExtremaSurfaceSurface from GeomAPI;
|
||||
|
||||
|
||||
Create(S1 : Surface from Geom;
|
||||
S2 : Surface from Geom;
|
||||
U1min, U1max : Parameter from Quantity;
|
||||
V1min, V1max : Parameter from Quantity;
|
||||
U2min, U2max : Parameter from Quantity;
|
||||
V2min, V2max : Parameter from Quantity)
|
||||
---Purpose: Computes the extrema distances between
|
||||
-- the portion of the surface S1 limited by the
|
||||
-- two values of parameter (U1min,U1max) in
|
||||
-- the u parametric direction, and by the two
|
||||
-- values of parameter (V1min,V1max) in the v
|
||||
-- parametric direction, and
|
||||
-- - the portion of the surface S2 limited by the
|
||||
-- two values of parameter (U2min,U2max) in
|
||||
-- the u parametric direction, and by the two
|
||||
-- values of parameter (V2min,V2max) in the v
|
||||
-- parametric direction.
|
||||
returns ExtremaSurfaceSurface from GeomAPI;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
S1 : Surface from Geom;
|
||||
S2 : Surface from Geom)
|
||||
---Purpose: Initializes this algorithm with the given arguments
|
||||
-- and computes the extrema distances between the
|
||||
-- surfaces <S1> and <S2>
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
S1 : Surface from Geom;
|
||||
S2 : Surface from Geom;
|
||||
U1min, U1max : Parameter from Quantity;
|
||||
V1min, V1max : Parameter from Quantity;
|
||||
U2min, U2max : Parameter from Quantity;
|
||||
V2min, V2max : Parameter from Quantity)
|
||||
---Purpose: Initializes this algorithm with the given arguments
|
||||
-- and computes the extrema distances between -
|
||||
-- the portion of the surface S1 limited by the two
|
||||
-- values of parameter (U1min,U1max) in the u
|
||||
-- parametric direction, and by the two values of
|
||||
-- parameter (V1min,V1max) in the v parametric direction, and
|
||||
-- - the portion of the surface S2 limited by the two
|
||||
-- values of parameter (U2min,U2max) in the u
|
||||
-- parametric direction, and by the two values of
|
||||
-- parameter (V2min,V2max) in the v parametric direction.
|
||||
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 Pnt from gp )
|
||||
---Purpose: Returns the points P1 on the first surface and P2 on
|
||||
-- the second surface, 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, V1 : out Parameter from Quantity;
|
||||
U2, V2 : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters (U1,V1) of the point on the
|
||||
-- first surface, and (U2,V2) of the point on the second
|
||||
-- surface, 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 Pnt from gp)
|
||||
---Purpose: Returns the points P1 on the first surface and P2 on
|
||||
-- the second surface, 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, V1 : out Parameter from Quantity;
|
||||
U2, V2 : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters (U1,V1) of the point on the
|
||||
-- first surface and (U2,V2) of the point on the second
|
||||
-- surface, 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)
|
||||
---Purpose: return the algorithmic object from Extrema
|
||||
---Level: Advanced
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
returns ExtSS from Extrema
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIsDone: Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtSS : ExtSS from Extrema;
|
||||
|
||||
|
||||
end ExtremaSurfaceSurface;
|
@@ -14,21 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_ExtremaSurfaceSurface.ixx>
|
||||
|
||||
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <Extrema_ExtSS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAPI_ExtremaSurfaceSurface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_ExtremaSurfaceSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAPI_ExtremaSurfaceSurface::GeomAPI_ExtremaSurfaceSurface()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
183
src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.hxx
Normal file
183
src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.hxx
Normal file
@@ -0,0 +1,183 @@
|
||||
// Created on: 1994-03-18
|
||||
// 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 _GeomAPI_ExtremaSurfaceSurface_HeaderFile
|
||||
#define _GeomAPI_ExtremaSurfaceSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtSS.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class Geom_Surface;
|
||||
class gp_Pnt;
|
||||
class Extrema_ExtSS;
|
||||
|
||||
|
||||
//! Describes functions for computing all the extrema
|
||||
//! between two surfaces.
|
||||
//! An ExtremaSurfaceSurface algorithm minimizes or
|
||||
//! maximizes the distance between a point on the first
|
||||
//! surface and a point on the second surface. Results
|
||||
//! are start and end points of perpendiculars common to the two surfaces.
|
||||
//! Solutions consist of pairs of points, and an extremum
|
||||
//! is considered to be a segment joining the two points of a solution.
|
||||
//! An ExtremaSurfaceSurface 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 the two
|
||||
//! surfaces do not correspond to one of the computed
|
||||
//! extrema. Instead, they may be given by:
|
||||
//! - a point of a bounding curve of one surface and one of the following:
|
||||
//! - its orthogonal projection on the other surface,
|
||||
//! - a point of a bounding curve of the other surface; or
|
||||
//! - any point on intersection curves between the two surfaces.
|
||||
class GeomAPI_ExtremaSurfaceSurface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty algorithm for computing
|
||||
//! extrema between two surfaces. Use an Init function
|
||||
//! to define the surfaces on which it is going to work.
|
||||
Standard_EXPORT GeomAPI_ExtremaSurfaceSurface();
|
||||
|
||||
//! Computes the extrema distances between the
|
||||
//! surfaces <S1> and <S2>
|
||||
Standard_EXPORT GeomAPI_ExtremaSurfaceSurface(const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2);
|
||||
|
||||
//! Computes the extrema distances between
|
||||
//! the portion of the surface S1 limited by the
|
||||
//! two values of parameter (U1min,U1max) in
|
||||
//! the u parametric direction, and by the two
|
||||
//! values of parameter (V1min,V1max) in the v
|
||||
//! parametric direction, and
|
||||
//! - the portion of the surface S2 limited by the
|
||||
//! two values of parameter (U2min,U2max) in
|
||||
//! the u parametric direction, and by the two
|
||||
//! values of parameter (V2min,V2max) in the v
|
||||
//! parametric direction.
|
||||
Standard_EXPORT GeomAPI_ExtremaSurfaceSurface(const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Quantity_Parameter U1min, const Quantity_Parameter U1max, const Quantity_Parameter V1min, const Quantity_Parameter V1max, const Quantity_Parameter U2min, const Quantity_Parameter U2max, const Quantity_Parameter V2min, const Quantity_Parameter V2max);
|
||||
|
||||
//! Initializes this algorithm with the given arguments
|
||||
//! and computes the extrema distances between the
|
||||
//! surfaces <S1> and <S2>
|
||||
Standard_EXPORT void Init (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2);
|
||||
|
||||
//! Initializes this algorithm with the given arguments
|
||||
//! and computes the extrema distances between -
|
||||
//! the portion of the surface S1 limited by the two
|
||||
//! values of parameter (U1min,U1max) in the u
|
||||
//! parametric direction, and by the two values of
|
||||
//! parameter (V1min,V1max) in the v parametric direction, and
|
||||
//! - the portion of the surface S2 limited by the two
|
||||
//! values of parameter (U2min,U2max) in the u
|
||||
//! parametric direction, and by the two values of
|
||||
//! parameter (V2min,V2max) in the v parametric direction.
|
||||
Standard_EXPORT void Init (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Quantity_Parameter U1min, const Quantity_Parameter U1max, const Quantity_Parameter V1min, const Quantity_Parameter V1max, const Quantity_Parameter U2min, const Quantity_Parameter U2max, const Quantity_Parameter V2min, const Quantity_Parameter V2max);
|
||||
|
||||
//! 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 surface and P2 on
|
||||
//! the second surface, 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_Pnt& P1, gp_Pnt& P2) const;
|
||||
|
||||
//! Returns the parameters (U1,V1) of the point on the
|
||||
//! first surface, and (U2,V2) of the point on the second
|
||||
//! surface, 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& V1, Quantity_Parameter& U2, Quantity_Parameter& V2) 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 surface and P2 on
|
||||
//! the second surface, which are the ends of the
|
||||
//! shortest extremum computed by this algorithm.
|
||||
//! Exceptions StdFail_NotDone if this algorithm fails.
|
||||
Standard_EXPORT void NearestPoints (gp_Pnt& P1, gp_Pnt& P2) const;
|
||||
|
||||
//! Returns the parameters (U1,V1) of the point on the
|
||||
//! first surface and (U2,V2) of the point on the second
|
||||
//! surface, 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& V1, Quantity_Parameter& U2, Quantity_Parameter& V2) 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;
|
||||
|
||||
//! return the algorithmic object from Extrema
|
||||
const Extrema_ExtSS& Extrema() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtSS myExtSS;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GeomAPI_ExtremaSurfaceSurface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_ExtremaSurfaceSurface_HeaderFile
|
@@ -1,139 +0,0 @@
|
||||
-- Created on: 1995-09-12
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- Copyright (c) 1995-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 IntCS from GeomAPI
|
||||
|
||||
---Purpose: This class implements methods for
|
||||
-- computing intersection points and segments between a
|
||||
--3D curve and a surface.
|
||||
-- It intersects a Curve and a Surface from Geom. The
|
||||
-- result is a set of points and segments with their
|
||||
-- parameters on the curve and the surface. The
|
||||
-- "domain" used for a surface is the natural
|
||||
-- parametric domain unless the surface is a
|
||||
-- RectangularTrimmedSurface from Geom.
|
||||
|
||||
uses
|
||||
Parameter from Quantity,
|
||||
Surface from Geom,
|
||||
Curve from Geom,
|
||||
Pnt from gp,
|
||||
HInter from IntCurveSurface
|
||||
|
||||
|
||||
raises
|
||||
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns IntCS from GeomAPI;
|
||||
|
||||
---Purpose: Creates an empty object. Use the
|
||||
-- function Perform for further initialization of the algorithm by
|
||||
-- the curve and the surface.
|
||||
|
||||
Create(C : Curve from Geom; S : Surface from Geom)
|
||||
returns IntCS from GeomAPI;
|
||||
---Purpose: Computes the intersections between
|
||||
-- the curve C and the surface S.
|
||||
-- Warning
|
||||
-- Use function IsDone to verify that the intersections are computed successfully.
|
||||
|
||||
Perform(me : in out; C : Curve from Geom; S : Surface from Geom);
|
||||
---Purpose: This function Initializes an algorithm with the curve C and the
|
||||
-- surface S and computes the intersections between C and S.
|
||||
-- Warning
|
||||
-- Use function IsDone to verify that the intersections are computed successfully.
|
||||
|
||||
IsDone(me)
|
||||
---Purpose: Returns true if the intersections are successfully computed.
|
||||
returns Boolean from Standard;
|
||||
|
||||
NbPoints(me)
|
||||
---Purpose: Returns the number of Intersection Points
|
||||
-- if IsDone returns True.
|
||||
-- else NotDone is raised.
|
||||
returns Integer from Standard
|
||||
raises NotDone from StdFail;
|
||||
|
||||
Point(me; Index: Integer from Standard)
|
||||
---Purpose: Returns the Intersection Point of range <Index>in case of cross intersection.
|
||||
-- Raises NotDone if the computation has failed or if
|
||||
-- the computation has not been done
|
||||
-- raises OutOfRange if Index is not in the range <1..NbPoints>
|
||||
---C++: return const &
|
||||
returns Pnt from gp
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard;
|
||||
|
||||
Parameters(me; Index: Integer from Standard;
|
||||
U,V,W : out Parameter from Quantity)
|
||||
---Purpose: Returns parameter W on the curve
|
||||
-- and (parameters U,V) on the surface of the computed intersection point
|
||||
-- of index Index in case of cross intersection.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if intersection algorithm fails or is not initialized.
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
-- NbPoints is the number of computed intersection points.
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard;
|
||||
|
||||
NbSegments(me)
|
||||
---Purpose: Returns the number of computed
|
||||
-- intersection segments in case of tangential intersection.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if the intersection algorithm fails or is not initialized.
|
||||
returns Integer from Standard
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
Segment(me; Index: Integer from Standard)
|
||||
---Purpose: Returns the computed intersection
|
||||
-- segment of index Index in case of tangential intersection.
|
||||
-- Intersection segment is a portion of the initial curve tangent to surface.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if intersection algorithm fails or is not initialized.
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
-- where NbSegments is the number of computed intersection segments.
|
||||
|
||||
returns Curve from Geom
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard;
|
||||
|
||||
|
||||
Parameters(me; Index : Integer from Standard;
|
||||
U1,V1, U2, V2 : out Parameter from Quantity)
|
||||
|
||||
---Purpose: Returns the parameters of the first (U1,V1) and the last (U2,V2) points
|
||||
-- of curve's segment on the surface in case of tangential intersection.
|
||||
-- Index is the number of computed intersection segments.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if intersection algorithm fails or is not initialized.
|
||||
-- Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
-- where NbSegments is the number of computed intersection segments.
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard;
|
||||
|
||||
fields
|
||||
|
||||
myCurve : Curve from Geom;
|
||||
myIntCS : HInter from IntCurveSurface;
|
||||
|
||||
end IntCS;
|
@@ -14,19 +14,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_IntCS.ixx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAPI_IntCS.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IntCurveSurface_IntersectionPoint.hxx>
|
||||
#include <IntCurveSurface_IntersectionSegment.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_IntCS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAPI_IntCS::GeomAPI_IntCS()
|
||||
{
|
||||
}
|
||||
|
133
src/GeomAPI/GeomAPI_IntCS.hxx
Normal file
133
src/GeomAPI/GeomAPI_IntCS.hxx
Normal file
@@ -0,0 +1,133 @@
|
||||
// Created on: 1995-09-12
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1995-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 _GeomAPI_IntCS_HeaderFile
|
||||
#define _GeomAPI_IntCS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <IntCurveSurface_HInter.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
class Geom_Curve;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Geom_Surface;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
//! This class implements methods for
|
||||
//! computing intersection points and segments between a
|
||||
class GeomAPI_IntCS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty object. Use the
|
||||
//! function Perform for further initialization of the algorithm by
|
||||
//! the curve and the surface.
|
||||
Standard_EXPORT GeomAPI_IntCS();
|
||||
|
||||
//! Computes the intersections between
|
||||
//! the curve C and the surface S.
|
||||
//! Warning
|
||||
//! Use function IsDone to verify that the intersections are computed successfully.
|
||||
Standard_EXPORT GeomAPI_IntCS(const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
|
||||
|
||||
//! This function Initializes an algorithm with the curve C and the
|
||||
//! surface S and computes the intersections between C and S.
|
||||
//! Warning
|
||||
//! Use function IsDone to verify that the intersections are computed successfully.
|
||||
Standard_EXPORT void Perform (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
|
||||
|
||||
//! Returns true if the intersections are successfully computed.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of Intersection Points
|
||||
//! if IsDone returns True.
|
||||
//! else NotDone is raised.
|
||||
Standard_EXPORT Standard_Integer NbPoints() const;
|
||||
|
||||
//! Returns the Intersection Point of range <Index>in case of cross intersection.
|
||||
//! Raises NotDone if the computation has failed or if
|
||||
//! the computation has not been done
|
||||
//! raises OutOfRange if Index is not in the range <1..NbPoints>
|
||||
Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns parameter W on the curve
|
||||
//! and (parameters U,V) on the surface of the computed intersection point
|
||||
//! of index Index in case of cross intersection.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if intersection algorithm fails or is not initialized.
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
|
||||
//! NbPoints is the number of computed intersection points.
|
||||
Standard_EXPORT void Parameters (const Standard_Integer Index, Quantity_Parameter& U, Quantity_Parameter& V, Quantity_Parameter& W) const;
|
||||
|
||||
//! Returns the number of computed
|
||||
//! intersection segments in case of tangential intersection.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if the intersection algorithm fails or is not initialized.
|
||||
Standard_EXPORT Standard_Integer NbSegments() const;
|
||||
|
||||
//! Returns the computed intersection
|
||||
//! segment of index Index in case of tangential intersection.
|
||||
//! Intersection segment is a portion of the initial curve tangent to surface.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if intersection algorithm fails or is not initialized.
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
//! where NbSegments is the number of computed intersection segments.
|
||||
Standard_EXPORT Handle(Geom_Curve) Segment (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the parameters of the first (U1,V1) and the last (U2,V2) points
|
||||
//! of curve's segment on the surface in case of tangential intersection.
|
||||
//! Index is the number of computed intersection segments.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if intersection algorithm fails or is not initialized.
|
||||
//! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
|
||||
//! where NbSegments is the number of computed intersection segments.
|
||||
Standard_EXPORT void Parameters (const Standard_Integer Index, Quantity_Parameter& U1, Quantity_Parameter& V1, Quantity_Parameter& U2, Quantity_Parameter& V2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom_Curve) myCurve;
|
||||
IntCurveSurface_HInter myIntCS;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_IntCS_HeaderFile
|
@@ -1,105 +0,0 @@
|
||||
-- Created on: 1995-03-14
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- Copyright (c) 1995-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 IntSS from GeomAPI
|
||||
|
||||
---Purpose: This class implements methods for
|
||||
-- computing the intersection curves between two surfaces.
|
||||
-- The result is curves from Geom. The "domain" used for
|
||||
-- a surface is the natural parametric domain
|
||||
-- unless the surface is a RectangularTrimmedSurface
|
||||
-- from Geom.
|
||||
|
||||
|
||||
uses IntSS from GeomInt,
|
||||
Surface from Geom,
|
||||
Curve from Geom
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Constructs an empty object. Use the
|
||||
-- function Perform for further initialization algorithm by two surfaces.
|
||||
returns IntSS from GeomAPI;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Create(S1,S2: Surface from Geom; Tol: Real from Standard)
|
||||
---Purpose: Computes the intersection curves
|
||||
-- between the two surfaces S1 and S2. Parameter Tol defines the precision
|
||||
-- of curves computation. For most cases the value 1.0e-7 is recommended to use.
|
||||
-- Warning
|
||||
-- Use the function IsDone to verify that the intersections are successfully computed.I
|
||||
---C++: inline
|
||||
returns IntSS from GeomAPI;
|
||||
|
||||
|
||||
Perform(me: in out;S1,S2: Surface from Geom; Tol: Real from Standard)
|
||||
---Purpose: Initializes an algorithm with the
|
||||
-- given arguments and computes the intersection curves between the two surfaces S1 and S2.
|
||||
-- Parameter Tol defines the precision of curves computation. For most
|
||||
-- cases the value 1.0e-7 is recommended to use.
|
||||
-- Warning
|
||||
-- Use function IsDone to verify that the intersections are successfully computed.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
IsDone(me)
|
||||
---Purpose: Returns True if the intersection was successful.
|
||||
returns Boolean from Standard
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
NbLines(me)
|
||||
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
---Purpose: Returns the number of computed intersection curves.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if the computation fails.
|
||||
raises NotDone from StdFail
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Line(me; Index: Integer from Standard)
|
||||
---Purpose: Returns the computed intersection curve of index Index.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if the computation fails.
|
||||
-- Standard_OutOfRange if Index is out of range [1, NbLines] where NbLines
|
||||
-- is the number of computed intersection curves.
|
||||
returns any Curve from Geom
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
raises NotDone from StdFail,
|
||||
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIntersec : IntSS from GeomInt;
|
||||
|
||||
end IntSS;
|
@@ -14,4 +14,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_IntSS.ixx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAPI_IntSS.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
106
src/GeomAPI/GeomAPI_IntSS.hxx
Normal file
106
src/GeomAPI/GeomAPI_IntSS.hxx
Normal file
@@ -0,0 +1,106 @@
|
||||
// Created on: 1995-03-14
|
||||
// Created by: Jacques GOUSSARD
|
||||
// Copyright (c) 1995-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 _GeomAPI_IntSS_HeaderFile
|
||||
#define _GeomAPI_IntSS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GeomInt_IntSS.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Geom_Surface;
|
||||
class Geom_Curve;
|
||||
|
||||
|
||||
//! This class implements methods for
|
||||
//! computing the intersection curves between two surfaces.
|
||||
//! The result is curves from Geom. The "domain" used for
|
||||
//! a surface is the natural parametric domain
|
||||
//! unless the surface is a RectangularTrimmedSurface
|
||||
//! from Geom.
|
||||
class GeomAPI_IntSS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty object. Use the
|
||||
//! function Perform for further initialization algorithm by two surfaces.
|
||||
GeomAPI_IntSS();
|
||||
|
||||
//! Computes the intersection curves
|
||||
//! between the two surfaces S1 and S2. Parameter Tol defines the precision
|
||||
//! of curves computation. For most cases the value 1.0e-7 is recommended to use.
|
||||
//! Warning
|
||||
//! Use the function IsDone to verify that the intersections are successfully computed.I
|
||||
GeomAPI_IntSS(const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol);
|
||||
|
||||
//! Initializes an algorithm with the
|
||||
//! given arguments and computes the intersection curves between the two surfaces S1 and S2.
|
||||
//! Parameter Tol defines the precision of curves computation. For most
|
||||
//! cases the value 1.0e-7 is recommended to use.
|
||||
//! Warning
|
||||
//! Use function IsDone to verify that the intersections are successfully computed.
|
||||
void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol);
|
||||
|
||||
//! Returns True if the intersection was successful.
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of computed intersection curves.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if the computation fails.
|
||||
Standard_Integer NbLines() const;
|
||||
|
||||
//! Returns the computed intersection curve of index Index.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if the computation fails.
|
||||
//! Standard_OutOfRange if Index is out of range [1, NbLines] where NbLines
|
||||
//! is the number of computed intersection curves.
|
||||
const Handle(Geom_Curve)& Line (const Standard_Integer Index) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
GeomInt_IntSS myIntersec;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GeomAPI_IntSS.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_IntSS_HeaderFile
|
@@ -1,232 +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 GeomAPI
|
||||
|
||||
---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
|
||||
-- Describes functions for building a constrained 3D BSpline curve.
|
||||
-- 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
|
||||
|
||||
Vec from gp,
|
||||
Array1OfPnt from TColgp,
|
||||
HArray1OfPnt from TColgp,
|
||||
Array1OfVec from TColgp,
|
||||
HArray1OfBoolean from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
HArray1OfVec from TColgp,
|
||||
BSplineCurve from Geom
|
||||
|
||||
raises
|
||||
NotDone from StdFail,
|
||||
ConstructionError from Standard
|
||||
is
|
||||
|
||||
Create(Points : HArray1OfPnt from TColgp ;
|
||||
PeriodicFlag : Boolean from Standard ;
|
||||
Tolerance : Real)
|
||||
---Purpose: Initializes an algorithm for constructing a
|
||||
-- constrained BSpline curve passing through the points of the table Points.
|
||||
-- Tangential vectors can then be assigned, using the function Load.
|
||||
-- If PeriodicFlag is true, the constrained BSpline
|
||||
-- curve will be periodic and closed. In this case,
|
||||
-- the junction point is the first point of the table Points.
|
||||
-- The tolerance value Tolerance is used to check that:
|
||||
-- - points are not too close to each other, or
|
||||
-- - tangential vectors (defined using the
|
||||
-- function Load) are not too small.
|
||||
-- The resulting BSpline curve will be "C2"
|
||||
-- continuous, except where a tangency
|
||||
-- constraint is defined on a point through which
|
||||
-- the curve passes (by using the Load function).
|
||||
-- In this case, it will be only "C1" continuous.
|
||||
-- Once all the constraints are defined, use the
|
||||
-- function Perform to compute the curve.
|
||||
-- Warning
|
||||
-- - There must be at least 2 points in the table Points.
|
||||
-- - If PeriodicFlag is false, there must be as
|
||||
-- many parameters in the array Parameters as
|
||||
-- there are points in the array Points.
|
||||
-- - If PeriodicFlag is true, there must be one
|
||||
-- more parameter in the table Parameters: this
|
||||
-- is used to give the parameter on the
|
||||
-- resulting BSpline curve of the junction point
|
||||
-- of the curve (which is also the first point of the table Points).
|
||||
-- Exceptions
|
||||
-- - Standard_ConstructionError if the
|
||||
-- distance between two consecutive points in
|
||||
-- the table Points is less than or equal to Tolerance.
|
||||
-- - Standard_OutOfRange if:
|
||||
-- - there are less than two points in the table Points, or
|
||||
-- - conditions relating to the respective
|
||||
-- number of elements in the parallel tables
|
||||
-- Points and Parameters are not respected.
|
||||
|
||||
returns Interpolate from GeomAPI
|
||||
|
||||
raises ConstructionError from Standard ;
|
||||
|
||||
Create(Points : HArray1OfPnt from TColgp ;
|
||||
Parameters : HArray1OfReal from TColStd;
|
||||
PeriodicFlag : Boolean from Standard;
|
||||
Tolerance : Real)
|
||||
---Purpose: Initializes an algorithm for constructing a
|
||||
-- constrained BSpline curve passing through the points of the table
|
||||
-- Points, where the parameters of each of its
|
||||
-- points are given by the parallel table Parameters.
|
||||
-- Tangential vectors can then be assigned, using the function Load.
|
||||
-- If PeriodicFlag is true, the constrained BSpline
|
||||
-- curve will be periodic and closed. In this case,
|
||||
-- the junction point is the first point of the table Points.
|
||||
-- The tolerance value Tolerance is used to check that:
|
||||
-- - points are not too close to each other, or
|
||||
-- - tangential vectors (defined using the
|
||||
-- function Load) are not too small.
|
||||
-- The resulting BSpline curve will be "C2"
|
||||
-- continuous, except where a tangency
|
||||
-- constraint is defined on a point through which
|
||||
-- the curve passes (by using the Load function).
|
||||
-- In this case, it will be only "C1" continuous.
|
||||
-- Once all the constraints are defined, use the
|
||||
-- function Perform to compute the curve.
|
||||
-- Warning
|
||||
-- - There must be at least 2 points in the table Points.
|
||||
-- - If PeriodicFlag is false, there must be as
|
||||
-- many parameters in the array Parameters as
|
||||
-- there are points in the array Points.
|
||||
-- - If PeriodicFlag is true, there must be one
|
||||
-- more parameter in the table Parameters: this
|
||||
-- is used to give the parameter on the
|
||||
-- resulting BSpline curve of the junction point
|
||||
-- of the curve (which is also the first point of the table Points).
|
||||
-- Exceptions
|
||||
-- - Standard_ConstructionError if the
|
||||
-- distance between two consecutive points in
|
||||
-- the table Points is less than or equal to Tolerance.
|
||||
-- - Standard_OutOfRange if:
|
||||
-- - there are less than two points in the table Points, or
|
||||
-- - conditions relating to the respective
|
||||
-- number of elements in the parallel tables
|
||||
-- Points and Parameters are not respected.
|
||||
|
||||
returns Interpolate from GeomAPI
|
||||
|
||||
raises ConstructionError from Standard ;
|
||||
Load(me : in out;
|
||||
InitialTangent : Vec from gp;
|
||||
FinalTangent : Vec from gp;
|
||||
Scale : Boolean from Standard = Standard_True)
|
||||
---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 : Array1OfVec from TColgp ;
|
||||
TangentFlags : HArray1OfBoolean from TColStd;
|
||||
Scale : Boolean from Standard = Standard_True)
|
||||
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 Geom
|
||||
---Purpose: Returns the computed BSpline curve.
|
||||
-- Raises StdFail_NotDone if the interpolation fails.
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator Handle(Geom_BSplineCurve)() const;"
|
||||
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 : HArray1OfPnt from TColgp ;
|
||||
-- the points to interpolates
|
||||
myIsDone : Boolean from Standard ;
|
||||
-- the algorithm did complete OK if Standard_True
|
||||
myCurve : BSplineCurve from Geom ;
|
||||
-- the interpolated curve
|
||||
myTangents : HArray1OfVec 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 @@
|
||||
|
||||
// 08-Aug-95 : xab : interpolation uses BSplCLib::Interpolate
|
||||
|
||||
#include <GeomAPI_Interpolate.ixx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <PLib.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <GeomAPI_Interpolate.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <PLib.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColStd_Array1OfBoolean.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_Array1OfBoolean.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean CheckPoints(const TColgp_Array1OfPnt& PointArray,
|
||||
const Standard_Real Tolerance)
|
||||
{
|
||||
|
215
src/GeomAPI/GeomAPI_Interpolate.hxx
Normal file
215
src/GeomAPI/GeomAPI_Interpolate.hxx
Normal file
@@ -0,0 +1,215 @@
|
||||
// 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 _GeomAPI_Interpolate_HeaderFile
|
||||
#define _GeomAPI_Interpolate_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColgp_HArray1OfVec.hxx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
class Geom_BSplineCurve;
|
||||
class StdFail_NotDone;
|
||||
class Standard_ConstructionError;
|
||||
class gp_Vec;
|
||||
|
||||
|
||||
//! 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
|
||||
//! Describes functions for building a constrained 3D BSpline curve.
|
||||
//! 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 GeomAPI_Interpolate
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Initializes an algorithm for constructing a
|
||||
//! constrained BSpline curve passing through the points of the table Points.
|
||||
//! Tangential vectors can then be assigned, using the function Load.
|
||||
//! If PeriodicFlag is true, the constrained BSpline
|
||||
//! curve will be periodic and closed. In this case,
|
||||
//! the junction point is the first point of the table Points.
|
||||
//! The tolerance value Tolerance is used to check that:
|
||||
//! - points are not too close to each other, or
|
||||
//! - tangential vectors (defined using the
|
||||
//! function Load) are not too small.
|
||||
//! The resulting BSpline curve will be "C2"
|
||||
//! continuous, except where a tangency
|
||||
//! constraint is defined on a point through which
|
||||
//! the curve passes (by using the Load function).
|
||||
//! In this case, it will be only "C1" continuous.
|
||||
//! Once all the constraints are defined, use the
|
||||
//! function Perform to compute the curve.
|
||||
//! Warning
|
||||
//! - There must be at least 2 points in the table Points.
|
||||
//! - If PeriodicFlag is false, there must be as
|
||||
//! many parameters in the array Parameters as
|
||||
//! there are points in the array Points.
|
||||
//! - If PeriodicFlag is true, there must be one
|
||||
//! more parameter in the table Parameters: this
|
||||
//! is used to give the parameter on the
|
||||
//! resulting BSpline curve of the junction point
|
||||
//! of the curve (which is also the first point of the table Points).
|
||||
//! Exceptions
|
||||
//! - Standard_ConstructionError if the
|
||||
//! distance between two consecutive points in
|
||||
//! the table Points is less than or equal to Tolerance.
|
||||
//! - Standard_OutOfRange if:
|
||||
//! - there are less than two points in the table Points, or
|
||||
//! - conditions relating to the respective
|
||||
//! number of elements in the parallel tables
|
||||
//! Points and Parameters are not respected.
|
||||
Standard_EXPORT GeomAPI_Interpolate(const Handle(TColgp_HArray1OfPnt)& Points, const Standard_Boolean PeriodicFlag, const Standard_Real Tolerance);
|
||||
|
||||
//! Initializes an algorithm for constructing a
|
||||
//! constrained BSpline curve passing through the points of the table
|
||||
//! Points, where the parameters of each of its
|
||||
//! points are given by the parallel table Parameters.
|
||||
//! Tangential vectors can then be assigned, using the function Load.
|
||||
//! If PeriodicFlag is true, the constrained BSpline
|
||||
//! curve will be periodic and closed. In this case,
|
||||
//! the junction point is the first point of the table Points.
|
||||
//! The tolerance value Tolerance is used to check that:
|
||||
//! - points are not too close to each other, or
|
||||
//! - tangential vectors (defined using the
|
||||
//! function Load) are not too small.
|
||||
//! The resulting BSpline curve will be "C2"
|
||||
//! continuous, except where a tangency
|
||||
//! constraint is defined on a point through which
|
||||
//! the curve passes (by using the Load function).
|
||||
//! In this case, it will be only "C1" continuous.
|
||||
//! Once all the constraints are defined, use the
|
||||
//! function Perform to compute the curve.
|
||||
//! Warning
|
||||
//! - There must be at least 2 points in the table Points.
|
||||
//! - If PeriodicFlag is false, there must be as
|
||||
//! many parameters in the array Parameters as
|
||||
//! there are points in the array Points.
|
||||
//! - If PeriodicFlag is true, there must be one
|
||||
//! more parameter in the table Parameters: this
|
||||
//! is used to give the parameter on the
|
||||
//! resulting BSpline curve of the junction point
|
||||
//! of the curve (which is also the first point of the table Points).
|
||||
//! Exceptions
|
||||
//! - Standard_ConstructionError if the
|
||||
//! distance between two consecutive points in
|
||||
//! the table Points is less than or equal to Tolerance.
|
||||
//! - Standard_OutOfRange if:
|
||||
//! - there are less than two points in the table Points, or
|
||||
//! - conditions relating to the respective
|
||||
//! number of elements in the parallel tables
|
||||
//! Points and Parameters are not respected.
|
||||
Standard_EXPORT GeomAPI_Interpolate(const Handle(TColgp_HArray1OfPnt)& 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_Vec& InitialTangent, const gp_Vec& FinalTangent, const Standard_Boolean Scale = Standard_True);
|
||||
|
||||
//! 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_Array1OfVec& Tangents, const Handle(TColStd_HArray1OfBoolean)& TangentFlags, const Standard_Boolean Scale = Standard_True);
|
||||
|
||||
//! 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(Geom_BSplineCurve)& Curve() const;
|
||||
Standard_EXPORT operator Handle(Geom_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_HArray1OfPnt) myPoints;
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom_BSplineCurve) myCurve;
|
||||
Handle(TColgp_HArray1OfVec) myTangents;
|
||||
Handle(TColStd_HArray1OfBoolean) myTangentFlags;
|
||||
Handle(TColStd_HArray1OfReal) myParameters;
|
||||
Standard_Boolean myPeriodic;
|
||||
Standard_Boolean myTangentRequest;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_Interpolate_HeaderFile
|
@@ -1,201 +0,0 @@
|
||||
-- Created on: 1994-03-21
|
||||
-- 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 GeomAPI
|
||||
|
||||
---Purpose: This class is used to approximate a BsplineCurve
|
||||
-- passing through an array of points, with a given Continuity.
|
||||
-- Describes functions for building a 3D 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
|
||||
Array1OfPnt from TColgp,
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
ParametrizationType from Approx,
|
||||
BSplineCurve from Geom
|
||||
|
||||
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 GeomAPI;
|
||||
|
||||
Create(Points : Array1OfPnt from TColgp;
|
||||
DegMin : Integer from Standard = 3;
|
||||
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. 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 Tol3D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from GeomAPI;
|
||||
|
||||
Create(Points : Array1OfPnt from TColgp;
|
||||
ParType : ParametrizationType from Approx;
|
||||
DegMin : Integer from Standard = 3;
|
||||
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. 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 Tol3D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from GeomAPI;
|
||||
|
||||
Create(Points : Array1OfPnt from TColgp;
|
||||
Parameters : Array1OfReal from TColStd;
|
||||
DegMin : Integer from Standard = 3;
|
||||
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, 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 Tol3D
|
||||
---Level: Public
|
||||
returns PointsToBSpline from GeomAPI
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
|
||||
Create(Points : Array1OfPnt 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 GeomAPI;
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt from TColgp;
|
||||
DegMin : Integer from Standard = 3;
|
||||
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. 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 Tol3D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt from TColgp;
|
||||
ParType : ParametrizationType from Approx;
|
||||
DegMin : Integer from Standard = 3;
|
||||
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. 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 Tol3D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt from TColgp;
|
||||
Parameters : Array1OfReal from TColStd;
|
||||
DegMin : Integer from Standard = 3;
|
||||
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, 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 Tol3D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array1OfPnt 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
|
||||
is static;
|
||||
|
||||
Curve(me)
|
||||
---Purpose: Returns the computed BSpline curve.
|
||||
-- Raises StdFail_NotDone if the curve is not built.
|
||||
returns BSplineCurve from Geom
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator Handle(Geom_BSplineCurve)() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
IsDone(me)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
myIsDone : Boolean from Standard;
|
||||
myCurve : BSplineCurve from Geom;
|
||||
|
||||
|
||||
end PointsToBSpline;
|
@@ -14,25 +14,25 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_PointsToBSpline.ixx>
|
||||
|
||||
#include <AppDef_BSplineCompute.hxx>
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <AppDef_MultiPointConstraint.hxx>
|
||||
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppDef_Variational.hxx>
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <GeomAPI_PointsToBSpline.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_PointsToBSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline()
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
|
156
src/GeomAPI/GeomAPI_PointsToBSpline.hxx
Normal file
156
src/GeomAPI/GeomAPI_PointsToBSpline.hxx
Normal file
@@ -0,0 +1,156 @@
|
||||
// Created on: 1994-03-21
|
||||
// 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 _GeomAPI_PointsToBSpline_HeaderFile
|
||||
#define _GeomAPI_PointsToBSpline_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Approx_ParametrizationType.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Geom_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 3D 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 GeomAPI_PointsToBSpline
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty approximation algorithm.
|
||||
//! Use an Init function to define and build the BSpline curve.
|
||||
Standard_EXPORT GeomAPI_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 Tol3D
|
||||
Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Standard_Integer DegMin = 3, 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 Tol3D
|
||||
Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, 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, 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 Tol3D
|
||||
Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, 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 using variational smoothing algorithm,
|
||||
//! which tries to minimize additional criterium:
|
||||
//! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& 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 Tol3D
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Standard_Integer DegMin = 3, 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 Tol3D
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, 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, 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 Tol3D
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, 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 using variational smoothing algorithm,
|
||||
//! which tries to minimize additional criterium:
|
||||
//! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
Standard_EXPORT void Init (const TColgp_Array1OfPnt& 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);
|
||||
|
||||
//! Returns the computed BSpline curve.
|
||||
//! Raises StdFail_NotDone if the curve is not built.
|
||||
Standard_EXPORT const Handle(Geom_BSplineCurve)& Curve() const;
|
||||
Standard_EXPORT operator Handle(Geom_BSplineCurve)() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom_BSplineCurve) myCurve;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_PointsToBSpline_HeaderFile
|
@@ -1,266 +0,0 @@
|
||||
-- Created on: 1995-01-16
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1995-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 PointsToBSplineSurface from GeomAPI
|
||||
|
||||
---Purpose: This class is used to approximate or interpolate
|
||||
-- a BSplineSurface passing through an Array2 of
|
||||
-- points, with a given continuity.
|
||||
-- Describes functions for building a BSpline
|
||||
-- surface which approximates or interpolates a set of points.
|
||||
-- A PointsToBSplineSurface object provides a framework for:
|
||||
-- - defining the data of the BSpline surface to be built,
|
||||
-- - implementing the approximation algorithm
|
||||
-- or the interpolation algorithm, and consulting the results.
|
||||
uses
|
||||
Array2OfPnt from TColgp,
|
||||
Array2OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
BSplineSurface from Geom,
|
||||
ParametrizationType from Approx
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
Create
|
||||
---Purpose: Constructs an empty algorithm for
|
||||
-- approximation or interpolation of a surface.
|
||||
-- Use:
|
||||
-- - an Init function to define and build the
|
||||
-- BSpline surface by approximation, or
|
||||
-- - an Interpolate function to define and build
|
||||
-- the BSpline surface by interpolation.
|
||||
|
||||
returns PointsToBSplineSurface from GeomAPI;
|
||||
|
||||
Create(Points : Array2OfPnt from TColgp;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximates a BSpline Surface passing through an
|
||||
-- array of Points. 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 Tol3D
|
||||
---Level: Public
|
||||
returns PointsToBSplineSurface from GeomAPI;
|
||||
|
||||
Create(Points : Array2OfPnt from TColgp;
|
||||
ParType : ParametrizationType from Approx;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximates a BSpline Surface passing through an
|
||||
-- array of Points. 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 Tol3D
|
||||
---Level: Public
|
||||
returns PointsToBSplineSurface from GeomAPI;
|
||||
|
||||
Create(Points : Array2OfPnt 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: Approximates a BSpline Surface passing through an
|
||||
-- array of points using variational smoothing algorithm,
|
||||
-- which tries to minimize additional criterium:
|
||||
-- Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
---Level: Public
|
||||
returns PointsToBSplineSurface from GeomAPI;
|
||||
|
||||
Create(ZPoints : Array2OfReal from TColStd;
|
||||
X0 : Real from Standard;
|
||||
dX : Real from Standard;
|
||||
Y0 : Real from Standard;
|
||||
dY : Real from Standard;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximates a BSpline Surface passing through an
|
||||
-- array of Points.
|
||||
--
|
||||
-- The points will be constructed as follow:
|
||||
-- P(i,j) = gp_Pnt( X0 + (i-1)*dX ,
|
||||
-- Y0 + (j-1)*dY ,
|
||||
-- ZPoints(i,j) )
|
||||
--
|
||||
-- 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 Tol3D
|
||||
-- 4- the parametrization of the surface will verify:
|
||||
-- S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );
|
||||
---Level: Public
|
||||
returns PointsToBSplineSurface from GeomAPI;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array2OfPnt from TColgp;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximates a BSpline Surface 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 Tol3D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Interpolate(me : in out; Points : Array2OfPnt from TColgp)
|
||||
---Purpose: Interpolates a BSpline Surface passing through an
|
||||
-- array of Point. The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be 3.
|
||||
-- 2- his continuity will be C2.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Interpolate(me : in out; Points : Array2OfPnt from TColgp;
|
||||
ParType : ParametrizationType from Approx)
|
||||
---Purpose: Interpolates a BSpline Surface passing through an
|
||||
-- array of Point. The resulting BSpline will have
|
||||
-- the following properties:
|
||||
-- 1- his degree will be 3.
|
||||
-- 2- his continuity will be C2.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
ZPoints : Array2OfReal from TColStd;
|
||||
X0 : Real from Standard;
|
||||
dX : Real from Standard;
|
||||
Y0 : Real from Standard;
|
||||
dY : Real from Standard;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximates a BSpline Surface passing through an
|
||||
-- array of Points.
|
||||
--
|
||||
-- The points will be constructed as follow:
|
||||
-- P(i,j) = gp_Pnt( X0 + (i-1)*dX ,
|
||||
-- Y0 + (j-1)*dY ,
|
||||
-- ZPoints(i,j) )
|
||||
--
|
||||
-- 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 Tol3D
|
||||
-- 4- the parametrization of the surface will verify:
|
||||
-- S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Interpolate(me : in out;
|
||||
ZPoints : Array2OfReal from TColStd;
|
||||
X0 : Real from Standard;
|
||||
dX : Real from Standard;
|
||||
Y0 : Real from Standard;
|
||||
dY : Real from Standard)
|
||||
---Purpose: Interpolates a BSpline Surface passing through an
|
||||
-- array of Points.
|
||||
--
|
||||
-- The points will be constructed as follow:
|
||||
-- P(i,j) = gp_Pnt( X0 + (i-1)*dX ,
|
||||
-- Y0 + (j-1)*dY ,
|
||||
-- ZPoints(i,j) )
|
||||
--
|
||||
-- The resulting BSpline will have the following
|
||||
-- properties:
|
||||
-- 1- his degree will be 3
|
||||
-- 2- his continuity will be C2.
|
||||
-- 4- the parametrization of the surface will verify:
|
||||
-- S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array2OfPnt from TColgp;
|
||||
ParType : ParametrizationType from Approx;
|
||||
DegMin : Integer from Standard = 3;
|
||||
DegMax : Integer from Standard = 8;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C2;
|
||||
Tol3D : Real from Standard = 1.0e-3)
|
||||
---Purpose: Approximates a BSpline Surface 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 Tol3D
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
Points : Array2OfPnt 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: Approximates a BSpline Surface 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;
|
||||
|
||||
|
||||
Surface(me)
|
||||
---Purpose: Returns the approximate BSpline Surface
|
||||
returns BSplineSurface from Geom
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator Handle(Geom_BSplineSurface)() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
IsDone(me)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
myIsDone : Boolean from Standard;
|
||||
mySurface : BSplineSurface from Geom;
|
||||
|
||||
end PointsToBSplineSurface;
|
@@ -14,31 +14,31 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_PointsToBSplineSurface.ixx>
|
||||
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <GeomFill_SectionGenerator.hxx>
|
||||
#include <GeomFill_Line.hxx>
|
||||
#include <GeomFill_AppSurf.hxx>
|
||||
#include <GeomAPI_PointsToBSpline.hxx>
|
||||
#include <AppDef_BSplineCompute.hxx>
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <AppDef_MultiPointConstraint.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <AppDef_Variational.hxx>
|
||||
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <GeomAPI_PointsToBSpline.hxx>
|
||||
#include <GeomAPI_PointsToBSplineSurface.hxx>
|
||||
#include <GeomFill_AppSurf.hxx>
|
||||
#include <GeomFill_Line.hxx>
|
||||
#include <GeomFill_SectionGenerator.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_PointsToBSplineSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAPI_PointsToBSplineSurface::GeomAPI_PointsToBSplineSurface()
|
||||
: myIsDone ( Standard_False)
|
||||
{
|
||||
|
205
src/GeomAPI/GeomAPI_PointsToBSplineSurface.hxx
Normal file
205
src/GeomAPI/GeomAPI_PointsToBSplineSurface.hxx
Normal file
@@ -0,0 +1,205 @@
|
||||
// Created on: 1995-01-16
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1995-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 _GeomAPI_PointsToBSplineSurface_HeaderFile
|
||||
#define _GeomAPI_PointsToBSplineSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Approx_ParametrizationType.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
class Geom_BSplineSurface;
|
||||
class StdFail_NotDone;
|
||||
|
||||
|
||||
//! This class is used to approximate or interpolate
|
||||
//! a BSplineSurface passing through an Array2 of
|
||||
//! points, with a given continuity.
|
||||
//! Describes functions for building a BSpline
|
||||
//! surface which approximates or interpolates a set of points.
|
||||
//! A PointsToBSplineSurface object provides a framework for:
|
||||
//! - defining the data of the BSpline surface to be built,
|
||||
//! - implementing the approximation algorithm
|
||||
//! or the interpolation algorithm, and consulting the results.
|
||||
class GeomAPI_PointsToBSplineSurface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an empty algorithm for
|
||||
//! approximation or interpolation of a surface.
|
||||
//! Use:
|
||||
//! - an Init function to define and build the
|
||||
//! BSpline surface by approximation, or
|
||||
//! - an Interpolate function to define and build
|
||||
//! the BSpline surface by interpolation.
|
||||
Standard_EXPORT GeomAPI_PointsToBSplineSurface();
|
||||
|
||||
//! Approximates a BSpline Surface passing through an
|
||||
//! array of Points. 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 Tol3D
|
||||
Standard_EXPORT GeomAPI_PointsToBSplineSurface(const TColgp_Array2OfPnt& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Approximates a BSpline Surface passing through an
|
||||
//! array of Points. 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 Tol3D
|
||||
Standard_EXPORT GeomAPI_PointsToBSplineSurface(const TColgp_Array2OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Approximates a BSpline Surface passing through an
|
||||
//! array of points using variational smoothing algorithm,
|
||||
//! which tries to minimize additional criterium:
|
||||
//! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion
|
||||
Standard_EXPORT GeomAPI_PointsToBSplineSurface(const TColgp_Array2OfPnt& 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);
|
||||
|
||||
//! Approximates a BSpline Surface passing through an
|
||||
//! array of Points.
|
||||
//!
|
||||
//! The points will be constructed as follow:
|
||||
//! P(i,j) = gp_Pnt( X0 + (i-1)*dX ,
|
||||
//! Y0 + (j-1)*dY ,
|
||||
//! ZPoints(i,j) )
|
||||
//!
|
||||
//! 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 Tol3D
|
||||
//! 4- the parametrization of the surface will verify:
|
||||
//! S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );
|
||||
Standard_EXPORT GeomAPI_PointsToBSplineSurface(const TColStd_Array2OfReal& ZPoints, const Standard_Real X0, const Standard_Real dX, const Standard_Real Y0, const Standard_Real dY, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Approximates a BSpline Surface 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 Tol3D
|
||||
Standard_EXPORT void Init (const TColgp_Array2OfPnt& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Interpolates a BSpline Surface passing through an
|
||||
//! array of Point. The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be 3.
|
||||
//! 2- his continuity will be C2.
|
||||
Standard_EXPORT void Interpolate (const TColgp_Array2OfPnt& Points);
|
||||
|
||||
//! Interpolates a BSpline Surface passing through an
|
||||
//! array of Point. The resulting BSpline will have
|
||||
//! the following properties:
|
||||
//! 1- his degree will be 3.
|
||||
//! 2- his continuity will be C2.
|
||||
Standard_EXPORT void Interpolate (const TColgp_Array2OfPnt& Points, const Approx_ParametrizationType ParType);
|
||||
|
||||
//! Approximates a BSpline Surface passing through an
|
||||
//! array of Points.
|
||||
//!
|
||||
//! The points will be constructed as follow:
|
||||
//! P(i,j) = gp_Pnt( X0 + (i-1)*dX ,
|
||||
//! Y0 + (j-1)*dY ,
|
||||
//! ZPoints(i,j) )
|
||||
//!
|
||||
//! 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 Tol3D
|
||||
//! 4- the parametrization of the surface will verify:
|
||||
//! S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );
|
||||
Standard_EXPORT void Init (const TColStd_Array2OfReal& ZPoints, const Standard_Real X0, const Standard_Real dX, const Standard_Real Y0, const Standard_Real dY, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Interpolates a BSpline Surface passing through an
|
||||
//! array of Points.
|
||||
//!
|
||||
//! The points will be constructed as follow:
|
||||
//! P(i,j) = gp_Pnt( X0 + (i-1)*dX ,
|
||||
//! Y0 + (j-1)*dY ,
|
||||
//! ZPoints(i,j) )
|
||||
//!
|
||||
//! The resulting BSpline will have the following
|
||||
//! properties:
|
||||
//! 1- his degree will be 3
|
||||
//! 2- his continuity will be C2.
|
||||
//! 4- the parametrization of the surface will verify:
|
||||
//! S->Value( U, V) = gp_Pnt( U, V, Z(U,V) );
|
||||
Standard_EXPORT void Interpolate (const TColStd_Array2OfReal& ZPoints, const Standard_Real X0, const Standard_Real dX, const Standard_Real Y0, const Standard_Real dY);
|
||||
|
||||
//! Approximates a BSpline Surface 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 Tol3D
|
||||
Standard_EXPORT void Init (const TColgp_Array2OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3);
|
||||
|
||||
//! Approximates a BSpline Surface 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_Array2OfPnt& 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);
|
||||
|
||||
//! Returns the approximate BSpline Surface
|
||||
Standard_EXPORT const Handle(Geom_BSplineSurface)& Surface() const;
|
||||
Standard_EXPORT operator Handle(Geom_BSplineSurface)() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom_BSplineSurface) mySurface;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_PointsToBSplineSurface_HeaderFile
|
@@ -1,202 +0,0 @@
|
||||
-- Created on: 1994-03-17
|
||||
-- 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 GeomAPI
|
||||
---Purpose:
|
||||
-- This class implements methods for computing all the orthogonal
|
||||
-- projections of a 3D point onto a 3D curve.
|
||||
|
||||
uses
|
||||
Curve from Geom,
|
||||
Curve from GeomAdaptor,
|
||||
ExtPC from Extrema,
|
||||
Pnt from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
Create
|
||||
---Purpose: Creates an empty object. Use an
|
||||
-- Init function for further initialization.
|
||||
returns ProjectPointOnCurve from GeomAPI;
|
||||
|
||||
|
||||
Create(P : Pnt from gp;
|
||||
Curve : Curve from Geom)
|
||||
---Purpose: Create the projection of a point <P> on a curve
|
||||
-- <Curve>
|
||||
---Level: Public
|
||||
returns ProjectPointOnCurve from GeomAPI;
|
||||
|
||||
|
||||
Create(P : Pnt from gp;
|
||||
Curve : Curve from Geom;
|
||||
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.
|
||||
returns ProjectPointOnCurve from GeomAPI;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt from gp;
|
||||
Curve : Curve from Geom)
|
||||
---Purpose: Init the projection of a point <P> on a curve
|
||||
-- <Curve>
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt from gp;
|
||||
Curve : Curve from Geom;
|
||||
Umin, Usup : Parameter from Quantity)
|
||||
---Purpose: Init the projection of a point <P> on a curve
|
||||
-- <Curve> limited by the two points of parameter Umin and Usup.
|
||||
is static;
|
||||
|
||||
--modified by NIZNHY-PKV Wed Apr 3 17:47:28 2002 f
|
||||
Init(me : in out;
|
||||
Curve : Curve from Geom;
|
||||
Umin, Usup : Parameter from Quantity)
|
||||
---Purpose: Init the projection of a point <P> on a curve
|
||||
-- <Curve> limited by the two points of parameter Umin and Usup.
|
||||
is static;
|
||||
|
||||
Perform (me: in out; P: Pnt from gp)
|
||||
---Purpose: Performs the projection of a point on the current curve.
|
||||
---Level : Public.
|
||||
is static;
|
||||
--modified by NIZNHY-PKV Wed Apr 3 17:47:30 2002 t
|
||||
|
||||
|
||||
|
||||
NbPoints(me)
|
||||
---Purpose: Returns the number of computed
|
||||
-- orthogonal projection points.
|
||||
-- Note: if this algorithm fails, NbPoints returns 0.
|
||||
returns Integer from Standard
|
||||
---C++: alias "Standard_EXPORT operator Standard_Integer() const;"
|
||||
is static;
|
||||
|
||||
|
||||
Point(me; Index : Integer from Standard)
|
||||
---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.
|
||||
returns Pnt from gp
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Parameter(me; Index : Integer from Standard)
|
||||
---Purpose: Returns the parameter on the curve
|
||||
-- of the point, which is the orthogonal projection. 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.
|
||||
returns Parameter from Quantity
|
||||
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 the point, which is the orthogonal projection. 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;
|
||||
|
||||
|
||||
Distance(me; Index : Integer from Standard)
|
||||
returns Length from Quantity
|
||||
---Purpose: Computes the distance between the
|
||||
-- point and its 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;
|
||||
|
||||
|
||||
NearestPoint(me)
|
||||
---Purpose: Returns the nearest orthogonal
|
||||
-- projection of the point on the curve.
|
||||
-- Exceptions: StdFail_NotDone if this algorithm fails.
|
||||
returns Pnt from gp
|
||||
---C++: alias "Standard_EXPORT operator gp_Pnt() const;"
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistanceParameter(me)
|
||||
---Purpose: Returns the parameter on the curve
|
||||
-- of the nearest orthogonal projection of the point.
|
||||
-- Exceptions: StdFail_NotDone if this algorithm fails.
|
||||
returns Parameter from Quantity
|
||||
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 ExtPC from Extrema
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIsDone: Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtPC : ExtPC from Extrema;
|
||||
myC : Curve from GeomAdaptor;
|
||||
|
||||
end ProjectPointOnCurve;
|
@@ -14,10 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_ProjectPointOnCurve.ixx>
|
||||
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_ProjectPointOnCurve
|
||||
|
158
src/GeomAPI/GeomAPI_ProjectPointOnCurve.hxx
Normal file
158
src/GeomAPI/GeomAPI_ProjectPointOnCurve.hxx
Normal file
@@ -0,0 +1,158 @@
|
||||
// Created on: 1994-03-17
|
||||
// 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 _GeomAPI_ProjectPointOnCurve_HeaderFile
|
||||
#define _GeomAPI_ProjectPointOnCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class gp_Pnt;
|
||||
class Geom_Curve;
|
||||
class Extrema_ExtPC;
|
||||
|
||||
|
||||
|
||||
//! This class implements methods for computing all the orthogonal
|
||||
//! projections of a 3D point onto a 3D curve.
|
||||
class GeomAPI_ProjectPointOnCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty object. Use an
|
||||
//! Init function for further initialization.
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnCurve();
|
||||
|
||||
//! Create the projection of a point <P> on a curve
|
||||
//! <Curve>
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnCurve(const gp_Pnt& P, const Handle(Geom_Curve)& Curve);
|
||||
|
||||
//! Create the projection of a point <P> on a curve
|
||||
//! <Curve> limited by the two points of parameter Umin and Usup.
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnCurve(const gp_Pnt& P, const Handle(Geom_Curve)& Curve, const Quantity_Parameter Umin, const Quantity_Parameter Usup);
|
||||
|
||||
//! Init the projection of a point <P> on a curve
|
||||
//! <Curve>
|
||||
Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Curve)& Curve);
|
||||
|
||||
//! Init the projection of a point <P> on a curve
|
||||
//! <Curve> limited by the two points of parameter Umin and Usup.
|
||||
Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Curve)& Curve, const Quantity_Parameter Umin, const Quantity_Parameter Usup);
|
||||
|
||||
//! Init the projection of a point <P> on a curve
|
||||
//! <Curve> limited by the two points of parameter Umin and Usup.
|
||||
Standard_EXPORT void Init (const Handle(Geom_Curve)& Curve, const Quantity_Parameter Umin, const Quantity_Parameter Usup);
|
||||
|
||||
//! Performs the projection of a point on the current curve.
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
//! Returns the number of computed
|
||||
//! orthogonal projection points.
|
||||
//! Note: if this algorithm fails, NbPoints returns 0.
|
||||
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_Pnt Point (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the parameter on the curve
|
||||
//! of the point, which is the orthogonal projection. 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 Quantity_Parameter Parameter (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the parameter on the curve
|
||||
//! of the point, which is the orthogonal projection. 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 void Parameter (const Standard_Integer Index, Quantity_Parameter& U) const;
|
||||
|
||||
//! Computes the distance between the
|
||||
//! point and its 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 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_Pnt NearestPoint() const;
|
||||
Standard_EXPORT operator gp_Pnt() 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_ExtPC& Extrema() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtPC myExtPC;
|
||||
GeomAdaptor_Curve myC;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GeomAPI_ProjectPointOnCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_ProjectPointOnCurve_HeaderFile
|
@@ -1,254 +0,0 @@
|
||||
-- Created on: 1994-03-17
|
||||
-- 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 ProjectPointOnSurf from GeomAPI
|
||||
|
||||
--- Purpose:
|
||||
-- This class implements methods for computing all the orthogonal
|
||||
-- projections of a point onto a surface.
|
||||
|
||||
uses
|
||||
Surface from Geom,
|
||||
ExtPS from Extrema,
|
||||
ExtAlgo from Extrema,
|
||||
Pnt from gp,
|
||||
Length from Quantity,
|
||||
Parameter from Quantity,
|
||||
--modified by NIZNHY-PKV Thu Apr 4 10:37:24 2002 f
|
||||
Surface from GeomAdaptor
|
||||
--modified by NIZNHY-PKV Thu Apr 4 10:37:28 2002 t
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Creates an empty object. Use the
|
||||
-- Init function for further initialization.
|
||||
returns ProjectPointOnSurf from GeomAPI;
|
||||
|
||||
|
||||
Create(P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
---Purpose: Create the projection of a point <P> on a surface
|
||||
-- <Surface>
|
||||
---Level: Public
|
||||
returns ProjectPointOnSurf from GeomAPI;
|
||||
|
||||
Create(P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Tolerance : Real from Standard;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
---Purpose: Create the projection of a point <P> on a surface
|
||||
-- <Surface>
|
||||
---Level: Public
|
||||
returns ProjectPointOnSurf from GeomAPI;
|
||||
|
||||
|
||||
---Purpose: Create the projection of a point <P> on a surface
|
||||
-- <Surface>. The solution are computed in the domain
|
||||
-- [Umin,Usup] [Vmin,Vsup] of the surface.
|
||||
---Level: Public
|
||||
|
||||
Create(P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Umin, Usup,
|
||||
Vmin, Vsup : Parameter from Quantity;
|
||||
Tolerance : Real from Standard;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
returns ProjectPointOnSurf from GeomAPI;
|
||||
|
||||
Create(P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Umin, Usup,
|
||||
Vmin, Vsup : Parameter from Quantity;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
returns ProjectPointOnSurf from GeomAPI;
|
||||
|
||||
|
||||
---Purpose: Init the projection of a point <P> on a surface
|
||||
-- <Surface>
|
||||
---Level: Public
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Tolerance : Real from Standard;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
is static;
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
is static;
|
||||
|
||||
|
||||
---Purpose: Init the projection of a point <P> on a surface
|
||||
-- <Surface>. The solution are computed in the domain
|
||||
-- [Umin,Usup] [Vmin,Vsup] of the surface.
|
||||
---Level: Public
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Umin, Usup,
|
||||
Vmin, Vsup : Parameter from Quantity;
|
||||
Tolerance : Real from Standard;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Init(me : in out;
|
||||
P : Pnt from gp;
|
||||
Surface : Surface from Geom;
|
||||
Umin, Usup,
|
||||
Vmin, Vsup : Parameter from Quantity;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
is static;
|
||||
|
||||
|
||||
---Purpose: Init the projection for many points on a surface
|
||||
-- <Surface>. The solutions will be computed in the domain
|
||||
-- [Umin,Usup] [Vmin,Vsup] of the surface.
|
||||
---Level: Public
|
||||
|
||||
Init(me : in out;
|
||||
Surface : Surface from Geom;
|
||||
Umin, Usup,
|
||||
Vmin, Vsup : Parameter from Quantity;
|
||||
Tolerance : Real from Standard;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
is static;
|
||||
|
||||
Init(me : in out;
|
||||
Surface : Surface from Geom;
|
||||
Umin, Usup,
|
||||
Vmin, Vsup : Parameter from Quantity;
|
||||
Algo : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
is static;
|
||||
|
||||
|
||||
Perform (me: in out; P: Pnt from gp)
|
||||
---Purpose: Performs the projection of a point on the current surface.
|
||||
---Level : Public.
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean from Standard is static;
|
||||
|
||||
|
||||
NbPoints(me)
|
||||
---Purpose: Returns the number of computed orthogonal projection points.
|
||||
-- Note: if projection fails, NbPoints returns 0.
|
||||
returns Integer
|
||||
---C++: alias "Standard_EXPORT operator Standard_Integer() const;"
|
||||
is static;
|
||||
|
||||
|
||||
Point(me; Index : Integer from Standard)
|
||||
---Purpose: Returns the orthogonal projection
|
||||
-- on the surface. 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.
|
||||
returns Pnt from gp
|
||||
raises OutOfRange from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Parameters(me; Index : Integer from Standard;
|
||||
U, V : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters (U,V) on the
|
||||
-- surface of the orthogonal projection. 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;
|
||||
|
||||
|
||||
Distance(me; Index : Integer from Standard)
|
||||
returns Length from Quantity
|
||||
---Purpose: Computes the distance between the
|
||||
-- point and its orthogonal projection on the surface. 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;
|
||||
|
||||
|
||||
NearestPoint(me)
|
||||
---Purpose: Returns the nearest orthogonal projection of the point
|
||||
-- on the surface.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if projection fails.
|
||||
returns Pnt from gp
|
||||
---C++: alias "Standard_EXPORT operator gp_Pnt() const;"
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistanceParameters(me; U, V : out Parameter from Quantity)
|
||||
---Purpose: Returns the parameters (U,V) on the
|
||||
-- surface of the nearest computed orthogonal projection of the point.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if projection fails.
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
LowerDistance(me)
|
||||
---Purpose: Computes the distance between the
|
||||
-- point and its nearest orthogonal projection on the surface.
|
||||
-- Exceptions
|
||||
-- StdFail_NotDone if projection 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 ExtPS from Extrema
|
||||
is static;
|
||||
|
||||
|
||||
Init(me : in out) is static private;
|
||||
---Level: Private
|
||||
|
||||
fields
|
||||
|
||||
myIsDone : Boolean from Standard;
|
||||
myIndex : Integer from Standard; -- index of the nearest solution
|
||||
myExtPS : ExtPS from Extrema;
|
||||
--modified by NIZNHY-PKV Thu Apr 4 10:36:31 2002 f
|
||||
myGeomAdaptor: Surface from GeomAdaptor;
|
||||
--modified by NIZNHY-PKV Thu Apr 4 10:36:33 2002 t
|
||||
end ProjectPointOnSurf;
|
@@ -14,11 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAPI_ProjectPointOnSurf.ixx>
|
||||
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAPI_ProjectPointOnSurf
|
||||
|
174
src/GeomAPI/GeomAPI_ProjectPointOnSurf.hxx
Normal file
174
src/GeomAPI/GeomAPI_ProjectPointOnSurf.hxx
Normal file
@@ -0,0 +1,174 @@
|
||||
// Created on: 1994-03-17
|
||||
// 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 _GeomAPI_ProjectPointOnSurf_HeaderFile
|
||||
#define _GeomAPI_ProjectPointOnSurf_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Quantity_Parameter.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class gp_Pnt;
|
||||
class Geom_Surface;
|
||||
class Extrema_ExtPS;
|
||||
|
||||
|
||||
|
||||
//! This class implements methods for computing all the orthogonal
|
||||
//! projections of a point onto a surface.
|
||||
class GeomAPI_ProjectPointOnSurf
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty object. Use the
|
||||
//! Init function for further initialization.
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnSurf();
|
||||
|
||||
//! Create the projection of a point <P> on a surface
|
||||
//! <Surface>
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! Create the projection of a point <P> on a surface
|
||||
//! <Surface>
|
||||
//! Create the projection of a point <P> on a surface
|
||||
//! <Surface>. The solution are computed in the domain
|
||||
//! [Umin,Usup] [Vmin,Vsup] of the surface.
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Quantity_Parameter Umin, const Quantity_Parameter Usup, const Quantity_Parameter Vmin, const Quantity_Parameter Vsup, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! Init the projection of a point <P> on a surface
|
||||
//! <Surface>
|
||||
Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Quantity_Parameter Umin, const Quantity_Parameter Usup, const Quantity_Parameter Vmin, const Quantity_Parameter Vsup, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! Init the projection of a point <P> on a surface
|
||||
//! <Surface>. The solution are computed in the domain
|
||||
//! [Umin,Usup] [Vmin,Vsup] of the surface.
|
||||
Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Quantity_Parameter Umin, const Quantity_Parameter Usup, const Quantity_Parameter Vmin, const Quantity_Parameter Vsup, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! Init the projection for many points on a surface
|
||||
//! <Surface>. The solutions will be computed in the domain
|
||||
//! [Umin,Usup] [Vmin,Vsup] of the surface.
|
||||
Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Quantity_Parameter Umin, const Quantity_Parameter Usup, const Quantity_Parameter Vmin, const Quantity_Parameter Vsup, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT void Init (const Handle(Geom_Surface)& Surface, const Quantity_Parameter Umin, const Quantity_Parameter Usup, const Quantity_Parameter Vmin, const Quantity_Parameter Vsup, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT void Init (const Handle(Geom_Surface)& Surface, const Quantity_Parameter Umin, const Quantity_Parameter Usup, const Quantity_Parameter Vmin, const Quantity_Parameter Vsup, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! Performs the projection of a point on the current surface.
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of computed orthogonal projection points.
|
||||
//! Note: if projection fails, NbPoints returns 0.
|
||||
Standard_EXPORT Standard_Integer NbPoints() const;
|
||||
Standard_EXPORT operator Standard_Integer() const;
|
||||
|
||||
//! Returns the orthogonal projection
|
||||
//! on the surface. 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_Pnt Point (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the parameters (U,V) on the
|
||||
//! surface of the orthogonal projection. 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 void Parameters (const Standard_Integer Index, Quantity_Parameter& U, Quantity_Parameter& V) const;
|
||||
|
||||
//! Computes the distance between the
|
||||
//! point and its orthogonal projection on the surface. 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 Quantity_Length Distance (const Standard_Integer Index) const;
|
||||
|
||||
//! Returns the nearest orthogonal projection of the point
|
||||
//! on the surface.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if projection fails.
|
||||
Standard_EXPORT gp_Pnt NearestPoint() const;
|
||||
Standard_EXPORT operator gp_Pnt() const;
|
||||
|
||||
//! Returns the parameters (U,V) on the
|
||||
//! surface of the nearest computed orthogonal projection of the point.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if projection fails.
|
||||
Standard_EXPORT void LowerDistanceParameters (Quantity_Parameter& U, Quantity_Parameter& V) const;
|
||||
|
||||
//! Computes the distance between the
|
||||
//! point and its nearest orthogonal projection on the surface.
|
||||
//! Exceptions
|
||||
//! StdFail_NotDone if projection fails.
|
||||
Standard_EXPORT Quantity_Length LowerDistance() const;
|
||||
Standard_EXPORT operator Standard_Real() const;
|
||||
|
||||
//! return the algorithmic object from Extrema
|
||||
const Extrema_ExtPS& Extrema() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Init();
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Integer myIndex;
|
||||
Extrema_ExtPS myExtPS;
|
||||
GeomAdaptor_Surface myGeomAdaptor;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GeomAPI_ProjectPointOnSurf.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAPI_ProjectPointOnSurf_HeaderFile
|
Reference in New Issue
Block a user