1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,2 +1,36 @@
ProjLib_SequenceOfHSequenceOfPnt.hxx
ProjLib.cxx
ProjLib.hxx
ProjLib_CompProjectedCurve.cxx
ProjLib_CompProjectedCurve.hxx
ProjLib_ComputeApprox.cxx
ProjLib_ComputeApprox.hxx
ProjLib_ComputeApproxOnPolarSurface.cxx
ProjLib_ComputeApproxOnPolarSurface.hxx
ProjLib_Cone.cxx
ProjLib_Cone.hxx
ProjLib_Cylinder.cxx
ProjLib_Cylinder.hxx
ProjLib_HCompProjectedCurve.hxx
ProjLib_HCompProjectedCurve_0.cxx
ProjLib_HProjectedCurve.hxx
ProjLib_HProjectedCurve_0.cxx
ProjLib_HSequenceOfHSequenceOfPnt.hxx
ProjLib_Plane.cxx
ProjLib_Plane.hxx
ProjLib_PrjFunc.cxx
ProjLib_PrjFunc.hxx
ProjLib_PrjResolve.cxx
ProjLib_PrjResolve.hxx
ProjLib_ProjectedCurve.cxx
ProjLib_ProjectedCurve.hxx
ProjLib_ProjectOnPlane.cxx
ProjLib_ProjectOnPlane.hxx
ProjLib_ProjectOnSurface.cxx
ProjLib_ProjectOnSurface.hxx
ProjLib_Projector.cxx
ProjLib_Projector.hxx
ProjLib_SequenceOfHSequenceOfPnt.hxx
ProjLib_Sphere.cxx
ProjLib_Sphere.hxx
ProjLib_Torus.cxx
ProjLib_Torus.hxx

View File

@@ -1,194 +0,0 @@
-- Created on: 1993-08-11
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package ProjLib
---Purpose: The projLib package first provides projection of
-- curves on a plane along a given Direction. The
-- result will be a 3D curve.
---Purpose: The ProjLib package provides projection of curves
-- on surfaces to compute the curve in the parametric
-- space.
--
-- It is assumed that the curve is on the surface.
--
-- It provides :
--
-- * Package methods to handle the easiest cases :
--
-- - Line, Circle, Ellipse, Parabola, Hyperbola on plane.
--
-- - Line, Circle on cylinder.
--
-- - Line, Circle on cone.
--
-- * Classes to handle the general cases :
--
-- - Plane.
--
-- - Cylinder.
--
-- - Cone.
--
-- - Sphere.
--
-- - Torus.
--
--
-- * A generic class to handle a Curve from Adaptor3d
-- on a Surface from Adaptor3d.
--
uses
GeomAbs, -- Geometry enumeration
gp, -- Elementary geometry
Geom,
Geom2d,
Adaptor2d, -- Curve and Surface interface.
Adaptor3d, -- Curve and Surface interface.
Extrema, -- for projection of points on surface.
GeomAdaptor,
TColgp,
TColStd,
TCollection,
math
is
-- ---------------------------------------------------------------
-- Classes computing the projection of a 3d curve on a surface.
-- The result will be a 3d curve.
--
-- Make an approximation if necessary
-- ---------------------------------------------------------------
class ProjectOnPlane ;
class ProjectOnSurface ;
-- ---------------------------------------------------------------
-- Classes computing the PCurves of curves lying on a surface
--
-- Make an approximation if necessary
-- ---------------------------------------------------------------
class ComputeApprox;
class ComputeApproxOnPolarSurface ;
class ProjectedCurve ;
class HProjectedCurve instantiates
GenHCurve2d from Adaptor2d (ProjectedCurve);
---------------------------------------------
-- Normal projection of a curve on a surface
-- Computes the different parts
-----------------------------------------------
imported SequenceOfHSequenceOfPnt;
imported transient class HSequenceOfHSequenceOfPnt;
class CompProjectedCurve;
class HCompProjectedCurve
instantiates GenHCurve2d from Adaptor2d (CompProjectedCurve);
private class PrjResolve;
private class PrjFunc;
-- ------------------------------------------------------------
-- Projection of Curves on Surfaces.
--
-- This classes evaluate the 2d curve of a curve lying on a
-- surface in some particular case. See the description of this
-- classes to have more informations.
--
-- ------------------------------------------------------------
class Projector;
class Plane;
class Cylinder;
class Cone;
class Sphere;
class Torus;
-- methods
Project(Pl : Pln from gp;
P : Pnt from gp ) returns Pnt2d from gp;
Project(Pl : Pln from gp;
L : Lin from gp ) returns Lin2d from gp;
Project(Pl : Pln from gp;
C : Circ from gp ) returns Circ2d from gp;
Project(Pl : Pln from gp;
E : Elips from gp ) returns Elips2d from gp;
Project(Pl : Pln from gp;
P : Parab from gp ) returns Parab2d from gp;
Project(Pl : Pln from gp;
H : Hypr from gp ) returns Hypr2d from gp;
Project(Cy : Cylinder from gp;
P : Pnt from gp ) returns Pnt2d from gp;
Project(Cy : Cylinder from gp;
L : Lin from gp ) returns Lin2d from gp;
Project(Cy : Cylinder from gp;
Ci : Circ from gp ) returns Lin2d from gp;
Project(Co : Cone from gp;
P : Pnt from gp ) returns Pnt2d from gp;
Project(Co : Cone from gp;
L : Lin from gp ) returns Lin2d from gp;
Project(Co : Cone from gp;
Ci : Circ from gp ) returns Lin2d from gp;
Project(Sp : Sphere from gp;
P : Pnt from gp ) returns Pnt2d from gp;
Project(Sp : Sphere from gp;
Ci : Circ from gp ) returns Lin2d from gp;
Project(To : Torus from gp;
P : Pnt from gp ) returns Pnt2d from gp;
Project(To : Torus from gp;
Ci : Circ from gp ) returns Lin2d from gp;
end ProjLib;

View File

@@ -14,20 +14,36 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib.ixx>
#include <ProjLib_Plane.hxx>
#include <ProjLib_Cylinder.hxx>
#include <ProjLib_Cone.hxx>
#include <ProjLib_Sphere.hxx>
#include <ProjLib_Torus.hxx>
#include <ElSLib.hxx>
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Elips.hxx>
#include <gp_Elips2d.hxx>
#include <gp_Hypr.hxx>
#include <gp_Hypr2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Parab.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
#include <ProjLib.hxx>
#include <ProjLib_Cone.hxx>
#include <ProjLib_Cylinder.hxx>
#include <ProjLib_Plane.hxx>
#include <ProjLib_Sphere.hxx>
#include <ProjLib_Torus.hxx>
//=======================================================================
//function : Project
//purpose :
//=======================================================================
gp_Pnt2d ProjLib::Project(const gp_Pln& Pl, const gp_Pnt& P)
{
Standard_Real U, V;

170
src/ProjLib/ProjLib.hxx Normal file
View File

@@ -0,0 +1,170 @@
// Created on: 1993-08-11
// Created by: Bruno DUMORTIER
// 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 _ProjLib_HeaderFile
#define _ProjLib_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class gp_Pnt2d;
class gp_Pln;
class gp_Pnt;
class gp_Lin2d;
class gp_Lin;
class gp_Circ2d;
class gp_Circ;
class gp_Elips2d;
class gp_Elips;
class gp_Parab2d;
class gp_Parab;
class gp_Hypr2d;
class gp_Hypr;
class gp_Cylinder;
class gp_Cone;
class gp_Sphere;
class gp_Torus;
class ProjLib_ProjectOnPlane;
class ProjLib_ProjectOnSurface;
class ProjLib_ComputeApprox;
class ProjLib_ComputeApproxOnPolarSurface;
class ProjLib_ProjectedCurve;
class ProjLib_HProjectedCurve;
class ProjLib_CompProjectedCurve;
class ProjLib_HCompProjectedCurve;
class ProjLib_PrjResolve;
class ProjLib_PrjFunc;
class ProjLib_Projector;
class ProjLib_Plane;
class ProjLib_Cylinder;
class ProjLib_Cone;
class ProjLib_Sphere;
class ProjLib_Torus;
//! The projLib package first provides projection of
//! curves on a plane along a given Direction. The
//! result will be a 3D curve.
//! The ProjLib package provides projection of curves
//! on surfaces to compute the curve in the parametric
//! space.
//!
//! It is assumed that the curve is on the surface.
//!
//! It provides :
//!
//! * Package methods to handle the easiest cases :
//!
//! - Line, Circle, Ellipse, Parabola, Hyperbola on plane.
//!
//! - Line, Circle on cylinder.
//!
//! - Line, Circle on cone.
//!
//! * Classes to handle the general cases :
//!
//! - Plane.
//!
//! - Cylinder.
//!
//! - Cone.
//!
//! - Sphere.
//!
//! - Torus.
//!
//! * A generic class to handle a Curve from Adaptor3d
//! on a Surface from Adaptor3d.
class ProjLib
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static gp_Pnt2d Project (const gp_Pln& Pl, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Pln& Pl, const gp_Lin& L);
Standard_EXPORT static gp_Circ2d Project (const gp_Pln& Pl, const gp_Circ& C);
Standard_EXPORT static gp_Elips2d Project (const gp_Pln& Pl, const gp_Elips& E);
Standard_EXPORT static gp_Parab2d Project (const gp_Pln& Pl, const gp_Parab& P);
Standard_EXPORT static gp_Hypr2d Project (const gp_Pln& Pl, const gp_Hypr& H);
Standard_EXPORT static gp_Pnt2d Project (const gp_Cylinder& Cy, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Cylinder& Cy, const gp_Lin& L);
Standard_EXPORT static gp_Lin2d Project (const gp_Cylinder& Cy, const gp_Circ& Ci);
Standard_EXPORT static gp_Pnt2d Project (const gp_Cone& Co, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Cone& Co, const gp_Lin& L);
Standard_EXPORT static gp_Lin2d Project (const gp_Cone& Co, const gp_Circ& Ci);
Standard_EXPORT static gp_Pnt2d Project (const gp_Sphere& Sp, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Sphere& Sp, const gp_Circ& Ci);
Standard_EXPORT static gp_Pnt2d Project (const gp_Torus& To, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Torus& To, const gp_Circ& Ci);
protected:
private:
friend class ProjLib_ProjectOnPlane;
friend class ProjLib_ProjectOnSurface;
friend class ProjLib_ComputeApprox;
friend class ProjLib_ComputeApproxOnPolarSurface;
friend class ProjLib_ProjectedCurve;
friend class ProjLib_HProjectedCurve;
friend class ProjLib_CompProjectedCurve;
friend class ProjLib_HCompProjectedCurve;
friend class ProjLib_PrjResolve;
friend class ProjLib_PrjFunc;
friend class ProjLib_Projector;
friend class ProjLib_Plane;
friend class ProjLib_Cylinder;
friend class ProjLib_Cone;
friend class ProjLib_Sphere;
friend class ProjLib_Torus;
};
#endif // _ProjLib_HeaderFile

