1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
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,149 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package Convert
--- Purpose:
--The Convert package provides algorithms to convert the following into a BSpline curve or surface:
-- - a bounded curve based on an elementary 2D curve (line, circle or conic) from the gp package,
-- - a bounded surface based on an elementary surface (cylinder, cone, sphere or torus) from the gp package,
-- - a series of adjacent 2D or 3D Bezier curves defined by their poles.
-- These algorithms compute the data needed to define the resulting BSpline curve or surface.
-- This elementary data (degrees, periodic characteristics, poles and weights, knots and
-- multiplicities) may then be used directly in an algorithm, or can be used to construct the curve
-- or the surface by calling the appropriate constructor provided by the classes
-- Geom2d_BSplineCurve, Geom_BSplineCurve or Geom_BSplineSurface.
uses TColStd,
TColgp,
StdFail,
gp,
GeomAbs,
TCollection
is
enumeration ParameterisationType is
TgtThetaOver2,
TgtThetaOver2_1,
TgtThetaOver2_2,
TgtThetaOver2_3,
TgtThetaOver2_4,
---Purpose:
-- Identifies a type of parameterization of a circle or ellipse represented as a BSpline curve.
-- For a circle with a center C and a radius R (for example a Geom2d_Circle or a Geom_Circle),
-- the natural parameterization is angular. It uses the angle Theta made by the vector CM with
-- the 'X Axis' of the circle's local coordinate system as parameter for the current point M. The
-- coordinates of the point M are as follows:
-- X = R *cos ( Theta )
-- y = R * sin ( Theta )
-- Similarly, for an ellipse with a center C, a major radius R and a minor radius r, the circle Circ
-- with center C and radius R (and located in the same plane as the ellipse) lends its natural
-- angular parameterization to the ellipse. This is achieved by an affine transformation in the plane
-- of the ellipse, in the ratio r / R, about the 'X Axis' of its local coordinate system. The
-- coordinates of the current point M are as follows:
-- X = R * cos ( Theta )
-- y = r * sin ( Theta )
-- The process of converting a circle or an ellipse into a rational or non-rational BSpline curve
-- transforms the Theta angular parameter into a parameter t. This ensures the rational or
-- polynomial parameterization of the resulting BSpline curve. Several types of parametric
-- transformations are available.
-- TgtThetaOver2
-- The most usual method is Convert_TgtThetaOver2 where the parameter t on the BSpline
-- curve is obtained by means of transformation of the following type:
-- t = tan ( Theta / 2 )
-- The result of this definition is:
-- cos ( Theta ) = ( 1. - t**2 ) / ( 1. + t**2 )
-- sin ( Theta ) = 2. * t / ( 1. + t**2 )
-- which ensures the rational parameterization of the circle or the ellipse. However, this is not the
-- most suitable parameterization method where the arc of the circle or ellipse has a large opening
-- angle. In such cases, the curve will be represented by a BSpline with intermediate knots. Each
-- span, i.e. each portion of curve between two different knot values, will use parameterization of
-- this type.
-- The number of spans is calculated using the following rule:
-- ( 1.2 * Delta / Pi ) + 1
-- where Delta is equal to the opening angle (in radians) of the arc of the circle (Delta is
-- equal to 2.* Pi in the case of a complete circle).
-- The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
-- curve gives an exact point on the circle or the ellipse.
-- TgtThetaOver2_N
-- Where N is equal to 1, 2, 3 or 4, this ensures the same type of parameterization as
-- Convert_TgtThetaOver2 but sets the number of spans in the resulting BSpline curve to N
-- rather than allowing the algorithm to make this calculation.
-- However, the opening angle Delta (parametric angle, given in radians) of the arc of the circle
-- (or of the ellipse) must comply with the following:
-- - Delta <= 0.9999 * Pi for the Convert_TgtThetaOver2_1 method, or
-- - Delta <= 1.9999 * Pi for the Convert_TgtThetaOver2_2 method.
-- QuasiAngular
-- The Convert_QuasiAngular method of parameterization uses a different type of rational
-- parameterization. This method ensures that the parameter t along the resulting BSpline curve is
-- very close to the natural parameterization angle Theta of the circle or ellipse (i.e. which uses
-- the functions sin ( Theta ) and cos ( Theta ).
-- The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
-- curve gives an exact point on the circle or the ellipse.
-- RationalC1
-- The Convert_RationalC1 method of parameterization uses a further type of rational
-- parameterization. This method ensures that the equation relating to the resulting BSpline curve
-- has a "C1" continuous denominator, which is not the case with the above methods. RationalC1
-- enhances the degree of continuity at the junction point of the different spans of the curve.
-- The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
-- curve gives an exact point on the circle or the ellipse.
-- Polynomial
-- The Convert_Polynomial method is used to produce polynomial (i.e. non-rational)
-- parameterization of the resulting BSpline curve with 8 poles (i.e. a polynomial degree equal to 7).
-- However, the result is an approximation of the circle or ellipse (i.e. computing the point of
-- parameter t on the BSpline curve does not give an exact point on the circle or the ellipse).
QuasiAngular,
RationalC1,
Polynomial;
imported CosAndSinEvalFunction ;
-- typedef void *CosAndSinEvalFunction(Standard_Real,
-- const Standard_Integer,
-- const TColgp_Array1OfPnt2d&
-- const TColStd_Array1OfReal&
-- const TColStd_Array1OfInteger&
-- Standard_Real Result[2]
--
deferred class ConicToBSplineCurve;
class CircleToBSplineCurve;
class EllipseToBSplineCurve;
class HyperbolaToBSplineCurve;
class ParabolaToBSplineCurve;
deferred class ElementarySurfaceToBSplineSurface;
class CylinderToBSplineSurface;
class ConeToBSplineSurface;
class TorusToBSplineSurface;
class SphereToBSplineSurface;
imported SequenceOfArray1OfPoles;
class CompBezierCurvesToBSplineCurve;
alias SequenceOfArray1OfPoles2d is SequenceOfArray1OfPnt2d from TColgp;
class CompBezierCurves2dToBSplineCurve2d;
class CompPolynomialToPoles;
class GridPolynomialToPoles;
end Convert;

View File

@@ -1,65 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class CircleToBSplineCurve from Convert inherits ConicToBSplineCurve
--- Purpose :
-- This algorithm converts a circle into a rational B-spline curve.
-- The circle is a Circ2d from package gp and its parametrization is :
-- P (U) = Loc + R * (Cos(U) * Xdir + Sin(U) * YDir) where Loc is the
-- center of the circle Xdir and Ydir are the normalized directions
-- of the local cartesian coordinate system of the circle.
-- The parametrization range for the circle is U [0, 2Pi].
--
--- Warnings :
-- The parametrization range for the B-spline curve is not [0, 2Pi].
--
--- KeyWords :
-- Convert, Circle, BSplineCurve, 2D .
uses Circ2d from gp,
ParameterisationType from Convert
raises DomainError from Standard
is
Create (C : Circ2d;
Parameterisation : ParameterisationType from Convert
= Convert_TgtThetaOver2)
returns CircleToBSplineCurve;
--- Purpose :
-- The equivalent B-spline curve has the same orientation
-- as the circle C.
Create (C : Circ2d; U1, U2 : Real ;
Parameterisation : ParameterisationType from Convert
= Convert_TgtThetaOver2)
returns CircleToBSplineCurve
--- Purpose :
-- The circle C is limited between the parametric values U1, U2
-- in radians. U1 and U2 [0.0, 2*Pi] .
-- The equivalent B-spline curve is oriented from U1 to U2 and has
-- the same orientation as the circle C.
raises DomainError;
--- Purpose :
-- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
end CircleToBSplineCurve;

View File

@@ -14,18 +14,19 @@
//JCV 16/10/91
#include <Convert_CircleToBSplineCurve.ixx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Precision.hxx>
#include <Convert_CircleToBSplineCurve.hxx>
#include <gp.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Trsf2d.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
//Attention :
//To avoid use of persistent tables in the fields
@@ -35,8 +36,6 @@
//nbKnots and nbPoles are present and updated in the
//constructor of an arc of B-spline circle to take into account
//the real number of poles and nodes.
// parametrization :
// Reference : Rational B-spline for Curve and Surface Representation
// Wayne Tiller CADG September 1983
@@ -44,12 +43,10 @@
// y(t) = 2 t / (1 + t^2)
// then t = Sqrt(2) u / ((Sqrt(2) - 2) u + 2)
// => u = 2 t / (Sqrt(2) + (2 - Sqrt(2)) t)
//=======================================================================
//function : Convert_CircleToBSplineCurve
//purpose : this constructs a periodic circle
//=======================================================================
Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve
(const gp_Circ2d& C, const Convert_ParameterisationType Parameterisation)
:Convert_ConicToBSplineCurve(0,0,0){

View File

@@ -0,0 +1,88 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_CircleToBSplineCurve_HeaderFile
#define _Convert_CircleToBSplineCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ConicToBSplineCurve.hxx>
#include <Convert_ParameterisationType.hxx>
#include <Standard_Real.hxx>
class Standard_DomainError;
class gp_Circ2d;
//! This algorithm converts a circle into a rational B-spline curve.
//! The circle is a Circ2d from package gp and its parametrization is :
//! P (U) = Loc + R * (Cos(U) * Xdir + Sin(U) * YDir) where Loc is the
//! center of the circle Xdir and Ydir are the normalized directions
//! of the local cartesian coordinate system of the circle.
//! The parametrization range for the circle is U [0, 2Pi].
//!
//! Warnings :
//! The parametrization range for the B-spline curve is not [0, 2Pi].
//!
//! KeyWords :
//! Convert, Circle, BSplineCurve, 2D .
class Convert_CircleToBSplineCurve : public Convert_ConicToBSplineCurve
{
public:
DEFINE_STANDARD_ALLOC
//! The equivalent B-spline curve has the same orientation
//! as the circle C.
Standard_EXPORT Convert_CircleToBSplineCurve(const gp_Circ2d& C, const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
//! The circle C is limited between the parametric values U1, U2
//! in radians. U1 and U2 [0.0, 2*Pi] .
//! The equivalent B-spline curve is oriented from U1 to U2 and has
//! the same orientation as the circle C.
//!
//! Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
Standard_EXPORT Convert_CircleToBSplineCurve(const gp_Circ2d& C, const Standard_Real U1, const Standard_Real U2, const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
protected:
private:
};
#endif // _Convert_CircleToBSplineCurve_HeaderFile

View File

@@ -1,193 +0,0 @@
-- Created on: 1993-11-09
-- Created by: Modelistation
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class CompBezierCurves2dToBSplineCurve2d from Convert
---Purpose: Converts a list of connecting Bezier Curves 2d to a
-- BSplineCurve 2d.
-- if possible, the continuity of the BSpline will be
-- increased to more than C0.
uses
SequenceOfReal from TColStd,
SequenceOfInteger from TColStd,
Array1OfReal from TColStd,
Array1OfInteger from TColStd,
Array1OfPnt2d from TColgp,
SequenceOfPnt2d from TColgp,
SequenceOfArray1OfPoles2d from Convert
raises
ConstructionError from Standard
-------------------------------------------------------------------------
--- Don't forget to use the method Perform before accessing the Result.
-------------------------------------------------------------------------
is
Create( AngularTolerance : Real = 1.0e-4 )
returns CompBezierCurves2dToBSplineCurve2d from Convert;
---Purpose: Constructs a framework for converting a sequence of
-- adjacent non-rational Bezier curves into a BSpline curve.
-- Knots will be created on the computed BSpline curve at
-- each junction point of two consecutive Bezier curves. The
-- degree of continuity of the BSpline curve will be increased at
-- the junction point of two consecutive Bezier curves if their
-- tangent vectors at this point are parallel. AngularTolerance
-- (given in radians, and defaulted to 1.0 e-4) will be used
-- to check the parallelism of the two tangent vectors.
-- Use the following functions:
-- - AddCurve to define in sequence the adjacent Bezier
-- curves to be converted,
-- - Perform to compute the data needed to build the BSpline curve,
-- - and the available consultation functions to access the
-- computed data. This data may be used to construct the BSpline curve.
AddCurve( me : in out;
Poles : Array1OfPnt2d from TColgp)
is static;
--- Purpose: Adds the Bezier curve defined by the table of poles Poles, to
-- the sequence (still contained in this framework) of adjacent
-- Bezier curves to be converted into a BSpline curve.
-- Only polynomial (i.e. non-rational) Bezier curves are
-- converted using this framework.
-- If this is not the first call to the function (i.e. if this framework
-- still contains data in its sequence of Bezier curves), the
-- degree of continuity of the BSpline curve will be increased at
-- the time of computation at the first point of the added Bezier
-- curve (i.e. the first point of the Poles table). This will be the
-- case if the tangent vector of the curve at this point is
-- parallel to the tangent vector at the end point of the
-- preceding Bezier curve in the sequence of Bezier curves still
-- contained in this framework. An angular tolerance given at
-- the time of construction of this framework, will be used to
-- check the parallelism of the two tangent vectors. This
-- checking procedure, and all the relative computations will be
-- performed by the function Perform.
-- When the sequence of adjacent Bezier curves is complete,
-- use the following functions:
-- - Perform to compute the data needed to build the BSpline curve,
-- - and the available consultation functions to access the
-- computed data. This data may be used to construct the BSpline curve.
-- Warning
-- The sequence of Bezier curves treated by this framework is
-- automatically initialized with the first Bezier curve when the
-- function is first called. During subsequent use of this function,
-- ensure that the first point of the added Bezier curve (i.e. the
-- first point of the Poles table) is coincident with the last point
-- of the sequence (i.e. the last point of the preceding Bezier
-- curve in the sequence) of Bezier curves still contained in
-- this framework. An error may occur at the time of
-- computation if this condition is not satisfied. Particular care
-- must be taken with respect to the above, as this condition is
-- not checked either when defining the sequence of Bezier
-- curves or at the time of computation.
Perform(me: in out)
---Purpose: Computes all the data needed to build a BSpline curve
-- equivalent to the sequence of adjacent Bezier curves still
-- contained in this framework.
-- A knot is inserted on the computed BSpline curve at the
-- junction point of two consecutive Bezier curves. The
-- degree of continuity of the BSpline curve will be increased
-- at the junction point of two consecutive Bezier curves if
-- their tangent vectors at this point are parallel. An angular
-- tolerance given at the time of construction of this
-- framework is used to check the parallelism of the two
-- tangent vectors.
-- Use the available consultation functions to access the
-- computed data. This data may then be used to construct
-- the BSpline curve.
-- Warning
-- Ensure that the curves in the sequence of Bezier curves
-- contained in this framework are adjacent. An error may
-- occur at the time of computation if this condition is not
-- satisfied. Particular care must be taken with respect to the
-- above as this condition is not checked, either when
-- defining the Bezier curve sequence or at the time of computation.
is static;
Degree(me) returns Integer from Standard
is static;
---Purpose: Returns the degree of the BSpline curve whose data is
-- computed in this framework.
-- Warning
-- Take particular care not to use this function before the
-- computation is performed (Perform function), as this
-- condition is not checked and an error may therefore occur.
NbPoles(me) returns Integer from Standard
is static;
---Purpose: Returns the number of poles of the BSpline curve whose
-- data is computed in this framework.
-- Warning
-- Take particular care not to use this function before the
-- computation is performed (Perform function), as this
-- condition is not checked and an error may therefore occur.
Poles(me; Poles : in out Array1OfPnt2d from TColgp)
is static;
--- Purpose: Loads the Poles table with the poles of the BSpline curve
-- whose data is computed in this framework.
-- Warning
-- - Do not use this function before the computation is
-- performed (Perform function).
-- - The length of the Poles array must be equal to the
-- number of poles of the BSpline curve whose data is
-- computed in this framework.
-- Particular care must be taken with respect to the above, as
-- these conditions are not checked, and an error may occur.
NbKnots(me) returns Integer from Standard
is static;
--- Purpose: Returns the number of knots of the BSpline curve whose
-- data is computed in this framework.
-- Warning
-- Take particular care not to use this function before the
-- computation is performed (Perform function), as this
-- condition is not checked and an error may therefore occur.
KnotsAndMults(me;
Knots : in out Array1OfReal from TColStd;
Mults : in out Array1OfInteger from TColStd)
is static;
--- Purpose: Loads the Knots table with the knots
-- and the Mults table with the corresponding multiplicities
-- of the BSpline curve whose data is computed in this framework.
-- Warning
-- - Do not use this function before the computation is
-- performed (Perform function).
-- - The length of the Knots and Mults arrays must be equal
-- to the number of knots in the BSpline curve whose data is
-- computed in this framework.
-- Particular care must be taken with respect to the above as
-- these conditions are not checked, and an error may occur.
fields
mySequence : SequenceOfArray1OfPoles2d from Convert;
CurvePoles : SequenceOfPnt2d from TColgp;
CurveKnots : SequenceOfReal from TColStd;
KnotsMultiplicities : SequenceOfInteger from TColStd;
myDegree : Integer from Standard;
myAngular : Real from Standard;
myDone : Boolean from Standard;
end CompBezierCurves2dToBSplineCurve2d;

View File

@@ -14,22 +14,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Convert_CompBezierCurves2dToBSplineCurve2d.ixx>
#include <Precision.hxx>
#include <BSplCLib.hxx>
#include <PLib.hxx>
#include <Convert_CompBezierCurves2dToBSplineCurve2d.hxx>
#include <gp.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp.hxx>
#include <PLib.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
//=======================================================================
//function : Convert_CompBezierCurves2dToBSplineCurve2d
//purpose :
//=======================================================================
Convert_CompBezierCurves2dToBSplineCurve2d::
Convert_CompBezierCurves2dToBSplineCurve2d(
const Standard_Real AngularTolerance) :

View File

@@ -0,0 +1,205 @@
// Created on: 1993-11-09
// Created by: Modelistation
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_CompBezierCurves2dToBSplineCurve2d_HeaderFile
#define _Convert_CompBezierCurves2dToBSplineCurve2d_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_SequenceOfArray1OfPoles2d.hxx>
#include <TColgp_SequenceOfPnt2d.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class Standard_ConstructionError;
//! Converts a list of connecting Bezier Curves 2d to a
//! BSplineCurve 2d.
//! if possible, the continuity of the BSpline will be
//! increased to more than C0.
class Convert_CompBezierCurves2dToBSplineCurve2d
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for converting a sequence of
//! adjacent non-rational Bezier curves into a BSpline curve.
//! Knots will be created on the computed BSpline curve at
//! each junction point of two consecutive Bezier curves. The
//! degree of continuity of the BSpline curve will be increased at
//! the junction point of two consecutive Bezier curves if their
//! tangent vectors at this point are parallel. AngularTolerance
//! (given in radians, and defaulted to 1.0 e-4) will be used
//! to check the parallelism of the two tangent vectors.
//! Use the following functions:
//! - AddCurve to define in sequence the adjacent Bezier
//! curves to be converted,
//! - Perform to compute the data needed to build the BSpline curve,
//! - and the available consultation functions to access the
//! computed data. This data may be used to construct the BSpline curve.
Standard_EXPORT Convert_CompBezierCurves2dToBSplineCurve2d(const Standard_Real AngularTolerance = 1.0e-4);
//! Adds the Bezier curve defined by the table of poles Poles, to
//! the sequence (still contained in this framework) of adjacent
//! Bezier curves to be converted into a BSpline curve.
//! Only polynomial (i.e. non-rational) Bezier curves are
//! converted using this framework.
//! If this is not the first call to the function (i.e. if this framework
//! still contains data in its sequence of Bezier curves), the
//! degree of continuity of the BSpline curve will be increased at
//! the time of computation at the first point of the added Bezier
//! curve (i.e. the first point of the Poles table). This will be the
//! case if the tangent vector of the curve at this point is
//! parallel to the tangent vector at the end point of the
//! preceding Bezier curve in the sequence of Bezier curves still
//! contained in this framework. An angular tolerance given at
//! the time of construction of this framework, will be used to
//! check the parallelism of the two tangent vectors. This
//! checking procedure, and all the relative computations will be
//! performed by the function Perform.
//! When the sequence of adjacent Bezier curves is complete,
//! use the following functions:
//! - Perform to compute the data needed to build the BSpline curve,
//! - and the available consultation functions to access the
//! computed data. This data may be used to construct the BSpline curve.
//! Warning
//! The sequence of Bezier curves treated by this framework is
//! automatically initialized with the first Bezier curve when the
//! function is first called. During subsequent use of this function,
//! ensure that the first point of the added Bezier curve (i.e. the
//! first point of the Poles table) is coincident with the last point
//! of the sequence (i.e. the last point of the preceding Bezier
//! curve in the sequence) of Bezier curves still contained in
//! this framework. An error may occur at the time of
//! computation if this condition is not satisfied. Particular care
//! must be taken with respect to the above, as this condition is
//! not checked either when defining the sequence of Bezier
//! curves or at the time of computation.
Standard_EXPORT void AddCurve (const TColgp_Array1OfPnt2d& Poles);
//! Computes all the data needed to build a BSpline curve
//! equivalent to the sequence of adjacent Bezier curves still
//! contained in this framework.
//! A knot is inserted on the computed BSpline curve at the
//! junction point of two consecutive Bezier curves. The
//! degree of continuity of the BSpline curve will be increased
//! at the junction point of two consecutive Bezier curves if
//! their tangent vectors at this point are parallel. An angular
//! tolerance given at the time of construction of this
//! framework is used to check the parallelism of the two
//! tangent vectors.
//! Use the available consultation functions to access the
//! computed data. This data may then be used to construct
//! the BSpline curve.
//! Warning
//! Ensure that the curves in the sequence of Bezier curves
//! contained in this framework are adjacent. An error may
//! occur at the time of computation if this condition is not
//! satisfied. Particular care must be taken with respect to the
//! above as this condition is not checked, either when
//! defining the Bezier curve sequence or at the time of computation.
Standard_EXPORT void Perform();
//! Returns the degree of the BSpline curve whose data is
//! computed in this framework.
//! Warning
//! Take particular care not to use this function before the
//! computation is performed (Perform function), as this
//! condition is not checked and an error may therefore occur.
Standard_EXPORT Standard_Integer Degree() const;
//! Returns the number of poles of the BSpline curve whose
//! data is computed in this framework.
//! Warning
//! Take particular care not to use this function before the
//! computation is performed (Perform function), as this
//! condition is not checked and an error may therefore occur.
Standard_EXPORT Standard_Integer NbPoles() const;
//! Loads the Poles table with the poles of the BSpline curve
//! whose data is computed in this framework.
//! Warning
//! - Do not use this function before the computation is
//! performed (Perform function).
//! - The length of the Poles array must be equal to the
//! number of poles of the BSpline curve whose data is
//! computed in this framework.
//! Particular care must be taken with respect to the above, as
//! these conditions are not checked, and an error may occur.
Standard_EXPORT void Poles (TColgp_Array1OfPnt2d& Poles) const;
//! Returns the number of knots of the BSpline curve whose
//! data is computed in this framework.
//! Warning
//! Take particular care not to use this function before the
//! computation is performed (Perform function), as this
//! condition is not checked and an error may therefore occur.
Standard_EXPORT Standard_Integer NbKnots() const;
//! Loads the Knots table with the knots
//! and the Mults table with the corresponding multiplicities
//! of the BSpline curve whose data is computed in this framework.
//! Warning
//! - Do not use this function before the computation is
//! performed (Perform function).
//! - The length of the Knots and Mults arrays must be equal
//! to the number of knots in the BSpline curve whose data is
//! computed in this framework.
//! Particular care must be taken with respect to the above as
//! these conditions are not checked, and an error may occur.
Standard_EXPORT void KnotsAndMults (TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults) const;
protected:
private:
Convert_SequenceOfArray1OfPoles2d mySequence;
TColgp_SequenceOfPnt2d CurvePoles;
TColStd_SequenceOfReal CurveKnots;
TColStd_SequenceOfInteger KnotsMultiplicities;
Standard_Integer myDegree;
Standard_Real myAngular;
Standard_Boolean myDone;
};
#endif // _Convert_CompBezierCurves2dToBSplineCurve2d_HeaderFile

View File

@@ -1,194 +0,0 @@
-- Created on: 1993-10-20
-- 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 CompBezierCurvesToBSplineCurve from Convert
---Purpose: An algorithm to convert a sequence of adjacent
-- non-rational Bezier curves into a BSpline curve.
-- A CompBezierCurvesToBSplineCurve object provides a framework for:
-- - defining the sequence of adjacent non-rational Bezier
-- curves to be converted into a BSpline curve,
-- - implementing the computation algorithm, and
-- - consulting the results.
-- Warning
-- Do not attempt to convert rational Bezier curves using this type of algorithm.
uses
Array1OfReal from TColStd,
SequenceOfReal from TColStd,
SequenceOfInteger from TColStd,
Array1OfInteger from TColStd,
Array1OfPnt from TColgp,
SequenceOfPnt from TColgp,
SequenceOfArray1OfPoles from Convert
-------------------------------------------------------------------------
--- Don't forget to use the method Perform before accessing the Result.
-------------------------------------------------------------------------
raises
ConstructionError from Standard
is
Create ( AngularTolerance : Real = 1.0e-4 )
returns CompBezierCurvesToBSplineCurve from Convert;
---Purpose: Constructs a framework for converting a sequence of
-- adjacent non-rational Bezier curves into a BSpline curve.
-- Knots will be created on the computed BSpline curve at
-- each junction point of two consecutive Bezier curves. The
-- degree of continuity of the BSpline curve will be increased at
-- the junction point of two consecutive Bezier curves if their
-- tangent vectors at this point are parallel. AngularTolerance
-- (given in radians, and defaulted to 1.0 e-4) will be used
-- to check the parallelism of the two tangent vectors.
-- Use the following functions:
-- - AddCurve to define in sequence the adjacent Bezier
-- curves to be converted,
-- - Perform to compute the data needed to build the BSpline curve,
-- - and the available consultation functions to access the
-- computed data. This data may be used to construct the BSpline curve.
AddCurve( me : in out;
Poles : Array1OfPnt from TColgp)
is static;
--- Purpose: Adds the Bezier curve defined by the table of poles Poles, to
-- the sequence (still contained in this framework) of adjacent
-- Bezier curves to be converted into a BSpline curve.
-- Only polynomial (i.e. non-rational) Bezier curves are
-- converted using this framework.
-- If this is not the first call to the function (i.e. if this framework
-- still contains data in its Bezier curve sequence), the degree
-- of continuity of the BSpline curve will be increased at the
-- time of computation at the first point of the added Bezier
-- curve (i.e. the first point of the Poles table). This will be the
-- case if the tangent vector of the curve at this point is
-- parallel to the tangent vector at the end point of the
-- preceding Bezier curve in the Bezier curve sequence still
-- contained in this framework. An angular tolerance given at
-- the time of construction of this framework will be used to
-- check the parallelism of the two tangent vectors. This
-- checking procedure and all related computations will be
-- performed by the Perform function.
-- When the adjacent Bezier curve sequence is complete, use
-- the following functions:
-- - Perform to compute the data needed to build the BSpline curve,
-- - and the available consultation functions to access the
-- computed data. This data may be used to construct the BSpline curve.
-- Warning
-- The Bezier curve sequence treated by this framework is
-- automatically initialized with the first Bezier curve when the
-- function is first called. During subsequent use of this function,
-- ensure that the first point of the added Bezier curve (i.e. the
-- first point of the Poles table) is coincident with the last point
-- of the Bezier curve sequence (i.e. the last point of the
-- preceding Bezier curve in the sequence) still contained in
-- this framework. An error may occur at the time of
-- computation if this condition is not satisfied. Particular care
-- must be taken with respect to the above, as this condition is
-- not checked either when defining the Bezier curve
-- sequence or at the time of computation.
Perform(me: in out)
---Purpose: Computes all the data needed to build a BSpline curve
-- equivalent to the adjacent Bezier curve sequence still
-- contained in this framework.
-- A knot is inserted on the computed BSpline curve at the
-- junction point of two consecutive Bezier curves. The
-- degree of continuity of the BSpline curve will be increased
-- at the junction point of two consecutive Bezier curves if
-- their tangent vectors at this point are parallel. An angular
-- tolerance given at the time of construction of this
-- framework is used to check the parallelism of the two
-- tangent vectors.
-- Use the available consultation functions to access the
-- computed data. This data may then be used to construct
-- the BSpline curve.
-- Warning
-- Make sure that the curves in the Bezier curve sequence
-- contained in this framework are adjacent. An error may
-- occur at the time of computation if this condition is not
-- satisfied. Particular care must be taken with respect to the
-- above as this condition is not checked, either when
-- defining the Bezier curve sequence or at the time of computation.
is static;
Degree(me) returns Integer from Standard
is static;
---Purpose: Returns the degree of the BSpline curve whose data is
-- computed in this framework.
-- Warning
-- Take particular care not to use this function before the
-- computation is performed (Perform function), as this
-- condition is not checked and an error may therefore occur.
NbPoles(me) returns Integer from Standard
is static;
---Purpose: Returns the number of poles of the BSpline curve whose
-- data is computed in this framework.
-- Warning
-- Take particular care not to use this function before the
-- computation is performed (Perform function), as this
-- condition is not checked and an error may therefore occur.
Poles(me; Poles : in out Array1OfPnt from TColgp)
is static;
--- Purpose: Loads the Poles table with the poles of the BSpline curve
-- whose data is computed in this framework.
-- Warning
-- - Do not use this function before the computation is
-- performed (Perform function).
-- - The length of the Poles array must be equal to the
-- number of poles of the BSpline curve whose data is
-- computed in this framework.
-- Particular care must be taken with respect to the above, as
-- these conditions are not checked, and an error may occur.
NbKnots(me) returns Integer from Standard
is static;
---Purpose: Returns the number of knots of the BSpline curve whose
-- data is computed in this framework.
-- Warning
-- Take particular care not to use this function before the
-- computation is performed (Perform function), as this
-- condition is not checked and an error may therefore occur.
KnotsAndMults(me;
Knots : in out Array1OfReal from TColStd;
Mults : in out Array1OfInteger from TColStd)
is static;
---Purpose:
-- - loads the Knots table with the knots,
-- - and loads the Mults table with the corresponding multiplicities
-- of the BSpline curve whose data is computed in this framework.
-- Warning
-- - Do not use this function before the computation is
-- performed (Perform function).
-- - The length of the Knots and Mults arrays must be equal
-- to the number of knots in the BSpline curve whose data is
-- computed in this framework.
-- Particular care must be taken with respect to the above as
-- these conditions are not checked, and an error may occur.
fields
mySequence : SequenceOfArray1OfPoles from Convert;
CurvePoles : SequenceOfPnt from TColgp;
CurveKnots : SequenceOfReal from TColStd;
KnotsMultiplicities : SequenceOfInteger from TColStd;
myDegree : Integer from Standard;
myAngular : Real from Standard;
myDone : Boolean from Standard;
end CompBezierCurvesToBSplineCurve;

View File

@@ -14,23 +14,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Convert_CompBezierCurvesToBSplineCurve.ixx>
#include <Precision.hxx>
#include <BSplCLib.hxx>
#include <PLib.hxx>
#include <gp_Pnt.hxx>
#include <Convert_CompBezierCurvesToBSplineCurve.hxx>
#include <gp.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <PLib.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <TColgp_HArray1OfPnt.hxx>
//=======================================================================
//function : Convert_CompBezierCurvesToBSplineCurve
//purpose :
//=======================================================================
Convert_CompBezierCurvesToBSplineCurve::
Convert_CompBezierCurvesToBSplineCurve(
const Standard_Real AngularTolerance) :

View File

@@ -0,0 +1,211 @@
// Created on: 1993-10-20
// 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 _Convert_CompBezierCurvesToBSplineCurve_HeaderFile
#define _Convert_CompBezierCurvesToBSplineCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_SequenceOfArray1OfPoles.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class Standard_ConstructionError;
//! An algorithm to convert a sequence of adjacent
//! non-rational Bezier curves into a BSpline curve.
//! A CompBezierCurvesToBSplineCurve object provides a framework for:
//! - defining the sequence of adjacent non-rational Bezier
//! curves to be converted into a BSpline curve,
//! - implementing the computation algorithm, and
//! - consulting the results.
//! Warning
//! Do not attempt to convert rational Bezier curves using this type of algorithm.
class Convert_CompBezierCurvesToBSplineCurve
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for converting a sequence of
//! adjacent non-rational Bezier curves into a BSpline curve.
//! Knots will be created on the computed BSpline curve at
//! each junction point of two consecutive Bezier curves. The
//! degree of continuity of the BSpline curve will be increased at
//! the junction point of two consecutive Bezier curves if their
//! tangent vectors at this point are parallel. AngularTolerance
//! (given in radians, and defaulted to 1.0 e-4) will be used
//! to check the parallelism of the two tangent vectors.
//! Use the following functions:
//! - AddCurve to define in sequence the adjacent Bezier
//! curves to be converted,
//! - Perform to compute the data needed to build the BSpline curve,
//! - and the available consultation functions to access the
//! computed data. This data may be used to construct the BSpline curve.
Standard_EXPORT Convert_CompBezierCurvesToBSplineCurve(const Standard_Real AngularTolerance = 1.0e-4);
//! Adds the Bezier curve defined by the table of poles Poles, to
//! the sequence (still contained in this framework) of adjacent
//! Bezier curves to be converted into a BSpline curve.
//! Only polynomial (i.e. non-rational) Bezier curves are
//! converted using this framework.
//! If this is not the first call to the function (i.e. if this framework
//! still contains data in its Bezier curve sequence), the degree
//! of continuity of the BSpline curve will be increased at the
//! time of computation at the first point of the added Bezier
//! curve (i.e. the first point of the Poles table). This will be the
//! case if the tangent vector of the curve at this point is
//! parallel to the tangent vector at the end point of the
//! preceding Bezier curve in the Bezier curve sequence still
//! contained in this framework. An angular tolerance given at
//! the time of construction of this framework will be used to
//! check the parallelism of the two tangent vectors. This
//! checking procedure and all related computations will be
//! performed by the Perform function.
//! When the adjacent Bezier curve sequence is complete, use
//! the following functions:
//! - Perform to compute the data needed to build the BSpline curve,
//! - and the available consultation functions to access the
//! computed data. This data may be used to construct the BSpline curve.
//! Warning
//! The Bezier curve sequence treated by this framework is
//! automatically initialized with the first Bezier curve when the
//! function is first called. During subsequent use of this function,
//! ensure that the first point of the added Bezier curve (i.e. the
//! first point of the Poles table) is coincident with the last point
//! of the Bezier curve sequence (i.e. the last point of the
//! preceding Bezier curve in the sequence) still contained in
//! this framework. An error may occur at the time of
//! computation if this condition is not satisfied. Particular care
//! must be taken with respect to the above, as this condition is
//! not checked either when defining the Bezier curve
//! sequence or at the time of computation.
Standard_EXPORT void AddCurve (const TColgp_Array1OfPnt& Poles);
//! Computes all the data needed to build a BSpline curve
//! equivalent to the adjacent Bezier curve sequence still
//! contained in this framework.
//! A knot is inserted on the computed BSpline curve at the
//! junction point of two consecutive Bezier curves. The
//! degree of continuity of the BSpline curve will be increased
//! at the junction point of two consecutive Bezier curves if
//! their tangent vectors at this point are parallel. An angular
//! tolerance given at the time of construction of this
//! framework is used to check the parallelism of the two
//! tangent vectors.
//! Use the available consultation functions to access the
//! computed data. This data may then be used to construct
//! the BSpline curve.
//! Warning
//! Make sure that the curves in the Bezier curve sequence
//! contained in this framework are adjacent. An error may
//! occur at the time of computation if this condition is not
//! satisfied. Particular care must be taken with respect to the
//! above as this condition is not checked, either when
//! defining the Bezier curve sequence or at the time of computation.
Standard_EXPORT void Perform();
//! Returns the degree of the BSpline curve whose data is
//! computed in this framework.
//! Warning
//! Take particular care not to use this function before the
//! computation is performed (Perform function), as this
//! condition is not checked and an error may therefore occur.
Standard_EXPORT Standard_Integer Degree() const;
//! Returns the number of poles of the BSpline curve whose
//! data is computed in this framework.
//! Warning
//! Take particular care not to use this function before the
//! computation is performed (Perform function), as this
//! condition is not checked and an error may therefore occur.
Standard_EXPORT Standard_Integer NbPoles() const;
//! Loads the Poles table with the poles of the BSpline curve
//! whose data is computed in this framework.
//! Warning
//! - Do not use this function before the computation is
//! performed (Perform function).
//! - The length of the Poles array must be equal to the
//! number of poles of the BSpline curve whose data is
//! computed in this framework.
//! Particular care must be taken with respect to the above, as
//! these conditions are not checked, and an error may occur.
Standard_EXPORT void Poles (TColgp_Array1OfPnt& Poles) const;
//! Returns the number of knots of the BSpline curve whose
//! data is computed in this framework.
//! Warning
//! Take particular care not to use this function before the
//! computation is performed (Perform function), as this
//! condition is not checked and an error may therefore occur.
Standard_EXPORT Standard_Integer NbKnots() const;
//! - loads the Knots table with the knots,
//! - and loads the Mults table with the corresponding multiplicities
//! of the BSpline curve whose data is computed in this framework.
//! Warning
//! - Do not use this function before the computation is
//! performed (Perform function).
//! - The length of the Knots and Mults arrays must be equal
//! to the number of knots in the BSpline curve whose data is
//! computed in this framework.
//! Particular care must be taken with respect to the above as
//! these conditions are not checked, and an error may occur.
Standard_EXPORT void KnotsAndMults (TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults) const;
protected:
private:
Convert_SequenceOfArray1OfPoles mySequence;
TColgp_SequenceOfPnt CurvePoles;
TColStd_SequenceOfReal CurveKnots;
TColStd_SequenceOfInteger KnotsMultiplicities;
Standard_Integer myDegree;
Standard_Real myAngular;
Standard_Boolean myDone;
};
#endif // _Convert_CompBezierCurvesToBSplineCurve_HeaderFile

View File

@@ -1,159 +0,0 @@
-- Created on: 1995-05-30
-- Created by: Xavier BENVENISTE
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class CompPolynomialToPoles from Convert
---Purpose: Convert a serie of Polynomial N-Dimensional Curves
-- that are have continuity CM to an N-Dimensional Bspline Curve
-- that has continuity CM.
-- (to convert an function (curve) polynomial by span in a BSpline)
-- This class uses the following arguments :
-- NumCurves : the number of Polynomial Curves
-- Continuity: the requested continuity for the n-dimensional Spline
-- Dimension : the dimension of the Spline
-- MaxDegree : maximum allowed degree for each composite
-- polynomial segment.
-- NumCoeffPerCurve : the number of coefficient per segments = degree - 1
-- Coefficients : the coefficients organized in the following way
-- [1..<myNumPolynomials>][1..myMaxDegree +1][1..myDimension]
-- that is : index [n,d,i] is at slot
-- (n-1) * (myMaxDegree + 1) * myDimension + (d-1) * myDimension + i
-- PolynomialIntervals : nth polynomial represents a polynomial between
-- myPolynomialIntervals->Value(n,0) and
-- myPolynomialIntervals->Value(n,1)
-- TrueIntervals : the nth polynomial has to be mapped linearly to be
-- defined on the following interval :
-- myTrueIntervals->Value(n) and myTrueIntervals->Value(n+1)
-- so that it represent adequatly the function with the
-- required continuity
uses Array1OfReal from TColStd,
HArray1OfReal from TColStd,
HArray2OfReal from TColStd,
HArray1OfInteger from TColStd,
Array1OfReal from TColStd,
Array2OfReal from TColStd,
Array1OfInteger from TColStd,
Shape from GeomAbs
raises
OutOfRange from Standard,
ConstructionError from Standard
is
Create(NumCurves : Integer ;
Continuity : Integer ;
Dimension : Integer ;
MaxDegree : Integer ;
NumCoeffPerCurve : HArray1OfInteger from TColStd ;
Coefficients : HArray1OfReal from TColStd ;
PolynomialIntervals : HArray2OfReal from TColStd ;
TrueIntervals : HArray1OfReal from TColStd)
raises ConstructionError ;
---Purpose: Warning!
-- Continuity can be at MOST the maximum degree of
-- the polynomial functions
-- TrueIntervals :
-- this is the true parameterisation for the composite curve
-- that is : the curve has myContinuity if the nth curve
-- is parameterized between myTrueIntervals(n) and myTrueIntervals(n+1)
--
-- Coefficients have to be the implicit "c form":
-- Coefficients[Numcurves][MaxDegree+1][Dimension]
--
-- Warning!
-- The NumberOfCoefficient of an polynome is his degree + 1
-- Example: To convert the linear function f(x) = 2*x + 1 on the
-- domaine [2,5] to BSpline with the bound [-1,1]. Arguments are :
-- NumCurves = 1;
-- Continuity = 1;
-- Dimension = 1;
-- MaxDegree = 1;
-- NumCoeffPerCurve [1] = {2};
-- Coefficients[2] = {1, 2};
-- PolynomialIntervals[1,2] = {{2,5}}
-- TrueIntervals[2] = {-1, 1}
Create(NumCurves : Integer ;
Dimension : Integer ;
MaxDegree : Integer ;
Continuity : Array1OfInteger from TColStd ;
NumCoeffPerCurve : Array1OfInteger from TColStd ;
Coefficients : Array1OfReal from TColStd ;
PolynomialIntervals : Array2OfReal from TColStd ;
TrueIntervals : Array1OfReal from TColStd)
---Purpose: To Convert sevral span with different order of Continuity.
-- Warning: The Length of Continuity have to be NumCurves-1
raises ConstructionError;
Create(Dimension : Integer ;
MaxDegree : Integer ;
Degree : Integer ;
Coefficients : Array1OfReal from TColStd ;
PolynomialIntervals: Array1OfReal from TColStd ;
TrueIntervals : Array1OfReal from TColStd)
---Purpose: To Convert only one span.
raises ConstructionError;
Perform(me : in out;
NumCurves : Integer;
MaxDegree : Integer;
Dimension : Integer ;
NumCoeffPerCurve : Array1OfInteger from TColStd ;
Coefficients : Array1OfReal from TColStd;
PolynomialIntervals : Array2OfReal from TColStd ;
TrueIntervals : Array1OfReal from TColStd) is private;
NbPoles(me) returns Integer ;
--
---Purpose: number of poles of the n-dimensional BSpline
--
Poles(me; Poles : in out HArray2OfReal from TColStd) ;
---Purpose: returns the poles of the n-dimensional BSpline
-- in the following format :
-- [1..NumPoles][1..Dimension]
--
Degree(me)
returns Integer ;
NbKnots(me)
returns Integer ;
---Purpose: Degree of the n-dimensional Bspline
Knots(me; K : in out HArray1OfReal from TColStd) ;
---Purpose: Knots of the n-dimensional Bspline
Multiplicities(me; M : in out HArray1OfInteger from TColStd) ;
---Purpose: Multiplicities of the knots in the BSpline
IsDone(me) returns Boolean ;
fields
myFlatKnots : HArray1OfReal from TColStd ;
myKnots : HArray1OfReal from TColStd ;
myMults : HArray1OfInteger from TColStd ;
myPoles : HArray2OfReal from TColStd ;
-- the poles of the n-dimensional Bspline organized in the following
-- fashion
-- [1..NumPoles][1..myDimension]
myDegree : Integer ;
myDone : Boolean ;
end CompPolynomialToPoles ;

View File

@@ -24,20 +24,21 @@
#define No_Standard_OutOfRange
#include <Convert_CompPolynomialToPoles.ixx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <PLib.hxx>
#include <BSplCLib.hxx>
#include <Convert_CompPolynomialToPoles.hxx>
#include <PLib.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles(
const Standard_Integer NumCurves,
const Standard_Integer Continuity,

View File

@@ -0,0 +1,150 @@
// Created on: 1995-05-30
// Created by: Xavier BENVENISTE
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_CompPolynomialToPoles_HeaderFile
#define _Convert_CompPolynomialToPoles_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
//! Convert a serie of Polynomial N-Dimensional Curves
//! that are have continuity CM to an N-Dimensional Bspline Curve
//! that has continuity CM.
//! (to convert an function (curve) polynomial by span in a BSpline)
//! This class uses the following arguments :
//! NumCurves : the number of Polynomial Curves
//! Continuity: the requested continuity for the n-dimensional Spline
//! Dimension : the dimension of the Spline
//! MaxDegree : maximum allowed degree for each composite
//! polynomial segment.
//! NumCoeffPerCurve : the number of coefficient per segments = degree - 1
//! Coefficients : the coefficients organized in the following way
//! [1..<myNumPolynomials>][1..myMaxDegree +1][1..myDimension]
//! that is : index [n,d,i] is at slot
//! (n-1) * (myMaxDegree + 1) * myDimension + (d-1) * myDimension + i
//! PolynomialIntervals : nth polynomial represents a polynomial between
//! myPolynomialIntervals->Value(n,0) and
//! myPolynomialIntervals->Value(n,1)
//! TrueIntervals : the nth polynomial has to be mapped linearly to be
//! defined on the following interval :
//! myTrueIntervals->Value(n) and myTrueIntervals->Value(n+1)
//! so that it represent adequatly the function with the
//! required continuity
class Convert_CompPolynomialToPoles
{
public:
DEFINE_STANDARD_ALLOC
//! Warning!
//! Continuity can be at MOST the maximum degree of
//! the polynomial functions
//! TrueIntervals :
//! this is the true parameterisation for the composite curve
//! that is : the curve has myContinuity if the nth curve
//! is parameterized between myTrueIntervals(n) and myTrueIntervals(n+1)
//!
//! Coefficients have to be the implicit "c form":
//! Coefficients[Numcurves][MaxDegree+1][Dimension]
//!
//! Warning!
//! The NumberOfCoefficient of an polynome is his degree + 1
//! Example: To convert the linear function f(x) = 2*x + 1 on the
//! domaine [2,5] to BSpline with the bound [-1,1]. Arguments are :
//! NumCurves = 1;
//! Continuity = 1;
//! Dimension = 1;
//! MaxDegree = 1;
//! NumCoeffPerCurve [1] = {2};
//! Coefficients[2] = {1, 2};
//! PolynomialIntervals[1,2] = {{2,5}}
//! TrueIntervals[2] = {-1, 1}
Standard_EXPORT Convert_CompPolynomialToPoles(const Standard_Integer NumCurves, const Standard_Integer Continuity, const Standard_Integer Dimension, const Standard_Integer MaxDegree, const Handle(TColStd_HArray1OfInteger)& NumCoeffPerCurve, const Handle(TColStd_HArray1OfReal)& Coefficients, const Handle(TColStd_HArray2OfReal)& PolynomialIntervals, const Handle(TColStd_HArray1OfReal)& TrueIntervals);
//! To Convert sevral span with different order of Continuity.
//! Warning: The Length of Continuity have to be NumCurves-1
Standard_EXPORT Convert_CompPolynomialToPoles(const Standard_Integer NumCurves, const Standard_Integer Dimension, const Standard_Integer MaxDegree, const TColStd_Array1OfInteger& Continuity, const TColStd_Array1OfInteger& NumCoeffPerCurve, const TColStd_Array1OfReal& Coefficients, const TColStd_Array2OfReal& PolynomialIntervals, const TColStd_Array1OfReal& TrueIntervals);
//! To Convert only one span.
Standard_EXPORT Convert_CompPolynomialToPoles(const Standard_Integer Dimension, const Standard_Integer MaxDegree, const Standard_Integer Degree, const TColStd_Array1OfReal& Coefficients, const TColStd_Array1OfReal& PolynomialIntervals, const TColStd_Array1OfReal& TrueIntervals);
//! number of poles of the n-dimensional BSpline
Standard_EXPORT Standard_Integer NbPoles() const;
//! returns the poles of the n-dimensional BSpline
//! in the following format :
//! [1..NumPoles][1..Dimension]
Standard_EXPORT void Poles (Handle(TColStd_HArray2OfReal)& Poles) const;
Standard_EXPORT Standard_Integer Degree() const;
//! Degree of the n-dimensional Bspline
Standard_EXPORT Standard_Integer NbKnots() const;
//! Knots of the n-dimensional Bspline
Standard_EXPORT void Knots (Handle(TColStd_HArray1OfReal)& K) const;
//! Multiplicities of the knots in the BSpline
Standard_EXPORT void Multiplicities (Handle(TColStd_HArray1OfInteger)& M) const;
Standard_EXPORT Standard_Boolean IsDone() const;
protected:
private:
Standard_EXPORT void Perform (const Standard_Integer NumCurves, const Standard_Integer MaxDegree, const Standard_Integer Dimension, const TColStd_Array1OfInteger& NumCoeffPerCurve, const TColStd_Array1OfReal& Coefficients, const TColStd_Array2OfReal& PolynomialIntervals, const TColStd_Array1OfReal& TrueIntervals);
Handle(TColStd_HArray1OfReal) myFlatKnots;
Handle(TColStd_HArray1OfReal) myKnots;
Handle(TColStd_HArray1OfInteger) myMults;
Handle(TColStd_HArray2OfReal) myPoles;
Standard_Integer myDegree;
Standard_Boolean myDone;
};
#endif // _Convert_CompPolynomialToPoles_HeaderFile

View File

@@ -1,64 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ConeToBSplineSurface from Convert
--- Purpose :
-- This algorithm converts a bounded Cone into a rational
-- B-spline surface.
-- The cone a Cone from package gp. Its parametrization is :
-- P (U, V) = Loc + V * Zdir +
-- (R + V*Tan(Ang)) * (Cos(U)*Xdir + Sin(U)*Ydir)
-- where Loc is the location point of the cone, Xdir, Ydir and Zdir
-- are the normalized directions of the local cartesian coordinate
-- system of the cone (Zdir is the direction of the Cone's axis) ,
-- Ang is the cone semi-angle. The U parametrization range is
-- [0, 2PI].
--- KeyWords :
-- Convert, Cone, BSplineSurface.
inherits ElementarySurfaceToBSplineSurface
uses Cone from gp
raises DomainError from Standard
is
Create (C : Cone; U1, U2, V1, V2 : Real) returns ConeToBSplineSurface
--- Purpose :
-- The equivalent B-spline surface as the same orientation as the
-- Cone in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
-- Raised if V1 = V2.
Create (C : Cone; V1, V2 : Real) returns ConeToBSplineSurface
--- Purpose :
-- The equivalent B-spline surface as the same orientation as the
-- Cone in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if V1 = V2.
end ConeToBSplineSurface;

View File

@@ -14,10 +14,11 @@
//JCV 16/10/91
#include <Convert_ConeToBSplineSurface.ixx>
#include <Convert_ConeToBSplineSurface.hxx>
#include <gp.hxx>
#include <gp_Cone.hxx>
#include <gp_Trsf.hxx>
#include <Standard_DomainError.hxx>
static const Standard_Integer TheUDegree = 2;
static const Standard_Integer TheVDegree = 1;

View File

@@ -0,0 +1,88 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_ConeToBSplineSurface_HeaderFile
#define _Convert_ConeToBSplineSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ElementarySurfaceToBSplineSurface.hxx>
#include <Standard_Real.hxx>
class Standard_DomainError;
class gp_Cone;
//! This algorithm converts a bounded Cone into a rational
//! B-spline surface.
//! The cone a Cone from package gp. Its parametrization is :
//! P (U, V) = Loc + V * Zdir +
//! (R + V*Tan(Ang)) * (Cos(U)*Xdir + Sin(U)*Ydir)
//! where Loc is the location point of the cone, Xdir, Ydir and Zdir
//! are the normalized directions of the local cartesian coordinate
//! system of the cone (Zdir is the direction of the Cone's axis) ,
//! Ang is the cone semi-angle. The U parametrization range is
//! [0, 2PI].
//! KeyWords :
//! Convert, Cone, BSplineSurface.
class Convert_ConeToBSplineSurface : public Convert_ElementarySurfaceToBSplineSurface
{
public:
DEFINE_STANDARD_ALLOC
//! The equivalent B-spline surface as the same orientation as the
//! Cone in the U and V parametric directions.
//!
//! Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
//! Raised if V1 = V2.
Standard_EXPORT Convert_ConeToBSplineSurface(const gp_Cone& C, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2);
//! The equivalent B-spline surface as the same orientation as the
//! Cone in the U and V parametric directions.
//!
//! Raised if V1 = V2.
Standard_EXPORT Convert_ConeToBSplineSurface(const gp_Cone& C, const Standard_Real V1, const Standard_Real V2);
protected:
private:
};
#endif // _Convert_ConeToBSplineSurface_HeaderFile

View File

@@ -1,172 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class ConicToBSplineCurve from Convert
---Purpose: Root class for algorithms which convert a conic curve into
-- a BSpline curve (CircleToBSplineCurve, EllipseToBSplineCurve,
-- HyperbolaToBSplineCurve, ParabolaToBSplineCurve).
-- These algorithms all work on 2D curves from the gp
-- package and compute all the data needed to construct a
-- BSpline curve equivalent to the conic curve. This data consists of:
-- - the degree of the curve,
-- - the periodic characteristics of the curve,
-- - a poles table with associated weights,
-- - a knots table with associated multiplicities.
-- The abstract class ConicToBSplineCurve provides a
-- framework for storing and consulting this computed data.
-- The data may then be used to construct a
-- Geom2d_BSplineCurve curvSuper class of the following classes :
-- This abstract class implements the methods to get the geometric
-- representation of the B-spline curve equivalent to the conic.
-- The B-spline is computed at the creation time in the sub classes.
-- The B-spline curve is defined with its degree, its control points
-- (Poles), its weights, its knots and their multiplicity.
-- All the geometric entities used in this package are defined in 2D
-- space.
-- KeyWords :
-- Convert, Conic, BSplineCurve, 2D.
uses Array1OfInteger from TColStd,
Array1OfReal from TColStd,
HArray1OfInteger from TColStd,
HArray1OfReal from TColStd,
HArray1OfPnt2d from TColgp,
ParameterisationType from Convert,
Pnt2d from gp
raises OutOfRange from Standard,
ConstructionError from Standard
is
Degree (me) returns Integer is static;
---Purpose: Returns the degree of the BSpline curve whose data is
-- computed in this framework.
NbPoles (me) returns Integer is static;
---Purpose: Returns the number of poles of the BSpline curve whose
-- data is computed in this framework.
NbKnots (me) returns Integer is static;
---Purpose: Returns the number of knots of the BSpline curve whose
-- data is computed in this framework.
IsPeriodic(me) returns Boolean is static;
--- Purpose: Returns true if the BSpline curve whose data is computed in
-- this framework is periodic.
Pole (me; Index : Integer) returns Pnt2d
--- Purpose : Returns the pole of index Index to the poles table of the
-- BSpline curve whose data is computed in this framework.
-- Exceptions
-- Standard_OutOfRange if Index is outside the bounds of
-- the poles table of the BSpline curve whose data is computed in this framework.
raises OutOfRange
is static;
Weight (me; Index : Integer) returns Real
--- Purpose : Returns the weight of the pole of index Index to the poles
-- table of the BSpline curve whose data is computed in this framework.
-- Exceptions
-- Standard_OutOfRange if Index is outside the bounds of
-- the poles table of the BSpline curve whose data is computed in this framework.
raises OutOfRange
is static;
Knot (me; Index : Integer) returns Real
--- Purpose : Returns the knot of index Index to the knots table of the
-- BSpline curve whose data is computed in this framework.
-- Exceptions
-- Standard_OutOfRange if Index is outside the bounds of
-- the knots table of the BSpline curve whose data is computed in this framework.
raises OutOfRange
is static;
Multiplicity (me; Index : Integer) returns Integer
--- Purpose : Returns the multiplicity of the knot of index Index to the
-- knots table of the BSpline curve whose data is computed in this framework.
-- Exceptions
-- Standard_OutOfRange if Index is outside the bounds of
-- the knots table of the BSpline curve whose data is computed in this framework.
raises OutOfRange
is static;
Initialize (NumberOfPoles, NumberOfKnots, Degree : Integer);
BuildCosAndSin(me ;
Parametrisation : ParameterisationType from Convert ;
--
-- allowed parameterisation are TgtThetaOver2 and RationalC1
-- will raise otherwise
CosNumerator : in out HArray1OfReal from TColStd ;
-- Array has the following dimensions :
-- <1, NbPoles> without multiplying by the weights
SinNumerator : in out HArray1OfReal from TColStd ;
-- Array has the following dimensions :
-- <1, NbPoles> without multiplying by the weights
Denominator : in out HArray1OfReal from TColStd ;
-- Array has the following dimension
-- <1, NbPoles>
Degree : in out Integer from Standard ;
Knots : in out HArray1OfReal from TColStd ;
Mults : in out HArray1OfInteger from TColStd)
raises ConstructionError
-- see above
is static ;
-- builds a full periodic circle
--
BuildCosAndSin(me;
Parametrisation : ParameterisationType from Convert ;
UFirst : Real from Standard ;
ULast : Real from Standard ;
CosNumerator : in out HArray1OfReal from TColStd ;
-- Array has the following dimensions :
-- <1, NbPoles> without multiplying by the weights
SinNumerator : in out HArray1OfReal from TColStd ;
-- Array has the following dimensions :
-- <1, NbPoles> without multiplying by the weights
Denominator : in out HArray1OfReal from TColStd ;
-- Array has the following dimension
-- <1, NbPoles>
Degree : in out Integer from Standard ;
Knots : in out HArray1OfReal from TColStd ;
Mults : in out HArray1OfInteger from TColStd)
raises ConstructionError
is static ;
fields
poles : HArray1OfPnt2d is protected;
weights : HArray1OfReal is protected;
knots : HArray1OfReal is protected;
mults : HArray1OfInteger is protected;
degree : Integer is protected;
nbPoles : Integer is protected;
nbKnots : Integer is protected;
isperiodic : Boolean is protected;
end ConicToBSplineCurve;

View File

@@ -16,30 +16,29 @@
#define No_Standard_OutOfRange
#include <Convert_ConicToBSplineCurve.ixx>
#include <BSplCLib.hxx>
#include <Convert_ConicToBSplineCurve.hxx>
#include <Convert_CosAndSinEvalFunction.hxx>
#include <Convert_PolynomialCosAndSin.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <gp.hxx>
#include <gp_Pnt2d.hxx>
#include <PLib.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <PLib.hxx>
#include <BSplCLib.hxx>
#include <Precision.hxx>
#include <gp.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_ConstructionError.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
//function : Convert_ConicToBSplineCurve
//purpose :
//=======================================================================
Convert_ConicToBSplineCurve::Convert_ConicToBSplineCurve
(const Standard_Integer NbPoles,
const Standard_Integer NbKnots,

View File

@@ -0,0 +1,147 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_ConicToBSplineCurve_HeaderFile
#define _Convert_ConicToBSplineCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <Convert_ParameterisationType.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class gp_Pnt2d;
//! Root class for algorithms which convert a conic curve into
//! a BSpline curve (CircleToBSplineCurve, EllipseToBSplineCurve,
//! HyperbolaToBSplineCurve, ParabolaToBSplineCurve).
//! These algorithms all work on 2D curves from the gp
//! package and compute all the data needed to construct a
//! BSpline curve equivalent to the conic curve. This data consists of:
//! - the degree of the curve,
//! - the periodic characteristics of the curve,
//! - a poles table with associated weights,
//! - a knots table with associated multiplicities.
//! The abstract class ConicToBSplineCurve provides a
//! framework for storing and consulting this computed data.
//! The data may then be used to construct a
//! Geom2d_BSplineCurve curvSuper class of the following classes :
//! This abstract class implements the methods to get the geometric
//! representation of the B-spline curve equivalent to the conic.
//! The B-spline is computed at the creation time in the sub classes.
//! The B-spline curve is defined with its degree, its control points
//! (Poles), its weights, its knots and their multiplicity.
//! All the geometric entities used in this package are defined in 2D
//! space.
//! KeyWords :
//! Convert, Conic, BSplineCurve, 2D.
class Convert_ConicToBSplineCurve
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the degree of the BSpline curve whose data is
//! computed in this framework.
Standard_EXPORT Standard_Integer Degree() const;
//! Returns the number of poles of the BSpline curve whose
//! data is computed in this framework.
Standard_EXPORT Standard_Integer NbPoles() const;
//! Returns the number of knots of the BSpline curve whose
//! data is computed in this framework.
Standard_EXPORT Standard_Integer NbKnots() const;
//! Returns true if the BSpline curve whose data is computed in
//! this framework is periodic.
Standard_EXPORT Standard_Boolean IsPeriodic() const;
//! Returns the pole of index Index to the poles table of the
//! BSpline curve whose data is computed in this framework.
//! Exceptions
//! Standard_OutOfRange if Index is outside the bounds of
//! the poles table of the BSpline curve whose data is computed in this framework.
Standard_EXPORT gp_Pnt2d Pole (const Standard_Integer Index) const;
//! Returns the weight of the pole of index Index to the poles
//! table of the BSpline curve whose data is computed in this framework.
//! Exceptions
//! Standard_OutOfRange if Index is outside the bounds of
//! the poles table of the BSpline curve whose data is computed in this framework.
Standard_EXPORT Standard_Real Weight (const Standard_Integer Index) const;
//! Returns the knot of index Index to the knots table of the
//! BSpline curve whose data is computed in this framework.
//! Exceptions
//! Standard_OutOfRange if Index is outside the bounds of
//! the knots table of the BSpline curve whose data is computed in this framework.
Standard_EXPORT Standard_Real Knot (const Standard_Integer Index) const;
//! Returns the multiplicity of the knot of index Index to the
//! knots table of the BSpline curve whose data is computed in this framework.
//! Exceptions
//! Standard_OutOfRange if Index is outside the bounds of
//! the knots table of the BSpline curve whose data is computed in this framework.
Standard_EXPORT Standard_Integer Multiplicity (const Standard_Integer Index) const;
Standard_EXPORT void BuildCosAndSin (const Convert_ParameterisationType Parametrisation, Handle(TColStd_HArray1OfReal)& CosNumerator, Handle(TColStd_HArray1OfReal)& SinNumerator, Handle(TColStd_HArray1OfReal)& Denominator, Standard_Integer& Degree, Handle(TColStd_HArray1OfReal)& Knots, Handle(TColStd_HArray1OfInteger)& Mults) const;
Standard_EXPORT void BuildCosAndSin (const Convert_ParameterisationType Parametrisation, const Standard_Real UFirst, const Standard_Real ULast, Handle(TColStd_HArray1OfReal)& CosNumerator, Handle(TColStd_HArray1OfReal)& SinNumerator, Handle(TColStd_HArray1OfReal)& Denominator, Standard_Integer& Degree, Handle(TColStd_HArray1OfReal)& Knots, Handle(TColStd_HArray1OfInteger)& Mults) const;
protected:
Standard_EXPORT Convert_ConicToBSplineCurve(const Standard_Integer NumberOfPoles, const Standard_Integer NumberOfKnots, const Standard_Integer Degree);
Handle(TColgp_HArray1OfPnt2d) poles;
Handle(TColStd_HArray1OfReal) weights;
Handle(TColStd_HArray1OfReal) knots;
Handle(TColStd_HArray1OfInteger) mults;
Standard_Integer degree;
Standard_Integer nbPoles;
Standard_Integer nbKnots;
Standard_Boolean isperiodic;
private:
};
#endif // _Convert_ConicToBSplineCurve_HeaderFile

View File

@@ -1,63 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class CylinderToBSplineSurface from Convert
--- Purpose :
-- This algorithm converts a bounded cylinder into a rational
-- B-spline surface. The cylinder is a Cylinder from package gp.
-- The parametrization of the cylinder is :
-- P (U, V) = Loc + V * Zdir + Radius * (Xdir*Cos(U) + Ydir*Sin(U))
-- where Loc is the location point of the cylinder, Xdir, Ydir and
-- Zdir are the normalized directions of the local cartesian
-- coordinate system of the cylinder (Zdir is the direction of the
-- cylinder's axis). The U parametrization range is U [0, 2PI].
--- KeyWords :
-- Convert, Cylinder, BSplineSurface.
inherits ElementarySurfaceToBSplineSurface
uses Cylinder from gp
raises DomainError from Standard
is
Create (Cyl : Cylinder; U1, U2, V1, V2 : Real)
returns CylinderToBSplineSurface
--- Purpose :
-- The equivalent B-splineSurface as the same orientation as the
-- cylinder in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
-- Raised if V1 = V2.
Create (Cyl : Cylinder; V1, V2 : Real)
returns CylinderToBSplineSurface
--- Purpose :
-- The equivalent B-splineSurface as the same orientation as the
-- cylinder in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if V1 = V2.
end CylinderToBSplineSurface;

View File

@@ -14,11 +14,11 @@
//JCV 16/10/91
#include <Convert_CylinderToBSplineSurface.ixx>
#include <Convert_CylinderToBSplineSurface.hxx>
#include <gp.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Trsf.hxx>
#include <Standard_DomainError.hxx>
static const Standard_Integer TheUDegree = 2;
static const Standard_Integer TheVDegree = 1;

View File

@@ -0,0 +1,86 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_CylinderToBSplineSurface_HeaderFile
#define _Convert_CylinderToBSplineSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ElementarySurfaceToBSplineSurface.hxx>
#include <Standard_Real.hxx>
class Standard_DomainError;
class gp_Cylinder;
//! This algorithm converts a bounded cylinder into a rational
//! B-spline surface. The cylinder is a Cylinder from package gp.
//! The parametrization of the cylinder is :
//! P (U, V) = Loc + V * Zdir + Radius * (Xdir*Cos(U) + Ydir*Sin(U))
//! where Loc is the location point of the cylinder, Xdir, Ydir and
//! Zdir are the normalized directions of the local cartesian
//! coordinate system of the cylinder (Zdir is the direction of the
//! cylinder's axis). The U parametrization range is U [0, 2PI].
//! KeyWords :
//! Convert, Cylinder, BSplineSurface.
class Convert_CylinderToBSplineSurface : public Convert_ElementarySurfaceToBSplineSurface
{
public:
DEFINE_STANDARD_ALLOC
//! The equivalent B-splineSurface as the same orientation as the
//! cylinder in the U and V parametric directions.
//!
//! Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
//! Raised if V1 = V2.
Standard_EXPORT Convert_CylinderToBSplineSurface(const gp_Cylinder& Cyl, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2);
//! The equivalent B-splineSurface as the same orientation as the
//! cylinder in the U and V parametric directions.
//!
//! Raised if V1 = V2.
Standard_EXPORT Convert_CylinderToBSplineSurface(const gp_Cylinder& Cyl, const Standard_Real V1, const Standard_Real V2);
protected:
private:
};
#endif // _Convert_CylinderToBSplineSurface_HeaderFile

View File

@@ -1,170 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class ElementarySurfaceToBSplineSurface from Convert
--- Purpose :Root class for algorithms which convert an elementary
-- surface (cylinder, cone, sphere or torus) into a BSpline
-- surface (CylinderToBSplineSurface, ConeToBSplineSurface,
-- SphereToBSplineSurface, TorusToBSplineSurface).
-- These algorithms all work on elementary surfaces from
-- the gp package and compute all the data needed to
-- construct a BSpline surface equivalent to the cylinder,
-- cone, sphere or torus. This data consists of the following:
-- - degrees in the u and v parametric directions,
-- - periodic characteristics in the u and v parametric directions,
-- - a poles table with associated weights,
-- - a knots table (for the u and v parametric directions)
-- with associated multiplicities.
-- The abstract class
-- ElementarySurfaceToBSplineSurface provides a
-- framework for storing and consulting this computed data.
-- This data may then be used to construct a
-- Geom_BSplineSurface surface, for example.
-- All those classes define algorithmes to convert an
-- ElementarySurface into a B-spline surface.
-- This abstract class implements the methods to get
-- the geometric representation of the B-spline surface.
-- The B-spline representation is computed at the creation
-- time in the sub classes.
-- The B-spline surface is defined with its degree in the
-- parametric U and V directions, its control points (Poles),
-- its weights, its knots and their multiplicity.
-- KeyWords :
-- Convert, ElementarySurface, BSplineSurface.
uses Array1OfInteger from TColStd,
Array1OfReal from TColStd,
Array2OfReal from TColStd,
Array2OfPnt from TColgp,
Pnt from gp
raises OutOfRange from Standard
is
UDegree (me) returns Integer is static;
VDegree (me) returns Integer is static;
---Purpose: Returns the degree for the u or v parametric direction of
-- the BSpline surface whose data is computed in this framework.
NbUPoles (me) returns Integer is static;
NbVPoles (me) returns Integer is static;
---Purpose: Returns the number of poles for the u or v parametric
-- direction of the BSpline surface whose data is computed in this framework.
NbUKnots (me) returns Integer is static;
NbVKnots (me) returns Integer is static;
---Purpose: Returns the number of knots for the u or v parametric
-- direction of the BSpline surface whose data is computed in this framework .
IsUPeriodic(me) returns Boolean is static;
IsVPeriodic(me) returns Boolean is static;
---Purpose: Returns true if the BSpline surface whose data is computed
-- in this framework is periodic in the u or v parametric direction.
Pole (me; UIndex, VIndex : Integer) returns Pnt
--- Purpose : Returns the pole of index (UIndex,VIndex) to the poles
-- table of the BSpline surface whose data is computed in this framework.
-- Exceptions
-- Standard_OutOfRange if, for the BSpline surface whose
-- data is computed in this framework:
-- - UIndex is outside the bounds of the poles table in the u
-- parametric direction, or
-- - VIndex is outside the bounds of the poles table in the v
-- parametric direction.
raises OutOfRange
is static;
Weight (me; UIndex, VIndex : Integer) returns Real
--- Purpose : Returns the weight of the pole of index (UIndex,VIndex) to
-- the poles table of the BSpline surface whose data is computed in this framework.
-- Exceptions
-- Standard_OutOfRange if, for the BSpline surface whose
-- data is computed in this framework:
-- - UIndex is outside the bounds of the poles table in the u
-- parametric direction, or
-- - VIndex is outside the bounds of the poles table in the v
-- parametric direction.
raises OutOfRange
is static;
UKnot (me; UIndex : Integer) returns Real
--- Purpose : Returns the U-knot of range UIndex.
raises OutOfRange
--- Purpose : Raised if UIndex < 1 or UIndex > NbUKnots.
is static;
VKnot (me; UIndex : Integer) returns Real
--- Purpose : Returns the V-knot of range VIndex.
raises OutOfRange
--- Purpose : Raised if VIndex < 1 or VIndex > NbVKnots.
is static;
UMultiplicity (me; UIndex : Integer) returns Integer
--- Purpose : Returns the multiplicity of the U-knot of range UIndex.
raises OutOfRange
--- Purpose : Raised if UIndex < 1 or UIndex > NbUKnots.
is static;
VMultiplicity (me; VIndex : Integer) returns Integer
--- Purpose : Returns the multiplicity of the V-knot of range VIndex.
raises OutOfRange
--- Purpose : Raised if VIndex < 1 or VIndex > NbVKnots.
is static;
Initialize (NumberOfUPoles, NumberOfVPoles, NumberOfUKnots,
NumberOfVKnots, UDegree, VDegree : Integer);
fields
poles : Array2OfPnt is protected;
weights : Array2OfReal is protected;
uknots : Array1OfReal is protected;
umults : Array1OfInteger is protected;
vknots : Array1OfReal is protected;
vmults : Array1OfInteger is protected;
udegree : Integer is protected;
vdegree : Integer is protected;
nbUPoles : Integer is protected;
nbVPoles : Integer is protected;
nbUKnots : Integer is protected;
nbVKnots : Integer is protected;
isuperiodic : Boolean is protected;
isvperiodic : Boolean is protected;
end ElementarySurfaceToBSplineSurface;

View File

@@ -14,18 +14,14 @@
//JCV 16/10/91
#include <Convert_ElementarySurfaceToBSplineSurface.ixx>
#include <Convert_ElementarySurfaceToBSplineSurface.hxx>
#include <gp_Pnt.hxx>
#include <Standard_OutOfRange.hxx>
//=======================================================================
//function : Convert_ElementarySurfaceToBSplineSurface
//purpose :
//=======================================================================
Convert_ElementarySurfaceToBSplineSurface::
Convert_ElementarySurfaceToBSplineSurface
(const Standard_Integer NbUPoles,

View File

@@ -0,0 +1,172 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_ElementarySurfaceToBSplineSurface_HeaderFile
#define _Convert_ElementarySurfaceToBSplineSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Standard_OutOfRange;
class gp_Pnt;
//! Root class for algorithms which convert an elementary
//! surface (cylinder, cone, sphere or torus) into a BSpline
//! surface (CylinderToBSplineSurface, ConeToBSplineSurface,
//! SphereToBSplineSurface, TorusToBSplineSurface).
//! These algorithms all work on elementary surfaces from
//! the gp package and compute all the data needed to
//! construct a BSpline surface equivalent to the cylinder,
//! cone, sphere or torus. This data consists of the following:
//! - degrees in the u and v parametric directions,
//! - periodic characteristics in the u and v parametric directions,
//! - a poles table with associated weights,
//! - a knots table (for the u and v parametric directions)
//! with associated multiplicities.
//! The abstract class
//! ElementarySurfaceToBSplineSurface provides a
//! framework for storing and consulting this computed data.
//! This data may then be used to construct a
//! Geom_BSplineSurface surface, for example.
//! All those classes define algorithmes to convert an
//! ElementarySurface into a B-spline surface.
//! This abstract class implements the methods to get
//! the geometric representation of the B-spline surface.
//! The B-spline representation is computed at the creation
//! time in the sub classes.
//! The B-spline surface is defined with its degree in the
//! parametric U and V directions, its control points (Poles),
//! its weights, its knots and their multiplicity.
//! KeyWords :
//! Convert, ElementarySurface, BSplineSurface.
class Convert_ElementarySurfaceToBSplineSurface
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT Standard_Integer UDegree() const;
//! Returns the degree for the u or v parametric direction of
//! the BSpline surface whose data is computed in this framework.
Standard_EXPORT Standard_Integer VDegree() const;
Standard_EXPORT Standard_Integer NbUPoles() const;
//! Returns the number of poles for the u or v parametric
//! direction of the BSpline surface whose data is computed in this framework.
Standard_EXPORT Standard_Integer NbVPoles() const;
Standard_EXPORT Standard_Integer NbUKnots() const;
//! Returns the number of knots for the u or v parametric
//! direction of the BSpline surface whose data is computed in this framework .
Standard_EXPORT Standard_Integer NbVKnots() const;
Standard_EXPORT Standard_Boolean IsUPeriodic() const;
//! Returns true if the BSpline surface whose data is computed
//! in this framework is periodic in the u or v parametric direction.
Standard_EXPORT Standard_Boolean IsVPeriodic() const;
//! Returns the pole of index (UIndex,VIndex) to the poles
//! table of the BSpline surface whose data is computed in this framework.
//! Exceptions
//! Standard_OutOfRange if, for the BSpline surface whose
//! data is computed in this framework:
//! - UIndex is outside the bounds of the poles table in the u
//! parametric direction, or
//! - VIndex is outside the bounds of the poles table in the v
//! parametric direction.
Standard_EXPORT gp_Pnt Pole (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
//! Returns the weight of the pole of index (UIndex,VIndex) to
//! the poles table of the BSpline surface whose data is computed in this framework.
//! Exceptions
//! Standard_OutOfRange if, for the BSpline surface whose
//! data is computed in this framework:
//! - UIndex is outside the bounds of the poles table in the u
//! parametric direction, or
//! - VIndex is outside the bounds of the poles table in the v
//! parametric direction.
Standard_EXPORT Standard_Real Weight (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
//! Returns the U-knot of range UIndex.
//! Raised if UIndex < 1 or UIndex > NbUKnots.
Standard_EXPORT Standard_Real UKnot (const Standard_Integer UIndex) const;
//! Returns the V-knot of range VIndex.
//! Raised if VIndex < 1 or VIndex > NbVKnots.
Standard_EXPORT Standard_Real VKnot (const Standard_Integer UIndex) const;
//! Returns the multiplicity of the U-knot of range UIndex.
//! Raised if UIndex < 1 or UIndex > NbUKnots.
Standard_EXPORT Standard_Integer UMultiplicity (const Standard_Integer UIndex) const;
//! Returns the multiplicity of the V-knot of range VIndex.
//! Raised if VIndex < 1 or VIndex > NbVKnots.
Standard_EXPORT Standard_Integer VMultiplicity (const Standard_Integer VIndex) const;
protected:
Standard_EXPORT Convert_ElementarySurfaceToBSplineSurface(const Standard_Integer NumberOfUPoles, const Standard_Integer NumberOfVPoles, const Standard_Integer NumberOfUKnots, const Standard_Integer NumberOfVKnots, const Standard_Integer UDegree, const Standard_Integer VDegree);
TColgp_Array2OfPnt poles;
TColStd_Array2OfReal weights;
TColStd_Array1OfReal uknots;
TColStd_Array1OfInteger umults;
TColStd_Array1OfReal vknots;
TColStd_Array1OfInteger vmults;
Standard_Integer udegree;
Standard_Integer vdegree;
Standard_Integer nbUPoles;
Standard_Integer nbVPoles;
Standard_Integer nbUKnots;
Standard_Integer nbVKnots;
Standard_Boolean isuperiodic;
Standard_Boolean isvperiodic;
private:
};
#endif // _Convert_ElementarySurfaceToBSplineSurface_HeaderFile

View File

@@ -1,59 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class EllipseToBSplineCurve from Convert inherits ConicToBSplineCurve
--- Purpose :
-- This algorithm converts a ellipse into a rational B-spline curve.
-- The ellipse is represented an Elips2d from package gp with
-- the parametrization :
-- P (U) =
-- Loc + (MajorRadius * Cos(U) * Xdir + MinorRadius * Sin(U) * Ydir)
-- where Loc is the center of the ellipse, Xdir and Ydir are the
-- normalized directions of the local cartesian coordinate system of
-- the ellipse. The parametrization range is U [0, 2PI].
--- KeyWords :
-- Convert, Ellipse, BSplineCurve, 2D .
uses Elips2d from gp,
ParameterisationType from Convert
raises DomainError from Standard
is
Create (E : Elips2d;
Parameterisation : ParameterisationType from Convert
= Convert_TgtThetaOver2 ) returns EllipseToBSplineCurve;
--- Purpose : The equivalent B-spline curve has the same orientation
-- as the ellipse E.
Create (E : Elips2d; U1, U2 : Real;
Parameterisation : ParameterisationType from Convert
= Convert_TgtThetaOver2 ) returns EllipseToBSplineCurve
--- Purpose :
-- The ellipse E is limited between the parametric values U1, U2.
-- The equivalent B-spline curve is oriented from U1 to U2 and has
-- the same orientation as E.
raises DomainError;
--- Purpose :
-- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
end EllipseToBSplineCurve;

View File

@@ -14,21 +14,19 @@
//JCV 16/10/91
#include <Convert_EllipseToBSplineCurve.ixx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Convert_EllipseToBSplineCurve.hxx>
#include <gp.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Elips2d.hxx>
#include <gp_Trsf2d.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
//Attention :
//To avoid use of persistent tables in the fields
@@ -38,8 +36,6 @@
//nbKnots and nbPoles are present and updated in the
//constructor of an arc of B-spline circle to take into account
//the real number of poles and nodes.
// parameterization :
// Reference : Rational B-spline for Curve and Surface Representation
// Wayne Tiller CADG September 1983
@@ -47,12 +43,10 @@
// y(t) = 2 t / (1 + t^2)
// then t = Sqrt(2) u / ((Sqrt(2) - 2) u + 2)
// => u = 2 t / (Sqrt(2) + (2 - Sqrt(2)) t)
//=======================================================================
//function : Convert_EllipseToBSplineCurve
//purpose : this constructs a periodic Ellipse
//=======================================================================
Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve
(const gp_Elips2d& E, const Convert_ParameterisationType Parameterisation)
:Convert_ConicToBSplineCurve(0,0,0){

View File

@@ -0,0 +1,84 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_EllipseToBSplineCurve_HeaderFile
#define _Convert_EllipseToBSplineCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ConicToBSplineCurve.hxx>
#include <Convert_ParameterisationType.hxx>
#include <Standard_Real.hxx>
class Standard_DomainError;
class gp_Elips2d;
//! This algorithm converts a ellipse into a rational B-spline curve.
//! The ellipse is represented an Elips2d from package gp with
//! the parametrization :
//! P (U) =
//! Loc + (MajorRadius * Cos(U) * Xdir + MinorRadius * Sin(U) * Ydir)
//! where Loc is the center of the ellipse, Xdir and Ydir are the
//! normalized directions of the local cartesian coordinate system of
//! the ellipse. The parametrization range is U [0, 2PI].
//! KeyWords :
//! Convert, Ellipse, BSplineCurve, 2D .
class Convert_EllipseToBSplineCurve : public Convert_ConicToBSplineCurve
{
public:
DEFINE_STANDARD_ALLOC
//! The equivalent B-spline curve has the same orientation
//! as the ellipse E.
Standard_EXPORT Convert_EllipseToBSplineCurve(const gp_Elips2d& E, const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
//! The ellipse E is limited between the parametric values U1, U2.
//! The equivalent B-spline curve is oriented from U1 to U2 and has
//! the same orientation as E.
//!
//! Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
Standard_EXPORT Convert_EllipseToBSplineCurve(const gp_Elips2d& E, const Standard_Real U1, const Standard_Real U2, const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
protected:
private:
};
#endif // _Convert_EllipseToBSplineCurve_HeaderFile

View File

@@ -1,168 +0,0 @@
-- Created on: 1996-07-08
-- Created by: Philippe MANGIN
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class GridPolynomialToPoles from Convert
---Purpose: Convert a grid of Polynomial Surfaces
-- that are have continuity CM to an
-- Bspline Surface that has continuity
-- CM
uses Array1OfReal from TColStd,
HArray1OfReal from TColStd,
HArray2OfReal from TColStd,
HArray1OfInteger from TColStd,
HArray2OfInteger from TColStd,
HArray2OfPnt from TColgp,
Shape from GeomAbs
raises
DomainError from Standard,
NotDone from StdFail
is
Create(MaxUDegree : Integer ;
MaxVDegree : Integer ;
NumCoeff : HArray1OfInteger from TColStd ;
Coefficients : HArray1OfReal from TColStd ;
PolynomialUIntervals : HArray1OfReal from TColStd ;
PolynomialVIntervals : HArray1OfReal from TColStd )
returns GridPolynomialToPoles
---Purpose: To only one polynomial Surface.
-- The Length of <PolynomialUIntervals> and <PolynomialVIntervals>
-- have to be 2.
-- This values defined the parametric domain of the Polynomial Equation.
--
-- Coefficients :
-- The <Coefficients> have to be formated than an "C array"
-- [MaxUDegree+1] [MaxVDegree+1] [3]
--
---Level: Public
raises DomainError; -- if <NumCoeff> is not a [1, 2] array
-- if the <Coefficients> is not a [1,(MaxUDegree+1)*(MaxVDegree+1)*3]
-- array
Create(NbUSurfaces : Integer;
NBVSurfaces : Integer;
UContinuity : Integer ;
VContinuity : Integer ;
MaxUDegree : Integer ;
MaxVDegree : Integer ;
NumCoeffPerSurface : HArray2OfInteger from TColStd ;
Coefficients : HArray1OfReal from TColStd ;
PolynomialUIntervals : HArray1OfReal from TColStd ;
PolynomialVIntervals : HArray1OfReal from TColStd ;
TrueUIntervals : HArray1OfReal from TColStd;
TrueVIntervals : HArray1OfReal from TColStd)
returns GridPolynomialToPoles
---Purpose: To one grid of polynomial Surface.
-- Warning!
-- Continuity in each parametric direction can be at MOST the
-- maximum degree of the polynomial functions.
--
-- <TrueUIntervals>, <TrueVIntervals> :
-- this is the true parameterisation for the composite surface
--
-- Coefficients :
-- The Coefficients have to be formated than an "C array"
-- [NbVSurfaces] [NBUSurfaces] [MaxUDegree+1] [MaxVDegree+1] [3]
-- raises DomainError if <NumCoeffPerSurface> is not a
-- [1, NbVSurfaces*NbUSurfaces, 1,2] array.
-- if <Coefficients> is not a
--[1, NbVSurfaces*NBUSurfaces*(MaxUDegree+1)*(MaxVDegree+1)*3] array
raises DomainError ;
Perform(me : in out;
UContinuity : Integer ;
VContinuity : Integer ;
MaxUDegree : Integer ;
MaxVDegree : Integer ;
NumCoeffPerSurface : HArray2OfInteger from TColStd ;
Coefficients : HArray1OfReal from TColStd ;
PolynomialUIntervals : HArray1OfReal from TColStd ;
PolynomialVIntervals : HArray1OfReal from TColStd ;
TrueUIntervals : HArray1OfReal from TColStd ;
TrueVIntervals : HArray1OfReal from TColStd );
BuildArray(me;
Degree : Integer;
Knots : HArray1OfReal;
Continuty : Integer;
FlatKnots : in out HArray1OfReal;
Mults : in out HArray1OfInteger;
Parameters : in out HArray1OfReal)
is private;
NbUPoles(me) returns Integer ;
NbVPoles(me) returns Integer ;
Poles(me)
---Purpose: returns the poles of the BSpline Surface
---C++: return const &
returns HArray2OfPnt ;
UDegree(me)
returns Integer ;
VDegree(me)
returns Integer ;
NbUKnots(me)
returns Integer ;
NbVKnots(me)
returns Integer ;
UKnots(me)
---Purpose: Knots in the U direction
---C++: return const &
returns HArray1OfReal;
VKnots(me)
---Purpose: Knots in the V direction
---C++: return const &
returns HArray1OfReal;
UMultiplicities(me)
---Purpose: Multiplicities of the knots in the U direction
---C++: return const &
returns HArray1OfInteger;
VMultiplicities(me)
---Purpose: Multiplicities of the knots in the V direction
---C++: return const &
returns HArray1OfInteger;
IsDone(me) returns Boolean ;
fields
myUFlatKnots : HArray1OfReal from TColStd ;
myVFlatKnots : HArray1OfReal from TColStd ;
myUKnots : HArray1OfReal from TColStd ;
myVKnots : HArray1OfReal from TColStd ;
myUMults : HArray1OfInteger from TColStd ;
myVMults : HArray1OfInteger from TColStd ;
myPoles : HArray2OfPnt from TColgp ;
myUDegree : Integer ;
myVDegree : Integer ;
myDone : Boolean ;
end GridPolynomialToPoles;

View File

@@ -19,15 +19,12 @@
// Condition d'extraction corrigee
// + positionnement par EvalPoly2Var
#include <Convert_GridPolynomialToPoles.ixx>
#include <StdFail_NotDone.hxx>
#include <Standard_DomainError.hxx>
#include <PLib.hxx>
#include <BSplSLib.hxx>
#include <BSplCLib.hxx>
#include <BSplSLib.hxx>
#include <Convert_GridPolynomialToPoles.hxx>
#include <PLib.hxx>
#include <Standard_DomainError.hxx>
#include <StdFail_NotDone.hxx>
Convert_GridPolynomialToPoles::
Convert_GridPolynomialToPoles(

View File

@@ -0,0 +1,137 @@
// Created on: 1996-07-08
// Created by: Philippe MANGIN
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_GridPolynomialToPoles_HeaderFile
#define _Convert_GridPolynomialToPoles_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColgp_HArray2OfPnt.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_HArray2OfInteger.hxx>
class Standard_DomainError;
class StdFail_NotDone;
//! Convert a grid of Polynomial Surfaces
//! that are have continuity CM to an
//! Bspline Surface that has continuity
//! CM
class Convert_GridPolynomialToPoles
{
public:
DEFINE_STANDARD_ALLOC
//! To only one polynomial Surface.
//! The Length of <PolynomialUIntervals> and <PolynomialVIntervals>
//! have to be 2.
//! This values defined the parametric domain of the Polynomial Equation.
//!
//! Coefficients :
//! The <Coefficients> have to be formated than an "C array"
//! [MaxUDegree+1] [MaxVDegree+1] [3]
Standard_EXPORT Convert_GridPolynomialToPoles(const Standard_Integer MaxUDegree, const Standard_Integer MaxVDegree, const Handle(TColStd_HArray1OfInteger)& NumCoeff, const Handle(TColStd_HArray1OfReal)& Coefficients, const Handle(TColStd_HArray1OfReal)& PolynomialUIntervals, const Handle(TColStd_HArray1OfReal)& PolynomialVIntervals);
//! To one grid of polynomial Surface.
//! Warning!
//! Continuity in each parametric direction can be at MOST the
//! maximum degree of the polynomial functions.
//!
//! <TrueUIntervals>, <TrueVIntervals> :
//! this is the true parameterisation for the composite surface
//!
//! Coefficients :
//! The Coefficients have to be formated than an "C array"
//! [NbVSurfaces] [NBUSurfaces] [MaxUDegree+1] [MaxVDegree+1] [3]
//! raises DomainError if <NumCoeffPerSurface> is not a
//! [1, NbVSurfaces*NbUSurfaces, 1,2] array.
//! if <Coefficients> is not a
Standard_EXPORT Convert_GridPolynomialToPoles(const Standard_Integer NbUSurfaces, const Standard_Integer NBVSurfaces, const Standard_Integer UContinuity, const Standard_Integer VContinuity, const Standard_Integer MaxUDegree, const Standard_Integer MaxVDegree, const Handle(TColStd_HArray2OfInteger)& NumCoeffPerSurface, const Handle(TColStd_HArray1OfReal)& Coefficients, const Handle(TColStd_HArray1OfReal)& PolynomialUIntervals, const Handle(TColStd_HArray1OfReal)& PolynomialVIntervals, const Handle(TColStd_HArray1OfReal)& TrueUIntervals, const Handle(TColStd_HArray1OfReal)& TrueVIntervals);
Standard_EXPORT void Perform (const Standard_Integer UContinuity, const Standard_Integer VContinuity, const Standard_Integer MaxUDegree, const Standard_Integer MaxVDegree, const Handle(TColStd_HArray2OfInteger)& NumCoeffPerSurface, const Handle(TColStd_HArray1OfReal)& Coefficients, const Handle(TColStd_HArray1OfReal)& PolynomialUIntervals, const Handle(TColStd_HArray1OfReal)& PolynomialVIntervals, const Handle(TColStd_HArray1OfReal)& TrueUIntervals, const Handle(TColStd_HArray1OfReal)& TrueVIntervals);
Standard_EXPORT Standard_Integer NbUPoles() const;
Standard_EXPORT Standard_Integer NbVPoles() const;
//! returns the poles of the BSpline Surface
Standard_EXPORT const Handle(TColgp_HArray2OfPnt)& Poles() const;
Standard_EXPORT Standard_Integer UDegree() const;
Standard_EXPORT Standard_Integer VDegree() const;
Standard_EXPORT Standard_Integer NbUKnots() const;
Standard_EXPORT Standard_Integer NbVKnots() const;
//! Knots in the U direction
Standard_EXPORT const Handle(TColStd_HArray1OfReal)& UKnots() const;
//! Knots in the V direction
Standard_EXPORT const Handle(TColStd_HArray1OfReal)& VKnots() const;
//! Multiplicities of the knots in the U direction
Standard_EXPORT const Handle(TColStd_HArray1OfInteger)& UMultiplicities() const;
//! Multiplicities of the knots in the V direction
Standard_EXPORT const Handle(TColStd_HArray1OfInteger)& VMultiplicities() const;
Standard_EXPORT Standard_Boolean IsDone() const;
protected:
private:
Standard_EXPORT void BuildArray (const Standard_Integer Degree, const Handle(TColStd_HArray1OfReal)& Knots, const Standard_Integer Continuty, Handle(TColStd_HArray1OfReal)& FlatKnots, Handle(TColStd_HArray1OfInteger)& Mults, Handle(TColStd_HArray1OfReal)& Parameters) const;
Handle(TColStd_HArray1OfReal) myUFlatKnots;
Handle(TColStd_HArray1OfReal) myVFlatKnots;
Handle(TColStd_HArray1OfReal) myUKnots;
Handle(TColStd_HArray1OfReal) myVKnots;
Handle(TColStd_HArray1OfInteger) myUMults;
Handle(TColStd_HArray1OfInteger) myVMults;
Handle(TColgp_HArray2OfPnt) myPoles;
Standard_Integer myUDegree;
Standard_Integer myVDegree;
Standard_Boolean myDone;
};
#endif // _Convert_GridPolynomialToPoles_HeaderFile

View File

@@ -1,43 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class HyperbolaToBSplineCurve from Convert inherits ConicToBSplineCurve
--- Purpose :
-- This algorithm converts a hyperbola into a rational B-spline curve.
-- The hyperbola is an Hypr2d from package gp with the
-- parametrization :
-- P (U) =
-- Loc + (MajorRadius * Cosh(U) * Xdir + MinorRadius * Sinh(U) * Ydir)
-- where Loc is the location point of the hyperbola, Xdir and Ydir are
-- the normalized directions of the local cartesian coordinate system
-- of the hyperbola.
--- KeyWords :
-- Convert, Hyperbola, BSplineCurve, 2D .
uses Hypr2d from gp
is
Create (H : Hypr2d; U1, U2 : Real) returns HyperbolaToBSplineCurve;
--- Purpose :
-- The hyperbola H is limited between the parametric values U1, U2
-- and the equivalent B-spline curve has the same orientation as the
-- hyperbola.
end HyperbolaToBSplineCurve;

View File

@@ -14,18 +14,17 @@
//JCV 16/10/91
#include <Convert_HyperbolaToBSplineCurve.ixx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Convert_HyperbolaToBSplineCurve.hxx>
#include <gp.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Hypr2d.hxx>
#include <gp_Trsf2d.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
static Standard_Integer TheDegree = 2;
static Standard_Integer MaxNbKnots = 2;

View File

@@ -0,0 +1,76 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_HyperbolaToBSplineCurve_HeaderFile
#define _Convert_HyperbolaToBSplineCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ConicToBSplineCurve.hxx>
#include <Standard_Real.hxx>
class gp_Hypr2d;
//! This algorithm converts a hyperbola into a rational B-spline curve.
//! The hyperbola is an Hypr2d from package gp with the
//! parametrization :
//! P (U) =
//! Loc + (MajorRadius * Cosh(U) * Xdir + MinorRadius * Sinh(U) * Ydir)
//! where Loc is the location point of the hyperbola, Xdir and Ydir are
//! the normalized directions of the local cartesian coordinate system
//! of the hyperbola.
//! KeyWords :
//! Convert, Hyperbola, BSplineCurve, 2D .
class Convert_HyperbolaToBSplineCurve : public Convert_ConicToBSplineCurve
{
public:
DEFINE_STANDARD_ALLOC
//! The hyperbola H is limited between the parametric values U1, U2
//! and the equivalent B-spline curve has the same orientation as the
//! hyperbola.
Standard_EXPORT Convert_HyperbolaToBSplineCurve(const gp_Hypr2d& H, const Standard_Real U1, const Standard_Real U2);
protected:
private:
};
#endif // _Convert_HyperbolaToBSplineCurve_HeaderFile

View File

@@ -1,42 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ParabolaToBSplineCurve from Convert inherits ConicToBSplineCurve
--- Purpose :
-- This algorithm converts a parabola into a non rational B-spline
-- curve.
-- The parabola is a Parab2d from package gp with the parametrization
-- P (U) = Loc + F * (U*U * Xdir + 2 * U * Ydir) where Loc is the
-- apex of the parabola, Xdir is the normalized direction of the
-- symmetry axis of the parabola, Ydir is the normalized direction of
-- the directrix and F is the focal length.
--- KeyWords :
-- Convert, Parabola, BSplineCurve, 2D .
uses Parab2d from gp
is
Create (Prb : Parab2d; U1, U2 : Real) returns ParabolaToBSplineCurve;
--- Purpose :
-- The parabola Prb is limited between the parametric values U1, U2
-- and the equivalent B-spline curve as the same orientation as the
-- parabola Prb.
end ParabolaToBSplineCurve;

View File

@@ -14,18 +14,17 @@
//JCV 16/10/91
#include <Convert_ParabolaToBSplineCurve.ixx>
#include <Convert_ParabolaToBSplineCurve.hxx>
#include <gp.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Trsf2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
static Standard_Integer TheDegree = 2;
static Standard_Integer MaxNbKnots = 2;

View File

@@ -0,0 +1,75 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_ParabolaToBSplineCurve_HeaderFile
#define _Convert_ParabolaToBSplineCurve_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ConicToBSplineCurve.hxx>
#include <Standard_Real.hxx>
class gp_Parab2d;
//! This algorithm converts a parabola into a non rational B-spline
//! curve.
//! The parabola is a Parab2d from package gp with the parametrization
//! P (U) = Loc + F * (U*U * Xdir + 2 * U * Ydir) where Loc is the
//! apex of the parabola, Xdir is the normalized direction of the
//! symmetry axis of the parabola, Ydir is the normalized direction of
//! the directrix and F is the focal length.
//! KeyWords :
//! Convert, Parabola, BSplineCurve, 2D .
class Convert_ParabolaToBSplineCurve : public Convert_ConicToBSplineCurve
{
public:
DEFINE_STANDARD_ALLOC
//! The parabola Prb is limited between the parametric values U1, U2
//! and the equivalent B-spline curve as the same orientation as the
//! parabola Prb.
Standard_EXPORT Convert_ParabolaToBSplineCurve(const gp_Parab2d& Prb, const Standard_Real U1, const Standard_Real U2);
protected:
private:
};
#endif // _Convert_ParabolaToBSplineCurve_HeaderFile

View File

@@ -0,0 +1,96 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_ParameterisationType_HeaderFile
#define _Convert_ParameterisationType_HeaderFile
//! Identifies a type of parameterization of a circle or ellipse represented as a BSpline curve.
//! For a circle with a center C and a radius R (for example a Geom2d_Circle or a Geom_Circle),
//! the natural parameterization is angular. It uses the angle Theta made by the vector CM with
//! the 'X Axis' of the circle's local coordinate system as parameter for the current point M. The
//! coordinates of the point M are as follows:
//! X = R *cos ( Theta )
//! y = R * sin ( Theta )
//! Similarly, for an ellipse with a center C, a major radius R and a minor radius r, the circle Circ
//! with center C and radius R (and located in the same plane as the ellipse) lends its natural
//! angular parameterization to the ellipse. This is achieved by an affine transformation in the plane
//! of the ellipse, in the ratio r / R, about the 'X Axis' of its local coordinate system. The
//! coordinates of the current point M are as follows:
//! X = R * cos ( Theta )
//! y = r * sin ( Theta )
//! The process of converting a circle or an ellipse into a rational or non-rational BSpline curve
//! transforms the Theta angular parameter into a parameter t. This ensures the rational or
//! polynomial parameterization of the resulting BSpline curve. Several types of parametric
//! transformations are available.
//! TgtThetaOver2
//! The most usual method is Convert_TgtThetaOver2 where the parameter t on the BSpline
//! curve is obtained by means of transformation of the following type:
//! t = tan ( Theta / 2 )
//! The result of this definition is:
//! cos ( Theta ) = ( 1. - t**2 ) / ( 1. + t**2 )
//! sin ( Theta ) = 2. * t / ( 1. + t**2 )
//! which ensures the rational parameterization of the circle or the ellipse. However, this is not the
//! most suitable parameterization method where the arc of the circle or ellipse has a large opening
//! angle. In such cases, the curve will be represented by a BSpline with intermediate knots. Each
//! span, i.e. each portion of curve between two different knot values, will use parameterization of
//! this type.
//! The number of spans is calculated using the following rule:
//! ( 1.2 * Delta / Pi ) + 1
//! where Delta is equal to the opening angle (in radians) of the arc of the circle (Delta is
//! equal to 2.* Pi in the case of a complete circle).
//! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
//! curve gives an exact point on the circle or the ellipse.
//! TgtThetaOver2_N
//! Where N is equal to 1, 2, 3 or 4, this ensures the same type of parameterization as
//! Convert_TgtThetaOver2 but sets the number of spans in the resulting BSpline curve to N
//! rather than allowing the algorithm to make this calculation.
//! However, the opening angle Delta (parametric angle, given in radians) of the arc of the circle
//! (or of the ellipse) must comply with the following:
//! - Delta <= 0.9999 * Pi for the Convert_TgtThetaOver2_1 method, or
//! - Delta <= 1.9999 * Pi for the Convert_TgtThetaOver2_2 method.
//! QuasiAngular
//! The Convert_QuasiAngular method of parameterization uses a different type of rational
//! parameterization. This method ensures that the parameter t along the resulting BSpline curve is
//! very close to the natural parameterization angle Theta of the circle or ellipse (i.e. which uses
//! the functions sin ( Theta ) and cos ( Theta ).
//! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
//! curve gives an exact point on the circle or the ellipse.
//! RationalC1
//! The Convert_RationalC1 method of parameterization uses a further type of rational
//! parameterization. This method ensures that the equation relating to the resulting BSpline curve
//! has a "C1" continuous denominator, which is not the case with the above methods. RationalC1
//! enhances the degree of continuity at the junction point of the different spans of the curve.
//! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
//! curve gives an exact point on the circle or the ellipse.
//! Polynomial
//! The Convert_Polynomial method is used to produce polynomial (i.e. non-rational)
//! parameterization of the resulting BSpline curve with 8 poles (i.e. a polynomial degree equal to 7).
//! However, the result is an approximation of the circle or ellipse (i.e. computing the point of
//! parameter t on the BSpline curve does not give an exact point on the circle or the ellipse).
enum Convert_ParameterisationType
{
Convert_TgtThetaOver2,
Convert_TgtThetaOver2_1,
Convert_TgtThetaOver2_2,
Convert_TgtThetaOver2_3,
Convert_TgtThetaOver2_4,
Convert_QuasiAngular,
Convert_RationalC1,
Convert_Polynomial
};
#endif // _Convert_ParameterisationType_HeaderFile

View File

@@ -0,0 +1,25 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_SequenceOfArray1OfPoles2d_HeaderFile
#define _Convert_SequenceOfArray1OfPoles2d_HeaderFile
#include <TColgp_SequenceOfArray1OfPnt2d.hxx>
typedef TColgp_SequenceOfArray1OfPnt2d Convert_SequenceOfArray1OfPoles2d;
#endif // _Convert_SequenceOfArray1OfPoles2d_HeaderFile

View File

@@ -1,75 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class SphereToBSplineSurface from Convert
--- Purpose :
-- This algorithm converts a bounded Sphere into a rational
-- B-spline surface. The sphere is a Sphere from package gp.
-- The parametrization of the sphere is
-- P (U, V) = Loc + Radius * Sin(V) * Zdir +
-- Radius * Cos(V) * (Cos(U)*Xdir + Sin(U)*Ydir)
-- where Loc is the center of the sphere Xdir, Ydir and Zdir are the
-- normalized directions of the local cartesian coordinate system of
-- the sphere. The parametrization range is U [0, 2PI] and
-- V [-PI/2, PI/2].
--- KeyWords :
-- Convert, Sphere, BSplineSurface.
inherits ElementarySurfaceToBSplineSurface
uses Sphere from gp
raises DomainError from Standard
is
Create (Sph : Sphere; U1, U2, V1, V2 : Real) returns SphereToBSplineSurface
--- Purpose :
-- The equivalent B-spline surface as the same orientation as the
-- sphere in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
-- Raised if V1 = V2.
Create (Sph : Sphere;
Param1, Param2 : Real;
UTrim : Boolean = Standard_True)
returns SphereToBSplineSurface
--- Purpose :
-- The equivalent B-spline surface as the same orientation
-- as the sphere in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if UTrim = True and Param1 = Param2 or
-- Param1 = Param2 + 2.0 * Pi
-- Raised if UTrim = False and Param1 = Param2
Create (Sph : Sphere) returns SphereToBSplineSurface;
--- Purpose :
-- The equivalent B-spline surface as the same orientation
-- as the sphere in the U and V parametric directions.
end SphereToBSplineSurface;

View File

@@ -14,10 +14,11 @@
//JCV 16/10/91
#include <Convert_SphereToBSplineSurface.ixx>
#include <Convert_SphereToBSplineSurface.hxx>
#include <gp.hxx>
#include <gp_Sphere.hxx>
#include <gp_Trsf.hxx>
#include <Standard_DomainError.hxx>
static const Standard_Integer TheUDegree = 2;
static const Standard_Integer TheVDegree = 2;

View File

@@ -0,0 +1,95 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_SphereToBSplineSurface_HeaderFile
#define _Convert_SphereToBSplineSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ElementarySurfaceToBSplineSurface.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Standard_DomainError;
class gp_Sphere;
//! This algorithm converts a bounded Sphere into a rational
//! B-spline surface. The sphere is a Sphere from package gp.
//! The parametrization of the sphere is
//! P (U, V) = Loc + Radius * Sin(V) * Zdir +
//! Radius * Cos(V) * (Cos(U)*Xdir + Sin(U)*Ydir)
//! where Loc is the center of the sphere Xdir, Ydir and Zdir are the
//! normalized directions of the local cartesian coordinate system of
//! the sphere. The parametrization range is U [0, 2PI] and
//! V [-PI/2, PI/2].
//! KeyWords :
//! Convert, Sphere, BSplineSurface.
class Convert_SphereToBSplineSurface : public Convert_ElementarySurfaceToBSplineSurface
{
public:
DEFINE_STANDARD_ALLOC
//! The equivalent B-spline surface as the same orientation as the
//! sphere in the U and V parametric directions.
//!
//! Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
//! Raised if V1 = V2.
Standard_EXPORT Convert_SphereToBSplineSurface(const gp_Sphere& Sph, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2);
//! The equivalent B-spline surface as the same orientation
//! as the sphere in the U and V parametric directions.
//!
//! Raised if UTrim = True and Param1 = Param2 or
//! Param1 = Param2 + 2.0 * Pi
//! Raised if UTrim = False and Param1 = Param2
Standard_EXPORT Convert_SphereToBSplineSurface(const gp_Sphere& Sph, const Standard_Real Param1, const Standard_Real Param2, const Standard_Boolean UTrim = Standard_True);
//! The equivalent B-spline surface as the same orientation
//! as the sphere in the U and V parametric directions.
Standard_EXPORT Convert_SphereToBSplineSurface(const gp_Sphere& Sph);
protected:
private:
};
#endif // _Convert_SphereToBSplineSurface_HeaderFile

View File

@@ -1,72 +0,0 @@
-- Created on: 1991-10-10
-- Created by: Jean Claude VAUTHIER
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class TorusToBSplineSurface from Convert
--- Purpose :
-- This algorithm converts a bounded Torus into a rational
-- B-spline surface. The torus is a Torus from package gp.
-- The parametrization of the torus is :
-- P (U, V) =
-- Loc + MinorRadius * Sin(V) * Zdir +
-- (MajorRadius+MinorRadius*Cos(V)) * (Cos(U)*Xdir + Sin(U)*Ydir)
-- where Loc is the center of the torus, Xdir, Ydir and Zdir are the
-- normalized directions of the local cartesian coordinate system of
-- the Torus. The parametrization range is U [0, 2PI], V [0, 2PI].
--- KeyWords :
-- Convert, Torus, BSplineSurface.
inherits ElementarySurfaceToBSplineSurface
uses Torus from gp
raises DomainError from Standard
is
Create (T : Torus; U1, U2, V1, V2 : Real) returns TorusToBSplineSurface
--- Purpose :
-- The equivalent B-spline surface as the same orientation as the
-- torus in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
-- Raised if V1 = V2 or V1 = V2 + 2.0 * Pi
Create (T : Torus;
Param1, Param2 : Real;
UTrim : Boolean = Standard_True)
returns TorusToBSplineSurface
--- Purpose :
-- The equivalent B-spline surface as the same orientation as the
-- torus in the U and V parametric directions.
raises DomainError;
--- Purpose :
-- Raised if Param1 = Param2 or Param1 = Param2 + 2.0 * Pi
Create (T : Torus) returns TorusToBSplineSurface;
--- Purpose :
-- The equivalent B-spline surface as the same orientation as the
-- torus in the U and V parametric directions.
end TorusToBSplineSurface;

View File

@@ -14,10 +14,11 @@
//JCV 16/10/91
#include <Convert_TorusToBSplineSurface.ixx>
#include <Convert_TorusToBSplineSurface.hxx>
#include <gp.hxx>
#include <gp_Torus.hxx>
#include <gp_Trsf.hxx>
#include <Standard_DomainError.hxx>
static const Standard_Integer TheUDegree = 2;
static const Standard_Integer TheVDegree = 2;

View File

@@ -0,0 +1,93 @@
// Created on: 1991-10-10
// Created by: Jean Claude VAUTHIER
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Convert_TorusToBSplineSurface_HeaderFile
#define _Convert_TorusToBSplineSurface_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Convert_ElementarySurfaceToBSplineSurface.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Standard_DomainError;
class gp_Torus;
//! This algorithm converts a bounded Torus into a rational
//! B-spline surface. The torus is a Torus from package gp.
//! The parametrization of the torus is :
//! P (U, V) =
//! Loc + MinorRadius * Sin(V) * Zdir +
//! (MajorRadius+MinorRadius*Cos(V)) * (Cos(U)*Xdir + Sin(U)*Ydir)
//! where Loc is the center of the torus, Xdir, Ydir and Zdir are the
//! normalized directions of the local cartesian coordinate system of
//! the Torus. The parametrization range is U [0, 2PI], V [0, 2PI].
//! KeyWords :
//! Convert, Torus, BSplineSurface.
class Convert_TorusToBSplineSurface : public Convert_ElementarySurfaceToBSplineSurface
{
public:
DEFINE_STANDARD_ALLOC
//! The equivalent B-spline surface as the same orientation as the
//! torus in the U and V parametric directions.
//!
//! Raised if U1 = U2 or U1 = U2 + 2.0 * Pi
//! Raised if V1 = V2 or V1 = V2 + 2.0 * Pi
Standard_EXPORT Convert_TorusToBSplineSurface(const gp_Torus& T, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2);
//! The equivalent B-spline surface as the same orientation as the
//! torus in the U and V parametric directions.
//!
//! Raised if Param1 = Param2 or Param1 = Param2 + 2.0 * Pi
Standard_EXPORT Convert_TorusToBSplineSurface(const gp_Torus& T, const Standard_Real Param1, const Standard_Real Param2, const Standard_Boolean UTrim = Standard_True);
//! The equivalent B-spline surface as the same orientation as the
//! torus in the U and V parametric directions.
Standard_EXPORT Convert_TorusToBSplineSurface(const gp_Torus& T);
protected:
private:
};
#endif // _Convert_TorusToBSplineSurface_HeaderFile

View File

@@ -1,4 +1,34 @@
Convert_CircleToBSplineCurve.cxx
Convert_CircleToBSplineCurve.hxx
Convert_CompBezierCurves2dToBSplineCurve2d.cxx
Convert_CompBezierCurves2dToBSplineCurve2d.hxx
Convert_CompBezierCurvesToBSplineCurve.cxx
Convert_CompBezierCurvesToBSplineCurve.hxx
Convert_CompPolynomialToPoles.cxx
Convert_CompPolynomialToPoles.hxx
Convert_ConeToBSplineSurface.cxx
Convert_ConeToBSplineSurface.hxx
Convert_ConicToBSplineCurve.cxx
Convert_ConicToBSplineCurve.hxx
Convert_CosAndSinEvalFunction.hxx
Convert_PolynomialCosAndSin.hxx
Convert_CylinderToBSplineSurface.cxx
Convert_CylinderToBSplineSurface.hxx
Convert_ElementarySurfaceToBSplineSurface.cxx
Convert_ElementarySurfaceToBSplineSurface.hxx
Convert_EllipseToBSplineCurve.cxx
Convert_EllipseToBSplineCurve.hxx
Convert_GridPolynomialToPoles.cxx
Convert_GridPolynomialToPoles.hxx
Convert_HyperbolaToBSplineCurve.cxx
Convert_HyperbolaToBSplineCurve.hxx
Convert_ParabolaToBSplineCurve.cxx
Convert_ParabolaToBSplineCurve.hxx
Convert_ParameterisationType.hxx
Convert_PolynomialCosAndSin.cxx
Convert_PolynomialCosAndSin.hxx
Convert_SequenceOfArray1OfPoles.hxx
Convert_SequenceOfArray1OfPoles2d.hxx
Convert_SphereToBSplineSurface.cxx
Convert_SphereToBSplineSurface.hxx
Convert_TorusToBSplineSurface.cxx
Convert_TorusToBSplineSurface.hxx