mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +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:
@@ -1,130 +0,0 @@
|
||||
-- Created on: 1993-01-26
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package Approx
|
||||
|
||||
---Purpose: Tis package provides algorithms approximating a set of
|
||||
-- points or curves with the possibility of dividing into
|
||||
-- one or many bezier curves.
|
||||
-- It also provides an instantiation for approximating
|
||||
-- a continous function f(t) into one or many curves.
|
||||
|
||||
uses AdvApprox,
|
||||
AppCont,
|
||||
AppParCurves,
|
||||
math,
|
||||
gp,
|
||||
GeomAbs,
|
||||
Geom,
|
||||
Geom2d,
|
||||
Adaptor3d,
|
||||
Adaptor2d,
|
||||
TColStd,
|
||||
TColGeom,
|
||||
TColgp,
|
||||
TCollection,
|
||||
Standard,
|
||||
StdFail
|
||||
|
||||
|
||||
is
|
||||
|
||||
enumeration ParametrizationType is
|
||||
ChordLength,
|
||||
Centripetal,
|
||||
IsoParametric
|
||||
end;
|
||||
|
||||
enumeration Status is
|
||||
PointsAdded,
|
||||
NoPointsAdded,
|
||||
NoApproximation
|
||||
end;
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
---Algorithms for Bezier curves construction:
|
||||
---------------------------------------------
|
||||
|
||||
|
||||
generic class ComputeLine, MyGradient;
|
||||
|
||||
generic class ComputeCLine;
|
||||
|
||||
----------------------------------------------
|
||||
---Algorithms for BSpline curves construction:
|
||||
----------------------------------------------
|
||||
|
||||
|
||||
generic class BSplComputeLine, MyBSplGradient, MyGradientbis;
|
||||
|
||||
----------------------------------------------
|
||||
---Algorithms for BSpline Surface construction:
|
||||
----------------------------------------------
|
||||
class SweepApproximation;
|
||||
deferred class SweepFunction;
|
||||
-----------------------------------------------------------------
|
||||
--- Transformation of connecting MultiCurves into a MultiBSpCurve
|
||||
-----------------------------------------------------------------
|
||||
|
||||
|
||||
class MCurvesToBSpCurve;
|
||||
|
||||
------------------------------------------------
|
||||
---Algorithms for PCurve approximation:
|
||||
------------------------------------------------
|
||||
class CurveOnSurface;
|
||||
class Curve3d;
|
||||
class Curve2d;
|
||||
------------------------------------------------
|
||||
---Algorithms for PCurve approximation:
|
||||
------------------------------------------------
|
||||
class CurvilinearParameter;
|
||||
class CurvlinFunc;
|
||||
--------------------------
|
||||
--- instantiate classes:
|
||||
--------------------------
|
||||
|
||||
imported SequenceOfHArray1OfReal;
|
||||
|
||||
|
||||
-----------------------------------------------------------------
|
||||
--- the folowing classes approximate a continous function f(t) in
|
||||
--- one or many bezier curves.
|
||||
-----------------------------------------------------------------
|
||||
|
||||
class FitAndDivide instantiates ComputeCLine from Approx
|
||||
(Function from AppCont);
|
||||
|
||||
class FitAndDivide2d instantiates ComputeCLine from Approx
|
||||
(Function from AppCont);
|
||||
|
||||
class SameParameter from Approx ;
|
||||
|
||||
imported Array1OfAdHSurface;
|
||||
imported transient class HArray1OfAdHSurface;
|
||||
imported Array1OfGTrsf2d;
|
||||
|
||||
imported transient class HArray1OfGTrsf2d;
|
||||
|
||||
-- class ApproxPoints from Approx ;
|
||||
-- class ApproxPoints from Approx ;
|
||||
-- this approximates a series of points
|
||||
-- Boundary conditions can be given as well
|
||||
-- a given parameterisation
|
||||
--
|
||||
|
||||
end Approx;
|
@@ -1,318 +0,0 @@
|
||||
-- Created on: 1993-09-22
|
||||
-- Created by: Modelistation
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class BSplComputeLine from Approx
|
||||
(MultiLine as any;
|
||||
LineTool as any)
|
||||
|
||||
|
||||
|
||||
uses ParametrizationType from Approx,
|
||||
SequenceOfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
HArray1OfInteger from TColStd,
|
||||
Array1OfReal from TColStd,
|
||||
Array1OfInteger from TColStd,
|
||||
HArray1OfConstraintCouple from AppParCurves,
|
||||
Constraint from AppParCurves,
|
||||
MultiBSpCurve from AppParCurves,
|
||||
MultiCurve from AppParCurves,
|
||||
Vector from math
|
||||
|
||||
|
||||
|
||||
private class MyBSplGradient instantiates BSpGradient from AppParCurves
|
||||
(MultiLine,
|
||||
LineTool);
|
||||
|
||||
|
||||
private class MyGradientbis instantiates Gradient from AppParCurves
|
||||
(MultiLine,
|
||||
LineTool);
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create(Line: MultiLine;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-3;
|
||||
Tolerance2d: Real = 1.0e-6;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
parametrization: ParametrizationType from Approx =
|
||||
Approx_ChordLength;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: The MultiLine <Line> will be approximated until tolerances
|
||||
-- will be reached.
|
||||
-- The approximation will be done from degreemin to degreemax
|
||||
-- with a cutting if the corresponding boolean is True.
|
||||
-- If <Squares> is True, the computation will be done with
|
||||
-- no iteration at all.
|
||||
--
|
||||
-- The multiplicities of the internal knots is set by
|
||||
-- default.
|
||||
|
||||
returns BSplComputeLine;
|
||||
|
||||
|
||||
Create(Line: MultiLine;
|
||||
Parameters: Vector from math;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: The MultiLine <Line> will be approximated until tolerances
|
||||
-- will be reached.
|
||||
-- The approximation will be done from degreemin to degreemax
|
||||
-- with a cutting if the corresponding boolean is True.
|
||||
-- If <Squares> is True, the computation will be done with
|
||||
-- no iteration at all.
|
||||
|
||||
returns BSplComputeLine;
|
||||
|
||||
|
||||
Create(Parameters: Vector from math;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
returns BSplComputeLine;
|
||||
|
||||
|
||||
Create(degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
parametrization: ParametrizationType from Approx =
|
||||
Approx_ChordLength;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
returns BSplComputeLine;
|
||||
|
||||
|
||||
Interpol(me: in out; Line: MultiLine)
|
||||
---Purpose: Constructs an interpolation of the MultiLine <Line>
|
||||
-- The result will be a C2 curve of degree 3.
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
Init(me: in out; degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
parametrization: ParametrizationType from Approx =
|
||||
Approx_ChordLength;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; Line: MultiLine)
|
||||
---Purpose: runs the algorithm after having initialized the fields.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Compute(me: in out; Line: MultiLine; fpt, lpt: Integer;
|
||||
Para: in out Vector from math; Knots: Array1OfReal;
|
||||
Mults: in out Array1OfInteger)
|
||||
---Purpose: is internally used in the algorithm.
|
||||
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
|
||||
ComputeCurve(me: in out; Line: MultiLine; firspt, lastpt: Integer)
|
||||
---Purpose: is internally used in the algorithm.
|
||||
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
|
||||
Parameters(me; Line: MultiLine; firstP, LastP: Integer;
|
||||
TheParameters: in out Vector)
|
||||
---Purpose: computes new parameters between firstP and lastP.
|
||||
|
||||
is static private;
|
||||
|
||||
|
||||
SetParameters(me: in out; ThePar: Vector from math)
|
||||
---Purpose: The approximation will begin with the
|
||||
-- set of parameters <ThePar>.
|
||||
is static;
|
||||
|
||||
|
||||
SetKnots(me: in out; Knots: Array1OfReal from TColStd)
|
||||
---Purpose: The approximation will be done with the
|
||||
-- set of knots <Knots>. The multiplicities will be set
|
||||
-- with the degree and the desired continuity.
|
||||
is static;
|
||||
|
||||
|
||||
SetKnotsAndMultiplicities(me: in out;
|
||||
Knots: Array1OfReal from TColStd;
|
||||
Mults: Array1OfInteger from TColStd)
|
||||
---Purpose: The approximation will be done with the
|
||||
-- set of knots <Knots> and the multiplicities <Mults>.
|
||||
is static;
|
||||
|
||||
|
||||
SetDegrees(me: in out; degreemin, degreemax: Integer)
|
||||
---Purpose: changes the degrees of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetTolerances(me: in out; Tolerance3d, Tolerance2d: Real)
|
||||
---Purpose: Changes the tolerances of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetContinuity(me: in out; C: Integer)
|
||||
---Purpose: sets the continuity of the spline.
|
||||
-- if C = 2, the spline will be C2.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetConstraints(me: in out; firstC, lastC: Constraint from AppParCurves)
|
||||
---Purpose: changes the first and the last constraint points.
|
||||
is static;
|
||||
|
||||
|
||||
IsAllApproximated(me)
|
||||
---Purpose: returns False if at a moment of the approximation,
|
||||
-- the status NoApproximation has been sent by the user
|
||||
-- when more points were needed.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
IsToleranceReached(me)
|
||||
---Purpose: returns False if the status NoPointsAdded has been sent.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
Error(me; tol3d: in out Real; tol2d: in out Real)
|
||||
---Purpose: returns the tolerances 2d and 3d of the MultiBSpCurve.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Value(me)
|
||||
---Purpose: returns the result of the approximation.
|
||||
---C++: return const&
|
||||
returns MultiBSpCurve from AppParCurves;
|
||||
|
||||
|
||||
ChangeValue(me: in out)
|
||||
---Purpose: returns the result of the approximation.
|
||||
---C++: return &
|
||||
returns MultiBSpCurve from AppParCurves;
|
||||
|
||||
|
||||
|
||||
Parameters(me)
|
||||
---Purpose: returns the new parameters of the approximation
|
||||
-- corresponding to the points of the MultiBSpCurve.
|
||||
---C++: return const&
|
||||
returns Array1OfReal from TColStd
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
SearchFirstLambda(me; Line: MultiLine; Para: Vector;
|
||||
Knots: Array1OfReal from TColStd;
|
||||
V: Vector; index: Integer)
|
||||
returns Real
|
||||
is static private;
|
||||
|
||||
SearchLastLambda(me: ; Line: MultiLine; Para: Vector;
|
||||
Knots: Array1OfReal from TColStd;
|
||||
V: Vector; index: Integer)
|
||||
returns Real
|
||||
is static private;
|
||||
|
||||
TangencyVector(me; Line: MultiLine; C: MultiCurve from AppParCurves;
|
||||
U: Real from Standard; V: in out Vector from math)
|
||||
is static private;
|
||||
|
||||
|
||||
FirstTangencyVector(me; Line: MultiLine; index: Integer; V: out Vector)
|
||||
is static private;
|
||||
|
||||
LastTangencyVector(me; Line: MultiLine; index: Integer; V: out Vector)
|
||||
is static private;
|
||||
|
||||
FindRealConstraints(me: in out; Line: MultiLine)
|
||||
is static private;
|
||||
|
||||
fields
|
||||
|
||||
TheMultiBSpCurve: MultiBSpCurve from AppParCurves;
|
||||
alldone : Boolean from Standard;
|
||||
tolreached : Boolean from Standard;
|
||||
Par : ParametrizationType from Approx;
|
||||
myParameters : HArray1OfReal from TColStd;
|
||||
myfirstParam : HArray1OfReal from TColStd;
|
||||
myknots : HArray1OfReal from TColStd;
|
||||
mymults : HArray1OfInteger from TColStd;
|
||||
myhasknots : Boolean from Standard;
|
||||
myhasmults : Boolean from Standard;
|
||||
myConstraints : HArray1OfConstraintCouple from AppParCurves;
|
||||
mydegremin : Integer from Standard;
|
||||
mydegremax : Integer from Standard;
|
||||
mytol3d : Real from Standard;
|
||||
mytol2d : Real from Standard;
|
||||
currenttol3d : Real from Standard;
|
||||
currenttol2d : Real from Standard;
|
||||
mycut : Boolean from Standard;
|
||||
mysquares : Boolean from Standard;
|
||||
myitermax : Integer from Standard;
|
||||
myfirstC : Constraint from AppParCurves;
|
||||
mylastC : Constraint from AppParCurves;
|
||||
realfirstC : Constraint from AppParCurves;
|
||||
reallastC : Constraint from AppParCurves;
|
||||
mycont : Integer from Standard;
|
||||
mylambda1 : Real from Standard;
|
||||
mylambda2 : Real from Standard;
|
||||
|
||||
end BSplComputeLine;
|
@@ -1,160 +0,0 @@
|
||||
-- Created on: 1993-05-14
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class ComputeCLine from Approx
|
||||
(MultiLine as any)
|
||||
---Purpose: Approximate a continous MultiLine with a cutting.
|
||||
-- The Tool of the line is the tool from AppCont.
|
||||
|
||||
uses ParametrizationType from Approx,
|
||||
SequenceOfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
SequenceOfMultiCurve from AppParCurves,
|
||||
MultiCurve from AppParCurves,
|
||||
Constraint from AppParCurves,
|
||||
Vector from math
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create(Line: MultiLine;
|
||||
degreemin: Integer = 3;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-5;
|
||||
Tolerance2d: Real = 1.0e-5;
|
||||
cutting: Boolean = Standard_False;
|
||||
FirstC: Constraint = AppParCurves_TangencyPoint;
|
||||
LastC: Constraint = AppParCurves_TangencyPoint)
|
||||
|
||||
---Purpose: The MultiLine <Line> will be approximated until tolerances
|
||||
-- will be reached.
|
||||
-- The approximation will be done from degreemin to degreemax
|
||||
-- with a cutting if the corresponding boolean is True.
|
||||
|
||||
returns ComputeCLine;
|
||||
|
||||
|
||||
|
||||
|
||||
Create(degreemin: Integer = 3;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-05;
|
||||
Tolerance2d: Real = 1.0e-05;
|
||||
cutting: Boolean = Standard_False;
|
||||
FirstC: Constraint = AppParCurves_TangencyPoint;
|
||||
LastC: Constraint = AppParCurves_TangencyPoint)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
returns ComputeCLine;
|
||||
|
||||
|
||||
Perform(me: in out; Line: MultiLine)
|
||||
---Purpose: runs the algorithm after having initialized the fields.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Compute(me: in out; Line: MultiLine; Ufirst, Ulast: Real;
|
||||
TheTol3d, TheTol2d: in out Real)
|
||||
---Purpose: is internally used by the algorithms.
|
||||
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
|
||||
SetDegrees(me: in out; degreemin, degreemax: Integer)
|
||||
---Purpose: changes the degrees of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetTolerances(me: in out; Tolerance3d, Tolerance2d: Real)
|
||||
---Purpose: Changes the tolerances of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetConstraints(me: in out; FirstC, LastC: Constraint)
|
||||
---Purpose: Changes the constraints of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
IsAllApproximated(me)
|
||||
---Purpose: returns False if at a moment of the approximation,
|
||||
-- the status NoApproximation has been sent by the user
|
||||
-- when more points were needed.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
IsToleranceReached(me)
|
||||
---Purpose: returns False if the status NoPointsAdded has been sent.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
Error(me; Index: Integer; tol3d: in out Real; tol2d: in out Real)
|
||||
---Purpose: returns the tolerances 2d and 3d of the <Index> MultiCurve.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
NbMultiCurves(me)
|
||||
---Purpose: Returns the number of MultiCurve doing the approximation
|
||||
-- of the MultiLine.
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
|
||||
Value(me; Index: Integer = 1)
|
||||
---Purpose: returns the approximation MultiCurve of range <Index>.
|
||||
|
||||
returns MultiCurve from AppParCurves;
|
||||
|
||||
|
||||
Parameters(me; Index: Integer; firstp, lastp: in out Real)
|
||||
---purpose: returns the first and last parameters of the
|
||||
-- <Index> MultiCurve.
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
|
||||
myMultiCurves: SequenceOfMultiCurve from AppParCurves;
|
||||
myfirstparam: SequenceOfReal from TColStd;
|
||||
mylastparam: SequenceOfReal from TColStd;
|
||||
TheMultiCurve: MultiCurve from AppParCurves;
|
||||
alldone: Boolean;
|
||||
tolreached: Boolean;
|
||||
Tolers3d: SequenceOfReal from TColStd;
|
||||
Tolers2d: SequenceOfReal from TColStd;
|
||||
mydegremin: Integer;
|
||||
mydegremax: Integer;
|
||||
mytol3d: Real;
|
||||
mytol2d: Real;
|
||||
currenttol3d: Real;
|
||||
currenttol2d: Real;
|
||||
mycut: Boolean;
|
||||
myfirstC: Constraint;
|
||||
mylastC: Constraint;
|
||||
|
||||
|
||||
end ComputeCLine;
|
@@ -1,284 +0,0 @@
|
||||
-- Created on: 1993-01-26
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class ComputeLine from Approx
|
||||
(MultiLine as any;
|
||||
LineTool as any)
|
||||
---Purpose: Approximate a MultiLine with a cutting.
|
||||
|
||||
uses ParametrizationType from Approx,
|
||||
SequenceOfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
Array1OfReal from TColStd,
|
||||
SequenceOfMultiCurve from AppParCurves,
|
||||
HArray1OfMultiCurve from AppParCurves,
|
||||
HArray1OfConstraintCouple from AppParCurves,
|
||||
Constraint from AppParCurves,
|
||||
SequenceOfHArray1OfReal from Approx,
|
||||
MultiCurve from AppParCurves,
|
||||
MultiBSpCurve from AppParCurves,
|
||||
Vector from math
|
||||
|
||||
|
||||
|
||||
private class MyGradient instantiates Gradient from AppParCurves
|
||||
(MultiLine,
|
||||
LineTool);
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create(Line: MultiLine;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-3;
|
||||
Tolerance2d: Real = 1.0e-6;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
parametrization: ParametrizationType from Approx =
|
||||
Approx_ChordLength;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: The MultiLine <Line> will be approximated until tolerances
|
||||
-- will be reached.
|
||||
-- The approximation will be done from degreemin to degreemax
|
||||
-- with a cutting if the corresponding boolean is True.
|
||||
-- If <Squares> is True, the computation will be done with
|
||||
-- no iteration at all.
|
||||
|
||||
returns ComputeLine;
|
||||
|
||||
|
||||
Create(Line: MultiLine;
|
||||
Parameters: Vector from math;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: The MultiLine <Line> will be approximated until tolerances
|
||||
-- will be reached.
|
||||
-- The approximation will be done from degreemin to degreemax
|
||||
-- with a cutting if the corresponding boolean is True.
|
||||
-- If <Squares> is True, the computation will be done with
|
||||
-- no iteration at all.
|
||||
|
||||
returns ComputeLine;
|
||||
|
||||
|
||||
Create(Parameters: Vector from math;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
returns ComputeLine;
|
||||
|
||||
|
||||
Create(degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
parametrization: ParametrizationType from Approx =
|
||||
Approx_ChordLength;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
returns ComputeLine;
|
||||
|
||||
|
||||
Init(me: in out; degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
Tolerance2d: Real = 1.0e-06;
|
||||
NbIterations: Integer = 5;
|
||||
cutting: Boolean = Standard_True;
|
||||
parametrization: ParametrizationType from Approx =
|
||||
Approx_ChordLength;
|
||||
Squares: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
|
||||
Perform(me: in out; Line: MultiLine)
|
||||
---Purpose: runs the algorithm after having initialized the fields.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Compute(me: in out; Line: MultiLine; fpt, lpt: Integer;
|
||||
Para: in out Vector from math; TheTol3d, TheTol2d: in out Real)
|
||||
---Purpose: is internally used in the algorithm.
|
||||
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
|
||||
ComputeCurve(me: in out; Line: MultiLine; firspt, lastpt: Integer)
|
||||
---Purpose: is internally used in the algorithm.
|
||||
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
|
||||
Parameters(me; Line: MultiLine; firstP, LastP: Integer;
|
||||
TheParameters: in out Vector)
|
||||
---Purpose: computes new parameters between firstP and lastP.
|
||||
|
||||
is static private;
|
||||
|
||||
|
||||
SetDegrees(me: in out; degreemin, degreemax: Integer)
|
||||
---Purpose: changes the degrees of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetTolerances(me: in out; Tolerance3d, Tolerance2d: Real)
|
||||
---Purpose: Changes the tolerances of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetConstraints(me: in out; firstC, lastC: Constraint from AppParCurves)
|
||||
---Purpose: changes the first and the last constraint points.
|
||||
is static;
|
||||
|
||||
|
||||
IsAllApproximated(me)
|
||||
---Purpose: returns False if at a moment of the approximation,
|
||||
-- the status NoApproximation has been sent by the user
|
||||
-- when more points were needed.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
IsToleranceReached(me)
|
||||
---Purpose: returns False if the status NoPointsAdded has been sent.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
Error(me; Index: Integer; tol3d: in out Real; tol2d: in out Real)
|
||||
---Purpose: returns the tolerances 2d and 3d of the <Index> MultiCurve.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
NbMultiCurves(me)
|
||||
---Purpose: Returns the number of MultiCurve doing the approximation
|
||||
-- of the MultiLine.
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
|
||||
Value(me; Index: Integer = 1)
|
||||
---Purpose: returns the result of the approximation.
|
||||
---C++: return const&
|
||||
returns MultiCurve from AppParCurves
|
||||
is static;
|
||||
|
||||
ChangeValue(me: in out; Index: Integer = 1)
|
||||
---Purpose: returns the result of the approximation.
|
||||
---C++: return &
|
||||
returns MultiCurve from AppParCurves
|
||||
is static;
|
||||
|
||||
|
||||
SplineValue(me: in out)
|
||||
---Purpose: returns the result of the approximation.
|
||||
---C++: return const&
|
||||
returns MultiBSpCurve from AppParCurves
|
||||
is static;
|
||||
|
||||
Parametrization(me; partype : in out ParametrizationType from Approx)
|
||||
---Purpose: returns the type of parametrization
|
||||
is static;
|
||||
|
||||
|
||||
Parameters(me; Index: Integer = 1)
|
||||
---Purpose: returns the new parameters of the approximation
|
||||
-- corresponding to the points of the multicurve <Index>.
|
||||
---C++: return const&
|
||||
returns Array1OfReal from TColStd
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
SearchFirstLambda(me; Line: MultiLine; Para: Vector;
|
||||
V: Vector; index: Integer)
|
||||
returns Real
|
||||
is static private;
|
||||
|
||||
SearchLastLambda(me: ; Line: MultiLine; Para: Vector;
|
||||
V: Vector; index: Integer)
|
||||
returns Real
|
||||
is static private;
|
||||
|
||||
FirstTangencyVector(me; Line: MultiLine; index: Integer; V: in out Vector)
|
||||
is static private;
|
||||
|
||||
LastTangencyVector(me; Line: MultiLine; index: Integer; V: in out Vector)
|
||||
is static private;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
|
||||
myMultiCurves: SequenceOfMultiCurve from AppParCurves;
|
||||
TheMultiCurve: MultiCurve from AppParCurves;
|
||||
myspline : MultiBSpCurve from AppParCurves;
|
||||
alldone: Boolean from Standard;
|
||||
tolreached: Boolean from Standard;
|
||||
Par: ParametrizationType from Approx;
|
||||
myParameters: HArray1OfReal from TColStd;
|
||||
myfirstParam: HArray1OfReal from TColStd;
|
||||
myPar: SequenceOfHArray1OfReal from Approx;
|
||||
Tolers3d: SequenceOfReal from TColStd;
|
||||
Tolers2d: SequenceOfReal from TColStd;
|
||||
myConstraints: HArray1OfConstraintCouple from AppParCurves;
|
||||
mydegremin: Integer from Standard;
|
||||
mydegremax: Integer from Standard;
|
||||
mytol3d: Real from Standard;
|
||||
mytol2d: Real from Standard;
|
||||
currenttol3d: Real from Standard;
|
||||
currenttol2d: Real from Standard;
|
||||
mycut: Boolean from Standard;
|
||||
mysquares: Boolean from Standard;
|
||||
myitermax: Integer from Standard;
|
||||
myfirstC: Constraint from AppParCurves;
|
||||
mylastC: Constraint from AppParCurves;
|
||||
myMultiLineNb: Integer from Standard;
|
||||
myIsClear : Boolean from Standard;
|
||||
|
||||
end ComputeLine;
|
@@ -1,55 +0,0 @@
|
||||
-- Created on: 1997-10-28
|
||||
-- Created by: Roman BORISOV
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Curve2d from Approx
|
||||
|
||||
---Purpose: Makes an approximation for HCurve2d from Adaptor3d
|
||||
|
||||
uses
|
||||
HCurve2d from Adaptor2d,
|
||||
Shape from GeomAbs,
|
||||
BSplineCurve from Geom2d
|
||||
|
||||
is
|
||||
Create(C2D : HCurve2d from Adaptor2d;
|
||||
First,
|
||||
Last,
|
||||
TolU, TolV : Real;
|
||||
Continuity : Shape from GeomAbs;
|
||||
MaxDegree : Integer ;
|
||||
MaxSegments : Integer)
|
||||
|
||||
returns Curve2d;
|
||||
|
||||
IsDone(me) returns Boolean from Standard;
|
||||
|
||||
HasResult(me) returns Boolean from Standard;
|
||||
|
||||
Curve(me)
|
||||
returns BSplineCurve from Geom2d;
|
||||
|
||||
MaxError2dU(me) returns Real;
|
||||
MaxError2dV(me) returns Real;
|
||||
|
||||
fields
|
||||
|
||||
myCurve : BSplineCurve from Geom2d;
|
||||
myIsDone : Boolean from Standard;
|
||||
myHasResult : Boolean from Standard;
|
||||
myMaxError2dU : Real from Standard;
|
||||
myMaxError2dV : Real from Standard;
|
||||
|
||||
end Curve2d;
|
@@ -14,17 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_Curve2d.ixx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <Approx_Curve2d.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : Approx_Curve2d_Eval
|
||||
//purpose: evaluator class for approximation
|
||||
//=======================================================================
|
||||
|
||||
class Approx_Curve2d_Eval : public AdvApprox_EvaluatorFunction
|
||||
{
|
||||
public:
|
||||
|
80
src/Approx/Approx_Curve2d.hxx
Normal file
80
src/Approx/Approx_Curve2d.hxx
Normal file
@@ -0,0 +1,80 @@
|
||||
// Created on: 1997-10-28
|
||||
// Created by: Roman BORISOV
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_Curve2d_HeaderFile
|
||||
#define _Approx_Curve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Geom2d_BSplineCurve;
|
||||
class Adaptor2d_HCurve2d;
|
||||
|
||||
|
||||
//! Makes an approximation for HCurve2d from Adaptor3d
|
||||
class Approx_Curve2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Approx_Curve2d(const Handle(Adaptor2d_HCurve2d)& C2D, const Standard_Real First, const Standard_Real Last, const Standard_Real TolU, const Standard_Real TolV, const GeomAbs_Shape Continuity, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasResult() const;
|
||||
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve() const;
|
||||
|
||||
Standard_EXPORT Standard_Real MaxError2dU() const;
|
||||
|
||||
Standard_EXPORT Standard_Real MaxError2dV() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom2d_BSplineCurve) myCurve;
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Boolean myHasResult;
|
||||
Standard_Real myMaxError2dU;
|
||||
Standard_Real myMaxError2dV;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_Curve2d_HeaderFile
|
@@ -1,62 +0,0 @@
|
||||
-- Created on: 1998-08-20
|
||||
-- Created by: Philippe MANGIN
|
||||
-- Copyright (c) 1998-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 Curve3d from Approx
|
||||
|
||||
uses
|
||||
HCurve from Adaptor3d,
|
||||
BSplineCurve from Geom,
|
||||
Shape from GeomAbs,
|
||||
OutOfRange from Standard
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
ConstructionError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(Curve: HCurve from Adaptor3d;
|
||||
Tol3d: Real;
|
||||
Order: Shape from GeomAbs;
|
||||
MaxSegments: Integer;
|
||||
MaxDegree: Integer) returns Curve3d from Approx;
|
||||
---Purpose: Approximation of a curve with respect of the
|
||||
-- requiered tolerance Tol3D.
|
||||
|
||||
Curve(me) returns BSplineCurve from Geom;
|
||||
|
||||
IsDone(me) returns Boolean from Standard;
|
||||
---Purpose: returns Standard_True if the approximation has
|
||||
-- been done within requiered tolerance
|
||||
|
||||
HasResult(me) returns Boolean;
|
||||
---Purpose: returns Standard_True if the approximation did come out
|
||||
-- with a result that is not NECESSARELY within the required
|
||||
-- tolerance
|
||||
|
||||
MaxError(me) returns Real from Standard;
|
||||
---Purpose: returns the Maximum Error (>0 when an approximation
|
||||
-- has been done, 0 if no approximation)
|
||||
|
||||
Dump(me; o: in out OStream);
|
||||
---Purpose: Print on the stream o information about the object
|
||||
|
||||
fields
|
||||
myIsDone : Boolean from Standard;
|
||||
myHasResult : Boolean from Standard;
|
||||
myBSplCurve : BSplineCurve from Geom;
|
||||
myMaxError : Real from Standard;
|
||||
|
||||
end Curve3d;
|
@@ -14,21 +14,25 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_Curve3d.ixx>
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <Approx_Curve3d.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : Approx_Curve3d_Eval
|
||||
//purpose: evaluator class for approximation
|
||||
//=======================================================================
|
||||
|
||||
class Approx_Curve3d_Eval : public AdvApprox_EvaluatorFunction
|
||||
{
|
||||
public:
|
||||
|
92
src/Approx/Approx_Curve3d.hxx
Normal file
92
src/Approx/Approx_Curve3d.hxx
Normal file
@@ -0,0 +1,92 @@
|
||||
// Created on: 1998-08-20
|
||||
// Created by: Philippe MANGIN
|
||||
// Copyright (c) 1998-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 _Approx_Curve3d_HeaderFile
|
||||
#define _Approx_Curve3d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Geom_BSplineCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_ConstructionError;
|
||||
class Adaptor3d_HCurve;
|
||||
|
||||
|
||||
|
||||
class Approx_Curve3d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Approximation of a curve with respect of the
|
||||
//! requiered tolerance Tol3D.
|
||||
Standard_EXPORT Approx_Curve3d(const Handle(Adaptor3d_HCurve)& Curve, const Standard_Real Tol3d, const GeomAbs_Shape Order, const Standard_Integer MaxSegments, const Standard_Integer MaxDegree);
|
||||
|
||||
Standard_EXPORT Handle(Geom_BSplineCurve) Curve() const;
|
||||
|
||||
//! returns Standard_True if the approximation has
|
||||
//! been done within requiered tolerance
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns Standard_True if the approximation did come out
|
||||
//! with a result that is not NECESSARELY within the required
|
||||
//! tolerance
|
||||
Standard_EXPORT Standard_Boolean HasResult() const;
|
||||
|
||||
//! returns the Maximum Error (>0 when an approximation
|
||||
//! has been done, 0 if no approximation)
|
||||
Standard_EXPORT Standard_Real MaxError() const;
|
||||
|
||||
//! Print on the stream o information about the object
|
||||
Standard_EXPORT void Dump (Standard_OStream& o) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Boolean myHasResult;
|
||||
Handle(Geom_BSplineCurve) myBSplCurve;
|
||||
Standard_Real myMaxError;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_Curve3d_HeaderFile
|
@@ -1,79 +0,0 @@
|
||||
-- Created on: 1997-09-30
|
||||
-- Created by: Roman BORISOV
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CurveOnSurface from Approx
|
||||
|
||||
---Purpose:
|
||||
---Purpose: Approximation of curve on surface
|
||||
|
||||
uses
|
||||
Surface from Geom,
|
||||
HCurve2d from Adaptor2d,
|
||||
HSurface from Adaptor3d,
|
||||
BSplineCurve from Geom,
|
||||
BSplineCurve from Geom2d,
|
||||
Shape from GeomAbs
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
ConstructionError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create (C2D : HCurve2d from Adaptor2d;
|
||||
Surf : HSurface from Adaptor3d;
|
||||
First,
|
||||
Last,
|
||||
Tol : Real;
|
||||
Continuity : Shape from GeomAbs;
|
||||
MaxDegree : Integer ;
|
||||
MaxSegments : Integer;
|
||||
Only3d,
|
||||
Only2d : Boolean from Standard = Standard_False)
|
||||
returns CurveOnSurface from Approx
|
||||
raises ConstructionError;
|
||||
|
||||
|
||||
IsDone(me) returns Boolean from Standard;
|
||||
|
||||
HasResult(me) returns Boolean from Standard;
|
||||
|
||||
Curve3d(me)
|
||||
returns BSplineCurve from Geom;
|
||||
|
||||
MaxError3d(me) returns Real;
|
||||
|
||||
Curve2d(me)
|
||||
|
||||
---Purpose:
|
||||
returns BSplineCurve from Geom2d;
|
||||
|
||||
MaxError2dU(me) returns Real;
|
||||
MaxError2dV(me) returns Real;
|
||||
|
||||
---Purpose : returns the maximum errors relativly to the U component or the V component of the
|
||||
-- 2d Curve
|
||||
|
||||
fields
|
||||
|
||||
myCurve2d : BSplineCurve from Geom2d;
|
||||
myCurve3d : BSplineCurve from Geom;
|
||||
myIsDone : Boolean from Standard;
|
||||
myHasResult : Boolean from Standard;
|
||||
myError3d : Real from Standard;
|
||||
myError2dU : Real from Standard;
|
||||
myError2dV : Real from Standard;
|
||||
|
||||
end CurveOnSurface;
|
@@ -14,29 +14,35 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <Approx_CurveOnSurface.ixx>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <AdvApprox_DichoCutting.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <Approx_CurveOnSurface.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <AdvApprox_DichoCutting.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : Approx_CurveOnSurface_Eval
|
||||
//purpose: evaluator class for approximation of both 2d and 3d curves
|
||||
//=======================================================================
|
||||
|
||||
class Approx_CurveOnSurface_Eval : public AdvApprox_EvaluatorFunction
|
||||
{
|
||||
public:
|
||||
|
92
src/Approx/Approx_CurveOnSurface.hxx
Normal file
92
src/Approx/Approx_CurveOnSurface.hxx
Normal file
@@ -0,0 +1,92 @@
|
||||
// Created on: 1997-09-30
|
||||
// Created by: Roman BORISOV
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_CurveOnSurface_HeaderFile
|
||||
#define _Approx_CurveOnSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Geom2d_BSplineCurve;
|
||||
class Geom_BSplineCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_ConstructionError;
|
||||
class Adaptor2d_HCurve2d;
|
||||
class Adaptor3d_HSurface;
|
||||
|
||||
|
||||
//! Approximation of curve on surface
|
||||
class Approx_CurveOnSurface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Approx_CurveOnSurface(const Handle(Adaptor2d_HCurve2d)& C2D, const Handle(Adaptor3d_HSurface)& Surf, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol, const GeomAbs_Shape Continuity, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments, const Standard_Boolean Only3d = Standard_False, const Standard_Boolean Only2d = Standard_False);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasResult() const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_BSplineCurve) Curve3d() const;
|
||||
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d() const;
|
||||
|
||||
Standard_EXPORT Standard_Real MaxError2dU() const;
|
||||
|
||||
//! returns the maximum errors relativly to the U component or the V component of the
|
||||
//! 2d Curve
|
||||
Standard_EXPORT Standard_Real MaxError2dV() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom2d_BSplineCurve) myCurve2d;
|
||||
Handle(Geom_BSplineCurve) myCurve3d;
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Boolean myHasResult;
|
||||
Standard_Real myError3d;
|
||||
Standard_Real myError2dU;
|
||||
Standard_Real myError2dV;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_CurveOnSurface_HeaderFile
|
@@ -1,124 +0,0 @@
|
||||
-- Created on: 1997-08-22
|
||||
-- Created by: Jeannine PANCIATICI, Sergey SOKOLOV
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CurvilinearParameter from Approx
|
||||
|
||||
---Purpose: Approximation of a Curve to make its parameter be its
|
||||
-- curvilinear abscissa
|
||||
-- If the curve is a curve on a surface S, C2D is the corresponding Pcurve,
|
||||
-- we considere the curve is given by its representation S(C2D(u))
|
||||
-- If the curve is a curve on 2 surfaces S1 and S2 and C2D1 C2D2 are
|
||||
-- the two corresponding Pcurve, we considere the curve is given
|
||||
-- by its representation 1/2(S1(C2D1(u) + S2 (C2D2(u)))
|
||||
|
||||
uses
|
||||
Shape from GeomAbs,
|
||||
HSurface from Adaptor3d,
|
||||
HCurve from Adaptor3d,
|
||||
HCurve2d from Adaptor2d,
|
||||
BSplineCurve from Geom,
|
||||
BSplineCurve from Geom2d
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
ConstructionError from Standard
|
||||
|
||||
is
|
||||
Create (C3D : HCurve from Adaptor3d;
|
||||
Tol : Real;
|
||||
Order : Shape from GeomAbs;
|
||||
MaxDegree : Integer;
|
||||
MaxSegments : Integer)
|
||||
|
||||
returns CurvilinearParameter from Approx
|
||||
---Purpose : case of a free 3D curve
|
||||
--
|
||||
raises ConstructionError;
|
||||
-- If the length of the curve can't be computed or if the length is null
|
||||
|
||||
Create (C2D : HCurve2d from Adaptor2d;
|
||||
Surf : HSurface from Adaptor3d;
|
||||
Tol : Real;
|
||||
Order : Shape from GeomAbs;
|
||||
MaxDegree : Integer;
|
||||
MaxSegments : Integer)
|
||||
returns CurvilinearParameter from Approx
|
||||
---Purpose : case of a curve on one surface
|
||||
--
|
||||
raises ConstructionError;
|
||||
-- If the length of the curve can't be computed or if the length is null
|
||||
|
||||
Create (C2D1 : HCurve2d from Adaptor2d;
|
||||
Surf1 : HSurface from Adaptor3d;
|
||||
C2D2 : HCurve2d from Adaptor2d;
|
||||
Surf2 : HSurface from Adaptor3d;
|
||||
Tol : Real;
|
||||
Order : Shape from GeomAbs;
|
||||
MaxDegree : Integer;
|
||||
MaxSegments : Integer)
|
||||
returns CurvilinearParameter from Approx
|
||||
---Purpose : case of a curve on two surfaces
|
||||
--
|
||||
raises ConstructionError;
|
||||
-- If the length of the curve can't be computed or if the length is null
|
||||
|
||||
IsDone(me) returns Boolean from Standard;
|
||||
-- True if the approximation succeeded within the imposed
|
||||
-- tolerances
|
||||
|
||||
HasResult(me) returns Boolean from Standard;
|
||||
-- True if the approximation did come out with a result that
|
||||
-- is not NECESSARELY within the required tolerance
|
||||
|
||||
Curve3d(me) returns BSplineCurve from Geom;
|
||||
--- Purpose: returns the Bspline curve corresponding to the reparametrized 3D curve
|
||||
|
||||
MaxError3d (me) returns Real;
|
||||
--- Purpose: returns the maximum error on the reparametrized 3D curve
|
||||
|
||||
Curve2d1(me) returns BSplineCurve from Geom2d;
|
||||
---Purpose: returns the BsplineCurve representing the reparametrized 2D curve on the
|
||||
-- first surface (case of a curve on one or two surfaces)
|
||||
|
||||
MaxError2d1(me) returns Real;
|
||||
---Purpose: returns the maximum error on the first reparametrized 2D curve
|
||||
|
||||
Curve2d2(me) returns BSplineCurve from Geom2d;
|
||||
---Purpose: returns the BsplineCurve representing the reparametrized 2D curve on the
|
||||
-- second surface (case of a curve on two surfaces)
|
||||
|
||||
MaxError2d2(me) returns Real;
|
||||
---Purpose: returns the maximum error on the second reparametrized 2D curve
|
||||
|
||||
Dump(me; o: in out OStream);
|
||||
---Purpose: print the maximum errors(s)
|
||||
|
||||
ToleranceComputation(myclass; C2D : HCurve2d from Adaptor2d; S : HSurface from Adaptor3d;
|
||||
MaxNumber : Integer; Tol : Real; TolV, TolW : out Real)
|
||||
is private;
|
||||
|
||||
fields
|
||||
|
||||
myCase : Integer from Standard;
|
||||
myDone : Boolean from Standard;
|
||||
myHasResult : Boolean from Standard;
|
||||
myCurve3d : BSplineCurve from Geom;
|
||||
myMaxError3d : Real from Standard;
|
||||
myCurve2d1 : BSplineCurve from Geom2d;
|
||||
myMaxError2d1 : Real from Standard;
|
||||
myCurve2d2 : BSplineCurve from Geom2d;
|
||||
myMaxError2d2 : Real from Standard;
|
||||
|
||||
end CurvilinearParameter;
|
@@ -14,31 +14,36 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_CurvilinearParameter.ixx>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <Approx_CurvilinearParameter.hxx>
|
||||
#include <Approx_CurvlinFunc.hxx>
|
||||
#include <CPnts_AbscissaPoint.hxx>
|
||||
#include <GCPnts_AbscissaPoint.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <CPnts_AbscissaPoint.hxx>
|
||||
#include <Approx_CurvlinFunc.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG_CHRONO
|
||||
#include <OSD_Timer.hxx>
|
||||
|
122
src/Approx/Approx_CurvilinearParameter.hxx
Normal file
122
src/Approx/Approx_CurvilinearParameter.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1997-08-22
|
||||
// Created by: Jeannine PANCIATICI, Sergey SOKOLOV
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_CurvilinearParameter_HeaderFile
|
||||
#define _Approx_CurvilinearParameter_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Geom_BSplineCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_ConstructionError;
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor2d_HCurve2d;
|
||||
class Adaptor3d_HSurface;
|
||||
|
||||
|
||||
//! Approximation of a Curve to make its parameter be its
|
||||
//! curvilinear abscissa
|
||||
//! If the curve is a curve on a surface S, C2D is the corresponding Pcurve,
|
||||
//! we considere the curve is given by its representation S(C2D(u))
|
||||
//! If the curve is a curve on 2 surfaces S1 and S2 and C2D1 C2D2 are
|
||||
//! the two corresponding Pcurve, we considere the curve is given
|
||||
//! by its representation 1/2(S1(C2D1(u) + S2 (C2D2(u)))
|
||||
class Approx_CurvilinearParameter
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! case of a free 3D curve
|
||||
Standard_EXPORT Approx_CurvilinearParameter(const Handle(Adaptor3d_HCurve)& C3D, const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
|
||||
|
||||
//! case of a curve on one surface
|
||||
Standard_EXPORT Approx_CurvilinearParameter(const Handle(Adaptor2d_HCurve2d)& C2D, const Handle(Adaptor3d_HSurface)& Surf, const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
|
||||
|
||||
//! case of a curve on two surfaces
|
||||
Standard_EXPORT Approx_CurvilinearParameter(const Handle(Adaptor2d_HCurve2d)& C2D1, const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor2d_HCurve2d)& C2D2, const Handle(Adaptor3d_HSurface)& Surf2, const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasResult() const;
|
||||
|
||||
//! returns the Bspline curve corresponding to the reparametrized 3D curve
|
||||
Standard_EXPORT Handle(Geom_BSplineCurve) Curve3d() const;
|
||||
|
||||
//! returns the maximum error on the reparametrized 3D curve
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the BsplineCurve representing the reparametrized 2D curve on the
|
||||
//! first surface (case of a curve on one or two surfaces)
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d1() const;
|
||||
|
||||
//! returns the maximum error on the first reparametrized 2D curve
|
||||
Standard_EXPORT Standard_Real MaxError2d1() const;
|
||||
|
||||
//! returns the BsplineCurve representing the reparametrized 2D curve on the
|
||||
//! second surface (case of a curve on two surfaces)
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) Curve2d2() const;
|
||||
|
||||
//! returns the maximum error on the second reparametrized 2D curve
|
||||
Standard_EXPORT Standard_Real MaxError2d2() const;
|
||||
|
||||
//! print the maximum errors(s)
|
||||
Standard_EXPORT void Dump (Standard_OStream& o) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT static void ToleranceComputation (const Handle(Adaptor2d_HCurve2d)& C2D, const Handle(Adaptor3d_HSurface)& S, const Standard_Integer MaxNumber, const Standard_Real Tol, Standard_Real& TolV, Standard_Real& TolW);
|
||||
|
||||
|
||||
Standard_Integer myCase;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myHasResult;
|
||||
Handle(Geom_BSplineCurve) myCurve3d;
|
||||
Standard_Real myMaxError3d;
|
||||
Handle(Geom2d_BSplineCurve) myCurve2d1;
|
||||
Standard_Real myMaxError2d1;
|
||||
Handle(Geom2d_BSplineCurve) myCurve2d2;
|
||||
Standard_Real myMaxError2d2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_CurvilinearParameter_HeaderFile
|
@@ -1,160 +0,0 @@
|
||||
-- Created on: 1998-05-12
|
||||
-- Created by: Roman BORISOV
|
||||
-- Copyright (c) 1998-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 CurvlinFunc from Approx inherits TShared from MMgt
|
||||
|
||||
---Purpose: defines an abstract curve with
|
||||
-- curvilinear parametrization
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
|
||||
uses
|
||||
HCurve from Adaptor3d,
|
||||
Curve from Adaptor3d,
|
||||
HCurve2d from Adaptor2d,
|
||||
HSurface from Adaptor3d,
|
||||
Shape from GeomAbs,
|
||||
Array1OfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
Pnt from gp,
|
||||
Vec from gp
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
DomainError from Standard,
|
||||
ConstructionError from Standard
|
||||
|
||||
is
|
||||
Create(C: HCurve from Adaptor3d; Tol: Real)
|
||||
returns CurvlinFunc;
|
||||
|
||||
Create(C2D: HCurve2d from Adaptor2d; S: HSurface from Adaptor3d; Tol: Real)
|
||||
returns CurvlinFunc;
|
||||
|
||||
Create(C2D1, C2D2: HCurve2d from Adaptor2d; S1, S2: HSurface from Adaptor3d; Tol: Real)
|
||||
returns CurvlinFunc;
|
||||
|
||||
SetTol(me: mutable; Tol: Real)
|
||||
---Purpose Update the tolerance to used
|
||||
is static;
|
||||
|
||||
Init(me: mutable)
|
||||
is private;
|
||||
|
||||
Init(me; C: in out Curve from Adaptor3d;
|
||||
Si: out HArray1OfReal from TColStd;
|
||||
Ui: out HArray1OfReal from TColStd)
|
||||
is private;
|
||||
|
||||
FirstParameter(me) returns Real;
|
||||
|
||||
LastParameter(me) returns Real;
|
||||
|
||||
NbIntervals(me; S : Shape from GeomAbs) returns Integer;
|
||||
---Purpose: Returns the number of intervals for continuity
|
||||
-- <S>. May be one if Continuity(me) >= <S>
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs);
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
|
||||
Trim(me: mutable; First, Last, Tol: Real from Standard)
|
||||
raises OutOfRange from Standard;
|
||||
--- Purpose : if First < 0 or Last > 1
|
||||
|
||||
Length(me: mutable)
|
||||
--- Purpose : Computes length of the curve.
|
||||
is static;
|
||||
|
||||
Length(me; C: in out Curve from Adaptor3d;
|
||||
FirstU, LasrU: Real) returns Real
|
||||
--- Purpose : Computes length of the curve segment.
|
||||
|
||||
is static;
|
||||
GetLength(me) returns Real;
|
||||
|
||||
GetUParameter(me; C: in out Curve from Adaptor3d; S: Real; NumberOfCurve: Integer) returns Real;
|
||||
--- Purpose : returns original parameter correponding S. if
|
||||
-- Case == 1 computation is performed on myC2D1 and mySurf1,
|
||||
-- otherwise it is done on myC2D2 and mySurf2.
|
||||
|
||||
GetSParameter(me; U: Real) returns Real;
|
||||
--- Purpose : returns original parameter correponding S.
|
||||
|
||||
GetSParameter(me; C: in out Curve from Adaptor3d; U, Length: Real) returns Real
|
||||
--- Purpose : returns curvilinear parameter correponding U.
|
||||
is private;
|
||||
|
||||
EvalCase1(me; S: Real; Order: Integer;
|
||||
Result: out Array1OfReal from TColStd) -- dim(Result) = 3
|
||||
returns Boolean from Standard
|
||||
|
||||
raises
|
||||
ConstructionError from Standard;
|
||||
--- Purpose : if myCase != 1
|
||||
|
||||
EvalCase2(me; S: Real; Order: Integer;
|
||||
Result: out Array1OfReal from TColStd) -- dim(Result) = 5
|
||||
returns Boolean from Standard
|
||||
raises
|
||||
ConstructionError from Standard;
|
||||
--- Purpose : if myCase != 2
|
||||
|
||||
EvalCase3(me: mutable; S: Real; Order: Integer;
|
||||
Result: out Array1OfReal from TColStd) -- dim(Result) = 7
|
||||
returns Boolean from Standard
|
||||
raises
|
||||
ConstructionError from Standard;
|
||||
--- Purpose : if myCase != 3
|
||||
|
||||
EvalCurOnSur(me; S: Real; Order: Integer;
|
||||
Result: out Array1OfReal from TColStd;
|
||||
NumberOfCurve: Integer)
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
|
||||
fields
|
||||
|
||||
myC3D : HCurve from Adaptor3d;
|
||||
myC2D1 : HCurve2d from Adaptor2d;
|
||||
myC2D2 : HCurve2d from Adaptor2d;
|
||||
mySurf1 : HSurface from Adaptor3d;
|
||||
mySurf2 : HSurface from Adaptor3d;
|
||||
myCase : Integer from Standard; -- [1..3]
|
||||
myFirstS : Real from Standard;
|
||||
myLastS : Real from Standard;
|
||||
myFirstU1: Real from Standard;
|
||||
myLastU1 : Real from Standard;
|
||||
myFirstU2: Real from Standard;
|
||||
myLastU2 : Real from Standard;
|
||||
myLength : Real from Standard;
|
||||
myLength1: Real from Standard;
|
||||
myLength2: Real from Standard;
|
||||
myTolLen : Real from Standard;
|
||||
myPrevS : Real from Standard; -- should be mutable
|
||||
myPrevU : Real from Standard; -- should be mutable
|
||||
|
||||
myUi_1 : HArray1OfReal from TColStd;
|
||||
mySi_1 : HArray1OfReal from TColStd;
|
||||
myUi_2 : HArray1OfReal from TColStd;
|
||||
mySi_2 : HArray1OfReal from TColStd;
|
||||
end CurvlinFunc;
|
@@ -14,13 +14,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_CurvlinFunc.ixx>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Approx_CurvlinFunc.hxx>
|
||||
#include <GCPnts_AbscissaPoint.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG_CHRONO
|
||||
#include <OSD_Timer.hxx>
|
||||
|
156
src/Approx/Approx_CurvlinFunc.hxx
Normal file
156
src/Approx/Approx_CurvlinFunc.hxx
Normal file
@@ -0,0 +1,156 @@
|
||||
// Created on: 1998-05-12
|
||||
// Created by: Roman BORISOV
|
||||
// Copyright (c) 1998-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 _Approx_CurvlinFunc_HeaderFile
|
||||
#define _Approx_CurvlinFunc_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor2d_HCurve2d;
|
||||
class Adaptor3d_HSurface;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_DomainError;
|
||||
class Standard_ConstructionError;
|
||||
class Adaptor3d_Curve;
|
||||
|
||||
|
||||
class Approx_CurvlinFunc;
|
||||
DEFINE_STANDARD_HANDLE(Approx_CurvlinFunc, MMgt_TShared)
|
||||
|
||||
//! defines an abstract curve with
|
||||
//! curvilinear parametrization
|
||||
class Approx_CurvlinFunc : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Approx_CurvlinFunc(const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT Approx_CurvlinFunc(const Handle(Adaptor2d_HCurve2d)& C2D, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT Approx_CurvlinFunc(const Handle(Adaptor2d_HCurve2d)& C2D1, const Handle(Adaptor2d_HCurve2d)& C2D2, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real Tol);
|
||||
|
||||
//! ---Purpose Update the tolerance to used
|
||||
Standard_EXPORT void SetTol (const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT Standard_Real FirstParameter() const;
|
||||
|
||||
Standard_EXPORT Standard_Real LastParameter() const;
|
||||
|
||||
//! Returns the number of intervals for continuity
|
||||
//! <S>. May be one if Continuity(me) >= <S>
|
||||
Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
|
||||
|
||||
//! Stores in <T> the parameters bounding the intervals
|
||||
//! of continuity <S>.
|
||||
//!
|
||||
//! The array must provide enough room to accomodate
|
||||
//! for the parameters. i.e. T.Length() > NbIntervals()
|
||||
Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
|
||||
|
||||
//! if First < 0 or Last > 1
|
||||
Standard_EXPORT void Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
|
||||
|
||||
//! Computes length of the curve.
|
||||
Standard_EXPORT void Length();
|
||||
|
||||
//! Computes length of the curve segment.
|
||||
Standard_EXPORT Standard_Real Length (Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
|
||||
|
||||
Standard_EXPORT Standard_Real GetLength() const;
|
||||
|
||||
//! returns original parameter correponding S. if
|
||||
//! Case == 1 computation is performed on myC2D1 and mySurf1,
|
||||
//! otherwise it is done on myC2D2 and mySurf2.
|
||||
Standard_EXPORT Standard_Real GetUParameter (Adaptor3d_Curve& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
|
||||
|
||||
//! returns original parameter correponding S.
|
||||
Standard_EXPORT Standard_Real GetSParameter (const Standard_Real U) const;
|
||||
|
||||
//! if myCase != 1
|
||||
Standard_EXPORT Standard_Boolean EvalCase1 (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result) const;
|
||||
|
||||
//! if myCase != 2
|
||||
Standard_EXPORT Standard_Boolean EvalCase2 (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result) const;
|
||||
|
||||
//! if myCase != 3
|
||||
Standard_EXPORT Standard_Boolean EvalCase3 (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Approx_CurvlinFunc,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Init();
|
||||
|
||||
Standard_EXPORT void Init (Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
|
||||
|
||||
//! returns curvilinear parameter correponding U.
|
||||
Standard_EXPORT Standard_Real GetSParameter (Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Length) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean EvalCurOnSur (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result, const Standard_Integer NumberOfCurve) const;
|
||||
|
||||
Handle(Adaptor3d_HCurve) myC3D;
|
||||
Handle(Adaptor2d_HCurve2d) myC2D1;
|
||||
Handle(Adaptor2d_HCurve2d) myC2D2;
|
||||
Handle(Adaptor3d_HSurface) mySurf1;
|
||||
Handle(Adaptor3d_HSurface) mySurf2;
|
||||
Standard_Integer myCase;
|
||||
Standard_Real myFirstS;
|
||||
Standard_Real myLastS;
|
||||
Standard_Real myFirstU1;
|
||||
Standard_Real myLastU1;
|
||||
Standard_Real myFirstU2;
|
||||
Standard_Real myLastU2;
|
||||
Standard_Real myLength;
|
||||
Standard_Real myLength1;
|
||||
Standard_Real myLength2;
|
||||
Standard_Real myTolLen;
|
||||
Standard_Real myPrevS;
|
||||
Standard_Real myPrevU;
|
||||
Handle(TColStd_HArray1OfReal) myUi_1;
|
||||
Handle(TColStd_HArray1OfReal) mySi_1;
|
||||
Handle(TColStd_HArray1OfReal) myUi_2;
|
||||
Handle(TColStd_HArray1OfReal) mySi_2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_CurvlinFunc_HeaderFile
|
109
src/Approx/Approx_FitAndDivide.hxx
Normal file
109
src/Approx/Approx_FitAndDivide.hxx
Normal file
@@ -0,0 +1,109 @@
|
||||
// Created on: 1993-01-26
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_FitAndDivide_HeaderFile
|
||||
#define _Approx_FitAndDivide_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_SequenceOfMultiCurve.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppCont_Function.hxx>
|
||||
class AppParCurves_MultiCurve;
|
||||
|
||||
|
||||
|
||||
class Approx_FitAndDivide
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Approx_FitAndDivide(const AppCont_Function& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
|
||||
|
||||
Standard_EXPORT Approx_FitAndDivide(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
|
||||
|
||||
Standard_EXPORT void Perform (const AppCont_Function& Line);
|
||||
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const;
|
||||
|
||||
Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean Compute (const AppCont_Function& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
|
||||
|
||||
|
||||
AppParCurves_SequenceOfMultiCurve myMultiCurves;
|
||||
TColStd_SequenceOfReal myfirstparam;
|
||||
TColStd_SequenceOfReal mylastparam;
|
||||
AppParCurves_MultiCurve TheMultiCurve;
|
||||
Standard_Boolean alldone;
|
||||
Standard_Boolean tolreached;
|
||||
TColStd_SequenceOfReal Tolers3d;
|
||||
TColStd_SequenceOfReal Tolers2d;
|
||||
Standard_Integer mydegremin;
|
||||
Standard_Integer mydegremax;
|
||||
Standard_Real mytol3d;
|
||||
Standard_Real mytol2d;
|
||||
Standard_Real currenttol3d;
|
||||
Standard_Real currenttol2d;
|
||||
Standard_Boolean mycut;
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_FitAndDivide_HeaderFile
|
109
src/Approx/Approx_FitAndDivide2d.hxx
Normal file
109
src/Approx/Approx_FitAndDivide2d.hxx
Normal file
@@ -0,0 +1,109 @@
|
||||
// Created on: 1993-01-26
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_FitAndDivide2d_HeaderFile
|
||||
#define _Approx_FitAndDivide2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_SequenceOfMultiCurve.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppCont_Function.hxx>
|
||||
class AppParCurves_MultiCurve;
|
||||
|
||||
|
||||
|
||||
class Approx_FitAndDivide2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Approx_FitAndDivide2d(const AppCont_Function& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
|
||||
|
||||
Standard_EXPORT Approx_FitAndDivide2d(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
|
||||
|
||||
Standard_EXPORT void Perform (const AppCont_Function& Line);
|
||||
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const;
|
||||
|
||||
Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean Compute (const AppCont_Function& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
|
||||
|
||||
|
||||
AppParCurves_SequenceOfMultiCurve myMultiCurves;
|
||||
TColStd_SequenceOfReal myfirstparam;
|
||||
TColStd_SequenceOfReal mylastparam;
|
||||
AppParCurves_MultiCurve TheMultiCurve;
|
||||
Standard_Boolean alldone;
|
||||
Standard_Boolean tolreached;
|
||||
TColStd_SequenceOfReal Tolers3d;
|
||||
TColStd_SequenceOfReal Tolers2d;
|
||||
Standard_Integer mydegremin;
|
||||
Standard_Integer mydegremax;
|
||||
Standard_Real mytol3d;
|
||||
Standard_Real mytol2d;
|
||||
Standard_Real currenttol3d;
|
||||
Standard_Real currenttol2d;
|
||||
Standard_Boolean mycut;
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_FitAndDivide2d_HeaderFile
|
27
src/Approx/Approx_FitAndDivide2d_0.cxx
Normal file
27
src/Approx/Approx_FitAndDivide2d_0.cxx
Normal file
@@ -0,0 +1,27 @@
|
||||
// Created on: 1993-01-26
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_FitAndDivide2d.hxx>
|
||||
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
|
||||
|
||||
#define MultiLine AppCont_Function
|
||||
#define MultiLine_hxx <AppCont_Function.hxx>
|
||||
#define Approx_ComputeCLine Approx_FitAndDivide2d
|
||||
#define Approx_ComputeCLine_hxx <Approx_FitAndDivide2d.hxx>
|
||||
#include <Approx_ComputeCLine.gxx>
|
||||
|
27
src/Approx/Approx_FitAndDivide_0.cxx
Normal file
27
src/Approx/Approx_FitAndDivide_0.cxx
Normal file
@@ -0,0 +1,27 @@
|
||||
// Created on: 1993-01-26
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_FitAndDivide.hxx>
|
||||
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
|
||||
|
||||
#define MultiLine AppCont_Function
|
||||
#define MultiLine_hxx <AppCont_Function.hxx>
|
||||
#define Approx_ComputeCLine Approx_FitAndDivide
|
||||
#define Approx_ComputeCLine_hxx <Approx_FitAndDivide.hxx>
|
||||
#include <Approx_ComputeCLine.gxx>
|
||||
|
@@ -1,68 +0,0 @@
|
||||
-- Created on: 1994-02-21
|
||||
-- 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 MCurvesToBSpCurve from Approx
|
||||
|
||||
|
||||
|
||||
uses MultiBSpCurve from AppParCurves,
|
||||
MultiCurve from AppParCurves,
|
||||
SequenceOfMultiCurve from AppParCurves
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create returns MCurvesToBSpCurve;
|
||||
|
||||
Reset(me: in out)
|
||||
--- Clear the internal Sequence Of MultiCurve
|
||||
is static;
|
||||
|
||||
Append(me: in out; MC: MultiCurve from AppParCurves)
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out)
|
||||
is static;
|
||||
|
||||
Perform(me: in out; TheSeq: SequenceOfMultiCurve from AppParCurves)
|
||||
is static;
|
||||
|
||||
|
||||
Value(me)
|
||||
---Purpose: return the composite MultiCurves as a MultiBSpCurve.
|
||||
---C++: return const&
|
||||
|
||||
returns MultiBSpCurve
|
||||
is static;
|
||||
|
||||
|
||||
ChangeValue(me: in out)
|
||||
---Purpose: return the composite MultiCurves as a MultiBSpCurve.
|
||||
---C++: return const&
|
||||
|
||||
returns MultiBSpCurve
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
|
||||
mySpline: MultiBSpCurve from AppParCurves;
|
||||
myDone : Boolean from Standard;
|
||||
myCurves: SequenceOfMultiCurve from AppParCurves;
|
||||
|
||||
end MCurvesToBSpCurve;
|
@@ -12,18 +12,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_MCurvesToBSpCurve.ixx>
|
||||
#include <Convert_CompBezierCurvesToBSplineCurve.hxx>
|
||||
#include <Convert_CompBezierCurves2dToBSplineCurve2d.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
|
||||
#include <AppParCurves_Array1OfMultiPoint.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <AppParCurves_MultiPoint.hxx>
|
||||
#include <AppParCurves_Array1OfMultiPoint.hxx>
|
||||
#include <Approx_MCurvesToBSpCurve.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Convert_CompBezierCurves2dToBSplineCurve2d.hxx>
|
||||
#include <Convert_CompBezierCurvesToBSplineCurve.hxx>
|
||||
#include <PLib.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <PLib.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
static void DEBUG(const AppParCurves_MultiCurve& MC) {
|
||||
|
81
src/Approx/Approx_MCurvesToBSpCurve.hxx
Normal file
81
src/Approx/Approx_MCurvesToBSpCurve.hxx
Normal file
@@ -0,0 +1,81 @@
|
||||
// Created on: 1994-02-21
|
||||
// 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 _Approx_MCurvesToBSpCurve_HeaderFile
|
||||
#define _Approx_MCurvesToBSpCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <AppParCurves_SequenceOfMultiCurve.hxx>
|
||||
class AppParCurves_MultiCurve;
|
||||
class AppParCurves_MultiBSpCurve;
|
||||
|
||||
|
||||
|
||||
class Approx_MCurvesToBSpCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Approx_MCurvesToBSpCurve();
|
||||
|
||||
Standard_EXPORT void Reset();
|
||||
|
||||
Standard_EXPORT void Append (const AppParCurves_MultiCurve& MC);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
Standard_EXPORT void Perform (const AppParCurves_SequenceOfMultiCurve& TheSeq);
|
||||
|
||||
//! return the composite MultiCurves as a MultiBSpCurve.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const;
|
||||
|
||||
//! return the composite MultiCurves as a MultiBSpCurve.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& ChangeValue();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
AppParCurves_MultiBSpCurve mySpline;
|
||||
Standard_Boolean myDone;
|
||||
AppParCurves_SequenceOfMultiCurve myCurves;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_MCurvesToBSpCurve_HeaderFile
|
28
src/Approx/Approx_ParametrizationType.hxx
Normal file
28
src/Approx/Approx_ParametrizationType.hxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Created on: 1993-01-26
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_ParametrizationType_HeaderFile
|
||||
#define _Approx_ParametrizationType_HeaderFile
|
||||
|
||||
|
||||
enum Approx_ParametrizationType
|
||||
{
|
||||
Approx_ChordLength,
|
||||
Approx_Centripetal,
|
||||
Approx_IsoParametric
|
||||
};
|
||||
|
||||
#endif // _Approx_ParametrizationType_HeaderFile
|
@@ -1,115 +0,0 @@
|
||||
-- Created on: 1995-06-02
|
||||
-- Created by: Xavier BENVENISTE
|
||||
-- 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 SameParameter from Approx
|
||||
|
||||
---Purpose: Approximation of a PCurve on a surface to make its
|
||||
-- parameter be the same that the parameter of a given 3d
|
||||
-- reference curve.
|
||||
|
||||
uses
|
||||
HSurface from Adaptor3d,
|
||||
HCurve from Adaptor3d,
|
||||
HCurve2d from Adaptor2d,
|
||||
Surface from Geom,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
BSplineCurve from Geom2d
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
ConstructionError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create (C3D : Curve from Geom;
|
||||
C2D : Curve from Geom2d;
|
||||
S : Surface from Geom;
|
||||
Tol : Real)
|
||||
|
||||
returns SameParameter from Approx
|
||||
---Purpose:
|
||||
-- Warning: the C3D and C2D must have the same parametric domain.
|
||||
--
|
||||
raises ConstructionError;
|
||||
|
||||
|
||||
Create (C3D : HCurve from Adaptor3d;
|
||||
C2D : Curve from Geom2d;
|
||||
S : HSurface from Adaptor3d;
|
||||
Tol : Real)
|
||||
|
||||
returns SameParameter from Approx
|
||||
---Purpose:
|
||||
--Warning: the C3D and C2D must have the same parametric domain.
|
||||
|
||||
raises ConstructionError;
|
||||
|
||||
|
||||
Create (C3D : HCurve from Adaptor3d;
|
||||
C2D : HCurve2d from Adaptor2d;
|
||||
S : HSurface from Adaptor3d;
|
||||
Tol : Real)
|
||||
|
||||
returns SameParameter from Approx
|
||||
---Purpose:
|
||||
-- Warning: the C3D and C2D must have the same parametric domain.
|
||||
--
|
||||
raises ConstructionError;
|
||||
|
||||
|
||||
Build (me : in out;
|
||||
Tol : Real from Standard)
|
||||
---Purpose: Compute the Pcurve (internal use only).
|
||||
is static private;
|
||||
|
||||
|
||||
IsDone(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
TolReached(me) returns Real from Standard;
|
||||
---C++: inline
|
||||
|
||||
|
||||
IsSameParameter(me)
|
||||
---C++: inline
|
||||
|
||||
---Purpose: Tells whether the original data had already the same
|
||||
-- parameter up to the tolerance : in that case nothing
|
||||
-- is done.
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
Curve2d(me)
|
||||
---C++: inline
|
||||
|
||||
---Purpose: Returns the 2D curve that has the same parameter as
|
||||
-- the 3D curve once evaluated on the surface up to the
|
||||
-- specified tolerance
|
||||
returns BSplineCurve from Geom2d;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
mySameParameter : Boolean from Standard;
|
||||
myDone : Boolean from Standard;
|
||||
myTolReached : Real from Standard;
|
||||
myCurve2d : BSplineCurve from Geom2d;
|
||||
myHCurve2d : HCurve2d from Adaptor2d;
|
||||
myC3d : HCurve from Adaptor3d;
|
||||
mySurf : HSurface from Adaptor3d;
|
||||
|
||||
end SameParameter;
|
@@ -16,22 +16,31 @@
|
||||
|
||||
// Modified by skv - Wed Jun 2 11:49:59 2004 OCC5898
|
||||
|
||||
#include <Approx_SameParameter.ixx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <Approx_SameParameter.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <GCPnts_QuasiUniformDeflection.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GCPnts_QuasiUniformDeflection.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomLib_MakeCurvefromApprox.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
#ifdef DRAW
|
||||
|
105
src/Approx/Approx_SameParameter.hxx
Normal file
105
src/Approx/Approx_SameParameter.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1995-06-02
|
||||
// Created by: Xavier BENVENISTE
|
||||
// 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 _Approx_SameParameter_HeaderFile
|
||||
#define _Approx_SameParameter_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Geom2d_BSplineCurve;
|
||||
class Adaptor2d_HCurve2d;
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor3d_HSurface;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_ConstructionError;
|
||||
class Geom_Curve;
|
||||
class Geom2d_Curve;
|
||||
class Geom_Surface;
|
||||
|
||||
|
||||
//! Approximation of a PCurve on a surface to make its
|
||||
//! parameter be the same that the parameter of a given 3d
|
||||
//! reference curve.
|
||||
class Approx_SameParameter
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Warning: the C3D and C2D must have the same parametric domain.
|
||||
Standard_EXPORT Approx_SameParameter(const Handle(Geom_Curve)& C3D, const Handle(Geom2d_Curve)& C2D, const Handle(Geom_Surface)& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT Approx_SameParameter(const Handle(Adaptor3d_HCurve)& C3D, const Handle(Geom2d_Curve)& C2D, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
|
||||
|
||||
|
||||
//! Warning: the C3D and C2D must have the same parametric domain.
|
||||
Standard_EXPORT Approx_SameParameter(const Handle(Adaptor3d_HCurve)& C3D, const Handle(Adaptor2d_HCurve2d)& C2D, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
|
||||
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_Real TolReached() const;
|
||||
|
||||
//! Tells whether the original data had already the same
|
||||
//! parameter up to the tolerance : in that case nothing
|
||||
//! is done.
|
||||
Standard_Boolean IsSameParameter() const;
|
||||
|
||||
//! Returns the 2D curve that has the same parameter as
|
||||
//! the 3D curve once evaluated on the surface up to the
|
||||
//! specified tolerance
|
||||
Handle(Geom2d_BSplineCurve) Curve2d() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Compute the Pcurve (internal use only).
|
||||
Standard_EXPORT void Build (const Standard_Real Tol);
|
||||
|
||||
|
||||
Standard_Boolean mySameParameter;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Real myTolReached;
|
||||
Handle(Geom2d_BSplineCurve) myCurve2d;
|
||||
Handle(Adaptor2d_HCurve2d) myHCurve2d;
|
||||
Handle(Adaptor3d_HCurve) myC3d;
|
||||
Handle(Adaptor3d_HSurface) mySurf;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Approx_SameParameter.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_SameParameter_HeaderFile
|
28
src/Approx/Approx_Status.hxx
Normal file
28
src/Approx/Approx_Status.hxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Created on: 1993-01-26
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_Status_HeaderFile
|
||||
#define _Approx_Status_HeaderFile
|
||||
|
||||
|
||||
enum Approx_Status
|
||||
{
|
||||
Approx_PointsAdded,
|
||||
Approx_NoPointsAdded,
|
||||
Approx_NoApproximation
|
||||
};
|
||||
|
||||
#endif // _Approx_Status_HeaderFile
|
@@ -1,373 +0,0 @@
|
||||
-- Created on: 1997-06-24
|
||||
-- Created by: Philippe MANGIN
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class SweepApproximation from Approx
|
||||
|
||||
---Purpose: Approximation of an Surface S(u,v)
|
||||
-- (and eventually associate 2d Curves) defined
|
||||
-- by section's law.
|
||||
--
|
||||
-- This surface is defined by a function F(u, v)
|
||||
-- where Ft(u) = F(u, t) is a bspline curve.
|
||||
-- To use this algorithme, you have to implement Ft(u)
|
||||
-- as a derivative class of Approx_SweepFunction.
|
||||
-- This algorithm can be used by blending, sweeping...
|
||||
|
||||
|
||||
|
||||
uses Array2OfReal from TColStd,
|
||||
HArray2OfReal from TColStd,
|
||||
Array1OfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
Array1OfInteger from TColStd,
|
||||
HArray1OfInteger from TColStd,
|
||||
|
||||
Vec from gp,
|
||||
Array1OfPnt2d from TColgp,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
HArray1OfPnt from TColgp,
|
||||
HArray1OfVec2d from TColgp,
|
||||
HArray1OfVec from TColgp,
|
||||
Array2OfPnt from TColgp,
|
||||
HArray2OfPnt from TColgp,
|
||||
|
||||
HArray1OfGTrsf2d from Approx,
|
||||
SequenceOfArray1OfPnt2d from TColgp,
|
||||
Shape from GeomAbs,
|
||||
EvaluatorFunction from AdvApprox,
|
||||
Cutting from AdvApprox,
|
||||
SweepFunction from Approx
|
||||
|
||||
raises NotDone from StdFail,
|
||||
DomainError,
|
||||
OutOfRange
|
||||
|
||||
is
|
||||
Create(Func : SweepFunction from Approx)
|
||||
returns SweepApproximation from Approx;
|
||||
|
||||
Perform(me : in out;
|
||||
First, Last : Real;
|
||||
Tol3d, BoundTol, Tol2d, TolAngular : Real;
|
||||
Continuity : Shape = GeomAbs_C0;
|
||||
Degmax : Integer = 11;
|
||||
Segmax : Integer = 50)
|
||||
---Purpose: Perform the Approximation
|
||||
-- [First, Last] : Approx_SweepApproximation.cdl
|
||||
-- Tol3d : Tolerance to surface approximation
|
||||
-- Tol2d : Tolerance used to perform curve approximation
|
||||
-- Normaly the 2d curve are approximated with a
|
||||
-- tolerance given by the resolution on support surfaces,
|
||||
-- but if this tolerance is too large Tol2d is used.
|
||||
-- TolAngular : Tolerance (in radian) to control the angle
|
||||
-- beetween tangents on the section law and
|
||||
-- tangent of iso-v on approximed surface
|
||||
-- Continuity : The continuity in v waiting on the surface
|
||||
-- Degmax : The maximum degree in v requiered on the surface
|
||||
-- Segmax : The maximum number of span in v requiered on
|
||||
-- the surface
|
||||
-- Warning : The continuity ci can be obtained only if Ft is Ci
|
||||
raises DomainError from Standard;
|
||||
-- if <Continuity> not in {C0, C1, C2}
|
||||
-- if <Degmax> < 2 or degmax > Geom_BSplineSurface::MaxDegree()
|
||||
-- if <Segmax> < 1
|
||||
-- if one tolerance is <= 0
|
||||
|
||||
Approximation(me : in out;
|
||||
OneDTol, TwoDTol, ThreeDTol : HArray1OfReal;
|
||||
BounTol : Real;
|
||||
First, Last : Real;
|
||||
Continuity : Shape;
|
||||
Degmax, Segmax : Integer;
|
||||
TheApproxFunction : EvaluatorFunction from AdvApprox;
|
||||
TheCuttingTool : Cutting from AdvApprox)
|
||||
is private;
|
||||
|
||||
Eval(me : in out;
|
||||
Parameter : Real;
|
||||
DerivativeRequest : Integer;
|
||||
First, Last : Real;
|
||||
Result : in out Real)
|
||||
---Purpose : The EvaluatorFunction from AdvApprox;
|
||||
returns Integer from Standard;
|
||||
|
||||
D0(me : in out;
|
||||
Param: Real;
|
||||
First, Last : Real;
|
||||
Result:in out Real)
|
||||
returns Boolean is private;
|
||||
|
||||
D1(me : in out;
|
||||
Param: Real;
|
||||
First, Last : Real;
|
||||
Result:in out Real)
|
||||
returns Boolean is private;
|
||||
|
||||
D2(me : in out;
|
||||
Param: Real;
|
||||
First, Last : Real;
|
||||
Result:in out Real)
|
||||
returns Boolean is private;
|
||||
|
||||
|
||||
IsDone(me)
|
||||
---Purpose : returns if we have an result
|
||||
returns Boolean from Standard
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
SurfShape(me; UDegree,VDegree : out Integer from Standard;
|
||||
NbUPoles,NbVPoles: out Integer from Standard;
|
||||
NbUKnots,NbVKnots: out Integer from Standard)
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Surface(me; TPoles : out Array2OfPnt from TColgp;
|
||||
TWeights : out Array2OfReal from TColStd;
|
||||
TUKnots,TVKnots : out Array1OfReal from TColStd;
|
||||
TUMults,TVMults : out Array1OfInteger from TColStd)
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
UDegree(me)
|
||||
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
VDegree(me)
|
||||
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
SurfPoles(me)
|
||||
|
||||
returns Array2OfPnt from TColgp
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
SurfWeights(me)
|
||||
|
||||
returns Array2OfReal from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
SurfUKnots(me)
|
||||
|
||||
returns Array1OfReal from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
SurfVKnots(me)
|
||||
|
||||
returns Array1OfReal from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
SurfUMults(me)
|
||||
|
||||
returns Array1OfInteger from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
SurfVMults(me)
|
||||
|
||||
returns Array1OfInteger from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
MaxErrorOnSurf (me)
|
||||
---Purpose: returns the maximum error in the suface approximation.
|
||||
returns Real;
|
||||
|
||||
|
||||
AverageErrorOnSurf(me)
|
||||
---Purpose: returns the average error in the suface approximation.
|
||||
returns Real;
|
||||
|
||||
|
||||
NbCurves2d(me)
|
||||
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Curves2dShape(me; Degree,NbPoles,NbKnots: out Integer from Standard)
|
||||
|
||||
raises NotDone from StdFail,
|
||||
DomainError from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Curve2d(me; Index: Integer from Standard;
|
||||
TPoles : out Array1OfPnt2d from TColgp;
|
||||
TKnots : out Array1OfReal from TColStd;
|
||||
TMults : out Array1OfInteger from TColStd)
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Curves2dDegree(me)
|
||||
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
|
||||
raises NotDone from StdFail,
|
||||
DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Curve2dPoles(me; Index: Integer from Standard)
|
||||
|
||||
returns Array1OfPnt2d from TColgp
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Curves2dKnots(me)
|
||||
|
||||
returns Array1OfReal from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail,
|
||||
DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Curves2dMults(me)
|
||||
|
||||
returns Array1OfInteger from TColStd
|
||||
---C++: inline
|
||||
---C++: return const&
|
||||
|
||||
raises NotDone from StdFail,
|
||||
DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Max2dError (me; Index : Integer)
|
||||
---Purpose: returns the maximum error of the <Index>
|
||||
-- 2d curve approximation.
|
||||
returns Real;
|
||||
|
||||
|
||||
Average2dError(me; Index : Integer )
|
||||
---Purpose: returns the average error of the <Index>
|
||||
-- 2d curve approximation.
|
||||
returns Real;
|
||||
|
||||
TolCurveOnSurf(me; Index : Integer from Standard)
|
||||
---Purpose: returns the maximum 3d error of the <Index>
|
||||
-- 2d curve approximation on the Surface.
|
||||
returns Real from Standard
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
Dump(me; o: in out OStream);
|
||||
---Purpose: display information on approximation.
|
||||
|
||||
fields
|
||||
myFunc : SweepFunction from Approx;
|
||||
done : Boolean from Standard;
|
||||
Num1DSS : Integer from Standard;
|
||||
Num2DSS : Integer from Standard;
|
||||
Num3DSS : Integer from Standard;
|
||||
|
||||
udeg : Integer from Standard;
|
||||
vdeg : Integer from Standard;
|
||||
deg2d : Integer from Standard;
|
||||
tabPoles : HArray2OfPnt from TColgp;
|
||||
tabWeights: HArray2OfReal from TColStd;
|
||||
tabUKnots : HArray1OfReal from TColStd;
|
||||
tabVKnots : HArray1OfReal from TColStd;
|
||||
tab2dKnots: HArray1OfReal from TColStd;
|
||||
tabUMults : HArray1OfInteger from TColStd;
|
||||
tabVMults : HArray1OfInteger from TColStd;
|
||||
tab2dMults: HArray1OfInteger from TColStd;
|
||||
seqPoles2d: SequenceOfArray1OfPnt2d from TColgp;
|
||||
MError1d : HArray1OfReal from TColStd;
|
||||
tab2dError: HArray1OfReal from TColStd;
|
||||
MError3d : HArray1OfReal from TColStd;
|
||||
AError1d : HArray1OfReal from TColStd;
|
||||
Ave2dError: HArray1OfReal from TColStd;
|
||||
AError3d : HArray1OfReal from TColStd;
|
||||
AAffin : HArray1OfGTrsf2d from Approx;
|
||||
COnSurfErr: HArray1OfReal from TColStd;
|
||||
Translation : Vec from gp;
|
||||
--
|
||||
-- To Accelerate Evaluation :
|
||||
--
|
||||
myPoles : HArray1OfPnt;
|
||||
myPoles2d : HArray1OfPnt2d;
|
||||
myWeigths : HArray1OfReal;
|
||||
myDPoles : HArray1OfVec;
|
||||
myD2Poles : HArray1OfVec;
|
||||
myDPoles2d : HArray1OfVec2d;
|
||||
myD2Poles2d: HArray1OfVec2d;
|
||||
myDWeigths : HArray1OfReal;
|
||||
myD2Weigths: HArray1OfReal;
|
||||
|
||||
myOrder : Integer;
|
||||
myParam : Real;
|
||||
first, last: Real;
|
||||
end SweepApproximation;
|
@@ -14,28 +14,28 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_SweepApproximation.ixx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <AdvApprox_Cutting.hxx>
|
||||
#include <AdvApprox_DichoCutting.hxx>
|
||||
#include <AdvApprox_PrefAndRec.hxx>
|
||||
|
||||
#include <Approx_SweepApproximation.hxx>
|
||||
#include <Approx_SweepFunction.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColgp_Array1OfVec2d.hxx>
|
||||
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : Approx_SweepApproximation_Eval
|
||||
//purpose: evaluator class for approximation
|
||||
//=======================================================================
|
||||
|
||||
class Approx_SweepApproximation_Eval : public AdvApprox_EvaluatorFunction
|
||||
{
|
||||
public:
|
||||
|
220
src/Approx/Approx_SweepApproximation.hxx
Normal file
220
src/Approx/Approx_SweepApproximation.hxx
Normal file
@@ -0,0 +1,220 @@
|
||||
// Created on: 1997-06-24
|
||||
// Created by: Philippe MANGIN
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_SweepApproximation_HeaderFile
|
||||
#define _Approx_SweepApproximation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColgp_SequenceOfArray1OfPnt2d.hxx>
|
||||
#include <Approx_HArray1OfGTrsf2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <TColgp_HArray1OfVec.hxx>
|
||||
#include <TColgp_HArray1OfVec2d.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <AdvApprox_EvaluatorFunction.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Approx_SweepFunction;
|
||||
class StdFail_NotDone;
|
||||
class Standard_DomainError;
|
||||
class Standard_OutOfRange;
|
||||
class AdvApprox_Cutting;
|
||||
|
||||
|
||||
//! Approximation of an Surface S(u,v)
|
||||
//! (and eventually associate 2d Curves) defined
|
||||
//! by section's law.
|
||||
//!
|
||||
//! This surface is defined by a function F(u, v)
|
||||
//! where Ft(u) = F(u, t) is a bspline curve.
|
||||
//! To use this algorithme, you have to implement Ft(u)
|
||||
//! as a derivative class of Approx_SweepFunction.
|
||||
//! This algorithm can be used by blending, sweeping...
|
||||
class Approx_SweepApproximation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func);
|
||||
|
||||
//! Perform the Approximation
|
||||
//! [First, Last] : Approx_SweepApproximation.cdl
|
||||
//! Tol3d : Tolerance to surface approximation
|
||||
//! Tol2d : Tolerance used to perform curve approximation
|
||||
//! Normaly the 2d curve are approximated with a
|
||||
//! tolerance given by the resolution on support surfaces,
|
||||
//! but if this tolerance is too large Tol2d is used.
|
||||
//! TolAngular : Tolerance (in radian) to control the angle
|
||||
//! beetween tangents on the section law and
|
||||
//! tangent of iso-v on approximed surface
|
||||
//! Continuity : The continuity in v waiting on the surface
|
||||
//! Degmax : The maximum degree in v requiered on the surface
|
||||
//! Segmax : The maximum number of span in v requiered on
|
||||
//! the surface
|
||||
//! Warning : The continuity ci can be obtained only if Ft is Ci
|
||||
Standard_EXPORT void Perform (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol3d, const Standard_Real BoundTol, const Standard_Real Tol2d, const Standard_Real TolAngular, const GeomAbs_Shape Continuity = GeomAbs_C0, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 50);
|
||||
|
||||
//! The EvaluatorFunction from AdvApprox;
|
||||
Standard_EXPORT Standard_Integer Eval (const Standard_Real Parameter, const Standard_Integer DerivativeRequest, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
|
||||
|
||||
//! returns if we have an result
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
|
||||
|
||||
Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
|
||||
|
||||
Standard_Integer UDegree() const;
|
||||
|
||||
Standard_Integer VDegree() const;
|
||||
|
||||
const TColgp_Array2OfPnt& SurfPoles() const;
|
||||
|
||||
const TColStd_Array2OfReal& SurfWeights() const;
|
||||
|
||||
const TColStd_Array1OfReal& SurfUKnots() const;
|
||||
|
||||
const TColStd_Array1OfReal& SurfVKnots() const;
|
||||
|
||||
const TColStd_Array1OfInteger& SurfUMults() const;
|
||||
|
||||
const TColStd_Array1OfInteger& SurfVMults() const;
|
||||
|
||||
//! returns the maximum error in the suface approximation.
|
||||
Standard_EXPORT Standard_Real MaxErrorOnSurf() const;
|
||||
|
||||
//! returns the average error in the suface approximation.
|
||||
Standard_EXPORT Standard_Real AverageErrorOnSurf() const;
|
||||
|
||||
Standard_Integer NbCurves2d() const;
|
||||
|
||||
Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
|
||||
|
||||
Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
|
||||
|
||||
Standard_Integer Curves2dDegree() const;
|
||||
|
||||
const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
|
||||
|
||||
const TColStd_Array1OfReal& Curves2dKnots() const;
|
||||
|
||||
const TColStd_Array1OfInteger& Curves2dMults() const;
|
||||
|
||||
//! returns the maximum error of the <Index>
|
||||
//! 2d curve approximation.
|
||||
Standard_EXPORT Standard_Real Max2dError (const Standard_Integer Index) const;
|
||||
|
||||
//! returns the average error of the <Index>
|
||||
//! 2d curve approximation.
|
||||
Standard_EXPORT Standard_Real Average2dError (const Standard_Integer Index) const;
|
||||
|
||||
//! returns the maximum 3d error of the <Index>
|
||||
//! 2d curve approximation on the Surface.
|
||||
Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
|
||||
|
||||
//! display information on approximation.
|
||||
Standard_EXPORT void Dump (Standard_OStream& o) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Approximation (const Handle(TColStd_HArray1OfReal)& OneDTol, const Handle(TColStd_HArray1OfReal)& TwoDTol, const Handle(TColStd_HArray1OfReal)& ThreeDTol, const Standard_Real BounTol, const Standard_Real First, const Standard_Real Last, const GeomAbs_Shape Continuity, const Standard_Integer Degmax, const Standard_Integer Segmax, const AdvApprox_EvaluatorFunction& TheApproxFunction, const AdvApprox_Cutting& TheCuttingTool);
|
||||
|
||||
Standard_EXPORT Standard_Boolean D0 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
|
||||
|
||||
Standard_EXPORT Standard_Boolean D1 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
|
||||
|
||||
Standard_EXPORT Standard_Boolean D2 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
|
||||
|
||||
|
||||
Handle(Approx_SweepFunction) myFunc;
|
||||
Standard_Boolean done;
|
||||
Standard_Integer Num1DSS;
|
||||
Standard_Integer Num2DSS;
|
||||
Standard_Integer Num3DSS;
|
||||
Standard_Integer udeg;
|
||||
Standard_Integer vdeg;
|
||||
Standard_Integer deg2d;
|
||||
Handle(TColgp_HArray2OfPnt) tabPoles;
|
||||
Handle(TColStd_HArray2OfReal) tabWeights;
|
||||
Handle(TColStd_HArray1OfReal) tabUKnots;
|
||||
Handle(TColStd_HArray1OfReal) tabVKnots;
|
||||
Handle(TColStd_HArray1OfReal) tab2dKnots;
|
||||
Handle(TColStd_HArray1OfInteger) tabUMults;
|
||||
Handle(TColStd_HArray1OfInteger) tabVMults;
|
||||
Handle(TColStd_HArray1OfInteger) tab2dMults;
|
||||
TColgp_SequenceOfArray1OfPnt2d seqPoles2d;
|
||||
Handle(TColStd_HArray1OfReal) MError1d;
|
||||
Handle(TColStd_HArray1OfReal) tab2dError;
|
||||
Handle(TColStd_HArray1OfReal) MError3d;
|
||||
Handle(TColStd_HArray1OfReal) AError1d;
|
||||
Handle(TColStd_HArray1OfReal) Ave2dError;
|
||||
Handle(TColStd_HArray1OfReal) AError3d;
|
||||
Handle(Approx_HArray1OfGTrsf2d) AAffin;
|
||||
Handle(TColStd_HArray1OfReal) COnSurfErr;
|
||||
gp_Vec Translation;
|
||||
Handle(TColgp_HArray1OfPnt) myPoles;
|
||||
Handle(TColgp_HArray1OfPnt2d) myPoles2d;
|
||||
Handle(TColStd_HArray1OfReal) myWeigths;
|
||||
Handle(TColgp_HArray1OfVec) myDPoles;
|
||||
Handle(TColgp_HArray1OfVec) myD2Poles;
|
||||
Handle(TColgp_HArray1OfVec2d) myDPoles2d;
|
||||
Handle(TColgp_HArray1OfVec2d) myD2Poles2d;
|
||||
Handle(TColStd_HArray1OfReal) myDWeigths;
|
||||
Handle(TColStd_HArray1OfReal) myD2Weigths;
|
||||
Standard_Integer myOrder;
|
||||
Standard_Real myParam;
|
||||
Standard_Real first;
|
||||
Standard_Real last;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Approx_SweepApproximation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_SweepApproximation_HeaderFile
|
@@ -1,203 +0,0 @@
|
||||
-- Created on: 1997-06-25
|
||||
-- Created by: Philippe MANGIN
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class SweepFunction from Approx inherits TShared from MMgt
|
||||
|
||||
---Purpose: defined the function used by SweepApproximation to
|
||||
-- perform sweeping application.
|
||||
|
||||
|
||||
uses
|
||||
Shape from GeomAbs,
|
||||
Pnt from gp,
|
||||
Array1OfPnt from TColgp,
|
||||
Array1OfPnt2d from TColgp,
|
||||
Array1OfVec from TColgp,
|
||||
Array1OfVec2d from TColgp,
|
||||
Array1OfInteger from TColStd,
|
||||
Array1OfReal from TColStd
|
||||
|
||||
raises NotImplemented ,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
--========== To compute Sections and derivatives Sections
|
||||
--
|
||||
D0(me : mutable;
|
||||
Param: Real;
|
||||
First, Last : Real;
|
||||
Poles : out Array1OfPnt from TColgp;
|
||||
Poles2d : out Array1OfPnt2d from TColgp;
|
||||
Weigths : out Array1OfReal from TColStd)
|
||||
---Purpose: compute the section for v = param
|
||||
returns Boolean is deferred;
|
||||
|
||||
D1(me : mutable;
|
||||
Param: Real;
|
||||
First, Last : Real;
|
||||
Poles : out Array1OfPnt from TColgp;
|
||||
DPoles : out Array1OfVec from TColgp;
|
||||
Poles2d : out Array1OfPnt2d from TColgp;
|
||||
DPoles2d : out Array1OfVec2d from TColgp;
|
||||
Weigths : out Array1OfReal from TColStd;
|
||||
DWeigths : out Array1OfReal from TColStd)
|
||||
---Purpose: compute the first derivative in v direction of the
|
||||
-- section for v = param
|
||||
-- Warning : It used only for C1 or C2 aproximation
|
||||
returns Boolean
|
||||
raises NotImplemented
|
||||
is virtual;
|
||||
|
||||
D2(me : mutable;
|
||||
Param: Real;
|
||||
First, Last : Real;
|
||||
Poles : out Array1OfPnt from TColgp;
|
||||
DPoles : out Array1OfVec from TColgp;
|
||||
D2Poles : out Array1OfVec from TColgp;
|
||||
Poles2d : out Array1OfPnt2d from TColgp;
|
||||
DPoles2d : out Array1OfVec2d from TColgp;
|
||||
D2Poles2d : out Array1OfVec2d from TColgp;
|
||||
Weigths : out Array1OfReal from TColStd;
|
||||
DWeigths : out Array1OfReal from TColStd;
|
||||
D2Weigths : out Array1OfReal from TColStd)
|
||||
---Purpose: compute the second derivative in v direction of the
|
||||
-- section for v = param
|
||||
-- Warning : It used only for C2 aproximation
|
||||
returns Boolean
|
||||
raises NotImplemented
|
||||
is virtual;
|
||||
|
||||
--
|
||||
-- =================== General Information On The Function ===================
|
||||
--
|
||||
Nb2dCurves(me)
|
||||
---Purpose: get the number of 2d curves to approximate.
|
||||
returns Integer is deferred;
|
||||
|
||||
SectionShape(me; NbPoles : out Integer from Standard;
|
||||
NbKnots : out Integer from Standard;
|
||||
Degree : out Integer from Standard)
|
||||
---Purpose: get the format of an section
|
||||
is deferred;
|
||||
|
||||
Knots(me; TKnots: out Array1OfReal from TColStd)
|
||||
---Purpose: get the Knots of the section
|
||||
is deferred;
|
||||
|
||||
Mults(me; TMults: out Array1OfInteger from TColStd)
|
||||
---Purpose: get the Multplicities of the section
|
||||
is deferred;
|
||||
|
||||
IsRational(me)
|
||||
---Purpose: Returns if the sections are rationnal or not
|
||||
returns Boolean is deferred;
|
||||
|
||||
|
||||
--
|
||||
-- =================== Management of continuity ===================
|
||||
--
|
||||
NbIntervals(me; S : Shape from GeomAbs)
|
||||
---Purpose: Returns the number of intervals for continuity
|
||||
-- <S>.
|
||||
-- May be one if Continuity(me) >= <S>
|
||||
returns Integer is deferred;
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is deferred;
|
||||
|
||||
|
||||
SetInterval(me: mutable; First, Last: Real from Standard)
|
||||
---Purpose: Sets the bounds of the parametric interval on
|
||||
-- the fonction
|
||||
-- This determines the derivatives in these values if the
|
||||
-- function is not Cn.
|
||||
is deferred;
|
||||
|
||||
|
||||
-- ===================== To help computation of Tolerance ======
|
||||
-- Evaluation of error, in 2d space, or on rational function, is
|
||||
-- difficult. The following methods can help the approximation to
|
||||
-- make good evaluation and use good tolerances.
|
||||
--
|
||||
-- It is not necessary for the following informations to be very
|
||||
-- precise. A fast evaluation is sufficient.
|
||||
|
||||
Resolution(me;
|
||||
Index : Integer from Standard;
|
||||
Tol : Real from Standard;
|
||||
TolU, TolV : out Real from Standard)
|
||||
---Purpose: Returns the resolutions in the sub-space 2d <Index>
|
||||
-- This information is usfull to find an good tolerance in
|
||||
-- 2d approximation.
|
||||
---Warning: Used only if Nb2dCurve > 0
|
||||
raises NotImplemented
|
||||
is virtual;
|
||||
|
||||
|
||||
GetTolerance(me;
|
||||
BoundTol, SurfTol, AngleTol : Real;
|
||||
Tol3d : out Array1OfReal)
|
||||
---Purpose: Returns the tolerance to reach in approximation
|
||||
-- to satisfy.
|
||||
-- BoundTol error at the Boundary
|
||||
-- AngleTol tangent error at the Boundary (in radian)
|
||||
-- SurfTol error inside the surface.
|
||||
is deferred;
|
||||
|
||||
|
||||
SetTolerance(me : mutable; Tol3d, Tol2d : Real)
|
||||
---Purpose: Is usefull, if (me) have to run numerical
|
||||
-- algorithm to perform D0, D1 or D2
|
||||
is deferred;
|
||||
|
||||
BarycentreOfSurf(me)
|
||||
---Purpose: Get the barycentre of Surface.
|
||||
-- An very poor estimation is sufficent.
|
||||
-- This information is usefull to perform well
|
||||
-- conditioned rational approximation.
|
||||
-- Warning: Used only if <me> IsRational
|
||||
returns Pnt from gp
|
||||
raises NotImplemented
|
||||
is virtual;
|
||||
|
||||
|
||||
MaximalSection(me) returns Real
|
||||
---Purpose: Returns the length of the greater section. This
|
||||
-- information is usefull to G1's control.
|
||||
-- Warning: With an little value, approximation can be slower.
|
||||
raises NotImplemented
|
||||
is virtual;
|
||||
|
||||
GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
|
||||
---Purpose: Compute the minimal value of weight for each poles
|
||||
-- in all sections.
|
||||
-- This information is usefull to control error
|
||||
-- in rational approximation.
|
||||
-- Warning: Used only if <me> IsRational
|
||||
raises NotImplemented
|
||||
is virtual;
|
||||
|
||||
end SweepFunction;
|
@@ -14,7 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Approx_SweepFunction.ixx>
|
||||
|
||||
#include <Approx_SweepFunction.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
// Standard_Boolean Approx_SweepFunction::D1(const Standard_Real Param,const Standard_Real First,const Standard_Real Last,TColgp_Array1OfPnt& Poles,TColgp_Array1OfVec& DPoles,TColgp_Array1OfPnt2d& Poles2d,TColgp_Array1OfVec2d& DPoles2d,TColStd_Array1OfReal& Weigths,TColStd_Array1OfReal& DWeigths)
|
||||
Standard_Boolean Approx_SweepFunction::D1(const Standard_Real ,const Standard_Real ,const Standard_Real ,TColgp_Array1OfPnt& ,TColgp_Array1OfVec& ,TColgp_Array1OfPnt2d& ,TColgp_Array1OfVec2d& ,TColStd_Array1OfReal& ,TColStd_Array1OfReal& )
|
||||
|
154
src/Approx/Approx_SweepFunction.hxx
Normal file
154
src/Approx/Approx_SweepFunction.hxx
Normal file
@@ -0,0 +1,154 @@
|
||||
// Created on: 1997-06-25
|
||||
// Created by: Philippe MANGIN
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Approx_SweepFunction_HeaderFile
|
||||
#define _Approx_SweepFunction_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColgp_Array1OfVec2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class Standard_NotImplemented;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
class Approx_SweepFunction;
|
||||
DEFINE_STANDARD_HANDLE(Approx_SweepFunction, MMgt_TShared)
|
||||
|
||||
//! defined the function used by SweepApproximation to
|
||||
//! perform sweeping application.
|
||||
class Approx_SweepFunction : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! compute the section for v = param
|
||||
Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0;
|
||||
|
||||
//! compute the first derivative in v direction of the
|
||||
//! section for v = param
|
||||
//! Warning : It used only for C1 or C2 aproximation
|
||||
Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths);
|
||||
|
||||
//! compute the second derivative in v direction of the
|
||||
//! section for v = param
|
||||
//! Warning : It used only for C2 aproximation
|
||||
Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths);
|
||||
|
||||
//! get the number of 2d curves to approximate.
|
||||
Standard_EXPORT virtual Standard_Integer Nb2dCurves() const = 0;
|
||||
|
||||
//! get the format of an section
|
||||
Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const = 0;
|
||||
|
||||
//! get the Knots of the section
|
||||
Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const = 0;
|
||||
|
||||
//! get the Multplicities of the section
|
||||
Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const = 0;
|
||||
|
||||
//! Returns if the sections are rationnal or not
|
||||
Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
|
||||
|
||||
//! Returns the number of intervals for continuity
|
||||
//! <S>.
|
||||
//! May be one if Continuity(me) >= <S>
|
||||
Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
|
||||
|
||||
//! Stores in <T> the parameters bounding the intervals
|
||||
//! of continuity <S>.
|
||||
//!
|
||||
//! The array must provide enough room to accomodate
|
||||
//! for the parameters. i.e. T.Length() > NbIntervals()
|
||||
Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
|
||||
|
||||
//! Sets the bounds of the parametric interval on
|
||||
//! the fonction
|
||||
//! This determines the derivatives in these values if the
|
||||
//! function is not Cn.
|
||||
Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) = 0;
|
||||
|
||||
//! Returns the resolutions in the sub-space 2d <Index>
|
||||
//! This information is usfull to find an good tolerance in
|
||||
//! 2d approximation.
|
||||
Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const;
|
||||
|
||||
//! Returns the tolerance to reach in approximation
|
||||
//! to satisfy.
|
||||
//! BoundTol error at the Boundary
|
||||
//! AngleTol tangent error at the Boundary (in radian)
|
||||
//! SurfTol error inside the surface.
|
||||
Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const = 0;
|
||||
|
||||
//! Is usefull, if (me) have to run numerical
|
||||
//! algorithm to perform D0, D1 or D2
|
||||
Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d) = 0;
|
||||
|
||||
//! Get the barycentre of Surface.
|
||||
//! An very poor estimation is sufficent.
|
||||
//! This information is usefull to perform well
|
||||
//! conditioned rational approximation.
|
||||
//! Warning: Used only if <me> IsRational
|
||||
Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const;
|
||||
|
||||
//! Returns the length of the greater section. This
|
||||
//! information is usefull to G1's control.
|
||||
//! Warning: With an little value, approximation can be slower.
|
||||
Standard_EXPORT virtual Standard_Real MaximalSection() const;
|
||||
|
||||
//! Compute the minimal value of weight for each poles
|
||||
//! in all sections.
|
||||
//! This information is usefull to control error
|
||||
//! in rational approximation.
|
||||
//! Warning: Used only if <me> IsRational
|
||||
Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Approx_SweepFunction,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_SweepFunction_HeaderFile
|
@@ -1,5 +1,34 @@
|
||||
Approx_SequenceOfHArray1OfReal.hxx
|
||||
Approx_Array1OfAdHSurface.hxx
|
||||
Approx_HArray1OfAdHSurface.hxx
|
||||
Approx_Array1OfGTrsf2d.hxx
|
||||
Approx_BSplComputeLine.gxx
|
||||
Approx_ComputeCLine.gxx
|
||||
Approx_ComputeLine.gxx
|
||||
Approx_Curve2d.cxx
|
||||
Approx_Curve2d.hxx
|
||||
Approx_Curve3d.cxx
|
||||
Approx_Curve3d.hxx
|
||||
Approx_CurveOnSurface.cxx
|
||||
Approx_CurveOnSurface.hxx
|
||||
Approx_CurvilinearParameter.cxx
|
||||
Approx_CurvilinearParameter.hxx
|
||||
Approx_CurvlinFunc.cxx
|
||||
Approx_CurvlinFunc.hxx
|
||||
Approx_FitAndDivide.hxx
|
||||
Approx_FitAndDivide2d.hxx
|
||||
Approx_FitAndDivide2d_0.cxx
|
||||
Approx_FitAndDivide_0.cxx
|
||||
Approx_HArray1OfAdHSurface.hxx
|
||||
Approx_HArray1OfGTrsf2d.hxx
|
||||
Approx_MCurvesToBSpCurve.cxx
|
||||
Approx_MCurvesToBSpCurve.hxx
|
||||
Approx_ParametrizationType.hxx
|
||||
Approx_SameParameter.cxx
|
||||
Approx_SameParameter.hxx
|
||||
Approx_SameParameter.lxx
|
||||
Approx_SequenceOfHArray1OfReal.hxx
|
||||
Approx_Status.hxx
|
||||
Approx_SweepApproximation.cxx
|
||||
Approx_SweepApproximation.hxx
|
||||
Approx_SweepApproximation.lxx
|
||||
Approx_SweepFunction.cxx
|
||||
Approx_SweepFunction.hxx
|
||||
|
Reference in New Issue
Block a user