View File

@@ -1,228 +0,0 @@
-- Created on: 1997-09-22
-- Created by: Roman BORISOV
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class CompProjectedCurve from ProjLib inherits Curve2d from Adaptor2d
uses
HSurface from Adaptor3d,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
Pnt2d from gp,
Vec2d from gp,
Pnt from gp,
Array1OfReal from TColStd,
HSequenceOfHSequenceOfPnt from ProjLib,
Shape from GeomAbs,
HArray1OfBoolean from TColStd,
HArray1OfReal from TColStd,
CurveType from GeomAbs
raises
OutOfRange from Standard,
NoSuchObject from Standard,
DomainError from Standard,
NotImplemented from Standard
is
Create returns CompProjectedCurve;
Create(S : HSurface from Adaptor3d;
C : HCurve from Adaptor3d;
TolU, TolV: Real from Standard)
returns CompProjectedCurve;
---Purpose: try to find all solutions
Create(S : HSurface from Adaptor3d;
C : HCurve from Adaptor3d;
TolU, TolV, MaxDist: Real from Standard)
returns CompProjectedCurve;
---Purpose: this constructor tries to optimize the search using the
-- assamption that maximum distance between surface and curve less or
-- equal then MaxDist.
-- if MaxDist < 0 then algorithm works as above.
Init(me: in out)
---Purpose : computes a set of projected point and determine the
-- continuous parts of the projected curves. The points
-- corresponding to a projection on the bounds of the surface are
-- included in this set of points.
is static;
Load(me : in out;S : HSurface from Adaptor3d)
---Purpose: Changes the surface.
is static;
Load(me : in out; C : HCurve from Adaptor3d)
---Purpose: Changes the curve.
is static;
GetSurface(me) returns HSurface from Adaptor3d
---C++: return const &
is static;
GetCurve(me) returns HCurve from Adaptor3d
---C++: return const &
is static;
GetTolerance(me; TolU, TolV: in out Real)
is static;
--
-- Global methods - Apply to the whole curve.
--
NbCurves (me) returns Integer from Standard
---Purpose: returns the number of continuous part of the projected curve
is static;
Bounds(me; Index : in Integer from Standard;
Udeb,Ufin : out Real from Standard)
--- Purpose : returns the bounds of the continuous part corresponding to Index
raises NoSuchObject
is static;
IsSinglePnt(me; Index: Integer; P : out Pnt2d from gp ) returns Boolean from Standard
--- Purpose : returns True if part of projection with number Index is a single point and writes its coordinats in P
raises NoSuchObject
is static;
IsUIso(me; Index: Integer; U : out Real from Standard) returns Boolean from Standard
--- Purpose : returns True if part of projection with number Index is an u-isoparametric curve of input surface
raises NoSuchObject
is static;
IsVIso(me; Index: Integer; V : out Real from Standard) returns Boolean from Standard
--- Purpose : returns True if part of projection with number Index is an v-isoparametric curve of input surface
raises NoSuchObject
is static;
Value(me; U : Real from Standard) returns Pnt2d from gp
--- Purpose : Computes the point of parameter U on the curve.
is redefined static;
D0 (me; U : Real from Standard; P : out Pnt2d from gp)
--- Purpose : Computes the point of parameter U on the curve.
raises DomainError
is redefined static;
D1 (me; U : Real from Standard; P : out Pnt2d from gp ; V : out Vec2d from gp)
--- Purpose : Computes the point of parameter U on the curve with its
-- first derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C1.
is redefined static;
D2 (me; U : Real from Standard; 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.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C2.
is redefined static;
DN (me; U : Real; N : Integer) returns Vec2d from gp
--- Purpose :
-- The returned vector gives the value of the derivative for the
-- order of derivation N.
raises
OutOfRange from Standard,
--- Purpose : Raised if N < 1.
NotImplemented from Standard
--- Purpose : Raised if N > 2.
is redefined static;
FirstParameter(me) returns Real
---Purpose: Returns the first parameter of the curve C
-- which has a projection on S.
is redefined static;
LastParameter(me) returns Real
---Purpose: Returns the last parameter of the curve C
-- which has a projection on S.
is redefined static;
NbIntervals(me; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals which define
-- an S continuous part of the projected curve
is redefined static;
Trim(me;FirstParam,LastParam,Tol : Real) returns HCurve2d from Adaptor2d
---Purpose: Returns a curve equivalent of <me> between
-- parameters <First> and <Last>. <Tol> is used to
-- test for 2d points confusion.
raises
OutOfRange from Standard
---Purpose: If <First> >= <Last>
is redefined static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Returns the parameters corresponding to
-- S discontinuities.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard
is redefined static;
BuildIntervals(me; S : Shape from GeomAbs)
raises
OutOfRange from Standard
is private;
MaxDistance(me; Index: Integer)
---Purpose: returns the maximum distance between
-- curve to project and surface
returns Real
raises NoSuchObject;
-- Methods for debugging
GetSequence(me) returns HSequenceOfHSequenceOfPnt from ProjLib
---C++: return const &
is static;
GetType(me) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
is redefined static;
fields
mySurface : HSurface from Adaptor3d;
myCurve : HCurve from Adaptor3d;
myNbCurves : Integer from Standard;
mySequence : HSequenceOfHSequenceOfPnt from ProjLib;
myTolU : Real from Standard;
myTolV : Real from Standard;
myMaxDist : Real from Standard;
myUIso : HArray1OfBoolean from TColStd;
myVIso : HArray1OfBoolean from TColStd;
mySnglPnts : HArray1OfBoolean from TColStd;
myMaxDistance : HArray1OfReal from TColStd;
myTabInt : HArray1OfReal from TColStd; -- this field should be mutable
end CompProjectedCurve;

View File

@@ -14,20 +14,30 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_CompProjectedCurve.ixx>
#include <ProjLib_HCompProjectedCurve.hxx>
#include <gp_XY.hxx>
#include <gp_Mat2d.hxx>
#include <Extrema_ExtPS.hxx>
#include <Precision.hxx>
#include <Adaptor2d_HCurve2d.hxx>
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <Extrema_ExtCS.hxx>
#include <TColgp_HSequenceOfPnt.hxx>
#include <Extrema_ExtPS.hxx>
#include <Extrema_GenLocateExtPS.hxx>
#include <Extrema_POnSurf.hxx>
#include <Extrema_POnCurv.hxx>
#include <ProjLib_PrjResolve.hxx>
#include <Extrema_POnSurf.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomLib.hxx>
#include <gp_Mat2d.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_XY.hxx>
#include <Precision.hxx>
#include <ProjLib_CompProjectedCurve.hxx>
#include <ProjLib_HCompProjectedCurve.hxx>
#include <ProjLib_PrjResolve.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_OutOfRange.hxx>
#include <TColgp_HSequenceOfPnt.hxx>
#define FuncTol 1.e-10

View File

@@ -0,0 +1,196 @@
// Created on: 1997-09-22
// Created by: Roman BORISOV
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ProjLib_CompProjectedCurve_HeaderFile
#define _ProjLib_CompProjectedCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <ProjLib_HSequenceOfHSequenceOfPnt.hxx>
#include <Standard_Real.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_Shape.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <GeomAbs_CurveType.hxx>
class Adaptor3d_HSurface;
class Adaptor3d_HCurve;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class Standard_NotImplemented;
class gp_Pnt2d;
class gp_Vec2d;
class Adaptor2d_HCurve2d;
class ProjLib_CompProjectedCurve : public Adaptor2d_Curve2d
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ProjLib_CompProjectedCurve();
//! try to find all solutions
Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Standard_Real TolU, const Standard_Real TolV);
//! this constructor tries to optimize the search using the
//! assamption that maximum distance between surface and curve less or
//! equal then MaxDist.
//! if MaxDist < 0 then algorithm works as above.
Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Standard_Real TolU, const Standard_Real TolV, const Standard_Real MaxDist);
//! computes a set of projected point and determine the
//! continuous parts of the projected curves. The points
//! corresponding to a projection on the bounds of the surface are
//! included in this set of points.
Standard_EXPORT void Init();
//! Changes the surface.
Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
//! Changes the curve.
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C);
Standard_EXPORT const Handle(Adaptor3d_HSurface)& GetSurface() const;
Standard_EXPORT const Handle(Adaptor3d_HCurve)& GetCurve() const;
Standard_EXPORT void GetTolerance (Standard_Real& TolU, Standard_Real& TolV) const;
//! returns the number of continuous part of the projected curve
Standard_EXPORT Standard_Integer NbCurves() const;
//! returns the bounds of the continuous part corresponding to Index
Standard_EXPORT void Bounds (const Standard_Integer Index, Standard_Real& Udeb, Standard_Real& Ufin) const;
//! returns True if part of projection with number Index is a single point and writes its coordinats in P
Standard_EXPORT Standard_Boolean IsSinglePnt (const Standard_Integer Index, gp_Pnt2d& P) const;
//! returns True if part of projection with number Index is an u-isoparametric curve of input surface
Standard_EXPORT Standard_Boolean IsUIso (const Standard_Integer Index, Standard_Real& U) const;
//! returns True if part of projection with number Index is an v-isoparametric curve of input surface
Standard_EXPORT Standard_Boolean IsVIso (const Standard_Integer Index, Standard_Real& V) const;
//! Computes the point of parameter U on the curve.
Standard_EXPORT gp_Pnt2d Value (const Standard_Real U) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt2d& P) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const Standard_OVERRIDE;
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if N < 1.
//! Raised if N > 2.
Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
//! Returns the first parameter of the curve C
//! which has a projection on S.
Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
//! Returns the last parameter of the curve C
//! which has a projection on S.
Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
//! Returns the number of intervals which define
//! an S continuous part of the projected curve
Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Returns a curve equivalent of <me> between
//! parameters <First> and <Last>. <Tol> is used to
//! test for 2d points confusion.
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real FirstParam, const Standard_Real LastParam, const Standard_Real Tol) const Standard_OVERRIDE;
//! Returns the parameters corresponding to
//! S discontinuities.
//!
//! The array must provide enough room to accomodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
//! returns the maximum distance between
//! curve to project and surface
Standard_EXPORT Standard_Real MaxDistance (const Standard_Integer Index) const;
Standard_EXPORT const Handle(ProjLib_HSequenceOfHSequenceOfPnt)& GetSequence() const;
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
protected:
private:
Standard_EXPORT void BuildIntervals (const GeomAbs_Shape S) const;
Handle(Adaptor3d_HSurface) mySurface;
Handle(Adaptor3d_HCurve) myCurve;
Standard_Integer myNbCurves;
Handle(ProjLib_HSequenceOfHSequenceOfPnt) mySequence;
Standard_Real myTolU;
Standard_Real myTolV;
Standard_Real myMaxDist;
Handle(TColStd_HArray1OfBoolean) myUIso;
Handle(TColStd_HArray1OfBoolean) myVIso;
Handle(TColStd_HArray1OfBoolean) mySnglPnts;
Handle(TColStd_HArray1OfReal) myMaxDistance;
Handle(TColStd_HArray1OfReal) myTabInt;
};
#endif // _ProjLib_CompProjectedCurve_HeaderFile

