mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +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,274 +0,0 @@
|
||||
-- Created on: 1991-02-26
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1991-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 Extrema
|
||||
---Purpose: This package calculates the distances between
|
||||
-- points, curves and surfaces.
|
||||
-- In general case, the algorithm to find the
|
||||
-- distances is a minimization algorithm of a function
|
||||
-- of variables: F(X). It is stopped when:
|
||||
-- for X1=X+Dx, F(X) and F(X1) are the same.
|
||||
-- The value of Dx can be calculated for all the
|
||||
-- algorithms.
|
||||
|
||||
---Level : Public.
|
||||
-- All methods of all classes will be public.
|
||||
|
||||
|
||||
uses
|
||||
gp,
|
||||
math,
|
||||
TColStd,
|
||||
TColgp,
|
||||
StdFail,
|
||||
Standard,
|
||||
TCollection,
|
||||
GeomAbs,
|
||||
Adaptor3d,
|
||||
Adaptor2d,
|
||||
Geom,
|
||||
Geom2d,
|
||||
Bnd
|
||||
|
||||
is
|
||||
|
||||
enumeration ExtFlag is ExtFlag_MIN, ExtFlag_MAX, ExtFlag_MINMAX;
|
||||
|
||||
enumeration ExtAlgo is ExtAlgo_Grad, ExtAlgo_Tree;
|
||||
|
||||
enumeration ElementType is Node, UIsoEdge, VIsoEdge, Face;
|
||||
|
||||
class CurveTool;
|
||||
class Curve2dTool;
|
||||
|
||||
generic class Point;
|
||||
class POnSurf;
|
||||
class POnSurfParams;
|
||||
|
||||
-----------------------------------
|
||||
-- Treatement of elementary curves
|
||||
-- and surfaces extremas:
|
||||
-----------------------------------
|
||||
class ExtPElC;
|
||||
class ExtPElC2d;
|
||||
class ExtPElS;
|
||||
class ExtPExtS;
|
||||
class ExtPRevS;
|
||||
class ExtElC;
|
||||
class ExtElC2d;
|
||||
|
||||
class ExtElCS;
|
||||
class ExtElSS;
|
||||
|
||||
-----------------------------------------------
|
||||
-- generic classes for POINT-CURVE extremas:
|
||||
-----------------------------------------------
|
||||
private generic class FuncExtPC, SeqPC;
|
||||
generic class GenExtPC, PCF;
|
||||
generic class GenLocateExtPC, PCLocF;
|
||||
|
||||
-------------------------------------------------
|
||||
-- classes for POINT-SURFACE extremas:
|
||||
-------------------------------------------------
|
||||
private class FuncExtPS;
|
||||
class GenExtPS;
|
||||
class GenLocateExtPS;
|
||||
imported HUBTreeOfSphere;
|
||||
|
||||
----------------------------------------------
|
||||
-- generic classes for CURVE-CURVE extremas:
|
||||
----------------------------------------------
|
||||
private generic class FuncExtCC, SeqPOnC;
|
||||
generic class GenExtCC;
|
||||
generic class GenLocateExtCC, CCLocF;
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
-- classes for CURVE-SURFACE extremas:
|
||||
----------------------------------------------
|
||||
private class FuncExtCS;
|
||||
class GenExtCS;
|
||||
class GenLocateExtCS;
|
||||
|
||||
----------------------------------------------
|
||||
-- classes for SURFACE-SURFACE extremas:
|
||||
----------------------------------------------
|
||||
private class FuncExtSS;
|
||||
class GenExtSS;
|
||||
class GenLocateExtSS;
|
||||
|
||||
--------------------------------------------------
|
||||
-- the following classes switches the curve or
|
||||
-- surface types for approximate elementary curves.
|
||||
-- the tools are the tools from Adaptor3d.
|
||||
--------------------------------------------------
|
||||
-- Point-Curve:
|
||||
generic class GExtPC, EPC;
|
||||
generic class GLocateExtPC, ELPC, LocEPC;
|
||||
|
||||
-- Point-Surface:
|
||||
class ExtPS;
|
||||
|
||||
-- Curve-Curve:
|
||||
-- 3d:
|
||||
class ExtCC;
|
||||
|
||||
class ECC instantiates GenExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
HArray1OfPnt from TColgp,
|
||||
POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp);
|
||||
|
||||
class LocateExtCC;
|
||||
|
||||
class LocECC instantiates GenLocateExtCC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp);
|
||||
|
||||
-- 2d:
|
||||
class ExtCC2d;
|
||||
|
||||
class ECC2d instantiates GenExtCC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp);
|
||||
|
||||
class LocateExtCC2d;
|
||||
|
||||
class LocECC2d instantiates GenLocateExtCC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
POnCurv2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp);
|
||||
|
||||
-- Curve-Surface:
|
||||
class ExtCS;
|
||||
|
||||
-- Surface-Surface:
|
||||
class ExtSS;
|
||||
|
||||
|
||||
-----------------------------------------------
|
||||
-- the following class is used to locate
|
||||
-- a first evaluation of the possible extremas.
|
||||
-----------------------------------------------
|
||||
generic class CurveLocator;
|
||||
|
||||
|
||||
--------------------------------------
|
||||
--- instantiations of generic classes:
|
||||
--------------------------------------
|
||||
class POnCurv instantiates Point from Extrema(Pnt from gp);
|
||||
class POnCurv2d instantiates Point from Extrema(Pnt2d from gp);
|
||||
|
||||
imported Array1OfPOnCurv;
|
||||
|
||||
imported Array2OfPOnCurv;
|
||||
|
||||
imported Array1OfPOnCurv2d;
|
||||
|
||||
imported Array2OfPOnCurv2d;
|
||||
|
||||
imported Array1OfPOnSurf;
|
||||
|
||||
imported Array2OfPOnSurf;
|
||||
|
||||
imported Array2OfPOnSurfParams;
|
||||
|
||||
|
||||
imported transient class HArray1OfPOnCurv;
|
||||
|
||||
imported transient class HArray2OfPOnCurv;
|
||||
|
||||
imported transient class HArray1OfPOnCurv2d;
|
||||
|
||||
imported transient class HArray2OfPOnCurv2d;
|
||||
|
||||
|
||||
imported transient class HArray1OfPOnSurf;
|
||||
|
||||
imported transient class HArray2OfPOnSurf;
|
||||
|
||||
imported transient class HArray2OfPOnSurfParams;
|
||||
|
||||
|
||||
imported SequenceOfPOnCurv;
|
||||
|
||||
imported SequenceOfPOnCurv2d;
|
||||
|
||||
imported SequenceOfPOnSurf;
|
||||
|
||||
|
||||
|
||||
--- 3d instantiations:
|
||||
class ExtPC instantiates GExtPC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
ExtPElC from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
POnCurv from Extrema,
|
||||
SequenceOfPOnCurv from Extrema);
|
||||
|
||||
|
||||
class LocateExtPC instantiates GLocateExtPC from Extrema
|
||||
(Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
ExtPElC from Extrema,
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
POnCurv from Extrema,
|
||||
SequenceOfPOnCurv from Extrema);
|
||||
|
||||
--- 2d instantiations:
|
||||
class ExtPC2d instantiates GExtPC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
ExtPElC2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp,
|
||||
POnCurv2d from Extrema,
|
||||
SequenceOfPOnCurv2d from Extrema);
|
||||
|
||||
|
||||
class LocateExtPC2d instantiates GLocateExtPC from Extrema
|
||||
(Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
ExtPElC2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp,
|
||||
POnCurv2d from Extrema,
|
||||
SequenceOfPOnCurv2d from Extrema);
|
||||
|
||||
|
||||
end Extrema;
|
178
src/Extrema/Extrema_CCLocFOfLocECC.hxx
Normal file
178
src/Extrema/Extrema_CCLocFOfLocECC.hxx
Normal file
@@ -0,0 +1,178 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_CCLocFOfLocECC_HeaderFile
|
||||
#define _Extrema_CCLocFOfLocECC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Extrema_SeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_FunctionSetWithDerivatives.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_POnCurv;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class Extrema_SeqPOnCOfCCLocFOfLocECC;
|
||||
class Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC;
|
||||
class math_Matrix;
|
||||
|
||||
|
||||
|
||||
class Extrema_CCLocFOfLocECC : public math_FunctionSetWithDerivatives
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_CCLocFOfLocECC(const Standard_Real thetol = 1.0e-10);
|
||||
|
||||
Standard_EXPORT Extrema_CCLocFOfLocECC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real thetol = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C1);
|
||||
|
||||
void SetTolerance (const Standard_Real theTol);
|
||||
|
||||
virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer NbEquations() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF);
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
|
||||
|
||||
Standard_Integer NbExt() const;
|
||||
|
||||
Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const;
|
||||
|
||||
Standard_Address CurvePtr (const Standard_Integer theRank) const;
|
||||
|
||||
Standard_Real Tolerance() const;
|
||||
|
||||
Standard_EXPORT void SubIntervalInitialize (const math_Vector& theUfirst, const math_Vector& theUlast);
|
||||
|
||||
Standard_EXPORT Standard_Real SearchOfTolerance (const Standard_Address C);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address myC1;
|
||||
Standard_Address myC2;
|
||||
Standard_Real myTol;
|
||||
Standard_Real myU;
|
||||
Standard_Real myV;
|
||||
gp_Pnt myP1;
|
||||
gp_Pnt myP2;
|
||||
gp_Vec myDu;
|
||||
gp_Vec myDv;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Extrema_SeqPOnCOfCCLocFOfLocECC myPoints;
|
||||
Standard_Real myTolC1;
|
||||
Standard_Real myTolC2;
|
||||
Standard_Integer myMaxDerivOrderC1;
|
||||
Standard_Integer myMaxDerivOrderC2;
|
||||
Standard_Real myUinfium;
|
||||
Standard_Real myUsupremum;
|
||||
Standard_Real myVinfium;
|
||||
Standard_Real myVsupremum;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define Curve1 Adaptor3d_Curve
|
||||
#define Curve1_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool1 Extrema_CurveTool
|
||||
#define Tool1_hxx <Extrema_CurveTool.hxx>
|
||||
#define Curve2 Adaptor3d_Curve
|
||||
#define Curve2_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool2 Extrema_CurveTool
|
||||
#define Tool2_hxx <Extrema_CurveTool.hxx>
|
||||
#define POnC Extrema_POnCurv
|
||||
#define POnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define Pnt gp_Pnt
|
||||
#define Pnt_hxx <gp_Pnt.hxx>
|
||||
#define Vec gp_Vec
|
||||
#define Vec_hxx <gp_Vec.hxx>
|
||||
#define Extrema_SeqPOnC Extrema_SeqPOnCOfCCLocFOfLocECC
|
||||
#define Extrema_SeqPOnC_hxx <Extrema_SeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC)
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC)
|
||||
#define Extrema_FuncExtCC Extrema_CCLocFOfLocECC
|
||||
#define Extrema_FuncExtCC_hxx <Extrema_CCLocFOfLocECC.hxx>
|
||||
|
||||
#include <Extrema_FuncExtCC.lxx>
|
||||
|
||||
#undef Curve1
|
||||
#undef Curve1_hxx
|
||||
#undef Tool1
|
||||
#undef Tool1_hxx
|
||||
#undef Curve2
|
||||
#undef Curve2_hxx
|
||||
#undef Tool2
|
||||
#undef Tool2_hxx
|
||||
#undef POnC
|
||||
#undef POnC_hxx
|
||||
#undef Pnt
|
||||
#undef Pnt_hxx
|
||||
#undef Vec
|
||||
#undef Vec_hxx
|
||||
#undef Extrema_SeqPOnC
|
||||
#undef Extrema_SeqPOnC_hxx
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC_hxx
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC_hxx
|
||||
#undef Handle_Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Handle_Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Extrema_FuncExtCC
|
||||
#undef Extrema_FuncExtCC_hxx
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_CCLocFOfLocECC_HeaderFile
|
178
src/Extrema/Extrema_CCLocFOfLocECC2d.hxx
Normal file
178
src/Extrema/Extrema_CCLocFOfLocECC2d.hxx
Normal file
@@ -0,0 +1,178 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_CCLocFOfLocECC2d_HeaderFile
|
||||
#define _Extrema_CCLocFOfLocECC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_FunctionSetWithDerivatives.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_POnCurv2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Extrema_SeqPOnCOfCCLocFOfLocECC2d;
|
||||
class Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d;
|
||||
class math_Matrix;
|
||||
|
||||
|
||||
|
||||
class Extrema_CCLocFOfLocECC2d : public math_FunctionSetWithDerivatives
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_CCLocFOfLocECC2d(const Standard_Real thetol = 1.0e-10);
|
||||
|
||||
Standard_EXPORT Extrema_CCLocFOfLocECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real thetol = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor2d_Curve2d& C1);
|
||||
|
||||
void SetTolerance (const Standard_Real theTol);
|
||||
|
||||
virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer NbEquations() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF);
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
|
||||
|
||||
Standard_Integer NbExt() const;
|
||||
|
||||
Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
|
||||
|
||||
Standard_Address CurvePtr (const Standard_Integer theRank) const;
|
||||
|
||||
Standard_Real Tolerance() const;
|
||||
|
||||
Standard_EXPORT void SubIntervalInitialize (const math_Vector& theUfirst, const math_Vector& theUlast);
|
||||
|
||||
Standard_EXPORT Standard_Real SearchOfTolerance (const Standard_Address C);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address myC1;
|
||||
Standard_Address myC2;
|
||||
Standard_Real myTol;
|
||||
Standard_Real myU;
|
||||
Standard_Real myV;
|
||||
gp_Pnt2d myP1;
|
||||
gp_Pnt2d myP2;
|
||||
gp_Vec2d myDu;
|
||||
gp_Vec2d myDv;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Extrema_SeqPOnCOfCCLocFOfLocECC2d myPoints;
|
||||
Standard_Real myTolC1;
|
||||
Standard_Real myTolC2;
|
||||
Standard_Integer myMaxDerivOrderC1;
|
||||
Standard_Integer myMaxDerivOrderC2;
|
||||
Standard_Real myUinfium;
|
||||
Standard_Real myUsupremum;
|
||||
Standard_Real myVinfium;
|
||||
Standard_Real myVsupremum;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define Curve1 Adaptor2d_Curve2d
|
||||
#define Curve1_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool1 Extrema_Curve2dTool
|
||||
#define Tool1_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define Curve2 Adaptor2d_Curve2d
|
||||
#define Curve2_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool2 Extrema_Curve2dTool
|
||||
#define Tool2_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define POnC Extrema_POnCurv2d
|
||||
#define POnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define Pnt gp_Pnt2d
|
||||
#define Pnt_hxx <gp_Pnt2d.hxx>
|
||||
#define Vec gp_Vec2d
|
||||
#define Vec_hxx <gp_Vec2d.hxx>
|
||||
#define Extrema_SeqPOnC Extrema_SeqPOnCOfCCLocFOfLocECC2d
|
||||
#define Extrema_SeqPOnC_hxx <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
|
||||
#define Extrema_FuncExtCC Extrema_CCLocFOfLocECC2d
|
||||
#define Extrema_FuncExtCC_hxx <Extrema_CCLocFOfLocECC2d.hxx>
|
||||
|
||||
#include <Extrema_FuncExtCC.lxx>
|
||||
|
||||
#undef Curve1
|
||||
#undef Curve1_hxx
|
||||
#undef Tool1
|
||||
#undef Tool1_hxx
|
||||
#undef Curve2
|
||||
#undef Curve2_hxx
|
||||
#undef Tool2
|
||||
#undef Tool2_hxx
|
||||
#undef POnC
|
||||
#undef POnC_hxx
|
||||
#undef Pnt
|
||||
#undef Pnt_hxx
|
||||
#undef Vec
|
||||
#undef Vec_hxx
|
||||
#undef Extrema_SeqPOnC
|
||||
#undef Extrema_SeqPOnC_hxx
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC_hxx
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Extrema_SequenceNodeOfSeqPOnC_hxx
|
||||
#undef Handle_Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Handle_Extrema_SequenceNodeOfSeqPOnC
|
||||
#undef Extrema_FuncExtCC
|
||||
#undef Extrema_FuncExtCC_hxx
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_CCLocFOfLocECC2d_HeaderFile
|
55
src/Extrema/Extrema_CCLocFOfLocECC2d_0.cxx
Normal file
55
src/Extrema/Extrema_CCLocFOfLocECC2d_0.cxx
Normal file
@@ -0,0 +1,55 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_CCLocFOfLocECC2d.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#include <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
|
||||
|
||||
#define Curve1 Adaptor2d_Curve2d
|
||||
#define Curve1_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool1 Extrema_Curve2dTool
|
||||
#define Tool1_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define Curve2 Adaptor2d_Curve2d
|
||||
#define Curve2_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool2 Extrema_Curve2dTool
|
||||
#define Tool2_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define POnC Extrema_POnCurv2d
|
||||
#define POnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define Pnt gp_Pnt2d
|
||||
#define Pnt_hxx <gp_Pnt2d.hxx>
|
||||
#define Vec gp_Vec2d
|
||||
#define Vec_hxx <gp_Vec2d.hxx>
|
||||
#define Extrema_SeqPOnC Extrema_SeqPOnCOfCCLocFOfLocECC2d
|
||||
#define Extrema_SeqPOnC_hxx <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
|
||||
#define Extrema_FuncExtCC Extrema_CCLocFOfLocECC2d
|
||||
#define Extrema_FuncExtCC_hxx <Extrema_CCLocFOfLocECC2d.hxx>
|
||||
#include <Extrema_FuncExtCC.gxx>
|
||||
|
55
src/Extrema/Extrema_CCLocFOfLocECC_0.cxx
Normal file
55
src/Extrema/Extrema_CCLocFOfLocECC_0.cxx
Normal file
@@ -0,0 +1,55 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_CCLocFOfLocECC.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Extrema_SeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#include <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
|
||||
|
||||
#define Curve1 Adaptor3d_Curve
|
||||
#define Curve1_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool1 Extrema_CurveTool
|
||||
#define Tool1_hxx <Extrema_CurveTool.hxx>
|
||||
#define Curve2 Adaptor3d_Curve
|
||||
#define Curve2_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool2 Extrema_CurveTool
|
||||
#define Tool2_hxx <Extrema_CurveTool.hxx>
|
||||
#define POnC Extrema_POnCurv
|
||||
#define POnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define Pnt gp_Pnt
|
||||
#define Pnt_hxx <gp_Pnt.hxx>
|
||||
#define Vec gp_Vec
|
||||
#define Vec_hxx <gp_Vec.hxx>
|
||||
#define Extrema_SeqPOnC Extrema_SeqPOnCOfCCLocFOfLocECC
|
||||
#define Extrema_SeqPOnC_hxx <Extrema_SeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC
|
||||
#define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC.hxx>
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC)
|
||||
#define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC)
|
||||
#define Extrema_FuncExtCC Extrema_CCLocFOfLocECC
|
||||
#define Extrema_FuncExtCC_hxx <Extrema_CCLocFOfLocECC.hxx>
|
||||
#include <Extrema_FuncExtCC.gxx>
|
||||
|
@@ -1,172 +0,0 @@
|
||||
-- Created on: 1995-07-18
|
||||
-- Created by: Modelistation
|
||||
-- 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 Curve2dTool from Extrema
|
||||
|
||||
uses
|
||||
Curve2d from Adaptor2d,
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec2d from gp,
|
||||
Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Lin2d from gp,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
is
|
||||
|
||||
FirstParameter(myclass; C : Curve2d from Adaptor2d) returns Real
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
LastParameter(myclass; C : Curve2d from Adaptor2d) returns Real
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Continuity(myclass; C : Curve2d from Adaptor2d) returns Shape from GeomAbs
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
NbIntervals(myclass; C : Curve2d from Adaptor2d; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: If necessary, breaks the curve in intervals of
|
||||
-- continuity <S>. And returns the number of
|
||||
-- intervals.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Intervals(myclass; C : Curve2d from Adaptor2d;
|
||||
T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs);
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
---C++: inline
|
||||
|
||||
|
||||
IsClosed(myclass; C : Curve2d from Adaptor2d) returns Boolean
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
IsPeriodic(myclass; C : Curve2d from Adaptor2d) returns Boolean
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Period(myclass; C : Curve2d from Adaptor2d) returns Real
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Value(myclass; C : Curve2d from Adaptor2d; U : Real) returns Pnt2d from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
D0 (myclass; C : Curve2d from Adaptor2d; U : Real; P : out Pnt2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
D1 (myclass; C : Curve2d from Adaptor2d; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve with its
|
||||
-- first derivative.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
D2 (myclass; C : Curve2d from Adaptor2d; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first and second
|
||||
-- derivatives V1 and V2.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
D3 (myclass; C : Curve2d from Adaptor2d; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first, the second
|
||||
-- and the third derivative.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
DN (myclass; C : Curve2d from Adaptor2d; U : Real; N : Integer) returns Vec2d from gp
|
||||
--- Purpose :
|
||||
-- The returned vector gives the value of the derivative for the
|
||||
-- order of derivation N.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Resolution(myclass; C : Curve2d from Adaptor2d ; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
GetType(myclass; C : Curve2d from Adaptor2d) returns CurveType from GeomAbs
|
||||
---Purpose: Returns the type of the curve in the current
|
||||
-- interval : Line, Circle, Ellipse, Hyperbola,
|
||||
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
|
||||
Line(myclass; C : Curve2d from Adaptor2d) returns Lin2d from gp
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Circle(myclass; C : Curve2d from Adaptor2d) returns Circ2d from gp
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Ellipse(myclass; C : Curve2d from Adaptor2d) returns Elips2d from gp
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Hyperbola(myclass; C : Curve2d from Adaptor2d) returns Hypr2d from gp
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Parabola(myclass; C : Curve2d from Adaptor2d) returns Parab2d from gp
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Degree(myclass; C : Curve2d from Adaptor2d) returns Integer
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
IsRational(myclass; C : Curve2d from Adaptor2d) returns Boolean
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
NbPoles(myclass; C : Curve2d from Adaptor2d) returns Integer
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
NbKnots(myclass; C : Curve2d from Adaptor2d) returns Integer
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
Bezier(myclass; C : Curve2d from Adaptor2d) returns BezierCurve from Geom2d
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
BSpline(myclass; C : Curve2d from Adaptor2d) returns BSplineCurve from Geom2d
|
||||
---C++: inline
|
||||
;
|
||||
|
||||
|
||||
end Curve2dTool;
|
@@ -14,4 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_Curve2dTool.ixx>
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
153
src/Extrema/Extrema_Curve2dTool.hxx
Normal file
153
src/Extrema/Extrema_Curve2dTool.hxx
Normal file
@@ -0,0 +1,153 @@
|
||||
// Created on: 1995-07-18
|
||||
// Created by: Modelistation
|
||||
// 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 _Extrema_Curve2dTool_HeaderFile
|
||||
#define _Extrema_Curve2dTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
class Adaptor2d_Curve2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Geom2d_BezierCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
|
||||
|
||||
|
||||
class Extrema_Curve2dTool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
static Standard_Real FirstParameter (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Real LastParameter (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static GeomAbs_Shape Continuity (const Adaptor2d_Curve2d& C);
|
||||
|
||||
//! If necessary, breaks the curve in intervals of
|
||||
//! continuity <S>. And returns the number of
|
||||
//! intervals.
|
||||
static Standard_Integer NbIntervals (const Adaptor2d_Curve2d& C, const GeomAbs_Shape S);
|
||||
|
||||
//! Stores in <T> the parameters bounding the intervals
|
||||
//! of continuity <S>.
|
||||
static void Intervals (const Adaptor2d_Curve2d& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
|
||||
|
||||
static Standard_Boolean IsClosed (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Boolean IsPeriodic (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Real Period (const Adaptor2d_Curve2d& C);
|
||||
|
||||
//! Computes the point of parameter U on the curve.
|
||||
static gp_Pnt2d Value (const Adaptor2d_Curve2d& C, const Standard_Real U);
|
||||
|
||||
//! Computes the point of parameter U on the curve.
|
||||
static void D0 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P);
|
||||
|
||||
//! Computes the point of parameter U on the curve with its
|
||||
//! first derivative.
|
||||
static void D1 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V);
|
||||
|
||||
|
||||
//! Returns the point P of parameter U, the first and second
|
||||
//! derivatives V1 and V2.
|
||||
static void D2 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
|
||||
|
||||
|
||||
//! Returns the point P of parameter U, the first, the second
|
||||
//! and the third derivative.
|
||||
static void D3 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
|
||||
|
||||
|
||||
//! The returned vector gives the value of the derivative for the
|
||||
//! order of derivation N.
|
||||
static gp_Vec2d DN (const Adaptor2d_Curve2d& C, const Standard_Real U, const Standard_Integer N);
|
||||
|
||||
//! Returns the parametric resolution corresponding
|
||||
//! to the real space resolution <R3d>.
|
||||
static Standard_Real Resolution (const Adaptor2d_Curve2d& C, const Standard_Real R3d);
|
||||
|
||||
//! Returns the type of the curve in the current
|
||||
//! interval : Line, Circle, Ellipse, Hyperbola,
|
||||
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
static GeomAbs_CurveType GetType (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static gp_Lin2d Line (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static gp_Circ2d Circle (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static gp_Elips2d Ellipse (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static gp_Hypr2d Hyperbola (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static gp_Parab2d Parabola (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Integer Degree (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Boolean IsRational (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Integer NbPoles (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Standard_Integer NbKnots (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Handle(Geom2d_BezierCurve) Bezier (const Adaptor2d_Curve2d& C);
|
||||
|
||||
static Handle(Geom2d_BSplineCurve) BSpline (const Adaptor2d_Curve2d& C);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Extrema_Curve2dTool.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_Curve2dTool_HeaderFile
|
@@ -1,48 +0,0 @@
|
||||
-- Created on: 1992-07-21
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1992-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 CurveLocator from Extrema
|
||||
(Curve1 as any;
|
||||
Tool1 as any; -- as ToolCurve(Curve1)
|
||||
Curve2 as any;
|
||||
Tool2 as any; -- as ToolCurve(Curve2)
|
||||
POnC as any;
|
||||
Pnt as any)
|
||||
|
||||
|
||||
is
|
||||
|
||||
Locate (myclass; P: Pnt; C: Curve1; NbU: Integer; Papp: out POnC);
|
||||
---Purpose: Among a set of points {C(ui),i=1,NbU}, locate the point
|
||||
-- P=C(uj) such that:
|
||||
-- distance(P,C) = Min{distance(P,C(ui))}
|
||||
|
||||
|
||||
Locate (myclass; P: Pnt; C: Curve1; NbU: Integer; Umin, Usup: Real;Papp: out POnC);
|
||||
---Purpose: Among a set of points {C(ui),i=1,NbU}, locate the point
|
||||
-- P=C(uj) such that:
|
||||
-- distance(P,C) = Min{distance(P,C(ui))}
|
||||
-- The research is done between umin and usup.
|
||||
|
||||
|
||||
Locate (myclass; C1: Curve1; C2: Curve2; NbU, NbV: Integer; Papp1, Papp2: out POnC);
|
||||
---Purpose: Among two sets of points {C1(ui),i=1,NbU} and
|
||||
-- {C2(vj),j=1,NbV}, locate the two points P1=C1(uk) and
|
||||
-- P2=C2(vl) such that:
|
||||
-- distance(P1,P2) = Min {distance(C1(ui),C2(vj))}.
|
||||
|
||||
|
||||
end CurveLocator;
|
@@ -1,144 +0,0 @@
|
||||
-- Created on: 1995-07-18
|
||||
-- Created by: Modelistation
|
||||
-- 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 CurveTool from Extrema
|
||||
|
||||
uses Pnt from gp,
|
||||
Vec from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
Lin from gp,
|
||||
Array1OfReal from TColStd,
|
||||
BezierCurve from Geom,
|
||||
BSplineCurve from Geom,
|
||||
CurveType from GeomAbs,
|
||||
Shape from GeomAbs,
|
||||
Curve from Adaptor3d
|
||||
|
||||
is
|
||||
|
||||
|
||||
FirstParameter(myclass; C : Curve from Adaptor3d)
|
||||
returns Real from Standard;
|
||||
---C++: inline
|
||||
|
||||
LastParameter(myclass; C : Curve from Adaptor3d)
|
||||
returns Real from Standard;
|
||||
---C++: inline
|
||||
|
||||
Continuity(myclass; C: Curve from Adaptor3d) returns Shape from GeomAbs;
|
||||
---C++: inline
|
||||
|
||||
NbIntervals(myclass; C: in out Curve from Adaptor3d; S : Shape from GeomAbs) returns Integer;
|
||||
---Purpose: Returns the number of intervals for continuity
|
||||
-- <S>. May be one if Continuity(me) >= <S>
|
||||
---C++: inline
|
||||
|
||||
|
||||
Intervals(myclass; C: in out Curve from Adaptor3d; 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()
|
||||
---C++: inline
|
||||
|
||||
IsPeriodic(myclass;C: Curve from Adaptor3d) returns Boolean;
|
||||
|
||||
Period(myclass; C: Curve from Adaptor3d) returns Real;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Resolution(myclass; C: Curve from Adaptor3d; R3d: Real) returns Real;
|
||||
---C++: inline
|
||||
|
||||
|
||||
GetType(myclass;C: Curve from Adaptor3d) returns CurveType from GeomAbs;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Value(myclass; C : Curve from Adaptor3d;
|
||||
U : Real from Standard)
|
||||
returns Pnt from gp;
|
||||
---C++: inline
|
||||
|
||||
D0 (myclass; C : Curve from Adaptor3d;
|
||||
U : Real from Standard;
|
||||
P : out Pnt from gp);
|
||||
---C++: inline
|
||||
|
||||
D1 (myclass; C : Curve from Adaptor3d;
|
||||
U : Real from Standard;
|
||||
P : out Pnt from gp;
|
||||
V : out Vec from gp);
|
||||
---C++: inline
|
||||
|
||||
D2 (myclass; C : Curve from Adaptor3d;
|
||||
U : Real from Standard;
|
||||
P : out Pnt from gp;
|
||||
V1, V2 : out Vec from gp);
|
||||
---C++: inline
|
||||
|
||||
D3 (myclass; C : Curve from Adaptor3d;
|
||||
U : Real from Standard;
|
||||
P : out Pnt from gp;
|
||||
V1, V2, V3 : out Vec from gp);
|
||||
---C++: inline
|
||||
|
||||
DN (myclass; C : Curve from Adaptor3d;
|
||||
U : Real from Standard;
|
||||
N : Integer from Standard)
|
||||
returns Vec from gp;
|
||||
---C++: inline
|
||||
|
||||
Line(myclass; C : Curve from Adaptor3d) returns Lin from gp;
|
||||
---C++: inline
|
||||
|
||||
Circle(myclass; C : Curve from Adaptor3d) returns Circ from gp;
|
||||
---C++: inline
|
||||
|
||||
Ellipse(myclass; C : Curve from Adaptor3d) returns Elips from gp;
|
||||
---C++: inline
|
||||
|
||||
Hyperbola(myclass; C : Curve from Adaptor3d) returns Hypr from gp;
|
||||
---C++: inline
|
||||
|
||||
Parabola(myclass; C : Curve from Adaptor3d) returns Parab from gp;
|
||||
---C++: inline
|
||||
|
||||
Degree(myclass; C : Curve from Adaptor3d) returns Integer;
|
||||
---C++: inline
|
||||
|
||||
IsRational(myclass; C : Curve from Adaptor3d) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
NbPoles(myclass; C : Curve from Adaptor3d) returns Integer;
|
||||
---C++: inline
|
||||
|
||||
NbKnots(myclass; C : Curve from Adaptor3d) returns Integer;
|
||||
---C++: inline
|
||||
|
||||
Bezier(myclass; C : Curve from Adaptor3d) returns BezierCurve from Geom;
|
||||
---C++: inline
|
||||
|
||||
BSpline(myclass; C : Curve from Adaptor3d) returns BSplineCurve from Geom;
|
||||
---C++: inline
|
||||
|
||||
|
||||
end CurveTool;
|
@@ -14,13 +14,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_CurveTool.ixx>
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Extrema_CurveTool::IsPeriodic(const Adaptor3d_Curve& C)
|
||||
{
|
||||
GeomAbs_CurveType aType = GetType(C);
|
||||
|
135
src/Extrema/Extrema_CurveTool.hxx
Normal file
135
src/Extrema/Extrema_CurveTool.hxx
Normal file
@@ -0,0 +1,135 @@
|
||||
// Created on: 1995-07-18
|
||||
// Created by: Modelistation
|
||||
// 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 _Extrema_CurveTool_HeaderFile
|
||||
#define _Extrema_CurveTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
class Adaptor3d_Curve;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class Geom_BezierCurve;
|
||||
class Geom_BSplineCurve;
|
||||
|
||||
|
||||
|
||||
class Extrema_CurveTool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
static Standard_Real FirstParameter (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Real LastParameter (const Adaptor3d_Curve& C);
|
||||
|
||||
static GeomAbs_Shape Continuity (const Adaptor3d_Curve& C);
|
||||
|
||||
//! Returns the number of intervals for continuity
|
||||
//! <S>. May be one if Continuity(me) >= <S>
|
||||
static Standard_Integer NbIntervals (Adaptor3d_Curve& C, const GeomAbs_Shape S);
|
||||
|
||||
//! 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()
|
||||
static void Intervals (Adaptor3d_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsPeriodic (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Real Period (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Real Resolution (const Adaptor3d_Curve& C, const Standard_Real R3d);
|
||||
|
||||
static GeomAbs_CurveType GetType (const Adaptor3d_Curve& C);
|
||||
|
||||
static gp_Pnt Value (const Adaptor3d_Curve& C, const Standard_Real U);
|
||||
|
||||
static void D0 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P);
|
||||
|
||||
static void D1 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
|
||||
|
||||
static void D2 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
|
||||
|
||||
static void D3 (const Adaptor3d_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
|
||||
|
||||
static gp_Vec DN (const Adaptor3d_Curve& C, const Standard_Real U, const Standard_Integer N);
|
||||
|
||||
static gp_Lin Line (const Adaptor3d_Curve& C);
|
||||
|
||||
static gp_Circ Circle (const Adaptor3d_Curve& C);
|
||||
|
||||
static gp_Elips Ellipse (const Adaptor3d_Curve& C);
|
||||
|
||||
static gp_Hypr Hyperbola (const Adaptor3d_Curve& C);
|
||||
|
||||
static gp_Parab Parabola (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Integer Degree (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Boolean IsRational (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Integer NbPoles (const Adaptor3d_Curve& C);
|
||||
|
||||
static Standard_Integer NbKnots (const Adaptor3d_Curve& C);
|
||||
|
||||
static Handle(Geom_BezierCurve) Bezier (const Adaptor3d_Curve& C);
|
||||
|
||||
static Handle(Geom_BSplineCurve) BSpline (const Adaptor3d_Curve& C);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Extrema_CurveTool.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_CurveTool_HeaderFile
|
102
src/Extrema/Extrema_ECC.hxx
Normal file
102
src/Extrema/Extrema_ECC.hxx
Normal file
@@ -0,0 +1,102 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ECC_HeaderFile
|
||||
#define _Extrema_ECC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_POnCurv;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
|
||||
|
||||
|
||||
class Extrema_ECC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ECC();
|
||||
|
||||
Standard_EXPORT Extrema_ECC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2);
|
||||
|
||||
Standard_EXPORT Extrema_ECC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
|
||||
|
||||
Standard_EXPORT void SetParams (const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
|
||||
|
||||
Standard_EXPORT void SetTolerance (const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myParallel;
|
||||
Standard_Real myCurveMinTol;
|
||||
math_Vector myLowBorder;
|
||||
math_Vector myUppBorder;
|
||||
TColStd_SequenceOfReal myPoints1;
|
||||
TColStd_SequenceOfReal myPoints2;
|
||||
Standard_Address myC[2];
|
||||
Standard_Boolean myDone;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ECC_HeaderFile
|
102
src/Extrema/Extrema_ECC2d.hxx
Normal file
102
src/Extrema/Extrema_ECC2d.hxx
Normal file
@@ -0,0 +1,102 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ECC2d_HeaderFile
|
||||
#define _Extrema_ECC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_POnCurv2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
|
||||
|
||||
|
||||
class Extrema_ECC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ECC2d();
|
||||
|
||||
Standard_EXPORT Extrema_ECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2);
|
||||
|
||||
Standard_EXPORT Extrema_ECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
|
||||
|
||||
Standard_EXPORT void SetParams (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
|
||||
|
||||
Standard_EXPORT void SetTolerance (const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myParallel;
|
||||
Standard_Real myCurveMinTol;
|
||||
math_Vector myLowBorder;
|
||||
math_Vector myUppBorder;
|
||||
TColStd_SequenceOfReal myPoints1;
|
||||
TColStd_SequenceOfReal myPoints2;
|
||||
Standard_Address myC[2];
|
||||
Standard_Boolean myDone;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ECC2d_HeaderFile
|
49
src/Extrema/Extrema_ECC2d_0.cxx
Normal file
49
src/Extrema/Extrema_ECC2d_0.cxx
Normal file
@@ -0,0 +1,49 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_ECC2d.hxx>
|
||||
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
|
||||
#define Curve1 Adaptor2d_Curve2d
|
||||
#define Curve1_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool1 Extrema_Curve2dTool
|
||||
#define Tool1_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define Curve2 Adaptor2d_Curve2d
|
||||
#define Curve2_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool2 Extrema_Curve2dTool
|
||||
#define Tool2_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define Handle_ArrayOfPnt Handle(TColgp_HArray1OfPnt2d)
|
||||
#define ArrayOfPnt TColgp_HArray1OfPnt2d
|
||||
#define ArrayOfPnt_hxx <TColgp_HArray1OfPnt2d.hxx>
|
||||
#define POnC Extrema_POnCurv2d
|
||||
#define POnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define Pnt gp_Pnt2d
|
||||
#define Pnt_hxx <gp_Pnt2d.hxx>
|
||||
#define Vec gp_Vec2d
|
||||
#define Vec_hxx <gp_Vec2d.hxx>
|
||||
#define Extrema_GenExtCC Extrema_ECC2d
|
||||
#define Extrema_GenExtCC_hxx <Extrema_ECC2d.hxx>
|
||||
#include <Extrema_GenExtCC.gxx>
|
||||
|
49
src/Extrema/Extrema_ECC_0.cxx
Normal file
49
src/Extrema/Extrema_ECC_0.cxx
Normal file
@@ -0,0 +1,49 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_ECC.hxx>
|
||||
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
|
||||
#define Curve1 Adaptor3d_Curve
|
||||
#define Curve1_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool1 Extrema_CurveTool
|
||||
#define Tool1_hxx <Extrema_CurveTool.hxx>
|
||||
#define Curve2 Adaptor3d_Curve
|
||||
#define Curve2_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool2 Extrema_CurveTool
|
||||
#define Tool2_hxx <Extrema_CurveTool.hxx>
|
||||
#define Handle_ArrayOfPnt Handle(TColgp_HArray1OfPnt)
|
||||
#define ArrayOfPnt TColgp_HArray1OfPnt
|
||||
#define ArrayOfPnt_hxx <TColgp_HArray1OfPnt.hxx>
|
||||
#define POnC Extrema_POnCurv
|
||||
#define POnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define Pnt gp_Pnt
|
||||
#define Pnt_hxx <gp_Pnt.hxx>
|
||||
#define Vec gp_Vec
|
||||
#define Vec_hxx <gp_Vec.hxx>
|
||||
#define Extrema_GenExtCC Extrema_ECC
|
||||
#define Extrema_GenExtCC_hxx <Extrema_ECC.hxx>
|
||||
#include <Extrema_GenExtCC.gxx>
|
||||
|
122
src/Extrema/Extrema_ELPCOfLocateExtPC.hxx
Normal file
122
src/Extrema/Extrema_ELPCOfLocateExtPC.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ELPCOfLocateExtPC_HeaderFile
|
||||
#define _Extrema_ELPCOfLocateExtPC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Address.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_EPCOfELPCOfLocateExtPC.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <TColStd_SequenceOfBoolean.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_ExtPElC;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class Extrema_POnCurv;
|
||||
class Extrema_EPCOfELPCOfLocateExtPC;
|
||||
class Extrema_PCFOfEPCOfELPCOfLocateExtPC;
|
||||
|
||||
|
||||
|
||||
class Extrema_ELPCOfLocateExtPC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ELPCOfLocateExtPC();
|
||||
|
||||
Standard_EXPORT Extrema_ELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT Extrema_ELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt& P1, gp_Pnt& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void IntervalPerform (const gp_Pnt& P);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address myC;
|
||||
gp_Pnt Pf;
|
||||
gp_Pnt Pl;
|
||||
Extrema_ExtPElC myExtPElC;
|
||||
Extrema_SequenceOfPOnCurv mypoint;
|
||||
Standard_Boolean mydone;
|
||||
Standard_Real mydist1;
|
||||
Standard_Real mydist2;
|
||||
Extrema_EPCOfELPCOfLocateExtPC myExtPC;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolf;
|
||||
Standard_Integer mysample;
|
||||
Standard_Real myintuinf;
|
||||
Standard_Real myintusup;
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
GeomAbs_CurveType type;
|
||||
TColStd_SequenceOfBoolean myismin;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ELPCOfLocateExtPC_HeaderFile
|
122
src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx
Normal file
122
src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ELPCOfLocateExtPC2d_HeaderFile
|
||||
#define _Extrema_ELPCOfLocateExtPC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Address.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_EPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <TColStd_SequenceOfBoolean.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_ExtPElC2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Extrema_POnCurv2d;
|
||||
class Extrema_EPCOfELPCOfLocateExtPC2d;
|
||||
class Extrema_PCFOfEPCOfELPCOfLocateExtPC2d;
|
||||
|
||||
|
||||
|
||||
class Extrema_ELPCOfLocateExtPC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ELPCOfLocateExtPC2d();
|
||||
|
||||
Standard_EXPORT Extrema_ELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT Extrema_ELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt2d& P1, gp_Pnt2d& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void IntervalPerform (const gp_Pnt2d& P);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address myC;
|
||||
gp_Pnt2d Pf;
|
||||
gp_Pnt2d Pl;
|
||||
Extrema_ExtPElC2d myExtPElC;
|
||||
Extrema_SequenceOfPOnCurv2d mypoint;
|
||||
Standard_Boolean mydone;
|
||||
Standard_Real mydist1;
|
||||
Standard_Real mydist2;
|
||||
Extrema_EPCOfELPCOfLocateExtPC2d myExtPC;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolf;
|
||||
Standard_Integer mysample;
|
||||
Standard_Real myintuinf;
|
||||
Standard_Real myintusup;
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
GeomAbs_CurveType type;
|
||||
TColStd_SequenceOfBoolean myismin;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ELPCOfLocateExtPC2d_HeaderFile
|
55
src/Extrema/Extrema_ELPCOfLocateExtPC2d_0.cxx
Normal file
55
src/Extrema/Extrema_ELPCOfLocateExtPC2d_0.cxx
Normal file
@@ -0,0 +1,55 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_ELPCOfLocateExtPC2d.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <Extrema_EPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
|
||||
|
||||
#define TheCurve Adaptor2d_Curve2d
|
||||
#define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define TheCurveTool Extrema_Curve2dTool
|
||||
#define TheCurveTool_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define TheExtPElC Extrema_ExtPElC2d
|
||||
#define TheExtPElC_hxx <Extrema_ExtPElC2d.hxx>
|
||||
#define ThePoint gp_Pnt2d
|
||||
#define ThePoint_hxx <gp_Pnt2d.hxx>
|
||||
#define TheVector gp_Vec2d
|
||||
#define TheVector_hxx <gp_Vec2d.hxx>
|
||||
#define ThePOnC Extrema_POnCurv2d
|
||||
#define ThePOnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define TheSequenceOfPOnC Extrema_SequenceOfPOnCurv2d
|
||||
#define TheSequenceOfPOnC_hxx <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#define Extrema_EPC Extrema_EPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_EPC_hxx <Extrema_EPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#define Extrema_GExtPC Extrema_ELPCOfLocateExtPC2d
|
||||
#define Extrema_GExtPC_hxx <Extrema_ELPCOfLocateExtPC2d.hxx>
|
||||
#include <Extrema_GExtPC.gxx>
|
||||
|
55
src/Extrema/Extrema_ELPCOfLocateExtPC_0.cxx
Normal file
55
src/Extrema/Extrema_ELPCOfLocateExtPC_0.cxx
Normal file
@@ -0,0 +1,55 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_ELPCOfLocateExtPC.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_EPCOfELPCOfLocateExtPC.hxx>
|
||||
#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
|
||||
|
||||
#define TheCurve Adaptor3d_Curve
|
||||
#define TheCurve_hxx <Adaptor3d_Curve.hxx>
|
||||
#define TheCurveTool Extrema_CurveTool
|
||||
#define TheCurveTool_hxx <Extrema_CurveTool.hxx>
|
||||
#define TheExtPElC Extrema_ExtPElC
|
||||
#define TheExtPElC_hxx <Extrema_ExtPElC.hxx>
|
||||
#define ThePoint gp_Pnt
|
||||
#define ThePoint_hxx <gp_Pnt.hxx>
|
||||
#define TheVector gp_Vec
|
||||
#define TheVector_hxx <gp_Vec.hxx>
|
||||
#define ThePOnC Extrema_POnCurv
|
||||
#define ThePOnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define TheSequenceOfPOnC Extrema_SequenceOfPOnCurv
|
||||
#define TheSequenceOfPOnC_hxx <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#define Extrema_EPC Extrema_EPCOfELPCOfLocateExtPC
|
||||
#define Extrema_EPC_hxx <Extrema_EPCOfELPCOfLocateExtPC.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfELPCOfLocateExtPC
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfELPCOfLocateExtPC
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
#define Extrema_GExtPC Extrema_ELPCOfLocateExtPC
|
||||
#define Extrema_GExtPC_hxx <Extrema_ELPCOfLocateExtPC.hxx>
|
||||
#include <Extrema_GExtPC.gxx>
|
||||
|
105
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC.hxx
Normal file
105
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_EPCOfELPCOfLocateExtPC_HeaderFile
|
||||
#define _Extrema_EPCOfELPCOfLocateExtPC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_POnCurv;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class Extrema_PCFOfEPCOfELPCOfLocateExtPC;
|
||||
class Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC;
|
||||
|
||||
|
||||
|
||||
class Extrema_EPCOfELPCOfLocateExtPC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC();
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C);
|
||||
|
||||
Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Integer mynbsample;
|
||||
Standard_Real myumin;
|
||||
Standard_Real myusup;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolF;
|
||||
Extrema_PCFOfEPCOfELPCOfLocateExtPC myF;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_EPCOfELPCOfLocateExtPC_HeaderFile
|
105
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d.hxx
Normal file
105
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile
|
||||
#define _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_POnCurv2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Extrema_PCFOfEPCOfELPCOfLocateExtPC2d;
|
||||
class Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d;
|
||||
|
||||
|
||||
|
||||
class Extrema_EPCOfELPCOfLocateExtPC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d();
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C);
|
||||
|
||||
Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Integer mynbsample;
|
||||
Standard_Real myumin;
|
||||
Standard_Real myusup;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolF;
|
||||
Extrema_PCFOfEPCOfELPCOfLocateExtPC2d myF;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile
|
50
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d_0.cxx
Normal file
50
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d_0.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_EPCOfELPCOfLocateExtPC2d.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#include <Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
|
||||
|
||||
#define Curve Adaptor2d_Curve2d
|
||||
#define Curve_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool Extrema_Curve2dTool
|
||||
#define Tool_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define POnC Extrema_POnCurv2d
|
||||
#define POnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define Pnt gp_Pnt2d
|
||||
#define Pnt_hxx <gp_Pnt2d.hxx>
|
||||
#define Vec gp_Vec2d
|
||||
#define Vec_hxx <gp_Vec2d.hxx>
|
||||
#define Extrema_PCF Extrema_PCFOfEPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_PCF_hxx <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#define Extrema_GenExtPC Extrema_EPCOfELPCOfLocateExtPC2d
|
||||
#define Extrema_GenExtPC_hxx <Extrema_EPCOfELPCOfLocateExtPC2d.hxx>
|
||||
#include <Extrema_GenExtPC.gxx>
|
||||
|
50
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC_0.cxx
Normal file
50
src/Extrema/Extrema_EPCOfELPCOfLocateExtPC_0.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_EPCOfELPCOfLocateExtPC.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
#include <Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
|
||||
|
||||
#define Curve Adaptor3d_Curve
|
||||
#define Curve_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool Extrema_CurveTool
|
||||
#define Tool_hxx <Extrema_CurveTool.hxx>
|
||||
#define POnC Extrema_POnCurv
|
||||
#define POnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define Pnt gp_Pnt
|
||||
#define Pnt_hxx <gp_Pnt.hxx>
|
||||
#define Vec gp_Vec
|
||||
#define Vec_hxx <gp_Vec.hxx>
|
||||
#define Extrema_PCF Extrema_PCFOfEPCOfELPCOfLocateExtPC
|
||||
#define Extrema_PCF_hxx <Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC.hxx>
|
||||
#define Extrema_GenExtPC Extrema_EPCOfELPCOfLocateExtPC
|
||||
#define Extrema_GenExtPC_hxx <Extrema_EPCOfELPCOfLocateExtPC.hxx>
|
||||
#include <Extrema_GenExtPC.gxx>
|
||||
|
105
src/Extrema/Extrema_EPCOfExtPC.hxx
Normal file
105
src/Extrema/Extrema_EPCOfExtPC.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_EPCOfExtPC_HeaderFile
|
||||
#define _Extrema_EPCOfExtPC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_PCFOfEPCOfExtPC.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_POnCurv;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class Extrema_PCFOfEPCOfExtPC;
|
||||
class Extrema_SeqPCOfPCFOfEPCOfExtPC;
|
||||
|
||||
|
||||
|
||||
class Extrema_EPCOfExtPC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfExtPC();
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C);
|
||||
|
||||
Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Integer mynbsample;
|
||||
Standard_Real myumin;
|
||||
Standard_Real myusup;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolF;
|
||||
Extrema_PCFOfEPCOfExtPC myF;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_EPCOfExtPC_HeaderFile
|
105
src/Extrema/Extrema_EPCOfExtPC2d.hxx
Normal file
105
src/Extrema/Extrema_EPCOfExtPC2d.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_EPCOfExtPC2d_HeaderFile
|
||||
#define _Extrema_EPCOfExtPC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_PCFOfEPCOfExtPC2d.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_POnCurv2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Extrema_PCFOfEPCOfExtPC2d;
|
||||
class Extrema_SeqPCOfPCFOfEPCOfExtPC2d;
|
||||
|
||||
|
||||
|
||||
class Extrema_EPCOfExtPC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfExtPC2d();
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT Extrema_EPCOfExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C);
|
||||
|
||||
Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Integer mynbsample;
|
||||
Standard_Real myumin;
|
||||
Standard_Real myusup;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolF;
|
||||
Extrema_PCFOfEPCOfExtPC2d myF;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_EPCOfExtPC2d_HeaderFile
|
50
src/Extrema/Extrema_EPCOfExtPC2d_0.cxx
Normal file
50
src/Extrema/Extrema_EPCOfExtPC2d_0.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_EPCOfExtPC2d.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Extrema_PCFOfEPCOfExtPC2d.hxx>
|
||||
#include <Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx>
|
||||
|
||||
|
||||
#define Curve Adaptor2d_Curve2d
|
||||
#define Curve_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define Tool Extrema_Curve2dTool
|
||||
#define Tool_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define POnC Extrema_POnCurv2d
|
||||
#define POnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define Pnt gp_Pnt2d
|
||||
#define Pnt_hxx <gp_Pnt2d.hxx>
|
||||
#define Vec gp_Vec2d
|
||||
#define Vec_hxx <gp_Vec2d.hxx>
|
||||
#define Extrema_PCF Extrema_PCFOfEPCOfExtPC2d
|
||||
#define Extrema_PCF_hxx <Extrema_PCFOfEPCOfExtPC2d.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfExtPC2d
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfExtPC2d
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx>
|
||||
#define Extrema_GenExtPC Extrema_EPCOfExtPC2d
|
||||
#define Extrema_GenExtPC_hxx <Extrema_EPCOfExtPC2d.hxx>
|
||||
#include <Extrema_GenExtPC.gxx>
|
||||
|
50
src/Extrema/Extrema_EPCOfExtPC_0.cxx
Normal file
50
src/Extrema/Extrema_EPCOfExtPC_0.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_EPCOfExtPC.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Extrema_PCFOfEPCOfExtPC.hxx>
|
||||
#include <Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx>
|
||||
|
||||
|
||||
#define Curve Adaptor3d_Curve
|
||||
#define Curve_hxx <Adaptor3d_Curve.hxx>
|
||||
#define Tool Extrema_CurveTool
|
||||
#define Tool_hxx <Extrema_CurveTool.hxx>
|
||||
#define POnC Extrema_POnCurv
|
||||
#define POnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define Pnt gp_Pnt
|
||||
#define Pnt_hxx <gp_Pnt.hxx>
|
||||
#define Vec gp_Vec
|
||||
#define Vec_hxx <gp_Vec.hxx>
|
||||
#define Extrema_PCF Extrema_PCFOfEPCOfExtPC
|
||||
#define Extrema_PCF_hxx <Extrema_PCFOfEPCOfExtPC.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfExtPC
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx>
|
||||
#define Extrema_SeqPCOfPCF Extrema_SeqPCOfPCFOfEPCOfExtPC
|
||||
#define Extrema_SeqPCOfPCF_hxx <Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx>
|
||||
#define Extrema_GenExtPC Extrema_EPCOfExtPC
|
||||
#define Extrema_GenExtPC_hxx <Extrema_EPCOfExtPC.hxx>
|
||||
#include <Extrema_GenExtPC.gxx>
|
||||
|
29
src/Extrema/Extrema_ElementType.hxx
Normal file
29
src/Extrema/Extrema_ElementType.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ElementType_HeaderFile
|
||||
#define _Extrema_ElementType_HeaderFile
|
||||
|
||||
|
||||
enum Extrema_ElementType
|
||||
{
|
||||
Extrema_Node,
|
||||
Extrema_UIsoEdge,
|
||||
Extrema_VIsoEdge,
|
||||
Extrema_Face
|
||||
};
|
||||
|
||||
#endif // _Extrema_ElementType_HeaderFile
|
27
src/Extrema/Extrema_ExtAlgo.hxx
Normal file
27
src/Extrema/Extrema_ExtAlgo.hxx
Normal file
@@ -0,0 +1,27 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtAlgo_HeaderFile
|
||||
#define _Extrema_ExtAlgo_HeaderFile
|
||||
|
||||
|
||||
enum Extrema_ExtAlgo
|
||||
{
|
||||
Extrema_ExtAlgo_Grad,
|
||||
Extrema_ExtAlgo_Tree
|
||||
};
|
||||
|
||||
#endif // _Extrema_ExtAlgo_HeaderFile
|
@@ -1,161 +0,0 @@
|
||||
-- Created on: 1994-07-06
|
||||
-- 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 ExtCC from Extrema
|
||||
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses POnCurv from Extrema,
|
||||
SequenceOfPOnCurv from Extrema,
|
||||
ExtElC from Extrema,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp,
|
||||
SequenceOfReal from TColStd,
|
||||
ListOfTransient from TColStd,
|
||||
Curve from Adaptor3d,
|
||||
CurveTool from Extrema,
|
||||
ECC from Extrema
|
||||
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create (TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC;
|
||||
|
||||
|
||||
Create (C1: Curve from Adaptor3d; C2: Curve from Adaptor3d;
|
||||
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
Create (C1: Curve from Adaptor3d;
|
||||
C2: Curve from Adaptor3d;
|
||||
U1: Real from Standard;
|
||||
U2: Real from Standard;
|
||||
V1: Real from Standard;
|
||||
V2: Real from Standard;
|
||||
TolC1: Real = 1.0e-10;
|
||||
TolC2: Real = 1.0e-10) returns ExtCC;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
SetCurve (me: in out; theRank: Integer; C: Curve from Adaptor3d);
|
||||
---Purpose:
|
||||
|
||||
SetCurve (me: in out; theRank: Integer; C: Curve from Adaptor3d; Uinf, Usup: Real);
|
||||
---Purpose:
|
||||
|
||||
SetRange (me: in out; theRank: Integer; Uinf, Usup: Real);
|
||||
---Purpose:
|
||||
|
||||
SetTolerance (me: in out; theRank: Integer; Tol: Real);
|
||||
---Purpose:
|
||||
|
||||
Perform(me: in out);
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)= True.
|
||||
is static;
|
||||
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the two curves are parallel.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True and N > 1.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnCurv)
|
||||
---Purpose: Returns the points of the Nth extremum distance.
|
||||
-- P1 is on the first curve, P2 on the second one.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
TrimmedSquareDistances(me; dist11, distP12, distP21, distP22: out Real;
|
||||
P11, P12, P21, P22: out Pnt)
|
||||
---Purpose: if the curve is a trimmed curve,
|
||||
-- dist11 is a square distance between the point on C1
|
||||
-- of parameter FirstParameter and the point of
|
||||
-- parameter FirstParameter on C2.
|
||||
|
||||
is static;
|
||||
|
||||
Results(me: in out; AlgExt: ExtElC from Extrema;
|
||||
Ut11, Ut12, Ut21, Ut22: Real)
|
||||
|
||||
is static protected;
|
||||
|
||||
Results(me: in out;AlgExt: ECC from Extrema;
|
||||
Ut11, Ut12, Ut21, Ut22: Real)
|
||||
|
||||
is static protected;
|
||||
|
||||
|
||||
|
||||
|
||||
fields
|
||||
myECC: ECC from Extrema;
|
||||
myDone: Boolean;
|
||||
myIsPar: Boolean;
|
||||
mypoints: SequenceOfPOnCurv from Extrema;
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
mynbext: Integer;
|
||||
inverse: Boolean;
|
||||
myC: Address from Standard [2];
|
||||
myInf: Real [2];
|
||||
mySup: Real [2];
|
||||
myTol: Real [2];
|
||||
P1f: Pnt;
|
||||
P1l: Pnt;
|
||||
P2f: Pnt;
|
||||
P2l: Pnt;
|
||||
mydist11: Real;
|
||||
mydist12: Real;
|
||||
mydist21: Real;
|
||||
mydist22: Real;
|
||||
|
||||
|
||||
|
||||
end ExtCC;
|
@@ -19,38 +19,39 @@
|
||||
// tri des solutions pour eviter de rendre plusieurs
|
||||
// fois la meme solution
|
||||
|
||||
#include <Extrema_ExtCC.ixx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_ECC.hxx>
|
||||
#include <Extrema_ExtCC.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_ExtCC
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_ExtCC::Extrema_ExtCC (const Standard_Real TolC1,
|
||||
const Standard_Real TolC2) :
|
||||
myDone (Standard_False)
|
||||
|
137
src/Extrema/Extrema_ExtCC.hxx
Normal file
137
src/Extrema/Extrema_ExtCC.hxx
Normal file
@@ -0,0 +1,137 @@
|
||||
// Created on: 1994-07-06
|
||||
// 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 _Extrema_ExtCC_HeaderFile
|
||||
#define _Extrema_ExtCC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Extrema_ECC.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_POnCurv;
|
||||
class gp_Pnt;
|
||||
class Extrema_ExtElC;
|
||||
class Extrema_ECC;
|
||||
|
||||
|
||||
//! It calculates all the distance between two curves.
|
||||
//! These distances can be maximum or minimum.
|
||||
class Extrema_ExtCC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtCC(const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
//! It calculates all the distances.
|
||||
Standard_EXPORT Extrema_ExtCC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
//! It calculates all the distances.
|
||||
Standard_EXPORT Extrema_ExtCC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C);
|
||||
|
||||
Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void SetRange (const Standard_Integer theRank, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void SetTolerance (const Standard_Integer theRank, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns True if the two curves are parallel.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
//! Returns the points of the Nth extremum distance.
|
||||
//! P1 is on the first curve, P2 on the second one.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const;
|
||||
|
||||
//! if the curve is a trimmed curve,
|
||||
//! dist11 is a square distance between the point on C1
|
||||
//! of parameter FirstParameter and the point of
|
||||
//! parameter FirstParameter on C2.
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist11, Standard_Real& distP12, Standard_Real& distP21, Standard_Real& distP22, gp_Pnt& P11, gp_Pnt& P12, gp_Pnt& P21, gp_Pnt& P22) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void Results (const Extrema_ExtElC& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22);
|
||||
|
||||
Standard_EXPORT void Results (const Extrema_ECC& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Extrema_ECC myECC;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_SequenceOfPOnCurv mypoints;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Standard_Integer mynbext;
|
||||
Standard_Boolean inverse;
|
||||
Standard_Address myC[2];
|
||||
Standard_Real myInf[2];
|
||||
Standard_Real mySup[2];
|
||||
Standard_Real myTol[2];
|
||||
gp_Pnt P1f;
|
||||
gp_Pnt P1l;
|
||||
gp_Pnt P2f;
|
||||
gp_Pnt P2l;
|
||||
Standard_Real mydist11;
|
||||
Standard_Real mydist12;
|
||||
Standard_Real mydist21;
|
||||
Standard_Real mydist22;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtCC_HeaderFile
|
@@ -1,159 +0,0 @@
|
||||
-- Created on: 1994-07-06
|
||||
-- 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 ExtCC2d from Extrema
|
||||
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses POnCurv2d from Extrema,
|
||||
SequenceOfPOnCurv2d from Extrema,
|
||||
ExtElC2d from Extrema,
|
||||
Pnt2d from gp,
|
||||
HArray1OfPnt2d from TColgp,
|
||||
SequenceOfReal from TColStd,
|
||||
Curve2d from Adaptor2d,
|
||||
Curve2dTool from Extrema,
|
||||
ECC2d from Extrema
|
||||
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns ExtCC2d;
|
||||
|
||||
|
||||
Create (C1: Curve2d from Adaptor2d; C2: Curve2d from Adaptor2d;
|
||||
TolC1: Real = 1.0e-10; TolC2: Real = 1.0e-10) returns ExtCC2d;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
Create (C1: Curve2d from Adaptor2d;
|
||||
C2: Curve2d from Adaptor2d;
|
||||
U1: Real from Standard;
|
||||
U2: Real from Standard;
|
||||
V1: Real from Standard;
|
||||
V2: Real from Standard;
|
||||
TolC1: Real = 1.0e-10;
|
||||
TolC2: Real = 1.0e-10) returns ExtCC2d;
|
||||
---Purpose: It calculates all the distances.
|
||||
|
||||
|
||||
Initialize(me: in out; C2: Curve2d from Adaptor2d;
|
||||
V1, V2: Real from Standard;
|
||||
TolC1: Real = 1.0e-10;
|
||||
TolC2: Real = 1.0e-10)
|
||||
---Purpose: initializes the fields.
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; C1: Curve2d from Adaptor2d;
|
||||
U1, U2: Real from Standard)
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)= True.
|
||||
is static;
|
||||
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the two curves are parallel.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True and N > 1.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnCurv2d)
|
||||
---Purpose: Returns the points of the Nth extremum distance.
|
||||
-- P1 is on the first curve, P2 on the second one.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
TrimmedSquareDistances(me; dist11, distP12, distP21, distP22: out Real;
|
||||
P11, P12, P21, P22: out Pnt2d)
|
||||
---Purpose: if the curve is a trimmed curve,
|
||||
-- dist11 is a square distance between the point on C1
|
||||
-- of parameter FirstParameter and the point of
|
||||
-- parameter FirstParameter on C2.
|
||||
|
||||
is static;
|
||||
|
||||
Results(me: in out; AlgExt: ExtElC2d from Extrema;
|
||||
Ut11, Ut12, Ut21, Ut22: Real;
|
||||
Period1 : Real from Standard = 0.0;
|
||||
Period2 : Real from Standard = 0.0)
|
||||
|
||||
is static protected;
|
||||
|
||||
Results(me: in out;AlgExt: ECC2d from Extrema;
|
||||
Ut11, Ut12, Ut21, Ut22: Real;
|
||||
Period1 : Real from Standard = 0.0;
|
||||
Period2 : Real from Standard = 0.0)
|
||||
|
||||
is static protected;
|
||||
|
||||
|
||||
fields
|
||||
myDone: Boolean;
|
||||
myIsPar: Boolean;
|
||||
mypoints: SequenceOfPOnCurv2d from Extrema;
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
mynbext: Integer;
|
||||
inverse: Boolean;
|
||||
myC: Address from Standard;
|
||||
myv1: Real;
|
||||
myv2: Real;
|
||||
mytolc1: Real;
|
||||
mytolc2: Real;
|
||||
P1f: Pnt2d;
|
||||
P1l: Pnt2d;
|
||||
P2f: Pnt2d;
|
||||
P2l: Pnt2d;
|
||||
mydist11: Real;
|
||||
mydist12: Real;
|
||||
mydist21: Real;
|
||||
mydist22: Real;
|
||||
|
||||
|
||||
|
||||
end ExtCC2d;
|
@@ -14,29 +14,31 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtCC2d.ixx>
|
||||
|
||||
#include <Extrema_ExtElC2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
|
||||
#include <Extrema_ECC2d.hxx>
|
||||
#include <Extrema_ExtCC2d.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <Extrema_ExtElC2d.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtCC2d::Extrema_ExtCC2d()
|
||||
{
|
||||
|
131
src/Extrema/Extrema_ExtCC2d.hxx
Normal file
131
src/Extrema/Extrema_ExtCC2d.hxx
Normal file
@@ -0,0 +1,131 @@
|
||||
// Created on: 1994-07-06
|
||||
// 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 _Extrema_ExtCC2d_HeaderFile
|
||||
#define _Extrema_ExtCC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_POnCurv2d;
|
||||
class gp_Pnt2d;
|
||||
class Extrema_ExtElC2d;
|
||||
class Extrema_ECC2d;
|
||||
|
||||
|
||||
//! It calculates all the distance between two curves.
|
||||
//! These distances can be maximum or minimum.
|
||||
class Extrema_ExtCC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtCC2d();
|
||||
|
||||
//! It calculates all the distances.
|
||||
Standard_EXPORT Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
//! It calculates all the distances.
|
||||
Standard_EXPORT Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
//! initializes the fields.
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C2, const Standard_Real V1, const Standard_Real V2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const Standard_Real U1, const Standard_Real U2);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns True if the two curves are parallel.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
//! Returns the points of the Nth extremum distance.
|
||||
//! P1 is on the first curve, P2 on the second one.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
|
||||
|
||||
//! if the curve is a trimmed curve,
|
||||
//! dist11 is a square distance between the point on C1
|
||||
//! of parameter FirstParameter and the point of
|
||||
//! parameter FirstParameter on C2.
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist11, Standard_Real& distP12, Standard_Real& distP21, Standard_Real& distP22, gp_Pnt2d& P11, gp_Pnt2d& P12, gp_Pnt2d& P21, gp_Pnt2d& P22) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void Results (const Extrema_ExtElC2d& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22, const Standard_Real Period1 = 0.0, const Standard_Real Period2 = 0.0);
|
||||
|
||||
Standard_EXPORT void Results (const Extrema_ECC2d& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22, const Standard_Real Period1 = 0.0, const Standard_Real Period2 = 0.0);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_SequenceOfPOnCurv2d mypoints;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Standard_Integer mynbext;
|
||||
Standard_Boolean inverse;
|
||||
Standard_Address myC;
|
||||
Standard_Real myv1;
|
||||
Standard_Real myv2;
|
||||
Standard_Real mytolc1;
|
||||
Standard_Real mytolc2;
|
||||
gp_Pnt2d P1f;
|
||||
gp_Pnt2d P1l;
|
||||
gp_Pnt2d P2f;
|
||||
gp_Pnt2d P2l;
|
||||
Standard_Real mydist11;
|
||||
Standard_Real mydist12;
|
||||
Standard_Real mydist21;
|
||||
Standard_Real mydist22;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtCC2d_HeaderFile
|
@@ -1,145 +0,0 @@
|
||||
-- Created on: 1991-02-21
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1991-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 ExtCS from Extrema
|
||||
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between a curve and a surface.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
POnCurv from Extrema,
|
||||
ExtElCS from Extrema,
|
||||
Pnt from gp,
|
||||
SurfaceType from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
SequenceOfPOnCurv from Extrema,
|
||||
SequenceOfReal from TColStd,
|
||||
Curve from Adaptor3d,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d
|
||||
|
||||
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns ExtCS;
|
||||
|
||||
Create (C: Curve from Adaptor3d;
|
||||
S: Surface from Adaptor3d;
|
||||
TolC, TolS: Real)
|
||||
returns ExtCS;
|
||||
---Purpose: It calculates all the distances between C and S.
|
||||
|
||||
|
||||
Create (C: Curve from Adaptor3d;
|
||||
S: Surface from Adaptor3d;
|
||||
UCinf, UCsup: Real;
|
||||
Uinf, Usup, Vinf, Vsup: Real;
|
||||
TolC, TolS: Real)
|
||||
returns ExtCS;
|
||||
---Purpose: It calculates all the distances between C and S.
|
||||
-- UCinf and UCmax are the start and end parameters
|
||||
-- of the curve.
|
||||
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d;
|
||||
Uinf, Usup, Vinf, Vsup: Real;
|
||||
TolC, TolS: Real)
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; C: Curve from Adaptor3d; Uinf, Usup: Real)
|
||||
---Purpose: Computes the distances.
|
||||
-- An exception is raised if the fieds have not been
|
||||
-- initialized.
|
||||
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the curve is on a parallel surface.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1: out POnCurv; P2: out POnSurf)
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
AddSolution (me: in out;
|
||||
Curve: Curve from Adaptor3d;
|
||||
T,U,V: Real;
|
||||
PointOnCurve, PointOnSurf: Pnt from gp;
|
||||
SquareDist: Real)
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
Bidon(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
|
||||
fields
|
||||
myS : SurfacePtr from Adaptor3d;
|
||||
myDone : Boolean from Standard;
|
||||
myIsPar : Boolean from Standard;
|
||||
myExtElCS: ExtElCS from Extrema;
|
||||
myPOnS : SequenceOfPOnSurf from Extrema;
|
||||
myPOnC : SequenceOfPOnCurv from Extrema;
|
||||
myuinf : Real from Standard;
|
||||
myusup : Real from Standard;
|
||||
myvinf : Real from Standard;
|
||||
myvsup : Real from Standard;
|
||||
mytolC : Real from Standard;
|
||||
mytolS : Real from Standard;
|
||||
myucinf : Real from Standard;
|
||||
myucsup : Real from Standard;
|
||||
mySqDist : SequenceOfReal from TColStd;
|
||||
myStype : SurfaceType from GeomAbs;
|
||||
|
||||
end ExtCS;
|
@@ -16,29 +16,34 @@
|
||||
|
||||
// Modified by skv - Thu Jul 7 12:29:34 2005 OCC9134
|
||||
|
||||
#include <Extrema_ExtCS.ixx>
|
||||
#include <Extrema_GenExtCS.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BndLib_AddSurface.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_ExtCS.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <Extrema_GenExtCS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
Extrema_ExtCS::Extrema_ExtCS()
|
||||
{
|
||||
|
129
src/Extrema/Extrema_ExtCS.hxx
Normal file
129
src/Extrema/Extrema_ExtCS.hxx
Normal file
@@ -0,0 +1,129 @@
|
||||
// Created on: 1991-02-21
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtCS_HeaderFile
|
||||
#define _Extrema_ExtCS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_ExtElCS.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnCurv;
|
||||
class Extrema_POnSurf;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between a curve and a surface.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_ExtCS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtCS();
|
||||
|
||||
//! It calculates all the distances between C and S.
|
||||
Standard_EXPORT Extrema_ExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real TolC, const Standard_Real TolS);
|
||||
|
||||
//! It calculates all the distances between C and S.
|
||||
//! UCinf and UCmax are the start and end parameters
|
||||
//! of the curve.
|
||||
Standard_EXPORT Extrema_ExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real UCinf, const Standard_Real UCsup, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolC, const Standard_Real TolS);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolC, const Standard_Real TolS);
|
||||
|
||||
//! Computes the distances.
|
||||
//! An exception is raised if the fieds have not been
|
||||
//! initialized.
|
||||
Standard_EXPORT void Perform (const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns True if the curve is on a parallel surface.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean AddSolution (const Adaptor3d_Curve& Curve, const Standard_Real T, const Standard_Real U, const Standard_Real V, const gp_Pnt& PointOnCurve, const gp_Pnt& PointOnSurf, const Standard_Real SquareDist);
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_ExtElCS myExtElCS;
|
||||
Extrema_SequenceOfPOnSurf myPOnS;
|
||||
Extrema_SequenceOfPOnCurv myPOnC;
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
Standard_Real myvinf;
|
||||
Standard_Real myvsup;
|
||||
Standard_Real mytolC;
|
||||
Standard_Real mytolS;
|
||||
Standard_Real myucinf;
|
||||
Standard_Real myucsup;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
GeomAbs_SurfaceType myStype;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtCS_HeaderFile
|
@@ -1,145 +0,0 @@
|
||||
-- Created on: 1991-02-21
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1991-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 ExtElC from Extrema
|
||||
---Purpose: It calculates all the distance between two elementary
|
||||
-- curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Lin from gp,
|
||||
Parab from gp,
|
||||
POnCurv from Extrema
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns ExtElC;
|
||||
|
||||
Create (C1,C2: Lin; AngTol: Real) returns ExtElC;
|
||||
---Purpose: Calculates the distance between two lines.
|
||||
-- AngTol is used to test if the lines are parallel:
|
||||
-- Angle(C1,C2) < AngTol.
|
||||
|
||||
Create (C1: Lin; C2: Circ; Tol: Real) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a line and a
|
||||
-- circle.
|
||||
|
||||
Create (C1: Lin; C2: Elips) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a line and an
|
||||
-- elipse.
|
||||
|
||||
Create (C1: Lin; C2: Hypr) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a line and a
|
||||
-- hyperbola.
|
||||
|
||||
Create (C1: Lin; C2: Parab) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a line and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Circ) returns ExtElC;
|
||||
---Purpose: Calculates the distance between two circles.
|
||||
-- The circles can be parallel or identical.
|
||||
|
||||
Create (C1: Circ; C2: Elips) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a circle and an
|
||||
-- elipse.
|
||||
|
||||
Create (C1: Circ; C2: Hypr) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a circle and a
|
||||
-- hyperbola.
|
||||
|
||||
Create (C1: Circ; C2: Parab) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a circle and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Elips) returns ExtElC;
|
||||
---Purpose: Calculates the distance between two elipses.
|
||||
-- The elipses can be parallel or identical.
|
||||
|
||||
Create (C1: Elips; C2: Hypr) returns ExtElC;
|
||||
---Purpose: Calculates the distance between an elipse and a
|
||||
-- hyperbola.
|
||||
|
||||
Create (C1: Elips; C2: Parab) returns ExtElC;
|
||||
---Purpose: Calculates the distance between an elipse and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Hypr) returns ExtElC;
|
||||
---Purpose: Calculates the distance between two hyperbolas.
|
||||
-- The hyperbolas can be parallel or identical.
|
||||
|
||||
Create (C1: Hypr; C2: Parab) returns ExtElC;
|
||||
---Purpose: Calculates the distance between a hyperbola and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Parab) returns ExtElC;
|
||||
---Purpose: Calculates the distance between two parabolas
|
||||
-- The parabolas can be parallel or identical.
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the two curves are parallel.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)= True.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True and N > 1.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnCurv)
|
||||
---Purpose: Returns the points of the Nth extremum distance.
|
||||
-- P1 is on the first curve, P2 on the second one.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myIsPar: Boolean;
|
||||
myNbExt: Integer;
|
||||
--modified by NIZNHY-PKV Fri Nov 21 10:47:21 2008 ft
|
||||
-- it was *[4]
|
||||
mySqDist: Real [6];
|
||||
myPoint: POnCurv from Extrema [6,2];
|
||||
|
||||
end ExtElC;
|
@@ -12,28 +12,32 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Extrema_ExtElC.ixx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IntAna_QuadQuadGeo.hxx>
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <IntAna_QuadQuadGeo.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
static
|
||||
void RefineDir(gp_Dir& aDir);
|
||||
|
||||
|
156
src/Extrema/Extrema_ExtElC.hxx
Normal file
156
src/Extrema/Extrema_ExtElC.hxx
Normal file
@@ -0,0 +1,156 @@
|
||||
// Created on: 1991-02-21
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtElC_HeaderFile
|
||||
#define _Extrema_ExtElC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Lin;
|
||||
class gp_Circ;
|
||||
class gp_Elips;
|
||||
class gp_Hypr;
|
||||
class gp_Parab;
|
||||
class Extrema_POnCurv;
|
||||
|
||||
|
||||
//! It calculates all the distance between two elementary
|
||||
//! curves.
|
||||
//! These distances can be maximum or minimum.
|
||||
class Extrema_ExtElC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtElC();
|
||||
|
||||
//! Calculates the distance between two lines.
|
||||
//! AngTol is used to test if the lines are parallel:
|
||||
//! Angle(C1,C2) < AngTol.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Lin& C2, const Standard_Real AngTol);
|
||||
|
||||
//! Calculates the distance between a line and a
|
||||
//! circle.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Circ& C2, const Standard_Real Tol);
|
||||
|
||||
//! Calculates the distance between a line and an
|
||||
//! elipse.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Elips& C2);
|
||||
|
||||
//! Calculates the distance between a line and a
|
||||
//! hyperbola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Hypr& C2);
|
||||
|
||||
//! Calculates the distance between a line and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Parab& C2);
|
||||
|
||||
//! Calculates the distance between two circles.
|
||||
//! The circles can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Circ& C2);
|
||||
|
||||
//! Calculates the distance between a circle and an
|
||||
//! elipse.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Elips& C2);
|
||||
|
||||
//! Calculates the distance between a circle and a
|
||||
//! hyperbola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Hypr& C2);
|
||||
|
||||
//! Calculates the distance between a circle and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Parab& C2);
|
||||
|
||||
//! Calculates the distance between two elipses.
|
||||
//! The elipses can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Elips& C1, const gp_Elips& C2);
|
||||
|
||||
//! Calculates the distance between an elipse and a
|
||||
//! hyperbola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Elips& C1, const gp_Hypr& C2);
|
||||
|
||||
//! Calculates the distance between an elipse and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Elips& C1, const gp_Parab& C2);
|
||||
|
||||
//! Calculates the distance between two hyperbolas.
|
||||
//! The hyperbolas can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Hypr& C1, const gp_Hypr& C2);
|
||||
|
||||
//! Calculates the distance between a hyperbola and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Hypr& C1, const gp_Parab& C2);
|
||||
|
||||
//! Calculates the distance between two parabolas
|
||||
//! The parabolas can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC(const gp_Parab& C1, const gp_Parab& C2);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns True if the two curves are parallel.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
//! Returns the points of the Nth extremum distance.
|
||||
//! P1 is on the first curve, P2 on the second one.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[6];
|
||||
Extrema_POnCurv myPoint[6][2];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtElC_HeaderFile
|
@@ -1,143 +0,0 @@
|
||||
-- Created on: 1994-01-04
|
||||
-- Created by: Christophe MARION
|
||||
-- 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 ExtElC2d from Extrema
|
||||
---Purpose: It calculates all the distance between two elementary
|
||||
-- curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Lin2d from gp,
|
||||
Parab2d from gp,
|
||||
POnCurv2d from Extrema
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns ExtElC2d;
|
||||
|
||||
Create (C1,C2: Lin2d; AngTol: Real) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between two lines.
|
||||
-- AngTol is used to test if the lines are parallel:
|
||||
-- Angle(C1,C2) < AngTol.
|
||||
|
||||
Create (C1: Lin2d; C2: Circ2d; Tol: Real) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a line and a
|
||||
-- circle.
|
||||
|
||||
Create (C1: Lin2d; C2: Elips2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a line and an
|
||||
-- elipse.
|
||||
|
||||
Create (C1: Lin2d; C2: Hypr2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a line and a
|
||||
-- hyperbola.
|
||||
|
||||
Create (C1: Lin2d; C2: Parab2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a line and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Circ2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between two circles.
|
||||
-- The circles can be parallel or identical.
|
||||
|
||||
Create (C1: Circ2d; C2: Elips2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a circle and an
|
||||
-- elipse.
|
||||
|
||||
Create (C1: Circ2d; C2: Hypr2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a circle and a
|
||||
-- hyperbola.
|
||||
|
||||
Create (C1: Circ2d; C2: Parab2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a circle and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Elips2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between two elipses.
|
||||
-- The elipses can be parallel or identical.
|
||||
|
||||
Create (C1: Elips2d; C2: Hypr2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between an elipse and a
|
||||
-- hyperbola.
|
||||
|
||||
Create (C1: Elips2d; C2: Parab2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between an elipse and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Hypr2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between two hyperbolas.
|
||||
-- The hyperbolas can be parallel or identical.
|
||||
|
||||
Create (C1: Hypr2d; C2: Parab2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between a hyperbola and a
|
||||
-- parabola.
|
||||
|
||||
Create (C1,C2: Parab2d) returns ExtElC2d;
|
||||
---Purpose: Calculates the distance between two parabolas
|
||||
-- The parabolas can be parallel or identical.
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the two curves are parallel.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)= True.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True and N > 1.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnCurv2d)
|
||||
---Purpose: Returns the points of the Nth extremum distance.
|
||||
-- P1 is on the first curve, P2 on the second one.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myIsPar: Boolean;
|
||||
myNbExt: Integer;
|
||||
mySqDist: Real [8];
|
||||
myPoint: POnCurv2d from Extrema [8,2];
|
||||
|
||||
end ExtElC2d;
|
@@ -14,20 +14,25 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtElC2d.ixx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtElC2d.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
|
||||
//=============================================================================
|
||||
|
||||
Extrema_ExtElC2d::Extrema_ExtElC2d () { myDone = Standard_False; }
|
||||
//=============================================================================
|
||||
|
||||
|
156
src/Extrema/Extrema_ExtElC2d.hxx
Normal file
156
src/Extrema/Extrema_ExtElC2d.hxx
Normal file
@@ -0,0 +1,156 @@
|
||||
// Created on: 1994-01-04
|
||||
// Created by: Christophe MARION
|
||||
// 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 _Extrema_ExtElC2d_HeaderFile
|
||||
#define _Extrema_ExtElC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Lin2d;
|
||||
class gp_Circ2d;
|
||||
class gp_Elips2d;
|
||||
class gp_Hypr2d;
|
||||
class gp_Parab2d;
|
||||
class Extrema_POnCurv2d;
|
||||
|
||||
|
||||
//! It calculates all the distance between two elementary
|
||||
//! curves.
|
||||
//! These distances can be maximum or minimum.
|
||||
class Extrema_ExtElC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtElC2d();
|
||||
|
||||
//! Calculates the distance between two lines.
|
||||
//! AngTol is used to test if the lines are parallel:
|
||||
//! Angle(C1,C2) < AngTol.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Lin2d& C2, const Standard_Real AngTol);
|
||||
|
||||
//! Calculates the distance between a line and a
|
||||
//! circle.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Circ2d& C2, const Standard_Real Tol);
|
||||
|
||||
//! Calculates the distance between a line and an
|
||||
//! elipse.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Elips2d& C2);
|
||||
|
||||
//! Calculates the distance between a line and a
|
||||
//! hyperbola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Hypr2d& C2);
|
||||
|
||||
//! Calculates the distance between a line and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Parab2d& C2);
|
||||
|
||||
//! Calculates the distance between two circles.
|
||||
//! The circles can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Circ2d& C2);
|
||||
|
||||
//! Calculates the distance between a circle and an
|
||||
//! elipse.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Elips2d& C2);
|
||||
|
||||
//! Calculates the distance between a circle and a
|
||||
//! hyperbola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Hypr2d& C2);
|
||||
|
||||
//! Calculates the distance between a circle and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Parab2d& C2);
|
||||
|
||||
//! Calculates the distance between two elipses.
|
||||
//! The elipses can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Elips2d& C1, const gp_Elips2d& C2);
|
||||
|
||||
//! Calculates the distance between an elipse and a
|
||||
//! hyperbola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Elips2d& C1, const gp_Hypr2d& C2);
|
||||
|
||||
//! Calculates the distance between an elipse and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Elips2d& C1, const gp_Parab2d& C2);
|
||||
|
||||
//! Calculates the distance between two hyperbolas.
|
||||
//! The hyperbolas can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Hypr2d& C1, const gp_Hypr2d& C2);
|
||||
|
||||
//! Calculates the distance between a hyperbola and a
|
||||
//! parabola.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Hypr2d& C1, const gp_Parab2d& C2);
|
||||
|
||||
//! Calculates the distance between two parabolas
|
||||
//! The parabolas can be parallel or identical.
|
||||
Standard_EXPORT Extrema_ExtElC2d(const gp_Parab2d& C1, const gp_Parab2d& C2);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns True if the two curves are parallel.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
//! Returns the points of the Nth extremum distance.
|
||||
//! P1 is on the first curve, P2 on the second one.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[8];
|
||||
Extrema_POnCurv2d myPoint[8][2];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtElC2d_HeaderFile
|
@@ -1,169 +0,0 @@
|
||||
-- Created on: 1992-07-22
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1992-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 ExtElCS from Extrema
|
||||
---Purpose: It calculates all the distances between a curve and
|
||||
-- a surface.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses POnCurv from Extrema,
|
||||
POnSurf from Extrema,
|
||||
HArray1OfPOnCurv from Extrema,
|
||||
HArray1OfPOnSurf from Extrema,
|
||||
Circ from gp,
|
||||
Cone from gp,
|
||||
Cylinder from gp,
|
||||
Lin from gp,
|
||||
Hypr from gp,
|
||||
Pln from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp,
|
||||
HArray1OfReal from TColStd
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns ExtElCS;
|
||||
|
||||
Create (C: Lin; S: Pln) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a line and a
|
||||
-- plane. The line can be on the plane or on a parallel
|
||||
-- plane.
|
||||
|
||||
Perform(me: in out; C: Lin; S: Pln)
|
||||
is static ;
|
||||
|
||||
Create (C: Lin; S: Cylinder) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a line and a
|
||||
-- cylinder.
|
||||
Perform(me: in out; C: Lin; S: Cylinder)
|
||||
is static ;
|
||||
|
||||
Create (C: Lin; S: Cone) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a line and a cone.
|
||||
|
||||
Perform(me: in out; C: Lin; S: Cone)
|
||||
is static ;
|
||||
|
||||
Create (C: Lin; S: Sphere) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a line and a
|
||||
-- sphere.
|
||||
|
||||
Perform(me: in out; C: Lin; S: Sphere)
|
||||
is static ;
|
||||
|
||||
|
||||
Create (C: Lin; S: Torus) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a line and a
|
||||
-- torus.
|
||||
|
||||
Perform(me: in out; C: Lin; S: Torus)
|
||||
is static ;
|
||||
|
||||
Create (C: Circ; S: Pln) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a circle and a
|
||||
-- plane.
|
||||
|
||||
Perform(me: in out; C: Circ; S: Pln)
|
||||
is static ;
|
||||
|
||||
Create (C: Circ; S: Cylinder) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a circle and a
|
||||
-- cylinder.
|
||||
|
||||
Perform(me: in out; C: Circ; S: Cylinder)
|
||||
is static ;
|
||||
|
||||
Create (C: Circ; S: Cone) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a circle and a
|
||||
-- cone.
|
||||
|
||||
Perform(me: in out; C: Circ; S: Cone)
|
||||
is static ;
|
||||
|
||||
Create (C: Circ; S: Sphere) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a circle and a
|
||||
-- sphere.
|
||||
|
||||
Perform(me: in out; C: Circ; S: Sphere)
|
||||
is static ;
|
||||
|
||||
Create (C: Circ; S: Torus) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a circle and a
|
||||
-- torus.
|
||||
|
||||
Perform(me: in out; C: Circ; S: Torus)
|
||||
is static ;
|
||||
|
||||
Create (C: Hypr; S: Pln) returns ExtElCS;
|
||||
---Purpose: Calculates the distances between a hyperbola and a
|
||||
-- plane.
|
||||
|
||||
Perform(me: in out; C: Hypr; S: Pln)
|
||||
is static ;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the curve is on a parallel surface.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)=True.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises OutOfRange from Standard,
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)=True and N<>1.
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1: out POnCurv; P2: out POnSurf)
|
||||
---Purpose: Returns the points of the Nth extremum distance.
|
||||
-- P1 is on the curve, P2 on the surface.
|
||||
raises OutOfRange from Standard,
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)=True and N<>1.
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myNbExt : Integer;
|
||||
myIsPar : Boolean;
|
||||
mySqDist: HArray1OfReal from TColStd;
|
||||
myPoint1: HArray1OfPOnCurv from Extrema;
|
||||
myPoint2: HArray1OfPOnSurf from Extrema;
|
||||
|
||||
end ExtElCS;
|
@@ -14,20 +14,30 @@
|
||||
|
||||
// Modified by skv - Thu Jul 7 14:37:05 2005 OCC9134
|
||||
|
||||
#include <Extrema_ExtElCS.ixx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <Extrema_ExtElCS.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <IntAna_Quadric.hxx>
|
||||
#include <IntAna_IntConicQuad.hxx>
|
||||
|
||||
#include <IntAna_Quadric.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtElCS::Extrema_ExtElCS()
|
||||
{
|
||||
|
168
src/Extrema/Extrema_ExtElCS.hxx
Normal file
168
src/Extrema/Extrema_ExtElCS.hxx
Normal file
@@ -0,0 +1,168 @@
|
||||
// Created on: 1992-07-22
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1992-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 _Extrema_ExtElCS_HeaderFile
|
||||
#define _Extrema_ExtElCS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Extrema_HArray1OfPOnCurv.hxx>
|
||||
#include <Extrema_HArray1OfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Lin;
|
||||
class gp_Pln;
|
||||
class gp_Cylinder;
|
||||
class gp_Cone;
|
||||
class gp_Sphere;
|
||||
class gp_Torus;
|
||||
class gp_Circ;
|
||||
class gp_Hypr;
|
||||
class Extrema_POnCurv;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the distances between a curve and
|
||||
//! a surface.
|
||||
//! These distances can be maximum or minimum.
|
||||
class Extrema_ExtElCS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtElCS();
|
||||
|
||||
//! Calculates the distances between a line and a
|
||||
//! plane. The line can be on the plane or on a parallel
|
||||
//! plane.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Pln& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Lin& C, const gp_Pln& S);
|
||||
|
||||
//! Calculates the distances between a line and a
|
||||
//! cylinder.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cylinder& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cylinder& S);
|
||||
|
||||
//! Calculates the distances between a line and a cone.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cone& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cone& S);
|
||||
|
||||
//! Calculates the distances between a line and a
|
||||
//! sphere.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Sphere& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Lin& C, const gp_Sphere& S);
|
||||
|
||||
//! Calculates the distances between a line and a
|
||||
//! torus.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Torus& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Lin& C, const gp_Torus& S);
|
||||
|
||||
//! Calculates the distances between a circle and a
|
||||
//! plane.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Pln& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& S);
|
||||
|
||||
//! Calculates the distances between a circle and a
|
||||
//! cylinder.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cylinder& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cylinder& S);
|
||||
|
||||
//! Calculates the distances between a circle and a
|
||||
//! cone.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cone& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cone& S);
|
||||
|
||||
//! Calculates the distances between a circle and a
|
||||
//! sphere.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Sphere& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Circ& C, const gp_Sphere& S);
|
||||
|
||||
//! Calculates the distances between a circle and a
|
||||
//! torus.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Torus& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Circ& C, const gp_Torus& S);
|
||||
|
||||
//! Calculates the distances between a hyperbola and a
|
||||
//! plane.
|
||||
Standard_EXPORT Extrema_ExtElCS(const gp_Hypr& C, const gp_Pln& S);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Hypr& C, const gp_Pln& S);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns True if the curve is on a parallel surface.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
//! Returns the points of the Nth extremum distance.
|
||||
//! P1 is on the curve, P2 on the surface.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Boolean myIsPar;
|
||||
Handle(TColStd_HArray1OfReal) mySqDist;
|
||||
Handle(Extrema_HArray1OfPOnCurv) myPoint1;
|
||||
Handle(Extrema_HArray1OfPOnSurf) myPoint2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtElCS_HeaderFile
|
@@ -1,134 +0,0 @@
|
||||
-- Created on: 1992-07-22
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1992-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 ExtElSS from Extrema
|
||||
|
||||
---Purpose: It calculates all the distances between 2 elementary
|
||||
-- surfaces.
|
||||
-- These distances can be maximum or minimum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
HArray1OfPOnSurf from Extrema,
|
||||
HArray1OfReal from TColStd,
|
||||
Pnt from gp,
|
||||
Pln from gp,
|
||||
Sphere from gp,
|
||||
Cone from gp,
|
||||
Torus from gp,
|
||||
Cylinder from gp
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns ExtElSS;
|
||||
|
||||
Create (S1,S2: Pln) returns ExtElSS;
|
||||
---Purpose: Calculates the distances between 2 planes.
|
||||
-- These planes can be parallel.
|
||||
|
||||
Perform(me: in out; S1,S2: Pln)
|
||||
is static;
|
||||
|
||||
Create (S1: Pln; S2: Sphere) returns ExtElSS;
|
||||
---Purpose: Calculates the distances between a plane
|
||||
-- and a sphere.
|
||||
|
||||
Perform(me: in out; S1: Pln; S2: Sphere)
|
||||
is static;
|
||||
|
||||
|
||||
Create (S1: Sphere; S2: Sphere) returns ExtElSS;
|
||||
---Purpose: Calculates the distances between 2 spheres.
|
||||
-- These spheres can be parallel.
|
||||
|
||||
Perform(me: in out; S1,S2: Sphere)
|
||||
is static;
|
||||
|
||||
|
||||
Create (S1: Sphere; S2: Cylinder) returns ExtElSS;
|
||||
---Purpose: Calculates the distances between a sphere
|
||||
-- and a cylinder.
|
||||
|
||||
Perform(me: in out; S1: Sphere; S2: Cylinder)
|
||||
is static;
|
||||
|
||||
Create (S1: Sphere; S2: Cone) returns ExtElSS;
|
||||
---Purpose: Calculates the distances between a sphere
|
||||
-- and a cone.
|
||||
|
||||
Perform(me: in out; S1: Sphere; S2: Cone)
|
||||
is static;
|
||||
|
||||
|
||||
Create (S1: Sphere; S2: Torus) returns ExtElSS;
|
||||
---Purpose: Calculates the distances between a sphere
|
||||
-- and a torus.
|
||||
|
||||
Perform(me: in out; S1: Sphere; S2: Torus)
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the two surfaces are parallel.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)=True
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange,
|
||||
-- if N < 1 or N > NbPoints(me)
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)=True and N<>1.
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnSurf)
|
||||
---Purpose: Returns the points for the Nth resulting distance.
|
||||
-- P1 is on the first surface, P2 on the second one.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange,
|
||||
-- if N < 1 or N > NbPoints(me)
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)=True and N<>1.
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myIsPar : Boolean;
|
||||
myNbExt : Integer;
|
||||
mySqDist : HArray1OfReal from TColStd;
|
||||
myPOnS1 : HArray1OfPOnSurf from Extrema;
|
||||
myPOnS2 : HArray1OfPOnSurf from Extrema;
|
||||
|
||||
end ExtElSS;
|
@@ -12,13 +12,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtElSS.ixx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Extrema_ExtElSS.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtElSS::Extrema_ExtElSS()
|
||||
{
|
||||
|
133
src/Extrema/Extrema_ExtElSS.hxx
Normal file
133
src/Extrema/Extrema_ExtElSS.hxx
Normal file
@@ -0,0 +1,133 @@
|
||||
// Created on: 1992-07-22
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1992-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 _Extrema_ExtElSS_HeaderFile
|
||||
#define _Extrema_ExtElSS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Extrema_HArray1OfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pln;
|
||||
class gp_Sphere;
|
||||
class gp_Cylinder;
|
||||
class gp_Cone;
|
||||
class gp_Torus;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the distances between 2 elementary
|
||||
//! surfaces.
|
||||
//! These distances can be maximum or minimum.
|
||||
class Extrema_ExtElSS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtElSS();
|
||||
|
||||
//! Calculates the distances between 2 planes.
|
||||
//! These planes can be parallel.
|
||||
Standard_EXPORT Extrema_ExtElSS(const gp_Pln& S1, const gp_Pln& S2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pln& S1, const gp_Pln& S2);
|
||||
|
||||
//! Calculates the distances between a plane
|
||||
//! and a sphere.
|
||||
Standard_EXPORT Extrema_ExtElSS(const gp_Pln& S1, const gp_Sphere& S2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pln& S1, const gp_Sphere& S2);
|
||||
|
||||
//! Calculates the distances between 2 spheres.
|
||||
//! These spheres can be parallel.
|
||||
Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Sphere& S2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Sphere& S2);
|
||||
|
||||
//! Calculates the distances between a sphere
|
||||
//! and a cylinder.
|
||||
Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Cylinder& S2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Cylinder& S2);
|
||||
|
||||
//! Calculates the distances between a sphere
|
||||
//! and a cone.
|
||||
Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Cone& S2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Cone& S2);
|
||||
|
||||
//! Calculates the distances between a sphere
|
||||
//! and a torus.
|
||||
Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Torus& S2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Torus& S2);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns True if the two surfaces are parallel.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
|
||||
|
||||
//! Returns the points for the Nth resulting distance.
|
||||
//! P1 is on the first surface, P2 on the second one.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnSurf& P1, Extrema_POnSurf& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Standard_Integer myNbExt;
|
||||
Handle(TColStd_HArray1OfReal) mySqDist;
|
||||
Handle(Extrema_HArray1OfPOnSurf) myPOnS1;
|
||||
Handle(Extrema_HArray1OfPOnSurf) myPOnS2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtElSS_HeaderFile
|
28
src/Extrema/Extrema_ExtFlag.hxx
Normal file
28
src/Extrema/Extrema_ExtFlag.hxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtFlag_HeaderFile
|
||||
#define _Extrema_ExtFlag_HeaderFile
|
||||
|
||||
|
||||
enum Extrema_ExtFlag
|
||||
{
|
||||
Extrema_ExtFlag_MIN,
|
||||
Extrema_ExtFlag_MAX,
|
||||
Extrema_ExtFlag_MINMAX
|
||||
};
|
||||
|
||||
#endif // _Extrema_ExtFlag_HeaderFile
|
122
src/Extrema/Extrema_ExtPC.hxx
Normal file
122
src/Extrema/Extrema_ExtPC.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtPC_HeaderFile
|
||||
#define _Extrema_ExtPC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Address.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_EPCOfExtPC.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <TColStd_SequenceOfBoolean.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_ExtPElC;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class Extrema_POnCurv;
|
||||
class Extrema_EPCOfExtPC;
|
||||
class Extrema_PCFOfEPCOfExtPC;
|
||||
|
||||
|
||||
|
||||
class Extrema_ExtPC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPC();
|
||||
|
||||
Standard_EXPORT Extrema_ExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT Extrema_ExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt& P1, gp_Pnt& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void IntervalPerform (const gp_Pnt& P);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address myC;
|
||||
gp_Pnt Pf;
|
||||
gp_Pnt Pl;
|
||||
Extrema_ExtPElC myExtPElC;
|
||||
Extrema_SequenceOfPOnCurv mypoint;
|
||||
Standard_Boolean mydone;
|
||||
Standard_Real mydist1;
|
||||
Standard_Real mydist2;
|
||||
Extrema_EPCOfExtPC myExtPC;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolf;
|
||||
Standard_Integer mysample;
|
||||
Standard_Real myintuinf;
|
||||
Standard_Real myintusup;
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
GeomAbs_CurveType type;
|
||||
TColStd_SequenceOfBoolean myismin;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPC_HeaderFile
|
122
src/Extrema/Extrema_ExtPC2d.hxx
Normal file
122
src/Extrema/Extrema_ExtPC2d.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtPC2d_HeaderFile
|
||||
#define _Extrema_ExtPC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Address.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_EPCOfExtPC2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <TColStd_SequenceOfBoolean.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_ExtPElC2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Extrema_POnCurv2d;
|
||||
class Extrema_EPCOfExtPC2d;
|
||||
class Extrema_PCFOfEPCOfExtPC2d;
|
||||
|
||||
|
||||
|
||||
class Extrema_ExtPC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPC2d();
|
||||
|
||||
Standard_EXPORT Extrema_ExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT Extrema_ExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
|
||||
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt2d& P1, gp_Pnt2d& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void IntervalPerform (const gp_Pnt2d& P);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address myC;
|
||||
gp_Pnt2d Pf;
|
||||
gp_Pnt2d Pl;
|
||||
Extrema_ExtPElC2d myExtPElC;
|
||||
Extrema_SequenceOfPOnCurv2d mypoint;
|
||||
Standard_Boolean mydone;
|
||||
Standard_Real mydist1;
|
||||
Standard_Real mydist2;
|
||||
Extrema_EPCOfExtPC2d myExtPC;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolf;
|
||||
Standard_Integer mysample;
|
||||
Standard_Real myintuinf;
|
||||
Standard_Real myintusup;
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
GeomAbs_CurveType type;
|
||||
TColStd_SequenceOfBoolean myismin;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPC2d_HeaderFile
|
55
src/Extrema/Extrema_ExtPC2d_0.cxx
Normal file
55
src/Extrema/Extrema_ExtPC2d_0.cxx
Normal file
@@ -0,0 +1,55 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_ExtPC2d.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <Extrema_EPCOfExtPC2d.hxx>
|
||||
#include <Extrema_PCFOfEPCOfExtPC2d.hxx>
|
||||
|
||||
|
||||
#define TheCurve Adaptor2d_Curve2d
|
||||
#define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
|
||||
#define TheCurveTool Extrema_Curve2dTool
|
||||
#define TheCurveTool_hxx <Extrema_Curve2dTool.hxx>
|
||||
#define TheExtPElC Extrema_ExtPElC2d
|
||||
#define TheExtPElC_hxx <Extrema_ExtPElC2d.hxx>
|
||||
#define ThePoint gp_Pnt2d
|
||||
#define ThePoint_hxx <gp_Pnt2d.hxx>
|
||||
#define TheVector gp_Vec2d
|
||||
#define TheVector_hxx <gp_Vec2d.hxx>
|
||||
#define ThePOnC Extrema_POnCurv2d
|
||||
#define ThePOnC_hxx <Extrema_POnCurv2d.hxx>
|
||||
#define TheSequenceOfPOnC Extrema_SequenceOfPOnCurv2d
|
||||
#define TheSequenceOfPOnC_hxx <Extrema_SequenceOfPOnCurv2d.hxx>
|
||||
#define Extrema_EPC Extrema_EPCOfExtPC2d
|
||||
#define Extrema_EPC_hxx <Extrema_EPCOfExtPC2d.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfExtPC2d
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfExtPC2d.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfExtPC2d
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfExtPC2d.hxx>
|
||||
#define Extrema_GExtPC Extrema_ExtPC2d
|
||||
#define Extrema_GExtPC_hxx <Extrema_ExtPC2d.hxx>
|
||||
#include <Extrema_GExtPC.gxx>
|
||||
|
55
src/Extrema/Extrema_ExtPC_0.cxx
Normal file
55
src/Extrema/Extrema_ExtPC_0.cxx
Normal file
@@ -0,0 +1,55 @@
|
||||
// Created on: 1991-02-26
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 <Extrema_ExtPC.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_EPCOfExtPC.hxx>
|
||||
#include <Extrema_PCFOfEPCOfExtPC.hxx>
|
||||
|
||||
|
||||
#define TheCurve Adaptor3d_Curve
|
||||
#define TheCurve_hxx <Adaptor3d_Curve.hxx>
|
||||
#define TheCurveTool Extrema_CurveTool
|
||||
#define TheCurveTool_hxx <Extrema_CurveTool.hxx>
|
||||
#define TheExtPElC Extrema_ExtPElC
|
||||
#define TheExtPElC_hxx <Extrema_ExtPElC.hxx>
|
||||
#define ThePoint gp_Pnt
|
||||
#define ThePoint_hxx <gp_Pnt.hxx>
|
||||
#define TheVector gp_Vec
|
||||
#define TheVector_hxx <gp_Vec.hxx>
|
||||
#define ThePOnC Extrema_POnCurv
|
||||
#define ThePOnC_hxx <Extrema_POnCurv.hxx>
|
||||
#define TheSequenceOfPOnC Extrema_SequenceOfPOnCurv
|
||||
#define TheSequenceOfPOnC_hxx <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#define Extrema_EPC Extrema_EPCOfExtPC
|
||||
#define Extrema_EPC_hxx <Extrema_EPCOfExtPC.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfExtPC
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfExtPC.hxx>
|
||||
#define Extrema_PCFOfEPC Extrema_PCFOfEPCOfExtPC
|
||||
#define Extrema_PCFOfEPC_hxx <Extrema_PCFOfEPCOfExtPC.hxx>
|
||||
#define Extrema_GExtPC Extrema_ExtPC
|
||||
#define Extrema_GExtPC_hxx <Extrema_ExtPC.hxx>
|
||||
#include <Extrema_GExtPC.gxx>
|
||||
|
@@ -1,150 +0,0 @@
|
||||
-- Created on: 1991-02-21
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1991-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 ExtPElC from Extrema
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and an elementary curve.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnCurv from Extrema,
|
||||
Lin from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
Pnt from gp
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns ExtPElC;
|
||||
|
||||
Create (P: Pnt; C: Lin; Tol: Real; Uinf,Usup: Real)
|
||||
returns ExtPElC;
|
||||
---Purpose: Calculates the extremum distance between the
|
||||
-- point P and the segment [Uinf,Usup] of the line C.
|
||||
|
||||
Perform(me: in out; P: Pnt; C: Lin; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
|
||||
Create (P: Pnt; C: Circ; Tol: Real; Uinf,Usup: Real)
|
||||
returns ExtPElC;
|
||||
---Purpose: Calculates the 2 extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the circle C.
|
||||
-- Tol is used to determine
|
||||
-- if P is on the axis of the circle or
|
||||
-- if an extremum is on an endpoint of the segment.
|
||||
-- If P is on the axis of the circle,
|
||||
-- there are infinite solution then IsDone(me)=False.
|
||||
-- The conditions on the Uinf and Usup are:
|
||||
-- 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
-- If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
-- the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt; C: Circ; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt; C: Elips; Tol: Real; Uinf,Usup: Real)
|
||||
returns ExtPElC;
|
||||
---Purpose: Calculates the 4 extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the elipse C.
|
||||
-- Tol is used to determine
|
||||
-- if the point is on the axis of the elipse and
|
||||
-- if the major radius is equal to the minor radius or
|
||||
-- if an extremum is on an endpoint of the segment.
|
||||
-- If P is on the axis of the elipse,
|
||||
-- there are infinite solution then IsDone(me)=False.
|
||||
-- The conditions on the Uinf and Usup are:
|
||||
-- 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
-- If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
-- the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt; C: Elips; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt; C: Hypr; Tol: Real; Uinf,Usup: Real)
|
||||
returns ExtPElC;
|
||||
---Purpose: Calculates the extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the hyperbola
|
||||
-- C.
|
||||
-- Tol is used to determine if two solutions u and v
|
||||
-- are identical; the condition is:
|
||||
-- dist(C(u),C(v)) < Tol.
|
||||
|
||||
Perform(me: in out; P: Pnt; C: Hypr; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt; C: Parab; Tol: Real; Uinf,Usup: Real)
|
||||
returns ExtPElC;
|
||||
---Purpose: Calculates the 4 extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the parabola
|
||||
-- C.
|
||||
-- Tol is used to determine if two solutions u and v
|
||||
-- are identical; the condition is:
|
||||
-- dist(C(u),C(v)) < Tol.
|
||||
|
||||
Perform(me: in out; P: Pnt; C: Parab; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
IsMin (me; N: Integer) returns Boolean
|
||||
---Purpose: Returns True if the Nth extremum distance is a
|
||||
-- minimum.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnCurv
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth extremum distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myNbExt: Integer;
|
||||
mySqDist: Real [4];
|
||||
myIsMin: Boolean [4];
|
||||
myPoint: POnCurv from Extrema [4];
|
||||
|
||||
end ExtPElC;
|
@@ -12,14 +12,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtPElC.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_ExtPElC
|
||||
|
152
src/Extrema/Extrema_ExtPElC.hxx
Normal file
152
src/Extrema/Extrema_ExtPElC.hxx
Normal file
@@ -0,0 +1,152 @@
|
||||
// Created on: 1991-02-21
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtPElC_HeaderFile
|
||||
#define _Extrema_ExtPElC_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
class gp_Lin;
|
||||
class gp_Circ;
|
||||
class gp_Elips;
|
||||
class gp_Hypr;
|
||||
class gp_Parab;
|
||||
class Extrema_POnCurv;
|
||||
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and an elementary curve.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_ExtPElC
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPElC();
|
||||
|
||||
//! Calculates the extremum distance between the
|
||||
//! point P and the segment [Uinf,Usup] of the line C.
|
||||
Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Lin& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Lin& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the 2 extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the circle C.
|
||||
//! Tol is used to determine
|
||||
//! if P is on the axis of the circle or
|
||||
//! if an extremum is on an endpoint of the segment.
|
||||
//! If P is on the axis of the circle,
|
||||
//! there are infinite solution then IsDone(me)=False.
|
||||
//! The conditions on the Uinf and Usup are:
|
||||
//! 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
//! If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
//! the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Circ& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Circ& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the 4 extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the elipse C.
|
||||
//! Tol is used to determine
|
||||
//! if the point is on the axis of the elipse and
|
||||
//! if the major radius is equal to the minor radius or
|
||||
//! if an extremum is on an endpoint of the segment.
|
||||
//! If P is on the axis of the elipse,
|
||||
//! there are infinite solution then IsDone(me)=False.
|
||||
//! The conditions on the Uinf and Usup are:
|
||||
//! 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
//! If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
//! the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Elips& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Elips& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the hyperbola
|
||||
//! C.
|
||||
//! Tol is used to determine if two solutions u and v
|
||||
//! are identical; the condition is:
|
||||
//! dist(C(u),C(v)) < Tol.
|
||||
Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Hypr& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Hypr& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the 4 extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the parabola
|
||||
//! C.
|
||||
//! Tol is used to determine if two solutions u and v
|
||||
//! are identical; the condition is:
|
||||
//! dist(C(u),C(v)) < Tol.
|
||||
Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Parab& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Parab& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns True if the Nth extremum distance is a
|
||||
//! minimum.
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth extremum distance.
|
||||
Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[4];
|
||||
Standard_Boolean myIsMin[4];
|
||||
Extrema_POnCurv myPoint[4];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPElC_HeaderFile
|
@@ -1,155 +0,0 @@
|
||||
-- Created on: 1993-12-13
|
||||
-- Created by: Christophe MARION
|
||||
-- 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.
|
||||
|
||||
class ExtPElC2d from Extrema
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and an elementary curve.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnCurv2d from Extrema,
|
||||
Lin2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Pnt2d from gp
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns ExtPElC2d;
|
||||
|
||||
Create (P: Pnt2d; C: Lin2d; Tol: Real;
|
||||
Uinf: Real; Usup: Real)
|
||||
returns ExtPElC2d;
|
||||
---Purpose: Calculates the extremum distance between the
|
||||
-- point P and the segment [Uinf,Usup] of the line L.
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt2d; L: Lin2d; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt2d; C: Circ2d; Tol: Real;
|
||||
Uinf: Real; Usup: Real)
|
||||
returns ExtPElC2d;
|
||||
---Purpose: Calculates the 2 extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the circle C.
|
||||
-- Tol is used to determine
|
||||
-- if P is on the axis of the circle or
|
||||
-- if an extremum is on an endpoint of the segment.
|
||||
-- If P is on the axis of the circle,
|
||||
-- there are infinite solution then IsDone(me)=False.
|
||||
-- The conditions on the Uinf and Usup are:
|
||||
-- 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
-- If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
-- the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt2d; C: Circ2d; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt2d; C: Elips2d; Tol: Real;
|
||||
Uinf: Real; Usup: Real)
|
||||
returns ExtPElC2d;
|
||||
---Purpose: Calculates the 4 extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the elipse C.
|
||||
-- Tol is used to determine
|
||||
-- if the point is on the axis of the elipse and
|
||||
-- if the major radius is equal to the minor radius or
|
||||
-- if an extremum is on an endpoint of the segment.
|
||||
-- If P is on the axis of the elipse,
|
||||
-- there are infinite solution then IsDone(me)=False.
|
||||
-- The conditions on the Uinf and Usup are:
|
||||
-- 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
-- If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
-- the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt2d; C: Elips2d; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt2d; C: Hypr2d; Tol: Real; Uinf: Real;
|
||||
Usup: Real)
|
||||
returns ExtPElC2d;
|
||||
---Purpose: Calculates the extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the hyperbola
|
||||
-- C.
|
||||
-- Tol is used to determine if two solutions u and v
|
||||
-- are identical; the condition is:
|
||||
-- dist(C(u),C(v)) < Tol.
|
||||
|
||||
Perform(me: in out; P: Pnt2d; C: Hypr2d; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt2d; C: Parab2d; Tol: Real; Uinf: Real;
|
||||
Usup: Real)
|
||||
returns ExtPElC2d;
|
||||
---Purpose: Calculates the 4 extremum distances between the
|
||||
-- point P and the segment [Uinf,Usup] of the parabola
|
||||
-- C.
|
||||
-- Tol is used to determine if two solutions u and v
|
||||
-- are identical; the condition is:
|
||||
-- dist(C(u),C(v)) < Tol.
|
||||
|
||||
Perform(me: in out; P: Pnt2d; C: Parab2d; Tol: Real; Uinf,Usup: Real)
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
IsMin (me; N: Integer) returns Boolean
|
||||
---Purpose: Returns True if the Nth extremum distance is a
|
||||
-- minimum.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnCurv2d
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth extremum distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myNbExt: Integer;
|
||||
mySqDist: Real [4];
|
||||
myIsMin: Boolean [4];
|
||||
myPoint: POnCurv2d from Extrema [4];
|
||||
|
||||
end ExtPElC2d;
|
@@ -14,16 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <Extrema_ExtPElC2d.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtPElC2d.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
//=============================================================================
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=============================================================================
|
||||
Extrema_ExtPElC2d::Extrema_ExtPElC2d () { myDone = Standard_False; }
|
||||
//=============================================================================
|
||||
|
||||
|
152
src/Extrema/Extrema_ExtPElC2d.hxx
Normal file
152
src/Extrema/Extrema_ExtPElC2d.hxx
Normal file
@@ -0,0 +1,152 @@
|
||||
// Created on: 1993-12-13
|
||||
// Created by: Christophe MARION
|
||||
// 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 _Extrema_ExtPElC2d_HeaderFile
|
||||
#define _Extrema_ExtPElC2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt2d;
|
||||
class gp_Lin2d;
|
||||
class gp_Circ2d;
|
||||
class gp_Elips2d;
|
||||
class gp_Hypr2d;
|
||||
class gp_Parab2d;
|
||||
class Extrema_POnCurv2d;
|
||||
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and an elementary curve.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_ExtPElC2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPElC2d();
|
||||
|
||||
//! Calculates the extremum distance between the
|
||||
//! point P and the segment [Uinf,Usup] of the line L.
|
||||
Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Lin2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Lin2d& L, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the 2 extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the circle C.
|
||||
//! Tol is used to determine
|
||||
//! if P is on the axis of the circle or
|
||||
//! if an extremum is on an endpoint of the segment.
|
||||
//! If P is on the axis of the circle,
|
||||
//! there are infinite solution then IsDone(me)=False.
|
||||
//! The conditions on the Uinf and Usup are:
|
||||
//! 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
//! If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
//! the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Circ2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Circ2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the 4 extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the elipse C.
|
||||
//! Tol is used to determine
|
||||
//! if the point is on the axis of the elipse and
|
||||
//! if the major radius is equal to the minor radius or
|
||||
//! if an extremum is on an endpoint of the segment.
|
||||
//! If P is on the axis of the elipse,
|
||||
//! there are infinite solution then IsDone(me)=False.
|
||||
//! The conditions on the Uinf and Usup are:
|
||||
//! 0. <= Uinf <= 2.*PI and Usup > Uinf.
|
||||
//! If Usup > Uinf + 2.*PI, then only the solutions in
|
||||
//! the range [Uinf,Uinf+2.*PI[ are computed.
|
||||
Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Elips2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Elips2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the hyperbola
|
||||
//! C.
|
||||
//! Tol is used to determine if two solutions u and v
|
||||
//! are identical; the condition is:
|
||||
//! dist(C(u),C(v)) < Tol.
|
||||
Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Hypr2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Hypr2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! Calculates the 4 extremum distances between the
|
||||
//! point P and the segment [Uinf,Usup] of the parabola
|
||||
//! C.
|
||||
//! Tol is used to determine if two solutions u and v
|
||||
//! are identical; the condition is:
|
||||
//! dist(C(u),C(v)) < Tol.
|
||||
Standard_EXPORT Extrema_ExtPElC2d(const gp_Pnt2d& P, const gp_Parab2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt2d& P, const gp_Parab2d& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
|
||||
|
||||
//! True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth extremum square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns True if the Nth extremum distance is a
|
||||
//! minimum.
|
||||
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth extremum distance.
|
||||
Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[4];
|
||||
Standard_Boolean myIsMin[4];
|
||||
Extrema_POnCurv2d myPoint[4];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPElC2d_HeaderFile
|
@@ -1,112 +0,0 @@
|
||||
-- Created on: 1991-02-21
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1991-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 ExtPElS from Extrema
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between a point and a surface.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
Cone from gp,
|
||||
Pln from gp,
|
||||
Cylinder from gp,
|
||||
Pnt from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange
|
||||
|
||||
is
|
||||
Create returns ExtPElS;
|
||||
|
||||
Create (P: Pnt; S: Cylinder; Tol: Real) returns ExtPElS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a cylinder from gp.
|
||||
-- Tol is used to test if the point is on the axis.
|
||||
|
||||
Perform(me: in out; P: Pnt; S: Cylinder; Tol: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt; S: Pln; Tol: Real) returns ExtPElS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a plane from gp.
|
||||
-- Tol is used to test if the point is on the plane.
|
||||
|
||||
Perform(me: in out; P: Pnt; S: Pln; Tol: Real)
|
||||
is static;
|
||||
|
||||
|
||||
Create (P: Pnt; S: Cone; Tol: Real) returns ExtPElS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a cone from gp.
|
||||
-- Tol is used to test if the point is at the apex or
|
||||
-- on the axis.
|
||||
|
||||
Perform(me: in out;P: Pnt; S: Cone; Tol: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt; S: Torus; Tol: Real) returns ExtPElS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a torus from gp.
|
||||
-- Tol is used to test if the point is on the axis.
|
||||
|
||||
Perform(me: in out; P: Pnt; S: Torus; Tol: Real)
|
||||
is static;
|
||||
|
||||
Create (P: Pnt; S: Sphere; Tol: Real) returns ExtPElS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a sphere from gp.
|
||||
-- Tol is used to test if the point is at the center.
|
||||
|
||||
Perform(me: in out; P: Pnt; S: Sphere; Tol: Real)
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myNbExt: Integer;
|
||||
mySqDist: Real [4];
|
||||
myPoint: POnSurf from Extrema [4];
|
||||
|
||||
end ExtPElS;
|
@@ -12,11 +12,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtPElS.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
static const Standard_Real ExtPElS_MyEps = Epsilon(2. * M_PI);
|
||||
//=============================================================================
|
||||
|
||||
|
126
src/Extrema/Extrema_ExtPElS.hxx
Normal file
126
src/Extrema/Extrema_ExtPElS.hxx
Normal file
@@ -0,0 +1,126 @@
|
||||
// Created on: 1991-02-21
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtPElS_HeaderFile
|
||||
#define _Extrema_ExtPElS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
class gp_Cylinder;
|
||||
class gp_Pln;
|
||||
class gp_Cone;
|
||||
class gp_Torus;
|
||||
class gp_Sphere;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between a point and a surface.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_ExtPElS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPElS();
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and a cylinder from gp.
|
||||
//! Tol is used to test if the point is on the axis.
|
||||
Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol);
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and a plane from gp.
|
||||
//! Tol is used to test if the point is on the plane.
|
||||
Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol);
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and a cone from gp.
|
||||
//! Tol is used to test if the point is at the apex or
|
||||
//! on the axis.
|
||||
Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol);
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and a torus from gp.
|
||||
//! Tol is used to test if the point is on the axis.
|
||||
Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol);
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! and a sphere from gp.
|
||||
//! Tol is used to test if the point is at the center.
|
||||
Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[4];
|
||||
Extrema_POnSurf myPoint[4];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPElS_HeaderFile
|
@@ -1,122 +0,0 @@
|
||||
-- Created on: 1999-09-16
|
||||
-- Created by: Edward AGAPOV
|
||||
-- Copyright (c) 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 ExtPExtS from Extrema inherits Transient from Standard
|
||||
|
||||
---Purpose: It calculates all the extremum (minimum and
|
||||
-- maximum) distances between a point and a linear
|
||||
-- extrusion surface.
|
||||
|
||||
uses
|
||||
POnSurf from Extrema,
|
||||
GenExtPS from Extrema,
|
||||
FuncExtPS from Extrema,
|
||||
|
||||
HCurve from Adaptor3d,
|
||||
|
||||
HSurfaceOfLinearExtrusion from Adaptor3d,
|
||||
|
||||
Ax2 from gp,
|
||||
Vec from gp,
|
||||
Pnt from gp
|
||||
|
||||
raises
|
||||
NotDone from StdFail,
|
||||
OutOfRange
|
||||
|
||||
|
||||
is
|
||||
Create returns ExtPExtS;
|
||||
|
||||
Create (P: Pnt; S: HSurfaceOfLinearExtrusion from Adaptor3d;
|
||||
Umin, Usup, Vmin, Vsup: Real;
|
||||
TolU,TolV: Real)
|
||||
returns ExtPExtS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- from gp and a Surface.
|
||||
|
||||
Create (P: Pnt; S: HSurfaceOfLinearExtrusion from Adaptor3d;
|
||||
TolU,TolV: Real)
|
||||
returns ExtPExtS;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- from gp and a Surface.
|
||||
|
||||
Initialize(me: mutable; S: HSurfaceOfLinearExtrusion from Adaptor3d;
|
||||
Uinf, Usup, Vinf, Vsup: Real;
|
||||
TolU, TolV: Real)
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
Perform(me: mutable; P: Pnt)
|
||||
is static;
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
--- Private methods
|
||||
|
||||
MakePreciser (me; U : in out Real from Standard;
|
||||
P : Pnt from gp;
|
||||
isMin : Boolean from Standard;
|
||||
OrtogSection: Ax2 from gp) is static private;
|
||||
|
||||
fields
|
||||
myuinf : Real from Standard;
|
||||
myusup : Real from Standard;
|
||||
mytolu : Real from Standard;
|
||||
myvinf : Real from Standard;
|
||||
myvsup : Real from Standard;
|
||||
mytolv : Real from Standard;
|
||||
|
||||
myF : FuncExtPS from Extrema;
|
||||
myC : HCurve from Adaptor3d;
|
||||
myS : HSurfaceOfLinearExtrusion from Adaptor3d;
|
||||
myDirection : Vec from gp;
|
||||
myPosition : Ax2 from gp;
|
||||
myExtPS : GenExtPS from Extrema;
|
||||
|
||||
myIsAnalyticallyComputable : Boolean from Standard;
|
||||
|
||||
myDone : Boolean from Standard;
|
||||
myNbExt: Integer from Standard;
|
||||
mySqDist: Real from Standard [4];
|
||||
myPoint: POnSurf from Extrema [4];
|
||||
|
||||
end ExtPExtS;
|
122
src/Extrema/Extrema_ExtPExtS.hxx
Normal file
122
src/Extrema/Extrema_ExtPExtS.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1999-09-16
|
||||
// Created by: Edward AGAPOV
|
||||
// Copyright (c) 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 _Extrema_ExtPExtS_HeaderFile
|
||||
#define _Extrema_ExtPExtS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_FuncExtPS.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor3d_HSurfaceOfLinearExtrusion;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
class Extrema_POnSurf;
|
||||
class gp_Ax2;
|
||||
|
||||
|
||||
class Extrema_ExtPExtS;
|
||||
DEFINE_STANDARD_HANDLE(Extrema_ExtPExtS, Standard_Transient)
|
||||
|
||||
//! It calculates all the extremum (minimum and
|
||||
//! maximum) distances between a point and a linear
|
||||
//! extrusion surface.
|
||||
class Extrema_ExtPExtS : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPExtS();
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! from gp and a Surface.
|
||||
Standard_EXPORT Extrema_ExtPExtS(const gp_Pnt& P, const Handle(Adaptor3d_HSurfaceOfLinearExtrusion)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! from gp and a Surface.
|
||||
Standard_EXPORT Extrema_ExtPExtS(const gp_Pnt& P, const Handle(Adaptor3d_HSurfaceOfLinearExtrusion)& S, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
Standard_EXPORT void Initialize (const Handle(Adaptor3d_HSurfaceOfLinearExtrusion)& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Extrema_ExtPExtS,Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void MakePreciser (Standard_Real& U, const gp_Pnt& P, const Standard_Boolean isMin, const gp_Ax2& OrtogSection) const;
|
||||
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real myvinf;
|
||||
Standard_Real myvsup;
|
||||
Standard_Real mytolv;
|
||||
Extrema_FuncExtPS myF;
|
||||
Handle(Adaptor3d_HCurve) myC;
|
||||
Handle(Adaptor3d_HSurfaceOfLinearExtrusion) myS;
|
||||
gp_Vec myDirection;
|
||||
gp_Ax2 myPosition;
|
||||
Extrema_GenExtPS myExtPS;
|
||||
Standard_Boolean myIsAnalyticallyComputable;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[4];
|
||||
Extrema_POnSurf myPoint[4];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPExtS_HeaderFile
|
@@ -1,105 +0,0 @@
|
||||
-- Created on: 1999-09-21
|
||||
-- Created by: Edward AGAPOV
|
||||
-- Copyright (c) 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 ExtPRevS from Extrema inherits Transient from Standard
|
||||
|
||||
---Purpose: It calculates all the extremum (minimum and
|
||||
-- maximum) distances between a point and a surface
|
||||
-- of revolution.
|
||||
|
||||
uses
|
||||
POnSurf from Extrema,
|
||||
GenExtPS from Extrema,
|
||||
|
||||
HSurfaceOfRevolution from Adaptor3d,
|
||||
|
||||
Ax2 from gp,
|
||||
Pnt from gp
|
||||
|
||||
raises
|
||||
NotDone from StdFail,
|
||||
OutOfRange
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns ExtPRevS from Extrema;
|
||||
|
||||
Create (P: Pnt; S: HSurfaceOfRevolution from Adaptor3d;
|
||||
Umin, Usup, Vmin, Vsup: Real;
|
||||
TolU,TolV: Real)
|
||||
returns ExtPRevS from Extrema;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- from gp and a SurfacePtr from Adaptor3d.
|
||||
|
||||
Create (P: Pnt; S: HSurfaceOfRevolution from Adaptor3d;
|
||||
TolU,TolV: Real)
|
||||
returns ExtPRevS from Extrema;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- from gp and a SurfacePtr from Adaptor3d.
|
||||
|
||||
Initialize(me: mutable; S: HSurfaceOfRevolution from Adaptor3d;
|
||||
Umin, Usup, Vmin, Vsup: Real;
|
||||
TolU,TolV: Real)
|
||||
is static;
|
||||
|
||||
Perform (me: mutable; P: Pnt)
|
||||
is static;
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
fields
|
||||
myS : HSurfaceOfRevolution from Adaptor3d;
|
||||
myvinf : Real from Standard;
|
||||
myvsup : Real from Standard;
|
||||
mytolv : Real from Standard;
|
||||
|
||||
myPosition : Ax2 from gp;
|
||||
myExtPS : GenExtPS from Extrema;
|
||||
|
||||
myIsAnalyticallyComputable : Boolean from Standard;
|
||||
|
||||
myDone : Boolean;
|
||||
myNbExt: Integer;
|
||||
mySqDist: Real [8];
|
||||
myPoint: POnSurf from Extrema [8];
|
||||
|
||||
end ExtPRevS;
|
@@ -14,9 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtPRevS.ixx>
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_ExtPRevS.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
@@ -28,7 +31,9 @@
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
static gp_Ax2 GetPosition (const Adaptor3d_SurfaceOfRevolution& S)//const Handle(Adaptor_HCurve)& C)
|
||||
{
|
||||
|
109
src/Extrema/Extrema_ExtPRevS.hxx
Normal file
109
src/Extrema/Extrema_ExtPRevS.hxx
Normal file
@@ -0,0 +1,109 @@
|
||||
// Created on: 1999-09-21
|
||||
// Created by: Edward AGAPOV
|
||||
// Copyright (c) 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 _Extrema_ExtPRevS_HeaderFile
|
||||
#define _Extrema_ExtPRevS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
class Adaptor3d_HSurfaceOfRevolution;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
class Extrema_ExtPRevS;
|
||||
DEFINE_STANDARD_HANDLE(Extrema_ExtPRevS, Standard_Transient)
|
||||
|
||||
//! It calculates all the extremum (minimum and
|
||||
//! maximum) distances between a point and a surface
|
||||
//! of revolution.
|
||||
class Extrema_ExtPRevS : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPRevS();
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! from gp and a SurfacePtr from Adaptor3d.
|
||||
Standard_EXPORT Extrema_ExtPRevS(const gp_Pnt& P, const Handle(Adaptor3d_HSurfaceOfRevolution)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
//! It calculates all the distances between a point
|
||||
//! from gp and a SurfacePtr from Adaptor3d.
|
||||
Standard_EXPORT Extrema_ExtPRevS(const gp_Pnt& P, const Handle(Adaptor3d_HSurfaceOfRevolution)& S, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
Standard_EXPORT void Initialize (const Handle(Adaptor3d_HSurfaceOfRevolution)& S, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Extrema_ExtPRevS,Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Adaptor3d_HSurfaceOfRevolution) myS;
|
||||
Standard_Real myvinf;
|
||||
Standard_Real myvsup;
|
||||
Standard_Real mytolv;
|
||||
gp_Ax2 myPosition;
|
||||
Extrema_GenExtPS myExtPS;
|
||||
Standard_Boolean myIsAnalyticallyComputable;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Integer myNbExt;
|
||||
Standard_Real mySqDist[8];
|
||||
Extrema_POnSurf myPoint[8];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPRevS_HeaderFile
|
@@ -1,174 +0,0 @@
|
||||
-- Created on: 1994-02-01
|
||||
-- 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 ExtPS from Extrema
|
||||
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between a point and a surface.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses
|
||||
POnSurf from Extrema,
|
||||
ExtPElS from Extrema,
|
||||
Pnt from gp,
|
||||
SurfaceType from GeomAbs,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
SequenceOfReal from TColStd,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d,
|
||||
GenExtPS from Extrema,
|
||||
ExtFlag from Extrema,
|
||||
ExtAlgo from Extrema,
|
||||
ExtPExtS from Extrema,
|
||||
ExtPRevS from Extrema
|
||||
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
|
||||
is
|
||||
Create returns ExtPS;
|
||||
|
||||
|
||||
Create (P: Pnt from gp; S: Surface from Adaptor3d; TolU,TolV: Real;
|
||||
F : ExtFlag from Extrema = Extrema_ExtFlag_MINMAX;
|
||||
A : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
returns ExtPS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- NbU and NbV are used to locate the close points
|
||||
-- to find the zeros. They must be great enough
|
||||
-- such that if there is N extrema, there will
|
||||
-- be N extrema between P and the grid.
|
||||
-- TolU et TolV are used to determine the conditions
|
||||
-- to stop the iterations; at the iteration number n:
|
||||
-- (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
|
||||
Create (P: Pnt from gp; S: Surface from Adaptor3d;
|
||||
Uinf, Usup, Vinf, Vsup: Real;
|
||||
TolU,TolV: Real;
|
||||
F : ExtFlag from Extrema = Extrema_ExtFlag_MINMAX;
|
||||
A : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
returns ExtPS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- NbU and NbV are used to locate the close points
|
||||
-- to find the zeros. They must be great enough
|
||||
-- such that if there is N extrema, there will
|
||||
-- be N extrema between P and the grid.
|
||||
-- TolU et TolV are used to determine the conditions
|
||||
-- to stop the iterations; at the iteration number n:
|
||||
-- (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d;
|
||||
Uinf, Usup, Vinf, Vsup: Real;
|
||||
TolU, TolV: Real)
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
is static;
|
||||
|
||||
Perform(me: in out; P: Pnt from gp)
|
||||
---Purpose: Computes the distances.
|
||||
-- An exception is raised if the fieds have not been
|
||||
-- initialized.
|
||||
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
TrimmedSquareDistances(me; dUfVf, dUfVl, dUlVf, dUlVl: out Real;
|
||||
PUfVf, PUfVl, PUlVf, PUlVl: out Pnt)
|
||||
---Purpose: if the surface is a trimmed surface,
|
||||
-- dUfVf is a square distance between <P> and the point
|
||||
-- of parameter FirstUParameter and FirstVParameter <PUfVf>.
|
||||
-- dUfVl is a square distance between <P> and the point
|
||||
-- of parameter FirstUParameter and LastVParameter <PUfVl>.
|
||||
-- dUlVf is a square distance between <P> and the point
|
||||
-- of parameter LastUParameter and FirstVParameter <PUlVf>.
|
||||
-- dUlVl is a square distance between <P> and the point
|
||||
-- of parameter LastUParameter and LastVParameter <PUlVl>.
|
||||
is static;
|
||||
|
||||
SetFlag(me : in out; F : ExtFlag from Extrema)
|
||||
is static;
|
||||
|
||||
SetAlgo(me : in out; A : ExtAlgo from Extrema)
|
||||
is static;
|
||||
|
||||
|
||||
Bidon(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
-- modified by NIZHNY-EAP Fri Oct 29 09:44:34 1999 ___BEGIN___
|
||||
TreatSolution (me:in out; PS: POnSurf from Extrema;
|
||||
Val: Real from Standard)
|
||||
is static private;
|
||||
-- modified by NIZHNY-EAP Fri Oct 29 09:44:37 1999 ___END___
|
||||
fields
|
||||
myS : SurfacePtr from Adaptor3d;
|
||||
myDone : Boolean from Standard;
|
||||
myExtPElS : ExtPElS from Extrema;
|
||||
myExtPS : GenExtPS from Extrema;
|
||||
myPoints : SequenceOfPOnSurf from Extrema;
|
||||
myuinf : Real from Standard;
|
||||
myusup : Real from Standard;
|
||||
myvinf : Real from Standard;
|
||||
myvsup : Real from Standard;
|
||||
mytolu : Real from Standard;
|
||||
mytolv : Real from Standard;
|
||||
d11 : Real from Standard;
|
||||
d12 : Real from Standard;
|
||||
d21 : Real from Standard;
|
||||
d22 : Real from Standard;
|
||||
P11 : Pnt from gp;
|
||||
P12 : Pnt from gp;
|
||||
P21 : Pnt from gp;
|
||||
P22 : Pnt from gp;
|
||||
mySqDist : SequenceOfReal from TColStd;
|
||||
mytype : SurfaceType from GeomAbs;
|
||||
myExtPExtS : ExtPExtS from Extrema;
|
||||
myExtPRevS : ExtPRevS from Extrema;
|
||||
|
||||
end ExtPS;
|
@@ -14,31 +14,33 @@
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
#include <Extrema_ExtPS.ixx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfLinearExtrusion.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Extrema_ExtPExtS.hxx>
|
||||
#include <Extrema_ExtPRevS.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IsoIsDeg
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S,
|
||||
const Standard_Real Param,
|
||||
const GeomAbs_IsoType IT,
|
||||
|
163
src/Extrema/Extrema_ExtPS.hxx
Normal file
163
src/Extrema/Extrema_ExtPS.hxx
Normal file
@@ -0,0 +1,163 @@
|
||||
// Created on: 1994-02-01
|
||||
// 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 _Extrema_ExtPS_HeaderFile
|
||||
#define _Extrema_ExtPS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Extrema_ExtPExtS;
|
||||
class Extrema_ExtPRevS;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class gp_Pnt;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between a point and a surface.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_ExtPS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtPS();
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! NbU and NbV are used to locate the close points
|
||||
//! to find the zeros. They must be great enough
|
||||
//! such that if there is N extrema, there will
|
||||
//! be N extrema between P and the grid.
|
||||
//! TolU et TolV are used to determine the conditions
|
||||
//! to stop the iterations; at the iteration number n:
|
||||
//! (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
Standard_EXPORT Extrema_ExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S, const Standard_Real TolU, const Standard_Real TolV, const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! NbU and NbV are used to locate the close points
|
||||
//! to find the zeros. They must be great enough
|
||||
//! such that if there is N extrema, there will
|
||||
//! be N extrema between P and the grid.
|
||||
//! TolU et TolV are used to determine the conditions
|
||||
//! to stop the iterations; at the iteration number n:
|
||||
//! (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
Standard_EXPORT Extrema_ExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV, const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
//! Computes the distances.
|
||||
//! An exception is raised if the fieds have not been
|
||||
//! initialized.
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
//! if the surface is a trimmed surface,
|
||||
//! dUfVf is a square distance between <P> and the point
|
||||
//! of parameter FirstUParameter and FirstVParameter <PUfVf>.
|
||||
//! dUfVl is a square distance between <P> and the point
|
||||
//! of parameter FirstUParameter and LastVParameter <PUfVl>.
|
||||
//! dUlVf is a square distance between <P> and the point
|
||||
//! of parameter LastUParameter and FirstVParameter <PUlVf>.
|
||||
//! dUlVl is a square distance between <P> and the point
|
||||
//! of parameter LastUParameter and LastVParameter <PUlVl>.
|
||||
Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dUfVf, Standard_Real& dUfVl, Standard_Real& dUlVf, Standard_Real& dUlVl, gp_Pnt& PUfVf, gp_Pnt& PUfVl, gp_Pnt& PUlVf, gp_Pnt& PUlVl) const;
|
||||
|
||||
Standard_EXPORT void SetFlag (const Extrema_ExtFlag F);
|
||||
|
||||
Standard_EXPORT void SetAlgo (const Extrema_ExtAlgo A);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
Standard_EXPORT void TreatSolution (const Extrema_POnSurf& PS, const Standard_Real Val);
|
||||
|
||||
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
Standard_Boolean myDone;
|
||||
Extrema_ExtPElS myExtPElS;
|
||||
Extrema_GenExtPS myExtPS;
|
||||
Extrema_SequenceOfPOnSurf myPoints;
|
||||
Standard_Real myuinf;
|
||||
Standard_Real myusup;
|
||||
Standard_Real myvinf;
|
||||
Standard_Real myvsup;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolv;
|
||||
Standard_Real d11;
|
||||
Standard_Real d12;
|
||||
Standard_Real d21;
|
||||
Standard_Real d22;
|
||||
gp_Pnt P11;
|
||||
gp_Pnt P12;
|
||||
gp_Pnt P21;
|
||||
gp_Pnt P22;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
GeomAbs_SurfaceType mytype;
|
||||
Handle(Extrema_ExtPExtS) myExtPExtS;
|
||||
Handle(Extrema_ExtPRevS) myExtPRevS;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtPS_HeaderFile
|
@@ -1,127 +0,0 @@
|
||||
-- Created on: 1991-02-21
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1991-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 ExtSS from Extrema
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between two surfaces.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
ExtElSS from Extrema,
|
||||
Pnt from gp,
|
||||
SurfaceType from GeomAbs,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
SequenceOfReal from TColStd,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d
|
||||
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
is
|
||||
Create returns ExtSS;
|
||||
|
||||
|
||||
Create (S1, S2: Surface from Adaptor3d; TolS1, TolS2: Real)
|
||||
returns ExtSS;
|
||||
---Purpose: It calculates all the distances between S1 and S2.
|
||||
|
||||
|
||||
Create (S1, S2: Surface from Adaptor3d;
|
||||
Uinf1, Usup1, Vinf1, Vsup1: Real;
|
||||
Uinf2, Usup2, Vinf2, Vsup2: Real;
|
||||
TolS1, TolS2: Real)
|
||||
returns ExtSS;
|
||||
---Purpose: It calculates all the distances between S1 and S2.
|
||||
|
||||
|
||||
Initialize(me: in out; S2: Surface from Adaptor3d;
|
||||
Uinf2, Usup2, Vinf2, Vsup2: Real; TolS1: Real)
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
is static;
|
||||
|
||||
Perform(me: in out; S1: Surface from Adaptor3d;
|
||||
Uinf1, Usup1, Vinf1, Vsup1: Real; TolS1: Real)
|
||||
---Purpose: Computes the distances.
|
||||
-- An exception is raised if the fieds have not been
|
||||
-- initialized.
|
||||
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns True if the curve is on a parallel surface.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1: out POnSurf; P2: out POnSurf)
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Bidon(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
|
||||
fields
|
||||
myS2 : SurfacePtr from Adaptor3d;
|
||||
myDone : Boolean from Standard;
|
||||
myIsPar : Boolean from Standard;
|
||||
myExtElSS: ExtElSS from Extrema;
|
||||
myPOnS1 : SequenceOfPOnSurf from Extrema;
|
||||
myPOnS2 : SequenceOfPOnSurf from Extrema;
|
||||
myuinf1 : Real from Standard;
|
||||
myusup1 : Real from Standard;
|
||||
myvinf1 : Real from Standard;
|
||||
myvsup1 : Real from Standard;
|
||||
myuinf2 : Real from Standard;
|
||||
myusup2 : Real from Standard;
|
||||
myvinf2 : Real from Standard;
|
||||
myvsup2 : Real from Standard;
|
||||
mytolS1 : Real from Standard;
|
||||
mytolS2 : Real from Standard;
|
||||
mySqDist : SequenceOfReal from TColStd;
|
||||
myStype : SurfaceType from GeomAbs;
|
||||
|
||||
end ExtSS;
|
@@ -14,18 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_ExtSS.ixx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
|
||||
#include <Extrema_GenExtSS.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtSS.hxx>
|
||||
#include <Extrema_GenExtSS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtSS::Extrema_ExtSS()
|
||||
{
|
||||
|
123
src/Extrema/Extrema_ExtSS.hxx
Normal file
123
src/Extrema/Extrema_ExtSS.hxx
Normal file
@@ -0,0 +1,123 @@
|
||||
// Created on: 1991-02-21
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1991-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 _Extrema_ExtSS_HeaderFile
|
||||
#define _Extrema_ExtSS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Extrema_ExtElSS.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between two surfaces.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_ExtSS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_ExtSS();
|
||||
|
||||
//! It calculates all the distances between S1 and S2.
|
||||
Standard_EXPORT Extrema_ExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Real TolS1, const Standard_Real TolS2);
|
||||
|
||||
//! It calculates all the distances between S1 and S2.
|
||||
Standard_EXPORT Extrema_ExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Real Uinf1, const Standard_Real Usup1, const Standard_Real Vinf1, const Standard_Real Vsup1, const Standard_Real Uinf2, const Standard_Real Usup2, const Standard_Real Vinf2, const Standard_Real Vsup2, const Standard_Real TolS1, const Standard_Real TolS2);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S2, const Standard_Real Uinf2, const Standard_Real Usup2, const Standard_Real Vinf2, const Standard_Real Vsup2, const Standard_Real TolS1);
|
||||
|
||||
//! Computes the distances.
|
||||
//! An exception is raised if the fieds have not been
|
||||
//! initialized.
|
||||
Standard_EXPORT void Perform (const Adaptor3d_Surface& S1, const Standard_Real Uinf1, const Standard_Real Usup1, const Standard_Real Vinf1, const Standard_Real Vsup1, const Standard_Real TolS1);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns True if the curve is on a parallel surface.
|
||||
Standard_EXPORT Standard_Boolean IsParallel() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnSurf& P1, Extrema_POnSurf& P2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
|
||||
Adaptor3d_SurfacePtr myS2;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsPar;
|
||||
Extrema_ExtElSS myExtElSS;
|
||||
Extrema_SequenceOfPOnSurf myPOnS1;
|
||||
Extrema_SequenceOfPOnSurf myPOnS2;
|
||||
Standard_Real myuinf1;
|
||||
Standard_Real myusup1;
|
||||
Standard_Real myvinf1;
|
||||
Standard_Real myvsup1;
|
||||
Standard_Real myuinf2;
|
||||
Standard_Real myusup2;
|
||||
Standard_Real myvinf2;
|
||||
Standard_Real myvsup2;
|
||||
Standard_Real mytolS1;
|
||||
Standard_Real mytolS2;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
GeomAbs_SurfaceType myStype;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_ExtSS_HeaderFile
|
@@ -1,131 +0,0 @@
|
||||
-- Created on: 1991-07-24
|
||||
-- Created by: Michel CHAUVAT
|
||||
-- Copyright (c) 1991-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.
|
||||
|
||||
private generic class FuncExtCC from Extrema
|
||||
(Curve1 as any;
|
||||
Tool1 as any;-- as ToolCurve(Curve1);
|
||||
Curve2 as any;
|
||||
Tool2 as any;-- as ToolCurve(Curve2);
|
||||
POnC as any;
|
||||
Pnt as any;
|
||||
Vec as any )
|
||||
|
||||
|
||||
inherits FunctionSetWithDerivatives from math
|
||||
---Purpose: Function allows finding extrema of the distance between 2 curves.
|
||||
|
||||
uses Vector from math,
|
||||
Matrix from math,
|
||||
SequenceOfReal from TColStd
|
||||
|
||||
raises OutOfRange from Standard
|
||||
|
||||
private class SeqPOnC instantiates Sequence from TCollection(POnC);
|
||||
|
||||
is
|
||||
|
||||
Create (thetol: Real = 1.0e-10) returns FuncExtCC;
|
||||
---Purpose:
|
||||
|
||||
Create (C1: Curve1; C2: Curve2; thetol: Real = 1.0e-10) returns FuncExtCC;
|
||||
---Purpose:
|
||||
|
||||
SetCurve (me: in out; theRank: Integer; C1: Curve1);
|
||||
---Purpose:
|
||||
|
||||
SetTolerance (me: in out; theTol: Real);
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
|
||||
NbVariables (me) returns Integer is redefined;
|
||||
---C++: inline
|
||||
|
||||
NbEquations (me) returns Integer is redefined;
|
||||
---C++: inline
|
||||
|
||||
Value (me: in out; UV: Vector; F: out Vector) returns Boolean is redefined;
|
||||
---Purpose: Calculate Fi(U,V).
|
||||
|
||||
Derivatives (me: in out; UV: Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculate Fi'(U,V).
|
||||
|
||||
Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculate Fi(U,V) and Fi'(U,V).
|
||||
|
||||
GetStateNumber (me: in out) returns Integer
|
||||
---Purpose: Save the found extremum.
|
||||
is redefined;
|
||||
|
||||
NbExt (me) returns Integer;
|
||||
---C++: inline
|
||||
---Purpose: Return the number of found extrema.
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---C++: inline
|
||||
---Purpose: Return the value of the Nth distance.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnC)
|
||||
---Purpose: Return the points of the Nth extreme distance.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
CurvePtr (me; theRank: Integer) returns Address;
|
||||
---C++: inline
|
||||
---Purpose: Returns a pointer to the curve specified in the constructor
|
||||
-- or in SetCurve() method.
|
||||
|
||||
Tolerance (me) returns Real;
|
||||
---C++: inline
|
||||
---Purpose: Returns a tolerance specified in the constructor
|
||||
-- or in SetTolerance() method.
|
||||
|
||||
SubIntervalInitialize(me: in out; theUfirst, theUlast: Vector);
|
||||
---Purpose: Determines of boundaries of subinterval for find of root.
|
||||
|
||||
SearchOfTolerance(me: in out; C: Address from Standard) returns Real from Standard;
|
||||
---Purpose: Computes a Tol value. If 1st derivative of curve
|
||||
-- |D1|<Tol, it is considered D1=0.
|
||||
|
||||
|
||||
fields
|
||||
myC1 : Address from Standard;
|
||||
myC2 : Address from Standard;
|
||||
myTol : Real;
|
||||
myU : Real;
|
||||
myV : Real;
|
||||
myP1 : Pnt; -- current point C1(U)
|
||||
myP2 : Pnt; -- current point C2(U)
|
||||
myDu : Vec; -- current D1 C1(U)
|
||||
myDv : Vec; -- current D1 C2(V)
|
||||
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
myPoints: SeqPOnC;
|
||||
|
||||
myTolC1,myTolC2: Real from Standard; -- toolerance for derivate
|
||||
|
||||
--Supremum of search 1st non-zero derivative
|
||||
myMaxDerivOrderC1, myMaxDerivOrderC2: Integer from Standard;
|
||||
|
||||
--boundaries of subinterval for find of root
|
||||
myUinfium, myUsupremum: Real from Standard; -- C1 curve
|
||||
myVinfium, myVsupremum: Real from Standard; -- C2 curve
|
||||
|
||||
|
||||
end FuncExtCC;
|
@@ -1,116 +0,0 @@
|
||||
-- Created on: 1996-01-22
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
private class FuncExtCS from Extrema
|
||||
|
||||
inherits FunctionSetWithDerivatives from math
|
||||
---Purpose: Function to find extrema of the
|
||||
-- distance between a curve and a surface.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
POnCurv from Extrema,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
SequenceOfPOnCurv from Extrema,
|
||||
SequenceOfReal from TColStd,
|
||||
Pnt from gp,
|
||||
Vector from math,
|
||||
Matrix from math,
|
||||
Curve from Adaptor3d,
|
||||
CurvePtr from Adaptor3d,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d
|
||||
|
||||
raises OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns FuncExtCS;
|
||||
|
||||
Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d) returns FuncExtCS;
|
||||
---Purpose:
|
||||
|
||||
Initialize(me: in out; C: Curve from Adaptor3d; S: Surface from Adaptor3d)
|
||||
---Purpose: sets the field mysurf of the function.
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------
|
||||
-- In all next methods, an exception is raised if the fields
|
||||
-- were not initialized.
|
||||
|
||||
NbVariables (me) returns Integer;
|
||||
|
||||
NbEquations (me) returns Integer;
|
||||
|
||||
Value (me: in out; UV: Vector; F: out Vector) returns Boolean;
|
||||
---Purpose: Calculation of Fi(U,V).
|
||||
|
||||
Derivatives (me: in out; UV: Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculation of Fi'(U,V).
|
||||
|
||||
Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculation of Fi(U,V) and Fi'(U,V).
|
||||
|
||||
GetStateNumber (me: in out) returns Integer
|
||||
---Purpose: Save the found extremum.
|
||||
is redefined;
|
||||
|
||||
NbExt (me) returns Integer;
|
||||
---Purpose: Return the number of found extrema.
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Return the value of the Nth distance.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
PointOnCurve (me; N: Integer) returns POnCurv
|
||||
---Purpose: Returns the Nth extremum on C.
|
||||
---C++: return const&
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
PointOnSurface (me; N: Integer) returns POnSurf
|
||||
---Purpose: Return the Nth extremum on S.
|
||||
---C++: return const&
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
Bidon1(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
Bidon2(me) returns CurvePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
|
||||
fields
|
||||
myC : CurvePtr from Adaptor3d;
|
||||
myS : SurfacePtr from Adaptor3d;
|
||||
|
||||
myP1 : Pnt from gp;
|
||||
myP2 : Pnt from gp;
|
||||
|
||||
myt : Real; -- current value of U on C
|
||||
myU : Real; -- current value of U on S
|
||||
myV : Real; -- current value of V on S
|
||||
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
myPoint1: SequenceOfPOnCurv from Extrema;
|
||||
myPoint2: SequenceOfPOnSurf from Extrema;
|
||||
|
||||
myCinit: Boolean;
|
||||
mySinit: Boolean;
|
||||
|
||||
end FuncExtCS;
|
@@ -14,44 +14,42 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_FuncExtCS.ixx>
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Extrema_FuncExtCS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Fonction permettant de rechercher une distance extremale entre une courbe C
|
||||
et une surface S.
|
||||
Cette classe herite de math_FunctionWithDerivative et est utilisee par
|
||||
les algorithmes math_FunctionRoot et math_FunctionRoots.
|
||||
|
||||
{ F1(t,u,v) = (C(t)-S(u,v)).Dtc(t) }
|
||||
{ F2(t,u,v) = (C(t)-S(u,v)).Dus(u,v) }
|
||||
{ F3(t,u,v) = (C(t)-S(u,v)).Dvs(u,v) }
|
||||
|
||||
{ Dtf1(t,u,v) = Dtc(t).Dtc(t)+(C(t)-S(u,v)).Dttc(t)
|
||||
= ||Dtc(t)||**2+(C(t)-S(u,v)).Dttc(t) }
|
||||
{ Duf1(t,u,v) = -Dus(u,v).Dtc(t) }
|
||||
{ Dvf1(t,u,v) = -Dvs(u,v).Dtc(t) }
|
||||
|
||||
{ Dtf2(t,u,v) = Dtc(t).Dus(u,v) }
|
||||
{ Duf2(t,u,v) = -Dus(u,v).Dus(u,v)+(C(t)-S(u,v)).Duus(u,v)
|
||||
= -||Dus(u,v)||**2+(C(t)-S(u,v)).Duus(u,v) }
|
||||
{ Dvf2(t,u,v) = -Dvs(u,v).Dus(u,v)+(C(t)-S(u,v)).Duvs(u,v) }
|
||||
|
||||
{ Dtf3(t,u,v) = Dtc(t).Dvs(u,v) }
|
||||
{ Duf3(t,u,v) = -Dus(u,v).Dvs(u,v)+(C(t)-S(u,v)).Duvs(u,v) }
|
||||
{ Dvf3(t,u,v) = -Dvs(u,v).Dvs(u,v)+(C(t)-S(u,v)).Dvvs(u,v) }
|
||||
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_FuncExtCS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_FuncExtCS::Extrema_FuncExtCS()
|
||||
{
|
||||
myCinit = Standard_False;
|
||||
|
126
src/Extrema/Extrema_FuncExtCS.hxx
Normal file
126
src/Extrema/Extrema_FuncExtCS.hxx
Normal file
@@ -0,0 +1,126 @@
|
||||
// Created on: 1996-01-22
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1996-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 _Extrema_FuncExtCS_HeaderFile
|
||||
#define _Extrema_FuncExtCS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_CurvePtr.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Extrema_SequenceOfPOnCurv.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <math_FunctionSetWithDerivatives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Curve;
|
||||
class Adaptor3d_Surface;
|
||||
class math_Matrix;
|
||||
class Extrema_POnCurv;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! Function to find extrema of the
|
||||
//! distance between a curve and a surface.
|
||||
class Extrema_FuncExtCS : public math_FunctionSetWithDerivatives
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_FuncExtCS();
|
||||
|
||||
Standard_EXPORT Extrema_FuncExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S);
|
||||
|
||||
//! sets the field mysurf of the function.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Adaptor3d_Surface& S);
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbEquations() const;
|
||||
|
||||
//! Calculation of Fi(U,V).
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& UV, math_Vector& F);
|
||||
|
||||
//! Calculation of Fi'(U,V).
|
||||
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF);
|
||||
|
||||
//! Calculation of Fi(U,V) and Fi'(U,V).
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF);
|
||||
|
||||
//! Save the found extremum.
|
||||
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
|
||||
|
||||
//! Return the number of found extrema.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Return the value of the Nth distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the Nth extremum on C.
|
||||
Standard_EXPORT const Extrema_POnCurv& PointOnCurve (const Standard_Integer N) const;
|
||||
|
||||
//! Return the Nth extremum on S.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnSurface (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon1() const;
|
||||
|
||||
Standard_EXPORT Adaptor3d_CurvePtr Bidon2() const;
|
||||
|
||||
|
||||
Adaptor3d_CurvePtr myC;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
gp_Pnt myP1;
|
||||
gp_Pnt myP2;
|
||||
Standard_Real myt;
|
||||
Standard_Real myU;
|
||||
Standard_Real myV;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Extrema_SequenceOfPOnCurv myPoint1;
|
||||
Extrema_SequenceOfPOnSurf myPoint2;
|
||||
Standard_Boolean myCinit;
|
||||
Standard_Boolean mySinit;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_FuncExtCS_HeaderFile
|
@@ -1,124 +0,0 @@
|
||||
-- Created on: 1991-07-24
|
||||
-- Created by: Michel CHAUVAT
|
||||
-- Copyright (c) 1991-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.
|
||||
|
||||
private generic class FuncExtPC from Extrema
|
||||
(Curve as any;
|
||||
Tool as any;
|
||||
POnC as any;
|
||||
Pnt as any;
|
||||
Vec as any)
|
||||
|
||||
inherits FunctionWithDerivative from math
|
||||
--- Purpose: Function to find extrema of the distance between a
|
||||
--- point and a curve.
|
||||
|
||||
uses SequenceOfReal from TColStd,
|
||||
SequenceOfInteger from TColStd
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
private class SeqPC instantiates Sequence from TCollection(POnC);
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns FuncExtPC;
|
||||
|
||||
Create (P: Pnt; C: Curve) returns FuncExtPC;
|
||||
---Purpose:
|
||||
|
||||
Initialize(me: in out; C: Curve)
|
||||
---Purpose: sets the field mycurve of the function.
|
||||
is static;
|
||||
|
||||
SetPoint(me: in out; P: Pnt)
|
||||
---Purpose: sets the field P of the function.
|
||||
is static;
|
||||
|
||||
|
||||
-- In all next methods, an exception is raised if the fields
|
||||
-- were not initialized.
|
||||
|
||||
Value (me: in out; U: Real; F: out Real) returns Boolean;
|
||||
---Purpose: Calculation of F(U).
|
||||
|
||||
Derivative (me: in out; U: Real; DF: out Real) returns Boolean;
|
||||
---Purpose: Calculation of F'(U).
|
||||
|
||||
Values (me: in out; U: Real; F,DF: out Real) returns Boolean;
|
||||
---Purpose: Calculation of F(U) and F'(U).
|
||||
|
||||
GetStateNumber (me: in out) returns Integer
|
||||
---Purpose: Save the found extremum.
|
||||
is redefined;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Return the nunber of found extrema.
|
||||
raises TypeMismatch from Standard;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the Nth distance.
|
||||
raises OutOfRange from Standard,
|
||||
TypeMismatch from Standard;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
IsMin (me; N: Integer) returns Boolean
|
||||
---Purpose: Shows if the Nth distance is a minimum.
|
||||
raises OutOfRange from Standard,
|
||||
TypeMismatch from Standard;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
Point (me; N: Integer) returns POnC
|
||||
---C++: return const &
|
||||
---Purpose: Returns the Nth extremum.
|
||||
raises OutOfRange from Standard,
|
||||
TypeMismatch from Standard;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
SubIntervalInitialize(me: in out; theUfirst, theUlast: Real from Standard);
|
||||
---Purpose: Determines boundaries of subinterval for find of root.
|
||||
|
||||
SearchOfTolerance(me: in out) returns Real from Standard;
|
||||
---Purpose: Computes a Tol value. If 1st derivative of curve
|
||||
-- |D1|<Tol, it is considered D1=0.
|
||||
|
||||
|
||||
fields
|
||||
myP : Pnt;
|
||||
myC : Address from Standard;
|
||||
|
||||
myU : Real; -- current
|
||||
myPc : Pnt; -- current point
|
||||
myD1f : Real; -- value of derivative of the function
|
||||
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
myIsMin: SequenceOfInteger from TColStd;
|
||||
myPoint: SeqPC;
|
||||
myPinit: Boolean;
|
||||
myCinit: Boolean;
|
||||
myD1Init: Boolean;
|
||||
|
||||
myTol: Real from Standard; -- toolerance for derivate
|
||||
|
||||
--Supremum of search 1st non-zero derivative
|
||||
myMaxDerivOrder: Integer from Standard;
|
||||
|
||||
--boundaries of subinterval for find of root
|
||||
myUinfium, myUsupremum: Real from Standard;
|
||||
|
||||
|
||||
end FuncExtPC;
|
@@ -1,121 +0,0 @@
|
||||
-- Created on: 1991-07-24
|
||||
-- Created by: Michel CHAUVAT
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- Modified by skv - Thu Sep 30 15:19:59 2004 OCC593
|
||||
|
||||
|
||||
private class FuncExtPS from Extrema
|
||||
|
||||
inherits FunctionSetWithDerivatives from math
|
||||
---Purpose:
|
||||
--
|
||||
-- Functional for search of extremum of the distance between point P and
|
||||
-- surface S, starting from approximate solution (u0, v0).
|
||||
--
|
||||
-- The class inherits math_FunctionSetWithDerivatives and thus is intended
|
||||
-- for use in math_FunctionSetRoot algorithm .
|
||||
--
|
||||
-- Denoting derivatives of the surface S(u,v) by u and v, respectively, as
|
||||
-- Su and Sv, the two functions to be nullified are:
|
||||
--
|
||||
-- F1(u,v) = (S - P) * Su
|
||||
-- F2(u,v) = (S - P) * Sv
|
||||
--
|
||||
-- The derivatives of the functional are:
|
||||
--
|
||||
-- Duf1(u,v) = Su^2 + (S-P) * Suu;
|
||||
-- Dvf1(u,v) = Su * Sv + (S-P) * Suv
|
||||
-- Duf2(u,v) = Sv * Su + (S-P) * Suv = Dvf1
|
||||
-- Dvf2(u,v) = Sv^2 + (S-P) * Svv
|
||||
--
|
||||
-- Here * denotes scalar product, and ^2 is square power.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
SequenceOfReal from TColStd,
|
||||
Pnt from gp,
|
||||
Vector from math,
|
||||
Matrix from math,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d
|
||||
|
||||
raises OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns FuncExtPS;
|
||||
|
||||
Create (P: Pnt; S: Surface from Adaptor3d) returns FuncExtPS;
|
||||
---Purpose:
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d)
|
||||
---Purpose: sets the field mysurf of the function.
|
||||
is static;
|
||||
|
||||
SetPoint(me: in out; P: Pnt)
|
||||
---Purpose: sets the field mysurf of the function.
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------
|
||||
-- In all next methods, an exception is raised if the fields
|
||||
-- were not initialized.
|
||||
|
||||
NbVariables (me) returns Integer;
|
||||
|
||||
NbEquations (me) returns Integer;
|
||||
|
||||
Value (me: in out; UV: Vector; F: out Vector) returns Boolean;
|
||||
---Purpose: Calculate Fi(U,V).
|
||||
|
||||
Derivatives (me: in out; UV: Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculate Fi'(U,V).
|
||||
|
||||
Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculate Fi(U,V) and Fi'(U,V).
|
||||
|
||||
GetStateNumber (me: in out) returns Integer
|
||||
---Purpose: Save the found extremum.
|
||||
is redefined;
|
||||
|
||||
NbExt (me) returns Integer;
|
||||
---Purpose: Return the number of found extrema.
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Return the value of the Nth distance.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the Nth extremum.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
fields
|
||||
myP : Pnt from gp;
|
||||
myS : SurfacePtr from Adaptor3d;
|
||||
|
||||
myU : Real; -- current value of U
|
||||
myV : Real; -- current value of V
|
||||
myPs : Pnt from gp; -- current point
|
||||
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
myPoint: SequenceOfPOnSurf from Extrema;
|
||||
myPinit: Boolean;
|
||||
mySinit: Boolean;
|
||||
|
||||
end FuncExtPS;
|
@@ -16,13 +16,16 @@
|
||||
|
||||
// Modified by skv - Thu Sep 30 15:21:07 2004 OCC593
|
||||
|
||||
|
||||
#include <Extrema_FuncExtPS.ixx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Extrema_FuncExtPS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
|
||||
Extrema_FuncExtPS::Extrema_FuncExtPS ()
|
||||
{
|
||||
|
135
src/Extrema/Extrema_FuncExtPS.hxx
Normal file
135
src/Extrema/Extrema_FuncExtPS.hxx
Normal file
@@ -0,0 +1,135 @@
|
||||
// Created on: 1991-07-24
|
||||
// Created by: Michel CHAUVAT
|
||||
// Copyright (c) 1991-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 _Extrema_FuncExtPS_HeaderFile
|
||||
#define _Extrema_FuncExtPS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <math_FunctionSetWithDerivatives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pnt;
|
||||
class Adaptor3d_Surface;
|
||||
class math_Matrix;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
|
||||
//! Functional for search of extremum of the distance between point P and
|
||||
//! surface S, starting from approximate solution (u0, v0).
|
||||
//!
|
||||
//! The class inherits math_FunctionSetWithDerivatives and thus is intended
|
||||
//! for use in math_FunctionSetRoot algorithm .
|
||||
//!
|
||||
//! Denoting derivatives of the surface S(u,v) by u and v, respectively, as
|
||||
//! Su and Sv, the two functions to be nullified are:
|
||||
//!
|
||||
//! F1(u,v) = (S - P) * Su
|
||||
//! F2(u,v) = (S - P) * Sv
|
||||
//!
|
||||
//! The derivatives of the functional are:
|
||||
//!
|
||||
//! Duf1(u,v) = Su^2 + (S-P) * Suu;
|
||||
//! Dvf1(u,v) = Su * Sv + (S-P) * Suv
|
||||
//! Duf2(u,v) = Sv * Su + (S-P) * Suv = Dvf1
|
||||
//! Dvf2(u,v) = Sv^2 + (S-P) * Svv
|
||||
//!
|
||||
//! Here * denotes scalar product, and ^2 is square power.
|
||||
class Extrema_FuncExtPS : public math_FunctionSetWithDerivatives
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_FuncExtPS();
|
||||
|
||||
Standard_EXPORT Extrema_FuncExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S);
|
||||
|
||||
//! sets the field mysurf of the function.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S);
|
||||
|
||||
//! sets the field mysurf of the function.
|
||||
Standard_EXPORT void SetPoint (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbEquations() const;
|
||||
|
||||
//! Calculate Fi(U,V).
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& UV, math_Vector& F);
|
||||
|
||||
//! Calculate Fi'(U,V).
|
||||
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF);
|
||||
|
||||
//! Calculate Fi(U,V) and Fi'(U,V).
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF);
|
||||
|
||||
//! Save the found extremum.
|
||||
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
|
||||
|
||||
//! Return the number of found extrema.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Return the value of the Nth distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the Nth extremum.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
gp_Pnt myP;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
Standard_Real myU;
|
||||
Standard_Real myV;
|
||||
gp_Pnt myPs;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Extrema_SequenceOfPOnSurf myPoint;
|
||||
Standard_Boolean myPinit;
|
||||
Standard_Boolean mySinit;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_FuncExtPS_HeaderFile
|
@@ -1,110 +0,0 @@
|
||||
-- Created on: 1996-01-09
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
private class FuncExtSS from Extrema
|
||||
|
||||
inherits FunctionSetWithDerivatives from math
|
||||
---Purpose: Function to find extrema of the
|
||||
-- distance between two surfaces.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
SequenceOfReal from TColStd,
|
||||
Pnt from gp,
|
||||
Vector from math,
|
||||
Matrix from math,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d
|
||||
|
||||
raises OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns FuncExtSS;
|
||||
|
||||
Create (S1, S2: Surface from Adaptor3d) returns FuncExtSS;
|
||||
---Purpose:
|
||||
|
||||
Initialize(me: in out; S1, S2: Surface from Adaptor3d)
|
||||
---Purpose: sets the field mysurf of the function.
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------
|
||||
-- In all next methods, an exception is raised if the fields
|
||||
-- were not initialized.
|
||||
|
||||
NbVariables (me) returns Integer;
|
||||
|
||||
NbEquations (me) returns Integer;
|
||||
|
||||
Value (me: in out; UV: Vector; F: out Vector) returns Boolean;
|
||||
---Purpose: Calculate Fi(U,V).
|
||||
|
||||
Derivatives (me: in out; UV: Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculate Fi'(U,V).
|
||||
|
||||
Values (me: in out; UV: Vector; F: out Vector; DF: out Matrix)
|
||||
returns Boolean;
|
||||
---Purpose: Calculate Fi(U,V) and Fi'(U,V).
|
||||
|
||||
GetStateNumber (me: in out) returns Integer
|
||||
---Purpose: Save the found extremum.
|
||||
is redefined;
|
||||
|
||||
NbExt (me) returns Integer;
|
||||
---Purpose: Return the number of found extrema.
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Return the value of the Nth distance.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
PointOnS1 (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Return the Nth extremum on S1.
|
||||
raises OutOfRange;
|
||||
-- if N < 1 or N > NbExt(me).
|
||||
|
||||
PointOnS2 (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Renvoie le Nieme extremum sur S2.
|
||||
raises OutOfRange;
|
||||
-- si N < 1 ou N > NbExt(me).
|
||||
|
||||
Bidon(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
|
||||
fields
|
||||
myS1 : SurfacePtr from Adaptor3d;
|
||||
myS2 : SurfacePtr from Adaptor3d;
|
||||
|
||||
myP1 : Pnt from gp;
|
||||
myP2 : Pnt from gp;
|
||||
|
||||
myU1 : Real; -- current value of U on S1
|
||||
myV1 : Real; -- current value of V on S1
|
||||
myU2 : Real; -- current value of U on S2
|
||||
myV2 : Real; -- current value of V on S2
|
||||
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
myPoint1: SequenceOfPOnSurf from Extrema;
|
||||
myPoint2: SequenceOfPOnSurf from Extrema;
|
||||
|
||||
myS1init: Boolean;
|
||||
myS2init: Boolean;
|
||||
|
||||
end FuncExtSS;
|
@@ -14,52 +14,47 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_FuncExtSS.ixx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Extrema_FuncExtSS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Si on note Du1s et Dv1s, les derivees en u1 et v1, les 2 fonctions a annuler sont:
|
||||
Si on note Du2s et Dv2s, les derivees en u2 et v2, les 2 fonctions a annuler sont:
|
||||
|
||||
{ F1(u1,v1,u2,v2) = (S1(u1,v1)-S2(u2,v2)).Du1s1(u1,v1) }
|
||||
{ F2(u1,v1,u2,v2) = (S1(u1,v1)-S2(u2,v2)).Dv1s1(u1,v1) }
|
||||
{ F3(u1,v1,u2,v2) = (S1(u1,v1)-S2(u2,v2)).Du2s2(u2,v2) }
|
||||
{ F4(u1,v1,u2,v2) = (S1(u1,v1)-S2(u2,v2)).Dv2s2(u2,v2) }
|
||||
|
||||
{ du1f1(u1,v1,u2,v2) = Du1s1(u1,v1).Du1s1(u1,v1)+(S1(u1,v1)-S2(u2,v2)).Du1u1s1(u1,v1)
|
||||
= ||Du1s1(u1,v1)||**2 +(S1(u1,v1)-S2(u2,v2)).Du1u1s1(u1,v1) }
|
||||
{ dv1f1(u1,v1,u2,v2) = Dv1s1(u1,v1).Du1s1(u1,v1)+(S1(u1,v1)-S2(u2,v2)).Du1v1s1(u1,v1) }
|
||||
{ du2f1(u1,v1,u2,v2) = -Du2s2(u2,v2).Du1s1(u1,v1) }
|
||||
{ dv2f1(u1,v1,u2,v2) = -Dv2s2(u2,v2).Du1s1(u1,v1) }
|
||||
|
||||
{ du1f2(u1,v1,u2,v2) = Du1s1(u1,v1).Dv1s1(u1,v1)+(S1(u1,v1)-S2(u2,v2)).Du1v1s1(u1,v1) }
|
||||
{ dv1f2(u1,v1,u2,v2) = Dv1s1(u1,v1).Dv1s1(u1,v1)+(S1(u1,v1)-S2(u2,v2)).Dv1v1s1(u1,v1)
|
||||
= ||Dv1s1(u1,v1)||**2 +(S1(u1,v1)-S2(u2,v2)).Dv1v1s1(u1,v1) }
|
||||
{ du2f2(u1,v1,u2,v2) = -Du2s2(u2,v2).Dv1s1(u1,v1) }
|
||||
{ dv2f2(u1,v1,u2,v2) = -Dv2s2(u2,v2).Dv1s1(u1,v1) }
|
||||
|
||||
{ du1f3(u1,v1,u2,v2) = Du1s1(u1,v1).Du2s2(u2,v2) }
|
||||
{ dv1f3(u1,v1,u2,v2) = Dv1s1(u1,v1).Du2s2(u2,v2) }
|
||||
{ du2f3(u1,v1,u2,v2) = -Du2s2(u2,v2).Du2s2(u2,v2)+(S1(u1,v1)-S2(u2,v2)).Du2u2s2(u2,v2)
|
||||
= -||Du2s2(u2,v2)||**2 +(S1(u1,v1)-S2(u2,v2)).Du2u2s2(u2,v2) }
|
||||
{ dv2f3(u1,v1,u2,v2) = -Dv2s2(u2,v2).Du2s2(u2,v2)+(S1(u1,v1)-S2(u2,v2)).Dv2u2s2(u2,v2) }
|
||||
|
||||
{ du1f4(u1,v1,u2,v2) = Du1s1(u1,v1).Dv2s2(u2,v2) }
|
||||
{ dv1f4(u1,v1,u2,v2) = Dv1s1(u1,v1).Dv2s2(u2,v2) }
|
||||
{ du2f4(u1,v1,u2,v2) = -Du2s2(u2,v2).Dv2s2(u2,v2)+(S1(u1,v1)-S2(u2,v2)).Du2v2s2(u2,v2) }
|
||||
{ dv2f4(u1,v1,u2,v2) = -Dv2s2(u2,v2).Dv2s2(u2,v2)+(S1(u1,v1)-S2(u2,v2)).Dv2v2s2(u2,v2)
|
||||
= -||Dv2s2(u2,v2)||**2 +(S1(u1,v1)-S2(u2,v2)).Dv2v2s2(u2,v2) }
|
||||
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_FuncExtSS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_FuncExtSS::Extrema_FuncExtSS ()
|
||||
{
|
||||
myS1init = Standard_False;
|
||||
|
121
src/Extrema/Extrema_FuncExtSS.hxx
Normal file
121
src/Extrema/Extrema_FuncExtSS.hxx
Normal file
@@ -0,0 +1,121 @@
|
||||
// Created on: 1996-01-09
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1996-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 _Extrema_FuncExtSS_HeaderFile
|
||||
#define _Extrema_FuncExtSS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <math_FunctionSetWithDerivatives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Surface;
|
||||
class math_Matrix;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! Function to find extrema of the
|
||||
//! distance between two surfaces.
|
||||
class Extrema_FuncExtSS : public math_FunctionSetWithDerivatives
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_FuncExtSS();
|
||||
|
||||
Standard_EXPORT Extrema_FuncExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
|
||||
|
||||
//! sets the field mysurf of the function.
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2);
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbEquations() const;
|
||||
|
||||
//! Calculate Fi(U,V).
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& UV, math_Vector& F);
|
||||
|
||||
//! Calculate Fi'(U,V).
|
||||
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF);
|
||||
|
||||
//! Calculate Fi(U,V) and Fi'(U,V).
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF);
|
||||
|
||||
//! Save the found extremum.
|
||||
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
|
||||
|
||||
//! Return the number of found extrema.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Return the value of the Nth distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Return the Nth extremum on S1.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnS1 (const Standard_Integer N) const;
|
||||
|
||||
//! Renvoie le Nieme extremum sur S2.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
|
||||
Adaptor3d_SurfacePtr myS1;
|
||||
Adaptor3d_SurfacePtr myS2;
|
||||
gp_Pnt myP1;
|
||||
gp_Pnt myP2;
|
||||
Standard_Real myU1;
|
||||
Standard_Real myV1;
|
||||
Standard_Real myU2;
|
||||
Standard_Real myV2;
|
||||
TColStd_SequenceOfReal mySqDist;
|
||||
Extrema_SequenceOfPOnSurf myPoint1;
|
||||
Extrema_SequenceOfPOnSurf myPoint2;
|
||||
Standard_Boolean myS1init;
|
||||
Standard_Boolean myS2init;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_FuncExtSS_HeaderFile
|
@@ -1,156 +0,0 @@
|
||||
-- Created on: 1992-10-19
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1992-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 GExtPC from Extrema(
|
||||
TheCurve as any;
|
||||
TheCurveTool as any;
|
||||
TheExtPElC as any;
|
||||
ThePoint as any;
|
||||
TheVector as any;
|
||||
ThePOnC as any;
|
||||
TheSequenceOfPOnC as any)
|
||||
---Purpose: It calculates all the distances between a point and a
|
||||
-- curve. The Algorithm finds the C2 intervals on the
|
||||
-- curve.
|
||||
|
||||
uses
|
||||
SequenceOfBoolean from TColStd,
|
||||
SequenceOfReal from TColStd,
|
||||
CurveType from GeomAbs
|
||||
|
||||
raises
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
class EPC instantiates GenExtPC from Extrema
|
||||
(TheCurve,
|
||||
TheCurveTool,
|
||||
ThePOnC,
|
||||
ThePoint,
|
||||
TheVector);
|
||||
|
||||
is
|
||||
Create returns GExtPC;
|
||||
|
||||
Create(P : ThePoint;
|
||||
C : TheCurve;
|
||||
Uinf, Usup : Real from Standard;
|
||||
TolF : Real from Standard = 1.0e-10)
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u)=distance(P,C(u)) has an extremum
|
||||
-- when g(u)=dF/du=0. The algorithm searchs all the
|
||||
-- zeros inside the definition range of the curve.
|
||||
-- Zeros are searched between uinf and usup.
|
||||
-- Tol is used to decide to stop the
|
||||
-- iterations according to the following condition:
|
||||
-- if n is the number of iterations,
|
||||
-- the algorithm stops when abs(F(Un)-F(Un-1)) < Tol.
|
||||
returns GExtPC;
|
||||
|
||||
Create(P : ThePoint;
|
||||
C : TheCurve;
|
||||
TolF : Real from Standard = 1.0e-10)
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u)=distance(P,C(u)) has an extremum
|
||||
-- when g(u)=dF/du=0. The algorithm searchs all the
|
||||
-- zeros inside the definition range of the curve.
|
||||
-- Tol is used to decide to stop the
|
||||
-- iterations according to the following condition:
|
||||
-- if n is the number of iterations,
|
||||
-- the algorithm stops when abs(F(Un)-F(Un-1)) < Tol.
|
||||
returns GExtPC;
|
||||
|
||||
Initialize(me : in out; C : TheCurve;
|
||||
Uinf, Usup : Real from Standard;
|
||||
TolF : Real from Standard = 1.0e-10)
|
||||
---Purpose: initializes the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
Perform(me: in out; P: ThePoint)
|
||||
---Purpose: An exception is raised if the fields have not been
|
||||
-- initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
IntervalPerform(me: in out; P: ThePoint)
|
||||
is static protected;
|
||||
|
||||
IsDone(me) returns Boolean from Standard
|
||||
---Purpose: True if the distances are found.
|
||||
is static;
|
||||
|
||||
SquareDistance(me; N: Integer from Standard) returns Real from Standard
|
||||
---Purpose: Returns the value of the <N>th extremum square distance.
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
NbExt(me) returns Integer from Standard
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
IsMin(me; N: Integer from Standard) returns Boolean from Standard
|
||||
---Purpose: Returns True if the <N>th extremum distance is a
|
||||
-- minimum.
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
Point(me; N: Integer from Standard) returns ThePOnC
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the <N>th extremum distance.
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
TrimmedSquareDistances(me; dist1: out Real from Standard;
|
||||
dist2: out Real from Standard;
|
||||
P1: out ThePoint;
|
||||
P2: out ThePoint)
|
||||
---Purpose: if the curve is a trimmed curve,
|
||||
-- dist1 is a square distance between <P> and the point
|
||||
-- of parameter FirstParameter <P1> and
|
||||
-- dist2 is a square distance between <P> and the point
|
||||
-- of parameter LastParameter <P2>.
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
myC: Address from Standard;
|
||||
Pf: ThePoint;
|
||||
Pl: ThePoint;
|
||||
myExtPElC: TheExtPElC;
|
||||
mypoint: TheSequenceOfPOnC;
|
||||
mydone: Boolean from Standard;
|
||||
mydist1: Real from Standard;
|
||||
mydist2: Real from Standard;
|
||||
myExtPC: EPC from Extrema;
|
||||
mytolu: Real from Standard;
|
||||
mytolf: Real from Standard;
|
||||
mysample: Integer from Standard;
|
||||
myintuinf: Real from Standard;
|
||||
myintusup: Real from Standard;
|
||||
myuinf: Real from Standard;
|
||||
myusup: Real from Standard;
|
||||
type: CurveType from GeomAbs;
|
||||
myismin: SequenceOfBoolean from TColStd;
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
|
||||
end GExtPC;
|
@@ -1,138 +0,0 @@
|
||||
-- Created on: 1993-12-14
|
||||
-- Created by: Christophe MARION
|
||||
-- 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 GLocateExtPC from Extrema(
|
||||
TheCurve as any;
|
||||
TheCurveTool as any;
|
||||
TheExtPElC as any;
|
||||
ThePoint as any;
|
||||
TheVector as any;
|
||||
ThePOnC as any;
|
||||
TheSequenceOfPOnC as any)
|
||||
|
||||
---Purpose: It calculates the distance between a point and a
|
||||
-- curve with a close point.
|
||||
-- This distance can be a minimum or a maximum.
|
||||
|
||||
uses CurveType from GeomAbs
|
||||
|
||||
|
||||
raises DomainError from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
class ELPC instantiates GExtPC from Extrema
|
||||
(TheCurve,
|
||||
TheCurveTool,
|
||||
TheExtPElC,
|
||||
ThePoint,
|
||||
TheVector,
|
||||
ThePOnC,
|
||||
TheSequenceOfPOnC);
|
||||
|
||||
|
||||
class LocEPC instantiates GenLocateExtPC from Extrema
|
||||
(TheCurve,
|
||||
TheCurveTool,
|
||||
ThePOnC,
|
||||
ThePoint,
|
||||
TheVector);
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns GLocateExtPC;
|
||||
|
||||
Create (P: ThePoint; C: TheCurve; U0: Real; TolF: Real)
|
||||
returns GLocateExtPC
|
||||
---Purpose: Calculates the distance with a close point.
|
||||
-- The close point is defined by the parameter value
|
||||
-- U0.
|
||||
-- The function F(u)=distance(P,C(u)) has an extremum
|
||||
-- when g(u)=dF/du=0. The algorithm searchs a zero
|
||||
-- near the close point.
|
||||
-- TolF is used to decide to stop the iterations.
|
||||
-- At the nth iteration, the criteria is:
|
||||
-- abs(Un - Un-1) < TolF.
|
||||
raises DomainError;
|
||||
-- if U0 is outside the definition range of the curve.
|
||||
|
||||
|
||||
Create (P: ThePoint; C: TheCurve; U0: Real; Umin, Usup: Real; TolF: Real)
|
||||
returns GLocateExtPC
|
||||
---Purpose: Calculates the distance with a close point.
|
||||
-- The close point is defined by the parameter value
|
||||
-- U0.
|
||||
-- The function F(u)=distance(P,C(u)) has an extremum
|
||||
-- when g(u)=dF/du=0. The algorithm searchs a zero
|
||||
-- near the close point.
|
||||
-- Zeros are searched between Umin et Usup.
|
||||
-- TolF is used to decide to stop the iterations.
|
||||
-- At the nth iteration, the criteria is:
|
||||
-- abs(Un - Un-1) < TolF.
|
||||
raises DomainError;
|
||||
-- if U0 is outside the definition range of the curve.
|
||||
|
||||
Initialize(me: in out; C: TheCurve; Umin, Usup: Real; TolF: Real)
|
||||
---Purpose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; P: ThePoint; U0: Real)
|
||||
---Purpose:
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distance is found.
|
||||
is static;
|
||||
|
||||
SquareDistance (me) returns Real
|
||||
---Purpose: Returns the value of the extremum square distance.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
IsMin (me) returns Boolean
|
||||
---Purpose: Returns True if the extremum distance is a minimum.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
Point (me) returns ThePOnC
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the extremum distance.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
mypp: ThePOnC;
|
||||
myC: Address from Standard;
|
||||
mydist2: Real from Standard;
|
||||
myismin: Boolean from Standard;
|
||||
myDone : Boolean from Standard;
|
||||
myumin: Real from Standard;
|
||||
myusup: Real from Standard;
|
||||
mytol: Real from Standard;
|
||||
myLocExtPC: LocEPC from Extrema;
|
||||
myExtremPC: ELPC from Extrema;
|
||||
type: CurveType from GeomAbs;
|
||||
numberext: Integer from Standard;
|
||||
|
||||
end GLocateExtPC;
|
@@ -1,112 +0,0 @@
|
||||
-- Created on: 1995-07-18
|
||||
-- Created by: Modelistation
|
||||
-- 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.
|
||||
|
||||
generic class GenExtCC from Extrema
|
||||
(Curve1 as any;
|
||||
Tool1 as any; -- as ToolCurve(Curve1)
|
||||
Curve2 as any;
|
||||
Tool2 as any; -- as ToolCurve(Curve2)
|
||||
ArrayOfPnt as Transient from Standard; -- as returned by Extrema_CurveCache::Points()
|
||||
POnC as any;
|
||||
Pnt as any;
|
||||
Vec as any)
|
||||
|
||||
---Purpose: It calculates all the distance between two curves.
|
||||
-- These distances can be maximum or minimum.
|
||||
uses SequenceOfReal from TColStd,
|
||||
Vector from math
|
||||
|
||||
raises InfiniteSolutions from StdFail,
|
||||
NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns GenExtCC;
|
||||
---Purpose: Calculates all the distances as above
|
||||
-- between Uinf and Usup for C1 and between Vinf and Vsup
|
||||
-- for C2.
|
||||
|
||||
Create (C1: Curve1; C2: Curve2) returns GenExtCC;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(C1(u),C2(v)) has an
|
||||
-- extremum when gradient(f)=0. The algorithm uses
|
||||
-- Evtushenko's global optimization solver.
|
||||
|
||||
Create (C1: Curve1; C2: Curve2; Uinf, Usup, Vinf, Vsup: Real) returns GenExtCC;
|
||||
---Purpose: Calculates all the distances as above
|
||||
-- between Uinf and Usup for C1 and between Vinf and Vsup
|
||||
-- for C2.
|
||||
|
||||
SetParams (me: in out; C1: Curve1; C2: Curve2; Uinf, Usup, Vinf, Vsup: Real)
|
||||
---Purpose: Set params in case of empty constructor is usage.
|
||||
is static;
|
||||
|
||||
SetTolerance (me: in out; Tol: Real);
|
||||
---Purpose:
|
||||
|
||||
Perform (me: in out) is static;
|
||||
---Purpose: Performs calculations.
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
IsParallel (me) returns Boolean
|
||||
---Purpose: Returns state of myParallel flag.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail
|
||||
-- if IsParallel(me)= True.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer =1) returns Real
|
||||
---Purpose: Returns the value of the Nth square extremum distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True and N > 1.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
Points (me; N: Integer; P1,P2: out POnC)
|
||||
---Purpose: Returns the points of the Nth extremum distance.
|
||||
-- P1 is on the first curve, P2 on the second one.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
InfiniteSolutions from StdFail,
|
||||
-- if IsParallel(me)= True.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbExt(me)
|
||||
is static;
|
||||
|
||||
fields
|
||||
myParallel : Boolean;
|
||||
myCurveMinTol : Real from Standard;
|
||||
myLowBorder : Vector from math;
|
||||
myUppBorder : Vector from math;
|
||||
myPoints1 : SequenceOfReal from TColStd;
|
||||
myPoints2 : SequenceOfReal from TColStd;
|
||||
myC : Address from Standard [2];
|
||||
myDone : Boolean;
|
||||
|
||||
end GenExtCC;
|
@@ -1,157 +0,0 @@
|
||||
-- Created on: 1996-01-23
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1996-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 GenExtCS from Extrema
|
||||
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between acurve and a surface.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
POnCurv from Extrema,
|
||||
Pnt from gp,
|
||||
HArray1OfPnt from TColgp,
|
||||
HArray2OfPnt from TColgp,
|
||||
FuncExtCS from Extrema,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d,
|
||||
Curve from Adaptor3d,
|
||||
CurvePtr from Adaptor3d
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns GenExtCS;
|
||||
|
||||
Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d;
|
||||
NbT: Integer; NbU,NbV: Integer; Tol1,Tol2: Real)
|
||||
returns GenExtCS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an
|
||||
-- extremum when gradient(F)=0. The algorithm searchs
|
||||
-- all the zeros inside the definition ranges of the
|
||||
-- surfaces.
|
||||
-- NbU and NbV are used to locate the close points on the
|
||||
-- surface and NbT on the curve to find the zeros.
|
||||
|
||||
Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d;
|
||||
NbT,NbU,NbV: Integer;
|
||||
tmin, tsup: Real;
|
||||
Umin, Usup, Vmin, Vsup: Real;
|
||||
Tol1,Tol2: Real)
|
||||
returns GenExtCS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(P,S(u,v)) has an
|
||||
-- extremum when gradient(F)=0. The algorithm searchs
|
||||
-- all the zeros inside the definition ranges of the
|
||||
-- surface.
|
||||
-- NbT,NbU and NbV are used to locate the close points
|
||||
-- to find the zeros.
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d;
|
||||
NbU, NbV: Integer; Tol2: Real)
|
||||
---Pupose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer;
|
||||
Umin, Usup, Vmin, Vsup: Real; Tol2: Real)
|
||||
---Pupose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; C: Curve from Adaptor3d;
|
||||
NbT: Integer; Tol1: Real)
|
||||
---Purpose: the algorithm is done with S
|
||||
-- An exception is raised if the fields have not
|
||||
-- been initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
Perform(me: in out; C: Curve from Adaptor3d; NbT: Integer;
|
||||
tmin, tsup: Real; Tol1: Real)
|
||||
---Purpose: the algorithm is done with C
|
||||
-- An exception is raised if the fields have not
|
||||
-- been initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance(me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
PointOnCurve (me; N: Integer) returns POnCurv
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
---C++: return const&
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
PointOnSurface (me; N: Integer) returns POnSurf
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
---C++: return const&
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
BidonCurve(me) returns CurvePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
BidonSurface(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myInit : Boolean;
|
||||
mytmin : Real;
|
||||
mytsup : Real;
|
||||
myumin : Real;
|
||||
myusup : Real;
|
||||
myvmin : Real;
|
||||
myvsup : Real;
|
||||
mytsample : Integer;
|
||||
myusample : Integer;
|
||||
myvsample : Integer;
|
||||
mytol1 : Real;
|
||||
mytol2 : Real;
|
||||
myF : FuncExtCS from Extrema;
|
||||
myS : SurfacePtr from Adaptor3d;
|
||||
mySurfPnts : HArray2OfPnt from TColgp;
|
||||
|
||||
end GenExtCS;
|
@@ -14,13 +14,16 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_GenExtCS.ixx>
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Extrema_ExtCC.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <Extrema_GenExtCS.hxx>
|
||||
#include <Extrema_GlobOptFuncCS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <math_FunctionSetRoot.hxx>
|
||||
@@ -28,6 +31,9 @@
|
||||
#include <math_PSOParticlesPool.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
|
||||
const Standard_Real aMaxParamVal = 1.0e+10;
|
||||
|
142
src/Extrema/Extrema_GenExtCS.hxx
Normal file
142
src/Extrema/Extrema_GenExtCS.hxx
Normal file
@@ -0,0 +1,142 @@
|
||||
// Created on: 1996-01-23
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1996-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 _Extrema_GenExtCS_HeaderFile
|
||||
#define _Extrema_GenExtCS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_FuncExtCS.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <Adaptor3d_CurvePtr.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Curve;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnCurv;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between acurve and a surface.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_GenExtCS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_GenExtCS();
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an
|
||||
//! extremum when gradient(F)=0. The algorithm searchs
|
||||
//! all the zeros inside the definition ranges of the
|
||||
//! surfaces.
|
||||
//! NbU and NbV are used to locate the close points on the
|
||||
//! surface and NbT on the curve to find the zeros.
|
||||
Standard_EXPORT Extrema_GenExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Integer NbT, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Tol1, const Standard_Real Tol2);
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! The function F(u,v)=distance(P,S(u,v)) has an
|
||||
//! extremum when gradient(F)=0. The algorithm searchs
|
||||
//! all the zeros inside the definition ranges of the
|
||||
//! surface.
|
||||
//! NbT,NbU and NbV are used to locate the close points
|
||||
//! to find the zeros.
|
||||
Standard_EXPORT Extrema_GenExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Integer NbT, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real tmin, const Standard_Real tsup, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real Tol1, const Standard_Real Tol2);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Tol2);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real Tol2);
|
||||
|
||||
//! the algorithm is done with S
|
||||
//! An exception is raised if the fields have not
|
||||
//! been initialized.
|
||||
Standard_EXPORT void Perform (const Adaptor3d_Curve& C, const Standard_Integer NbT, const Standard_Real Tol1);
|
||||
|
||||
//! the algorithm is done with C
|
||||
//! An exception is raised if the fields have not
|
||||
//! been initialized.
|
||||
Standard_EXPORT void Perform (const Adaptor3d_Curve& C, const Standard_Integer NbT, const Standard_Real tmin, const Standard_Real tsup, const Standard_Real Tol1);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnCurv& PointOnCurve (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnSurface (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_CurvePtr BidonCurve() const;
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr BidonSurface() const;
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Real mytmin;
|
||||
Standard_Real mytsup;
|
||||
Standard_Real myumin;
|
||||
Standard_Real myusup;
|
||||
Standard_Real myvmin;
|
||||
Standard_Real myvsup;
|
||||
Standard_Integer mytsample;
|
||||
Standard_Integer myusample;
|
||||
Standard_Integer myvsample;
|
||||
Standard_Real mytol1;
|
||||
Standard_Real mytol2;
|
||||
Extrema_FuncExtCS myF;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
Handle(TColgp_HArray2OfPnt) mySurfPnts;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_GenExtCS_HeaderFile
|
@@ -1,152 +0,0 @@
|
||||
-- Created on: 1995-07-18
|
||||
-- Created by: Modelistation
|
||||
-- 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.
|
||||
|
||||
generic class GenExtPC from Extrema (Curve as any;
|
||||
Tool as any; --as ToolCurve(Curve)
|
||||
POnC as any;
|
||||
Pnt as any;
|
||||
Vec as any)
|
||||
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a curve.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
private class PCF instantiates FuncExtPC from Extrema (Curve, Tool, POnC, Pnt, Vec);
|
||||
|
||||
is
|
||||
|
||||
Create returns GenExtPC;
|
||||
|
||||
|
||||
Create (P: Pnt; C: Curve; NbU: Integer; TolU,TolF: Real)
|
||||
returns GenExtPC;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u)=distance(P,C(u)) has an extremum
|
||||
-- when g(u)=dF/du=0. The algorithm searchs all the
|
||||
-- zeros inside the definition range of the curve.
|
||||
-- NbU is used to locate the close points to
|
||||
-- find the zeros.
|
||||
-- Tol and TolU are used to decide to stop the
|
||||
-- iterations according to the following condition:
|
||||
-- if n is the number of iterations,
|
||||
-- abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
|
||||
|
||||
|
||||
Create (P: Pnt; C: Curve; NbU: Integer; Umin, Usup: Real; TolU,TolF: Real)
|
||||
returns GenExtPC;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u)=distance(P,C(u)) has an extremum
|
||||
-- when g(u)=dF/du=0. The algorithm searchs all the
|
||||
-- zeros inside the definition range of the curve.
|
||||
-- NbU is used to locate the close points to
|
||||
-- find the zeros.
|
||||
-- Zeros are searched between umin and usup.
|
||||
-- Tol and TolU are used to decide to stop the
|
||||
-- iterations according to the following condition:
|
||||
-- if n is the number of iterations,
|
||||
-- abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
|
||||
|
||||
|
||||
|
||||
Initialize(me: in out; C: Curve; NbU: Integer; TolU, TolF: Real)
|
||||
---Purpose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Initialize(me: in out; C: Curve; NbU: Integer;
|
||||
Umin, Usup: Real; TolU, TolF: Real)
|
||||
---Purpose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
Initialize(me: in out; C: Curve)
|
||||
---Purpose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
Initialize(me: in out; NbU: Integer; Umin, Usup: Real; TolU, TolF: Real)
|
||||
---Purpose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt)
|
||||
---Purpose: the algorithm is done with the point P.
|
||||
-- An exception is raised if the fields have not
|
||||
-- been initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: True if the distances are found.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises TypeMismatch from Standard,
|
||||
NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth extremum square distance.
|
||||
raises TypeMismatch from Standard,
|
||||
NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
|
||||
IsMin (me; N: Integer) returns Boolean
|
||||
---Purpose: Returns True if the Nth extremum distance is a
|
||||
-- minimum.
|
||||
raises TypeMismatch from Standard,
|
||||
NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
|
||||
Point (me; N: Integer) returns POnC
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth extremum distance.
|
||||
raises TypeMismatch from Standard,
|
||||
NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange from Standard
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myInit: Boolean;
|
||||
mynbsample: Integer;
|
||||
myumin: Real;
|
||||
myusup: Real;
|
||||
mytolu: Real;
|
||||
mytolF: Real;
|
||||
myF : PCF;
|
||||
|
||||
end GenExtPC;
|
||||
|
@@ -1,183 +0,0 @@
|
||||
-- Created on: 1995-07-18
|
||||
-- Created by: Modelistation
|
||||
-- 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 GenExtPS from Extrema
|
||||
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between a point and a surface.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
Pnt from gp,
|
||||
FuncExtPS from Extrema,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d,
|
||||
HUBTreeOfSphere from Extrema,
|
||||
ExtFlag from Extrema,
|
||||
ExtAlgo from Extrema,
|
||||
HArray1OfSphere from Bnd,
|
||||
Vector from math,
|
||||
HArray1OfReal from TColStd,
|
||||
POnSurfParams from Extrema,
|
||||
HArray2OfPOnSurfParams from Extrema
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns GenExtPS;
|
||||
|
||||
Create (P: Pnt; S: Surface from Adaptor3d; NbU,NbV: Integer; TolU,TolV: Real; F : ExtFlag from Extrema = Extrema_ExtFlag_MINMAX; A : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
returns GenExtPS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(P,S(u,v)) has an
|
||||
-- extremum when gradient(F)=0. The algorithm searchs
|
||||
-- all the zeros inside the definition ranges of the
|
||||
-- surface.
|
||||
-- NbU and NbV are used to locate the close points
|
||||
-- to find the zeros. They must be great enough
|
||||
-- such that if there is N extrema, there will
|
||||
-- be N extrema between P and the grid.
|
||||
-- TolU et TolV are used to determine the conditions
|
||||
-- to stop the iterations; at the iteration number n:
|
||||
-- (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
|
||||
|
||||
Create (P: Pnt; S: Surface from Adaptor3d; NbU,NbV: Integer;
|
||||
Umin, Usup, Vmin, Vsup: Real; TolU,TolV: Real; F : ExtFlag from Extrema = Extrema_ExtFlag_MINMAX; A : ExtAlgo from Extrema = Extrema_ExtAlgo_Grad)
|
||||
returns GenExtPS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(P,S(u,v)) has an
|
||||
-- extremum when gradient(F)=0. The algorithm searchs
|
||||
-- all the zeros inside the definition ranges of the
|
||||
-- surface.
|
||||
-- NbU and NbV are used to locate the close points
|
||||
-- to find the zeros. They must be great enough
|
||||
-- such that if there is N extrema, there will
|
||||
-- be N extrema between P and the grid.
|
||||
-- TolU et TolV are used to determine the conditions
|
||||
-- to stop the iterations; at the iteration number n:
|
||||
-- (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer; TolU, TolV: Real)
|
||||
---Pupose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer;
|
||||
Umin, Usup, Vmin, Vsup: Real; TolU, TolV: Real)
|
||||
---Pupose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; P: Pnt from gp)
|
||||
---Purpose: the algorithm is done with the point P.
|
||||
-- An exception is raised if the fields have not
|
||||
-- been initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
SetFlag(me : in out; F : ExtFlag from Extrema)
|
||||
is static;
|
||||
|
||||
SetAlgo(me : in out; A : ExtAlgo from Extrema)
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Bidon(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
BuildTree(me : in out)
|
||||
is static private;
|
||||
|
||||
FindSolution(me: in out; P : Pnt from gp;
|
||||
theParams: POnSurfParams from Extrema)
|
||||
is static private;
|
||||
|
||||
GetGridPoints(me: in out; theSurf: Surface from Adaptor3d) is private;
|
||||
---Purpose: Selection of points to build grid, depending on the type of surface
|
||||
|
||||
BuildGrid(me: in out; thePoint: Pnt from gp) is private;
|
||||
---Purpose: Creation of grid of parametric points
|
||||
|
||||
ComputeEdgeParameters(me: in out;
|
||||
IsUEdge : Boolean;
|
||||
theParam0 : POnSurfParams from Extrema;
|
||||
theParam1 : POnSurfParams from Extrema;
|
||||
thePoints : Pnt from gp;
|
||||
theDiffTol : Real) returns POnSurfParams from Extrema
|
||||
is private;
|
||||
---Purpose: Compute new edge parameters.
|
||||
---C++: return const &
|
||||
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myInit : Boolean;
|
||||
myumin : Real;
|
||||
myusup : Real;
|
||||
myvmin : Real;
|
||||
myvsup : Real;
|
||||
myusample : Integer;
|
||||
myvsample : Integer;
|
||||
mytolu : Real;
|
||||
mytolv : Real;
|
||||
myPoints : HArray2OfPOnSurfParams from Extrema;
|
||||
mySphereUBTree : HUBTreeOfSphere from Extrema;
|
||||
mySphereArray : HArray1OfSphere from Bnd;
|
||||
myF : FuncExtPS from Extrema;
|
||||
myS : SurfacePtr from Adaptor3d;
|
||||
myFlag : ExtFlag from Extrema;
|
||||
myAlgo : ExtAlgo from Extrema;
|
||||
myUParams : HArray1OfReal from TColStd;
|
||||
myVParams : HArray1OfReal from TColStd;
|
||||
myFacePntParams : HArray2OfPOnSurfParams from Extrema;
|
||||
myUEdgePntParams : HArray2OfPOnSurfParams from Extrema;
|
||||
myVEdgePntParams : HArray2OfPOnSurfParams from Extrema;
|
||||
myGridParam : POnSurfParams from Extrema;
|
||||
|
||||
end GenExtPS;
|
@@ -16,35 +16,38 @@
|
||||
|
||||
// Modified by skv - Thu Sep 30 15:21:07 2004 OCC593
|
||||
|
||||
|
||||
#include <Extrema_GenExtPS.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TColStd_Array2OfInteger.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <math_FunctionSetRoot.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_NewtonFunctionSetRoot.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <Bnd_Sphere.hxx>
|
||||
#include <Extrema_HUBTreeOfSphere.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Bnd_Array1OfSphere.hxx>
|
||||
#include <Bnd_HArray1OfSphere.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Bnd_Sphere.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Extrema_GenExtPS.hxx>
|
||||
#include <Extrema_HUBTreeOfSphere.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <Extrema_POnSurfParams.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <math_FunctionSetRoot.hxx>
|
||||
#include <math_NewtonFunctionSetRoot.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array2OfInteger.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
|
||||
//IMPLEMENT_HARRAY1(Extrema_HArray1OfSphere)
|
||||
|
||||
|
||||
class Bnd_SphereUBTreeSelector : public Extrema_UBTreeOfSphere::Selector
|
||||
{
|
||||
public:
|
||||
|
171
src/Extrema/Extrema_GenExtPS.hxx
Normal file
171
src/Extrema/Extrema_GenExtPS.hxx
Normal file
@@ -0,0 +1,171 @@
|
||||
// Created on: 1995-07-18
|
||||
// Created by: Modelistation
|
||||
// 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 _Extrema_GenExtPS_HeaderFile
|
||||
#define _Extrema_GenExtPS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Extrema_HArray2OfPOnSurfParams.hxx>
|
||||
#include <Extrema_HUBTreeOfSphere.hxx>
|
||||
#include <Bnd_HArray1OfSphere.hxx>
|
||||
#include <Extrema_FuncExtPS.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Extrema_POnSurfParams.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class gp_Pnt;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnSurf;
|
||||
class Extrema_POnSurfParams;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between a point and a surface.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_GenExtPS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_GenExtPS();
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! The function F(u,v)=distance(P,S(u,v)) has an
|
||||
//! extremum when gradient(F)=0. The algorithm searchs
|
||||
//! all the zeros inside the definition ranges of the
|
||||
//! surface.
|
||||
//! NbU and NbV are used to locate the close points
|
||||
//! to find the zeros. They must be great enough
|
||||
//! such that if there is N extrema, there will
|
||||
//! be N extrema between P and the grid.
|
||||
//! TolU et TolV are used to determine the conditions
|
||||
//! to stop the iterations; at the iteration number n:
|
||||
//! (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
Standard_EXPORT Extrema_GenExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real TolU, const Standard_Real TolV, const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! The function F(u,v)=distance(P,S(u,v)) has an
|
||||
//! extremum when gradient(F)=0. The algorithm searchs
|
||||
//! all the zeros inside the definition ranges of the
|
||||
//! surface.
|
||||
//! NbU and NbV are used to locate the close points
|
||||
//! to find the zeros. They must be great enough
|
||||
//! such that if there is N extrema, there will
|
||||
//! be N extrema between P and the grid.
|
||||
//! TolU et TolV are used to determine the conditions
|
||||
//! to stop the iterations; at the iteration number n:
|
||||
//! (Un - Un-1) < TolU and (Vn - Vn-1) < TolV .
|
||||
Standard_EXPORT Extrema_GenExtPS(const gp_Pnt& P, const Adaptor3d_Surface& S, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV, const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX, const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
//! the algorithm is done with the point P.
|
||||
//! An exception is raised if the fields have not
|
||||
//! been initialized.
|
||||
Standard_EXPORT void Perform (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT void SetFlag (const Extrema_ExtFlag F);
|
||||
|
||||
Standard_EXPORT void SetAlgo (const Extrema_ExtAlgo A);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
Standard_EXPORT void BuildTree();
|
||||
|
||||
Standard_EXPORT void FindSolution (const gp_Pnt& P, const Extrema_POnSurfParams& theParams);
|
||||
|
||||
//! Selection of points to build grid, depending on the type of surface
|
||||
Standard_EXPORT void GetGridPoints (const Adaptor3d_Surface& theSurf);
|
||||
|
||||
//! Creation of grid of parametric points
|
||||
Standard_EXPORT void BuildGrid (const gp_Pnt& thePoint);
|
||||
|
||||
//! Compute new edge parameters.
|
||||
Standard_EXPORT const Extrema_POnSurfParams& ComputeEdgeParameters (const Standard_Boolean IsUEdge, const Extrema_POnSurfParams& theParam0, const Extrema_POnSurfParams& theParam1, const gp_Pnt& thePoints, const Standard_Real theDiffTol);
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Real myumin;
|
||||
Standard_Real myusup;
|
||||
Standard_Real myvmin;
|
||||
Standard_Real myvsup;
|
||||
Standard_Integer myusample;
|
||||
Standard_Integer myvsample;
|
||||
Standard_Real mytolu;
|
||||
Standard_Real mytolv;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myPoints;
|
||||
Extrema_HUBTreeOfSphere mySphereUBTree;
|
||||
Handle(Bnd_HArray1OfSphere) mySphereArray;
|
||||
Extrema_FuncExtPS myF;
|
||||
Adaptor3d_SurfacePtr myS;
|
||||
Extrema_ExtFlag myFlag;
|
||||
Extrema_ExtAlgo myAlgo;
|
||||
Handle(TColStd_HArray1OfReal) myUParams;
|
||||
Handle(TColStd_HArray1OfReal) myVParams;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myFacePntParams;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myUEdgePntParams;
|
||||
Handle(Extrema_HArray2OfPOnSurfParams) myVEdgePntParams;
|
||||
Extrema_POnSurfParams myGridParam;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_GenExtPS_HeaderFile
|
@@ -1,149 +0,0 @@
|
||||
-- Created on: 1996-01-18
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1996-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 GenExtSS from Extrema
|
||||
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between two surfaces.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
Pnt from gp,
|
||||
HArray2OfPnt from TColgp,
|
||||
FuncExtSS from Extrema,
|
||||
Surface from Adaptor3d,
|
||||
SurfacePtr from Adaptor3d
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns GenExtSS;
|
||||
|
||||
Create (S1, S2: Surface from Adaptor3d; NbU,NbV: Integer; Tol1,Tol2: Real)
|
||||
returns GenExtSS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an
|
||||
-- extremum when gradient(F)=0. The algorithm searchs
|
||||
-- all the zeros inside the definition ranges of the
|
||||
-- surfaces.
|
||||
-- NbU and NbV are used to locate the close points
|
||||
-- to find the zeros.
|
||||
|
||||
Create (S1, S2: Surface from Adaptor3d; NbU,NbV: Integer;
|
||||
U1min, U1sup, V1min, V1sup: Real;
|
||||
U2min, U2sup, V2min, V2sup: Real;
|
||||
Tol1,Tol2: Real)
|
||||
returns GenExtSS;
|
||||
---Purpose: It calculates all the distances.
|
||||
-- The function F(u,v)=distance(P,S(u,v)) has an
|
||||
-- extremum when gradient(F)=0. The algorithm searchs
|
||||
-- all the zeros inside the definition ranges of the
|
||||
-- surface.
|
||||
-- NbU and NbV are used to locate the close points
|
||||
-- to find the zeros.
|
||||
|
||||
Initialize(me: in out; S2: Surface from Adaptor3d;
|
||||
NbU, NbV: Integer; Tol2: Real)
|
||||
---Pupose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Initialize(me: in out; S2: Surface from Adaptor3d; NbU, NbV: Integer;
|
||||
U2min, U2sup, V2min, V2sup: Real; Tol2: Real)
|
||||
---Pupose: sets the fields of the algorithm.
|
||||
is static;
|
||||
|
||||
|
||||
Perform(me: in out; S1: Surface from Adaptor3d; Tol1: Real)
|
||||
---Purpose: the algorithm is done with S1
|
||||
-- An exception is raised if the fields have not
|
||||
-- been initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
Perform(me: in out; S1: Surface from Adaptor3d;
|
||||
U1min, U1sup, V1min, V1sup: Real; Tol1: Real)
|
||||
---Purpose: the algorithm is done withS1
|
||||
-- An exception is raised if the fields have not
|
||||
-- been initialized.
|
||||
raises TypeMismatch from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
PointOnS1 (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
PointOnS2 (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Bidon(me) returns SurfacePtr from Adaptor3d
|
||||
is static private;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
myInit : Boolean;
|
||||
myu1min : Real;
|
||||
myu1sup : Real;
|
||||
myv1min : Real;
|
||||
myv1sup : Real;
|
||||
myu2min : Real;
|
||||
myu2sup : Real;
|
||||
myv2min : Real;
|
||||
myv2sup : Real;
|
||||
myusample : Integer;
|
||||
myvsample : Integer;
|
||||
mypoints1 : HArray2OfPnt from TColgp;
|
||||
mypoints2 : HArray2OfPnt from TColgp;
|
||||
mytol1 : Real;
|
||||
mytol2 : Real;
|
||||
myF : FuncExtSS from Extrema;
|
||||
myS2 : SurfacePtr from Adaptor3d;
|
||||
|
||||
end GenExtSS;
|
@@ -14,15 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Extrema_GenExtSS.ixx>
|
||||
#include <math_Vector.hxx>
|
||||
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Extrema_GenExtSS.hxx>
|
||||
#include <Extrema_POnSurf.hxx>
|
||||
#include <math_FunctionSetRoot.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_GenExtSS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Extrema_GenExtSS::Extrema_GenExtSS()
|
||||
{
|
||||
myDone = Standard_False;
|
||||
|
139
src/Extrema/Extrema_GenExtSS.hxx
Normal file
139
src/Extrema/Extrema_GenExtSS.hxx
Normal file
@@ -0,0 +1,139 @@
|
||||
// Created on: 1996-01-18
|
||||
// Created by: Laurent PAINNOT
|
||||
// Copyright (c) 1996-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 _Extrema_GenExtSS_HeaderFile
|
||||
#define _Extrema_GenExtSS_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <Extrema_FuncExtSS.hxx>
|
||||
#include <Adaptor3d_SurfacePtr.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_TypeMismatch;
|
||||
class Adaptor3d_Surface;
|
||||
class Extrema_POnSurf;
|
||||
|
||||
|
||||
//! It calculates all the extremum distances
|
||||
//! between two surfaces.
|
||||
//! These distances can be minimum or maximum.
|
||||
class Extrema_GenExtSS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Extrema_GenExtSS();
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an
|
||||
//! extremum when gradient(F)=0. The algorithm searchs
|
||||
//! all the zeros inside the definition ranges of the
|
||||
//! surfaces.
|
||||
//! NbU and NbV are used to locate the close points
|
||||
//! to find the zeros.
|
||||
Standard_EXPORT Extrema_GenExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Tol1, const Standard_Real Tol2);
|
||||
|
||||
//! It calculates all the distances.
|
||||
//! The function F(u,v)=distance(P,S(u,v)) has an
|
||||
//! extremum when gradient(F)=0. The algorithm searchs
|
||||
//! all the zeros inside the definition ranges of the
|
||||
//! surface.
|
||||
//! NbU and NbV are used to locate the close points
|
||||
//! to find the zeros.
|
||||
Standard_EXPORT Extrema_GenExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real U1min, const Standard_Real U1sup, const Standard_Real V1min, const Standard_Real V1sup, const Standard_Real U2min, const Standard_Real U2sup, const Standard_Real V2min, const Standard_Real V2sup, const Standard_Real Tol1, const Standard_Real Tol2);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Tol2);
|
||||
|
||||
Standard_EXPORT void Initialize (const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real U2min, const Standard_Real U2sup, const Standard_Real V2min, const Standard_Real V2sup, const Standard_Real Tol2);
|
||||
|
||||
//! the algorithm is done with S1
|
||||
//! An exception is raised if the fields have not
|
||||
//! been initialized.
|
||||
Standard_EXPORT void Perform (const Adaptor3d_Surface& S1, const Standard_Real Tol1);
|
||||
|
||||
//! the algorithm is done withS1
|
||||
//! An exception is raised if the fields have not
|
||||
//! been initialized.
|
||||
Standard_EXPORT void Perform (const Adaptor3d_Surface& S1, const Standard_Real U1min, const Standard_Real U1sup, const Standard_Real V1min, const Standard_Real V1sup, const Standard_Real Tol1);
|
||||
|
||||
//! Returns True if the distances are found.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the number of extremum distances.
|
||||
Standard_EXPORT Standard_Integer NbExt() const;
|
||||
|
||||
//! Returns the value of the Nth resulting square distance.
|
||||
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnS1 (const Standard_Integer N) const;
|
||||
|
||||
//! Returns the point of the Nth resulting distance.
|
||||
Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const;
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myInit;
|
||||
Standard_Real myu1min;
|
||||
Standard_Real myu1sup;
|
||||
Standard_Real myv1min;
|
||||
Standard_Real myv1sup;
|
||||
Standard_Real myu2min;
|
||||
Standard_Real myu2sup;
|
||||
Standard_Real myv2min;
|
||||
Standard_Real myv2sup;
|
||||
Standard_Integer myusample;
|
||||
Standard_Integer myvsample;
|
||||
Handle(TColgp_HArray2OfPnt) mypoints1;
|
||||
Handle(TColgp_HArray2OfPnt) mypoints2;
|
||||
Standard_Real mytol1;
|
||||
Standard_Real mytol2;
|
||||
Extrema_FuncExtSS myF;
|
||||
Adaptor3d_SurfacePtr myS2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Extrema_GenExtSS_HeaderFile
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user