mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,168 +0,0 @@
|
||||
-- Created on: 1992-10-08
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package Adaptor2d
|
||||
|
||||
---Purpose: The Adaptor2d package is used to help defining
|
||||
-- reusable geometric algorithms. i.e. that can be
|
||||
-- used on curves and surfaces.
|
||||
--
|
||||
-- It defines general services for objects :
|
||||
--
|
||||
-- - the 2d curve. Curve2d
|
||||
--
|
||||
-- The services are :
|
||||
--
|
||||
-- - Usual services found in Geom or Geom2d :
|
||||
--
|
||||
-- * parameter range, value and derivatives, etc...
|
||||
--
|
||||
-- - Continuity breakout services :
|
||||
--
|
||||
-- * Allows to divide a curve or a surfaces in
|
||||
-- parts with a given derivation order.
|
||||
--
|
||||
-- - Special geometries detection services :
|
||||
--
|
||||
-- * Allows to test for special cases that can
|
||||
-- be processed more easily :
|
||||
-- - Conics, Quadrics, Bezier, BSpline ...
|
||||
--
|
||||
-- And to get the correponding data form the
|
||||
-- package gp or Geom. The special type
|
||||
-- OtherCurve means that no special case has
|
||||
-- been detected and the algorithm may use
|
||||
-- only the evaluation methods (D0, D1, ...)
|
||||
--
|
||||
--
|
||||
-- For each category Curve2d, Curve, Surface we
|
||||
-- define three classes, we illustrate now the
|
||||
-- principles with the Curve, the same applies to
|
||||
-- Curve2d and Surface.
|
||||
--
|
||||
-- The class Curve is the abstract root for all
|
||||
-- Curves used by algorithms, it is handled by value
|
||||
-- and provides as deferred methods the services
|
||||
-- described above.
|
||||
--
|
||||
-- Some services (breakout) requires to create new
|
||||
-- curves, this leads to memory allocation
|
||||
-- considerations (who create the curve, who deletes
|
||||
-- it ?). To solve this problem elegantly the curve
|
||||
-- will return a HCurve, the HCurve is a curve
|
||||
-- handled by reference so it will be deallocated
|
||||
-- automatically when it is not used.
|
||||
--
|
||||
-- A third class GenHCurve is provided, this class is
|
||||
-- generic and its utility is to provide automatic
|
||||
-- generation of the HCurve class when you have
|
||||
-- written the Curve class.
|
||||
--
|
||||
--
|
||||
-- * Let us show an example (with 2d curves) :
|
||||
--
|
||||
-- Imagine an algorithm to intersect curves, this
|
||||
-- algorithms is written to process Curve2d from
|
||||
-- Adaptor2d :
|
||||
--
|
||||
-- A method may look like :
|
||||
--
|
||||
-- Intersect(C1,C2 : Curve2d from Adaptor2d);
|
||||
--
|
||||
-- Which will look like in C++
|
||||
--
|
||||
-- Intersect(const Adaptor2d_Curve2d& C1,
|
||||
-- const Adaptor2d_Curve2d& C2)
|
||||
-- {
|
||||
-- // you can call any method
|
||||
-- Standard_Real first1 = C1.FirstParameter();
|
||||
--
|
||||
-- // but avoid to copy in an Adaptor2d_Curve which
|
||||
-- // is an Abstract class, use a reference or a pointer
|
||||
--
|
||||
-- const Adaptor2d_Curve& C = C1;
|
||||
-- const Adaptor2d_Curve *pC = &C1;
|
||||
--
|
||||
-- // If you are interseted in Intervals you must
|
||||
-- // store them in a HCurve to ensure they are kept
|
||||
-- // in memory. Then a referrence may be used.
|
||||
--
|
||||
-- Handle(Adaptor2d_HCurve) HCI = C1.Interval(1);
|
||||
--
|
||||
-- const Adaptor2d_Curve& CI = HCI->Curve();
|
||||
-- pC = &(HCI->Curve());
|
||||
--
|
||||
--
|
||||
-- * The Adaptor2d provides also Generic classes
|
||||
-- implementing algorithmic curves and surfaces.
|
||||
--
|
||||
-- - IsoCurve : Isoparametric curve on a surface.
|
||||
-- - CurveOnSurface : 2D curve in the parametric
|
||||
-- space of a surface.
|
||||
--
|
||||
--
|
||||
-- - OffsetCurve2d : 2d offset curve
|
||||
-- - ProjectedCurve : 3d curve projected on a plane
|
||||
-- - SurfaceOfLinearExtrusion
|
||||
-- - SurfaceOfRevolution
|
||||
--
|
||||
-- They are instantiated with HCurve, HSurface, HCurved2d
|
||||
|
||||
uses
|
||||
Standard,
|
||||
MMgt,
|
||||
TColStd,
|
||||
GeomAbs,
|
||||
TColgp,
|
||||
gp,
|
||||
Geom2d,
|
||||
math
|
||||
|
||||
is
|
||||
|
||||
deferred class Curve2d;
|
||||
|
||||
pointer Curve2dPtr to Curve2d from Adaptor2d;
|
||||
|
||||
deferred class HCurve2d;
|
||||
|
||||
generic class GenHCurve2d;
|
||||
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- The following classes are used to define an abstract
|
||||
-- simplified "topology" for surfaces. This is used by
|
||||
-- algorithm as mass properties or surface intersections.
|
||||
--
|
||||
|
||||
|
||||
class Line2d;
|
||||
|
||||
class HLine2d instantiates GenHCurve2d(Line2d from Adaptor2d);
|
||||
---Purpose: Use by the TopolTool to trim a surface.
|
||||
|
||||
--
|
||||
-- The following classes provides algorithmic curves and
|
||||
-- surface, they are inheriting from Curve and Surface and the
|
||||
-- correponding HCurve and HSurface is instantiated.
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
|
||||
end Adaptor2d;
|
@@ -1,234 +0,0 @@
|
||||
-- Created on: 1993-04-02
|
||||
-- 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.
|
||||
|
||||
deferred class Curve2d from Adaptor2d
|
||||
|
||||
---Purpose: Root class for 2D curves on which geometric
|
||||
-- algorithms work.
|
||||
-- An adapted curve is an interface between the
|
||||
-- services provided by a curve, and those required of
|
||||
-- the curve by algorithms, which use it.
|
||||
-- A derived concrete class is provided:
|
||||
-- Geom2dAdaptor_Curve for a curve from the Geom2d package.
|
||||
|
||||
uses
|
||||
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec2d from gp,
|
||||
Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Lin2d from gp,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
is virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
--
|
||||
-- Local methods - Apply to the current interval.
|
||||
-- By default the current interval is the first.
|
||||
--
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is virtual;
|
||||
|
||||
Value(me; U : Real) returns Pnt2d from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is virtual;
|
||||
|
||||
D0 (me; U : Real; P : out Pnt2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is virtual;
|
||||
|
||||
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 virtual;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Circle(me) returns Circ2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Ellipse(me) returns Elips2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Hyperbola(me) returns Hypr2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Parabola(me) returns Parab2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbSamples(me) returns Integer from Standard is virtual;
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
---C++: alias " Standard_EXPORT virtual ~Adaptor2d_Curve2d();"
|
||||
|
||||
end Curve2d;
|
||||
|
||||
|
@@ -14,15 +14,27 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Adaptor2d_Curve2d.ixx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ~Adaptor2d_Curve2d
|
||||
//purpose : Destructor
|
||||
//=======================================================================
|
||||
|
||||
Adaptor2d_Curve2d::~Adaptor2d_Curve2d()
|
||||
{
|
||||
}
|
||||
|
180
src/Adaptor2d/Adaptor2d_Curve2d.hxx
Normal file
180
src/Adaptor2d/Adaptor2d_Curve2d.hxx
Normal file
@@ -0,0 +1,180 @@
|
||||
// Created on: 1993-04-02
|
||||
// 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 _Adaptor2d_Curve2d_HeaderFile
|
||||
#define _Adaptor2d_Curve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
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;
|
||||
|
||||
|
||||
//! Root class for 2D curves on which geometric
|
||||
//! algorithms work.
|
||||
//! An adapted curve is an interface between the
|
||||
//! services provided by a curve, and those required of
|
||||
//! the curve by algorithms, which use it.
|
||||
//! A derived concrete class is provided:
|
||||
//! Geom2dAdaptor_Curve for a curve from the Geom2d package.
|
||||
class Adaptor2d_Curve2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT virtual Standard_Real FirstParameter() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Real LastParameter() const;
|
||||
|
||||
Standard_EXPORT virtual GeomAbs_Shape Continuity() const;
|
||||
|
||||
//! If necessary, breaks the curve in intervals of
|
||||
//! continuity <S>. And returns the number of
|
||||
//! intervals.
|
||||
Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
|
||||
|
||||
//! Stores in <T> the parameters bounding the intervals
|
||||
//! of continuity <S>.
|
||||
//!
|
||||
//! The array must provide enough room to accomodate
|
||||
//! for the parameters. i.e. T.Length() > NbIntervals()
|
||||
Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
|
||||
|
||||
//! 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 virtual Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsClosed() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsPeriodic() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Real Period() const;
|
||||
|
||||
//! Computes the point of parameter U on the curve.
|
||||
Standard_EXPORT virtual gp_Pnt2d Value (const Standard_Real U) const;
|
||||
|
||||
//! Computes the point of parameter U on the curve.
|
||||
Standard_EXPORT virtual void D0 (const Standard_Real U, gp_Pnt2d& P) const;
|
||||
|
||||
//! 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 virtual void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const;
|
||||
|
||||
|
||||
//! 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 virtual void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
|
||||
|
||||
|
||||
//! 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 virtual void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
|
||||
|
||||
|
||||
//! 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 virtual gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const;
|
||||
|
||||
//! Returns the parametric resolution corresponding
|
||||
//! to the real space resolution <R3d>.
|
||||
Standard_EXPORT virtual Standard_Real Resolution (const Standard_Real R3d) const;
|
||||
|
||||
//! Returns the type of the curve in the current
|
||||
//! interval : Line, Circle, Ellipse, Hyperbola,
|
||||
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
Standard_EXPORT virtual GeomAbs_CurveType GetType() const;
|
||||
|
||||
Standard_EXPORT virtual gp_Lin2d Line() const;
|
||||
|
||||
Standard_EXPORT virtual gp_Circ2d Circle() const;
|
||||
|
||||
Standard_EXPORT virtual gp_Elips2d Ellipse() const;
|
||||
|
||||
Standard_EXPORT virtual gp_Hypr2d Hyperbola() const;
|
||||
|
||||
Standard_EXPORT virtual gp_Parab2d Parabola() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer Degree() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsRational() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer NbPoles() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer NbKnots() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer NbSamples() const;
|
||||
|
||||
Standard_EXPORT virtual Handle(Geom2d_BezierCurve) Bezier() const;
|
||||
|
||||
Standard_EXPORT virtual Handle(Geom2d_BSplineCurve) BSpline() const;
|
||||
Standard_EXPORT virtual ~Adaptor2d_Curve2d();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor2d_Curve2d_HeaderFile
|
23
src/Adaptor2d/Adaptor2d_Curve2dPtr.hxx
Normal file
23
src/Adaptor2d/Adaptor2d_Curve2dPtr.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Adaptor2d_Curve2dPtr_HeaderFile
|
||||
#define _Adaptor2d_Curve2dPtr_HeaderFile
|
||||
|
||||
class Adaptor2d_Curve2d;
|
||||
typedef Adaptor2d_Curve2d* Adaptor2d_Curve2dPtr;
|
||||
|
||||
#endif // _Adaptor2d_Curve2dPtr_HeaderFile
|
@@ -1,78 +0,0 @@
|
||||
-- Created on: 1994-02-23
|
||||
-- Created by: model
|
||||
-- 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.
|
||||
|
||||
generic class GenHCurve2d from Adaptor2d
|
||||
(TheCurve as Curve2d from Adaptor2d)
|
||||
|
||||
inherits HCurve2d from Adaptor2d
|
||||
|
||||
---Purpose: Generic class used to create a curve2d manipulated
|
||||
-- with Handle from a curve2d described by the class Curve2d.
|
||||
|
||||
uses
|
||||
|
||||
Curve2d from Adaptor2d
|
||||
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Creates an empty GenHCurve2d.
|
||||
returns GenHCurve2d from Adaptor2d;
|
||||
|
||||
|
||||
Create(C: TheCurve)
|
||||
|
||||
---Purpose: Creates a GenHCurve2d from a Curve
|
||||
returns GenHCurve2d from Adaptor2d;
|
||||
|
||||
|
||||
Set(me: mutable; C: TheCurve)
|
||||
|
||||
---Purpose: Sets the field of the GenHCurve2d.
|
||||
is static;
|
||||
|
||||
Curve2d(me)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve2d.
|
||||
-- This is redefined from HCurve2d, cannot be inline.
|
||||
--
|
||||
---C++: return const &
|
||||
|
||||
returns Curve2d from Adaptor2d
|
||||
is static;
|
||||
|
||||
ChangeCurve2d(me : mutable)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve.
|
||||
--
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
|
||||
returns TheCurve;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myCurve : TheCurve is protected;
|
||||
|
||||
end GenHCurve2d;
|
@@ -1,215 +0,0 @@
|
||||
-- Created on: 1994-02-23
|
||||
-- Created by: model
|
||||
-- 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.
|
||||
|
||||
deferred class HCurve2d from Adaptor2d inherits TShared from MMgt
|
||||
|
||||
---Purpose: Root class for 2D curves manipulated by handles, on
|
||||
-- which geometric algorithms work.
|
||||
-- An adapted curve is an interface between the
|
||||
-- services provided by a curve, and those required of
|
||||
-- the curve by algorithms, which use it.
|
||||
-- A derived specific class is provided:
|
||||
-- Geom2dAdaptor_HCurve for a curve from the Geom2d package.
|
||||
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec2d from gp,
|
||||
Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Lin2d from gp,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
Curve2d from Adaptor2d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard,
|
||||
NotImplemented from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Access to the curve
|
||||
--
|
||||
|
||||
Curve2d(me) returns Curve2d from Adaptor2d
|
||||
---Purpose: Returns a reference to the Curve2d inside the HCurve2d.
|
||||
--
|
||||
---C++: return const &
|
||||
is deferred;
|
||||
|
||||
|
||||
-- Curve methods, they are provided for convenience. Each
|
||||
-- method M() is defined inline as :
|
||||
--
|
||||
-- Adaptor_HCurve::M() { Curve().M(); }
|
||||
--
|
||||
-- See the class Curve for comments on the methods.
|
||||
--
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
LastParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
NbIntervals(me ; S : Shape from GeomAbs) returns Integer ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---C++: inline
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
|
||||
---C++: inline
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is static;
|
||||
|
||||
--
|
||||
-- Local methods - Apply to the current interval.
|
||||
-- By default the current interval is the first.
|
||||
--
|
||||
|
||||
IsClosed(me) returns Boolean ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
IsPeriodic(me) returns Boolean ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Period(me) returns Real ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Value(me; U : Real) returns Pnt2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D0 (me; U : Real; P : out Pnt2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D2 (me; U : Real; P : out Pnt2d from gp;
|
||||
V1, V2 : out Vec2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D3 (me; U : Real; P : out Pnt2d from gp;
|
||||
V1, V2, V3 : out Vec2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Resolution(me; R3d : Real) returns Real ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Circle(me) returns Circ2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Ellipse(me) returns Elips2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Hyperbola(me) returns Hypr2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Parabola(me) returns Parab2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Degree(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard,
|
||||
OutOfRange from Standard -- if TK has not length NbKnots
|
||||
is virtual;
|
||||
|
||||
|
||||
end HCurve2d;
|
@@ -11,5 +11,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Adaptor2d_HCurve2d.ixx>
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
148
src/Adaptor2d/Adaptor2d_HCurve2d.hxx
Normal file
148
src/Adaptor2d/Adaptor2d_HCurve2d.hxx
Normal file
@@ -0,0 +1,148 @@
|
||||
// Created on: 1994-02-23
|
||||
// Created by: model
|
||||
// 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 _Adaptor2d_HCurve2d_HeaderFile
|
||||
#define _Adaptor2d_HCurve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class Standard_NotImplemented;
|
||||
class Adaptor2d_Curve2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Geom2d_BezierCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
|
||||
|
||||
class Adaptor2d_HCurve2d;
|
||||
DEFINE_STANDARD_HANDLE(Adaptor2d_HCurve2d, MMgt_TShared)
|
||||
|
||||
//! Root class for 2D curves manipulated by handles, on
|
||||
//! which geometric algorithms work.
|
||||
//! An adapted curve is an interface between the
|
||||
//! services provided by a curve, and those required of
|
||||
//! the curve by algorithms, which use it.
|
||||
//! A derived specific class is provided:
|
||||
//! Geom2dAdaptor_HCurve for a curve from the Geom2d package.
|
||||
class Adaptor2d_HCurve2d : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns a reference to the Curve2d inside the HCurve2d.
|
||||
Standard_EXPORT virtual const Adaptor2d_Curve2d& Curve2d() const = 0;
|
||||
|
||||
Standard_Real FirstParameter() const;
|
||||
|
||||
Standard_Real LastParameter() const;
|
||||
|
||||
GeomAbs_Shape Continuity() const;
|
||||
|
||||
Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
|
||||
|
||||
void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
|
||||
|
||||
//! If <First> >= <Last>
|
||||
Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
|
||||
|
||||
Standard_Boolean IsClosed() const;
|
||||
|
||||
Standard_Boolean IsPeriodic() const;
|
||||
|
||||
Standard_Real Period() const;
|
||||
|
||||
gp_Pnt2d Value (const Standard_Real U) const;
|
||||
|
||||
void D0 (const Standard_Real U, gp_Pnt2d& P) const;
|
||||
|
||||
void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const;
|
||||
|
||||
void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
|
||||
|
||||
void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
|
||||
|
||||
gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const;
|
||||
|
||||
Standard_Real Resolution (const Standard_Real R3d) const;
|
||||
|
||||
GeomAbs_CurveType GetType() const;
|
||||
|
||||
gp_Lin2d Line() const;
|
||||
|
||||
gp_Circ2d Circle() const;
|
||||
|
||||
gp_Elips2d Ellipse() const;
|
||||
|
||||
gp_Hypr2d Hyperbola() const;
|
||||
|
||||
gp_Parab2d Parabola() const;
|
||||
|
||||
Standard_Integer Degree() const;
|
||||
|
||||
Standard_Boolean IsRational() const;
|
||||
|
||||
Standard_Integer NbPoles() const;
|
||||
|
||||
Standard_Integer NbKnots() const;
|
||||
|
||||
Handle(Geom2d_BezierCurve) Bezier() const;
|
||||
|
||||
virtual Handle(Geom2d_BSplineCurve) BSpline() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Adaptor2d_HCurve2d,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Adaptor2d_HCurve2d.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor2d_HCurve2d_HeaderFile
|
87
src/Adaptor2d/Adaptor2d_HLine2d.hxx
Normal file
87
src/Adaptor2d/Adaptor2d_HLine2d.hxx
Normal file
@@ -0,0 +1,87 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Adaptor2d_HLine2d_HeaderFile
|
||||
#define _Adaptor2d_HLine2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Adaptor2d_Line2d.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class Adaptor2d_Line2d;
|
||||
class Adaptor2d_Curve2d;
|
||||
|
||||
|
||||
class Adaptor2d_HLine2d;
|
||||
DEFINE_STANDARD_HANDLE(Adaptor2d_HLine2d, Adaptor2d_HCurve2d)
|
||||
|
||||
|
||||
class Adaptor2d_HLine2d : public Adaptor2d_HCurve2d
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor2d_HLine2d();
|
||||
|
||||
Standard_EXPORT Adaptor2d_HLine2d(const Adaptor2d_Line2d& C);
|
||||
|
||||
Standard_EXPORT void Set (const Adaptor2d_Line2d& C);
|
||||
|
||||
Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const;
|
||||
|
||||
Adaptor2d_Line2d& ChangeCurve2d();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Adaptor2d_HLine2d,Adaptor2d_HCurve2d)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Adaptor2d_Line2d myCurve;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheCurve Adaptor2d_Line2d
|
||||
#define TheCurve_hxx <Adaptor2d_Line2d.hxx>
|
||||
#define Adaptor2d_GenHCurve2d Adaptor2d_HLine2d
|
||||
#define Adaptor2d_GenHCurve2d_hxx <Adaptor2d_HLine2d.hxx>
|
||||
#define Handle_Adaptor2d_GenHCurve2d Handle(Adaptor2d_HLine2d)
|
||||
|
||||
#include <Adaptor2d_GenHCurve2d.lxx>
|
||||
|
||||
#undef TheCurve
|
||||
#undef TheCurve_hxx
|
||||
#undef Adaptor2d_GenHCurve2d
|
||||
#undef Adaptor2d_GenHCurve2d_hxx
|
||||
#undef Handle_Adaptor2d_GenHCurve2d
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor2d_HLine2d_HeaderFile
|
42
src/Adaptor2d/Adaptor2d_HLine2d_0.cxx
Normal file
42
src/Adaptor2d/Adaptor2d_HLine2d_0.cxx
Normal file
@@ -0,0 +1,42 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Adaptor2d_HLine2d.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Adaptor2d_Line2d.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheCurve Adaptor2d_Line2d
|
||||
#define TheCurve_hxx <Adaptor2d_Line2d.hxx>
|
||||
#define Adaptor2d_GenHCurve2d Adaptor2d_HLine2d
|
||||
#define Adaptor2d_GenHCurve2d_hxx <Adaptor2d_HLine2d.hxx>
|
||||
#define Handle_Adaptor2d_GenHCurve2d Handle(Adaptor2d_HLine2d)
|
||||
#include <Adaptor2d_GenHCurve2d.gxx>
|
||||
|
@@ -1,207 +0,0 @@
|
||||
-- Created on: 1995-05-02
|
||||
-- Created by: Modelistation
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Line2d from Adaptor2d inherits Curve2d from Adaptor2d
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Pnt2d from gp,
|
||||
Dir2d from gp,
|
||||
Vec2d from gp,
|
||||
Lin2d from gp,
|
||||
Ax2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns Line2d from Adaptor2d;
|
||||
|
||||
Create(P: Pnt2d from gp;
|
||||
D: Dir2d from gp;
|
||||
UFirst,ULast: Real from Standard)
|
||||
returns Line2d from Adaptor2d;
|
||||
|
||||
Load(me : in out; L : Lin2d from gp)
|
||||
is static;
|
||||
|
||||
Load(me : in out; L : Lin2d from gp;
|
||||
UFirst,ULast: Real from Standard)
|
||||
is static;
|
||||
|
||||
FirstParameter(me)
|
||||
returns Real from Standard
|
||||
is redefined static;
|
||||
|
||||
LastParameter(me)
|
||||
returns Real from Standard
|
||||
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 from Standard
|
||||
is redefined static;
|
||||
|
||||
IsPeriodic(me)
|
||||
returns Boolean from Standard
|
||||
is redefined static;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value(me; X: Real from Standard)
|
||||
returns Pnt2d from gp
|
||||
is redefined static;
|
||||
|
||||
D0(me; X: Real from Standard; P: out Pnt2d from gp)
|
||||
is redefined static;
|
||||
|
||||
D1(me; X: Real from Standard;
|
||||
P: out Pnt2d from gp; V: out Vec2d from gp)
|
||||
is redefined static;
|
||||
|
||||
D2(me; X: Real from Standard;
|
||||
P: out Pnt2d from gp; V1,V2: out Vec2d from gp)
|
||||
is redefined static;
|
||||
|
||||
D3(me; X: Real from Standard;
|
||||
P: out Pnt2d from gp; V1,V2,V3: out Vec2d from gp)
|
||||
is redefined static;
|
||||
|
||||
DN (me; U : Real; N : Integer)
|
||||
returns Vec2d from gp
|
||||
is redefined static;
|
||||
|
||||
|
||||
Resolution(me; R3d : Real)
|
||||
returns Real from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
GetType(me)
|
||||
returns CurveType from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
|
||||
Line(me)
|
||||
returns Lin2d from gp
|
||||
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;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
fields
|
||||
|
||||
myUfirst : Real from Standard;
|
||||
myUlast : Real from Standard;
|
||||
myAx2d : Ax2d from gp;
|
||||
|
||||
end Line2d;
|
@@ -11,19 +11,30 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Adaptor2d_Line2d.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor2d_HLine2d.hxx>
|
||||
#include <Adaptor2d_Line2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor2d_Line2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor2d_Line2d::Adaptor2d_Line2d()
|
||||
: myUfirst(0.0), myUlast (0.0)
|
||||
{
|
||||
|
158
src/Adaptor2d/Adaptor2d_Line2d.hxx
Normal file
158
src/Adaptor2d/Adaptor2d_Line2d.hxx
Normal file
@@ -0,0 +1,158 @@
|
||||
// Created on: 1995-05-02
|
||||
// Created by: Modelistation
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Adaptor2d_Line2d_HeaderFile
|
||||
#define _Adaptor2d_Line2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Ax2d.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 Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class gp_Pnt2d;
|
||||
class gp_Dir2d;
|
||||
class gp_Lin2d;
|
||||
class Adaptor2d_HCurve2d;
|
||||
class gp_Vec2d;
|
||||
class gp_Circ2d;
|
||||
class gp_Elips2d;
|
||||
class gp_Hypr2d;
|
||||
class gp_Parab2d;
|
||||
class Geom2d_BezierCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
|
||||
|
||||
|
||||
class Adaptor2d_Line2d : public Adaptor2d_Curve2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor2d_Line2d();
|
||||
|
||||
Standard_EXPORT Adaptor2d_Line2d(const gp_Pnt2d& P, const gp_Dir2d& D, const Standard_Real UFirst, const Standard_Real ULast);
|
||||
|
||||
Standard_EXPORT void Load (const gp_Lin2d& L);
|
||||
|
||||
Standard_EXPORT void Load (const gp_Lin2d& L, const Standard_Real UFirst, const Standard_Real ULast);
|
||||
|
||||
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;
|
||||
|
||||
Standard_EXPORT gp_Pnt2d Value (const Standard_Real X) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void D0 (const Standard_Real X, gp_Pnt2d& P) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void D1 (const Standard_Real X, gp_Pnt2d& P, gp_Vec2d& V) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void D2 (const Standard_Real X, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void D3 (const Standard_Real X, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real Resolution (const Standard_Real R3d) const Standard_OVERRIDE;
|
||||
|
||||
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;
|
||||
|
||||
Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Real myUfirst;
|
||||
Standard_Real myUlast;
|
||||
gp_Ax2d myAx2d;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor2d_Line2d_HeaderFile
|
12
src/Adaptor2d/FILES
Normal file
12
src/Adaptor2d/FILES
Normal file
@@ -0,0 +1,12 @@
|
||||
Adaptor2d_Curve2d.cxx
|
||||
Adaptor2d_Curve2d.hxx
|
||||
Adaptor2d_Curve2dPtr.hxx
|
||||
Adaptor2d_GenHCurve2d.gxx
|
||||
Adaptor2d_GenHCurve2d.lxx
|
||||
Adaptor2d_HCurve2d.cxx
|
||||
Adaptor2d_HCurve2d.hxx
|
||||
Adaptor2d_HCurve2d.lxx
|
||||
Adaptor2d_HLine2d.hxx
|
||||
Adaptor2d_HLine2d_0.cxx
|
||||
Adaptor2d_Line2d.cxx
|
||||
Adaptor2d_Line2d.hxx
|
Reference in New Issue
Block a user