View File

@@ -1,49 +0,0 @@
-- Created on: 1993-09-07
-- Created by: Bruno DUMORTIER
-- 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 ComputeApprox from ProjLib
---Purpose: Approximate the projection of a 3d curve on an
-- analytic surface and stores the result in Approx.
-- The result is a 2d curve.
uses
HCurve from Adaptor3d,
HSurface from Adaptor3d,
BSplineCurve from Geom2d,
BezierCurve from Geom2d
is
Create(C : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d;
Tol : Real from Standard)
---Purpose: <Tol> is the tolerance with which the
-- approximation is performed.
returns ComputeApprox from ProjLib;
BSpline(me) returns BSplineCurve from Geom2d ;
Bezier(me) returns BezierCurve from Geom2d ;
Tolerance(me) returns Real from Standard;
---Purpose: returns the reached Tolerance.
fields
myTolerance : Real from Standard;
myBSpline : BSplineCurve from Geom2d ;
myBezier : BezierCurve from Geom2d ;
end ComputeApprox;

View File

@@ -0,0 +1,78 @@
// Created on: 1993-09-07
// Created by: Bruno DUMORTIER
// 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 _ProjLib_ComputeApprox_HeaderFile
#define _ProjLib_ComputeApprox_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
class Geom2d_BSplineCurve;
class Geom2d_BezierCurve;
class Adaptor3d_HCurve;
class Adaptor3d_HSurface;
//! Approximate the projection of a 3d curve on an
//! analytic surface and stores the result in Approx.
//! The result is a 2d curve.
class ProjLib_ComputeApprox
{
public:
DEFINE_STANDARD_ALLOC
//! <Tol> is the tolerance with which the
//! approximation is performed.
Standard_EXPORT ProjLib_ComputeApprox(const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const;
Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const;
//! returns the reached Tolerance.
Standard_EXPORT Standard_Real Tolerance() const;
protected:
private:
Standard_Real myTolerance;
Handle(Geom2d_BSplineCurve) myBSpline;
Handle(Geom2d_BezierCurve) myBezier;
};
#endif // _ProjLib_ComputeApprox_HeaderFile

View File

@@ -1,88 +0,0 @@
-- Created on: 1994-10-07
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1994-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ComputeApproxOnPolarSurface from ProjLib
---Purpose: Approximate the projection of a 3d curve on an
-- polar surface and stores the result in Approx.
-- The result is a 2d curve. The evaluation of the
-- current point of the 2d curve is done with the
-- evaluation of the extrema P3d - Surface.
uses
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
HSurface from Adaptor3d,
BSplineCurve from Geom2d,
Curve from Geom2d
is
Create returns ComputeApproxOnPolarSurface from ProjLib;
Create(C : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d ;
Tol : Real = 1.0e-4)
returns ComputeApproxOnPolarSurface from ProjLib;
-- Create(C : HCurve from Adaptor3d ;
-- S : HSurface from Adaptor3d)
---purpose: pour etre en phase avec ProjOnSurf
-- returns ComputeApproxOnPolarSurface from ProjLib;
Create(InitCurve2d : HCurve2d from Adaptor2d ;
C : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d ;
Tol : Real)
returns ComputeApproxOnPolarSurface from ProjLib;
Create(InitCurve2d : HCurve2d from Adaptor2d ;
InitCurve2dBis : HCurve2d from Adaptor2d ;
C : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d ;
Tol : Real)
returns ComputeApproxOnPolarSurface from ProjLib;
Perform(me : in out ; InitCurve2d : HCurve2d from Adaptor2d;
C : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d )
returns BSplineCurve from Geom2d;
BuildInitialCurve2d(me : in out ; Curve : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d )
returns HCurve2d from Adaptor2d;
ProjectUsingInitialCurve2d(me : in out ; Curve : HCurve from Adaptor3d ;
S : HSurface from Adaptor3d ;
InitCurve2d : HCurve2d from Adaptor2d )
returns BSplineCurve from Geom2d;
BSpline(me) returns BSplineCurve from Geom2d ;
Curve2d(me) returns Curve from Geom2d ;
IsDone(me) returns Boolean from Standard;
fields
myProjIsDone : Boolean from Standard;
myTolerance : Real from Standard;
myBSpline : BSplineCurve from Geom2d ;
my2ndCurve : Curve from Geom2d ;
-- myInitCurve2d : HCurve2d from Adaptor3d;
end ComputeApproxOnPolarSurface;

View File

@@ -0,0 +1,92 @@
// Created on: 1994-10-07
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ProjLib_ComputeApproxOnPolarSurface_HeaderFile
#define _ProjLib_ComputeApproxOnPolarSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Geom2d_BSplineCurve;
class Geom2d_Curve;
class Adaptor3d_HCurve;
class Adaptor3d_HSurface;
class Adaptor2d_HCurve2d;
//! Approximate the projection of a 3d curve on an
//! polar surface and stores the result in Approx.
//! The result is a 2d curve. The evaluation of the
//! current point of the 2d curve is done with the
//! evaluation of the extrema P3d - Surface.
class ProjLib_ComputeApproxOnPolarSurface
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface();
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol = 1.0e-4);
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor2d_HCurve2d)& InitCurve2d, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor2d_HCurve2d)& InitCurve2d, const Handle(Adaptor2d_HCurve2d)& InitCurve2dBis, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
Standard_EXPORT Handle(Geom2d_BSplineCurve) Perform (const Handle(Adaptor2d_HCurve2d)& InitCurve2d, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S);
Standard_EXPORT Handle(Adaptor2d_HCurve2d) BuildInitialCurve2d (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& S);
Standard_EXPORT Handle(Geom2d_BSplineCurve) ProjectUsingInitialCurve2d (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor2d_HCurve2d)& InitCurve2d);
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const;
Standard_EXPORT Handle(Geom2d_Curve) Curve2d() const;
Standard_EXPORT Standard_Boolean IsDone() const;
protected:
private:
Standard_Boolean myProjIsDone;
Standard_Real myTolerance;
Handle(Geom2d_BSplineCurve) myBSpline;
Handle(Geom2d_Curve) my2ndCurve;
};
#endif // _ProjLib_ComputeApproxOnPolarSurface_HeaderFile

View File

@@ -1,85 +0,0 @@
-- Created on: 1993-08-24
-- Created by: Bruno DUMORTIER
-- 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 Cone from ProjLib inherits Projector from ProjLib
---Purpose: Projects elementary curves on a cone.
uses
CurveType from GeomAbs,
Cone from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp
raises
NoSuchObject from Standard
is
Create returns Cone from ProjLib;
---Purpose: Undefined projection.
Create(Co : Cone from gp) returns Cone from ProjLib;
---Purpose: Projection on the cone <Co>.
Create(Co : Cone from gp;
L : Lin from gp) returns Cone from ProjLib;
---Purpose: Projection of the line <L> on the cone <Co>.
Create(Co : Cone from gp;
C : Circ from gp) returns Cone from ProjLib;
---Purpose: Projection of the circle <C> on the cone <Co>.
Init(me : in out;
Co : Cone from gp)
is static;
Project(me : in out;
L : Lin from gp)
is redefined;
Project(me : in out;
C : Circ from gp)
is redefined;
Project(me : in out;
E : Elips from gp)
is redefined;
Project(me : in out;
P : Parab from gp)
is redefined;
Project(me : in out;
H : Hypr from gp)
is redefined;
fields
myCone : Cone from gp;
end Cone;

View File

@@ -14,20 +14,26 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_Cone.ixx>
#include <Precision.hxx>
#include <gp.hxx>
#include <gp_Vec.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec2d.hxx>
#include <ElSLib.hxx>
#include <gp.hxx>
#include <gp_Circ.hxx>
#include <gp_Cone.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <Precision.hxx>
#include <ProjLib_Cone.hxx>
#include <Standard_NoSuchObject.hxx>
//=======================================================================
//function : ProjLib_Cone
//purpose :
//=======================================================================
ProjLib_Cone::ProjLib_Cone()
{
}

View File

@@ -0,0 +1,91 @@
// Created on: 1993-08-24
// Created by: Bruno DUMORTIER
// 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 _ProjLib_Cone_HeaderFile
#define _ProjLib_Cone_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Cone.hxx>
#include <ProjLib_Projector.hxx>
class Standard_NoSuchObject;
class gp_Cone;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Projects elementary curves on a cone.
class ProjLib_Cone : public ProjLib_Projector
{
public:
DEFINE_STANDARD_ALLOC
//! Undefined projection.
Standard_EXPORT ProjLib_Cone();
//! Projection on the cone <Co>.
Standard_EXPORT ProjLib_Cone(const gp_Cone& Co);
//! Projection of the line <L> on the cone <Co>.
Standard_EXPORT ProjLib_Cone(const gp_Cone& Co, const gp_Lin& L);
//! Projection of the circle <C> on the cone <Co>.
Standard_EXPORT ProjLib_Cone(const gp_Cone& Co, const gp_Circ& C);
Standard_EXPORT void Init (const gp_Cone& Co);
Standard_EXPORT virtual void Project (const gp_Lin& L) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Circ& C) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Elips& E) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Parab& P) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Hypr& H) Standard_OVERRIDE;
protected:
private:
gp_Cone myCone;
};
#endif // _ProjLib_Cone_HeaderFile

View File

@@ -1,89 +0,0 @@
-- Created on: 1993-08-24
-- Created by: Bruno DUMORTIER
-- 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 Cylinder from ProjLib inherits Projector from ProjLib
---Purpose: Projects elementary curves on a cylinder.
uses
CurveType from GeomAbs,
Cylinder from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp
raises
NoSuchObject from Standard
is
Create returns Cylinder from ProjLib;
---Purpose: Undefined projection.
Create(Cyl : Cylinder from gp) returns Cylinder from ProjLib;
---Purpose: Projection on the cylinder <Cyl>.
Create(Cyl : Cylinder from gp;
L : Lin from gp) returns Cylinder from ProjLib;
---Purpose: Projection of the line <L> on the cylinder <Cyl>.
Create(Cyl : Cylinder from gp;
C : Circ from gp) returns Cylinder from ProjLib;
---Purpose: Projection of the circle <C> on the cylinder <Cyl>.
Create(Cyl : Cylinder from gp;
E : Elips from gp) returns Cylinder from ProjLib;
---Purpose: Projection of the ellipse <E> on the cylinder <Cyl>.
Init(me : in out;
Cyl : Cylinder from gp)
is static;
Project(me : in out;
L : Lin from gp)
is redefined;
Project(me : in out;
C : Circ from gp)
is redefined;
Project(me : in out;
E : Elips from gp)
is redefined;
Project(me : in out;
P : Parab from gp)
is redefined;
Project(me : in out;
H : Hypr from gp)
is redefined;
fields
myCylinder : Cylinder from gp;
end Cylinder;

View File

@@ -14,22 +14,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <ProjLib_Cylinder.ixx>
#include <Precision.hxx>
#include <gp_Ax3.hxx>
#include <gp_Circ.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Pln.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <gp_Ax3.hxx>
#include <gp_Vec2d.hxx>
#include <Precision.hxx>
#include <ProjLib_Cylinder.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
//=======================================================================
//function : ProjLib_Cylinder
//purpose :
//=======================================================================
ProjLib_Cylinder::ProjLib_Cylinder()
{
}

View File

@@ -0,0 +1,94 @@
// Created on: 1993-08-24
// Created by: Bruno DUMORTIER
// 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 _ProjLib_Cylinder_HeaderFile
#define _ProjLib_Cylinder_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Cylinder.hxx>
#include <ProjLib_Projector.hxx>
class Standard_NoSuchObject;
class gp_Cylinder;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Projects elementary curves on a cylinder.
class ProjLib_Cylinder : public ProjLib_Projector
{
public:
DEFINE_STANDARD_ALLOC
//! Undefined projection.
Standard_EXPORT ProjLib_Cylinder();
//! Projection on the cylinder <Cyl>.
Standard_EXPORT ProjLib_Cylinder(const gp_Cylinder& Cyl);
//! Projection of the line <L> on the cylinder <Cyl>.
Standard_EXPORT ProjLib_Cylinder(const gp_Cylinder& Cyl, const gp_Lin& L);
//! Projection of the circle <C> on the cylinder <Cyl>.
Standard_EXPORT ProjLib_Cylinder(const gp_Cylinder& Cyl, const gp_Circ& C);
//! Projection of the ellipse <E> on the cylinder <Cyl>.
Standard_EXPORT ProjLib_Cylinder(const gp_Cylinder& Cyl, const gp_Elips& E);
Standard_EXPORT void Init (const gp_Cylinder& Cyl);
Standard_EXPORT virtual void Project (const gp_Lin& L) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Circ& C) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Elips& E) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Parab& P) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Hypr& H) Standard_OVERRIDE;
protected:
private:
gp_Cylinder myCylinder;
};
#endif // _ProjLib_Cylinder_HeaderFile

View File

@@ -0,0 +1,87 @@
// Created on: 1993-08-11
// Created by: Bruno DUMORTIER
// 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 _ProjLib_HCompProjectedCurve_HeaderFile
#define _ProjLib_HCompProjectedCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <ProjLib_CompProjectedCurve.hxx>
#include <Adaptor2d_HCurve2d.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class ProjLib_CompProjectedCurve;
class Adaptor2d_Curve2d;
class ProjLib_HCompProjectedCurve;
DEFINE_STANDARD_HANDLE(ProjLib_HCompProjectedCurve, Adaptor2d_HCurve2d)
class ProjLib_HCompProjectedCurve : public Adaptor2d_HCurve2d
{
public:
Standard_EXPORT ProjLib_HCompProjectedCurve();
Standard_EXPORT ProjLib_HCompProjectedCurve(const ProjLib_CompProjectedCurve& C);
Standard_EXPORT void Set (const ProjLib_CompProjectedCurve& C);
Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const;
ProjLib_CompProjectedCurve& ChangeCurve2d();
DEFINE_STANDARD_RTTI(ProjLib_HCompProjectedCurve,Adaptor2d_HCurve2d)
protected:
ProjLib_CompProjectedCurve myCurve;
private:
};
#define TheCurve ProjLib_CompProjectedCurve
#define TheCurve_hxx <ProjLib_CompProjectedCurve.hxx>
#define Adaptor2d_GenHCurve2d ProjLib_HCompProjectedCurve
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HCompProjectedCurve.hxx>
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HCompProjectedCurve)
#include <Adaptor2d_GenHCurve2d.lxx>
#undef TheCurve
#undef TheCurve_hxx
#undef Adaptor2d_GenHCurve2d
#undef Adaptor2d_GenHCurve2d_hxx
#undef Handle_Adaptor2d_GenHCurve2d
#endif // _ProjLib_HCompProjectedCurve_HeaderFile

View File

@@ -0,0 +1,42 @@
// Created on: 1993-08-11
// Created by: Bruno DUMORTIER
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_HCompProjectedCurve.hxx>
#include <Standard_Type.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_DomainError.hxx>
#include <ProjLib_CompProjectedCurve.hxx>
#include <Adaptor2d_Curve2d.hxx>
#define TheCurve ProjLib_CompProjectedCurve
#define TheCurve_hxx <ProjLib_CompProjectedCurve.hxx>
#define Adaptor2d_GenHCurve2d ProjLib_HCompProjectedCurve
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HCompProjectedCurve.hxx>
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HCompProjectedCurve)
#include <Adaptor2d_GenHCurve2d.gxx>

View File

@@ -0,0 +1,87 @@
// Created on: 1993-08-11
// Created by: Bruno DUMORTIER
// 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 _ProjLib_HProjectedCurve_HeaderFile
#define _ProjLib_HProjectedCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <ProjLib_ProjectedCurve.hxx>
#include <Adaptor2d_HCurve2d.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class ProjLib_ProjectedCurve;
class Adaptor2d_Curve2d;
class ProjLib_HProjectedCurve;
DEFINE_STANDARD_HANDLE(ProjLib_HProjectedCurve, Adaptor2d_HCurve2d)
class ProjLib_HProjectedCurve : public Adaptor2d_HCurve2d
{
public:
Standard_EXPORT ProjLib_HProjectedCurve();
Standard_EXPORT ProjLib_HProjectedCurve(const ProjLib_ProjectedCurve& C);
Standard_EXPORT void Set (const ProjLib_ProjectedCurve& C);
Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const;
ProjLib_ProjectedCurve& ChangeCurve2d();
DEFINE_STANDARD_RTTI(ProjLib_HProjectedCurve,Adaptor2d_HCurve2d)
protected:
ProjLib_ProjectedCurve myCurve;
private:
};
#define TheCurve ProjLib_ProjectedCurve
#define TheCurve_hxx <ProjLib_ProjectedCurve.hxx>
#define Adaptor2d_GenHCurve2d ProjLib_HProjectedCurve
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HProjectedCurve.hxx>
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HProjectedCurve)
#include <Adaptor2d_GenHCurve2d.lxx>
#undef TheCurve
#undef TheCurve_hxx
#undef Adaptor2d_GenHCurve2d
#undef Adaptor2d_GenHCurve2d_hxx
#undef Handle_Adaptor2d_GenHCurve2d
#endif // _ProjLib_HProjectedCurve_HeaderFile

View File

@@ -0,0 +1,42 @@
// Created on: 1993-08-11
// Created by: Bruno DUMORTIER
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_HProjectedCurve.hxx>
#include <Standard_Type.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_DomainError.hxx>
#include <ProjLib_ProjectedCurve.hxx>
#include <Adaptor2d_Curve2d.hxx>
#define TheCurve ProjLib_ProjectedCurve
#define TheCurve_hxx <ProjLib_ProjectedCurve.hxx>
#define Adaptor2d_GenHCurve2d ProjLib_HProjectedCurve
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HProjectedCurve.hxx>
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HProjectedCurve)
#include <Adaptor2d_GenHCurve2d.gxx>

View File

@@ -1,99 +0,0 @@
-- Created on: 1993-08-11
-- Created by: Remi LEQUETTE
-- 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 Plane from ProjLib inherits Projector from ProjLib
---Purpose: Projects elementary curves on a plane.
uses
CurveType from GeomAbs,
Pln from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp
raises
NoSuchObject from Standard
is
Create returns Plane from ProjLib;
---Purpose: Undefined projection.
Create(Pl : Pln from gp) returns Plane from ProjLib;
---Purpose: Projection on the plane <Pl>.
Create(Pl : Pln from gp;
L : Lin from gp) returns Plane from ProjLib;
---Purpose: Projection of the line <L> on the plane <Pl>.
Create(Pl : Pln from gp;
C : Circ from gp) returns Plane from ProjLib;
---Purpose: Projection of the circle <C> on the plane <Pl>.
Create(Pl : Pln from gp;
E : Elips from gp) returns Plane from ProjLib;
---Purpose: Projection of the ellipse <E> on the plane <Pl>.
Create(Pl : Pln from gp;
P : Parab from gp) returns Plane from ProjLib;
---Purpose: Projection of the parabola <P> on the plane <Pl>.
Create(Pl : Pln from gp;
H : Hypr from gp) returns Plane from ProjLib;
---Purpose: Projection of the hyperbola <H> on the plane <Pl>.
Init(me : in out;
Pl : Pln from gp)
is static;
Project(me : in out;
L : Lin from gp)
is redefined;
Project(me : in out;
C : Circ from gp)
is redefined;
Project(me : in out;
E : Elips from gp)
is redefined;
Project(me : in out;
P : Parab from gp)
is redefined;
Project(me : in out;
H : Hypr from gp)
is redefined;
fields
myPlane : Pln from gp;
end Plane;

View File

@@ -14,15 +14,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_Plane.ixx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <ProjLib_Plane.hxx>
#include <Standard_NoSuchObject.hxx>
//=======================================================================
//function : ProjLib_Plane
//purpose :
//=======================================================================
ProjLib_Plane::ProjLib_Plane()
{
}

View File

@@ -0,0 +1,100 @@
// Created on: 1993-08-11
// Created by: Remi LEQUETTE
// 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 _ProjLib_Plane_HeaderFile
#define _ProjLib_Plane_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Pln.hxx>
#include <ProjLib_Projector.hxx>
class Standard_NoSuchObject;
class gp_Pln;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Projects elementary curves on a plane.
class ProjLib_Plane : public ProjLib_Projector
{
public:
DEFINE_STANDARD_ALLOC
//! Undefined projection.
Standard_EXPORT ProjLib_Plane();
//! Projection on the plane <Pl>.
Standard_EXPORT ProjLib_Plane(const gp_Pln& Pl);
//! Projection of the line <L> on the plane <Pl>.
Standard_EXPORT ProjLib_Plane(const gp_Pln& Pl, const gp_Lin& L);
//! Projection of the circle <C> on the plane <Pl>.
Standard_EXPORT ProjLib_Plane(const gp_Pln& Pl, const gp_Circ& C);
//! Projection of the ellipse <E> on the plane <Pl>.
Standard_EXPORT ProjLib_Plane(const gp_Pln& Pl, const gp_Elips& E);
//! Projection of the parabola <P> on the plane <Pl>.
Standard_EXPORT ProjLib_Plane(const gp_Pln& Pl, const gp_Parab& P);
//! Projection of the hyperbola <H> on the plane <Pl>.
Standard_EXPORT ProjLib_Plane(const gp_Pln& Pl, const gp_Hypr& H);
Standard_EXPORT void Init (const gp_Pln& Pl);
Standard_EXPORT virtual void Project (const gp_Lin& L) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Circ& C) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Elips& E) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Parab& P) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Hypr& H) Standard_OVERRIDE;
protected:
private:
gp_Pln myPlane;
};
#endif // _ProjLib_Plane_HeaderFile

View File

@@ -1,80 +0,0 @@
-- Created on: 1997-11-06
-- Created by: Roman BORISOV
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class PrjFunc from ProjLib inherits FunctionSetWithDerivatives from math
---Purpose:
uses
Vector from math,
Matrix from math,
CurvePtr from Adaptor3d,
SurfacePtr from Adaptor3d,
Pnt2d from gp
raises ConstructionError
is
Create (C: CurvePtr from Adaptor3d; FixVal: Real from Standard; S: SurfacePtr from Adaptor3d; Fix: Integer)
returns PrjFunc
raises ConstructionError;
NbVariables(me)
---Purpose: returns the number of variables of the function.
returns Integer;
NbEquations(me)
---Purpose: returns the number of equations of the function.
returns Integer;
Value(me: in out; X: Vector from math; F: out Vector from math)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean;
Derivatives(me: in out; X: Vector from math; D: out Matrix from math)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean;
Values(me: in out; X: Vector from math; F: out Vector from math; D: out Matrix from math)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean;
Solution(me) returns Pnt2d from gp;
---Purpose: returns point on surface
fields
myCurve : CurvePtr from Adaptor3d;
mySurface : SurfacePtr from Adaptor3d;
myt : Real from Standard;
myU, myV : Real from Standard;
myFix : Integer from Standard;
myNorm : Real from Standard;
end PrjFunc;

View File

@@ -14,11 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_PrjFunc.ixx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Adaptor3d_Surface.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_Surface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
#include <math_Matrix.hxx>
#include <ProjLib_PrjFunc.hxx>
#include <Standard_ConstructionError.hxx>
ProjLib_PrjFunc::ProjLib_PrjFunc(const Adaptor3d_CurvePtr & C,const Standard_Real FixVal,const Adaptor3d_SurfacePtr & S, const Standard_Integer Fix) : myCurve(C), mySurface(S), myt(0), myU(0), myV(0), myFix(Fix)
{

View File

@@ -0,0 +1,103 @@
// Created on: 1997-11-06
// Created by: Roman BORISOV
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ProjLib_PrjFunc_HeaderFile
#define _ProjLib_PrjFunc_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Adaptor3d_CurvePtr.hxx>
#include <Adaptor3d_SurfacePtr.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <math_FunctionSetWithDerivatives.hxx>
#include <Standard_Boolean.hxx>
#include <math_Vector.hxx>
class Standard_ConstructionError;
class math_Matrix;
class gp_Pnt2d;
class ProjLib_PrjFunc : public math_FunctionSetWithDerivatives
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ProjLib_PrjFunc(const Adaptor3d_CurvePtr& C, const Standard_Real FixVal, const Adaptor3d_SurfacePtr& S, const Standard_Integer Fix);
//! returns the number of variables of the function.
Standard_EXPORT Standard_Integer NbVariables() const;
//! returns the number of equations of the function.
Standard_EXPORT Standard_Integer NbEquations() const;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
//! returns point on surface
Standard_EXPORT gp_Pnt2d Solution() const;
protected:
private:
Adaptor3d_CurvePtr myCurve;
Adaptor3d_SurfacePtr mySurface;
Standard_Real myt;
Standard_Real myU;
Standard_Real myV;
Standard_Integer myFix;
Standard_Real myNorm;
};
#endif // _ProjLib_PrjFunc_HeaderFile

View File

@@ -1,69 +0,0 @@
-- Created on: 1997-11-06
-- Created by: Roman BORISOV
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class PrjResolve from ProjLib
---Purpose:
uses
Pnt2d from gp,
Surface from Adaptor3d,
Curve from Adaptor3d,
SurfacePtr from Adaptor3d,
CurvePtr from Adaptor3d
raises
DomainError from Standard,
ConstructionError,
NotDone from StdFail
is
Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d; Fix: Integer)
returns PrjResolve
raises ConstructionError;
Perform(me: in out; t, U, V: Real; Tol, Inf, Sup: Pnt2d; FTol: Real from Standard = -1; StrictInside: Boolean from Standard = Standard_False)
---Purpose: Calculates the ort from C(t) to S with a close point.
-- The close point is defined by the parameter values
-- U0 and V0.
-- The function F(u,v)=distance(S(u,v),C(t)) has an
-- extremum when gradient(F)=0. The algorithm searchs
-- a zero near the close point.
raises DomainError;
-- if U0,V0 are outside the definition ranges of the
-- surface.
IsDone (me) returns Boolean
---Purpose: Returns True if the distance is found.
is static;
Solution (me) returns Pnt2d from gp
---Purpose: Returns the point of the extremum distance.
raises NotDone from StdFail
-- if IsDone(me)=False.
is static;
fields
myCurve : CurvePtr from Adaptor3d;
mySurface : SurfacePtr from Adaptor3d;
myDone : Boolean from Standard;
mySolution : Pnt2d from gp;
myFix : Integer from Standard;
end PrjResolve;

View File

@@ -14,10 +14,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_PrjResolve.ixx>
#include <ProjLib_PrjFunc.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_Surface.hxx>
#include <gp_Pnt2d.hxx>
#include <math_FunctionSetRoot.hxx>
#include <math_NewtonFunctionSetRoot.hxx>
#include <ProjLib_PrjFunc.hxx>
#include <ProjLib_PrjResolve.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_DomainError.hxx>
#include <StdFail_NotDone.hxx>
ProjLib_PrjResolve::ProjLib_PrjResolve(const Adaptor3d_Curve& C,const Adaptor3d_Surface& S,const Standard_Integer Fix) : myFix(Fix)
{

View File

@@ -0,0 +1,90 @@
// Created on: 1997-11-06
// Created by: Roman BORISOV
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ProjLib_PrjResolve_HeaderFile
#define _ProjLib_PrjResolve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Adaptor3d_CurvePtr.hxx>
#include <Adaptor3d_SurfacePtr.hxx>
#include <Standard_Boolean.hxx>
#include <gp_Pnt2d.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
class Standard_DomainError;
class Standard_ConstructionError;
class StdFail_NotDone;
class Adaptor3d_Curve;
class Adaptor3d_Surface;
class gp_Pnt2d;
class ProjLib_PrjResolve
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ProjLib_PrjResolve(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Integer Fix);
//! Calculates the ort from C(t) to S with a close point.
//! The close point is defined by the parameter values
//! U0 and V0.
//! The function F(u,v)=distance(S(u,v),C(t)) has an
//! extremum when gradient(F)=0. The algorithm searchs
//! a zero near the close point.
Standard_EXPORT void Perform (const Standard_Real t, const Standard_Real U, const Standard_Real V, const gp_Pnt2d& Tol, const gp_Pnt2d& Inf, const gp_Pnt2d& Sup, const Standard_Real FTol = -1, const Standard_Boolean StrictInside = Standard_False);
//! Returns True if the distance is found.
Standard_EXPORT Standard_Boolean IsDone() const;
//! Returns the point of the extremum distance.
Standard_EXPORT gp_Pnt2d Solution() const;
protected:
private:
Adaptor3d_CurvePtr myCurve;
Adaptor3d_SurfacePtr mySurface;
Standard_Boolean myDone;
gp_Pnt2d mySolution;
Standard_Integer myFix;
};
#endif // _ProjLib_PrjResolve_HeaderFile

View File

@@ -1,312 +0,0 @@
-- Created on: 1994-09-02
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1994-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ProjectOnPlane from ProjLib inherits Curve from Adaptor3d
---Purpose: Class used to project a 3d curve on a plane. The
-- result will be a 3d curve.
--
-- You can ask the projected curve to have the same
-- parametrization as the original curve.
--
-- The projection can be done along every direction not
-- parallel to the plane.
--
uses
Shape from GeomAbs,
CurveType from GeomAbs,
Dir from gp,
Ax3 from gp,
Vec from gp,
Pnt from gp,
Circ from gp,
Elips from gp,
Hypr from gp,
Parab from gp,
Lin from gp,
Curve from Adaptor3d,
HCurve from GeomAdaptor,
HCurve from Adaptor3d,
BezierCurve from Geom,
BSplineCurve from Geom,
Array1OfPnt from TColgp,
Array1OfReal from TColStd,
Array1OfInteger from TColStd
raises
OutOfRange from Standard,
NoSuchObject from Standard,
DomainError from Standard,
ConstructionError from Standard,
NotImplemented from Standard
is
Create returns ProjectOnPlane from ProjLib;
---Purpose: Empty constructor.
Create( Pl : Ax3 from gp)
---Purpose: The projection will be normal to the Plane defined
-- by the Ax3 <Pl>.
returns ProjectOnPlane from ProjLib;
Create( Pl : Ax3 from gp;
D : Dir from gp )
returns ProjectOnPlane from ProjLib
---Purpose: The projection will be along the direction <D> on
-- the plane defined by the Ax3 <Pl>.
raises
ConstructionError from Standard;
---Purpose: raises if the direction <D> is parallel to the
-- plane <Pl>.
Load(me : in out;
C : HCurve from Adaptor3d;
Tolerance : Real from Standard;
KeepParametrization : Boolean from Standard = Standard_True)
---Purpose: Sets the Curve and perform the projection. if
-- <KeepParametrization> is true, the parametrization
-- of the Projected Curve <PC> will be the same as
-- the parametrization of the initial curve <C>. It
-- meens: proj(C(u)) = PC(u) for each u. Otherwize,
-- the parametrization may change.
is static;
GetPlane(me) returns Ax3 from gp
---C++: return const &
is static;
GetDirection (me) returns Dir from gp
---C++: return const &
is static;
GetCurve(me) returns HCurve from Adaptor3d
---C++: return const &
is static;
--
-- Global methods - Apply to the whole curve.
--
FirstParameter(me) returns Real
is redefined static;
LastParameter(me) returns Real
is redefined static;
Continuity(me) returns Shape from GeomAbs
is redefined static;
NbIntervals(me; S : Shape from GeomAbs) returns Integer
---Purpose: If necessary, breaks the curve in intervals of
-- continuity <S>. And returns the number of
-- intervals.
is redefined static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard
is redefined static;
Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
---Purpose: Returns a curve equivalent of <me> between
-- parameters <First> and <Last>. <Tol> is used to
-- test for 3d points confusion.
raises
OutOfRange from Standard
---Purpose: If <First> >= <Last>
is redefined static;
IsClosed(me) returns Boolean
is redefined static;
IsPeriodic(me) returns Boolean
is redefined static;
Period(me) returns Real
raises
DomainError from Standard -- if the curve is not periodic
is redefined static;
Value(me; U : Real) returns Pnt from gp
--- Purpose : Computes the point of parameter U on the curve.
is redefined static;
D0 (me; U : Real; P : out Pnt from gp)
--- Purpose : Computes the point of parameter U on the curve.
is redefined static;
D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
--- Purpose : Computes the point of parameter U on the curve with its
-- first derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C1.
is redefined static;
D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
--- Purpose :
-- Returns the point P of parameter U, the first and second
-- derivatives V1 and V2.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C2.
is redefined static;
D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
--- Purpose :
-- Returns the point P of parameter U, the first, the second
-- and the third derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C3.
is redefined static;
DN (me; U : Real; N : Integer) returns Vec from gp
--- Purpose :
-- The returned vector gives the value of the derivative for the
-- order of derivation N.
raises
DomainError from Standard,
--- Purpose : Raised if the continuity of the current interval
-- is not CN.
OutOfRange from Standard
--- Purpose : Raised if N < 1.
is redefined static;
Resolution(me; R3d : Real) returns Real
---Purpose : Returns the parametric resolution corresponding
-- to the real space resolution <R3d>.
is redefined static;
GetType(me) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
is redefined static;
--
-- The following methods must be called when GetType returned
-- the corresponding type.
--
Line(me) returns Lin from gp
raises
NoSuchObject from Standard
is redefined static;
Circle(me) returns Circ from gp
raises
NoSuchObject from Standard
is redefined static;
Ellipse(me) returns Elips from gp
raises
NoSuchObject from Standard
is redefined static;
Hyperbola(me) returns Hypr from gp
raises
NoSuchObject from Standard
is redefined static;
Parabola(me) returns Parab from gp
raises
NoSuchObject from Standard
is redefined static;
Degree(me) returns Integer
raises
NoSuchObject from Standard
is redefined static;
IsRational(me) returns Boolean
raises
NoSuchObject from Standard
is redefined static;
NbPoles(me) returns Integer
raises
NoSuchObject from Standard
is redefined static;
NbKnots(me) returns Integer
raises
NoSuchObject from Standard
is redefined static;
Bezier(me) returns BezierCurve from Geom
raises
NoSuchObject from Standard
is redefined static;
---Purpose: Warning ! this will NOT make a copy of the
-- Bezier Curve : If you want to modify
-- the Curve please make a copy yourself
-- Also it will NOT trim the surface to
-- myFirst/Last.
BSpline(me) returns BSplineCurve from Geom
raises
NoSuchObject from Standard
is redefined static;
---Purpose: Warning ! this will NOT make a copy of the
-- BSpline Curve : If you want to modify
-- the Curve please make a copy yourself
-- Also it will NOT trim the surface to
-- myFirst/Last.
fields
myCurve : HCurve from Adaptor3d ;
myPlane : Ax3 from gp;
myDirection : Dir from gp;
myKeepParam : Boolean from Standard;
myFirstPar : Real from Standard;
myLastPar : Real from Standard;
myTolerance : Real from Standard;
-- the tolerance to make the approximation if
-- necessary
myType : CurveType from GeomAbs;
myResult : HCurve from GeomAdaptor ;
myIsApprox : Boolean from Standard;
-- the result of the approximation
end ProjectOnPlane;

View File

@@ -0,0 +1,233 @@
// Created on: 1994-09-02
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ProjLib_ProjectOnPlane_HeaderFile
#define _ProjLib_ProjectOnPlane_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Ax3.hxx>
#include <gp_Dir.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Adaptor3d_Curve.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfReal.hxx>
class Adaptor3d_HCurve;
class GeomAdaptor_HCurve;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class Standard_ConstructionError;
class Standard_NotImplemented;
class gp_Ax3;
class gp_Dir;
class gp_Pnt;
class gp_Vec;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Hypr;
class gp_Parab;
class Geom_BezierCurve;
class Geom_BSplineCurve;
//! Class used to project a 3d curve on a plane. The
//! result will be a 3d curve.
//!
//! You can ask the projected curve to have the same
//! parametrization as the original curve.
//!
//! The projection can be done along every direction not
//! parallel to the plane.
class ProjLib_ProjectOnPlane : public Adaptor3d_Curve
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
Standard_EXPORT ProjLib_ProjectOnPlane();
//! The projection will be normal to the Plane defined
//! by the Ax3 <Pl>.
Standard_EXPORT ProjLib_ProjectOnPlane(const gp_Ax3& Pl);
//! The projection will be along the direction <D> on
//! the plane defined by the Ax3 <Pl>.
//! raises if the direction <D> is parallel to the
//! plane <Pl>.
Standard_EXPORT ProjLib_ProjectOnPlane(const gp_Ax3& Pl, const gp_Dir& D);
//! Sets the Curve and perform the projection. if
//! <KeepParametrization> is true, the parametrization
//! of the Projected Curve <PC> will be the same as
//! the parametrization of the initial curve <C>. It
//! meens: proj(C(u)) = PC(u) for each u. Otherwize,
//! the parametrization may change.
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tolerance, const Standard_Boolean KeepParametrization = Standard_True);
Standard_EXPORT const gp_Ax3& GetPlane() const;
Standard_EXPORT const gp_Dir& GetDirection() const;
Standard_EXPORT const Handle(Adaptor3d_HCurve)& GetCurve() const;
Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
//! If necessary, breaks the curve in intervals of
//! continuity <S>. And returns the number of
//! intervals.
Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accomodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Returns a curve equivalent of <me> between
//! parameters <First> and <Last>. <Tol> is used to
//! test for 3d points confusion.
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT gp_Pnt Value (const Standard_Real U) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const Standard_OVERRIDE;
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
Standard_EXPORT Standard_Real Resolution (const Standard_Real R3d) const Standard_OVERRIDE;
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
Standard_EXPORT gp_Lin Line() const Standard_OVERRIDE;
Standard_EXPORT gp_Circ Circle() const Standard_OVERRIDE;
Standard_EXPORT gp_Elips Ellipse() const Standard_OVERRIDE;
Standard_EXPORT gp_Hypr Hyperbola() const Standard_OVERRIDE;
Standard_EXPORT gp_Parab Parabola() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer Degree() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer NbPoles() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer NbKnots() const Standard_OVERRIDE;
//! Warning ! this will NOT make a copy of the
//! Bezier Curve : If you want to modify
//! the Curve please make a copy yourself
//! Also it will NOT trim the surface to
//! myFirst/Last.
Standard_EXPORT Handle(Geom_BezierCurve) Bezier() const Standard_OVERRIDE;
//! Warning ! this will NOT make a copy of the
//! BSpline Curve : If you want to modify
//! the Curve please make a copy yourself
//! Also it will NOT trim the surface to
//! myFirst/Last.
Standard_EXPORT Handle(Geom_BSplineCurve) BSpline() const Standard_OVERRIDE;
protected:
private:
Handle(Adaptor3d_HCurve) myCurve;
gp_Ax3 myPlane;
gp_Dir myDirection;
Standard_Boolean myKeepParam;
Standard_Real myFirstPar;
Standard_Real myLastPar;
Standard_Real myTolerance;
GeomAbs_CurveType myType;
Handle(GeomAdaptor_HCurve) myResult;
Standard_Boolean myIsApprox;
};
#endif // _ProjLib_ProjectOnPlane_HeaderFile

View File

@@ -1,62 +0,0 @@
-- Created on: 1994-09-15
-- Created by: Bruno DUMORTIER
-- Copyright (c) 1994-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ProjectOnSurface from ProjLib
---Purpose: Project a curve on a surface. The result ( a 3D
-- Curve) will be an approximation
uses
HCurve from Adaptor3d,
HSurface from Adaptor3d,
BSplineCurve from Geom
is
Create
---Purpose: Create an empty projector.
returns ProjectOnSurface from ProjLib;
Create( S : HSurface from Adaptor3d)
---Purpose: Create a projector normaly to the surface <S>.
returns ProjectOnSurface from ProjLib;
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~ProjLib_ProjectOnSurface(){Delete() ; }"
Load(me : in out; S : HSurface from Adaptor3d)
---Purpose: Set the Surface to <S>.
-- To compute the projection, you have to Load the Curve.
is static;
Load(me : in out; C : HCurve from Adaptor3d; Tolerance : Real)
---Purpose: Compute the projection of the curve <C> on the Surface.
is static;
IsDone(me) returns Boolean ;
BSpline(me) returns BSplineCurve from Geom
is static ;
fields
myCurve : HCurve from Adaptor3d ;
mySurface : HSurface from Adaptor3d ;
myTolerance : Real ;
myIsDone : Boolean ;
myResult : BSplineCurve from Geom ;
end ProjectOnSurface;

View File

@@ -14,29 +14,28 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_ProjectOnSurface.ixx>
#include <AppCont_Function.hxx>
#include <Approx_FitAndDivide.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Extrema_POnSurf.hxx>
#include <Precision.hxx>
#include <BSplCLib.hxx>
#include <PLib.hxx>
#include <Adaptor3d_HCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <AppCont_Function.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <Approx_FitAndDivide.hxx>
#include <BSplCLib.hxx>
#include <Extrema_ExtPS.hxx>
#include <Extrema_POnSurf.hxx>
#include <Geom_BSplineCurve.hxx>
#include <PLib.hxx>
#include <Precision.hxx>
#include <ProjLib_ProjectOnSurface.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
//=======================================================================
//function : OnSurface_Value
//purpose : Evaluate current point of the projected curve
//=======================================================================
static gp_Pnt OnSurface_Value(const Standard_Real U,
const Handle(Adaptor3d_HCurve)& myCurve,
Extrema_ExtPS * myExtPS)

View File

@@ -0,0 +1,88 @@
// Created on: 1994-09-15
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ProjLib_ProjectOnSurface_HeaderFile
#define _ProjLib_ProjectOnSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Adaptor3d_HCurve;
class Adaptor3d_HSurface;
class Geom_BSplineCurve;
//! Project a curve on a surface. The result ( a 3D
//! Curve) will be an approximation
class ProjLib_ProjectOnSurface
{
public:
DEFINE_STANDARD_ALLOC
//! Create an empty projector.
Standard_EXPORT ProjLib_ProjectOnSurface();
//! Create a projector normaly to the surface <S>.
Standard_EXPORT ProjLib_ProjectOnSurface(const Handle(Adaptor3d_HSurface)& S);
Standard_EXPORT virtual void Delete();
Standard_EXPORT virtual ~ProjLib_ProjectOnSurface(){Delete() ; }
//! Set the Surface to <S>.
//! To compute the projection, you have to Load the Curve.
Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
//! Compute the projection of the curve <C> on the Surface.
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tolerance);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Handle(Geom_BSplineCurve) BSpline() const;
protected:
private:
Handle(Adaptor3d_HCurve) myCurve;
Handle(Adaptor3d_HSurface) mySurface;
Standard_Real myTolerance;
Standard_Boolean myIsDone;
Handle(Geom_BSplineCurve) myResult;
};
#endif // _ProjLib_ProjectOnSurface_HeaderFile

View File

@@ -1,283 +0,0 @@
-- Created on: 1993-08-25
-- Created by: Bruno DUMORTIER
-- 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 ProjectedCurve from ProjLib inherits Curve2d from Adaptor2d
---Purpose: Compute the 2d-curve. Try to solve the particular
-- case if possible. Otherwize, an approximation is
-- done.
uses
Projector from ProjLib,
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,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
HSurface from Adaptor3d,
BezierCurve from Geom2d,
BSplineCurve from Geom2d,
Array1OfReal from TColStd
raises
OutOfRange from Standard,
NoSuchObject from Standard,
DomainError from Standard,
NotImplemented from Standard
is
Create returns ProjectedCurve;
Create(S : HSurface from Adaptor3d)
returns ProjectedCurve;
Create(S : HSurface from Adaptor3d;
C : HCurve from Adaptor3d)
returns ProjectedCurve;
Create(S : HSurface from Adaptor3d;
C : HCurve from Adaptor3d;
Tol : Real from Standard)
returns ProjectedCurve;
Load(me : in out ; Tolerance : Real)
---Purpose: Changes the tolerance used to project
-- the curve on the surface
is static;
Load(me : in out; S : HSurface from Adaptor3d)
---Purpose: Changes the Surface.
is static;
Load(me : in out; C : HCurve from Adaptor3d)
---Purpose: Changes the Curve.
is static;
GetSurface(me) returns HSurface from Adaptor3d
---C++: return const &
is static;
GetCurve(me) returns HCurve from Adaptor3d
---C++: return const &
is static;
GetTolerance(me) returns Real from Standard
---Purpose: returns the tolerance reached if an approximation
-- is Done.
is static;
--
-- Global methods - Apply to the whole curve.
--
FirstParameter(me) returns Real
is redefined static;
LastParameter(me) returns Real
is redefined static;
Continuity(me) returns Shape from GeomAbs
is redefined static;
NbIntervals(me ; S : Shape from GeomAbs) returns Integer
---Purpose: If necessary, breaks the curve in intervals of
-- continuity <S>. And returns the number of
-- intervals.
is redefined static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard
is redefined static;
Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
---Purpose: Returns a curve equivalent of <me> between
-- parameters <First> and <Last>. <Tol> is used to
-- test for 3d points confusion.
raises
OutOfRange from Standard
---Purpose: If <First> >= <Last>
is redefined static;
IsClosed(me) returns Boolean
is redefined static;
IsPeriodic(me) returns Boolean
is redefined static;
Period(me) returns Real
raises
DomainError from Standard -- if the curve is not periodic
is redefined static;
Value(me; U : Real) returns Pnt2d from gp
--- Purpose : Computes the point of parameter U on the curve.
is redefined static;
D0 (me; U : Real; P : out Pnt2d from gp)
--- Purpose : Computes the point of parameter U on the curve.
is redefined static;
D1 (me; 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.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C1.
is redefined static;
D2 (me; 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.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C2.
is redefined static;
D3 (me; 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.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C3.
is redefined static;
DN (me; U : Real; N : Integer) returns Vec2d from gp
--- Purpose :
-- The returned vector gives the value of the derivative for the
-- order of derivation N.
raises
DomainError from Standard,
--- Purpose : Raised if the continuity of the current interval
-- is not CN.
OutOfRange from Standard
--- Purpose : Raised if N < 1.
is redefined static;
Resolution(me; R3d : Real) returns Real
---Purpose : Returns the parametric resolution corresponding
-- to the real space resolution <R3d>.
is redefined static;
GetType(me) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
is redefined static;
--
-- The following methods must be called when GetType returned
-- the corresponding type.
--
Line(me) returns Lin2d from gp
raises
NoSuchObject from Standard
is redefined static;
Circle(me) returns Circ2d from gp
raises
NoSuchObject from Standard
is redefined static;
Ellipse(me) returns Elips2d from gp
raises
NoSuchObject from Standard
is redefined static;
Hyperbola(me) returns Hypr2d from gp
raises
NoSuchObject from Standard
is redefined static;
Parabola(me) returns Parab2d from gp
raises
NoSuchObject from Standard
is redefined static;
Degree(me) returns Integer
raises
NoSuchObject from Standard
is redefined static;
IsRational(me) returns Boolean
raises
NoSuchObject from Standard
is redefined static;
NbPoles(me) returns Integer
raises
NoSuchObject from Standard
is redefined static;
NbKnots(me) returns Integer
raises
NoSuchObject from Standard
is redefined static;
Bezier(me) returns BezierCurve from Geom2d
raises
NoSuchObject from Standard
is redefined static;
---Purpose: Warning ! This will NOT make a copy of the -- Bezier Curve -
-- If you want to modify -- the Curve please make a copy
-- yourself -- Also it will NOT trim the surface to --
-- myFirst/Last.
BSpline(me) returns BSplineCurve from Geom2d
raises
NoSuchObject from Standard
is redefined static;
---Purpose: Warning ! This will NOT make a copy of the BSpline Curve - If
-- you want to modify the Curve please make a copy
-- yourself Also it will NOT trim the surface to
-- myFirst/Last.
fields
myTolerance : Real ;
mySurface : HSurface from Adaptor3d ;
myCurve : HCurve from Adaptor3d ;
myResult : Projector from ProjLib ;
end ProjectedCurve;

View File

@@ -0,0 +1,216 @@
// Created on: 1993-08-25
// Created by: Bruno DUMORTIER
// 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 _ProjLib_ProjectedCurve_HeaderFile
#define _ProjLib_ProjectedCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <ProjLib_Projector.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_CurveType.hxx>
class Adaptor3d_HSurface;
class Adaptor3d_HCurve;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class Standard_NotImplemented;
class Adaptor2d_HCurve2d;
class gp_Pnt2d;
class gp_Vec2d;
class gp_Lin2d;
class gp_Circ2d;
class gp_Elips2d;
class gp_Hypr2d;
class gp_Parab2d;
class Geom2d_BezierCurve;
class Geom2d_BSplineCurve;
//! Compute the 2d-curve. Try to solve the particular
//! case if possible. Otherwize, an approximation is
//! done.
class ProjLib_ProjectedCurve : public Adaptor2d_Curve2d
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ProjLib_ProjectedCurve();
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_HSurface)& S);
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C);
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tol);
//! Changes the tolerance used to project
//! the curve on the surface
Standard_EXPORT void Load (const Standard_Real Tolerance);
//! Changes the Surface.
Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
//! Changes the Curve.
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C);
Standard_EXPORT const Handle(Adaptor3d_HSurface)& GetSurface() const;
Standard_EXPORT const Handle(Adaptor3d_HCurve)& GetCurve() const;
//! returns the tolerance reached if an approximation
//! is Done.
Standard_EXPORT Standard_Real GetTolerance() const;
Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
//! If necessary, breaks the curve in intervals of
//! continuity <S>. And returns the number of
//! intervals.
Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accomodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Returns a curve equivalent of <me> between
//! parameters <First> and <Last>. <Tol> is used to
//! test for 3d points confusion.
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT gp_Pnt2d Value (const Standard_Real U) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt2d& P) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const Standard_OVERRIDE;
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
Standard_EXPORT Standard_Real Resolution (const Standard_Real R3d) const Standard_OVERRIDE;
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
Standard_EXPORT gp_Lin2d Line() const Standard_OVERRIDE;
Standard_EXPORT gp_Circ2d Circle() const Standard_OVERRIDE;
Standard_EXPORT gp_Elips2d Ellipse() const Standard_OVERRIDE;
Standard_EXPORT gp_Hypr2d Hyperbola() const Standard_OVERRIDE;
Standard_EXPORT gp_Parab2d Parabola() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer Degree() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer NbPoles() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer NbKnots() const Standard_OVERRIDE;
//! Warning ! This will NOT make a copy of the -- Bezier Curve -
//! If you want to modify -- the Curve please make a copy
//! yourself -- Also it will NOT trim the surface to --
//! myFirst/Last.
Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const Standard_OVERRIDE;
//! Warning ! This will NOT make a copy of the BSpline Curve - If
//! you want to modify the Curve please make a copy
//! yourself Also it will NOT trim the surface to
//! myFirst/Last.
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const Standard_OVERRIDE;
protected:
private:
Standard_Real myTolerance;
Handle(Adaptor3d_HSurface) mySurface;
Handle(Adaptor3d_HCurve) myCurve;
ProjLib_Projector myResult;
};
#endif // _ProjLib_ProjectedCurve_HeaderFile

View File

@@ -1,166 +0,0 @@
-- Created on: 1993-08-11
-- Created by: Remi LEQUETTE
-- 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 Projector from ProjLib
---Purpose: Root class for projection algorithms, stores the result.
uses
CurveType from GeomAbs,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp,
BezierCurve from Geom2d,
BSplineCurve from Geom2d
raises
NoSuchObject from Standard,
NotImplemented from Standard
is
Create ;
---Purpose: Sets the type to OtherCurve
---C++: alias " Standard_EXPORT virtual ~ProjLib_Projector();"
IsDone(me) returns Boolean from Standard
is static;
Done(me : in out)
---Purpose: Set isDone = Standard_True;
is static;
GetType(me) returns CurveType from GeomAbs
is static;
SetBSpline(me : in out; C : BSplineCurve from Geom2d)
is static;
SetBezier(me : in out; C : BezierCurve from Geom2d)
is static;
SetType(me : in out; Type : CurveType from GeomAbs)
is static;
IsPeriodic(me)
returns Boolean from Standard
is static;
SetPeriodic(me: in out)
is static;
Line(me) returns Lin2d from gp
---C++: return const &
raises
NoSuchObject from Standard
is static;
Circle(me) returns Circ2d from gp
---C++: return const &
raises
NoSuchObject from Standard
is static;
Ellipse(me) returns Elips2d from gp
---C++: return const &
raises
NoSuchObject from Standard
is static;
Hyperbola(me) returns Hypr2d from gp
---C++: return const &
raises
NoSuchObject from Standard
is static;
Parabola(me) returns Parab2d from gp
---C++: return const &
raises
NoSuchObject from Standard
is static;
Bezier(me) returns BezierCurve from Geom2d
raises
NoSuchObject from Standard
is static;
BSpline(me) returns BSplineCurve from Geom2d
raises
NoSuchObject from Standard
is static;
Project(me : in out;
L : Lin from gp)
is virtual;
Project(me : in out;
C : Circ from gp)
is virtual;
Project(me : in out;
E : Elips from gp)
is virtual;
Project(me : in out;
P : Parab from gp)
is virtual;
Project(me : in out;
H : Hypr from gp)
is virtual;
UFrame(me : in out;
CFirst, CLast : Real from Standard; -- Bounds of the curve
UFirst, Period : Real from Standard) -- UBounds of the surface
---Purpose: Translates the 2d curve
-- to set the part of the curve [CFirst, CLast]
-- in the range [ UFirst, UFirst + Period [
is static;
VFrame(me : in out;
CFirst, CLast : Real from Standard; -- Bounds of the curve
VFirst, Period : Real from Standard) -- VBounds of the surface
---Purpose: Translates the 2d curve
-- to set the part of the curve [CFirst, CLast]
-- in the range [ VFirst, VFirst + Period [
is static;
fields
myType : CurveType from GeomAbs is protected;
myLin : Lin2d from gp is protected;
myCirc : Circ2d from gp is protected;
myElips : Elips2d from gp is protected;
myHypr : Hypr2d from gp is protected;
myParab : Parab2d from gp is protected;
myBSpline : BSplineCurve from Geom2d is protected;
myBezier : BezierCurve from Geom2d is protected;
myIsPeriodic : Boolean from Standard is protected;
isDone : Boolean from Standard is protected;
end Projector;

View File

@@ -16,17 +16,27 @@
// Modified by skv - Wed Aug 11 15:45:58 2004 OCC6272
#include <ProjLib_Projector.ixx>
#include <ElCLib.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Elips.hxx>
#include <gp_Elips2d.hxx>
#include <gp_Hypr.hxx>
#include <gp_Hypr2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Parab.hxx>
#include <gp_Parab2d.hxx>
#include <ProjLib_Projector.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
//=======================================================================
//function : ProjLib_Projector
//purpose :
//=======================================================================
ProjLib_Projector::ProjLib_Projector()
{
isDone = Standard_False;

View File

@@ -0,0 +1,144 @@
// Created on: 1993-08-11
// Created by: Remi LEQUETTE
// 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 _ProjLib_Projector_HeaderFile
#define _ProjLib_Projector_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.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>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Geom2d_BSplineCurve;
class Geom2d_BezierCurve;
class Standard_NoSuchObject;
class Standard_NotImplemented;
class gp_Lin2d;
class gp_Circ2d;
class gp_Elips2d;
class gp_Hypr2d;
class gp_Parab2d;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Root class for projection algorithms, stores the result.
class ProjLib_Projector
{
public:
DEFINE_STANDARD_ALLOC
//! Sets the type to OtherCurve
Standard_EXPORT ProjLib_Projector();
Standard_EXPORT virtual ~ProjLib_Projector();
Standard_EXPORT Standard_Boolean IsDone() const;
//! Set isDone = Standard_True;
Standard_EXPORT void Done();
Standard_EXPORT GeomAbs_CurveType GetType() const;
Standard_EXPORT void SetBSpline (const Handle(Geom2d_BSplineCurve)& C);
Standard_EXPORT void SetBezier (const Handle(Geom2d_BezierCurve)& C);
Standard_EXPORT void SetType (const GeomAbs_CurveType Type);
Standard_EXPORT Standard_Boolean IsPeriodic() const;
Standard_EXPORT void SetPeriodic();
Standard_EXPORT const gp_Lin2d& Line() const;
Standard_EXPORT const gp_Circ2d& Circle() const;
Standard_EXPORT const gp_Elips2d& Ellipse() const;
Standard_EXPORT const gp_Hypr2d& Hyperbola() const;
Standard_EXPORT const gp_Parab2d& Parabola() const;
Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const;
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const;
Standard_EXPORT virtual void Project (const gp_Lin& L);
Standard_EXPORT virtual void Project (const gp_Circ& C);
Standard_EXPORT virtual void Project (const gp_Elips& E);
Standard_EXPORT virtual void Project (const gp_Parab& P);
Standard_EXPORT virtual void Project (const gp_Hypr& H);
//! Translates the 2d curve
//! to set the part of the curve [CFirst, CLast]
//! in the range [ UFirst, UFirst + Period [
Standard_EXPORT void UFrame (const Standard_Real CFirst, const Standard_Real CLast, const Standard_Real UFirst, const Standard_Real Period);
//! Translates the 2d curve
//! to set the part of the curve [CFirst, CLast]
//! in the range [ VFirst, VFirst + Period [
Standard_EXPORT void VFrame (const Standard_Real CFirst, const Standard_Real CLast, const Standard_Real VFirst, const Standard_Real Period);
protected:
GeomAbs_CurveType myType;
gp_Lin2d myLin;
gp_Circ2d myCirc;
gp_Elips2d myElips;
gp_Hypr2d myHypr;
gp_Parab2d myParab;
Handle(Geom2d_BSplineCurve) myBSpline;
Handle(Geom2d_BezierCurve) myBezier;
Standard_Boolean myIsPeriodic;
Standard_Boolean isDone;
private:
};
#endif // _ProjLib_Projector_HeaderFile

View File

@@ -1,87 +0,0 @@
-- Created on: 1993-08-24
-- Created by: Bruno DUMORTIER
-- 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 Sphere from ProjLib inherits Projector from ProjLib
---Purpose: Projects elementary curves on a sphere.
uses
CurveType from GeomAbs,
Sphere from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp
raises
NoSuchObject from Standard
is
Create returns Sphere from ProjLib;
---Purpose: Undefined projection.
Create(Sp : Sphere from gp) returns Sphere from ProjLib;
---Purpose: Projection on the sphere <Sp>.
Create(Sp : Sphere from gp;
C : Circ from gp) returns Sphere from ProjLib;
---Purpose: Projection of the circle <C> on the sphere <Sp>.
Init(me : in out;
Sp : Sphere from gp)
is static;
Project(me : in out;
L : Lin from gp)
is redefined;
Project(me : in out;
C : Circ from gp)
is redefined;
Project(me : in out;
E : Elips from gp)
is redefined;
Project(me : in out;
P : Parab from gp)
is redefined;
Project(me : in out;
H : Hypr from gp)
is redefined;
SetInBounds(me: in out;
U : Real from Standard)
---Purpose: Set the point of parameter U on C in the natural
-- restrictions of the sphere.
is static;
fields
mySphere : Sphere from gp;
end Sphere;

View File

@@ -16,24 +16,27 @@
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116
#include <Standard_NotImplemented.hxx>
#include <ProjLib_Sphere.ixx>
#include <ElCLib.hxx>
#include <Precision.hxx>
#include <gp.hxx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Sphere.hxx>
#include <gp_Trsf2d.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Trsf2d.hxx>
#include <Precision.hxx>
#include <ProjLib_Sphere.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <StdFail_NotDone.hxx>
//=======================================================================
//function : ProjLib_Sphere
//purpose :
//=======================================================================
ProjLib_Sphere::ProjLib_Sphere()
{
}

View File

@@ -0,0 +1,93 @@
// Created on: 1993-08-24
// Created by: Bruno DUMORTIER
// 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 _ProjLib_Sphere_HeaderFile
#define _ProjLib_Sphere_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Sphere.hxx>
#include <ProjLib_Projector.hxx>
#include <Standard_Real.hxx>
class Standard_NoSuchObject;
class gp_Sphere;
class gp_Circ;
class gp_Lin;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Projects elementary curves on a sphere.
class ProjLib_Sphere : public ProjLib_Projector
{
public:
DEFINE_STANDARD_ALLOC
//! Undefined projection.
Standard_EXPORT ProjLib_Sphere();
//! Projection on the sphere <Sp>.
Standard_EXPORT ProjLib_Sphere(const gp_Sphere& Sp);
//! Projection of the circle <C> on the sphere <Sp>.
Standard_EXPORT ProjLib_Sphere(const gp_Sphere& Sp, const gp_Circ& C);
Standard_EXPORT void Init (const gp_Sphere& Sp);
Standard_EXPORT virtual void Project (const gp_Lin& L) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Circ& C) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Elips& E) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Parab& P) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Hypr& H) Standard_OVERRIDE;
//! Set the point of parameter U on C in the natural
//! restrictions of the sphere.
Standard_EXPORT void SetInBounds (const Standard_Real U);
protected:
private:
gp_Sphere mySphere;
};
#endif // _ProjLib_Sphere_HeaderFile

View File

@@ -1,81 +0,0 @@
-- Created on: 1993-08-24
-- Created by: Bruno DUMORTIER
-- 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 Torus from ProjLib inherits Projector from ProjLib
---Purpose: Projects elementary curves on a torus.
uses
CurveType from GeomAbs,
Torus from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Parab from gp,
Hypr from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp
raises
NoSuchObject from Standard
is
Create returns Torus from ProjLib;
---Purpose: Undefined projection.
Create(To : Torus from gp) returns Torus from ProjLib;
---Purpose: Projection on the torus <To>.
Create(To : Torus from gp;
C : Circ from gp) returns Torus from ProjLib;
---Purpose: Projection of the circle <C> on the torus <To>.
Init(me : in out;
To : Torus from gp)
is static;
Project(me : in out;
L : Lin from gp)
is redefined;
Project(me : in out;
C : Circ from gp)
is redefined;
Project(me : in out;
E : Elips from gp)
is redefined;
Project(me : in out;
P : Parab from gp)
is redefined;
Project(me : in out;
H : Hypr from gp)
is redefined;
fields
myTorus : Torus from gp;
end Torus;

View File

@@ -14,21 +14,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib_Torus.ixx>
#include <Precision.hxx>
#include <gp.hxx>
#include <gp_Circ.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Torus.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <Precision.hxx>
#include <ProjLib_Torus.hxx>
#include <Standard_NoSuchObject.hxx>
//=======================================================================
//function : ProjLib_Torus
//purpose :
//=======================================================================
ProjLib_Torus::ProjLib_Torus()
{
}

View File

@@ -0,0 +1,88 @@
// Created on: 1993-08-24
// Created by: Bruno DUMORTIER
// 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 _ProjLib_Torus_HeaderFile
#define _ProjLib_Torus_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Torus.hxx>
#include <ProjLib_Projector.hxx>
class Standard_NoSuchObject;
class gp_Torus;
class gp_Circ;
class gp_Lin;
class gp_Elips;
class gp_Parab;
class gp_Hypr;
//! Projects elementary curves on a torus.
class ProjLib_Torus : public ProjLib_Projector
{
public:
DEFINE_STANDARD_ALLOC
//! Undefined projection.
Standard_EXPORT ProjLib_Torus();
//! Projection on the torus <To>.
Standard_EXPORT ProjLib_Torus(const gp_Torus& To);
//! Projection of the circle <C> on the torus <To>.
Standard_EXPORT ProjLib_Torus(const gp_Torus& To, const gp_Circ& C);
Standard_EXPORT void Init (const gp_Torus& To);
Standard_EXPORT virtual void Project (const gp_Lin& L) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Circ& C) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Elips& E) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Parab& P) Standard_OVERRIDE;
Standard_EXPORT virtual void Project (const gp_Hypr& H) Standard_OVERRIDE;
protected:
private:
gp_Torus myTorus;
};
#endif // _ProjLib_Torus_HeaderFile